@rovula/ui 0.0.29 → 0.0.31

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 (77) hide show
  1. package/dist/cjs/bundle.css +139 -69
  2. package/dist/cjs/bundle.js +3 -3
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +12 -0
  5. package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +18 -0
  6. package/dist/cjs/types/components/InputFilter/InputFilter.d.ts +64 -0
  7. package/dist/cjs/types/components/InputFilter/InputFilter.stories.d.ts +370 -0
  8. package/dist/cjs/types/components/InputFilter/InputFilter.styles.d.ts +8 -0
  9. package/dist/cjs/types/components/Search/Search.d.ts +2 -20
  10. package/dist/cjs/types/components/Search/Search.stories.d.ts +26 -38
  11. package/dist/cjs/types/components/TextInput/TextInput.d.ts +10 -0
  12. package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +10 -0
  13. package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +1 -0
  14. package/dist/cjs/types/index.d.ts +1 -0
  15. package/dist/components/ActionButton/ActionButton.stories.js +1 -1
  16. package/dist/components/Checkbox/Checkbox.js +3 -3
  17. package/dist/components/Checkbox/Checkbox.stories.js +1 -1
  18. package/dist/components/DatePicker/DatePicker.js +2 -1
  19. package/dist/components/Dropdown/Dropdown.js +34 -19
  20. package/dist/components/Dropdown/Dropdown.stories.js +1 -0
  21. package/dist/components/Dropdown/Dropdown.styles.js +1 -1
  22. package/dist/components/InputFilter/InputFilter.js +124 -0
  23. package/dist/components/InputFilter/InputFilter.stories.js +34 -0
  24. package/dist/components/InputFilter/InputFilter.styles.js +65 -0
  25. package/dist/components/RadioGroup/RadioGroup.js +5 -2
  26. package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
  27. package/dist/components/Search/Search.js +1 -1
  28. package/dist/components/Search/Search.stories.js +2 -1
  29. package/dist/components/TextInput/TextInput.js +23 -6
  30. package/dist/components/TextInput/TextInput.styles.js +94 -20
  31. package/dist/esm/bundle.css +139 -69
  32. package/dist/esm/bundle.js +3 -3
  33. package/dist/esm/bundle.js.map +1 -1
  34. package/dist/esm/types/components/Dropdown/Dropdown.d.ts +12 -0
  35. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +18 -0
  36. package/dist/esm/types/components/InputFilter/InputFilter.d.ts +64 -0
  37. package/dist/esm/types/components/InputFilter/InputFilter.stories.d.ts +370 -0
  38. package/dist/esm/types/components/InputFilter/InputFilter.styles.d.ts +8 -0
  39. package/dist/esm/types/components/Search/Search.d.ts +2 -20
  40. package/dist/esm/types/components/Search/Search.stories.d.ts +26 -38
  41. package/dist/esm/types/components/TextInput/TextInput.d.ts +10 -0
  42. package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +10 -0
  43. package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +1 -0
  44. package/dist/esm/types/index.d.ts +1 -0
  45. package/dist/index.d.ts +82 -16
  46. package/dist/index.js +1 -0
  47. package/dist/src/theme/global.css +278 -161
  48. package/dist/theme/presets/colors.js +21 -0
  49. package/dist/theme/themes/xspector/color.css +13 -0
  50. package/dist/theme/themes/xspector/components/action-button.css +44 -42
  51. package/dist/theme/themes/xspector/state.css +1 -1
  52. package/dist/theme/tokens/color.css +13 -0
  53. package/dist/theme/tokens/components/action-button.css +42 -42
  54. package/package.json +1 -1
  55. package/src/components/ActionButton/ActionButton.stories.tsx +1 -1
  56. package/src/components/Checkbox/Checkbox.stories.tsx +1 -1
  57. package/src/components/Checkbox/Checkbox.tsx +4 -4
  58. package/src/components/DatePicker/DatePicker.tsx +4 -2
  59. package/src/components/Dropdown/Dropdown.stories.tsx +1 -0
  60. package/src/components/Dropdown/Dropdown.styles.ts +1 -1
  61. package/src/components/Dropdown/Dropdown.tsx +69 -38
  62. package/src/components/InputFilter/InputFilter.stories.tsx +72 -0
  63. package/src/components/InputFilter/InputFilter.styles.ts +74 -0
  64. package/src/components/InputFilter/InputFilter.tsx +314 -0
  65. package/src/components/RadioGroup/RadioGroup.stories.tsx +1 -1
  66. package/src/components/RadioGroup/RadioGroup.tsx +7 -9
  67. package/src/components/Search/Search.stories.tsx +3 -2
  68. package/src/components/Search/Search.tsx +13 -2
  69. package/src/components/TextInput/TextInput.styles.ts +94 -20
  70. package/src/components/TextInput/TextInput.tsx +53 -11
  71. package/src/index.ts +1 -0
  72. package/src/theme/presets/colors.js +21 -0
  73. package/src/theme/themes/xspector/color.css +13 -0
  74. package/src/theme/themes/xspector/components/action-button.css +44 -42
  75. package/src/theme/themes/xspector/state.css +1 -1
  76. package/src/theme/tokens/color.css +13 -0
  77. package/src/theme/tokens/components/action-button.css +42 -42
