@norges-domstoler/dds-components 5.4.0 → 5.5.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 +8 -1
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.stories.d.ts +3 -3
- package/dist/cjs/components/Button/Button.d.ts +3 -3
- package/dist/cjs/components/Button/Button.stories.d.ts +3 -3
- package/dist/cjs/components/Card/CardAccordion/CardAccordion.d.ts +3 -3
- package/dist/cjs/components/Card/CardAccordion/CardAccordionBody.d.ts +3 -3
- package/dist/cjs/components/Card/CardAccordion/CardAccordionHeader.d.ts +3 -3
- package/dist/cjs/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/cjs/components/Checkbox/Checkbox.stories.d.ts +3 -3
- package/dist/cjs/components/Chip/Chip.d.ts +3 -3
- package/dist/cjs/components/Chip/Chip.stories.d.ts +3 -3
- package/dist/cjs/components/Datepicker/Datepicker.d.ts +10 -8
- package/dist/cjs/components/Datepicker/Datepicker.stories.d.ts +3 -6
- package/dist/cjs/components/DescriptionList/DescriptionList.d.ts +3 -3
- package/dist/cjs/components/DescriptionList/DescriptionList.stories.d.ts +3 -3
- package/dist/cjs/components/DescriptionList/DescriptionListDesc.d.ts +3 -3
- package/dist/cjs/components/DescriptionList/DescriptionListGroup.d.ts +3 -3
- package/dist/cjs/components/Divider/Divider.d.ts +3 -3
- package/dist/cjs/components/Divider/Divider.stories.d.ts +3 -3
- package/dist/cjs/components/Drawer/Drawer.d.ts +3 -3
- package/dist/cjs/components/Drawer/Drawer.stories.d.ts +3 -3
- package/dist/cjs/components/GlobalMessage/GlobalMessage.d.ts +3 -3
- package/dist/cjs/components/GlobalMessage/GlobalMessage.stories.d.ts +3 -3
- package/dist/cjs/components/InputMessage/InputMessage.d.ts +3 -3
- package/dist/cjs/components/InputMessage/InputMessage.stories.d.ts +3 -3
- package/dist/cjs/components/InternalHeader/InternalHeader.stories.d.ts +10 -5
- package/dist/cjs/components/InternalHeader/InternalHeader.styles.d.ts +3 -3
- package/dist/cjs/components/InternalHeader/InternalHeader.types.d.ts +2 -0
- package/dist/cjs/components/List/List.d.ts +3 -3
- package/dist/cjs/components/List/List.stories.d.ts +3 -3
- package/dist/cjs/components/LocalMessage/LocalMessage.d.ts +3 -3
- package/dist/cjs/components/LocalMessage/LocalMessage.stories.d.ts +3 -3
- package/dist/cjs/components/Modal/Modal.d.ts +3 -3
- package/dist/cjs/components/Modal/Modal.stories.d.ts +3 -3
- package/dist/cjs/components/Modal/ModalBody.d.ts +3 -3
- package/dist/cjs/components/OverflowMenu/OverflowMenu.d.ts +3 -3
- package/dist/cjs/components/OverflowMenu/OverflowMenu.stories.d.ts +3 -3
- package/dist/cjs/components/Pagination/Pagination.d.ts +3 -3
- package/dist/cjs/components/Pagination/Pagination.stories.d.ts +3 -3
- package/dist/cjs/components/Popover/Popover.d.ts +3 -3
- package/dist/cjs/components/Popover/Popover.stories.d.ts +3 -3
- package/dist/cjs/components/RadioButton/RadioButton.d.ts +3 -3
- package/dist/cjs/components/RadioButton/RadioButton.stories.d.ts +3 -3
- package/dist/cjs/components/Select/Select.styles.d.ts +1 -0
- package/dist/cjs/components/SkipToContent/SkipToContent.d.ts +3 -3
- package/dist/cjs/components/SkipToContent/SkipToContent.stories.d.ts +3 -3
- package/dist/cjs/components/Spinner/Spinner.d.ts +1 -1
- package/dist/cjs/components/Stepper/Stepper.d.ts +3 -3
- package/dist/cjs/components/Stepper/Stepper.stories.d.ts +3 -3
- package/dist/cjs/components/Tabs/Tab.d.ts +3 -3
- package/dist/cjs/components/Tabs/TabPanel.d.ts +3 -3
- package/dist/cjs/components/Tabs/Tabs.d.ts +3 -3
- package/dist/cjs/components/Tag/Tag.d.ts +3 -3
- package/dist/cjs/components/Tag/Tag.stories.d.ts +3 -3
- package/dist/cjs/components/ToggleBar/ToggleRadio.d.ts +4 -4
- package/dist/cjs/components/ToggleButton/ToggleButton.d.ts +3 -3
- package/dist/cjs/components/ToggleButton/ToggleButton.stories.d.ts +3 -3
- package/dist/cjs/components/Tooltip/Tooltip.d.ts +4 -4
- package/dist/cjs/components/Tooltip/Tooltip.stories.d.ts +3 -3
- package/dist/cjs/components/Typography/Caption/Caption.d.ts +10 -0
- package/dist/cjs/components/Typography/Caption/Caption.stories.d.ts +28 -0
- package/dist/cjs/components/Typography/Caption/index.d.ts +1 -0
- package/dist/cjs/components/Typography/Heading/Heading.d.ts +21 -0
- package/dist/cjs/components/Typography/Heading/Heading.stories.d.ts +37 -0
- package/dist/cjs/components/Typography/Heading/index.d.ts +1 -0
- package/dist/cjs/components/Typography/Label/Label.d.ts +13 -0
- package/dist/cjs/components/Typography/Label/Label.stories.d.ts +30 -0
- package/dist/cjs/components/Typography/Label/index.d.ts +1 -0
- package/dist/cjs/components/Typography/Legend/Legend.d.ts +10 -0
- package/dist/cjs/components/Typography/Legend/Legend.stories.d.ts +28 -0
- package/dist/cjs/components/Typography/Legend/index.d.ts +1 -0
- package/dist/cjs/components/Typography/Link/Link.d.ts +23 -0
- package/dist/cjs/components/Typography/Link/Link.stories.d.ts +47 -0
- package/dist/cjs/components/Typography/Link/index.d.ts +1 -0
- package/dist/cjs/components/Typography/Paragraph/Paragraph.d.ts +16 -0
- package/dist/cjs/components/Typography/Paragraph/Paragraph.stories.d.ts +35 -0
- package/dist/cjs/components/Typography/Paragraph/index.d.ts +1 -0
- package/dist/cjs/components/Typography/Typography/Typography.d.ts +25 -0
- package/dist/{components → cjs/components/Typography}/Typography/Typography.stories.d.ts +2 -1
- package/dist/cjs/components/Typography/Typography/Typography.types.d.ts +37 -0
- package/dist/cjs/components/Typography/Typography/index.d.ts +2 -0
- package/dist/cjs/components/Typography/Typography.tokens.d.ts +401 -100
- package/dist/cjs/components/Typography/Typography.utils.d.ts +9 -0
- package/dist/cjs/components/Typography/index.d.ts +6 -1
- package/dist/cjs/components/Typography/stories/Examples.stories.d.ts +5 -0
- package/dist/cjs/components/Typography/stories/TypographyComponents.stories.d.ts +42 -0
- package/dist/cjs/components/Typography/{Body.stories.d.ts → stories/TypographyTypes.stories.d.ts} +1 -1
- package/dist/cjs/index.js +791 -702
- package/dist/cjs/types/BaseComponentProps.d.ts +2 -2
- package/dist/cjs/utils/color.d.ts +24 -0
- package/dist/components/Breadcrumbs/Breadcrumb.js +2 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.js +3 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +3 -3
- package/dist/components/Button/Button.d.ts +3 -3
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Button.stories.d.ts +3 -3
- package/dist/components/Button/Button.styles.js +6 -3
- package/dist/components/Button/Button.tokens.js +6 -0
- package/dist/components/Card/Card.js +6 -2
- package/dist/components/Card/Card.tokens.js +5 -1
- package/dist/components/Card/CardAccordion/CardAccordion.d.ts +3 -3
- package/dist/components/Card/CardAccordion/CardAccordionBody.d.ts +3 -3
- package/dist/components/Card/CardAccordion/CardAccordionHeader.d.ts +3 -3
- package/dist/components/Card/CardAccordion/CardAccordionHeader.js +11 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.js +10 -2
- package/dist/components/Checkbox/Checkbox.stories.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.styles.js +5 -1
- package/dist/components/Checkbox/Checkbox.tokens.js +4 -1
- package/dist/components/Checkbox/CheckboxGroup.js +12 -4
- package/dist/components/Chip/Chip.d.ts +3 -3
- package/dist/components/Chip/Chip.js +2 -1
- package/dist/components/Chip/Chip.stories.d.ts +3 -3
- package/dist/components/Datepicker/Datepicker.d.ts +10 -8
- package/dist/components/Datepicker/Datepicker.js +44 -11
- package/dist/components/Datepicker/Datepicker.stories.d.ts +3 -6
- package/dist/components/DescriptionList/DescriptionList.d.ts +3 -3
- package/dist/components/DescriptionList/DescriptionList.js +7 -3
- package/dist/components/DescriptionList/DescriptionList.stories.d.ts +3 -3
- package/dist/components/DescriptionList/DescriptionListDesc.d.ts +3 -3
- package/dist/components/DescriptionList/DescriptionListDesc.js +1 -1
- package/dist/components/DescriptionList/DescriptionListGroup.d.ts +3 -3
- package/dist/components/Divider/Divider.d.ts +3 -3
- package/dist/components/Divider/Divider.js +1 -1
- package/dist/components/Divider/Divider.stories.d.ts +3 -3
- package/dist/components/Drawer/Drawer.d.ts +3 -3
- package/dist/components/Drawer/Drawer.js +25 -9
- package/dist/components/Drawer/Drawer.stories.d.ts +3 -3
- package/dist/components/GlobalMessage/GlobalMessage.d.ts +3 -3
- package/dist/components/GlobalMessage/GlobalMessage.js +5 -3
- package/dist/components/GlobalMessage/GlobalMessage.stories.d.ts +3 -3
- package/dist/components/GlobalMessage/GlobalMessage.tokens.js +4 -1
- package/dist/components/InputMessage/InputMessage.d.ts +3 -3
- package/dist/components/InputMessage/InputMessage.js +5 -3
- package/dist/components/InputMessage/InputMessage.stories.d.ts +3 -3
- package/dist/components/InternalHeader/InternalHeader.js +10 -7
- package/dist/components/InternalHeader/InternalHeader.stories.d.ts +10 -5
- package/dist/components/InternalHeader/InternalHeader.styles.d.ts +3 -3
- package/dist/components/InternalHeader/InternalHeader.styles.js +8 -2
- package/dist/components/InternalHeader/InternalHeader.types.d.ts +2 -0
- package/dist/components/InternalHeader/NavigationItem.js +5 -1
- package/dist/components/List/List.d.ts +3 -3
- package/dist/components/List/List.js +6 -2
- package/dist/components/List/List.stories.d.ts +3 -3
- package/dist/components/LocalMessage/LocalMessage.d.ts +3 -3
- package/dist/components/LocalMessage/LocalMessage.js +10 -4
- package/dist/components/LocalMessage/LocalMessage.stories.d.ts +3 -3
- package/dist/components/LocalMessage/LocalMessage.tokens.js +5 -2
- package/dist/components/Modal/Modal.d.ts +3 -3
- package/dist/components/Modal/Modal.js +23 -9
- package/dist/components/Modal/Modal.stories.d.ts +3 -3
- package/dist/components/Modal/Modal.tokens.js +5 -0
- package/dist/components/Modal/ModalBody.d.ts +3 -3
- package/dist/components/Modal/ModalBody.js +3 -1
- package/dist/components/OverflowMenu/OverflowMenu.d.ts +3 -3
- package/dist/components/OverflowMenu/OverflowMenu.js +17 -9
- package/dist/components/OverflowMenu/OverflowMenu.stories.d.ts +3 -3
- package/dist/components/OverflowMenu/OverflowMenuItem.js +8 -2
- package/dist/components/Pagination/Pagination.d.ts +3 -3
- package/dist/components/Pagination/Pagination.js +9 -7
- package/dist/components/Pagination/Pagination.stories.d.ts +3 -3
- package/dist/components/Popover/Popover.d.ts +3 -3
- package/dist/components/Popover/Popover.js +12 -4
- package/dist/components/Popover/Popover.stories.d.ts +3 -3
- package/dist/components/Popover/PopoverGroup.js +3 -1
- package/dist/components/RadioButton/RadioButton.d.ts +3 -3
- package/dist/components/RadioButton/RadioButton.js +9 -2
- package/dist/components/RadioButton/RadioButton.stories.d.ts +3 -3
- package/dist/components/RadioButton/RadioButton.styles.js +4 -0
- package/dist/components/RadioButton/RadioButton.tokens.js +4 -1
- package/dist/components/RadioButton/RadioButtonGroup.js +12 -4
- package/dist/components/ScrollableContainer/ScrollableContainer.js +5 -1
- package/dist/components/ScrollableContainer/Scrollbar.js +1 -3
- package/dist/components/Search/Search.js +12 -4
- package/dist/components/Select/Select.js +34 -19
- package/dist/components/Select/Select.styles.d.ts +1 -0
- package/dist/components/Select/Select.styles.js +27 -11
- package/dist/components/Select/Select.tokens.js +5 -0
- package/dist/components/SkipToContent/SkipToContent.d.ts +3 -3
- package/dist/components/SkipToContent/SkipToContent.js +4 -0
- package/dist/components/SkipToContent/SkipToContent.stories.d.ts +3 -3
- package/dist/components/SkipToContent/SkipToContent.tokens.js +5 -0
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Step.js +6 -2
- package/dist/components/Stepper/Stepper.d.ts +3 -3
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/Stepper.stories.d.ts +3 -3
- package/dist/components/Table/Cell.tokens.js +5 -0
- package/dist/components/Table/Row.tokens.js +5 -0
- package/dist/components/Table/SortCell.js +10 -4
- package/dist/components/Table/Table.js +9 -3
- package/dist/components/Table/TableWrapper.js +2 -0
- package/dist/components/Tabs/Tab.d.ts +3 -3
- package/dist/components/Tabs/Tab.js +9 -3
- package/dist/components/Tabs/TabList.js +8 -4
- package/dist/components/Tabs/TabPanel.d.ts +3 -3
- package/dist/components/Tabs/TabPanel.js +5 -1
- package/dist/components/Tabs/TabPanels.js +3 -1
- package/dist/components/Tabs/Tabs.d.ts +3 -3
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.tokens.js +6 -1
- package/dist/components/Tag/Tag.d.ts +3 -3
- package/dist/components/Tag/Tag.js +2 -1
- package/dist/components/Tag/Tag.stories.d.ts +3 -3
- package/dist/components/TextInput/CharCounter.js +3 -2
- package/dist/components/TextInput/TextInput.js +9 -3
- package/dist/components/TextInput/TextInput.styles.js +9 -1
- package/dist/components/ToggleBar/ToggleBar.js +10 -4
- package/dist/components/ToggleBar/ToggleBar.tokens.js +1 -0
- package/dist/components/ToggleBar/ToggleRadio.d.ts +4 -4
- package/dist/components/ToggleBar/ToggleRadio.js +8 -2
- package/dist/components/ToggleBar/ToggleRadio.styles.js +11 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +3 -3
- package/dist/components/ToggleButton/ToggleButton.js +14 -5
- package/dist/components/ToggleButton/ToggleButton.stories.d.ts +3 -3
- package/dist/components/ToggleButton/ToggleButton.tokens.js +6 -1
- package/dist/components/ToggleButton/ToggleButtonGroup.js +3 -2
- package/dist/components/Tooltip/Tooltip.d.ts +4 -4
- package/dist/components/Tooltip/Tooltip.js +6 -4
- package/dist/components/Tooltip/Tooltip.stories.d.ts +3 -3
- package/dist/components/Tooltip/Tooltip.styles.js +7 -3
- package/dist/components/Typography/Caption/Caption.d.ts +10 -0
- package/dist/components/Typography/Caption/Caption.js +23 -0
- package/dist/components/Typography/Caption/Caption.stories.d.ts +28 -0
- package/dist/components/Typography/Caption/index.d.ts +1 -0
- package/dist/components/Typography/Heading/Heading.d.ts +21 -0
- package/dist/components/Typography/Heading/Heading.js +56 -0
- package/dist/components/Typography/Heading/Heading.stories.d.ts +37 -0
- package/dist/components/Typography/Heading/index.d.ts +1 -0
- package/dist/components/Typography/Label/Label.d.ts +13 -0
- package/dist/components/Typography/Label/Label.js +22 -0
- package/dist/components/Typography/Label/Label.stories.d.ts +30 -0
- package/dist/components/Typography/Label/index.d.ts +1 -0
- package/dist/components/Typography/Legend/Legend.d.ts +10 -0
- package/dist/components/Typography/Legend/Legend.js +23 -0
- package/dist/components/Typography/Legend/Legend.stories.d.ts +28 -0
- package/dist/components/Typography/Legend/index.d.ts +1 -0
- package/dist/components/Typography/Link/Link.d.ts +23 -0
- package/dist/components/Typography/Link/Link.js +45 -0
- package/dist/components/Typography/Link/Link.stories.d.ts +47 -0
- package/dist/components/Typography/Link/index.d.ts +1 -0
- package/dist/components/Typography/Paragraph/Paragraph.d.ts +16 -0
- package/dist/components/Typography/Paragraph/Paragraph.js +25 -0
- package/dist/components/Typography/Paragraph/Paragraph.stories.d.ts +35 -0
- package/dist/components/Typography/Paragraph/index.d.ts +1 -0
- package/dist/components/Typography/Typography/Typography.d.ts +25 -0
- package/dist/components/Typography/Typography/Typography.js +101 -0
- package/dist/{cjs/components → components/Typography}/Typography/Typography.stories.d.ts +2 -1
- package/dist/components/Typography/Typography/Typography.types.d.ts +37 -0
- package/dist/components/Typography/Typography/index.d.ts +2 -0
- package/dist/components/Typography/Typography.tokens.d.ts +401 -100
- package/dist/components/Typography/Typography.tokens.js +354 -482
- package/dist/components/Typography/Typography.utils.d.ts +9 -0
- package/dist/components/Typography/Typography.utils.js +75 -0
- package/dist/components/Typography/index.d.ts +6 -1
- package/dist/components/Typography/stories/Examples.stories.d.ts +5 -0
- package/dist/components/Typography/stories/TypographyComponents.stories.d.ts +42 -0
- package/dist/components/Typography/{Body.stories.d.ts → stories/TypographyTypes.stories.d.ts} +1 -1
- package/dist/helpers/Input/Input.styles.js +11 -3
- package/dist/helpers/Input/Input.tokens.js +4 -1
- package/dist/helpers/Paper/Paper.js +6 -2
- package/dist/hooks/useScreenSize.js +17 -0
- package/dist/index.js +7 -1
- package/dist/types/BaseComponentProps.d.ts +2 -2
- package/dist/utils/color.d.ts +24 -0
- package/dist/utils/color.js +31 -1
- package/package.json +3 -3
- package/dist/cjs/components/Typography/Examples.stories.d.ts +0 -7
- package/dist/cjs/components/Typography/Typography.d.ts +0 -49
- package/dist/cjs/components/Typography/Typography.types.d.ts +0 -13
- package/dist/components/Typography/Examples.stories.d.ts +0 -7
- package/dist/components/Typography/Typography.d.ts +0 -49
- package/dist/components/Typography/Typography.js +0 -172
- package/dist/components/Typography/Typography.types.d.ts +0 -13
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { TypographyType, TypographyHeadingType, InlineElement, TypographyInteractionStyling, StaticTypographyType } from './Typography/Typography.types';
|
|
3
|
+
export declare const getElementType: (element: string) => ElementType;
|
|
4
|
+
export declare const isHeading: (type: TypographyType) => type is TypographyHeadingType;
|
|
5
|
+
export declare const inlineElements: ElementType[];
|
|
6
|
+
export declare const isInlineElement: (as: ElementType) => as is InlineElement;
|
|
7
|
+
export declare const getAdditionalFontStyle: (bold?: boolean, italic?: boolean, underline?: boolean) => import("styled-components").FlattenSimpleInterpolation;
|
|
8
|
+
export declare const getMarginStyling: (typographyType: TypographyType, element: ElementType, withMargins?: boolean) => import("styled-components").FlattenSimpleInterpolation;
|
|
9
|
+
export declare const getAnchorStyling: (external?: boolean, interactionStyling?: TypographyInteractionStyling, typographyType?: StaticTypographyType, withMargins?: boolean) => import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
import { typographyTokens } from './Typography.tokens.js';
|
|
3
|
+
import { focusVisibleLinkTransitionValue, focusVisibleLink } from '../../helpers/styling/focusVisible.js';
|
|
4
|
+
import '../../helpers/styling/hover.js';
|
|
5
|
+
import '../../helpers/styling/focus.js';
|
|
6
|
+
import '../../helpers/styling/danger.js';
|
|
7
|
+
import '../../helpers/styling/selection.js';
|
|
8
|
+
|
|
9
|
+
var getElementType = function getElementType(element) {
|
|
10
|
+
switch (element) {
|
|
11
|
+
case 'a':
|
|
12
|
+
return 'a';
|
|
13
|
+
|
|
14
|
+
case 'headingSans01':
|
|
15
|
+
return 'h6';
|
|
16
|
+
|
|
17
|
+
case 'headingSans02':
|
|
18
|
+
return 'h5';
|
|
19
|
+
|
|
20
|
+
case 'headingSans03':
|
|
21
|
+
return 'h4';
|
|
22
|
+
|
|
23
|
+
case 'headingSans04':
|
|
24
|
+
return 'h3';
|
|
25
|
+
|
|
26
|
+
case 'headingSans05':
|
|
27
|
+
return 'h2';
|
|
28
|
+
|
|
29
|
+
case 'headingSans06':
|
|
30
|
+
case 'headingSans07':
|
|
31
|
+
case 'headingSans08':
|
|
32
|
+
return 'h1';
|
|
33
|
+
|
|
34
|
+
case 'supportingStyleLabel01':
|
|
35
|
+
return 'label';
|
|
36
|
+
|
|
37
|
+
case 'bodySans01':
|
|
38
|
+
case 'bodySans02':
|
|
39
|
+
case 'bodySans03':
|
|
40
|
+
case 'bodySans04':
|
|
41
|
+
case 'bodySerif01':
|
|
42
|
+
case 'bodySerif02':
|
|
43
|
+
case 'bodySerif03':
|
|
44
|
+
case 'bodySerif04':
|
|
45
|
+
case 'leadSans01':
|
|
46
|
+
case 'leadSans02':
|
|
47
|
+
case 'leadSans03':
|
|
48
|
+
case 'leadSans04':
|
|
49
|
+
case 'leadSans05':
|
|
50
|
+
case 'supportingStyleInputText01':
|
|
51
|
+
case 'supportingStyleInputText02':
|
|
52
|
+
case 'supportingStyleInputText03':
|
|
53
|
+
case 'supportingStyleHelperText01':
|
|
54
|
+
case 'supportingStylePlaceholderText01':
|
|
55
|
+
case 'supportingStyleTiny01':
|
|
56
|
+
case 'supportingStyleTiny02':
|
|
57
|
+
default:
|
|
58
|
+
return 'p';
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var inlineElements = ['a', 'abbr', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button', 'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'mark', 'meter', 'noscript', 'object', 'output', 'picture', 'progress', 'q', 'ruby', 's', 'samp', 'script', 'select', 'slot', 'small', 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var', 'video', 'wbr'];
|
|
62
|
+
var isInlineElement = function isInlineElement(as) {
|
|
63
|
+
return inlineElements.indexOf(as) !== -1;
|
|
64
|
+
};
|
|
65
|
+
var getAdditionalFontStyle = function getAdditionalFontStyle(bold, italic, underline) {
|
|
66
|
+
return css(["", " ", " ", ""], bold && css(["font-weight:", ";"], typographyTokens.style.bold.fontWeight), italic && css(["font-style:italic;"]), underline && css(["text-decoration:underline;"]));
|
|
67
|
+
};
|
|
68
|
+
var getMarginStyling = function getMarginStyling(typographyType, element, withMargins) {
|
|
69
|
+
return withMargins ? css(["", " margin-top:", ";margin-bottom:", ";", ""], isInlineElement(element) && element !== 'a' && css(["display:block;"]), typographyTokens.typographyType[typographyType].margins.marginTop, typographyTokens.typographyType[typographyType].margins.marginBottom, css(["padding-top:", ";"], typographyTokens.typographyType[typographyType].margins.paddingTop)) : css(["margin:0;"]);
|
|
70
|
+
};
|
|
71
|
+
var getAnchorStyling = function getAnchorStyling(external, interactionStyling, typographyType, withMargins) {
|
|
72
|
+
return css(["", " width:fit-content;text-decoration:underline;@media (prefers-reduced-motion:no-preference){transition:", ";}", " &:hover{color:", ";", "}", " &:focus-visible,&.focus-visible,&:focus-visible::selection,&.focus-visible::selection{", "}"], typographyType ? css(["", ";color:", ";", ""], typographyTokens.typographyType[typographyType].base.font, typographyTokens.typographyType[typographyType].base.color, getMarginStyling(typographyType, 'a', withMargins)) : css(["font:inherit;color:", ";", ""], typographyTokens.typographyType.a.base.color, getMarginStyling('a', 'a', withMargins)), focusVisibleLinkTransitionValue, external ? css(["display:inline-flex;align-items:center;gap:", ";"], typographyTokens.typographyType.a.base.gap) : '', typographyTokens.typographyType.a.hover.color, interactionStyling && interactionStyling.hover && css(["", ""], interactionStyling.hover), interactionStyling && interactionStyling.active && css(["&:active{", "}"], interactionStyling.active), focusVisibleLink);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export { getAdditionalFontStyle, getAnchorStyling, getElementType, getMarginStyling, inlineElements, isInlineElement };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
argTypes: {
|
|
4
|
+
typographyType: {
|
|
5
|
+
control: {
|
|
6
|
+
type: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
bold: {
|
|
10
|
+
control: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
italic: {
|
|
15
|
+
control: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
underline: {
|
|
20
|
+
control: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
withMargins: {
|
|
25
|
+
control: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
color: {
|
|
30
|
+
control: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
text: {
|
|
35
|
+
control: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
42
|
+
export declare const ComponentsOverview: () => JSX.Element;
|
package/dist/components/Typography/{Body.stories.d.ts → stories/TypographyTypes.stories.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: import("react").ForwardRefExoticComponent<import("
|
|
3
|
+
component: import("react").ForwardRefExoticComponent<import("..").TypographyProps & import("react").RefAttributes<HTMLElement>>;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Body: () => JSX.Element;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { inputTokens } from './Input.tokens.js';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { Typography } from '../../components/Typography/Typography/Typography.js';
|
|
4
|
+
import 'tslib';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../components/Typography/Link/Link.js';
|
|
8
|
+
import '../styling/focusVisible.js';
|
|
9
|
+
import '../styling/hover.js';
|
|
10
|
+
import '../styling/focus.js';
|
|
11
|
+
import '../styling/danger.js';
|
|
12
|
+
import { selection } from '../styling/selection.js';
|
|
5
13
|
|
|
6
14
|
var Input = styled.input.withConfig({
|
|
7
15
|
displayName: "Inputstyles__Input",
|
|
8
16
|
componentId: "sc-1oz9x8w-0"
|
|
9
|
-
})(["", " width:100%;top:0;left:0;margin:0;padding:0;box-sizing:border-box;box-shadow:none;@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-color 0.2s,background-color 0.2s;}&[type='text'],&[type='password'],&[type='number'],&[type='tel'],&[type='date'],&[type='url'],&[type='email'],&[type='search'],&[type='datetime-local']{-webkit-appearance:none;}&::selection{", "}&:focus:enabled:read-write,&:active:enabled:read-write{", "}&:hover:enabled:read-write{", "}"], inputTokens.baseInput.base,
|
|
17
|
+
})(["", " width:100%;top:0;left:0;margin:0;padding:0;box-sizing:border-box;box-shadow:none;@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-color 0.2s,background-color 0.2s;}&[type='text'],&[type='password'],&[type='number'],&[type='tel'],&[type='date'],&[type='url'],&[type='email'],&[type='search'],&[type='datetime-local']{-webkit-appearance:none;}&::selection{", "}&:focus:enabled:read-write,&:active:enabled:read-write{", "}&:hover:enabled:read-write{", "}"], inputTokens.baseInput.base, selection, inputTokens.baseInput.focus.base, inputTokens.baseInput.hover.base);
|
|
10
18
|
var StatefulInput = styled(Input).withConfig({
|
|
11
19
|
displayName: "Inputstyles__StatefulInput",
|
|
12
20
|
componentId: "sc-1oz9x8w-1"
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ddsBaseTokens, ddsReferenceTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
|
-
import
|
|
2
|
+
import 'styled-components';
|
|
3
|
+
import '../styling/focusVisible.js';
|
|
3
4
|
import { hoverInputfield, hoverDangerInputfield } from '../styling/hover.js';
|
|
5
|
+
import { focusInputfield, focusDangerInputfield } from '../styling/focus.js';
|
|
4
6
|
import { dangerInputfield } from '../styling/danger.js';
|
|
7
|
+
import '../styling/selection.js';
|
|
5
8
|
|
|
6
9
|
var colors = ddsBaseTokens.colors,
|
|
7
10
|
spacing = ddsBaseTokens.spacing,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import
|
|
2
|
+
import '../styling/focusVisible.js';
|
|
3
|
+
import '../styling/hover.js';
|
|
4
|
+
import '../styling/focus.js';
|
|
5
|
+
import '../styling/danger.js';
|
|
6
|
+
import { selection } from '../styling/selection.js';
|
|
3
7
|
import { paperTokens } from './Paper.tokens.js';
|
|
4
8
|
|
|
5
9
|
var Paper = styled.div.withConfig({
|
|
6
10
|
displayName: "Paper",
|
|
7
11
|
componentId: "sc-mrbi8q-0"
|
|
8
|
-
})(["box-sizing:border-box;margin:0;&::selection,*::selection{", "}", ""],
|
|
12
|
+
})(["box-sizing:border-box;margin:0;&::selection,*::selection{", "}", ""], selection, paperTokens.base);
|
|
9
13
|
|
|
10
14
|
export { Paper };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
3
|
+
|
|
4
|
+
var breakpoints = ddsBaseTokens.breakpoints;
|
|
5
|
+
var ScreenSize;
|
|
6
|
+
|
|
7
|
+
(function (ScreenSize) {
|
|
8
|
+
ScreenSize[ScreenSize["XSmall"] = 0] = "XSmall";
|
|
9
|
+
ScreenSize[ScreenSize["Small"] = 1] = "Small";
|
|
10
|
+
ScreenSize[ScreenSize["Medium"] = 2] = "Medium";
|
|
11
|
+
ScreenSize[ScreenSize["Large"] = 3] = "Large";
|
|
12
|
+
ScreenSize[ScreenSize["XLarge"] = 4] = "XLarge";
|
|
13
|
+
})(ScreenSize || (ScreenSize = {}));
|
|
14
|
+
|
|
15
|
+
[[ScreenSize.XLarge, "only screen and (min-width: ".concat(breakpoints.DdsBreakpointXl, ")")], [ScreenSize.Large, "only screen and (min-width: ".concat(breakpoints.DdsBreakpointLg, ")")], [ScreenSize.Medium, "only screen and (min-width: ".concat(breakpoints.DdsBreakpointMd, ")")], [ScreenSize.Small, "only screen and (min-width: ".concat(breakpoints.DdsBreakpointSm, ")")], [ScreenSize.XSmall, "only screen and (min-width: ".concat(breakpoints.DdsBreakpointXs, ")")]];
|
|
16
|
+
|
|
17
|
+
export { ScreenSize };
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,13 @@ export { Select, createSelectOptions, searchFilter } from './components/Select/S
|
|
|
9
9
|
export { GlobalMessage } from './components/GlobalMessage/GlobalMessage.js';
|
|
10
10
|
export { LocalMessage } from './components/LocalMessage/LocalMessage.js';
|
|
11
11
|
export { Search } from './components/Search/Search.js';
|
|
12
|
-
export { Typography
|
|
12
|
+
export { Typography } from './components/Typography/Typography/Typography.js';
|
|
13
|
+
export { Label } from './components/Typography/Label/Label.js';
|
|
14
|
+
export { Paragraph } from './components/Typography/Paragraph/Paragraph.js';
|
|
15
|
+
export { Heading } from './components/Typography/Heading/Heading.js';
|
|
16
|
+
export { Link } from './components/Typography/Link/Link.js';
|
|
17
|
+
export { Legend } from './components/Typography/Legend/Legend.js';
|
|
18
|
+
export { Caption } from './components/Typography/Caption/Caption.js';
|
|
13
19
|
export { Table } from './components/Table/Table.js';
|
|
14
20
|
export { Body } from './components/Table/Body.js';
|
|
15
21
|
export { Head } from './components/Table/Head.js';
|
|
@@ -10,10 +10,10 @@ import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
|
10
10
|
* @template TOtherProps Andre props komponenten skal eksponere til konsumenter.
|
|
11
11
|
* @template THTMLAttributesProps Standard `HTMLAttributes<T>` men kan overstyres for f.eks knapper hvis man trenger en annen basetype for `htmlProps`.
|
|
12
12
|
*/
|
|
13
|
-
export declare type BaseComponentProps<TElement extends Element, TOtherProps extends Record<string, unknown> = Record<string, unknown>, THTMLAttributesProps extends HTMLAttributes<TElement> = HTMLAttributes<TElement>> = {
|
|
13
|
+
export declare type BaseComponentProps<TElement extends Element, TOtherProps extends Record<string, unknown> = Record<string, unknown>, THTMLAttributesProps extends HTMLAttributes<TElement> = HTMLAttributes<TElement>> = Pick<THTMLAttributesProps, 'id' | 'className'> & TOtherProps & {
|
|
14
14
|
/**Ekstra HTML-attributter som vil settes på elementet som genereres. Untatt `id` og `className` som settes på toppnivå. */
|
|
15
15
|
htmlProps?: THTMLAttributesProps;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
/**
|
|
18
18
|
* Utvidelese av {@link BaseComponentProps} med prop for `children`.
|
|
19
19
|
*
|
package/dist/utils/color.d.ts
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
|
+
import { Property } from 'csstype';
|
|
1
2
|
export declare type ColorAlphaFormat = 'hex8' | 'decimal';
|
|
2
3
|
export declare const convertAlpha: (value: number | string, typeFrom: ColorAlphaFormat, typeTo: ColorAlphaFormat) => string | number | undefined;
|
|
3
4
|
export declare const hexToRGBA: (hex: string) => string;
|
|
4
5
|
export declare const addAlphaToRGB: (rgb: string, alpha: number | string) => string;
|
|
5
6
|
export declare const RGBToHex: (value: string) => string;
|
|
6
7
|
export declare const changeRGBAAlpha: (value: string, alpha: number) => string;
|
|
8
|
+
export declare const textColors: {
|
|
9
|
+
interactive: string;
|
|
10
|
+
primary: string;
|
|
11
|
+
danger: string;
|
|
12
|
+
success: string;
|
|
13
|
+
warning: string;
|
|
14
|
+
onLight: string;
|
|
15
|
+
onDark: string;
|
|
16
|
+
gray1: string;
|
|
17
|
+
gray2: string;
|
|
18
|
+
gray3: string;
|
|
19
|
+
gray4: string;
|
|
20
|
+
gray5: string;
|
|
21
|
+
gray6: string;
|
|
22
|
+
gray7: string;
|
|
23
|
+
gray8: string;
|
|
24
|
+
gray9: string;
|
|
25
|
+
};
|
|
26
|
+
export declare type DDSTextColor = 'interactive' | 'primary' | 'danger' | 'warning' | 'success' | 'onLight' | 'onDark' | 'gray1' | 'gray2' | 'gray3' | 'gray4' | 'gray5' | 'gray6' | 'gray7' | 'gray8' | 'gray9';
|
|
27
|
+
export declare const textColorsArray: string[];
|
|
28
|
+
export declare type TextColor = DDSTextColor | Property.Color;
|
|
29
|
+
export declare function isTextColor(color: string): color is DDSTextColor;
|
|
30
|
+
export declare const getTextColor: (color: TextColor) => string;
|
package/dist/utils/color.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ddsBaseTokens, ddsReferenceTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
|
+
|
|
3
|
+
var colors = ddsBaseTokens.colors;
|
|
4
|
+
var textDefault = ddsReferenceTokens.textDefault;
|
|
1
5
|
var changeRGBAAlpha = function changeRGBAAlpha(value, alpha) {
|
|
2
6
|
if (value.slice(0, 5) !== 'rgba(' || value.slice(-1) !== ')') {
|
|
3
7
|
return '';
|
|
@@ -5,5 +9,31 @@ var changeRGBAAlpha = function changeRGBAAlpha(value, alpha) {
|
|
|
5
9
|
|
|
6
10
|
return value.replace(/[\d\.]+\)$/g, alpha.toString() + ')');
|
|
7
11
|
};
|
|
12
|
+
var textColors = {
|
|
13
|
+
interactive: colors.DdsColorInteractiveBase,
|
|
14
|
+
primary: colors.DdsColorPrimaryBase,
|
|
15
|
+
danger: colors.DdsColorDangerBase,
|
|
16
|
+
success: colors.DdsColorSuccessBase,
|
|
17
|
+
warning: colors.DdsColorWarningBase,
|
|
18
|
+
onLight: textDefault.textColor,
|
|
19
|
+
onDark: colors.DdsColorNeutralsWhite,
|
|
20
|
+
gray1: colors.DdsColorNeutralsGray1,
|
|
21
|
+
gray2: colors.DdsColorNeutralsGray2,
|
|
22
|
+
gray3: colors.DdsColorNeutralsGray3,
|
|
23
|
+
gray4: colors.DdsColorNeutralsGray4,
|
|
24
|
+
gray5: colors.DdsColorNeutralsGray5,
|
|
25
|
+
gray6: colors.DdsColorNeutralsGray6,
|
|
26
|
+
gray7: colors.DdsColorNeutralsGray7,
|
|
27
|
+
gray8: colors.DdsColorNeutralsGray8,
|
|
28
|
+
gray9: colors.DdsColorNeutralsGray9
|
|
29
|
+
};
|
|
30
|
+
var textColorsArray = ['interactive', 'primary', 'danger', 'success', 'warning', 'onLight', 'onDark', 'gray1', 'gray2', 'gray3', 'gray4', 'gray5', 'gray6', 'gray7', 'gray8', 'gray9'];
|
|
31
|
+
function isTextColor(color) {
|
|
32
|
+
return textColorsArray.indexOf(color) !== -1;
|
|
33
|
+
}
|
|
34
|
+
var getTextColor = function getTextColor(color) {
|
|
35
|
+
if (isTextColor(color)) return textColors[color];
|
|
36
|
+
return color;
|
|
37
|
+
};
|
|
8
38
|
|
|
9
|
-
export { changeRGBAAlpha };
|
|
39
|
+
export { changeRGBAAlpha, getTextColor, isTextColor, textColors, textColorsArray };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norges-domstoler/dds-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "React components used in Elsa - domstolenes designsystem",
|
|
5
5
|
"author": "Elsa team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@rollup/plugin-babel": "^5.3.1",
|
|
55
55
|
"@rollup/plugin-commonjs": "^22.0.2",
|
|
56
56
|
"@rollup/plugin-image": "^2.1.1",
|
|
57
|
-
"@rollup/plugin-node-resolve": "^
|
|
57
|
+
"@rollup/plugin-node-resolve": "^14.1.0",
|
|
58
58
|
"@storybook/addon-actions": "^6.5.10",
|
|
59
59
|
"@storybook/addon-essentials": "^6.5.10",
|
|
60
60
|
"@storybook/addon-links": "^6.5.10",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"rollup-plugin-copy": "^3.4.0",
|
|
88
88
|
"rollup-plugin-import-css": "^3.0.3",
|
|
89
89
|
"rollup-plugin-sass": "^1.2.13",
|
|
90
|
-
"rollup-plugin-typescript2": "^0.
|
|
90
|
+
"rollup-plugin-typescript2": "^0.34.0",
|
|
91
91
|
"ts-jest": "^28.0.8",
|
|
92
92
|
"typescript": "^4.7.4"
|
|
93
93
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
title: string;
|
|
3
|
-
component: import("react").ForwardRefExoticComponent<import("./Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const Article: () => JSX.Element;
|
|
7
|
-
export declare const Link: () => JSX.Element;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ElementType, PropsWithChildren, HTMLAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
|
-
import { CSSObject } from 'styled-components';
|
|
3
|
-
import { TextColor, OtherTypographyType, AnchorTypographyType, LabelTypographyType } from './Typography.types';
|
|
4
|
-
import { BaseComponentProps } from '../../types';
|
|
5
|
-
export declare const inlineElements: ElementType[];
|
|
6
|
-
export declare function isTextColor(color: string): color is TextColor;
|
|
7
|
-
export declare const getTextColor: (color: TextColor | string) => string;
|
|
8
|
-
export declare type TypographyInteractionProps = {
|
|
9
|
-
hover?: CSSObject;
|
|
10
|
-
active?: CSSObject;
|
|
11
|
-
};
|
|
12
|
-
declare type BaseTypographyProps = PropsWithChildren<{
|
|
13
|
-
/**HTML tag som skal brukes istedenfor default definert via `typographyType`. */
|
|
14
|
-
as?: ElementType;
|
|
15
|
-
/**Spesifiserer om tekstelementet skal ha spacing definert i Elsa. Brukes hovedsakelig i artikler og lignende. **OBS!** har forskjellig virkning på ulike typografityper. `body` og `lead`-typer får margin på bunnen, `heading`-typer får margin på bunnen og padding på toppen mens `supportingStyles` får margin topp og bunn. */
|
|
16
|
-
withMargins?: boolean;
|
|
17
|
-
/**Tekstfarge fra utvalget eller custom. **OBS!** Bruk farger fra `@dds-design-tokens`. */
|
|
18
|
-
color?: TextColor | string;
|
|
19
|
-
/**Setter `bold` styling. */
|
|
20
|
-
bold?: boolean;
|
|
21
|
-
/**Setter `italic` styling. */
|
|
22
|
-
italic?: boolean;
|
|
23
|
-
/**Setter en linje under. */
|
|
24
|
-
underline?: boolean;
|
|
25
|
-
/**Støtte for å enkelt kunne endre på hover- og active-styling. Bruk `@dds-design-tokens` til farger osv. */
|
|
26
|
-
interactionProps?: TypographyInteractionProps;
|
|
27
|
-
}> & Pick<HTMLAttributes<HTMLElement>, 'style'>;
|
|
28
|
-
declare type AnchorTypographyProps = BaseComponentProps<HTMLAnchorElement, BaseTypographyProps & {
|
|
29
|
-
/**nativ `href`-prop ved `typographyType='a'`. */
|
|
30
|
-
href?: string | undefined;
|
|
31
|
-
/** Spesifiserer om lenka er ekstern ved `typographyType='a'` eller `as='a'`.*/
|
|
32
|
-
externalLink?: boolean;
|
|
33
|
-
/**nativ `target`-prop ved `typographyType='a'`. */
|
|
34
|
-
target?: string;
|
|
35
|
-
}, AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
36
|
-
declare type LabelTypographyProps = BaseComponentProps<HTMLLabelElement, BaseTypographyProps, HTMLAttributes<HTMLLabelElement>>;
|
|
37
|
-
declare type OtherTypographyProps = BaseComponentProps<HTMLElement, BaseTypographyProps, HTMLAttributes<HTMLElement>>;
|
|
38
|
-
export declare type TypographyProps = ({
|
|
39
|
-
/**Styling basert på det typografiske utvalget definert i Figma. Returnerer default HTML tag for hver type. **OBS!** Ved bruk av `'a'` er det flere tilgjengelige props, se under. */
|
|
40
|
-
typographyType?: AnchorTypographyType;
|
|
41
|
-
} & AnchorTypographyProps) | ({
|
|
42
|
-
/**Styling basert på det typografiske utvalget definert i Figma. Returnerer default HTML tag for hver type. **OBS!** Ved bruk av `'a'` er det flere tilgjengelige props, se under. */
|
|
43
|
-
typographyType?: LabelTypographyType;
|
|
44
|
-
} & LabelTypographyProps) | ({
|
|
45
|
-
/**Styling basert på det typografiske utvalget definert i Figma. Returnerer default HTML tag for hver type. **OBS!** Ved bruk av `'a'` er det flere tilgjengelige props, se under. */
|
|
46
|
-
typographyType?: OtherTypographyType;
|
|
47
|
-
} & OtherTypographyProps);
|
|
48
|
-
export declare const Typography: import("react").ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<HTMLElement>>;
|
|
49
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare type TypographyBodySansType = 'bodySans01' | 'bodySans02' | 'bodySans03' | 'bodySans04';
|
|
2
|
-
declare type TypographyBodySerifType = 'bodySerif01' | 'bodySerif02' | 'bodySerif03' | 'bodySerif04';
|
|
3
|
-
export declare type TypographyBodyType = TypographyBodySansType | TypographyBodySerifType;
|
|
4
|
-
declare type TypographyHeadingType = 'headingSans01' | 'headingSans02' | 'headingSans03' | 'headingSans04' | 'headingSans05' | 'headingSans06' | 'headingSans07' | 'headingSans08';
|
|
5
|
-
declare type TypographyLeadType = 'leadSans01' | 'leadSans02' | 'leadSans03' | 'leadSans04' | 'leadSans05';
|
|
6
|
-
declare type TypographySupportingType = 'supportingStyleInputText01' | 'supportingStyleInputText02' | 'supportingStyleInputText03' | 'supportingStyleHelperText01' | 'supportingStylePlaceholderText01' | 'supportingStyleTiny01' | 'supportingStyleTiny02';
|
|
7
|
-
export declare type AnchorTypographyType = 'a';
|
|
8
|
-
export declare type LabelTypographyType = 'supportingStyleLabel01';
|
|
9
|
-
export declare type OtherTypographyType = TypographyHeadingType | TypographyBodyType | TypographyLeadType | TypographySupportingType;
|
|
10
|
-
export declare type TypographyType = AnchorTypographyType | LabelTypographyType | OtherTypographyType;
|
|
11
|
-
export declare type TextColor = 'interactive' | 'primary' | 'danger' | 'warning' | 'success' | 'onLight' | 'onDark' | 'gray1' | 'gray2' | 'gray3' | 'gray4' | 'gray5' | 'gray6' | 'gray7' | 'gray8' | 'gray9';
|
|
12
|
-
export declare type InlineElement = 'a' | 'abbr' | 'audio' | 'b' | 'bdi' | 'bdo' | 'big' | 'br' | 'button' | 'canvas' | 'cite' | 'code' | 'data' | 'datalist' | 'del' | 'dfn' | 'em' | 'embed' | 'i' | 'iframe' | 'img' | 'input' | 'ins' | 'kbd' | 'label' | 'map' | 'mark' | 'meter' | 'noscript' | 'object' | 'output' | 'picture' | 'progress' | 'q' | 'ruby' | 's' | 'samp' | 'script' | 'select' | 'slot' | 'small' | 'span' | 'strong' | 'sub' | 'sup' | 'svg' | 'template' | 'textarea' | 'time' | 'u' | 'var' | 'video' | 'wbr';
|
|
13
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
title: string;
|
|
3
|
-
component: import("react").ForwardRefExoticComponent<import("./Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const Article: () => JSX.Element;
|
|
7
|
-
export declare const Link: () => JSX.Element;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ElementType, PropsWithChildren, HTMLAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
|
-
import { CSSObject } from 'styled-components';
|
|
3
|
-
import { TextColor, OtherTypographyType, AnchorTypographyType, LabelTypographyType } from './Typography.types';
|
|
4
|
-
import { BaseComponentProps } from '../../types';
|
|
5
|
-
export declare const inlineElements: ElementType[];
|
|
6
|
-
export declare function isTextColor(color: string): color is TextColor;
|
|
7
|
-
export declare const getTextColor: (color: TextColor | string) => string;
|
|
8
|
-
export declare type TypographyInteractionProps = {
|
|
9
|
-
hover?: CSSObject;
|
|
10
|
-
active?: CSSObject;
|
|
11
|
-
};
|
|
12
|
-
declare type BaseTypographyProps = PropsWithChildren<{
|
|
13
|
-
/**HTML tag som skal brukes istedenfor default definert via `typographyType`. */
|
|
14
|
-
as?: ElementType;
|
|
15
|
-
/**Spesifiserer om tekstelementet skal ha spacing definert i Elsa. Brukes hovedsakelig i artikler og lignende. **OBS!** har forskjellig virkning på ulike typografityper. `body` og `lead`-typer får margin på bunnen, `heading`-typer får margin på bunnen og padding på toppen mens `supportingStyles` får margin topp og bunn. */
|
|
16
|
-
withMargins?: boolean;
|
|
17
|
-
/**Tekstfarge fra utvalget eller custom. **OBS!** Bruk farger fra `@dds-design-tokens`. */
|
|
18
|
-
color?: TextColor | string;
|
|
19
|
-
/**Setter `bold` styling. */
|
|
20
|
-
bold?: boolean;
|
|
21
|
-
/**Setter `italic` styling. */
|
|
22
|
-
italic?: boolean;
|
|
23
|
-
/**Setter en linje under. */
|
|
24
|
-
underline?: boolean;
|
|
25
|
-
/**Støtte for å enkelt kunne endre på hover- og active-styling. Bruk `@dds-design-tokens` til farger osv. */
|
|
26
|
-
interactionProps?: TypographyInteractionProps;
|
|
27
|
-
}> & Pick<HTMLAttributes<HTMLElement>, 'style'>;
|
|
28
|
-
declare type AnchorTypographyProps = BaseComponentProps<HTMLAnchorElement, BaseTypographyProps & {
|
|
29
|
-
/**nativ `href`-prop ved `typographyType='a'`. */
|
|
30
|
-
href?: string | undefined;
|
|
31
|
-
/** Spesifiserer om lenka er ekstern ved `typographyType='a'` eller `as='a'`.*/
|
|
32
|
-
externalLink?: boolean;
|
|
33
|
-
/**nativ `target`-prop ved `typographyType='a'`. */
|
|
34
|
-
target?: string;
|
|
35
|
-
}, AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
36
|
-
declare type LabelTypographyProps = BaseComponentProps<HTMLLabelElement, BaseTypographyProps, HTMLAttributes<HTMLLabelElement>>;
|
|
37
|
-
declare type OtherTypographyProps = BaseComponentProps<HTMLElement, BaseTypographyProps, HTMLAttributes<HTMLElement>>;
|
|
38
|
-
export declare type TypographyProps = ({
|
|
39
|
-
/**Styling basert på det typografiske utvalget definert i Figma. Returnerer default HTML tag for hver type. **OBS!** Ved bruk av `'a'` er det flere tilgjengelige props, se under. */
|
|
40
|
-
typographyType?: AnchorTypographyType;
|
|
41
|
-
} & AnchorTypographyProps) | ({
|
|
42
|
-
/**Styling basert på det typografiske utvalget definert i Figma. Returnerer default HTML tag for hver type. **OBS!** Ved bruk av `'a'` er det flere tilgjengelige props, se under. */
|
|
43
|
-
typographyType?: LabelTypographyType;
|
|
44
|
-
} & LabelTypographyProps) | ({
|
|
45
|
-
/**Styling basert på det typografiske utvalget definert i Figma. Returnerer default HTML tag for hver type. **OBS!** Ved bruk av `'a'` er det flere tilgjengelige props, se under. */
|
|
46
|
-
typographyType?: OtherTypographyType;
|
|
47
|
-
} & OtherTypographyProps);
|
|
48
|
-
export declare const Typography: import("react").ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<HTMLElement>>;
|
|
49
|
-
export {};
|