@norges-domstoler/dds-components 5.2.0 → 5.4.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/README.md +19 -5
- package/dist/cjs/components/Breadcrumbs/Breadcrumb.tokens.d.ts +14 -5
- package/dist/cjs/components/Checkbox/Checkbox.styles.d.ts +0 -3
- package/dist/cjs/components/InternalHeader/InternalHeader.styles.d.ts +1 -1
- package/dist/cjs/components/InternalHeader/InternalHeader.tokens.d.ts +39 -27
- package/dist/cjs/components/OverflowMenu/OverflowMenu.tokens.d.ts +25 -10
- package/dist/cjs/components/RadioButton/RadioButton.styles.d.ts +0 -3
- package/dist/cjs/components/Select/Select.tokens.d.ts +0 -3
- package/dist/cjs/components/ToggleBar/ToggleBar.context.d.ts +10 -0
- package/dist/cjs/components/ToggleBar/ToggleBar.d.ts +2 -0
- package/dist/cjs/components/ToggleBar/ToggleBar.stories.d.ts +20 -0
- package/dist/cjs/components/ToggleBar/ToggleBar.tokens.d.ts +111 -0
- package/dist/cjs/components/ToggleBar/ToggleBar.types.d.ts +19 -0
- package/dist/cjs/components/ToggleBar/ToggleRadio.d.ts +19 -0
- package/dist/cjs/components/ToggleBar/ToggleRadio.styles.d.ts +11 -0
- package/dist/cjs/components/ToggleBar/index.d.ts +3 -0
- package/dist/cjs/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/cjs/helpers/HiddenInput/HiddenInput.d.ts +1 -0
- package/dist/cjs/helpers/HiddenInput/index.d.ts +1 -0
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/styling/hideInput.d.ts +2 -2
- package/dist/cjs/helpers/styling/index.d.ts +1 -0
- package/dist/cjs/helpers/styling/selection.d.ts +4 -0
- package/dist/cjs/icons/tsx/closeSmall.d.ts +2 -0
- package/dist/cjs/icons/tsx/index.d.ts +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1400 -1229
- package/dist/components/Breadcrumbs/Breadcrumb.tokens.d.ts +14 -5
- package/dist/components/Breadcrumbs/Breadcrumb.tokens.js +11 -12
- package/dist/components/Breadcrumbs/Breadcrumbs.js +10 -14
- package/dist/components/Card/CardAccordion/CardAccordion.js +3 -8
- package/dist/components/Checkbox/Checkbox.js +7 -9
- package/dist/components/Checkbox/Checkbox.styles.d.ts +0 -3
- package/dist/components/Checkbox/Checkbox.styles.js +15 -26
- package/dist/components/Checkbox/CheckboxGroup.js +3 -7
- package/dist/components/Datepicker/Datepicker.js +3 -7
- package/dist/components/Drawer/Drawer.js +3 -7
- package/dist/components/Drawer/DrawerGroup.js +7 -12
- package/dist/components/InternalHeader/InternalHeader.js +2 -2
- package/dist/components/InternalHeader/InternalHeader.styles.d.ts +1 -1
- package/dist/components/InternalHeader/InternalHeader.styles.js +17 -11
- package/dist/components/InternalHeader/InternalHeader.tokens.d.ts +39 -27
- package/dist/components/InternalHeader/InternalHeader.tokens.js +48 -80
- package/dist/components/InternalHeader/NavigationItem.js +4 -2
- package/dist/components/Modal/Modal.js +3 -9
- package/dist/components/OverflowMenu/OverflowMenu.js +5 -3
- package/dist/components/OverflowMenu/OverflowMenu.tokens.d.ts +25 -10
- package/dist/components/OverflowMenu/OverflowMenu.tokens.js +33 -45
- package/dist/components/OverflowMenu/OverflowMenuGroup.js +3 -7
- package/dist/components/OverflowMenu/OverflowMenuItem.js +7 -3
- package/dist/components/Pagination/Pagination.js +3 -3
- package/dist/components/Popover/PopoverGroup.js +3 -7
- package/dist/components/RadioButton/RadioButton.js +8 -11
- package/dist/components/RadioButton/RadioButton.styles.d.ts +0 -3
- package/dist/components/RadioButton/RadioButton.styles.js +8 -19
- package/dist/components/RadioButton/RadioButtonGroup.js +5 -8
- package/dist/components/Search/Search.js +3 -7
- package/dist/components/Select/Select.js +41 -10
- package/dist/components/Select/Select.styles.js +4 -1
- package/dist/components/Select/Select.tokens.d.ts +0 -3
- package/dist/components/Select/Select.tokens.js +6 -18
- package/dist/components/Spinner/Spinner.js +3 -8
- package/dist/components/Table/SortCell.js +1 -1
- package/dist/components/Tabs/TabList.js +2 -5
- package/dist/components/Tabs/Tabs.js +11 -13
- package/dist/components/TextInput/CharCounter.js +3 -7
- package/dist/components/TextInput/TextInput.js +3 -6
- package/dist/components/ToggleBar/ToggleBar.context.d.ts +10 -0
- package/dist/components/ToggleBar/ToggleBar.context.js +10 -0
- package/dist/components/ToggleBar/ToggleBar.d.ts +2 -0
- package/dist/components/ToggleBar/ToggleBar.js +77 -0
- package/dist/components/ToggleBar/ToggleBar.stories.d.ts +20 -0
- package/dist/components/ToggleBar/ToggleBar.tokens.d.ts +111 -0
- package/dist/components/ToggleBar/ToggleBar.tokens.js +100 -0
- package/dist/components/ToggleBar/ToggleBar.types.d.ts +19 -0
- package/dist/components/ToggleBar/ToggleRadio.d.ts +19 -0
- package/dist/components/ToggleBar/ToggleRadio.js +80 -0
- package/dist/components/ToggleBar/ToggleRadio.styles.d.ts +11 -0
- package/dist/components/ToggleBar/ToggleRadio.styles.js +21 -0
- package/dist/components/ToggleBar/index.d.ts +3 -0
- package/dist/components/ToggleButton/ToggleButton.js +8 -16
- package/dist/components/ToggleButton/ToggleButtonGroup.js +3 -7
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +10 -14
- package/dist/helpers/HiddenInput/HiddenInput.d.ts +1 -0
- package/dist/helpers/HiddenInput/HiddenInput.js +8 -0
- package/dist/helpers/HiddenInput/index.d.ts +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/styling/hideInput.d.ts +2 -2
- package/dist/helpers/styling/index.d.ts +1 -0
- package/dist/helpers/styling/selection.d.ts +4 -0
- package/dist/helpers/styling/selection.js +9 -0
- package/dist/icons/tsx/closeSmall.d.ts +2 -0
- package/dist/icons/tsx/closeSmall.js +25 -0
- package/dist/icons/tsx/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/package.json +2 -2
- package/dist/helpers/styling/hideInput.js +0 -9
|
@@ -1,93 +1,61 @@
|
|
|
1
1
|
import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
|
-
import { focusVisibleLink } from '../../helpers/styling/focusVisible.js';
|
|
3
2
|
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
var border = ddsBaseTokens.border,
|
|
4
|
+
colors = ddsBaseTokens.colors,
|
|
5
|
+
spacing = ddsBaseTokens.spacing,
|
|
6
|
+
fontPackages = ddsBaseTokens.fontPackages;
|
|
7
|
+
var borderStyle = "".concat(border.BordersDdsBorderStyleLightStrokeWeight, " ").concat(border.BordersDdsBorderStyleLightStroke, " solid ");
|
|
8
|
+
var navLink = {
|
|
9
|
+
base: {
|
|
10
|
+
color: colors.DdsColorNeutralsGray9,
|
|
11
|
+
textDecoration: 'none',
|
|
12
|
+
backgroundColor: colors.DdsColorNeutralsWhite,
|
|
13
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX075, " ").concat(spacing.SizesDdsSpacingLocalX15),
|
|
14
|
+
font: fontPackages.body_sans_01.base
|
|
15
|
+
},
|
|
16
|
+
hover: {
|
|
17
|
+
color: colors.DdsColorInteractiveDark
|
|
18
|
+
},
|
|
19
|
+
active: {
|
|
20
|
+
color: colors.DdsColorInteractiveDark
|
|
21
|
+
},
|
|
22
|
+
current: {
|
|
23
|
+
color: colors.DdsColorInteractiveDarkest,
|
|
24
|
+
backgroundColor: colors.DdsColorPrimaryLightest
|
|
25
|
+
}
|
|
23
26
|
};
|
|
24
|
-
var
|
|
25
|
-
|
|
27
|
+
var outerContainer = {
|
|
28
|
+
backgroundColor: colors.DdsColorNeutralsWhite
|
|
26
29
|
};
|
|
27
|
-
var
|
|
28
|
-
padding: "".concat(
|
|
29
|
-
borderRight: "".concat(Border.BordersDdsBorderStyleLightStrokeWeight, " ").concat(borderColor, " solid ")
|
|
30
|
+
var applicationNameWrapper = {
|
|
31
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX1, " ").concat(spacing.SizesDdsSpacingLocalX15)
|
|
30
32
|
};
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
var lovisaWrapper = {
|
|
34
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX1, " ").concat(spacing.SizesDdsSpacingLocalX15),
|
|
35
|
+
borderRight: borderStyle
|
|
34
36
|
};
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
var banner = {
|
|
38
|
+
borderBottom: borderStyle,
|
|
39
|
+
paddingRight: spacing.SizesDdsSpacingLocalX1,
|
|
40
|
+
hasContextMenu: {
|
|
41
|
+
paddingRight: spacing.SizesDdsSpacingLayoutX4
|
|
42
|
+
}
|
|
38
43
|
};
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
}, linkBase);
|
|
42
|
-
var navigationLinkHoverBase = Object.assign({}, linkHoverBase);
|
|
43
|
-
var navigationLinkActiveBase = Object.assign({}, linkActiveBase);
|
|
44
|
-
var navigationLinkFocusBase = Object.assign({}, focusVisibleLink);
|
|
45
|
-
var navigationLinkCurrentBase = {
|
|
46
|
-
color: Colors.DdsColorInteractiveDarker,
|
|
47
|
-
backgroundColor: Colors.DdsColorPrimaryLightest
|
|
44
|
+
var navigation = {
|
|
45
|
+
borderBottom: borderStyle
|
|
48
46
|
};
|
|
49
|
-
var
|
|
50
|
-
right:
|
|
51
|
-
top:
|
|
47
|
+
var contextGroup = {
|
|
48
|
+
right: spacing.SizesDdsSpacingLocalX075,
|
|
49
|
+
top: spacing.SizesDdsSpacingLocalX025
|
|
52
50
|
};
|
|
53
51
|
var internalHeaderTokens = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
base: lovisaWrapperBase
|
|
62
|
-
},
|
|
63
|
-
banner: {
|
|
64
|
-
base: bannerBase,
|
|
65
|
-
contextMenuSpacing: Spacing.SizesDdsSpacingLayoutX4
|
|
66
|
-
},
|
|
67
|
-
bannerLeft: {
|
|
68
|
-
base: bannerLeftBase
|
|
69
|
-
},
|
|
70
|
-
navigation: {
|
|
71
|
-
base: navigationBase
|
|
72
|
-
},
|
|
73
|
-
navigationLink: {
|
|
74
|
-
base: navigationLinkBase,
|
|
75
|
-
hover: {
|
|
76
|
-
base: navigationLinkHoverBase
|
|
77
|
-
},
|
|
78
|
-
active: {
|
|
79
|
-
base: navigationLinkActiveBase
|
|
80
|
-
},
|
|
81
|
-
focus: {
|
|
82
|
-
base: navigationLinkFocusBase
|
|
83
|
-
},
|
|
84
|
-
current: {
|
|
85
|
-
base: navigationLinkCurrentBase
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
contextGroup: {
|
|
89
|
-
base: contextGroupBase
|
|
90
|
-
}
|
|
52
|
+
navLink: navLink,
|
|
53
|
+
outerContainer: outerContainer,
|
|
54
|
+
applicationNameWrapper: applicationNameWrapper,
|
|
55
|
+
lovisaWrapper: lovisaWrapper,
|
|
56
|
+
banner: banner,
|
|
57
|
+
navigation: navigation,
|
|
58
|
+
contextGroup: contextGroup
|
|
91
59
|
};
|
|
92
60
|
|
|
93
61
|
export { internalHeaderTokens };
|
|
@@ -3,13 +3,15 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import { internalHeaderTokens } from './InternalHeader.tokens.js';
|
|
6
|
+
import { focusVisible } from '../../helpers/styling/focusVisible.js';
|
|
6
7
|
|
|
8
|
+
var navLink = internalHeaderTokens.navLink;
|
|
7
9
|
var Link = styled.a.withConfig({
|
|
8
10
|
displayName: "NavigationItem__Link",
|
|
9
11
|
componentId: "sc-1fua9kw-0"
|
|
10
|
-
})(["display:flex;align-items:center;@media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}
|
|
12
|
+
})(["display:flex;align-items:center;height:100%;box-sizing:border-box;@media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}color:", ";background-color:", ";padding:", ";text-decoration:", ";", ";&:hover{color:", ";}&:active{color:", ";}&:focus-visible,&.focus-visible{", ";}", ""], navLink.base.color, navLink.base.backgroundColor, navLink.base.padding, navLink.base.textDecoration, navLink.base.font, navLink.hover.color, navLink.active.color, focusVisible, function (_ref) {
|
|
11
13
|
var isCurrent = _ref.isCurrent;
|
|
12
|
-
return isCurrent && css(["", ""],
|
|
14
|
+
return isCurrent && css(["color:", ";background-color:", ";&:hover{color:", ";}"], navLink.current.color, navLink.current.backgroundColor, navLink.current.color);
|
|
13
15
|
});
|
|
14
16
|
var NavigationItem = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
15
17
|
var title = _a.title,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from 'tslib';
|
|
3
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import { forwardRef,
|
|
3
|
+
import { forwardRef, useId, useEffect } from 'react';
|
|
5
4
|
import styled from 'styled-components';
|
|
6
5
|
import { modalTokens } from './Modal.tokens.js';
|
|
7
6
|
import { createPortal } from 'react-dom';
|
|
@@ -34,7 +33,6 @@ var StyledButton = styled(Button).withConfig({
|
|
|
34
33
|
displayName: "Modal__StyledButton",
|
|
35
34
|
componentId: "sc-12c14zx-3"
|
|
36
35
|
})(["align-self:flex-end;"]);
|
|
37
|
-
var nextUniqueId = 0;
|
|
38
36
|
var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
39
37
|
var _props$isOpen = props.isOpen,
|
|
40
38
|
isOpen = _props$isOpen === void 0 ? false : _props$isOpen,
|
|
@@ -49,12 +47,8 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
49
47
|
htmlProps = props.htmlProps,
|
|
50
48
|
rest = __rest(props, ["isOpen", "parentElement", "children", "header", "onClose", "id", "triggerRef", "className", "htmlProps"]);
|
|
51
49
|
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
var _useState = useState(id !== null && id !== void 0 ? id : "modal-".concat(uniqueId)),
|
|
55
|
-
_useState2 = _slicedToArray(_useState, 1),
|
|
56
|
-
modalId = _useState2[0];
|
|
57
|
-
|
|
50
|
+
var generatedId = useId();
|
|
51
|
+
var modalId = id !== null && id !== void 0 ? id : "".concat(generatedId, "-modal");
|
|
58
52
|
var headerId = "".concat(modalId, "-header");
|
|
59
53
|
var modalRef = useFocusTrap(isOpen);
|
|
60
54
|
var combinedRef = useCombinedRef(ref, modalRef);
|
|
@@ -18,13 +18,15 @@ import { scrollbarStyling } from '../ScrollableContainer/scrollbarStyling.js';
|
|
|
18
18
|
import { useCombinedRef } from '../../hooks/useCombinedRefs.js';
|
|
19
19
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
20
20
|
|
|
21
|
+
var container = overflowMenuTokens.container,
|
|
22
|
+
divider = overflowMenuTokens.divider;
|
|
21
23
|
var Container = styled.div.withConfig({
|
|
22
24
|
displayName: "OverflowMenu__Container",
|
|
23
25
|
componentId: "sc-kh744b-0"
|
|
24
|
-
})(["box-sizing:border-box;z-index:3;overflow-y:auto;min-width:180px;max-width:300px;", " ", " ", " ", " *::selection{", "}"], function (_ref) {
|
|
26
|
+
})(["box-sizing:border-box;z-index:3;overflow-y:auto;min-width:180px;max-width:300px;", " border:", ";background-color:", ";border-radius:", ";", " ", " *::selection{", "}"], function (_ref) {
|
|
25
27
|
var isOpen = _ref.isOpen;
|
|
26
28
|
return visibilityTransition(isOpen);
|
|
27
|
-
},
|
|
29
|
+
}, container.border, container.backgroundColor, container.borderRadius, scrollbarStyling.webkit, scrollbarStyling.firefox, typographyTokens.selection.base);
|
|
28
30
|
var OverflowMenuList = styled.ul.withConfig({
|
|
29
31
|
displayName: "OverflowMenu__OverflowMenuList",
|
|
30
32
|
componentId: "sc-kh744b-1"
|
|
@@ -32,7 +34,7 @@ var OverflowMenuList = styled.ul.withConfig({
|
|
|
32
34
|
var StyledDivider = styled(Divider).withConfig({
|
|
33
35
|
displayName: "OverflowMenu__StyledDivider",
|
|
34
36
|
componentId: "sc-kh744b-2"
|
|
35
|
-
})(["", ""],
|
|
37
|
+
})(["margin-left:", ";margin-right:", ";"], divider.marginLeft, divider.marginRight);
|
|
36
38
|
var OverflowMenu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
37
39
|
var _a, _b;
|
|
38
40
|
|
|
@@ -1,22 +1,37 @@
|
|
|
1
|
-
import { CSSObject } from 'styled-components';
|
|
2
1
|
export declare const overflowMenuTokens: {
|
|
3
2
|
container: {
|
|
4
|
-
|
|
3
|
+
border: string;
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
borderRadius: string;
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
-
base:
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
element: {
|
|
8
|
+
base: {
|
|
9
|
+
color: string;
|
|
10
|
+
textDecoration: string;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
padding: string;
|
|
13
|
+
gap: string;
|
|
14
|
+
font: {
|
|
15
|
+
lineHeight: any;
|
|
16
|
+
fontSize: string;
|
|
17
|
+
letterSpacing: any;
|
|
18
|
+
fontFamily: any;
|
|
19
|
+
fontWeight: any;
|
|
20
|
+
fontStyle: any;
|
|
21
|
+
};
|
|
10
22
|
};
|
|
23
|
+
};
|
|
24
|
+
link: {
|
|
11
25
|
hover: {
|
|
12
|
-
|
|
26
|
+
color: string;
|
|
13
27
|
};
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
active: {
|
|
29
|
+
color: string;
|
|
16
30
|
};
|
|
17
31
|
};
|
|
18
32
|
divider: {
|
|
19
|
-
|
|
33
|
+
marginRight: string;
|
|
34
|
+
marginLeft: string;
|
|
20
35
|
};
|
|
21
36
|
offset: number;
|
|
22
37
|
};
|
|
@@ -1,55 +1,43 @@
|
|
|
1
1
|
import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
|
-
import { focusVisibleLink } from '../../helpers/styling/focusVisible.js';
|
|
3
2
|
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
backgroundColor: Colors.DdsColorPrimaryLightest
|
|
3
|
+
var border = ddsBaseTokens.border,
|
|
4
|
+
borderRadius = ddsBaseTokens.borderRadius,
|
|
5
|
+
colors = ddsBaseTokens.colors,
|
|
6
|
+
spacing = ddsBaseTokens.spacing,
|
|
7
|
+
fontPackages = ddsBaseTokens.fontPackages;
|
|
8
|
+
var element = {
|
|
9
|
+
base: {
|
|
10
|
+
color: colors.DdsColorNeutralsGray9,
|
|
11
|
+
textDecoration: 'none',
|
|
12
|
+
backgroundColor: colors.DdsColorNeutralsWhite,
|
|
13
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX075, " ").concat(spacing.SizesDdsSpacingLocalX15),
|
|
14
|
+
gap: spacing.SizesDdsSpacingLocalX025,
|
|
15
|
+
font: fontPackages.body_sans_01.base
|
|
16
|
+
}
|
|
19
17
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
18
|
+
var link = {
|
|
19
|
+
hover: {
|
|
20
|
+
color: colors.DdsColorInteractiveDark
|
|
21
|
+
},
|
|
22
|
+
active: {
|
|
23
|
+
color: colors.DdsColorInteractiveDark
|
|
24
|
+
}
|
|
22
25
|
};
|
|
23
|
-
var
|
|
24
|
-
border: "".concat(
|
|
25
|
-
backgroundColor:
|
|
26
|
-
borderRadius:
|
|
26
|
+
var container = {
|
|
27
|
+
border: "".concat(border.BordersDdsBorderStyleLightStrokeWeight, " ").concat(border.BordersDdsBorderStyleLightStroke, " solid "),
|
|
28
|
+
backgroundColor: colors.DdsColorNeutralsWhite,
|
|
29
|
+
borderRadius: borderRadius.RadiiDdsBorderRadius1Radius
|
|
27
30
|
};
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
marginLeft: Spacing.SizesDdsSpacingLocalX15
|
|
31
|
+
var divider = {
|
|
32
|
+
marginRight: spacing.SizesDdsSpacingLocalX15,
|
|
33
|
+
marginLeft: spacing.SizesDdsSpacingLocalX15
|
|
32
34
|
};
|
|
33
35
|
var overflowMenuTokens = {
|
|
34
|
-
container:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
active: {
|
|
40
|
-
base: linkActiveBase
|
|
41
|
-
},
|
|
42
|
-
hover: {
|
|
43
|
-
base: linkHoverBase
|
|
44
|
-
},
|
|
45
|
-
focus: {
|
|
46
|
-
base: linkFocusBase
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
divider: {
|
|
50
|
-
base: dividerBase
|
|
51
|
-
},
|
|
52
|
-
offset: Spacing.SizesDdsSpacingLocalX0125NumberPx
|
|
36
|
+
container: container,
|
|
37
|
+
element: element,
|
|
38
|
+
link: link,
|
|
39
|
+
divider: divider,
|
|
40
|
+
offset: spacing.SizesDdsSpacingLocalX0125NumberPx
|
|
53
41
|
};
|
|
54
42
|
|
|
55
43
|
export { overflowMenuTokens };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useRef, Children, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import { useState, useRef, useId, Children, isValidElement, cloneElement } from 'react';
|
|
4
4
|
|
|
5
|
-
var nextUniqueId = 0;
|
|
6
5
|
var OverflowMenuGroup = function OverflowMenuGroup(_ref) {
|
|
7
6
|
var children = _ref.children,
|
|
8
7
|
onClose = _ref.onClose,
|
|
@@ -24,11 +23,8 @@ var OverflowMenuGroup = function OverflowMenuGroup(_ref) {
|
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
var buttonRef = useRef(null);
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
var _useState3 = useState(overflowMenuId !== null && overflowMenuId !== void 0 ? overflowMenuId : "overflowMenu-".concat(uniqueId)),
|
|
30
|
-
_useState4 = _slicedToArray(_useState3, 1),
|
|
31
|
-
uniqueOverflowMenuId = _useState4[0];
|
|
26
|
+
var generatedId = useId();
|
|
27
|
+
var uniqueOverflowMenuId = overflowMenuId !== null && overflowMenuId !== void 0 ? overflowMenuId : "".concat(generatedId, "-overflowMenu");
|
|
32
28
|
|
|
33
29
|
var handleClose = function handleClose() {
|
|
34
30
|
onClose && onClose();
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef, useRef, useEffect, useCallback } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
4
|
+
import styled, { css } from 'styled-components';
|
|
5
5
|
import { overflowMenuTokens } from './OverflowMenu.tokens.js';
|
|
6
6
|
import { useCombinedRef } from '../../hooks/useCombinedRefs.js';
|
|
7
|
+
import { focusVisibleLink } from '../../helpers/styling/focusVisible.js';
|
|
7
8
|
import { Icon } from '../Icon/Icon.js';
|
|
8
9
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
9
10
|
|
|
11
|
+
var element = overflowMenuTokens.element,
|
|
12
|
+
link = overflowMenuTokens.link;
|
|
13
|
+
var elementBaseCSS = css(["display:flex;align-items:center;box-sizing:border-box;color:", ";text-decoration:", ";background-color:", ";padding:", ";gap:", ";", ""], element.base.color, element.base.textDecoration, element.base.backgroundColor, element.base.padding, element.base.gap, element.base.font);
|
|
10
14
|
var Span = styled.span.withConfig({
|
|
11
15
|
displayName: "OverflowMenuItem__Span",
|
|
12
16
|
componentId: "sc-1ka2asi-0"
|
|
13
|
-
})(["", "
|
|
17
|
+
})(["", ""], elementBaseCSS);
|
|
14
18
|
var Link = styled.a.withConfig({
|
|
15
19
|
displayName: "OverflowMenuItem__Link",
|
|
16
20
|
componentId: "sc-1ka2asi-1"
|
|
17
|
-
})(["
|
|
21
|
+
})(["border:none;cursor:pointer;outline:inherit;width:100%;", " @media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}&:hover{color:", ";}&:active{color:", ";}&:focus-visible,&.focus-visible{", "}"], elementBaseCSS, link.hover.color, link.active.color, focusVisibleLink);
|
|
18
22
|
|
|
19
23
|
var isAnchorProps = function isAnchorProps(props) {
|
|
20
24
|
return props.href !== undefined;
|
|
@@ -34,9 +34,9 @@ var ListItem = styled.li.withConfig({
|
|
|
34
34
|
var Container = styled.div.withConfig({
|
|
35
35
|
displayName: "Pagination__Container",
|
|
36
36
|
componentId: "sc-5ltegq-3"
|
|
37
|
-
})(["display:
|
|
37
|
+
})(["display:flex;gap:", ";", ""], paginationTokens.container.spaceBetweenItems, function (_ref2) {
|
|
38
38
|
var smallScreen = _ref2.smallScreen;
|
|
39
|
-
return smallScreen ? css(["flex-direction:column;align-items:center;"]) : css(["justify-content:space-
|
|
39
|
+
return smallScreen ? css(["flex-direction:column;align-items:center;"]) : css(["justify-content:space-between;flex-wrap:wrap;"]);
|
|
40
40
|
});
|
|
41
41
|
var IndicatorsContainer = styled.div.withConfig({
|
|
42
42
|
displayName: "Pagination__IndicatorsContainer",
|
|
@@ -229,7 +229,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
229
229
|
children: [withSelect && jsx(Select, {
|
|
230
230
|
options: selectOptions,
|
|
231
231
|
isSearchable: false,
|
|
232
|
-
width: "
|
|
232
|
+
width: "88px",
|
|
233
233
|
defaultValue: {
|
|
234
234
|
label: itemsPerPage.toString(),
|
|
235
235
|
value: itemsPerPage
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useEffect, useRef, Children, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import { useState, useEffect, useId, useRef, Children, isValidElement, cloneElement } from 'react';
|
|
4
4
|
import { useOnKeyDown } from '../../hooks/useOnKeyDown.js';
|
|
5
5
|
import { useOnClickOutside } from '../../hooks/useOnClickOutside.js';
|
|
6
6
|
|
|
7
|
-
var nextUniqueId = 0;
|
|
8
7
|
var PopoverGroup = function PopoverGroup(_ref) {
|
|
9
8
|
var _ref$isOpen = _ref.isOpen,
|
|
10
9
|
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
|
@@ -21,11 +20,8 @@ var PopoverGroup = function PopoverGroup(_ref) {
|
|
|
21
20
|
useEffect(function () {
|
|
22
21
|
setOpen(isOpen);
|
|
23
22
|
}, [isOpen]);
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
var _useState3 = useState(popoverId !== null && popoverId !== void 0 ? popoverId : "popover-".concat(uniqueId)),
|
|
27
|
-
_useState4 = _slicedToArray(_useState3, 1),
|
|
28
|
-
uniquePopoverId = _useState4[0];
|
|
23
|
+
var generatedId = useId();
|
|
24
|
+
var uniquePopoverId = popoverId !== null && popoverId !== void 0 ? popoverId : "".concat(generatedId, "-popover");
|
|
29
25
|
|
|
30
26
|
var handleOnCloseButtonClick = function handleOnCloseButtonClick() {
|
|
31
27
|
setOpen(false);
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from 'tslib';
|
|
3
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { forwardRef,
|
|
3
|
+
import { forwardRef, useId } from 'react';
|
|
5
4
|
import { useRadioButtonGroup } from './RadioButtonGroupContext.js';
|
|
6
|
-
import { Container,
|
|
5
|
+
import { Container, CustomRadioButton } from './RadioButton.styles.js';
|
|
7
6
|
import { getBaseHTMLProps, joinClassNames } from '../../types/BaseComponentProps.js';
|
|
7
|
+
import { HiddenInput } from '../../helpers/HiddenInput/HiddenInput.js';
|
|
8
8
|
import { Typography } from '../Typography/Typography.js';
|
|
9
9
|
|
|
10
|
-
var nextUniqueId = 0;
|
|
11
|
-
|
|
12
10
|
var isValueEqualToGroupValueOrFalsy = function isValueEqualToGroupValueOrFalsy(value, group) {
|
|
13
11
|
if (typeof value !== 'undefined' && value !== null && group) {
|
|
14
12
|
if (typeof value === 'number') {
|
|
@@ -43,10 +41,8 @@ var RadioButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
43
41
|
style = htmlProps.style,
|
|
44
42
|
restHtmlProps = __rest(htmlProps, ["className", "style"]);
|
|
45
43
|
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
uniqueId = _useState2[0];
|
|
49
|
-
|
|
44
|
+
var generatedId = useId();
|
|
45
|
+
var uniqueId = id !== null && id !== void 0 ? id : "".concat(generatedId, "-radioButton");
|
|
50
46
|
var radioButtonGroup = useRadioButtonGroup();
|
|
51
47
|
|
|
52
48
|
var handleChange = function handleChange(event) {
|
|
@@ -58,6 +54,7 @@ var RadioButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
58
54
|
if (radioButtonGroup === null || radioButtonGroup === void 0 ? void 0 : radioButtonGroup.errorMessageId) describedByIds.push(radioButtonGroup === null || radioButtonGroup === void 0 ? void 0 : radioButtonGroup.errorMessageId);
|
|
59
55
|
if (ariaDescribedby) describedByIds.push(ariaDescribedby);
|
|
60
56
|
var inputProps = Object.assign(Object.assign({}, getBaseHTMLProps(uniqueId, restHtmlProps, rest)), {
|
|
57
|
+
type: 'radio',
|
|
61
58
|
name: name !== null && name !== void 0 ? name : radioButtonGroup === null || radioButtonGroup === void 0 ? void 0 : radioButtonGroup.name,
|
|
62
59
|
disabled: disabled || readOnly || (radioButtonGroup === null || radioButtonGroup === void 0 ? void 0 : radioButtonGroup.disabled) || (radioButtonGroup === null || radioButtonGroup === void 0 ? void 0 : radioButtonGroup.readOnly),
|
|
63
60
|
required: required || (radioButtonGroup === null || radioButtonGroup === void 0 ? void 0 : radioButtonGroup.required),
|
|
@@ -77,9 +74,9 @@ var RadioButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
77
74
|
return jsxs(Container, Object.assign({}, containerProps, {
|
|
78
75
|
htmlFor: uniqueId
|
|
79
76
|
}, {
|
|
80
|
-
children: [jsx(
|
|
77
|
+
children: [jsx(HiddenInput, Object.assign({}, inputProps, {
|
|
81
78
|
ref: ref
|
|
82
|
-
}
|
|
79
|
+
})), jsx(CustomRadioButton, {}), jsx(Typography, Object.assign({
|
|
83
80
|
as: "span"
|
|
84
81
|
}, {
|
|
85
82
|
children: children !== null && children !== void 0 ? children : label
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { RadioButtonProps } from './RadioButton.types';
|
|
2
2
|
export declare const CustomRadioButton: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
-
export declare const Input: import("styled-components").StyledComponent<"input", any, {
|
|
4
|
-
type: import("react").HTMLInputTypeAttribute;
|
|
5
|
-
}, "type">;
|
|
6
3
|
declare type ContainerProps = Pick<RadioButtonProps, 'error' | 'disabled' | 'readOnly'>;
|
|
7
4
|
export declare const Container: import("styled-components").StyledComponent<"label", any, ContainerProps, never>;
|
|
8
5
|
export {};
|
|
@@ -1,34 +1,23 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { radioButtonTokens } from './RadioButton.tokens.js';
|
|
3
|
-
import { hideInput } from '../../helpers/styling/hideInput.js';
|
|
4
3
|
import { focusVisibleTransitionValue } from '../../helpers/styling/focusVisible.js';
|
|
5
4
|
|
|
6
5
|
var CustomRadioButton = styled.span.withConfig({
|
|
7
6
|
displayName: "RadioButtonstyles__CustomRadioButton",
|
|
8
7
|
componentId: "sc-iwypha-0"
|
|
9
8
|
})(["position:absolute;box-sizing:border-box;border-radius:50%;vertical-align:middle;", " left:", ";&:after{content:'';position:absolute;display:none;}"], radioButtonTokens.radioButton.base, radioButtonTokens.radioButton.spaceLeft);
|
|
10
|
-
var Input = styled.input.attrs(function (_ref) {
|
|
11
|
-
var _ref$type = _ref.type,
|
|
12
|
-
type = _ref$type === void 0 ? 'radio' : _ref$type;
|
|
13
|
-
return {
|
|
14
|
-
type: type
|
|
15
|
-
};
|
|
16
|
-
}).withConfig({
|
|
17
|
-
displayName: "RadioButtonstyles__Input",
|
|
18
|
-
componentId: "sc-iwypha-1"
|
|
19
|
-
})(["", ""], hideInput);
|
|
20
9
|
var Container = styled.label.withConfig({
|
|
21
10
|
displayName: "RadioButtonstyles__Container",
|
|
22
|
-
componentId: "sc-iwypha-
|
|
23
|
-
})(["position:relative;display:block;cursor:pointer;user-select:none;width:fit-content;display:flex;align-items:center;", " input:checked ~ ", ":after{display:block;}input ~ ", "{transition:box-shadow 0.2s,background-color 0.2s,border 0.2s;}input:checked ~ ", "{", "}&:hover input:enabled ~ ", "{", "}&:hover input:checked:enabled ~ ", "{", "}&:focus-within{", " transition:", ";}", " ", " ", " ", ":after{border-radius:50%;", "}"], radioButtonTokens.container.base, CustomRadioButton, CustomRadioButton, CustomRadioButton, radioButtonTokens.radioButton.checked.base, CustomRadioButton, radioButtonTokens.radioButton.hover.base, CustomRadioButton, radioButtonTokens.radioButton.checked.hover.base, radioButtonTokens.container.focus.base, focusVisibleTransitionValue, function (
|
|
24
|
-
var error =
|
|
11
|
+
componentId: "sc-iwypha-1"
|
|
12
|
+
})(["position:relative;display:block;cursor:pointer;user-select:none;width:fit-content;display:flex;align-items:center;", " input:checked ~ ", ":after{display:block;}input ~ ", "{transition:box-shadow 0.2s,background-color 0.2s,border 0.2s;}input:checked ~ ", "{", "}&:hover input:enabled ~ ", "{", "}&:hover input:checked:enabled ~ ", "{", "}&:focus-within{", " transition:", ";}", " ", " ", " ", ":after{border-radius:50%;", "}"], radioButtonTokens.container.base, CustomRadioButton, CustomRadioButton, CustomRadioButton, radioButtonTokens.radioButton.checked.base, CustomRadioButton, radioButtonTokens.radioButton.hover.base, CustomRadioButton, radioButtonTokens.radioButton.checked.hover.base, radioButtonTokens.container.focus.base, focusVisibleTransitionValue, function (_ref) {
|
|
13
|
+
var error = _ref.error;
|
|
25
14
|
return error && css(["input ~ ", "{", "}&:hover input:enabled ~ ", "{", "}"], CustomRadioButton, radioButtonTokens.radioButton.danger.base, CustomRadioButton, radioButtonTokens.radioButton.danger.hover.base);
|
|
26
|
-
}, function (
|
|
27
|
-
var disabled =
|
|
15
|
+
}, function (_ref2) {
|
|
16
|
+
var disabled = _ref2.disabled;
|
|
28
17
|
return disabled && css(["cursor:not-allowed;input ~ ", "{", "}input:checked ~ ", "{", "}"], CustomRadioButton, radioButtonTokens.radioButton.disabled.base, CustomRadioButton, radioButtonTokens.radioButton.checked.disabled.base);
|
|
29
|
-
}, function (
|
|
30
|
-
var readOnly =
|
|
18
|
+
}, function (_ref3) {
|
|
19
|
+
var readOnly = _ref3.readOnly;
|
|
31
20
|
return readOnly && css(["cursor:default;input ~ ", "{", "}input:checked ~ ", "{", "}"], CustomRadioButton, radioButtonTokens.radioButton.readOnly.base, CustomRadioButton, radioButtonTokens.radioButton.checked.readOnly.base);
|
|
32
21
|
}, CustomRadioButton, radioButtonTokens.checkmark.base);
|
|
33
22
|
|
|
34
|
-
export { Container, CustomRadioButton
|
|
23
|
+
export { Container, CustomRadioButton };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { useState } from 'react';
|
|
4
|
+
import { useState, useId } from 'react';
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
6
|
import { radioButtonGroupTokens } from './RadioButtonGroup.tokens.js';
|
|
7
7
|
import { RadioButtonGroupContext } from './RadioButtonGroupContext.js';
|
|
@@ -26,7 +26,6 @@ var Label = styled(Typography).withConfig({
|
|
|
26
26
|
displayName: "RadioButtonGroup__Label",
|
|
27
27
|
componentId: "sc-1xsll60-2"
|
|
28
28
|
})(["padding-left:", ";"], radioButtonGroupTokens.label.spaceLeft);
|
|
29
|
-
var nextUniqueGroupId = 0;
|
|
30
29
|
var RadioButtonGroup = function RadioButtonGroup(_a) {
|
|
31
30
|
var name = _a.name,
|
|
32
31
|
label = _a.label,
|
|
@@ -51,10 +50,8 @@ var RadioButtonGroup = function RadioButtonGroup(_a) {
|
|
|
51
50
|
groupValue = _useState2[0],
|
|
52
51
|
setGroupValue = _useState2[1];
|
|
53
52
|
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
uniqueGroupId = _useState4[0];
|
|
57
|
-
|
|
53
|
+
var generatedId = useId();
|
|
54
|
+
var uniqueGroupId = groupId !== null && groupId !== void 0 ? groupId : "".concat(generatedId, "-radioButtonGroup");
|
|
58
55
|
var handleChange = combineHandlers(function (e) {
|
|
59
56
|
return setGroupValue(e.target.value);
|
|
60
57
|
}, function (e) {
|
|
@@ -62,8 +59,8 @@ var RadioButtonGroup = function RadioButtonGroup(_a) {
|
|
|
62
59
|
});
|
|
63
60
|
var hasErrorMessage = !!errorMessage;
|
|
64
61
|
var hasTip = !!tip;
|
|
65
|
-
var tipId =
|
|
66
|
-
var errorMessageId =
|
|
62
|
+
var tipId = tip && "".concat(uniqueGroupId, "-tip");
|
|
63
|
+
var errorMessageId = errorMessage && "".concat(uniqueGroupId, "-errorMessage");
|
|
67
64
|
var contextProps = {
|
|
68
65
|
name: name,
|
|
69
66
|
disabled: disabled,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from 'tslib';
|
|
3
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { forwardRef,
|
|
3
|
+
import { forwardRef, useId } from 'react';
|
|
5
4
|
import styled, { css } from 'styled-components';
|
|
6
5
|
import { searchTokens } from './Search.tokens.js';
|
|
7
6
|
import { Input as Input$1, OuterInputContainer, InputContainer } from '../../helpers/Input/Input.styles.js';
|
|
@@ -33,7 +32,6 @@ var ButtonWrapper = styled.div.withConfig({
|
|
|
33
32
|
displayName: "Search__ButtonWrapper",
|
|
34
33
|
componentId: "sc-1ax3s9s-3"
|
|
35
34
|
})([""]);
|
|
36
|
-
var nextUniqueId = 0;
|
|
37
35
|
var Search = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
38
36
|
var _a$componentSize = _a.componentSize,
|
|
39
37
|
componentSize = _a$componentSize === void 0 ? 'medium' : _a$componentSize,
|
|
@@ -46,10 +44,8 @@ var Search = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
46
44
|
ariaDescribedby = _a['aria-describedby'],
|
|
47
45
|
rest = __rest(_a, ["componentSize", "buttonProps", "name", "tip", "id", "className", "style", 'aria-describedby']);
|
|
48
46
|
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
uniqueId = _useState2[0];
|
|
52
|
-
|
|
47
|
+
var generatedId = useId();
|
|
48
|
+
var uniqueId = id !== null && id !== void 0 ? id : "".concat(generatedId, "-searchInput");
|
|
53
49
|
var hasTip = !!tip;
|
|
54
50
|
var tipId = derivativeIdGenerator(uniqueId, 'tip', tip);
|
|
55
51
|
var containerProps = {
|