@norges-domstoler/dds-components 0.0.2 → 0.0.6

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.
Files changed (89) hide show
  1. package/README.md +61 -15
  2. package/dist/components/Breadcrumbs/Breadcrumb.d.ts +4 -0
  3. package/dist/components/Breadcrumbs/Breadcrumb.tokens.d.ts +7 -0
  4. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +7 -0
  5. package/dist/components/Breadcrumbs/index.d.ts +2 -0
  6. package/dist/components/Button/Button.d.ts +35 -0
  7. package/dist/components/Button/Button.tokens.d.ts +192 -0
  8. package/dist/components/Button/index.d.ts +1 -0
  9. package/dist/components/Checkbox/Checkbox.d.ts +6 -2
  10. package/dist/components/Checkbox/Checkbox.tokens.d.ts +66 -0
  11. package/dist/components/Checkbox/CheckboxGroup.d.ts +14 -0
  12. package/dist/components/Checkbox/CheckboxGroup.tokens.d.ts +5 -0
  13. package/dist/components/Checkbox/index.d.ts +1 -0
  14. package/dist/components/CheckboxTest/CheckboxTest.d.ts +15 -0
  15. package/dist/components/{Checkbox/checkboxTokens.d.ts → CheckboxTest/checkboxTestTokens.d.ts} +0 -0
  16. package/dist/components/CheckboxTest/index.d.ts +1 -0
  17. package/dist/components/DescriptionList/DescriptionList.d.ts +8 -0
  18. package/dist/components/DescriptionList/DescriptionListDesc.d.ts +9 -0
  19. package/dist/components/DescriptionList/DescriptionListDesc.tokens.d.ts +7 -0
  20. package/dist/components/DescriptionList/DescriptionListGroup.d.ts +8 -0
  21. package/dist/components/DescriptionList/DescriptionListGroup.tokens.d.ts +4 -0
  22. package/dist/components/DescriptionList/DescriptionListTerm.d.ts +3 -0
  23. package/dist/components/DescriptionList/DescriptionListTerm.tokens.d.ts +13 -0
  24. package/dist/components/DescriptionList/index.d.ts +4 -0
  25. package/dist/components/Divider/Divider.d.ts +8 -0
  26. package/dist/components/Divider/Divider.tokens.d.ts +8 -0
  27. package/dist/components/Divider/index.d.ts +1 -0
  28. package/dist/components/GlobalMessage/GlobalMessage.d.ts +12 -0
  29. package/dist/components/GlobalMessage/GlobalMessage.tokens.d.ts +47 -0
  30. package/dist/components/GlobalMessage/index.d.ts +1 -0
  31. package/dist/components/List/List.d.ts +12 -0
  32. package/dist/components/List/List.tokens.d.ts +16 -0
  33. package/dist/components/List/ListItem.d.ts +3 -0
  34. package/dist/components/List/ListItem.tokens.d.ts +5 -0
  35. package/dist/components/List/index.d.ts +2 -0
  36. package/dist/components/LocalMessage/LocalMessage.d.ts +18 -0
  37. package/dist/components/LocalMessage/LocalMessage.tokens.d.ts +87 -0
  38. package/dist/components/LocalMessage/index.d.ts +1 -0
  39. package/dist/components/Pagination/Pagination.d.ts +29 -0
  40. package/dist/components/Pagination/Pagination.tokens.d.ts +15 -0
  41. package/dist/components/Pagination/index.d.ts +1 -0
  42. package/dist/components/Pagination/paginationGenerator.d.ts +1 -0
  43. package/dist/components/RadioButton/RadioButton.d.ts +15 -0
  44. package/dist/components/RadioButton/RadioButton.tokens.d.ts +44 -0
  45. package/dist/components/RadioButton/RadioButtonGroup.d.ts +20 -0
  46. package/dist/components/RadioButton/RadioButtonGroup.tokens.d.ts +5 -0
  47. package/dist/components/RadioButton/RadioButtonGroupContext.d.ts +12 -0
  48. package/dist/components/RadioButton/index.d.ts +2 -0
  49. package/dist/components/Search/Search.d.ts +21 -0
  50. package/dist/components/Search/Search.tokens.d.ts +23 -0
  51. package/dist/components/Search/index.d.ts +1 -0
  52. package/dist/components/Select/Select.d.ts +15 -0
  53. package/dist/components/Select/Select.tokens.d.ts +86 -0
  54. package/dist/components/Select/index.d.ts +1 -0
  55. package/dist/components/Spinner/Spinner.d.ts +7 -0
  56. package/dist/components/Spinner/Spinner.tokens.d.ts +6 -0
  57. package/dist/components/Spinner/index.d.ts +1 -0
  58. package/dist/components/Table/Body.d.ts +3 -0
  59. package/dist/components/Table/Cell.d.ts +8 -0
  60. package/dist/components/Table/Cell.tokens.d.ts +28 -0
  61. package/dist/components/Table/Foot.d.ts +3 -0
  62. package/dist/components/Table/Head.d.ts +3 -0
  63. package/dist/components/Table/Row.d.ts +15 -0
  64. package/dist/components/Table/Row.tokens.d.ts +29 -0
  65. package/dist/components/Table/SortCell.d.ts +10 -0
  66. package/dist/components/Table/Table.d.ts +10 -0
  67. package/dist/components/Table/index.d.ts +7 -0
  68. package/dist/components/Table/tableData.d.ts +17 -0
  69. package/dist/components/TextInput/CharCounter.d.ts +6 -0
  70. package/dist/components/TextInput/CharCounter.tokens.d.ts +4 -0
  71. package/dist/components/TextInput/TextInput.d.ts +20 -0
  72. package/dist/components/TextInput/TextInput.tokens.d.ts +100 -0
  73. package/dist/components/TextInput/index.d.ts +1 -0
  74. package/dist/components/Typography/Typography.d.ts +23 -0
  75. package/dist/components/Typography/Typography.tokens.d.ts +224 -0
  76. package/dist/components/Typography/Typography.types.d.ts +7 -0
  77. package/dist/components/Typography/index.d.ts +2 -0
  78. package/dist/helpers/IconWrapper/IconWrapper.d.ts +13 -0
  79. package/dist/helpers/IconWrapper/index.d.ts +1 -0
  80. package/dist/helpers/InputMessage/InputMessage.d.ts +9 -0
  81. package/dist/helpers/InputMessage/InputMessage.tokens.d.ts +15 -0
  82. package/dist/helpers/RequiredMarker.d.ts +2 -0
  83. package/dist/helpers/functions.d.ts +2 -0
  84. package/dist/helpers/inputFieldStylingBase.d.ts +1 -0
  85. package/dist/helpers/scrollbarStyling.d.ts +2 -0
  86. package/dist/index.d.ts +17 -0
  87. package/dist/index.es.js +28429 -236
  88. package/dist/index.js +28488 -242
  89. package/package.json +102 -89
