@rovula/ui 0.1.6 → 0.1.8

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 (232) hide show
  1. package/dist/cjs/bundle.css +630 -467
  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 +17 -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 +351 -267
  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/Switch/Switch.styles.js +1 -1
  72. package/dist/components/Table/Table.js +5 -5
  73. package/dist/components/Tabs/Tabs.js +12 -9
  74. package/dist/components/Tabs/Tabs.stories.js +1 -1
  75. package/dist/components/Text/Text.js +1 -1
  76. package/dist/components/Text/Text.stories.js +1 -1
  77. package/dist/components/TextArea/TextArea.stories.js +1 -1
  78. package/dist/components/TextArea/TextArea.styles.js +3 -3
  79. package/dist/components/TextInput/TextInput.js +3 -2
  80. package/dist/components/TextInput/TextInput.stories.js +3 -3
  81. package/dist/components/TextInput/TextInput.styles.js +41 -19
  82. package/dist/components/Toast/Toast.js +4 -2
  83. package/dist/components/Toast/Toast.stories.js +1 -1
  84. package/dist/components/Toast/Toast.styles.js +4 -4
  85. package/dist/components/Toast/Toaster.js +2 -2
  86. package/dist/components/Tree/Tree.stories.js +1 -1
  87. package/dist/components/Tree/TreeItem.js +1 -1
  88. package/dist/esm/bundle.css +630 -467
  89. package/dist/esm/bundle.js +1545 -1545
  90. package/dist/esm/bundle.js.map +1 -1
  91. package/dist/esm/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
  92. package/dist/esm/types/components/Dialog/Dialog.d.ts +7 -1
  93. package/dist/esm/types/components/Dialog/Dialog.stories.d.ts +3 -0
  94. package/dist/esm/types/components/Dropdown/Dropdown.d.ts +2 -0
  95. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
  96. package/dist/esm/types/components/Form/Field.d.ts +26 -0
  97. package/dist/esm/types/components/Form/FieldMessage.d.ts +7 -0
  98. package/dist/esm/types/components/Form/Form.d.ts +49 -11
  99. package/dist/esm/types/components/Form/Form.stories.d.ts +23 -0
  100. package/dist/esm/types/components/Form/ValidationHintList.d.ts +17 -0
  101. package/dist/esm/types/components/Form/ValidationHintList.stories.d.ts +9 -0
  102. package/dist/esm/types/components/Form/index.d.ts +10 -0
  103. package/dist/esm/types/components/Form/useOptionBridge.d.ts +17 -0
  104. package/dist/esm/types/components/OtpInput/OtpInput.d.ts +17 -0
  105. package/dist/esm/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
  106. package/dist/esm/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
  107. package/dist/esm/types/components/OtpInput/index.d.ts +5 -0
  108. package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +3 -0
  109. package/dist/esm/types/index.d.ts +5 -0
  110. package/dist/esm/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
  111. package/dist/esm/types/utils/colors.d.ts +351 -267
  112. package/dist/index.d.ts +512 -269
  113. package/dist/index.js +3 -0
  114. package/dist/src/theme/global.css +2739 -2681
  115. package/dist/theme/ThemeColorCoverageRuntime.stories.js +91 -0
  116. package/dist/utils/colors.js +359 -267
  117. package/package.json +4 -2
  118. package/src/components/ActionButton/ActionButton.stories.tsx +6 -6
  119. package/src/components/ActionButton/ActionButton.styles.ts +1 -1
  120. package/src/components/AlertDialog/AlertDialog.stories.tsx +22 -0
  121. package/src/components/AlertDialog/AlertDialog.tsx +6 -6
  122. package/src/components/Avatar/Avatar.stories.tsx +1 -1
  123. package/src/components/Avatar/Avatar.styles.ts +1 -1
  124. package/src/components/Avatar/AvatarBase.tsx +1 -1
  125. package/src/components/Avatar/AvatarGroup.stories.tsx +1 -1
  126. package/src/components/Button/Buttons.stories.tsx +25 -17
  127. package/src/components/Calendar/Calendar.tsx +3 -3
  128. package/src/components/Checkbox/Checkbox.stories.tsx +35 -12
  129. package/src/components/Checkbox/Checkbox.tsx +7 -5
  130. package/src/components/Collapsible/Collapsible.styles.ts +1 -1
  131. package/src/components/DataTable/DataTable.tsx +2 -2
  132. package/src/components/Dialog/Dialog.stories.tsx +173 -0
  133. package/src/components/Dialog/Dialog.tsx +32 -15
  134. package/src/components/Dropdown/Dropdown.styles.ts +1 -1
  135. package/src/components/Dropdown/Dropdown.tsx +16 -14
  136. package/src/components/DropdownMenu/DropdownMenu.tsx +3 -3
  137. package/src/components/FocusedScrollView/FocusedScrollView.stories.tsx +10 -10
  138. package/src/components/Form/Field.tsx +160 -0
  139. package/src/components/Form/FieldMessage.tsx +38 -0
  140. package/src/components/Form/Form.docs.mdx +67 -0
  141. package/src/components/Form/Form.stories.tsx +490 -0
  142. package/src/components/Form/Form.tsx +185 -87
  143. package/src/components/Form/README.md +284 -0
  144. package/src/components/Form/ValidationHintList.stories.tsx +118 -0
  145. package/src/components/Form/ValidationHintList.tsx +82 -0
  146. package/src/components/Form/index.ts +28 -0
  147. package/src/components/Form/useOptionBridge.ts +55 -0
  148. package/src/components/InputFilter/InputFilter.stories.tsx +1 -1
  149. package/src/components/InputFilter/InputFilter.styles.ts +14 -1
  150. package/src/components/InputFilter/InputFilter.tsx +33 -28
  151. package/src/components/Label/Label.styles.ts +2 -2
  152. package/src/components/Label/Label.tsx +1 -1
  153. package/src/components/Menu/Menu.tsx +12 -12
  154. package/src/components/NumberInput/NumberInput.stories.tsx +1 -1
  155. package/src/components/OtpInput/OtpInput.stories.tsx +168 -0
  156. package/src/components/OtpInput/OtpInput.tsx +210 -0
  157. package/src/components/OtpInput/OtpInputGroup.tsx +74 -0
  158. package/src/components/OtpInput/index.ts +5 -0
  159. package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
  160. package/src/components/Popover/Popover.tsx +1 -1
  161. package/src/components/RadioGroup/RadioGroup.stories.tsx +4 -4
  162. package/src/components/RadioGroup/RadioGroup.tsx +2 -1
  163. package/src/components/Search/Search.stories.tsx +1 -1
  164. package/src/components/Search/Search.tsx +6 -2
  165. package/src/components/Slider/Slider.stories.tsx +7 -7
  166. package/src/components/Slider/Slider.tsx +1 -1
  167. package/src/components/Switch/Switch.stories.tsx +4 -4
  168. package/src/components/Switch/Switch.styles.ts +1 -1
  169. package/src/components/Table/Table.tsx +5 -5
  170. package/src/components/Tabs/Tabs.stories.tsx +1 -1
  171. package/src/components/Tabs/Tabs.tsx +29 -18
  172. package/src/components/Text/Text.stories.tsx +1 -1
  173. package/src/components/Text/Text.tsx +1 -1
  174. package/src/components/TextArea/TextArea.stories.tsx +1 -1
  175. package/src/components/TextArea/TextArea.styles.ts +3 -3
  176. package/src/components/TextInput/TextInput.stories.tsx +7 -7
  177. package/src/components/TextInput/TextInput.styles.ts +42 -19
  178. package/src/components/TextInput/TextInput.tsx +3 -1
  179. package/src/components/Toast/Toast.stories.tsx +1 -1
  180. package/src/components/Toast/Toast.styles.tsx +7 -7
  181. package/src/components/Toast/Toast.tsx +5 -4
  182. package/src/components/Toast/Toaster.tsx +17 -20
  183. package/src/components/Tree/Tree.stories.tsx +1 -1
  184. package/src/components/Tree/TreeItem.tsx +1 -1
  185. package/src/index.ts +5 -0
  186. package/src/theme/THEME_MAPPING.md +36 -37
  187. package/src/theme/ThemeColorCoverageRuntime.stories.tsx +236 -0
  188. package/src/theme/direct-token-migration-plan.md +121 -0
  189. package/src/theme/figma-mcp-check-report.md +225 -0
  190. package/src/theme/figma-mcp-component-checklist.json +1250 -0
  191. package/src/theme/global.css +7 -3
  192. package/src/theme/presets/colors.js +173 -64
  193. package/src/theme/themes/skyller/baseline.css +0 -4
  194. package/src/theme/themes/variable-mapping.css +1064 -0
  195. package/src/theme/themes/variable.css +248 -230
  196. package/src/theme/themes/xspector/baseline.css +0 -4
  197. package/src/theme/themes/xspector/components/dropdown-menu.css +4 -4
  198. package/src/theme/themes/xspector/components/loading.css +2 -2
  199. package/src/theme/tokens/baseline.css +0 -3
  200. package/src/theme/tokens/color.css +36 -65
  201. package/src/theme/tokens/components/action-button.css +6 -6
  202. package/src/theme/tokens/components/button.css +189 -189
  203. package/src/theme/tokens/components/dropdown-menu.css +5 -5
  204. package/src/theme/tokens/components/footer.css +1 -1
  205. package/src/theme/tokens/components/loading.css +2 -2
  206. package/src/theme/tokens/components/switch.css +11 -11
  207. package/src/theme/tokens/typography.css +28 -28
  208. package/src/theme/tokens_old/baseline.css +13 -0
  209. package/src/theme/tokens_old/color.css +78 -0
  210. package/src/theme/tokens_old/components/action-button.css +127 -0
  211. package/src/theme/tokens_old/components/button.css +512 -0
  212. package/src/theme/tokens_old/components/dropdown-menu.css +27 -0
  213. package/src/theme/tokens_old/components/footer.css +9 -0
  214. package/src/theme/tokens_old/components/loading.css +11 -0
  215. package/src/theme/tokens_old/components/navbar.css +9 -0
  216. package/src/theme/tokens_old/components/progress-bar.css +8 -0
  217. package/src/theme/tokens_old/components/switch.css +29 -0
  218. package/src/theme/tokens_old/typography.css +199 -0
  219. package/src/theme/tokens_old/variables.css +28 -0
  220. package/src/theme/utils.js +172 -33
  221. package/src/utils/colors.ts +367 -278
  222. package/src/theme/themes/skyller/color.css +0 -79
  223. package/src/theme/themes/skyller/palette.css +0 -143
  224. package/src/theme/themes/skyller/state.css +0 -94
  225. package/src/theme/themes/skyller/transparent.css +0 -94
  226. package/src/theme/themes/xspector/color.css +0 -83
  227. package/src/theme/themes/xspector/palette.css +0 -142
  228. package/src/theme/themes/xspector/state.css +0 -94
  229. package/src/theme/themes/xspector/transparent.css +0 -93
  230. /package/src/theme/{tokens → tokens_old}/palette.css +0 -0
  231. /package/src/theme/{tokens → tokens_old}/state.css +0 -0
  232. /package/src/theme/{tokens → tokens_old}/transparent.css +0 -0
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
2
  import type { Meta, StoryObj } from "@storybook/react";
