@rovula/ui 0.0.51 → 0.0.53

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 (63) hide show
  1. package/dist/cjs/bundle.css +50 -11
  2. package/dist/cjs/bundle.js +2 -2
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/Tabs/Tabs.d.ts +14 -1
  5. package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +81 -2
  6. package/dist/cjs/types/components/Tree/Tree.stories.d.ts +3 -0
  7. package/dist/cjs/types/components/Tree/example-data.d.ts +5 -0
  8. package/dist/cjs/types/components/Tree/type.d.ts +14 -4
  9. package/dist/components/Tabs/Tabs.js +35 -18
  10. package/dist/components/Tabs/Tabs.stories.js +70 -3
  11. package/dist/components/Tree/Tree.js +7 -4
  12. package/dist/components/Tree/Tree.stories.js +34 -2090
  13. package/dist/components/Tree/TreeItem.js +16 -8
  14. package/dist/components/Tree/example-data.js +2125 -0
  15. package/dist/esm/bundle.css +50 -11
  16. package/dist/esm/bundle.js +2 -2
  17. package/dist/esm/bundle.js.map +1 -1
  18. package/dist/esm/types/components/Tabs/Tabs.d.ts +14 -1
  19. package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +81 -2
  20. package/dist/esm/types/components/Tree/Tree.stories.d.ts +3 -0
  21. package/dist/esm/types/components/Tree/example-data.d.ts +5 -0
  22. package/dist/esm/types/components/Tree/type.d.ts +14 -4
  23. package/dist/index.d.ts +27 -5
  24. package/dist/src/theme/global.css +36 -1164
  25. package/dist/theme/global.css +0 -1
  26. package/package.json +6 -1
  27. package/src/components/Tabs/Tabs.css +21 -0
  28. package/src/components/Tabs/Tabs.stories.tsx +140 -4
  29. package/src/components/Tabs/Tabs.tsx +134 -50
  30. package/src/components/Tree/Tree.stories.tsx +58 -2124
  31. package/src/components/Tree/Tree.tsx +17 -3
  32. package/src/components/Tree/TreeItem.tsx +47 -17
  33. package/src/components/Tree/example-data.ts +2162 -0
  34. package/src/components/Tree/type.ts +18 -4
  35. package/src/theme/global.css +0 -1
  36. package/dist/theme/themes/SKL/baseline.css +0 -12
  37. package/dist/theme/themes/SKL/color.css +0 -78
  38. package/dist/theme/themes/SKL/components/action-button.css +0 -127
  39. package/dist/theme/themes/SKL/components/button.css +0 -512
  40. package/dist/theme/themes/SKL/components/dropdown-menu.css +0 -27
  41. package/dist/theme/themes/SKL/components/loading.css +0 -11
  42. package/dist/theme/themes/SKL/components/navbar.css +0 -8
  43. package/dist/theme/themes/SKL/components/progress-bar.css +0 -8
  44. package/dist/theme/themes/SKL/components/switch.css +0 -30
  45. package/dist/theme/themes/SKL/palette.css +0 -145
  46. package/dist/theme/themes/SKL/state.css +0 -86
  47. package/dist/theme/themes/SKL/transparent.css +0 -68
  48. package/dist/theme/themes/SKL/typography.css +0 -199
  49. package/dist/theme/themes/SKL/variables.css +0 -28
  50. package/src/theme/themes/SKL/baseline.css +0 -12
  51. package/src/theme/themes/SKL/color.css +0 -78
  52. package/src/theme/themes/SKL/components/action-button.css +0 -127
  53. package/src/theme/themes/SKL/components/button.css +0 -512
  54. package/src/theme/themes/SKL/components/dropdown-menu.css +0 -27
  55. package/src/theme/themes/SKL/components/loading.css +0 -11
  56. package/src/theme/themes/SKL/components/navbar.css +0 -8
  57. package/src/theme/themes/SKL/components/progress-bar.css +0 -8
  58. package/src/theme/themes/SKL/components/switch.css +0 -30
  59. package/src/theme/themes/SKL/palette.css +0 -145
  60. package/src/theme/themes/SKL/state.css +0 -86
  61. package/src/theme/themes/SKL/transparent.css +0 -68
  62. package/src/theme/themes/SKL/typography.css +0 -199
  63. package/src/theme/themes/SKL/variables.css +0 -28
