@rovula/ui 0.0.47 → 0.0.49

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 (45) hide show
  1. package/dist/cjs/bundle.css +32 -4
  2. package/dist/cjs/bundle.js +3 -3
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/Switch/Switch.stories.d.ts +1 -6
  5. package/dist/cjs/types/components/Tree/Tree.d.ts +4 -0
  6. package/dist/cjs/types/components/Tree/Tree.stories.d.ts +12 -0
  7. package/dist/cjs/types/components/Tree/TreeItem.d.ts +4 -0
  8. package/dist/cjs/types/components/Tree/index.d.ts +4 -0
  9. package/dist/cjs/types/components/Tree/type.d.ts +76 -0
  10. package/dist/cjs/types/index.d.ts +1 -0
  11. package/dist/components/Switch/Switch.js +2 -2
  12. package/dist/components/Switch/Switch.stories.js +2 -7
  13. package/dist/components/Tree/Tree.js +104 -0
  14. package/dist/components/Tree/Tree.stories.js +162 -0
  15. package/dist/components/Tree/TreeItem.js +81 -0
  16. package/dist/components/Tree/index.js +4 -0
  17. package/dist/components/Tree/type.js +1 -0
  18. package/dist/esm/bundle.css +32 -4
  19. package/dist/esm/bundle.js +1 -1
  20. package/dist/esm/bundle.js.map +1 -1
  21. package/dist/esm/types/components/Switch/Switch.stories.d.ts +1 -6
  22. package/dist/esm/types/components/Tree/Tree.d.ts +4 -0
  23. package/dist/esm/types/components/Tree/Tree.stories.d.ts +12 -0
  24. package/dist/esm/types/components/Tree/TreeItem.d.ts +4 -0
  25. package/dist/esm/types/components/Tree/index.d.ts +4 -0
  26. package/dist/esm/types/components/Tree/type.d.ts +76 -0
  27. package/dist/esm/types/index.d.ts +1 -0
  28. package/dist/index.d.ts +82 -2
  29. package/dist/index.js +1 -0
  30. package/dist/src/theme/global.css +75 -14
  31. package/dist/theme/themes/SKL/color.css +10 -10
  32. package/dist/theme/themes/xspector/baseline.css +1 -0
  33. package/dist/theme/themes/xspector/components/switch.css +30 -0
  34. package/package.json +1 -1
  35. package/src/components/Switch/Switch.stories.tsx +2 -7
  36. package/src/components/Switch/Switch.tsx +2 -2
  37. package/src/components/Tree/Tree.stories.tsx +288 -0
  38. package/src/components/Tree/Tree.tsx +192 -0
  39. package/src/components/Tree/TreeItem.tsx +231 -0
  40. package/src/components/Tree/index.ts +5 -0
  41. package/src/components/Tree/type.ts +90 -0
  42. package/src/index.ts +1 -0
  43. package/src/theme/themes/SKL/color.css +10 -10
  44. package/src/theme/themes/xspector/baseline.css +1 -0
  45. package/src/theme/themes/xspector/components/switch.css +30 -0