3
+ import * as yup from "yup";
3
4
  import {
4
5
  Dialog,
5
6
  DialogContent,
6
7
  DialogDescription,
8
+ DialogBody,
7
9
  DialogFooter,
8
10
  DialogHeader,
9
11
  DialogTitle,
@@ -12,6 +14,8 @@ import {
12
14
  import Button from "../Button/Button";
13
15
  import { Label } from "../Label/Label";
14
16
  import { Input } from "../Input/Input";
17
+ import { Field, Form, ValidationHintList, ValidationHintRule } from "../Form";
18
+ import PasswordInput from "../PasswordInput";
15
19
 
16
20
  const meta = {
17
21
  title: "Components/Dialog",
@@ -116,3 +120,172 @@ export const Demo = {
116
120
  );
117
121
  },
118
122
  } satisfies StoryObj;
123
+
124
+ const passwordHints = [
125
+ {
126
+ id: "min-length",
127
+ label: "Minimum 12 characters",
128
+ validate: (values: ChangePasswordFormValues) =>
129
+ values.newPassword.length >= 12,
130
+ when: (values: ChangePasswordFormValues) => Boolean(values.newPassword),
131
+ },
132
+ {
133
+ id: "lower-and-upper",
134
+ label: "At least a lower and upper case",
135
+ validate: (values: ChangePasswordFormValues) =>
136
+ /[a-z]/.test(values.newPassword) && /[A-Z]/.test(values.newPassword),
137
+ when: (values: ChangePasswordFormValues) => Boolean(values.newPassword),
138
+ },
139
+ {
140
+ id: "special",
141
+ label: "At least 1 special character",
142
+ validate: (values: ChangePasswordFormValues) =>
143
+ /[^A-Za-z0-9]/.test(values.newPassword),
144
+ when: (values: ChangePasswordFormValues) => Boolean(values.newPassword),
145
+ },
146
+ {
147
+ id: "numeral",
148
+ label: "At least 1 numeral",
149
+ validate: (values: ChangePasswordFormValues) =>
150
+ /\d/.test(values.newPassword),
151
+ when: (values: ChangePasswordFormValues) => Boolean(values.newPassword),
152
+ },
153
+ {
154
+ id: "capital",
155
+ label: "At least 1 capital letter",
156
+ validate: (values: ChangePasswordFormValues) =>
157
+ /[A-Z]/.test(values.newPassword),
158
+ when: (values: ChangePasswordFormValues) => Boolean(values.newPassword),
159
+ },
160
+ {
161
+ id: "match",
162
+ label: "Password and confirmation are matching",
163
+ validate: (values: ChangePasswordFormValues) =>
164
+ Boolean(values.newPassword) &&
165
+ values.newPassword === values.confirmPassword,
166
+ when: (values: ChangePasswordFormValues) =>
167
+ Boolean(values.newPassword) && Boolean(values.confirmPassword),
168
+ },
169
+ ] satisfies ValidationHintRule<ChangePasswordFormValues>[];
170
+
171
+ type ChangePasswordFormValues = {
172
+ newPassword: string;
173
+ confirmPassword: string;
174
+ };
175
+
176
+ const changePasswordSchema = yup.object({
177
+ newPassword: yup
178
+ .string()
179
+ .required("New password is required")
180
+ .min(12, "Password must be at least 12 characters")
181
+ .matches(/[a-z]/, "Password must include a lowercase letter")
182
+ .matches(/[A-Z]/, "Password must include an uppercase letter")
183
+ .matches(/\d/, "Password must include a numeral")
184
+ .matches(/[^A-Za-z0-9]/, "Password must include a special character"),
185
+ confirmPassword: yup
186
+ .string()
187
+ .required("Please confirm your password")
188
+ .oneOf([yup.ref("newPassword")], "Passwords must match"),
189
+ });
190
+
191
+ export const FigmaChangePassword = {
192
+ render: () => {
193
+ return (
194
+ <div className="flex w-full">
195
+ <Dialog defaultOpen>
196
+ <DialogContent className="min-h-[686px] max-w-[650px]">
197
+ <Form<ChangePasswordFormValues>
198
+ className="contents"
199
+ defaultValues={{
200
+ newPassword: "",
201
+ confirmPassword: "",
202
+ }}
203
+ mode="onTouched"
204
+ validationSchema={changePasswordSchema}
205
+ onSubmit={(values) => {
206
+ // eslint-disable-next-line no-console
207
+ console.log("Change password submit:", values);
208
+ }}
209
+ >
210
+ {({ formState, watch }) => {
211
+ const newPassword = watch("newPassword");
212
+ const confirmPassword = watch("confirmPassword");
213
+
214
+ return (
215
+ <>
216
+ <DialogHeader>
217
+ <DialogTitle>Welcome!</DialogTitle>
218
+ <DialogDescription>
219
+ Please create a new password to replace the temporary
220
+ password.
221
+ </DialogDescription>
222
+ </DialogHeader>
223
+
224
+ <DialogBody>
225
+ <div className="flex flex-col gap-4">
226
+ <Field<ChangePasswordFormValues, "newPassword">
227
+ name="newPassword"
228
+ component={PasswordInput}
229
+ componentProps={{
230
+ id: "new-password",
231
+ label: "New password",
232
+ type: "password",
233
+ required: true,
234
+ fullwidth: true,
235
+ size: "lg",
236
+ }}
237
+ />
238
+ <Field<ChangePasswordFormValues, "confirmPassword">
239
+ name="confirmPassword"
240
+ component={PasswordInput}
241
+ componentProps={{
242
+ id: "confirm-password",
243
+ label: "Confirm password",
244
+ type: "password",
245
+ required: true,
246
+ fullwidth: true,
247
+ size: "lg",
248
+ }}
249
+ />
250
+
251
+ <ValidationHintList<ChangePasswordFormValues>
252
+ values={{
253
+ newPassword: newPassword || "",
254
+ confirmPassword: confirmPassword || "",
255
+ }}
256
+ rules={passwordHints}
257
+ />
258
+ </div>
259
+ </DialogBody>
260
+
261
+ <DialogFooter>
262
+ <Button
263
+ type="button"
264
+ variant="outline"
265
+ color="primary"
266
+ size="lg"
267
+ fullwidth={false}
268
+ >
269
+ Back
270
+ </Button>
271
+ <Button
272
+ type="submit"
273
+ size="lg"
274
+ fullwidth={false}
275
+ className="w-[180px]"
276
+ disabled={!formState.isValid || formState.isSubmitting}
277
+ isLoading={formState.isSubmitting}
278
+ >
279
+ Save changes
280
+ </Button>
281
+ </DialogFooter>
282
+ </>
283
+ );
284
+ }}
285
+ </Form>
286
+ </DialogContent>
287
+ </Dialog>
288
+ </div>
289
+ );
290
+ },
291
+ } satisfies StoryObj;
@@ -21,8 +21,8 @@ const DialogOverlay = React.forwardRef<
21
21
  <DialogPrimitive.Overlay
22
22
  ref={ref}
23
23
  className={cn(
24
- "fixed inset-0 z-50 bg-base-popup-curtain data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
25
- className
24
+ "fixed inset-0 z-50 bg-modal-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
25
+ className,
26
26
  )}
27
27
  {...props}
28
28
  />
@@ -44,15 +44,15 @@ const DialogContent = React.forwardRef<
44
44
  closeButtonClassName,
45
45
  ...props
46
46
  },
