@chain-ui/core 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +38 -0
  2. package/dist/index.cjs +1 -0
  3. package/dist/index.css +1 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +1051 -0
  6. package/dist/src/components/alert/alert.d.ts +15 -0
  7. package/dist/src/components/alert/alert.stories.d.ts +13 -0
  8. package/dist/src/components/alert/alert.test.d.ts +1 -0
  9. package/dist/src/components/alert/index.d.ts +2 -0
  10. package/dist/src/components/badge/badge.d.ts +12 -0
  11. package/dist/src/components/badge/badge.stories.d.ts +13 -0
  12. package/dist/src/components/badge/badge.test.d.ts +1 -0
  13. package/dist/src/components/badge/index.d.ts +2 -0
  14. package/dist/src/components/button/button.d.ts +13 -0
  15. package/dist/src/components/button/button.stories.d.ts +11 -0
  16. package/dist/src/components/button/button.test.d.ts +1 -0
  17. package/dist/src/components/button/index.d.ts +2 -0
  18. package/dist/src/components/divider/divider.d.ts +8 -0
  19. package/dist/src/components/divider/divider.stories.d.ts +12 -0
  20. package/dist/src/components/divider/divider.test.d.ts +1 -0
  21. package/dist/src/components/divider/index.d.ts +2 -0
  22. package/dist/src/components/form-item/form-item.d.ts +15 -0
  23. package/dist/src/components/form-item/form-item.stories.d.ts +16 -0
  24. package/dist/src/components/form-item/form-item.test.d.ts +1 -0
  25. package/dist/src/components/form-item/index.d.ts +2 -0
  26. package/dist/src/components/index.d.ts +12 -0
  27. package/dist/src/components/input/index.d.ts +2 -0
  28. package/dist/src/components/input/input.d.ts +18 -0
  29. package/dist/src/components/input/input.stories.d.ts +20 -0
  30. package/dist/src/components/input/input.test.d.ts +1 -0
  31. package/dist/src/components/modal/index.d.ts +2 -0
  32. package/dist/src/components/modal/modal.d.ts +25 -0
  33. package/dist/src/components/modal/modal.stories.d.ts +12 -0
  34. package/dist/src/components/modal/modal.test.d.ts +1 -0
  35. package/dist/src/components/pagination/index.d.ts +2 -0
  36. package/dist/src/components/pagination/pagination.d.ts +23 -0
  37. package/dist/src/components/pagination/pagination.stories.d.ts +12 -0
  38. package/dist/src/components/pagination/pagination.test.d.ts +1 -0
  39. package/dist/src/components/select/index.d.ts +2 -0
  40. package/dist/src/components/select/select.d.ts +35 -0
  41. package/dist/src/components/select/select.stories.d.ts +21 -0
  42. package/dist/src/components/select/select.test.d.ts +1 -0
  43. package/dist/src/components/space/index.d.ts +2 -0
  44. package/dist/src/components/space/space.d.ts +9 -0
  45. package/dist/src/components/space/space.stories.d.ts +10 -0
  46. package/dist/src/components/space/space.test.d.ts +1 -0
  47. package/dist/src/components/table/index.d.ts +2 -0
  48. package/dist/src/components/table/table.d.ts +54 -0
  49. package/dist/src/components/table/table.stories.d.ts +13 -0
  50. package/dist/src/components/table/table.test.d.ts +1 -0
  51. package/dist/src/components/tag/index.d.ts +2 -0
  52. package/dist/src/components/tag/tag.d.ts +10 -0
  53. package/dist/src/components/tag/tag.stories.d.ts +12 -0
  54. package/dist/src/components/tag/tag.test.d.ts +1 -0
  55. package/dist/src/index.d.ts +1 -0
  56. package/dist/src/theme/index.d.ts +1 -0
  57. package/dist/src/utils/index.d.ts +1 -0
  58. package/package.json +54 -0
