@digdir/designsystemet-react 1.1.10 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/dialog/dialog.js +7 -1
- package/dist/cjs/components/field/field-observer.js +1 -1
- package/dist/cjs/components/tabs/tabs-list.js +4 -2
- package/dist/cjs/components/tabs/tabs-panel.js +16 -3
- package/dist/cjs/components/tabs/tabs-tab.js +5 -2
- package/dist/cjs/components/tabs/tabs.js +5 -0
- package/dist/cjs/components/tooltip/tooltip.js +19 -3
- package/dist/esm/components/dialog/dialog.js +7 -1
- package/dist/esm/components/field/field-observer.js +1 -1
- package/dist/esm/components/tabs/tabs-list.js +4 -2
- package/dist/esm/components/tabs/tabs-panel.js +18 -5
- package/dist/esm/components/tabs/tabs-tab.js +5 -2
- package/dist/esm/components/tabs/tabs.js +6 -1
- package/dist/esm/components/tooltip/tooltip.js +19 -3
- package/dist/types/components/dialog/dialog.d.ts +4 -0
- package/dist/types/components/dialog/dialog.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton.d.ts +24 -7
- package/dist/types/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs-list.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs-panel.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs-tab.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs.d.ts +3 -0
- package/dist/types/components/tabs/tabs.d.ts.map +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts.map +1 -1
- package/package.json +10 -10
|
@@ -49,6 +49,12 @@ const Dialog = react.forwardRef(function Dialog({ asChild, children, className,
|
|
|
49
49
|
return (closedby === 'none' &&
|
|
50
50
|
event.key === 'Escape' &&
|
|
51
51
|
event.preventDefault()); // Skip ESC-key if closedby="none"
|
|
52
|
+
/* Check if clicked element or its closest parent has data-command='close' */
|
|
53
|
+
if (target instanceof Element) {
|
|
54
|
+
const closeElement = target.closest('[data-command="close"]');
|
|
55
|
+
if (closeElement)
|
|
56
|
+
return dialog?.close();
|
|
57
|
+
}
|
|
52
58
|
if (window.getSelection()?.toString())
|
|
53
59
|
return; // Fix bug where if you select text spanning two divs it thinks you clicked outside
|
|
54
60
|
if (dialog && target === dialog && closedby === 'any') {
|
|
@@ -79,7 +85,7 @@ const Dialog = react.forwardRef(function Dialog({ asChild, children, className,
|
|
|
79
85
|
currentRef?.addEventListener('close', handleClose);
|
|
80
86
|
return () => currentRef?.removeEventListener('close', handleClose);
|
|
81
87
|
}, [onClose]);
|
|
82
|
-
return (jsxRuntime.jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-modal": modal, ...rest, children: [closeButton !== false && (jsxRuntime.jsx(
|
|
88
|
+
return (jsxRuntime.jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-modal": modal, ...rest, children: [closeButton !== false && (jsxRuntime.jsx(button.Button, { "aria-label": closeButton, autoFocus: true, "data-color": 'neutral', icon: true, variant: 'tertiary', "data-command": 'close' })), children] }));
|
|
83
89
|
});
|
|
84
90
|
|
|
85
91
|
exports.Dialog = Dialog;
|
|
@@ -27,7 +27,7 @@ function fieldObserver(fieldElement) {
|
|
|
27
27
|
elements.set(el, el.htmlFor);
|
|
28
28
|
else if (el.hasAttribute('data-field'))
|
|
29
29
|
elements.set(el, el.id);
|
|
30
|
-
else if (isInputLike(el)) {
|
|
30
|
+
else if (isInputLike(el) && !el.hidden) {
|
|
31
31
|
input = el;
|
|
32
32
|
describedby = el.getAttribute('aria-describedby') || '';
|
|
33
33
|
}
|
|
@@ -5,6 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var rovingFocusRoot = require('../../utilities/roving-focus/roving-focus-root.js');
|
|
7
7
|
var tabs = require('./tabs.js');
|
|
8
|
+
var useMergeRefs = require('../../utilities/hooks/use-merge-refs/use-merge-refs.js');
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* The container for all `Tab` components.
|
|
@@ -16,8 +17,9 @@ var tabs = require('./tabs.js');
|
|
|
16
17
|
* </TabsList>
|
|
17
18
|
*/
|
|
18
19
|
const TabsList = react.forwardRef(function TabsList({ children, ...rest }, ref) {
|
|
19
|
-
const { value } = react.useContext(tabs.Context);
|
|
20
|
-
|
|
20
|
+
const { value, tablistRef } = react.useContext(tabs.Context);
|
|
21
|
+
const mergedRefs = useMergeRefs.useMergeRefs([ref, tablistRef]);
|
|
22
|
+
return (jsxRuntime.jsx(rovingFocusRoot.RovingFocusRoot, { role: 'tablist', activeValue: value, orientation: 'ambiguous', ref: mergedRefs, ...rest, children: children }));
|
|
21
23
|
});
|
|
22
24
|
|
|
23
25
|
exports.TabsList = TabsList;
|
|
@@ -12,10 +12,13 @@ var useMergeRefs = require('../../utilities/hooks/use-merge-refs/use-merge-refs.
|
|
|
12
12
|
* @example
|
|
13
13
|
* <TabsPanel value='1'>content 1</TabsPanel>
|
|
14
14
|
*/
|
|
15
|
-
const TabsPanel = react.forwardRef(function TabsPanel({ children, value, ...rest }, ref) {
|
|
16
|
-
const { value: tabsValue } = react.useContext(tabs.Context);
|
|
15
|
+
const TabsPanel = react.forwardRef(function TabsPanel({ children, value, id, ...rest }, ref) {
|
|
16
|
+
const { value: tabsValue, tablistRef, setPanelButtonMap, } = react.useContext(tabs.Context);
|
|
17
17
|
const active = value === tabsValue;
|
|
18
|
+
const generatedId = react.useId();
|
|
19
|
+
const panelId = id ?? `tabpanel-${generatedId}`;
|
|
18
20
|
const [hasTabbableElement, setHasTabbableElement] = react.useState(false);
|
|
21
|
+
const [labelledBy, setLabelledBy] = react.useState(undefined);
|
|
19
22
|
const internalRef = react.useRef(null);
|
|
20
23
|
const mergedRef = useMergeRefs.useMergeRefs([ref, internalRef]);
|
|
21
24
|
/* Check if the panel has any tabbable elements */
|
|
@@ -25,7 +28,17 @@ const TabsPanel = react.forwardRef(function TabsPanel({ children, value, ...rest
|
|
|
25
28
|
const tabbableElements = internalRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
26
29
|
setHasTabbableElement(tabbableElements.length > 0);
|
|
27
30
|
}, [children]);
|
|
28
|
-
|
|
31
|
+
/* get associated button */
|
|
32
|
+
react.useEffect(() => {
|
|
33
|
+
if (!tablistRef)
|
|
34
|
+
return;
|
|
35
|
+
const button = tablistRef.current?.querySelector(`[role="tab"][data-value="${value}"]`);
|
|
36
|
+
setLabelledBy(button ? button.id : undefined);
|
|
37
|
+
if (button) {
|
|
38
|
+
setPanelButtonMap?.((prev) => new Map(prev).set(button.id, panelId));
|
|
39
|
+
}
|
|
40
|
+
}, [tablistRef]);
|
|
41
|
+
return (jsxRuntime.jsx("div", { ref: mergedRef, id: panelId, role: 'tabpanel', tabIndex: hasTabbableElement ? undefined : 0, "aria-labelledby": labelledBy, hidden: !active, ...rest, children: children }));
|
|
29
42
|
});
|
|
30
43
|
|
|
31
44
|
exports.TabsPanel = TabsPanel;
|
|
@@ -12,11 +12,14 @@ var tabs = require('./tabs.js');
|
|
|
12
12
|
* @example
|
|
13
13
|
* <TabsTab value='1'>Tab 1</TabsTab>
|
|
14
14
|
*/
|
|
15
|
-
const TabsTab = react.forwardRef(function TabsTab({ value, id, ...rest }, ref) {
|
|
15
|
+
const TabsTab = react.forwardRef(function TabsTab({ value, id, onClick, ...rest }, ref) {
|
|
16
16
|
const tabs$1 = react.useContext(tabs.Context);
|
|
17
17
|
const generatedId = react.useId();
|
|
18
18
|
const buttonId = id ?? `tab-${generatedId}`;
|
|
19
|
-
return (jsxRuntime.jsx(rovingFocusItem.RovingFocusItem, { value: value, ...rest, asChild: true, children: jsxRuntime.jsx("button", {
|
|
19
|
+
return (jsxRuntime.jsx(rovingFocusItem.RovingFocusItem, { value: value, ...rest, asChild: true, children: jsxRuntime.jsx("button", { ref: ref, id: buttonId, "aria-selected": tabs$1.value === value, "data-value": value, role: 'tab', type: 'button', onClick: (e) => {
|
|
20
|
+
tabs$1.onChange?.(value);
|
|
21
|
+
onClick?.(e);
|
|
22
|
+
}, "aria-controls": tabs$1.panelButtonMap?.get(buttonId), ...rest }) }));
|
|
20
23
|
});
|
|
21
24
|
|
|
22
25
|
exports.TabsTab = TabsTab;
|
|
@@ -22,8 +22,10 @@ const Context = react.createContext({});
|
|
|
22
22
|
* </Tabs>
|
|
23
23
|
*/
|
|
24
24
|
const Tabs = react.forwardRef(function Tabs({ value, defaultValue, className, onChange, ...rest }, ref) {
|
|
25
|
+
const tablistRef = react.useRef(null);
|
|
25
26
|
const isControlled = value !== undefined;
|
|
26
27
|
const [uncontrolledValue, setUncontrolledValue] = react.useState(defaultValue);
|
|
28
|
+
const [panelButtonMap, setPanelButtonMap] = react.useState(new Map());
|
|
27
29
|
let onValueChange = onChange;
|
|
28
30
|
if (!isControlled) {
|
|
29
31
|
onValueChange = (newValue) => {
|
|
@@ -36,6 +38,9 @@ const Tabs = react.forwardRef(function Tabs({ value, defaultValue, className, on
|
|
|
36
38
|
value,
|
|
37
39
|
defaultValue,
|
|
38
40
|
onChange: onValueChange,
|
|
41
|
+
tablistRef,
|
|
42
|
+
panelButtonMap,
|
|
43
|
+
setPanelButtonMap,
|
|
39
44
|
}, children: jsxRuntime.jsx("div", { className: cl('ds-tabs', className), ref: ref, ...rest }) }));
|
|
40
45
|
});
|
|
41
46
|
|
|
@@ -65,18 +65,34 @@ const Tooltip = react.forwardRef(function Tooltip({ id, children, content, place
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
}, [controlledOpen, placement]);
|
|
68
|
-
/* Add
|
|
68
|
+
/* Add listeners for ESC to dismiss and click outside on mobile */
|
|
69
69
|
react.useEffect(() => {
|
|
70
|
+
const tooltip = tooltipRef.current;
|
|
71
|
+
const trigger = triggerRef.current;
|
|
70
72
|
const handleKeyDown = (event) => {
|
|
71
73
|
if (event.key === 'Escape') {
|
|
72
74
|
setInternalOpen(false);
|
|
73
75
|
}
|
|
74
76
|
};
|
|
75
|
-
|
|
77
|
+
const handleClick = (event) => {
|
|
78
|
+
const el = event.target;
|
|
79
|
+
const isTooltip = tooltip?.contains(el);
|
|
80
|
+
const isTrigger = trigger?.contains(el);
|
|
81
|
+
const isOutside = !isTrigger && !isTooltip;
|
|
82
|
+
if (isOutside && controlledOpen) {
|
|
83
|
+
setInternalOpen(false);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
if (controlledOpen) {
|
|
87
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
88
|
+
/* Add click listener to handle mobile tap-to-close */
|
|
89
|
+
document.addEventListener('click', handleClick);
|
|
90
|
+
}
|
|
76
91
|
return () => {
|
|
77
92
|
window.removeEventListener('keydown', handleKeyDown);
|
|
93
|
+
document.removeEventListener('click', handleClick);
|
|
78
94
|
};
|
|
79
|
-
}, []);
|
|
95
|
+
}, [controlledOpen]);
|
|
80
96
|
/* If children is only a string, make a span */
|
|
81
97
|
const ChildContainer = typeof children === 'string' ? 'span' : reactSlot.Slot;
|
|
82
98
|
/* Make sure it is valid */
|
|
@@ -47,6 +47,12 @@ const Dialog = forwardRef(function Dialog({ asChild, children, className, closeB
|
|
|
47
47
|
return (closedby === 'none' &&
|
|
48
48
|
event.key === 'Escape' &&
|
|
49
49
|
event.preventDefault()); // Skip ESC-key if closedby="none"
|
|
50
|
+
/* Check if clicked element or its closest parent has data-command='close' */
|
|
51
|
+
if (target instanceof Element) {
|
|
52
|
+
const closeElement = target.closest('[data-command="close"]');
|
|
53
|
+
if (closeElement)
|
|
54
|
+
return dialog?.close();
|
|
55
|
+
}
|
|
50
56
|
if (window.getSelection()?.toString())
|
|
51
57
|
return; // Fix bug where if you select text spanning two divs it thinks you clicked outside
|
|
52
58
|
if (dialog && target === dialog && closedby === 'any') {
|
|
@@ -77,7 +83,7 @@ const Dialog = forwardRef(function Dialog({ asChild, children, className, closeB
|
|
|
77
83
|
currentRef?.addEventListener('close', handleClose);
|
|
78
84
|
return () => currentRef?.removeEventListener('close', handleClose);
|
|
79
85
|
}, [onClose]);
|
|
80
|
-
return (jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-modal": modal, ...rest, children: [closeButton !== false && (jsx(
|
|
86
|
+
return (jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-modal": modal, ...rest, children: [closeButton !== false && (jsx(Button, { "aria-label": closeButton, autoFocus: true, "data-color": 'neutral', icon: true, variant: 'tertiary', "data-command": 'close' })), children] }));
|
|
81
87
|
});
|
|
82
88
|
|
|
83
89
|
export { Dialog };
|
|
@@ -25,7 +25,7 @@ function fieldObserver(fieldElement) {
|
|
|
25
25
|
elements.set(el, el.htmlFor);
|
|
26
26
|
else if (el.hasAttribute('data-field'))
|
|
27
27
|
elements.set(el, el.id);
|
|
28
|
-
else if (isInputLike(el)) {
|
|
28
|
+
else if (isInputLike(el) && !el.hidden) {
|
|
29
29
|
input = el;
|
|
30
30
|
describedby = el.getAttribute('aria-describedby') || '';
|
|
31
31
|
}
|
|
@@ -3,6 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef, useContext } from 'react';
|
|
4
4
|
import { RovingFocusRoot } from '../../utilities/roving-focus/roving-focus-root.js';
|
|
5
5
|
import { Context } from './tabs.js';
|
|
6
|
+
import { useMergeRefs } from '../../utilities/hooks/use-merge-refs/use-merge-refs.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* The container for all `Tab` components.
|
|
@@ -14,8 +15,9 @@ import { Context } from './tabs.js';
|
|
|
14
15
|
* </TabsList>
|
|
15
16
|
*/
|
|
16
17
|
const TabsList = forwardRef(function TabsList({ children, ...rest }, ref) {
|
|
17
|
-
const { value } = useContext(Context);
|
|
18
|
-
|
|
18
|
+
const { value, tablistRef } = useContext(Context);
|
|
19
|
+
const mergedRefs = useMergeRefs([ref, tablistRef]);
|
|
20
|
+
return (jsx(RovingFocusRoot, { role: 'tablist', activeValue: value, orientation: 'ambiguous', ref: mergedRefs, ...rest, children: children }));
|
|
19
21
|
});
|
|
20
22
|
|
|
21
23
|
export { TabsList };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx
|
|
3
|
-
import { forwardRef, useContext, useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useContext, useId, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import { Context } from './tabs.js';
|
|
5
5
|
import { useMergeRefs } from '../../utilities/hooks/use-merge-refs/use-merge-refs.js';
|
|
6
6
|
|
|
@@ -10,10 +10,13 @@ import { useMergeRefs } from '../../utilities/hooks/use-merge-refs/use-merge-ref
|
|
|
10
10
|
* @example
|
|
11
11
|
* <TabsPanel value='1'>content 1</TabsPanel>
|
|
12
12
|
*/
|
|
13
|
-
const TabsPanel = forwardRef(function TabsPanel({ children, value, ...rest }, ref) {
|
|
14
|
-
const { value: tabsValue } = useContext(Context);
|
|
13
|
+
const TabsPanel = forwardRef(function TabsPanel({ children, value, id, ...rest }, ref) {
|
|
14
|
+
const { value: tabsValue, tablistRef, setPanelButtonMap, } = useContext(Context);
|
|
15
15
|
const active = value === tabsValue;
|
|
16
|
+
const generatedId = useId();
|
|
17
|
+
const panelId = id ?? `tabpanel-${generatedId}`;
|
|
16
18
|
const [hasTabbableElement, setHasTabbableElement] = useState(false);
|
|
19
|
+
const [labelledBy, setLabelledBy] = useState(undefined);
|
|
17
20
|
const internalRef = useRef(null);
|
|
18
21
|
const mergedRef = useMergeRefs([ref, internalRef]);
|
|
19
22
|
/* Check if the panel has any tabbable elements */
|
|
@@ -23,7 +26,17 @@ const TabsPanel = forwardRef(function TabsPanel({ children, value, ...rest }, re
|
|
|
23
26
|
const tabbableElements = internalRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
24
27
|
setHasTabbableElement(tabbableElements.length > 0);
|
|
25
28
|
}, [children]);
|
|
26
|
-
|
|
29
|
+
/* get associated button */
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!tablistRef)
|
|
32
|
+
return;
|
|
33
|
+
const button = tablistRef.current?.querySelector(`[role="tab"][data-value="${value}"]`);
|
|
34
|
+
setLabelledBy(button ? button.id : undefined);
|
|
35
|
+
if (button) {
|
|
36
|
+
setPanelButtonMap?.((prev) => new Map(prev).set(button.id, panelId));
|
|
37
|
+
}
|
|
38
|
+
}, [tablistRef]);
|
|
39
|
+
return (jsx("div", { ref: mergedRef, id: panelId, role: 'tabpanel', tabIndex: hasTabbableElement ? undefined : 0, "aria-labelledby": labelledBy, hidden: !active, ...rest, children: children }));
|
|
27
40
|
});
|
|
28
41
|
|
|
29
42
|
export { TabsPanel };
|
|
@@ -10,11 +10,14 @@ import { Context } from './tabs.js';
|
|
|
10
10
|
* @example
|
|
11
11
|
* <TabsTab value='1'>Tab 1</TabsTab>
|
|
12
12
|
*/
|
|
13
|
-
const TabsTab = forwardRef(function TabsTab({ value, id, ...rest }, ref) {
|
|
13
|
+
const TabsTab = forwardRef(function TabsTab({ value, id, onClick, ...rest }, ref) {
|
|
14
14
|
const tabs = useContext(Context);
|
|
15
15
|
const generatedId = useId();
|
|
16
16
|
const buttonId = id ?? `tab-${generatedId}`;
|
|
17
|
-
return (jsx(RovingFocusItem, { value: value, ...rest, asChild: true, children: jsx("button", {
|
|
17
|
+
return (jsx(RovingFocusItem, { value: value, ...rest, asChild: true, children: jsx("button", { ref: ref, id: buttonId, "aria-selected": tabs.value === value, "data-value": value, role: 'tab', type: 'button', onClick: (e) => {
|
|
18
|
+
tabs.onChange?.(value);
|
|
19
|
+
onClick?.(e);
|
|
20
|
+
}, "aria-controls": tabs.panelButtonMap?.get(buttonId), ...rest }) }));
|
|
18
21
|
});
|
|
19
22
|
|
|
20
23
|
export { TabsTab };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import cl from 'clsx/lite';
|
|
4
|
-
import { forwardRef, createContext, useState } from 'react';
|
|
4
|
+
import { forwardRef, createContext, useRef, useState } from 'react';
|
|
5
5
|
|
|
6
6
|
const Context = createContext({});
|
|
7
7
|
/**
|
|
@@ -20,8 +20,10 @@ const Context = createContext({});
|
|
|
20
20
|
* </Tabs>
|
|
21
21
|
*/
|
|
22
22
|
const Tabs = forwardRef(function Tabs({ value, defaultValue, className, onChange, ...rest }, ref) {
|
|
23
|
+
const tablistRef = useRef(null);
|
|
23
24
|
const isControlled = value !== undefined;
|
|
24
25
|
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
26
|
+
const [panelButtonMap, setPanelButtonMap] = useState(new Map());
|
|
25
27
|
let onValueChange = onChange;
|
|
26
28
|
if (!isControlled) {
|
|
27
29
|
onValueChange = (newValue) => {
|
|
@@ -34,6 +36,9 @@ const Tabs = forwardRef(function Tabs({ value, defaultValue, className, onChange
|
|
|
34
36
|
value,
|
|
35
37
|
defaultValue,
|
|
36
38
|
onChange: onValueChange,
|
|
39
|
+
tablistRef,
|
|
40
|
+
panelButtonMap,
|
|
41
|
+
setPanelButtonMap,
|
|
37
42
|
}, children: jsx("div", { className: cl('ds-tabs', className), ref: ref, ...rest }) }));
|
|
38
43
|
});
|
|
39
44
|
|
|
@@ -63,18 +63,34 @@ const Tooltip = forwardRef(function Tooltip({ id, children, content, placement =
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}, [controlledOpen, placement]);
|
|
66
|
-
/* Add
|
|
66
|
+
/* Add listeners for ESC to dismiss and click outside on mobile */
|
|
67
67
|
useEffect(() => {
|
|
68
|
+
const tooltip = tooltipRef.current;
|
|
69
|
+
const trigger = triggerRef.current;
|
|
68
70
|
const handleKeyDown = (event) => {
|
|
69
71
|
if (event.key === 'Escape') {
|
|
70
72
|
setInternalOpen(false);
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
|
-
|
|
75
|
+
const handleClick = (event) => {
|
|
76
|
+
const el = event.target;
|
|
77
|
+
const isTooltip = tooltip?.contains(el);
|
|
78
|
+
const isTrigger = trigger?.contains(el);
|
|
79
|
+
const isOutside = !isTrigger && !isTooltip;
|
|
80
|
+
if (isOutside && controlledOpen) {
|
|
81
|
+
setInternalOpen(false);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
if (controlledOpen) {
|
|
85
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
86
|
+
/* Add click listener to handle mobile tap-to-close */
|
|
87
|
+
document.addEventListener('click', handleClick);
|
|
88
|
+
}
|
|
74
89
|
return () => {
|
|
75
90
|
window.removeEventListener('keydown', handleKeyDown);
|
|
91
|
+
document.removeEventListener('click', handleClick);
|
|
76
92
|
};
|
|
77
|
-
}, []);
|
|
93
|
+
}, [controlledOpen]);
|
|
78
94
|
/* If children is only a string, make a span */
|
|
79
95
|
const ChildContainer = typeof children === 'string' ? 'span' : Slot;
|
|
80
96
|
/* Make sure it is valid */
|
|
@@ -32,6 +32,8 @@ export type DialogProps = MergeRight<DefaultProps & DialogHTMLAttributes<HTMLDia
|
|
|
32
32
|
/**
|
|
33
33
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
34
34
|
* @default false
|
|
35
|
+
*
|
|
36
|
+
* @deprecated Will be removed in the next major version. Should always be a `<dialog>` element
|
|
35
37
|
*/
|
|
36
38
|
asChild?: boolean;
|
|
37
39
|
}>;
|
|
@@ -89,6 +91,8 @@ export declare const Dialog: React.ForwardRefExoticComponent<Omit<DefaultProps &
|
|
|
89
91
|
/**
|
|
90
92
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
91
93
|
* @default false
|
|
94
|
+
*
|
|
95
|
+
* @deprecated Will be removed in the next major version. Should always be a `<dialog>` element
|
|
92
96
|
*/
|
|
93
97
|
asChild?: boolean;
|
|
94
98
|
} & React.RefAttributes<HTMLDialogElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAE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CAAC;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM;IA5Df;;;OAGG;kBACW,MAAM,GAAG,KAAK;IAC5B;;;;OAIG;eACQ,MAAM,GAAG,cAAc,GAAG,KAAK;IAC1C;;;;;;OAMG;YACK,OAAO;IACf;;OAEG;WACI,OAAO;IACd;;OAEG;cACO,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IAChC;;;;;OAKG;cACO,OAAO;2CA2HpB,CAAC"}
|
|
@@ -18,13 +18,9 @@ export type SkeletonProps = {
|
|
|
18
18
|
* @default false
|
|
19
19
|
*/
|
|
20
20
|
asChild?: boolean;
|
|
21
|
-
|
|
22
|
-
variant: 'text';
|
|
21
|
+
/** @deprecated This prop has no effect. Use `width` or supply text as children instead */
|
|
23
22
|
characters?: number;
|
|
24
|
-
}
|
|
25
|
-
variant?: 'rectangle' | 'circle';
|
|
26
|
-
characters?: never;
|
|
27
|
-
});
|
|
23
|
+
} & HTMLAttributes<HTMLSpanElement>;
|
|
28
24
|
/**
|
|
29
25
|
* Skeleton is used to represent a draft of page while the content loads.
|
|
30
26
|
*
|
|
@@ -33,5 +29,26 @@ export type SkeletonProps = {
|
|
|
33
29
|
* <Skeleton variant="text" />
|
|
34
30
|
* <Skeleton variant="rectangle" />
|
|
35
31
|
*/
|
|
36
|
-
export declare const Skeleton: React.ForwardRefExoticComponent<
|
|
32
|
+
export declare const Skeleton: React.ForwardRefExoticComponent<{
|
|
33
|
+
/**
|
|
34
|
+
* The width of the component
|
|
35
|
+
*/
|
|
36
|
+
width?: string | number;
|
|
37
|
+
/**
|
|
38
|
+
* The height of the component
|
|
39
|
+
*/
|
|
40
|
+
height?: string | number;
|
|
41
|
+
/**
|
|
42
|
+
* The shape variant
|
|
43
|
+
* @default 'rectangle'
|
|
44
|
+
*/
|
|
45
|
+
variant?: "rectangle" | "circle" | "text";
|
|
46
|
+
/**
|
|
47
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
asChild?: boolean;
|
|
51
|
+
/** @deprecated This prop has no effect. Use `width` or supply text as children instead */
|
|
52
|
+
characters?: number;
|
|
53
|
+
} & HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
37
54
|
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIxD,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIxD,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAEpC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;IA9BnB;;OAEG;YACK,MAAM,GAAG,MAAM;IACvB;;OAEG;aACM,MAAM,GAAG,MAAM;IACxB;;;OAGG;cACO,WAAW,GAAG,QAAQ,GAAG,MAAM;IACzC;;;OAGG;cACO,OAAO;IACjB,0FAA0F;iBAC7E,MAAM;2EA2CpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-list.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs-list.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAM5C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,sFAkBpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-panel.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs-panel.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAa5C,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,SAAS;IAbpB;;;OAGG;WACI,MAAM;wFAgEd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-tab.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,OAAO;IAZlB;;OAEG;WACI,MAAM;
|
|
1
|
+
{"version":3,"file":"tabs-tab.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,OAAO;IAZlB;;OAEG;WACI,MAAM;8FAkCd,CAAC"}
|
|
@@ -21,7 +21,10 @@ export type TabsProps = MergeRight<DefaultProps & Omit<HTMLAttributes<HTMLDivEle
|
|
|
21
21
|
export type ContextProps = {
|
|
22
22
|
value?: string;
|
|
23
23
|
defaultValue?: string;
|
|
24
|
+
panelButtonMap?: Map<string, string>;
|
|
25
|
+
setPanelButtonMap?: React.Dispatch<React.SetStateAction<Map<string, string>>>;
|
|
24
26
|
onChange?: (value: string) => void;
|
|
27
|
+
tablistRef?: React.RefObject<HTMLDivElement | null>;
|
|
25
28
|
};
|
|
26
29
|
export declare const Context: React.Context<ContextProps>;
|
|
27
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,UAAU,CAChC,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,EACzE;IACE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CACF,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,UAAU,CAChC,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,EACzE;IACE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,E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AC,EAAE,OAAO,CAAC;CAChB,CACF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO;IA1ChB;;;;;OAKG;cACO,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM;IAC9D;;QAEI;aACK,MAAM;IACf;;;OAGG;gBACS,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;IAC/C;;;OAGG;oBACa,OAAO;IACvB;;;OAGG;WACI,OAAO;kCAoKjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digdir/designsystemet-react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"description": "React components for Designsystemet",
|
|
6
6
|
"author": "Designsystemet team",
|
|
7
7
|
"repository": {
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@floating-ui/dom": "^1.7.3",
|
|
40
40
|
"@floating-ui/react": "0.26.23",
|
|
41
|
-
"@navikt/aksel-icons": "^7.
|
|
41
|
+
"@navikt/aksel-icons": "^7.27.0",
|
|
42
42
|
"@radix-ui/react-slot": "^1.2.3",
|
|
43
43
|
"@tanstack/react-virtual": "^3.13.12",
|
|
44
44
|
"@u-elements/u-combobox": "^0.0.20",
|
|
45
|
-
"@u-elements/u-datalist": "^1.0.
|
|
46
|
-
"@u-elements/u-details": "^0.1.
|
|
45
|
+
"@u-elements/u-datalist": "^1.0.13",
|
|
46
|
+
"@u-elements/u-details": "^0.1.2",
|
|
47
47
|
"clsx": "^2.1.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
51
51
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
52
|
-
"@storybook/addon-docs": "^9.1.
|
|
53
|
-
"@storybook/addon-vitest": "^9.1.
|
|
54
|
-
"@storybook/react-vite": "^9.1.
|
|
52
|
+
"@storybook/addon-docs": "^9.1.1",
|
|
53
|
+
"@storybook/addon-vitest": "^9.1.1",
|
|
54
|
+
"@storybook/react-vite": "^9.1.1",
|
|
55
55
|
"@testing-library/dom": "^10.4.1",
|
|
56
56
|
"@testing-library/jest-dom": "^6.6.4",
|
|
57
57
|
"@testing-library/react": "^16.3.0",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"rimraf": "^6.0.1",
|
|
65
65
|
"rollup": "^4.46.2",
|
|
66
66
|
"rollup-plugin-copy": "^3.5.0",
|
|
67
|
-
"storybook": "^9.1.
|
|
67
|
+
"storybook": "^9.1.1",
|
|
68
68
|
"tsx": "4.20.3",
|
|
69
69
|
"typescript": "^5.9.2",
|
|
70
|
-
"@digdir/designsystemet": "^1.
|
|
71
|
-
"@digdir/designsystemet-css": "^1.
|
|
70
|
+
"@digdir/designsystemet": "^1.2.0",
|
|
71
|
+
"@digdir/designsystemet-css": "^1.2.0"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "pnpm run clean && tsc -b tsconfig.lib.json --emitDeclarationOnly false && rollup -c --bundleConfigAsCjs",
|