47
- ref
47
+ ref,
48
48
  ) => (
49
49
  <DialogPortal>
50
50
  <DialogOverlay />
51
51
  <DialogPrimitive.Content
52
52
  ref={ref}
53
53
  className={cn(
54
- "fixed text-base-popup-foreground left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-base-popup bg-base-popup p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-md",
55
- className
54
+ "fixed left-[50%] top-[50%] z-50 flex w-[calc(100%-32px)] max-w-[650px] translate-x-[-50%] translate-y-[-50%] flex-col rounded-md bg-modal-surface p-8 text-text-g-contrast-medium shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
55
+ className,
56
56
  )}
57
57
  {...props}
58
58
  >
@@ -60,8 +60,8 @@ const DialogContent = React.forwardRef<
60
60
  {showCloseButton && (
61
61
  <DialogPrimitive.Close
62
62
  className={cn(
63
- "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-primary data-[state=open]:text-primary-foreground",
64
- closeButtonClassName
63
+ "absolute right-8 top-8 rounded-sm opacity-70 ring-offset-bg-bg1 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-input-active-stroke focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-primary data-[state=open]:text-state-primary-text-solid",
64
+ closeButtonClassName,
65
65
  )}
66
66
  >
67
67
  <XMarkIcon className="h-4 w-4" />
@@ -70,7 +70,7 @@ const DialogContent = React.forwardRef<
70
70
  )}
71
71
  </DialogPrimitive.Content>
72
72
  </DialogPortal>
73
- )
73
+ ),
74
74
  );
