@rovula/ui 0.1.7 → 0.1.9

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 (196) hide show
  1. package/dist/cjs/bundle.css +273 -126
  2. package/dist/cjs/bundle.js +1545 -1545
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
  5. package/dist/cjs/types/components/Dialog/Dialog.d.ts +7 -1
  6. package/dist/cjs/types/components/Dialog/Dialog.stories.d.ts +3 -0
  7. package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +2 -0
  8. package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
  9. package/dist/cjs/types/components/Form/Field.d.ts +26 -0
  10. package/dist/cjs/types/components/Form/FieldMessage.d.ts +7 -0
  11. package/dist/cjs/types/components/Form/Form.d.ts +49 -11
  12. package/dist/cjs/types/components/Form/Form.stories.d.ts +23 -0
  13. package/dist/cjs/types/components/Form/ValidationHintList.d.ts +20 -0
  14. package/dist/cjs/types/components/Form/ValidationHintList.stories.d.ts +9 -0
  15. package/dist/cjs/types/components/Form/index.d.ts +10 -0
  16. package/dist/cjs/types/components/Form/useOptionBridge.d.ts +17 -0
  17. package/dist/cjs/types/components/OtpInput/OtpInput.d.ts +17 -0
  18. package/dist/cjs/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
  19. package/dist/cjs/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
  20. package/dist/cjs/types/components/OtpInput/index.d.ts +5 -0
  21. package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +3 -0
  22. package/dist/cjs/types/index.d.ts +5 -0
  23. package/dist/cjs/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
  24. package/dist/cjs/types/utils/colors.d.ts +84 -0
  25. package/dist/components/ActionButton/ActionButton.stories.js +2 -2
  26. package/dist/components/ActionButton/ActionButton.styles.js +1 -1
  27. package/dist/components/AlertDialog/AlertDialog.js +6 -6
  28. package/dist/components/AlertDialog/AlertDialog.stories.js +3 -0
  29. package/dist/components/Avatar/Avatar.stories.js +1 -1
  30. package/dist/components/Avatar/Avatar.styles.js +1 -1
  31. package/dist/components/Avatar/AvatarBase.js +1 -1
  32. package/dist/components/Avatar/AvatarGroup.stories.js +1 -1
  33. package/dist/components/Button/Buttons.stories.js +2 -2
  34. package/dist/components/Calendar/Calendar.js +1 -1
  35. package/dist/components/Checkbox/Checkbox.js +1 -1
  36. package/dist/components/Checkbox/Checkbox.stories.js +17 -7
  37. package/dist/components/Collapsible/Collapsible.styles.js +1 -1
  38. package/dist/components/DataTable/DataTable.js +2 -2
  39. package/dist/components/Dialog/Dialog.js +12 -7
  40. package/dist/components/Dialog/Dialog.stories.js +90 -2
  41. package/dist/components/Dropdown/Dropdown.js +2 -2
  42. package/dist/components/DropdownMenu/DropdownMenu.js +3 -3
  43. package/dist/components/FocusedScrollView/FocusedScrollView.stories.js +6 -6
  44. package/dist/components/Form/Field.js +60 -0
  45. package/dist/components/Form/FieldMessage.js +24 -0
  46. package/dist/components/Form/Form.js +73 -41
  47. package/dist/components/Form/Form.stories.js +221 -0
  48. package/dist/components/Form/ValidationHintList.js +30 -0
  49. package/dist/components/Form/ValidationHintList.stories.js +50 -0
  50. package/dist/components/Form/index.js +5 -0
  51. package/dist/components/Form/useOptionBridge.js +27 -0
  52. package/dist/components/InputFilter/InputFilter.js +5 -4
  53. package/dist/components/InputFilter/InputFilter.stories.js +1 -1
  54. package/dist/components/InputFilter/InputFilter.styles.js +14 -1
  55. package/dist/components/Label/Label.styles.js +1 -1
  56. package/dist/components/Menu/Menu.js +2 -2
  57. package/dist/components/NumberInput/NumberInput.stories.js +1 -1
  58. package/dist/components/OtpInput/OtpInput.js +118 -0
  59. package/dist/components/OtpInput/OtpInput.stories.js +60 -0
  60. package/dist/components/OtpInput/OtpInputGroup.js +23 -0
  61. package/dist/components/OtpInput/index.js +3 -0
  62. package/dist/components/PasswordInput/PasswordInput.stories.js +1 -1
  63. package/dist/components/Popover/Popover.js +1 -1
  64. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  65. package/dist/components/RadioGroup/RadioGroup.stories.js +2 -2
  66. package/dist/components/Search/Search.js +13 -1
  67. package/dist/components/Search/Search.stories.js +1 -1
  68. package/dist/components/Slider/Slider.js +1 -1
  69. package/dist/components/Slider/Slider.stories.js +5 -5
  70. package/dist/components/Switch/Switch.stories.js +2 -2
  71. package/dist/components/Table/Table.js +5 -5
  72. package/dist/components/Tabs/Tabs.js +12 -9
  73. package/dist/components/Tabs/Tabs.stories.js +1 -1
  74. package/dist/components/Text/Text.js +1 -1
  75. package/dist/components/Text/Text.stories.js +1 -1
  76. package/dist/components/TextArea/TextArea.stories.js +1 -1
  77. package/dist/components/TextArea/TextArea.styles.js +3 -3
  78. package/dist/components/TextInput/TextInput.js +3 -2
  79. package/dist/components/TextInput/TextInput.stories.js +3 -3
  80. package/dist/components/TextInput/TextInput.styles.js +41 -19
  81. package/dist/components/Toast/Toast.js +4 -2
  82. package/dist/components/Toast/Toast.stories.js +1 -1
  83. package/dist/components/Toast/Toast.styles.js +4 -4
  84. package/dist/components/Toast/Toaster.js +2 -2
  85. package/dist/components/Tree/Tree.stories.js +1 -1
  86. package/dist/components/Tree/TreeItem.js +1 -1
  87. package/dist/esm/bundle.css +273 -126
  88. package/dist/esm/bundle.js +1545 -1545
  89. package/dist/esm/bundle.js.map +1 -1
  90. package/dist/esm/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
  91. package/dist/esm/types/components/Dialog/Dialog.d.ts +7 -1
  92. package/dist/esm/types/components/Dialog/Dialog.stories.d.ts +3 -0
  93. package/dist/esm/types/components/Dropdown/Dropdown.d.ts +2 -0
  94. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
  95. package/dist/esm/types/components/Form/Field.d.ts +26 -0
  96. package/dist/esm/types/components/Form/FieldMessage.d.ts +7 -0
  97. package/dist/esm/types/components/Form/Form.d.ts +49 -11
  98. package/dist/esm/types/components/Form/Form.stories.d.ts +23 -0
  99. package/dist/esm/types/components/Form/ValidationHintList.d.ts +20 -0
  100. package/dist/esm/types/components/Form/ValidationHintList.stories.d.ts +9 -0
  101. package/dist/esm/types/components/Form/index.d.ts +10 -0
  102. package/dist/esm/types/components/Form/useOptionBridge.d.ts +17 -0
  103. package/dist/esm/types/components/OtpInput/OtpInput.d.ts +17 -0
  104. package/dist/esm/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
  105. package/dist/esm/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
  106. package/dist/esm/types/components/OtpInput/index.d.ts +5 -0
  107. package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +3 -0
  108. package/dist/esm/types/index.d.ts +5 -0
  109. package/dist/esm/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
  110. package/dist/esm/types/utils/colors.d.ts +84 -0
  111. package/dist/index.d.ts +248 -2
  112. package/dist/index.js +3 -0
  113. package/dist/src/theme/global.css +340 -151
  114. package/dist/theme/ThemeColorCoverageRuntime.stories.js +91 -0
  115. package/dist/utils/colors.js +92 -0
  116. package/package.json +4 -2
  117. package/src/components/ActionButton/ActionButton.stories.tsx +6 -6
  118. package/src/components/ActionButton/ActionButton.styles.ts +1 -1
  119. package/src/components/AlertDialog/AlertDialog.stories.tsx +22 -0
  120. package/src/components/AlertDialog/AlertDialog.tsx +6 -6
  121. package/src/components/Avatar/Avatar.stories.tsx +1 -1
  122. package/src/components/Avatar/Avatar.styles.ts +1 -1
  123. package/src/components/Avatar/AvatarBase.tsx +1 -1
  124. package/src/components/Avatar/AvatarGroup.stories.tsx +1 -1
  125. package/src/components/Button/Buttons.stories.tsx +10 -10
  126. package/src/components/Calendar/Calendar.tsx +3 -3
  127. package/src/components/Checkbox/Checkbox.stories.tsx +35 -12
  128. package/src/components/Checkbox/Checkbox.tsx +7 -5
  129. package/src/components/Collapsible/Collapsible.styles.ts +1 -1
  130. package/src/components/DataTable/DataTable.tsx +2 -2
  131. package/src/components/Dialog/Dialog.stories.tsx +173 -0
  132. package/src/components/Dialog/Dialog.tsx +32 -15
  133. package/src/components/Dropdown/Dropdown.styles.ts +1 -1
  134. package/src/components/Dropdown/Dropdown.tsx +16 -14
  135. package/src/components/DropdownMenu/DropdownMenu.tsx +3 -3
  136. package/src/components/FocusedScrollView/FocusedScrollView.stories.tsx +10 -10
  137. package/src/components/Form/Field.tsx +160 -0
  138. package/src/components/Form/FieldMessage.tsx +38 -0
  139. package/src/components/Form/Form.docs.mdx +67 -0
  140. package/src/components/Form/Form.stories.tsx +490 -0
  141. package/src/components/Form/Form.tsx +185 -87
  142. package/src/components/Form/README.md +284 -0
  143. package/src/components/Form/ValidationHintList.stories.tsx +118 -0
  144. package/src/components/Form/ValidationHintList.tsx +95 -0
  145. package/src/components/Form/index.ts +28 -0
  146. package/src/components/Form/useOptionBridge.ts +55 -0
  147. package/src/components/InputFilter/InputFilter.stories.tsx +1 -1
  148. package/src/components/InputFilter/InputFilter.styles.ts +14 -1
  149. package/src/components/InputFilter/InputFilter.tsx +33 -28
  150. package/src/components/Label/Label.styles.ts +2 -2
  151. package/src/components/Label/Label.tsx +1 -1
  152. package/src/components/Menu/Menu.tsx +12 -12
  153. package/src/components/NumberInput/NumberInput.stories.tsx +1 -1
  154. package/src/components/OtpInput/OtpInput.stories.tsx +168 -0
  155. package/src/components/OtpInput/OtpInput.tsx +223 -0
  156. package/src/components/OtpInput/OtpInputGroup.tsx +74 -0
  157. package/src/components/OtpInput/index.ts +5 -0
  158. package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
  159. package/src/components/Popover/Popover.tsx +1 -1
  160. package/src/components/RadioGroup/RadioGroup.stories.tsx +4 -4
  161. package/src/components/RadioGroup/RadioGroup.tsx +2 -1
  162. package/src/components/Search/Search.stories.tsx +1 -1
  163. package/src/components/Search/Search.tsx +6 -2
  164. package/src/components/Slider/Slider.stories.tsx +7 -7
  165. package/src/components/Slider/Slider.tsx +1 -1
  166. package/src/components/Switch/Switch.stories.tsx +4 -4
  167. package/src/components/Table/Table.tsx +5 -5
  168. package/src/components/Tabs/Tabs.stories.tsx +1 -1
  169. package/src/components/Tabs/Tabs.tsx +29 -18
  170. package/src/components/Text/Text.stories.tsx +1 -1
  171. package/src/components/Text/Text.tsx +1 -1
  172. package/src/components/TextArea/TextArea.stories.tsx +1 -1
  173. package/src/components/TextArea/TextArea.styles.ts +3 -3
  174. package/src/components/TextInput/TextInput.stories.tsx +7 -7
  175. package/src/components/TextInput/TextInput.styles.ts +42 -19
  176. package/src/components/TextInput/TextInput.tsx +3 -1
  177. package/src/components/Toast/Toast.stories.tsx +1 -1
  178. package/src/components/Toast/Toast.styles.tsx +7 -7
  179. package/src/components/Toast/Toast.tsx +5 -4
  180. package/src/components/Toast/Toaster.tsx +17 -20
  181. package/src/components/Tree/Tree.stories.tsx +1 -1
  182. package/src/components/Tree/TreeItem.tsx +1 -1
  183. package/src/index.ts +5 -0
  184. package/src/theme/ThemeColorCoverageRuntime.stories.tsx +236 -0
  185. package/src/theme/direct-token-migration-plan.md +121 -0
  186. package/src/theme/figma-mcp-check-report.md +225 -0
  187. package/src/theme/figma-mcp-component-checklist.json +1250 -0
  188. package/src/theme/presets/colors.js +155 -44
  189. package/src/theme/themes/xspector/components/loading.css +2 -2
  190. package/src/theme/tokens/color.css +3 -3
  191. package/src/theme/tokens/components/action-button.css +1 -1
  192. package/src/theme/tokens/components/dropdown-menu.css +3 -3
  193. package/src/theme/tokens/components/loading.css +2 -2
  194. package/src/theme/tokens/components/switch.css +1 -1
  195. package/src/theme/utils.js +164 -25
  196. package/src/utils/colors.ts +92 -0
