@contentstudio/ui 0.1.18 → 0.1.20

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
@@ -1,4 +1,7 @@
1
1
  import { default as Alert } from './Alert.vue';
2
+ import { App } from 'vue';
3
+ import { default as Avatar } from './Avatar.vue';
4
+ import { default as AvatarGroup } from './AvatarGroup.vue';
2
5
  import { default as Badge } from './components/Badge/Badge.vue';
3
6
  import { default as Button } from './components/Button/Button.vue';
4
7
  import { default as Checkbox } from './components/Checkbox/Checkbox.vue';
@@ -15,12 +18,17 @@ import { default as Indicator } from './Indicator.vue';
15
18
  import { InjectionKey } from 'vue';
16
19
  import { default as ListItem } from './components/ListItem/ListItem.vue';
17
20
  import { default as Loader } from './Loader.vue';
21
+ import { default as Modal } from './Modal.vue';
18
22
  import { Placement } from '@floating-ui/vue';
19
23
  import { default as Progress } from './Progress.vue';
20
24
  import { default as Radio } from './components/Radio/Radio.vue';
21
25
  import { Ref } from 'vue';
22
26
  import { default as SegmentedControl } from './components/SegmentedControl/SegmentedControl.vue';
23
27
  import { default as Select } from './components/Select/Select.vue';
28
+ import { default as Tabs } from './Tabs.vue';
29
+ import { default as TabsList } from './TabsList.vue';
30
+ import { default as TabsPanel } from './TabsPanel.vue';
31
+ import { default as TabsTab } from './TabsTab.vue';
24
32
  import { default as TextInput } from './TextInput.vue';
25
33
 
26
34
  export { Alert }
@@ -54,8 +62,81 @@ export declare interface AlertProps {
54
62
  class?: string;
55
63
  }
56
64
 
65
+ export { Avatar }
66
+
67
+ export { AvatarGroup }
68
+
69
+ export declare interface AvatarGroupProps {
70
+ /** Spacing between avatars (sm, md, lg) */
71
+ spacing?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
72
+ /** Gap between avatars in the group */
73
+ gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | string | number;
74
+ /** Outline width for avatars in the group */
75
+ outlineWidth?: 'none' | 'thin' | 'normal' | 'medium' | 'thick' | string | number;
76
+ /** Outline color for avatars in the group */
77
+ outlineColor?: ColorVariant | string;
78
+ /** Outline offset for avatars in the group */
79
+ outlineOffset?: 'none' | 'inset' | 'small' | 'medium' | 'large' | string | number;
80
+ /** Custom CSS classes to apply to the avatar group */
81
+ customClasses?: string | string[];
82
+ /** Maximum number of avatars to show before displaying a count */
83
+ max?: number;
84
+ /** Enable hover effect on avatars in the group */
85
+ hover?: boolean;
86
+ }
87
+
88
+ export declare interface AvatarProps {
89
+ /** Width and height of the avatar */
90
+ size?: AvatarSize | string | number;
91
+ /** Border radius of the avatar */
92
+ radius?: Radius;
93
+ /** Color of the avatar */
94
+ color?: ColorVariant | 'initials';
95
+ /** Gradient configuration when variant is gradient */
96
+ gradient?: {
97
+ from: ColorVariant;
98
+ to: ColorVariant;
99
+ deg?: number;
100
+ };
101
+ /** Image source URL */
102
+ src?: string | null;
103
+ /** Image alt text and placeholder title */
104
+ alt?: string;
105
+ /** Additional image attributes */
106
+ imageProps?: Record<string, any>;
107
+ /** Avatar placeholder content */
108
+ children?: any;
109
+ /** Determines whether text color should depend on background-color */
110
+ autoContrast?: boolean;
111
+ /** User name for generating initials when src is not available */
112
+ name?: string;
113
+ /** Colors used for autogenerated initials */
114
+ allowedInitialsColors?: ColorVariant[];
115
+ /** Component variant */
116
+ variant?: AvatarVariant;
117
+ /** HTML element or component to render as */
118
+ component?: string | object;
119
+ /** Enable hover effect (scale and shadow) */
120
+ hover?: boolean;
121
+ /** Custom CSS classes to apply to the avatar */
122
+ customClasses?: string | string[];
123
+ }
124
+
125
+ export declare type AvatarSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
126
+
127
+ export declare type AvatarVariant = VariantType | 'transparent';
128
+
57
129
  export { Badge }
