@kth/style 0.0.12 → 0.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 +28 -22
- package/dist/cjs/components/MenuPanel.d.ts +13 -0
- package/dist/cjs/index.d.ts +1 -5
- package/dist/cjs/index.js +63 -165
- package/dist/cjs/react.d.ts +1 -0
- package/dist/cjs/react.js +7 -0
- package/dist/esm/components/MenuPanel.d.ts +13 -0
- package/dist/esm/index.d.ts +1 -5
- package/dist/esm/index.js +63 -137
- package/dist/esm/react.d.ts +1 -0
- package/dist/esm/react.js +5 -0
- package/package.json +14 -14
- package/scss/components/a11y-nav.scss +31 -0
- package/scss/components/button.scss +20 -66
- package/scss/components/header.scss +40 -0
- package/scss/components/logotype.scss +28 -0
- package/scss/components/mega-menu.scss +33 -0
- package/scss/components/menu-item.scss +40 -0
- package/scss/components/menu-panel.scss +32 -0
- package/scss/components/search.scss +54 -0
- package/scss/components/visually-hidden.scss +11 -0
- package/scss/tokens/colors.scss +60 -0
- package/scss/tokens/icons.scss +69 -0
- package/scss/tokens/spacing.scss +31 -0
- package/scss/tokens/typography.scss +35 -0
- package/scss/utils/mixins.scss +19 -0
- package/scss/utils/prose.scss +88 -76
- package/scss/utils/reset.scss +59 -247
- package/dist/cjs/components/Button.d.ts +0 -20
- package/dist/cjs/components/Radio.d.ts +0 -20
- package/dist/cjs/components/Select.d.ts +0 -36
- package/dist/cjs/components/Tabs.d.ts +0 -34
- package/dist/cjs/icons/400/ArrowBack.d.ts +0 -3
- package/dist/cjs/icons/400/Check.d.ts +0 -3
- package/dist/cjs/icons/500/ArrowForward.d.ts +0 -3
- package/dist/cjs/stories/Button.stories.d.ts +0 -14
- package/dist/cjs/stories/ContentTabs.stories.d.ts +0 -13
- package/dist/cjs/stories/FilterTabs.stories.d.ts +0 -12
- package/dist/cjs/stories/InlineIcons.stories.d.ts +0 -9
- package/dist/cjs/stories/Select.stories.d.ts +0 -14
- package/dist/esm/components/Button.d.ts +0 -20
- package/dist/esm/components/Radio.d.ts +0 -20
- package/dist/esm/components/Select.d.ts +0 -36
- package/dist/esm/components/Tabs.d.ts +0 -34
- package/dist/esm/icons/400/ArrowBack.d.ts +0 -3
- package/dist/esm/icons/400/Check.d.ts +0 -3
- package/dist/esm/icons/500/ArrowForward.d.ts +0 -3
- package/dist/esm/stories/Button.stories.d.ts +0 -14
- package/dist/esm/stories/ContentTabs.stories.d.ts +0 -13
- package/dist/esm/stories/FilterTabs.stories.d.ts +0 -12
- package/dist/esm/stories/InlineIcons.stories.d.ts +0 -9
- package/dist/esm/stories/Select.stories.d.ts +0 -14
- package/scss/components/content-tabs.scss +0 -68
- package/scss/components/filter-tabs.scss +0 -31
- package/scss/components/form.scss +0 -48
- package/scss/components/inline-icon.scss +0 -7
- package/scss/globals.scss +0 -5
- package/scss/tokens/_colors.scss +0 -20
- package/scss/tokens/_spacing.en.md +0 -40
- package/scss/tokens/_spacing.scss +0 -81
- package/scss/tokens/_typography.scss +0 -71
- package/scss/tokens/index.scss +0 -6
- package/scss/utils/sizes.scss +0 -22
package/scss/utils/prose.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../tokens" as
|
|
1
|
+
@use "../tokens/spacing.scss" as s;
|
|
2
2
|
|
|
3
3
|
/// This mixin provides CSS for webpages with lots of prose text.
|
|
4
4
|
///
|
|
@@ -6,103 +6,115 @@
|
|
|
6
6
|
/// - CSS for tags like <p>, <h1-6>, <code>, <pre>, <ul> and <li>
|
|
7
7
|
/// - CSS classes like ".lead"
|
|
8
8
|
@mixin prose {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
max-width: 60ch;
|
|
14
|
-
}
|
|
9
|
+
p {
|
|
10
|
+
margin-block: s.$space-20;
|
|
11
|
+
max-width: 60ch;
|
|
12
|
+
}
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
.lead {
|
|
15
|
+
font: var(--font-lead);
|
|
16
|
+
margin-block-start: s.$space-12;
|
|
17
|
+
margin-block-end: s.$space-16;
|
|
18
|
+
}
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
h1,
|
|
21
|
+
h2,
|
|
22
|
+
h3,
|
|
23
|
+
h4 {
|
|
24
|
+
text-wrap: balance;
|
|
25
|
+
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
h1 {
|
|
28
|
+
font: var(--font-heading-xl);
|
|
29
|
+
margin-block-start: s.$space-32;
|
|
30
|
+
margin-block-end: s.$space-16;
|
|
31
|
+
}
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
h2 {
|
|
34
|
+
font: var(--font-heading-l);
|
|
35
|
+
margin-block-start: s.$space-32;
|
|
36
|
+
margin-block-end: s.$space-16;
|
|
37
|
+
}
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
h3 {
|
|
40
|
+
font: var(--font-heading-m);
|
|
41
|
+
margin-block-start: s.$space-32;
|
|
42
|
+
margin-block-end: s.$space-8;
|
|
43
|
+
}
|
|
37
44
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
h4 {
|
|
46
|
+
font: var(--font-heading-s);
|
|
47
|
+
margin-block-start: s.$space-32;
|
|
48
|
+
margin-block-end: s.$space-4;
|
|
49
|
+
}
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
li {
|
|
52
|
+
max-width: 60ch;
|
|
53
|
+
margin-block: s.$space-8;
|
|
54
|
+
margin-inline: 0;
|
|
55
|
+
}
|
|
47
56
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
57
|
+
ol,
|
|
58
|
+
ul {
|
|
59
|
+
padding-inline-start: s.$space-32;
|
|
52
60
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
h3 + * {
|
|
56
|
-
margin-block-start: 0;
|
|
61
|
+
li {
|
|
62
|
+
padding-inline-start: s.$space-6;
|
|
57
63
|
}
|
|
64
|
+
}
|
|
58
65
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
h1 + *,
|
|
67
|
+
h2 + *,
|
|
68
|
+
h3 + * {
|
|
69
|
+
margin-block-start: 0;
|
|
70
|
+
}
|
|
64
71
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
pre {
|
|
73
|
+
margin-block: s.$space-32;
|
|
74
|
+
padding-block: s.$space-16;
|
|
75
|
+
padding-inline: s.$space-24;
|
|
76
|
+
}
|
|
68
77
|
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
table {
|
|
79
|
+
@include s.theme-dense;
|
|
80
|
+
table-layout: auto;
|
|
81
|
+
text-align: left;
|
|
82
|
+
margin-block: s.$space-32;
|
|
83
|
+
border-collapse: collapse;
|
|
84
|
+
overflow-x: auto;
|
|
85
|
+
}
|
|
71
86
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
87
|
+
thead {
|
|
88
|
+
// TODO: border
|
|
89
|
+
th {
|
|
90
|
+
font: var(--font-label-s);
|
|
91
|
+
padding-block: var(--space-inner-block);
|
|
92
|
+
padding-inline: var(--space-inner-inline);
|
|
75
93
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
94
|
+
&:first-child {
|
|
95
|
+
padding-inline-start: 0;
|
|
96
|
+
}
|
|
79
97
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
98
|
+
&:last-child {
|
|
99
|
+
padding-inline-end: 0;
|
|
83
100
|
}
|
|
84
101
|
}
|
|
102
|
+
}
|
|
85
103
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
border-bottom: 1px solid t.$color-neutral-2;
|
|
89
|
-
|
|
90
|
-
&:last-child {
|
|
91
|
-
border-bottom-width: 0;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
104
|
+
tbody {
|
|
105
|
+
// TODO: border
|
|
94
106
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
107
|
+
td {
|
|
108
|
+
vertical-align: baseline;
|
|
109
|
+
padding-block: var(--space-inner-block);
|
|
110
|
+
padding-inline: var(--space-inner-inline);
|
|
98
111
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
112
|
+
&:first-child {
|
|
113
|
+
padding-inline-start: 0;
|
|
114
|
+
}
|
|
102
115
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
116
|
+
&:last-child {
|
|
117
|
+
padding-inline-end: 0;
|
|
106
118
|
}
|
|
107
119
|
}
|
|
108
120
|
}
|
package/scss/utils/reset.scss
CHANGED
|
@@ -1,263 +1,75 @@
|
|
|
1
|
-
@use "../tokens/
|
|
1
|
+
@use "../tokens/typography";
|
|
2
|
+
@use "../tokens/spacing";
|
|
3
|
+
@use "../tokens/colors";
|
|
2
4
|
|
|
3
|
-
///
|
|
4
|
-
/// github.com/necolas/normalize.css
|
|
5
|
+
/// When true, the file generates CSS code for the entire document
|
|
5
6
|
///
|
|
6
|
-
///
|
|
7
|
-
///
|
|
8
|
-
|
|
9
|
-
@layer kth-style {
|
|
10
|
-
// HTML
|
|
11
|
-
// 1. Prevent adjustments of font size after orientation changes in iOS.
|
|
12
|
-
html {
|
|
13
|
-
line-height: t.$font-lh-base;
|
|
14
|
-
-webkit-text-size-adjust: 100%; /* 1 */
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* Sections
|
|
18
|
-
========================================================================== */
|
|
19
|
-
|
|
20
|
-
// Body
|
|
21
|
-
// 1. Remove the margin in all browsers
|
|
22
|
-
// 2. Default fonts
|
|
23
|
-
body {
|
|
24
|
-
margin: 0;
|
|
25
|
-
font-family: t.$font-family-sans;
|
|
26
|
-
font-weight: t.$font-weight-normal;
|
|
27
|
-
line-height: t.$font-lh-base;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
h1 {
|
|
31
|
-
@include t.font-h1();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
h2 {
|
|
35
|
-
@include t.font-h2();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
h3 {
|
|
39
|
-
@include t.font-h3();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
h4 {
|
|
43
|
-
@include t.font-h4();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
h5,
|
|
47
|
-
h6 {
|
|
48
|
-
@include t.font-h5();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* Grouping content
|
|
52
|
-
========================================================================== */
|
|
53
|
-
|
|
54
|
-
// 1. Add the correct box sizing in Firefox.
|
|
55
|
-
// 2. Show the overflow in Edge and IE.
|
|
56
|
-
hr {
|
|
57
|
-
box-sizing: content-box; /* 1 */
|
|
58
|
-
height: 0; /* 1 */
|
|
59
|
-
border: 0;
|
|
60
|
-
border-top: 1px t.$color-neutral-2 solid;
|
|
61
|
-
margin: t.$space-32 0;
|
|
62
|
-
overflow: visible; /* 2 */
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// 1. Correct the inheritance and scaling of font size in all browsers.
|
|
66
|
-
// 2. Correct the odd `em` font sizing in all browsers.
|
|
67
|
-
pre {
|
|
68
|
-
font-family: monospace, monospace; /* 1 */
|
|
69
|
-
font-size: 1em; /* 2 */
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
iframe {
|
|
73
|
-
border: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
img {
|
|
77
|
-
max-width: 100%;
|
|
78
|
-
height: auto;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
figure {
|
|
82
|
-
margin: t.$space-32 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
figcaption {
|
|
86
|
-
max-width: 70ch;
|
|
87
|
-
font-style: italic;
|
|
88
|
-
margin-block-start: t.$space-12;
|
|
89
|
-
font-size: 1rem;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* Text-level semantics
|
|
93
|
-
========================================================================== */
|
|
94
|
-
a {
|
|
95
|
-
// color: t.$color-blue-5;
|
|
96
|
-
text-decoration: none;
|
|
97
|
-
|
|
98
|
-
&:hover {
|
|
99
|
-
text-decoration: underline;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
104
|
-
abbr[title] {
|
|
105
|
-
text-decoration: underline; /* 2 */
|
|
106
|
-
text-decoration: underline dotted; /* 2 */
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
b,
|
|
110
|
-
strong {
|
|
111
|
-
font-weight: t.$font-weight-bold;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// 1. Correct the inheritance and scaling of font size in all browsers.
|
|
115
|
-
// 2. Correct the odd `em` font sizing in all browsers.
|
|
116
|
-
code,
|
|
117
|
-
kbd,
|
|
118
|
-
samp {
|
|
119
|
-
font-family: monospace, monospace; /* 1 */
|
|
120
|
-
font-size: 1em; /* 2 */
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
small {
|
|
124
|
-
// TODO: This is the default in normalize.css. Define the right one
|
|
125
|
-
font-size: 80%;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Prevent `sub` and `sup` elements from affecting the line height in all browsers.
|
|
129
|
-
sub,
|
|
130
|
-
sup {
|
|
131
|
-
font-size: 75%;
|
|
132
|
-
line-height: 0;
|
|
133
|
-
position: relative;
|
|
134
|
-
vertical-align: baseline;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
sub {
|
|
138
|
-
bottom: -0.25em;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
sup {
|
|
142
|
-
top: -0.5em;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/* Forms
|
|
146
|
-
========================================================================== */
|
|
147
|
-
|
|
148
|
-
// 1. Change the font styles in all browsers.
|
|
149
|
-
// 2. Remove the margin in Firefox and Safari.
|
|
150
|
-
button,
|
|
151
|
-
input,
|
|
152
|
-
optgroup,
|
|
153
|
-
select,
|
|
154
|
-
textarea {
|
|
155
|
-
font-family: inherit; /* 1 */
|
|
156
|
-
font-size: 100%; /* 1 */
|
|
157
|
-
line-height: t.$font-lh-base; /* 1 */
|
|
158
|
-
margin: 0; /* 2 */
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
162
|
-
// Remove the inheritance of text transform in Firefox.
|
|
163
|
-
button,
|
|
164
|
-
select {
|
|
165
|
-
/* 1 */
|
|
166
|
-
text-transform: none;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Correct the inability to style clickable types in iOS and Safari.
|
|
170
|
-
button,
|
|
171
|
-
[type="button"],
|
|
172
|
-
[type="reset"],
|
|
173
|
-
[type="submit"] {
|
|
174
|
-
-webkit-appearance: button;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Remove the inner border and padding in Firefox.
|
|
178
|
-
button::-moz-focus-inner,
|
|
179
|
-
[type="button"]::-moz-focus-inner,
|
|
180
|
-
[type="reset"]::-moz-focus-inner,
|
|
181
|
-
[type="submit"]::-moz-focus-inner {
|
|
182
|
-
border-style: none;
|
|
183
|
-
padding: 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Restore the focus styles unset by the previous rule.
|
|
187
|
-
button:-moz-focusring,
|
|
188
|
-
[type="button"]:-moz-focusring,
|
|
189
|
-
[type="reset"]:-moz-focusring,
|
|
190
|
-
[type="submit"]:-moz-focusring {
|
|
191
|
-
outline: 1px dotted ButtonText;
|
|
192
|
-
}
|
|
7
|
+
/// Set to `false` when importing if you want to use the mixin but don't want
|
|
8
|
+
/// to apply reset to the entire document.
|
|
9
|
+
$generate-css: true !default;
|
|
193
10
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
// 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
202
|
-
// 3. Remove the padding so developers are not caught out when they zero out
|
|
203
|
-
// `fieldset` elements in all browsers.
|
|
204
|
-
legend {
|
|
205
|
-
box-sizing: border-box; /* 1 */
|
|
206
|
-
color: inherit; /* 2 */
|
|
207
|
-
display: table; /* 1 */
|
|
208
|
-
max-width: 100%; /* 1 */
|
|
209
|
-
padding: 0; /* 3 */
|
|
210
|
-
white-space: normal; /* 1 */
|
|
211
|
-
}
|
|
11
|
+
/// Based on https://andy-bell.co.uk/a-more-modern-css-reset/
|
|
12
|
+
@mixin reset {
|
|
13
|
+
*,
|
|
14
|
+
*::before,
|
|
15
|
+
*::after {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
212
18
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
19
|
+
h1,
|
|
20
|
+
h2,
|
|
21
|
+
h3,
|
|
22
|
+
h4,
|
|
23
|
+
p,
|
|
24
|
+
figure,
|
|
25
|
+
blockquote,
|
|
26
|
+
dl,
|
|
27
|
+
dd {
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
217
30
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
31
|
+
a {
|
|
32
|
+
color: var(--color-tertiary);
|
|
33
|
+
text-underline-offset: spacing.$space-4;
|
|
34
|
+
}
|
|
223
35
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
36
|
+
img,
|
|
37
|
+
picture {
|
|
38
|
+
max-width: 100%;
|
|
39
|
+
height: auto;
|
|
40
|
+
}
|
|
230
41
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
42
|
+
input,
|
|
43
|
+
button,
|
|
44
|
+
textarea,
|
|
45
|
+
select {
|
|
46
|
+
font: inherit;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
235
49
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
-
|
|
240
|
-
|
|
50
|
+
@if $generate-css {
|
|
51
|
+
@layer kth-style {
|
|
52
|
+
html {
|
|
53
|
+
-moz-text-size-adjust: none;
|
|
54
|
+
-webkit-text-size-adjust: none;
|
|
55
|
+
text-size-adjust: none;
|
|
56
|
+
scrollbar-gutter: stable;
|
|
241
57
|
}
|
|
242
58
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
display: block;
|
|
59
|
+
:root {
|
|
60
|
+
@include colors.theme-default;
|
|
61
|
+
@include spacing.theme-default;
|
|
62
|
+
@include typography.theme-default;
|
|
248
63
|
}
|
|
249
64
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
65
|
+
body {
|
|
66
|
+
color: var(--color-text);
|
|
67
|
+
background: var(--color-background);
|
|
68
|
+
font: var(--font-default);
|
|
69
|
+
min-height: 100vh;
|
|
70
|
+
margin: 0;
|
|
253
71
|
}
|
|
254
72
|
|
|
255
|
-
|
|
256
|
-
========================================================================== */
|
|
257
|
-
|
|
258
|
-
// Add the correct display
|
|
259
|
-
[hidden] {
|
|
260
|
-
display: none;
|
|
261
|
-
}
|
|
73
|
+
@include reset;
|
|
262
74
|
}
|
|
263
75
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface ButtonProps {
|
|
3
|
-
/** The label of the button */
|
|
4
|
-
children?: string;
|
|
5
|
-
/** The callback function when the button is clicked */
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
/** Appearance */
|
|
8
|
-
appearance: "primary" | "secondary" | "tertiary";
|
|
9
|
-
}
|
|
10
|
-
interface IconButtonProps {
|
|
11
|
-
/** The label of the button */
|
|
12
|
-
children?: string;
|
|
13
|
-
/** The callback function when the button is clicked */
|
|
14
|
-
onClick?: () => void;
|
|
15
|
-
}
|
|
16
|
-
/** A button with just text */
|
|
17
|
-
export declare function Button({ children, onClick, appearance }: ButtonProps): JSX.Element;
|
|
18
|
-
export declare function BackButton({ children, onClick }: IconButtonProps): JSX.Element;
|
|
19
|
-
export declare function ForwardButton({ children, onClick }: IconButtonProps): JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface RadioGroupProps {
|
|
3
|
-
/** Options */
|
|
4
|
-
children: React.ReactElement<RadioProps> | React.ReactElement<RadioProps>[];
|
|
5
|
-
/** The value of the selected radio button */
|
|
6
|
-
value: string;
|
|
7
|
-
/** The callback function when a different choice is made by the user */
|
|
8
|
-
onChange: (value: string) => void;
|
|
9
|
-
}
|
|
10
|
-
interface RadioProps {
|
|
11
|
-
/** The value of the radio button */
|
|
12
|
-
value: string;
|
|
13
|
-
/** The label of the radio button */
|
|
14
|
-
label: string;
|
|
15
|
-
}
|
|
16
|
-
/** Implemented as fancy radio buttons */
|
|
17
|
-
export declare function FilterTabs({ children, value, onChange }: RadioGroupProps): JSX.Element;
|
|
18
|
-
/** A single radio button */
|
|
19
|
-
export declare function Radio({ value, label }: RadioProps): JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface SelectProps {
|
|
3
|
-
/** Equivalent to HTML `name` */
|
|
4
|
-
name: string;
|
|
5
|
-
/** Label for the select */
|
|
6
|
-
label: string;
|
|
7
|
-
/** Select description */
|
|
8
|
-
description?: string;
|
|
9
|
-
/** Current value of the select field */
|
|
10
|
-
value: string;
|
|
11
|
-
/** Called when the select value changes */
|
|
12
|
-
onChange(value: string): void;
|
|
13
|
-
/** Options */
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Error message if the field has errors. `undefined` here means the field
|
|
17
|
-
* contains no error.
|
|
18
|
-
*/
|
|
19
|
-
error?: string;
|
|
20
|
-
}
|
|
21
|
-
interface OptionProps {
|
|
22
|
-
/** The value for the option */
|
|
23
|
-
value: string;
|
|
24
|
-
/** Human-readable label for the option */
|
|
25
|
-
children: string;
|
|
26
|
-
/** True if the option should be disabled */
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
}
|
|
29
|
-
interface OptionGroupProps {
|
|
30
|
-
label: string;
|
|
31
|
-
children: React.ReactNode;
|
|
32
|
-
}
|
|
33
|
-
export declare function Select({ name, label, description, value, onChange, children, error, }: SelectProps): JSX.Element;
|
|
34
|
-
export declare function OptionGroup({ label, children }: OptionGroupProps): JSX.Element;
|
|
35
|
-
export declare function Option({ value, children, disabled }: OptionProps): JSX.Element;
|
|
36
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface TabProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
id: string;
|
|
5
|
-
title: string;
|
|
6
|
-
}
|
|
7
|
-
interface GenericTabsProps {
|
|
8
|
-
classPrefix: string;
|
|
9
|
-
children: React.ReactElement<TabProps>[];
|
|
10
|
-
id: string;
|
|
11
|
-
defaultValue?: string;
|
|
12
|
-
url: "query" | "hash" | "none";
|
|
13
|
-
}
|
|
14
|
-
interface NavigationTabsProps {
|
|
15
|
-
id: string;
|
|
16
|
-
children: React.ReactElement<TabProps>[];
|
|
17
|
-
url?: "query" | "none";
|
|
18
|
-
defaultValue?: string;
|
|
19
|
-
}
|
|
20
|
-
interface ContentTabsProps {
|
|
21
|
-
id: string;
|
|
22
|
-
children: React.ReactElement<TabProps>[];
|
|
23
|
-
url?: "hash" | "none";
|
|
24
|
-
defaultValue?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Highly customizable Tabs component made for testing purposes.
|
|
28
|
-
* You should use {@link NavigationTabs} or {@link ContentTabs} instead.
|
|
29
|
-
*/
|
|
30
|
-
export declare function GenericTabs({ classPrefix, children, id, defaultValue, url, }: GenericTabsProps): JSX.Element;
|
|
31
|
-
export declare function NavigationTabs({ id, children, url, defaultValue, }: NavigationTabsProps): JSX.Element;
|
|
32
|
-
export declare function ContentTabs({ id, children, url, defaultValue, }: ContentTabsProps): JSX.Element;
|
|
33
|
-
export declare function Tab({ children }: TabProps): JSX.Element;
|
|
34
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import { Button } from "../components/Button";
|
|
3
|
-
import "../../scss/globals.scss";
|
|
4
|
-
import "../../scss/components/button.scss";
|
|
5
|
-
declare const meta: {
|
|
6
|
-
title: string;
|
|
7
|
-
component: typeof Button;
|
|
8
|
-
tags: string[];
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof meta>;
|
|
12
|
-
export declare const Primary: Story;
|
|
13
|
-
export declare const Back: StoryObj;
|
|
14
|
-
export declare const Forward: StoryObj;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import { ContentTabs } from "../components/Tabs";
|
|
3
|
-
import "../../scss/globals.scss";
|
|
4
|
-
import "../../scss/components/content-tabs.scss";
|
|
5
|
-
declare const meta: {
|
|
6
|
-
title: string;
|
|
7
|
-
component: typeof ContentTabs;
|
|
8
|
-
tags: string[];
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof meta>;
|
|
12
|
-
export declare const Primary: Story;
|
|
13
|
-
export declare const Secondary: Story;
|