@antscorp/ama-ui 0.0.45 → 0.1.0

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.
package/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ import { Collapse as Collapse_2 } from 'antd-mobile';
29
29
  import { CollapseProps as CollapseProps_2 } from 'antd-mobile';
30
30
  import { ConfigProviderProps as ConfigProviderProps_2 } from 'antd-mobile';
31
31
  import { confirm as confirm_2 } from 'antd-mobile/es/components/modal/confirm';
32
+ import { CSSProperties } from 'react';
32
33
  import { DatePickerProps as DatePickerProps_2 } from 'antd-mobile';
33
34
  import { default as default_2 } from 'react';
34
35
  import { Dialog } from 'antd-mobile';
@@ -39,19 +40,14 @@ import { DotLoadingProps as DotLoadingProps_2 } from 'antd-mobile';
39
40
  import { EllipsisProps as EllipsisProps_2 } from 'antd-mobile';
40
41
  import { ErrorBlockProps as ErrorBlockProps_2 } from 'antd-mobile';
41
42
  import { FC } from 'react';
42
- import { FloatingBubble } from 'antd-mobile';
43
- import { FloatingBubbleProps } from 'antd-mobile';
44
43
  import { FloatingPanelProps as FloatingPanelProps_2 } from 'antd-mobile';
45
44
  import { FooterProps as FooterProps_2 } from 'antd-mobile';
46
- import { Form as Form_2 } from 'antd-mobile';
45
+ import { FormItemProps } from 'antd-mobile';
47
46
  import { FormProps as FormProps_2 } from 'antd-mobile';
48
47
  import { ForwardRefExoticComponent } from 'react';
49
48
  import { Grid as Grid_2 } from 'antd-mobile';
50
49
  import { GridProps as GridProps_2 } from 'antd-mobile';
51
50
  import { ImageProps as ImageProps_2 } from 'antd-mobile';
52
- import { ImageUploaderProps as ImageUploaderProps_2 } from 'antd-mobile';
53
- import { ImageUploaderRef } from 'antd-mobile';
54
- import { ImageUploadItem } from 'antd-mobile';
55
51
  import { ImageViewer as ImageViewer_2 } from 'antd-mobile';
56
52
  import { ImageViewerProps as ImageViewerProps_2 } from 'antd-mobile';
57
53
  import { IndexBar as IndexBar_2 } from 'antd-mobile';
@@ -118,10 +114,28 @@ import { TextAreaProps as TextAreaProps_2 } from 'antd-mobile';
118
114
  import { Toast } from 'antd-mobile';
119
115
  import { ToastHandler } from 'antd-mobile/es/components/toast';
120
116
  import { ToastShowProps } from 'antd-mobile';
117
+ import { Transition } from 'motion/react';
118
+ import { useForm } from 'rc-field-form';
119
+ import { useWatch } from 'rc-field-form';
121
120
  import { WaterMarkProps as WaterMarkProps_2 } from 'antd-mobile';
122
121
 
123
122
  export { Action }
124
123
 
124
+ export declare interface ActionButton {
125
+ /** Text hiển thị trên action button */
126
+ text: string;
127
+ /** Nếu giá trị là true action sẽ có kiểu highlight */
128
+ highLight?: boolean;
129
+ /** Nếu giá trị là true action sẽ có kiểu danger */
130
+ danger?: boolean;
131
+ /** Function sẽ được gọi khi click action */
132
+ onClick?: () => void;
133
+ /** Action sau khi click sẽ close modal */
134
+ close?: boolean;
135
+ /** Disable action */
136
+ disabled?: boolean;
137
+ }
138
+
125
139
  export declare const ActionSheet: ActionSheetType;
126
140
 