75
75
  DialogContent.displayName = DialogPrimitive.Content.displayName;
76
76
 
@@ -78,15 +78,25 @@ const DialogHeader = ({
78
78
  className,
79
79
  ...props
80
80
  }: React.HTMLAttributes<HTMLDivElement>) => (
81
+ <div className={cn("flex flex-col gap-2 text-left", className)} {...props} />
82
+ );
83
+ DialogHeader.displayName = "DialogHeader";
84
+
85
+ const DialogBody = ({
86
+ className,
87
+ scrollable = false,
88
+ ...props
89
+ }: React.HTMLAttributes<HTMLDivElement> & { scrollable?: boolean }) => (
81
90
  <div
82
91
  className={cn(
83
- "flex flex-col space-y-2 text-center sm:text-left",
84
- className
92
+ "flex flex-1 min-h-0 flex-col mt-8",
93
+ scrollable && "overflow-y-auto",
94
+ className,
85
95
  )}
86
96
  {...props}
87
97
  />
88
98
  );
89
- DialogHeader.displayName = "DialogHeader";
99
+ DialogBody.displayName = "DialogBody";
90
100
 
91
101
  const DialogFooter = ({
92
102
  className,
@@ -94,8 +104,8 @@ const DialogFooter = ({
94
104
  }: React.HTMLAttributes<HTMLDivElement>) => (
95
105
  <div
96
106
  className={cn(
97
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ",
98
- className
107
+ "flex flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-end sm:gap-6",
108
+ className,
99
109
  )}
100
110
  {...props}
101
111
  />
@@ -108,7 +118,10 @@ const DialogTitle = React.forwardRef<
108
118
  >(({ className, ...props }, ref) => (
109
119
  <DialogPrimitive.Title
110
120
  ref={ref}
111
- className={cn("typography-h5 tracking-tight ", className)}
121
+ className={cn(
122
+ "typography-h4 tracking-tight text-text-contrast-max",
123
+ className,
124
+ )}
112
125
  {...props}
113
126
  />
114
127
  ));
@@ -120,7 +133,10 @@ const DialogDescription = React.forwardRef<
120
133
  >(({ className, ...props }, ref) => (
121
134
  <DialogPrimitive.Description
122
135
  ref={ref}
123
- className={cn("text-sm", className)}
136
+ className={cn(
137
+ "typography-subtitle1 text-text-g-contrast-medium",
138
+ className,
139
+ )}
124
140
  {...props}
125
141
  />
126
142
  ));
@@ -134,6 +150,7 @@ export {
134
150
  DialogTrigger,
135
151
  DialogContent,
136
152
  DialogHeader,
153
+ DialogBody,
137
154
  DialogFooter,
138
155
  DialogTitle,
139
156
  DialogDescription,
@@ -14,7 +14,7 @@ export const iconWrapperVariant = cva(
14
14
  defaultVariants: {
15
15
  size: "md",
16
16
  },
17
- }
17
+ },
18
18
  );
19
19
 
20
20
  export const dropdownIconVariant = cva(["transition-all"], {
@@ -50,6 +50,7 @@ export type DropdownProps = {
50
50
  optionContainerClassName?: string;
51
51
  optionItemClassName?: string;
52
52
  optionNotFoundItemClassName?: string;
53
+ segmentedInput?: boolean;
53
54
  options: Options[];
54
55
  value?: Options;
55
56
  onChangeText?: InputProps["onChange"];
@@ -88,9 +89,10 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
88
89
  optionContainerClassName,
89
90
  optionItemClassName,
90
91
  optionNotFoundItemClassName,
92
+ segmentedInput = true,
91
93
  ...props
92
94
  },
93
- ref
95
+ ref,
94
96
  ) => {
95
97
  const _id = id || `${label}-select`;
96
98
 
@@ -136,7 +138,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
136
138
  clearMismatchValue(event as any);
137
139
  }
138
140
  },
139
- [onChangeText]
141
+ [onChangeText],
140
142
  );
141
143
 
142
144
  const handleOptionClick = useCallback(
@@ -146,14 +148,14 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
146
148
  onSelect?.(option);
147
149
  setIsFocused(false);
148
150
  },
149
- [onSelect]
151
+ [onSelect],
150
152
  );
