paris 0.17.9 → 0.18.0

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 (81) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +139 -150
  3. package/src/helpers/renderEnhancer.tsx +4 -5
  4. package/src/helpers/useResizeObserver.ts +17 -23
  5. package/src/pages/_document.tsx +1 -3
  6. package/src/pages/index.tsx +8 -24
  7. package/src/stories/Pagination.mdx +1 -1
  8. package/src/stories/Tokens.mdx +1 -1
  9. package/src/stories/Welcome.mdx +1 -1
  10. package/src/stories/accordion/Accordion.stories.ts +1 -1
  11. package/src/stories/accordion/Accordion.tsx +14 -35
  12. package/src/stories/accordionselect/AccordionSelect.stories.ts +2 -5
  13. package/src/stories/accordionselect/AccordionSelect.tsx +26 -50
  14. package/src/stories/avatar/Avatar.stories.ts +1 -1
  15. package/src/stories/avatar/Avatar.tsx +14 -13
  16. package/src/stories/button/Button.stories.ts +18 -15
  17. package/src/stories/button/Button.tsx +44 -48
  18. package/src/stories/callout/Callout.stories.ts +3 -7
  19. package/src/stories/callout/Callout.tsx +4 -8
  20. package/src/stories/card/Card.stories.ts +1 -1
  21. package/src/stories/card/Card.tsx +4 -11
  22. package/src/stories/cardbutton/CardButton.stories.tsx +1 -1
  23. package/src/stories/cardbutton/CardButton.tsx +16 -18
  24. package/src/stories/checkbox/Checkbox.stories.ts +1 -1
  25. package/src/stories/checkbox/Checkbox.tsx +37 -49
  26. package/src/stories/combobox/Combobox.stories.ts +65 -71
  27. package/src/stories/combobox/Combobox.tsx +80 -89
  28. package/src/stories/dialog/Dialog.stories.tsx +2 -2
  29. package/src/stories/dialog/Dialog.tsx +45 -68
  30. package/src/stories/drawer/Drawer.stories.tsx +63 -105
  31. package/src/stories/drawer/Drawer.tsx +93 -90
  32. package/src/stories/field/Field.stories.ts +1 -1
  33. package/src/stories/field/Field.tsx +25 -30
  34. package/src/stories/icon/Ellipsis.tsx +4 -1
  35. package/src/stories/icon/Icon.stories.ts +2 -2
  36. package/src/stories/icon/Icon.tsx +16 -26
  37. package/src/stories/icon/Info.tsx +4 -1
  38. package/src/stories/icon/Spinner.tsx +4 -2
  39. package/src/stories/icon/index.ts +6 -6
  40. package/src/stories/informationaltooltip/InformationalTooltip.stories.tsx +12 -11
  41. package/src/stories/informationaltooltip/InformationalTooltip.tsx +23 -28
  42. package/src/stories/input/Input.stories.ts +14 -15
  43. package/src/stories/input/Input.tsx +119 -95
  44. package/src/stories/markdown/Markdown.module.scss +384 -0
  45. package/src/stories/markdown/Markdown.stories.ts +203 -0
  46. package/src/stories/markdown/Markdown.tsx +293 -0
  47. package/src/stories/markdown/index.ts +1 -0
  48. package/src/stories/menu/Menu.module.scss +9 -0
  49. package/src/stories/menu/Menu.stories.tsx +4 -10
  50. package/src/stories/menu/Menu.tsx +27 -29
  51. package/src/stories/pagination/usePagination.ts +8 -8
  52. package/src/stories/popover/Popover.stories.ts +2 -2
  53. package/src/stories/popover/Popover.tsx +4 -10
  54. package/src/stories/select/Select.stories.ts +10 -10
  55. package/src/stories/select/Select.tsx +268 -240
  56. package/src/stories/styledlink/StyledLink.stories.ts +1 -1
  57. package/src/stories/styledlink/StyledLink.tsx +11 -17
  58. package/src/stories/table/Table.stories.ts +1 -1
  59. package/src/stories/table/Table.tsx +55 -65
  60. package/src/stories/tabs/Tabs.stories.tsx +2 -2
  61. package/src/stories/tabs/Tabs.tsx +15 -21
  62. package/src/stories/tag/Tag.stories.ts +1 -4
  63. package/src/stories/tag/Tag.tsx +9 -17
  64. package/src/stories/text/Text.stories.ts +1 -1
  65. package/src/stories/text/Text.tsx +49 -31
  66. package/src/stories/text/Typography.module.css +120 -120
  67. package/src/stories/textarea/TextArea.stories.ts +2 -5
  68. package/src/stories/textarea/TextArea.tsx +91 -84
  69. package/src/stories/theme/index.ts +1 -1
  70. package/src/stories/theme/themes.ts +423 -424
  71. package/src/stories/theme/tokens.ts +3 -3
  72. package/src/stories/theme/tw-preflight.css +4 -3
  73. package/src/stories/tilt/Tilt.stories.tsx +3 -6
  74. package/src/stories/tilt/Tilt.tsx +160 -126
  75. package/src/stories/toast/Toast.stories.tsx +2 -2
  76. package/src/stories/toast/Toast.tsx +3 -6
  77. package/src/stories/utility/RemoveFromDOM.tsx +9 -13
  78. package/src/stories/utility/TextWhenString.tsx +3 -16
  79. package/src/stories/utility/VisuallyHidden.tsx +10 -17
  80. package/src/styles/Home.module.css +185 -195
  81. package/src/styles/globals.css +0 -2
