@norges-domstoler/dds-components 9.2.0-beta.0 → 9.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/README.md +2 -1
- package/dist/assets/svg/bullets/jordskifterett_bullet1.svg.js +2 -2
- package/dist/cjs/components/Breadcrumbs/Breadcrumb.tokens.d.ts +2 -8
- package/dist/cjs/components/Button/Button.stories.d.ts +4 -4
- package/dist/cjs/components/Button/Button.styles.d.ts +1 -0
- package/dist/cjs/components/Button/Button.tokens.d.ts +294 -165
- package/dist/cjs/components/Card/Card.tokens.d.ts +17 -16
- package/dist/cjs/components/Card/CardAccordion/CardAccordion.tokens.d.ts +28 -0
- package/dist/cjs/components/Checkbox/Checkbox.stories.d.ts +2 -2
- package/dist/cjs/components/Checkbox/CheckboxGroup.d.ts +1 -3
- package/dist/cjs/components/Chip/Chip.tokens.d.ts +8 -6
- package/dist/cjs/components/DescriptionList/DescriptionList.tokens.d.ts +6 -36
- package/dist/cjs/components/Divider/Divider.tokens.d.ts +11 -6
- package/dist/cjs/components/Drawer/Drawer.tokens.d.ts +3 -11
- package/dist/cjs/components/GlobalMessage/GlobalMessage.tokens.d.ts +24 -22
- package/dist/cjs/components/Grid/Grid.d.ts +8 -7
- package/dist/cjs/components/Grid/Grid.tokens.d.ts +5 -5
- package/dist/cjs/components/InternalHeader/InternalHeader.styles.d.ts +3 -2
- package/dist/cjs/components/InternalHeader/InternalHeader.tokens.d.ts +4 -9
- package/dist/cjs/components/List/List.d.ts +1 -1
- package/dist/cjs/components/List/List.tokens.d.ts +21 -9
- package/dist/cjs/components/LocalMessage/LocalMessage.tokens.d.ts +49 -53
- package/dist/cjs/components/Modal/Modal.tokens.d.ts +5 -6
- package/dist/cjs/components/OverflowMenu/OverflowMenu.d.ts +4 -3
- package/dist/cjs/components/OverflowMenu/OverflowMenu.stories.d.ts +4 -3
- package/dist/cjs/components/OverflowMenu/OverflowMenu.tokens.d.ts +2 -8
- package/dist/cjs/components/OverflowMenu/OverflowMenu.types.d.ts +8 -6
- package/dist/cjs/components/Pagination/Pagination.tokens.d.ts +7 -8
- package/dist/cjs/components/Popover/Popover.tokens.d.ts +0 -1
- package/dist/cjs/components/ProgressTracker/ProgressTracker.tokens.d.ts +9 -6
- package/dist/cjs/components/RadioButton/RadioButton.stories.d.ts +4 -4
- package/dist/cjs/components/RadioButton/RadioButtonGroup.d.ts +2 -4
- package/dist/cjs/components/RadioButton/RadioButtonGroup.stories.d.ts +1 -1
- package/dist/cjs/components/Search/Search.tokens.d.ts +5 -24
- package/dist/cjs/components/Select/Select.tokens.d.ts +14 -127
- package/dist/cjs/components/SkipToContent/SkipToContent.d.ts +2 -2
- package/dist/cjs/components/SkipToContent/SkipToContent.stories.d.ts +1 -1
- package/dist/cjs/components/SkipToContent/SkipToContent.tokens.d.ts +5 -10
- package/dist/cjs/components/SplitButton/SplitButton.d.ts +11 -0
- package/dist/cjs/components/SplitButton/SplitButton.stories.d.ts +9 -0
- package/dist/cjs/components/SplitButton/index.d.ts +1 -0
- package/dist/cjs/components/Table/Table.tokens.d.ts +0 -19
- package/dist/cjs/components/Tabs/Tabs.tokens.d.ts +21 -22
- package/dist/cjs/components/Tag/Tag.d.ts +1 -1
- package/dist/cjs/components/Tag/Tag.tokens.d.ts +19 -14
- package/dist/cjs/components/TextInput/TextInput.tokens.d.ts +0 -3
- package/dist/cjs/components/ToggleBar/ToggleBar.tokens.d.ts +5 -32
- package/dist/cjs/components/ToggleButton/ToggleButton.stories.d.ts +2 -2
- package/dist/cjs/components/ToggleButton/ToggleButton.tokens.d.ts +23 -13
- package/dist/cjs/components/Tooltip/Tooltip.stories.d.ts +2 -2
- package/dist/cjs/components/Tooltip/Tooltip.styles.d.ts +4 -1
- package/dist/cjs/components/Tooltip/Tooltip.tokens.d.ts +1 -2
- package/dist/cjs/components/Typography/Typography.utils.d.ts +195 -1
- package/dist/cjs/helpers/Input/Input.tokens.d.ts +2 -68
- package/dist/cjs/helpers/Input/Input.types.d.ts +4 -0
- package/dist/cjs/helpers/SelectionControl/SelectionControl.styles.d.ts +5 -0
- package/dist/cjs/helpers/SelectionControl/SelectionControl.tokens.d.ts +11 -0
- package/dist/cjs/helpers/TextOverflowEllipsis/TextOverflowEllipsis.d.ts +2 -0
- package/dist/cjs/helpers/TextOverflowEllipsis/index.d.ts +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1475 -1823
- package/dist/cjs/utils/color.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumb.tokens.d.ts +2 -8
- package/dist/components/Breadcrumbs/Breadcrumb.tokens.js +3 -4
- package/dist/components/Breadcrumbs/Breadcrumbs.js +3 -2
- package/dist/components/Button/Button.js +7 -4
- package/dist/components/Button/Button.stories.d.ts +4 -4
- package/dist/components/Button/Button.styles.d.ts +1 -0
- package/dist/components/Button/Button.styles.js +49 -24
- package/dist/components/Button/Button.tokens.d.ts +294 -165
- package/dist/components/Button/Button.tokens.js +232 -349
- package/dist/components/Card/Card.js +6 -5
- package/dist/components/Card/Card.tokens.d.ts +17 -16
- package/dist/components/Card/Card.tokens.js +26 -54
- package/dist/components/Card/CardAccordion/CardAccordion.tokens.d.ts +28 -0
- package/dist/components/Card/CardAccordion/CardAccordion.tokens.js +37 -0
- package/dist/components/Card/CardAccordion/CardAccordionBody.js +4 -3
- package/dist/components/Card/CardAccordion/CardAccordionHeader.js +9 -6
- package/dist/components/Checkbox/Checkbox.stories.d.ts +2 -2
- package/dist/components/Checkbox/CheckboxGroup.d.ts +1 -3
- package/dist/components/Checkbox/CheckboxGroup.js +3 -16
- package/dist/components/Chip/Chip.js +9 -9
- package/dist/components/Chip/Chip.tokens.d.ts +8 -6
- package/dist/components/Chip/Chip.tokens.js +8 -25
- package/dist/components/Chip/ChipGroup.js +1 -1
- package/dist/components/DescriptionList/DescriptionList.js +3 -2
- package/dist/components/DescriptionList/DescriptionList.tokens.d.ts +6 -36
- package/dist/components/DescriptionList/DescriptionList.tokens.js +7 -18
- package/dist/components/DescriptionList/DescriptionListDesc.js +3 -2
- package/dist/components/Divider/Divider.js +6 -6
- package/dist/components/Divider/Divider.tokens.d.ts +11 -6
- package/dist/components/Divider/Divider.tokens.js +16 -16
- package/dist/components/Drawer/Drawer.js +11 -4
- package/dist/components/Drawer/Drawer.tokens.d.ts +3 -11
- package/dist/components/Drawer/Drawer.tokens.js +10 -26
- package/dist/components/GlobalMessage/GlobalMessage.js +13 -10
- package/dist/components/GlobalMessage/GlobalMessage.tokens.d.ts +24 -22
- package/dist/components/GlobalMessage/GlobalMessage.tokens.js +45 -64
- package/dist/components/Grid/Grid.d.ts +8 -7
- package/dist/components/Grid/Grid.js +7 -5
- package/dist/components/Grid/Grid.tokens.d.ts +5 -5
- package/dist/components/Grid/Grid.tokens.js +5 -5
- package/dist/components/InternalHeader/InternalHeader.styles.d.ts +3 -2
- package/dist/components/InternalHeader/InternalHeader.tokens.d.ts +4 -9
- package/dist/components/InternalHeader/InternalHeader.tokens.js +6 -6
- package/dist/components/InternalHeader/NavigationItem.js +3 -2
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/List/List.js +8 -7
- package/dist/components/List/List.tokens.d.ts +21 -9
- package/dist/components/List/List.tokens.js +26 -20
- package/dist/components/List/ListItem.js +2 -2
- package/dist/components/LocalMessage/LocalMessage.js +19 -15
- package/dist/components/LocalMessage/LocalMessage.tokens.d.ts +49 -53
- package/dist/components/LocalMessage/LocalMessage.tokens.js +94 -127
- package/dist/components/Modal/Modal.js +9 -5
- package/dist/components/Modal/Modal.tokens.d.ts +5 -6
- package/dist/components/Modal/Modal.tokens.js +11 -31
- package/dist/components/Modal/ModalActions.js +1 -1
- package/dist/components/OverflowMenu/OverflowMenu.d.ts +4 -3
- package/dist/components/OverflowMenu/OverflowMenu.js +12 -3
- package/dist/components/OverflowMenu/OverflowMenu.stories.d.ts +4 -3
- package/dist/components/OverflowMenu/OverflowMenu.tokens.d.ts +2 -8
- package/dist/components/OverflowMenu/OverflowMenu.tokens.js +5 -5
- package/dist/components/OverflowMenu/OverflowMenu.types.d.ts +8 -6
- package/dist/components/OverflowMenu/OverflowMenuGroup.js +1 -0
- package/dist/components/OverflowMenu/OverflowMenuItem.js +3 -2
- package/dist/components/Pagination/Pagination.js +13 -8
- package/dist/components/Pagination/Pagination.tokens.d.ts +7 -8
- package/dist/components/Pagination/Pagination.tokens.js +17 -16
- package/dist/components/Popover/Popover.tokens.d.ts +0 -1
- package/dist/components/Popover/Popover.tokens.js +0 -1
- package/dist/components/ProgressTracker/ProgressTracker.tokens.d.ts +9 -6
- package/dist/components/ProgressTracker/ProgressTracker.tokens.js +11 -9
- package/dist/components/ProgressTracker/ProgressTrackerItem.js +7 -6
- package/dist/components/RadioButton/RadioButton.stories.d.ts +4 -4
- package/dist/components/RadioButton/RadioButtonGroup.d.ts +2 -4
- package/dist/components/RadioButton/RadioButtonGroup.js +3 -15
- package/dist/components/RadioButton/RadioButtonGroup.stories.d.ts +1 -1
- package/dist/components/Search/Search.js +3 -2
- package/dist/components/Search/Search.tokens.d.ts +5 -24
- package/dist/components/Search/Search.tokens.js +6 -5
- package/dist/components/Select/Select.js +5 -4
- package/dist/components/Select/Select.styles.js +13 -14
- package/dist/components/Select/Select.tokens.d.ts +14 -127
- package/dist/components/Select/Select.tokens.js +28 -36
- package/dist/components/SkipToContent/SkipToContent.d.ts +2 -2
- package/dist/components/SkipToContent/SkipToContent.js +7 -4
- package/dist/components/SkipToContent/SkipToContent.stories.d.ts +1 -1
- package/dist/components/SkipToContent/SkipToContent.tokens.d.ts +5 -10
- package/dist/components/SkipToContent/SkipToContent.tokens.js +14 -37
- package/dist/components/Spinner/Spinner.js +1 -2
- package/dist/components/SplitButton/SplitButton.d.ts +11 -0
- package/dist/components/SplitButton/SplitButton.js +62 -0
- package/dist/components/SplitButton/SplitButton.stories.d.ts +9 -0
- package/dist/components/SplitButton/index.d.ts +1 -0
- package/dist/components/Table/Row.js +2 -1
- package/dist/components/Table/Table.tokens.d.ts +0 -19
- package/dist/components/Table/Table.tokens.js +1 -8
- package/dist/components/Tabs/Tab.js +8 -5
- package/dist/components/Tabs/TabPanel.js +4 -3
- package/dist/components/Tabs/Tabs.tokens.d.ts +21 -22
- package/dist/components/Tabs/Tabs.tokens.js +31 -79
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.js +8 -21
- package/dist/components/Tag/Tag.tokens.d.ts +19 -14
- package/dist/components/Tag/Tag.tokens.js +14 -41
- package/dist/components/TextArea/TextArea.js +3 -2
- package/dist/components/TextInput/TextInput.tokens.d.ts +0 -3
- package/dist/components/TextInput/TextInput.tokens.js +0 -3
- package/dist/components/ToggleBar/ToggleBar.tokens.d.ts +5 -32
- package/dist/components/ToggleBar/ToggleBar.tokens.js +7 -5
- package/dist/components/ToggleBar/ToggleRadio.styles.js +3 -2
- package/dist/components/ToggleButton/ToggleButton.js +14 -8
- package/dist/components/ToggleButton/ToggleButton.stories.d.ts +2 -2
- package/dist/components/ToggleButton/ToggleButton.tokens.d.ts +23 -13
- package/dist/components/ToggleButton/ToggleButton.tokens.js +26 -49
- package/dist/components/ToggleButton/ToggleButtonGroup.js +2 -2
- package/dist/components/Tooltip/Tooltip.js +6 -2
- package/dist/components/Tooltip/Tooltip.stories.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.styles.d.ts +4 -1
- package/dist/components/Tooltip/Tooltip.styles.js +15 -4
- package/dist/components/Tooltip/Tooltip.tokens.d.ts +1 -2
- package/dist/components/Tooltip/Tooltip.tokens.js +14 -24
- package/dist/components/Typography/Typography.utils.d.ts +195 -1
- package/dist/components/Typography/Typography.utils.js +7 -1
- package/dist/helpers/Input/Input.styles.js +3 -2
- package/dist/helpers/Input/Input.tokens.d.ts +2 -68
- package/dist/helpers/Input/Input.tokens.js +10 -46
- package/dist/helpers/Input/Input.types.d.ts +4 -0
- package/dist/helpers/SelectionControl/SelectionControl.styles.d.ts +5 -0
- package/dist/helpers/SelectionControl/SelectionControl.styles.js +15 -2
- package/dist/helpers/SelectionControl/SelectionControl.tokens.d.ts +11 -0
- package/dist/helpers/SelectionControl/SelectionControl.tokens.js +14 -1
- package/dist/helpers/TextOverflowEllipsis/TextOverflowEllipsis.d.ts +2 -0
- package/dist/helpers/TextOverflowEllipsis/TextOverflowEllipsis.js +12 -0
- package/dist/helpers/TextOverflowEllipsis/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/color.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/Card/CardAccordion/CardAccordionBody.tokens.d.ts +0 -4
- package/dist/cjs/components/Card/CardAccordion/CardAccordionHeader.tokens.d.ts +0 -17
- package/dist/cjs/components/List/ListItem.tokens.d.ts +0 -5
- package/dist/cjs/components/RadioButton/RadioButtonGroup.tokens.d.ts +0 -19
- package/dist/cjs/components/Spinner/Spinner.tokens.d.ts +0 -6
- package/dist/components/Card/CardAccordion/CardAccordionBody.tokens.d.ts +0 -4
- package/dist/components/Card/CardAccordion/CardAccordionBody.tokens.js +0 -12
- package/dist/components/Card/CardAccordion/CardAccordionHeader.tokens.d.ts +0 -17
- package/dist/components/Card/CardAccordion/CardAccordionHeader.tokens.js +0 -38
- package/dist/components/Checkbox/CheckboxGroup.tokens.js +0 -20
- package/dist/components/List/ListItem.tokens.d.ts +0 -5
- package/dist/components/List/ListItem.tokens.js +0 -12
- package/dist/components/RadioButton/RadioButtonGroup.tokens.d.ts +0 -19
- package/dist/components/RadioButton/RadioButtonGroup.tokens.js +0 -32
- package/dist/components/Spinner/Spinner.tokens.d.ts +0 -6
- package/dist/components/Spinner/Spinner.tokens.js +0 -13
|
@@ -3,21 +3,22 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { cardTokens } from './Card.tokens.js';
|
|
5
5
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
6
|
-
import '../../helpers/styling/focusVisible.js';
|
|
7
|
-
import '../../helpers/styling/hover.js';
|
|
6
|
+
import { focusVisibleWithBorder } from '../../helpers/styling/focusVisible.js';
|
|
7
|
+
import { hoverWithBorder } from '../../helpers/styling/hover.js';
|
|
8
8
|
import '../../helpers/styling/focus.js';
|
|
9
9
|
import '../../helpers/styling/danger.js';
|
|
10
10
|
import { selection } from '../../helpers/styling/selection.js';
|
|
11
|
+
import { getFontStyling, defaultTypographyType } from '../Typography/Typography.utils.js';
|
|
11
12
|
|
|
12
13
|
var Container = styled.div.withConfig({
|
|
13
14
|
displayName: "Card__Container",
|
|
14
15
|
componentId: "sc-410ao9-0"
|
|
15
|
-
})(["", "
|
|
16
|
+
})(["border:", ";", ";&::selection,*::selection{", "}@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-color 0.2s;}", " ", ""], cardTokens.base.border, getFontStyling(defaultTypographyType), selection, function (_ref) {
|
|
16
17
|
var color = _ref.color;
|
|
17
|
-
return color && css(["", ""], cardTokens.colors[color].
|
|
18
|
+
return color && css(["color:", ";background-color:", ";border-color:", ";"], cardTokens.colors[color].color, cardTokens.colors[color].backgroundColor, cardTokens.colors[color].borderColor);
|
|
18
19
|
}, function (_ref2) {
|
|
19
20
|
var cardType = _ref2.cardType;
|
|
20
|
-
return cardType === 'navigation' ? css(["text-decoration:none;&:hover{", "}&:focus{
|
|
21
|
+
return cardType === 'navigation' ? css(["text-decoration:none;&:hover{", "}&:focus{", "}"], hoverWithBorder, focusVisibleWithBorder) : cardType === 'expandable' ? css(["width:100%;box-sizing:border-box;&:not(:first-of-type){border-top:none;}"]) : '';
|
|
21
22
|
});
|
|
22
23
|
var Card = function Card(props) {
|
|
23
24
|
var _props$color = props.color,
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { CSSObject } from 'styled-components';
|
|
2
1
|
export declare const cardTokens: {
|
|
3
|
-
base:
|
|
4
|
-
|
|
5
|
-
hover: {
|
|
6
|
-
base: CSSObject;
|
|
7
|
-
};
|
|
8
|
-
focus: {
|
|
9
|
-
base: CSSObject;
|
|
10
|
-
};
|
|
2
|
+
base: {
|
|
3
|
+
border: string;
|
|
11
4
|
};
|
|
12
5
|
colors: {
|
|
13
|
-
filledDark: {
|
|
14
|
-
base: CSSObject;
|
|
15
|
-
};
|
|
16
6
|
filledLight: {
|
|
17
|
-
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
borderColor: string;
|
|
9
|
+
color: string;
|
|
18
10
|
};
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
filledDark: {
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
borderColor: string;
|
|
14
|
+
color: string;
|
|
21
15
|
};
|
|
22
16
|
strokeDark: {
|
|
23
|
-
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
borderColor: string;
|
|
19
|
+
color: string;
|
|
20
|
+
};
|
|
21
|
+
strokeLight: {
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
borderColor: string;
|
|
24
|
+
color: string;
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
};
|
|
@@ -1,64 +1,36 @@
|
|
|
1
1
|
import { ddsBaseTokens, ddsReferenceTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
|
-
import 'styled-components';
|
|
3
|
-
import { focusVisibleWithBorder } from '../../helpers/styling/focusVisible.js';
|
|
4
|
-
import { hoverWithBorder } from '../../helpers/styling/hover.js';
|
|
5
|
-
import '../../helpers/styling/focus.js';
|
|
6
|
-
import '../../helpers/styling/danger.js';
|
|
7
|
-
import '../../helpers/styling/selection.js';
|
|
8
2
|
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
FontPackages = ddsBaseTokens.fontPackages;
|
|
3
|
+
var colors = ddsBaseTokens.colors,
|
|
4
|
+
border = ddsBaseTokens.border;
|
|
12
5
|
var textDefault = ddsReferenceTokens.textDefault;
|
|
13
|
-
var base =
|
|
14
|
-
border: "".concat(
|
|
15
|
-
}, FontPackages.body_sans_02.base);
|
|
16
|
-
var navigationHoverBase = Object.assign({}, hoverWithBorder);
|
|
17
|
-
var navigationFocusBase = Object.assign({}, focusVisibleWithBorder);
|
|
18
|
-
var filledDarkBase = {
|
|
19
|
-
backgroundColor: Colors.DdsColorPrimaryBase,
|
|
20
|
-
borderColor: Colors.DdsColorPrimaryBase,
|
|
21
|
-
color: Colors.DdsColorNeutralsWhite
|
|
6
|
+
var base = {
|
|
7
|
+
border: "".concat(border.BordersDdsBorderStyleLightStrokeWeight, " solid")
|
|
22
8
|
};
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
var cardColors = {
|
|
10
|
+
filledLight: {
|
|
11
|
+
backgroundColor: colors.DdsColorPrimaryLightest,
|
|
12
|
+
borderColor: colors.DdsColorPrimaryLightest,
|
|
13
|
+
color: textDefault.textColor
|
|
14
|
+
},
|
|
15
|
+
filledDark: {
|
|
16
|
+
backgroundColor: colors.DdsColorPrimaryBase,
|
|
17
|
+
borderColor: colors.DdsColorPrimaryBase,
|
|
18
|
+
color: colors.DdsColorNeutralsWhite
|
|
19
|
+
},
|
|
20
|
+
strokeDark: {
|
|
21
|
+
backgroundColor: colors.DdsColorNeutralsWhite,
|
|
22
|
+
borderColor: border.BordersDdsBorderStyleLightStroke,
|
|
23
|
+
color: textDefault.textColor
|
|
24
|
+
},
|
|
25
|
+
strokeLight: {
|
|
26
|
+
backgroundColor: colors.DdsColorNeutralsWhite,
|
|
27
|
+
borderColor: border.BordersDdsBorderStyleLightStroke,
|
|
28
|
+
color: textDefault.textColor
|
|
29
|
+
}
|
|
37
30
|
};
|
|
38
31
|
var cardTokens = {
|
|
39
32
|
base: base,
|
|
40
|
-
|
|
41
|
-
hover: {
|
|
42
|
-
base: navigationHoverBase
|
|
43
|
-
},
|
|
44
|
-
focus: {
|
|
45
|
-
base: navigationFocusBase
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
colors: {
|
|
49
|
-
filledDark: {
|
|
50
|
-
base: filledDarkBase
|
|
51
|
-
},
|
|
52
|
-
filledLight: {
|
|
53
|
-
base: filledLightBase
|
|
54
|
-
},
|
|
55
|
-
strokeLight: {
|
|
56
|
-
base: strokeLightBase
|
|
57
|
-
},
|
|
58
|
-
strokeDark: {
|
|
59
|
-
base: strokeDarkBase
|
|
60
|
-
}
|
|
61
|
-
}
|
|
33
|
+
colors: cardColors
|
|
62
34
|
};
|
|
63
35
|
|
|
64
36
|
export { cardTokens };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StaticTypographyType } from '../../Typography';
|
|
2
|
+
export declare const typographyTypes: {
|
|
3
|
+
body: StaticTypographyType;
|
|
4
|
+
header: StaticTypographyType;
|
|
5
|
+
};
|
|
6
|
+
export declare const cardAccordionTokens: {
|
|
7
|
+
header: {
|
|
8
|
+
padding: string;
|
|
9
|
+
hover: {
|
|
10
|
+
boxShadow: string;
|
|
11
|
+
};
|
|
12
|
+
focus: {
|
|
13
|
+
boxShadow: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
body: {
|
|
17
|
+
padding: string;
|
|
18
|
+
};
|
|
19
|
+
chevronWrapper: {
|
|
20
|
+
width: string;
|
|
21
|
+
height: string;
|
|
22
|
+
marginLeft: string;
|
|
23
|
+
};
|
|
24
|
+
chevron: {
|
|
25
|
+
width: string;
|
|
26
|
+
height: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
|
+
|
|
3
|
+
var spacing = ddsBaseTokens.spacing,
|
|
4
|
+
border = ddsBaseTokens.border,
|
|
5
|
+
iconSizes = ddsBaseTokens.iconSizes;
|
|
6
|
+
var typographyTypes = {
|
|
7
|
+
body: 'bodySans03',
|
|
8
|
+
header: 'headingSans03'
|
|
9
|
+
};
|
|
10
|
+
var header = {
|
|
11
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX1, " ").concat(spacing.SizesDdsSpacingLocalX075, " ").concat(spacing.SizesDdsSpacingLocalX1, " ").concat(spacing.SizesDdsSpacingLocalX15),
|
|
12
|
+
hover: {
|
|
13
|
+
boxShadow: "0 0 0 ".concat(border.BordersDdsBorderFocusInputfieldStrokeWeight, " ").concat(border.BordersDdsBorderFocusInputfieldStroke)
|
|
14
|
+
},
|
|
15
|
+
focus: {
|
|
16
|
+
boxShadow: "0 0 0 ".concat(border.BordersDdsBorderFocusCardStrokeWeight, " ").concat(border.BordersDdsBorderFocusCardStroke)
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
var chevronWrapper = {
|
|
20
|
+
width: iconSizes.DdsIconsizeMedium,
|
|
21
|
+
height: iconSizes.DdsIconsizeMedium,
|
|
22
|
+
marginLeft: spacing.SizesDdsSpacingLocalX05
|
|
23
|
+
};
|
|
24
|
+
var body = {
|
|
25
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX1, " ").concat(spacing.SizesDdsSpacingLocalX2NumberPx + spacing.SizesDdsSpacingLocalX075NumberPx, "px ").concat(spacing.SizesDdsSpacingLocalX2, " ").concat(spacing.SizesDdsSpacingLocalX15)
|
|
26
|
+
};
|
|
27
|
+
var cardAccordionTokens = {
|
|
28
|
+
header: header,
|
|
29
|
+
body: body,
|
|
30
|
+
chevronWrapper: chevronWrapper,
|
|
31
|
+
chevron: {
|
|
32
|
+
width: iconSizes.DdsIconsizeMedium,
|
|
33
|
+
height: spacing.SizesDdsSpacingLocalX05
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { cardAccordionTokens, typographyTypes };
|
|
@@ -3,18 +3,19 @@ import { __rest } from 'tslib';
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { forwardRef, useRef, useState, useLayoutEffect, useEffect } from 'react';
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
|
-
import {
|
|
6
|
+
import { cardAccordionTokens, typographyTypes } from './CardAccordion.tokens.js';
|
|
7
7
|
import { getBaseHTMLProps } from '../../../types/BaseComponentProps.js';
|
|
8
8
|
import useIsMounted from '../../../hooks/useIsMounted.js';
|
|
9
|
+
import { getFontStyling } from '../../Typography/Typography.utils.js';
|
|
9
10
|
|
|
10
11
|
var expandingAnimation = css(["@media (prefers-reduced-motion:no-preference){transition:padding 0.2s,visibility 0.3s,max-height 0.2s cubic-bezier(0.4,0,0.2,1);}"]);
|
|
11
12
|
var Body = styled.div.withConfig({
|
|
12
13
|
displayName: "CardAccordionBody__Body",
|
|
13
14
|
componentId: "sc-igsnpx-0"
|
|
14
|
-
})(["@media (prefers-reduced-motion:no-preference){", "}", " ", " ", ""], function (_ref) {
|
|
15
|
+
})(["@media (prefers-reduced-motion:no-preference){", "}padding:", ";", " ", " ", ""], function (_ref) {
|
|
15
16
|
var animate = _ref.animate;
|
|
16
17
|
return animate && expandingAnimation;
|
|
17
|
-
},
|
|
18
|
+
}, cardAccordionTokens.body.padding, getFontStyling(typographyTypes.body), function (_ref2) {
|
|
18
19
|
var paddingTop = _ref2.paddingTop;
|
|
19
20
|
return paddingTop && css(["padding-top:", ";"], paddingTop);
|
|
20
21
|
}, function (_ref3) {
|
|
@@ -2,7 +2,7 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import {
|
|
5
|
+
import { cardAccordionTokens, typographyTypes } from './CardAccordion.tokens.js';
|
|
6
6
|
import '../../../helpers/Backdrop/Backdrop.js';
|
|
7
7
|
import { AnimatedChevronUpDown } from '../../../helpers/Chevron/AnimatedChevronUpDown.js';
|
|
8
8
|
import '../../../helpers/HiddenInput/HiddenInput.js';
|
|
@@ -18,7 +18,10 @@ import '../../../helpers/styling/focus.js';
|
|
|
18
18
|
import '../../../helpers/styling/danger.js';
|
|
19
19
|
import '../../../helpers/styling/selection.js';
|
|
20
20
|
import { getBaseHTMLProps } from '../../../types/BaseComponentProps.js';
|
|
21
|
+
import { getFontStyling } from '../../Typography/Typography.utils.js';
|
|
21
22
|
|
|
23
|
+
var header = cardAccordionTokens.header,
|
|
24
|
+
chevronWrapper = cardAccordionTokens.chevronWrapper;
|
|
22
25
|
var ContentWrapper = styled.div.withConfig({
|
|
23
26
|
displayName: "CardAccordionHeader__ContentWrapper",
|
|
24
27
|
componentId: "sc-1qs6bkj-0"
|
|
@@ -26,15 +29,15 @@ var ContentWrapper = styled.div.withConfig({
|
|
|
26
29
|
var HeaderContainer = styled.div.withConfig({
|
|
27
30
|
displayName: "CardAccordionHeader__HeaderContainer",
|
|
28
31
|
componentId: "sc-1qs6bkj-1"
|
|
29
|
-
})(["display:flex;justify-content:space-between;align-items:center;@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s;}", ""],
|
|
32
|
+
})(["display:flex;justify-content:space-between;align-items:center;@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s;}padding:", ";", ""], header.padding, getFontStyling(typographyTypes.header));
|
|
30
33
|
var HeaderWrapper = styled.button.withConfig({
|
|
31
34
|
displayName: "CardAccordionHeader__HeaderWrapper",
|
|
32
35
|
componentId: "sc-1qs6bkj-2"
|
|
33
|
-
})(["user-select:text;position:relative;cursor:pointer;@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s;}", " display:block;width:100%;&:hover{", "}&:focus-visible,&.focus-visible{outline:none;", "}"], removeButtonStyling,
|
|
36
|
+
})(["user-select:text;position:relative;cursor:pointer;@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s;}", " display:block;width:100%;&:hover{box-shadow:", ";}&:focus-visible,&.focus-visible{outline:none;box-shadow:", ";}"], removeButtonStyling, header.hover.boxShadow, header.focus.boxShadow);
|
|
34
37
|
var ChevronWrapper = styled.span.withConfig({
|
|
35
38
|
displayName: "CardAccordionHeader__ChevronWrapper",
|
|
36
39
|
componentId: "sc-1qs6bkj-3"
|
|
37
|
-
})(["display:flex;align-items:center;justify-content:center;", ""],
|
|
40
|
+
})(["display:flex;align-items:center;justify-content:center;width:", ";height:", ";margin-left:", ";"], chevronWrapper.width, chevronWrapper.height, chevronWrapper.marginLeft);
|
|
38
41
|
var CardAccordionHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
39
42
|
var children = props.children,
|
|
40
43
|
_props$isExpanded = props.isExpanded,
|
|
@@ -60,8 +63,8 @@ var CardAccordionHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
60
63
|
});
|
|
61
64
|
var chevronProps = {
|
|
62
65
|
isUp: isExpanded,
|
|
63
|
-
width:
|
|
64
|
-
height:
|
|
66
|
+
width: cardAccordionTokens.chevron.width,
|
|
67
|
+
height: cardAccordionTokens.chevron.height
|
|
65
68
|
};
|
|
66
69
|
return jsx(HeaderWrapper, Object.assign({}, headerWrapperProps, {
|
|
67
70
|
children: jsxs(HeaderContainer, {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CheckboxProps } from '.';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "onBlur" | "name" | "value" | "defaultChecked" | "defaultValue" | "aria-describedby" | "onChange" | "checked">, "id" | "className"> & {
|
|
5
5
|
label?: string | undefined;
|
|
6
6
|
error?: boolean | undefined;
|
|
7
7
|
disabled?: boolean | undefined;
|
|
8
8
|
readOnly?: boolean | undefined;
|
|
9
9
|
indeterminate?: boolean | undefined;
|
|
10
10
|
} & import("../../types").CheckboxPickedHTMLAttributes & {
|
|
11
|
-
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "
|
|
11
|
+
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "onBlur" | "name" | "value" | "defaultChecked" | "defaultValue" | "aria-describedby" | "onChange" | "checked"> | undefined;
|
|
12
12
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
13
13
|
argTypes: {
|
|
14
14
|
label: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BaseComponentPropsWithChildren } from '../../types';
|
|
2
|
-
declare type Direction = 'column' | 'row';
|
|
1
|
+
import { BaseComponentPropsWithChildren, Direction } from '../../types';
|
|
3
2
|
export declare type CheckboxGroupProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
4
3
|
/**Ledetekst for gruppen. */
|
|
5
4
|
label?: string;
|
|
@@ -14,4 +13,3 @@ export declare type CheckboxGroupProps = BaseComponentPropsWithChildren<HTMLDivE
|
|
|
14
13
|
required?: boolean;
|
|
15
14
|
}>;
|
|
16
15
|
export declare const CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useId } from 'react';
|
|
4
|
-
import styled, { css } from 'styled-components';
|
|
5
4
|
import '../../helpers/Backdrop/Backdrop.js';
|
|
6
5
|
import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
7
6
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
@@ -10,27 +9,15 @@ import '../../helpers/Input/Input.tokens.js';
|
|
|
10
9
|
import { renderInputMessage } from '../../helpers/Input/Input.utils.js';
|
|
11
10
|
import '../../helpers/Paper/Paper.js';
|
|
12
11
|
import { RequiredMarker } from '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
13
|
-
import { checkboxGroupTokens } from './CheckboxGroup.tokens.js';
|
|
14
12
|
import { CheckboxGroupContext } from './CheckboxGroupContext.js';
|
|
15
13
|
import { Typography } from '../Typography/Typography/Typography.js';
|
|
16
14
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
17
15
|
import '../Typography/Link/Link.js';
|
|
18
16
|
import { derivativeIdGenerator } from '../../utils/idGenerator.js';
|
|
19
17
|
import '../../utils/color.js';
|
|
18
|
+
import { OuterGroupContainer, GroupContainer } from '../../helpers/SelectionControl/SelectionControl.styles.js';
|
|
19
|
+
import '../../helpers/SelectionControl/SelectionControl.tokens.js';
|
|
20
20
|
|
|
21
|
-
var outerContainer = checkboxGroupTokens.outerContainer,
|
|
22
|
-
groupContainer = checkboxGroupTokens.groupContainer;
|
|
23
|
-
var Container = styled.div.withConfig({
|
|
24
|
-
displayName: "CheckboxGroup__Container",
|
|
25
|
-
componentId: "sc-uixbzg-0"
|
|
26
|
-
})(["display:flex;flex-direction:column;gap:", ";"], outerContainer.gap);
|
|
27
|
-
var GroupContainer = styled.div.withConfig({
|
|
28
|
-
displayName: "CheckboxGroup__GroupContainer",
|
|
29
|
-
componentId: "sc-uixbzg-1"
|
|
30
|
-
})(["display:flex;", ""], function (_ref) {
|
|
31
|
-
var direction = _ref.direction;
|
|
32
|
-
return css(["flex-direction:", ";gap:", ";"], direction, groupContainer[direction].gap);
|
|
33
|
-
});
|
|
34
21
|
var CheckboxGroup = function CheckboxGroup(props) {
|
|
35
22
|
var label = props.label,
|
|
36
23
|
_props$direction = props.direction,
|
|
@@ -59,7 +46,7 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
59
46
|
uniqueGroupId: uniqueGroupId,
|
|
60
47
|
tipId: tip ? tipId : undefined
|
|
61
48
|
};
|
|
62
|
-
return jsxs(
|
|
49
|
+
return jsxs(OuterGroupContainer, Object.assign({}, getBaseHTMLProps(id, className, Object.assign(Object.assign({}, htmlProps), {
|
|
63
50
|
'aria-required': ariaRequired
|
|
64
51
|
}), rest), {
|
|
65
52
|
children: [jsxs(Typography, Object.assign({
|
|
@@ -4,19 +4,18 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { forwardRef, useState } from 'react';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { Button } from '../Button/Button.js';
|
|
7
|
-
import { chipTokens } from './Chip.tokens.js';
|
|
7
|
+
import { chipTokens, typographyType } from './Chip.tokens.js';
|
|
8
8
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
9
9
|
import '../../icons/utils/StyledSvg.js';
|
|
10
10
|
import { CloseIcon } from '../../icons/tsx/close.js';
|
|
11
|
+
import { TextOverflowEllipsisWrapper, TextOverflowEllipsisInner } from '../../helpers/TextOverflowEllipsis/TextOverflowEllipsis.js';
|
|
12
|
+
import { getFontStyling } from '../Typography/Typography.utils.js';
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var container = chipTokens.container;
|
|
15
|
+
var Container = styled(TextOverflowEllipsisWrapper).withConfig({
|
|
13
16
|
displayName: "Chip__Container",
|
|
14
17
|
componentId: "sc-1l242zs-0"
|
|
15
|
-
})(["", ""],
|
|
16
|
-
var TextWrapper = styled.span.withConfig({
|
|
17
|
-
displayName: "Chip__TextWrapper",
|
|
18
|
-
componentId: "sc-1l242zs-1"
|
|
19
|
-
})(["", ""], chipTokens.text.base);
|
|
18
|
+
})(["display:flex;align-items:center;max-width:100%;gap:", ";padding:", ";border:", ";border-radius:", ";background-color:", ";", ";"], container.gap, container.padding, container.border, container.borderRadius, container.backgroundColor, getFontStyling(typographyType, true));
|
|
20
19
|
var Chip = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
20
|
var text = props.text,
|
|
22
21
|
onClose = props.onClose,
|
|
@@ -40,9 +39,10 @@ var Chip = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
return isOpen ? jsxs(Container, Object.assign({}, getBaseHTMLProps(id, className, restHTMLprops, rest), {
|
|
43
|
-
ref: ref
|
|
42
|
+
ref: ref,
|
|
43
|
+
as: "div"
|
|
44
44
|
}, {
|
|
45
|
-
children: [jsx(
|
|
45
|
+
children: [jsx(TextOverflowEllipsisInner, {
|
|
46
46
|
children: text
|
|
47
47
|
}), jsx(Button, {
|
|
48
48
|
size: "tiny",
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StaticTypographyType } from '../Typography';
|
|
2
|
+
export declare const typographyType: StaticTypographyType;
|
|
2
3
|
export declare const chipTokens: {
|
|
3
4
|
container: {
|
|
4
|
-
|
|
5
|
+
gap: string;
|
|
6
|
+
padding: string;
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
border: string;
|
|
9
|
+
borderRadius: string;
|
|
5
10
|
};
|
|
6
11
|
group: {
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
text: {
|
|
10
|
-
base: CSSObject;
|
|
12
|
+
gap: string;
|
|
11
13
|
};
|
|
12
14
|
};
|
|
@@ -2,38 +2,21 @@ import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
|
2
2
|
|
|
3
3
|
var colors = ddsBaseTokens.colors,
|
|
4
4
|
spacing = ddsBaseTokens.spacing,
|
|
5
|
-
borderRadius = ddsBaseTokens.borderRadius
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
display: 'flex',
|
|
9
|
-
alignItems: 'center',
|
|
5
|
+
borderRadius = ddsBaseTokens.borderRadius;
|
|
6
|
+
var typographyType = 'bodySans01';
|
|
7
|
+
var container = {
|
|
10
8
|
gap: spacing.SizesDdsSpacingLocalX025,
|
|
11
9
|
padding: "".concat(spacing.SizesDdsSpacingLocalX0125, " ").concat(spacing.SizesDdsSpacingLocalX025),
|
|
12
10
|
backgroundColor: colors.DdsColorNeutralsGray1,
|
|
13
11
|
border: "1px solid ".concat(colors.DdsColorNeutralsGray3),
|
|
14
|
-
borderRadius: borderRadius.RadiiDdsBorderRadius1Radius
|
|
15
|
-
color: colors.DdsColorNeutralsGray9,
|
|
16
|
-
maxWidth: '100%'
|
|
12
|
+
borderRadius: borderRadius.RadiiDdsBorderRadius1Radius
|
|
17
13
|
};
|
|
18
|
-
var
|
|
19
|
-
whiteSpace: 'nowrap',
|
|
20
|
-
overflow: 'hidden',
|
|
21
|
-
textOverflow: 'ellipsis'
|
|
22
|
-
}, fontPackages.body_sans_01.base);
|
|
23
|
-
var groupBase = {
|
|
24
|
-
display: 'flex',
|
|
14
|
+
var group = {
|
|
25
15
|
gap: spacing.SizesDdsSpacingLocalX075
|
|
26
16
|
};
|
|
27
17
|
var chipTokens = {
|
|
28
|
-
container:
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
group: {
|
|
32
|
-
base: groupBase
|
|
33
|
-
},
|
|
34
|
-
text: {
|
|
35
|
-
base: textBase
|
|
36
|
-
}
|
|
18
|
+
container: container,
|
|
19
|
+
group: group
|
|
37
20
|
};
|
|
38
21
|
|
|
39
|
-
export { chipTokens };
|
|
22
|
+
export { chipTokens, typographyType };
|
|
@@ -8,7 +8,7 @@ import { chipTokens } from './Chip.tokens.js';
|
|
|
8
8
|
var Group = styled.ul.withConfig({
|
|
9
9
|
displayName: "ChipGroup__Group",
|
|
10
10
|
componentId: "sc-evmxhv-0"
|
|
11
|
-
})(["", " ", ""], removeListStyling, chipTokens.group.
|
|
11
|
+
})(["", " display:flex;gap:", ";"], removeListStyling, chipTokens.group.gap);
|
|
12
12
|
var ChipGroup = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
13
13
|
var children = _a.children,
|
|
14
14
|
rest = __rest(_a, ["children"]);
|
|
@@ -8,7 +8,8 @@ import '../../helpers/styling/focus.js';
|
|
|
8
8
|
import '../../helpers/styling/danger.js';
|
|
9
9
|
import { selection } from '../../helpers/styling/selection.js';
|
|
10
10
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
11
|
-
import {
|
|
11
|
+
import { getFontStyling } from '../Typography/Typography.utils.js';
|
|
12
|
+
import { descriptionListTokens, termTypographyTypes } from './DescriptionList.tokens.js';
|
|
12
13
|
|
|
13
14
|
var term = descriptionListTokens.term,
|
|
14
15
|
desc = descriptionListTokens.desc,
|
|
@@ -18,7 +19,7 @@ var DList = styled.dl.withConfig({
|
|
|
18
19
|
componentId: "sc-1ob73hm-0"
|
|
19
20
|
})(["margin:0;*::selection{", "}", " & > dt:first-of-type{margin-top:", ";}& > dd:last-child{margin-bottom:", ";}dd + dt{margin-top:", ";}"], selection, function (_ref) {
|
|
20
21
|
var appearance = _ref.appearance;
|
|
21
|
-
return appearance && css(["dt{
|
|
22
|
+
return appearance && css(["dt{color:", ";", " ", ""], term.appearance[appearance].color, getFontStyling(termTypographyTypes[appearance]), appearance === 'bold' && css(["font-weight:600;"]));
|
|
22
23
|
}, term.firstOfType.marginTop, desc.lastChild.marginBottom, list.beforeNextTerm.marginTop);
|
|
23
24
|
var DescriptionList = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
24
25
|
var _props$appearance = props.appearance,
|
|
@@ -1,38 +1,16 @@
|
|
|
1
|
+
import { StaticTypographyType } from '../Typography';
|
|
2
|
+
import { DescriptionListAppearance } from './DescriptionList';
|
|
3
|
+
export declare const termTypographyTypes: {
|
|
4
|
+
[k in DescriptionListAppearance]: StaticTypographyType;
|
|
5
|
+
};
|
|
6
|
+
export declare const descTypographyType: StaticTypographyType;
|
|
1
7
|
export declare const descriptionListTokens: {
|
|
2
8
|
term: {
|
|
3
9
|
appearance: {
|
|
4
10
|
small: {
|
|
5
|
-
font: {
|
|
6
|
-
lineHeight: any;
|
|
7
|
-
fontSize: string;
|
|
8
|
-
letterSpacing: any;
|
|
9
|
-
fontFamily: any;
|
|
10
|
-
fontWeight: any;
|
|
11
|
-
fontStyle: any;
|
|
12
|
-
};
|
|
13
11
|
color: string;
|
|
14
|
-
lineHeight: any;
|
|
15
|
-
fontSize: string;
|
|
16
|
-
letterSpacing: any;
|
|
17
|
-
fontFamily: any;
|
|
18
|
-
fontWeight: any;
|
|
19
|
-
fontStyle: any;
|
|
20
12
|
};
|
|
21
13
|
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
14
|
color: string;
|
|
37
15
|
};
|
|
38
16
|
};
|
|
@@ -42,14 +20,6 @@ export declare const descriptionListTokens: {
|
|
|
42
20
|
};
|
|
43
21
|
desc: {
|
|
44
22
|
base: {
|
|
45
|
-
font: {
|
|
46
|
-
lineHeight: any;
|
|
47
|
-
fontSize: string;
|
|
48
|
-
letterSpacing: any;
|
|
49
|
-
fontFamily: any;
|
|
50
|
-
fontWeight: any;
|
|
51
|
-
fontStyle: any;
|
|
52
|
-
};
|
|
53
23
|
gap: string;
|
|
54
24
|
color: string;
|
|
55
25
|
};
|
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
2
|
|
|
3
3
|
var spacing = ddsBaseTokens.spacing,
|
|
4
|
-
fontPackages = ddsBaseTokens.fontPackages,
|
|
5
4
|
colors = ddsBaseTokens.colors;
|
|
5
|
+
var termTypographyTypes = {
|
|
6
|
+
bold: 'bodySans03',
|
|
7
|
+
small: 'bodySans01'
|
|
8
|
+
};
|
|
9
|
+
var descTypographyType = 'bodySans03';
|
|
6
10
|
var term = {
|
|
7
11
|
appearance: {
|
|
8
12
|
small: {
|
|
9
|
-
|
|
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
|
|
13
|
+
color: colors.DdsColorNeutralsGray7
|
|
17
14
|
},
|
|
18
15
|
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
16
|
color: colors.DdsColorNeutralsGray9
|
|
27
17
|
}
|
|
28
18
|
},
|
|
@@ -32,7 +22,6 @@ var term = {
|
|
|
32
22
|
};
|
|
33
23
|
var desc = {
|
|
34
24
|
base: {
|
|
35
|
-
font: fontPackages.body_sans_03.base,
|
|
36
25
|
gap: spacing.SizesDdsSpacingLocalX025,
|
|
37
26
|
color: colors.DdsColorNeutralsGray9
|
|
38
27
|
},
|
|
@@ -57,4 +46,4 @@ var descriptionListTokens = {
|
|
|
57
46
|
group: group
|
|
58
47
|
};
|
|
59
48
|
|
|
60
|
-
export { descriptionListTokens };
|
|
49
|
+
export { descTypographyType, descriptionListTokens, termTypographyTypes };
|