@rovula/ui 0.0.15 → 0.0.17

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 (43) hide show
  1. package/dist/cjs/bundle.css +61 -0
  2. package/dist/cjs/bundle.js +3 -3
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/Avatar/Avatar.stories.d.ts +3 -3
  5. package/dist/cjs/types/components/Avatar/Avatar.styles.d.ts +1 -1
  6. package/dist/cjs/types/components/Collapsible/Collapsible.d.ts +23 -0
  7. package/dist/cjs/types/components/Collapsible/Collapsible.stories.d.ts +8 -0
  8. package/dist/cjs/types/components/Collapsible/Collapsible.styles.d.ts +11 -0
  9. package/dist/cjs/types/components/Collapsible/CollapsibleContext.d.ts +16 -0
  10. package/dist/cjs/types/components/Collapsible/index.d.ts +1 -0
  11. package/dist/cjs/types/index.d.ts +2 -0
  12. package/dist/components/ActionButton/ActionButton.js +0 -1
  13. package/dist/components/Collapsible/Collapsible.js +37 -0
  14. package/dist/components/Collapsible/Collapsible.stories.js +44 -0
  15. package/dist/components/Collapsible/Collapsible.styles.js +47 -0
  16. package/dist/components/Collapsible/CollapsibleContext.js +25 -0
  17. package/dist/components/Collapsible/index.js +1 -0
  18. package/dist/esm/bundle.css +61 -0
  19. package/dist/esm/bundle.js +3 -3
  20. package/dist/esm/bundle.js.map +1 -1
  21. package/dist/esm/types/components/Avatar/Avatar.stories.d.ts +3 -3
  22. package/dist/esm/types/components/Avatar/Avatar.styles.d.ts +1 -1
  23. package/dist/esm/types/components/Collapsible/Collapsible.d.ts +23 -0
  24. package/dist/esm/types/components/Collapsible/Collapsible.stories.d.ts +8 -0
  25. package/dist/esm/types/components/Collapsible/Collapsible.styles.d.ts +11 -0
  26. package/dist/esm/types/components/Collapsible/CollapsibleContext.d.ts +16 -0
  27. package/dist/esm/types/components/Collapsible/index.d.ts +1 -0
  28. package/dist/esm/types/index.d.ts +2 -0
  29. package/dist/index.d.ts +33 -1
  30. package/dist/index.js +2 -0
  31. package/dist/src/theme/global.css +72 -0
  32. package/dist/theme/global.css +16 -0
  33. package/dist/theme/presets/colors.js +16 -0
  34. package/package.json +1 -1
  35. package/src/components/ActionButton/ActionButton.tsx +0 -2
  36. package/src/components/Collapsible/Collapsible.stories.tsx +65 -0
  37. package/src/components/Collapsible/Collapsible.styles.ts +62 -0
  38. package/src/components/Collapsible/Collapsible.tsx +113 -0
  39. package/src/components/Collapsible/CollapsibleContext.tsx +61 -0
  40. package/src/components/Collapsible/index.ts +1 -0
  41. package/src/index.ts +2 -0
  42. package/src/theme/global.css +16 -0
  43. package/src/theme/presets/colors.js +16 -0