@@ -1,33 +1,37 @@
1
1
  'use client';
2
2
 
3
- import type {
4
- CSSProperties, ComponentPropsWithoutRef, ForwardedRef, ReactNode,
5
- } from 'react';
6
- import { forwardRef, useId } from 'react';
3
+ import { faChevronDown } from '@fortawesome/free-solid-svg-icons';
4
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
7
5
  import {
8
- Listbox, ListboxButton, ListboxOptions, ListboxOption, RadioGroup, Radio, Transition,
6
+ Listbox,
7
+ ListboxButton,
8
+ ListboxOption,
9
+ ListboxOptions,
10
+ Radio,
11
+ RadioGroup,
12
+ Transition,
9
13
  } from '@headlessui/react';
10
14
  import { clsx } from 'clsx';
11
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
12
- import { faChevronDown } from '@fortawesome/free-solid-svg-icons';
13
15
  import { motion } from 'framer-motion';
16
+ import type { ComponentPropsWithoutRef, CSSProperties, ForwardedRef, ReactNode } from 'react';
17
+ import { forwardRef, useId } from 'react';
18
+ import { MemoizedEnhancer } from '../../helpers/renderEnhancer';
19
+ import { Field } from '../field';
20
+ import { Check, Icon } from '../icon';
21
+ import type { InputProps } from '../input';
14
22
  import inputStyles from '../input/Input.module.scss';
15
- import dropdownStyles from '../utility/Dropdown.module.scss';
16
- import styles from './Select.module.scss';
17
23
  import type { TextProps } from '../text';
18
24
  import { Text } from '../text';
19
- import type { InputProps } from '../input';
20
- import { MemoizedEnhancer } from '../../helpers/renderEnhancer';
21
25
  import { pget, theme } from '../theme';
22
- import { Field } from '../field';
23
26
  import { TextWhenString } from '../utility';
24
- import { Check, Icon } from '../icon';
27
+ import dropdownStyles from '../utility/Dropdown.module.scss';
28
+ import styles from './Select.module.scss';
25
29
 
26
30
  export type Option<T = Record<string, any>> = {
27
- id: string,
28
- node: ReactNode,
29
- disabled?: boolean,
30
- metadata?: T,
31
+ id: string;
32
+ node: ReactNode;
33
+ disabled?: boolean;
34
+ metadata?: T;
31
35
  };