@@ -7,56 +7,111 @@ import {
7
7
  generateActionButtonStyles,
8
8
  } from "../utils";
9
9
 
10
- const secondaryRange = [
11
- "50",
12
- "100",
13
- "200",
14
- "300",
15
- "400",
16
- "500",
17
- "600",
18
- "700",
19
- "800",
20
- "900",
21
- "950",
22
- ];
10
+ const secondaryRange = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
23
11
 
24
12
  module.exports = {
25
13
  theme: {
26
14
  extend: {
27
15
  colors: {
16
+ // ------------------------------
17
+ // Canonical design tokens (new)
18
+ // ------------------------------
19
+ // Main / brand core
20
+ "main-primary": withColorMixin("--main-primary"),
21
+ "main-secondary": withColorMixin("--main-secondary"),
22
+ "main-tertiary": withColorMixin("--main-tertiary"),
23
+ "brand-midnight-blue": withColorMixin("--brand-midnight-blue"),
24
+ "brand-columbia-blue": withColorMixin("--brand-columbia-blue"),
25
+ "brand-background": withColorMixin("--brand-background"),
26
+ "brand-lemon-glacier": withColorMixin("--brand-lemon-glacier"),
27
+ "brand-rvl-yellow": withColorMixin("--brand-rvl-yellow"),
28
+ "brand-rvl-grey": withColorMixin("--brand-rvl-grey"),
29
+
30
+ // Text
28
31
  "text-black": withColorMixin("--text-black"),
29
- "text-dark": withColorMixin("--text-dark"),
30
- "text-medium": withColorMixin("--text-medium"),
31
- "text-light": withColorMixin("--text-light"),
32
- "text-grey-dark": withColorMixin("--text-grey-dark"),
33
- "text-grey-medium": withColorMixin("--text-grey-medium"),
34
- "text-grey-light": withColorMixin("--text-grey-light"),
32
+ "text-contrast-low": withColorMixin("--text-contrast-low"),
33
+ "text-contrast-medium": withColorMixin("--text-contrast-medium"),
34
+ "text-contrast-high": withColorMixin("--text-contrast-high"),
35
+ "text-contrast-max": withColorMixin("--text-contrast-max"),
36
+ "text-g-contrast-low": withColorMixin("--text-g-contrast-low"),
37
+ "text-g-contrast-medium": withColorMixin("--text-g-contrast-medium"),
38
+ "text-g-contrast-high": withColorMixin("--text-g-contrast-high"),
35
39
  "text-white": withColorMixin("--text-white"),
36
40
 
37
- ...generateColorConfig("primary", "ramps-primary"),
38
- ...generateColorConfig("secondary", "ramps-secondary"),
39
- ...generateColorConfig("tertiary", "ramps-tertiary"),
40
- ...generateColorConfig("grey", "ramps-grey"),
41
-
42
- ...generateColorConfig("grey2", "ramps-grey2", secondaryRange), // border-t-grey-transparent-24
43
- ...generateColorConfig("info", "ramps-info", secondaryRange),
44
- ...generateColorConfig("success", "ramps-success", secondaryRange),
45
- ...generateColorConfig("warning", "ramps-warning", secondaryRange),
46
- ...generateColorConfig("error", "ramps-error", secondaryRange),
47
-
48
- ...generateTransparentColorConfig("primary", "main"),
49
- ...generateTransparentColorConfig("secondary", "main"),
50
- ...generateTransparentColorConfig("tertiary", "main"),
51
- ...generateTransparentColorConfig("grey", "other"),
52
- ...generateTransparentColorConfig("grey2", "other"),
53
- ...generateTransparentColorConfig("info", "other"),
54
- ...generateTransparentColorConfig("success", "other"),
55
- ...generateTransparentColorConfig("warning", "other"),
56
- ...generateTransparentColorConfig("error", "other"),
57
- ...generateTransparentColorConfig("black", "other"),
58
- ...generateTransparentColorConfig("white", "other"),
41
+ // Palette / state ramps
42
+ // Ranges: 5 - 150
43
+ ...generateColorConfig("primary", "ramps-primary", {
44
+ includeOriginalVarAliases: true,
45
+ }),
46
+ ...generateColorConfig("secondary", "ramps-secondary", {
47
+ includeOriginalVarAliases: true,
48
+ }),
49
+ ...generateColorConfig("tertiary", "ramps-tertiary", {
50
+ includeOriginalVarAliases: true,
51
+ }),
52
+ ...generateColorConfig("grey", "ramps-grey", {
53
+ stateVars: false,
54
+ includeOriginalVarAliases: true,
55
+ }),
56
+
57
+ // Ranges: 50 - 950
58
+ ...generateColorConfig("grey2", "ramps-grey2", {
59
+ range: secondaryRange,
60
+ stateVars: false,
61
+ includeOriginalVarAliases: true,
62
+ }),
63
+ ...generateColorConfig("info", "ramps-info", {
64
+ range: secondaryRange,
65
+ includeOriginalVarAliases: true,
66
+ }),
67
+ ...generateColorConfig("success", "ramps-success", {
68
+ range: secondaryRange,
69
+ includeOriginalVarAliases: true,
70
+ }),
71
+ ...generateColorConfig("warning", "ramps-warning", {
72
+ range: secondaryRange,
73
+ includeOriginalVarAliases: true,
74
+ }),
75
+ ...generateColorConfig("error", "ramps-error", {
76
+ range: secondaryRange,
77
+ includeOriginalVarAliases: true,
78
+ }),
59
79
 
80
+ ...generateTransparentColorConfig("primary", {
81
+ includeOriginalVarAliases: true,
82
+ }),
83
+ ...generateTransparentColorConfig("secondary", {
84
+ includeOriginalVarAliases: true,
85
+ }),
86
+ ...generateTransparentColorConfig("tertiary", {
87
+ includeOriginalVarAliases: true,
88
+ }),
89
+ ...generateTransparentColorConfig("grey", {
90
+ includeOriginalVarAliases: true,
91
+ }),
92
+ ...generateTransparentColorConfig("grey2", {
93
+ includeOriginalVarAliases: true,
94
+ }),
95
+ ...generateTransparentColorConfig("info", {
96
+ includeOriginalVarAliases: true,
97
+ }),
98
+ ...generateTransparentColorConfig("success", {
99
+ includeOriginalVarAliases: true,
100
+ }),
101
+ ...generateTransparentColorConfig("warning", {
102
+ includeOriginalVarAliases: true,
103
+ }),
104
+ ...generateTransparentColorConfig("error", {
105
+ includeOriginalVarAliases: true,
106
+ }),
107
+ ...generateTransparentColorConfig("black", {
108
+ includeOriginalVarAliases: true,
109
+ }),
110
+ ...generateTransparentColorConfig("white", {
111
+ includeOriginalVarAliases: true,
112
+ }),
113
+
114
+ // State / input / function
60
115
  "state-disable-solid": withColorMixin("--state-disable-solid"),
61
116
  "state-disable-outline": withColorMixin("--state-disable-outline"),
62
117
 
@@ -77,7 +132,7 @@ module.exports = {
77
132
  ),
78
133
  "function-default-stroke": withColorMixin("--function-default-stroke"),
79
134
  "function-default-icon": withColorMixin("--function-default-icon"),
80
- "function-default-outline": withColorMixin(
135
+ "function-default-outline-icon": withColorMixin(
81
136
  "--function-default-outline-icon",
82
137
  ),
83
138
  "function-active-solid": withColorMixin("--function-active-solid"),
@@ -88,6 +143,59 @@ module.exports = {
88
143
  "function-active-stroke": withColorMixin("--function-active-stroke"),
89
144
  "function-active-icon": withColorMixin("--function-active-icon"),
90
145
 
146
+ // Surface / background primitives
147
+ "modal-surface": withColorMixin("--modal-surface"),
148
+ "modal-highlight": withColorMixin("--modal-highlight"),
149
+ "modal-overlay": withColorMixin("--modal-overlay"),
150
+ "modal-line": withColorMixin("--modal-line"),
151
+ "bg-bg1": withColorMixin("--bg-bg1"),
152
+ "bg-bg2": withColorMixin("--bg-bg2"),
153
+ "bg-bg3": withColorMixin("--bg-bg3"),
154
+ "bg-bg4": withColorMixin("--bg-bg4"),
155
+ "bg-bg5": withColorMixin("--bg-bg5"),
156
+ "bg-stroke1": withColorMixin("--bg-stroke1"),
157
+ "bg-stroke2": withColorMixin("--bg-stroke2"),
158
+ "bg-stroke3": withColorMixin("--bg-stroke3"),
159
+ "bg-stroke4": withColorMixin("--bg-stroke4"),
160
+ "bg-stroke5": withColorMixin("--bg-stroke5"),
161
+
162
+ // Common
163
+ "common-white": withColorMixin("--common-white"),
164
+ "common-black": withColorMixin("--common-black"),
165
+
166
+ // Others (direct export tokens)
167
+ ...generateColorConfig("others", "others", {
168
+ count: 35,
169
+ stateVars: false,
170
+ foreground: false,
171
+ includeStatePrefixedAliases: false,
172
+ }),
173
+
174
+ // Page background tokens
175
+ "page-bg-main": withColorMixin("--page-bg-main"),
176
+ "page-bg-circle-top-g-in": withColorMixin("--page-bg-circle-top-g-in"),
177
+ "page-bg-circle-top-g-out": withColorMixin(
178
+ "--page-bg-circle-top-g-out",
179
+ ),
180
+ "page-bg-circle-bottom-g-in": withColorMixin(
181
+ "--page-bg-circle-bottom-g-in",
182
+ ),
183
+ "page-bg-circle-bottom-g-out": withColorMixin(
184
+ "--page-bg-circle-bottom-g-out",
185
+ ),
186
+
187
+ // --------------------------------
188
+ // Deprecated aliases (compat only)
189
+ // --------------------------------
190
+ // Text aliases (prefer text-contrast-* / text-g-contrast-*)
191
+ "text-dark": withColorMixin("--text-dark"),
192
+ "text-medium": withColorMixin("--text-medium"),
193
+ "text-light": withColorMixin("--text-light"),
194
+ "text-grey-dark": withColorMixin("--text-grey-dark"),
195
+ "text-grey-medium": withColorMixin("--text-grey-medium"),
196
+ "text-grey-light": withColorMixin("--text-grey-light"),
197
+
198
+ // Base aliases (prefer modal-*, bg-*, text-contrast-* and state-*-text-solid)
91
199
  "base-bg": withColorMixin("--base-color-bg"),
92
200
  "base-bg2": withColorMixin("--base-color-bg2"),
93
201
  "base-bg3": withColorMixin("--base-color-bg3"),
@@ -105,9 +213,12 @@ module.exports = {
105
213
  "--base-color-guideline-stroke",
106
214
  ),
107
215
 
108
- "common-white": withColorMixin("--common-white"),
109
- "common-black": withColorMixin("--common-black"),
216
+ // Function aliases (prefer function-default-outline-icon)
217
+ "function-default-outline": withColorMixin(
218
+ "--function-default-outline-icon",
219
+ ),
110
220
 
221
+ // Semantic aliases (prefer direct design token names)
111
222
  surface: withColorMixin("--surface"),
112
223
  "surface-foreground": withColorMixin("--surface-foreground"),
113
224
  background: withColorMixin("--background"),
@@ -6,6 +6,6 @@
6
6
  /* Element: [progress, track] */
7
7
  /* ------------------------------------------------------------------ */
8
8
 
9
- --loading-process-color: var(--primary);
10
- --loading-track-color: #9E9E9E7A;
9
+ --loading-process-color: var(--brand-rvl-yellow);
10
+ --loading-track-color: var(--transparent-grey-32);
11
11
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  :root {
3
- /* Text aliases mapped to new contrast tokens */
3
+ /* Deprecated aliases: use --text-contrast-* / --text-g-contrast-* directly */
4
4
  --text-dark: var(--text-contrast-low);
5
5
  --text-medium: var(--text-contrast-medium);
6
6
  --text-light: var(--text-contrast-high);
@@ -8,7 +8,7 @@
8
8
  --text-grey-medium: var(--text-g-contrast-medium);
9
9
  --text-grey-light: var(--text-g-contrast-high);
10
10
 
11
- /* Base color aliases mapped to new background tokens */
11
+ /* Deprecated aliases: use --bg-* / --modal-* directly */
12
12
  --base-color-bg: var(--bg-bg1);
13
13
  --base-color-bg2: var(--bg-bg2);
14
14
  --base-color-bg3: var(--bg-bg3);
@@ -18,7 +18,7 @@
18
18
  --base-color-popup-highlight: var(--modal-highlight);
19
19
  --base-color-popup-curtain: var(--modal-overlay);
20
20
 
21
- /* ------- Addon base ---------- */
21
+ /* Deprecated semantic aliases */
22
22
  --background: var(--base-color-bg);
23
23
  --foreground: var(--common-black);
24
24
 
@@ -83,7 +83,7 @@
83
83
 
84
84
  /* Disabled State */
85
85
  --action-button-outline-disabled-bg: transparent;
86
- --action-button-outline-disabled-border: var(--state-disable-outline);
86
+ --action-button-outline-disabled-border: var(--state-disable-solid);
87
87
  --action-button-outline-disabled-text: var(--state-disable-outline);
88
88
 
89
89
  /* ------------------------------------------------------------------ */
@@ -11,15 +11,15 @@
11
11
 
12
12
  /* Default State */
13
13
  --dropdown-menu-default-bg: transparent;
14
- --dropdown-menu-default-text: inherit;
14
+ --dropdown-menu-default-text: var(--text-g-contrast-high);
15
15
 
16
16
  /* Hover State */
17
17
  --dropdown-menu-hover-bg: var(--state-primary-hover-bg);
18
- --dropdown-menu-hover-text: inherit;
18
+ --dropdown-menu-hover-text: var(--text-g-contrast-high);
19
19
 
20
20
  /* Selected State */
21
21
  --dropdown-menu-selected-bg: transparent;
22
- --dropdown-menu-selected-text: inherit;
22
+ --dropdown-menu-selected-text: var(--text-g-contrast-high);
23
23
 
24
24
  /* Disabled State */
25
25
  --dropdown-menu-disabled-bg: transparent;
@@ -6,6 +6,6 @@
6
6
  /* Element: [progress, track] */
7
7
  /* ------------------------------------------------------------------ */
8
8
 
9
- --loading-process-color: var(--secondary);
10
- --loading-track-color: #9E9E9E7A;
9
+ --loading-process-color: var(--brand-rvl-yellow);
10
+ --loading-track-color: var(--transparent-grey-32);
11
11
  }
@@ -9,7 +9,7 @@
9
9
  /* Default State */
10
10
  --switch-default-color: rgb(from var(--ramps-grey-100, #9e9e9e) r g b / 0.32);
11
11
  --switch-thumb-default-color: var(--ramps-grey-100, #9e9e9e);
12
- --switch-thumb-filter: drop-shadow(0 2px 8px rgba(145, 158, 171, 0.24));
12
+ --switch-thumb-filter: drop-shadow(0 8px 16px #00000014);
13
13
 
14
14
  /* Hover State */
15
15
  --switch-hover-color: rgb(from var(--ramps-grey-80, #b1b1b1) r g b / 0.48);
@@ -1,37 +1,98 @@
1
+ const DEFAULT_COLOR_RANGE = [
2
+ 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150,
3
+ ];
4
+ const DEFAULT_TRANSPARENT_RANGE = [8, 12, 16, 24, 32, 48];
5
+
6
+ /**
7
+ * Create Tailwind-compatible alpha color from a CSS variable.
8
+ *
9
+ * @param {string} variable CSS variable name including `--` prefix.
10
+ * @returns {string} `color-mix(...)` expression that Tailwind can inject alpha into.
11
+ *
12
+ * @example
13
+ * withColorMixin("--main-primary");
14
+ * // => "color-mix(in srgb, var(--main-primary) calc(100% * <alpha-value>), transparent)"
15
+ */
1
16
  export const withColorMixin = (variable) =>
2
17
  `color-mix(in srgb, var(${variable}) calc(100% * <alpha-value>), transparent)`;
3
18
 
19
+ /**
20
+ * Generate palette/state color aliases for Tailwind `theme.extend.colors`.
21
+ *
22
+ * @param {string} baseName Base key used for generated token names (e.g. `primary`).
23
+ * @param {string} variablePrefix Prefix for ramp variables (e.g. `ramps-primary`).
24
+ * @param {{
25
+ * range?: Array<number | string>,
26
+ * count?: number,
27
+ * stateVars?: boolean,
28
+ * foreground?: boolean,
29
+ * includeStatePrefixedAliases?: boolean,
30
+ * includeOriginalVarAliases?: boolean
31
+ * }} [options]
32
+ * @returns {Record<string, string>} Map of token -> `color-mix(...)` CSS values.
33
+ *
34
+ * @example
35
+ * generateColorConfig("primary", "ramps-primary", { range: [50, 100] });
36
+ * // => {
37
+ * // "primary-50": "color-mix(...var(--ramps-primary-50)... )",
38
+ * // "primary-100": "color-mix(...var(--ramps-primary-100)... )",
39
+ * // "primary-foreground": "color-mix(...var(--primary-foreground)... )",
40
+ * // "primary": "color-mix(...var(--state-primary-default)... )",
41
+ * // ...state aliases
42
+ * // }
43
+ *
44
+ * @example
45
+ * generateColorConfig("others", "others", {
46
+ * count: 3,
47
+ * stateVars: false,
48
+ * foreground: false,
49
+ * });
50
+ * // => { "others-1": "color-mix(...)", "others-2": "color-mix(...)", "others-3": "color-mix(...)" }
51
+ */
4
52
  export const generateColorConfig = (
5
53
  baseName,
6
54
  variablePrefix,
7
- range = [5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150],
55
+ {
56
+ range,
57
+ count,
58
+ stateVars = true,
59
+ foreground = true,
60
+ includeStatePrefixedAliases = true,
61
+ includeOriginalVarAliases = false,
62
+ } = {},
8
63
  ) => {
64
+ const resolvedRange = Number.isInteger(count)
65
+ ? Array.from({ length: count }, (_, i) => i + 1)
66
+ : range ?? DEFAULT_COLOR_RANGE;
67
+
9
68
  const colors = {};
10
69
 
11
- range.forEach((num) => {
70
+ resolvedRange.forEach((num) => {
12
71
  colors[`${baseName}-${num}`] = withColorMixin(`--${variablePrefix}-${num}`);
72
+ if (includeOriginalVarAliases) {
73
+ colors[`${variablePrefix}-${num}`] = withColorMixin(
74
+ `--${variablePrefix}-${num}`,
75
+ );
76
+ }
13
77
  });
14
78
 
15
- colors[`${baseName}-foreground`] = withColorMixin(`--${baseName}-foreground`);
16
- colors[`${baseName}`] = withColorMixin(`--state-${baseName}-default`); // TODO should be dynamic
17
- colors[`${baseName}-default`] = withColorMixin(
18
- `--state-${baseName}-default`,
19
- );
20
- colors[`${baseName}-hover`] = withColorMixin(
21
- `--state-${baseName}-hover`,
22
- );
23
- colors[`${baseName}-stroke`] = withColorMixin(
24
- `--state-${baseName}-stroke`,
25
- );
79
+ if (foreground) {
80
+ colors[`${baseName}-foreground`] = withColorMixin(
81
+ `--${baseName}-foreground`,
82
+ );
83
+ }
84
+
85
+ if (!stateVars) return colors;
86
+
87
+ colors[`${baseName}`] = withColorMixin(`--state-${baseName}-default`);
88
+ colors[`${baseName}-default`] = withColorMixin(`--state-${baseName}-default`);
89
+ colors[`${baseName}-hover`] = withColorMixin(`--state-${baseName}-hover`);
90
+ colors[`${baseName}-stroke`] = withColorMixin(`--state-${baseName}-stroke`);
26
91
  colors[`${baseName}-hover-bg`] = withColorMixin(
27
92
  `--state-${baseName}-hover-bg`,
28
93
  );
29
- colors[`${baseName}-pressed`] = withColorMixin(
30
- `--state-${baseName}-pressed`,
31
- );
32
- colors[`${baseName}-active`] = withColorMixin(
33
- `--state-${baseName}-active`,
34
- );
94
+ colors[`${baseName}-pressed`] = withColorMixin(`--state-${baseName}-pressed`);
95
+ colors[`${baseName}-active`] = withColorMixin(`--state-${baseName}-active`);
35
96
 
36
97
  // text
37
98
  colors[`${baseName}-text-solid`] = withColorMixin(
@@ -40,13 +101,61 @@ export const generateColorConfig = (
40
101
  colors[`${baseName}-text-outline`] = withColorMixin(
41
102
  `--state-${baseName}-text-outline`,
42
103
  );
104
+ colors[`${baseName}-text-hover`] = withColorMixin(
105
+ `--state-${baseName}-text-hover`,
106
+ );
43
107
  colors[`${baseName}-text-pressed`] = withColorMixin(
44
108
  `--state-${baseName}-text-pressed`,
45
109
  );
46
110
 
111
+ if (includeStatePrefixedAliases) {
112
+ colors[`state-${baseName}-default`] = withColorMixin(
113
+ `--state-${baseName}-default`,
114
+ );
115
+ colors[`state-${baseName}-hover`] = withColorMixin(
116
+ `--state-${baseName}-hover`,
117
+ );
118
+ colors[`state-${baseName}-stroke`] = withColorMixin(
119
+ `--state-${baseName}-stroke`,
120
+ );
121
+ colors[`state-${baseName}-hover-bg`] = withColorMixin(
122
+ `--state-${baseName}-hover-bg`,
123
+ );
124
+ colors[`state-${baseName}-pressed`] = withColorMixin(
125
+ `--state-${baseName}-pressed`,
126
+ );
127
+ colors[`state-${baseName}-active`] = withColorMixin(
128
+ `--state-${baseName}-active`,
129
+ );
130
+
131
+ // Text
132
+ colors[`state-${baseName}-text-solid`] = withColorMixin(
133
+ `--state-${baseName}-text-solid`,
134
+ );
135
+ colors[`state-${baseName}-text-outline`] = withColorMixin(
136
+ `--state-${baseName}-text-outline`,
137
+ );
138
+ colors[`state-${baseName}-text-hover`] = withColorMixin(
139
+ `--state-${baseName}-text-hover`,
140
+ );
141
+ colors[`state-${baseName}-text-pressed`] = withColorMixin(
142
+ `--state-${baseName}-text-pressed`,
143
+ );
144
+ }
145
+
47
146
  return colors;
48
147
  };
49
148
 
149
+ /**
150
+ * Generate button semantic aliases by style `type` (`bg`, `text`, `border`).
151
+ *
152
+ * @param {"bg" | "text" | "border"} type Token type suffix.
153
+ * @returns {Record<string, string>} Map like `button-primary-solid-default`.
154
+ *
155
+ * @example
156
+ * generateButtonStyles("bg");
157
+ * // => { "button-primary-solid-default": "color-mix(...)", ... }
158
+ */
50
159
  export function generateButtonStyles(type) {
51
160
  const themes = [
52
161
  "primary",
@@ -72,7 +181,16 @@ export function generateButtonStyles(type) {
72
181
  }, {});
73
182
  }
74
183
 
75
- // action-button-solid-hover
184
+ /**
185
+ * Generate action-button semantic aliases by style `type` (`bg`, `text`, `border`).
186
+ *
187
+ * @param {"bg" | "text" | "border"} type Token type suffix.
188
+ * @returns {Record<string, string>} Map like `action-button-solid-default`.
189
+ *
190
+ * @example
191
+ * generateActionButtonStyles("text");
192
+ * // => { "action-button-solid-default": "color-mix(...)", ... }
193
+ */
76
194
  export function generateActionButtonStyles(type) {
77
195
  const modes = ["solid", "outline", "icon"];
78
196
 
@@ -93,16 +211,37 @@ export function generateActionButtonStyles(type) {
93
211
  }, {});
94
212
  }
95
213
 
96
- // bg-primary-transparent-8
97
- export const generateTransparentColorConfig = (baseName, _type) => {
214
+ /**
215
+ * Generate transparent color aliases for a base color family.
216
+ *
217
+ * @param {string} baseName Base key such as `primary` or `warning`.
218
+ * @param {{ includeOriginalVarAliases?: boolean }} [options]
219
+ * @returns {Record<string, string>} Map like `primary-transparent-8`.
220
+ *
221
+ * @example
222
+ * generateTransparentColorConfig("primary");
223
+ * // => {
224
+ * // "primary-transparent-8": "color-mix(...var(--transparent-primary-8)... )",
225
+ * // "primary-transparent-12": "color-mix(...var(--transparent-primary-12)... )",
226
+ * // ...
227
+ * // }
228
+ */
229
+ export const generateTransparentColorConfig = (
230
+ baseName,
231
+ { includeOriginalVarAliases = false } = {},
232
+ ) => {
98
233
  const colors = {};
99
234
 
100
- const range = [8, 12, 16, 24, 32, 48];
101
-
102
- range.forEach((num) => {
235
+ DEFAULT_TRANSPARENT_RANGE.forEach((num) => {
103
236
  colors[`${baseName}-transparent-${num}`] = withColorMixin(
104
237
  `--transparent-${baseName}-${num}`,
105
238
  );
239
+
240
+ if (includeOriginalVarAliases) {
241
+ colors[`transparent-${baseName}-${num}`] = withColorMixin(
242
+ `--transparent-${baseName}-${num}`,
243
+ );
244
+ }
106
245
  });
107
246
 
108
247
  return colors;