@@ -14,7 +14,7 @@ declare const meta: {
14
14
  fallback?: React.ReactNode;
15
15
  icon?: React.ReactNode;
16
16
  children?: React.ReactNode;
17
- size?: "sm" | "md" | "lg" | "xxs" | "xs" | undefined;
17
+ size?: "sm" | "md" | "lg" | "xs" | "xxs" | undefined;
18
18
  rounded?: "none" | "normal" | "full" | undefined;
19
19
  className?: string | undefined;
20
20
  imageClassName?: string | undefined;
@@ -27,7 +27,7 @@ declare const meta: {
27
27
  text?: string | undefined;
28
28
  icon?: React.ReactNode;
29
29
  children?: React.ReactNode;
30
- size?: "sm" | "md" | "lg" | "xxs" | "xs" | undefined;
30
+ size?: "sm" | "md" | "lg" | "xs" | "xxs" | undefined;
31
31
  rounded?: "none" | "normal" | "full" | undefined;
32
32
  className?: string | undefined;
33
33
  imageClassName?: string | undefined;
@@ -40,7 +40,7 @@ declare const meta: {
40
40
  text?: string | undefined;
41
41
  fallback?: React.ReactNode;
42
42
  children?: React.ReactNode;
43
- size?: "sm" | "md" | "lg" | "xxs" | "xs" | undefined;
43
+ size?: "sm" | "md" | "lg" | "xs" | "xxs" | undefined;
44
44
  rounded?: "none" | "normal" | "full" | undefined;
45
45
  className?: string | undefined;
46
46
  imageClassName?: string | undefined;
@@ -1,4 +1,4 @@
1
1
  export declare const avatarVariants: (props?: ({
2
- size?: "sm" | "md" | "lg" | "xxs" | "xs" | null | undefined;
2
+ size?: "sm" | "md" | "lg" | "xs" | "xxs" | null | undefined;
3
3
  rounded?: "none" | "normal" | "full" | null | undefined;
4
4
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ declare const CollapsibleButton: React.ForwardRefExoticComponent<{
3
+ children: React.ReactNode;
4
+ className?: string | undefined;
5
+ hideExpandIcon?: boolean | undefined;
6
+ } & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const CollapsiblePanel: React.ForwardRefExoticComponent<{
8
+ children: React.ReactNode;
9
+ className?: string | undefined;
10
+ } & React.RefAttributes<HTMLDivElement>>;
11
+ interface CollapsibleComponent extends React.ForwardRefExoticComponent<CollapsibleProps & React.RefAttributes<HTMLDivElement>> {
12
+ Button: typeof CollapsibleButton;
13
+ Panel: typeof CollapsiblePanel;
14
+ }
15
+ interface CollapsibleProps {
16
+ size?: "sm" | "md" | "lg";
17
+ children: React.ReactNode;
18
+ isExpand?: boolean;
19
+ className?: string;
20
+ onToggle?: (isExpand: boolean) => void;
21
+ }
22
+ declare const Collapsible: CollapsibleComponent;
23
+ export default Collapsible;
@@ -0,0 +1,8 @@
1
+ declare const meta: any;
2
+ export default meta;
3
+ export declare const Default: {
4
+ args: {
5
+ size: string;
6
+ };
7
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
8
+ };
@@ -0,0 +1,11 @@
1
+ export declare const collapseButtonVariants: (props?: ({
2
+ size?: "sm" | "md" | "lg" | null | undefined;
3
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
4
+ export declare const collapseIconVariants: (props?: ({
5
+ size?: "sm" | "md" | "lg" | null | undefined;
6
+ isExpand?: boolean | null | undefined;
7
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
8
+ export declare const collapsePanelVariants: (props?: ({
9
+ size?: "sm" | "md" | "lg" | null | undefined;
10
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
11
+ export declare const collapseContainerVariants: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
@@ -0,0 +1,16 @@
1
+ import React, { ReactNode } from "react";
2
+ interface CollapsibleContextProps {
3
+ size?: "sm" | "md" | "lg";
4
+ isExpand: boolean;
5
+ toggle: () => void;
6
+ setIsExpand: React.Dispatch<React.SetStateAction<boolean>>;
7
+ }
8
+ export declare const useCollapsible: () => CollapsibleContextProps;
9
+ interface CollapsibleProviderProps {
10
+ size?: "sm" | "md" | "lg";
11
+ children: ReactNode;
12
+ isExpandControlled?: boolean;
13
+ onToggle?: (isExpand: boolean) => void;
14
+ }
15
+ export declare const CollapsibleProvider: React.FC<CollapsibleProviderProps>;
16
+ export {};
@@ -0,0 +1 @@
1
+ export { default as Collapsible } from "./Collapsible";
@@ -8,7 +8,9 @@ export { Checkbox } from "./components/Checkbox/Checkbox";
8
8
  export { Label } from "./components/Label/Label";
9
9
  export { Input } from "./components/Input/Input";
10
10
  export { Navbar } from "./components/Navbar";
11
+ export { default as ActionButton } from "./components/ActionButton/ActionButton";
11
12
  export { Avatar, AvatarGroup } from "./components/Avatar";
13
+ export { Collapsible } from "./components/Collapsible";
12
14
  export * from "./components/Table/Table";
13
15
  export * from "./components/DataTable/DataTable";
14
16
  export * from "./components/Dialog/Dialog";
package/dist/index.d.ts CHANGED
@@ -176,6 +176,16 @@ type NavbarProps = {
176
176
  };
177
177
  declare const Navbar: FC<NavbarProps>;
178
178
 
179
+ declare const ActionButton: React__default.ForwardRefExoticComponent<{
180
+ title?: string | undefined;
181
+ size?: "sm" | "md" | "lg" | "xs" | undefined;
182
+ variant?: "solid" | "outline" | "icon" | undefined;
183
+ disabled?: boolean | undefined;
184
+ active?: boolean | undefined;
185
+ children?: React__default.ReactNode;
186
+ className?: string | undefined;
187
+ } & React__default.ButtonHTMLAttributes<HTMLButtonElement> & React__default.RefAttributes<HTMLButtonElement>>;
188
+
179
189
  type BaseAvatarProps = {
180
190
  imageUrl?: string;
181
191
  text?: string;
@@ -215,6 +225,28 @@ type AvatarGroupProps = {
215
225
  };
216
226
  declare const AvatarGroup: FC<AvatarGroupProps>;
217
227
 
228
+ declare const CollapsibleButton: React__default.ForwardRefExoticComponent<{
229
+ children: React__default.ReactNode;
230
+ className?: string | undefined;
231
+ hideExpandIcon?: boolean | undefined;
232
+ } & React__default.RefAttributes<HTMLButtonElement>>;
233
+ declare const CollapsiblePanel: React__default.ForwardRefExoticComponent<{
234
+ children: React__default.ReactNode;
235
+ className?: string | undefined;
236
+ } & React__default.RefAttributes<HTMLDivElement>>;
237
+ interface CollapsibleComponent extends React__default.ForwardRefExoticComponent<CollapsibleProps & React__default.RefAttributes<HTMLDivElement>> {
238
+ Button: typeof CollapsibleButton;
239
+ Panel: typeof CollapsiblePanel;
240
+ }
241
+ interface CollapsibleProps {
242
+ size?: "sm" | "md" | "lg";
243
+ children: React__default.ReactNode;
244
+ isExpand?: boolean;
245
+ className?: string;
246
+ onToggle?: (isExpand: boolean) => void;
247
+ }
248
+ declare const Collapsible: CollapsibleComponent;
249
+
218
250
  declare const Table: React.ForwardRefExoticComponent<{
219
251
  rootRef?: React.LegacyRef<HTMLDivElement> | undefined;
220
252
  } & React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
@@ -281,4 +313,4 @@ declare const getTimestampUTC: (date: Date) => number;
281
313
 
282
314
  declare function cn(...inputs: ClassValue[]): string;
283
315
 
284
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Checkbox, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, type DropdownProps, Input, type InputProps, Label, Navbar, type NavbarProps, type Options, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextInput, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, resloveTimestamp };
316
+ export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Checkbox, Collapsible, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, type DropdownProps, Input, type InputProps, Label, Navbar, type NavbarProps, type Options, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextInput, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, resloveTimestamp };
package/dist/index.js CHANGED
@@ -10,7 +10,9 @@ export { Checkbox } from "./components/Checkbox/Checkbox";
10
10
  export { Label } from "./components/Label/Label";
11
11
  export { Input } from "./components/Input/Input";
12
12
  export { Navbar } from "./components/Navbar";
13
+ export { default as ActionButton } from "./components/ActionButton/ActionButton";
13
14
  export { Avatar, AvatarGroup } from "./components/Avatar";
15
+ export { Collapsible } from "./components/Collapsible";
14
16
  export * from "./components/Table/Table";
15
17
  export * from "./components/DataTable/DataTable";
16
18
  export * from "./components/Dialog/Dialog";
@@ -628,28 +628,44 @@ video {
628
628
  /* #161C24 */
629
629
  --grey-default: var(--grey-100);
630
630
  --grey-foreground: var(--white);
631
+ --info-lighter: 208 242 255;
632
+ --info-light: 116 202 255;
631
633
  --info-100: 41 152 255;
632
634
  /* #2998FF */
633
635
  --info-120: 33 122 204;
634
636
  /* #217ACC */
637
+ --info-dark: 12 83 183;
638
+ --info-darker: 4 41 122;
635
639
  --info-default: var(--info-100);
636
640
  --info-foreground: var(--white);
641
+ --success-lighter: 233 252 212;
642
+ --success-light: 170 242 127;
637
643
  --success-100: 84 214 44;
638
644
  /* #54D62C */
639
645
  --success-120: 67 171 35;
640
646
  /* #43AB23 */
647
+ --success-dark: 34 154 22;
648
+ --success-darker:8 102 13;
641
649
  --success-default: var(--success-100);
642
650
  --success-foreground: var(--white);
651
+ --warning-lighter: 255 247 205;
652
+ --warning-light:255 225 106;
643
653
  --warning-100: 255 193 7;
644
654
  /* #FFC107 */
645
655
  --warning-120: 204 154 6;
646
656
  /* #CC9A06 */
657
+ --warning-dark: 183 129 3;
658
+ --warning-darker: 122 79 1;
647
659
  --warning-default: var(--warning-100);
648
660
  --warning-foreground: var(--white);
661
+ --error-lighter: 255 231 217;
662
+ --error-light: 255 164 141;
649
663
  --error-100: 255 77 53;
650
664
  /* #FF4D35 */
651
665
  --error-120: 204 62 42;
652
666
  /* #CC3E2A */
667
+ --error-dark: 183 33 54;
668
+ --error-darker: 122 12 46;
653
669
  --error-default: var(--error-100);
654
670
  --error-foreground: var(--white);
655
671
  --main-transparent-primary: 1 1 68;
@@ -1046,11 +1062,21 @@ body {
1046
1062
  height: 1.5rem;
1047
1063
  }
1048
1064
 
1065
+ .size-7 {
1066
+ width: 1.75rem;
1067
+ height: 1.75rem;
1068
+ }
1069
+
1049
1070
  .size-\[14px\] {
1050
1071
  width: 14px;
1051
1072
  height: 14px;
1052
1073
  }
1053
1074
 
1075
+ .size-full {
1076
+ width: 100%;
1077
+ height: 100%;
1078
+ }
1079
+
1054
1080
  .h-10 {
1055
1081
  height: 2.5rem;
1056
1082
  }
@@ -1287,6 +1313,10 @@ body {
1287
1313
  flex-wrap: wrap;
1288
1314
  }
1289
1315
 
1316
+ .content-center {
1317
+ align-content: center;
1318
+ }
1319
+
1290
1320
  .items-center {
1291
1321
  align-items: center;
1292
1322
  }
@@ -1574,6 +1604,11 @@ body {
1574
1604
  background-color: rgb(var(--error-100) / var(--tw-bg-opacity));
1575
1605
  }
1576
1606
 
1607
+ .bg-gray-100 {
1608
+ --tw-bg-opacity: 1;
1609
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity));
1610
+ }
1611
+
1577
1612
  .bg-gray-200 {
1578
1613
  --tw-bg-opacity: 1;
1579
1614
  background-color: rgb(229 231 235 / var(--tw-bg-opacity));
@@ -1763,6 +1798,11 @@ body {
1763
1798
  padding-right: 1rem;
1764
1799
  }
1765
1800
 
1801
+ .px-5 {
1802
+ padding-left: 1.25rem;
1803
+ padding-right: 1.25rem;
1804
+ }
1805
+
1766
1806
  .px-6 {
1767
1807
  padding-left: 1.5rem;
1768
1808
  padding-right: 1.5rem;
@@ -2233,6 +2273,14 @@ body {
2233
2273
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2234
2274
  }
2235
2275
 
2276
+ .transition {
2277
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
2278
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
2279
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
2280
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2281
+ transition-duration: 150ms;
2282
+ }
2283
+
2236
2284
  .transition-all {
2237
2285
  transition-property: all;
2238
2286
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
@@ -2251,6 +2299,10 @@ body {
2251
2299
  transition-duration: 150ms;
2252
2300
  }
2253
2301
 
2302
+ .delay-150 {
2303
+ transition-delay: 150ms;
2304
+ }
2305
+
2254
2306
  .duration-200 {
2255
2307
  transition-duration: 200ms;
2256
2308
  }
@@ -2436,6 +2488,11 @@ body {
2436
2488
  background-color: rgb(243 244 246 / var(--tw-bg-opacity));
2437
2489
  }
2438
2490
 
2491
+ .hover\:bg-gray-200:hover {
2492
+ --tw-bg-opacity: 1;
2493
+ background-color: rgb(229 231 235 / var(--tw-bg-opacity));
2494
+ }
2495
+
2439
2496
  .hover\:bg-info-100:hover {
2440
2497
  --tw-bg-opacity: 1;
2441
2498
  background-color: rgb(var(--info-100)) / var(--tw-bg-opacity));
@@ -2588,16 +2645,31 @@ body {
2588
2645
  outline-offset: 2px;
2589
2646
  }
2590
2647
 
2648
+ .focus-visible\:ring:focus-visible {
2649
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
2650
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
2651
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
2652
+ }
2653
+
2591
2654
  .focus-visible\:ring-2:focus-visible {
2592
2655
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
2593
2656
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
2594
2657
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
2595
2658
  }
2596
2659
 
2660
+ .focus-visible\:ring-gray-500:focus-visible {
2661
+ --tw-ring-opacity: 1;
2662
+ --tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity));
2663
+ }
2664
+
2597
2665
  .focus-visible\:ring-ring:focus-visible {
2598
2666
  --tw-ring-color: hsl(var(--ring));
2599
2667
  }
2600
2668
 
2669
+ .focus-visible\:ring-opacity-75:focus-visible {
2670
+ --tw-ring-opacity: 0.75;
2671
+ }
2672
+
2601
2673
  .focus-visible\:ring-offset-2:focus-visible {
2602
2674
  --tw-ring-offset-width: 2px;
2603
2675
  }
@@ -108,23 +108,39 @@
108
108
  --grey-default: var(--grey-100);
109
109
  --grey-foreground: var(--white);
110
110
 
111
+ --info-lighter: 208 242 255;
112
+ --info-light: 116 202 255;
111
113
  --info-100: 41 152 255; /* #2998FF */
112
114
  --info-120: 33 122 204; /* #217ACC */
115
+ --info-dark: 12 83 183;
116
+ --info-darker: 4 41 122;
113
117
  --info-default: var(--info-100);
114
118
  --info-foreground: var(--white);
115
119
 
120
+ --success-lighter: 233 252 212;
121
+ --success-light: 170 242 127;
116
122
  --success-100: 84 214 44; /* #54D62C */
117
123
  --success-120: 67 171 35; /* #43AB23 */
124
+ --success-dark: 34 154 22;
125
+ --success-darker:8 102 13;
118
126
  --success-default: var(--success-100);
119
127
  --success-foreground: var(--white);
120
128
 
129
+ --warning-lighter: 255 247 205;
130
+ --warning-light:255 225 106;
121
131
  --warning-100: 255 193 7; /* #FFC107 */
122
132
  --warning-120: 204 154 6; /* #CC9A06 */
133
+ --warning-dark: 183 129 3;
134
+ --warning-darker: 122 79 1;
123
135
  --warning-default: var(--warning-100);
124
136
  --warning-foreground: var(--white);
125
137
 
138
+ --error-lighter: 255 231 217;
139
+ --error-light: 255 164 141;
126
140
  --error-100: 255 77 53; /* #FF4D35 */
127
141
  --error-120: 204 62 42; /* #CC3E2A */
142
+ --error-dark: 183 33 54;
143
+ --error-darker: 122 12 46;
128
144
  --error-default: var(--error-100);
129
145
  --error-foreground: var(--white);
130
146
 
@@ -118,26 +118,42 @@ module.exports = {
118
118
  foreground: "rgb(var(--grey2-foreground) / <alpha-value>)",
119
119
  },
120
120
  info: {
121
+ lighter: "rgb(var(--info-lighter)) / <alpha-value>)",
122
+ light: "rgb(var(--info-light)) / <alpha-value>)",
121
123
  100: "rgb(var(--info-100)) / <alpha-value>)",
122
124
  120: "rgb(var(--info-120)) / <alpha-value>)",
125
+ dark: "rgb(var(--info-dark)) / <alpha-value>)",
126
+ darker: "rgb(var(--info-darker)) / <alpha-value>)",
123
127
  DEFAULT: "rgb(var(--info-default) / <alpha-value>)",
124
128
  foreground: "rgb(var(--info-foreground) / <alpha-value>)",
125
129
  },
126
130
  success: {
131
+ lighter: "rgb(var(--success-lighter)) / <alpha-value>)",
132
+ light: "rgb(var(--success-light)) / <alpha-value>)",
127
133
  100: "rgb(var(--success-100)) / <alpha-value>)",
128
134
  120: "rgb(var(--success-120)) / <alpha-value>)",
135
+ dark: "rgb(var(--success-dark)) / <alpha-value>)",
136
+ darker: "rgb(var(--success-darker)) / <alpha-value>)",
129
137
  DEFAULT: "rgb(var(--success-default) / <alpha-value>)",
130
138
  foreground: "rgb(var(--success-foreground) / <alpha-value>)",
131
139
  },
132
140
  warning: {
141
+ lighter: "rgb(var(--warning-lighter)) / <alpha-value>)",
142
+ light: "rgb(var(--warning-light)) / <alpha-value>)",
133
143
  100: "rgb(var(--warning-100) / <alpha-value>)",
134
144
  120: "rgb(var(--warning-120) / <alpha-value>)",
145
+ dark: "rgb(var(--warning-dark)) / <alpha-value>)",
146
+ darker: "rgb(var(--warning-darker)) / <alpha-value>)",
135
147
  DEFAULT: "rgb(var(--warning-default) / <alpha-value>)",
136
148
  foreground: "rgb(var(--warning-foreground) / <alpha-value>)",
137
149
  },
138
150
  error: {
151
+ lighter: "rgb(var(--error-lighter)) / <alpha-value>)",
152
+ light: "rgb(var(--error-light)) / <alpha-value>)",
139
153
  100: "rgb(var(--error-100) / <alpha-value>)",
140
154
  120: "rgb(var(--error-120) / <alpha-value>)",
155
+ dark: "rgb(var(--error-dark)) / <alpha-value>)",
156
+ darker: "rgb(var(--error-darker)) / <alpha-value>)",
141
157
  DEFAULT: "rgb(var(--error-100) / <alpha-value>)",
142
158
  foreground: "rgb(var(--error-foreground) / <alpha-value>)",
143
159
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rovula/ui",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "main": "dist/cjs/bundle.js",
5
5
  "module": "dist/esm/bundle.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,3 @@
1
- "use-client";
2
-
3
1
  import { cn } from "@/utils/cn";
4
2
  import React, { forwardRef } from "react";
5
3
  import { actionButtonVariants } from "./ActionButton.styles";
@@ -0,0 +1,65 @@
1
+ import React, { useEffect } from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import Collapsible from "./Collapsible";
4
+
5
+ const meta: any = {
6
+ title: "Components/Collapsible",
7
+ component: Collapsible,
8
+ tags: ["autodocs"],
9
+ parameters: {
10
+ layout: "fullscreen",
11
+ },
12
+ decorators: [
13
+ (Story) => (
14
+ <div className="p-5 flex w-full">
15
+ <Story />
16
+ </div>
17
+ ),
18
+ ],
19
+ } satisfies Meta<typeof Collapsible>;
20
+
21
+ export default meta;
22
+
23
+ const Test = () => {
24
+ useEffect(() => {
25
+ console.log("Mont");
26
+ return () => {
27
+ console.log("UnMont");
28
+ };
29
+ }, []);
30
+
31
+ return <p>This is the content of section 1.</p>;
32
+ };
33
+
34
+ export const Default = {
35
+ args: {
36
+ size: "md",
37
+ },
38
+ render: (args) => {
39
+ const props: typeof args = {
40
+ ...args,
41
+ };
42
+ return (
43
+ <div className="flex flex-col gap-1 w-full ">
44
+ <Collapsible isExpand {...props}>
45
+ <Collapsible.Button>Section 1</Collapsible.Button>
46
+ <Collapsible.Panel>
47
+ This is the content of section 1.
48
+ </Collapsible.Panel>
49
+ </Collapsible>
50
+ <Collapsible>
51
+ <Collapsible.Button>Section 2</Collapsible.Button>
52
+ <Collapsible.Panel>
53
+ <p>This is the content of section 2.</p>
54
+ </Collapsible.Panel>
55
+ </Collapsible>
56
+ <Collapsible>
57
+ <Collapsible.Button>Section 3</Collapsible.Button>
58
+ <Collapsible.Panel>
59
+ <p>This is the content of section 3.</p>
60
+ </Collapsible.Panel>
61
+ </Collapsible>
62
+ </div>
63
+ );
64
+ },
65
+ } satisfies StoryObj;
@@ -0,0 +1,62 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ export const collapseButtonVariants = cva(
4
+ [
5
+ "flex flex-1 bg-gray-100 hover:bg-gray-200",
6
+ "focus:outline-none focus-visible:ring focus-visible:ring-gray-500 focus-visible:ring-opacity-75",
7
+ ],
8
+ {
9
+ variants: {
10
+ size: {
11
+ sm: "py-2 px-3",
12
+ md: "py-3 px-4",
13
+ lg: "py-4 px-5",
14
+ },
15
+ },
16
+
17
+ defaultVariants: {
18
+ size: "md",
19
+ },
20
+ }
21
+ );
22
+
23
+ export const collapseIconVariants = cva(
24
+ ["transition-all flex content-center justify-center "],
25
+ {
26
+ variants: {
27
+ size: {
28
+ sm: "size-5",
29
+ md: "size-6",
30
+ lg: "size-7",
31
+ },
32
+ isExpand: {
33
+ true: "rotate-180",
34
+ },
35
+ },
36
+ defaultVariants: {
37
+ size: "md",
38
+ isExpand: false,
39
+ },
40
+ }
41
+ );
42
+
43
+ export const collapsePanelVariants = cva(
44
+ ["flex flex-1 border-t", "transition ease-in-out delay-150 duration-300"],
45
+ {
46
+ variants: {
47
+ size: {
48
+ sm: "py-2 px-3",
49
+ md: "py-3 px-4",
50
+ lg: "py-4 px-5",
51
+ },
52
+ },
53
+
54
+ defaultVariants: {
55
+ size: "md",
56
+ },
57
+ }
58
+ );
59
+
60
+ export const collapseContainerVariants = cva([
61
+ "flex flex-col border rounded overflow-hidden",
62
+ ]);