@funidata/fudis-core 0.0.2 → 0.0.3
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/_index.scss +29 -2
- package/package.json +3 -1
- package/src/components/alert/alert.scss +75 -0
- package/src/components/badge/badge.scss +39 -0
- package/src/components/button/button.scss +49 -15
- package/src/components/checkbox/checkbox.scss +85 -0
- package/src/components/checkbox-group/checkbox-group.scss +7 -0
- package/src/components/error-summary/error-summary.scss +47 -0
- package/src/components/fieldset/fieldset.scss +90 -0
- package/src/components/guidance/guidance.scss +80 -0
- package/src/components/horizontal-rule/horizontal-rule.scss +13 -0
- package/src/components/icon/icon.scss +238 -0
- package/src/components/label/label.scss +33 -0
- package/src/components/link/link.scss +18 -0
- package/src/components/loading-spinner/loading-spinner.scss +49 -0
- package/src/components/notification/notification.scss +49 -0
- package/src/components/popover/popover.scss +18 -0
- package/src/components/radio-button/radio-button.scss +107 -0
- package/src/components/radio-button-group/radio-button-group.scss +7 -0
- package/src/components/tab-navigation/tab-navigation.scss +99 -0
- package/src/components/text-area/text-area.scss +7 -0
- package/src/components/text-input/text-input.scss +17 -0
- package/src/components/validator-error-message/validator-error-message.scss +17 -0
- package/src/foundations/borders/mixins.scss +10 -10
- package/src/foundations/colors/mixins.scss +5 -5
- package/src/foundations/focus/mixins.scss +8 -8
- package/src/foundations/grid/mixins.scss +1 -1
- package/src/foundations/spacing/classes.scss +1 -2
- package/src/foundations/spacing/tokens.scss +3 -0
- package/src/foundations/typography/classes.scss +4 -21
- package/src/foundations/typography/mixins.scss +15 -4
- package/src/foundations/utilities/classes.scss +7 -11
- package/src/foundations/utilities/mixins.scss +0 -1
- package/src/foundations/z-index/mixins.scss +1 -1
- package/src/assets/fonts/fonts.scss +0 -33
- package/src/assets/fonts/woff/FiraSans-Light.woff2 +0 -0
- package/src/assets/fonts/woff/FiraSans-Medium.woff2 +0 -0
- package/src/assets/fonts/woff/FiraSans-Regular.woff2 +0 -0
- package/src/assets/fonts/woff/FiraSans-SemiBold.woff2 +0 -0
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/* stylelint-disable declaration-property-value-disallowed-list */
|
|
3
3
|
/* stylelint-disable property-disallowed-list */
|
|
4
4
|
@use 'sass:map';
|
|
5
|
-
@use './../colors/tokens.scss' as
|
|
5
|
+
@use './../colors/tokens.scss' as color;
|
|
6
6
|
@use './../spacing/tokens.scss' as spacing;
|
|
7
|
-
@use './tokens
|
|
7
|
+
@use './tokens';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
Generates border, i. e.:
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
*/
|
|
13
13
|
@mixin border($width, $style, $color) {
|
|
14
14
|
@if map.has-key(spacing.$pixel-tokens, $width) and
|
|
15
|
-
map.has-key(
|
|
16
|
-
map.has-key(
|
|
15
|
+
map.has-key(tokens.$border-styles, $style) and
|
|
16
|
+
map.has-key(color.$colors, $color)
|
|
17
17
|
{
|
|
18
18
|
border: map.get(spacing.$pixel-tokens, $width)
|
|
19
|
-
map.get(
|
|
20
|
-
map.get(
|
|
19
|
+
map.get(tokens.$border-styles, $style)
|
|
20
|
+
map.get(color.$colors, $color);
|
|
21
21
|
} @else {
|
|
22
22
|
@error 'Unknown border parameter. Please check foundations/borders/mixins.scss for accepted arguments.';
|
|
23
23
|
}
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
*/
|
|
29
29
|
@mixin outline($width, $style, $color) {
|
|
30
30
|
@if map.has-key(spacing.$pixel-tokens, $width) and
|
|
31
|
-
map.has-key(
|
|
32
|
-
map.has-key(
|
|
31
|
+
map.has-key(tokens.$border-styles, $style) and
|
|
32
|
+
map.has-key(color.$colors, $color)
|
|
33
33
|
{
|
|
34
34
|
outline: map.get(spacing.$pixel-tokens, $width)
|
|
35
|
-
map.get(
|
|
36
|
-
map.get(
|
|
35
|
+
map.get(tokens.$border-styles, $style)
|
|
36
|
+
map.get(color.$colors, $color);
|
|
37
37
|
outline-offset: -(map.get(spacing.$pixel-tokens, $width));
|
|
38
38
|
} @else {
|
|
39
39
|
@error 'Unknown border parameter. Please check foundations/borders/mixins.scss for accepted arguments.';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use './tokens'
|
|
2
|
+
@use './tokens';
|
|
3
3
|
|
|
4
4
|
@mixin text-color($color) {
|
|
5
|
-
@if map.has-key(
|
|
5
|
+
@if map.has-key(tokens.$colors, $color) {
|
|
6
6
|
/* stylelint-disable-next-line property-disallowed-list */
|
|
7
|
-
color: map.get(
|
|
7
|
+
color: map.get(tokens.$colors, $color);
|
|
8
8
|
} @else {
|
|
9
9
|
@error 'Unknown palette color of #{$color}. Check colors/tokens.scss file for accepted arguments.';
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
@mixin bg-color($color) {
|
|
14
|
-
@if map.has-key(
|
|
14
|
+
@if map.has-key(tokens.$colors, $color) {
|
|
15
15
|
/* stylelint-disable-next-line property-disallowed-list */
|
|
16
|
-
background-color: map.get(
|
|
16
|
+
background-color: map.get(tokens.$colors, $color);
|
|
17
17
|
} @else {
|
|
18
18
|
@error 'Unknown palette background color of #{$color}. Check colors/tokens.scss file for accepted arguments.';
|
|
19
19
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/* stylelint-disable property-disallowed-list */
|
|
2
2
|
@use './../spacing/tokens.scss' as spacing;
|
|
3
|
-
@use './../borders/mixins.scss' as
|
|
4
|
-
@use './../colors/tokens' as
|
|
5
|
-
@use './tokens'
|
|
3
|
+
@use './../borders/mixins.scss' as border;
|
|
4
|
+
@use './../colors/tokens' as color;
|
|
5
|
+
@use './tokens';
|
|
6
6
|
|
|
7
7
|
@mixin focus-generic {
|
|
8
8
|
outline: tokens.$focus-generic-outline;
|
|
9
9
|
outline-offset: spacing.$pixel-1;
|
|
10
|
-
box-shadow: 0 0 0 spacing.$spacing-xxs
|
|
10
|
+
box-shadow: 0 0 0 spacing.$spacing-xxs color.$color-white;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
@mixin focus-form-field {
|
|
14
|
-
@include
|
|
14
|
+
@include border.border('1px', 'solid', 'focus-primary');
|
|
15
15
|
|
|
16
16
|
outline: tokens.$focus-form-field-outline;
|
|
17
17
|
outline-offset: -(spacing.$pixel-2);
|
|
18
|
-
box-shadow: 0 0 0 spacing.$pixel-1
|
|
18
|
+
box-shadow: 0 0 0 spacing.$pixel-1 color.$color-white;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
@mixin focus-checkbox {
|
|
22
|
-
@include
|
|
22
|
+
@include border.outline('2px', 'solid', 'primary');
|
|
23
23
|
|
|
24
24
|
outline-offset: -(spacing.$pixel-1);
|
|
25
25
|
width: spacing.$checkbox-size;
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
@mixin focus-dropdown {
|
|
30
30
|
outline: tokens.$focus-generic-outline;
|
|
31
31
|
outline-offset: -(spacing.$pixel-2);
|
|
32
|
-
box-shadow: 0 0 0 spacing.$spacing-xxs
|
|
32
|
+
box-shadow: 0 0 0 spacing.$spacing-xxs color.$color-white;
|
|
33
33
|
}
|
|
@@ -29,3 +29,6 @@ $input-width-lg: calc(23rem / var(--fudis-rem-multiplier));
|
|
|
29
29
|
|
|
30
30
|
// Fixed size for checkboxes' visual input box. Clickable input area should be 2rem high.
|
|
31
31
|
$checkbox-size: calc(1.25rem / var(--fudis-rem-multiplier));
|
|
32
|
+
|
|
33
|
+
// Fixed height for tab navigation scroll view buttons
|
|
34
|
+
$tab-navigation-button-height: calc(3rem / var(--fudis-rem-multiplier));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
@use './mixins.scss' as typography;
|
|
2
|
-
@use './../colors/mixins.scss' as
|
|
2
|
+
@use './../colors/mixins.scss' as colorMixin;
|
|
3
3
|
@use './../focus/mixins.scss' as focus;
|
|
4
4
|
@use './../utilities/mixins.scss' as utilities;
|
|
5
5
|
|
|
6
6
|
.fudis-heading {
|
|
7
|
-
@include
|
|
7
|
+
@include colorMixin.text-color('gray-dark');
|
|
8
8
|
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
margin-top: 0;
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
.fudis-body-text {
|
|
63
63
|
@include utilities.box-reset;
|
|
64
|
-
@include
|
|
64
|
+
@include colorMixin.text-color('gray-dark');
|
|
65
65
|
|
|
66
66
|
&__sm-regular {
|
|
67
67
|
@include typography.body-text-sm-regular;
|
|
@@ -96,27 +96,10 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.fudis-link {
|
|
100
|
-
&__size {
|
|
101
|
-
&__inherit {
|
|
102
|
-
@include typography.link-inherit;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&__md {
|
|
106
|
-
@include typography.link-md;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
&__lg {
|
|
110
|
-
@include typography.link-lg;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
99
|
.fudis-text-emptystate {
|
|
116
100
|
@include typography.text-emptystate;
|
|
117
101
|
}
|
|
118
102
|
|
|
119
103
|
.fudis-table-caption {
|
|
120
|
-
@include typography.table-caption
|
|
104
|
+
@include typography.table-caption;
|
|
121
105
|
}
|
|
122
|
-
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
@use 'sass:map';
|
|
4
4
|
@use './../breakpoints/mixins.scss' as breakpoints;
|
|
5
5
|
@use './../spacing/tokens.scss' as spacing;
|
|
6
|
-
@use './../colors/mixins.scss' as
|
|
6
|
+
@use './../colors/mixins.scss' as colorMixin;
|
|
7
7
|
@use './../focus/mixins.scss' as focus;
|
|
8
|
-
@use './tokens
|
|
8
|
+
@use './tokens';
|
|
9
9
|
|
|
10
10
|
// Body Text
|
|
11
11
|
|
|
@@ -130,6 +130,8 @@
|
|
|
130
130
|
// Table caption
|
|
131
131
|
|
|
132
132
|
@mixin table-caption {
|
|
133
|
+
@include colorMixin.text-color('gray-dark');
|
|
134
|
+
|
|
133
135
|
text-transform: uppercase;
|
|
134
136
|
line-height: tokens.$text-input-line-height;
|
|
135
137
|
font-family: tokens.$font-family;
|
|
@@ -241,7 +243,7 @@
|
|
|
241
243
|
// Link component
|
|
242
244
|
|
|
243
245
|
@mixin text-link {
|
|
244
|
-
@include
|
|
246
|
+
@include colorMixin.text-color('primary-dark');
|
|
245
247
|
|
|
246
248
|
display: inline-block;
|
|
247
249
|
position: relative;
|
|
@@ -275,10 +277,19 @@
|
|
|
275
277
|
font-weight: inherit;
|
|
276
278
|
}
|
|
277
279
|
|
|
280
|
+
// Tab component
|
|
281
|
+
|
|
282
|
+
@mixin tab-text {
|
|
283
|
+
font-family: tokens.$font-family;
|
|
284
|
+
font-size: tokens.$body-text-md-font-size;
|
|
285
|
+
font-weight: tokens.$font-weight-medium;
|
|
286
|
+
text-wrap: nowrap;
|
|
287
|
+
}
|
|
288
|
+
|
|
278
289
|
// Empty state
|
|
279
290
|
|
|
280
291
|
@mixin text-emptystate {
|
|
281
|
-
@include
|
|
292
|
+
@include colorMixin.text-color('gray-middle');
|
|
282
293
|
|
|
283
294
|
font-family: tokens.$font-family;
|
|
284
295
|
font-size: tokens.$body-text-md-font-size;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@use './mixins
|
|
1
|
+
@use './mixins';
|
|
2
2
|
@use './../spacing/tokens.scss' as spacing;
|
|
3
3
|
@use './../borders/mixins.scss' as border;
|
|
4
|
-
@use './../colors/mixins.scss' as
|
|
4
|
+
@use './../colors/mixins.scss' as colorMixin;
|
|
5
5
|
|
|
6
6
|
.fudis-visually-hidden {
|
|
7
7
|
@include mixins.visually-hidden;
|
|
@@ -15,19 +15,15 @@
|
|
|
15
15
|
|
|
16
16
|
.fudis-form-input {
|
|
17
17
|
@include border.border('1px', 'solid', 'gray-middle');
|
|
18
|
-
@include
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
&--touched {
|
|
23
|
-
&[aria-invalid='true'] {
|
|
24
|
-
@include border.border('1px', 'solid', 'red');
|
|
25
|
-
}
|
|
18
|
+
@include colorMixin.bg-color('white');
|
|
19
|
+
|
|
20
|
+
&[aria-invalid='true'] {
|
|
21
|
+
@include border.border('1px', 'solid', 'red');
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
&[aria-disabled='true'] {
|
|
29
25
|
@include border.border('1px', 'dashed', 'gray-middle');
|
|
30
|
-
@include
|
|
26
|
+
@include colorMixin.bg-color('gray-extra-light');
|
|
31
27
|
|
|
32
28
|
cursor: default;
|
|
33
29
|
pointer-events: none;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* stylelint-disable property-disallowed-list */
|
|
2
2
|
/* stylelint-disable unit-disallowed-list */
|
|
3
3
|
@use './../spacing/tokens.scss' as spacing;
|
|
4
|
-
@use './../colors/tokens.scss' as colors;
|
|
5
4
|
@use './../typography/mixins.scss' as typography;
|
|
6
5
|
@use './../borders/mixins.scss' as borders;
|
|
7
6
|
@use './../focus/mixins.scss' as focus;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* stylelint-disable property-disallowed-list */
|
|
2
|
-
|
|
3
|
-
// Light, 300
|
|
4
|
-
@font-face {
|
|
5
|
-
font-family: 'Fira Sans';
|
|
6
|
-
src: url('./woff/FiraSans-Light.woff2');
|
|
7
|
-
font-weight: 300;
|
|
8
|
-
font-style: normal;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Regular, 400
|
|
12
|
-
@font-face {
|
|
13
|
-
font-family: 'Fira Sans';
|
|
14
|
-
src: url('./woff/FiraSans-Regular.woff2');
|
|
15
|
-
font-weight: 400;
|
|
16
|
-
font-style: normal;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Medium, 500
|
|
20
|
-
@font-face {
|
|
21
|
-
font-family: 'Fira Sans';
|
|
22
|
-
src: url('./woff/FiraSans-Medium.woff2');
|
|
23
|
-
font-weight: 500;
|
|
24
|
-
font-style: normal;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Semibold, 600
|
|
28
|
-
@font-face {
|
|
29
|
-
font-family: 'Fira Sans';
|
|
30
|
-
src: url('./woff/FiraSans-SemiBold.woff2');
|
|
31
|
-
font-weight: 600;
|
|
32
|
-
font-style: normal;
|
|
33
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|