@norges-domstoler/dds-components 5.2.0-beta.2 → 5.3.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/README.md +14 -3
- package/dist/cjs/components/DescriptionList/DescriptionList.tokens.d.ts +70 -0
- 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/Modal/Modal.tokens.d.ts +0 -6
- package/dist/cjs/components/Modal/ModalBody.d.ts +6 -1
- package/dist/cjs/components/OverflowMenu/OverflowMenu.tokens.d.ts +25 -10
- package/dist/cjs/components/ScrollableContainer/ScrollableContainer.d.ts +7 -0
- package/dist/cjs/components/ScrollableContainer/ScrollableContainer.stories.d.ts +15 -0
- package/dist/cjs/components/ScrollableContainer/ScrollableContainer.tokens.d.ts +25 -0
- package/dist/cjs/components/ScrollableContainer/Scrollbar.d.ts +7 -0
- package/dist/cjs/components/ScrollableContainer/index.d.ts +3 -0
- package/dist/cjs/components/ScrollableContainer/scrollbarStyling.d.ts +26 -0
- package/dist/cjs/components/Select/Select.tokens.d.ts +0 -3
- package/dist/cjs/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/cjs/helpers/styling/index.d.ts +0 -1
- 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 +1322 -1100
- package/dist/components/Card/CardAccordion/CardAccordion.js +3 -8
- package/dist/components/Checkbox/Checkbox.js +3 -7
- package/dist/components/Checkbox/CheckboxGroup.js +3 -7
- package/dist/components/Datepicker/Datepicker.js +3 -7
- package/dist/components/DescriptionList/DescriptionList.js +6 -3
- package/dist/components/DescriptionList/DescriptionList.tokens.d.ts +70 -0
- package/dist/components/DescriptionList/DescriptionList.tokens.js +60 -0
- package/dist/components/DescriptionList/DescriptionListDesc.js +2 -2
- package/dist/components/DescriptionList/DescriptionListGroup.js +4 -4
- package/dist/components/Drawer/Drawer.js +15 -17
- 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/Modal/Modal.tokens.d.ts +0 -6
- package/dist/components/Modal/Modal.tokens.js +0 -10
- package/dist/components/Modal/ModalBody.d.ts +6 -1
- package/dist/components/Modal/ModalBody.js +13 -13
- package/dist/components/OverflowMenu/OverflowMenu.js +6 -4
- 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 +1 -1
- package/dist/components/Popover/PopoverGroup.js +3 -7
- package/dist/components/RadioButton/RadioButton.js +3 -8
- package/dist/components/RadioButton/RadioButtonGroup.js +3 -6
- package/dist/components/ScrollableContainer/ScrollableContainer.d.ts +7 -0
- package/dist/components/ScrollableContainer/ScrollableContainer.js +47 -0
- package/dist/components/ScrollableContainer/ScrollableContainer.stories.d.ts +15 -0
- package/dist/components/ScrollableContainer/ScrollableContainer.tokens.d.ts +25 -0
- package/dist/components/ScrollableContainer/ScrollableContainer.tokens.js +36 -0
- package/dist/components/ScrollableContainer/Scrollbar.d.ts +7 -0
- package/dist/components/ScrollableContainer/Scrollbar.js +178 -0
- package/dist/components/ScrollableContainer/index.d.ts +3 -0
- package/dist/components/ScrollableContainer/scrollbarStyling.d.ts +26 -0
- package/dist/components/ScrollableContainer/scrollbarStyling.js +40 -0
- package/dist/components/Search/Search.js +3 -7
- package/dist/components/Select/Select.js +41 -10
- package/dist/components/Select/Select.styles.js +7 -4
- 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/Table/Table.js +2 -2
- package/dist/components/Table/TableWrapper.js +3 -3
- package/dist/components/Tabs/TabList.js +4 -7
- 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/TextInput/TextInput.styles.js +2 -2
- package/dist/components/TextInput/TextInput.tokens.js +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +3 -7
- 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/styling/focusVisible.js +3 -2
- package/dist/helpers/styling/index.d.ts +0 -1
- 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 +4 -0
- package/package.json +2 -4
- package/dist/cjs/components/DescriptionList/DescriptionListDesc.tokens.d.ts +0 -7
- package/dist/cjs/components/DescriptionList/DescriptionListGroup.tokens.d.ts +0 -4
- package/dist/cjs/components/DescriptionList/DescriptionListTerm.tokens.d.ts +0 -13
- package/dist/cjs/helpers/styling/scrollbarStyling.d.ts +0 -3
- package/dist/components/DescriptionList/DescriptionListDesc.tokens.d.ts +0 -7
- package/dist/components/DescriptionList/DescriptionListDesc.tokens.js +0 -22
- package/dist/components/DescriptionList/DescriptionListGroup.tokens.d.ts +0 -4
- package/dist/components/DescriptionList/DescriptionListGroup.tokens.js +0 -11
- package/dist/components/DescriptionList/DescriptionListTerm.tokens.d.ts +0 -13
- package/dist/components/DescriptionList/DescriptionListTerm.tokens.js +0 -27
- package/dist/helpers/styling/scrollbarStyling.d.ts +0 -3
- package/dist/helpers/styling/scrollbarStyling.js +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { forwardRef, useState, useEffect, Children, isValidElement, cloneElement } from 'react';
|
|
4
|
+
import { forwardRef, useState, useId, useEffect, Children, isValidElement, cloneElement } from 'react';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { getBaseHTMLProps } from '../../../types/BaseComponentProps.js';
|
|
7
7
|
|
|
@@ -9,7 +9,6 @@ var Wrapper = styled.div.withConfig({
|
|
|
9
9
|
displayName: "CardAccordion__Wrapper",
|
|
10
10
|
componentId: "sc-1ctxrby-0"
|
|
11
11
|
})([""]);
|
|
12
|
-
var nextUniqueId = 0;
|
|
13
12
|
var CardAccordion = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
13
|
var _props$isExpanded = props.isExpanded,
|
|
15
14
|
isExpanded = _props$isExpanded === void 0 ? false : _props$isExpanded,
|
|
@@ -24,12 +23,8 @@ var CardAccordion = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
24
23
|
expanded = _useState2[0],
|
|
25
24
|
setExpanded = _useState2[1];
|
|
26
25
|
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
var _useState3 = useState(id !== null && id !== void 0 ? id : "cardAccordion-".concat(uniqueId)),
|
|
30
|
-
_useState4 = _slicedToArray(_useState3, 1),
|
|
31
|
-
accordionId = _useState4[0];
|
|
32
|
-
|
|
26
|
+
var generatedId = useId();
|
|
27
|
+
var accordionId = id !== null && id !== void 0 ? id : "".concat(generatedId, "-cardAccordion");
|
|
33
28
|
useEffect(function () {
|
|
34
29
|
setExpanded(isExpanded);
|
|
35
30
|
}, [isExpanded]);
|
|
@@ -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 { Container, Input, CustomCheckbox } from './Checkbox.styles.js';
|
|
6
5
|
import { useCheckboxGroup } from './CheckboxGroupContext.js';
|
|
7
6
|
import { spaceSeparatedIdListGenerator } from '../../utils/idGenerator.js';
|
|
8
7
|
import { joinClassNames, getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
9
8
|
import { Typography } from '../Typography/Typography.js';
|
|
10
9
|
|
|
11
|
-
var nextUniqueId = 0;
|
|
12
10
|
var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
13
11
|
var id = props.id,
|
|
14
12
|
name = props.name,
|
|
@@ -23,10 +21,8 @@ var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
21
|
htmlProps = _props$htmlProps === void 0 ? {} : _props$htmlProps,
|
|
24
22
|
rest = __rest(props, ["id", "name", "label", "error", "disabled", "readOnly", "indeterminate", 'aria-describedby', "className", "htmlProps"]);
|
|
25
23
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
uniqueId = _useState2[0];
|
|
29
|
-
|
|
24
|
+
var generatedId = useId();
|
|
25
|
+
var uniqueId = id !== null && id !== void 0 ? id : "".concat(generatedId, "-checkbox");
|
|
30
26
|
var checkboxGroup = useCheckboxGroup();
|
|
31
27
|
|
|
32
28
|
var style = htmlProps.style,
|
|
@@ -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 {
|
|
3
|
+
import { useId } from 'react';
|
|
5
4
|
import styled, { css } from 'styled-components';
|
|
6
5
|
import { checkboxGroupTokens } from './CheckboxGroup.tokens.js';
|
|
7
6
|
import { CheckboxGroupContext } from './CheckboxGroupContext.js';
|
|
@@ -26,7 +25,6 @@ var Label = styled(Typography).withConfig({
|
|
|
26
25
|
displayName: "CheckboxGroup__Label",
|
|
27
26
|
componentId: "sc-uixbzg-2"
|
|
28
27
|
})(["padding-left:", ";"], checkboxGroupTokens.label.spaceLeft);
|
|
29
|
-
var nextUniqueGroupId = 0;
|
|
30
28
|
var CheckboxGroup = function CheckboxGroup(_a) {
|
|
31
29
|
var label = _a.label,
|
|
32
30
|
_a$direction = _a.direction,
|
|
@@ -41,10 +39,8 @@ var CheckboxGroup = function CheckboxGroup(_a) {
|
|
|
41
39
|
htmlProps = _a.htmlProps,
|
|
42
40
|
rest = __rest(_a, ["label", "direction", "errorMessage", "tip", "required", "groupId", "children", "id", "className", "htmlProps"]);
|
|
43
41
|
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
uniqueGroupId = _useState2[0];
|
|
47
|
-
|
|
42
|
+
var generatedId = useId();
|
|
43
|
+
var uniqueGroupId = groupId !== null && groupId !== void 0 ? groupId : "".concat(generatedId, "-checkboxGroup");
|
|
48
44
|
var hasErrorMessage = !!errorMessage;
|
|
49
45
|
var errorMessageId = derivativeIdGenerator(uniqueGroupId, 'errorMessage', errorMessage);
|
|
50
46
|
var tipId = derivativeIdGenerator(uniqueGroupId, 'tip', tip);
|
|
@@ -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 from 'styled-components';
|
|
6
5
|
import { typographyTokens } from '../Typography/Typography.tokens.js';
|
|
7
6
|
import CalendarIcon from '../../assets/svg/calendar_today.svg.js';
|
|
@@ -19,7 +18,6 @@ var StyledInput = styled(StatefulInput).withConfig({
|
|
|
19
18
|
displayName: "Datepicker__StyledInput",
|
|
20
19
|
componentId: "sc-1ijxhje-0"
|
|
21
20
|
})(["&::-webkit-calendar-picker-indicator{background-image:", ";", " margin-left:0px;padding:0;top:50%;transform:translate(0,-50%);box-sizing:border-box;}&::-webkit-datetime-edit-fields-wrapper{padding:0;}&::-webkit-calendar-picker-indicator:focus-visible{", "}&::-webkit-inner-spin-button{display:none;}@media (prefers-reduced-motion:no-preference){::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{transition:0.2s;}}&::-webkit-datetime-edit-day-field:focus,&::-webkit-datetime-edit-month-field:focus,&::-webkit-datetime-edit-year-field:focus,&::-webkit-datetime-edit-hour-field:focus,&::-webkit-datetime-edit-minute-field:focus{", "}"], "url(\"".concat(CalendarIcon, "\")"), datepickerTokens.calendarIndicator.base, datepickerTokens.calendarIndicator.focus.base, typographyTokens.selection.base);
|
|
22
|
-
var nextUniqueId = 0;
|
|
23
21
|
var Datepicker = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
24
22
|
var id = _a.id,
|
|
25
23
|
_a$type = _a.type,
|
|
@@ -37,10 +35,8 @@ var Datepicker = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
37
35
|
ariaDescribedby = _a['aria-describedby'],
|
|
38
36
|
rest = __rest(_a, ["id", "type", "required", "readOnly", "disabled", "label", "width", "errorMessage", "tip", "style", "className", "max", 'aria-describedby']);
|
|
39
37
|
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
uniqueId = _useState2[0];
|
|
43
|
-
|
|
38
|
+
var generatedId = useId();
|
|
39
|
+
var uniqueId = id !== null && id !== void 0 ? id : "".concat(generatedId, "-datepickerInput");
|
|
44
40
|
var componentWidth = width ? width : getWidth(type);
|
|
45
41
|
var hasLabel = !!label;
|
|
46
42
|
var labelPresence = hasLabel ? 'hasLabel' : 'noLabel';
|
|
@@ -3,16 +3,19 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import { typographyTokens } from '../Typography/Typography.tokens.js';
|
|
6
|
-
import {
|
|
6
|
+
import { descriptionListTokens } from './DescriptionList.tokens.js';
|
|
7
7
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
8
8
|
|
|
9
|
+
var term = descriptionListTokens.term,
|
|
10
|
+
desc = descriptionListTokens.desc,
|
|
11
|
+
list = descriptionListTokens.list;
|
|
9
12
|
var DList = styled.dl.withConfig({
|
|
10
13
|
displayName: "DescriptionList__DList",
|
|
11
14
|
componentId: "sc-1ob73hm-0"
|
|
12
15
|
})(["margin:0;*::selection{", "}", " & > dt:first-of-type{margin-top:", ";}& > dd:last-child{margin-bottom:", ";}dd + dt{margin-top:", ";}"], typographyTokens.selection.base, function (_ref) {
|
|
13
16
|
var appearance = _ref.appearance;
|
|
14
|
-
return appearance && css(["dt{", "}"],
|
|
15
|
-
},
|
|
17
|
+
return appearance && css(["dt{", " color:", ";line-height:", ";font-size:", ";letter-spacing:", ";font-family:", ";font-weight:", ";font-style:", ";}"], term.appearance[appearance].font, term.appearance[appearance].color, term.appearance[appearance].lineHeight, term.appearance[appearance].fontSize, term.appearance[appearance].letterSpacing, term.appearance[appearance].fontFamily, term.appearance[appearance].fontWeight, term.appearance[appearance].fontStyle);
|
|
18
|
+
}, term.firstOfType.marginTop, desc.lastChild.marginBottom, list.beforeNextTerm.marginTop);
|
|
16
19
|
var DescriptionList = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
17
20
|
var _props$appearance = props.appearance,
|
|
18
21
|
appearance = _props$appearance === void 0 ? 'bold' : _props$appearance,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const descriptionListTokens: {
|
|
2
|
+
term: {
|
|
3
|
+
appearance: {
|
|
4
|
+
small: {
|
|
5
|
+
font: {
|
|
6
|
+
lineHeight: any;
|
|
7
|
+
fontSize: string;
|
|
8
|
+
letterSpacing: any;
|
|
9
|
+
fontFamily: any;
|
|
10
|
+
fontWeight: any;
|
|
11
|
+
fontStyle: any;
|
|
12
|
+
};
|
|
13
|
+
color: string;
|
|
14
|
+
lineHeight: any;
|
|
15
|
+
fontSize: string;
|
|
16
|
+
letterSpacing: any;
|
|
17
|
+
fontFamily: any;
|
|
18
|
+
fontWeight: any;
|
|
19
|
+
fontStyle: any;
|
|
20
|
+
};
|
|
21
|
+
bold: {
|
|
22
|
+
font: {
|
|
23
|
+
lineHeight: any;
|
|
24
|
+
fontSize: string;
|
|
25
|
+
letterSpacing: any;
|
|
26
|
+
fontFamily: any;
|
|
27
|
+
fontWeight: any;
|
|
28
|
+
fontStyle: any;
|
|
29
|
+
};
|
|
30
|
+
lineHeight: any;
|
|
31
|
+
fontSize: string;
|
|
32
|
+
letterSpacing: any;
|
|
33
|
+
fontFamily: any;
|
|
34
|
+
fontWeight: number;
|
|
35
|
+
fontStyle: any;
|
|
36
|
+
color: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
firstOfType: {
|
|
40
|
+
marginTop: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
desc: {
|
|
44
|
+
base: {
|
|
45
|
+
font: {
|
|
46
|
+
lineHeight: any;
|
|
47
|
+
fontSize: string;
|
|
48
|
+
letterSpacing: any;
|
|
49
|
+
fontFamily: any;
|
|
50
|
+
fontWeight: any;
|
|
51
|
+
fontStyle: any;
|
|
52
|
+
};
|
|
53
|
+
gap: string;
|
|
54
|
+
color: string;
|
|
55
|
+
};
|
|
56
|
+
lastChild: {
|
|
57
|
+
marginBottom: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
list: {
|
|
61
|
+
beforeNextTerm: {
|
|
62
|
+
marginTop: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
group: {
|
|
66
|
+
base: {
|
|
67
|
+
margin: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
|
+
|
|
3
|
+
var spacing = ddsBaseTokens.spacing,
|
|
4
|
+
fontPackages = ddsBaseTokens.fontPackages,
|
|
5
|
+
colors = ddsBaseTokens.colors;
|
|
6
|
+
var term = {
|
|
7
|
+
appearance: {
|
|
8
|
+
small: {
|
|
9
|
+
font: fontPackages.body_sans_01.base,
|
|
10
|
+
color: colors.DdsColorNeutralsGray7,
|
|
11
|
+
lineHeight: fontPackages.body_sans_01.base.lineHeight,
|
|
12
|
+
fontSize: fontPackages.body_sans_01.base.fontSize,
|
|
13
|
+
letterSpacing: fontPackages.body_sans_01.base.letterSpacing,
|
|
14
|
+
fontFamily: fontPackages.body_sans_01.base.fontFamily,
|
|
15
|
+
fontWeight: fontPackages.body_sans_01.base.fontWeight,
|
|
16
|
+
fontStyle: fontPackages.body_sans_01.base.fontStyle
|
|
17
|
+
},
|
|
18
|
+
bold: {
|
|
19
|
+
font: fontPackages.body_sans_03.base,
|
|
20
|
+
lineHeight: fontPackages.body_sans_03.base.lineHeight,
|
|
21
|
+
fontSize: fontPackages.body_sans_03.base.fontSize,
|
|
22
|
+
letterSpacing: fontPackages.body_sans_03.base.letterSpacing,
|
|
23
|
+
fontFamily: fontPackages.body_sans_03.base.fontFamily,
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
fontStyle: fontPackages.body_sans_03.base.fontStyle,
|
|
26
|
+
color: colors.DdsColorNeutralsGray9
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
firstOfType: {
|
|
30
|
+
marginTop: spacing.SizesDdsSpacingLocalX1
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var desc = {
|
|
34
|
+
base: {
|
|
35
|
+
font: fontPackages.body_sans_03.base,
|
|
36
|
+
gap: spacing.SizesDdsSpacingLocalX025,
|
|
37
|
+
color: colors.DdsColorNeutralsGray9
|
|
38
|
+
},
|
|
39
|
+
lastChild: {
|
|
40
|
+
marginBottom: spacing.SizesDdsSpacingLocalX1
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var list = {
|
|
44
|
+
beforeNextTerm: {
|
|
45
|
+
marginTop: spacing.SizesDdsSpacingLocalX2
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var group = {
|
|
49
|
+
base: {
|
|
50
|
+
margin: spacing.SizesDdsSpacingLocalX2
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var descriptionListTokens = {
|
|
54
|
+
term: term,
|
|
55
|
+
desc: desc,
|
|
56
|
+
list: list,
|
|
57
|
+
group: group
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { descriptionListTokens };
|
|
@@ -2,14 +2,14 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import {
|
|
5
|
+
import { descriptionListTokens } from './DescriptionList.tokens.js';
|
|
6
6
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
7
7
|
import { Icon } from '../Icon/Icon.js';
|
|
8
8
|
|
|
9
9
|
var DListDesc = styled.dd.withConfig({
|
|
10
10
|
displayName: "DescriptionListDesc__DListDesc",
|
|
11
11
|
componentId: "sc-1djcf0s-0"
|
|
12
|
-
})(["
|
|
12
|
+
})(["margin-inline-start:0;align-items:center;display:flex;color:", ";", ";gap:", ";"], descriptionListTokens.desc.base.color, descriptionListTokens.desc.base.font, descriptionListTokens.desc.base.gap);
|
|
13
13
|
var DescriptionListDesc = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
14
|
var children = props.children,
|
|
15
15
|
icon = props.icon,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import styled
|
|
5
|
-
import {
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { descriptionListTokens } from './DescriptionList.tokens.js';
|
|
6
6
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
7
7
|
|
|
8
8
|
var DListGroup = styled.div.withConfig({
|
|
9
9
|
displayName: "DescriptionListGroup__DListGroup",
|
|
10
10
|
componentId: "sc-jkdc0o-0"
|
|
11
|
-
})(["", "
|
|
11
|
+
})(["margin:", ";"], function (_ref) {
|
|
12
12
|
var margin = _ref.margin;
|
|
13
|
-
return margin
|
|
13
|
+
return margin ? margin : descriptionListTokens.group.base.margin;
|
|
14
14
|
});
|
|
15
15
|
var DescriptionListGroup = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
16
16
|
var children = props.children,
|
|
@@ -1,20 +1,19 @@
|
|
|
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 { createPortal } from 'react-dom';
|
|
6
5
|
import styled, { css } from 'styled-components';
|
|
7
6
|
import { drawerTokens } from './Drawer.tokens.js';
|
|
8
7
|
import { Paper } from '../../helpers/Paper/Paper.js';
|
|
9
8
|
import { useMountTransition } from '../../hooks/useMountTransition.js';
|
|
10
9
|
import { focusVisible } from '../../helpers/styling/focusVisible.js';
|
|
11
|
-
import { scrollbarStyling } from '../../helpers/styling/scrollbarStyling.js';
|
|
12
10
|
import { Button } from '../Button/Button.js';
|
|
13
11
|
import { useFocusTrap } from '../../hooks/useFocusTrap.js';
|
|
14
12
|
import { useCombinedRef } from '../../hooks/useCombinedRefs.js';
|
|
15
13
|
import { useOnKeyDown } from '../../hooks/useOnKeyDown.js';
|
|
16
14
|
import { useOnClickOutside } from '../../hooks/useOnClickOutside.js';
|
|
17
15
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
16
|
+
import { ScrollableContainer } from '../ScrollableContainer/ScrollableContainer.js';
|
|
18
17
|
import { Typography } from '../Typography/Typography.js';
|
|
19
18
|
import { CloseIcon } from '../../icons/tsx/close.js';
|
|
20
19
|
|
|
@@ -35,7 +34,7 @@ var Container = styled(Paper).withConfig({
|
|
|
35
34
|
var ContentContainer = styled.div.withConfig({
|
|
36
35
|
displayName: "Drawer__ContentContainer",
|
|
37
36
|
componentId: "sc-i9luw3-1"
|
|
38
|
-
})(["display:flex;flex-direction:column;
|
|
37
|
+
})(["display:flex;flex-direction:column;", ""], drawerTokens.contentContainer.base);
|
|
39
38
|
var HeaderContainer = styled.div.withConfig({
|
|
40
39
|
displayName: "Drawer__HeaderContainer",
|
|
41
40
|
componentId: "sc-i9luw3-2"
|
|
@@ -44,7 +43,6 @@ var StyledButton = styled(Button).withConfig({
|
|
|
44
43
|
displayName: "Drawer__StyledButton",
|
|
45
44
|
componentId: "sc-i9luw3-3"
|
|
46
45
|
})(["align-self:flex-end;"]);
|
|
47
|
-
var nextUniqueId = 0;
|
|
48
46
|
var Drawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
49
47
|
var children = props.children,
|
|
50
48
|
onClose = props.onClose,
|
|
@@ -63,10 +61,8 @@ var Drawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
63
61
|
htmlProps = props.htmlProps,
|
|
64
62
|
rest = __rest(props, ["children", "onClose", "header", "isOpen", "placement", "parentElement", "size", "triggerRef", "id", "className", "htmlProps"]);
|
|
65
63
|
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
uniqueId = _useState2[0];
|
|
69
|
-
|
|
64
|
+
var generatedId = useId();
|
|
65
|
+
var uniqueId = id !== null && id !== void 0 ? id : "".concat(generatedId, "-drawer");
|
|
70
66
|
var hasHeader = !!header;
|
|
71
67
|
var headerId = hasHeader ? "".concat(uniqueId, "-header") : undefined;
|
|
72
68
|
var drawerRef = useFocusTrap(isOpen);
|
|
@@ -98,14 +94,16 @@ var Drawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
98
94
|
id: headerId
|
|
99
95
|
};
|
|
100
96
|
return isOpen || hasTransitionedIn ? /*#__PURE__*/createPortal(jsxs(Container, Object.assign({}, containerProps, {
|
|
101
|
-
children: [
|
|
102
|
-
children:
|
|
103
|
-
children:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
97
|
+
children: [jsx(ScrollableContainer, {
|
|
98
|
+
children: jsxs(ContentContainer, {
|
|
99
|
+
children: [hasHeader && jsx(HeaderContainer, Object.assign({}, headerContainerProps, {
|
|
100
|
+
children: typeof header === 'string' ? jsx(Typography, Object.assign({
|
|
101
|
+
typographyType: "headingSans03"
|
|
102
|
+
}, {
|
|
103
|
+
children: header
|
|
104
|
+
})) : header
|
|
105
|
+
})), children]
|
|
106
|
+
})
|
|
109
107
|
}), jsx(StyledButton, {
|
|
110
108
|
"data-testid": "drawer-close-btn",
|
|
111
109
|
size: "small",
|
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { useId, useRef, useState, Children, isValidElement, cloneElement } from 'react';
|
|
4
4
|
|
|
5
|
-
var nextUniqueId = 0;
|
|
6
5
|
var DrawerGroup = function DrawerGroup(_ref) {
|
|
7
6
|
var children = _ref.children,
|
|
8
7
|
drawerId = _ref.drawerId,
|
|
9
8
|
onOpen = _ref.onOpen,
|
|
10
9
|
onClose = _ref.onClose;
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var _useState = useState(drawerId !== null && drawerId !== void 0 ? drawerId : "drawer-".concat(uniqueId)),
|
|
14
|
-
_useState2 = _slicedToArray(_useState, 1),
|
|
15
|
-
uniqueDrawerId = _useState2[0];
|
|
16
|
-
|
|
10
|
+
var generatedId = useId();
|
|
11
|
+
var uniqueDrawerId = drawerId !== null && drawerId !== void 0 ? drawerId : "".concat(generatedId, "-drawer");
|
|
17
12
|
var buttonRef = useRef(null);
|
|
18
13
|
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
closed =
|
|
22
|
-
setClosed =
|
|
14
|
+
var _useState = useState(true),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
closed = _useState2[0],
|
|
17
|
+
setClosed = _useState2[1];
|
|
23
18
|
|
|
24
19
|
var open = function open() {
|
|
25
20
|
return setClosed(false);
|
|
@@ -2,7 +2,7 @@ import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBab
|
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useRef } from 'react';
|
|
5
|
-
import { Navigation, NavigationList,
|
|
5
|
+
import { Navigation, NavigationList, OuterContainer, BannerWrapper, BannerLeftWrapper, LovisaWrapper, ApplicationNameWrapper, ContextMenuGroup, StyledOverflowMenu } from './InternalHeader.styles.js';
|
|
6
6
|
import { NavigationItem } from './NavigationItem.js';
|
|
7
7
|
import { InternalHeaderListItem } from './InternalHeaderListItem.js';
|
|
8
8
|
import { MenuIcon } from '../../icons/tsx/menu.js';
|
|
@@ -75,7 +75,7 @@ var InternalHeader = function InternalHeader(props) {
|
|
|
75
75
|
})
|
|
76
76
|
})) : null;
|
|
77
77
|
var hasContextMenu = hasContextMenuElements || !!userProps || hasNavInContextMenu;
|
|
78
|
-
return jsxs(
|
|
78
|
+
return jsxs(OuterContainer, Object.assign({}, getBaseHTMLProps(id, className, htmlProps, rest), {
|
|
79
79
|
children: [jsx(BannerWrapper, Object.assign({
|
|
80
80
|
hasContextMenu: hasContextMenu
|
|
81
81
|
}, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InternalHeaderProps } from './InternalHeader.types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const OuterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
declare type BannerProps = {
|
|
4
4
|
hasContextMenu?: boolean;
|
|
5
5
|
};
|
|
@@ -3,33 +3,39 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
import { internalHeaderTokens } from './InternalHeader.tokens.js';
|
|
4
4
|
import { OverflowMenu } from '../OverflowMenu/OverflowMenu.js';
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
|
|
6
|
+
var outerContainer = internalHeaderTokens.outerContainer,
|
|
7
|
+
applicationNameWrapper = internalHeaderTokens.applicationNameWrapper,
|
|
8
|
+
lovisaWrapper = internalHeaderTokens.lovisaWrapper,
|
|
9
|
+
banner = internalHeaderTokens.banner,
|
|
10
|
+
navigation = internalHeaderTokens.navigation,
|
|
11
|
+
contextGroup = internalHeaderTokens.contextGroup;
|
|
12
|
+
var OuterContainer = styled.div.withConfig({
|
|
13
|
+
displayName: "InternalHeaderstyles__OuterContainer",
|
|
8
14
|
componentId: "sc-91bnca-0"
|
|
9
|
-
})(["position:relative;*::selection{", "}", ""], typographyTokens.selection.base,
|
|
15
|
+
})(["position:relative;*::selection{", "}background-color:", ";"], typographyTokens.selection.base, outerContainer.backgroundColor);
|
|
10
16
|
var BannerWrapper = styled.div.withConfig({
|
|
11
17
|
displayName: "InternalHeaderstyles__BannerWrapper",
|
|
12
18
|
componentId: "sc-91bnca-1"
|
|
13
|
-
})(["position:relative;display:flex;align-items:center;", " ", ""],
|
|
19
|
+
})(["position:relative;display:flex;align-items:center;border-bottom:", ";padding-right:", ";", ""], banner.borderBottom, banner.paddingRight, function (_ref) {
|
|
14
20
|
var hasContextMenu = _ref.hasContextMenu;
|
|
15
|
-
return hasContextMenu && css(["padding-right:", ";"],
|
|
21
|
+
return hasContextMenu && css(["padding-right:", ";"], banner.hasContextMenu.paddingRight);
|
|
16
22
|
});
|
|
17
23
|
var BannerLeftWrapper = styled.div.withConfig({
|
|
18
24
|
displayName: "InternalHeaderstyles__BannerLeftWrapper",
|
|
19
25
|
componentId: "sc-91bnca-2"
|
|
20
|
-
})(["display:flex;"
|
|
26
|
+
})(["display:flex;"]);
|
|
21
27
|
var ApplicationNameWrapper = styled.div.withConfig({
|
|
22
28
|
displayName: "InternalHeaderstyles__ApplicationNameWrapper",
|
|
23
29
|
componentId: "sc-91bnca-3"
|
|
24
|
-
})(["display:flex;align-items:center;", ""],
|
|
30
|
+
})(["display:flex;align-items:center;padding:", ";"], applicationNameWrapper.padding);
|
|
25
31
|
var LovisaWrapper = styled.div.withConfig({
|
|
26
32
|
displayName: "InternalHeaderstyles__LovisaWrapper",
|
|
27
33
|
componentId: "sc-91bnca-4"
|
|
28
|
-
})(["", ""],
|
|
34
|
+
})(["padding:", ";border-right:", ";"], lovisaWrapper.padding, lovisaWrapper.borderRight);
|
|
29
35
|
var Navigation = styled.nav.withConfig({
|
|
30
36
|
displayName: "InternalHeaderstyles__Navigation",
|
|
31
37
|
componentId: "sc-91bnca-5"
|
|
32
|
-
})(["", ""],
|
|
38
|
+
})(["border-bottom:", ";"], navigation.borderBottom);
|
|
33
39
|
var NavigationList = styled.ul.withConfig({
|
|
34
40
|
displayName: "InternalHeaderstyles__NavigationList",
|
|
35
41
|
componentId: "sc-91bnca-6"
|
|
@@ -40,10 +46,10 @@ var NavigationList = styled.ul.withConfig({
|
|
|
40
46
|
var ContextMenuGroup = styled.div.withConfig({
|
|
41
47
|
displayName: "InternalHeaderstyles__ContextMenuGroup",
|
|
42
48
|
componentId: "sc-91bnca-7"
|
|
43
|
-
})(["position:absolute;", ""],
|
|
49
|
+
})(["position:absolute;top:", ";right:", ";"], contextGroup.top, contextGroup.right);
|
|
44
50
|
var StyledOverflowMenu = styled(OverflowMenu).withConfig({
|
|
45
51
|
displayName: "InternalHeaderstyles__StyledOverflowMenu",
|
|
46
52
|
componentId: "sc-91bnca-8"
|
|
47
53
|
})(["max-height:calc(100vh - 110px);"]);
|
|
48
54
|
|
|
49
|
-
export { ApplicationNameWrapper, BannerLeftWrapper, BannerWrapper, ContextMenuGroup, LovisaWrapper, Navigation, NavigationList,
|
|
55
|
+
export { ApplicationNameWrapper, BannerLeftWrapper, BannerWrapper, ContextMenuGroup, LovisaWrapper, Navigation, NavigationList, OuterContainer, StyledOverflowMenu };
|
|
@@ -1,40 +1,52 @@
|
|
|
1
|
-
import { CSSObject } from 'styled-components';
|
|
2
1
|
export declare const internalHeaderTokens: {
|
|
3
|
-
|
|
4
|
-
base:
|
|
2
|
+
navLink: {
|
|
3
|
+
base: {
|
|
4
|
+
color: string;
|
|
5
|
+
textDecoration: string;
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
padding: string;
|
|
8
|
+
font: {
|
|
9
|
+
lineHeight: any;
|
|
10
|
+
fontSize: string;
|
|
11
|
+
letterSpacing: any;
|
|
12
|
+
fontFamily: any;
|
|
13
|
+
fontWeight: any;
|
|
14
|
+
fontStyle: any;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
hover: {
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
active: {
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
current: {
|
|
24
|
+
color: string;
|
|
25
|
+
backgroundColor: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
outerContainer: {
|
|
29
|
+
backgroundColor: string;
|
|
5
30
|
};
|
|
6
31
|
applicationNameWrapper: {
|
|
7
|
-
|
|
32
|
+
padding: string;
|
|
8
33
|
};
|
|
9
34
|
lovisaWrapper: {
|
|
10
|
-
|
|
35
|
+
padding: string;
|
|
36
|
+
borderRight: string;
|
|
11
37
|
};
|
|
12
38
|
banner: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
borderBottom: string;
|
|
40
|
+
paddingRight: string;
|
|
41
|
+
hasContextMenu: {
|
|
42
|
+
paddingRight: string;
|
|
43
|
+
};
|
|
18
44
|
};
|
|
19
45
|
navigation: {
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
navigationLink: {
|
|
23
|
-
base: CSSObject;
|
|
24
|
-
hover: {
|
|
25
|
-
base: CSSObject;
|
|
26
|
-
};
|
|
27
|
-
active: {
|
|
28
|
-
base: CSSObject;
|
|
29
|
-
};
|
|
30
|
-
focus: {
|
|
31
|
-
base: CSSObject;
|
|
32
|
-
};
|
|
33
|
-
current: {
|
|
34
|
-
base: CSSObject;
|
|
35
|
-
};
|
|
46
|
+
borderBottom: string;
|
|
36
47
|
};
|
|
37
48
|
contextGroup: {
|
|
38
|
-
|
|
49
|
+
right: string;
|
|
50
|
+
top: string;
|
|
39
51
|
};
|
|
40
52
|
};
|