151
153
 
152
154
  const optionsFiltered = useMemo(() => {
153
155
  return options.filter(
154
156
  (option) =>
155
157
  !filterMode ||
156
- option.label?.toLowerCase().includes(textValue?.toLowerCase())
158
+ option.label?.toLowerCase().includes(textValue?.toLowerCase()),
157
159
  );
158
160
  }, [options, filterMode, textValue]);
159
161
 
@@ -236,7 +238,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
236
238
  "bg-[var(--dropdown-menu-selected-bg)] text-[var(--dropdown-menu-selected-text)] typography-subtitle5":
237
239
  selectedOption?.value === option.value,
238
240
  },
239
- optionItemClassName
241
+ optionItemClassName,
240
242
  ),
241
243
  })}
242
244
  </Fragment>
@@ -263,7 +265,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
263
265
  key="not-found"
264
266
  className={cn(
265
267
  "px-4 py-14 text-center text-input-text",
266
- optionNotFoundItemClassName
268
+ optionNotFoundItemClassName,
267
269
  )}
268
270
  >
269
271
  Not found
@@ -286,7 +288,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
286
288
  className={cn(
287
289
  "absolute mt-1 w-full max-h-60 overflow-y-auto",
288
290
  !usePortal && (isAbove ? "bottom-full mb-1" : "top-full mt-1"),
289
- optionContainerClassName
291
+ optionContainerClassName,
290
292
  )}