@@ -71,6 +71,27 @@ module.exports = {
71
71
  "input-label-bg": withColorMixin("--input-color-label-bg"),
72
72
  "input-error": withColorMixin("--input-color-error"),
73
73
 
74
+ "function-default-solid": withColorMixin("--function-default-solid"),
75
+ "function-default-hover": withColorMixin("--function-default-hover"),
76
+ "function-default-hover-bg": withColorMixin(
77
+ "--function-default-hover-bg"
78
+ ),
79
+ "function-default-hover-bg": withColorMixin(
80
+ "--function-default-hover-bg"
81
+ ),
82
+ "function-default-stroke": withColorMixin("--function-default-stroke"),
83
+ "function-default-icon": withColorMixin("--function-default-icon"),
84
+ "function-default-outline": withColorMixin(
85
+ "--function-default-outline-icon"
86
+ ),
87
+ "function-active-solid": withColorMixin("--function-active-solid"),
88
+ "function-active-hover": withColorMixin("--function-active-hover"),
89
+ "function-active-hover-bg": withColorMixin(
90
+ "--function-active-hover-bg"
91
+ ),
92
+ "function-active-stroke": withColorMixin("--function-active-stroke"),
93
+ "function-active-icon": withColorMixin("--function-active-icon"),
94
+
74
95
  "base-bg": withColorMixin("--base-color-bg"),
75
96
  "base-bg2": withColorMixin("--base-color-bg2"),
76
97
  "base-bg3": withColorMixin("--base-color-bg3"),
@@ -11,6 +11,19 @@
11
11
  --input-color-label-bg: #2d2e30;
12
12
  --input-color-error: #ff4d35;
13
13
 
14
+ /* Function button */
15
+ --function-default-solid: #ececec;
16
+ --function-default-hover: #fafafa;
17
+ --function-default-hover-bg: rgba(250 250 250 / 0.08);
18
+ --function-default-stroke: rgba(158 158 158 / 0.24);
19
+ --function-default-icon: #212b36;
20
+ --function-default-outline-icon: #9e9e9e;
21
+ --function-active-solid: #b1a400;
22
+ --function-active-hover: #ddcd00;
23
+ --function-active-hover-bg: rgba(221 205 0 / 0.08);
24
+ --function-active-stroke: rgba(177 164 0 / 0.48);
25
+ --function-active-icon: #212b36;
26
+
14
27
  --text-dark: #212b36;
15
28
  --text-medium: #637381;
16
29
  --text-light: #919eab;
@@ -12,34 +12,34 @@
12
12
  /* ------------------------------------------------------------------ */
13
13
 
14
14
  /* Default State */
15
- --action-button-solid-default-bg: var(--state-color-secondary-default);
16
- --action-button-solid-default-border: var(--state-color-secondary-default);
17
- --action-button-solid-default-text: var(--state-color-secondary-text-solid);
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
18
 
19
19
  /* Hover State */
20
- --action-button-solid-hover-bg: var(--state-color-secondary-hover);
21
- --action-button-solid-hover-border: var(--state-color-secondary-hover);
22
- --action-button-solid-hover-text: var(--state-color-secondary-text-solid);
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
23
 
24
24
  /* Pressed State */
25
- --action-button-solid-pressed-bg: var(--state-color-secondary-pressed);
26
- --action-button-solid-pressed-border: var(--state-color-secondary-pressed);
27
- --action-button-solid-pressed-text: var(--state-color-secondary-text-solid);
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
28
 
29
29
  /* Active State */
30
- --action-button-solid-active-bg: var(--state-color-primary-default);
31
- --action-button-solid-active-border: var(--state-color-primary-default);
32
- --action-button-solid-active-text: var(--state-color-primary-text-solid);
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
33
 
34
34
  /* Active Hover State */
35
- --action-button-solid-active-hover-bg: var(--state-color-primary-hover);
36
- --action-button-solid-active-hover-border: var(--state-color-primary-hover);
37
- --action-button-solid-active-hover-text: var(--state-color-primary-text-solid);
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
38
 
39
39
  /* Active Pressed State */
40
- --action-button-solid-active-pressed-bg: var(--state-color-primary-pressed);
41
- --action-button-solid-active-pressed-border: var(--state-color-primary-pressed);
42
- --action-button-solid-active-pressed-text: var(--state-color-primary-text-solid);
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
43
 
44
44
 
45
45
  /* ------------------------------------------------------------------ */
@@ -47,52 +47,54 @@
47
47
  /* ------------------------------------------------------------------ */
48
48
 
49
49
  /* Default State */
50
- --action-button-outline-default-border: var(--state-color-secondary-stroke);
51
- --action-button-outline-default-text: var(--state-color-secondary-text-outline);
50
+ --action-button-outline-default-border: var(--function-default-stroke);
51
+ --action-button-outline-default-text: var(--function-default-outline-icon);
52
52
 
53
53
  /* Hover State */
54
- --action-button-outline-hover-bg: var(--state-color-secondary-hover-bg);
55
- --action-button-outline-hover-border: var(--state-color-secondary-hover);
56
- --action-button-outline-hover-text: var(--state-color-secondary-text-hover);
54
+ --action-button-outline-hover-bg: var(--function-default-hover-bg);
55
+ --action-button-outline-hover-border: var(--function-default-hover);
56
+ --action-button-outline-hover-text: var(--function-default-hover);
57
57
 
58
58
  /* Pressed State */
59
- --action-button-outline-pressed-bg: var(--state-color-secondary-hover-bg);
60
- --action-button-outline-pressed-border: var(--state-color-secondary-pressed);
61
- --action-button-outline-pressed-text: var(--state-color-secondary-text-pressed);
59
+ --action-button-outline-pressed-bg: var(--function-default-hover-bg);
60
+ --action-button-outline-pressed-border: var(--function-default-stroke);
61
+ --action-button-outline-pressed-text: var(--function-default-outline-icon);
62
62
 
63
63
  /* Active State */
64
- --action-button-outline-active-border: var(--state-color-primary-stroke);
65
- --action-button-outline-active-text: var(--state-color-primary-text-outline);
64
+ --action-button-outline-active-border: var(--function-active-stroke);
65
+ --action-button-outline-active-text: var(--function-active-solid);
66
66
 
67
67
  /* Active Hover State */
68
- --action-button-outline-active-hover-bg: var(--state-color-primary-hover-bg);
69
- --action-button-outline-active-hover-border: var(--state-color-primary-hover);
70
- --action-button-outline-active-hover-text: var(--state-color-primary-text-hover);
68
+ --action-button-outline-active-hover-bg: var(--function-active-hover-bg);;
69
+ --action-button-outline-active-hover-border: var(--function-active-hover);
70
+ --action-button-outline-active-hover-text: var(--function-active-hover);
71
71
 
72
72
  /* Active Pressed State */
73
- --action-button-outline-active-pressed-bg: var(--state-color-primary-hover-bg);
74
- --action-button-outline-active-pressed-border: var(--state-color-primary-pressed);
75
- --action-button-outline-active-pressed-text: var(--state-color-primary-text-pressed);
73
+ --action-button-outline-active-pressed-bg: var(--function-active-hover-bg);;
74
+ --action-button-outline-active-pressed-border: var(--function-active-stroke);
75
+ --action-button-outline-active-pressed-text: var(--function-active-solid);
76
76
 
77
77
  /* ------------------------------------------------------------------ */
78
78
  /* Icon Mode Tokens */
79
79
  /* ------------------------------------------------------------------ */
80
80
 
81
81
  /* Default State */
82
- --action-button-icon-default-text: var(--state-color-secondary-text-outline);
82
+ --action-button-icon-default-text: var(--function-default-outline-icon);
83
83
 
84
84
  /* Hover State */
85
- --action-button-icon-hover-bg: var(--state-color-secondary-hover-bg);
86
- --action-button-icon-hover-text: var(--state-color-secondary-text-hover);
85
+ --action-button-icon-hover-bg: var(--function-default-hover-bg);
86
+ --action-button-icon-hover-text: var(--function-default-hover);
87
87
 
88
88
  /* Pressed State */
89
- --action-button-icon-pressed-text: var(--state-color-secondary-text-pressed);
89
+ --action-button-icon-pressed-text: var(--function-default-outline-icon);
90
90
 
91
91
  /* Active State */
92
- --action-button-icon-active-text: var(--state-color-primary-text-outline);
92
+ --action-button-icon-active-text: var(--function-active-solid);
93
93
 
94
94
  /* Active Hover State */
95
- --action-button-icon-active-hover-bg: var(--state-color-primary-hover-bg);
96
- --action-button-icon-active-hover-text: var(--state-color-primary-text-hover);
97
- --action-button-icon-active-pressed-text: var(--state-color-primary-text-pressed);
95
+ --action-button-icon-active-hover-bg: var(--function-active-hover-bg);
96
+ --action-button-icon-active-hover-text: var(--function-active-hover);
97
+
98
+ /* Active Pressed State */
99
+ --action-button-icon-active-pressed-text: var(--function-active-solid);
98
100
  }
