= (args) => (
11 |
12 |
13 | Link
14 |
15 | Link
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/apps/storybook/stories/loading/loading.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Loading, LoadingProps } from "@illa-design/react"
3 |
4 | export default {
5 | title: "GENERAL/Loading",
6 | component: Loading,
7 | } as Meta
8 |
9 | const Template: StoryFn = (args) => {
10 | return
11 | }
12 |
13 | export const Basic = Template.bind({})
14 |
--------------------------------------------------------------------------------
/apps/storybook/stories/popconfirm/popconfirm.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Button, PopConfirm, PopconfirmProps } from "@illa-design/react"
3 |
4 | //👇 This default export determines where your story goes in the story list
5 | export default {
6 | title: "FEEDBACK/PopConfirm",
7 | component: PopConfirm,
8 | argTypes: {
9 | icon: {
10 | control: false,
11 | },
12 | },
13 | } as Meta
14 |
15 | export const Basic: StoryFn = (args) => (
16 |
17 |
18 |
19 |
20 |
21 | )
22 |
--------------------------------------------------------------------------------
/apps/storybook/stories/popover/popover.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Button, Popover, PopoverProps } from "@illa-design/react"
3 |
4 | //👇 This default export determines where your story goes in the story list
5 | export default {
6 | title: "DATA DISPLAY/Popover",
7 | component: Popover,
8 | argTypes: {
9 | content: {
10 | type: "string",
11 | },
12 | },
13 | } as Meta
14 |
15 | export const Basic: StoryFn = (args) => (
16 |
17 |
18 |
19 |
20 |
21 | )
22 |
--------------------------------------------------------------------------------
/apps/storybook/stories/progress/progress.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Space, Progress, ProgressProps } from "@illa-design/react"
3 |
4 | //👇 This default export determines where your story goes in the story list
5 | export default {
6 | title: "FEEDBACK/Progress",
7 | component: Progress,
8 | } as Meta
9 |
10 | export const Basic: StoryFn = (args) => (
11 |
12 |
13 |
14 |
15 |
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/apps/storybook/stories/radio/radio.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Radio, RadioProps } from "@illa-design/react"
3 | import { BsFacebook } from "react-icons/bs"
4 |
5 | //👇 This default export determines where your story goes in the story list
6 | export default {
7 | title: "DATA INPUT/Radio",
8 | component: Radio,
9 | } as Meta
10 |
11 | const Template: StoryFn = (args) => ILLA
12 |
13 | export const Basic = Template.bind({
14 | icon: ,
15 | })
16 |
--------------------------------------------------------------------------------
/apps/storybook/stories/rate/rate.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Space, RateProps, Rate } from "@illa-design/react"
3 |
4 | export default {
5 | title: "DATA INPUT/Rate",
6 | component: Rate,
7 | argTypes: {
8 | character: {
9 | control: false,
10 | },
11 | },
12 | } as Meta
13 |
14 | const Template: StoryFn = (args) => {
15 | return (
16 |
17 |
18 |
19 |
20 | )
21 | }
22 |
23 | export const Basic = Template.bind({})
24 |
25 | Basic.args = {
26 | tooltips: ["👌", "❤️", "🤔", "😊", "😄"],
27 | }
28 |
--------------------------------------------------------------------------------
/apps/storybook/stories/result/result.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Result, ResultProps } from "@illa-design/react"
3 |
4 | export default {
5 | title: "FEEDBACK/Result",
6 | component: Result,
7 | argTypes: {
8 | extra: {
9 | control: false,
10 | },
11 | icon: {
12 | control: false,
13 | },
14 | subTitle: {
15 | control: false,
16 | },
17 | title: {
18 | control: false,
19 | },
20 | },
21 | parameters: {
22 | docs: {
23 | source: {
24 | type: "code",
25 | },
26 | },
27 | },
28 | } as Meta
29 |
30 | const Template: StoryFn = (props) => {
31 | return
32 | }
33 |
34 | export const Basic = Template.bind({})
35 |
--------------------------------------------------------------------------------
/apps/storybook/stories/slider/slider.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Slider, SliderProps } from "@illa-design/react"
3 |
4 | export default {
5 | title: "DATA INPUT/Slider",
6 | component: Slider,
7 | argTypes: {
8 | checkedIcon: {
9 | control: false,
10 | },
11 | uncheckedIcon: {
12 | control: false,
13 | },
14 | },
15 | } as Meta
16 |
17 | const Template: StoryFn = (args) => {
18 | return (
19 | <>
20 |
26 |
27 |
28 |
29 | >
30 | )
31 | }
32 |
33 | export const Basic = Template.bind({})
34 |
--------------------------------------------------------------------------------
/apps/storybook/stories/space/space.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Space, SpaceProps, Tag } from "@illa-design/react"
3 |
4 | //👇 This default export determines where your story goes in the story list
5 | export default {
6 | title: "Layout/Space",
7 |
8 | component: Space,
9 | } as Meta
10 |
11 | const Template: StoryFn = (props) => {
12 | return (
13 |
19 | B
20 | 我
21 | English
22 | 开
23 |
24 | )
25 | }
26 |
27 | export const Basic = Template.bind({})
28 |
--------------------------------------------------------------------------------
/apps/storybook/stories/spin/spin.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Spin, SpinProps } from "@illa-design/react"
3 | import { css } from "@emotion/react"
4 |
5 | //👇 This default export determines where your story goes in the story list
6 | export default {
7 | title: "Feedback/Spin",
8 | component: Spin,
9 | argTypes: {
10 | icon: {
11 | control: false,
12 | },
13 | element: {
14 | control: false,
15 | },
16 | tip: {
17 | control: {
18 | type: "text",
19 | },
20 | },
21 | },
22 | } as Meta
23 |
24 | const Template: StoryFn = (props) => {
25 | return (
26 |
27 |
34 |
35 | )
36 | }
37 |
38 | export const Basic = Template.bind({})
39 |
--------------------------------------------------------------------------------
/apps/storybook/stories/statistic/countdown.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Space, CountDownProps, Countdown } from "@illa-design/react"
3 |
4 | export default {
5 | title: "DATA DISPLAY/Countdown",
6 | component: Countdown,
7 | } as Meta
8 |
9 | const Template: StoryFn = (args) => {
10 | return (
11 |
12 |
13 |
14 | )
15 | }
16 |
17 | export const Basic = Template.bind({})
18 | Basic.args = {
19 | title: "",
20 | value: Date.now() + 1000 * 20,
21 | now: Date.now(),
22 | }
23 |
--------------------------------------------------------------------------------
/apps/storybook/stories/time-picker/date-picker.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import {
3 | TimePicker as TimePickerInStory,
4 | TimePickerProps,
5 | } from "@illa-design/react"
6 |
7 | export default {
8 | title: "DATA INPUT/TimePicker",
9 | component: TimePickerInStory,
10 | } as Meta
11 |
12 | export const TimePicker: StoryFn = (args) => {
13 | return
14 | }
15 |
--------------------------------------------------------------------------------
/apps/storybook/stories/time-picker/range-picker.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import {
3 | RangePicker as RangePickerInStory,
4 | RangePickerProps,
5 | } from "@illa-design/react"
6 |
7 | export default {
8 | title: "DATA INPUT/TimePicker",
9 | component: RangePickerInStory,
10 | } as Meta
11 |
12 | export const RangePickerStory: StoryFn = (args) => {
13 | return
14 | }
15 |
--------------------------------------------------------------------------------
/apps/storybook/stories/timeline/timeline.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Timeline, TimelineProps, TimelineItem } from "@illa-design/react"
3 |
4 | export default {
5 | title: "DATA DISPLAY/Timeline",
6 | component: Timeline,
7 | argTypes: {
8 | pending: {
9 | control: false,
10 | },
11 | pendingDot: {
12 | control: false,
13 | },
14 | },
15 | } as Meta
16 |
17 | const Template: StoryFn = (props) => {
18 | return (
19 |
20 | The first milestone
21 | The second milestone
22 | The third milestone
23 |
24 | )
25 | }
26 |
27 | export const Basic = Template.bind({})
28 |
--------------------------------------------------------------------------------
/apps/storybook/stories/typography/text.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { Text, TextProps, Typography } from "@illa-design/react"
3 |
4 | //👇 This default export determines where your story goes in the story list
5 | export default {
6 | title: "General/Typography/Text",
7 | component: Text,
8 | } as Meta
9 |
10 | export const Basic: StoryFn = (args) => (
11 |
12 | Hello Text
13 |
14 | )
15 |
--------------------------------------------------------------------------------
/commitlint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ["@commitlint/config-conventional"],
3 | }
4 |
--------------------------------------------------------------------------------
/crowdin.yml:
--------------------------------------------------------------------------------
1 | files:
2 | - source: packages/**/README.md
3 | translation: packages/**/README_%language%.md
4 |
--------------------------------------------------------------------------------
/cypress.json:
--------------------------------------------------------------------------------
1 | {
2 | "viewportWidth": 1000,
3 | "viewportHeight": 1000,
4 | "scrollBehavior": false,
5 | "component": {
6 | "testFiles": "**/tests/*.e2e.{ts,tsx}",
7 | "componentFolder": "packages"
8 | },
9 | "defaultCommandTimeout": 20000
10 | }
11 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | testEnvironment: "jsdom",
3 | coverageDirectory: "./jest-coverage/",
4 | coverageReporters: ["lcov"],
5 | collectCoverage: true,
6 | coverageProvider: "v8",
7 | collectCoverageFrom: [
8 | "packages/**/src/**/*.(ts|tsx)",
9 | "!packages/react/src/*.(ts|tsx)",
10 | "!packages/**/src/index.(ts|tsx)",
11 | "!packages/table/src/types/*.(ts|tsx)",
12 | "!packages/**/src/**/*.d.ts",
13 | ],
14 | moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
15 | modulePathIgnorePatterns: ["/examples"],
16 | setupFilesAfterEnv: ["/setup-jest.js"],
17 | snapshotSerializers: ["@emotion/jest/serializer"],
18 | testPathIgnorePatterns: [
19 | "/node_modules/",
20 | "/plop-templates/",
21 | ],
22 | transform: {
23 | "^.+\\.(ts|tsx)$": ["ts-jest", { tsconfig: "tsconfig.json" }],
24 | },
25 | preset: "ts-jest",
26 | }
27 |
--------------------------------------------------------------------------------
/packages/affix/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/affix/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./affix"
2 | export * from "./interface"
3 | export * from "./style"
4 |
--------------------------------------------------------------------------------
/packages/affix/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export interface AffixProps
5 | extends Omit, "onChange">,
6 | BoxProps {
7 | offsetTop?: number
8 | offsetBottom?: number
9 | target?: () => HTMLElement | null | Window
10 | targetContainer?: () => HTMLElement | null | Window
11 | onChange?: (isFixed: boolean) => void
12 | }
13 |
14 | export interface AffixFixedValue {
15 | isFixed: boolean
16 | position: PositionValue
17 | }
18 |
19 | export interface PositionValue {
20 | type: "top" | "bottom"
21 | offset: number
22 | }
23 |
--------------------------------------------------------------------------------
/packages/affix/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css, SerializedStyles } from "@emotion/react"
2 | import { AffixFixedValue, PositionValue } from "./interface"
3 |
4 | export function applyFixedPosition(
5 | positionValue: PositionValue,
6 | ): SerializedStyles {
7 | return css`
8 | position: fixed;
9 | ${positionValue.type}: ${positionValue.offset}px
10 | `
11 | }
12 |
13 | export function applySize(w: number, h: number): SerializedStyles {
14 | return css`
15 | width: ${w}px;
16 | height: ${h}px;
17 | `
18 | }
19 |
20 | export function applyAffixFixedStyle(
21 | affixFixedValue: AffixFixedValue,
22 | w: number,
23 | h: number,
24 | ): SerializedStyles {
25 | if (affixFixedValue.isFixed) {
26 | return css`
27 | ${applyFixedPosition(affixFixedValue.position)};
28 | ${applySize(w, h)}
29 | `
30 | }
31 |
32 | return css``
33 | }
34 |
--------------------------------------------------------------------------------
/packages/affix/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/affix/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/alert/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./alert"
2 | export * from "./interface"
3 | export * from "./style"
4 |
--------------------------------------------------------------------------------
/packages/alert/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, MouseEvent, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type AlertType = "info" | "success" | "warning" | "error"
5 |
6 | export interface AlertProps
7 | extends Omit, "title" | "content">,
8 | BoxProps {
9 | action?: ReactNode
10 | closable?: boolean
11 | showIcon?: boolean
12 | banner?: boolean
13 | type?: AlertType
14 | onClose?: (event: MouseEvent) => void
15 | afterClose?: () => void
16 | title?: ReactNode
17 | content?: ReactNode
18 | icon?: ReactNode
19 | closeElement?: ReactNode
20 | }
21 |
--------------------------------------------------------------------------------
/packages/alert/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/alert/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/avatar/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/avatar/src/avatar-group-context.tsx:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 | import { AvatarGroupContextProps } from "./interface"
3 |
4 | export const AvatarGroupContext = createContext<
5 | AvatarGroupContextProps | undefined
6 | >(undefined)
7 |
8 | AvatarGroupContext.displayName = "AvatarGroupContext"
9 |
--------------------------------------------------------------------------------
/packages/avatar/src/img-avatar.tsx:
--------------------------------------------------------------------------------
1 | import { FC } from "react"
2 | import { AvatarProps } from "./interface"
3 | import { applyAvatarSize, applyShape } from "./style"
4 | import { Image } from "@illa-design/image"
5 |
6 | export const ImgAvatar: FC = (props) => {
7 | const { size = "small", shape = "circle" } = props
8 |
9 | const [width, height] = applyAvatarSize(size)
10 | return (
11 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/packages/avatar/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./avatar"
2 | export * from "./interface"
3 | export * from "./avatar-group-context"
4 | export * from "./avatar-group"
5 |
--------------------------------------------------------------------------------
/packages/avatar/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/avatar/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/back-top/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/back-top/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./back-top"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/back-top/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export interface BackTopProps extends HTMLAttributes, BoxProps {
5 | visibleHeight?: number
6 | target?: () => HTMLElement | Window
7 | onClick?: () => void
8 | easing?: string
9 | duration?: number
10 | children?: ReactNode
11 | }
12 |
--------------------------------------------------------------------------------
/packages/back-top/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css, SerializedStyles } from "@emotion/react"
2 |
3 | export function applyFixedStyle(right: number = 40, bottom: number = 40) {
4 | return css`
5 | position: fixed;
6 | right: ${right}px;
7 | bottom: ${bottom}px;
8 | `
9 | }
10 |
11 | export const pointerStyle = css`
12 | cursor: pointer;
13 | `
14 |
15 | export function applyOpacity(visible: boolean): SerializedStyles {
16 | return css`
17 | opacity: ${visible ? 1 : 0};
18 | `
19 | }
20 |
21 | export const opacityTransition = css`
22 | transition: opacity 0.2s ease-in;
23 | `
24 |
--------------------------------------------------------------------------------
/packages/back-top/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/back-top/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/badge/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/badge/src/count.tsx:
--------------------------------------------------------------------------------
1 | import usePrevious from "./usePrevious"
2 | import { CountProps } from "./interface"
3 | import { deleteCssProps, globalColor, illaPrefix } from "@illa-design/theme"
4 | import { applyBadgeNumberOrText, applyBadgeScale } from "./style"
5 | import { Key } from "react"
6 |
7 | const defaultColor = globalColor(`--${illaPrefix}-red-03`)
8 | export function Count(props: CountProps) {
9 | const { count, color = defaultColor, hasChildren, ...restProps } = props
10 | const oldCount = usePrevious(count)
11 | const isChanged = count !== oldCount
12 |
13 | return (
14 |
22 |
23 | {count}
24 |
25 |
26 | )
27 | }
28 |
--------------------------------------------------------------------------------
/packages/badge/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./badge"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/badge/src/usePrevious.tsx:
--------------------------------------------------------------------------------
1 | // thx arco
2 | import { ComponentState, PropsWithoutRef, useEffect, useRef } from "react"
3 |
4 | export default function usePrevious(
5 | value: PropsWithoutRef | ComponentState,
6 | ) {
7 | const ref = useRef()
8 | useEffect(() => {
9 | ref.current = value
10 | })
11 | return ref.current
12 | }
13 |
--------------------------------------------------------------------------------
/packages/badge/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/badge/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/breadcrumb/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/breadcrumb/src/breadcrumb-context.ts:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 |
3 | export interface BreadcrumbContextProps {
4 | onClickPath?: (path: string, last: boolean) => void
5 | blockRouterChange?: boolean
6 | }
7 |
8 | export const BreadcrumbContext = createContext({})
9 |
--------------------------------------------------------------------------------
/packages/breadcrumb/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./breadcrumb"
2 | export * from "./breadcrumbItem"
3 | export * from "./interface"
4 |
--------------------------------------------------------------------------------
/packages/breadcrumb/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { DropdownProps } from "@illa-design/dropdown"
3 | import { BoxProps } from "@illa-design/theme"
4 |
5 | export type RouteProps = {
6 | path?: string
7 | breadcrumbName?: string
8 | children?: {
9 | path?: string
10 | breadcrumbName?: string
11 | }[]
12 | }
13 |
14 | export interface BreadcrumbProps
15 | extends HTMLAttributes,
16 | BoxProps {
17 | separator?: string | ReactNode
18 | routes?: RouteProps[]
19 | blockRouterChange?: boolean
20 | maxCount?: number
21 | onClickPath?: (path: string, last: boolean) => void
22 | }
23 |
24 | export interface BreadcrumbItemProps
25 | extends HTMLAttributes,
26 | BoxProps {
27 | last?: boolean
28 | href?: string
29 | blockRouterChange?: boolean
30 | dropList?: ReactNode
31 | dropdownProps?: DropdownProps
32 | }
33 |
--------------------------------------------------------------------------------
/packages/breadcrumb/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/breadcrumb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/button/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/button/src/button-group-context.tsx:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 | import { ButtonGroupContextProps } from "./interface"
3 |
4 | export const ButtonGroupContext = createContext<
5 | ButtonGroupContextProps | undefined
6 | >(undefined)
7 |
8 | ButtonGroupContext.displayName = "ButtonGroupContext"
9 |
--------------------------------------------------------------------------------
/packages/button/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./button"
2 | export * from "./button-group-context"
3 | export * from "./button-group"
4 | export * from "./interface"
5 |
--------------------------------------------------------------------------------
/packages/button/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/button/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/calendar/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/packages/calendar/src/calendar.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef, useEffect } from "react"
2 | import { CalendarProps } from "./interface"
3 | import * as dayjs from "dayjs"
4 | import utc from "dayjs/plugin/utc"
5 | import timezone from "dayjs/plugin/timezone"
6 | import { CardCalendar } from "./card-calendar"
7 | import { CompleteCalendar } from "./complete-calendar"
8 |
9 | export const Calendar = forwardRef(
10 | (props, ref) => {
11 | const { panel } = props
12 |
13 | useEffect(() => {
14 | dayjs.extend(utc)
15 | dayjs.extend(timezone)
16 | // eslint-disable-next-line import/namespace
17 | dayjs.tz.guess()
18 | }, [])
19 |
20 | if (panel) {
21 | return
22 | } else {
23 | return
24 | }
25 | },
26 | )
27 |
28 | Calendar.displayName = "Calendar"
29 |
--------------------------------------------------------------------------------
/packages/calendar/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./calendar"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/calendar/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css, SerializedStyles } from "@emotion/react"
2 | import { getColor } from "@illa-design/theme"
3 |
4 | export function applyDividerStyle(): SerializedStyles {
5 | return css`
6 | width: 100%;
7 | border-top: 1px solid ${getColor("grayBlue", "08")};
8 | `
9 | }
10 |
--------------------------------------------------------------------------------
/packages/calendar/src/util.ts:
--------------------------------------------------------------------------------
1 | import { def, Locale } from "@illa-design/config-provider"
2 |
3 | export function getMonthString(
4 | month: number,
5 | locale: Record,
6 | ): string {
7 | switch (month) {
8 | case 0:
9 | return locale["January"]
10 | case 1:
11 | return locale["February"]
12 | case 2:
13 | return locale["March"]
14 | case 3:
15 | return locale["April"]
16 | case 4:
17 | return locale["May"]
18 | case 5:
19 | return locale["June"]
20 | case 6:
21 | return locale["July"]
22 | case 7:
23 | return locale["August"]
24 | case 8:
25 | return locale["September"]
26 | case 9:
27 | return locale["October"]
28 | case 10:
29 | return locale["November"]
30 | case 11:
31 | return locale["December"]
32 | default:
33 | return ""
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/packages/calendar/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/calendar/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/card/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/card/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./card"
2 | export * from "./interface"
3 | export * from "./card-meta"
4 |
--------------------------------------------------------------------------------
/packages/card/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type CardSize = "small" | "medium"
5 |
6 | export interface CardProps
7 | extends Omit, "title">,
8 | BoxProps {
9 | size?: CardSize
10 | hoverable?: boolean
11 | bordered?: boolean
12 | title?: ReactNode
13 | extra?: ReactNode
14 | }
15 |
16 | export interface CardMetaProps
17 | extends Omit, "title">,
18 | BoxProps {
19 | avatar?: ReactNode
20 | size?: CardSize
21 | hoverable?: boolean
22 | bordered?: boolean
23 | nickname?: string
24 | title?: ReactNode
25 | cover?: ReactNode
26 | description?: ReactNode
27 | actionList?: ReactNode[]
28 | }
29 |
--------------------------------------------------------------------------------
/packages/card/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/cascader/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/cascader/src/cascader.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef } from "react"
2 | import { CascaderProps } from "./interface"
3 | import { SingleCascader } from "./single-cascader"
4 | import { MultipleCascader } from "./multiple-cascader"
5 |
6 | export const Cascader = forwardRef(
7 | (props, ref) => {
8 | if (props.multiple) {
9 | return
10 | } else {
11 | return
12 | }
13 | },
14 | )
15 |
16 | Cascader.displayName = "Cascader"
17 |
--------------------------------------------------------------------------------
/packages/cascader/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./cascader"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/cascader/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/cascader/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/checkbox/src/context.ts:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 | import { CheckboxGroupProps } from "./interface"
3 |
4 | export const CheckboxGroupContext = createContext({})
5 |
6 | CheckboxGroupContext.displayName = "CheckboxGroupContext"
7 |
--------------------------------------------------------------------------------
/packages/checkbox/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./checkbox"
2 | export * from "./checkbox-group"
3 | export * from "./interface"
4 |
--------------------------------------------------------------------------------
/packages/checkbox/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/checkbox/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/collapse/src/collapse-context.tsx:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 | import { CollapseContextProps } from "./interface"
3 |
4 | export const CollapseContext = createContext(
5 | {} as CollapseContextProps,
6 | )
7 |
8 | CollapseContext.displayName = "CollapseContext"
9 |
--------------------------------------------------------------------------------
/packages/collapse/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./collapse"
2 | export * from "./collapse-item"
3 | export * from "./interface"
4 |
--------------------------------------------------------------------------------
/packages/collapse/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/collapse/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/comment/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/comment/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./comment"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/comment/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export interface CommentProps
5 | extends Omit, "content">,
6 | BoxProps {
7 | actions?: ReactNode
8 | author?: ReactNode | string
9 | avatar?: ReactNode
10 | children?: ReactNode
11 | content?: ReactNode
12 | datetime?: ReactNode | string
13 | align?:
14 | | "left"
15 | | "right"
16 | | { datetime?: "left" | "right"; actions?: "left" | "right" }
17 | placeholder?: string
18 | }
19 |
--------------------------------------------------------------------------------
/packages/comment/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/comment/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/config-provider/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/config-provider/src/config-provider-context.tsx:
--------------------------------------------------------------------------------
1 | import { ConfigProviderProps } from "./interface"
2 |
3 | import { createContext } from "react"
4 | import { def } from "./locale/def"
5 |
6 | export const ConfigProviderContext = createContext({
7 | locale: def,
8 | } as ConfigProviderProps)
9 |
10 | ConfigProviderContext.displayName = "ConfigProviderContext"
11 |
--------------------------------------------------------------------------------
/packages/config-provider/src/config-provider.tsx:
--------------------------------------------------------------------------------
1 | import { FC, useEffect } from "react"
2 | import { ConfigProviderProps } from "./interface"
3 | import { ConfigProviderContext } from "./config-provider-context"
4 | import { setConfigProviderProps } from "./config"
5 |
6 | export const ConfigProvider: FC = (props) => {
7 | const { locale } = props
8 | useEffect(() => {
9 | setConfigProviderProps({ locale })
10 | }, [locale])
11 | return (
12 |
13 | {props.children}
14 |
15 | )
16 | }
17 |
18 | ConfigProvider.displayName = "ConfigProvider"
19 |
--------------------------------------------------------------------------------
/packages/config-provider/src/config.tsx:
--------------------------------------------------------------------------------
1 | import { ConfigProviderProps } from "./interface"
2 |
3 | let configProvider: ConfigProviderProps = {}
4 |
5 | export function setConfigProviderProps(
6 | configProviderProps: ConfigProviderProps,
7 | ) {
8 | configProvider = {
9 | ...configProviderProps,
10 | }
11 | }
12 |
13 | export function getConfigProviderProps() {
14 | return configProvider
15 | }
16 |
--------------------------------------------------------------------------------
/packages/config-provider/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./config-provider"
2 | export * from "./interface"
3 | export * from "./config-provider-context"
4 | export * from "./config"
5 |
6 | // locale
7 | export * from "./locale/def"
8 | export * from "./locale/en-US"
9 | export * from "./locale/zh-CN"
10 | export * from "./locale/ja-JP"
11 | export * from "./locale/ko-KR"
12 | export * from "./locale/cs-CS"
13 | export * from "./locale/de-DE"
14 | export * from "./locale/da-DK"
15 | export * from "./locale/es-ES"
16 | export * from "./locale/el-GR"
17 | export * from "./locale/fi-FI"
18 | export * from "./locale/fr-FR"
19 | export * from "./locale/it-IT"
20 | export * from "./locale/nl-NL"
21 | export * from "./locale/no-NO"
22 | export * from "./locale/pl-PL"
23 | export * from "./locale/pt-PT"
24 | export * from "./locale/ro-RO"
25 | export * from "./locale/ru-RU"
26 | export * from "./locale/sv-SE"
27 | export * from "./locale/uk-UA"
28 | export * from "./locale/zh-TW"
29 |
--------------------------------------------------------------------------------
/packages/config-provider/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { ReactNode } from "react"
2 |
3 | export interface ConfigProviderProps {
4 | children?: ReactNode
5 | locale?: Locale
6 | }
7 |
8 | export interface Locale {
9 | typography: Record
10 | timePicker: Record
11 | popover: Record
12 | empty: Record
13 | pagination: Record
14 | upload: Record
15 | popConfirm: Record
16 | calendar: Record
17 | modal: Record
18 | drawer: Record
19 | datePicker: Record
20 | }
21 |
--------------------------------------------------------------------------------
/packages/config-provider/src/locale/def.tsx:
--------------------------------------------------------------------------------
1 | import { enUS } from "./en-US"
2 |
3 | export const def = enUS
4 |
--------------------------------------------------------------------------------
/packages/config-provider/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/config-provider/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/date-picker/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/packages/date-picker/src/context.ts:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 |
3 | type PickerContext = {
4 | utcOffset?: number
5 | timezone?: string
6 | weekStart?: 0 | 1 | 2 | 3 | 4 | 5 | 6
7 | }
8 |
9 | export const PickerContext = createContext({})
10 |
--------------------------------------------------------------------------------
/packages/date-picker/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./interface"
2 | export * from "./signle-date-picker"
3 | export * from "./signle-year-picker"
4 | export * from "./single-month-picker"
5 | export * from "./single-quarter-picker"
6 | export * from "./single-week-picker"
7 | export * from "./range-date-picker"
8 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/date/interface.ts:
--------------------------------------------------------------------------------
1 | import { Dayjs } from "dayjs"
2 | import {
3 | PrivateCType,
4 | SingleDatePickerProps,
5 | DatePickerModeType,
6 | } from "../../interface"
7 |
8 | export interface DatePickerPanelProps
9 | extends SingleDatePickerProps,
10 | PrivateCType {
11 | onTimePickerSelect?: (timeString: string, time: Dayjs) => void
12 | pageShowDate?: Dayjs
13 | isRangePicker?: boolean
14 | rangeValues?: Dayjs[]
15 | isWeek?: boolean
16 | onPrev?: () => void
17 | onNext?: () => void
18 | onSuperPrev?: () => void
19 | onSuperNext?: () => void
20 | isSameTime?: (current: Dayjs, target: Dayjs) => boolean
21 | format?: string
22 | index?: number
23 | timeValue?: Dayjs
24 | isTimePanel?: boolean
25 | panelMode?: DatePickerModeType
26 | setPanelMode?: (mode: DatePickerModeType) => void
27 | valueShowHover?: Dayjs[]
28 | }
29 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/date/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 | import { getColor } from "@illa-design/theme"
3 |
4 | export const datePanelStyle = css`
5 | width: 280px;
6 | `
7 |
8 | export const timePickerBodyPanelStyle = css`
9 | border-left: 1px solid ${getColor("grayBlue", "08")};
10 | height: 325px;
11 | .time-list {
12 | height: 100%;
13 | overflow: hidden;
14 | }
15 | .time-picker-popup {
16 | height: calc(100% - 40px);
17 | }
18 | `
19 | export const timePickerHeaderPanelStyle = css`
20 | height: 40px;
21 | border-bottom: 1px solid ${getColor("grayBlue", "08")};
22 | display: flex;
23 | align-items: center;
24 | justify-content: center;
25 | color: ${getColor("grayBlue", "02")};
26 | font-weight: 500;
27 | `
28 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/month/interface.ts:
--------------------------------------------------------------------------------
1 | import { Dayjs } from "dayjs"
2 | import { ReactNode } from "react"
3 | import {
4 | SingleMonthPickerProps,
5 | PrivateCType,
6 | DatePickerModeType,
7 | } from "../../interface"
8 |
9 | export interface MonthPickerPanelProps
10 | extends SingleMonthPickerProps,
11 | PrivateCType {
12 | rangeValues?: Dayjs[]
13 | dateRender?: (currentDate: Dayjs) => ReactNode
14 | pageShowDate?: Dayjs
15 | isRangePicker?: boolean
16 | onSuperPrev?: () => void
17 | onSuperNext?: () => void
18 | panelMode?: DatePickerModeType
19 | setPanelMode?: (mode: DatePickerModeType) => void
20 | originMode?: DatePickerModeType
21 | valueShowHover?: Dayjs[]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/month/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 |
3 | export const monthPanelStyle = css`
4 | width: 280px;
5 | `
6 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/quarter/interface.ts:
--------------------------------------------------------------------------------
1 | import { Dayjs } from "dayjs"
2 | import { ReactNode } from "react"
3 | import {
4 | PrivateCType,
5 | SingleQuarterPickerProps,
6 | DatePickerModeType,
7 | } from "../../interface"
8 |
9 | export interface QuarterPickerPanelProps
10 | extends SingleQuarterPickerProps,
11 | PrivateCType {
12 | rangeValues?: Dayjs[]
13 | dateRender?: (currentDate: Dayjs) => ReactNode
14 | pageShowDate?: Dayjs
15 | isRangePicker?: boolean
16 | onSuperPrev?: () => void
17 | onSuperNext?: () => void
18 | panelMode?: DatePickerModeType
19 | setPanelMode?: (mode: DatePickerModeType) => void
20 | valueShowHover?: Dayjs[]
21 | }
22 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/quarter/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 |
3 | export const quarterPanelStyle = css`
4 | width: 280px;
5 | `
6 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/range/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 |
3 | export const rangePanelWrapperStyle = css`
4 | display: flex;
5 | `
6 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/week/interface.ts:
--------------------------------------------------------------------------------
1 | import { Dayjs } from "dayjs"
2 | import {
3 | PrivateCType,
4 | SingleWeekPickerProps,
5 | DatePickerModeType,
6 | } from "../../interface"
7 |
8 | export interface WeekPickerPanelProps
9 | extends SingleWeekPickerProps,
10 | PrivateCType {
11 | isRangePicker?: boolean
12 | rangeValues?: Dayjs[]
13 | pageShowDate?: Dayjs
14 | onPrev?: () => void
15 | onNext?: () => void
16 | onSuperPrev?: () => void
17 | onSuperNext?: () => void
18 | localeName?: string
19 | panelMode?: DatePickerModeType
20 | setPanelMode?: (mode: DatePickerModeType) => void
21 | valueShowHover?: Dayjs[]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/week/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 |
3 | export const weekPanelStyle = css`
4 | width: 315px;
5 | `
6 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/year/interface.ts:
--------------------------------------------------------------------------------
1 | import { Dayjs } from "dayjs"
2 | import { ReactNode } from "react"
3 | import { SingleYearPickerProps, DatePickerModeType } from "../../interface"
4 |
5 | export interface YearPickerPanelProps
6 | extends Pick<
7 | SingleYearPickerProps,
8 | "value" | "onSelect" | "format" | "superPrevIcon" | "superNextIcon"
9 | > {
10 | dateRender?: (currentDate: Dayjs) => ReactNode
11 | disabledDate?: (current: Dayjs) => boolean
12 | pageShowDate?: Dayjs
13 | isRangePicker?: boolean
14 | rangeValues?: Dayjs[]
15 | onSuperPrev?: () => void
16 | onSuperNext?: () => void
17 | originMode?: DatePickerModeType
18 | valueShowHover?: Dayjs[]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/date-picker/src/panels/year/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 |
3 | export const yearPanelStyle = css`
4 | width: 280px;
5 | `
6 |
--------------------------------------------------------------------------------
/packages/date-picker/src/utils/hooks.ts:
--------------------------------------------------------------------------------
1 | import { useEffect, useRef } from "react"
2 |
3 | export const useUpdate = (fn: Function, deps: unknown[] = []) => {
4 | const isDidMount = useRef(false)
5 |
6 | useEffect(() => {
7 | if (isDidMount.current) {
8 | fn()
9 | } else {
10 | isDidMount.current = true
11 | }
12 | }, [...deps])
13 | }
14 |
--------------------------------------------------------------------------------
/packages/date-picker/src/utils/pad.ts:
--------------------------------------------------------------------------------
1 | export function padStart(string: unknown, length: number, char = " "): string {
2 | const s = String(string)
3 | if (!length) {
4 | return s
5 | }
6 | const newString = s.length < length ? `${char}${s}` : s
7 | return newString.length < length
8 | ? padStart(newString, length, char)
9 | : newString
10 | }
11 |
12 | export function padEnd(string: unknown, length: number, char = " "): string {
13 | const s = String(string)
14 | if (!length) {
15 | return s
16 | }
17 | const newString = s.length < length ? `${s}${char}` : s
18 | return newString.length < length ? padEnd(newString, length, char) : newString
19 | }
20 |
--------------------------------------------------------------------------------
/packages/date-picker/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/date-picker/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/description/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/description/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./description"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/description/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/description/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/divider/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/divider/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./divider"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/divider/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type DividerDirection = "vertical" | "horizontal"
5 | export type DividerVariant = "solid" | "dashed" | "dotted" | "double"
6 | export type DividerTextAlign = "start" | "center" | "end"
7 | export type DividerColorScheme =
8 | | string
9 | | "gray"
10 | | "blue"
11 | | "purple"
12 | | "red"
13 | | "green"
14 | | "yellow"
15 | | "orange"
16 | | "cyan"
17 | | "white"
18 | | "techPink"
19 | | "techPurple"
20 |
21 | export interface DividerProps extends HTMLAttributes, BoxProps {
22 | direction?: DividerDirection
23 | variant?: DividerVariant
24 | text?: string
25 | textAlign?: DividerTextAlign
26 | colorScheme?: DividerColorScheme
27 | }
28 |
--------------------------------------------------------------------------------
/packages/divider/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/divider/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/drawer/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./drawer"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/drawer/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, MouseEvent, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 | import { SerializedStyles } from "@emotion/react"
4 |
5 | export type DrawerPlacement = "top" | "bottom" | "left" | "right"
6 |
7 | export interface DrawerProps
8 | extends Omit, "title">,
9 | BoxProps {
10 | title?: ReactNode
11 | footer?: boolean
12 | okText?: string
13 | cancelText?: string
14 | placement?: DrawerPlacement
15 | mask?: boolean
16 | maskStyle?: SerializedStyles
17 | maskClosable?: boolean
18 | visible?: boolean
19 | closable?: boolean
20 | focusLock?: boolean
21 | autoFocus?: boolean
22 | confirmLoading?: boolean
23 | onOk?: (e?: MouseEvent) => void
24 | onCancel?: (e?: MouseEvent) => void
25 | afterOpen?: () => void
26 | afterClose?: () => void
27 | }
28 |
--------------------------------------------------------------------------------
/packages/drawer/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/drawer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/dropdown/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/dropdown/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./dropdown"
2 | export * from "./droplist"
3 | export * from "./droplist-item"
4 | export * from "./interface"
5 |
--------------------------------------------------------------------------------
/packages/dropdown/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/dropdown/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/empty/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/empty/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./empty"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/empty/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { ReactNode, HTMLAttributes } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export interface EmptyProps extends HTMLAttributes, BoxProps {
5 | description?: ReactNode
6 | divideSize?: string
7 | paddingVertical?: string
8 | icon?: ReactNode
9 | imgSrc?: string
10 | }
11 |
--------------------------------------------------------------------------------
/packages/empty/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css, SerializedStyles } from "@emotion/react"
2 | import { globalColor, illaPrefix } from "@illa-design/theme"
3 |
4 | export function applyEmptyContainerStyle(
5 | paddingVertical: string,
6 | ): SerializedStyles {
7 | return css`
8 | padding: ${paddingVertical} 0;
9 | vertical-align: middle;
10 | text-align: center;
11 | `
12 | }
13 |
14 | export function applyDescriptionStyle(divideSize: string): SerializedStyles {
15 | return css`
16 | margin-top: ${divideSize}px;
17 | color: ${globalColor(`--${illaPrefix}-grayBlue-04`)};
18 | font-size: 14px;
19 | `
20 | }
21 |
--------------------------------------------------------------------------------
/packages/empty/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/empty/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/grid/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/grid/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./row"
2 | export * from "./col"
3 | export * from "./interface"
4 | export * from "./row-context"
5 |
--------------------------------------------------------------------------------
/packages/grid/src/row-context.tsx:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 | import { RowContextProps } from "./interface"
3 |
4 | export const RowContext = createContext(undefined)
5 |
6 | RowContext.displayName = "RowContext"
7 |
--------------------------------------------------------------------------------
/packages/grid/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/grid/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/icon/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/add.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const AddIcon = createIcon({
4 | title: "AddIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | AddIcon.displayName = "AddIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/align-bottom.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const AlignBottomIcon = createIcon({
4 | title: "AlignBottomIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | AlignBottomIcon.displayName = "AlignBottomIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/align-h-center.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const AlignHCenterIcon = createIcon({
4 | title: "AlignHCenterIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | AlignHCenterIcon.displayName = "AlignHCenterIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/align-left.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const AlignLeftIcon = createIcon({
4 | title: "AlignLeftIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | AlignLeftIcon.displayName = "AlignLeftIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/align-right.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const AlignRightIcon = createIcon({
4 | title: "AlignRightIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | AlignRightIcon.displayName = "AlignRightIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/align-top.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const AlignTopIcon = createIcon({
4 | title: "AlignTopIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | AlignTopIcon.displayName = "AlignTopIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/align-v-center.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const AlignVCenterIcon = createIcon({
4 | title: "AlignVCenterIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | AlignVCenterIcon.displayName = "AlignVCenterIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/bind.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const BindIcon = createIcon({
4 | title: "BindIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
12 | ),
13 | })
14 |
15 | BindIcon.displayName = "BindIcon"
16 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/calendar.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const CalendarIcon = createIcon({
4 | title: "CalendarIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | CalendarIcon.displayName = "CalendarIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/caret-down.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const CaretDownIcon = createIcon({
4 | title: "CaretDownIcon",
5 | viewBox: "0 0 8 8",
6 | path: (
7 |
11 | ),
12 | })
13 |
14 | CaretDownIcon.displayName = "CaretDownIcon"
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/caret-left.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const CaretLeftIcon = createIcon({
4 | title: "CaretLeftIcon",
5 | viewBox: "0 0 8 8",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | CaretLeftIcon.displayName = "CaretLeftIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/caret-right.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const CaretRightIcon = createIcon({
4 | title: "CaretRightIcon",
5 | viewBox: "0 0 8 8",
6 | path: ,
7 | })
8 |
9 | CaretRightIcon.displayName = "CaretRightIcon"
10 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/close.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const CloseIcon = createIcon({
4 | title: "CloseIcon",
5 | viewBox: "0 0 8 8",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | CloseIcon.displayName = "CloseIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/copy.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const CopyIcon = createIcon({
4 | title: "CopyIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
16 |
20 | >
21 | ),
22 | })
23 |
24 | CopyIcon.displayName = "CopyIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/docs.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const DocsIcon = createIcon({
4 | title: "DocsIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | DocsIcon.displayName = "DocsIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/down.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const DownIcon = createIcon({
4 | title: "DownIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | DownIcon.displayName = "DownIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/email.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const EmailIcon = createIcon({
4 | title: "EmailIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | EmailIcon.displayName = "EmailIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/empty.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const EmptyIcon = createIcon({
4 | title: "EmptyIcon",
5 | viewBox: "0 0 48 48",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | EmptyIcon.displayName = "EmptyIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/error-circle.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const ErrorCircleIcon = createIcon({
4 | title: "ErrorCircleIcon",
5 | viewBox: "0 0 12 12",
6 | d: "M12 6A6 6 0 1 0 0 6a6 6 0 0 0 12 0zM4.146 4.146a.5.5 0 0 1 .708 0L6 5.293l1.146-1.147a.5.5 0 1 1 .708.708L6.707 6l1.147 1.146a.5.5 0 1 1-.708.708L6 6.707 4.854 7.854a.5.5 0 1 1-.708-.708L5.293 6 4.146 4.854a.5.5 0 0 1 0-.708z",
7 | })
8 |
9 | ErrorCircleIcon.displayName = "ErrorCircleIcon"
10 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/exit.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const ExitIcon = createIcon({
4 | title: "ExitIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
14 |
20 | >
21 | ),
22 | })
23 |
24 | ExitIcon.displayName = "ExitIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/eye-on.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const EyeOnIcon = createIcon({
4 | title: "EyeOnIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/file-music.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const FileMusicIcon = createIcon({
4 | title: "FileMusicIcon",
5 | viewBox: "0 0 16 20",
6 | path: (
7 | <>
8 |
9 |
13 |
19 |
23 | >
24 | ),
25 | })
26 |
27 | FileMusicIcon.displayName = "FileMusicIcon"
28 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/file-video.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const FileVideoIcon = createIcon({
4 | title: "FileVideoIcon",
5 | viewBox: "0 0 16 20",
6 | path: (
7 | <>
8 |
9 |
13 | >
14 | ),
15 | })
16 |
17 | FileVideoIcon.displayName = "FileVideoIcon"
18 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/floder.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const FolderIcon = createIcon({
4 | title: "FolderIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
13 |
14 | >
15 | ),
16 | })
17 |
18 | FolderIcon.displayName = "FolderIcon"
19 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/full-screen.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const FullScreenIcon = createIcon({
4 | title: "FullScreenIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
14 |
20 | >
21 | ),
22 | })
23 |
24 | FullScreenIcon.displayName = "FullScreenIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/horizontal-end.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const HorizontalEndIcon = createIcon({
4 | title: "HorizontalEndIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | HorizontalEndIcon.displayName = "HorizontalEndIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/horizontal-start.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const HorizontalStartIcon = createIcon({
4 | title: "HorizontalStartIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | HorizontalStartIcon.displayName = "HorizontalStartIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/image-default.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const ImageDefaultIcon = createIcon({
4 | title: "ImageDefaultIcon",
5 | viewBox: "0 0 24 24",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | ImageDefaultIcon.displayName = "ImageDefaultIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/image-error.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const ImageErrorIcon = createIcon({
4 | title: "ImageErrorIcon",
5 | viewBox: "0 0 24 24",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | ImageErrorIcon.displayName = "ImageErrorIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/info-cricle.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const InfoCircleIcon = createIcon({
4 | title: "InfoCircleIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
14 |
20 | >
21 | ),
22 | })
23 |
24 | InfoCircleIcon.displayName = "InfoCircleIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/info.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const InfoIcon = createIcon({
4 | title: "InfoIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
14 | >
15 | ),
16 | })
17 |
18 | InfoIcon.displayName = "InfoIcon"
19 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/like-fill.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const LikeFillIcon = createIcon({
4 | title: "LikeFillIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
11 | ),
12 | })
13 |
14 | LikeFillIcon.displayName = "LikeFillIcon"
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/like-outline.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const LikeOutlineIcon = createIcon({
4 | title: "LikeOutlineIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
12 | ),
13 | })
14 |
15 | LikeOutlineIcon.displayName = "LikeOutlineIcon"
16 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/lock.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const LockIcon = createIcon({
4 | title: "LockIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
12 |
13 | >
14 | ),
15 | })
16 |
17 | LockIcon.displayName = "LockIcon"
18 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/minus.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const MinusIcon = createIcon({
4 | title: "MinusIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | MinusIcon.displayName = "MinusIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/more.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const MoreIcon = createIcon({
4 | title: "MoreIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | MoreIcon.displayName = "MoreIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/move.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const MoveIcon = createIcon({
4 | title: "MoveIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
11 | ),
12 | })
13 |
14 | MoveIcon.displayName = "MoveIcon"
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/next.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const NextIcon = createIcon({
4 | title: "NextIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | NextIcon.displayName = "NextIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/open-window.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const OpenWindowIcon = createIcon({
4 | title: "OpenWindowIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
14 |
20 | >
21 | ),
22 | })
23 |
24 | OpenWindowIcon.displayName = "OpenWindowIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/pen.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const PenIcon = createIcon({
4 | title: "PenIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
11 | ),
12 | })
13 |
14 | PenIcon.displayName = "PenIcon"
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/people.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const PeopleIcon = createIcon({
4 | title: "PeopleIcon",
5 | viewBox: "0 0 16 16",
6 | d: "M8 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm2.667-4a2.667 2.667 0 1 1-5.334 0 2.667 2.667 0 0 1 5.334 0zM16 14.667C16 16 14.667 16 14.667 16H1.333S0 16 0 14.667c0-1.334 1.333-5.334 8-5.334s8 4 8 5.334zm-1.333-.006c-.002-.328-.206-1.314-1.11-2.218-.869-.87-2.505-1.776-5.557-1.776-3.053 0-4.688.906-5.557 1.776-.904.904-1.107 1.89-1.11 2.218h13.334z",
7 | })
8 |
9 | PeopleIcon.displayName = "PeopleIcon"
10 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/play-fill.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const PlayFillIcon = createIcon({
4 | title: "PlayOutlineIcon",
5 | viewBox: "0 0 12 12",
6 | path: (
7 |
11 | ),
12 | })
13 |
14 | PlayFillIcon.displayName = "PlayFillIcon"
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/play-outline.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const PlayOutlineIcon = createIcon({
4 | title: "PlayOutlineIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
12 | ),
13 | })
14 |
15 | PlayOutlineIcon.displayName = "PlayOutlineIcon"
16 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/plus.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const PlusIcon = createIcon({
4 | title: "PlusIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
14 |
20 | >
21 | ),
22 | })
23 |
24 | PlusIcon.displayName = "PlusIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/previous.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const PreviousIcon = createIcon({
4 | title: "PreviousIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | PreviousIcon.displayName = "PreviousIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/reduce.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const ReduceIcon = createIcon({
4 | title: "ReduceIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | ReduceIcon.displayName = "ReduceIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/reset.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const ResetIcon = createIcon({
4 | title: "ResetIcon",
5 | viewBox: "0 0 14 14",
6 | path: (
7 |
14 | ),
15 | })
16 |
17 | ResetIcon.displayName = "ResetIcon"
18 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/search.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const SearchIcon = createIcon({
4 | title: "SearchIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
14 | >
15 | ),
16 | })
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/slash.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const SlashIcon = createIcon({
4 | title: "SlashIcon",
5 | viewBox: "0 0 4 8",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | SlashIcon.displayName = "SlashIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/sorter-default.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const SorterDefaultIcon = createIcon({
4 | title: "SorterDefaultIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
11 | ),
12 | })
13 |
14 | SorterDefaultIcon.displayName = "SorterDefaultIcon"
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/sorter-down.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const SorterDownIcon = createIcon({
4 | title: "SorterDownIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
12 |
16 | >
17 | ),
18 | })
19 |
20 | SorterDownIcon.displayName = "SorterDownIcon"
21 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/sorter-up.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const SorterUpIcon = createIcon({
4 | title: "SorterUpIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
12 |
16 | >
17 | ),
18 | })
19 |
20 | SorterUpIcon.displayName = "SorterUpIcon"
21 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/star-fill.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const StarFillIcon = createIcon({
4 | title: "StarFillIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
11 | ),
12 | })
13 |
14 | StarFillIcon.displayName = "StarFillIcon"
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/stoke-width.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const StokeWidthIcon = createIcon({
4 | title: "StokeWidthIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | StokeWidthIcon.displayName = "StokeWidthIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/success-circle.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const SuccessCircleIcon = createIcon({
4 | title: "SuccessCircleIcon",
5 | viewBox: "0 0 12 12",
6 | path: (
7 | <>
8 |
14 |
20 | >
21 | ),
22 | })
23 |
24 | SuccessCircleIcon.displayName = "SuccessCircleIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/success.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const SuccessIcon = createIcon({
4 | title: "SuccessIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | SuccessIcon.displayName = "SuccessIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/switch.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const SwitchIcon = createIcon({
4 | title: "SwitchIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
14 |
20 | >
21 | ),
22 | })
23 |
24 | SwitchIcon.displayName = "SwitchIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/text-align-center.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const TextAlignCenterIcon = createIcon({
4 | title: "TextAlignCenterIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | TextAlignCenterIcon.displayName = "TextAlignCenterIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/text-align-left.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const TextAlignLeftIcon = createIcon({
4 | title: "TextAlignLeftIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | TextAlignLeftIcon.displayName = "TextAlignLeftIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/text-align-right.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const TextAlignRightIcon = createIcon({
4 | title: "TextAlignRightIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | TextAlignRightIcon.displayName = "TextAlignRightIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/time.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const TimeIcon = createIcon({
4 | title: "TimeIcon",
5 | viewBox: "0 0 12 12",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | TimeIcon.displayName = "TimeIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/unlock.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const UnlockIcon = createIcon({
4 | title: "UnlockIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
9 |
13 | >
14 | ),
15 | })
16 |
17 | UnlockIcon.displayName = "UnlockIcon"
18 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/up.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const UpIcon = createIcon({
4 | title: "UpIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | UpIcon.displayName = "UpIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/vertical-end.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const VerticalEndIcon = createIcon({
4 | title: "VerticalEndIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | VerticalEndIcon.displayName = "VerticalEndIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/vertical-start.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const VerticalStartIcon = createIcon({
4 | title: "VerticalStartIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | VerticalStartIcon.displayName = "VerticalStartIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/video-play.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const VideoPlayIcon = createIcon({
4 | title: "VideoPlayIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
11 | ),
12 | })
13 |
14 | VideoPlayIcon.displayName = "VideoPlayIcon"
15 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/warning-circle.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const WarningCircleIcon = createIcon({
4 | title: "WarningCircleIcon",
5 | viewBox: "0 0 12 12",
6 | path: (
7 | <>
8 |
14 |
20 | >
21 | ),
22 | })
23 |
24 | WarningCircleIcon.displayName = "WarningCircleIcon"
25 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/warning.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const WarningIcon = createIcon({
4 | title: "WarningIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 |
13 | ),
14 | })
15 |
16 | WarningIcon.displayName = "WarningIcon"
17 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/window-bottom.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const WindowBottomIcon = createIcon({
4 | title: "WindowBottomIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
17 |
23 | >
24 | ),
25 | })
26 |
27 | WindowBottomIcon.displayName = "WindowBottomIcon"
28 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/window-left.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const WindowLeftIcon = createIcon({
4 | title: "WindowLeftIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
17 |
23 | >
24 | ),
25 | })
26 |
27 | WindowLeftIcon.displayName = "WindowLeftIcon"
28 |
--------------------------------------------------------------------------------
/packages/icon/src/icons/window-right.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const WindowRightIcon = createIcon({
4 | title: "WindowRightIcon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | <>
8 |
17 |
23 | >
24 | ),
25 | })
26 |
27 | WindowRightIcon.displayName = "WindowRightIcon"
28 |
--------------------------------------------------------------------------------
/packages/icon/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { SVGAttributes } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 | import { SerializedStyles } from "@emotion/react"
4 |
5 | export interface IconProps extends SVGAttributes, BoxProps {
6 | size?: string
7 | spin?: boolean
8 | containerStyle?: SerializedStyles
9 | }
10 |
--------------------------------------------------------------------------------
/packages/icon/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css, keyframes } from "@emotion/react"
2 |
3 | export const rotateKeyframe = keyframes`
4 | 0% {
5 | transform: rotateZ(0deg);
6 | }
7 | 100% {
8 | transform: rotateZ(360deg)
9 | }
10 | `
11 |
12 | export const rotateAnimation = css`
13 | animation: 1s linear infinite ${rotateKeyframe};
14 | `
15 |
16 | export const iconContainerStyle = css`
17 | display: inline-flex;
18 | align-items: center;
19 | font-style: normal;
20 | line-height: 0;
21 | color: inherit;
22 | text-align: center;
23 | text-rendering: optimizeLegibility;
24 | text-transform: none;
25 | -webkit-font-smoothing: antialiased;
26 | -moz-osx-font-smoothing: grayscale;
27 | vertical-align: -0.125em;
28 | `
29 |
--------------------------------------------------------------------------------
/packages/icon/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/icon/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/image/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/image/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./image"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/image/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { ImgHTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export interface ImageProps
5 | extends ImgHTMLAttributes,
6 | BoxProps {
7 | objectFit?: "fill" | "contain" | "cover" | "none" | "scale-down"
8 | fallback?: ReactNode
9 | fallbackSrc?: string
10 | radius?: string
11 | }
12 |
--------------------------------------------------------------------------------
/packages/image/src/style.ts:
--------------------------------------------------------------------------------
1 | import { globalColor, illaPrefix } from "@illa-design/theme"
2 | import { css } from "@emotion/react"
3 |
4 | export function applyImageCss(
5 | objFit: "fill" | "contain" | "cover" | "none" | "scale-down",
6 | radius: string,
7 | ) {
8 | return css`
9 | object-fit: ${objFit};
10 | border-radius: ${radius};
11 | `
12 | }
13 |
14 | export function applyDefaultFallback(
15 | width: string | number,
16 | height: string | number,
17 | radius: string,
18 | ) {
19 | return css`
20 | display: inline-flex;
21 | flex-direction: row;
22 | align-items: center;
23 | justify-content: center;
24 | background-color: ${globalColor(`--${illaPrefix}-grayBlue-09`)};
25 | border-radius: ${radius};
26 | width: ${width};
27 | height: ${height};
28 | `
29 | }
30 |
31 | export const applyOuterCss = css`
32 | vertical-align: middle;
33 | display: inline-flex;
34 | `
35 |
--------------------------------------------------------------------------------
/packages/image/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/image/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/input-number/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/input-number/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./input-number"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/input-number/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/input-number/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/input-tag/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/input-tag/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./input-tag"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/input-tag/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/input-tag/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/input/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/input/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./input"
2 | export * from "./interface"
3 | export * from "./search"
4 | export * from "./password"
5 | export * from "./text-area"
6 |
--------------------------------------------------------------------------------
/packages/input/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/input/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/link/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/link/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./link"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/link/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { AnchorHTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type LinkColorScheme =
5 | | string
6 | | "white"
7 | | "blackAlpha"
8 | | "gray"
9 | | "grayBlue"
10 | | "red"
11 | | "orange"
12 | | "yellow"
13 | | "green"
14 | | "blue"
15 | | "cyan"
16 | | "purple"
17 | | "techPink"
18 | | "techPurple"
19 |
20 | export interface LinkProps
21 | extends AnchorHTMLAttributes,
22 | BoxProps {
23 | disabled?: boolean
24 | icon?: boolean | ReactNode
25 | colorScheme?: LinkColorScheme
26 | hoverable?: boolean
27 | }
28 |
--------------------------------------------------------------------------------
/packages/link/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/link/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/list/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/list/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./list"
2 | export * from "./list-item"
3 | export * from "./list-item-meta"
4 | export * from "./interface"
5 |
--------------------------------------------------------------------------------
/packages/list/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/list/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/loading/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./loading"
2 | export * from "./interface"
3 | export * from "./style"
4 |
--------------------------------------------------------------------------------
/packages/loading/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes } from "react"
2 | import { SerializedStyles } from "@emotion/react"
3 | import { BoxProps } from "@illa-design/theme"
4 |
5 | export type LoadingSize = "small" | "medium" | "large"
6 |
7 | export type LoadingColorScheme =
8 | | string
9 | | "white"
10 | | "blackAlpha"
11 | | "gray"
12 | | "grayBlue"
13 | | "red"
14 | | "orange"
15 | | "yellow"
16 | | "green"
17 | | "blue"
18 | | "cyan"
19 | | "purple"
20 | | "techPink"
21 | | "techPurple"
22 |
23 | export interface LoadingProps extends HTMLAttributes, BoxProps {
24 | size?: LoadingSize
25 | colorScheme?: LoadingColorScheme
26 | }
27 |
--------------------------------------------------------------------------------
/packages/loading/src/loading.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef } from "react"
2 | import { css } from "@emotion/react"
3 | import { LoadingProps } from "./interface"
4 | import { applyLoadingStyle } from "./style"
5 | import { applyBoxStyle, deleteCssProps } from "@illa-design/theme"
6 | import { LoadingIcon } from "@illa-design/icon"
7 |
8 | export const Loading = forwardRef(
9 | (props, ref) => {
10 | const { colorScheme = "gray", size = "medium", ...restProps } = props
11 | return (
12 |
17 | )
18 | },
19 | )
20 |
21 | Loading.displayName = "Loading"
22 |
--------------------------------------------------------------------------------
/packages/loading/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/loading/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/menu/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./menu"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/menu/src/menu-context.tsx:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 | import { MenuContextProps } from "./interface"
3 |
4 | export const MenuContext = createContext({})
5 |
6 | MenuContext.displayName = "MenuContext"
7 |
--------------------------------------------------------------------------------
/packages/menu/src/menu.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef } from "react"
2 | import { MenuProps } from "./interface"
3 | import { HorizontalMenu } from "./horizontal/horizontal-menu"
4 | import { VerticalMenu } from "./vertical/vertical-menu"
5 |
6 | export const Menu = forwardRef((props, ref) => {
7 | const { mode = "horizontal" } = props
8 |
9 | switch (mode) {
10 | case "horizontal":
11 | return
12 | case "vertical":
13 | return
14 | }
15 | return <>>
16 | })
17 |
18 | Menu.displayName = "Menu"
19 |
--------------------------------------------------------------------------------
/packages/menu/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/menu/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/message/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/message/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./interface"
2 | export * from "./message-group"
3 | export * from "./message"
4 | export * from "./hook"
5 | export * from "./message-store"
6 |
--------------------------------------------------------------------------------
/packages/message/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type MessagePosition = "top" | "bottom"
5 | export type MessageType =
6 | | "info"
7 | | "error"
8 | | "success"
9 | | "warning"
10 | | "loading"
11 | | "normal"
12 |
13 | export interface MessageProps extends BoxProps {
14 | type?: MessageType
15 | closable?: boolean
16 | showIcon?: boolean
17 | duration?: number
18 | id?: string
19 | position?: MessagePosition
20 | icon?: ReactNode
21 | content?: string | ReactNode
22 | onClose?: (id?: string) => void
23 | }
24 |
--------------------------------------------------------------------------------
/packages/message/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ],
6 | }
--------------------------------------------------------------------------------
/packages/modal/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/packages/modal/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./modal"
2 | export * from "./interface"
3 | export * from "./style"
4 | export * from "./hook"
5 | export * from "./modal-group"
6 |
--------------------------------------------------------------------------------
/packages/modal/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/modal/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/notification/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/notification/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./interface"
2 | export * from "./notification"
3 | export * from "./style"
4 | export * from "./notification-group"
5 | export * from "./hook"
6 |
--------------------------------------------------------------------------------
/packages/notification/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type NotificationPosition =
5 | | "topLeft"
6 | | "topRight"
7 | | "bottomLeft"
8 | | "bottomRight"
9 |
10 | export type NotificationType =
11 | | "info"
12 | | "error"
13 | | "success"
14 | | "warning"
15 | | "normal"
16 |
17 | export interface NotificationProps extends BoxProps {
18 | type?: NotificationType
19 | action?: ReactNode
20 | closable?: boolean
21 | showIcon?: boolean
22 | duration?: number
23 | id?: string
24 | position?: NotificationPosition
25 | icon?: ReactNode
26 | title?: string | ReactNode
27 | content?: string | ReactNode
28 | onClose?: (id?: string) => void
29 | }
30 |
--------------------------------------------------------------------------------
/packages/notification/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ],
6 | }
--------------------------------------------------------------------------------
/packages/page-header/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./page-header"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/page-header/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, MouseEvent, ReactNode } from "react"
2 | import { BreadcrumbProps } from "@illa-design/breadcrumb"
3 | import { BoxProps } from "@illa-design/theme"
4 |
5 | export interface PageHeaderProps
6 | extends Omit, "title">,
7 | BoxProps {
8 | title?: ReactNode
9 | subTitle?: ReactNode
10 | breadcrumb?: BreadcrumbProps
11 | backIcon?: ReactNode | boolean
12 | extra?: ReactNode
13 | onBack?: (e: MouseEvent) => void
14 | }
15 |
--------------------------------------------------------------------------------
/packages/page-header/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/page-header/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/pagination/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/pagination/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./pagination"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/pagination/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/pagination/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/popconfirm/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/popconfirm/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./popconfirm"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/popconfirm/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { ReactNode } from "react"
2 | import { TriggerProps } from "@illa-design/trigger"
3 | import { ButtonColorScheme, ButtonProps } from "@illa-design/button"
4 |
5 | export interface PopconfirmProps
6 | extends Omit {
7 | title?: string
8 | cancelText?: string
9 | okText?: string
10 | okColorScheme?: ButtonColorScheme
11 | cancelColorScheme?: ButtonColorScheme
12 | okButtonProps?: ButtonProps
13 | cancelButtonProps?: ButtonProps
14 | onOk?: () => void | Promise
15 | onCancel?: () => void
16 | icon?: ReactNode
17 | }
18 |
--------------------------------------------------------------------------------
/packages/popconfirm/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 | import { TriggerColorScheme } from "@illa-design/trigger"
3 | import { globalColor, illaPrefix } from "@illa-design/theme"
4 |
5 | export const applyTypographyContainer = css`
6 | display: flex;
7 | flex-direction: column;
8 | min-width: 320px;
9 | padding: 16px;
10 | `
11 |
12 | export const applyButtonGroupStyle = css`
13 | align-self: end;
14 | `
15 |
16 | export function applyHeaderStyle(colorScheme: TriggerColorScheme) {
17 | const textColor =
18 | colorScheme == "white"
19 | ? globalColor(`--${illaPrefix}-grayBlue-02`)
20 | : globalColor(`--${illaPrefix}-white-02`)
21 | return css`
22 | color: ${textColor};
23 | font-size: 16px;
24 | font-weight: 500;
25 | `
26 | }
27 |
--------------------------------------------------------------------------------
/packages/popconfirm/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/popconfirm/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/popover/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/popover/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./popover"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/popover/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { TriggerProps } from "@illa-design/trigger"
2 |
3 | export interface PopoverProps extends Omit {
4 | title?: string
5 | hasCloseIcon?: boolean
6 | }
7 |
--------------------------------------------------------------------------------
/packages/popover/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 | import { TriggerColorScheme } from "@illa-design/trigger"
3 | import { globalColor, illaPrefix } from "@illa-design/theme"
4 |
5 | export const applyTypographyContainer = css`
6 | display: flex;
7 | flex-direction: column;
8 | padding: 12px 16px;
9 | `
10 |
11 | export function applyTitleColor(colorScheme: TriggerColorScheme) {
12 | const textColor =
13 | colorScheme == "white"
14 | ? globalColor(`--${illaPrefix}-grayBlue-02`)
15 | : globalColor(`--${illaPrefix}-white-02`)
16 | return css`
17 | color: ${textColor};
18 | `
19 | }
20 |
21 | export const applyCloseButton = css`
22 | margin-top: 4px;
23 | align-self: end;
24 | `
25 |
--------------------------------------------------------------------------------
/packages/popover/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/popover/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/progress/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/progress/src/circle-progress-style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 | import { globalColor, illaPrefix } from "@illa-design/theme"
3 |
4 | export const applyCircleStatus = css`
5 | position: absolute;
6 | display: inline-flex;
7 | font-size: 16px;
8 | `
9 |
10 | export const applyProgressText = css`
11 | position: absolute;
12 | line-height: 22px;
13 | font-size: 14px;
14 | color: ${globalColor(`--${illaPrefix}-grayBlue-04`)};
15 | `
16 |
--------------------------------------------------------------------------------
/packages/progress/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./progress"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/progress/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/progress/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/radio/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/radio/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./radio"
2 | export * from "./radio-group"
3 | export * from "./interface"
4 | export * from "./radio-group-context"
5 |
--------------------------------------------------------------------------------
/packages/radio/src/radio-group-context.tsx:
--------------------------------------------------------------------------------
1 | import { ChangeEvent, createContext } from "react"
2 | import { RadioGroupContextProps } from "./interface"
3 |
4 | interface extraProps {
5 | onChangeValue?: (value: any, event: ChangeEvent) => void
6 | }
7 |
8 | export const RadioGroupContext = createContext<
9 | (RadioGroupContextProps & extraProps) | undefined
10 | >(undefined)
11 |
12 | RadioGroupContext.displayName = "RadioGroupContext"
13 |
--------------------------------------------------------------------------------
/packages/radio/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/radio/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/rate/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/rate/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./interface"
2 | export * from "./rate"
3 |
--------------------------------------------------------------------------------
/packages/rate/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export interface RateProps
5 | extends Omit, "onChange">,
6 | BoxProps {
7 | defaultValue?: number
8 | character?: ReactNode | ((index: number) => ReactNode)
9 | count?: number
10 | value?: number
11 | tooltips?: string[]
12 | allowHalf?: boolean
13 | allowClear?: boolean
14 | readonly?: boolean
15 | disabled?: boolean
16 | heart?: boolean
17 | onChange?: (value: number) => void
18 | onHoverChange?: (value: number) => void
19 | }
20 |
--------------------------------------------------------------------------------
/packages/rate/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/rate/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/react/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/react/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/react/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/result/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./result"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/result/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type ResultStatus =
5 | | "success"
6 | | "error"
7 | | "info"
8 | | "warning"
9 | | "404"
10 | | "403"
11 | | "500"
12 |
13 | export interface ResultProps
14 | extends Omit, "title">,
15 | BoxProps {
16 | extra?: ReactNode
17 | icon?: ReactNode
18 | paddingVertical?: string
19 | status?: ResultStatus
20 | subTitle?: ReactNode
21 | title?: ReactNode
22 | }
23 |
--------------------------------------------------------------------------------
/packages/result/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/result/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/select/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/select/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./select"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/select/src/select.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef } from "react"
2 | import { SelectProps } from "./interface"
3 | import { SingleSelect } from "./single-select"
4 | import { MultipleSelect } from "./multiple-select"
5 |
6 | export const Select = forwardRef(
7 | (props, ref) => {
8 | if (props.multiple) {
9 | return
10 | } else {
11 | return
12 | }
13 | },
14 | )
15 |
16 | Select.displayName = "Select"
17 |
--------------------------------------------------------------------------------
/packages/select/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 |
3 | export const dropListItemStyle = css`
4 | display: flex;
5 | flex-direction: row;
6 | align-items: center;
7 | `
8 | export const dropLabelStyle = css`
9 | display: inline-block;
10 | height: 100%;
11 | width: 100%;
12 | overflow: hidden;
13 | text-overflow: ellipsis;
14 | white-space: nowrap;
15 | `
16 |
--------------------------------------------------------------------------------
/packages/select/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/select/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/skeleton/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./skeleton"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/skeleton/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type ImageSize = number | "small" | "medium" | "large"
5 | export type ImageShape = "circle" | "square"
6 |
7 | export interface SkeletonImageProps
8 | extends HTMLAttributes,
9 | BoxProps {
10 | shape?: ImageShape
11 | size?: ImageSize
12 | animation?: boolean
13 | }
14 |
15 | export interface SkeletonTextProps
16 | extends HTMLAttributes,
17 | BoxProps {
18 | rows?: number
19 | width?: number | string | Array
20 | animation?: boolean
21 | }
22 |
23 | export interface SkeletonProps
24 | extends HTMLAttributes,
25 | BoxProps {
26 | animation?: boolean
27 | visible?: boolean
28 | image?: SkeletonImageProps | boolean
29 | text?: SkeletonTextProps | boolean
30 | children?: ReactNode
31 | }
32 |
--------------------------------------------------------------------------------
/packages/skeleton/src/skeleton-image.tsx:
--------------------------------------------------------------------------------
1 | import { SkeletonImageProps } from "./interface"
2 | import { applyAnimation, applyImageStyle } from "./style"
3 | import { applyBoxStyle, deleteCssProps } from "@illa-design/theme"
4 |
5 | export function SkeletonImage(props: SkeletonImageProps) {
6 | const { shape = "circle", size = "medium", animation, ...restProps } = props
7 |
8 | return (
9 |
17 | )
18 | }
19 |
20 | SkeletonImage.displayName = "SkeletonImage"
21 |
--------------------------------------------------------------------------------
/packages/skeleton/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/skeleton/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/slider/src/NumTick.tsx:
--------------------------------------------------------------------------------
1 | import { FC } from "react"
2 | import { SliderNumTick } from "./interface"
3 | import { applyNumTick } from "./style"
4 | export const NumTick: FC = (props) => {
5 | const { left, disabled, value } = props
6 |
7 | return (
8 |
9 | {value}
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/packages/slider/src/content.ts:
--------------------------------------------------------------------------------
1 | export const DefaultWidth = 240
2 | export enum BarLocation {
3 | LEFT = "left",
4 | RIGHT = "right",
5 | }
6 |
--------------------------------------------------------------------------------
/packages/slider/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./interface"
2 | export * from "./slider"
3 |
--------------------------------------------------------------------------------
/packages/slider/src/tick.tsx:
--------------------------------------------------------------------------------
1 | import { FC } from "react"
2 | import { SliderTick } from "./interface"
3 | import { applyTick, applyTickContainer, applyBgColor } from "./style"
4 | export const Tick: FC = (props) => {
5 | const {
6 | left,
7 | leftValue,
8 | rightValue,
9 | currentWidth,
10 | disabled,
11 | colorScheme,
12 | value,
13 | } = props
14 | const rightBound = currentWidth - rightValue >= left
15 | const background = applyBgColor(
16 | colorScheme,
17 | !(leftValue <= left && rightBound && !disabled),
18 | )
19 | return (
20 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/packages/slider/src/useElementSize.ts:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from "react"
2 |
3 | export const useElementSize = (
4 | ref: React.MutableRefObject,
5 | ) => {
6 | const [width, setWidth] = useState(0)
7 |
8 | useEffect(() => {
9 | if (ref.current) {
10 | const observer = new ResizeObserver((entries) => {
11 | const { width } = entries[0].contentRect
12 | setWidth(width)
13 | })
14 | observer.observe(ref.current)
15 | return () => {
16 | if (ref.current) {
17 | observer.unobserve(ref.current)
18 | }
19 | }
20 | }
21 | }, [ref])
22 |
23 | return width
24 | }
25 |
--------------------------------------------------------------------------------
/packages/slider/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/slider/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/space/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/space/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./space"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/space/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type SpaceSize = "mini" | "small" | "medium" | "large" | string
5 | export type SpaceAlign = "start" | "center" | "end" | "baseline"
6 | export type SpaceDirection = "vertical" | "horizontal"
7 |
8 | export interface SpaceProps extends HTMLAttributes, BoxProps {
9 | size?: SpaceSize | SpaceSize[]
10 | align?: SpaceAlign
11 | direction?: SpaceDirection
12 | divider?: boolean
13 | wrap?: boolean
14 | }
15 |
--------------------------------------------------------------------------------
/packages/space/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/space/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/spin/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/spin/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./spin"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/spin/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type SpinSize = "small" | "medium" | "large"
5 |
6 | export type SpinColorScheme =
7 | | string
8 | | "white"
9 | | "blackAlpha"
10 | | "gray"
11 | | "grayBlue"
12 | | "red"
13 | | "orange"
14 | | "yellow"
15 | | "green"
16 | | "blue"
17 | | "cyan"
18 | | "purple"
19 | | "techPink"
20 | | "techPurple"
21 |
22 | export interface SpinProps extends HTMLAttributes, BoxProps {
23 | block?: boolean
24 | loading?: boolean
25 | size?: SpinSize
26 | icon?: ReactNode
27 | element?: ReactNode
28 | tip?: string | ReactNode
29 | colorScheme?: SpinColorScheme
30 | }
31 |
--------------------------------------------------------------------------------
/packages/spin/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/spin/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/statistic/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/packages/statistic/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./statistic"
2 | export * from "./interface"
3 | export * from "./countdown"
4 |
--------------------------------------------------------------------------------
/packages/statistic/src/util.ts:
--------------------------------------------------------------------------------
1 | const units: [string, number][] = [
2 | ["Y", 1000 * 60 * 60 * 24 * 365], // years
3 | ["M", 1000 * 60 * 60 * 24 * 30], // months
4 | ["D", 1000 * 60 * 60 * 24], // days
5 | ["H", 1000 * 60 * 60], // hours
6 | ["m", 1000 * 60], // minutes
7 | ["s", 1000], // seconds
8 | ["S", 1], // million seconds
9 | ]
10 |
11 | // thx ant
12 | export function getDateString(millisecond: number, format: string) {
13 | let leftMillisecond: number = millisecond
14 | return units.reduce((current, [name, unit]) => {
15 | if (current.indexOf(name) !== -1) {
16 | const value = Math.floor(leftMillisecond / unit)
17 | leftMillisecond -= value * unit
18 | return current.replace(new RegExp(`${name}+`, "g"), (match: string) => {
19 | const len = match.length
20 | return value.toString().padStart(len, "0")
21 | })
22 | }
23 | return current
24 | }, format)
25 | }
26 |
--------------------------------------------------------------------------------
/packages/statistic/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/statistic/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/steps/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/packages/steps/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./steps"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/steps/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/steps/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/switch/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./interface"
2 | export * from "./switch"
3 |
--------------------------------------------------------------------------------
/packages/switch/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { ButtonHTMLAttributes, MouseEvent, ReactNode } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type SwitchColorScheme =
5 | | "white"
6 | | "blackAlpha"
7 | | "gray"
8 | | "red"
9 | | "orange"
10 | | "yellow"
11 | | "green"
12 | | "blue"
13 | | "cyan"
14 | | "purple"
15 | | "grayBlue"
16 | | "techPurple"
17 | | "techPink"
18 | | string
19 |
20 | export type SwitchSize = "medium" | "large"
21 |
22 | export interface SwitchProps
23 | extends Omit, "onChange">,
24 | BoxProps {
25 | colorScheme?: SwitchColorScheme
26 | disabled?: boolean
27 | size?: SwitchSize
28 | checkedText?: string | ReactNode
29 | uncheckedText?: string | ReactNode
30 | uncheckedIcon?: ReactNode
31 | checkedIcon?: ReactNode
32 | defaultChecked?: boolean
33 | checked?: boolean
34 | onChange?: (value: boolean, event: MouseEvent) => void
35 | }
36 |
--------------------------------------------------------------------------------
/packages/switch/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/switch/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/system/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/system/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./omit"
2 | export * from "./use-merge-value"
3 | export * from "./is"
4 | export * from "./raf"
5 | export * from "./throttle-by-raf"
6 | export * from "./keycode"
7 | export * from "./easing"
8 | export * from "./dayjs"
9 | export * from "./utils"
10 | export * from "./merge-ref"
11 | export * from "./style"
12 | export * from "./use-previous"
13 |
--------------------------------------------------------------------------------
/packages/system/src/keycode.ts:
--------------------------------------------------------------------------------
1 | // keycode definition
2 |
3 | export const KeyCode = {
4 | Enter: 13,
5 | Esc: 27,
6 | ArrowLeft: 37,
7 | ArrowUp: 38,
8 | ArrowRight: 39,
9 | ArrowDown: 40,
10 | }
11 |
--------------------------------------------------------------------------------
/packages/system/src/omit.ts:
--------------------------------------------------------------------------------
1 | // thx arco.design
2 | // delete keys from object
3 | export function omit(
4 | obj: T,
5 | keys: Array,
6 | ): Omit {
7 | const clone = {
8 | ...obj,
9 | }
10 | keys.forEach((key) => {
11 | if ((key as K) in clone) {
12 | delete clone[key as K]
13 | }
14 | })
15 | return clone
16 | }
17 |
--------------------------------------------------------------------------------
/packages/system/src/pick.ts:
--------------------------------------------------------------------------------
1 | // pick item from object
2 | export default function pick(
3 | obj: T,
4 | keys: Array,
5 | ): Pick {
6 | const clone = {} as Pick
7 | keys.forEach((key) => {
8 | const k = key as K
9 | if ((key as K) in obj) {
10 | clone[k] = obj[k]
11 | }
12 | })
13 | return clone
14 | }
15 |
16 | export function pickDataAttributes(
17 | obj: Record,
18 | ): Record {
19 | const clone = {} as Record
20 |
21 | obj &&
22 | Object.keys(obj).forEach((key) => {
23 | const k = String(key)
24 | if (k.indexOf("data-") === 0) {
25 | clone[k] = obj[k]
26 | }
27 | if (k.indexOf("aria-") === 0) {
28 | clone[k] = obj[k]
29 | }
30 | })
31 |
32 | return clone
33 | }
34 |
--------------------------------------------------------------------------------
/packages/system/src/style.ts:
--------------------------------------------------------------------------------
1 | interface StyleObj extends CSSStyleDeclaration {
2 | [index: string]: any
3 | }
4 |
5 | /**
6 | * Get element style value, e.g. width, margin-left..
7 | *
8 | */
9 | export function getStyle(
10 | element: HTMLElement,
11 | prop: string,
12 | pseudoElement: string | null = null,
13 | ): string {
14 | if (!element || !prop) {
15 | return ""
16 | }
17 |
18 | let style = (element.style as StyleObj)[prop]
19 |
20 | try {
21 | if (document.defaultView) {
22 | const computedStyles = document.defaultView.getComputedStyle(
23 | element,
24 | pseudoElement,
25 | )
26 | return style || (computedStyles as StyleObj)[prop] || ""
27 | }
28 | } catch (e) {
29 | return style
30 | }
31 |
32 | return ""
33 | }
34 |
--------------------------------------------------------------------------------
/packages/system/src/throttle-by-raf.ts:
--------------------------------------------------------------------------------
1 | // thx arco.design
2 | import { raf, caf } from "./raf"
3 |
4 | export function throttleByRaf(cb: (...args: any[]) => void) {
5 | let timer: null | number = null
6 |
7 | const throttle = function (...args: any[]) {
8 | timer && caf(timer)
9 | timer = raf(() => {
10 | cb(...args)
11 | timer = null
12 | })
13 | }
14 |
15 | throttle.cancel = () => {
16 | caf(timer)
17 | timer = null
18 | }
19 |
20 | return throttle
21 | }
22 |
--------------------------------------------------------------------------------
/packages/system/src/use-previous.ts:
--------------------------------------------------------------------------------
1 | import { ComponentState, PropsWithoutRef, useEffect, useRef } from "react"
2 |
3 | export function usePrevious(value: PropsWithoutRef | ComponentState) {
4 | const ref = useRef()
5 | useEffect(() => {
6 | ref.current = value
7 | })
8 | return ref.current
9 | }
10 |
--------------------------------------------------------------------------------
/packages/system/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/system/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/table/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/packages/table/src/filterFn.ts:
--------------------------------------------------------------------------------
1 | import { FilterOptionsMap } from "./utils"
2 | import { CustomFilterFn, FilterOptions } from "./interface"
3 | import { isObject, isString } from "@illa-design/system"
4 |
5 | export function isTableFilterFn(value: string): value is CustomFilterFn {
6 | return value in FilterOptionsMap
7 | }
8 |
9 | export function isFilterOption(option: unknown): option is FilterOptions {
10 | return (
11 | isObject(option) &&
12 | "id" in option &&
13 | isString(option.id) &&
14 | "filterFn" in option &&
15 | isTableFilterFn(option.filterFn) &&
16 | "value" in option
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/packages/table/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./table"
2 | export * from "./interface"
3 | export * from "./style"
4 | export * from "./tbody"
5 | export * from "./td"
6 | export * from "./tfoot"
7 | export * from "./th"
8 | export * from "./thead"
9 | export * from "./tr"
10 | export * from "./table-data"
11 | export * from "./filterFn"
12 |
--------------------------------------------------------------------------------
/packages/table/src/react-table.d.ts:
--------------------------------------------------------------------------------
1 | import type { RowData, CellContext } from "@tanstack/react-table"
2 | import "@tanstack/react-table"
3 | import { SerializedStyles } from "@emotion/react"
4 |
5 | declare module "@tanstack/react-table" {
6 | interface ColumnMeta {
7 | custom?: boolean
8 | style?: SerializedStyles
9 | getBackgroundColor?: (
10 | props: CellContext,
11 | ) => string | undefined
12 | getRenderedValueAsString?: (props: CellContext) => string
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/table/src/table-context.ts:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 | import { TableContextProps } from "./interface"
3 |
4 | export const TableContext = createContext(
5 | undefined,
6 | )
7 |
8 | TableContext.displayName = "TableContext"
9 |
--------------------------------------------------------------------------------
/packages/table/src/table-data.ts:
--------------------------------------------------------------------------------
1 | export interface TableData {}
2 |
--------------------------------------------------------------------------------
/packages/table/src/table.tsx:
--------------------------------------------------------------------------------
1 | import { TableProps } from "./interface"
2 | import { TableData } from "./table-data"
3 | import { RenderDirectTable } from "./render-direct-table"
4 | import { RenderDataDrivenTable } from "./render-data-driven-table"
5 |
6 | export function Table(
7 | props: TableProps,
8 | ) {
9 | const {
10 | columns,
11 | data,
12 | onSortingChange,
13 | onColumnSizingChange,
14 | onColumnFiltersChange,
15 | onRowSelectionChange,
16 | onPaginationChange,
17 | ...otherProps
18 | } = props
19 | if (columns == undefined || data == undefined) {
20 | return RenderDirectTable(otherProps)
21 | } else {
22 | return RenderDataDrivenTable(props)
23 | }
24 | }
25 |
26 | Table.displayName = "Table"
27 |
--------------------------------------------------------------------------------
/packages/table/src/tbody.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef } from "react"
2 | import { TBodyProps } from "./interface"
3 | import { css } from "@emotion/react"
4 | import { applyBoxStyle, deleteCssProps } from "@illa-design/theme"
5 |
6 | export const TBody = forwardRef(
7 | (props, ref) => {
8 | const { ...otherProps } = props
9 | return (
10 |
15 | )
16 | },
17 | )
18 |
19 | TBody.displayName = "TBody"
20 |
--------------------------------------------------------------------------------
/packages/table/src/tfoot.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef, useContext } from "react"
2 | import { TFootProps } from "./interface"
3 | import { css } from "@emotion/react"
4 | import { TableContext } from "./table-context"
5 | import { applyBoxStyle, deleteCssProps } from "@illa-design/theme"
6 |
7 | export const TFoot = forwardRef(
8 | (props, ref) => {
9 | const { ...otherProps } = props
10 | const tableContext = useContext(TableContext)
11 | return tableContext?.showFooter ? (
12 |
17 | ) : null
18 | },
19 | )
20 |
21 | TFoot.displayName = "TFoot"
22 |
--------------------------------------------------------------------------------
/packages/table/src/thead.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef, useContext } from "react"
2 | import { THeadProps } from "./interface"
3 | import { css } from "@emotion/react"
4 | import { TableContext } from "./table-context"
5 | import { applyBoxStyle, deleteCssProps } from "@illa-design/theme"
6 | import { applyPinedStyle, applyResizerTableHeaderStyle } from "./style"
7 |
8 | export const Thead = forwardRef(
9 | (props, ref) => {
10 | const { pinedHeader, ...otherProps } = props
11 | const tableContext = useContext(TableContext)
12 |
13 | return tableContext?.showHeader ? (
14 |
23 | ) : null
24 | },
25 | )
26 |
27 | Thead.displayName = "Thead"
28 |
--------------------------------------------------------------------------------
/packages/table/src/tr.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef, useContext } from "react"
2 | import { TrProps } from "./interface"
3 | import { applyBoxStyle, deleteCssProps } from "@illa-design/theme"
4 | import { TableContext } from "./table-context"
5 | import {
6 | applyBgHoverStyle,
7 | applyNormalStyle,
8 | applySelectedStyle,
9 | } from "./style"
10 |
11 | export const Tr = forwardRef((props, ref) => {
12 | const { hoverable, selected, ...otherProps } = props
13 | const context = useContext(TableContext)
14 |
15 | return (
16 |
26 | )
27 | })
28 |
29 | Tr.displayName = "Tr"
30 |
--------------------------------------------------------------------------------
/packages/table/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/table/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/tabs/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/tabs/src/constants.ts:
--------------------------------------------------------------------------------
1 | export const SCROLL_ICON_WIDTH = 12
2 |
--------------------------------------------------------------------------------
/packages/tabs/src/context/context.tsx:
--------------------------------------------------------------------------------
1 | import { FC, createContext } from "react"
2 | import { TabsProps } from "../interface"
3 | import { ProviderProps, Inject } from "./interface"
4 |
5 | export const TabContext = createContext(
6 | {} as Inject & ProviderProps & TabsProps,
7 | )
8 |
9 | export const TabsProvider: FC = (props) => {
10 | const { children, ...data } = props
11 |
12 | return (
13 | {children}
14 | )
15 | }
16 |
17 | TabsProvider.displayName = "TabsProvider"
18 |
--------------------------------------------------------------------------------
/packages/tabs/src/context/interface.ts:
--------------------------------------------------------------------------------
1 | import { ReactNode } from "react"
2 |
3 | export interface ProviderProps {
4 | selectedKey?: string
5 | handleSelectTab: (key: string | undefined) => void
6 | handleDeleteTab: (key: string | undefined) => void
7 | }
8 |
9 | export interface Inject {
10 | children?: ReactNode
11 | }
12 |
--------------------------------------------------------------------------------
/packages/tabs/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./tabs"
2 | export * from "./interface"
3 | export * from "./tab-pane"
4 |
--------------------------------------------------------------------------------
/packages/tabs/src/utils.ts:
--------------------------------------------------------------------------------
1 | import { TabPosition } from "./interface"
2 |
3 | export const isHorizontalLayout = (tabPosition?: TabPosition) => {
4 | return tabPosition === "left" || tabPosition === "right"
5 | }
6 |
--------------------------------------------------------------------------------
/packages/tabs/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/tabs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/tag/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/tag/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./tag"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/tag/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, ReactNode, SyntheticEvent } from "react"
2 | import { BoxProps } from "@illa-design/theme"
3 |
4 | export type TagColorScheme =
5 | | string
6 | | "white"
7 | | "blackAlpha"
8 | | "gray"
9 | | "grayBlue"
10 | | "red"
11 | | "orange"
12 | | "yellow"
13 | | "green"
14 | | "blue"
15 | | "cyan"
16 | | "purple"
17 | | "techPurple"
18 | | "techPink"
19 |
20 | export type TagVariant = "outline" | "fill" | "light"
21 |
22 | export type TagSize = "small" | "medium" | "large"
23 |
24 | export interface TagProps extends HTMLAttributes, BoxProps {
25 | clickable?: boolean
26 | colorScheme?: TagColorScheme
27 | size?: TagSize
28 | variant?: TagVariant
29 | visible?: boolean
30 | closable?: boolean
31 | icon?: ReactNode
32 | onClose?: (event: SyntheticEvent) => void
33 | }
34 |
--------------------------------------------------------------------------------
/packages/tag/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/tag/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/theme/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/theme/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./global-color"
2 | export * from "./interface"
3 | export * from "./color-palette"
4 | export * from "./style"
5 | export * from "./z-index"
6 |
--------------------------------------------------------------------------------
/packages/theme/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/theme/src/z-index.ts:
--------------------------------------------------------------------------------
1 | export const zIndex = {
2 | auto: "auto",
3 | hide: -1,
4 | base: 0,
5 | inputFocus: 2,
6 | tabs: 2,
7 | button: 2,
8 | modal: 1000,
9 | drawer: 1001,
10 | notification: 1002,
11 | message: 1003,
12 | table: 1,
13 | }
14 |
--------------------------------------------------------------------------------
/packages/theme/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/time-picker/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/packages/time-picker/src/context.ts:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 |
3 | type TimezoneContext = {
4 | utcOffset?: number
5 | timezone?: string
6 | }
7 |
8 | export const PickerContext = createContext({})
9 |
--------------------------------------------------------------------------------
/packages/time-picker/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./interface"
2 | export * from "./single-picker"
3 | export * from "./range-picker"
4 | export * from "./popup/interface"
5 | export * from "./popup/time-picker-body"
6 | export * from "./popup/range-picker-body"
7 |
--------------------------------------------------------------------------------
/packages/time-picker/src/popup/utils.ts:
--------------------------------------------------------------------------------
1 | import { getColumnsFromFormat } from "../utils"
2 |
3 | export const isUse12Hours = (format: string, use12Hours?: boolean) => {
4 | return use12Hours || getColumnsFromFormat(format).use12Hours
5 | }
6 |
7 | export const getHoursShowList = (step: number = 1, use12Hours?: boolean) => {
8 | const list: number[] = []
9 | for (let i = 0; i < (use12Hours ? 12 : 24); i += step) {
10 | list.push(i)
11 | }
12 | if (use12Hours) {
13 | list[0] = 12
14 | }
15 | return list
16 | }
17 |
18 | export const getMinutesShowList = (step: number = 1) => {
19 | const list: number[] = []
20 | for (let i = 0; i < 60; i += step) {
21 | list.push(i)
22 | }
23 | return list
24 | }
25 |
26 | export const getSecondsShowList = (step: number = 1) => {
27 | const list: number[] = []
28 | for (let i = 0; i < 60; i += step) {
29 | list.push(i)
30 | }
31 | return list
32 | }
33 |
--------------------------------------------------------------------------------
/packages/time-picker/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/time-picker/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/timeline/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/timeline/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./timeline"
2 | export * from "./interface"
3 | export * from "./timelineItem"
4 |
--------------------------------------------------------------------------------
/packages/timeline/src/timeline-context.tsx:
--------------------------------------------------------------------------------
1 | import { createContext } from "react"
2 | import { TimelineContextProps } from "./interface"
3 |
4 | export const TimelineContext = createContext(
5 | undefined,
6 | )
7 |
8 | TimelineContext.displayName = "TimelineContext"
9 |
--------------------------------------------------------------------------------
/packages/timeline/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/trigger/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/trigger/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./trigger"
2 | export * from "./interface"
3 | export * from "./trigger-provider"
4 | export * from "./trigger-context"
5 |
--------------------------------------------------------------------------------
/packages/trigger/src/triangle.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "@illa-design/icon"
2 |
3 | export const TriangleTop = createIcon({
4 | title: "TriangleIconTop",
5 | viewBox: "0 0 8 4",
6 | d: "M8 0H0L3.29289 3.29289C3.68342 3.68342 4.31658 3.68342 4.70711 3.29289L8 0Z",
7 | })
8 |
9 | export const TriangleBottom = createIcon({
10 | title: "TriangleIconBottom",
11 | viewBox: "0 0 8 4",
12 | d: "M8 4H0L3.29289 0.707107C3.68342 0.316583 4.31658 0.316583 4.70711 0.707107L8 4Z",
13 | })
14 |
15 | export const TriangleLeft = createIcon({
16 | title: "TriangleIconLeft",
17 | viewBox: "0 0 4 8",
18 | d: "M0 8V0L3.29289 3.29289C3.68342 3.68342 3.68342 4.31658 3.29289 4.70711L0 8Z",
19 | })
20 |
21 | export const TriangleRight = createIcon({
22 | title: "TriangleIconRight",
23 | viewBox: "0 0 4 8",
24 | d: "M4.00098 8V0L0.707366 3.29281C0.316726 3.68335 0.316726 4.31665 0.707366 4.70719L4.00098 8Z",
25 | })
26 |
--------------------------------------------------------------------------------
/packages/trigger/src/trigger-context.tsx:
--------------------------------------------------------------------------------
1 | import { TriggerContext } from "./interface"
2 | import { createContext } from "react"
3 |
4 | export const TriggerProviderContext = createContext({
5 | renderInBody: true,
6 | zIndex: 5,
7 | } as TriggerContext)
8 |
9 | TriggerProviderContext.displayName = "TriggerProviderContext"
10 |
--------------------------------------------------------------------------------
/packages/trigger/src/trigger-provider.tsx:
--------------------------------------------------------------------------------
1 | import { FC } from "react"
2 | import { TriggerContext } from "./interface"
3 | import { TriggerProviderContext } from "./trigger-context"
4 |
5 | export const TriggerProvider: FC = (props) => {
6 | const { renderInBody, zIndex } = props
7 |
8 | return (
9 |
10 | {props.children}
11 |
12 | )
13 | }
14 |
15 | TriggerProvider.displayName = "TriggerProvider"
16 |
--------------------------------------------------------------------------------
/packages/trigger/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/trigger/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/typography/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 |
--------------------------------------------------------------------------------
/packages/typography/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./text"
2 | export * from "./ellipsis-config"
3 | export * from "./copyable-config"
4 | export * from "./heading"
5 | export * from "./paragraph"
6 | export * from "./typography"
7 | export * from "./interface"
8 |
--------------------------------------------------------------------------------
/packages/typography/src/paragraph-style.ts:
--------------------------------------------------------------------------------
1 | import { css, SerializedStyles } from "@emotion/react"
2 |
3 | export function applyParagraphContainer(indent: boolean): SerializedStyles {
4 | if (indent) {
5 | return css`
6 | text-indent: 2em;
7 | font-size: 14px;
8 | line-height: 24px;
9 | `
10 | } else {
11 | return css`
12 | font-size: 14px;
13 | line-height: 24px;
14 | `
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/packages/typography/src/text-style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 |
3 | export const textStyle = css`
4 | line-height: 1.6;
5 | `
6 |
--------------------------------------------------------------------------------
/packages/typography/src/typography.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef } from "react"
2 | import { applyTypoContainer } from "./typograph-style"
3 | import { applyBoxStyle, deleteCssProps } from "@illa-design/theme"
4 | import { TypographyProps } from "./interface"
5 |
6 | export const Typography = forwardRef(
7 | (props, ref) => {
8 | return (
9 |
14 | {props.children}
15 |
16 | )
17 | },
18 | )
19 |
20 | Typography.displayName = "Typography"
21 |
--------------------------------------------------------------------------------
/packages/typography/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/typography/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/packages/upload/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/packages/upload/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./upload"
2 | export * from "./interface"
3 |
--------------------------------------------------------------------------------
/packages/upload/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/plop-templates/component/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/plop-templates/component/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @illa-design/{{lowerCase name}}
2 |
--------------------------------------------------------------------------------
/plop-templates/component/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./{{lowerCase name}}"
2 | export * from "./interface"
3 | export * from "./style"
--------------------------------------------------------------------------------
/plop-templates/component/src/interface.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes, MouseEvent, ReactNode } from "react"
2 |
3 | export interface {{properCase name}}Props {
4 | }
5 |
--------------------------------------------------------------------------------
/plop-templates/component/src/style.ts:
--------------------------------------------------------------------------------
1 | import { css } from "@emotion/react"
2 |
3 | export function apply{{properCase name}}(){
4 |
5 | }
--------------------------------------------------------------------------------
/plop-templates/component/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/plop-templates/component/src/{{dashCase name}}.tsx:
--------------------------------------------------------------------------------
1 | import { forwardRef } from "react"
2 | import { {{properCase name}}Props } from "./interface"
3 |
4 | export const {{properCase name}} = forwardRef((props, ref) => {
5 |
6 | return (
7 |
8 | )
9 | })
10 |
11 | {{properCase name}}.displayName = "{{properCase name}}"
12 |
--------------------------------------------------------------------------------
/plop-templates/component/stories/{{dashCase name}}.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryFn } from "@storybook/react"
2 | import { {{properCase name}}, {{properCase name}}Props } from "../src"
3 |
4 | export default {
5 | title: "{{type}}/{{properCase name}}",
6 | component: {{properCase name}},
7 | } as Meta
8 |
9 | export const Basic: StoryFn<{{properCase name}}Props> = (args) => {
10 | return (
11 | <{{properCase name}} {...args} />
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/plop-templates/component/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "include": [
4 | "./src"
5 | ]
6 | }
--------------------------------------------------------------------------------
/plop-templates/icon/icon.tsx:
--------------------------------------------------------------------------------
1 | import { createIcon } from "../create-icon"
2 |
3 | export const {{ properCase name }}Icon = createIcon({
4 | title: "{{properCase name}}Icon",
5 | viewBox: "0 0 16 16",
6 | path: (
7 | /*
8 | * You should remove this comment.
9 | *
10 | * 1. Copy all paths from svg icon into here, you may need to use `<>>` to wrap multi path
11 | * 2. Replace `viewBox` props with svg icon's `viewBox`
12 | * 3. Rename `kebabCase` to `camelCase`. e.g. stroke-width -> strokeWidth
13 | * 4. Check this icon in storybook
14 | *
15 | * Done!
16 | */
17 | ),
18 | })
19 |
20 | {{properCase name}}Icon.displayName = "{{properCase name}}Icon"
21 |
--------------------------------------------------------------------------------
/plop-templates/icon/story.tsx:
--------------------------------------------------------------------------------
1 | import { StoryFn } from "@storybook/react";
2 |
3 | export const {{properCase name}}: StoryFn = (props: IconProps) => (
4 | <{{properCase name}}Icon {...props} />
5 | )
6 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | # all packages in direct subdirs of packages/
3 | - "packages/*"
4 | - "apps/*"
5 |
--------------------------------------------------------------------------------
/setup-jest.js:
--------------------------------------------------------------------------------
1 | class IntersectionObserver {
2 | observe = jest.fn()
3 | disconnect = jest.fn()
4 | unobserve = jest.fn()
5 | }
6 |
7 | Object.defineProperty(global, "IntersectionObserver", {
8 | writable: true,
9 | configurable: true,
10 | value: IntersectionObserver,
11 | })
12 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "useDefineForClassFields": true,
5 | "lib": [
6 | "DOM",
7 | "DOM.Iterable",
8 | "ESNext"
9 | ],
10 | "allowJs": false,
11 | "skipLibCheck": false,
12 | "esModuleInterop": true,
13 | "allowSyntheticDefaultImports": true,
14 | "strict": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "module": "ESNext",
17 | "moduleResolution": "Node",
18 | "resolveJsonModule": true,
19 | "isolatedModules": true,
20 | "jsx": "react-jsx",
21 | "jsxImportSource": "@emotion/react"
22 | },
23 | "exclude": [
24 | "node_modules",
25 | "plop-templates",
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turbo.build/schema.json",
3 | "extends": ["//"],
4 | "pipeline": {
5 | "build": {
6 | "outputs": ["dist/**"],
7 | "dependsOn": ["^build"],
8 | "inputs": ["src/**/*.tsx", "src/**/*.ts"]
9 | },
10 | "bs": {},
11 | "dev": {
12 | "cache": false,
13 | "persistent": true
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------