shru-design-system 0.3.0 → 0.4.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/README.md +4 -1
- package/dist/index.d.mts +158 -26
- package/dist/index.d.ts +158 -26
- package/dist/index.js +773 -274
- package/dist/index.mjs +738 -242
- package/package.json +1 -1
- package/scripts/init.js +21 -131
- package/scripts/themeConfig.js +5 -29
package/README.md
CHANGED
|
@@ -35,6 +35,8 @@ Basic UI building blocks:
|
|
|
35
35
|
- **`Radio.tsx`** - Radio button group component
|
|
36
36
|
- **`Separator.tsx`** - Horizontal/vertical divider component
|
|
37
37
|
- **`Skeleton.tsx`** - Skeleton loading component
|
|
38
|
+
- **`SkeletonGrid.tsx`** - Grid layout skeleton component
|
|
39
|
+
- **`SkeletonText.tsx`** - Text lines skeleton component
|
|
38
40
|
- **`Slider.tsx`** - Slider input component
|
|
39
41
|
- **`Spinner.tsx`** - Loading spinner component
|
|
40
42
|
- **`Switch.tsx`** - Toggle switch component
|
|
@@ -68,6 +70,7 @@ Composite components:
|
|
|
68
70
|
- **`InfoBanner.tsx`** - Information banner component
|
|
69
71
|
- **`InlineEdit.tsx`** - Inline editing component
|
|
70
72
|
- **`InputGroup.tsx`** - Input with addons/buttons
|
|
73
|
+
- **`SearchInput.tsx`** - Search input with debounce and clearable
|
|
71
74
|
- **`Menubar.tsx`** - Menu bar component
|
|
72
75
|
- **`Modal.tsx`** - Modal dialog component
|
|
73
76
|
- **`NavigationMenu.tsx`** - Navigation menu component
|
|
@@ -96,7 +99,7 @@ Layout and container components:
|
|
|
96
99
|
- **`Footer.tsx`** - Footer component
|
|
97
100
|
- **`Grid.tsx`** - Grid layout component
|
|
98
101
|
- **`Header.tsx`** - Header component
|
|
99
|
-
- **`List.tsx`** -
|
|
102
|
+
- **`List.tsx`** - Enhanced list component with search, grid/list views, empty/loading states
|
|
100
103
|
- **`Resizable.tsx`** - Resizable panels component
|
|
101
104
|
- **`ResizeContainer.tsx`** - Resizable container wrapper
|
|
102
105
|
- **`ScrollArea.tsx`** - Scrollable area component
|
package/dist/index.d.mts
CHANGED
|
@@ -49,6 +49,7 @@ declare const Button: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttrib
|
|
|
49
49
|
readonly size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
50
50
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
51
51
|
asChild?: boolean;
|
|
52
|
+
stopPropagation?: boolean;
|
|
52
53
|
}, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
53
54
|
|
|
54
55
|
declare const badgeVariants: (props?: ({
|
|
@@ -86,7 +87,7 @@ interface CheckboxProps extends React$1.ComponentProps<typeof CheckboxPrimitive.
|
|
|
86
87
|
declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
87
88
|
|
|
88
89
|
declare const alertVariants: (props?: ({
|
|
89
|
-
readonly variant?: "default" | "destructive" | null | undefined;
|
|
90
|
+
readonly variant?: "default" | "destructive" | "error" | null | undefined;
|
|
90
91
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
91
92
|
declare function Alert({ className, variant, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof alertVariants>): react_jsx_runtime.JSX.Element;
|
|
92
93
|
declare function AlertTitle({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -103,6 +104,26 @@ declare function RadioItem({ className, ...props }: React$1.ComponentProps<typeo
|
|
|
103
104
|
|
|
104
105
|
declare function Skeleton({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
105
106
|
|
|
107
|
+
interface SkeletonGridProps {
|
|
108
|
+
count?: number;
|
|
109
|
+
cols?: {
|
|
110
|
+
default?: number;
|
|
111
|
+
md?: number;
|
|
112
|
+
lg?: number;
|
|
113
|
+
};
|
|
114
|
+
className?: string;
|
|
115
|
+
renderSkeleton?: () => React$1.ReactNode;
|
|
116
|
+
}
|
|
117
|
+
declare function SkeletonGrid({ count, cols, className, renderSkeleton, }: SkeletonGridProps): react_jsx_runtime.JSX.Element;
|
|
118
|
+
|
|
119
|
+
interface SkeletonTextProps {
|
|
120
|
+
lines?: number;
|
|
121
|
+
className?: string;
|
|
122
|
+
lineHeight?: "sm" | "md" | "lg";
|
|
123
|
+
lastLineWidth?: "full" | "3/4" | "1/2";
|
|
124
|
+
}
|
|
125
|
+
declare function SkeletonText({ lines, className, lineHeight, lastLineWidth, }: SkeletonTextProps): react_jsx_runtime.JSX.Element;
|
|
126
|
+
|
|
106
127
|
declare const sliderOrientations: readonly ["horizontal", "vertical"];
|
|
107
128
|
declare function Slider({ className, defaultValue, value, min, max, orientation, ...props }: React$1.ComponentProps<typeof SliderPrimitive.Root> & {
|
|
108
129
|
orientation?: typeof sliderOrientations[number];
|
|
@@ -533,11 +554,15 @@ interface SnackbarProps {
|
|
|
533
554
|
declare function Snackbar({ message, action, variant, className, }: SnackbarProps): react_jsx_runtime.JSX.Element;
|
|
534
555
|
|
|
535
556
|
interface StatusTextProps {
|
|
536
|
-
text
|
|
537
|
-
status
|
|
557
|
+
text?: string;
|
|
558
|
+
status?: "success" | "error" | "warning" | "info";
|
|
559
|
+
count?: number;
|
|
560
|
+
label?: string;
|
|
561
|
+
variant?: "caption" | "body" | "heading" | "badge";
|
|
562
|
+
formatText?: (text: string, count?: number, label?: string) => string;
|
|
538
563
|
className?: string;
|
|
539
564
|
}
|
|
540
|
-
declare function StatusText({ text, status, className, }: StatusTextProps): react_jsx_runtime.JSX.Element;
|
|
565
|
+
declare function StatusText({ text, status, count, label, variant, formatText, className, }: StatusTextProps): react_jsx_runtime.JSX.Element;
|
|
541
566
|
|
|
542
567
|
interface StepperProps {
|
|
543
568
|
steps: Array<{
|
|
@@ -604,11 +629,26 @@ interface FormInputProps {
|
|
|
604
629
|
}
|
|
605
630
|
declare function FormInput({ className, type, label, error, description, variant, id, options, onValueChange, checked, onCheckedChange, ...props }: FormInputProps): react_jsx_runtime.JSX.Element;
|
|
606
631
|
|
|
632
|
+
interface SearchInputProps {
|
|
633
|
+
placeholder?: string;
|
|
634
|
+
value?: string;
|
|
635
|
+
onChange?: (value: string) => void;
|
|
636
|
+
onSearch?: (value: string) => void;
|
|
637
|
+
debounceMs?: number;
|
|
638
|
+
clearable?: boolean;
|
|
639
|
+
icon?: React$1.ReactNode;
|
|
640
|
+
variant?: "default" | "minimal" | "filled";
|
|
641
|
+
size?: "sm" | "md" | "lg";
|
|
642
|
+
className?: string;
|
|
643
|
+
}
|
|
644
|
+
declare function SearchInput({ placeholder, value: valueProp, onChange, onSearch, debounceMs, clearable, icon, variant, size, className, }: SearchInputProps): react_jsx_runtime.JSX.Element;
|
|
645
|
+
|
|
607
646
|
interface ConfirmModalProps {
|
|
608
647
|
open?: boolean;
|
|
609
648
|
onOpenChange?: (open: boolean) => void;
|
|
610
649
|
triggerLabel?: string;
|
|
611
650
|
triggerProps?: React$1.ComponentProps<typeof Button>;
|
|
651
|
+
stopPropagation?: boolean;
|
|
612
652
|
text?: string;
|
|
613
653
|
title: string;
|
|
614
654
|
description?: string;
|
|
@@ -620,14 +660,15 @@ interface ConfirmModalProps {
|
|
|
620
660
|
error?: string;
|
|
621
661
|
showModal?: boolean;
|
|
622
662
|
}
|
|
623
|
-
declare function ConfirmModal({ open: openProp, onOpenChange, triggerLabel, triggerProps, text, title, description, onConfirm, confirmLabel, cancelLabel, variant, loading, error, showModal, }: ConfirmModalProps): react_jsx_runtime.JSX.Element;
|
|
663
|
+
declare function ConfirmModal({ open: openProp, onOpenChange, triggerLabel, triggerProps, stopPropagation, text, title, description, onConfirm, confirmLabel, cancelLabel, variant, loading, error, showModal, }: ConfirmModalProps): react_jsx_runtime.JSX.Element;
|
|
624
664
|
|
|
625
665
|
interface CopyButtonProps extends React$1.ComponentProps<typeof Button> {
|
|
626
666
|
text?: string;
|
|
627
667
|
getText?: () => string;
|
|
628
668
|
onCopy?: () => void;
|
|
669
|
+
stopPropagation?: boolean;
|
|
629
670
|
}
|
|
630
|
-
declare function CopyButton({ text, getText, onCopy, ...props }: CopyButtonProps): react_jsx_runtime.JSX.Element;
|
|
671
|
+
declare function CopyButton({ text, getText, onCopy, stopPropagation, ...props }: CopyButtonProps): react_jsx_runtime.JSX.Element;
|
|
631
672
|
|
|
632
673
|
type FormFieldType = "text" | "textarea" | "select" | "checkbox" | "upload" | "number" | "email" | "url";
|
|
633
674
|
interface FormFieldConfig {
|
|
@@ -636,19 +677,38 @@ interface FormFieldConfig {
|
|
|
636
677
|
label?: string;
|
|
637
678
|
placeholder?: string;
|
|
638
679
|
description?: string;
|
|
680
|
+
helpText?: string | ((formData: Record<string, any>) => string);
|
|
639
681
|
required?: boolean;
|
|
640
682
|
active?: boolean | ((values: Record<string, any>) => boolean);
|
|
641
683
|
validation?: (value: any) => string | undefined;
|
|
642
684
|
options?: Array<{
|
|
643
685
|
label: string;
|
|
644
686
|
value: string;
|
|
645
|
-
}
|
|
687
|
+
}> | ((formData: Record<string, any>) => Array<{
|
|
688
|
+
label: string;
|
|
689
|
+
value: string;
|
|
690
|
+
}>) | (() => Array<{
|
|
691
|
+
label: string;
|
|
692
|
+
value: string;
|
|
693
|
+
}>);
|
|
646
694
|
accept?: string;
|
|
647
695
|
multiple?: boolean;
|
|
648
696
|
min?: number;
|
|
649
697
|
max?: number;
|
|
650
698
|
step?: number;
|
|
699
|
+
rows?: number;
|
|
700
|
+
variant?: "default" | "dashed" | "outlined";
|
|
701
|
+
size?: "sm" | "md" | "lg";
|
|
651
702
|
defaultValue?: any;
|
|
703
|
+
onChange?: (value: any, params: {
|
|
704
|
+
formData: Record<string, any>;
|
|
705
|
+
setFormData: (data: Record<string, any> | ((prev: Record<string, any>) => Record<string, any>)) => void;
|
|
706
|
+
fieldName: string;
|
|
707
|
+
}) => void;
|
|
708
|
+
onFileSelect?: (file: File, params: {
|
|
709
|
+
formData: Record<string, any>;
|
|
710
|
+
setFormData: (data: Record<string, any> | ((prev: Record<string, any>) => Record<string, any>)) => void;
|
|
711
|
+
}) => void;
|
|
652
712
|
}
|
|
653
713
|
interface FormModalProps {
|
|
654
714
|
open?: boolean;
|
|
@@ -656,15 +716,21 @@ interface FormModalProps {
|
|
|
656
716
|
triggerLabel?: string;
|
|
657
717
|
triggerProps?: React$1.ComponentProps<typeof Button>;
|
|
658
718
|
title: string;
|
|
719
|
+
variant?: "create" | "edit";
|
|
720
|
+
itemType?: string;
|
|
659
721
|
onSubmit: (data: Record<string, any>) => void | Promise<void>;
|
|
660
722
|
submitLabel?: string;
|
|
723
|
+
submittingLabel?: string;
|
|
661
724
|
cancelLabel?: string;
|
|
725
|
+
loading?: boolean;
|
|
726
|
+
isSubmitDisabled?: boolean | ((formData: Record<string, any>) => boolean);
|
|
727
|
+
onCreated?: (data: Record<string, any>) => void;
|
|
662
728
|
fields?: FormFieldConfig[];
|
|
663
729
|
children?: React$1.ReactNode;
|
|
664
730
|
beforeFields?: React$1.ReactNode;
|
|
665
731
|
afterFields?: React$1.ReactNode;
|
|
666
732
|
}
|
|
667
|
-
declare function FormModal({ open: openProp, onOpenChange, triggerLabel, triggerProps, title, onSubmit, submitLabel, cancelLabel, fields, children, beforeFields, afterFields, }: FormModalProps): react_jsx_runtime.JSX.Element;
|
|
733
|
+
declare function FormModal({ open: openProp, onOpenChange, triggerLabel, triggerProps, title, variant, itemType, onSubmit, submitLabel, submittingLabel, cancelLabel, loading: loadingProp, isSubmitDisabled, onCreated, fields, children, beforeFields, afterFields, }: FormModalProps): react_jsx_runtime.JSX.Element;
|
|
668
734
|
|
|
669
735
|
interface TriggerModalProps {
|
|
670
736
|
trigger: React$1.ReactNode;
|
|
@@ -705,14 +771,18 @@ interface GridProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
705
771
|
declare function Grid({ className, cols, gap, ...props }: GridProps): react_jsx_runtime.JSX.Element;
|
|
706
772
|
|
|
707
773
|
declare const cardVariants: (props?: ({
|
|
708
|
-
variant?: "minimal" | "filled" | "
|
|
709
|
-
size?: "sm" | "lg" | "
|
|
774
|
+
variant?: "minimal" | "filled" | "outlined" | "subtle" | null | undefined;
|
|
775
|
+
size?: "sm" | "lg" | "md" | "xs" | null | undefined;
|
|
710
776
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
711
777
|
interface CardProps extends React$1.ComponentProps<"div">, VariantProps<typeof cardVariants> {
|
|
712
778
|
header?: React$1.ReactNode;
|
|
713
779
|
footer?: React$1.ReactNode;
|
|
780
|
+
maxHeight?: string | number;
|
|
781
|
+
maxWidth?: string | number;
|
|
782
|
+
contentHeight?: string | number;
|
|
783
|
+
interactive?: boolean;
|
|
714
784
|
}
|
|
715
|
-
declare function Card({ className, variant, size, header, footer, children, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
785
|
+
declare function Card({ className, variant, size, header, footer, children, maxHeight, maxWidth, contentHeight, interactive, onClick, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
716
786
|
declare function CardHeader({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
717
787
|
declare function CardTitle({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
718
788
|
declare function CardDescription({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -739,10 +809,32 @@ interface ContainerProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
739
809
|
}
|
|
740
810
|
declare function Container({ className, maxWidth, ...props }: ContainerProps): react_jsx_runtime.JSX.Element;
|
|
741
811
|
|
|
742
|
-
interface ListProps
|
|
743
|
-
|
|
812
|
+
interface ListProps {
|
|
813
|
+
items: Array<any>;
|
|
814
|
+
renderItem: (item: any, index: number) => React$1.ReactNode;
|
|
815
|
+
searchable?: boolean;
|
|
816
|
+
searchPlaceholder?: string;
|
|
817
|
+
emptyTitle?: string;
|
|
818
|
+
emptyDescription?: string;
|
|
819
|
+
emptyAction?: React$1.ReactNode;
|
|
820
|
+
loading?: boolean;
|
|
821
|
+
skeletonCount?: number;
|
|
822
|
+
renderSkeleton?: () => React$1.ReactNode;
|
|
823
|
+
type?: "grid" | "list";
|
|
824
|
+
gridCols?: {
|
|
825
|
+
default?: number;
|
|
826
|
+
md?: number;
|
|
827
|
+
lg?: number;
|
|
828
|
+
};
|
|
829
|
+
className?: string;
|
|
830
|
+
searchValue?: string;
|
|
831
|
+
onSearchChange?: (value: string) => void;
|
|
832
|
+
filterItems?: (items: Array<any>, searchValue: string) => Array<any>;
|
|
833
|
+
error?: string | React$1.ReactNode;
|
|
834
|
+
header?: React$1.ReactNode;
|
|
835
|
+
footer?: React$1.ReactNode;
|
|
744
836
|
}
|
|
745
|
-
declare function List({ className,
|
|
837
|
+
declare function List({ items, renderItem, searchable, searchPlaceholder, emptyTitle, emptyDescription, emptyAction, loading, skeletonCount, renderSkeleton, type, gridCols, className, searchValue: searchValueProp, onSearchChange: onSearchChangeProp, filterItems, error, header, footer, }: ListProps): react_jsx_runtime.JSX.Element;
|
|
746
838
|
|
|
747
839
|
declare const headerVariants: (props?: ({
|
|
748
840
|
variant?: "default" | "bordered" | null | undefined;
|
|
@@ -751,17 +843,20 @@ interface HeaderProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<
|
|
|
751
843
|
sticky?: boolean;
|
|
752
844
|
heading?: string;
|
|
753
845
|
caption?: string;
|
|
846
|
+
description?: string;
|
|
847
|
+
badge?: React$1.ReactNode;
|
|
848
|
+
actions?: React$1.ReactNode[];
|
|
754
849
|
left?: React$1.ReactNode;
|
|
755
850
|
right?: React$1.ReactNode;
|
|
756
851
|
}
|
|
757
|
-
declare function Header({ className, sticky, variant, heading, caption, left, right, children, ...props }: HeaderProps): react_jsx_runtime.JSX.Element;
|
|
852
|
+
declare function Header({ className, sticky, variant, heading, caption, description, badge, actions, left, right, children, ...props }: HeaderProps): react_jsx_runtime.JSX.Element;
|
|
758
853
|
|
|
759
854
|
interface FooterProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
760
855
|
}
|
|
761
856
|
declare function Footer({ className, ...props }: FooterProps): react_jsx_runtime.JSX.Element;
|
|
762
857
|
|
|
763
858
|
declare const emptyScreenVariants: (props?: ({
|
|
764
|
-
variant?: "default" | "minimal" | "spacious" | null | undefined;
|
|
859
|
+
variant?: "default" | "error" | "minimal" | "spacious" | null | undefined;
|
|
765
860
|
size?: "sm" | "lg" | "md" | null | undefined;
|
|
766
861
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
767
862
|
interface EmptyScreenProps extends VariantProps<typeof emptyScreenVariants> {
|
|
@@ -774,12 +869,21 @@ interface EmptyScreenProps extends VariantProps<typeof emptyScreenVariants> {
|
|
|
774
869
|
declare function EmptyScreen({ title, description, icon, action, variant, size, className, }: EmptyScreenProps): react_jsx_runtime.JSX.Element;
|
|
775
870
|
|
|
776
871
|
interface CollapsiblePanelProps {
|
|
777
|
-
title
|
|
872
|
+
title?: string;
|
|
873
|
+
label?: string;
|
|
874
|
+
keyword?: string;
|
|
778
875
|
children: React$1.ReactNode;
|
|
779
876
|
defaultOpen?: boolean;
|
|
780
877
|
className?: string;
|
|
878
|
+
direction?: "horizontal" | "vertical";
|
|
879
|
+
triggerPosition?: "left" | "right" | "top" | "bottom";
|
|
880
|
+
minWidth?: string | number;
|
|
881
|
+
minHeight?: string | number;
|
|
882
|
+
triggerClassName?: string;
|
|
883
|
+
contentClassName?: string;
|
|
884
|
+
customTrigger?: React$1.ReactNode;
|
|
781
885
|
}
|
|
782
|
-
declare function CollapsiblePanel({ title, children, defaultOpen, className, }: CollapsiblePanelProps): react_jsx_runtime.JSX.Element;
|
|
886
|
+
declare function CollapsiblePanel({ title, label, keyword, children, defaultOpen, className, direction, triggerPosition, minWidth, minHeight, triggerClassName, contentClassName, customTrigger, }: CollapsiblePanelProps): react_jsx_runtime.JSX.Element;
|
|
783
887
|
|
|
784
888
|
declare function ResizablePanelGroup({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>): react_jsx_runtime.JSX.Element;
|
|
785
889
|
declare function ResizablePanel({ ...props }: React$1.ComponentProps<typeof ResizablePrimitive.Panel>): react_jsx_runtime.JSX.Element;
|
|
@@ -791,8 +895,17 @@ interface ResizeContainerProps {
|
|
|
791
895
|
children: React$1.ReactNode;
|
|
792
896
|
direction?: "horizontal" | "vertical";
|
|
793
897
|
className?: string;
|
|
898
|
+
maxWidth?: string | number;
|
|
899
|
+
maxHeight?: string | number;
|
|
900
|
+
containerClassName?: string;
|
|
901
|
+
contentClassName?: string;
|
|
902
|
+
padding?: number;
|
|
903
|
+
minScale?: number;
|
|
904
|
+
maxScale?: number;
|
|
905
|
+
fit?: "contain" | "cover" | "fill";
|
|
906
|
+
showControls?: boolean;
|
|
794
907
|
}
|
|
795
|
-
declare function ResizeContainer({ children, direction, className, }: ResizeContainerProps): react_jsx_runtime.JSX.Element;
|
|
908
|
+
declare function ResizeContainer({ children, direction, className, maxWidth, maxHeight, containerClassName, contentClassName, padding, minScale, maxScale, fit, showControls, }: ResizeContainerProps): react_jsx_runtime.JSX.Element;
|
|
796
909
|
|
|
797
910
|
type SidebarContextProps = {
|
|
798
911
|
state: "expanded" | "collapsed";
|
|
@@ -912,8 +1025,8 @@ declare function useThemeToggle(): {
|
|
|
912
1025
|
* Theme Configuration
|
|
913
1026
|
* Registry of all available themes organized by category
|
|
914
1027
|
*
|
|
915
|
-
* Base themes are defined here.
|
|
916
|
-
*
|
|
1028
|
+
* Base themes are defined here. For custom themes, use registerTheme() to add them.
|
|
1029
|
+
* Create theme files in public/tokens/themes/{category}/{themeId}.json and register them.
|
|
917
1030
|
*/
|
|
918
1031
|
type ThemeMetadata = {
|
|
919
1032
|
name: string;
|
|
@@ -938,14 +1051,33 @@ type ThemeCategory = {
|
|
|
938
1051
|
declare const THEME_CATEGORY_ORDER: readonly ["color", "typography", "shape", "density", "animation", "custom"];
|
|
939
1052
|
/**
|
|
940
1053
|
* Register a custom theme dynamically
|
|
941
|
-
*
|
|
942
|
-
*
|
|
1054
|
+
* Use this to add custom themes after creating theme files in public/tokens/themes/
|
|
1055
|
+
*
|
|
1056
|
+
* Example:
|
|
1057
|
+
* ```ts
|
|
1058
|
+
* import { registerTheme } from 'shru-design-system'
|
|
1059
|
+
*
|
|
1060
|
+
* // After creating public/tokens/themes/color/ocean.json
|
|
1061
|
+
* registerTheme('color', 'ocean', {
|
|
1062
|
+
* name: 'Ocean',
|
|
1063
|
+
* file: 'color/ocean.json',
|
|
1064
|
+
* icon: '🌊',
|
|
1065
|
+
* description: 'Ocean color theme'
|
|
1066
|
+
* })
|
|
1067
|
+
* ```
|
|
943
1068
|
*/
|
|
944
1069
|
declare function registerTheme(category: string, themeId: string, metadata: ThemeMetadata): Record<string, ThemeCategory>;
|
|
945
1070
|
/**
|
|
946
1071
|
* Register a theme from a token file
|
|
947
|
-
* Helper function
|
|
948
|
-
*
|
|
1072
|
+
* Helper function that loads the theme file and registers it automatically
|
|
1073
|
+
*
|
|
1074
|
+
* Example:
|
|
1075
|
+
* ```ts
|
|
1076
|
+
* import { registerThemeFromFile } from 'shru-design-system'
|
|
1077
|
+
*
|
|
1078
|
+
* // After creating public/tokens/themes/color/ocean.json
|
|
1079
|
+
* await registerThemeFromFile('color', 'ocean')
|
|
1080
|
+
* ```
|
|
949
1081
|
*/
|
|
950
1082
|
declare function registerThemeFromFile(category: string, themeId: string, filePath?: string): Promise<{
|
|
951
1083
|
success: boolean;
|
|
@@ -995,4 +1127,4 @@ declare function getCurrentCSSVariables(): Record<string, string>;
|
|
|
995
1127
|
*/
|
|
996
1128
|
declare function applyThemeSync(): void;
|
|
997
1129
|
|
|
998
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Box, type BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsiblePanel, type CollapsiblePanelProps, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmModal, type ConfirmModalProps, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyScreen, type EmptyScreenProps, EmptyTitle, ErrorBoundary, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Footer, type FooterProps, Form, FormControl, FormDescription, FormField, type FormFieldConfig, type FormFieldType, FormInput, type FormInputProps, type FormInputType, FormItem, FormLabel, FormMessage, FormModal, type FormModalProps, Grid, type GridProps, Header, type HeaderProps, HistoryControlButtons, type HistoryControlButtonsProps, HoverCard, HoverCardContent, HoverCardTrigger, Image, type ImageProps, InfoBanner, type InfoBannerProps, InlineEdit, type InlineEditProps, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, List, type ListProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, Radio, RadioItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResizeContainer, type ResizeContainerProps, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Snackbar, type SnackbarProps, Spinner, Stack, type StackProps, StatusText, type StatusTextProps, Stepper, type StepperProps, Switch, THEME_CATEGORY_ORDER, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextInput, type TextProps, Textarea, type ThemeMetadata$1 as ThemeMetadata, type ThemeSelection, ThemeToggle, type ThemeToggleProps, Toast, type ToastProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TriggerModal, type TriggerModalProps, Upload, type UploadProps, alertVariants, applyThemeSync, badgeVariants, buttonVariants, emptyMediaVariants, enableDebugMode, fieldVariants, getCurrentCSSVariables, getTheme, getThemeCategories, getThemeFilePath, getThemesForCategory, navigationMenuTriggerStyle, registerTheme, registerThemeFromFile, toggleVariants, useChart, useFormField, useSidebar, useTheme, useThemeToggle };
|
|
1130
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Box, type BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsiblePanel, type CollapsiblePanelProps, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmModal, type ConfirmModalProps, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyScreen, type EmptyScreenProps, EmptyTitle, ErrorBoundary, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Footer, type FooterProps, Form, FormControl, FormDescription, FormField, type FormFieldConfig, type FormFieldType, FormInput, type FormInputProps, type FormInputType, FormItem, FormLabel, FormMessage, FormModal, type FormModalProps, Grid, type GridProps, Header, type HeaderProps, HistoryControlButtons, type HistoryControlButtonsProps, HoverCard, HoverCardContent, HoverCardTrigger, Image, type ImageProps, InfoBanner, type InfoBannerProps, InlineEdit, type InlineEditProps, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, List, type ListProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, Radio, RadioItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResizeContainer, type ResizeContainerProps, ScrollArea, ScrollBar, SearchInput, type SearchInputProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, SkeletonGrid, type SkeletonGridProps, SkeletonText, type SkeletonTextProps, Slider, Snackbar, type SnackbarProps, Spinner, Stack, type StackProps, StatusText, type StatusTextProps, Stepper, type StepperProps, Switch, THEME_CATEGORY_ORDER, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextInput, type TextProps, Textarea, type ThemeMetadata$1 as ThemeMetadata, type ThemeSelection, ThemeToggle, type ThemeToggleProps, Toast, type ToastProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TriggerModal, type TriggerModalProps, Upload, type UploadProps, alertVariants, applyThemeSync, badgeVariants, buttonVariants, emptyMediaVariants, enableDebugMode, fieldVariants, getCurrentCSSVariables, getTheme, getThemeCategories, getThemeFilePath, getThemesForCategory, navigationMenuTriggerStyle, registerTheme, registerThemeFromFile, toggleVariants, useChart, useFormField, useSidebar, useTheme, useThemeToggle };
|