@@ -84,6 +84,6 @@
84
84
  --state-color-error-text-pressed: #a5210f;
85
85
 
86
86
  --state-color-disable-solid: #454f5b;
87
- --state-color-disable-outline: #D3DADF;
87
+ --state-color-disable-outline: #637381;
88
88
  }
89
89
 
@@ -11,6 +11,19 @@
11
11
  --input-color-label-bg: #ffffff;/* #2d2e30; */
12
12
  --input-color-error: #ed2f15;
13
13
 
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);
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);
25
+ --function-active-icon: #ffffff;
26
+
14
27
  --text-dark: #18283a;
15
28
  --text-medium: #4b5b6d;
16
29
  --text-light: #8e98a4;
@@ -12,34 +12,34 @@
12
12
  /* ------------------------------------------------------------------ */
13
13
 
14
14
  /* Default State */
15
- --action-button-solid-default-bg: var(--state-color-primary-default);
16
- --action-button-solid-default-border: var(--state-color-primary-default);
17
- --action-button-solid-default-text: var(--state-color-primary-text-solid);
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
18
 
19
19
  /* Hover State */
20
- --action-button-solid-hover-bg: var(--state-color-primary-hover);
21
- --action-button-solid-hover-border: var(--state-color-primary-hover);
22
- --action-button-solid-hover-text: var(--state-color-primary-text-solid);
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
23
 
