@ultraviolet/ui 1.47.0 → 1.48.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.
- package/dist/index.d.ts +127 -3
- package/dist/src/components/Checkbox/index.js +4 -2
- package/dist/src/components/MenuV2/index.js +2 -2
- package/dist/src/components/SelectInput/index.js +1 -0
- package/dist/src/components/SelectInputV2/Dropdown.js +595 -0
- package/dist/src/components/SelectInputV2/DropdownOption.js +135 -0
- package/dist/src/components/SelectInputV2/SearchBarDropdown.js +119 -0
- package/dist/src/components/SelectInputV2/SelectBar.js +269 -0
- package/dist/src/components/SelectInputV2/SelectInputProvider.js +153 -0
- package/dist/src/components/SelectInputV2/index.js +138 -0
- package/dist/src/components/SelectInputV2/types.js +11 -0
- package/dist/src/components/TextInputV2/index.js +4 -2
- package/dist/src/index.js +1 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1567,7 +1567,7 @@ type CheckboxProps = {
|
|
|
1567
1567
|
required?: boolean;
|
|
1568
1568
|
'data-testid'?: string;
|
|
1569
1569
|
tooltip?: string;
|
|
1570
|
-
} & Pick<InputHTMLAttributes<HTMLInputElement>, 'onFocus' | 'onBlur' | 'name' | 'value' | 'autoFocus' | 'id' | 'onChange'> & XOR<[
|
|
1570
|
+
} & Pick<InputHTMLAttributes<HTMLInputElement>, 'onFocus' | 'onBlur' | 'name' | 'value' | 'autoFocus' | 'id' | 'onChange' | 'tabIndex'> & XOR<[
|
|
1571
1571
|
{
|
|
1572
1572
|
/**
|
|
1573
1573
|
* **`children` or `aria-label` property is required**
|
|
@@ -2468,6 +2468,7 @@ type OptionComponent = (props: Partial<OptionProps<SelectOption> & SelectOption>
|
|
|
2468
2468
|
/**
|
|
2469
2469
|
* SelectInput component is a wrapper around [react-select](https://react-select.com) component.
|
|
2470
2470
|
* It provides a styled select input with a label and an error message.
|
|
2471
|
+
* @deprecated use SelectInputV2 component instead
|
|
2471
2472
|
*/
|
|
2472
2473
|
declare const SelectInput: ForwardRefExoticComponent<Partial<SelectInputProps>> & {
|
|
2473
2474
|
Option: OptionComponent;
|
|
@@ -3097,7 +3098,7 @@ declare const TextInputV2: react.ForwardRefExoticComponent<{
|
|
|
3097
3098
|
tooltip?: string | undefined;
|
|
3098
3099
|
type?: "text" | "email" | "password" | "url" | undefined;
|
|
3099
3100
|
value?: string | undefined;
|
|
3100
|
-
} & Pick<InputHTMLAttributes<HTMLInputElement>, "autoFocus" | "id" | "tabIndex" | "aria-label" | "aria-labelledby" | "onFocus" | "onBlur" | "name" | "disabled" | "autoComplete" | "placeholder" | "readOnly" | "required"> & react.RefAttributes<HTMLInputElement>>;
|
|
3101
|
+
} & Pick<InputHTMLAttributes<HTMLInputElement>, "autoFocus" | "id" | "tabIndex" | "aria-label" | "aria-labelledby" | "onFocus" | "onBlur" | "onKeyDown" | "name" | "disabled" | "autoComplete" | "placeholder" | "readOnly" | "required"> & react.RefAttributes<HTMLInputElement>>;
|
|
3101
3102
|
|
|
3102
3103
|
declare const schedules: {
|
|
3103
3104
|
half: readonly ["00:00", "00:30", "01:00", "01:30", "02:00", "02:30", "03:00", "03:30", "04:00", "04:30", "05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00", "18:30", "19:00", "19:30", "20:00", "20:30", "21:00", "21:30", "22:00", "22:30", "23:00", "23:30"];
|
|
@@ -3430,6 +3431,129 @@ declare const SelectableCardGroup: {
|
|
|
3430
3431
|
Card: ({ value, disabled, children, className, isError, onFocus, onBlur, tooltip, id, label, "data-testid": dataTestId, }: CardSelectableCardProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
3431
3432
|
};
|
|
3432
3433
|
|
|
3434
|
+
type OptionType = {
|
|
3435
|
+
value: string;
|
|
3436
|
+
label: ReactNode;
|
|
3437
|
+
disabled: boolean;
|
|
3438
|
+
description?: string;
|
|
3439
|
+
optionalInfo?: ReactNode;
|
|
3440
|
+
searchText?: string;
|
|
3441
|
+
};
|
|
3442
|
+
type DataType = Record<string, OptionType[]> | OptionType[];
|
|
3443
|
+
|
|
3444
|
+
type SelectInputV2Props = {
|
|
3445
|
+
/**
|
|
3446
|
+
* Input name
|
|
3447
|
+
*/
|
|
3448
|
+
name: string;
|
|
3449
|
+
/**
|
|
3450
|
+
* Default value, must be one of the options
|
|
3451
|
+
*/
|
|
3452
|
+
value?: OptionType;
|
|
3453
|
+
/**
|
|
3454
|
+
* Place holder when no value defined
|
|
3455
|
+
*/
|
|
3456
|
+
placeholder?: string;
|
|
3457
|
+
/**
|
|
3458
|
+
* When searchable, placeholder when no value is searched
|
|
3459
|
+
*/
|
|
3460
|
+
placeholderSearch?: string;
|
|
3461
|
+
/**
|
|
3462
|
+
* Label of the component
|
|
3463
|
+
*/
|
|
3464
|
+
label?: string;
|
|
3465
|
+
/**
|
|
3466
|
+
* Helper text to give more information to the user
|
|
3467
|
+
*/
|
|
3468
|
+
helper?: string;
|
|
3469
|
+
/**
|
|
3470
|
+
* Selectable options
|
|
3471
|
+
*/
|
|
3472
|
+
options: DataType;
|
|
3473
|
+
/**
|
|
3474
|
+
* Message to show when no option available
|
|
3475
|
+
*/
|
|
3476
|
+
emptyState?: ReactNode;
|
|
3477
|
+
/**
|
|
3478
|
+
* Whether it is possible to search through the input
|
|
3479
|
+
*/
|
|
3480
|
+
searchable?: boolean;
|
|
3481
|
+
/**
|
|
3482
|
+
* Whether the component in disabled
|
|
3483
|
+
*/
|
|
3484
|
+
disabled?: boolean;
|
|
3485
|
+
/**
|
|
3486
|
+
* Whether the component in readOnly
|
|
3487
|
+
*/
|
|
3488
|
+
readOnly?: boolean;
|
|
3489
|
+
/**
|
|
3490
|
+
* Whether it is possible to clear the search input
|
|
3491
|
+
*/
|
|
3492
|
+
clearable?: boolean;
|
|
3493
|
+
/**
|
|
3494
|
+
* Size of the input
|
|
3495
|
+
*/
|
|
3496
|
+
size?: 'small' | 'medium' | 'large';
|
|
3497
|
+
/**
|
|
3498
|
+
* Whether it is possible to select multiple options
|
|
3499
|
+
*/
|
|
3500
|
+
multiselect?: boolean;
|
|
3501
|
+
/**
|
|
3502
|
+
* Whether field is required
|
|
3503
|
+
*/
|
|
3504
|
+
required?: boolean;
|
|
3505
|
+
/**
|
|
3506
|
+
* More information regarding/description ofs the selectInput
|
|
3507
|
+
*/
|
|
3508
|
+
labelDescription?: ReactNode;
|
|
3509
|
+
/**
|
|
3510
|
+
* Whether option description is on the right of the option or under it
|
|
3511
|
+
*/
|
|
3512
|
+
descriptionDirection?: 'row' | 'column';
|
|
3513
|
+
/**
|
|
3514
|
+
* Where to place the additional info prop
|
|
3515
|
+
*/
|
|
3516
|
+
optionalInfoPlacement?: 'left' | 'right';
|
|
3517
|
+
/**
|
|
3518
|
+
* To add custom fixed elements at the bottom of the dropdown
|
|
3519
|
+
*/
|
|
3520
|
+
footer?: ReactNode;
|
|
3521
|
+
/**
|
|
3522
|
+
* Display an error message under the select bar
|
|
3523
|
+
*/
|
|
3524
|
+
error?: string;
|
|
3525
|
+
/**
|
|
3526
|
+
* Display a success message under the select bar
|
|
3527
|
+
*/
|
|
3528
|
+
success?: string;
|
|
3529
|
+
/**
|
|
3530
|
+
* Load more button to implement lazy loading
|
|
3531
|
+
*/
|
|
3532
|
+
loadMore?: ReactNode;
|
|
3533
|
+
/**
|
|
3534
|
+
* When the options are loading, display a skeleton
|
|
3535
|
+
*/
|
|
3536
|
+
isLoading?: boolean;
|
|
3537
|
+
/**
|
|
3538
|
+
* Adds an option to select every selectable options
|
|
3539
|
+
*/
|
|
3540
|
+
selectAll?: {
|
|
3541
|
+
label: ReactNode;
|
|
3542
|
+
description?: string;
|
|
3543
|
+
};
|
|
3544
|
+
/**
|
|
3545
|
+
* When options are group, define a option to select every selectable options of a group
|
|
3546
|
+
*/
|
|
3547
|
+
selectAllGroup?: boolean;
|
|
3548
|
+
autofocus?: boolean;
|
|
3549
|
+
'data-testid'?: string;
|
|
3550
|
+
onChange?: (value: string[]) => void;
|
|
3551
|
+
} & Pick<HTMLAttributes<HTMLDivElement>, 'id' | 'onBlur' | 'onFocus' | 'aria-label' | 'className'>;
|
|
3552
|
+
/**
|
|
3553
|
+
* SelectInputV2 component is used to select one or many elements from a selection.
|
|
3554
|
+
*/
|
|
3555
|
+
declare const SelectInputV2: ({ name, id, onBlur, onFocus, onChange, "aria-label": ariaLabel, value, label, helper, options, size, emptyState, descriptionDirection, success, error, "data-testid": dataTestId, className, footer, placeholderSearch, placeholder, searchable, disabled, readOnly, clearable, multiselect, required, labelDescription, autofocus, loadMore, optionalInfoPlacement, isLoading, selectAll, selectAllGroup, }: SelectInputV2Props) => _emotion_react_jsx_runtime.JSX.Element;
|
|
3556
|
+
|
|
3433
3557
|
declare const getUUID: (prefix?: string) => string;
|
|
3434
3558
|
|
|
3435
3559
|
declare const bounce: _emotion_react.Keyframes;
|
|
@@ -3473,4 +3597,4 @@ declare const down: (size: ScreenSize, rules: string) => string;
|
|
|
3473
3597
|
|
|
3474
3598
|
declare const normalize: () => string;
|
|
3475
3599
|
|
|
3476
|
-
export { ActionBar, Alert, Avatar, Badge, Banner, BarChart, BarStack, Breadcrumbs, Breakpoint, Bullet, Button, Card, Carousel, Checkbox, CheckboxGroup, CheckboxGroupCheckbox, CopyButton, DateInput, EmptyState, Expandable, GlobalAlert, LineChart, Link, List, Loader, Menu, MenuV2, Meter, Modal, Notice, NotificationContainer, NumberInput, NumberInputV2, Pagination, PasswordCheck, PasswordStrengthMeter, PieChart, Popover, Popup, ProgressBar, Radio, RadioGroup, Row, type SCWUITheme, SelectInput, SelectableCard, SelectableCardGroup, Separator, Skeleton, Snippet, Stack, Status, StepList, Stepper, SwitchButton, Table, Tabs, Tag, TagInput, TagList, Text, TextArea, TextInput, TextInputV2, TimeInput, ToastContainer, Toggle, ToggleGroup, Tooltip, type UltravioletUITheme, VerificationCode, bounce, down, extendTheme, fadeIn, fadeOut, flash, getUUID, normalize, notification, ping, pulse, quickScaleDown, scaleBack, scaleDown, scaleForward, scaleUp, sketchIn, sketchOut, slideDownLarge, slideFromBottom, slideFromLeft, slideFromRight, slideFromTop, slideToBottom, slideToLeft, slideToRight, slideToTop, slideUpLarge, toast, unfoldIn, unfoldOut, up, zoomIn, zoomOut };
|
|
3600
|
+
export { ActionBar, Alert, Avatar, Badge, Banner, BarChart, BarStack, Breadcrumbs, Breakpoint, Bullet, Button, Card, Carousel, Checkbox, CheckboxGroup, CheckboxGroupCheckbox, CopyButton, DateInput, EmptyState, Expandable, GlobalAlert, LineChart, Link, List, Loader, Menu, MenuV2, Meter, Modal, Notice, NotificationContainer, NumberInput, NumberInputV2, Pagination, PasswordCheck, PasswordStrengthMeter, PieChart, Popover, Popup, ProgressBar, Radio, RadioGroup, Row, type SCWUITheme, SelectInput, SelectInputV2, SelectableCard, SelectableCardGroup, Separator, Skeleton, Snippet, Stack, Status, StepList, Stepper, SwitchButton, Table, Tabs, Tag, TagInput, TagList, Text, TextArea, TextInput, TextInputV2, TimeInput, ToastContainer, Toggle, ToggleGroup, Tooltip, type UltravioletUITheme, VerificationCode, bounce, down, extendTheme, fadeIn, fadeOut, flash, getUUID, normalize, notification, ping, pulse, quickScaleDown, scaleBack, scaleDown, scaleForward, scaleUp, sketchIn, sketchOut, slideDownLarge, slideFromBottom, slideFromLeft, slideFromRight, slideFromTop, slideToBottom, slideToLeft, slideToRight, slideToTop, slideUpLarge, toast, unfoldIn, unfoldOut, up, zoomIn, zoomOut };
|
|
@@ -210,7 +210,8 @@ const Checkbox = /*#__PURE__*/forwardRef(({
|
|
|
210
210
|
'aria-label': ariaLabel,
|
|
211
211
|
required,
|
|
212
212
|
'data-testid': dataTestId,
|
|
213
|
-
tooltip
|
|
213
|
+
tooltip,
|
|
214
|
+
tabIndex
|
|
214
215
|
}, ref) => {
|
|
215
216
|
const [state, setState] = useState(checked);
|
|
216
217
|
const uniqId = useId();
|
|
@@ -253,7 +254,8 @@ const Checkbox = /*#__PURE__*/forwardRef(({
|
|
|
253
254
|
name: name,
|
|
254
255
|
autoFocus: autoFocus,
|
|
255
256
|
ref: ref,
|
|
256
|
-
required: required
|
|
257
|
+
required: required,
|
|
258
|
+
tabIndex: tabIndex
|
|
257
259
|
}), !progress ? jsx(StyledIcon, {
|
|
258
260
|
size: size,
|
|
259
261
|
viewBox: "0 0 24 24",
|
|
@@ -27,7 +27,7 @@ const StyledPopup = /*#__PURE__*/_styled(Popup, {
|
|
|
27
27
|
}) => `${theme.space['0.25']} 0`, ";");
|
|
28
28
|
const MenuList = /*#__PURE__*/_styled(Stack, {
|
|
29
29
|
target: "e1jn11gg0"
|
|
30
|
-
})("
|
|
30
|
+
})("overflow-y:auto;overflow-x:hidden;&:after,&:before{border:solid transparent;border-width:9px;content:' ';height:0;width:0;position:absolute;pointer-events:none;}&:after{border-color:transparent;}&:before{border-color:transparent;}background-color:", ({
|
|
31
31
|
theme
|
|
32
32
|
}) => theme.colors.neutral.backgroundWeakElevated, ";color:", ({
|
|
33
33
|
theme
|
|
@@ -86,7 +86,7 @@ const FwdMenu = /*#__PURE__*/forwardRef(({
|
|
|
86
86
|
ref: popupRef,
|
|
87
87
|
onClose: () => setIsVisible(false),
|
|
88
88
|
tabIndex: -1,
|
|
89
|
-
maxHeight: maxHeight,
|
|
89
|
+
maxHeight: maxHeight ?? '480px',
|
|
90
90
|
maxWidth: maxWidth,
|
|
91
91
|
size: size,
|
|
92
92
|
text: jsx(MenuList, {
|
|
@@ -598,6 +598,7 @@ const FwdSelectInput = ({
|
|
|
598
598
|
/**
|
|
599
599
|
* SelectInput component is a wrapper around [react-select](https://react-select.com) component.
|
|
600
600
|
* It provides a styled select input with a label and an error message.
|
|
601
|
+
* @deprecated use SelectInputV2 component instead
|
|
601
602
|
*/
|
|
602
603
|
const SelectInput = /*#__PURE__*/forwardRef((props, ref) => jsx(FwdSelectInput, {
|
|
603
604
|
innerRef: ref,
|