@@ -293,13 +293,8 @@ declare const meta: {
293
293
  export default meta;
294
294
  export declare const Default: {
295
295
  args: {
296
- defaultValue: number[];
297
- max: number;
298
- step: number;
299
- name: string;
300
- minStepsBetweenThumbs: number;
296
+ checked: boolean;
301
297
  disabled: boolean;
302
- inverted: boolean;
303
298
  };
304
299
  render: (args: {}) => import("react/jsx-runtime").JSX.Element;
305
300
  };
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { TreeProps } from "./type";
3
+ declare const Tree: FC<TreeProps>;
4
+ export default Tree;
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import Tree from "./Tree";
3
+ declare const meta: Meta<typeof Tree>;
4
+ export default meta;
5
+ export declare const Default: StoryObj<typeof Tree>;
6
+ export declare const onClick: StoryObj<typeof Tree>;
7
+ export declare const CustomIcon: StoryObj<typeof Tree>;
8
+ export declare const renderRightSection: StoryObj<typeof Tree>;
9
+ export declare const ControlShowExpandButton: StoryObj<typeof Tree>;
10
+ export declare const Diabled: StoryObj<typeof Tree>;
11
+ export declare const DiabledEachItem: StoryObj<typeof Tree>;
12
+ export declare const ExpandLoadData: StoryObj<typeof Tree>;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { TreeItemProps } from "./type";
3
+ declare const TreeItem: FC<TreeItemProps>;
4
+ export default TreeItem;
@@ -0,0 +1,4 @@
1
+ import Tree from "./Tree";
2
+ import TreeItem from "./TreeItem";
3
+ export * from "./type";
4
+ export { Tree, TreeItem };
@@ -0,0 +1,76 @@
1
+ import { CSSProperties, ReactNode } from "react";
2
+ export type TreeData = {
3
+ id: string;
4
+ title: string;
5
+ icon?: ReactNode;
6
+ disabled?: boolean;
7
+ onClickItem?: (id: string) => void;
8
+ children?: TreeData[];
9
+ renderIcon?: (params: {
10
+ id: string;
11
+ expanded: boolean;
12
+ selected: boolean;
13
+ }) => ReactNode;
14
+ };
15
+ export interface TreeItemProps extends TreeData {
16
+ isFirstLevel?: boolean;
17
+ isLastItem: boolean;
18
+ disabled?: boolean;
19
+ showIcon?: boolean;
20
+ showExpandButton?: boolean;
21
+ enableSeparatorLine?: boolean;
22
+ checkIsExpanded: (id: string) => boolean;
23
+ checkIsChecked: (id: string) => boolean;
24
+ checkIsLoading?: (id: string) => void;
25
+ onExpandChange?: (id: string, expanded: boolean) => void;
26
+ onCheckedChange?: (id: string, checked: boolean) => void;
27
+ renderRightSection?: (params: {
28
+ id: string;
29
+ expanded: boolean;
30
+ selected: boolean;
31
+ }) => ReactNode;
32
+ renderElement?: (params: {
33
+ id: string;
34
+ expanded: boolean;
35
+ selected: boolean;
36
+ children: ReactNode;
37
+ styles: {
38
+ branch: CSSProperties;
39
+ horizontalLine: CSSProperties;
40
+ expandButton: CSSProperties;
41
+ childPadding: CSSProperties;
42
+ };
43
+ onClick?: TreeItemProps["onClickItem"];
44
+ }) => ReactNode;
45
+ renderTitle?: (params: {
46
+ id: string;
47
+ title: string;
48
+ expanded: boolean;
49
+ selected: boolean;
50
+ }) => ReactNode;
51
+ classes?: Partial<{
52
+ elementWrapper: string;
53
+ branch: string;
54
+ itemWrapper: string;
55
+ itemContainer: string;
56
+ horizontalLine: string;
57
+ expandButton: string;
58
+ separatorLine: string;
59
+ checkbox: string;
60
+ item: string;
61
+ title: string;
62
+ childrenWrapper: string;
63
+ }>;
64
+ }
65
+ export interface TreeProps extends Pick<TreeItemProps, "renderIcon" | "renderRightSection" | "renderElement" | "renderTitle" | "showIcon" | "disabled" | "enableSeparatorLine" | "classes"> {
66
+ data: TreeData[];
67
+ defaultExpandedId?: string[];
68
+ defaultCheckedId?: string[];
69
+ checkedId?: string[];
70
+ loadingId?: string[];
71
+ onExpandChange?: (id: string, expanded: boolean) => void;
72
+ onCheckedChange?: (checkedId: string[]) => void;
73
+ defaultExpandAll?: boolean;
74
+ defaultCheckAll?: boolean;
75
+ hierarchicalCheck?: boolean;
76
+ }
@@ -32,6 +32,7 @@ export * from "./components/Tooltip/TooltipSimple";
32
32
  export * from "./components/Toast/Toast";
33
33
  export * from "./components/Toast/Toaster";
34
34
  export * from "./components/Toast/useToast";
35
+ export * from "./components/Tree";
35
36
  export type { ButtonProps } from "./components/Button/Button";
36
37
  export type { InputProps } from "./components/TextInput/TextInput";
37
38
  export type { DropdownProps, Options } from "./components/Dropdown/Dropdown";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { ReactElement, ReactNode, FC, ComponentPropsWithoutRef } from 'react';
2
+ import React__default, { ReactElement, ReactNode, FC, ComponentPropsWithoutRef, CSSProperties } from 'react';
3
3
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
4
4
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
5
5
  import * as LabelPrimitive from '@radix-ui/react-label';
@@ -601,6 +601,86 @@ declare function useToast(options?: ToastOptions): {
601
601
  position?: ToasterPosition;
602
602
  };
603
603
 
604
+ type TreeData = {
605
+ id: string;
606
+ title: string;
607
+ icon?: ReactNode;
608
+ disabled?: boolean;
609
+ onClickItem?: (id: string) => void;
610
+ children?: TreeData[];
611
+ renderIcon?: (params: {
612
+ id: string;
613
+ expanded: boolean;
614
+ selected: boolean;
615
+ }) => ReactNode;
616
+ };
617
+ interface TreeItemProps extends TreeData {
618
+ isFirstLevel?: boolean;
619
+ isLastItem: boolean;
620
+ disabled?: boolean;
621
+ showIcon?: boolean;
622
+ showExpandButton?: boolean;
623
+ enableSeparatorLine?: boolean;
624
+ checkIsExpanded: (id: string) => boolean;
625
+ checkIsChecked: (id: string) => boolean;
626
+ checkIsLoading?: (id: string) => void;
627
+ onExpandChange?: (id: string, expanded: boolean) => void;
628
+ onCheckedChange?: (id: string, checked: boolean) => void;
629
+ renderRightSection?: (params: {
630
+ id: string;
631
+ expanded: boolean;
632
+ selected: boolean;
633
+ }) => ReactNode;
634
+ renderElement?: (params: {
635
+ id: string;
636
+ expanded: boolean;
637
+ selected: boolean;
638
+ children: ReactNode;
639
+ styles: {
640
+ branch: CSSProperties;
641
+ horizontalLine: CSSProperties;
642
+ expandButton: CSSProperties;
643
+ childPadding: CSSProperties;
644
+ };
645
+ onClick?: TreeItemProps["onClickItem"];
646
+ }) => ReactNode;
647
+ renderTitle?: (params: {
648
+ id: string;
649
+ title: string;
650
+ expanded: boolean;
651
+ selected: boolean;
652
+ }) => ReactNode;
653
+ classes?: Partial<{
654
+ elementWrapper: string;
655
+ branch: string;
656
+ itemWrapper: string;
657
+ itemContainer: string;
658
+ horizontalLine: string;
659
+ expandButton: string;
660
+ separatorLine: string;
661
+ checkbox: string;
662
+ item: string;
663
+ title: string;
664
+ childrenWrapper: string;
665
+ }>;
666
+ }
667
+ interface TreeProps extends Pick<TreeItemProps, "renderIcon" | "renderRightSection" | "renderElement" | "renderTitle" | "showIcon" | "disabled" | "enableSeparatorLine" | "classes"> {
668
+ data: TreeData[];
669
+ defaultExpandedId?: string[];
670
+ defaultCheckedId?: string[];
671
+ checkedId?: string[];
672
+ loadingId?: string[];
673
+ onExpandChange?: (id: string, expanded: boolean) => void;
674
+ onCheckedChange?: (checkedId: string[]) => void;
675
+ defaultExpandAll?: boolean;
676
+ defaultCheckAll?: boolean;
677
+ hierarchicalCheck?: boolean;
678
+ }
679
+
680
+ declare const Tree: FC<TreeProps>;
681
+
682
+ declare const TreeItem: FC<TreeItemProps>;
683
+
604
684
  declare const resloveTimestamp: (timestamp: number) => number;
605
685
  declare const getStartDateOfDay: (date: Date) => Date;
606
686
  declare const getEndDateOfDay: (date: Date) => Date;
@@ -612,4 +692,4 @@ declare const getTimestampUTC: (date: Date) => number;
612
692
 
613
693
  declare function cn(...inputs: ClassValue[]): string;
614
694
 
615
- export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Calendar, Checkbox, Collapsible, DataTable, type DataTableProps, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownProps, Icon, Input, InputFilter, type InputFilterProps, type InputProps, Label, Loading, Navbar, type NavbarProps, type Options$1 as Options, Popover, PopoverContent, PopoverTrigger, ProgressBar, Search, type SearchProps, Slider, type SliderProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextInput, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipSimple, TooltipTrigger, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, reducer, resloveTimestamp, toast, useToast };
695
+ export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Calendar, Checkbox, Collapsible, DataTable, type DataTableProps, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownProps, Icon, Input, InputFilter, type InputFilterProps, type InputProps, Label, Loading, Navbar, type NavbarProps, type Options$1 as Options, Popover, PopoverContent, PopoverTrigger, ProgressBar, Search, type SearchProps, Slider, type SliderProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextInput, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipSimple, TooltipTrigger, Tree, type TreeData, TreeItem, type TreeItemProps, type TreeProps, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, reducer, resloveTimestamp, toast, useToast };
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ export * from "./components/Tooltip/TooltipSimple";
34
34
  export * from "./components/Toast/Toast";