24
24
  /* Pressed State */
25
- --action-button-solid-pressed-bg: var(--state-color-primary-pressed);
26
- --action-button-solid-pressed-border: var(--state-color-primary-pressed);
27
- --action-button-solid-pressed-text: var(--state-color-primary-text-solid);
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
28
 
29
29
  /* Active State */
30
- --action-button-solid-active-bg: var(--state-color-secondary-default);
31
- --action-button-solid-active-border: var(--state-color-secondary-default);
32
- --action-button-solid-active-text: var(--state-color-secondary-text-solid);
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
33
 
34
34
  /* Active Hover State */
35
- --action-button-solid-active-hover-bg: var(--state-color-secondary-hover);
36
- --action-button-solid-active-hover-border: var(--state-color-secondary-hover);
37
- --action-button-solid-active-hover-text: var(--state-color-secondary-text-solid);
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
38
 
39
39
  /* Active Pressed State */
40
- --action-button-solid-active-pressed-bg: var(--state-color-secondary-pressed);
41
- --action-button-solid-active-pressed-border: var(--state-color-secondary-pressed);
42
- --action-button-solid-active-pressed-text: var(--state-color-secondary-text-solid);
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
43
 
44
44
  /* Disabled State */
45
45
  --action-button-solid-disabled-bg: var(--state-color-disable-solid);
@@ -53,33 +53,33 @@
53
53
 
54
54
  /* Default State */
55
55
  --action-button-outline-default-bg: transparent;
56
- --action-button-outline-default-border: var(--state-color-primary-stroke);
57
- --action-button-outline-default-text: var(--state-color-primary-text-outline);
56
+ --action-button-outline-default-border: var(--function-default-stroke);
57
+ --action-button-outline-default-text: var(--function-default-outline-icon);
58
58
 