32
36
  export type CommonSelectProps<T = Record<string, any>> = {
33
37
  /**
@@ -64,7 +68,7 @@ export type CommonSelectProps<T = Record<string, any>> = {
64
68
  description?: TextProps<'p'>;
65
69
  startEnhancerContainer?: ComponentPropsWithoutRef<'div'>;
66
70
  endEnhancerContainer?: ComponentPropsWithoutRef<'div'>;
67
- }
71
+ };
68
72
  } & Omit<InputProps, 'type' | 'overrides'>;
69
73
 
70
74
  export type SingleSelectProps<T = Record<string, any>> = {
@@ -97,7 +101,7 @@ export type MultiSelectProps<T = Record<string, any>> = {
97
101
  * The visual variant of the Select. For multiselect, only `listbox` is supported.
98
102
  * @default listbox
99
103
  */
100
- kind?: 'listbox',
104
+ kind?: 'listbox';
101
105
  /**
102
106
  * Converts the single select into a multiselect.
103
107
  */
@@ -112,8 +116,7 @@ export type MultiSelectProps<T = Record<string, any>> = {
112
116
  onChange?: (value: Option<T>['id'][] | null) => void | Promise<void>;
113
117
  } & CommonSelectProps;
114
118
 
115
- type SelectProps<T = Record<string, any>> = | (SingleSelectProps<T>)
116
- | (MultiSelectProps<T>);
119
+ type SelectProps<T = Record<string, any>> = SingleSelectProps<T> | MultiSelectProps<T>;
117
120
 
118
121
  /**
119
122
  * A Select component is used to render a `select` box.
@@ -127,233 +130,258 @@ type SelectProps<T = Record<string, any>> = | (SingleSelectProps<T>)
127
130
  * ```
128
131
  * @constructor
129
132
  */
130
- export const Select = forwardRef(<T = Record<string, any>>({
131
- options,
132
- value,
133
- onChange,
134
- label,
135
- status,
136
- hideLabel,
137
- description,
138
- hideDescription,
139
- descriptionPosition,
140
- placeholder,
141
- startEnhancer,
142
- endEnhancer,
143
- disabled,
144
- kind = 'listbox',
145
- maxHeight = 320,
146
- hasOptionBorder = false,
147
- multiple = false,
148
- multipleItemsName,
149
- segmentedHeight = 'compact',
150
- overrides,
151
- }: SelectProps<T>, ref: ForwardedRef<any>) => {
152
- const inputID = useId();
153
- const multiItems = multipleItemsName || 'items';
133
+ export const Select = forwardRef(
134
+ <T = Record<string, any>>(
135
+ {
136
+ options,
137
+ value,
138
+ onChange,
139
+ label,
140
+ status,
141
+ hideLabel,
142
+ description,
143
+ hideDescription,
144
+ descriptionPosition,
145
+ placeholder,
146
+ startEnhancer,
147
+ endEnhancer,
148
+ disabled,
149
+ kind = 'listbox',
150
+ maxHeight = 320,
151
+ hasOptionBorder = false,
152
+ multiple = false,
153
+ multipleItemsName,
154
+ segmentedHeight = 'compact',
155
+ overrides,
156
+ }: SelectProps<T>,
157
+ ref: ForwardedRef<any>,
158
+ ) => {
159
+ const inputID = useId();
160
+ const multiItems = multipleItemsName || 'items';
154
161
 
155
- // TypeScript can't track discriminated union correlation through destructuring and JSX conditionals.
156
- // For Listbox: supports both single and multi via overloads, needs explicit union types
157
- // For RadioGroup: only supports single-select, needs narrowed types
158
- const listboxValue = value as string | string[] | null | undefined;
159
- const listboxOnChange = onChange as ((value: string | string[] | null) => void) | undefined;
160
- const singleValue = value as string | null | undefined;
161
- const singleOnChange = onChange as ((value: string | null) => void) | undefined;
162
- const buttonText = () => {
163
- if (!value || value.length === 0) {
164
- return placeholder || 'Select an option';
165
- } if (!multiple) {
166
- return options?.find((o) => o.id === value)?.node;
167
- } if (value && value.length === 1) {
168
- return options?.find((o) => o.id === value[0])?.node;
169
- } if (value.length === options.length) {
170
- return `All ${multiItems}`;
171
- }
172
- return `${value.length} ${multiItems}`;
173
- };
174
- return (
175
- <Field
176
- htmlFor={inputID}
177
- label={label}
178
- hideLabel={hideLabel}
179
- description={description}
180
- hideDescription={hideDescription}
181
- descriptionPosition={descriptionPosition}
182
- disabled={disabled}
183
- overrides={{
184
- container: overrides?.container,
185
- label: overrides?.label,
186
- description: overrides?.description,
187
- }}
188
- >
189
- {kind === 'listbox' && (
190
- <Listbox
191
- as="div"
192
- ref={ref}
193
- value={listboxValue}
194
- onChange={listboxOnChange}
195
- multiple={multiple}
196
- >
197
- <ListboxButton
198
- id={inputID}
199
- {...overrides?.selectInput}
200
- aria-disabled={disabled}
201
- data-status={disabled ? 'disabled' : (status || 'default')}
202
- className={clsx(
203
- overrides?.selectInput?.className,
204
- inputStyles.inputContainer,
205
- styles.listboxButton,
206
- styles.field,
207
- )}
208
- >
209
- {!!startEnhancer && (
210
- <div
211
- {...overrides?.startEnhancerContainer}
212
- className={clsx(inputStyles.enhancer, overrides?.startEnhancerContainer?.className)}
213
- data-status={disabled ? 'disabled' : (status || 'default')}
214
- >
215
- {!!startEnhancer && (
216
- <MemoizedEnhancer
217
- enhancer={startEnhancer}
218
- size={parseInt(pget('typography.styles.paragraphSmall.fontSize') || theme.typography.styles.paragraphSmall.fontSize, 10)}
219
- />
220
- )}
221
- </div>
222
- )}
223
- {buttonText()}
224
- {endEnhancer ? (
225
- <div
226
- {...overrides?.endEnhancerContainer}
227
- className={clsx(inputStyles.enhancer, overrides?.endEnhancerContainer?.className)}
228
- data-status={disabled ? 'disabled' : (status || 'default')}
229
- >
230
- {!!endEnhancer && (
231
- <MemoizedEnhancer
232
- enhancer={endEnhancer}
233
- size={parseInt(pget('typography.styles.paragraphSmall.fontSize') || theme.typography.styles.paragraphSmall.fontSize, 10)}
234
- />
235
- )}
236
- </div>
237
- ) : (
238
- <FontAwesomeIcon className={clsx(inputStyles.enhancer, styles.chevron)} data-status={disabled ? 'disabled' : (status || 'default')} width="10px" icon={faChevronDown} />
239
- )}
240
- </ListboxButton>
241
- <Transition
242
- as="div"
243
- className={dropdownStyles.transitionContainer}
244
- enter={dropdownStyles.transition}
245
- enterFrom={dropdownStyles.enterFrom}
246
- enterTo={dropdownStyles.enterTo}
247
- leave={dropdownStyles.transition}
248
- leaveFrom={dropdownStyles.leaveFrom}
249
- leaveTo={dropdownStyles.leaveTo}
250
- >
251
- <ListboxOptions
162
+ // TypeScript can't track discriminated union correlation through destructuring and JSX conditionals.
163
+ // For Listbox: supports both single and multi via overloads, needs explicit union types
164
+ // For RadioGroup: only supports single-select, needs narrowed types
165
+ const listboxValue = value as string | string[] | null | undefined;
166
+ const listboxOnChange = onChange as ((value: string | string[] | null) => void) | undefined;
167
+ const singleValue = value as string | null | undefined;
168
+ const singleOnChange = onChange as ((value: string | null) => void) | undefined;
169
+ const buttonText = () => {
170
+ if (!value || value.length === 0) {
171
+ return placeholder || 'Select an option';
172
+ }
173
+ if (!multiple) {
174
+ return options?.find((o) => o.id === value)?.node;
175
+ }
176
+ if (value && value.length === 1) {
177
+ return options?.find((o) => o.id === value[0])?.node;
178
+ }
179
+ if (value.length === options.length) {
180
+ return `All ${multiItems}`;
181
+ }
182
+ return `${value.length} ${multiItems}`;
183
+ };
184
+ return (
185
+ <Field
186
+ htmlFor={inputID}
187
+ label={label}
188
+ hideLabel={hideLabel}
189
+ description={description}
190
+ hideDescription={hideDescription}
191
+ descriptionPosition={descriptionPosition}
192
+ disabled={disabled}
193
+ overrides={{
194
+ container: overrides?.container,
195
+ label: overrides?.label,
196
+ description: overrides?.description,
197
+ }}
198
+ >
199
+ {kind === 'listbox' && (
200
+ <Listbox as="div" ref={ref} value={listboxValue} onChange={listboxOnChange} multiple={multiple}>
201
+ <ListboxButton
202
+ id={inputID}
203
+ {...overrides?.selectInput}
204
+ aria-disabled={disabled}
205
+ data-status={disabled ? 'disabled' : status || 'default'}
252
206
  className={clsx(
253
- overrides?.optionsContainer,
254
- styles.options,
207
+ overrides?.selectInput?.className,
208
+ inputStyles.inputContainer,
209
+ styles.listboxButton,
210
+ styles.field,
255
211
  )}
256
- style={{
257
- '--options-maxHeight': `${maxHeight}px`,
258
- } as CSSProperties}
259
212
  >
260
- {(options || []).map((option) => (
261
- <ListboxOption
262
- key={option.id}
263
- value={option.id}
264
- className={clsx(
265
- overrides?.option,
266
- styles.option,
267
- hasOptionBorder && styles.optionBorder,
213
+ {!!startEnhancer && (
214
+ <div
215
+ {...overrides?.startEnhancerContainer}
216
+ className={clsx(inputStyles.enhancer, overrides?.startEnhancerContainer?.className)}
217
+ data-status={disabled ? 'disabled' : status || 'default'}
218
+ >
219
+ {!!startEnhancer && (
220
+ <MemoizedEnhancer
221
+ enhancer={startEnhancer}
222
+ size={parseInt(
223
+ pget('typography.styles.paragraphSmall.fontSize') ||
224
+ theme.typography.styles.paragraphSmall.fontSize,
225
+ 10,
226
+ )}
227
+ />
268
228
  )}
269
- disabled={option.disabled || false}
229
+ </div>
230
+ )}
231
+ {buttonText()}
232
+ {endEnhancer ? (
233
+ <div
234
+ {...overrides?.endEnhancerContainer}
235
+ className={clsx(inputStyles.enhancer, overrides?.endEnhancerContainer?.className)}
236
+ data-status={disabled ? 'disabled' : status || 'default'}
270
237
  >
271
- {typeof option.node === 'string' ? (
272
- <Text as="span" kind="paragraphSmall">
273
- {option.node}
274
- </Text>
275
- ) : option.node}
276
- <Icon icon={Check} size={12} className={styles.check} />
277
- </ListboxOption>
278
- ))}
279
- </ListboxOptions>
280
- </Transition>
281
- </Listbox>
282
- )}
283
- {kind === 'radio' && (
284
- <RadioGroup ref={ref} as="div" className={styles.radioContainer} value={singleValue} onChange={singleOnChange}>
285
- {options.map((option) => (
286
- <Radio
287
- as="div"
288
- className={clsx(
289
- styles.radioOption,
238
+ {!!endEnhancer && (
239
+ <MemoizedEnhancer
240
+ enhancer={endEnhancer}
241
+ size={parseInt(
242
+ pget('typography.styles.paragraphSmall.fontSize') ||
243
+ theme.typography.styles.paragraphSmall.fontSize,
244
+ 10,
245
+ )}
246
+ />
247
+ )}
248
+ </div>
249
+ ) : (
250
+ <FontAwesomeIcon
251
+ className={clsx(inputStyles.enhancer, styles.chevron)}
252
+ data-status={disabled ? 'disabled' : status || 'default'}
253
+ width="10px"
254
+ icon={faChevronDown}
255
+ />
290
256
  )}
291
- key={option.id}
292
- value={option.id}
293
- disabled={option.disabled || false}
294
- data-status={disabled ? 'disabled' : (status || 'default')}
295
- >
296
- <div className={styles.radioCircle} />
297
- <TextWhenString kind="paragraphXSmall">
298
- {option.node}
299
- </TextWhenString>
300
- </Radio>
301
- ))}
302
- </RadioGroup>
303
- )}
304
- {kind === 'card' && (
305
- <RadioGroup ref={ref} as="div" className={styles.cardContainer} value={singleValue} onChange={singleOnChange}>
306
- {options.map((option) => (
307
- <Radio
257
+ </ListboxButton>
258
+ <Transition
308
259
  as="div"
309
- className={clsx(
310
- styles.cardOption,
311
- )}
312
- key={option.id}
313
- value={option.id}
314
- disabled={option.disabled || false}
315
- data-status={disabled ? 'disabled' : (status || 'default')}
260
+ className={dropdownStyles.transitionContainer}
261
+ enter={dropdownStyles.transition}
262
+ enterFrom={dropdownStyles.enterFrom}
263
+ enterTo={dropdownStyles.enterTo}
264
+ leave={dropdownStyles.transition}
265
+ leaveFrom={dropdownStyles.leaveFrom}
266
+ leaveTo={dropdownStyles.leaveTo}
316
267
  >
317
- <div className={clsx(styles.cardSurface, typeof option.node === 'string' && styles.text)}>
318
- <TextWhenString kind="paragraphSmall">
268
+ <ListboxOptions
269
+ className={clsx(overrides?.optionsContainer, styles.options)}
270
+ style={
271
+ {
272
+ '--options-maxHeight': `${maxHeight}px`,
273
+ } as CSSProperties
274
+ }
275
+ >
276
+ {(options || []).map((option) => (
277
+ <ListboxOption
278
+ key={option.id}
279
+ value={option.id}
280
+ className={clsx(
281
+ overrides?.option,
282
+ styles.option,
283
+ hasOptionBorder && styles.optionBorder,
284
+ )}
285
+ disabled={option.disabled || false}
286
+ >
287
+ {typeof option.node === 'string' ? (
288
+ <Text as="span" kind="paragraphSmall">
289
+ {option.node}
290
+ </Text>
291
+ ) : (
292
+ option.node
293
+ )}
294
+ <Icon icon={Check} size={12} className={styles.check} />
295
+ </ListboxOption>
296
+ ))}
297
+ </ListboxOptions>
298
+ </Transition>
299
+ </Listbox>
300
+ )}
301
+ {kind === 'radio' && (
302
+ <RadioGroup
303
+ ref={ref}
304
+ as="div"
305
+ className={styles.radioContainer}
306
+ value={singleValue}
307
+ onChange={singleOnChange}
308
+ >
309
+ {options.map((option) => (
310
+ <Radio
311
+ as="div"
312
+ className={clsx(styles.radioOption)}
313
+ key={option.id}
314
+ value={option.id}
315
+ disabled={option.disabled || false}
316
+ data-status={disabled ? 'disabled' : status || 'default'}
317
+ >
318
+ <div className={styles.radioCircle} />
319
+ <TextWhenString kind="paragraphXSmall">{option.node}</TextWhenString>
320
+ </Radio>
321
+ ))}
322
+ </RadioGroup>
323
+ )}
324
+ {kind === 'card' && (
325
+ <RadioGroup
326
+ ref={ref}
327
+ as="div"
328
+ className={styles.cardContainer}
329
+ value={singleValue}
330
+ onChange={singleOnChange}
331
+ >
332
+ {options.map((option) => (
333
+ <Radio
334
+ as="div"
335
+ className={clsx(styles.cardOption)}
336
+ key={option.id}
337
+ value={option.id}
338
+ disabled={option.disabled || false}
339
+ data-status={disabled ? 'disabled' : status || 'default'}
340
+ >
341
+ <div
342
+ className={clsx(styles.cardSurface, typeof option.node === 'string' && styles.text)}
343
+ >
344
+ <TextWhenString kind="paragraphSmall">{option.node}</TextWhenString>
345
+ </div>
346
+ </Radio>
347
+ ))}
348
+ </RadioGroup>
349
+ )}
350
+ {kind === 'segmented' && (
351
+ <RadioGroup
352
+ ref={ref}
353
+ as="div"
354
+ className={styles.segmentedContainer}
355
+ value={singleValue || options[0].id}
356
+ onChange={singleOnChange}
357
+ >
358
+ {options.map((option) => (
359
+ <Radio
360
+ as="div"
361
+ className={clsx(styles.segmentedOption, styles[segmentedHeight])}
362
+ key={option.id}
363
+ value={option.id}
364
+ disabled={option.disabled || false}
365
+ data-status={disabled ? 'disabled' : status || 'default'}
366
+ >
367
+ {(option.id === value || (!value && option.id === options[0].id)) && (
368
+ <motion.div
369
+ className={styles.segmentedBackground}
370
+ layoutId={`${inputID}-segmented-selected`}
371
+ transition={{
372
+ ease: [0.42, 0.0, 0.58, 1.0],
373
+ duration: 0.25,
374
+ }}
375
+ />
376
+ )}
377
+ <TextWhenString kind="paragraphXSmall" weight="medium" className={styles.segmentedText}>
319
378
  {option.node}
320
379
  </TextWhenString>
321
- </div>
322
- </Radio>
323
- ))}
324
- </RadioGroup>
325
- )}
326
- {kind === 'segmented' && (
327
- <RadioGroup ref={ref} as="div" className={styles.segmentedContainer} value={singleValue || options[0].id} onChange={singleOnChange}>
328
- {options.map((option) => (
329
- <Radio
330
- as="div"
331
- className={clsx(
332
- styles.segmentedOption,
333
- styles[segmentedHeight],
334
- )}
335
- key={option.id}
336
- value={option.id}
337
- disabled={option.disabled || false}
338
- data-status={disabled ? 'disabled' : (status || 'default')}
339
- >
340
- {(option.id === value || (!value && option.id === options[0].id)) && (
341
- <motion.div
342
- className={styles.segmentedBackground}
343
- layoutId={`${inputID}-segmented-selected`}
344
- transition={{
345
- ease: [0.42, 0.0, 0.58, 1.0],
346
- duration: 0.25,
347
- }}
348
- />
349
- )}
350
- <TextWhenString kind="paragraphXSmall" weight="medium" className={styles.segmentedText}>
351
- {option.node}
352
- </TextWhenString>
353
- </Radio>
354
- ))}
355
- </RadioGroup>
356
- )}
357
- </Field>
358
- );
359
- });
380
+ </Radio>
381
+ ))}
382
+ </RadioGroup>
383
+ )}
384
+ </Field>
385
+ );
386
+ },
387
+ );
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
2
  import { StyledLink } from './StyledLink';
3
3
 
4
4
  const meta: Meta<typeof StyledLink> = {
@@ -1,8 +1,6 @@
1
- import type {
2
- ComponentPropsWithoutRef, ElementType, FC, ReactNode,
3
- } from 'react';
4
- import { createElement } from 'react';
5
1
  import { clsx } from 'clsx';
2
+ import type { ComponentPropsWithoutRef, ElementType, FC, ReactNode } from 'react';
3
+ import { createElement } from 'react';
6
4
  import styles from './StyledLink.module.scss';
7
5
 
8
6
  export type StyledLinkProps<T extends ElementType = 'a'> = {
@@ -24,16 +22,12 @@ export type StyledLinkProps<T extends ElementType = 'a'> = {
24
22
  * ```
25
23
  * @constructor
26
24
  */
27
- export const StyledLink: FC<StyledLinkProps<ElementType>> = ({
28
- as = 'a',
29
- children,
30
- className,
31
- ...props
32
- }) => createElement(
33
- as,
34
- {
35
- ...props,
36
- className: clsx(className, styles.link),
37
- },
38
- children,
39
- );
25
+ export const StyledLink: FC<StyledLinkProps<ElementType>> = ({ as = 'a', children, className, ...props }) =>
26
+ createElement(
27
+ as,
28
+ {
29
+ ...props,
30
+ className: clsx(className, styles.link),
31
+ },
32
+ children,
33
+ );
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
2
  import type { TableProps } from './Table';
3
3
  import { Table } from './Table';
4
4