35
35
  export * from "./components/Toast/Toaster";
36
36
  export * from "./components/Toast/useToast";
37
+ export * from "./components/Tree";
37
38
  // UTILS
38
39
  export { resloveTimestamp, getStartDateOfDay, getEndDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, } from "./utils/datetime";
39
40
  export { cn } from "./utils/cn";
@@ -1576,6 +1576,30 @@
1576
1576
  /* Disabled State */
1577
1577
  --dropdown-menu-disabled-bg: transparent;
1578
1578
  --dropdown-menu-disabled-text: var(--grey-grey-140);
1579
+ /* ------------------------------------------------------------------ */
1580
+ /* Switch Component Tokens */
1581
+ /* ------------------------------------------------------------------ */
1582
+ /* Naming Convention: --[component]-[element]-[state]-[property] */
1583
+ /* Element: [progress, track] */
1584
+ /* ------------------------------------------------------------------ */
1585
+ /* Default State */
1586
+ --switch-default-color: rgb(from var(--state-color-secondary-active) r g b / 0.32);
1587
+ --switch-thumb-default-color: var(--state-color-secondary-active);
1588
+ /* Hover State */
1589
+ --switch-hover-color: rgb(from var(--state-color-secondary-active) r g b / 0.48);
1590
+ --switch-thumb-hover-color: var(--switch-thumb-default-color);
1591
+ --switch-thumb-hover-ring: var(--state-color-secondary-hover-bg);
1592
+ /* Active State */
1593
+ --switch-active-color: rgb(from var(--state-color-primary-active) r g b / 0.32);
1594
+ --switch-thumb-active-color: var(--state-color-primary-active);
1595
+ /* Active Hover State */
1596
+ --switch-active-hover-color: rgb(from var(--state-color-primary-active) r g b / 0.48);
1597
+ --switch-thumb-active-hover-color: var(--switch-thumb-active-color);
1598
+ --switch-thumb-active-hover-ring: var(--state-color-primary-hover-bg);
1599
+ /* Disabled State */
1600
+ --switch-disabled-color: rgb(from var(--state-color-disable-solid) r g b / 0.32);
1601
+ --switch-thumb-disabled-color: var(--state-color-disable-solid)
1602
+ ;
1579
1603
  }
