@bubo-squared/ui-framework 0.2.21 → 0.2.22
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.
- package/dist/index.cjs +53 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -35
- package/dist/index.d.ts +42 -35
- package/dist/index.js +53 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -137,8 +137,8 @@ type BadgeVariant = "primary" | "secondary" | "informal" | "success" | "warning"
|
|
|
137
137
|
type BadgeSize = "sm" | "md" | "lg" | "xl";
|
|
138
138
|
interface BadgeProps extends VariantProps<typeof badgeVariants> {
|
|
139
139
|
asChild?: boolean;
|
|
140
|
-
label:
|
|
141
|
-
value?:
|
|
140
|
+
label: React$1.ReactNode;
|
|
141
|
+
value?: React$1.ReactNode;
|
|
142
142
|
className?: string;
|
|
143
143
|
size?: BadgeSize;
|
|
144
144
|
variant?: BadgeVariant;
|
|
@@ -168,7 +168,7 @@ interface BadgeDotProps extends VariantProps<typeof badgeDotVariants> {
|
|
|
168
168
|
declare const BadgeDot: React$1.FC<BadgeDotProps>;
|
|
169
169
|
|
|
170
170
|
interface BadgeStatusProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
171
|
-
label:
|
|
171
|
+
label: React$1.ReactNode;
|
|
172
172
|
active?: boolean;
|
|
173
173
|
dotClassName?: string;
|
|
174
174
|
}
|
|
@@ -184,7 +184,7 @@ interface BaseDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
184
184
|
/** Size variant for the divider (affects line thickness + center element sizing). */
|
|
185
185
|
size?: DividerSize;
|
|
186
186
|
/** Label shown for text variant (e.g. "OR"). */
|
|
187
|
-
label?:
|
|
187
|
+
label?: React$1.ReactNode;
|
|
188
188
|
}
|
|
189
189
|
type ButtonVariant = ButtonProps$1["variant"];
|
|
190
190
|
type IconButtonVariant = ButtonProps["variant"];
|
|
@@ -211,7 +211,7 @@ interface ButtonLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement>
|
|
|
211
211
|
/** Size variant for the divider (affects line thickness + button size). */
|
|
212
212
|
size?: DividerSize;
|
|
213
213
|
/** Text inside the button between the lines. */
|
|
214
|
-
buttonLabel:
|
|
214
|
+
buttonLabel: React$1.ReactNode;
|
|
215
215
|
/** onClick handler for the button between the lines. */
|
|
216
216
|
onButtonClick: React$1.MouseEventHandler<HTMLButtonElement>;
|
|
217
217
|
/** Variant for the button between the lines. */
|
|
@@ -235,9 +235,11 @@ interface ProgressProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "ch
|
|
|
235
235
|
/** Current value, from 0 to 100. */
|
|
236
236
|
value: number;
|
|
237
237
|
/** Optional label shown above the bar. */
|
|
238
|
-
label?:
|
|
238
|
+
label?: React$1.ReactNode;
|
|
239
239
|
/** Optional hint text shown below the bar. */
|
|
240
|
-
hint?:
|
|
240
|
+
hint?: React$1.ReactNode;
|
|
241
|
+
/** Optional accessible label for the progressbar (string-only). */
|
|
242
|
+
ariaLabel?: string;
|
|
241
243
|
/** Controls whether the progress percentage label is rendered. */
|
|
242
244
|
showProgressLabel?: boolean;
|
|
243
245
|
/** If true, the hint will not be rendered even if provided. */
|
|
@@ -263,8 +265,8 @@ declare const tagVariants: (props?: ({
|
|
|
263
265
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
264
266
|
interface TagProps extends VariantProps<typeof tagVariants> {
|
|
265
267
|
asChild?: boolean;
|
|
266
|
-
label:
|
|
267
|
-
value?:
|
|
268
|
+
label: React$1.ReactNode;
|
|
269
|
+
value?: React$1.ReactNode;
|
|
268
270
|
className?: string;
|
|
269
271
|
leadingIcon?: React$1.ReactElement<{
|
|
270
272
|
disabled?: boolean;
|
|
@@ -327,15 +329,15 @@ declare const MenuSubTrigger: typeof DropdownMenuSubTrigger;
|
|
|
327
329
|
interface CheckboxProps extends React$1.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
328
330
|
/** Only needed when the component is a part of a native form. */
|
|
329
331
|
name?: string;
|
|
330
|
-
label?:
|
|
332
|
+
label?: React$1.ReactNode;
|
|
331
333
|
}
|
|
332
334
|
declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
333
335
|
|
|
334
336
|
type TextInputSize = "sm" | "md" | "lg" | "xl";
|
|
335
337
|
type TextInputStatus = "default" | "success" | "error";
|
|
336
338
|
interface TextInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled"> {
|
|
337
|
-
label?:
|
|
338
|
-
hint?:
|
|
339
|
+
label?: React$1.ReactNode;
|
|
340
|
+
hint?: React$1.ReactNode;
|
|
339
341
|
/**
|
|
340
342
|
* If true, the hint will not be rendered even if provided.
|
|
341
343
|
*/
|
|
@@ -355,8 +357,8 @@ interface TextInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEleme
|
|
|
355
357
|
declare const TextInput: React$1.ForwardRefExoticComponent<TextInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
356
358
|
|
|
357
359
|
interface AutocompleteProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled" | "value" | "defaultValue" | "onChange"> {
|
|
358
|
-
label?:
|
|
359
|
-
hint?:
|
|
360
|
+
label?: React$1.ReactNode;
|
|
361
|
+
hint?: React$1.ReactNode;
|
|
360
362
|
/** If true, the hint will not be rendered even if provided. */
|
|
361
363
|
hideHint?: boolean;
|
|
362
364
|
status?: TextInputStatus;
|
|
@@ -377,6 +379,11 @@ interface AutocompleteProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEl
|
|
|
377
379
|
inputValue?: string;
|
|
378
380
|
defaultInputValue?: string;
|
|
379
381
|
onInputChange?: (value: string) => void;
|
|
382
|
+
/**
|
|
383
|
+
* If true, free-typed input is also treated as the committed value.
|
|
384
|
+
* Selecting an option from the dropdown still overrides the value.
|
|
385
|
+
*/
|
|
386
|
+
freeSolo?: boolean;
|
|
380
387
|
/** Optional className for the dropdown (options container). */
|
|
381
388
|
dropdownClassName?: string;
|
|
382
389
|
/** Optional className for the listbox (<ul>). */
|
|
@@ -386,7 +393,7 @@ declare const Autocomplete: React$1.ForwardRefExoticComponent<AutocompleteProps
|
|
|
386
393
|
|
|
387
394
|
type SelectStatus = "default" | "success" | "error";
|
|
388
395
|
interface SelectOption {
|
|
389
|
-
label:
|
|
396
|
+
label: React$1.ReactNode;
|
|
390
397
|
value: string;
|
|
391
398
|
}
|
|
392
399
|
declare const selectTriggerVariants: (props?: ({
|
|
@@ -394,8 +401,8 @@ declare const selectTriggerVariants: (props?: ({
|
|
|
394
401
|
status?: "error" | "success" | "default" | null | undefined;
|
|
395
402
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
396
403
|
interface SelectProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "onChange">, VariantProps<typeof selectTriggerVariants> {
|
|
397
|
-
label?:
|
|
398
|
-
hint?:
|
|
404
|
+
label?: React$1.ReactNode;
|
|
405
|
+
hint?: React$1.ReactNode;
|
|
399
406
|
/**
|
|
400
407
|
* If true, the hint will not be rendered even if provided.
|
|
401
408
|
*/
|
|
@@ -419,9 +426,9 @@ declare const Select: React$1.ForwardRefExoticComponent<SelectProps & React$1.Re
|
|
|
419
426
|
|
|
420
427
|
type FieldStatus = "default" | "success" | "error";
|
|
421
428
|
interface FieldProps {
|
|
422
|
-
label?:
|
|
429
|
+
label?: React$1.ReactNode;
|
|
423
430
|
labelRight?: React$1.ReactNode;
|
|
424
|
-
hint?:
|
|
431
|
+
hint?: React$1.ReactNode;
|
|
425
432
|
/**
|
|
426
433
|
* If true, the hint will not be rendered even if provided.
|
|
427
434
|
*/
|
|
@@ -437,8 +444,8 @@ type PasswordInputSize = "sm" | "md" | "lg" | "xl";
|
|
|
437
444
|
type PasswordInputStatus = "default" | "success" | "error";
|
|
438
445
|
type PasswordInputVariant = "icon" | "text";
|
|
439
446
|
interface PasswordInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "disabled"> {
|
|
440
|
-
label?:
|
|
441
|
-
hint?:
|
|
447
|
+
label?: React$1.ReactNode;
|
|
448
|
+
hint?: React$1.ReactNode;
|
|
442
449
|
/**
|
|
443
450
|
* If true, the hint will not be rendered even if provided.
|
|
444
451
|
*/
|
|
@@ -461,8 +468,8 @@ type PhoneInputProps = Omit<React$1.ComponentProps<"input">, "onChange" | "value
|
|
|
461
468
|
onChange?: (value: RPNInput.Value) => void;
|
|
462
469
|
} & {
|
|
463
470
|
className?: string;
|
|
464
|
-
label?:
|
|
465
|
-
hint?:
|
|
471
|
+
label?: React$1.ReactNode;
|
|
472
|
+
hint?: React$1.ReactNode;
|
|
466
473
|
/**
|
|
467
474
|
* If true, the hint will not be rendered even if provided.
|
|
468
475
|
*/
|
|
@@ -482,12 +489,12 @@ declare const PhoneInput: React$1.ForwardRefExoticComponent<PhoneInputProps>;
|
|
|
482
489
|
type RadioGroupOrientation = "vertical" | "horizontal";
|
|
483
490
|
interface RadioGroupOption {
|
|
484
491
|
value: string;
|
|
485
|
-
label:
|
|
492
|
+
label: React$1.ReactNode;
|
|
486
493
|
disabled?: boolean;
|
|
487
494
|
}
|
|
488
495
|
interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProps, "children" | "orientation" | "onValueChange"> {
|
|
489
|
-
label?:
|
|
490
|
-
hint?:
|
|
496
|
+
label?: React$1.ReactNode;
|
|
497
|
+
hint?: React$1.ReactNode;
|
|
491
498
|
/** Only needed when the component is a part of a native form. */
|
|
492
499
|
name?: string;
|
|
493
500
|
/** Only needed when the component is a part of a native form. */
|
|
@@ -564,8 +571,8 @@ declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & React$1.Re
|
|
|
564
571
|
|
|
565
572
|
type TextAreaType = "responsive" | "character-limit" | "plain";
|
|
566
573
|
interface TextAreaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, "disabled"> {
|
|
567
|
-
label?:
|
|
568
|
-
hint?:
|
|
574
|
+
label?: React$1.ReactNode;
|
|
575
|
+
hint?: React$1.ReactNode;
|
|
569
576
|
/**
|
|
570
577
|
* If true, the hint will not be rendered even if provided.
|
|
571
578
|
*/
|
|
@@ -601,7 +608,7 @@ interface ToggleProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>
|
|
|
601
608
|
* Provide this to include the checked value in native form submission / FormData.
|
|
602
609
|
*/
|
|
603
610
|
name?: string;
|
|
604
|
-
label?:
|
|
611
|
+
label?: React$1.ReactNode;
|
|
605
612
|
}
|
|
606
613
|
declare const Toggle: React$1.ForwardRefExoticComponent<ToggleProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
607
614
|
|
|
@@ -627,9 +634,9 @@ declare const WebsiteInput: React$1.ForwardRefExoticComponent<WebsiteInputProps
|
|
|
627
634
|
type PopoverPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
|
|
628
635
|
interface PopoverProps {
|
|
629
636
|
children: React$1.ReactNode;
|
|
630
|
-
strapline?:
|
|
631
|
-
title:
|
|
632
|
-
description?:
|
|
637
|
+
strapline?: React$1.ReactNode;
|
|
638
|
+
title: React$1.ReactNode;
|
|
639
|
+
description?: React$1.ReactNode;
|
|
633
640
|
onOk?: () => void;
|
|
634
641
|
okText?: string;
|
|
635
642
|
onCancel?: () => void;
|
|
@@ -653,9 +660,9 @@ declare const Popover: React$1.FC<PopoverProps>;
|
|
|
653
660
|
type TooltipPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
|
|
654
661
|
interface TooltipProps {
|
|
655
662
|
children: React$1.ReactNode;
|
|
656
|
-
strapline?:
|
|
657
|
-
title:
|
|
658
|
-
description?:
|
|
663
|
+
strapline?: React$1.ReactNode;
|
|
664
|
+
title: React$1.ReactNode;
|
|
665
|
+
description?: React$1.ReactNode;
|
|
659
666
|
showArrow?: boolean;
|
|
660
667
|
className?: string;
|
|
661
668
|
placement?: TooltipPlacement;
|
package/dist/index.d.ts
CHANGED
|
@@ -137,8 +137,8 @@ type BadgeVariant = "primary" | "secondary" | "informal" | "success" | "warning"
|
|
|
137
137
|
type BadgeSize = "sm" | "md" | "lg" | "xl";
|
|
138
138
|
interface BadgeProps extends VariantProps<typeof badgeVariants> {
|
|
139
139
|
asChild?: boolean;
|
|
140
|
-
label:
|
|
141
|
-
value?:
|
|
140
|
+
label: React$1.ReactNode;
|
|
141
|
+
value?: React$1.ReactNode;
|
|
142
142
|
className?: string;
|
|
143
143
|
size?: BadgeSize;
|
|
144
144
|
variant?: BadgeVariant;
|
|
@@ -168,7 +168,7 @@ interface BadgeDotProps extends VariantProps<typeof badgeDotVariants> {
|
|
|
168
168
|
declare const BadgeDot: React$1.FC<BadgeDotProps>;
|
|
169
169
|
|
|
170
170
|
interface BadgeStatusProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
171
|
-
label:
|
|
171
|
+
label: React$1.ReactNode;
|
|
172
172
|
active?: boolean;
|
|
173
173
|
dotClassName?: string;
|
|
174
174
|
}
|
|
@@ -184,7 +184,7 @@ interface BaseDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
184
184
|
/** Size variant for the divider (affects line thickness + center element sizing). */
|
|
185
185
|
size?: DividerSize;
|
|
186
186
|
/** Label shown for text variant (e.g. "OR"). */
|
|
187
|
-
label?:
|
|
187
|
+
label?: React$1.ReactNode;
|
|
188
188
|
}
|
|
189
189
|
type ButtonVariant = ButtonProps$1["variant"];
|
|
190
190
|
type IconButtonVariant = ButtonProps["variant"];
|
|
@@ -211,7 +211,7 @@ interface ButtonLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement>
|
|
|
211
211
|
/** Size variant for the divider (affects line thickness + button size). */
|
|
212
212
|
size?: DividerSize;
|
|
213
213
|
/** Text inside the button between the lines. */
|
|
214
|
-
buttonLabel:
|
|
214
|
+
buttonLabel: React$1.ReactNode;
|
|
215
215
|
/** onClick handler for the button between the lines. */
|
|
216
216
|
onButtonClick: React$1.MouseEventHandler<HTMLButtonElement>;
|
|
217
217
|
/** Variant for the button between the lines. */
|
|
@@ -235,9 +235,11 @@ interface ProgressProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "ch
|
|
|
235
235
|
/** Current value, from 0 to 100. */
|
|
236
236
|
value: number;
|
|
237
237
|
/** Optional label shown above the bar. */
|
|
238
|
-
label?:
|
|
238
|
+
label?: React$1.ReactNode;
|
|
239
239
|
/** Optional hint text shown below the bar. */
|
|
240
|
-
hint?:
|
|
240
|
+
hint?: React$1.ReactNode;
|
|
241
|
+
/** Optional accessible label for the progressbar (string-only). */
|
|
242
|
+
ariaLabel?: string;
|
|
241
243
|
/** Controls whether the progress percentage label is rendered. */
|
|
242
244
|
showProgressLabel?: boolean;
|
|
243
245
|
/** If true, the hint will not be rendered even if provided. */
|
|
@@ -263,8 +265,8 @@ declare const tagVariants: (props?: ({
|
|
|
263
265
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
264
266
|
interface TagProps extends VariantProps<typeof tagVariants> {
|
|
265
267
|
asChild?: boolean;
|
|
266
|
-
label:
|
|
267
|
-
value?:
|
|
268
|
+
label: React$1.ReactNode;
|
|
269
|
+
value?: React$1.ReactNode;
|
|
268
270
|
className?: string;
|
|
269
271
|
leadingIcon?: React$1.ReactElement<{
|
|
270
272
|
disabled?: boolean;
|
|
@@ -327,15 +329,15 @@ declare const MenuSubTrigger: typeof DropdownMenuSubTrigger;
|
|
|
327
329
|
interface CheckboxProps extends React$1.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
328
330
|
/** Only needed when the component is a part of a native form. */
|
|
329
331
|
name?: string;
|
|
330
|
-
label?:
|
|
332
|
+
label?: React$1.ReactNode;
|
|
331
333
|
}
|
|
332
334
|
declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
333
335
|
|
|
334
336
|
type TextInputSize = "sm" | "md" | "lg" | "xl";
|
|
335
337
|
type TextInputStatus = "default" | "success" | "error";
|
|
336
338
|
interface TextInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled"> {
|
|
337
|
-
label?:
|
|
338
|
-
hint?:
|
|
339
|
+
label?: React$1.ReactNode;
|
|
340
|
+
hint?: React$1.ReactNode;
|
|
339
341
|
/**
|
|
340
342
|
* If true, the hint will not be rendered even if provided.
|
|
341
343
|
*/
|
|
@@ -355,8 +357,8 @@ interface TextInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEleme
|
|
|
355
357
|
declare const TextInput: React$1.ForwardRefExoticComponent<TextInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
356
358
|
|
|
357
359
|
interface AutocompleteProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled" | "value" | "defaultValue" | "onChange"> {
|
|
358
|
-
label?:
|
|
359
|
-
hint?:
|
|
360
|
+
label?: React$1.ReactNode;
|
|
361
|
+
hint?: React$1.ReactNode;
|
|
360
362
|
/** If true, the hint will not be rendered even if provided. */
|
|
361
363
|
hideHint?: boolean;
|
|
362
364
|
status?: TextInputStatus;
|
|
@@ -377,6 +379,11 @@ interface AutocompleteProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEl
|
|
|
377
379
|
inputValue?: string;
|
|
378
380
|
defaultInputValue?: string;
|
|
379
381
|
onInputChange?: (value: string) => void;
|
|
382
|
+
/**
|
|
383
|
+
* If true, free-typed input is also treated as the committed value.
|
|
384
|
+
* Selecting an option from the dropdown still overrides the value.
|
|
385
|
+
*/
|
|
386
|
+
freeSolo?: boolean;
|
|
380
387
|
/** Optional className for the dropdown (options container). */
|
|
381
388
|
dropdownClassName?: string;
|
|
382
389
|
/** Optional className for the listbox (<ul>). */
|
|
@@ -386,7 +393,7 @@ declare const Autocomplete: React$1.ForwardRefExoticComponent<AutocompleteProps
|
|
|
386
393
|
|
|
387
394
|
type SelectStatus = "default" | "success" | "error";
|
|
388
395
|
interface SelectOption {
|
|
389
|
-
label:
|
|
396
|
+
label: React$1.ReactNode;
|
|
390
397
|
value: string;
|
|
391
398
|
}
|
|
392
399
|
declare const selectTriggerVariants: (props?: ({
|
|
@@ -394,8 +401,8 @@ declare const selectTriggerVariants: (props?: ({
|
|
|
394
401
|
status?: "error" | "success" | "default" | null | undefined;
|
|
395
402
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
396
403
|
interface SelectProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "onChange">, VariantProps<typeof selectTriggerVariants> {
|
|
397
|
-
label?:
|
|
398
|
-
hint?:
|
|
404
|
+
label?: React$1.ReactNode;
|
|
405
|
+
hint?: React$1.ReactNode;
|
|
399
406
|
/**
|
|
400
407
|
* If true, the hint will not be rendered even if provided.
|
|
401
408
|
*/
|
|
@@ -419,9 +426,9 @@ declare const Select: React$1.ForwardRefExoticComponent<SelectProps & React$1.Re
|
|
|
419
426
|
|
|
420
427
|
type FieldStatus = "default" | "success" | "error";
|
|
421
428
|
interface FieldProps {
|
|
422
|
-
label?:
|
|
429
|
+
label?: React$1.ReactNode;
|
|
423
430
|
labelRight?: React$1.ReactNode;
|
|
424
|
-
hint?:
|
|
431
|
+
hint?: React$1.ReactNode;
|
|
425
432
|
/**
|
|
426
433
|
* If true, the hint will not be rendered even if provided.
|
|
427
434
|
*/
|
|
@@ -437,8 +444,8 @@ type PasswordInputSize = "sm" | "md" | "lg" | "xl";
|
|
|
437
444
|
type PasswordInputStatus = "default" | "success" | "error";
|
|
438
445
|
type PasswordInputVariant = "icon" | "text";
|
|
439
446
|
interface PasswordInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "disabled"> {
|
|
440
|
-
label?:
|
|
441
|
-
hint?:
|
|
447
|
+
label?: React$1.ReactNode;
|
|
448
|
+
hint?: React$1.ReactNode;
|
|
442
449
|
/**
|
|
443
450
|
* If true, the hint will not be rendered even if provided.
|
|
444
451
|
*/
|
|
@@ -461,8 +468,8 @@ type PhoneInputProps = Omit<React$1.ComponentProps<"input">, "onChange" | "value
|
|
|
461
468
|
onChange?: (value: RPNInput.Value) => void;
|
|
462
469
|
} & {
|
|
463
470
|
className?: string;
|
|
464
|
-
label?:
|
|
465
|
-
hint?:
|
|
471
|
+
label?: React$1.ReactNode;
|
|
472
|
+
hint?: React$1.ReactNode;
|
|
466
473
|
/**
|
|
467
474
|
* If true, the hint will not be rendered even if provided.
|
|
468
475
|
*/
|
|
@@ -482,12 +489,12 @@ declare const PhoneInput: React$1.ForwardRefExoticComponent<PhoneInputProps>;
|
|
|
482
489
|
type RadioGroupOrientation = "vertical" | "horizontal";
|
|
483
490
|
interface RadioGroupOption {
|
|
484
491
|
value: string;
|
|
485
|
-
label:
|
|
492
|
+
label: React$1.ReactNode;
|
|
486
493
|
disabled?: boolean;
|
|
487
494
|
}
|
|
488
495
|
interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProps, "children" | "orientation" | "onValueChange"> {
|
|
489
|
-
label?:
|
|
490
|
-
hint?:
|
|
496
|
+
label?: React$1.ReactNode;
|
|
497
|
+
hint?: React$1.ReactNode;
|
|
491
498
|
/** Only needed when the component is a part of a native form. */
|
|
492
499
|
name?: string;
|
|
493
500
|
/** Only needed when the component is a part of a native form. */
|
|
@@ -564,8 +571,8 @@ declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & React$1.Re
|
|
|
564
571
|
|
|
565
572
|
type TextAreaType = "responsive" | "character-limit" | "plain";
|
|
566
573
|
interface TextAreaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, "disabled"> {
|
|
567
|
-
label?:
|
|
568
|
-
hint?:
|
|
574
|
+
label?: React$1.ReactNode;
|
|
575
|
+
hint?: React$1.ReactNode;
|
|
569
576
|
/**
|
|
570
577
|
* If true, the hint will not be rendered even if provided.
|
|
571
578
|
*/
|
|
@@ -601,7 +608,7 @@ interface ToggleProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>
|
|
|
601
608
|
* Provide this to include the checked value in native form submission / FormData.
|
|
602
609
|
*/
|
|
603
610
|
name?: string;
|
|
604
|
-
label?:
|
|
611
|
+
label?: React$1.ReactNode;
|
|
605
612
|
}
|
|
606
613
|
declare const Toggle: React$1.ForwardRefExoticComponent<ToggleProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
607
614
|
|
|
@@ -627,9 +634,9 @@ declare const WebsiteInput: React$1.ForwardRefExoticComponent<WebsiteInputProps
|
|
|
627
634
|
type PopoverPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
|
|
628
635
|
interface PopoverProps {
|
|
629
636
|
children: React$1.ReactNode;
|
|
630
|
-
strapline?:
|
|
631
|
-
title:
|
|
632
|
-
description?:
|
|
637
|
+
strapline?: React$1.ReactNode;
|
|
638
|
+
title: React$1.ReactNode;
|
|
639
|
+
description?: React$1.ReactNode;
|
|
633
640
|
onOk?: () => void;
|
|
634
641
|
okText?: string;
|
|
635
642
|
onCancel?: () => void;
|
|
@@ -653,9 +660,9 @@ declare const Popover: React$1.FC<PopoverProps>;
|
|
|
653
660
|
type TooltipPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
|
|
654
661
|
interface TooltipProps {
|
|
655
662
|
children: React$1.ReactNode;
|
|
656
|
-
strapline?:
|
|
657
|
-
title:
|
|
658
|
-
description?:
|
|
663
|
+
strapline?: React$1.ReactNode;
|
|
664
|
+
title: React$1.ReactNode;
|
|
665
|
+
description?: React$1.ReactNode;
|
|
659
666
|
showArrow?: boolean;
|
|
660
667
|
className?: string;
|
|
661
668
|
placement?: TooltipPlacement;
|
package/dist/index.js
CHANGED
|
@@ -692,13 +692,14 @@ var Badge = React9.forwardRef(
|
|
|
692
692
|
...rest
|
|
693
693
|
} = props;
|
|
694
694
|
const Comp = asChild ? Slot5 : "div";
|
|
695
|
+
const hasValue = typeof value === "string" ? value.trim() !== "" : value != null;
|
|
695
696
|
return /* @__PURE__ */ jsx11(
|
|
696
697
|
Comp,
|
|
697
698
|
{
|
|
698
699
|
ref,
|
|
699
700
|
className: cn(badgeVariants({ size, variant }), className),
|
|
700
701
|
...rest,
|
|
701
|
-
children:
|
|
702
|
+
children: hasValue ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
702
703
|
/* @__PURE__ */ jsx11("span", { className: "font-normal", children: label }),
|
|
703
704
|
/* @__PURE__ */ jsx11("span", { className: "font-normal", children: ":" }),
|
|
704
705
|
/* @__PURE__ */ jsx11("span", { className: "font-medium", children: value })
|
|
@@ -879,7 +880,7 @@ var Divider = (props) => {
|
|
|
879
880
|
className: _className,
|
|
880
881
|
...divProps
|
|
881
882
|
} = props;
|
|
882
|
-
const textLabel = label
|
|
883
|
+
const textLabel = label ?? "OR";
|
|
883
884
|
return /* @__PURE__ */ jsxs8(
|
|
884
885
|
"div",
|
|
885
886
|
{
|
|
@@ -1027,13 +1028,15 @@ var Field = (props) => {
|
|
|
1027
1028
|
className,
|
|
1028
1029
|
children
|
|
1029
1030
|
} = props;
|
|
1031
|
+
const hasLabel = label != null;
|
|
1032
|
+
const hasHint = hint != null;
|
|
1030
1033
|
const fieldId = React14.useId();
|
|
1031
|
-
const labelId =
|
|
1032
|
-
const hintId =
|
|
1034
|
+
const labelId = hasLabel ? `${fieldId}-label` : void 0;
|
|
1035
|
+
const hintId = hasHint ? `${fieldId}-hint` : void 0;
|
|
1033
1036
|
const hintColorClass = disabled ? "text-primary-disabled" : status === "success" ? "text-(--color-success)" : status === "error" ? "text-(--color-error)" : "text-(--color-secondary)";
|
|
1034
1037
|
const labelColorClass = disabled ? "text-primary-disabled" : "text-primary";
|
|
1035
1038
|
return /* @__PURE__ */ jsxs9("div", { className: cn(fieldBase, className), children: [
|
|
1036
|
-
|
|
1039
|
+
hasLabel && /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between", children: [
|
|
1037
1040
|
/* @__PURE__ */ jsx16("label", { id: labelId, className: cn("paragraph-sm", labelColorClass), children: label }),
|
|
1038
1041
|
labelRight
|
|
1039
1042
|
] }),
|
|
@@ -1041,9 +1044,9 @@ var Field = (props) => {
|
|
|
1041
1044
|
!hideHint && /* @__PURE__ */ jsx16(
|
|
1042
1045
|
"p",
|
|
1043
1046
|
{
|
|
1044
|
-
id:
|
|
1045
|
-
className: cn("caption",
|
|
1046
|
-
children: hint
|
|
1047
|
+
id: hasHint ? hintId : void 0,
|
|
1048
|
+
className: cn("caption", hasHint ? hintColorClass : "invisible"),
|
|
1049
|
+
children: hasHint ? hint : "\xA0"
|
|
1047
1050
|
}
|
|
1048
1051
|
)
|
|
1049
1052
|
] });
|
|
@@ -1063,6 +1066,7 @@ var Progress = React15.forwardRef(
|
|
|
1063
1066
|
value,
|
|
1064
1067
|
label,
|
|
1065
1068
|
hint,
|
|
1069
|
+
ariaLabel,
|
|
1066
1070
|
showProgressLabel = true,
|
|
1067
1071
|
hideHint,
|
|
1068
1072
|
size = "lg",
|
|
@@ -1073,12 +1077,13 @@ var Progress = React15.forwardRef(
|
|
|
1073
1077
|
} = props;
|
|
1074
1078
|
const clamped = Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;
|
|
1075
1079
|
const percentageLabel = `${Math.round(clamped)}%`;
|
|
1080
|
+
const resolvedAriaLabel = ariaLabel ?? (typeof label === "string" ? label : void 0);
|
|
1076
1081
|
const barHeightClasses = sizeToBarClasses[size];
|
|
1077
1082
|
return /* @__PURE__ */ jsx17(
|
|
1078
1083
|
Field,
|
|
1079
1084
|
{
|
|
1080
1085
|
label,
|
|
1081
|
-
labelRight: showProgressLabel && label ? /* @__PURE__ */ jsx17("span", { className: "footnote text-(--color-secondary)", children: percentageLabel }) : void 0,
|
|
1086
|
+
labelRight: showProgressLabel && label != null ? /* @__PURE__ */ jsx17("span", { className: "footnote text-(--color-secondary)", children: percentageLabel }) : void 0,
|
|
1082
1087
|
hint,
|
|
1083
1088
|
hideHint,
|
|
1084
1089
|
status,
|
|
@@ -1092,7 +1097,7 @@ var Progress = React15.forwardRef(
|
|
|
1092
1097
|
"aria-valuenow": clamped,
|
|
1093
1098
|
"aria-valuemin": 0,
|
|
1094
1099
|
"aria-valuemax": 100,
|
|
1095
|
-
"aria-label":
|
|
1100
|
+
"aria-label": resolvedAriaLabel,
|
|
1096
1101
|
...rest,
|
|
1097
1102
|
children: /* @__PURE__ */ jsx17(
|
|
1098
1103
|
"div",
|
|
@@ -1199,7 +1204,7 @@ import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
|
1199
1204
|
import { cva as cva11 } from "class-variance-authority";
|
|
1200
1205
|
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1201
1206
|
var tagVariants = cva11(
|
|
1202
|
-
"inline-flex flex-row items-center justify-center rounded-6 gap-2 px-3 overflow-hidden border-1 border-(--border-secondary) bg-(--background-neutral)
|
|
1207
|
+
"inline-flex flex-row items-center justify-center rounded-6 gap-2 px-3 overflow-hidden border-1 border-(--border-secondary) bg-(--background-neutral) focus:border-(--border-brand) focus-ring-primary ",
|
|
1203
1208
|
{
|
|
1204
1209
|
variants: {
|
|
1205
1210
|
size: {
|
|
@@ -1225,6 +1230,7 @@ var Tag = React17.forwardRef(
|
|
|
1225
1230
|
value,
|
|
1226
1231
|
...rest
|
|
1227
1232
|
} = props;
|
|
1233
|
+
const hasValue = typeof value === "string" ? value.trim() !== "" : value != null;
|
|
1228
1234
|
const Comp = asChild ? Slot6 : "div";
|
|
1229
1235
|
const leading = props.leadingIcon && React17.isValidElement(props.leadingIcon) ? React17.cloneElement(props.leadingIcon, { disabled, ...props.leadingIcon.props }) : null;
|
|
1230
1236
|
const trailing = props.trailingIcon && React17.isValidElement(props.trailingIcon) ? React17.cloneElement(props.trailingIcon, { disabled, ...props.trailingIcon.props }) : null;
|
|
@@ -1236,7 +1242,7 @@ var Tag = React17.forwardRef(
|
|
|
1236
1242
|
...rest,
|
|
1237
1243
|
children: [
|
|
1238
1244
|
leading && /* @__PURE__ */ jsx19("div", { className: iconClasses, children: leading }),
|
|
1239
|
-
|
|
1245
|
+
hasValue ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-row gap-1 items-center", children: [
|
|
1240
1246
|
/* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: label }),
|
|
1241
1247
|
/* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: ":" }),
|
|
1242
1248
|
/* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg-medium mb-0! cursor-default font-medium", children: value })
|
|
@@ -1694,6 +1700,7 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1694
1700
|
inputValue,
|
|
1695
1701
|
defaultInputValue,
|
|
1696
1702
|
onInputChange,
|
|
1703
|
+
freeSolo = false,
|
|
1697
1704
|
dropdownClassName,
|
|
1698
1705
|
listboxClassName,
|
|
1699
1706
|
placeholder = "Search\u2026",
|
|
@@ -1744,6 +1751,12 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1744
1751
|
}
|
|
1745
1752
|
onInputChange?.(next);
|
|
1746
1753
|
};
|
|
1754
|
+
const commitTypedValue = (next) => {
|
|
1755
|
+
if (!isValueControlled) {
|
|
1756
|
+
setInternalValue(next);
|
|
1757
|
+
}
|
|
1758
|
+
onChange?.(next);
|
|
1759
|
+
};
|
|
1747
1760
|
const commitValue = (next) => {
|
|
1748
1761
|
if (!isValueControlled) {
|
|
1749
1762
|
setInternalValue(next);
|
|
@@ -1760,6 +1773,9 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1760
1773
|
const next = event.target.value;
|
|
1761
1774
|
setInputText(next);
|
|
1762
1775
|
setActiveIndex(-1);
|
|
1776
|
+
if (freeSolo) {
|
|
1777
|
+
commitTypedValue(next);
|
|
1778
|
+
}
|
|
1763
1779
|
};
|
|
1764
1780
|
const handleFocus = (event) => {
|
|
1765
1781
|
setIsFocused(true);
|
|
@@ -1768,6 +1784,12 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1768
1784
|
const handleBlur = (event) => {
|
|
1769
1785
|
setIsFocused(false);
|
|
1770
1786
|
setActiveIndex(-1);
|
|
1787
|
+
if (freeSolo) {
|
|
1788
|
+
const trimmed = currentInput.trim();
|
|
1789
|
+
if (trimmed.length > 0 && currentInput !== currentValue) {
|
|
1790
|
+
commitTypedValue(currentInput);
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1771
1793
|
onBlur?.(event);
|
|
1772
1794
|
};
|
|
1773
1795
|
const handleKeyDown = (event) => {
|
|
@@ -1801,6 +1823,17 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1801
1823
|
event.preventDefault();
|
|
1802
1824
|
commitValue(options[activeIndex]);
|
|
1803
1825
|
setIsFocused(false);
|
|
1826
|
+
break;
|
|
1827
|
+
}
|
|
1828
|
+
if (freeSolo) {
|
|
1829
|
+
const trimmed = currentInput.trim();
|
|
1830
|
+
if (trimmed.length > 0) {
|
|
1831
|
+
event.preventDefault();
|
|
1832
|
+
if (currentInput !== currentValue) {
|
|
1833
|
+
commitTypedValue(currentInput);
|
|
1834
|
+
}
|
|
1835
|
+
setIsFocused(false);
|
|
1836
|
+
}
|
|
1804
1837
|
}
|
|
1805
1838
|
break;
|
|
1806
1839
|
}
|
|
@@ -3230,6 +3263,8 @@ var Tooltip = (props) => {
|
|
|
3230
3263
|
children,
|
|
3231
3264
|
delayDuration = 200
|
|
3232
3265
|
} = props;
|
|
3266
|
+
const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
|
|
3267
|
+
const hasDescription = typeof description === "string" ? description.trim() !== "" : description != null;
|
|
3233
3268
|
const { side, align } = mapPlacementToSideAndAlign(placement);
|
|
3234
3269
|
const tooltipClasses = "group bg-(--background-tooltip) max-w-[calc(100vw-2rem)] shadow-card-md border-none rounded-4 py-1.5 px-2.5 [&>span]:scale-200 data-[state=delayed-open]:animate-in data-[state=instant-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-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";
|
|
3235
3270
|
const tooltipArrowClasses = "relative fill-(--background-tooltip) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=bottom]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=right]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)]";
|
|
@@ -3253,9 +3288,9 @@ var Tooltip = (props) => {
|
|
|
3253
3288
|
children: [
|
|
3254
3289
|
showArrow && /* @__PURE__ */ jsx36(TooltipArrow, { className: tooltipArrowClasses }),
|
|
3255
3290
|
/* @__PURE__ */ jsxs24("div", { className: "grid", children: [
|
|
3256
|
-
|
|
3291
|
+
hasStrapline && /* @__PURE__ */ jsx36("span", { className: "caption text-secondary", children: strapline }),
|
|
3257
3292
|
/* @__PURE__ */ jsx36("h4", { className: "paragraph-md text-primary", children: title }),
|
|
3258
|
-
|
|
3293
|
+
hasDescription && /* @__PURE__ */ jsx36("p", { className: "paragraph-sm text-primary", children: description })
|
|
3259
3294
|
] })
|
|
3260
3295
|
]
|
|
3261
3296
|
}
|
|
@@ -4162,6 +4197,8 @@ var Popover2 = (props) => {
|
|
|
4162
4197
|
offset = 10,
|
|
4163
4198
|
children
|
|
4164
4199
|
} = props;
|
|
4200
|
+
const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
|
|
4201
|
+
const hasDescription = typeof description === "string" ? description.trim() !== "" : description != null;
|
|
4165
4202
|
const [open, setOpen] = React40.useState(false);
|
|
4166
4203
|
const handleCancel = () => {
|
|
4167
4204
|
onCancel?.();
|
|
@@ -4217,9 +4254,9 @@ var Popover2 = (props) => {
|
|
|
4217
4254
|
showArrow && /* @__PURE__ */ jsx42(PopoverArrow, { className: popoverArrowClasses }),
|
|
4218
4255
|
/* @__PURE__ */ jsxs30("div", { className: "grid gap-4", children: [
|
|
4219
4256
|
/* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
|
|
4220
|
-
/* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
|
|
4257
|
+
hasStrapline && /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
|
|
4221
4258
|
/* @__PURE__ */ jsx42("h4", { className: "subtitle-medium text-primary", children: title }),
|
|
4222
|
-
/* @__PURE__ */ jsx42("p", { className: "paragraph-sm text-primary", children: description })
|
|
4259
|
+
hasDescription && /* @__PURE__ */ jsx42("p", { className: "paragraph-sm text-primary", children: description })
|
|
4223
4260
|
] }),
|
|
4224
4261
|
/* @__PURE__ */ jsxs30("div", { className: "flex justify-start items-center gap-4 flex-wrap", children: [
|
|
4225
4262
|
/* @__PURE__ */ jsx42(Button, { size: "sm", variant: "secondary", onClick: handleCancel, children: cancelText || "Cancel" }),
|