58
130
 
131
+ export declare interface BadgeGradient {
132
+ /** First gradient color */
133
+ from: string;
134
+ /** Second gradient color */
135
+ to: string;
136
+ /** Gradient direction in degrees */
137
+ deg?: number;
138
+ }
139
+
59
140
  export declare interface BadgeProps {
60
141
  /** Controls font-size, height and horizontal padding */
61
142
  size?: ComponentSize;
@@ -64,13 +145,9 @@ export declare interface BadgeProps {
64
145
  /** Controls border-radius */
65
146
  radius?: ComponentRadius;
66
147
  /** Badge color */
67
- color?: ThemeColor;
148
+ color?: ThemeColor | string;
68
149
  /** Gradient configuration used when variant="gradient" */
69
- gradient?: {
70
- from: string;
71
- to: string;
72
- deg?: number;
73
- };
150
+ gradient?: BadgeGradient;
74
151
  /** Content displayed on the left side of the badge label */
75
152
  leftSection?: string | Component;
76
153
  /** Content displayed on the right side of the badge label */
@@ -79,9 +156,13 @@ export declare interface BadgeProps {
79
156
  fullWidth?: boolean;
80
157
  /** Badge variant */
81
158
  variant?: BadgeVariant;
159
+ /** Polymorphic component prop - allows changing the root element */
160
+ component?: string | Component;
161
+ /** Automatically adjust text color for better contrast with background */
162
+ autoContrast?: boolean;
82
163
  }
83
164
 
84
- export declare type BadgeVariant = 'filled' | 'light' | 'outline' | 'dot' | 'transparent' | 'white' | 'default' | 'gradient';
165
+ export declare type BadgeVariant = 'filled' | 'light' | 'outline' | 'gradient' | 'transparent';
85
166
 
86
167
  export { Button }
87
168
 
@@ -120,7 +201,7 @@ export declare type ButtonRadius = NonNullable<ButtonProps['radius']>;
120
201
 
121
202
  export declare type ButtonSize = NonNullable<ButtonProps['size']>;
122
203
 
123
- declare type ButtonVariant = 'filled' | 'light' | 'outline' | 'subtle' | 'gradient' | 'white' | 'default';
204
+ export declare type ButtonVariant = 'filled' | 'light' | 'outline' | 'subtle' | 'gradient' | 'white' | 'default';
124
205
 
125
206
  export { Checkbox }
126
207
 
@@ -227,11 +308,78 @@ export declare interface CollapsibleProps {
227
308
  modelValue?: boolean;
228
309
  }
229
310
 
311
+ export declare const colorClasses: {
312
+ readonly primary: {
313
+ readonly base: "blue";
314
+ readonly text: "text-blue-600";
315
+ readonly bg: "bg-blue-600";
316
+ readonly hover: "hover:bg-blue-700";
317
+ readonly border: "border-blue-600";
318
+ readonly ring: "ring-blue-500";
319
+ };
320
+ readonly secondary: {
321
+ readonly base: "gray";
322
+ readonly text: "text-gray-600";
323
+ readonly bg: "bg-gray-600";
324
+ readonly hover: "hover:bg-gray-700";
325
+ readonly border: "border-gray-600";
326
+ readonly ring: "ring-gray-500";
327
+ };
328
+ readonly success: {
329
+ readonly base: "green";
330
+ readonly text: "text-green-600";
331
+ readonly bg: "bg-green-600";
332
+ readonly hover: "hover:bg-green-700";
333
+ readonly border: "border-green-600";
334
+ readonly ring: "ring-green-500";
335
+ };
336
+ readonly warning: {
337
+ readonly base: "yellow";
338
+ readonly text: "text-yellow-600";
339
+ readonly bg: "bg-yellow-600";
340
+ readonly hover: "hover:bg-yellow-700";
341
+ readonly border: "border-yellow-600";
342
+ readonly ring: "ring-yellow-500";
343
+ };
344
+ readonly danger: {
345
+ readonly base: "red";
346
+ readonly text: "text-red-600";
347
+ readonly bg: "bg-red-600";
348
+ readonly hover: "hover:bg-red-700";
349
+ readonly border: "border-red-600";
350
+ readonly ring: "ring-red-500";
351
+ };
352
+ readonly info: {
353
+ readonly base: "sky";
354
+ readonly text: "text-sky-600";
355
+ readonly bg: "bg-sky-600";
356
+ readonly hover: "hover:bg-sky-700";
357
+ readonly border: "border-sky-600";
358
+ readonly ring: "ring-sky-500";
359
+ };
360
+ readonly dark: {
361
+ readonly base: "dark";
362
+ readonly text: "text-gray-200";
363
+ readonly bg: "bg-gray-900";
364
+ readonly hover: "hover:bg-gray-800";
365
+ readonly border: "border-gray-900";
366
+ readonly ring: "ring-gray-700";
367
+ };
368
+ readonly light: {
369
+ readonly base: "light";
370
+ readonly text: "text-gray-600";
371
+ readonly bg: "bg-gray-100";
372
+ readonly hover: "hover:bg-gray-200";
373
+ readonly border: "border-gray-100";
374
+ readonly ring: "ring-gray-300";
375
+ };
376
+ };
377
+
230
378
  declare type ColorVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'dark' | 'light';
231
379
 
232
- declare type ComponentRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
380
+ export declare type ComponentRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
233
381
 
234
- declare type ComponentSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
382
+ export declare type ComponentSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
235
383
 
236
384
  export declare const composables: {};
237
385
 
@@ -311,6 +459,16 @@ export declare interface DropdownProps {
311
459
  matchWidth?: boolean;
312
460
  }
313
461
 
462
+ /**
463
+ * Extracts initials from a name string
464
+ */
465
+ export declare function getInitials(name: string): string;
466
+
467
+ /**
468
+ * Generates a color from a string (name) using a simple hash function
469
+ */
470
+ export declare function getInitialsColor(name: string, allowedColors?: ColorVariant[]): ColorVariant;
471
+
314
472
  export { HoverCard }
315
473
 
316
474
  export declare interface HoverCardContext {
@@ -369,10 +527,10 @@ export { Indicator }
369
527
  export declare interface IndicatorProps {
370
528
  /** Position of the indicator relative to its container */
371
529
  position?: Position;
372
- /** Size of the indicator */
373
- size?: ComponentSize;
530
+ /** Size of the indicator (predefined size or number in pixels) */
531
+ size?: ComponentSize | number;
374
532
  /** Border radius of the indicator */
375
- radius?: ComponentRadius;
533
+ radius?: ComponentRadius | Radius;
376
534
  /** Color variant of the indicator */
377
535
  color?: ThemeColor;
378
536
  /** Variant style of the indicator */
@@ -432,6 +590,114 @@ export declare type MantineRadius = 'none' | 'sm' | 'md' | 'lg' | 'full' | numbe
432
590
 
433
591
  export declare type MantineSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
434
592
 
593
+ export { Modal }
594
+
595
+ export declare const ModalDirective: {
596
+ install: (app: any) => void;
597
+ };
598
+
599
+ declare interface ModalInstance {
600
+ show: (id: string) => void;
601
+ hide: (id: string) => void;
602
+ toggle: (id: string) => void;
603
+ msgBoxOk: (message: string | any, options?: ModalOptions) => Promise<boolean>;
604
+ msgBoxConfirm: (message: string | any, options?: ModalOptions) => Promise<boolean>;
605
+ }
606
+
607
+ declare interface ModalOptions {
608
+ title?: string;
609
+ okTitle?: string;
610
+ okVariant?: string;
611
+ okColor?: string;
612
+ cancelTitle?: string;
613
+ cancelVariant?: string;
614
+ cancelColor?: string;
615
+ centered?: boolean;
616
+ showHeaderDivider?: boolean;
617
+ showFooterDivider?: boolean;
618
+ size?: string;
619
+ noCloseOnBackdrop?: boolean;
620
+ noCloseOnEsc?: boolean;
621
+ zIndex?: number;
622
+ }
623
+
624
+ export declare interface ModalPlugin {
625
+ $cstuModal: ModalInstance;
626
+ }
627
+
628
+ export declare const ModalPlugin: {
629
+ install(app: App): void;
630
+ };
631
+
632
+ export declare interface ModalProps {
633
+ /** Modal title */
634
+ title?: string;
635
+ /** Modal content */
636
+ content?: string;
637
+ /** Whether the modal is opened */
638
+ modelValue?: boolean;
639
+ /** Modal size */
640
+ size?: ComponentSize;
641
+ /** Border radius */
642
+ radius?: ComponentRadius;
643
+ /** Whether to show close button in header */
644
+ hideHeaderClose?: boolean;
645
+ /** Whether to show footer */
646
+ hideFooter?: boolean;
647
+ /** Whether to show header */
648
+ hideHeader?: boolean;
649
+ /** Whether to close on ESC key */
650
+ noCloseOnEsc?: boolean;
651
+ /** Whether to close on backdrop click */
652
+ noCloseOnBackdrop?: boolean;
653
+ /** Whether to center modal vertically */
654
+ centered?: boolean;
655
+ /** Whether to make the modal scrollable */
656
+ scrollable?: boolean;
657
+ /** Whether to show modal in fullscreen */
658
+ fullscreen?: boolean;
659
+ /** Whether to keep the component mounted when hidden */
660
+ static?: boolean;
661
+ /** Whether the modal is busy (disables all buttons) */
662
+ busy?: boolean;
663
+ /** OK button text */
664
+ okTitle?: string;
665
+ /** Cancel button text */
666
+ cancelTitle?: string;
667
+ /** OK button variant */
668
+ okVariant?: ButtonVariant;
669
+ /** Cancel button variant */
670
+ cancelVariant?: ButtonVariant;
671
+ /** OK button color */
672
+ okColor?: ThemeColor;
673
+ /** Cancel button color */
674
+ cancelColor?: ThemeColor;
675
+ /** Whether to show only OK button */
676
+ okOnly?: boolean;
677
+ /** Whether to disable OK button */
678
+ okDisabled?: boolean;
679
+ /** Whether to disable Cancel button */
680
+ cancelDisabled?: boolean;
681
+ /** Whether to show backdrop */
682
+ backdrop?: boolean | 'static';
683
+ /** Modal z-index */
684
+ zIndex?: number;
685
+ /** Left section props */
686
+ leftSectionProps?: SectionProps;
687
+ /** Right section props */
688
+ rightSectionProps?: SectionProps;
689
+ /** Left section */
690
+ leftSection?: any;
691
+ /** Right section */
692
+ rightSection?: any;
693
+ /** Custom class names */
694
+ class?: string;
695
+ /** Whether to make the title visually hidden but accessible to screen readers */
696
+ titleSrOnly?: boolean;
697
+ /** Accessible label when no visible title is provided */
698
+ ariaLabel?: string;
699
+ }
700
+
435
701
  declare type Position = 'top-start' | 'top-end' | 'top-center' | 'bottom-start' | 'bottom-end' | 'bottom-center' | 'middle-start' | 'middle-end' | 'middle-center';
436
702
 
437
703
  export { Progress }
@@ -442,22 +708,36 @@ export declare interface ProgressProps {
442
708
  /** Size of the progress bar */
443
709
  size?: ComponentSize;
444
710
  /** Color of the progress bar */
445
- color?: string;
711
+ color?: ThemeColor | string;
446
712
  /** Whether to show stripes */
447
713
  striped?: boolean;
448
714
  /** Whether to animate the stripes */
449
715
  animated?: boolean;
450
716
  /** Label to show inside the progress bar */
451
717
  label?: string;
718
+ /** Whether to show the value as a percentage */
719
+ showValue?: boolean;
720
+ /** Radius of the progress bar */
721
+ radius?: ProgressRadius;
452
722
  /** Custom classes */
453
723
  class?: string;
724
+ /** Multiple sections for segmented progress bar */
725
+ sections?: ProgressSection[];
454
726
  }
455
727
 
456
- export declare interface ProgressSectionProps {
728
+ export declare type ProgressRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
729
+
730
+ export declare interface ProgressSection {
731
+ /** Value of this section (will be calculated as percentage of total) */
457
732
  value: number;
458
- color?: string;
733
+ /** Color of this section */
734
+ color?: ThemeColor | string;
735
+ /** Whether to show stripes for this section */
459
736
  striped?: boolean;
737
+ /** Whether to animate the stripes for this section */
460
738
  animated?: boolean;
739
+ /** Label to show inside this section (only visible if section is wide enough) */
740
+ label?: string;
461
741
  }
462
742
 
463
743
  export { Radio }
@@ -516,7 +796,19 @@ export declare interface RadioProps {
516
796
 
517
797
  export declare type RadioVariant = 'filled' | 'outlined';
518
798
 
519
- declare type SectionProps = Record<string, any>;
799
+ declare type Radius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
800
+
801
+ export declare const radiusClasses: {
802
+ readonly none: "rounded-none";
803
+ readonly xs: "rounded";
804
+ readonly sm: "rounded-md";
805
+ readonly md: "rounded-lg";
806
+ readonly lg: "rounded-xl";
807
+ readonly xl: "rounded-2xl";
808
+ readonly full: "rounded-full";
809
+ };
810
+
811
+ export declare type SectionProps = Record<string, any>;
520
812
 
521
813
  export { SegmentedControl }
522
814
 
@@ -605,6 +897,22 @@ export declare interface SelectProps {
605
897
 
606
898
  declare type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
607
899
 
900
+ export declare const sizeClasses: {
901
+ readonly xs: "px-2.5 py-1.5 text-xs";
902
+ readonly sm: "px-3 py-2 text-sm";
903
+ readonly md: "px-4 py-2 text-base";
904
+ readonly lg: "px-4 py-2.5 text-lg";
905
+ readonly xl: "px-5 py-3 text-xl";
906
+ };
907
+
908
+ export { Tabs }
909
+
910
+ export { TabsList }
911
+
912
+ export { TabsPanel }
913
+
914
+ export { TabsTab }
915
+
608
916
  export { TextInput }
609
917
 
610
918
  export declare interface TextInputProps {
@@ -654,7 +962,7 @@ export declare interface TextInputProps {
654
962
  leftSectionProps?: SectionProps;
655
963
  }
656
964
 
657
- declare type ThemeColor = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'dark' | 'light';
965
+ export declare type ThemeColor = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'dark' | 'light';
658
966
 
659
967
  export declare function useHoverCard(options?: UseHoverCardOptions): {
660
968
  isOpen: Ref<boolean, boolean>;
@@ -670,6 +978,8 @@ declare interface UseHoverCardOptions {
670
978
  initiallyOpened?: boolean;
671
979
  }
672
980
 
981
+ export declare function useModal(): ModalInstance;
982
+
673
983
  declare type VariantType = 'filled' | 'light' | 'outline' | 'default' | 'subtle' | 'gradient' | 'white' | 'dot' | 'bordered' | 'bordered-transparent' | 'text';
674
984
 
675
985
  export { }