291
293
  style={dropdownStyles}
292
294
  />
@@ -298,14 +300,14 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
298
300
  setIsFocused(true);
299
301
  props?.onFocus?.(e);
300
302
  },
301
- [props?.onFocus]
303
+ [props?.onFocus],
302
304
  );
303
305
 
304
306
  const clearMismatchValue = useCallback(
305
307
  (e: React.FocusEvent<HTMLInputElement, Element>) => {
306
308
  const matchSelectedValue = optionsFiltered.find(
307
309
  (opt) =>
308
- opt.value === e.target?.value || opt.label === e.target?.value
310
+ opt.value === e.target?.value || opt.label === e.target?.value,
309
311
  );
310
312
  const isMatchSelectedValue = !!matchSelectedValue;
311
313
 
@@ -329,7 +331,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
329
331
  setTextValue(option.label);
330
332
  onSelect?.(option);
331
333
  },
332
- [optionsFiltered, textValue]
334
+ [optionsFiltered, textValue],
333
335
  );
334
336
 
335
337
  const handleOnBlur = useCallback(
@@ -338,7 +340,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
338
340
  clearMismatchValue(e);
339
341
  props?.onBlur?.(e);
340
342
  },
341
- [props?.onBlur, clearMismatchValue]
343
+ [props?.onBlur, clearMismatchValue],
342
344
  );