1580
1604
 
1581
1605
  :root[data-theme="SKL"]{
@@ -1820,16 +1844,16 @@
1820
1844
  /* #2d2e30; */
1821
1845
  --input-color-error: #ed2f15;
1822
1846
  /* Function button */
1823
- --function-default-solid: #1e3249;
1824
- --function-default-hover: #35475b;
1825
- --function-default-hover-bg: rgba(30 50 73 / 0.08);
1826
- --function-default-stroke: rgba(30 50 73 / 0.48);
1847
+ --function-default-solid: var(--state-color-primary-default);
1848
+ --function-default-hover: var(--state-color-primary-hover);
1849
+ --function-default-hover-bg: var(--state-color-primary-hover-bg);
1850
+ --function-default-stroke: var(--state-color-primary-stroke);
1827
1851
  --function-default-icon: #ffffff;
1828
- --function-default-outline-icon: #1e3249;
1829
- --function-active-solid: #9b8f00;
1830
- --function-active-hover: #b1a400;
1831
- --function-active-hover-bg: rgba(221 205 0 / 0.08);
1832
- --function-active-stroke: rgba(177 164 0 / 0.48);
1852
+ --function-default-outline-icon: var(--state-color-primary-default);
1853
+ --function-active-solid: var(--state-color-secondary-default);
1854
+ --function-active-hover: var(--state-color-secondary-hover);
1855
+ --function-active-hover-bg: var(--state-color-secondary-hover-bg);
1856
+ --function-active-stroke: var(--state-color-secondary-stroke);
1833
1857
  --function-active-icon: #ffffff;
1834
1858
  --text-black: #000000;
1835
1859
  --text-dark: #18283a;
@@ -1853,7 +1877,7 @@
1853
1877
  --background: var(--base-color-bg);
1854
1878
  --foreground: var(--common-black);
1855
1879
  --primary: var(--primary-ramps-primary-100);
1856
- --secondary: var(--secondary-ramps-secondary-100);
1880
+ --primary: var(--secondary-ramps-secondary-100);
1857
1881
  --tertiary: var(--tertiary-ramps-tertiary-100);
1858
1882
  --info: var(--info-info-100);
1859
1883
  --success: var(--success-success-100);
@@ -3518,6 +3542,10 @@ input[type=number] {
3518
3542
  margin-right: 1rem;
3519
3543
  }
3520
3544
 
3545
+ .mr-\[2px\] {
3546
+ margin-right: 2px;
3547
+ }
3548
+
3521
3549
  .mt-1 {
3522
3550
  margin-top: 0.25rem;
3523
3551
  }
@@ -3619,6 +3647,11 @@ input[type=number] {
3619
3647
  height: 14px;
3620
3648
  }
3621
3649
 
3650
+ .size-\[16pt\] {
3651
+ width: 16pt;
3652
+ height: 16pt;
3653
+ }
3654
+
3622
3655
  .size-\[30px\] {
3623
3656
  width: 30px;
3624
3657
  height: 30px;
@@ -3634,6 +3667,10 @@ input[type=number] {
3634
3667
  height: 100%;
3635
3668
  }
3636
3669
 
3670
+ .h-1\/2 {
3671
+ height: 50%;
3672
+ }
3673
+
3637
3674
  .h-10 {
3638
3675
  height: 2.5rem;
3639
3676
  }
@@ -3674,6 +3711,10 @@ input[type=number] {
3674
3711
  height: 24px;
3675
3712
  }
3676
3713
 
3714
+ .h-\[2px\] {
3715
+ height: 2px;
3716
+ }
3717
+
3677
3718
  .h-\[32px\] {
3678
3719
  height: 32px;
3679
3720
  }
@@ -3727,6 +3768,10 @@ input[type=number] {
3727
3768
  max-height: 100vh;
3728
3769
  }
3729
3770
 
3771
+ .min-h-10 {
3772
+ min-height: 2.5rem;
3773
+ }
3774
+
3730
3775
  .w-1\/2 {
3731
3776
  width: 50%;
3732
3777
  }
@@ -4083,6 +4128,10 @@ input[type=number] {
4083
4128
  white-space: nowrap;
4084
4129
  }
4085
4130
 
4131
+ .text-ellipsis {
4132
+ text-overflow: ellipsis;
4133
+ }
4134
+
4086
4135
  .rounded {
4087
4136
  border-radius: 0.25rem;
4088
4137
  }
@@ -6059,6 +6108,10 @@ input[type=number] {
6059
6108
  fill: color-mix(in srgb, var(--state-color-error-default) calc(100% * 1), transparent);
6060
6109
  }
6061
6110
 
6111
+ .fill-info {
6112
+ fill: color-mix(in srgb, var(--state-color-info-default) calc(100% * 1), transparent);
6113
+ }
6114
+
6062
6115
  .fill-inherit {
6063
6116
  fill: inherit;
6064
6117
  }
@@ -6083,6 +6136,14 @@ input[type=number] {
6083
6136
  fill: color-mix(in srgb, var(--state-color-primary-default) calc(100% * 1), transparent);
6084
6137
  }
6085
6138
 
6139
+ .fill-secondary {
6140
+ fill: color-mix(in srgb, var(--state-color-secondary-default) calc(100% * 1), transparent);
6141
+ }
6142
+
6143
+ .fill-warning {
6144
+ fill: color-mix(in srgb, var(--state-color-warning-default) calc(100% * 1), transparent);
6145
+ }
6146
+
6086
6147
  .stroke-input-default-stroke {
6087
6148
  stroke: color-mix(in srgb, var(--input-color-default-stroke) calc(100% * 1), transparent);
6088
6149
  }
@@ -8921,8 +8982,8 @@ input[type=number] {
8921
8982
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
8922
8983
  }
8923
8984
 
8924
- .group:disabled .group-disabled\:bg-\[--switch-thumb-disabled-color\] {
8925
- background-color: var(--switch-thumb-disabled-color);
8985
+ .group:disabled .group-disabled\:\!bg-\[--switch-thumb-disabled-color\] {
8986
+ background-color: var(--switch-thumb-disabled-color) !important;
8926
8987
  }
8927
8988
 
8928
8989
  .peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:top-2 {
@@ -9255,8 +9316,8 @@ input[type=number] {
9255
9316
  background-color: var(--dropdown-menu-disabled-bg) !important;
9256
9317
  }
9257
9318
 
9258
- .data-\[disabled\]\:bg-\[var\(--switch-disabled-color\)\][data-disabled] {
9259
- background-color: var(--switch-disabled-color);
9319
+ .data-\[disabled\]\:\!bg-\[var\(--switch-disabled-color\)\][data-disabled] {
9320
+ background-color: var(--switch-disabled-color) !important;
9260
9321
  }
9261
9322
 
9262
9323
  .data-\[loading\=true\]\:bg-button-error-flat-active[data-loading=true] {
@@ -12,16 +12,16 @@
12
12
  --input-color-error: #ed2f15;
13
13
 
14
14
  /* Function button */
15
- --function-default-solid: #1e3249;
16
- --function-default-hover: #35475b;
17
- --function-default-hover-bg: rgba(30 50 73 / 0.08);
18
- --function-default-stroke: rgba(30 50 73 / 0.48);
15
+ --function-default-solid: var(--state-color-primary-default);
16
+ --function-default-hover: var(--state-color-primary-hover);
17
+ --function-default-hover-bg: var(--state-color-primary-hover-bg);
18
+ --function-default-stroke: var(--state-color-primary-stroke);
19
19
  --function-default-icon: #ffffff;
20
- --function-default-outline-icon: #1e3249;
21
- --function-active-solid: #9b8f00;
22
- --function-active-hover: #b1a400;
23
- --function-active-hover-bg: rgba(221 205 0 / 0.08);
24
- --function-active-stroke: rgba(177 164 0 / 0.48);
20
+ --function-default-outline-icon: var(--state-color-primary-default);
21
+ --function-active-solid: var(--state-color-secondary-default);
22
+ --function-active-hover: var(--state-color-secondary-hover);
23
+ --function-active-hover-bg: var(--state-color-secondary-hover-bg);
24
+ --function-active-stroke: var(--state-color-secondary-stroke);
25
25
  --function-active-icon: #ffffff;
26
26
 
27
27
  --text-black: #000000;
@@ -49,7 +49,7 @@
49
49
  --foreground: var(--common-black);
50
50
 
51
51
  --primary: var(--primary-ramps-primary-100);
52
- --secondary: var(--secondary-ramps-secondary-100);
52
+ --primary: var(--secondary-ramps-secondary-100);
53
53
  --tertiary: var(--tertiary-ramps-tertiary-100);
54
54
  --info: var(--info-info-100);
55
55
  --success: var(--success-success-100);
@@ -6,3 +6,4 @@
6
6
  @import url(components/action-button.css);
7
7
  @import url(components/loading.css);
8
8
  @import url(components/dropdown-menu.css);
9
+ @import url(components/switch.css);
@@ -0,0 +1,30 @@
1
+ :root[data-theme="xspector"] {
2
+ /* ------------------------------------------------------------------ */
3
+ /* Switch Component Tokens */
4
+ /* ------------------------------------------------------------------ */
5
+ /* Naming Convention: --[component]-[element]-[state]-[property] */
6
+ /* Element: [progress, track] */
7
+ /* ------------------------------------------------------------------ */
8
+
9
+ /* Default State */
10
+ --switch-default-color: rgb(from var(--state-color-secondary-active) r g b / 0.32);
11
+ --switch-thumb-default-color: var(--state-color-secondary-active);
12
+
13
+ /* Hover State */
14
+ --switch-hover-color: rgb(from var(--state-color-secondary-active) r g b / 0.48);
15
+ --switch-thumb-hover-color: var(--switch-thumb-default-color);
16
+ --switch-thumb-hover-ring: var(--state-color-secondary-hover-bg);
17
+
18
+ /* Active State */
19
+ --switch-active-color: rgb(from var(--state-color-primary-active) r g b / 0.32);
20
+ --switch-thumb-active-color: var(--state-color-primary-active);
21
+
22
+ /* Active Hover State */
23
+ --switch-active-hover-color: rgb(from var(--state-color-primary-active) r g b / 0.48);
24
+ --switch-thumb-active-hover-color: var(--switch-thumb-active-color);
25
+ --switch-thumb-active-hover-ring: var(--state-color-primary-hover-bg);
26
+
27
+ /* Disabled State */
28
+ --switch-disabled-color: rgb(from var(--state-color-disable-solid) r g b / 0.32);
29
+ --switch-thumb-disabled-color: var(--state-color-disable-solid)
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rovula/ui",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "main": "dist/cjs/bundle.js",
5
5
  "module": "dist/esm/bundle.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@ const meta = {
13
13
  },
14
14
  decorators: [
15
15
  (Story) => (
16
- <div className="p-5 flex w-full">
16
+ <div className="p-5 flex w-full bg-base-bg2">
17
17
  <Story />
18
18
  </div>
19
19
  ),
@@ -24,13 +24,8 @@ export default meta;
24
24
 
25
25
  export const Default = {
26
26
  args: {
27
- defaultValue: [50],
28
- max: 100,
29
- step: 1,
30
- name: "test",
31
- minStepsBetweenThumbs: 1,
27
+ checked: false,
32
28
  disabled: false,
33
- inverted: false,
34
29
  },
35
30
  render: (args) => {
36
31
  console.log("args ", args);
@@ -13,7 +13,7 @@ const switchStateClasses = {
13
13
  checked:
14
14
  "data-[state=checked]:bg-[var(--switch-active-color)] hover:data-[state=checked]:bg-[var(--switch-active-hover-color)]",
15
15
  disabled:
16
- "data-[disabled]:cursor-not-allowed data-[disabled]:bg-[var(--switch-disabled-color)] data-[disabled]:pointer-events-none",
16
+ "data-[disabled]:cursor-not-allowed data-[disabled]:!bg-[var(--switch-disabled-color)] data-[disabled]:pointer-events-none",
17
17
  };
18
18
 
19
19
  const thumbBaseClasses =
@@ -27,7 +27,7 @@ const thumbStateClasses = {
27
27
  "group-hover:ring group-hover:data-[state=checked]:ring-[var(--switch-thumb-active-hover-ring)] group-hover:data-[state=unchecked]:ring-[var(--switch-thumb-hover-ring)]",
28
28
  hoverColor:
29
29
  "group-hover:data-[state=checked]:bg-[var(--switch-thumb-active-hover-color)] group-hover:data-[state=unchecked]:bg-[var(--switch-thumb-hover-color)]",
30
- disabled: "group-disabled:bg-[--switch-thumb-disabled-color]",
30
+ disabled: "group-disabled:!bg-[--switch-thumb-disabled-color]",
31
31
  };
32
32
 
33
33
  const Switch = React.forwardRef<