127
141
  export declare interface ActionSheetProps extends ActionSheetProps_2 {
@@ -246,8 +260,6 @@ export declare const ConfigProvider: default_2.FC<ConfigProviderProps>;
246
260
  declare interface ConfigProviderProps extends ConfigProviderProps_2 {
247
261
  /** An optional prop */
248
262
  optional?: string;
249
- /** An optional prop */
250
- language?: "en" | "vi";
251
263
  }
252
264
 
253
265
  export declare const DatePicker: default_2.FC<DatePickerProps>;
@@ -294,10 +306,6 @@ export declare interface ErrorBlockProps extends ErrorBlockProps_2 {
294
306
  optional?: string;
295
307
  }
296
308
 
297
- export { FloatingBubble }
298
-
299
- export { FloatingBubbleProps }
300
-
301
309
  export declare const FloatingPanel: default_2.FC<FloatingPanelProps>;
302
310
 
303
311
  export declare interface FloatingPanelProps extends FloatingPanelProps_2 {
@@ -313,9 +321,9 @@ export declare interface FooterProps extends FooterProps_2 {
313
321
  }
314
322
 
315
323
  export declare const Form: default_2.FC<FormProps> & {
316
- Item: typeof Form_2.Item;
317
- useForm: typeof Form_2.useForm;
318
- useWatch: typeof Form_2.useWatch;
324
+ Item: default_2.FC<FormItemProps>;
325
+ useForm: useForm;
326
+ useWatch: useWatch;
319
327
  };
320
328
 
321
329
  export declare interface FormProps extends FormProps_2 {
@@ -340,15 +348,6 @@ export declare interface ImageProps extends ImageProps_2 {
340
348
  optional?: string;
341
349
  }
342
350
 
343
- export declare const ImageUploader: FC<ImageUploaderProps>;
344
-
345
- export declare interface ImageUploaderProps extends ImageUploaderProps_2 {
346
- }
347
-
348
- export { ImageUploaderRef }
349
-
350
- export { ImageUploadItem }
351
-
352
351
  export declare const ImageViewer: default_2.FC<ImageViewerProps> & {
353
352
  Multi: typeof ImageViewer_2.Multi;
354
353
  };
@@ -451,7 +450,7 @@ export declare interface PickerProps extends PickerProps_2 {
451
450
 
452
451
  export declare const PickerView: (props: PickerViewProps) => JSX_2.Element;
453
452
 
454
- export declare type PickerViewProps = Pick<PickerViewProps_2, 'className' | 'columns' | 'defaultValue' | 'mouseWheel' | 'onChange' | 'renderLabel' | 'value' | 'loading' | 'loadingContent'>;
453
+ export declare type PickerViewProps = Pick<PickerViewProps_2, "className" | "columns" | "defaultValue" | "mouseWheel" | "onChange" | "renderLabel" | "value" | "loading" | "loadingContent">;
455
454
 
456
455
  export declare const Popover: default_2.FC<PopoverProps> & {
457
456
  Menu: typeof Popover_2.Menu;
@@ -548,6 +547,116 @@ declare interface SelectorProps_2<V extends SelectorValue> extends SelectorProps
548
547
 
549
548
  declare type SelectorValue = string | number;
550
549
 
550
+ export declare const Sheet: SheetType;
551
+
552
+ export declare const SheetAction: default_2.FC<SheetActionProps>;
553
+
554
+ export declare interface SheetActionProps {
555
+ /** Có divider giữa các action */
556
+ divider?: boolean;
557
+ /** Danh sách các action */
558
+ actions: ActionButton[];
559
+ /** Có divider giữa các group action */
560
+ groupDivider?: boolean;
561
+ /** Callback để close sheet khi action có close=true */
562
+ onClose?: () => void;
563
+ }
564
+
565
+ declare const SheetComponent: default_2.ForwardRefExoticComponent<SheetProps & default_2.RefAttributes<SheetRef>>;
566
+
567
+ export declare interface SheetProps extends Omit<PopupProps_2, "position" | "bodyStyle"> {
568
+ /** Hiển thị mask khi show sheet */
569
+ mask?: boolean;
570
+ /** Function gọi sau khi close sheet */
571
+ afterClose?: () => void;
572
+ /** Function gọi khi close sheet */
573
+ onClose?: () => void;
574
+ /** Đóng sheet khi click vào mask */
575
+ maskClosable?: boolean;
576
+ /** Hiển thị sheet modal */
577
+ visible?: boolean;
578
+ /** Unmount sau khi đóng sheet modal */
579
+ unmountOnClose?: boolean;
580
+ /** Title của sheet modal */
581
+ title?: string;
582
+ /** Sheet width */
583
+ width?: string | number;
584
+ /** Sheet height */
585
+ height?: string | number;
586
+ /** Sheet description */
587
+ description?: string;
588
+ /** Nội dung sheet */
589
+ children?: default_2.ReactNode;
590
+ /** Giá trị z-index của modal */
591
+ zIndex?: number;
592
+ /** Sheet handler */
593
+ handler?: boolean;
594
+ /** Chiều cao của sheet ôm theo content */
595
+ autoHeight?: boolean;
596
+ /** Vuốt xuống để đóng sheet modal */
597
+ swipeToClose?: boolean;
598
+ /** Các snap points */
599
+ snapPoints?: number[] | ((args: {
600
+ sheetModalHeight: number;
601
+ }) => number[]);
602
+ /** Index của snapPoints mặc định khi mở sheet modal */
603
+ defaultSnapPoint?: number;
604
+ /** Callback function khi expand/collapse đến một snap point mới */
605
+ onSnap?: (snapPoint: number) => void;
606
+ /** Cấu hình transition animation cho sheet (default: spring với damping: 30, stiffness: 300) */
607
+ transition?: Transition;
608
+ /** Semantic class names cho các parts của Sheet */
609
+ classNames?: {
610
+ /** Class name cho AntdPopup root wrapper */
611
+ popup?: string;
612
+ /** Class name cho AntdPopup body */
613
+ popupBody?: string;
614
+ /** Class name cho Sheet container (SheetContainer) */
615
+ sheet?: string;
616
+ /** Class name cho mask overlay */
617
+ mask?: string;
618
+ /** Class name cho handler bar */
619
+ handler?: string;
620
+ /** Class name cho header wrapper */
621
+ header?: string;
622
+ /** Class name cho title */
623
+ title?: string;
624
+ /** Class name cho description */
625
+ description?: string;
626
+ /** Class name cho content wrapper */
627
+ content?: string;
628
+ };
629
+ /** Semantic styles cho các parts của Sheet */
630
+ styles?: {
631
+ /** Style cho AntdPopup root wrapper */
632
+ popup?: CSSProperties;
633
+ /** Style cho Sheet container (SheetContainer) */
634
+ sheet?: CSSProperties;
635
+ /** Style cho mask overlay */
636
+ mask?: CSSProperties;
637
+ /** Style cho handler bar */
638
+ handler?: CSSProperties;
639
+ /** Style cho header wrapper */
640
+ header?: CSSProperties;
641
+ /** Style cho title */
642
+ title?: CSSProperties;
643
+ /** Style cho description */
644
+ description?: CSSProperties;
645
+ /** Style cho content wrapper */
646
+ content?: CSSProperties;
647
+ };
648
+ }
649
+
650
+ export declare interface SheetRef {
651
+ sheet: HTMLDivElement | null;
652
+ snapTo: (index: number) => void;
653
+ getCurrentSnapIndex: () => number;
654
+ }
655
+
656
+ declare type SheetType = typeof SheetComponent & {
657
+ Action: typeof SheetAction;
658
+ };
659
+
551
660
  export declare const SideBar: default_2.FC<SideBarProps> & {
552
661
  Item: typeof SideBar_2.Item;
553
662
  };
@@ -0,0 +1,32 @@
1
+ @plugin "tailwindcss-animate";
2
+ @custom-variant dark (&:where(.dark, .dark *));
3
+
4
+ @theme {
5
+ --radius-lg: var(--am-radius);
6
+ --radius-md: calc(var(--am-radius) - 2px);
7
+ --radius-sm: calc(var(--am-radius) - 4px);
8
+ --color-background: hsl(var(--am-background));
9
+ --color-foreground: hsl(var(--am-foreground));
10
+ --color-card: hsl(var(--am-card));
11
+ --color-card-foreground: hsl(var(--am-card-foreground));
12
+ --color-popover: hsl(var(--am-popover));
13
+ --color-popover-foreground: hsl(var(--am-popover-foreground));
14
+ --color-primary: hsl(var(--am-primary));
15
+ --color-primary-foreground: hsl(var(--am-primary-foreground));
16
+ --color-secondary: hsl(var(--am-secondary));
17
+ --color-secondary-foreground: hsl(var(--am-secondary-foreground));
18
+ --color-muted: hsl(var(--am-muted));
19
+ --color-muted-foreground: hsl(var(--am-muted-foreground));
20
+ --color-accent: hsl(var(--am-accent));
21
+ --color-accent-foreground: hsl(var(--am-accent-foreground));
22
+ --color-destructive: hsl(var(--am-destructive));
23
+ --color-destructive-foreground: hsl(var(--am-destructive-foreground));
24
+ --color-border: hsl(var(--am-border));
25
+ --color-input: hsl(var(--am-input));
26
+ --color-ring: hsl(var(--am-ring));
27
+ --color-chart-1: hsl(var(--am-chart-1));
28
+ --color-chart-2: hsl(var(--am-chart-2));
29
+ --color-chart-3: hsl(var(--am-chart-3));
30
+ --color-chart-4: hsl(var(--am-chart-4));
31
+ --color-chart-5: hsl(var(--am-chart-5));
32
+ }
package/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "@antscorp/ama-ui",
3
- "version": "0.0.45",
3
+ "version": "0.1.0",
4
4
  "main": "dist/ama-ui.es.js",
5
5
  "module": "dist/ama-ui.es.js",
6
6
  "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/ama-ui.es.js"
11
+ },
12
+ "./ama-ui.css": "./dist/ama-ui.css",
13
+ "./tailwind-theme.css": "./dist/tailwind-theme.css"
14
+ },
7
15
  "sideEffects": false,
8
16
  "type": "module",
9
17
  "files": [
@@ -14,7 +22,9 @@
14
22
  "dev": "vite",
15
23
  "build": "yarn clean && vite build --config vite.config.build.ts",
16
24
  "clean": "rimraf dist",
17
- "lint": "eslint .",
25
+ "lint": "biome check .",
26
+ "lint:fix": "biome check --write .",
27
+ "format": "biome format --write .",
18
28
  "preview": "vite preview",
19
29
  "test": "vitest",
20
30
  "storybook": "storybook dev -p 6006",
@@ -24,14 +34,14 @@
24
34
  "antd-mobile": "^5.38.1",
25
35
  "clsx": "^2.1.1",
26
36
  "lucide-react": "^0.475.0",
37
+ "motion": "^12.0.0",
27
38
  "react": "^18.3.1",
28
39
  "react-dom": "^18.3.1",
29
- "styled-components": "^6.1.14",
30
- "tailwindcss-animate": "^1.0.7"
40
+ "styled-components": "^6.1.14"
31
41
  },
32
42
  "devDependencies": {
43
+ "@biomejs/biome": "^2.3.2",
33
44
  "@chromatic-com/storybook": "^3.2.4",
34
- "@eslint/js": "^9.17.0",
35
45
  "@rollup/plugin-terser": "^0.4.4",
36
46
  "@storybook/addon-docs": "^8.5.6",
37
47
  "@storybook/addon-essentials": "^8.5.8",
@@ -43,7 +53,6 @@
43
53
  "@storybook/react-vite": "^8.5.6",
44
54
  "@storybook/test": "^8.5.6",
45
55
  "@storybook/theming": "^8.5.7",
46
- "@tailwindcss/cli": "^4.0.0",
47
56
  "@tailwindcss/vite": "^4.0.0",
48
57
  "@testing-library/dom": "^10.4.0",
49
58
  "@testing-library/jest-dom": "^6.6.3",
@@ -53,11 +62,6 @@
53
62
  "@types/react-dom": "^18.3.5",
54
63
  "@vitejs/plugin-react": "^4.3.4",
55
64
  "autoprefixer": "^10.4.20",
56
- "eslint": "^9.17.0",
57
- "eslint-plugin-react-hooks": "^5.0.0",
58
- "eslint-plugin-react-refresh": "^0.4.16",
59
- "eslint-plugin-storybook": "^0.11.3",
60
- "globals": "^15.14.0",
61
65
  "jest": "^29.7.0",
62
66
  "js-beautify": "^1.15.3",
63
67
  "postcss": "^8.5.1",
@@ -67,22 +71,26 @@
67
71
  "rollup-plugin-visualizer": "^5.14.0",
68
72
  "sass-embedded": "^1.83.4",
69
73
  "storybook": "^8.5.6",
70
- "tailwindcss": "3.4.17",
74
+ "tailwindcss": "^4.0.0",
75
+ "tailwindcss-animate": "^1.0.7",
71
76
  "ts-dedent": "^2.2.0",
72
77
  "typescript": "~5.6.2",
73
- "typescript-eslint": "^8.18.2",
74
78
  "vite": "^6.0.5",
75
- "vite-plugin-css-injected-by-js": "^3.5.2",
76
79
  "vite-plugin-dts": "^4.5.0",
77
80
  "vitest": "^3.0.4"
78
81
  },
79
82
  "peerDependencies": {
80
83
  "react": ">=16.9.0",
81
- "react-dom": ">=16.9.0"
84
+ "react-dom": ">=16.9.0",
85
+ "tailwindcss": "^4.0.0",
86
+ "tailwindcss-animate": "^1.0.7"
82
87
  },
83
- "eslintConfig": {
84
- "extends": [
85
- "plugin:storybook/recommended"
86
- ]
88
+ "peerDependenciesMeta": {
89
+ "tailwindcss": {
90
+ "optional": true
91
+ },
92
+ "tailwindcss-animate": {
93
+ "optional": true
94
+ }
87
95
  }
88
96
  }