343
345
 
344
346
  const handleOnKeyDown = useCallback(
@@ -346,7 +348,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
346
348
  keyCode.current = e.code;
347
349
  props?.onKeyDown?.(e);
348
350
  },
349
- [props?.onKeyDown]
351
+ [props?.onKeyDown],
350
352
  );
351
353
 
352
354
  return (
@@ -377,7 +379,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
377
379
  id={_id}
378
380
  disabled={disabled}
379
381
  size={size}
380
- className={customInputVariant({ size })}
382
+ className={segmentedInput ? customInputVariant({ size }) : undefined}
381
383
  onFocus={handleOnFocus}
382
384
  onBlur={handleOnBlur}
383
385
  onKeyDown={handleOnKeyDown}
@@ -392,7 +394,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
392
394
  ))}
393
395
  </div>
394
396
  );
395
- }
397
+ },
396
398
  );
397
399
 
398
400
  export default Dropdown;
@@ -52,7 +52,7 @@ const DropdownMenuSubContent = React.forwardRef<
52
52
  <DropdownMenuPrimitive.SubContent
53
53
  ref={ref}
54
54
  className={cn(
55
- "z-50 min-w-[154px] overflow-hidden rounded-md bg-base-popup text-base-popup-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
55
+ "z-50 min-w-[154px] overflow-hidden rounded-md bg-modal-surface text-text-contrast-low data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
56
56
  className
57
57
  )}
