@digdir/designsystemet-react 0.62.0 → 0.63.1
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/form/Checkbox/Checkbox.js +1 -1
- package/dist/cjs/components/form/Combobox/Combobox.js +13 -14
- package/dist/cjs/components/form/Combobox/Option/useComboboxOption.js +3 -2
- package/dist/cjs/components/form/Combobox/internal/ComboboxInput.js +4 -3
- package/dist/cjs/components/form/Combobox/internal/ComboboxNative.js +3 -3
- package/dist/cjs/components/form/Combobox/useCombobox.js +22 -6
- package/dist/cjs/components/form/Fieldset/Fieldset.js +1 -1
- package/dist/cjs/components/form/NativeSelect/NativeSelect.js +1 -1
- package/dist/cjs/components/form/Radio/Radio.js +1 -1
- package/dist/cjs/components/form/Switch/Switch.js +1 -1
- package/dist/cjs/components/form/Textarea/Textarea.js +1 -1
- package/dist/cjs/components/form/Textfield/Textfield.js +1 -1
- package/dist/cjs/node_modules/@radix-ui/react-slot/dist/index.js +1 -1
- package/dist/cjs/utilities/getSize.js +2 -0
- package/dist/esm/components/form/Checkbox/Checkbox.js +1 -1
- package/dist/esm/components/form/Combobox/Combobox.js +15 -16
- package/dist/esm/components/form/Combobox/Option/useComboboxOption.js +3 -2
- package/dist/esm/components/form/Combobox/internal/ComboboxInput.js +4 -3
- package/dist/esm/components/form/Combobox/internal/ComboboxNative.js +3 -3
- package/dist/esm/components/form/Combobox/useCombobox.js +21 -7
- package/dist/esm/components/form/Fieldset/Fieldset.js +1 -1
- package/dist/esm/components/form/NativeSelect/NativeSelect.js +1 -1
- package/dist/esm/components/form/Radio/Radio.js +1 -1
- package/dist/esm/components/form/Switch/Switch.js +1 -1
- package/dist/esm/components/form/Textarea/Textarea.js +1 -1
- package/dist/esm/components/form/Textfield/Textfield.js +1 -1
- package/dist/esm/node_modules/@radix-ui/react-slot/dist/index.js +1 -1
- package/dist/esm/utilities/getSize.js +2 -0
- package/dist/types/components/List/ListHeading.d.ts +1 -1
- package/dist/types/components/Typography/Heading/Heading.d.ts +3 -3
- package/dist/types/components/Typography/Heading/Heading.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/Option/useComboboxOption.d.ts +1 -1
- package/dist/types/components/form/Combobox/Option/useComboboxOption.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/internal/ComboboxInput.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/internal/ComboboxNative.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/useCombobox.d.ts +7 -0
- package/dist/types/components/form/Combobox/useCombobox.d.ts.map +1 -1
- package/dist/types/components/form/NativeSelect/NativeSelect.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.d.ts.map +1 -1
- package/dist/types/components/form/Textfield/Textfield.d.ts.map +1 -1
- package/dist/types/utilities/getSize.d.ts.map +1 -1
- package/package.json +2 -2
- /package/dist/cjs/node_modules/{@radix-ui/react-slot/node_modules/@babel → @babel}/runtime/helpers/esm/extends.js +0 -0
- /package/dist/esm/node_modules/{@radix-ui/react-slot/node_modules/@babel → @babel}/runtime/helpers/esm/extends.js +0 -0
|
@@ -21,7 +21,7 @@ const Checkbox = React.forwardRef((props, ref) => {
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
]);
|
|
24
|
-
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx('fds-checkbox', `fds-checkbox--${size}`,
|
|
24
|
+
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx('fds-checkbox', `fds-checkbox--${size}`, hasError && `fds-checkbox--error`, readOnly && `fds-checkbox--readonly`, className), style: style, children: [jsxRuntime.jsx("input", { className: `fds-checkbox__input`, ref: inputRef, ...objectUtils.omit(['size', 'error', 'indeterminate'], rest), ...inputProps, type: 'checkbox', disabled: inputProps.disabled, "aria-checked": rest.indeterminate ? 'mixed' : inputProps.checked }), children && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Label.Label, { className: `fds-checkbox__label`, htmlFor: inputProps.id, size: size, weight: 'regular', children: jsxRuntime.jsx("span", { children: children }) }), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: `fds-checkbox__description`, children: description }) }))] }))] }) }));
|
|
25
25
|
});
|
|
26
26
|
Checkbox.displayName = 'Checkbox';
|
|
27
27
|
|
|
@@ -28,7 +28,6 @@ const ComboboxComponent = React.forwardRef(({ value, initialValue = [], onValueC
|
|
|
28
28
|
const inputRef = React.useRef(null);
|
|
29
29
|
const portalRef = React.useRef(null);
|
|
30
30
|
const listRef = React.useRef([]);
|
|
31
|
-
const listId = React.useId();
|
|
32
31
|
const [inputValue, setInputValue] = React.useState(rest.inputValue || '');
|
|
33
32
|
const { selectedOptions, options, restChildren, interactiveChildren, customIds, filteredOptionsChildren, filteredOptions, setSelectedOptions, } = useCombobox.default({
|
|
34
33
|
children,
|
|
@@ -52,18 +51,18 @@ const ComboboxComponent = React.forwardRef(({ value, initialValue = [], onValueC
|
|
|
52
51
|
// if value is set, set input value to the label of the value
|
|
53
52
|
React.useEffect(() => {
|
|
54
53
|
if (value && value.length > 0 && !multiple) {
|
|
55
|
-
const option = options[value[0]];
|
|
54
|
+
const option = options[useCombobox.prefix(value[0])];
|
|
56
55
|
setInputValue(option?.label || '');
|
|
57
56
|
}
|
|
58
57
|
}, [multiple, value, options]);
|
|
59
58
|
React.useEffect(() => {
|
|
60
59
|
if (value && Object.keys(options).length >= 0) {
|
|
61
60
|
const updatedSelectedOptions = value.map((option) => {
|
|
62
|
-
const value = options[option];
|
|
61
|
+
const value = options[useCombobox.prefix(option)];
|
|
63
62
|
return value;
|
|
64
63
|
});
|
|
65
64
|
setSelectedOptions(updatedSelectedOptions.reduce((acc, value) => {
|
|
66
|
-
acc[value.value] = value;
|
|
65
|
+
acc[useCombobox.prefix(value.value)] = value;
|
|
67
66
|
return acc;
|
|
68
67
|
}, {}));
|
|
69
68
|
}
|
|
@@ -81,18 +80,18 @@ const ComboboxComponent = React.forwardRef(({ value, initialValue = [], onValueC
|
|
|
81
80
|
return;
|
|
82
81
|
if (remove) {
|
|
83
82
|
const newSelectedOptions = { ...selectedOptions };
|
|
84
|
-
delete newSelectedOptions[option.value];
|
|
83
|
+
delete newSelectedOptions[useCombobox.prefix(option.value)];
|
|
85
84
|
setSelectedOptions(newSelectedOptions);
|
|
86
|
-
onValueChange?.(Object.keys(newSelectedOptions));
|
|
85
|
+
onValueChange?.(Object.keys(newSelectedOptions).map((key) => useCombobox.removePrefix(key)));
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
88
|
const newSelectedOptions = { ...selectedOptions };
|
|
90
89
|
if (multiple) {
|
|
91
|
-
if (newSelectedOptions[option.value]) {
|
|
92
|
-
delete newSelectedOptions[option.value];
|
|
90
|
+
if (newSelectedOptions[useCombobox.prefix(option.value)]) {
|
|
91
|
+
delete newSelectedOptions[useCombobox.prefix(option.value)];
|
|
93
92
|
}
|
|
94
93
|
else {
|
|
95
|
-
newSelectedOptions[option.value] = option;
|
|
94
|
+
newSelectedOptions[useCombobox.prefix(option.value)] = option;
|
|
96
95
|
}
|
|
97
96
|
setInputValue('');
|
|
98
97
|
inputRef.current?.focus();
|
|
@@ -102,7 +101,7 @@ const ComboboxComponent = React.forwardRef(({ value, initialValue = [], onValueC
|
|
|
102
101
|
Object.keys(newSelectedOptions).forEach((key) => {
|
|
103
102
|
delete newSelectedOptions[key];
|
|
104
103
|
});
|
|
105
|
-
newSelectedOptions[option.value] = option;
|
|
104
|
+
newSelectedOptions[useCombobox.prefix(option.value)] = option;
|
|
106
105
|
setInputValue(option?.label || '');
|
|
107
106
|
// move cursor to the end of the input
|
|
108
107
|
setTimeout(() => {
|
|
@@ -110,7 +109,7 @@ const ComboboxComponent = React.forwardRef(({ value, initialValue = [], onValueC
|
|
|
110
109
|
}, 0);
|
|
111
110
|
}
|
|
112
111
|
setSelectedOptions(newSelectedOptions);
|
|
113
|
-
onValueChange?.(Object.keys(newSelectedOptions));
|
|
112
|
+
onValueChange?.(Object.keys(newSelectedOptions).map((key) => useCombobox.removePrefix(key)));
|
|
114
113
|
!multiple && setOpen(false);
|
|
115
114
|
refs.domReference.current?.focus();
|
|
116
115
|
};
|
|
@@ -136,7 +135,7 @@ const ComboboxComponent = React.forwardRef(({ value, initialValue = [], onValueC
|
|
|
136
135
|
measureElement: (elem) => {
|
|
137
136
|
return elem.getBoundingClientRect().height;
|
|
138
137
|
},
|
|
139
|
-
overscan:
|
|
138
|
+
overscan: 7,
|
|
140
139
|
});
|
|
141
140
|
return (jsxRuntime.jsxs(ComboboxContext.ComboboxContext.Provider, { value: {
|
|
142
141
|
size,
|
|
@@ -164,14 +163,14 @@ const ComboboxComponent = React.forwardRef(({ value, initialValue = [], onValueC
|
|
|
164
163
|
return;
|
|
165
164
|
if (disabled)
|
|
166
165
|
return;
|
|
167
|
-
const option = options[value];
|
|
166
|
+
const option = options[useCombobox.prefix(value)];
|
|
168
167
|
debouncedHandleSelectOption({ option: option });
|
|
169
168
|
},
|
|
170
169
|
handleSelectOption: debouncedHandleSelectOption,
|
|
171
170
|
chipSrLabel,
|
|
172
171
|
listRef,
|
|
173
172
|
forwareddRef,
|
|
174
|
-
}, children: [jsxRuntime.jsxs(Box.Box, { className: lite.clsx('fds-combobox', `fds-combobox--${size}`, disabled && 'fds-combobox__disabled', className), style: style, ref: portalRef, children: [name && (jsxRuntime.jsx(ComboboxNative.default, { name: name, selectedOptions: selectedOptions, multiple: multiple })), jsxRuntime.jsx(ComboboxLabel.default, { label: label, description: description, size: size, readOnly: readOnly, hideLabel: hideLabel, formFieldProps: formFieldProps }), jsxRuntime.jsx(ComboboxInput.default, { ...objectUtils.omit(['inputValue'], rest), hideClearButton: hideClearButton, listId:
|
|
173
|
+
}, children: [jsxRuntime.jsxs(Box.Box, { className: lite.clsx('fds-combobox', `fds-combobox--${size}`, disabled && 'fds-combobox__disabled', className), style: style, ref: portalRef, children: [name && (jsxRuntime.jsx(ComboboxNative.default, { name: name, selectedOptions: selectedOptions, multiple: multiple })), jsxRuntime.jsx(ComboboxLabel.default, { label: label, description: description, size: size, readOnly: readOnly, hideLabel: hideLabel, formFieldProps: formFieldProps }), jsxRuntime.jsx(ComboboxInput.default, { ...objectUtils.omit(['inputValue'], rest), hideClearButton: hideClearButton, listId: context.floatingId, error: error, hideChips: hideChips, handleKeyDown: handleKeyDown, "aria-busy": loading }), jsxRuntime.jsx(ComboboxError.default, { size: size, error: error, formFieldProps: formFieldProps })] }), open && (jsxRuntime.jsx(floatingUi_react.FloatingPortal, { root: portal ? null : portalRef, children: jsxRuntime.jsx(floatingUi_react.FloatingFocusManager, { context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: jsxRuntime.jsxs(Box.Box, { shadow: 'md', borderRadius: 'md', borderColor: 'default', "aria-labelledby": formFieldProps.inputProps.id, "aria-autocomplete": 'list', tabIndex: -1, ...getFloatingProps({
|
|
175
174
|
ref: refs.setFloating,
|
|
176
175
|
style: {
|
|
177
176
|
...floatingStyles,
|
|
@@ -6,6 +6,7 @@ var floatingUi_react = require('../../../../node_modules/@floating-ui/react/dist
|
|
|
6
6
|
var ComboboxContext = require('../ComboboxContext.js');
|
|
7
7
|
var useDebounce = require('../../../../utilities/useDebounce.js');
|
|
8
8
|
var ComboboxIdContext = require('../ComboboxIdContext.js');
|
|
9
|
+
var useCombobox = require('../useCombobox.js');
|
|
9
10
|
|
|
10
11
|
function useComboboxOption({ id, ref, value, }) {
|
|
11
12
|
const generatedId = React.useId();
|
|
@@ -17,7 +18,7 @@ function useComboboxOption({ id, ref, value, }) {
|
|
|
17
18
|
throw new Error('ComboboxOption must be used within a Combobox');
|
|
18
19
|
}
|
|
19
20
|
const { selectedOptions, onOptionClick, listRef, customIds, filteredOptions, } = context;
|
|
20
|
-
const index = React.useMemo(() => filteredOptions.indexOf(value) + customIds.length, [customIds.length, filteredOptions, value]);
|
|
21
|
+
const index = React.useMemo(() => filteredOptions.indexOf(useCombobox.prefix(String(value))) + customIds.length, [customIds.length, filteredOptions, value]);
|
|
21
22
|
const combinedRef = floatingUi_react.useMergeRefs([
|
|
22
23
|
(node) => {
|
|
23
24
|
listRef.current[index] = node;
|
|
@@ -27,7 +28,7 @@ function useComboboxOption({ id, ref, value, }) {
|
|
|
27
28
|
if (index === -1) {
|
|
28
29
|
throw new Error('Internal error: ComboboxOption did not find index');
|
|
29
30
|
}
|
|
30
|
-
const selected = selectedOptions[value];
|
|
31
|
+
const selected = selectedOptions[useCombobox.prefix(value)];
|
|
31
32
|
const active = activeIndex === index;
|
|
32
33
|
React.useEffect(() => {
|
|
33
34
|
if (active) {
|
|
@@ -10,6 +10,7 @@ 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');
|
|
13
14
|
var ComboboxChips = require('./ComboboxChips.js');
|
|
14
15
|
var ComboboxClearButton = require('./ComboboxClearButton.js');
|
|
15
16
|
var Box = require('../../../Box/Box.js');
|
|
@@ -32,10 +33,10 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
32
33
|
setInputValue(value);
|
|
33
34
|
setActiveIndex(0);
|
|
34
35
|
// check if input value is the same as a label, if so, select it
|
|
35
|
-
const option = options[value.toLowerCase()];
|
|
36
|
+
const option = options[useCombobox.prefix(value.toLowerCase())];
|
|
36
37
|
if (!option)
|
|
37
38
|
return;
|
|
38
|
-
if (selectedOptions[option.value])
|
|
39
|
+
if (selectedOptions[useCombobox.prefix(option.value)])
|
|
39
40
|
return;
|
|
40
41
|
handleSelectOption({ option: option });
|
|
41
42
|
};
|
|
@@ -66,7 +67,7 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
69
|
});
|
|
69
|
-
return (jsxRuntime.jsxs(Box.Box, { ...props, "aria-disabled": disabled, className: lite.clsx('fds-textfield__input', 'fds-combobox__input__wrapper', readOnly && 'fds-combobox--readonly', error && 'fds-combobox--error'), children: [jsxRuntime.jsxs("div", { className: 'fds-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: 'fds-combobox__input', onChange: (e) => {
|
|
70
|
+
return (jsxRuntime.jsxs(Box.Box, { ...props, "aria-disabled": disabled, className: lite.clsx('fds-textfield__input', 'fds-combobox__input__wrapper', readOnly && 'fds-combobox--readonly', error && 'fds-combobox--error'), children: [jsxRuntime.jsxs("div", { className: 'fds-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": open ? listId : undefined, autoComplete: 'off', size: htmlSize, value: inputValue, ...objectUtils.omit(['style', 'className'], rest), ...formFieldProps.inputProps, className: 'fds-combobox__input', onChange: (e) => {
|
|
70
71
|
onChange(e);
|
|
71
72
|
!open && setOpen(true);
|
|
72
73
|
rest.onChange && rest.onChange(e);
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var useCombobox = require('../useCombobox.js');
|
|
7
8
|
|
|
8
9
|
const ComboboxNative = ({ selectedOptions, multiple, name, }) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
: Object.keys(selectedOptions)[0], onChange: () => { }, children: Object.keys(selectedOptions).map((value) => (jsxRuntime.jsx("option", { value: value }, value))) }));
|
|
10
|
+
const VALUE = Object.keys(selectedOptions).map((key) => useCombobox.removePrefix(key));
|
|
11
|
+
return (jsxRuntime.jsx("select", { name: name, multiple: multiple, style: { display: 'none' }, value: multiple ? VALUE : VALUE[0], onChange: () => { }, children: VALUE.map((value) => (jsxRuntime.jsx("option", { value: value }, value))) }));
|
|
12
12
|
};
|
|
13
13
|
ComboboxNative.displayName = 'ComboboxNative';
|
|
14
14
|
var ComboboxNative$1 = ComboboxNative;
|
|
@@ -17,6 +17,18 @@ function isComboboxCustom(child) {
|
|
|
17
17
|
function isInteractiveComboboxCustom(child) {
|
|
18
18
|
return isComboboxCustom(child) && child.props.interactive === true;
|
|
19
19
|
}
|
|
20
|
+
const INTERNAL_OPTION_PREFIX = 'internal-option-';
|
|
21
|
+
/**
|
|
22
|
+
* We use this function to prefix the value of the options so we can make sure numbers as strings are not parsed as numbers in objects
|
|
23
|
+
* @param value
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
const prefix = (value) => {
|
|
27
|
+
return INTERNAL_OPTION_PREFIX + value;
|
|
28
|
+
};
|
|
29
|
+
const removePrefix = (value) => {
|
|
30
|
+
return value.slice(INTERNAL_OPTION_PREFIX.length);
|
|
31
|
+
};
|
|
20
32
|
function useCombobox({ children, inputValue, multiple, filter = (inputValue, option) => {
|
|
21
33
|
return option.label.toLowerCase().startsWith(inputValue.toLowerCase());
|
|
22
34
|
}, initialValue, }) {
|
|
@@ -64,8 +76,8 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
64
76
|
});
|
|
65
77
|
label = childrenLabel;
|
|
66
78
|
}
|
|
67
|
-
allOptions[props.value] = {
|
|
68
|
-
value: props.value,
|
|
79
|
+
allOptions[prefix(String(props.value))] = {
|
|
80
|
+
value: String(props.value),
|
|
69
81
|
label,
|
|
70
82
|
displayValue: props.displayValue,
|
|
71
83
|
description: props.description,
|
|
@@ -73,7 +85,9 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
73
85
|
});
|
|
74
86
|
return allOptions;
|
|
75
87
|
}, [optionsChildren]);
|
|
76
|
-
const preSelectedOptions = React.useMemo(() => (initialValue
|
|
88
|
+
const preSelectedOptions = React.useMemo(() => (initialValue?.map((key) => {
|
|
89
|
+
return prefix(key);
|
|
90
|
+
}) || []).reduce((acc, value) => {
|
|
77
91
|
const option = options[value];
|
|
78
92
|
if (isOption(option)) {
|
|
79
93
|
acc[value] = option;
|
|
@@ -86,15 +100,15 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
86
100
|
const filteredOptionsChildren = Object.keys(options).map((option, index) => {
|
|
87
101
|
/* If we have a selected value in single mode and the input matches an option, return all children */
|
|
88
102
|
if (!multiple && Object.keys(selectedOptions).length === 1) {
|
|
89
|
-
filteredOptions.push(
|
|
103
|
+
filteredOptions.push(option);
|
|
90
104
|
return optionsChildren[index];
|
|
91
105
|
}
|
|
92
106
|
if (multiple && selectedOptions[option]) {
|
|
93
|
-
filteredOptions.push(
|
|
107
|
+
filteredOptions.push(option);
|
|
94
108
|
return optionsChildren[index];
|
|
95
109
|
}
|
|
96
110
|
if (filter(inputValue, options[option])) {
|
|
97
|
-
filteredOptions.push(
|
|
111
|
+
filteredOptions.push(option);
|
|
98
112
|
return optionsChildren[index];
|
|
99
113
|
}
|
|
100
114
|
});
|
|
@@ -117,3 +131,5 @@ exports.default = useCombobox;
|
|
|
117
131
|
exports.isComboboxCustom = isComboboxCustom;
|
|
118
132
|
exports.isComboboxOption = isComboboxOption;
|
|
119
133
|
exports.isInteractiveComboboxCustom = isInteractiveComboboxCustom;
|
|
134
|
+
exports.prefix = prefix;
|
|
135
|
+
exports.removePrefix = removePrefix;
|
|
@@ -21,7 +21,7 @@ const Fieldset = React.forwardRef((props, ref) => {
|
|
|
21
21
|
size,
|
|
22
22
|
disabled: props?.disabled,
|
|
23
23
|
readOnly,
|
|
24
|
-
}, children: jsxRuntime.jsxs("fieldset", { ...fieldsetProps, className: lite.clsx('fds-fieldset', !hideLegend && 'fds-fieldset--spacing', readOnly && 'fds-fieldset--readonly', props?.disabled
|
|
24
|
+
}, children: jsxRuntime.jsxs("fieldset", { ...fieldsetProps, className: lite.clsx('fds-fieldset', !hideLegend && 'fds-fieldset--spacing', readOnly && 'fds-fieldset--readonly', className), disabled: props?.disabled, ref: ref, ...rest, children: [jsxRuntime.jsx(Label.Label, { asChild: true, size: size, children: jsxRuntime.jsx("legend", { className: 'fds-fieldset__legend', children: jsxRuntime.jsxs("span", { className: lite.clsx('fds-fieldset__legend__content', hideLegend && `fds-sr-only`), children: [readOnly && (jsxRuntime.jsx(akselIcons.PadlockLockedFillIcon, { className: 'fds-fieldset__readonly__icon', "aria-hidden": true })), legend] }) }) }), description && (jsxRuntime.jsx(Paragraph.Paragraph, { size: size, variant: 'short', asChild: true, children: jsxRuntime.jsx("div", { id: descriptionId, className: lite.clsx('fds-fieldset__description', hideLegend && `fds-sr-only`), children: description }) })), children, jsxRuntime.jsx("div", { id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', className: 'fds-fieldset__error-message', children: hasError && jsxRuntime.jsx(ErrorMessage.ErrorMessage, { size: size, children: error }) })] }) }));
|
|
25
25
|
});
|
|
26
26
|
Fieldset.displayName = 'Fieldset';
|
|
27
27
|
|
|
@@ -14,7 +14,7 @@ var Paragraph = require('../../Typography/Paragraph/Paragraph.js');
|
|
|
14
14
|
const NativeSelect = React.forwardRef((props, ref) => {
|
|
15
15
|
const { children, disabled = false, label, description, hideLabel = false, error, className, htmlSize = 0, ...rest } = props;
|
|
16
16
|
const { selectProps, descriptionId, errorId, readOnly = false, size = 'md', } = useNativeSelect.useNativeSelect(props);
|
|
17
|
-
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx('fds-native-select--container',
|
|
17
|
+
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx('fds-native-select--container', readOnly && 'fds-native-select--readonly', error && 'fds-native-select--error'), children: [label && (jsxRuntime.jsxs(Label.Label, { weight: 'medium', size: size, htmlFor: selectProps.id, className: lite.clsx('fds-native-select__label', hideLabel && 'fds-sr-only'), children: [readOnly && (jsxRuntime.jsx(akselIcons.PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-native-select__readonly__icon' })), label] })), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: lite.clsx(`fds-native-select__description`, hideLabel && `fds-sr-only`), children: description }) })), jsxRuntime.jsx("select", { disabled: disabled || readOnly, ref: ref, size: htmlSize, className: lite.clsx('fds-native-select', `fds-native-select--${size}`, `fds-focus`, props.multiple && 'fds-native-select--multiple', className), ...objectUtils.omit(['size', 'error', 'errorId'], rest), ...objectUtils.omit(['readOnly', 'disabled'], selectProps), children: children }), error && (jsxRuntime.jsx("div", { id: errorId, className: 'fds-native-select__error-message', "aria-live": 'polite', "aria-relevant": 'additions removals', children: jsxRuntime.jsx(ErrorMessage.ErrorMessage, { size: size, children: error }) }))] }) }));
|
|
18
18
|
});
|
|
19
19
|
NativeSelect.displayName = 'NativeSelect';
|
|
20
20
|
|
|
@@ -12,7 +12,7 @@ var Label = require('../../Typography/Label/Label.js');
|
|
|
12
12
|
const Radio = React.forwardRef((props, ref) => {
|
|
13
13
|
const { children, description, className, style, ...rest } = props;
|
|
14
14
|
const { inputProps, descriptionId, hasError, size = 'md', readOnly, } = useRadio.useRadio(props);
|
|
15
|
-
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx('fds-radio', `fds-radio--${size}`,
|
|
15
|
+
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx('fds-radio', `fds-radio--${size}`, hasError && `fds-radio--error`, readOnly && `fds-radio--readonly`, className), style: style, children: [jsxRuntime.jsx("input", { className: 'fds-radio__input', disabled: inputProps.disabled, ref: ref, ...objectUtils.omit(['size', 'error'], rest), ...inputProps }), children && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Label.Label, { className: 'fds-radio__label', htmlFor: inputProps.id, size: size, weight: 'regular', children: jsxRuntime.jsx("span", { children: children }) }), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: 'fds-radio__description', children: description }) }))] }))] }) }));
|
|
16
16
|
});
|
|
17
17
|
Radio.displayName = 'Radio';
|
|
18
18
|
|
|
@@ -13,7 +13,7 @@ var Label = require('../../Typography/Label/Label.js');
|
|
|
13
13
|
const Switch = React.forwardRef((props, ref) => {
|
|
14
14
|
const { children, description, position = 'left', className, ...rest } = props;
|
|
15
15
|
const { inputProps, descriptionId, size = 'md', readOnly, } = useSwitch.useSwitch(props);
|
|
16
|
-
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx(`fds-switch`, `fds-switch--${size}`, inputProps.disabled && `fds-switch--disabled`, readOnly && `fds-switch--readonly`, className), children: [jsxRuntime.jsx("input", { className: `fds-switch__input`, ref: ref, ...objectUtils.omit(['size', 'error'], rest), ...inputProps }), jsxRuntime.jsxs(Label.Label, { className: lite.clsx(`fds-switch__label`, position === 'right' && `fds-switch__label--right`), htmlFor: inputProps.id, size: size, weight: 'regular', children: [jsxRuntime.jsx("span", { className: `fds-switch__track`, children: jsxRuntime.jsx("span", { className: `fds-switch__thumb` }) }), readOnly && (jsxRuntime.jsx(akselIcons.PadlockLockedFillIcon, { "aria-hidden": true, className: `fds-switch__readonly__icon` })), children && jsxRuntime.jsx("span", { children: children })] }), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: `fds-switch__description`, children: description }) }))] }) }));
|
|
16
|
+
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx(`fds-switch`, `fds-switch--${size}`, inputProps.disabled && `fds-switch--disabled`, readOnly && `fds-switch--readonly`, className), children: [jsxRuntime.jsx("input", { className: `fds-switch__input`, disabled: inputProps.disabled, ref: ref, ...objectUtils.omit(['size', 'error'], rest), ...inputProps }), jsxRuntime.jsxs(Label.Label, { className: lite.clsx(`fds-switch__label`, position === 'right' && `fds-switch__label--right`), htmlFor: inputProps.id, size: size, weight: 'regular', children: [jsxRuntime.jsx("span", { className: `fds-switch__track`, children: jsxRuntime.jsx("span", { className: `fds-switch__thumb` }) }), readOnly && (jsxRuntime.jsx(akselIcons.PadlockLockedFillIcon, { "aria-hidden": true, className: `fds-switch__readonly__icon` })), children && jsxRuntime.jsx("span", { children: children })] }), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: `fds-switch__description`, children: description }) }))] }) }));
|
|
17
17
|
});
|
|
18
18
|
Switch.displayName = 'Switch';
|
|
19
19
|
|
|
@@ -26,7 +26,7 @@ const Textarea = React.forwardRef((props, ref) => {
|
|
|
26
26
|
const characterLimitId = `${textareaProps.id}-charactercount}`;
|
|
27
27
|
const hasCharacterLimit = characterLimit != null;
|
|
28
28
|
const describedBy = lite.clsx(textareaProps['aria-describedby'], hasCharacterLimit && characterLimitId) || undefined;
|
|
29
|
-
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { style: style, className: lite.clsx('fds-textarea', `fds-textarea--${size}`,
|
|
29
|
+
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { style: style, className: lite.clsx('fds-textarea', `fds-textarea--${size}`, hasError && `fds-textarea--error`, className), children: [label && (jsxRuntime.jsxs(Label.Label, { size: size, weight: 'medium', htmlFor: textareaProps.id, className: lite.clsx('fds-textarea__label', hideLabel && `fds-sr-only`), children: [readOnly && (jsxRuntime.jsx(akselIcons.PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-textarea__readonly-icon' })), jsxRuntime.jsx("span", { children: label })] })), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: lite.clsx('fds-textarea__description', hideLabel && `fds-sr-only`), children: description }) })), jsxRuntime.jsx("textarea", { className: lite.clsx('fds-textarea__input', `fds-focus`), ref: ref, "aria-describedby": describedBy, disabled: textareaProps.disabled, readOnly: readOnly, ...objectUtils.omit(['size', 'error', 'errorId'], rest), ...textareaProps, onChange: (e) => {
|
|
30
30
|
textareaProps?.onChange?.(e);
|
|
31
31
|
setValue(e.target.value);
|
|
32
32
|
} }), hasCharacterLimit && (jsxRuntime.jsx(CharacterCounter.CharacterCounter, { size: size, value: value ? value.toString() : '', id: characterLimitId, ...characterLimit })), jsxRuntime.jsx("div", { className: 'fds-textarea__error-message', id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', children: hasError && jsxRuntime.jsx(ErrorMessage.ErrorMessage, { size: size, children: props.error }) })] }) }));
|
|
@@ -26,7 +26,7 @@ const Textfield = React.forwardRef((props, ref) => {
|
|
|
26
26
|
const characterLimitId = `textfield-charactercount-${React.useId()}`;
|
|
27
27
|
const hasCharacterLimit = characterLimit != null;
|
|
28
28
|
const describedBy = lite.clsx(inputProps['aria-describedby'], hasCharacterLimit && characterLimitId) || undefined;
|
|
29
|
-
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { style: style, className: lite.clsx(`fds-textfield`, `fds-textfield--${size}`,
|
|
29
|
+
return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { style: style, className: lite.clsx(`fds-textfield`, `fds-textfield--${size}`, readOnly && `fds-textfield--readonly`, hasError && `fds-textfield--error`, className), children: [label && (jsxRuntime.jsxs(Label.Label, { size: size, weight: 'medium', htmlFor: inputProps.id, className: lite.clsx(`fds-textfield__label`, hideLabel && `fds-sr-only`), children: [readOnly && (jsxRuntime.jsx(akselIcons.PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-textfield__readonly__icon' })), jsxRuntime.jsx("span", { children: label })] })), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: lite.clsx(`fds-textfield__description`, hideLabel && `fds-sr-only`), children: description }) })), jsxRuntime.jsxs("div", { className: 'fds-textfield__field', children: [prefix && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, variant: 'short', children: jsxRuntime.jsx("div", { className: lite.clsx(`fds-textfield__adornment`, `fds-textfield__prefix`), "aria-hidden": 'true', children: prefix }) })), jsxRuntime.jsx("input", { className: lite.clsx(`fds-textfield__input`, `fds-focus`, prefix && `fds-textfield__input--with-prefix`, suffix && `fds-textfield__input--with-suffix`), ref: ref, type: type, disabled: inputProps.disabled, "aria-describedby": describedBy, size: htmlSize, ...objectUtils.omit(['size', 'error', 'errorId'], rest), ...inputProps, onChange: (e) => {
|
|
30
30
|
inputProps?.onChange?.(e);
|
|
31
31
|
setInputValue(e.target.value);
|
|
32
32
|
} }), suffix && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, variant: 'short', children: jsxRuntime.jsx("div", { className: lite.clsx(`fds-textfield__adornment`, `fds-textfield__suffix`), "aria-hidden": 'true', children: suffix }) }))] }), hasCharacterLimit && (jsxRuntime.jsx(CharacterCounter.CharacterCounter, { size: size, value: inputValue ? inputValue.toString() : '', id: characterLimitId, ...characterLimit })), jsxRuntime.jsx("div", { className: 'fds-textfield__error-message', id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', children: hasError && jsxRuntime.jsx(ErrorMessage.ErrorMessage, { size: size, children: props.error }) })] }) }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var _extends = require('
|
|
4
|
+
var _extends = require('../../../@babel/runtime/helpers/esm/extends.js');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var index = require('../../react-compose-refs/dist/index.js');
|
|
7
7
|
|
|
@@ -19,7 +19,7 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
]);
|
|
22
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-checkbox', `fds-checkbox--${size}`,
|
|
22
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-checkbox', `fds-checkbox--${size}`, hasError && `fds-checkbox--error`, readOnly && `fds-checkbox--readonly`, className), style: style, children: [jsx("input", { className: `fds-checkbox__input`, ref: inputRef, ...omit(['size', 'error', 'indeterminate'], rest), ...inputProps, type: 'checkbox', disabled: inputProps.disabled, "aria-checked": rest.indeterminate ? 'mixed' : inputProps.checked }), children && (jsxs(Fragment, { children: [jsx(Label, { className: `fds-checkbox__label`, htmlFor: inputProps.id, size: size, weight: 'regular', children: jsx("span", { children: children }) }), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: `fds-checkbox__description`, children: description }) }))] }))] }) }));
|
|
23
23
|
});
|
|
24
24
|
Checkbox.displayName = 'Checkbox';
|
|
25
25
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useRef,
|
|
3
|
+
import { forwardRef, useRef, useState, useEffect } from 'react';
|
|
4
4
|
import { FloatingPortal, FloatingFocusManager } from '../../../node_modules/@floating-ui/react/dist/floating-ui.react.js';
|
|
5
5
|
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
6
6
|
import { useVirtualizer } from '../../../node_modules/@tanstack/react-virtual/dist/esm/index.js';
|
|
7
7
|
import { useFormField } from '../useFormField.js';
|
|
8
8
|
import useDebounce from '../../../utilities/useDebounce.js';
|
|
9
9
|
import { getSize } from '../../../utilities/getSize.js';
|
|
10
|
-
import useCombobox from './useCombobox.js';
|
|
10
|
+
import useCombobox, { prefix, removePrefix } from './useCombobox.js';
|
|
11
11
|
import ComboboxInput from './internal/ComboboxInput.js';
|
|
12
12
|
import ComboboxLabel from './internal/ComboboxLabel.js';
|
|
13
13
|
import ComboboxError from './internal/ComboboxError.js';
|
|
@@ -26,7 +26,6 @@ const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange,
|
|
|
26
26
|
const inputRef = useRef(null);
|
|
27
27
|
const portalRef = useRef(null);
|
|
28
28
|
const listRef = useRef([]);
|
|
29
|
-
const listId = useId();
|
|
30
29
|
const [inputValue, setInputValue] = useState(rest.inputValue || '');
|
|
31
30
|
const { selectedOptions, options, restChildren, interactiveChildren, customIds, filteredOptionsChildren, filteredOptions, setSelectedOptions, } = useCombobox({
|
|
32
31
|
children,
|
|
@@ -50,18 +49,18 @@ const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange,
|
|
|
50
49
|
// if value is set, set input value to the label of the value
|
|
51
50
|
useEffect(() => {
|
|
52
51
|
if (value && value.length > 0 && !multiple) {
|
|
53
|
-
const option = options[value[0]];
|
|
52
|
+
const option = options[prefix(value[0])];
|
|
54
53
|
setInputValue(option?.label || '');
|
|
55
54
|
}
|
|
56
55
|
}, [multiple, value, options]);
|
|
57
56
|
useEffect(() => {
|
|
58
57
|
if (value && Object.keys(options).length >= 0) {
|
|
59
58
|
const updatedSelectedOptions = value.map((option) => {
|
|
60
|
-
const value = options[option];
|
|
59
|
+
const value = options[prefix(option)];
|
|
61
60
|
return value;
|
|
62
61
|
});
|
|
63
62
|
setSelectedOptions(updatedSelectedOptions.reduce((acc, value) => {
|
|
64
|
-
acc[value.value] = value;
|
|
63
|
+
acc[prefix(value.value)] = value;
|
|
65
64
|
return acc;
|
|
66
65
|
}, {}));
|
|
67
66
|
}
|
|
@@ -79,18 +78,18 @@ const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange,
|
|
|
79
78
|
return;
|
|
80
79
|
if (remove) {
|
|
81
80
|
const newSelectedOptions = { ...selectedOptions };
|
|
82
|
-
delete newSelectedOptions[option.value];
|
|
81
|
+
delete newSelectedOptions[prefix(option.value)];
|
|
83
82
|
setSelectedOptions(newSelectedOptions);
|
|
84
|
-
onValueChange?.(Object.keys(newSelectedOptions));
|
|
83
|
+
onValueChange?.(Object.keys(newSelectedOptions).map((key) => removePrefix(key)));
|
|
85
84
|
return;
|
|
86
85
|
}
|
|
87
86
|
const newSelectedOptions = { ...selectedOptions };
|
|
88
87
|
if (multiple) {
|
|
89
|
-
if (newSelectedOptions[option.value]) {
|
|
90
|
-
delete newSelectedOptions[option.value];
|
|
88
|
+
if (newSelectedOptions[prefix(option.value)]) {
|
|
89
|
+
delete newSelectedOptions[prefix(option.value)];
|
|
91
90
|
}
|
|
92
91
|
else {
|
|
93
|
-
newSelectedOptions[option.value] = option;
|
|
92
|
+
newSelectedOptions[prefix(option.value)] = option;
|
|
94
93
|
}
|
|
95
94
|
setInputValue('');
|
|
96
95
|
inputRef.current?.focus();
|
|
@@ -100,7 +99,7 @@ const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange,
|
|
|
100
99
|
Object.keys(newSelectedOptions).forEach((key) => {
|
|
101
100
|
delete newSelectedOptions[key];
|
|
102
101
|
});
|
|
103
|
-
newSelectedOptions[option.value] = option;
|
|
102
|
+
newSelectedOptions[prefix(option.value)] = option;
|
|
104
103
|
setInputValue(option?.label || '');
|
|
105
104
|
// move cursor to the end of the input
|
|
106
105
|
setTimeout(() => {
|
|
@@ -108,7 +107,7 @@ const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange,
|
|
|
108
107
|
}, 0);
|
|
109
108
|
}
|
|
110
109
|
setSelectedOptions(newSelectedOptions);
|
|
111
|
-
onValueChange?.(Object.keys(newSelectedOptions));
|
|
110
|
+
onValueChange?.(Object.keys(newSelectedOptions).map((key) => removePrefix(key)));
|
|
112
111
|
!multiple && setOpen(false);
|
|
113
112
|
refs.domReference.current?.focus();
|
|
114
113
|
};
|
|
@@ -134,7 +133,7 @@ const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange,
|
|
|
134
133
|
measureElement: (elem) => {
|
|
135
134
|
return elem.getBoundingClientRect().height;
|
|
136
135
|
},
|
|
137
|
-
overscan:
|
|
136
|
+
overscan: 7,
|
|
138
137
|
});
|
|
139
138
|
return (jsxs(ComboboxContext.Provider, { value: {
|
|
140
139
|
size,
|
|
@@ -162,14 +161,14 @@ const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange,
|
|
|
162
161
|
return;
|
|
163
162
|
if (disabled)
|
|
164
163
|
return;
|
|
165
|
-
const option = options[value];
|
|
164
|
+
const option = options[prefix(value)];
|
|
166
165
|
debouncedHandleSelectOption({ option: option });
|
|
167
166
|
},
|
|
168
167
|
handleSelectOption: debouncedHandleSelectOption,
|
|
169
168
|
chipSrLabel,
|
|
170
169
|
listRef,
|
|
171
170
|
forwareddRef,
|
|
172
|
-
}, children: [jsxs(Box, { className: clsx('fds-combobox', `fds-combobox--${size}`, disabled && 'fds-combobox__disabled', className), style: style, ref: portalRef, children: [name && (jsx(ComboboxNative, { name: name, selectedOptions: selectedOptions, multiple: multiple })), jsx(ComboboxLabel, { label: label, description: description, size: size, readOnly: readOnly, hideLabel: hideLabel, formFieldProps: formFieldProps }), jsx(ComboboxInput, { ...omit(['inputValue'], rest), hideClearButton: hideClearButton, listId:
|
|
171
|
+
}, children: [jsxs(Box, { className: clsx('fds-combobox', `fds-combobox--${size}`, disabled && 'fds-combobox__disabled', className), style: style, ref: portalRef, children: [name && (jsx(ComboboxNative, { name: name, selectedOptions: selectedOptions, multiple: multiple })), jsx(ComboboxLabel, { label: label, description: description, size: size, readOnly: readOnly, hideLabel: hideLabel, formFieldProps: formFieldProps }), jsx(ComboboxInput, { ...omit(['inputValue'], rest), hideClearButton: hideClearButton, listId: context.floatingId, error: error, hideChips: hideChips, handleKeyDown: handleKeyDown, "aria-busy": loading }), jsx(ComboboxError, { size: size, error: error, formFieldProps: formFieldProps })] }), open && (jsx(FloatingPortal, { root: portal ? null : portalRef, children: jsx(FloatingFocusManager, { context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: jsxs(Box, { shadow: 'md', borderRadius: 'md', borderColor: 'default', "aria-labelledby": formFieldProps.inputProps.id, "aria-autocomplete": 'list', tabIndex: -1, ...getFloatingProps({
|
|
173
172
|
ref: refs.setFloating,
|
|
174
173
|
style: {
|
|
175
174
|
...floatingStyles,
|
|
@@ -4,6 +4,7 @@ import { useMergeRefs } from '../../../../node_modules/@floating-ui/react/dist/f
|
|
|
4
4
|
import { ComboboxContext } from '../ComboboxContext.js';
|
|
5
5
|
import useDebounce from '../../../../utilities/useDebounce.js';
|
|
6
6
|
import { useComboboxId, useComboboxIdDispatch } from '../ComboboxIdContext.js';
|
|
7
|
+
import { prefix } from '../useCombobox.js';
|
|
7
8
|
|
|
8
9
|
function useComboboxOption({ id, ref, value, }) {
|
|
9
10
|
const generatedId = useId();
|
|
@@ -15,7 +16,7 @@ function useComboboxOption({ id, ref, value, }) {
|
|
|
15
16
|
throw new Error('ComboboxOption must be used within a Combobox');
|
|
16
17
|
}
|
|
17
18
|
const { selectedOptions, onOptionClick, listRef, customIds, filteredOptions, } = context;
|
|
18
|
-
const index = useMemo(() => filteredOptions.indexOf(value) + customIds.length, [customIds.length, filteredOptions, value]);
|
|
19
|
+
const index = useMemo(() => filteredOptions.indexOf(prefix(String(value))) + customIds.length, [customIds.length, filteredOptions, value]);
|
|
19
20
|
const combinedRef = useMergeRefs([
|
|
20
21
|
(node) => {
|
|
21
22
|
listRef.current[index] = node;
|
|
@@ -25,7 +26,7 @@ function useComboboxOption({ id, ref, value, }) {
|
|
|
25
26
|
if (index === -1) {
|
|
26
27
|
throw new Error('Internal error: ComboboxOption did not find index');
|
|
27
28
|
}
|
|
28
|
-
const selected = selectedOptions[value];
|
|
29
|
+
const selected = selectedOptions[prefix(value)];
|
|
29
30
|
const active = activeIndex === index;
|
|
30
31
|
useEffect(() => {
|
|
31
32
|
if (active) {
|
|
@@ -6,6 +6,7 @@ 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';
|
|
9
10
|
import ComboboxChips from './ComboboxChips.js';
|
|
10
11
|
import ComboboxClearButton from './ComboboxClearButton.js';
|
|
11
12
|
import { Box } from '../../../Box/Box.js';
|
|
@@ -28,10 +29,10 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
28
29
|
setInputValue(value);
|
|
29
30
|
setActiveIndex(0);
|
|
30
31
|
// check if input value is the same as a label, if so, select it
|
|
31
|
-
const option = options[value.toLowerCase()];
|
|
32
|
+
const option = options[prefix(value.toLowerCase())];
|
|
32
33
|
if (!option)
|
|
33
34
|
return;
|
|
34
|
-
if (selectedOptions[option.value])
|
|
35
|
+
if (selectedOptions[prefix(option.value)])
|
|
35
36
|
return;
|
|
36
37
|
handleSelectOption({ option: option });
|
|
37
38
|
};
|
|
@@ -62,7 +63,7 @@ const ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDow
|
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
});
|
|
65
|
-
return (jsxs(Box, { ...props, "aria-disabled": disabled, className: clsx('fds-textfield__input', 'fds-combobox__input__wrapper', readOnly && 'fds-combobox--readonly', error && 'fds-combobox--error'), children: [jsxs("div", { className: 'fds-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: 'fds-combobox__input', onChange: (e) => {
|
|
66
|
+
return (jsxs(Box, { ...props, "aria-disabled": disabled, className: clsx('fds-textfield__input', 'fds-combobox__input__wrapper', readOnly && 'fds-combobox--readonly', error && 'fds-combobox--error'), children: [jsxs("div", { className: 'fds-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": open ? listId : undefined, autoComplete: 'off', size: htmlSize, value: inputValue, ...omit(['style', 'className'], rest), ...formFieldProps.inputProps, className: 'fds-combobox__input', onChange: (e) => {
|
|
66
67
|
onChange(e);
|
|
67
68
|
!open && setOpen(true);
|
|
68
69
|
rest.onChange && rest.onChange(e);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { removePrefix } from '../useCombobox.js';
|
|
3
4
|
|
|
4
5
|
const ComboboxNative = ({ selectedOptions, multiple, name, }) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
: Object.keys(selectedOptions)[0], onChange: () => { }, children: Object.keys(selectedOptions).map((value) => (jsx("option", { value: value }, value))) }));
|
|
6
|
+
const VALUE = Object.keys(selectedOptions).map((key) => removePrefix(key));
|
|
7
|
+
return (jsx("select", { name: name, multiple: multiple, style: { display: 'none' }, value: multiple ? VALUE : VALUE[0], onChange: () => { }, children: VALUE.map((value) => (jsx("option", { value: value }, value))) }));
|
|
8
8
|
};
|
|
9
9
|
ComboboxNative.displayName = 'ComboboxNative';
|
|
10
10
|
var ComboboxNative$1 = ComboboxNative;
|
|
@@ -13,6 +13,18 @@ function isComboboxCustom(child) {
|
|
|
13
13
|
function isInteractiveComboboxCustom(child) {
|
|
14
14
|
return isComboboxCustom(child) && child.props.interactive === true;
|
|
15
15
|
}
|
|
16
|
+
const INTERNAL_OPTION_PREFIX = 'internal-option-';
|
|
17
|
+
/**
|
|
18
|
+
* We use this function to prefix the value of the options so we can make sure numbers as strings are not parsed as numbers in objects
|
|
19
|
+
* @param value
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
const prefix = (value) => {
|
|
23
|
+
return INTERNAL_OPTION_PREFIX + value;
|
|
24
|
+
};
|
|
25
|
+
const removePrefix = (value) => {
|
|
26
|
+
return value.slice(INTERNAL_OPTION_PREFIX.length);
|
|
27
|
+
};
|
|
16
28
|
function useCombobox({ children, inputValue, multiple, filter = (inputValue, option) => {
|
|
17
29
|
return option.label.toLowerCase().startsWith(inputValue.toLowerCase());
|
|
18
30
|
}, initialValue, }) {
|
|
@@ -60,8 +72,8 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
60
72
|
});
|
|
61
73
|
label = childrenLabel;
|
|
62
74
|
}
|
|
63
|
-
allOptions[props.value] = {
|
|
64
|
-
value: props.value,
|
|
75
|
+
allOptions[prefix(String(props.value))] = {
|
|
76
|
+
value: String(props.value),
|
|
65
77
|
label,
|
|
66
78
|
displayValue: props.displayValue,
|
|
67
79
|
description: props.description,
|
|
@@ -69,7 +81,9 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
69
81
|
});
|
|
70
82
|
return allOptions;
|
|
71
83
|
}, [optionsChildren]);
|
|
72
|
-
const preSelectedOptions = useMemo(() => (initialValue
|
|
84
|
+
const preSelectedOptions = useMemo(() => (initialValue?.map((key) => {
|
|
85
|
+
return prefix(key);
|
|
86
|
+
}) || []).reduce((acc, value) => {
|
|
73
87
|
const option = options[value];
|
|
74
88
|
if (isOption(option)) {
|
|
75
89
|
acc[value] = option;
|
|
@@ -82,15 +96,15 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
82
96
|
const filteredOptionsChildren = Object.keys(options).map((option, index) => {
|
|
83
97
|
/* If we have a selected value in single mode and the input matches an option, return all children */
|
|
84
98
|
if (!multiple && Object.keys(selectedOptions).length === 1) {
|
|
85
|
-
filteredOptions.push(
|
|
99
|
+
filteredOptions.push(option);
|
|
86
100
|
return optionsChildren[index];
|
|
87
101
|
}
|
|
88
102
|
if (multiple && selectedOptions[option]) {
|
|
89
|
-
filteredOptions.push(
|
|
103
|
+
filteredOptions.push(option);
|
|
90
104
|
return optionsChildren[index];
|
|
91
105
|
}
|
|
92
106
|
if (filter(inputValue, options[option])) {
|
|
93
|
-
filteredOptions.push(
|
|
107
|
+
filteredOptions.push(option);
|
|
94
108
|
return optionsChildren[index];
|
|
95
109
|
}
|
|
96
110
|
});
|
|
@@ -109,4 +123,4 @@ function useCombobox({ children, inputValue, multiple, filter = (inputValue, opt
|
|
|
109
123
|
};
|
|
110
124
|
}
|
|
111
125
|
|
|
112
|
-
export { useCombobox as default, isComboboxCustom, isComboboxOption, isInteractiveComboboxCustom };
|
|
126
|
+
export { useCombobox as default, isComboboxCustom, isComboboxOption, isInteractiveComboboxCustom, prefix, removePrefix };
|
|
@@ -19,7 +19,7 @@ const Fieldset = forwardRef((props, ref) => {
|
|
|
19
19
|
size,
|
|
20
20
|
disabled: props?.disabled,
|
|
21
21
|
readOnly,
|
|
22
|
-
}, children: jsxs("fieldset", { ...fieldsetProps, className: clsx('fds-fieldset', !hideLegend && 'fds-fieldset--spacing', readOnly && 'fds-fieldset--readonly', props?.disabled
|
|
22
|
+
}, children: jsxs("fieldset", { ...fieldsetProps, className: clsx('fds-fieldset', !hideLegend && 'fds-fieldset--spacing', readOnly && 'fds-fieldset--readonly', className), disabled: props?.disabled, ref: ref, ...rest, children: [jsx(Label, { asChild: true, size: size, children: jsx("legend", { className: 'fds-fieldset__legend', children: jsxs("span", { className: clsx('fds-fieldset__legend__content', hideLegend && `fds-sr-only`), children: [readOnly && (jsx(PadlockLockedFillIcon, { className: 'fds-fieldset__readonly__icon', "aria-hidden": true })), legend] }) }) }), description && (jsx(Paragraph, { size: size, variant: 'short', asChild: true, children: jsx("div", { id: descriptionId, className: clsx('fds-fieldset__description', hideLegend && `fds-sr-only`), children: description }) })), children, jsx("div", { id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', className: 'fds-fieldset__error-message', children: hasError && jsx(ErrorMessage, { size: size, children: error }) })] }) }));
|
|
23
23
|
});
|
|
24
24
|
Fieldset.displayName = 'Fieldset';
|
|
25
25
|
|
|
@@ -12,7 +12,7 @@ import { Paragraph } from '../../Typography/Paragraph/Paragraph.js';
|
|
|
12
12
|
const NativeSelect = forwardRef((props, ref) => {
|
|
13
13
|
const { children, disabled = false, label, description, hideLabel = false, error, className, htmlSize = 0, ...rest } = props;
|
|
14
14
|
const { selectProps, descriptionId, errorId, readOnly = false, size = 'md', } = useNativeSelect(props);
|
|
15
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-native-select--container',
|
|
15
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-native-select--container', readOnly && 'fds-native-select--readonly', error && 'fds-native-select--error'), children: [label && (jsxs(Label, { weight: 'medium', size: size, htmlFor: selectProps.id, className: clsx('fds-native-select__label', hideLabel && 'fds-sr-only'), children: [readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-native-select__readonly__icon' })), label] })), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: clsx(`fds-native-select__description`, hideLabel && `fds-sr-only`), children: description }) })), jsx("select", { disabled: disabled || readOnly, ref: ref, size: htmlSize, className: clsx('fds-native-select', `fds-native-select--${size}`, `fds-focus`, props.multiple && 'fds-native-select--multiple', className), ...omit(['size', 'error', 'errorId'], rest), ...omit(['readOnly', 'disabled'], selectProps), children: children }), error && (jsx("div", { id: errorId, className: 'fds-native-select__error-message', "aria-live": 'polite', "aria-relevant": 'additions removals', children: jsx(ErrorMessage, { size: size, children: error }) }))] }) }));
|
|
16
16
|
});
|
|
17
17
|
NativeSelect.displayName = 'NativeSelect';
|
|
18
18
|
|
|
@@ -10,7 +10,7 @@ import { Label } from '../../Typography/Label/Label.js';
|
|
|
10
10
|
const Radio = forwardRef((props, ref) => {
|
|
11
11
|
const { children, description, className, style, ...rest } = props;
|
|
12
12
|
const { inputProps, descriptionId, hasError, size = 'md', readOnly, } = useRadio(props);
|
|
13
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-radio', `fds-radio--${size}`,
|
|
13
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-radio', `fds-radio--${size}`, hasError && `fds-radio--error`, readOnly && `fds-radio--readonly`, className), style: style, children: [jsx("input", { className: 'fds-radio__input', disabled: inputProps.disabled, ref: ref, ...omit(['size', 'error'], rest), ...inputProps }), children && (jsxs(Fragment, { children: [jsx(Label, { className: 'fds-radio__label', htmlFor: inputProps.id, size: size, weight: 'regular', children: jsx("span", { children: children }) }), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: 'fds-radio__description', children: description }) }))] }))] }) }));
|
|
14
14
|
});
|
|
15
15
|
Radio.displayName = 'Radio';
|
|
16
16
|
|
|
@@ -11,7 +11,7 @@ import { Label } from '../../Typography/Label/Label.js';
|
|
|
11
11
|
const Switch = forwardRef((props, ref) => {
|
|
12
12
|
const { children, description, position = 'left', className, ...rest } = props;
|
|
13
13
|
const { inputProps, descriptionId, size = 'md', readOnly, } = useSwitch(props);
|
|
14
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx(`fds-switch`, `fds-switch--${size}`, inputProps.disabled && `fds-switch--disabled`, readOnly && `fds-switch--readonly`, className), children: [jsx("input", { className: `fds-switch__input`, ref: ref, ...omit(['size', 'error'], rest), ...inputProps }), jsxs(Label, { className: clsx(`fds-switch__label`, position === 'right' && `fds-switch__label--right`), htmlFor: inputProps.id, size: size, weight: 'regular', children: [jsx("span", { className: `fds-switch__track`, children: jsx("span", { className: `fds-switch__thumb` }) }), readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: `fds-switch__readonly__icon` })), children && jsx("span", { children: children })] }), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: `fds-switch__description`, children: description }) }))] }) }));
|
|
14
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx(`fds-switch`, `fds-switch--${size}`, inputProps.disabled && `fds-switch--disabled`, readOnly && `fds-switch--readonly`, className), children: [jsx("input", { className: `fds-switch__input`, disabled: inputProps.disabled, ref: ref, ...omit(['size', 'error'], rest), ...inputProps }), jsxs(Label, { className: clsx(`fds-switch__label`, position === 'right' && `fds-switch__label--right`), htmlFor: inputProps.id, size: size, weight: 'regular', children: [jsx("span", { className: `fds-switch__track`, children: jsx("span", { className: `fds-switch__thumb` }) }), readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: `fds-switch__readonly__icon` })), children && jsx("span", { children: children })] }), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: `fds-switch__description`, children: description }) }))] }) }));
|
|
15
15
|
});
|
|
16
16
|
Switch.displayName = 'Switch';
|
|
17
17
|
|
|
@@ -24,7 +24,7 @@ const Textarea = forwardRef((props, ref) => {
|
|
|
24
24
|
const characterLimitId = `${textareaProps.id}-charactercount}`;
|
|
25
25
|
const hasCharacterLimit = characterLimit != null;
|
|
26
26
|
const describedBy = clsx(textareaProps['aria-describedby'], hasCharacterLimit && characterLimitId) || undefined;
|
|
27
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { style: style, className: clsx('fds-textarea', `fds-textarea--${size}`,
|
|
27
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { style: style, className: clsx('fds-textarea', `fds-textarea--${size}`, hasError && `fds-textarea--error`, className), children: [label && (jsxs(Label, { size: size, weight: 'medium', htmlFor: textareaProps.id, className: clsx('fds-textarea__label', hideLabel && `fds-sr-only`), children: [readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-textarea__readonly-icon' })), jsx("span", { children: label })] })), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: clsx('fds-textarea__description', hideLabel && `fds-sr-only`), children: description }) })), jsx("textarea", { className: clsx('fds-textarea__input', `fds-focus`), ref: ref, "aria-describedby": describedBy, disabled: textareaProps.disabled, readOnly: readOnly, ...omit(['size', 'error', 'errorId'], rest), ...textareaProps, onChange: (e) => {
|
|
28
28
|
textareaProps?.onChange?.(e);
|
|
29
29
|
setValue(e.target.value);
|
|
30
30
|
} }), hasCharacterLimit && (jsx(CharacterCounter, { size: size, value: value ? value.toString() : '', id: characterLimitId, ...characterLimit })), jsx("div", { className: 'fds-textarea__error-message', id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', children: hasError && jsx(ErrorMessage, { size: size, children: props.error }) })] }) }));
|
|
@@ -24,7 +24,7 @@ const Textfield = forwardRef((props, ref) => {
|
|
|
24
24
|
const characterLimitId = `textfield-charactercount-${useId()}`;
|
|
25
25
|
const hasCharacterLimit = characterLimit != null;
|
|
26
26
|
const describedBy = clsx(inputProps['aria-describedby'], hasCharacterLimit && characterLimitId) || undefined;
|
|
27
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { style: style, className: clsx(`fds-textfield`, `fds-textfield--${size}`,
|
|
27
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { style: style, className: clsx(`fds-textfield`, `fds-textfield--${size}`, readOnly && `fds-textfield--readonly`, hasError && `fds-textfield--error`, className), children: [label && (jsxs(Label, { size: size, weight: 'medium', htmlFor: inputProps.id, className: clsx(`fds-textfield__label`, hideLabel && `fds-sr-only`), children: [readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-textfield__readonly__icon' })), jsx("span", { children: label })] })), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: clsx(`fds-textfield__description`, hideLabel && `fds-sr-only`), children: description }) })), jsxs("div", { className: 'fds-textfield__field', children: [prefix && (jsx(Paragraph, { asChild: true, size: size, variant: 'short', children: jsx("div", { className: clsx(`fds-textfield__adornment`, `fds-textfield__prefix`), "aria-hidden": 'true', children: prefix }) })), jsx("input", { className: clsx(`fds-textfield__input`, `fds-focus`, prefix && `fds-textfield__input--with-prefix`, suffix && `fds-textfield__input--with-suffix`), ref: ref, type: type, disabled: inputProps.disabled, "aria-describedby": describedBy, size: htmlSize, ...omit(['size', 'error', 'errorId'], rest), ...inputProps, onChange: (e) => {
|
|
28
28
|
inputProps?.onChange?.(e);
|
|
29
29
|
setInputValue(e.target.value);
|
|
30
30
|
} }), suffix && (jsx(Paragraph, { asChild: true, size: size, variant: 'short', children: jsx("div", { className: clsx(`fds-textfield__adornment`, `fds-textfield__suffix`), "aria-hidden": 'true', children: suffix }) }))] }), hasCharacterLimit && (jsx(CharacterCounter, { size: size, value: inputValue ? inputValue.toString() : '', id: characterLimitId, ...characterLimit })), jsx("div", { className: 'fds-textfield__error-message', id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', children: hasError && jsx(ErrorMessage, { size: size, children: props.error }) })] }) }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import _extends from '
|
|
2
|
+
import _extends from '../../../@babel/runtime/helpers/esm/extends.js';
|
|
3
3
|
import { forwardRef, Children, isValidElement, createElement, cloneElement, Fragment } from 'react';
|
|
4
4
|
import { composeRefs as $6ed0406888f73fc4$export$43e446d32b3d21af } from '../../react-compose-refs/dist/index.js';
|
|
5
5
|
|
|
@@ -2,7 +2,7 @@ import { type HeadingProps } from '../Typography';
|
|
|
2
2
|
export type ListHeadingProps = HeadingProps;
|
|
3
3
|
export declare const ListHeading: import("react").ForwardRefExoticComponent<{
|
|
4
4
|
level?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
5
|
-
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" |
|
|
5
|
+
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | ("xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "2xlarge") | undefined;
|
|
6
6
|
spacing?: boolean | undefined;
|
|
7
7
|
asChild?: boolean | undefined;
|
|
8
8
|
} & import("react").HTMLAttributes<HTMLHeadingElement> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
-
type OldHeadingSizes = 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'
|
|
2
|
+
type OldHeadingSizes = 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';
|
|
3
3
|
export type HeadingProps = {
|
|
4
4
|
/** Heading level. This will translate into any h1-6 level unless `as` is defined */
|
|
5
5
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
@@ -8,7 +8,7 @@ export type HeadingProps = {
|
|
|
8
8
|
*
|
|
9
9
|
* @note `xxsmall`, `xsmall`, `small`, `medium`, `large`, `xlarge`, `2xlarge`, `3xlarge` is deprecated
|
|
10
10
|
*/
|
|
11
|
-
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' |
|
|
11
|
+
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | OldHeadingSizes;
|
|
12
12
|
/** Adds margin-bottom */
|
|
13
13
|
spacing?: boolean;
|
|
14
14
|
/**
|
|
@@ -26,7 +26,7 @@ export declare const Heading: import("react").ForwardRefExoticComponent<{
|
|
|
26
26
|
*
|
|
27
27
|
* @note `xxsmall`, `xsmall`, `small`, `medium`, `large`, `xlarge`, `2xlarge`, `3xlarge` is deprecated
|
|
28
28
|
*/
|
|
29
|
-
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" |
|
|
29
|
+
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | OldHeadingSizes | undefined;
|
|
30
30
|
/** Adds margin-bottom */
|
|
31
31
|
spacing?: boolean | undefined;
|
|
32
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../../../src/components/Typography/Heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,OAAO,CAAC;AAOzD,KAAK,eAAe,GAChB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,
|
|
1
|
+
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../../../src/components/Typography/Heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,OAAO,CAAC;AAOzD,KAAK,eAAe,GAChB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,YAAY,GAAG;IACzB,oFAAoF;IACpF,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B;;;;OAIG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,eAAe,CAAC;IAC1E,yBAAyB;IACzB,OAAO,CAAC,EAAE,OAAO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;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;;;;;OAOG;2BACmB,MAAM,UAAU,MAAM,KAAK,OAAO;IACxD;;;;;;OAMG;4BACoB,MAAM,KAAK,MAAM;;;;;;;;;oKAuWzC,CAAC;AAEF,eAAO,MAAM,QAAQ;IAhcnB;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;6BACqB,MAAM,EAAE,KAAK,IAAI;IACzC;;;OAGG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;;;;;OAOG;2BACmB,MAAM,UAAU,MAAM,KAAK,OAAO;IACxD;;;;;;OAMG;4BACoB,MAAM,KAAK,MAAM;;;;;;;;;oKAkXzC,CAAC"}
|
|
@@ -6,7 +6,7 @@ type UseComboboxOptionProps = {
|
|
|
6
6
|
export default function useComboboxOption({ id, ref, value, }: UseComboboxOptionProps): {
|
|
7
7
|
id: string;
|
|
8
8
|
ref: ((instance: HTMLButtonElement | null) => void) | null;
|
|
9
|
-
selected: import("
|
|
9
|
+
selected: import("../useCombobox").Option;
|
|
10
10
|
active: boolean;
|
|
11
11
|
onOptionClick: (...args: never[]) => void;
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComboboxOption.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/Combobox/Option/useComboboxOption.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useComboboxOption.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/Combobox/Option/useComboboxOption.tsx"],"names":[],"mappings":"AAQA,KAAK,sBAAsB,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,EAAE,EACF,GAAG,EACH,KAAK,GACN,EAAE,sBAAsB;;;;;;EAoDxB"}
|
|
@@ -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;AAMjD,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;;CAgIpB,CAAC;AAIF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxNative.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/Combobox/internal/ComboboxNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ComboboxNative.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/Combobox/internal/ComboboxNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,KAAK,mBAAmB,GAAG;IACzB,eAAe,EAAE;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,QAAQ,EAAE,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;IACjD,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,cAAc;2CAIxB,mBAAmB;;CAmBrB,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -18,6 +18,13 @@ export type Option = {
|
|
|
18
18
|
export declare function isComboboxOption(child: ReactNode): child is ReactElement<ComboboxOptionProps>;
|
|
19
19
|
export declare function isComboboxCustom(child: ReactNode): child is ReactElement<ComboboxCustomProps>;
|
|
20
20
|
export declare function isInteractiveComboboxCustom(child: ReactNode): child is ReactElement<ComboboxCustomProps>;
|
|
21
|
+
/**
|
|
22
|
+
* We use this function to prefix the value of the options so we can make sure numbers as strings are not parsed as numbers in objects
|
|
23
|
+
* @param value
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export declare const prefix: (value?: string) => string;
|
|
27
|
+
export declare const removePrefix: (value: string) => string;
|
|
21
28
|
export default function useCombobox({ children, inputValue, multiple, filter, initialValue, }: UseComboboxProps): {
|
|
22
29
|
filteredOptionsChildren: (ReactElement<ComboboxOptionProps, string | import("react").JSXElementConstructor<any>> | undefined)[];
|
|
23
30
|
filteredOptions: string[];
|
|
@@ -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;
|
|
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,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x"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAS3E,KAAK,oBAAoB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;iDAC6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;SAGK;IACL,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;QAII;IACJ,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,oBAAoB,CAAC;IACjD,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC;AAE1D,eAAO,MAAM,YAAY;IAhCvB;iDAC6C;;IAE7C;;;SAGK;;IAEL;;OAEG;kBACW,SAAS;IACvB,gDAAgD;;IAEhD;;;;QAII;;IAEJ,mCAAmC;YAC3B,SAAS;IACjB;;OAEG;;IAEH;;OAEG;;
|
|
1
|
+
{"version":3,"file":"NativeSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/NativeSelect/NativeSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAS3E,KAAK,oBAAoB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;iDAC6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;SAGK;IACL,SAAS,CAAC,E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M,MAAM;IAXjB,mBAAmB;eACR,SAAS;IACpB,mCAAmC;;IAEnC;;OAEG;;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAO5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAItD,MAAM,MAAM,WAAW,GAAG;IACxB,mBAAmB;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,GAClD,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAEhE,eAAO,MAAM,MAAM;IAXjB,mBAAmB;eACR,SAAS;IACpB,mCAAmC;;IAEnC;;OAEG;;uKAgFJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Textfield/Textfield.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAO5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAK/D,KAAK,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,iBAAiB,CAAC;IAC9C,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Textfield/Textfield.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAO5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAK/D,KAAK,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,iBAAiB,CAAC;IAC9C,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,IAAI,CAAC,EACH,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,MAAM,GACN,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,CAAC;IACT;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAC9B,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;IArDpB,YAAY;YACJ,SAAS;IACjB,qFAAqF;;IAErF;;;;OAIG;;IAEH,wBAAwB;;IAExB,wBAAwB;;IAExB,8BAA8B;;IAe9B;;;;;;;;OAQG;;IAEH;;OAEG;;yIAyKJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSize.d.ts","sourceRoot":"","sources":["../../../src/utilities/getSize.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getSize.d.ts","sourceRoot":"","sources":["../../../src/utilities/getSize.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,UA2BnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digdir/designsystemet-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.1",
|
|
4
4
|
"description": "React components for Designsystemet",
|
|
5
5
|
"author": "Designsystemet team",
|
|
6
6
|
"repository": "https://github.com/digdir/designsystemet",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"rollup": "^4.12.1",
|
|
40
40
|
"typescript": "^5.4.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "f8d3cb9c18dec5d85471923b3a5690b781d96aad"
|
|
43
43
|
}
|
|
File without changes
|
|
File without changes
|