@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
|
@@ -1,18 +1,13 @@
|
|
|
1
|
+
import { StaticTypographyType } from '../Typography';
|
|
2
|
+
export declare const typographyTypes: {
|
|
3
|
+
[k: string]: StaticTypographyType;
|
|
4
|
+
};
|
|
1
5
|
export declare const internalHeaderTokens: {
|
|
2
6
|
navLink: {
|
|
3
7
|
base: {
|
|
4
8
|
color: string;
|
|
5
|
-
textDecoration: string;
|
|
6
9
|
backgroundColor: string;
|
|
7
10
|
padding: string;
|
|
8
|
-
font: {
|
|
9
|
-
lineHeight: any;
|
|
10
|
-
fontSize: string;
|
|
11
|
-
letterSpacing: any;
|
|
12
|
-
fontFamily: any;
|
|
13
|
-
fontWeight: any;
|
|
14
|
-
fontStyle: any;
|
|
15
|
-
};
|
|
16
11
|
};
|
|
17
12
|
hover: {
|
|
18
13
|
color: string;
|
|
@@ -2,16 +2,16 @@ import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
|
2
2
|
|
|
3
3
|
var border = ddsBaseTokens.border,
|
|
4
4
|
colors = ddsBaseTokens.colors,
|
|
5
|
-
spacing = ddsBaseTokens.spacing
|
|
6
|
-
fontPackages = ddsBaseTokens.fontPackages;
|
|
5
|
+
spacing = ddsBaseTokens.spacing;
|
|
7
6
|
var borderStyle = "".concat(border.BordersDdsBorderStyleLightStrokeWeight, " ").concat(border.BordersDdsBorderStyleLightStroke, " solid ");
|
|
7
|
+
var typographyTypes = {
|
|
8
|
+
navLink: 'bodySans01'
|
|
9
|
+
};
|
|
8
10
|
var navLink = {
|
|
9
11
|
base: {
|
|
10
12
|
color: colors.DdsColorNeutralsGray9,
|
|
11
|
-
textDecoration: 'none',
|
|
12
13
|
backgroundColor: colors.DdsColorNeutralsWhite,
|
|
13
|
-
padding: "".concat(spacing.SizesDdsSpacingLocalX075, " ").concat(spacing.SizesDdsSpacingLocalX15)
|
|
14
|
-
font: fontPackages.body_sans_01.base
|
|
14
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX075, " ").concat(spacing.SizesDdsSpacingLocalX15)
|
|
15
15
|
},
|
|
16
16
|
hover: {
|
|
17
17
|
color: colors.DdsColorInteractiveDark
|
|
@@ -58,4 +58,4 @@ var internalHeaderTokens = {
|
|
|
58
58
|
contextGroup: contextGroup
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
export { internalHeaderTokens };
|
|
61
|
+
export { internalHeaderTokens, typographyTypes };
|
|
@@ -7,13 +7,14 @@ import '../../helpers/styling/hover.js';
|
|
|
7
7
|
import '../../helpers/styling/focus.js';
|
|
8
8
|
import '../../helpers/styling/danger.js';
|
|
9
9
|
import '../../helpers/styling/selection.js';
|
|
10
|
-
import {
|
|
10
|
+
import { getFontStyling } from '../Typography/Typography.utils.js';
|
|
11
|
+
import { internalHeaderTokens, typographyTypes } from './InternalHeader.tokens.js';
|
|
11
12
|
|
|
12
13
|
var navLink = internalHeaderTokens.navLink;
|
|
13
14
|
var Link = styled.a.withConfig({
|
|
14
15
|
displayName: "NavigationItem__Link",
|
|
15
16
|
componentId: "sc-1fua9kw-0"
|
|
16
|
-
})(["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:", ";
|
|
17
|
+
})(["display:flex;align-items:center;height:100%;box-sizing:border-box;text-decoration:none;@media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}color:", ";background-color:", ";padding:", ";", " &:hover{color:", ";}&:active{color:", ";}&:focus-visible,&.focus-visible{", ";}", ""], navLink.base.color, navLink.base.backgroundColor, navLink.base.padding, getFontStyling(typographyTypes.navLink), navLink.hover.color, navLink.active.color, focusVisible, function (_ref) {
|
|
17
18
|
var isCurrent = _ref.isCurrent;
|
|
18
19
|
return isCurrent && css(["color:", ";background-color:", ";&:hover{color:", ";}"], navLink.current.color, navLink.current.backgroundColor, navLink.current.color);
|
|
19
20
|
});
|
|
@@ -8,7 +8,7 @@ export declare type ListProps = BaseComponentPropsWithChildren<HTMLUListElement
|
|
|
8
8
|
/**Spesifiserer typografi for listen. Komponenten arver i utgangspunktet fra forelder, men hvis forelder stiller ikke med relevant styling må det velges `TypographyBodyType` som brukes i `<body>` ellers på siden. */
|
|
9
9
|
typographyType?: ListTypographyType;
|
|
10
10
|
}>;
|
|
11
|
-
export declare const List: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLUListElement | HTMLOListElement>, "
|
|
11
|
+
export declare const List: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLUListElement | HTMLOListElement>, "className" | "id"> & {
|
|
12
12
|
/**Spesifiserer om komponenten skal returnere `<ul />` (punktliste) eller `<ol />` (nummerert liste). */
|
|
13
13
|
listType?: ListType | undefined;
|
|
14
14
|
/**Spesifiserer typografi for listen. Komponenten arver i utgangspunktet fra forelder, men hvis forelder stiller ikke med relevant styling må det velges `TypographyBodyType` som brukes i `<body>` ellers på siden. */
|
|
@@ -2,10 +2,9 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
|
-
import
|
|
5
|
+
import bulletLvl1 from '../../assets/svg/bullets/jordskifterett_bullet1.svg.js';
|
|
6
6
|
import bulletLvl2 from '../../assets/svg/bullets/lagmannsrett_bullet2.svg.js';
|
|
7
7
|
import bulletLvl3 from '../../assets/svg/bullets/tingrett_bullet3.svg.js';
|
|
8
|
-
import { listItemTokens } from './ListItem.tokens.js';
|
|
9
8
|
import { listTokens } from './List.tokens.js';
|
|
10
9
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
11
10
|
import '../../helpers/styling/focusVisible.js';
|
|
@@ -13,18 +12,20 @@ import '../../helpers/styling/hover.js';
|
|
|
13
12
|
import '../../helpers/styling/focus.js';
|
|
14
13
|
import '../../helpers/styling/danger.js';
|
|
15
14
|
import { selection } from '../../helpers/styling/selection.js';
|
|
15
|
+
import { getFontStyling } from '../Typography/Typography.utils.js';
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
|
|
17
|
+
var list = listTokens.list,
|
|
18
|
+
listItem = listTokens.listItem,
|
|
19
|
+
bullet = listTokens.bullet;
|
|
19
20
|
var StyledList = styled.ul.withConfig({
|
|
20
21
|
displayName: "List__StyledList",
|
|
21
22
|
componentId: "sc-1f1c7eb-0"
|
|
22
|
-
})(["", " ul,ol{margin:0;}*::selection{", "}", " ", ""],
|
|
23
|
+
})(["margin:", ";color:", ";ul,ol{margin:0;}*::selection{", "}", " ", ""], list.base.margin, list.base.color, selection, function (_ref) {
|
|
23
24
|
var typographyType = _ref.typographyType;
|
|
24
|
-
return typographyType
|
|
25
|
+
return typographyType === 'inherit' ? css(["font:inherit;"]) : css(["", ""], getFontStyling(typographyType));
|
|
25
26
|
}, function (_ref2) {
|
|
26
27
|
var listType = _ref2.listType;
|
|
27
|
-
return listType === 'unordered' ? css(["padding-left:", ";list-style:none;li{position:relative;padding-left:", ";&:before{content:'';display:inline-block;height:1em;width:1em;position:absolute;top:", ";left:0;background-size:contain;background-repeat:no-repeat;background-image:", ";}ul > li:before{background-image:", ";}ul > li > ul > li:before{background-image:", ";}}"],
|
|
28
|
+
return listType === 'unordered' ? css(["padding-left:", ";list-style:none;li{position:relative;padding-left:", ";&:before{content:'';display:inline-block;height:1em;width:1em;position:absolute;top:", ";left:0;background-size:contain;background-repeat:no-repeat;background-image:", ";}ul > li:before{background-image:", ";}ul > li > ul > li:before{background-image:", ";}}"], list.ul.paddingLeft, listItem.ul.paddingLeft, bullet.top, "url(\"".concat(bulletLvl1, "\")"), "url(\"".concat(bulletLvl2, "\")"), "url(\"".concat(bulletLvl3, "\")")) : css(["padding-left:", ";& > li > ol{list-style-type:lower-alpha;}& > li > ol > li > ol{list-style-type:lower-roman;}"], list.ol.paddingLeft);
|
|
28
29
|
});
|
|
29
30
|
var List = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
30
31
|
var _props$listType = props.listType,
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import { CSSObject } from 'styled-components';
|
|
2
1
|
export declare const listTokens: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
list: {
|
|
3
|
+
base: {
|
|
4
|
+
margin: string;
|
|
5
|
+
color: string;
|
|
6
|
+
};
|
|
7
|
+
ol: {
|
|
8
|
+
paddingLeft: string;
|
|
9
|
+
};
|
|
10
|
+
ul: {
|
|
11
|
+
paddingLeft: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
listItem: {
|
|
15
|
+
lineHeight: string;
|
|
16
|
+
ul: {
|
|
17
|
+
paddingLeft: string;
|
|
18
|
+
};
|
|
11
19
|
};
|
|
20
|
+
bullet: {
|
|
21
|
+
top: string;
|
|
22
|
+
};
|
|
23
|
+
spaceLeft: string;
|
|
12
24
|
};
|
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
import { ddsBaseTokens, ddsReferenceTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
FontPackages = ddsBaseTokens.fontPackages;
|
|
3
|
+
var spacing = ddsBaseTokens.spacing;
|
|
5
4
|
var textDefault = ddsReferenceTokens.textDefault;
|
|
6
|
-
var
|
|
7
|
-
|
|
5
|
+
var ulLiPaddingLeft = "1em + ".concat(spacing.SizesDdsSpacingLocalX025);
|
|
6
|
+
var ulPaddingLeft = "".concat(spacing.SizesDdsSpacingLocalX2, " - (").concat(ulLiPaddingLeft, ")");
|
|
7
|
+
var list = {
|
|
8
|
+
base: {
|
|
9
|
+
margin: "".concat(spacing.SizesDdsSpacingLocalX1, " 0"),
|
|
10
|
+
color: textDefault.textColor
|
|
11
|
+
},
|
|
12
|
+
ol: {
|
|
13
|
+
paddingLeft: spacing.SizesDdsSpacingLocalX2
|
|
14
|
+
},
|
|
15
|
+
ul: {
|
|
16
|
+
paddingLeft: "calc(".concat(ulPaddingLeft, ")")
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
var listItem = {
|
|
20
|
+
lineHeight: '2.5em',
|
|
21
|
+
ul: {
|
|
22
|
+
paddingLeft: "calc(".concat(ulLiPaddingLeft, ")")
|
|
23
|
+
}
|
|
8
24
|
};
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var bodySans03Base = Object.assign({}, FontPackages.body_sans_03.base);
|
|
12
|
-
var bodySans04Base = Object.assign({}, FontPackages.body_sans_04.base);
|
|
13
|
-
var base = {
|
|
14
|
-
margin: "".concat(Spacing.SizesDdsSpacingLocalX1, " 0"),
|
|
15
|
-
color: textDefault.textColor
|
|
25
|
+
var bullet = {
|
|
26
|
+
top: "calc((".concat(listItem.lineHeight, " / 2) - 0.5em )")
|
|
16
27
|
};
|
|
17
28
|
var listTokens = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
bodySans02: bodySans02Base,
|
|
23
|
-
bodySans03: bodySans03Base,
|
|
24
|
-
bodySans04: bodySans04Base,
|
|
25
|
-
inherit: inheritBase
|
|
26
|
-
}
|
|
29
|
+
list: list,
|
|
30
|
+
listItem: listItem,
|
|
31
|
+
bullet: bullet,
|
|
32
|
+
spaceLeft: spacing.SizesDdsSpacingLocalX2
|
|
27
33
|
};
|
|
28
34
|
|
|
29
35
|
export { listTokens };
|
|
@@ -2,12 +2,12 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import {
|
|
5
|
+
import { listTokens } from './List.tokens.js';
|
|
6
6
|
|
|
7
7
|
var StyledListItem = styled.li.withConfig({
|
|
8
8
|
displayName: "ListItem__StyledListItem",
|
|
9
9
|
componentId: "sc-17s9l0b-0"
|
|
10
|
-
})(["", ""],
|
|
10
|
+
})(["line-height:", ";"], listTokens.listItem.lineHeight);
|
|
11
11
|
var ListItem = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
12
12
|
var children = _a.children,
|
|
13
13
|
rest = __rest(_a, ["children"]);
|
|
@@ -4,7 +4,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import { Button } from '../Button/Button.js';
|
|
6
6
|
import { forwardRef, useState } from 'react';
|
|
7
|
-
import { localMessageTokens } from './LocalMessage.tokens.js';
|
|
7
|
+
import { localMessageTokens, purposeVariants } from './LocalMessage.tokens.js';
|
|
8
8
|
import { Icon } from '../Icon/Icon.js';
|
|
9
9
|
import { Typography } from '../Typography/Typography/Typography.js';
|
|
10
10
|
import '../../helpers/Backdrop/Backdrop.js';
|
|
@@ -24,19 +24,24 @@ import '../../helpers/styling/hover.js';
|
|
|
24
24
|
import '../../helpers/styling/focus.js';
|
|
25
25
|
import '../../helpers/styling/danger.js';
|
|
26
26
|
import { selection } from '../../helpers/styling/selection.js';
|
|
27
|
+
import { getFontStyling, defaultTypographyType } from '../Typography/Typography.utils.js';
|
|
27
28
|
|
|
29
|
+
var defaultWidth = '400px';
|
|
30
|
+
var container = localMessageTokens.container,
|
|
31
|
+
contentContainer = localMessageTokens.contentContainer,
|
|
32
|
+
topContainer = localMessageTokens.topContainer;
|
|
28
33
|
var Container = styled.div.withConfig({
|
|
29
34
|
displayName: "LocalMessage__Container",
|
|
30
35
|
componentId: "sc-kmfp8w-0"
|
|
31
|
-
})(["display:flex;flex-direction:", ";box-
|
|
36
|
+
})(["box-sizing:border-box;display:flex;flex-direction:", ";box-shadow:", ";border:", ";padding:", ";border-radius:", ";", " ", ";*::selection{", "}", " width:", ";"], function (_ref) {
|
|
32
37
|
var layout = _ref.layout;
|
|
33
38
|
return layout === 'vertical' ? 'column' : 'row';
|
|
34
|
-
}, function (_ref2) {
|
|
39
|
+
}, container.base.boxShadow, container.base.border, container.base.padding, container.base.borderRadius, getFontStyling(defaultTypographyType, true), function (_ref2) {
|
|
35
40
|
var layout = _ref2.layout;
|
|
36
41
|
return layout === 'horisontal' && css(["align-items:center;justify-content:space-between;"]);
|
|
37
42
|
}, selection, function (_ref3) {
|
|
38
43
|
var purpose = _ref3.purpose;
|
|
39
|
-
return purpose && css(["", "
|
|
44
|
+
return purpose && css(["border-color:", ";background-color:", ";"], container.purpose[purpose].borderColor, container.purpose[purpose].backgroundColor);
|
|
40
45
|
}, function (_ref4) {
|
|
41
46
|
var width = _ref4.width;
|
|
42
47
|
return width;
|
|
@@ -48,19 +53,19 @@ var MessageIconWrapper = styled(Icon).withConfig({
|
|
|
48
53
|
var ContentContainer = styled.div.withConfig({
|
|
49
54
|
displayName: "LocalMessage__ContentContainer",
|
|
50
55
|
componentId: "sc-kmfp8w-2"
|
|
51
|
-
})(["", "
|
|
52
|
-
var
|
|
53
|
-
return
|
|
56
|
+
})(["padding-top:", ";padding-right:", ";", ";"], contentContainer.paddingTop, function (_ref5) {
|
|
57
|
+
var closable = _ref5.closable;
|
|
58
|
+
return closable ? contentContainer.withClosable.paddingRight : contentContainer.paddingRight;
|
|
54
59
|
}, function (_ref6) {
|
|
55
|
-
var
|
|
56
|
-
return
|
|
60
|
+
var layout = _ref6.layout;
|
|
61
|
+
return layout === 'vertical' ? css(["padding-bottom:", ";"], contentContainer.vertical.paddingBottom) : css(["display:flex;align-items:center;padding-bottom:", ";"], contentContainer.paddingBottom);
|
|
57
62
|
});
|
|
58
63
|
var TopContainer = styled.div.withConfig({
|
|
59
64
|
displayName: "LocalMessage__TopContainer",
|
|
60
65
|
componentId: "sc-kmfp8w-3"
|
|
61
|
-
})(["width:100%;display:flex;justify-content:space-between;align-items:center;", "
|
|
66
|
+
})(["width:100%;display:flex;justify-content:space-between;align-items:center;padding-top:", ";"], function (_ref7) {
|
|
62
67
|
var closable = _ref7.closable;
|
|
63
|
-
return closable
|
|
68
|
+
return closable ? topContainer.withClosable.paddingTop : topContainer.paddingTop;
|
|
64
69
|
});
|
|
65
70
|
var LocalMessage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
66
71
|
var message = props.message,
|
|
@@ -69,7 +74,7 @@ var LocalMessage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
69
74
|
closable = props.closable,
|
|
70
75
|
onClose = props.onClose,
|
|
71
76
|
_props$width = props.width,
|
|
72
|
-
width = _props$width === void 0 ?
|
|
77
|
+
width = _props$width === void 0 ? defaultWidth : _props$width,
|
|
73
78
|
_props$layout = props.layout,
|
|
74
79
|
layout = _props$layout === void 0 ? 'horisontal' : _props$layout,
|
|
75
80
|
children = props.children,
|
|
@@ -83,7 +88,6 @@ var LocalMessage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
83
88
|
isClosed = _useState2[0],
|
|
84
89
|
setClosed = _useState2[1];
|
|
85
90
|
|
|
86
|
-
var buttonPurpose = localMessageTokens.button[purpose].purpose;
|
|
87
91
|
var containerProps = Object.assign(Object.assign({}, getBaseHTMLProps(id, className, htmlProps, rest)), {
|
|
88
92
|
purpose: purpose,
|
|
89
93
|
width: width,
|
|
@@ -96,7 +100,7 @@ var LocalMessage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
96
100
|
};
|
|
97
101
|
|
|
98
102
|
var messageIconWrapper = jsx(MessageIconWrapper, {
|
|
99
|
-
icon:
|
|
103
|
+
icon: purposeVariants[purpose].icon,
|
|
100
104
|
color: localMessageTokens.icon[purpose].color
|
|
101
105
|
});
|
|
102
106
|
|
|
@@ -108,7 +112,7 @@ var LocalMessage = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
108
112
|
|
|
109
113
|
var closeButton = closable && jsx(Button, {
|
|
110
114
|
icon: CloseIcon,
|
|
111
|
-
purpose:
|
|
115
|
+
purpose: purposeVariants[purpose].closeButtonPurpose,
|
|
112
116
|
appearance: "borderless",
|
|
113
117
|
onClick: function onClick() {
|
|
114
118
|
setClosed(true);
|
|
@@ -1,89 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { SvgIcon } from '../../icons/utils';
|
|
2
|
+
import { ButtonPurpose } from '../Button';
|
|
3
|
+
import { StaticTypographyType } from '../Typography';
|
|
4
|
+
import { LocalMessagePurpose } from './LocalMessage';
|
|
5
|
+
export declare const typographyType: StaticTypographyType;
|
|
6
|
+
export declare const purposeVariants: {
|
|
7
|
+
[k in LocalMessagePurpose]: {
|
|
8
|
+
icon: SvgIcon;
|
|
9
|
+
closeButtonPurpose: ButtonPurpose;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
4
12
|
export declare const localMessageTokens: {
|
|
5
13
|
container: {
|
|
6
|
-
base:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
base: {
|
|
15
|
+
boxShadow: string;
|
|
16
|
+
borderRadius: string;
|
|
17
|
+
border: string;
|
|
18
|
+
padding: string;
|
|
19
|
+
};
|
|
20
|
+
purpose: {
|
|
21
|
+
info: {
|
|
22
|
+
borderColor: string;
|
|
23
|
+
backgroundColor: string;
|
|
24
|
+
};
|
|
25
|
+
warning: {
|
|
26
|
+
borderColor: string;
|
|
27
|
+
backgroundColor: string;
|
|
28
|
+
};
|
|
29
|
+
danger: {
|
|
30
|
+
borderColor: string;
|
|
31
|
+
backgroundColor: string;
|
|
32
|
+
};
|
|
33
|
+
success: {
|
|
34
|
+
borderColor: string;
|
|
35
|
+
backgroundColor: string;
|
|
36
|
+
};
|
|
37
|
+
tips: {
|
|
38
|
+
borderColor: string;
|
|
39
|
+
backgroundColor: string;
|
|
40
|
+
};
|
|
41
|
+
confidential: {
|
|
42
|
+
borderColor: string;
|
|
43
|
+
backgroundColor: string;
|
|
44
|
+
};
|
|
25
45
|
};
|
|
26
46
|
};
|
|
27
47
|
contentContainer: {
|
|
28
|
-
|
|
48
|
+
paddingRight: string;
|
|
49
|
+
paddingTop: string;
|
|
50
|
+
paddingBottom: string;
|
|
29
51
|
withClosable: {
|
|
30
|
-
|
|
52
|
+
paddingRight: string;
|
|
31
53
|
};
|
|
32
54
|
vertical: {
|
|
33
|
-
|
|
55
|
+
paddingBottom: string;
|
|
34
56
|
};
|
|
35
57
|
};
|
|
36
58
|
topContainer: {
|
|
37
|
-
|
|
59
|
+
paddingTop: string;
|
|
38
60
|
withClosable: {
|
|
39
|
-
|
|
61
|
+
paddingTop: string;
|
|
40
62
|
};
|
|
41
63
|
};
|
|
42
64
|
icon: {
|
|
43
65
|
marginRight: string;
|
|
44
66
|
info: {
|
|
45
|
-
icon: typeof InfoIcon;
|
|
46
67
|
color: string;
|
|
47
68
|
};
|
|
48
69
|
danger: {
|
|
49
|
-
icon: typeof ErrorIcon;
|
|
50
70
|
color: string;
|
|
51
71
|
};
|
|
52
72
|
warning: {
|
|
53
|
-
icon: typeof WarningIcon;
|
|
54
73
|
color: string;
|
|
55
74
|
};
|
|
56
75
|
success: {
|
|
57
|
-
icon: typeof CheckCircledIcon;
|
|
58
76
|
color: string;
|
|
59
77
|
};
|
|
60
78
|
tips: {
|
|
61
|
-
icon: typeof TipIcon;
|
|
62
79
|
color: string;
|
|
63
80
|
};
|
|
64
81
|
confidential: {
|
|
65
|
-
icon: typeof ErrorIcon;
|
|
66
82
|
color: string;
|
|
67
83
|
};
|
|
68
84
|
};
|
|
69
|
-
button: {
|
|
70
|
-
info: {
|
|
71
|
-
purpose: string;
|
|
72
|
-
};
|
|
73
|
-
danger: {
|
|
74
|
-
purpose: string;
|
|
75
|
-
};
|
|
76
|
-
warning: {
|
|
77
|
-
purpose: string;
|
|
78
|
-
};
|
|
79
|
-
success: {
|
|
80
|
-
purpose: string;
|
|
81
|
-
};
|
|
82
|
-
confidential: {
|
|
83
|
-
purpose: string;
|
|
84
|
-
};
|
|
85
|
-
tips: {
|
|
86
|
-
purpose: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
85
|
};
|