58
58
  {...props}
@@ -74,7 +74,7 @@ const DropdownMenuContent = React.forwardRef<
74
74
  ref={ref}
75
75
  sideOffset={sideOffset}
76
76
  className={cn(
77
- "z-50 min-w-[154px] overflow-hidden rounded-md bg-base-popup text-base-popup-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
77
+ "z-50 min-w-[154px] overflow-hidden rounded-md bg-modal-surface text-text-contrast-low data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
78
78
  className
79
79
  )}
80
80
  {...props}
@@ -174,7 +174,7 @@ const DropdownMenuLabel = React.forwardRef<
174
174
  <DropdownMenuPrimitive.Label
175
175
  ref={ref}
176
176
  className={cn(
177
- "px-3 py-2 typography-small4 text-text-grey-medium",
177
+ "px-3 py-2 typography-small4 text-text-g-contrast-medium",
178
178
  inset && "pl-8",
179
179
  className
180
180
  )}
@@ -27,19 +27,19 @@ export const VerticalScroll: Story = {
27
27
  <div className="flex gap-2">
28
28
  <button
29
29
  onClick={() => setSelected("item-5")}
30
- className="px-3 py-1 bg-primary text-white rounded"
30
+ className="px-3 py-1 bg-primary text-state-primary-text-solid rounded"
31
31
  >
32
32
  Scroll to Item 5
33
33
  </button>
34
34
  <button
35
35
  onClick={() => setSelected("item-20")}
36
- className="px-3 py-1 bg-primary text-white rounded"
36
+ className="px-3 py-1 bg-primary text-state-primary-text-solid rounded"
37
37
  >
38
38
  Scroll to Item 20
39
39
  </button>
40
40
  <button
41
41
  onClick={() => setSelected("item-29")}
42
- className="px-3 py-1 bg-primary text-white rounded"
42
+ className="px-3 py-1 bg-primary text-state-primary-text-solid rounded"
43
43
  >
44
44
  Scroll to Item 30
45
45
  </button>
@@ -51,8 +51,8 @@ export const VerticalScroll: Story = {
51
51
  key={`item-${index + 1}`}
52
52
  className={`px-4 py-2 ${
53
53
  selected === `item-${index + 1}`
54
- ? "bg-secondary text-secondary-foreground"
55
- : "bg-white"
54
+ ? "bg-secondary text-state-secondary-text-solid"
55
+ : "bg-bg-bg1"
56
56
  }`}
57
57
  >
58
58
  {item}
@@ -76,19 +76,19 @@ export const HorizontalScroll: Story = {
76
76
  <div className="flex gap-2">
77
77
  <button
78
78
  onClick={() => setSelected("item-5")}
79
- className="px-3 py-1 bg-primary text-white rounded"
79
+ className="px-3 py-1 bg-primary text-state-primary-text-solid rounded"
80
80
  >
81
81
  Scroll to Item 5
82
82
  </button>
83
83
  <button
84
84
  onClick={() => setSelected("item-15")}
85
- className="px-3 py-1 bg-primary text-white rounded"
85
+ className="px-3 py-1 bg-primary text-state-primary-text-solid rounded"
86
86
  >
87
87
  Scroll to Item 15
88
88
  </button>
89
89
  <button
90
90
  onClick={() => setSelected("item-25")}
91
- className="px-3 py-1 bg-primary text-white rounded"
91
+ className="px-3 py-1 bg-primary text-state-primary-text-solid rounded"
92
92
  >
93
93
  Scroll to Item 25
94
94
  </button>
@@ -100,8 +100,8 @@ export const HorizontalScroll: Story = {
100
100
  key={`item-${index + 1}`}
101
101
  className={`inline-block w-28 h-12 mx-2 text-center leading-[3rem] rounded ${
102
102
  selected === `item-${index + 1}`
103
- ? "bg-secondary text-secondary-foreground"
104
- : "bg-gray-200"
103
+ ? "bg-secondary text-state-secondary-text-solid"
104
+ : "bg-transparent-grey2-16"
105
105
  }`}
106
106
  >
107
107
  {item}