59
59
  /* Hover State */
60
- --action-button-outline-hover-bg: var(--state-color-primary-hover-bg);
61
- --action-button-outline-hover-border: var(--state-color-primary-hover);
62
- --action-button-outline-hover-text: var(--state-color-primary-text-hover);
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
63
 
64
64
  /* Pressed State */
65
- --action-button-outline-pressed-bg: var(--state-color-primary-hover-bg);
66
- --action-button-outline-pressed-border: var(--state-color-primary-pressed);
67
- --action-button-outline-pressed-text: var(--state-color-primary-text-pressed);
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
68
 
69
69
  /* Active State */
70
70
  --action-button-outline-active-bg: transparent;
71
- --action-button-outline-active-border: var(--state-color-secondary-stroke);
72
- --action-button-outline-active-text: var(--state-color-secondary-text-outline);
71
+ --action-button-outline-active-border: var(--function-active-stroke);
72
+ --action-button-outline-active-text: var(--function-active-solid);
73
73
 
74
74
  /* Active Hover State */
75
- --action-button-outline-active-hover-bg: var(--state-color-secondary-hover-bg);
76
- --action-button-outline-active-hover-border: var(--state-color-secondary-hover);
77
- --action-button-outline-active-hover-text: var(--state-color-secondary-text-hover);
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
78
 
79
79
  /* Active Pressed State */
80
- --action-button-outline-active-pressed-bg: var(--state-color-secondary-hover-bg);
81
- --action-button-outline-active-pressed-border: var(--state-color-secondary-pressed);
82
- --action-button-outline-active-pressed-text: var(--state-color-secondary-text-pressed);
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
83
 
84
84
  /* Disabled State */
85
85
  --action-button-outline-disabled-bg: transparent;
@@ -93,32 +93,32 @@
93
93
  /* Default State */
94
94
  --action-button-icon-default-bg: transparent;
95
95
  --action-button-icon-default-border: transparent;
96
- --action-button-icon-default-text: var(--state-color-primary-text-outline);
96
+ --action-button-icon-default-text: var(--function-default-outline-icon);
97
97
 
98
98
  /* Hover State */
99
- --action-button-icon-hover-bg: var(--state-color-primary-hover-bg);
99
+ --action-button-icon-hover-bg: var(--function-default-hover-bg);
100
100
  --action-button-icon-hover-border: transparent;
101
- --action-button-icon-hover-text: var(--state-color-primary-text-hover);
101
+ --action-button-icon-hover-text: var(--function-default-hover);
102
102
 
103
103
  /* Pressed State */
104
104
  --action-button-icon-pressed-bg: transparent;
105
105
  --action-button-icon-pressed-border: transparent;
106
- --action-button-icon-pressed-text: var(--state-color-primary-text-pressed);
106
+ --action-button-icon-pressed-text: var(--function-default-outline-icon);
107
107
 
108
108
  /* Active State */
109
109
  --action-button-icon-active-bg: transparent;
110
110
  --action-button-icon-active-border: transparent;
111
- --action-button-icon-active-text: var(--state-color-secondary-text-outline);
111
+ --action-button-icon-active-text: var(--function-active-solid);
112
112
 
113
113
  /* Active Hover State */
114
- --action-button-icon-active-hover-bg: var(--state-color-secondary-hover-bg);
114
+ --action-button-icon-active-hover-bg: var(--function-active-hover-bg);
115
115
  --action-button-icon-active-hover-border: transparent;
116
- --action-button-icon-active-hover-text: var(--state-color-secondary-text-hover);
116
+ --action-button-icon-active-hover-text: var(--function-active-hover);
117
117
 
118
118
  /* Active Pressed State */
119
119
  --action-button-icon-active-pressed-bg: transparent;
120
120
  --action-button-icon-active-pressed-border: transparent;
121
- --action-button-icon-active-pressed-text: var(--state-color-secondary-text-pressed);
121
+ --action-button-icon-active-pressed-text: var(--function-active-solid);
122
122
 
123
123
  /* Disabled State */
124
124
  --action-button-icon-disabled-bg: transparent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rovula/ui",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "main": "dist/cjs/bundle.js",
5
5
  "module": "dist/esm/bundle.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@ const meta = {
14
14
  },