@@ -0,0 +1,15 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
3
+ color?: 'success' | 'warning' | 'error' | 'info';
4
+ size?: 'sm' | 'md' | 'lg';
5
+ message: ReactNode;
6
+ description?: ReactNode;
7
+ showIcon?: boolean;
8
+ closable?: boolean;
9
+ closeAriaLabel?: string;
10
+ onClose?: () => void;
11
+ open?: boolean;
12
+ action?: ReactNode;
13
+ children?: ReactNode;
14
+ }
15
+ export declare const Alert: import('react').ForwardRefExoticComponent<AlertProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,13 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Alert } from './alert';
3
+ declare const meta: Meta<typeof Alert>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Alert>;
6
+ export declare const Success: Story;
7
+ export declare const Warning: Story;
8
+ export declare const Error: Story;
9
+ export declare const Info: Story;
10
+ export declare const WithDescription: Story;
11
+ export declare const Closable: Story;
12
+ export declare const Small: Story;
13
+ export declare const Large: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Alert } from './alert';
2
+ export type { AlertProps } from './alert';
@@ -0,0 +1,12 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
3
+ count?: number | string;
4
+ dot?: boolean;
5
+ color?: 'primary' | 'brand' | 'success' | 'warning' | 'error' | 'info' | 'default';
6
+ size?: 'sm' | 'md' | 'lg';
7
+ overflowCount?: number;
8
+ showZero?: boolean;
9
+ offset?: [number, number];
10
+ children?: ReactNode;
11
+ }
12
+ export declare const Badge: import('react').ForwardRefExoticComponent<BadgeProps & import('react').RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,13 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Badge } from './badge';
3
+ declare const meta: Meta<typeof Badge>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Badge>;
6
+ export declare const Number: Story;
7
+ export declare const Overflow: Story;
8
+ export declare const Dot: Story;
9
+ export declare const Small: Story;
10
+ export declare const Large: Story;
11
+ export declare const WithChildren: Story;
12
+ export declare const DotWithChildren: Story;
13
+ export declare const Colors: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Badge } from './badge';
2
+ export type { BadgeProps } from './badge';
@@ -0,0 +1,13 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
3
+ variant?: 'solid' | 'outline' | 'ghost' | 'link';
4
+ color?: 'primary' | 'brand' | 'success' | 'warning' | 'error' | 'info';
5
+ size?: 'sm' | 'md' | 'lg';
6
+ shape?: 'default' | 'circle' | 'round';
7
+ loading?: boolean;
8
+ icon?: ReactNode;
9
+ iconRight?: ReactNode;
10
+ htmlType?: 'button' | 'submit' | 'reset';
11
+ ariaLabel?: string;
12
+ }
13
+ export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Button } from './button';
3
+ declare const meta: Meta<typeof Button>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Button>;
6
+ export declare const Solid: Story;
7
+ export declare const Outline: Story;
8
+ export declare const Ghost: Story;
9
+ export declare const Link: Story;
10
+ export declare const Small: Story;
11
+ export declare const Large: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Button } from './button';
2
+ export type { ButtonProps } from './button';
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface DividerProps extends Omit<HTMLAttributes<HTMLHRElement>, 'children'> {
3
+ orientation?: 'horizontal' | 'vertical';
4
+ type?: 'solid' | 'dashed';
5
+ size?: 'sm' | 'md' | 'lg';
6
+ children?: ReactNode;
7
+ }
8
+ export declare const Divider: import('react').ForwardRefExoticComponent<DividerProps & import('react').RefAttributes<HTMLHRElement>>;
@@ -0,0 +1,12 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Divider } from './divider';
3
+ declare const meta: Meta<typeof Divider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Divider>;
6
+ export declare const Horizontal: Story;
7
+ export declare const Dashed: Story;
8
+ export declare const Vertical: Story;
9
+ export declare const WithText: Story;
10
+ export declare const Small: Story;
11
+ export declare const Large: Story;
12
+ export declare const DashedWithText: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Divider } from './divider';
2
+ export type { DividerProps } from './divider';
@@ -0,0 +1,15 @@
1
+ import { default as React, HTMLAttributes, ReactNode } from 'react';
2
+ export interface FormItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
3
+ label?: ReactNode;
4
+ labelWidth?: number | string;
5
+ labelAlign?: 'left' | 'right';
6
+ required?: boolean;
7
+ requiredMark?: ReactNode;
8
+ colon?: boolean;
9
+ colonText?: string;
10
+ status?: 'default' | 'error' | 'warning';
11
+ help?: ReactNode;
12
+ layout?: 'horizontal' | 'vertical';
13
+ children: ReactNode;
14
+ }
15
+ export declare const FormItem: React.ForwardRefExoticComponent<FormItemProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { FormItem } from './form-item';
3
+ declare const meta: Meta<typeof FormItem>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof FormItem>;
6
+ export declare const Default: Story;
7
+ export declare const Required: Story;
8
+ export declare const CustomRequiredMark: Story;
9
+ export declare const Vertical: Story;
10
+ export declare const Error: Story;
11
+ export declare const Warning: Story;
12
+ export declare const NoLabel: Story;
13
+ export declare const LeftAlign: Story;
14
+ export declare const WithoutColon: Story;
15
+ export declare const LongLabel: Story;
16
+ export declare const CustomLabelWidth: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { FormItem } from './form-item';
2
+ export type { FormItemProps } from './form-item';
@@ -0,0 +1,12 @@
1
+ export * from './button';
2
+ export * from './input';
3
+ export * from './form-item';
4
+ export * from './select';
5
+ export * from './modal';
6
+ export * from './table';
7
+ export * from './tag';
8
+ export * from './badge';
9
+ export * from './pagination';
10
+ export * from './alert';
11
+ export * from './space';
12
+ export * from './divider';
@@ -0,0 +1,2 @@
1
+ export { Input } from './input';
2
+ export type { InputProps } from './input';
@@ -0,0 +1,18 @@
1
+ import { default as React, InputHTMLAttributes, ReactNode } from 'react';
2
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size' | 'value' | 'defaultValue' | 'prefix'> {
3
+ value?: string;
4
+ defaultValue?: string;
5
+ onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;
6
+ variant?: 'outline' | 'filled' | 'borderless';
7
+ size?: 'sm' | 'md' | 'lg';
8
+ status?: 'default' | 'error' | 'warning';
9
+ prefix?: ReactNode;
10
+ suffix?: ReactNode;
11
+ allowClear?: boolean;
12
+ clearAriaLabel?: string;
13
+ showCount?: boolean;
14
+ maxLength?: number;
15
+ className?: string;
16
+ style?: React.CSSProperties;
17
+ }
18
+ export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,20 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Input } from './input';
3
+ declare const meta: Meta<typeof Input>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Input>;
6
+ export declare const Default: Story;
7
+ export declare const Outline: Story;
8
+ export declare const Filled: Story;
9
+ export declare const Borderless: Story;
10
+ export declare const Small: Story;
11
+ export declare const Large: Story;
12
+ export declare const Error: Story;
13
+ export declare const Warning: Story;
14
+ export declare const Disabled: Story;
15
+ export declare const ReadOnly: Story;
16
+ export declare const WithPrefix: Story;
17
+ export declare const WithSuffix: Story;
18
+ export declare const AllowClear: Story;
19
+ export declare const ShowCount: Story;
20
+ export declare const Password: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Modal } from './modal';
2
+ export type { ModalProps } from './modal';
@@ -0,0 +1,25 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { ButtonProps } from '../button';
3
+ export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
+ open?: boolean;
5
+ onCancel?: () => void;
6
+ title?: ReactNode;
7
+ children?: ReactNode;
8
+ footer?: ReactNode | null;
9
+ onOk?: () => void | Promise<void>;
10
+ okText?: string;
11
+ okButtonProps?: ButtonProps;
12
+ cancelText?: string;
13
+ cancelButtonProps?: ButtonProps;
14
+ confirmLoading?: boolean;
15
+ closable?: boolean;
16
+ closeAriaLabel?: string;
17
+ maskClosable?: boolean;
18
+ keyboard?: boolean;
19
+ destroyOnClose?: boolean;
20
+ size?: 'sm' | 'md' | 'lg';
21
+ width?: number | string;
22
+ centered?: boolean;
23
+ getContainer?: () => HTMLElement;
24
+ }
25
+ export declare const Modal: import('react').ForwardRefExoticComponent<ModalProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,12 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Modal } from './modal';
3
+ declare const meta: Meta<typeof Modal>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Modal>;
6
+ export declare const Default: Story;
7
+ export declare const Small: Story;
8
+ export declare const Large: Story;
9
+ export declare const Centered: Story;
10
+ export declare const NoFooter: Story;
11
+ export declare const CustomFooter: Story;
12
+ export declare const AsyncOnOk: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Pagination } from './pagination';
2
+ export type { PaginationProps, PaginationLocale } from './pagination';
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface PaginationLocale {
3
+ total?: string;
4
+ items?: string;
5
+ prevPage?: string;
6
+ nextPage?: string;
7
+ jumpTo?: string;
8
+ }
9
+ export interface PaginationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
10
+ value?: number;
11
+ defaultValue?: number;
12
+ pageSize?: number;
13
+ total?: number;
14
+ onChange?: (page: number, pageSize: number) => void;
15
+ showSizeChanger?: boolean;
16
+ pageSizeOptions?: number[];
17
+ showQuickJumper?: boolean;
18
+ showTotal?: boolean;
19
+ size?: 'sm' | 'md' | 'lg';
20
+ disabled?: boolean;
21
+ locale?: PaginationLocale;
22
+ }
23
+ export declare const Pagination: import('react').ForwardRefExoticComponent<PaginationProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,12 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Pagination } from './pagination';
3
+ declare const meta: Meta<typeof Pagination>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Pagination>;
6
+ export declare const Default: Story;
7
+ export declare const Small: Story;
8
+ export declare const Large: Story;
9
+ export declare const Disabled: Story;
10
+ export declare const ManyPages: Story;
11
+ export declare const WithLocale: Story;
12
+ export declare const Controlled: Story;
@@ -0,0 +1,2 @@
1
+ export { Select } from './select';
2
+ export type { SelectProps, SelectOption } from './select';
@@ -0,0 +1,35 @@
1
+ import { default as React, HTMLAttributes, ReactNode, MouseEvent, KeyboardEvent } from 'react';
2
+ export interface SelectOption {
3
+ label: ReactNode;
4
+ value: string | number;
5
+ disabled?: boolean;
6
+ }
7
+ type SelectValue = string | number | (string | number)[];
8
+ export interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'children' | 'value' | 'defaultValue' | 'prefix'> {
9
+ value?: SelectValue;
10
+ defaultValue?: SelectValue;
11
+ onChange?: (value: SelectValue, event?: MouseEvent | KeyboardEvent) => void;
12
+ options?: SelectOption[];
13
+ variant?: 'outline' | 'filled' | 'borderless';
14
+ size?: 'sm' | 'md' | 'lg';
15
+ status?: 'default' | 'error' | 'warning';
16
+ disabled?: boolean;
17
+ loading?: boolean;
18
+ allowClear?: boolean;
19
+ placeholder?: string;
20
+ mode?: 'single' | 'multiple';
21
+ showSearch?: boolean;
22
+ prefix?: ReactNode;
23
+ suffix?: ReactNode;
24
+ emptyText?: ReactNode;
25
+ clearAriaLabel?: string;
26
+ searchPlaceholder?: string;
27
+ expandAriaLabel?: string;
28
+ collapseAriaLabel?: string;
29
+ removeAriaLabel?: string;
30
+ dropdownClassName?: string;
31
+ dropdownStyle?: React.CSSProperties;
32
+ getPopupContainer?: () => HTMLElement;
33
+ }
34
+ export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLDivElement>>;
35
+ export {};
@@ -0,0 +1,21 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Select } from './select';
3
+ declare const meta: Meta<typeof Select>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Select>;
6
+ export declare const Default: Story;
7
+ export declare const Outline: Story;
8
+ export declare const Filled: Story;
9
+ export declare const Borderless: Story;
10
+ export declare const Small: Story;
11
+ export declare const Large: Story;
12
+ export declare const Error: Story;
13
+ export declare const Warning: Story;
14
+ export declare const Disabled: Story;
15
+ export declare const Loading: Story;
16
+ export declare const AllowClear: Story;
17
+ export declare const Multiple: Story;
18
+ export declare const WithSearch: Story;
19
+ export declare const WithPrefix: Story;
20
+ export declare const WithSuffix: Story;
21
+ export declare const Empty: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Space } from './space';
2
+ export type { SpaceProps } from './space';
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface SpaceProps extends HTMLAttributes<HTMLDivElement> {
3
+ size?: 'sm' | 'md' | 'lg' | number;
4
+ direction?: 'horizontal' | 'vertical';
5
+ align?: 'start' | 'end' | 'center' | 'baseline';
6
+ wrap?: boolean;
7
+ children: ReactNode;
8
+ }
9
+ export declare const Space: import('react').ForwardRefExoticComponent<SpaceProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Space } from './space';
3
+ declare const meta: Meta<typeof Space>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Space>;
6
+ export declare const Horizontal: Story;
7
+ export declare const Vertical: Story;
8
+ export declare const Small: Story;
9
+ export declare const Large: Story;
10
+ export declare const Wrap: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Table } from './table';
2
+ export type { TableProps, TableColumn, TableRowSelection, TablePagination, TableLocale } from './table';
@@ -0,0 +1,54 @@
1
+ import { HTMLAttributes, ReactNode, MouseEvent } from 'react';
2
+ export interface TableColumn {
3
+ key: string;
4
+ title?: ReactNode;
5
+ dataIndex?: string | string[];
6
+ width?: number | string;
7
+ align?: 'left' | 'center' | 'right';
8
+ render?: (value: unknown, record: Record<string, unknown>, index: number) => ReactNode;
9
+ ellipsis?: boolean;
10
+ }
11
+ export interface TableRowSelection {
12
+ type?: 'checkbox' | 'radio';
13
+ selectedRowKeys?: string[];
14
+ onChange?: (selectedRowKeys: string[], selectedRows: Record<string, unknown>[]) => void;
15
+ onSelect?: (record: Record<string, unknown>, selected: boolean, selectedRows: Record<string, unknown>[]) => void;
16
+ getCheckboxProps?: (record: Record<string, unknown>) => {
17
+ disabled?: boolean;
18
+ };
19
+ selectAriaLabel?: string;
20
+ }
21
+ export interface TablePagination {
22
+ current?: number;
23
+ pageSize?: number;
24
+ total?: number;
25
+ onChange?: (page: number, pageSize: number) => void;
26
+ }
27
+ export interface TableLocale {
28
+ total?: string;
29
+ items?: string;
30
+ prevPage?: string;
31
+ nextPage?: string;
32
+ }
33
+ export interface TableProps extends HTMLAttributes<HTMLDivElement> {
34
+ dataSource: Record<string, unknown>[];
35
+ columns: TableColumn[];
36
+ rowKey?: string | ((record: Record<string, unknown>) => string);
37
+ rowSelection?: TableRowSelection;
38
+ loading?: boolean;
39
+ emptyText?: ReactNode;
40
+ pagination?: false | TablePagination;
41
+ bordered?: boolean;
42
+ size?: 'sm' | 'md' | 'lg';
43
+ locale?: TableLocale;
44
+ scroll?: {
45
+ x?: number | string;
46
+ y?: number | string;
47
+ };
48
+ onRow?: (record: Record<string, unknown>, index: number) => {
49
+ onClick?: (e: MouseEvent) => void;
50
+ onDoubleClick?: (e: MouseEvent) => void;
51
+ className?: string;
52
+ };
53
+ }
54
+ export declare const Table: import('react').ForwardRefExoticComponent<TableProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,13 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Table } from './table';
3
+ declare const meta: Meta<typeof Table>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Table>;
6
+ export declare const Default: Story;
7
+ export declare const Small: Story;
8
+ export declare const Large: Story;
9
+ export declare const Borderless: Story;
10
+ export declare const Loading: Story;
11
+ export declare const Empty: Story;
12
+ export declare const WithPagination: Story;
13
+ export declare const WithRowSelection: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Tag } from './tag';
2
+ export type { TagProps } from './tag';
@@ -0,0 +1,10 @@
1
+ import { HTMLAttributes, ReactNode, MouseEvent } from 'react';
2
+ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
3
+ color?: 'primary' | 'brand' | 'success' | 'warning' | 'error' | 'info' | 'default';
4
+ variant?: 'solid' | 'outline' | 'light';
5
+ size?: 'sm' | 'md' | 'lg';
6
+ closable?: boolean;
7
+ onClose?: (e: MouseEvent) => void;
8
+ children: ReactNode;
9
+ }
10
+ export declare const Tag: import('react').ForwardRefExoticComponent<TagProps & import('react').RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,12 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Tag } from './tag';
3
+ declare const meta: Meta<typeof Tag>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Tag>;
6
+ export declare const Light: Story;
7
+ export declare const Outline: Story;
8
+ export declare const Solid: Story;
9
+ export declare const Small: Story;
10
+ export declare const Large: Story;
11
+ export declare const Closable: Story;
12
+ export declare const Colors: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@chain-ui/core",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "description": "Core UI components for Chain UI design system",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./*": {
16
+ "import": "./dist/*.js",
17
+ "require": "./dist/*.cjs",
18
+ "types": "./dist/*.d.ts"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "sideEffects": [
25
+ "*.css"
26
+ ],
27
+ "scripts": {
28
+ "build": "vite build && node -e \"require('fs').writeFileSync('dist/index.d.ts', 'export * from \\'./src/index\\';\\n')\"",
29
+ "dev": "vite build --watch",
30
+ "test": "vitest run",
31
+ "lint": "eslint src/"
32
+ },
33
+ "peerDependencies": {
34
+ "react": ">=18.0.0",
35
+ "react-dom": ">=18.0.0"
36
+ },
37
+ "devDependencies": {
38
+ "@storybook/react": "^10.4.1",
39
+ "@testing-library/jest-dom": "latest",
40
+ "@testing-library/react": "latest",
41
+ "@types/react": "latest",
42
+ "@types/react-dom": "latest",
43
+ "@vitejs/plugin-react": "latest",
44
+ "eslint": "latest",
45
+ "jsdom": "latest",
46
+ "react": "^18",
47
+ "react-dom": "^18",
48
+ "storybook": "^8.6.18",
49
+ "typescript": "latest",
50
+ "vite": "latest",
51
+ "vite-plugin-dts": "latest",
52
+ "vitest": "latest"
53
+ }
54
+ }