@@ -1,20 +1,22 @@
1
1
  import { CSSProperties, ReactNode } from "react";
2
2
 
3
- export type TreeData = {
3
+ export type TreeData<T = {}> = {
4
4
  id: string;
5
5
  title: string;
6
6
  icon?: ReactNode;
7
7
  disabled?: boolean;
8
+ isLeaf?: boolean;
8
9
  onClickItem?: (id: string) => void;
9
- children?: TreeData[];
10
+ children?: TreeData<T>[]; // Recursively include additional data
10
11
  renderIcon?: (params: {
11
12
  id: string;
12
13
  expanded: boolean;
13
14
  selected: boolean;
14
15
  }) => ReactNode;
15
- };
16
+ } & T; // Merge additional data
16
17
 
17
18
  export interface TreeItemProps extends TreeData {
19
+ checkable?: boolean;
18
20
  isFirstLevel?: boolean;
19
21
  isLastItem: boolean;
20
22
  disabled?: boolean;
@@ -25,11 +27,14 @@ export interface TreeItemProps extends TreeData {
25
27
  horizontalLineWidth?: number;
26
28
  expandButtonSize?: number;
27
29
  spacing?: number;
30
+ currentLevel: number;
31
+ maxLevel?: number;
28
32
  checkIsExpanded: (id: string) => boolean;
29
33
  checkIsChecked: (id: string) => boolean;
30
34
  checkIsLoading?: (id: string) => void;
31
35
  onExpandChange?: (id: string, expanded: boolean) => void;
32
36
  onCheckedChange?: (id: string, checked: boolean) => void;
37
+ notifyClickItem?: (id: string) => void;
33
38
  renderRightSection?: (params: {
34
39
  id: string;
35
40
  expanded: boolean;
@@ -55,6 +60,7 @@ export interface TreeItemProps extends TreeData {
55
60
  selected: boolean;
56
61
  }) => ReactNode;
57
62
  classes?: Partial<{
63
+ container?: string;
58
64
  elementWrapper?: string;
59
65
  branch?: string;
60
66
  itemWrapper?: string;
@@ -94,8 +100,16 @@ export interface TreeProps
94
100
  checkedId?: string[];
95
101
  loadingId?: string[];
96
102
  onExpandChange?: (id: string, expanded: boolean) => void;
97
- onCheckedChange?: (checkedId: string[]) => void;
103
+ onCheckedChange?: (
104
+ checkedId: string[],
105
+ uncheckedId: string[],
106
+ checkedState: Record<string, boolean>
107
+ ) => void;
108
+ onClickItem?: (id: string) => void;
109
+ onCheckedItem?: (id: string, checked: boolean) => void;
98
110
  defaultExpandAll?: boolean;
99
111
  defaultCheckAll?: boolean;
100
112
  hierarchicalCheck?: boolean;
113
+ checkable?: boolean;
114
+ maxLevel?: number;
101
115
  }
@@ -1,7 +1,6 @@
1
1
 
2
2
  @import "./tokens/baseline.css";
3
3
  @import "./themes/xspector/baseline.css";
4
- @import "./themes/SKL/baseline.css";
5
4
 
6
5
  @tailwind base;
7
6
  @tailwind components;
@@ -1,12 +0,0 @@
1
- @import url(palette.css);
2
- @import url(state.css);
3
- @import url(color.css);
4
- @import url(transparent.css);
5
- @import url(variables.css);
6
- @import url(typography.css);
7
- @import url(components/button.css);
8
- @import url(components/action-button.css);
9
- @import url(components/loading.css);
10
- @import url(components/navbar.css);
11
- @import url(components/dropdown-menu.css);
12
- @import url(components/switch.css);
@@ -1,78 +0,0 @@
1
-
2
- :root[data-theme="SKL"] {
3
- /* Base from design */
4
- --input-color-default-text: #9e9e9e;
5
- --input-color-default-stroke: #cfcfcf;
6
- --input-color-filled-text: #4f4f4f;
7
- --input-color-active-stroke: #9e9e9e;
8
- --input-color-disable-text: #919eab;
9
- --input-color-disable-stroke: #e7ebed;
10
- --input-color-disable-bg: #f2f5f5;
11
- --input-color-label-bg: #ffffff;/* #2d2e30; */
12
- --input-color-error: #ed2f15;
13
-
14
- /* Function button */
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
- --function-default-icon: #ffffff;
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
- --function-active-icon: #ffffff;
26
-
27
- --text-black: #000000;
28
- --text-dark: #18283a;
29
- --text-medium: #4b5b6d;
30
- --text-light: #8e98a4;
31
- --text-grey-dark: #4f4f4f;
32
- --text-grey-medium: #7e7e7e;
33
- --text-grey-light: #9e9e9e;
34
- --text-white: #ffffff;
35
-
36
- --base-color-bg: #f5f5f5;
37
- --base-color-bg2: #f5f5f5;
38
- --base-color-bg3: #d8d8d8;
39
- --base-color-workspace-stroke: #e2e2e2;
40
- --base-color-guideline-stroke: #c5c5c5;
41
- --base-color-popup: #ffffff;
42
- --base-color-popup-hightlight: #343638;
43
- --base-color-popup-curtain: rgba(0 0 0 / 0.6);
44
- --common-white: #ffffff;
45
- --common-black: #000000;
46
-
47
- /* ------- Addon base ---------- */
48
- --background: var(--base-color-bg);
49
- --foreground: var(--common-black);
50
-
51
- --primary: var(--primary-ramps-primary-100);
52
- --primary: var(--secondary-ramps-secondary-100);
53
- --tertiary: var(--tertiary-ramps-tertiary-100);
54
- --info: var(--info-info-100);
55
- --success: var(--success-success-100);
56
- --warning: var(--warning-warning-100);
57
- --error: var(--error-error-100);
58
- --grey: var(--grey-grey-100);
59
- --grey2: var(--grey2-grey2-100);
60
-
61
- --primary-foreground: var(--state-color-primary-text-solid);
62
- --secondary-foreground: var(--state-color-secondary-text-solid);
63
- --tertiary-foreground: var(--state-color-tertiary-text-solid);
64
- --info-foreground: var(--state-color-info-text-solid);
65
- --success-foreground: var(--state-color-success-text-solid);
66
- --warning-foreground: var(--state-color-warning-text-solid);
67
- --error-foreground: var(--state-color-error-text-solid);
68
- --grey-foreground: var(--common-black);
69
- --grey2-foreground: var(--common-black);
70
-
71
- --surface: var(--base-color-bg);
72
- --surface-foreground: var(--common-black);
73
-
74
- --primary-foreground: var(--common-white);
75
- --secondary-foreground: var(--common-white);
76
-
77
- --base-color-popup-foreground: var(--text-dark);
78
- }
@@ -1,127 +0,0 @@
1
- :root[data-theme="SKL"] {
2
- /* --------------------------------------------------------------------------------- */
3
- /* Action Button Component Tokens */
4
- /* --------------------------------------------------------------------------------- */
5
- /* Naming Convention: --[component]-[mode]-[state]-[property] */
6
- /* Mone: [solid, outline, icon] */
7
- /* States: [default, hover, pressed, active, active-pressed active-hover disabled] */
8
- /* --------------------------------------------------------------------------------- */
9
-
10
- /* ------------------------------------------------------------------ */
11
- /* Solid Mode Tokens */
12
- /* ------------------------------------------------------------------ */
13
-
14
- /* Default State */
15
- --action-button-solid-default-bg: var(--function-default-solid);
16
- --action-button-solid-default-border: var(--function-default-solid);
17
- --action-button-solid-default-text: var(--function-default-icon);
18
-
19
- /* Hover State */
20
- --action-button-solid-hover-bg: var(--function-default-hover);
21
- --action-button-solid-hover-border: var(--function-default-hover);
22
- --action-button-solid-hover-text: var(--function-default-icon);
23
-
24
- /* Pressed State */
25
- --action-button-solid-pressed-bg: var(--function-default-solid);
26
- --action-button-solid-pressed-border: var(--function-default-solid);
27
- --action-button-solid-pressed-text: var(--function-default-icon);
28
-
29
- /* Active State */
30
- --action-button-solid-active-bg: var(--function-active-solid);
31
- --action-button-solid-active-border: var(--function-active-solid);
32
- --action-button-solid-active-text: var(--function-active-icon);
33
-
34
- /* Active Hover State */
35
- --action-button-solid-active-hover-bg: var(--function-active-hover);
36
- --action-button-solid-active-hover-border: var(--function-active-hover);
37
- --action-button-solid-active-hover-text: var(--function-active-icon);
38
-
39
- /* Active Pressed State */
40
- --action-button-solid-active-pressed-bg: var(--function-active-solid);
41
- --action-button-solid-active-pressed-border: var(--function-active-solid);
42
- --action-button-solid-active-pressed-text: var(--function-active-icon);
43
-
44
- /* Disabled State */
45
- --action-button-solid-disabled-bg: var(--state-color-disable-solid);
46
- --action-button-solid-disabled-border: var(--state-color-disable-solid);
47
- --action-button-solid-disabled-text: var(--state-color-disable-outline);
48
-
49
-
50
- /* ------------------------------------------------------------------ */
51
- /* Outline Mode Tokens */
52
- /* ------------------------------------------------------------------ */
53
-
54
- /* Default State */
55
- --action-button-outline-default-bg: transparent;
56
- --action-button-outline-default-border: var(--function-default-stroke);
57
- --action-button-outline-default-text: var(--function-default-outline-icon);
58
-
59
- /* Hover State */
60
- --action-button-outline-hover-bg: var(--function-default-hover-bg);
61
- --action-button-outline-hover-border: var(--function-default-hover);
62
- --action-button-outline-hover-text: var(--function-default-hover);
63
-
64
- /* Pressed State */
65
- --action-button-outline-pressed-bg: var(--function-default-hover-bg);
66
- --action-button-outline-pressed-border: var(--function-default-stroke);
67
- --action-button-outline-pressed-text: var(--function-default-outline-icon);
68
-
69
- /* Active State */
70
- --action-button-outline-active-bg: transparent;
71
- --action-button-outline-active-border: var(--function-active-stroke);
72
- --action-button-outline-active-text: var(--function-active-solid);
73
-
74
- /* Active Hover State */
75
- --action-button-outline-active-hover-bg: var(--function-active-hover-bg);;
76
- --action-button-outline-active-hover-border: var(--function-active-hover);
77
- --action-button-outline-active-hover-text: var(--function-active-hover);
78
-
79
- /* Active Pressed State */
80
- --action-button-outline-active-pressed-bg: var(--function-active-hover-bg);;
81
- --action-button-outline-active-pressed-border: var(--function-active-stroke);
82
- --action-button-outline-active-pressed-text: var(--function-active-solid);
83
-
84
- /* Disabled State */
85
- --action-button-outline-disabled-bg: transparent;
86
- --action-button-outline-disabled-border: var(--state-color-disable-outline);
87
- --action-button-outline-disabled-text: var(--state-color-disable-outline);
88
-
89
- /* ------------------------------------------------------------------ */
90
- /* Icon Mode Tokens */
91
- /* ------------------------------------------------------------------ */
92
-
93
- /* Default State */
94
- --action-button-icon-default-bg: transparent;
95
- --action-button-icon-default-border: transparent;
96
- --action-button-icon-default-text: var(--function-default-outline-icon);
97
-
98
- /* Hover State */
99
- --action-button-icon-hover-bg: var(--function-default-hover-bg);
100
- --action-button-icon-hover-border: transparent;
101
- --action-button-icon-hover-text: var(--function-default-hover);
102
-
103
- /* Pressed State */
104
- --action-button-icon-pressed-bg: transparent;
105
- --action-button-icon-pressed-border: transparent;
106
- --action-button-icon-pressed-text: var(--function-default-outline-icon);
107
-
108
- /* Active State */
109
- --action-button-icon-active-bg: transparent;
110
- --action-button-icon-active-border: transparent;
111
- --action-button-icon-active-text: var(--function-active-solid);
112
-
113
- /* Active Hover State */
114
- --action-button-icon-active-hover-bg: var(--function-active-hover-bg);
115
- --action-button-icon-active-hover-border: transparent;
116
- --action-button-icon-active-hover-text: var(--function-active-hover);
117
-
118
- /* Active Pressed State */
119
- --action-button-icon-active-pressed-bg: transparent;
120
- --action-button-icon-active-pressed-border: transparent;
121
- --action-button-icon-active-pressed-text: var(--function-active-solid);
122
-
123
- /* Disabled State */
124
- --action-button-icon-disabled-bg: transparent;
125
- --action-button-icon-disabled-border: transparent;
126
- --action-button-icon-disabled-text: var(--state-color-disable-outline);
127
- }