15
15
  decorators: [
16
16
  (Story) => (
17
- <div className="p-5">
17
+ <div className="p-5 bg-base-bg2">
18
18
  <Story />
19
19
  </div>
20
20
  ),
@@ -11,7 +11,7 @@ const meta = {
11
11
  },
12
12
  decorators: [
13
13
  (Story) => (
14
- <div className="p-5 flex w-full">
14
+ <div className="p-5 flex w-full bg-base-bg2">
15
15
  <Story />
16
16
  </div>
17
17
  ),
@@ -14,14 +14,14 @@ const Checkbox = React.forwardRef<
14
14
  <CheckboxPrimitive.Root
15
15
  ref={ref}
16
16
  className={cn(
17
- "peer size-4 shrink-0 rounded-[var(--spacing-spacing-xxs,2px)] border border-primary ring-offset-background",
18
- "hover:border-primary-hover",
17
+ "peer size-4 shrink-0 rounded-[var(--spacing-spacing-xxs,2px)] border border-function-default-solid ring-offset-background",
18
+ "hover:border-function-default-hover",
19
19
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
20
20
  "disabled:cursor-not-allowed disabled:border-state-disable-solid disabled:text-state-disable-outline",
21
21
  {
22
- "data-[state=checked]:border-secondary data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground":
22
+ "data-[state=checked]:border-function-active-solid data-[state=checked]:bg-function-active-solid data-[state=checked]:text-function-active-icon":
23
23
  !props.disabled,
24
- "hover:data-[state=checked]:border-secondary-hover hover:data-[state=checked]:bg-secondary-hover":
24
+ "hover:data-[state=checked]:border-function-active-hover hover:data-[state=checked]:bg-function-active-hover":
25
25
  !props.disabled,
26
26
  "bg-state-disable-solid": props.checked && props.disabled,
27
27
  },
@@ -35,13 +35,15 @@ const DatePicker: FC<DatePickerProps> = ({
35
35
  <div className="flex">
36
36
  <TextInput
37
37
  fullwidth
38
- id="2"
38
+ id="2" // TODO
39
39
  readOnly
40
40
  label="Date"
41
41
  size="md"
42
42
  value={date ? format(date, "dd MMM yyyy") : isOpen ? " " : ""}
43
43
  hasClearIcon={false}
44
- endIcon={<CalendarIcon fill="inherit" />}
44
+ endIcon={
45
+ <CalendarIcon fill="inherit" className="cursor-pointer" />
46
+ }
45
47
  {...textInputProps}
46
48
  />
47
49
  </div>
@@ -33,6 +33,7 @@ export const Default = {
33
33
  args: {
34
34
  label: "Choose an option:",
35
35
  fullwidth: true,
36
+ isFloatingLabel: true,
36
37
  options,
37
38
  },
38
39
  render: (args) => {
@@ -45,7 +45,7 @@ export const customInputVariant = cva([], {
45
45
  size: {
46
46
  sm: "pe-[30px]",
47
47
  md: "pe-[40px]",
48
- lg: "pe-[48px]",
48
+ lg: "pe-[68px]",
49
49
  },
50
50
  },
51
51
  defaultVariants: {
@@ -17,6 +17,7 @@ import {
17
17
  } from "./Dropdown.styles";
18
18
 
19
19
  import { ChevronDownIcon } from "@heroicons/react/16/solid";
20
+ import { cn } from "@/utils/cn";
20
21
 
21
22
  type RenderLabelCallbackArg = {
22
23
  value: string;
@@ -45,10 +46,16 @@ export type DropdownProps = {
45
46
  error?: boolean;
46
47
  required?: boolean;
47
48
  className?: string;
49
+ optionContainerClassName?: string;
48
50
  options: Options[];
49
51
  value?: Options;
50
52
  onChangeText?: InputProps["onChange"];
51
53
  onSelect?: (value: Options) => void;
54
+ renderOptions?: (value: {
55
+ optionsFiltered: Options[];
56
+ selectedOption: Options | null | undefined;
57
+ onClick: (option: Options) => void;
58
+ }) => ReactNode;
52
59
  } & Omit<InputProps, "value">;
53
60
 
54
61
  const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
@@ -70,6 +77,8 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
70
77
  required = true,
71
78
  onChangeText,
72
79
  onSelect,
80
+ renderOptions: customRenderOptions,
81
+ optionContainerClassName,
73
82
  ...props
74
83
  },
75
84
  ref
@@ -84,15 +93,18 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
84
93
  const keyCode = useRef("");
85
94
 
86
95
  useEffect(() => {
87
- if (value && !selectedOption) {
88
- setSelectedOption(value);
89
- }
90
- }, [value, selectedOption]);
96
+ setSelectedOption(value);
97
+ setTextValue(value?.label ?? "");
98
+ }, [value]);
91
99
 
92
100
  const handleOnChangeText = useCallback(
93
101
  (event: React.ChangeEvent<HTMLInputElement>) => {
94
102
  onChangeText?.(event);
95
103
  setTextValue(event.target.value);
104
+
105
+ if (!event.target.value) {
106
+ clearMismatchValue(event as any);
107
+ }
96
108
  },
97
109
  [onChangeText]
98
110
  );
@@ -114,42 +126,61 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
114
126
  );
115
127
  }, [options, filterMode, textValue]);
116
128
 
117
- const renderOptions = () => (
118
- <ul className="absolute mt-1 w-full bg-base-popup border border-base-popup text-base-popup-foreground rounded-md shadow-md z-10 max-h-60 overflow-y-auto">
119
- {optionsFiltered.map((option) => {
120
- if (option.renderLabel) {
129
+ const renderOptions = () => {
130
+ if (customRenderOptions) {
131
+ return customRenderOptions({
132
+ optionsFiltered,
133
+ selectedOption,
134
+ onClick: handleOptionClick,
135
+ });
136
+ }
137
+
138
+ return (
139
+ <ul
140
+ className={cn(
141
+ "absolute mt-1 w-full bg-base-popup border border-base-popup text-base-popup-foreground rounded-md shadow-md z-10 max-h-60 overflow-y-auto",
142
+ optionContainerClassName
143
+ )}
144
+ >
145
+ {optionsFiltered.map((option) => {
146
+ if (option.renderLabel) {
147
+ return (
148
+ <Fragment key={option.value}>
149
+ {option.renderLabel({
150
+ value: option.value,
151
+ label: option.label,
152
+ handleOnClick: () => handleOptionClick(option),
153
+ className: `px-4 py-2 hover:bg-gray-100 cursor-pointer ${
154
+ selectedOption?.value === option.value
155
+ ? " bg-gray-200"
156
+ : ""
157
+ }`,
158
+ })}
159
+ </Fragment>
160
+ );
161
+ }
121
162
  return (
122
- <Fragment key={option.value}>
123
- {option.renderLabel({
124
- value: option.value,
125
- label: option.label,
126
- handleOnClick: () => handleOptionClick(option),
127
- className: `px-4 py-2 hover:bg-gray-100 cursor-pointer ${
128
- selectedOption?.value === option.value ? " bg-gray-200" : ""
129
- }`,
130
- })}
131
- </Fragment>
163
+ <li
164
+ key={option.value}
165
+ onMouseDown={() => handleOptionClick(option)}
166
+ className={`px-4 py-2 hover:bg-primary-hover-bg cursor-pointer ${
167
+ selectedOption?.value === option.value
168
+ ? "bg-base-popup-highligh"
169
+ : ""
170
+ }`}
171
+ >
172
+ {option.label}
173
+ </li>
132
174
  );
133
- }
134
- return (
135
- <li
136
- key={option.value}
137
- onMouseDown={() => handleOptionClick(option)}
138
- className={`px-4 py-2 hover:bg-primary-hover-bg cursor-pointer ${
139
- selectedOption?.value === option.value
140
- ? "bg-base-popup-highligh"
141
- : ""
142
- }`}
143
- >
144
- {option.label}
175
+ })}
176
+ {optionsFiltered.length === 0 && (
177
+ <li className="px-4 py-14 text-center text-input-text">
178
+ Not found
145
179
  </li>
146
- );
147
- })}
148
- {optionsFiltered.length === 0 && (
149
- <li className="px-4 py-14 text-center text-input-text">Not found</li>
150
- )}
151
- </ul>
152
- );
180
+ )}
181
+ </ul>
182
+ );
183
+ };
153
184
 
154
185
  const handleOnFocus = useCallback(
155
186
  (e: React.FocusEvent<HTMLInputElement, Element>) => {
@@ -196,7 +227,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
196
227
  clearMismatchValue(e);
197
228
  props?.onBlur?.(e);
198
229
  },
199
- [props?.onBlur]
230
+ [props?.onBlur, clearMismatchValue]
200
231
  );
201
232
 
202
233
  const handleOnKeyDown = useCallback(