@digdir/designsystemet-react 1.0.0-rc.6 → 1.0.0-rc.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.
- package/dist/cjs/components/Button/Button.js +1 -1
- package/dist/cjs/components/Card/CardContent.js +1 -1
- package/dist/cjs/components/Card/CardFooter.js +1 -1
- package/dist/cjs/components/Card/CardHeader.js +1 -1
- package/dist/cjs/components/HelpText/HelpText.js +1 -1
- package/dist/cjs/components/Link/Link.js +1 -1
- package/dist/cjs/components/Tabs/Tabs.js +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +1 -1
- package/dist/cjs/components/Typography/ErrorMessage/ErrorMessage.js +1 -1
- package/dist/cjs/components/Typography/Paragraph/Paragraph.js +4 -1
- package/dist/cjs/components/form/Combobox/Custom.js +2 -2
- package/dist/cjs/components/form/Combobox/Empty.js +2 -2
- package/dist/cjs/components/form/Combobox/Option/Option.js +1 -1
- package/dist/cjs/components/form/Combobox/internal/ComboboxInput.js +7 -9
- package/dist/cjs/components/form/Combobox/useCombobox.js +5 -2
- package/dist/cjs/node_modules/@tanstack/virtual-core/dist/esm/index.js +77 -71
- package/dist/cjs/node_modules/@tanstack/virtual-core/dist/esm/utils.js +8 -0
- package/dist/esm/components/Button/Button.js +1 -1
- package/dist/esm/components/Card/CardContent.js +1 -1
- package/dist/esm/components/Card/CardFooter.js +1 -1
- package/dist/esm/components/Card/CardHeader.js +1 -1
- package/dist/esm/components/HelpText/HelpText.js +1 -1
- package/dist/esm/components/Link/Link.js +1 -1
- package/dist/esm/components/Tabs/Tabs.js +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +1 -1
- package/dist/esm/components/Typography/ErrorMessage/ErrorMessage.js +1 -1
- package/dist/esm/components/Typography/Paragraph/Paragraph.js +4 -1
- package/dist/esm/components/form/Combobox/Custom.js +2 -2
- package/dist/esm/components/form/Combobox/Empty.js +2 -2
- package/dist/esm/components/form/Combobox/Option/Option.js +1 -1
- package/dist/esm/components/form/Combobox/internal/ComboboxInput.js +7 -9
- package/dist/esm/components/form/Combobox/useCombobox.js +5 -2
- package/dist/esm/node_modules/@tanstack/virtual-core/dist/esm/index.js +78 -73
- package/dist/esm/node_modules/@tanstack/virtual-core/dist/esm/utils.js +8 -1
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/HelpText/HelpText.d.ts.map +1 -1
- package/dist/types/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/components/Typography/Paragraph/Paragraph.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/Option/Option.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/internal/ComboboxInput.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/useCombobox.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -11,7 +11,7 @@ var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
|
|
|
11
11
|
*/
|
|
12
12
|
const Button = React.forwardRef(({ children, variant = 'primary', color = 'accent', fullWidth = false, icon = false, type = 'button', size = 'md', asChild, className, ...rest }, ref) => {
|
|
13
13
|
const Component = asChild ? index.Slot : 'button';
|
|
14
|
-
return (jsxRuntime.jsx(Component, { ref: ref, type: type, className: lite.clsx('ds-btn', `ds-focus`, `ds-btn--${size}`, `ds-btn--${variant}`, `ds-btn--${color}`, fullWidth && 'ds-btn--full-width', icon && 'ds-btn--icon-only', className), ...rest, children: children }));
|
|
14
|
+
return (jsxRuntime.jsx(Component, { ref: ref, type: type, className: lite.clsx('ds-btn', `ds-focus`, `ds-btn--${size}`, `ds-paragraph-short--${size}`, `ds-btn--${variant}`, `ds-btn--${color}`, fullWidth && 'ds-btn--full-width', icon && 'ds-btn--icon-only', className), ...rest, children: children }));
|
|
15
15
|
});
|
|
16
16
|
Button.displayName = 'Button';
|
|
17
17
|
|
|
@@ -8,7 +8,7 @@ var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
|
|
|
8
8
|
|
|
9
9
|
const CardContent = React.forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
10
10
|
const Component = asChild ? index.Slot : 'div';
|
|
11
|
-
return (jsxRuntime.jsx(Component, { className: lite.clsx(`ds-card__content`, className), ref: ref, ...rest }));
|
|
11
|
+
return (jsxRuntime.jsx(Component, { className: lite.clsx(`ds-card__content`, `ds-paragraph--md`, className), ref: ref, ...rest }));
|
|
12
12
|
});
|
|
13
13
|
CardContent.displayName = 'CardContent';
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
|
|
|
8
8
|
|
|
9
9
|
const CardFooter = React.forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
10
10
|
const Component = asChild ? index.Slot : 'div';
|
|
11
|
-
return (jsxRuntime.jsx(Component, { className: lite.clsx(`ds-card__footer`, className), ref: ref, ...rest }));
|
|
11
|
+
return (jsxRuntime.jsx(Component, { className: lite.clsx(`ds-card__footer`, `ds-paragraph--md`, className), ref: ref, ...rest }));
|
|
12
12
|
});
|
|
13
13
|
CardFooter.displayName = 'CardFooter';
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
|
|
|
8
8
|
|
|
9
9
|
const CardHeader = React.forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
10
10
|
const Component = asChild ? index.Slot : 'div';
|
|
11
|
-
return (jsxRuntime.jsx(Component, { className: lite.clsx(`ds-card__header`, className), ref: ref, ...rest }));
|
|
11
|
+
return (jsxRuntime.jsx(Component, { className: lite.clsx(`ds-card__header`, `ds-heading--md`, className), ref: ref, ...rest }));
|
|
12
12
|
});
|
|
13
13
|
CardHeader.displayName = 'CardHeader';
|
|
14
14
|
|
|
@@ -9,7 +9,7 @@ var HelpTextIcon = require('./HelpTextIcon.js');
|
|
|
9
9
|
|
|
10
10
|
const HelpText = ({ title, placement = 'right', portal, size = 'md', className, children, ...rest }) => {
|
|
11
11
|
const [open, setOpen] = React.useState(false);
|
|
12
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(index.Popover, { variant: 'info', placement: placement, size: size, portal: portal, open: open, onClose: () => setOpen(false), children: [jsxRuntime.jsx(index.Popover.Trigger, { asChild: true, variant: 'tertiary', children: jsxRuntime.jsxs("button", { className: lite.clsx(`ds-helptext--${size}`, 'ds-helptext__button', `ds-focus`, className), "aria-expanded": open, onClick: () => setOpen(!open), ...rest, children: [jsxRuntime.jsx(HelpTextIcon.HelpTextIcon, { filled: true, className: lite.clsx(`ds-helptext__icon`, `ds-helptext__icon--filled`, className), openState: open }), jsxRuntime.jsx(HelpTextIcon.HelpTextIcon, { className: lite.clsx(`ds-helptext__icon`, className), openState: open }), jsxRuntime.jsx("span", { className: `ds-sr-only`, children: title })] }) }), jsxRuntime.jsx(index.Popover.Content, { className: 'ds-helptext__content', children: children })] }) }));
|
|
12
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(index.Popover, { variant: 'info', placement: placement, size: size, portal: portal, open: open, onClose: () => setOpen(false), children: [jsxRuntime.jsx(index.Popover.Trigger, { asChild: true, variant: 'tertiary', children: jsxRuntime.jsxs("button", { className: lite.clsx(`ds-helptext--${size}`, 'ds-helptext__button', `ds-focus`, className), "aria-expanded": open, onClick: () => setOpen(!open), ...rest, children: [jsxRuntime.jsx(HelpTextIcon.HelpTextIcon, { filled: true, className: lite.clsx(`ds-helptext__icon`, `ds-helptext__icon--filled`, className), openState: open }), jsxRuntime.jsx(HelpTextIcon.HelpTextIcon, { className: lite.clsx(`ds-helptext__icon`, className), openState: open }), jsxRuntime.jsx("span", { className: `ds-sr-only`, children: title })] }) }), jsxRuntime.jsx(index.Popover.Content, { className: lite.clsx('ds-helptext__content', 'ds-paragraph--md'), children: children })] }) }));
|
|
13
13
|
};
|
|
14
14
|
HelpText.displayName = 'HelpText';
|
|
15
15
|
|
|
@@ -8,7 +8,7 @@ var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
|
|
|
8
8
|
|
|
9
9
|
const Link = React.forwardRef(({ color = 'accent', asChild, children, className, ...rest }, ref) => {
|
|
10
10
|
const Component = asChild ? index.Slot : 'a';
|
|
11
|
-
return (jsxRuntime.jsx(Component, { className: lite.clsx('ds-link', `ds-
|
|
11
|
+
return (jsxRuntime.jsx(Component, { className: lite.clsx('ds-link', `ds-link--${color}`, className), ref: ref, ...rest, children: children }));
|
|
12
12
|
});
|
|
13
13
|
Link.displayName = 'Link';
|
|
14
14
|
|
|
@@ -21,7 +21,7 @@ const Tabs = React.forwardRef(({ size = 'md', children, value, defaultValue, cla
|
|
|
21
21
|
value,
|
|
22
22
|
defaultValue,
|
|
23
23
|
onChange: onValueChange,
|
|
24
|
-
}, children: jsxRuntime.jsx("div", { className: lite.clsx(`ds-tabs--${size}`, className), ref: ref, ...rest, children: children }) }));
|
|
24
|
+
}, children: jsxRuntime.jsx("div", { className: lite.clsx(`ds-tabs--${size}`, `ds-paragraph-short--${size}`, className), ref: ref, ...rest, children: children }) }));
|
|
25
25
|
});
|
|
26
26
|
Tabs.displayName = 'Tabs';
|
|
27
27
|
|
|
@@ -78,7 +78,7 @@ const Tooltip = React.forwardRef(({ children, content, placement = 'top', delay
|
|
|
78
78
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [React.cloneElement(children, getReferenceProps({
|
|
79
79
|
ref: childMergedRef,
|
|
80
80
|
})), internalOpen && (jsxRuntime.jsx(Container, { children: jsxRuntime.jsxs("div", { ref: refs.setFloating, style: { ...floatingStyles, ...animationStyles, ...style }, role: 'tooltip', ...getFloatingProps({
|
|
81
|
-
className: lite.clsx('ds-tooltip', className),
|
|
81
|
+
className: lite.clsx('ds-tooltip', 'ds-paragraph--xs', className),
|
|
82
82
|
ref: mergedRef,
|
|
83
83
|
...rest,
|
|
84
84
|
}), children: [content, jsxRuntime.jsx(floatingUi_react.FloatingArrow, { ref: arrowRef, context: context, className: 'ds-tooltip__arrow', height: ARROW_HEIGHT })] }) }))] }));
|
|
@@ -9,7 +9,7 @@ var index = require('../../../node_modules/@radix-ui/react-slot/dist/index.js');
|
|
|
9
9
|
/** Use `ErrorMessage` to display text as error message. */
|
|
10
10
|
const ErrorMessage = React.forwardRef(({ size = 'md', className, spacing, asChild, error = true, ...rest }, ref) => {
|
|
11
11
|
const Component = asChild ? index.Slot : 'div';
|
|
12
|
-
return (jsxRuntime.jsx(Component, { ref: ref, className: lite.clsx('ds-error-message', `ds-
|
|
12
|
+
return (jsxRuntime.jsx(Component, { ref: ref, className: lite.clsx('ds-error-message', `ds-error_message--${size}`, spacing && 'ds-error-message--spacing', error && 'ds-error-message--error', className), ...rest }));
|
|
13
13
|
});
|
|
14
14
|
ErrorMessage.displayName = 'ErrorMessage';
|
|
15
15
|
|
|
@@ -9,7 +9,10 @@ var index = require('../../../node_modules/@radix-ui/react-slot/dist/index.js');
|
|
|
9
9
|
/** Use `Paragraph` to display text with paragraph text styles. */
|
|
10
10
|
const Paragraph = React.forwardRef(({ className, spacing, size = 'md', asChild, variant, ...rest }, ref) => {
|
|
11
11
|
const Component = asChild ? index.Slot : 'p';
|
|
12
|
-
return (jsxRuntime.jsx(Component, { ref: ref, className: lite.clsx('ds-paragraph',
|
|
12
|
+
return (jsxRuntime.jsx(Component, { ref: ref, className: lite.clsx('ds-paragraph', spacing && 'ds-paragraph--spacing', variant
|
|
13
|
+
? `ds-paragraph-${variant}--${size}`
|
|
14
|
+
: `ds-paragraph--${size}`, // TODO find a better solution for this
|
|
15
|
+
className), ...rest }));
|
|
13
16
|
});
|
|
14
17
|
Paragraph.displayName = 'Paragraph';
|
|
15
18
|
|
|
@@ -23,7 +23,7 @@ const ComboboxCustom = React.forwardRef(({ asChild, interactive, id, className,
|
|
|
23
23
|
if (!context) {
|
|
24
24
|
throw new Error('ComboboxCustom must be used within a Combobox');
|
|
25
25
|
}
|
|
26
|
-
const { customIds, listRef, getItemProps } = context;
|
|
26
|
+
const { customIds, listRef, getItemProps, size } = context;
|
|
27
27
|
const index$1 = React.useMemo(() => (id && customIds.indexOf(id)) || 0, [id, customIds]);
|
|
28
28
|
const combinedRef = floatingUi_react.useMergeRefs([
|
|
29
29
|
(node) => {
|
|
@@ -31,7 +31,7 @@ const ComboboxCustom = React.forwardRef(({ asChild, interactive, id, className,
|
|
|
31
31
|
},
|
|
32
32
|
ref,
|
|
33
33
|
]);
|
|
34
|
-
return (jsxRuntime.jsx(Component, { ref: combinedRef, tabIndex: -1, className: lite.clsx('ds-combobox__custom', className), id: id || randomId, role: 'option', "aria-selected": activeIndex === index$1, "data-active": activeIndex === index$1, ...objectUtils.omit(['interactive'], rest), ...objectUtils.omit(['onClick', 'onPointerLeave'], getItemProps()) }));
|
|
34
|
+
return (jsxRuntime.jsx(Component, { ref: combinedRef, tabIndex: -1, className: lite.clsx('ds-combobox__custom', `ds-label--${size}`, className), id: id || randomId, role: 'option', "aria-selected": activeIndex === index$1, "data-active": activeIndex === index$1, ...objectUtils.omit(['interactive'], rest), ...objectUtils.omit(['onClick', 'onPointerLeave'], getItemProps()) }));
|
|
35
35
|
});
|
|
36
36
|
var ComboboxCustom$1 = ComboboxCustom;
|
|
37
37
|
|
|
@@ -13,8 +13,8 @@ const ComboboxEmpty = React.forwardRef(({ children, className, ...rest }, ref) =
|
|
|
13
13
|
if (!context) {
|
|
14
14
|
throw new Error('ComboboxEmpty must be used within a Combobox');
|
|
15
15
|
}
|
|
16
|
-
const { filteredOptions } = context;
|
|
17
|
-
return (filteredOptions.length === 0 && (jsxRuntime.jsx("div", { ref: ref, className: lite.clsx('ds-combobox__empty', className), ...rest, children: children })));
|
|
16
|
+
const { filteredOptions, size } = context;
|
|
17
|
+
return (filteredOptions.length === 0 && (jsxRuntime.jsx("div", { ref: ref, className: lite.clsx('ds-combobox__empty', `ds-label--${size}`, className), ...rest, children: children })));
|
|
18
18
|
});
|
|
19
19
|
ComboboxEmpty.displayName = 'ComboboxEmpty';
|
|
20
20
|
|
|
@@ -27,7 +27,7 @@ const ComboboxOption = React.memo(React.forwardRef(({ value, description, childr
|
|
|
27
27
|
return (jsxRuntime.jsxs("button", { ref: ref, id: id, role: 'option', type: 'button', "aria-selected": !!selected, "aria-labelledby": labelId, tabIndex: -1, onClick: (e) => {
|
|
28
28
|
onOptionClick();
|
|
29
29
|
rest.onClick?.(e);
|
|
30
|
-
}, className: lite.clsx('ds-combobox__option', active && 'ds-combobox__option--active', multiple && 'ds-combobox__option--multiple', className), ...objectUtils.omit(['displayValue'], rest), ...objectUtils.omit(['onClick', 'onPointerLeave'], props), children: [jsxRuntime.jsx(Label.Label, { asChild: true, size: size, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(SelectedIcon.SelectedIcon, { multiple: multiple, selected: !!selected }) }) }), jsxRuntime.jsxs(Label.Label, { className: 'ds-combobox__option__label', size: size, id: labelId, children: [children, description && (jsxRuntime.jsx(Description.default, { children: description }))] })] }));
|
|
30
|
+
}, className: lite.clsx('ds-combobox__option', 'ds-label--md', active && 'ds-combobox__option--active', multiple && 'ds-combobox__option--multiple', className), ...objectUtils.omit(['displayValue'], rest), ...objectUtils.omit(['onClick', 'onPointerLeave'], props), children: [jsxRuntime.jsx(Label.Label, { asChild: true, size: size, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(SelectedIcon.SelectedIcon, { multiple: multiple, selected: !!selected }) }) }), jsxRuntime.jsxs(Label.Label, { className: 'ds-combobox__option__label', size: size, id: labelId, children: [children, description && (jsxRuntime.jsx(Description.default, { children: description }))] })] }));
|
|
31
31
|
}));
|
|
32
32
|
ComboboxOption.displayName = 'ComboboxOption';
|
|
33
33
|
|
|
@@ -10,7 +10,6 @@ var akselIcons = require('@navikt/aksel-icons');
|
|
|
10
10
|
var floatingUi_react = require('../../../../node_modules/@floating-ui/react/dist/floating-ui.react.js');
|
|
11
11
|
var ComboboxContext = require('../ComboboxContext.js');
|
|
12
12
|
var ComboboxIdContext = require('../ComboboxIdContext.js');
|
|
13
|
-
var useCombobox = require('../useCombobox.js');
|
|
14
13
|
var ComboboxChips = require('./ComboboxChips.js');
|
|
15
14
|
var ComboboxClearButton = require('./ComboboxClearButton.js');
|
|
16
15
|
var Box = require('../../../Box/Box.js');
|
|
@@ -25,7 +24,7 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
25
24
|
const setActiveIndex = (id) => {
|
|
26
25
|
idDispatch?.({ type: 'SET_ACTIVE_INDEX', payload: id });
|
|
27
26
|
};
|
|
28
|
-
const { forwareddRef, readOnly, disabled, open, inputRef, refs, inputValue, multiple, selectedOptions, formFieldProps, htmlSize, options, setOpen, getReferenceProps, setInputValue, handleSelectOption, } = context;
|
|
27
|
+
const { forwareddRef, readOnly, disabled, open, inputRef, refs, inputValue, multiple, selectedOptions, formFieldProps, htmlSize, options, setOpen, getReferenceProps, setInputValue, handleSelectOption, size, } = context;
|
|
29
28
|
const mergedRefs = floatingUi_react.useMergeRefs([forwareddRef, inputRef]);
|
|
30
29
|
// onChange function for the input
|
|
31
30
|
const onChange = (event) => {
|
|
@@ -33,12 +32,11 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
33
32
|
setInputValue(value);
|
|
34
33
|
setActiveIndex(0);
|
|
35
34
|
// check if input value is the same as a label, if so, select it
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
handleSelectOption({ option: option });
|
|
35
|
+
Object.values(options).forEach((option) => {
|
|
36
|
+
if (option.label.toLowerCase() === value.toLowerCase()) {
|
|
37
|
+
handleSelectOption({ option: option });
|
|
38
|
+
}
|
|
39
|
+
});
|
|
42
40
|
};
|
|
43
41
|
const showClearButton = multiple && !hideClearButton && Object.keys(selectedOptions).length > 0;
|
|
44
42
|
/* Props from floating-ui */
|
|
@@ -67,7 +65,7 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
67
65
|
}
|
|
68
66
|
},
|
|
69
67
|
});
|
|
70
|
-
return (jsxRuntime.jsxs(Box.Box, { ...props, "aria-disabled": disabled ? 'true' : undefined, className: lite.clsx('ds-textfield__input', 'ds-combobox__input__wrapper', readOnly && 'ds-combobox--readonly', error && 'ds-combobox--error'), children: [jsxRuntime.jsxs("div", { className: 'ds-combobox__chip-and-input', children: [multiple && !hideChips && jsxRuntime.jsx(ComboboxChips.default, {}), jsxRuntime.jsx("input", { ref: mergedRefs, "aria-activedescendant": props['aria-activedescendant'], readOnly: readOnly, "aria-autocomplete": 'list', role: 'combobox', "aria-expanded": open, "aria-controls": listId, autoComplete: 'off', size: htmlSize, value: inputValue, ...objectUtils.omit(['style', 'className'], rest), ...formFieldProps.inputProps, className: 'ds-combobox__input', onChange: (e) => {
|
|
68
|
+
return (jsxRuntime.jsxs(Box.Box, { ...props, "aria-disabled": disabled ? 'true' : undefined, className: lite.clsx('ds-textfield__input', `ds-paragraph--${size}`, 'ds-combobox__input__wrapper', readOnly && 'ds-combobox--readonly', error && 'ds-combobox--error'), children: [jsxRuntime.jsxs("div", { className: 'ds-combobox__chip-and-input', children: [multiple && !hideChips && jsxRuntime.jsx(ComboboxChips.default, {}), jsxRuntime.jsx("input", { ref: mergedRefs, "aria-activedescendant": props['aria-activedescendant'], readOnly: readOnly, "aria-autocomplete": 'list', role: 'combobox', "aria-expanded": open, "aria-controls": listId, autoComplete: 'off', size: htmlSize, value: inputValue, ...objectUtils.omit(['style', 'className'], rest), ...formFieldProps.inputProps, className: lite.clsx('ds-combobox__input', `ds-paragraph--${size}`), onChange: (e) => {
|
|
71
69
|
onChange(e);
|
|
72
70
|
!open && setOpen(true);
|
|
73
71
|
rest.onChange && rest.onChange(e);
|
|
@@ -97,7 +97,8 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
97
97
|
const [selectedOptions, setSelectedOptions] = React.useState(preSelectedOptions);
|
|
98
98
|
const { filteredOptions, filteredOptionsChildren } = React.useMemo(() => {
|
|
99
99
|
const filteredOptions = [];
|
|
100
|
-
const filteredOptionsChildren = Object.keys(options)
|
|
100
|
+
const filteredOptionsChildren = Object.keys(options)
|
|
101
|
+
.map((option, index) => {
|
|
101
102
|
/* If we have a selected value in single mode and the input matches an option, return all children */
|
|
102
103
|
if (!multiple && Object.keys(selectedOptions).length === 1) {
|
|
103
104
|
filteredOptions.push(option);
|
|
@@ -111,7 +112,9 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
111
112
|
filteredOptions.push(option);
|
|
112
113
|
return optionsChildren[index];
|
|
113
114
|
}
|
|
114
|
-
|
|
115
|
+
return;
|
|
116
|
+
})
|
|
117
|
+
.filter((child) => child);
|
|
115
118
|
return { filteredOptions, filteredOptionsChildren };
|
|
116
119
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
120
|
}, [inputValue, multiple, options, optionsChildren, selectedOptions]);
|
|
@@ -18,16 +18,20 @@ const observeElementRect = (instance, cb) => {
|
|
|
18
18
|
if (!element) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
+
const targetWindow = instance.targetWindow;
|
|
22
|
+
if (!targetWindow) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
21
25
|
const handler = (rect) => {
|
|
22
26
|
const { width, height } = rect;
|
|
23
27
|
cb({ width: Math.round(width), height: Math.round(height) });
|
|
24
28
|
};
|
|
25
29
|
handler(element.getBoundingClientRect());
|
|
26
|
-
if (
|
|
30
|
+
if (!targetWindow.ResizeObserver) {
|
|
27
31
|
return () => {
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
|
-
const observer = new ResizeObserver((entries) => {
|
|
34
|
+
const observer = new targetWindow.ResizeObserver((entries) => {
|
|
31
35
|
const entry = entries[0];
|
|
32
36
|
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
33
37
|
const box = entry.borderBoxSize[0];
|
|
@@ -43,20 +47,40 @@ const observeElementRect = (instance, cb) => {
|
|
|
43
47
|
observer.unobserve(element);
|
|
44
48
|
};
|
|
45
49
|
};
|
|
50
|
+
const addEventListenerOptions = {
|
|
51
|
+
passive: true
|
|
52
|
+
};
|
|
53
|
+
const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
|
|
46
54
|
const observeElementOffset = (instance, cb) => {
|
|
47
55
|
const element = instance.scrollElement;
|
|
48
56
|
if (!element) {
|
|
49
57
|
return;
|
|
50
58
|
}
|
|
51
|
-
const
|
|
52
|
-
|
|
59
|
+
const targetWindow = instance.targetWindow;
|
|
60
|
+
if (!targetWindow) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let offset = 0;
|
|
64
|
+
const fallback = supportsScrollend ? () => void 0 : utils.debounce(
|
|
65
|
+
targetWindow,
|
|
66
|
+
() => {
|
|
67
|
+
cb(offset, false);
|
|
68
|
+
},
|
|
69
|
+
instance.options.isScrollingResetDelay
|
|
70
|
+
);
|
|
71
|
+
const createHandler = (isScrolling) => () => {
|
|
72
|
+
offset = element[instance.options.horizontal ? "scrollLeft" : "scrollTop"];
|
|
73
|
+
fallback();
|
|
74
|
+
cb(offset, isScrolling);
|
|
53
75
|
};
|
|
54
|
-
handler();
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
const handler = createHandler(true);
|
|
77
|
+
const endHandler = createHandler(false);
|
|
78
|
+
endHandler();
|
|
79
|
+
element.addEventListener("scroll", handler, addEventListenerOptions);
|
|
80
|
+
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
|
|
58
81
|
return () => {
|
|
59
82
|
element.removeEventListener("scroll", handler);
|
|
83
|
+
element.removeEventListener("scrollend", endHandler);
|
|
60
84
|
};
|
|
61
85
|
};
|
|
62
86
|
const measureElement = (element, entry, instance) => {
|
|
@@ -88,8 +112,8 @@ class Virtualizer {
|
|
|
88
112
|
constructor(opts) {
|
|
89
113
|
this.unsubs = [];
|
|
90
114
|
this.scrollElement = null;
|
|
115
|
+
this.targetWindow = null;
|
|
91
116
|
this.isScrolling = false;
|
|
92
|
-
this.isScrollingTimeoutId = null;
|
|
93
117
|
this.scrollToIndexTimeoutId = null;
|
|
94
118
|
this.measurementsCache = [];
|
|
95
119
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
@@ -102,15 +126,15 @@ class Virtualizer {
|
|
|
102
126
|
const get = () => {
|
|
103
127
|
if (_ro) {
|
|
104
128
|
return _ro;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
entries.forEach((entry) => {
|
|
108
|
-
this._measureElement(entry.target, entry);
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
} else {
|
|
129
|
+
}
|
|
130
|
+
if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
|
|
112
131
|
return null;
|
|
113
132
|
}
|
|
133
|
+
return _ro = new this.targetWindow.ResizeObserver((entries) => {
|
|
134
|
+
entries.forEach((entry) => {
|
|
135
|
+
this._measureElement(entry.target, entry);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
114
138
|
};
|
|
115
139
|
return {
|
|
116
140
|
disconnect: () => {
|
|
@@ -150,39 +174,24 @@ class Virtualizer {
|
|
|
150
174
|
initialRect: { width: 0, height: 0 },
|
|
151
175
|
scrollMargin: 0,
|
|
152
176
|
gap: 0,
|
|
153
|
-
scrollingDelay: 150,
|
|
154
177
|
indexAttribute: "data-index",
|
|
155
178
|
initialMeasurementsCache: [],
|
|
156
179
|
lanes: 1,
|
|
180
|
+
isScrollingResetDelay: 150,
|
|
157
181
|
...opts2
|
|
158
182
|
};
|
|
159
183
|
};
|
|
160
|
-
this.notify = (sync) => {
|
|
184
|
+
this.notify = (force, sync) => {
|
|
161
185
|
var _a, _b;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
this.range ? this.range.startIndex : null,
|
|
170
|
-
this.range ? this.range.endIndex : null
|
|
171
|
-
];
|
|
172
|
-
},
|
|
173
|
-
(isScrolling) => {
|
|
174
|
-
this.notify(isScrolling);
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
178
|
-
debug: () => this.options.debug,
|
|
179
|
-
initialDeps: [
|
|
180
|
-
this.isScrolling,
|
|
181
|
-
this.range ? this.range.startIndex : null,
|
|
182
|
-
this.range ? this.range.endIndex : null
|
|
183
|
-
]
|
|
186
|
+
const { startIndex, endIndex } = this.range ?? {
|
|
187
|
+
startIndex: void 0,
|
|
188
|
+
endIndex: void 0
|
|
189
|
+
};
|
|
190
|
+
const range = this.calculateRange();
|
|
191
|
+
if (force || startIndex !== (range == null ? void 0 : range.startIndex) || endIndex !== (range == null ? void 0 : range.endIndex)) {
|
|
192
|
+
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);
|
|
184
193
|
}
|
|
185
|
-
|
|
194
|
+
};
|
|
186
195
|
this.cleanup = () => {
|
|
187
196
|
this.unsubs.filter(Boolean).forEach((d) => d());
|
|
188
197
|
this.unsubs = [];
|
|
@@ -196,10 +205,16 @@ class Virtualizer {
|
|
|
196
205
|
};
|
|
197
206
|
};
|
|
198
207
|
this._willUpdate = () => {
|
|
208
|
+
var _a;
|
|
199
209
|
const scrollElement = this.options.getScrollElement();
|
|
200
210
|
if (this.scrollElement !== scrollElement) {
|
|
201
211
|
this.cleanup();
|
|
202
212
|
this.scrollElement = scrollElement;
|
|
213
|
+
if (this.scrollElement && "ownerDocument" in this.scrollElement) {
|
|
214
|
+
this.targetWindow = this.scrollElement.ownerDocument.defaultView;
|
|
215
|
+
} else {
|
|
216
|
+
this.targetWindow = ((_a = this.scrollElement) == null ? void 0 : _a.window) ?? null;
|
|
217
|
+
}
|
|
203
218
|
this._scrollToOffset(this.scrollOffset, {
|
|
204
219
|
adjustments: void 0,
|
|
205
220
|
behavior: void 0
|
|
@@ -207,29 +222,17 @@ class Virtualizer {
|
|
|
207
222
|
this.unsubs.push(
|
|
208
223
|
this.options.observeElementRect(this, (rect) => {
|
|
209
224
|
this.scrollRect = rect;
|
|
210
|
-
this.
|
|
225
|
+
this.notify(false, false);
|
|
211
226
|
})
|
|
212
227
|
);
|
|
213
228
|
this.unsubs.push(
|
|
214
|
-
this.options.observeElementOffset(this, (offset) => {
|
|
229
|
+
this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
215
230
|
this.scrollAdjustments = 0;
|
|
216
|
-
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
if (this.isScrollingTimeoutId !== null) {
|
|
220
|
-
clearTimeout(this.isScrollingTimeoutId);
|
|
221
|
-
this.isScrollingTimeoutId = null;
|
|
222
|
-
}
|
|
223
|
-
this.isScrolling = true;
|
|
224
|
-
this.scrollDirection = this.scrollOffset < offset ? "forward" : "backward";
|
|
231
|
+
this.scrollDirection = isScrolling ? this.scrollOffset < offset ? "forward" : "backward" : null;
|
|
225
232
|
this.scrollOffset = offset;
|
|
226
|
-
this.
|
|
227
|
-
this.
|
|
228
|
-
|
|
229
|
-
this.isScrolling = false;
|
|
230
|
-
this.scrollDirection = null;
|
|
231
|
-
this.maybeNotify();
|
|
232
|
-
}, this.options.scrollingDelay);
|
|
233
|
+
const prevIsScrolling = this.isScrolling;
|
|
234
|
+
this.isScrolling = isScrolling;
|
|
235
|
+
this.notify(prevIsScrolling !== isScrolling, isScrolling);
|
|
233
236
|
})
|
|
234
237
|
);
|
|
235
238
|
}
|
|
@@ -237,7 +240,7 @@ class Virtualizer {
|
|
|
237
240
|
this.getSize = () => {
|
|
238
241
|
return this.scrollRect[this.options.horizontal ? "width" : "height"];
|
|
239
242
|
};
|
|
240
|
-
this.
|
|
243
|
+
this.getMeasurementOptions = utils.memo(
|
|
241
244
|
() => [
|
|
242
245
|
this.options.count,
|
|
243
246
|
this.options.paddingStart,
|
|
@@ -285,7 +288,7 @@ class Virtualizer {
|
|
|
285
288
|
})[0] : void 0;
|
|
286
289
|
};
|
|
287
290
|
this.getMeasurements = utils.memo(
|
|
288
|
-
() => [this.
|
|
291
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
289
292
|
({ count, paddingStart, scrollMargin, getItemKey }, itemSizeCache) => {
|
|
290
293
|
const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
291
294
|
this.pendingMeasuredCacheIndexes = [];
|
|
@@ -338,7 +341,8 @@ class Virtualizer {
|
|
|
338
341
|
],
|
|
339
342
|
(rangeExtractor, range, overscan, count) => {
|
|
340
343
|
return range === null ? [] : rangeExtractor({
|
|
341
|
-
|
|
344
|
+
startIndex: range.startIndex,
|
|
345
|
+
endIndex: range.endIndex,
|
|
342
346
|
overscan,
|
|
343
347
|
count
|
|
344
348
|
});
|
|
@@ -385,7 +389,7 @@ class Virtualizer {
|
|
|
385
389
|
const itemSize = this.itemSizeCache.get(item.key) ?? item.size;
|
|
386
390
|
const delta = size - itemSize;
|
|
387
391
|
if (delta !== 0) {
|
|
388
|
-
if (item.start < this.scrollOffset + this.scrollAdjustments) {
|
|
392
|
+
if (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.scrollOffset + this.scrollAdjustments) {
|
|
389
393
|
if (process.env.NODE_ENV !== "production" && this.options.debug) {
|
|
390
394
|
console.info("correction", delta);
|
|
391
395
|
}
|
|
@@ -396,7 +400,7 @@ class Virtualizer {
|
|
|
396
400
|
}
|
|
397
401
|
this.pendingMeasuredCacheIndexes.push(item.index);
|
|
398
402
|
this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
|
|
399
|
-
this.notify(false);
|
|
403
|
+
this.notify(true, false);
|
|
400
404
|
}
|
|
401
405
|
};
|
|
402
406
|
this.measureElement = (node) => {
|
|
@@ -472,8 +476,8 @@ class Virtualizer {
|
|
|
472
476
|
};
|
|
473
477
|
this.isDynamicMode = () => this.measureElementCache.size > 0;
|
|
474
478
|
this.cancelScrollToIndex = () => {
|
|
475
|
-
if (this.scrollToIndexTimeoutId !== null) {
|
|
476
|
-
clearTimeout(this.scrollToIndexTimeoutId);
|
|
479
|
+
if (this.scrollToIndexTimeoutId !== null && this.targetWindow) {
|
|
480
|
+
this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);
|
|
477
481
|
this.scrollToIndexTimeoutId = null;
|
|
478
482
|
}
|
|
479
483
|
};
|
|
@@ -499,8 +503,8 @@ class Virtualizer {
|
|
|
499
503
|
}
|
|
500
504
|
const [toOffset, align] = this.getOffsetForIndex(index, initialAlign);
|
|
501
505
|
this._scrollToOffset(toOffset, { adjustments: void 0, behavior });
|
|
502
|
-
if (behavior !== "smooth" && this.isDynamicMode()) {
|
|
503
|
-
this.scrollToIndexTimeoutId = setTimeout(() => {
|
|
506
|
+
if (behavior !== "smooth" && this.isDynamicMode() && this.targetWindow) {
|
|
507
|
+
this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
|
|
504
508
|
this.scrollToIndexTimeoutId = null;
|
|
505
509
|
const elementInDOM = this.measureElementCache.has(
|
|
506
510
|
this.options.getItemKey(index)
|
|
@@ -548,17 +552,18 @@ class Virtualizer {
|
|
|
548
552
|
this.options.scrollToFn(offset, { behavior, adjustments }, this);
|
|
549
553
|
};
|
|
550
554
|
this.measure = () => {
|
|
555
|
+
var _a, _b;
|
|
551
556
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
552
|
-
this.
|
|
557
|
+
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, false);
|
|
553
558
|
};
|
|
554
559
|
this.setOptions(opts);
|
|
555
560
|
this.scrollRect = this.options.initialRect;
|
|
556
|
-
this.scrollOffset = this.options.initialOffset;
|
|
561
|
+
this.scrollOffset = typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset;
|
|
557
562
|
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
558
563
|
this.measurementsCache.forEach((item) => {
|
|
559
564
|
this.itemSizeCache.set(item.key, item.size);
|
|
560
565
|
});
|
|
561
|
-
this.
|
|
566
|
+
this.notify(false, false);
|
|
562
567
|
}
|
|
563
568
|
}
|
|
564
569
|
const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
@@ -595,6 +600,7 @@ function calculateRange({
|
|
|
595
600
|
}
|
|
596
601
|
|
|
597
602
|
exports.approxEqual = utils.approxEqual;
|
|
603
|
+
exports.debounce = utils.debounce;
|
|
598
604
|
exports.memo = utils.memo;
|
|
599
605
|
exports.notUndefined = utils.notUndefined;
|
|
600
606
|
exports.Virtualizer = Virtualizer;
|
|
@@ -54,7 +54,15 @@ function notUndefined(value, msg) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
const approxEqual = (a, b) => Math.abs(a - b) < 1;
|
|
57
|
+
const debounce = (targetWindow, fn, ms) => {
|
|
58
|
+
let timeoutId;
|
|
59
|
+
return function(...args) {
|
|
60
|
+
targetWindow.clearTimeout(timeoutId);
|
|
61
|
+
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
62
|
+
};
|
|
63
|
+
};
|
|
57
64
|
|
|
58
65
|
exports.approxEqual = approxEqual;
|
|
66
|
+
exports.debounce = debounce;
|
|
59
67
|
exports.memo = memo;
|
|
60
68
|
exports.notUndefined = notUndefined;
|
|
@@ -9,7 +9,7 @@ import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_mo
|
|
|
9
9
|
*/
|
|
10
10
|
const Button = forwardRef(({ children, variant = 'primary', color = 'accent', fullWidth = false, icon = false, type = 'button', size = 'md', asChild, className, ...rest }, ref) => {
|
|
11
11
|
const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'button';
|
|
12
|
-
return (jsx(Component, { ref: ref, type: type, className: clsx('ds-btn', `ds-focus`, `ds-btn--${size}`, `ds-btn--${variant}`, `ds-btn--${color}`, fullWidth && 'ds-btn--full-width', icon && 'ds-btn--icon-only', className), ...rest, children: children }));
|
|
12
|
+
return (jsx(Component, { ref: ref, type: type, className: clsx('ds-btn', `ds-focus`, `ds-btn--${size}`, `ds-paragraph-short--${size}`, `ds-btn--${variant}`, `ds-btn--${color}`, fullWidth && 'ds-btn--full-width', icon && 'ds-btn--icon-only', className), ...rest, children: children }));
|
|
13
13
|
});
|
|
14
14
|
Button.displayName = 'Button';
|
|
15
15
|
|
|
@@ -6,7 +6,7 @@ import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_mo
|
|
|
6
6
|
|
|
7
7
|
const CardContent = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
8
8
|
const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'div';
|
|
9
|
-
return (jsx(Component, { className: clsx(`ds-card__content`, className), ref: ref, ...rest }));
|
|
9
|
+
return (jsx(Component, { className: clsx(`ds-card__content`, `ds-paragraph--md`, className), ref: ref, ...rest }));
|
|
10
10
|
});
|
|
11
11
|
CardContent.displayName = 'CardContent';
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_mo
|
|
|
6
6
|
|
|
7
7
|
const CardFooter = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
8
8
|
const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'div';
|
|
9
|
-
return (jsx(Component, { className: clsx(`ds-card__footer`, className), ref: ref, ...rest }));
|
|
9
|
+
return (jsx(Component, { className: clsx(`ds-card__footer`, `ds-paragraph--md`, className), ref: ref, ...rest }));
|
|
10
10
|
});
|
|
11
11
|
CardFooter.displayName = 'CardFooter';
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_mo
|
|
|
6
6
|
|
|
7
7
|
const CardHeader = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
8
8
|
const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'div';
|
|
9
|
-
return (jsx(Component, { className: clsx(`ds-card__header`, className), ref: ref, ...rest }));
|
|
9
|
+
return (jsx(Component, { className: clsx(`ds-card__header`, `ds-heading--md`, className), ref: ref, ...rest }));
|
|
10
10
|
});
|
|
11
11
|
CardHeader.displayName = 'CardHeader';
|
|
12
12
|
|
|
@@ -7,7 +7,7 @@ import { HelpTextIcon } from './HelpTextIcon.js';
|
|
|
7
7
|
|
|
8
8
|
const HelpText = ({ title, placement = 'right', portal, size = 'md', className, children, ...rest }) => {
|
|
9
9
|
const [open, setOpen] = useState(false);
|
|
10
|
-
return (jsx(Fragment, { children: jsxs(Popover, { variant: 'info', placement: placement, size: size, portal: portal, open: open, onClose: () => setOpen(false), children: [jsx(Popover.Trigger, { asChild: true, variant: 'tertiary', children: jsxs("button", { className: clsx(`ds-helptext--${size}`, 'ds-helptext__button', `ds-focus`, className), "aria-expanded": open, onClick: () => setOpen(!open), ...rest, children: [jsx(HelpTextIcon, { filled: true, className: clsx(`ds-helptext__icon`, `ds-helptext__icon--filled`, className), openState: open }), jsx(HelpTextIcon, { className: clsx(`ds-helptext__icon`, className), openState: open }), jsx("span", { className: `ds-sr-only`, children: title })] }) }), jsx(Popover.Content, { className: 'ds-helptext__content', children: children })] }) }));
|
|
10
|
+
return (jsx(Fragment, { children: jsxs(Popover, { variant: 'info', placement: placement, size: size, portal: portal, open: open, onClose: () => setOpen(false), children: [jsx(Popover.Trigger, { asChild: true, variant: 'tertiary', children: jsxs("button", { className: clsx(`ds-helptext--${size}`, 'ds-helptext__button', `ds-focus`, className), "aria-expanded": open, onClick: () => setOpen(!open), ...rest, children: [jsx(HelpTextIcon, { filled: true, className: clsx(`ds-helptext__icon`, `ds-helptext__icon--filled`, className), openState: open }), jsx(HelpTextIcon, { className: clsx(`ds-helptext__icon`, className), openState: open }), jsx("span", { className: `ds-sr-only`, children: title })] }) }), jsx(Popover.Content, { className: clsx('ds-helptext__content', 'ds-paragraph--md'), children: children })] }) }));
|
|
11
11
|
};
|
|
12
12
|
HelpText.displayName = 'HelpText';
|
|
13
13
|
|
|
@@ -6,7 +6,7 @@ import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_mo
|
|
|
6
6
|
|
|
7
7
|
const Link = forwardRef(({ color = 'accent', asChild, children, className, ...rest }, ref) => {
|
|
8
8
|
const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'a';
|
|
9
|
-
return (jsx(Component, { className: clsx('ds-link', `ds-
|
|
9
|
+
return (jsx(Component, { className: clsx('ds-link', `ds-link--${color}`, className), ref: ref, ...rest, children: children }));
|
|
10
10
|
});
|
|
11
11
|
Link.displayName = 'Link';
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ const Tabs = forwardRef(({ size = 'md', children, value, defaultValue, className
|
|
|
19
19
|
value,
|
|
20
20
|
defaultValue,
|
|
21
21
|
onChange: onValueChange,
|
|
22
|
-
}, children: jsx("div", { className: clsx(`ds-tabs--${size}`, className), ref: ref, ...rest, children: children }) }));
|
|
22
|
+
}, children: jsx("div", { className: clsx(`ds-tabs--${size}`, `ds-paragraph-short--${size}`, className), ref: ref, ...rest, children: children }) }));
|
|
23
23
|
});
|
|
24
24
|
Tabs.displayName = 'Tabs';
|
|
25
25
|
|
|
@@ -58,7 +58,7 @@ const Tooltip = forwardRef(({ children, content, placement = 'top', delay = 150,
|
|
|
58
58
|
return (jsxs(Fragment, { children: [cloneElement(children, getReferenceProps({
|
|
59
59
|
ref: childMergedRef,
|
|
60
60
|
})), internalOpen && (jsx(Container, { children: jsxs("div", { ref: refs.setFloating, style: { ...floatingStyles, ...animationStyles, ...style }, role: 'tooltip', ...getFloatingProps({
|
|
61
|
-
className: clsx('ds-tooltip', className),
|
|
61
|
+
className: clsx('ds-tooltip', 'ds-paragraph--xs', className),
|
|
62
62
|
ref: mergedRef,
|
|
63
63
|
...rest,
|
|
64
64
|
}), children: [content, jsx(FloatingArrow, { ref: arrowRef, context: context, className: 'ds-tooltip__arrow', height: ARROW_HEIGHT })] }) }))] }));
|
|
@@ -7,7 +7,7 @@ import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../../node
|
|
|
7
7
|
/** Use `ErrorMessage` to display text as error message. */
|
|
8
8
|
const ErrorMessage = forwardRef(({ size = 'md', className, spacing, asChild, error = true, ...rest }, ref) => {
|
|
9
9
|
const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'div';
|
|
10
|
-
return (jsx(Component, { ref: ref, className: clsx('ds-error-message', `ds-
|
|
10
|
+
return (jsx(Component, { ref: ref, className: clsx('ds-error-message', `ds-error_message--${size}`, spacing && 'ds-error-message--spacing', error && 'ds-error-message--error', className), ...rest }));
|
|
11
11
|
});
|
|
12
12
|
ErrorMessage.displayName = 'ErrorMessage';
|
|
13
13
|
|
|
@@ -7,7 +7,10 @@ import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../../node
|
|
|
7
7
|
/** Use `Paragraph` to display text with paragraph text styles. */
|
|
8
8
|
const Paragraph = forwardRef(({ className, spacing, size = 'md', asChild, variant, ...rest }, ref) => {
|
|
9
9
|
const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'p';
|
|
10
|
-
return (jsx(Component, { ref: ref, className: clsx('ds-paragraph',
|
|
10
|
+
return (jsx(Component, { ref: ref, className: clsx('ds-paragraph', spacing && 'ds-paragraph--spacing', variant
|
|
11
|
+
? `ds-paragraph-${variant}--${size}`
|
|
12
|
+
: `ds-paragraph--${size}`, // TODO find a better solution for this
|
|
13
|
+
className), ...rest }));
|
|
11
14
|
});
|
|
12
15
|
Paragraph.displayName = 'Paragraph';
|
|
13
16
|
|
|
@@ -19,7 +19,7 @@ const ComboboxCustom = forwardRef(({ asChild, interactive, id, className, ...res
|
|
|
19
19
|
if (!context) {
|
|
20
20
|
throw new Error('ComboboxCustom must be used within a Combobox');
|
|
21
21
|
}
|
|
22
|
-
const { customIds, listRef, getItemProps } = context;
|
|
22
|
+
const { customIds, listRef, getItemProps, size } = context;
|
|
23
23
|
const index = useMemo(() => (id && customIds.indexOf(id)) || 0, [id, customIds]);
|
|
24
24
|
const combinedRef = useMergeRefs([
|
|
25
25
|
(node) => {
|
|
@@ -27,7 +27,7 @@ const ComboboxCustom = forwardRef(({ asChild, interactive, id, className, ...res
|
|
|
27
27
|
},
|
|
28
28
|
ref,
|
|
29
29
|
]);
|
|
30
|
-
return (jsx(Component, { ref: combinedRef, tabIndex: -1, className: clsx('ds-combobox__custom', className), id: id || randomId, role: 'option', "aria-selected": activeIndex === index, "data-active": activeIndex === index, ...omit(['interactive'], rest), ...omit(['onClick', 'onPointerLeave'], getItemProps()) }));
|
|
30
|
+
return (jsx(Component, { ref: combinedRef, tabIndex: -1, className: clsx('ds-combobox__custom', `ds-label--${size}`, className), id: id || randomId, role: 'option', "aria-selected": activeIndex === index, "data-active": activeIndex === index, ...omit(['interactive'], rest), ...omit(['onClick', 'onPointerLeave'], getItemProps()) }));
|
|
31
31
|
});
|
|
32
32
|
var ComboboxCustom$1 = ComboboxCustom;
|
|
33
33
|
|
|
@@ -9,8 +9,8 @@ const ComboboxEmpty = forwardRef(({ children, className, ...rest }, ref) => {
|
|
|
9
9
|
if (!context) {
|
|
10
10
|
throw new Error('ComboboxEmpty must be used within a Combobox');
|
|
11
11
|
}
|
|
12
|
-
const { filteredOptions } = context;
|
|
13
|
-
return (filteredOptions.length === 0 && (jsx("div", { ref: ref, className: clsx('ds-combobox__empty', className), ...rest, children: children })));
|
|
12
|
+
const { filteredOptions, size } = context;
|
|
13
|
+
return (filteredOptions.length === 0 && (jsx("div", { ref: ref, className: clsx('ds-combobox__empty', `ds-label--${size}`, className), ...rest, children: children })));
|
|
14
14
|
});
|
|
15
15
|
ComboboxEmpty.displayName = 'ComboboxEmpty';
|
|
16
16
|
|
|
@@ -25,7 +25,7 @@ const ComboboxOption = memo(forwardRef(({ value, description, children, classNam
|
|
|
25
25
|
return (jsxs("button", { ref: ref, id: id, role: 'option', type: 'button', "aria-selected": !!selected, "aria-labelledby": labelId, tabIndex: -1, onClick: (e) => {
|
|
26
26
|
onOptionClick();
|
|
27
27
|
rest.onClick?.(e);
|
|
28
|
-
}, className: clsx('ds-combobox__option', active && 'ds-combobox__option--active', multiple && 'ds-combobox__option--multiple', className), ...omit(['displayValue'], rest), ...omit(['onClick', 'onPointerLeave'], props), children: [jsx(Label, { asChild: true, size: size, children: jsx("span", { children: jsx(SelectedIcon, { multiple: multiple, selected: !!selected }) }) }), jsxs(Label, { className: 'ds-combobox__option__label', size: size, id: labelId, children: [children, description && (jsx(ComboboxOptionDescription, { children: description }))] })] }));
|
|
28
|
+
}, className: clsx('ds-combobox__option', 'ds-label--md', active && 'ds-combobox__option--active', multiple && 'ds-combobox__option--multiple', className), ...omit(['displayValue'], rest), ...omit(['onClick', 'onPointerLeave'], props), children: [jsx(Label, { asChild: true, size: size, children: jsx("span", { children: jsx(SelectedIcon, { multiple: multiple, selected: !!selected }) }) }), jsxs(Label, { className: 'ds-combobox__option__label', size: size, id: labelId, children: [children, description && (jsx(ComboboxOptionDescription, { children: description }))] })] }));
|
|
29
29
|
}));
|
|
30
30
|
ComboboxOption.displayName = 'ComboboxOption';
|
|
31
31
|
|
|
@@ -6,7 +6,6 @@ import { ChevronUpIcon, ChevronDownIcon } from '@navikt/aksel-icons';
|
|
|
6
6
|
import { useMergeRefs } from '../../../../node_modules/@floating-ui/react/dist/floating-ui.react.js';
|
|
7
7
|
import { ComboboxContext } from '../ComboboxContext.js';
|
|
8
8
|
import { useComboboxIdDispatch } from '../ComboboxIdContext.js';
|
|
9
|
-
import { prefix } from '../useCombobox.js';
|
|
10
9
|
import ComboboxChips from './ComboboxChips.js';
|
|
11
10
|
import ComboboxClearButton from './ComboboxClearButton.js';
|
|
12
11
|
import { Box } from '../../../Box/Box.js';
|
|
@@ -21,7 +20,7 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
21
20
|
const setActiveIndex = (id) => {
|
|
22
21
|
idDispatch?.({ type: 'SET_ACTIVE_INDEX', payload: id });
|
|
23
22
|
};
|
|
24
|
-
const { forwareddRef, readOnly, disabled, open, inputRef, refs, inputValue, multiple, selectedOptions, formFieldProps, htmlSize, options, setOpen, getReferenceProps, setInputValue, handleSelectOption, } = context;
|
|
23
|
+
const { forwareddRef, readOnly, disabled, open, inputRef, refs, inputValue, multiple, selectedOptions, formFieldProps, htmlSize, options, setOpen, getReferenceProps, setInputValue, handleSelectOption, size, } = context;
|
|
25
24
|
const mergedRefs = useMergeRefs([forwareddRef, inputRef]);
|
|
26
25
|
// onChange function for the input
|
|
27
26
|
const onChange = (event) => {
|
|
@@ -29,12 +28,11 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
29
28
|
setInputValue(value);
|
|
30
29
|
setActiveIndex(0);
|
|
31
30
|
// check if input value is the same as a label, if so, select it
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
handleSelectOption({ option: option });
|
|
31
|
+
Object.values(options).forEach((option) => {
|
|
32
|
+
if (option.label.toLowerCase() === value.toLowerCase()) {
|
|
33
|
+
handleSelectOption({ option: option });
|
|
34
|
+
}
|
|
35
|
+
});
|
|
38
36
|
};
|
|
39
37
|
const showClearButton = multiple && !hideClearButton && Object.keys(selectedOptions).length > 0;
|
|
40
38
|
/* Props from floating-ui */
|
|
@@ -63,7 +61,7 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
63
61
|
}
|
|
64
62
|
},
|
|
65
63
|
});
|
|
66
|
-
return (jsxs(Box, { ...props, "aria-disabled": disabled ? 'true' : undefined, className: clsx('ds-textfield__input', 'ds-combobox__input__wrapper', readOnly && 'ds-combobox--readonly', error && 'ds-combobox--error'), children: [jsxs("div", { className: 'ds-combobox__chip-and-input', children: [multiple && !hideChips && jsx(ComboboxChips, {}), jsx("input", { ref: mergedRefs, "aria-activedescendant": props['aria-activedescendant'], readOnly: readOnly, "aria-autocomplete": 'list', role: 'combobox', "aria-expanded": open, "aria-controls": listId, autoComplete: 'off', size: htmlSize, value: inputValue, ...omit(['style', 'className'], rest), ...formFieldProps.inputProps, className: 'ds-combobox__input', onChange: (e) => {
|
|
64
|
+
return (jsxs(Box, { ...props, "aria-disabled": disabled ? 'true' : undefined, className: clsx('ds-textfield__input', `ds-paragraph--${size}`, 'ds-combobox__input__wrapper', readOnly && 'ds-combobox--readonly', error && 'ds-combobox--error'), children: [jsxs("div", { className: 'ds-combobox__chip-and-input', children: [multiple && !hideChips && jsx(ComboboxChips, {}), jsx("input", { ref: mergedRefs, "aria-activedescendant": props['aria-activedescendant'], readOnly: readOnly, "aria-autocomplete": 'list', role: 'combobox', "aria-expanded": open, "aria-controls": listId, autoComplete: 'off', size: htmlSize, value: inputValue, ...omit(['style', 'className'], rest), ...formFieldProps.inputProps, className: clsx('ds-combobox__input', `ds-paragraph--${size}`), onChange: (e) => {
|
|
67
65
|
onChange(e);
|
|
68
66
|
!open && setOpen(true);
|
|
69
67
|
rest.onChange && rest.onChange(e);
|
|
@@ -93,7 +93,8 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
93
93
|
const [selectedOptions, setSelectedOptions] = useState(preSelectedOptions);
|
|
94
94
|
const { filteredOptions, filteredOptionsChildren } = useMemo(() => {
|
|
95
95
|
const filteredOptions = [];
|
|
96
|
-
const filteredOptionsChildren = Object.keys(options)
|
|
96
|
+
const filteredOptionsChildren = Object.keys(options)
|
|
97
|
+
.map((option, index) => {
|
|
97
98
|
/* If we have a selected value in single mode and the input matches an option, return all children */
|
|
98
99
|
if (!multiple && Object.keys(selectedOptions).length === 1) {
|
|
99
100
|
filteredOptions.push(option);
|
|
@@ -107,7 +108,9 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
107
108
|
filteredOptions.push(option);
|
|
108
109
|
return optionsChildren[index];
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
+
return;
|
|
112
|
+
})
|
|
113
|
+
.filter((child) => child);
|
|
111
114
|
return { filteredOptions, filteredOptionsChildren };
|
|
112
115
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
113
116
|
}, [inputValue, multiple, options, optionsChildren, selectedOptions]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { memo, notUndefined, approxEqual } from './utils.js';
|
|
2
|
+
import { debounce, memo, notUndefined, approxEqual } from './utils.js';
|
|
3
3
|
|
|
4
4
|
const defaultKeyExtractor = (index) => index;
|
|
5
5
|
const defaultRangeExtractor = (range) => {
|
|
@@ -16,16 +16,20 @@ const observeElementRect = (instance, cb) => {
|
|
|
16
16
|
if (!element) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
+
const targetWindow = instance.targetWindow;
|
|
20
|
+
if (!targetWindow) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
19
23
|
const handler = (rect) => {
|
|
20
24
|
const { width, height } = rect;
|
|
21
25
|
cb({ width: Math.round(width), height: Math.round(height) });
|
|
22
26
|
};
|
|
23
27
|
handler(element.getBoundingClientRect());
|
|
24
|
-
if (
|
|
28
|
+
if (!targetWindow.ResizeObserver) {
|
|
25
29
|
return () => {
|
|
26
30
|
};
|
|
27
31
|
}
|
|
28
|
-
const observer = new ResizeObserver((entries) => {
|
|
32
|
+
const observer = new targetWindow.ResizeObserver((entries) => {
|
|
29
33
|
const entry = entries[0];
|
|
30
34
|
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
31
35
|
const box = entry.borderBoxSize[0];
|
|
@@ -41,20 +45,40 @@ const observeElementRect = (instance, cb) => {
|
|
|
41
45
|
observer.unobserve(element);
|
|
42
46
|
};
|
|
43
47
|
};
|
|
48
|
+
const addEventListenerOptions = {
|
|
49
|
+
passive: true
|
|
50
|
+
};
|
|
51
|
+
const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
|
|
44
52
|
const observeElementOffset = (instance, cb) => {
|
|
45
53
|
const element = instance.scrollElement;
|
|
46
54
|
if (!element) {
|
|
47
55
|
return;
|
|
48
56
|
}
|
|
49
|
-
const
|
|
50
|
-
|
|
57
|
+
const targetWindow = instance.targetWindow;
|
|
58
|
+
if (!targetWindow) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let offset = 0;
|
|
62
|
+
const fallback = supportsScrollend ? () => void 0 : debounce(
|
|
63
|
+
targetWindow,
|
|
64
|
+
() => {
|
|
65
|
+
cb(offset, false);
|
|
66
|
+
},
|
|
67
|
+
instance.options.isScrollingResetDelay
|
|
68
|
+
);
|
|
69
|
+
const createHandler = (isScrolling) => () => {
|
|
70
|
+
offset = element[instance.options.horizontal ? "scrollLeft" : "scrollTop"];
|
|
71
|
+
fallback();
|
|
72
|
+
cb(offset, isScrolling);
|
|
51
73
|
};
|
|
52
|
-
handler();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
74
|
+
const handler = createHandler(true);
|
|
75
|
+
const endHandler = createHandler(false);
|
|
76
|
+
endHandler();
|
|
77
|
+
element.addEventListener("scroll", handler, addEventListenerOptions);
|
|
78
|
+
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
|
|
56
79
|
return () => {
|
|
57
80
|
element.removeEventListener("scroll", handler);
|
|
81
|
+
element.removeEventListener("scrollend", endHandler);
|
|
58
82
|
};
|
|
59
83
|
};
|
|
60
84
|
const measureElement = (element, entry, instance) => {
|
|
@@ -86,8 +110,8 @@ class Virtualizer {
|
|
|
86
110
|
constructor(opts) {
|
|
87
111
|
this.unsubs = [];
|
|
88
112
|
this.scrollElement = null;
|
|
113
|
+
this.targetWindow = null;
|
|
89
114
|
this.isScrolling = false;
|
|
90
|
-
this.isScrollingTimeoutId = null;
|
|
91
115
|
this.scrollToIndexTimeoutId = null;
|
|
92
116
|
this.measurementsCache = [];
|
|
93
117
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
@@ -100,15 +124,15 @@ class Virtualizer {
|
|
|
100
124
|
const get = () => {
|
|
101
125
|
if (_ro) {
|
|
102
126
|
return _ro;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
entries.forEach((entry) => {
|
|
106
|
-
this._measureElement(entry.target, entry);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
} else {
|
|
127
|
+
}
|
|
128
|
+
if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
|
|
110
129
|
return null;
|
|
111
130
|
}
|
|
131
|
+
return _ro = new this.targetWindow.ResizeObserver((entries) => {
|
|
132
|
+
entries.forEach((entry) => {
|
|
133
|
+
this._measureElement(entry.target, entry);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
112
136
|
};
|
|
113
137
|
return {
|
|
114
138
|
disconnect: () => {
|
|
@@ -148,39 +172,24 @@ class Virtualizer {
|
|
|
148
172
|
initialRect: { width: 0, height: 0 },
|
|
149
173
|
scrollMargin: 0,
|
|
150
174
|
gap: 0,
|
|
151
|
-
scrollingDelay: 150,
|
|
152
175
|
indexAttribute: "data-index",
|
|
153
176
|
initialMeasurementsCache: [],
|
|
154
177
|
lanes: 1,
|
|
178
|
+
isScrollingResetDelay: 150,
|
|
155
179
|
...opts2
|
|
156
180
|
};
|
|
157
181
|
};
|
|
158
|
-
this.notify = (sync) => {
|
|
182
|
+
this.notify = (force, sync) => {
|
|
159
183
|
var _a, _b;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
this.range ? this.range.startIndex : null,
|
|
168
|
-
this.range ? this.range.endIndex : null
|
|
169
|
-
];
|
|
170
|
-
},
|
|
171
|
-
(isScrolling) => {
|
|
172
|
-
this.notify(isScrolling);
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
176
|
-
debug: () => this.options.debug,
|
|
177
|
-
initialDeps: [
|
|
178
|
-
this.isScrolling,
|
|
179
|
-
this.range ? this.range.startIndex : null,
|
|
180
|
-
this.range ? this.range.endIndex : null
|
|
181
|
-
]
|
|
184
|
+
const { startIndex, endIndex } = this.range ?? {
|
|
185
|
+
startIndex: void 0,
|
|
186
|
+
endIndex: void 0
|
|
187
|
+
};
|
|
188
|
+
const range = this.calculateRange();
|
|
189
|
+
if (force || startIndex !== (range == null ? void 0 : range.startIndex) || endIndex !== (range == null ? void 0 : range.endIndex)) {
|
|
190
|
+
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);
|
|
182
191
|
}
|
|
183
|
-
|
|
192
|
+
};
|
|
184
193
|
this.cleanup = () => {
|
|
185
194
|
this.unsubs.filter(Boolean).forEach((d) => d());
|
|
186
195
|
this.unsubs = [];
|
|
@@ -194,10 +203,16 @@ class Virtualizer {
|
|
|
194
203
|
};
|
|
195
204
|
};
|
|
196
205
|
this._willUpdate = () => {
|
|
206
|
+
var _a;
|
|
197
207
|
const scrollElement = this.options.getScrollElement();
|
|
198
208
|
if (this.scrollElement !== scrollElement) {
|
|
199
209
|
this.cleanup();
|
|
200
210
|
this.scrollElement = scrollElement;
|
|
211
|
+
if (this.scrollElement && "ownerDocument" in this.scrollElement) {
|
|
212
|
+
this.targetWindow = this.scrollElement.ownerDocument.defaultView;
|
|
213
|
+
} else {
|
|
214
|
+
this.targetWindow = ((_a = this.scrollElement) == null ? void 0 : _a.window) ?? null;
|
|
215
|
+
}
|
|
201
216
|
this._scrollToOffset(this.scrollOffset, {
|
|
202
217
|
adjustments: void 0,
|
|
203
218
|
behavior: void 0
|
|
@@ -205,29 +220,17 @@ class Virtualizer {
|
|
|
205
220
|
this.unsubs.push(
|
|
206
221
|
this.options.observeElementRect(this, (rect) => {
|
|
207
222
|
this.scrollRect = rect;
|
|
208
|
-
this.
|
|
223
|
+
this.notify(false, false);
|
|
209
224
|
})
|
|
210
225
|
);
|
|
211
226
|
this.unsubs.push(
|
|
212
|
-
this.options.observeElementOffset(this, (offset) => {
|
|
227
|
+
this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
213
228
|
this.scrollAdjustments = 0;
|
|
214
|
-
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (this.isScrollingTimeoutId !== null) {
|
|
218
|
-
clearTimeout(this.isScrollingTimeoutId);
|
|
219
|
-
this.isScrollingTimeoutId = null;
|
|
220
|
-
}
|
|
221
|
-
this.isScrolling = true;
|
|
222
|
-
this.scrollDirection = this.scrollOffset < offset ? "forward" : "backward";
|
|
229
|
+
this.scrollDirection = isScrolling ? this.scrollOffset < offset ? "forward" : "backward" : null;
|
|
223
230
|
this.scrollOffset = offset;
|
|
224
|
-
this.
|
|
225
|
-
this.
|
|
226
|
-
|
|
227
|
-
this.isScrolling = false;
|
|
228
|
-
this.scrollDirection = null;
|
|
229
|
-
this.maybeNotify();
|
|
230
|
-
}, this.options.scrollingDelay);
|
|
231
|
+
const prevIsScrolling = this.isScrolling;
|
|
232
|
+
this.isScrolling = isScrolling;
|
|
233
|
+
this.notify(prevIsScrolling !== isScrolling, isScrolling);
|
|
231
234
|
})
|
|
232
235
|
);
|
|
233
236
|
}
|
|
@@ -235,7 +238,7 @@ class Virtualizer {
|
|
|
235
238
|
this.getSize = () => {
|
|
236
239
|
return this.scrollRect[this.options.horizontal ? "width" : "height"];
|
|
237
240
|
};
|
|
238
|
-
this.
|
|
241
|
+
this.getMeasurementOptions = memo(
|
|
239
242
|
() => [
|
|
240
243
|
this.options.count,
|
|
241
244
|
this.options.paddingStart,
|
|
@@ -283,7 +286,7 @@ class Virtualizer {
|
|
|
283
286
|
})[0] : void 0;
|
|
284
287
|
};
|
|
285
288
|
this.getMeasurements = memo(
|
|
286
|
-
() => [this.
|
|
289
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
287
290
|
({ count, paddingStart, scrollMargin, getItemKey }, itemSizeCache) => {
|
|
288
291
|
const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
289
292
|
this.pendingMeasuredCacheIndexes = [];
|
|
@@ -336,7 +339,8 @@ class Virtualizer {
|
|
|
336
339
|
],
|
|
337
340
|
(rangeExtractor, range, overscan, count) => {
|
|
338
341
|
return range === null ? [] : rangeExtractor({
|
|
339
|
-
|
|
342
|
+
startIndex: range.startIndex,
|
|
343
|
+
endIndex: range.endIndex,
|
|
340
344
|
overscan,
|
|
341
345
|
count
|
|
342
346
|
});
|
|
@@ -383,7 +387,7 @@ class Virtualizer {
|
|
|
383
387
|
const itemSize = this.itemSizeCache.get(item.key) ?? item.size;
|
|
384
388
|
const delta = size - itemSize;
|
|
385
389
|
if (delta !== 0) {
|
|
386
|
-
if (item.start < this.scrollOffset + this.scrollAdjustments) {
|
|
390
|
+
if (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.scrollOffset + this.scrollAdjustments) {
|
|
387
391
|
if (process.env.NODE_ENV !== "production" && this.options.debug) {
|
|
388
392
|
console.info("correction", delta);
|
|
389
393
|
}
|
|
@@ -394,7 +398,7 @@ class Virtualizer {
|
|
|
394
398
|
}
|
|
395
399
|
this.pendingMeasuredCacheIndexes.push(item.index);
|
|
396
400
|
this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
|
|
397
|
-
this.notify(false);
|
|
401
|
+
this.notify(true, false);
|
|
398
402
|
}
|
|
399
403
|
};
|
|
400
404
|
this.measureElement = (node) => {
|
|
@@ -470,8 +474,8 @@ class Virtualizer {
|
|
|
470
474
|
};
|
|
471
475
|
this.isDynamicMode = () => this.measureElementCache.size > 0;
|
|
472
476
|
this.cancelScrollToIndex = () => {
|
|
473
|
-
if (this.scrollToIndexTimeoutId !== null) {
|
|
474
|
-
clearTimeout(this.scrollToIndexTimeoutId);
|
|
477
|
+
if (this.scrollToIndexTimeoutId !== null && this.targetWindow) {
|
|
478
|
+
this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);
|
|
475
479
|
this.scrollToIndexTimeoutId = null;
|
|
476
480
|
}
|
|
477
481
|
};
|
|
@@ -497,8 +501,8 @@ class Virtualizer {
|
|
|
497
501
|
}
|
|
498
502
|
const [toOffset, align] = this.getOffsetForIndex(index, initialAlign);
|
|
499
503
|
this._scrollToOffset(toOffset, { adjustments: void 0, behavior });
|
|
500
|
-
if (behavior !== "smooth" && this.isDynamicMode()) {
|
|
501
|
-
this.scrollToIndexTimeoutId = setTimeout(() => {
|
|
504
|
+
if (behavior !== "smooth" && this.isDynamicMode() && this.targetWindow) {
|
|
505
|
+
this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
|
|
502
506
|
this.scrollToIndexTimeoutId = null;
|
|
503
507
|
const elementInDOM = this.measureElementCache.has(
|
|
504
508
|
this.options.getItemKey(index)
|
|
@@ -546,17 +550,18 @@ class Virtualizer {
|
|
|
546
550
|
this.options.scrollToFn(offset, { behavior, adjustments }, this);
|
|
547
551
|
};
|
|
548
552
|
this.measure = () => {
|
|
553
|
+
var _a, _b;
|
|
549
554
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
550
|
-
this.
|
|
555
|
+
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, false);
|
|
551
556
|
};
|
|
552
557
|
this.setOptions(opts);
|
|
553
558
|
this.scrollRect = this.options.initialRect;
|
|
554
|
-
this.scrollOffset = this.options.initialOffset;
|
|
559
|
+
this.scrollOffset = typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset;
|
|
555
560
|
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
556
561
|
this.measurementsCache.forEach((item) => {
|
|
557
562
|
this.itemSizeCache.set(item.key, item.size);
|
|
558
563
|
});
|
|
559
|
-
this.
|
|
564
|
+
this.notify(false, false);
|
|
560
565
|
}
|
|
561
566
|
}
|
|
562
567
|
const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
@@ -592,4 +597,4 @@ function calculateRange({
|
|
|
592
597
|
return { startIndex, endIndex };
|
|
593
598
|
}
|
|
594
599
|
|
|
595
|
-
export { Virtualizer, approxEqual, defaultKeyExtractor, defaultRangeExtractor, elementScroll, measureElement, memo, notUndefined, observeElementOffset, observeElementRect };
|
|
600
|
+
export { Virtualizer, approxEqual, debounce, defaultKeyExtractor, defaultRangeExtractor, elementScroll, measureElement, memo, notUndefined, observeElementOffset, observeElementRect };
|
|
@@ -52,5 +52,12 @@ function notUndefined(value, msg) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
const approxEqual = (a, b) => Math.abs(a - b) < 1;
|
|
55
|
+
const debounce = (targetWindow, fn, ms) => {
|
|
56
|
+
let timeoutId;
|
|
57
|
+
return function(...args) {
|
|
58
|
+
targetWindow.clearTimeout(timeoutId);
|
|
59
|
+
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
60
|
+
};
|
|
61
|
+
};
|
|
55
62
|
|
|
56
|
-
export { approxEqual, memo, notUndefined };
|
|
63
|
+
export { approxEqual, debounce, memo, notUndefined };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,WAAW,GAAG;IACxB,mCAAmC;IACnC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,MAAM;IA3BjB,mCAAmC;;IAEnC;;OAEG;;IAEH;;;OAGG;;IAEH,0DAA0D;;IAE1D;;OAEG;;IAEH;;;OAGG;;+
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,WAAW,GAAG;IACxB,mCAAmC;IACnC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,MAAM;IA3BjB,mCAAmC;;IAEnC;;OAEG;;IAEH;;;OAGG;;IAEH,0DAA0D;;IAE1D;;OAEG;;IAEH;;;OAGG;;+FA8CJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpText.d.ts","sourceRoot":"","sources":["../../../../src/components/HelpText/HelpText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,MAAM,aAAa,GAAG;IAC1B;;QAEI;IACJ,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GAAG,WAAW,GACb,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE1C,QAAA,MAAM,QAAQ;uEAQX,aAAa;;
|
|
1
|
+
{"version":3,"file":"HelpText.d.ts","sourceRoot":"","sources":["../../../../src/components/HelpText/HelpText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,MAAM,aAAa,GAAG;IAC1B;;QAEI;IACJ,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GAAG,WAAW,GACb,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE1C,QAAA,MAAM,QAAQ;uEAQX,aAAa;;CAoDf,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,SAAS,GAAG;IACtB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,WAAW,2CAAsC,CAAC;AAE/D,eAAO,MAAM,IAAI;IApCf,6CAA6C;;IAE7C,qBAAqB;;IAErB,+CAA+C;wBAC5B,MAAM,KAAK,IAAI;IAClC;;;OAGG;;+
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,SAAS,GAAG;IACtB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,WAAW,2CAAsC,CAAC;AAE/D,eAAO,MAAM,IAAI;IApCf,6CAA6C;;IAE7C,qBAAqB;;IAErB,+CAA+C;wBAC5B,MAAM,KAAK,IAAI;IAClC;;;OAGG;;+GA2EJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paragraph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Typography/Paragraph/Paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,yBAAyB;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;AAEzC,kEAAkE;AAClE,eAAO,MAAM,SAAS;IAnBpB;;;;;OAKG;;IAEH,yBAAyB;;IAEzB,2CAA2C;;IAE3C;;;OAGG;;+
|
|
1
|
+
{"version":3,"file":"Paragraph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Typography/Paragraph/Paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,yBAAyB;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;AAEzC,kEAAkE;AAClE,eAAO,MAAM,SAAS;IAnBpB;;;;;OAKG;;IAEH,yBAAyB;;IAEzB,2CAA2C;;IAE3C;;;OAGG;;+FAyBJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/Combobox/Option/Option.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAWpC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAElD,eAAO,MAAM,cAAc;IAfzB;;OAEG;WACI,MAAM;IACb;;OAEG;;IAEH;;;OAGG;;
|
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/Combobox/Option/Option.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAWpC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAElD,eAAO,MAAM,cAAc;IAfzB;;OAEG;WACI,MAAM;IACb;;OAEG;;IAEH;;;OAGG;;4FAyEJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/Combobox/internal/ComboboxInput.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ComboboxInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/Combobox/internal/ComboboxInput.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,KAAK,kBAAkB,GAAG;IACxB,eAAe,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;IACnD,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;CACrD,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,aAAa;4EAOvB,kBAAkB;;CAkIpB,CAAC;AAIF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCombobox.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Combobox/useCombobox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAID;;;;GAIG;AACH,eAAO,MAAM,MAAM,WAAY,MAAM,KAAG,MAEvC,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,MAE5C,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,MAEC,EACD,YAAY,GACb,EAAE,gBAAgB;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useCombobox.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Combobox/useCombobox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAID;;;;GAIG;AACH,eAAO,MAAM,MAAM,WAAY,MAAM,KAAG,MAEvC,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,MAE5C,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,MAEC,EACD,YAAY,GACb,EAAE,gBAAgB;;;;;;;;;;;;;;;EAyIlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digdir/designsystemet-react",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.8",
|
|
4
4
|
"description": "React components for Designsystemet",
|
|
5
5
|
"author": "Designsystemet team",
|
|
6
6
|
"repository": "https://github.com/digdir/designsystemet",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@floating-ui/react": "0.26.12",
|
|
31
31
|
"@navikt/aksel-icons": "^5.12.2",
|
|
32
32
|
"@radix-ui/react-slot": "^1.0.2",
|
|
33
|
-
"@tanstack/react-virtual": "^3.
|
|
33
|
+
"@tanstack/react-virtual": "^3.5.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"copyfiles": "^2.4.1",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"rollup": "^4.12.1",
|
|
40
40
|
"typescript": "^5.4.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "87591aa2ce0bbcb4fc451ddcbb2ae9f15cfcfeca"
|
|
43
43
|
}
|