@@ -0,0 +1,100 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const inputTokens: {
3
+ general: {
4
+ input: {
5
+ borderRadius: string;
6
+ borderWidth: string;
7
+ borderColor: string;
8
+ textColor: string;
9
+ font: {
10
+ lineHeight: any;
11
+ fontSize: string;
12
+ letterSpacing: any;
13
+ fontFamily: any;
14
+ fontWeight: any;
15
+ fontStyle: any;
16
+ };
17
+ hover: {
18
+ backgroundColor: string;
19
+ borderColor: string;
20
+ borderWidth: string;
21
+ };
22
+ focus: {
23
+ borderColor: string;
24
+ borderWidth: string;
25
+ };
26
+ };
27
+ label: {
28
+ hover: {
29
+ textColor: string;
30
+ };
31
+ focus: {
32
+ textColor: string;
33
+ };
34
+ };
35
+ };
36
+ base: CSSObject;
37
+ focusColor: string;
38
+ withLabel: {
39
+ base: CSSObject;
40
+ };
41
+ noLabel: {
42
+ base: CSSObject;
43
+ };
44
+ readOnly: {
45
+ base: CSSObject;
46
+ };
47
+ disabled: {
48
+ base: CSSObject;
49
+ };
50
+ multiline: {
51
+ base: CSSObject;
52
+ withLabel: {
53
+ base: CSSObject;
54
+ };
55
+ noLabel: {
56
+ base: CSSObject;
57
+ };
58
+ };
59
+ error: {
60
+ base: CSSObject;
61
+ hover: {
62
+ base: CSSObject;
63
+ };
64
+ focus: {
65
+ base: CSSObject;
66
+ };
67
+ };
68
+ label: {
69
+ base: CSSObject;
70
+ multiline: {
71
+ base: {
72
+ backgroundColor: string;
73
+ padding: string;
74
+ };
75
+ };
76
+ hover: {
77
+ base: {
78
+ color: string;
79
+ };
80
+ };
81
+ focus: {
82
+ base: {
83
+ color: string;
84
+ };
85
+ };
86
+ };
87
+ wrapper: {
88
+ defaultWidth: string;
89
+ };
90
+ container: {
91
+ multiline: {
92
+ withLabel: {
93
+ height: string;
94
+ };
95
+ noLabel: {
96
+ height: string;
97
+ };
98
+ };
99
+ };
100
+ };
@@ -0,0 +1 @@
1
+ export * from './TextInput';
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes, ElementType, AnchorHTMLAttributes, LabelHTMLAttributes } from 'react';
2
+ import { CSSObject } from 'styled-components';
3
+ import { TypographyType } from './Typography.types';
4
+ export declare function isTextColor(color: string): color is TextColor;
5
+ export declare const getTextColor: (color: TextColor | string) => string;
6
+ export declare type TextColor = 'interactive' | 'primary' | 'danger' | 'warning' | 'success' | 'onLight' | 'onDark' | 'gray1' | 'gray2' | 'gray3' | 'gray4' | 'gray5' | 'gray6' | 'gray7' | 'gray8' | 'gray9';
7
+ export declare type TypographyInteractionProps = {
8
+ hover?: CSSObject;
9
+ active?: CSSObject;
10
+ };
11
+ export declare type TypographyProps = {
12
+ typographyType?: TypographyType;
13
+ as?: ElementType;
14
+ externalLink?: boolean;
15
+ color?: TextColor | string;
16
+ bold?: boolean;
17
+ italic?: boolean;
18
+ underline?: boolean;
19
+ withMargins?: boolean;
20
+ interactionProps?: TypographyInteractionProps;
21
+ target?: string;
22
+ } & (HTMLAttributes<HTMLElement> | LabelHTMLAttributes<HTMLLabelElement> | AnchorHTMLAttributes<HTMLAnchorElement>);
23
+ export declare const Typography: import("react").ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,224 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const textColors: {
3
+ interactive: string;
4
+ primary: string;
5
+ danger: string;
6
+ success: string;
7
+ warning: string;
8
+ onLight: string;
9
+ onDark: string;
10
+ gray1: string;
11
+ gray2: string;
12
+ gray3: string;
13
+ gray4: string;
14
+ gray5: string;
15
+ gray6: string;
16
+ gray7: string;
17
+ gray8: string;
18
+ gray9: string;
19
+ };
20
+ export declare const textColorsArray: string[];
21
+ export declare const typographyTokens: {
22
+ selection: {
23
+ base: CSSObject;
24
+ };
25
+ typographyType: {
26
+ a: {
27
+ base: CSSObject;
28
+ hover: {
29
+ base: CSSObject;
30
+ };
31
+ margins: {
32
+ base: CSSObject;
33
+ };
34
+ focus: {
35
+ base: CSSObject;
36
+ };
37
+ bold: {
38
+ base: CSSObject;
39
+ };
40
+ icon: {
41
+ marginLeft: string;
42
+ };
43
+ };
44
+ headingSans01: {
45
+ base: CSSObject;
46
+ margins: {
47
+ base: CSSObject;
48
+ };
49
+ };
50
+ headingSans02: {
51
+ base: CSSObject;
52
+ margins: {
53
+ base: CSSObject;
54
+ };
55
+ };
56
+ headingSans03: {
57
+ base: CSSObject;
58
+ margins: {
59
+ base: CSSObject;
60
+ };
61
+ };
62
+ headingSans04: {
63
+ base: CSSObject;
64
+ margins: {
65
+ base: CSSObject;
66
+ };
67
+ };
68
+ headingSans05: {
69
+ base: CSSObject;
70
+ margins: {
71
+ base: CSSObject;
72
+ };
73
+ };
74
+ headingSans06: {
75
+ base: CSSObject;
76
+ margins: {
77
+ base: CSSObject;
78
+ };
79
+ };
80
+ headingSans07: {
81
+ base: CSSObject;
82
+ margins: {
83
+ base: CSSObject;
84
+ };
85
+ };
86
+ headingSans08: {
87
+ base: CSSObject;
88
+ margins: {
89
+ base: CSSObject;
90
+ };
91
+ };
92
+ bodySans01: {
93
+ base: CSSObject;
94
+ margins: {
95
+ base: CSSObject;
96
+ };
97
+ };
98
+ bodySans02: {
99
+ base: CSSObject;
100
+ margins: {
101
+ base: CSSObject;
102
+ };
103
+ };
104
+ bodySans03: {
105
+ base: CSSObject;
106
+ margins: {
107
+ base: CSSObject;
108
+ };
109
+ };
110
+ bodySans04: {
111
+ base: CSSObject;
112
+ margins: {
113
+ base: CSSObject;
114
+ };
115
+ };
116
+ bodySerif01: {
117
+ base: CSSObject;
118
+ margins: {
119
+ base: CSSObject;
120
+ };
121
+ };
122
+ bodySerif02: {
123
+ base: CSSObject;
124
+ margins: {
125
+ base: CSSObject;
126
+ };
127
+ };
128
+ bodySerif03: {
129
+ base: CSSObject;
130
+ margins: {
131
+ base: CSSObject;
132
+ };
133
+ };
134
+ bodySerif04: {
135
+ base: CSSObject;
136
+ margins: {
137
+ base: CSSObject;
138
+ };
139
+ };
140
+ leadSans01: {
141
+ base: CSSObject;
142
+ margins: {
143
+ base: CSSObject;
144
+ };
145
+ };
146
+ leadSans02: {
147
+ base: CSSObject;
148
+ margins: {
149
+ base: CSSObject;
150
+ };
151
+ };
152
+ leadSans03: {
153
+ base: CSSObject;
154
+ margins: {
155
+ base: CSSObject;
156
+ };
157
+ };
158
+ leadSans04: {
159
+ base: CSSObject;
160
+ margins: {
161
+ base: CSSObject;
162
+ };
163
+ };
164
+ leadSans05: {
165
+ base: CSSObject;
166
+ margins: {
167
+ base: CSSObject;
168
+ };
169
+ };
170
+ supportingStyleLabel01: {
171
+ base: CSSObject;
172
+ margins: {
173
+ base: CSSObject;
174
+ };
175
+ };
176
+ supportingStyleHelperText01: {
177
+ base: CSSObject;
178
+ margins: {
179
+ base: CSSObject;
180
+ };
181
+ };
182
+ supportingStyleInputText01: {
183
+ base: CSSObject;
184
+ margins: {
185
+ base: CSSObject;
186
+ };
187
+ };
188
+ supportingStyleInputText02: {
189
+ base: CSSObject;
190
+ margins: {
191
+ base: CSSObject;
192
+ };
193
+ };
194
+ supportingStyleInputText03: {
195
+ base: CSSObject;
196
+ margins: {
197
+ base: CSSObject;
198
+ };
199
+ };
200
+ supportingStylePlaceholderText01: {
201
+ base: CSSObject;
202
+ margins: {
203
+ base: CSSObject;
204
+ };
205
+ };
206
+ supportingStyleTiny01: {
207
+ base: CSSObject;
208
+ margins: {
209
+ base: CSSObject;
210
+ };
211
+ };
212
+ };
213
+ style: {
214
+ bold: {
215
+ base: CSSObject;
216
+ };
217
+ italic: {
218
+ base: CSSObject;
219
+ };
220
+ underline: {
221
+ base: CSSObject;
222
+ };
223
+ };
224
+ };
@@ -0,0 +1,7 @@
1
+ export declare type TypographyBodySansType = 'bodySans01' | 'bodySans02' | 'bodySans03' | 'bodySans04';
2
+ export declare type TypographyBodySerifType = 'bodySerif01' | 'bodySerif02' | 'bodySerif03' | 'bodySerif04';
3
+ export declare type TypographyBodyType = TypographyBodySansType | TypographyBodySerifType;
4
+ export declare type TypographyHeadingType = 'headingSans01' | 'headingSans02' | 'headingSans03' | 'headingSans04' | 'headingSans05' | 'headingSans06' | 'headingSans07' | 'headingSans08';
5
+ export declare type TypographyLeadType = 'leadSans01' | 'leadSans02' | 'leadSans03' | 'leadSans04' | 'leadSans05';
6
+ export declare type TypographySupportingType = 'supportingStyleLabel01' | 'supportingStyleInputText01' | 'supportingStyleInputText02' | 'supportingStyleInputText03' | 'supportingStyleHelperText01' | 'supportingStylePlaceholderText01' | 'supportingStyleTiny01';
7
+ export declare type TypographyType = 'a' | TypographyHeadingType | TypographyBodyType | TypographyLeadType | TypographySupportingType;
@@ -0,0 +1,2 @@
1
+ export * from './Typography';
2
+ export * from './Typography.types';
@@ -0,0 +1,13 @@
1
+ import { SvgIconTypeMap } from '@material-ui/core/SvgIcon';
2
+ import { OverridableComponent } from '@material-ui/core/OverridableComponent';
3
+ import { CSSProperties } from 'react';
4
+ import * as CSS from 'csstype';
5
+ export declare type IconSize = 'small' | 'medium' | 'large' | 'inline';
6
+ export declare type IconWrapperProps = {
7
+ Icon: OverridableComponent<SvgIconTypeMap<{}, 'svg'>>;
8
+ iconSize?: IconSize;
9
+ color?: CSS.ColorProperty;
10
+ className?: string;
11
+ style?: CSSProperties;
12
+ };
13
+ export declare function IconWrapper({ Icon, iconSize, color, className, style }: IconWrapperProps): JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './IconWrapper';
@@ -0,0 +1,9 @@
1
+ import * as CSS from 'csstype';
2
+ declare type MessageType = 'error' | 'tip';
3
+ declare type Props = {
4
+ message: string;
5
+ messageType: MessageType;
6
+ maxWidth?: CSS.MaxWidthProperty<string>;
7
+ };
8
+ declare function InputMessage({ message, messageType, maxWidth }: Props): JSX.Element;
9
+ export default InputMessage;
@@ -0,0 +1,15 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const inputMessageTokens: {
3
+ padding: string;
4
+ base: CSSObject;
5
+ defaultMaxWidth: string;
6
+ tip: {
7
+ base: CSSObject;
8
+ };
9
+ error: {
10
+ base: CSSObject;
11
+ };
12
+ icon: {
13
+ spaceRight: string;
14
+ };
15
+ };
@@ -0,0 +1,2 @@
1
+ declare function RequiredMarker(): JSX.Element;
2
+ export default RequiredMarker;
@@ -0,0 +1,2 @@
1
+ export declare const calculateHeightWithLineHeight: (lineHeight: number, fontSize: number) => number;
2
+ export declare const firstLetterToUpperCase: (text: string) => string;
@@ -0,0 +1 @@
1
+ export declare const inputFieldStylingBase: () => import("styled-components").FlattenSimpleInterpolation;
@@ -0,0 +1,2 @@
1
+ declare const scrollbarStyling: import("styled-components").FlattenSimpleInterpolation;
2
+ export default scrollbarStyling;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,19 @@
1
1
  export * from './components/Radio';
2
+ export * from './components/RadioButton';
3
+ export * from './components/CheckboxTest';
2
4
  export * from './components/Checkbox';
5
+ export * from './components/Button';
6
+ export * from './components/TextInput';
7
+ export * from './components/Select';
8
+ export * from './components/GlobalMessage';
9
+ export * from './components/LocalMessage';
10
+ export * from './components/Search';
11
+ export * from './components/Typography';
12
+ export * from './components/Table';
13
+ export * from './components/Breadcrumbs';
14
+ export * from './helpers/IconWrapper';
15
+ export * from './components/Pagination';
16
+ export * from './components/Divider';
17
+ export * from './components/List';
18
+ export * from './components/DescriptionList';
19
+ export * from './components/Spinner';