@digdir/designsystemet-react 0.0.0-test-20250711105047 → 0.0.0-test-20250714103944
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/suggestion/suggestion-input.js +5 -2
- package/dist/cjs/components/suggestion/suggestion-list.js +33 -2
- package/dist/cjs/components/suggestion/suggestion.js +5 -3
- package/dist/esm/components/suggestion/suggestion-input.js +6 -3
- package/dist/esm/components/suggestion/suggestion-list.js +34 -3
- package/dist/esm/components/suggestion/suggestion.js +5 -3
- package/dist/types/components/Combobox/Combobox.d.ts +2 -2
- package/dist/types/components/suggestion/suggestion-input.d.ts +12 -0
- package/dist/types/components/suggestion/suggestion-input.d.ts.map +1 -1
- package/dist/types/components/suggestion/suggestion-list.d.ts.map +1 -1
- package/dist/types/components/suggestion/suggestion.d.ts +2 -0
- package/dist/types/components/suggestion/suggestion.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utilities/roving-focus/use-roving-focus.d.ts +1 -1
- package/package.json +5 -5
|
@@ -18,17 +18,20 @@ var suggestion = require('./suggestion.js');
|
|
|
18
18
|
* </Suggestion>
|
|
19
19
|
*/
|
|
20
20
|
const SuggestionInput = react.forwardRef(function SuggestionList({ value, onInput, onChange, ...rest }, ref) {
|
|
21
|
-
const { handleFilter } = react.useContext(suggestion.SuggestionContext);
|
|
21
|
+
const { listId, handleFilter } = react.useContext(suggestion.SuggestionContext);
|
|
22
22
|
react.useEffect(handleFilter, [value]); // Filter if controlled value
|
|
23
23
|
if (onChange)
|
|
24
24
|
console.warn('SuggestionInput: Avoid using onChange, as Suggestion controls the Input. Use onValueChange on Suggest instead, or onInput if fetching API results');
|
|
25
25
|
if (value)
|
|
26
26
|
console.warn('SuggestionInput: Avoid using value, as Suggestion controls the Input. Use value on Suggest instead.');
|
|
27
|
+
const popoverProps = Object.assign({
|
|
28
|
+
[react.version.startsWith('19') ? 'popoverTarget' : 'popovertarget']: listId,
|
|
29
|
+
}, rest);
|
|
27
30
|
return (jsxRuntime.jsx(input.Input, { placeholder: '' // We need an empty placeholder for the clear button to be able to show/hide
|
|
28
31
|
, ref: ref, onInput: (event) => {
|
|
29
32
|
onInput?.(event); // Should run first
|
|
30
33
|
handleFilter?.(); // Filter if uncontrolled value
|
|
31
|
-
}, ...
|
|
34
|
+
}, ...popoverProps }));
|
|
32
35
|
});
|
|
33
36
|
|
|
34
37
|
exports.SuggestionInput = SuggestionInput;
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
require('@u-elements/u-datalist');
|
|
7
|
+
var dom = require('@floating-ui/dom');
|
|
7
8
|
var suggestion = require('./suggestion.js');
|
|
9
|
+
var useMergeRefs = require('../../utilities/hooks/use-merge-refs/use-merge-refs.js');
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Component that provides a Suggestion list.
|
|
@@ -18,9 +20,38 @@ var suggestion = require('./suggestion.js');
|
|
|
18
20
|
* </Suggestion>
|
|
19
21
|
*/
|
|
20
22
|
const SuggestionList = react.forwardRef(function SuggestionList({ singular = '%d forslag', plural = '%d forslag', className, id, ...rest }, ref) {
|
|
21
|
-
const { handleFilter } = react.useContext(suggestion.SuggestionContext);
|
|
23
|
+
const { listId, setListId, handleFilter } = react.useContext(suggestion.SuggestionContext);
|
|
24
|
+
const listRef = react.useRef(null);
|
|
25
|
+
const mergedRefs = useMergeRefs.useMergeRefs([ref, listRef]);
|
|
22
26
|
react.useEffect(handleFilter); // Must run on every render
|
|
23
|
-
|
|
27
|
+
react.useEffect(() => {
|
|
28
|
+
id && setListId(id);
|
|
29
|
+
}, [id]);
|
|
30
|
+
// Position with floating-ui
|
|
31
|
+
react.useEffect(() => {
|
|
32
|
+
const list = listRef.current;
|
|
33
|
+
const trigger = document.querySelector(`[popovertarget="${list?.id}"]`);
|
|
34
|
+
if (list && trigger) {
|
|
35
|
+
return dom.autoUpdate(trigger, list, () => {
|
|
36
|
+
dom.computePosition(trigger, list, {
|
|
37
|
+
placement: 'bottom',
|
|
38
|
+
strategy: 'fixed',
|
|
39
|
+
middleware: [triggerWidth],
|
|
40
|
+
}).then(({ x, y }) => {
|
|
41
|
+
list.style.translate = `${x}px calc(${y}px + var(--dsc-suggestion-list-gap))`;
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}, [listId]);
|
|
46
|
+
return (jsxRuntime.jsx("u-datalist", { "data-nofilter": true, "data-sr-singular": singular, "data-sr-plural": plural, class: className, ref: mergedRefs, id: listId, popover: 'manual', ...rest }));
|
|
24
47
|
});
|
|
48
|
+
const triggerWidth = {
|
|
49
|
+
name: 'TriggerWidth',
|
|
50
|
+
fn(data) {
|
|
51
|
+
const { elements, rects } = data;
|
|
52
|
+
elements.floating.style.width = `${rects.reference.width}px`;
|
|
53
|
+
return data;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
25
56
|
|
|
26
57
|
exports.SuggestionList = SuggestionList;
|
|
@@ -8,6 +8,7 @@ var cl = require('clsx/lite');
|
|
|
8
8
|
var useMergeRefs = require('../../utilities/hooks/use-merge-refs/use-merge-refs.js');
|
|
9
9
|
|
|
10
10
|
const SuggestionContext = react.createContext({
|
|
11
|
+
setListId: () => undefined,
|
|
11
12
|
handleFilter: () => undefined,
|
|
12
13
|
});
|
|
13
14
|
const text = (el) => el.textContent?.trim() || '';
|
|
@@ -30,12 +31,13 @@ const nextItems = (data, prev, multiple) => {
|
|
|
30
31
|
const defaultFilter = ({ label, input }) => label.toLowerCase().includes(input.value.trim().toLowerCase());
|
|
31
32
|
const Suggestion = react.forwardRef(function Suggestion({ children, className, creatable = false, defaultValue, filter = true, multiple = false, name, onValueChange, value, ...rest }, ref) {
|
|
32
33
|
const uComboboxRef = react.useRef(null);
|
|
33
|
-
const
|
|
34
|
-
const selectId = rest.id ? `${rest.id}-select` :
|
|
34
|
+
const genId = react.useId();
|
|
35
|
+
const selectId = rest.id ? `${rest.id}-select` : genId;
|
|
35
36
|
const isContolled = value !== undefined;
|
|
36
37
|
const mergedRefs = useMergeRefs.useMergeRefs([ref, uComboboxRef]);
|
|
37
38
|
const [isEmpty, setIsEmpty] = react.useState(false);
|
|
38
39
|
const [selectedItems, setSelectedItems] = react.useState(sanitizeItems(defaultValue || value));
|
|
40
|
+
const [listId, setListId] = react.useState(rest.id ? `${rest.id}-list` : `${genId}-list`);
|
|
39
41
|
// Update if controlled values
|
|
40
42
|
const prevControlled = react.useRef(value);
|
|
41
43
|
if (value !== prevControlled.current) {
|
|
@@ -80,7 +82,7 @@ const Suggestion = react.forwardRef(function Suggestion({ children, className, c
|
|
|
80
82
|
}
|
|
81
83
|
setIsEmpty(index === disabled);
|
|
82
84
|
}, [filter]);
|
|
83
|
-
return (jsxRuntime.jsx(SuggestionContext.Provider, { value: { isEmpty, selectedItems, handleFilter }, children: jsxRuntime.jsxs("u-combobox", { "data-multiple": multiple || undefined, "data-creatable": creatable || undefined, class: cl('ds-suggestion', className), ref: mergedRefs, ...rest, children: [children, !!name && (jsxRuntime.jsx("select", { name: name, multiple: true, hidden: true, id: selectId }))] }) }));
|
|
85
|
+
return (jsxRuntime.jsx(SuggestionContext.Provider, { value: { isEmpty, selectedItems, listId, setListId, handleFilter }, children: jsxRuntime.jsxs("u-combobox", { "data-multiple": multiple || undefined, "data-creatable": creatable || undefined, class: cl('ds-suggestion', className), ref: mergedRefs, ...rest, children: [children, !!name && (jsxRuntime.jsx("select", { name: name, multiple: true, hidden: true, id: selectId }))] }) }));
|
|
84
86
|
});
|
|
85
87
|
|
|
86
88
|
exports.Suggestion = Suggestion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useContext, useEffect } from 'react';
|
|
3
|
+
import { forwardRef, useContext, useEffect, version } from 'react';
|
|
4
4
|
import { Input } from '../input/input.js';
|
|
5
5
|
import { SuggestionContext } from './suggestion.js';
|
|
6
6
|
|
|
@@ -16,17 +16,20 @@ import { SuggestionContext } from './suggestion.js';
|
|
|
16
16
|
* </Suggestion>
|
|
17
17
|
*/
|
|
18
18
|
const SuggestionInput = forwardRef(function SuggestionList({ value, onInput, onChange, ...rest }, ref) {
|
|
19
|
-
const { handleFilter } = useContext(SuggestionContext);
|
|
19
|
+
const { listId, handleFilter } = useContext(SuggestionContext);
|
|
20
20
|
useEffect(handleFilter, [value]); // Filter if controlled value
|
|
21
21
|
if (onChange)
|
|
22
22
|
console.warn('SuggestionInput: Avoid using onChange, as Suggestion controls the Input. Use onValueChange on Suggest instead, or onInput if fetching API results');
|
|
23
23
|
if (value)
|
|
24
24
|
console.warn('SuggestionInput: Avoid using value, as Suggestion controls the Input. Use value on Suggest instead.');
|
|
25
|
+
const popoverProps = Object.assign({
|
|
26
|
+
[version.startsWith('19') ? 'popoverTarget' : 'popovertarget']: listId,
|
|
27
|
+
}, rest);
|
|
25
28
|
return (jsx(Input, { placeholder: '' // We need an empty placeholder for the clear button to be able to show/hide
|
|
26
29
|
, ref: ref, onInput: (event) => {
|
|
27
30
|
onInput?.(event); // Should run first
|
|
28
31
|
handleFilter?.(); // Filter if uncontrolled value
|
|
29
|
-
}, ...
|
|
32
|
+
}, ...popoverProps }));
|
|
30
33
|
});
|
|
31
34
|
|
|
32
35
|
export { SuggestionInput };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useContext, useEffect } from 'react';
|
|
3
|
+
import { forwardRef, useContext, useRef, useEffect } from 'react';
|
|
4
4
|
import '@u-elements/u-datalist';
|
|
5
|
+
import { autoUpdate, computePosition } from '@floating-ui/dom';
|
|
5
6
|
import { SuggestionContext } from './suggestion.js';
|
|
7
|
+
import { useMergeRefs } from '../../utilities/hooks/use-merge-refs/use-merge-refs.js';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Component that provides a Suggestion list.
|
|
@@ -16,9 +18,38 @@ import { SuggestionContext } from './suggestion.js';
|
|
|
16
18
|
* </Suggestion>
|
|
17
19
|
*/
|
|
18
20
|
const SuggestionList = forwardRef(function SuggestionList({ singular = '%d forslag', plural = '%d forslag', className, id, ...rest }, ref) {
|
|
19
|
-
const { handleFilter } = useContext(SuggestionContext);
|
|
21
|
+
const { listId, setListId, handleFilter } = useContext(SuggestionContext);
|
|
22
|
+
const listRef = useRef(null);
|
|
23
|
+
const mergedRefs = useMergeRefs([ref, listRef]);
|
|
20
24
|
useEffect(handleFilter); // Must run on every render
|
|
21
|
-
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
id && setListId(id);
|
|
27
|
+
}, [id]);
|
|
28
|
+
// Position with floating-ui
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const list = listRef.current;
|
|
31
|
+
const trigger = document.querySelector(`[popovertarget="${list?.id}"]`);
|
|
32
|
+
if (list && trigger) {
|
|
33
|
+
return autoUpdate(trigger, list, () => {
|
|
34
|
+
computePosition(trigger, list, {
|
|
35
|
+
placement: 'bottom',
|
|
36
|
+
strategy: 'fixed',
|
|
37
|
+
middleware: [triggerWidth],
|
|
38
|
+
}).then(({ x, y }) => {
|
|
39
|
+
list.style.translate = `${x}px calc(${y}px + var(--dsc-suggestion-list-gap))`;
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, [listId]);
|
|
44
|
+
return (jsx("u-datalist", { "data-nofilter": true, "data-sr-singular": singular, "data-sr-plural": plural, class: className, ref: mergedRefs, id: listId, popover: 'manual', ...rest }));
|
|
22
45
|
});
|
|
46
|
+
const triggerWidth = {
|
|
47
|
+
name: 'TriggerWidth',
|
|
48
|
+
fn(data) {
|
|
49
|
+
const { elements, rects } = data;
|
|
50
|
+
elements.floating.style.width = `${rects.reference.width}px`;
|
|
51
|
+
return data;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
23
54
|
|
|
24
55
|
export { SuggestionList };
|
|
@@ -6,6 +6,7 @@ import cl from 'clsx/lite';
|
|
|
6
6
|
import { useMergeRefs } from '../../utilities/hooks/use-merge-refs/use-merge-refs.js';
|
|
7
7
|
|
|
8
8
|
const SuggestionContext = createContext({
|
|
9
|
+
setListId: () => undefined,
|
|
9
10
|
handleFilter: () => undefined,
|
|
10
11
|
});
|
|
11
12
|
const text = (el) => el.textContent?.trim() || '';
|
|
@@ -28,12 +29,13 @@ const nextItems = (data, prev, multiple) => {
|
|
|
28
29
|
const defaultFilter = ({ label, input }) => label.toLowerCase().includes(input.value.trim().toLowerCase());
|
|
29
30
|
const Suggestion = forwardRef(function Suggestion({ children, className, creatable = false, defaultValue, filter = true, multiple = false, name, onValueChange, value, ...rest }, ref) {
|
|
30
31
|
const uComboboxRef = useRef(null);
|
|
31
|
-
const
|
|
32
|
-
const selectId = rest.id ? `${rest.id}-select` :
|
|
32
|
+
const genId = useId();
|
|
33
|
+
const selectId = rest.id ? `${rest.id}-select` : genId;
|
|
33
34
|
const isContolled = value !== undefined;
|
|
34
35
|
const mergedRefs = useMergeRefs([ref, uComboboxRef]);
|
|
35
36
|
const [isEmpty, setIsEmpty] = useState(false);
|
|
36
37
|
const [selectedItems, setSelectedItems] = useState(sanitizeItems(defaultValue || value));
|
|
38
|
+
const [listId, setListId] = useState(rest.id ? `${rest.id}-list` : `${genId}-list`);
|
|
37
39
|
// Update if controlled values
|
|
38
40
|
const prevControlled = useRef(value);
|
|
39
41
|
if (value !== prevControlled.current) {
|
|
@@ -78,7 +80,7 @@ const Suggestion = forwardRef(function Suggestion({ children, className, creatab
|
|
|
78
80
|
}
|
|
79
81
|
setIsEmpty(index === disabled);
|
|
80
82
|
}, [filter]);
|
|
81
|
-
return (jsx(SuggestionContext.Provider, { value: { isEmpty, selectedItems, handleFilter }, children: jsxs("u-combobox", { "data-multiple": multiple || undefined, "data-creatable": creatable || undefined, class: cl('ds-suggestion', className), ref: mergedRefs, ...rest, children: [children, !!name && (jsx("select", { name: name, multiple: true, hidden: true, id: selectId }))] }) }));
|
|
83
|
+
return (jsx(SuggestionContext.Provider, { value: { isEmpty, selectedItems, listId, setListId, handleFilter }, children: jsxs("u-combobox", { "data-multiple": multiple || undefined, "data-creatable": creatable || undefined, class: cl('ds-suggestion', className), ref: mergedRefs, ...rest, children: [children, !!name && (jsx("select", { name: name, multiple: true, hidden: true, id: selectId }))] }) }));
|
|
82
84
|
});
|
|
83
85
|
|
|
84
86
|
export { Suggestion, SuggestionContext };
|
|
@@ -206,7 +206,7 @@ export declare const ComboboxComponent: React.ForwardRefExoticComponent<{
|
|
|
206
206
|
description?: ReactNode;
|
|
207
207
|
id?: string;
|
|
208
208
|
readOnly?: boolean;
|
|
209
|
-
size?: import("
|
|
209
|
+
size?: import("packages/cli/dist/src/types").Size;
|
|
210
210
|
} & Pick<React.HTMLAttributes<HTMLElement>, "aria-describedby"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
211
211
|
export declare const Combobox: React.ForwardRefExoticComponent<{
|
|
212
212
|
/**
|
|
@@ -312,6 +312,6 @@ export declare const Combobox: React.ForwardRefExoticComponent<{
|
|
|
312
312
|
description?: ReactNode;
|
|
313
313
|
id?: string;
|
|
314
314
|
readOnly?: boolean;
|
|
315
|
-
size?: import("
|
|
315
|
+
size?: import("packages/cli/dist/src/types").Size;
|
|
316
316
|
} & Pick<React.HTMLAttributes<HTMLElement>, "aria-describedby"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
317
317
|
//# sourceMappingURL=Combobox.d.ts.map
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { type InputProps } from '../input/input';
|
|
2
2
|
export type SuggestionInputProps = InputProps;
|
|
3
|
+
declare global {
|
|
4
|
+
namespace React.JSX {
|
|
5
|
+
interface IntrinsicAttributes {
|
|
6
|
+
popovertarget?: string;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
namespace React {
|
|
10
|
+
interface HTMLAttributes<T> {
|
|
11
|
+
popovertarget?: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
3
15
|
/**
|
|
4
16
|
* Component that provides an input field for the Suggestion list.
|
|
5
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion-input.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"suggestion-input.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAI9C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC,GAAG,CAAC;QAClB,UAAU,mBAAmB;YAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;IACD,UAAU,KAAK,CAAC;QAEd,UAAU,cAAc,CAAC,CAAC;YACxB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;CACF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe;;;;;;0CAkC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion-list.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"suggestion-list.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,wBAAwB,CAAC;AAMhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAC1C,YAAY,GAAG,cAAc,CAAC,mBAAmB,CAAC,EAClD;IACE;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CACF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc;IAxBvB;;;OAGG;eACQ,MAAM;IACjB;;;OAGG;aACM,MAAM;6CAgEjB,CAAC"}
|
|
@@ -35,6 +35,8 @@ type Filter = (args: {
|
|
|
35
35
|
type SuggestionContextType = {
|
|
36
36
|
isEmpty?: boolean;
|
|
37
37
|
selectedItems?: Item[];
|
|
38
|
+
listId?: string;
|
|
39
|
+
setListId: (id: string) => void;
|
|
38
40
|
handleFilter: (input?: HTMLInputElement | null) => void;
|
|
39
41
|
};
|
|
40
42
|
export declare const SuggestionContext: React.Context<SuggestionContextType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAC;AACf,OAAO,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;AAEtE,KAAK,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7C,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,iBAAiB,CAAC;IACjC;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;CACzB,KAAK,OAAO,CAAC;AAEd,KAAK,qBAAqB,GAAG;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC;IACvB,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAC;AACf,OAAO,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;AAEtE,KAAK,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7C,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,iBAAiB,CAAC;IACjC;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;CACzB,KAAK,OAAO,CAAC;AAEd,KAAK,qBAAqB,GAAG;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,sCAG5B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;AAgCzC,eAAO,MAAM,UAAU;IAzErB;;;;;;;;OAQG;aACM,OAAO,GAAG,MAAM;IACzB;;;;OAIG;gBACS,OAAO;IACnB;;;;OAIG;eACQ,OAAO;IAClB;;;OAGG;YACK,gBAAgB;IACxB;;OAEG;mBACY,gBAAgB;IAC/B;;OAEG;oBACa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI;IACvC;;;;OAIG;WACI,MAAM;qFAqId,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { Size } from '@digdir/designsystemet/types';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { Color } from './colors';
|
|
3
|
-
export type Size
|
|
4
|
+
export type { Size };
|
|
4
5
|
export type DefaultProps = {
|
|
5
6
|
/**
|
|
6
7
|
* Changes size for descendant Designsystemet components. Select from predefined sizes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,YAAY,EAAE,IAAI,EAAE,CAAC;AAErB,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GACrB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAClE;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACrE;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC"}
|
|
@@ -65,7 +65,7 @@ export declare const useRovingFocus: (value: string) => {
|
|
|
65
65
|
exportparts?: string | undefined;
|
|
66
66
|
part?: string | undefined;
|
|
67
67
|
popovertarget?: string;
|
|
68
|
-
'data-size'?: import("
|
|
68
|
+
'data-size'?: import("packages/cli/dist/src/types").Size | (string & {});
|
|
69
69
|
'data-color'?: import("packages/cli/dist/src/types").Color | (string & {});
|
|
70
70
|
"aria-activedescendant"?: string | undefined;
|
|
71
71
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digdir/designsystemet-react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-test-
|
|
4
|
+
"version": "0.0.0-test-20250714103944",
|
|
5
5
|
"description": "React components for Designsystemet",
|
|
6
6
|
"author": "Designsystemet team",
|
|
7
7
|
"repository": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@navikt/aksel-icons": "^7.25.1",
|
|
42
42
|
"@radix-ui/react-slot": "^1.2.3",
|
|
43
43
|
"@tanstack/react-virtual": "^3.13.12",
|
|
44
|
-
"@u-elements/u-combobox": "^0.0.
|
|
45
|
-
"@u-elements/u-datalist": "^1.0.
|
|
44
|
+
"@u-elements/u-combobox": "^0.0.17",
|
|
45
|
+
"@u-elements/u-datalist": "^1.0.10",
|
|
46
46
|
"@u-elements/u-details": "^0.1.1",
|
|
47
47
|
"clsx": "^2.1.1"
|
|
48
48
|
},
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"storybook": "^9.0.15",
|
|
68
68
|
"tsx": "4.20.3",
|
|
69
69
|
"typescript": "^5.8.3",
|
|
70
|
-
"@digdir/designsystemet": "^0.0.0-test-
|
|
71
|
-
"@digdir/designsystemet-css": "^0.0.0-test-
|
|
70
|
+
"@digdir/designsystemet": "^0.0.0-test-20250714103944",
|
|
71
|
+
"@digdir/designsystemet-css": "^0.0.0-test-20250714103944"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "pnpm run clean && tsc -b tsconfig.lib.json --emitDeclarationOnly false && rollup -c --bundleConfigAsCjs",
|