@apolitical/component-library 0.0.4-beta.6 → 1.1.0-beta.1
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/accessibility/hidden-from-screen-readers/hidden-from-screen-readers.d.ts +19 -0
- package/accessibility/hidden-from-screen-readers/index.d.ts +1 -0
- package/accessibility/index.d.ts +2 -0
- package/accessibility/visually-hidden/index.d.ts +1 -0
- package/accessibility/visually-hidden/visually-hidden.d.ts +21 -0
- package/banners/banner-section/banner-section.d.ts +33 -0
- package/banners/banner-section/index.d.ts +1 -0
- package/banners/index.d.ts +2 -0
- package/banners/marketing-block/index.d.ts +1 -0
- package/banners/marketing-block/marketing-block.d.ts +17 -0
- package/constants/assets.d.ts +1 -0
- package/constants/index.d.ts +2 -0
- package/constants/number-of-users.d.ts +1 -0
- package/context/index.d.ts +1 -0
- package/context/user/index.d.ts +3 -0
- package/context/user/user.context.d.ts +14 -0
- package/context/user/user.provider.d.ts +8 -0
- package/fonts/Moderat-Black-Italic.woff2 +0 -0
- package/fonts/Moderat-Black.woff2 +0 -0
- package/fonts/Moderat-Bold-Italic.woff2 +0 -0
- package/fonts/Moderat-Bold.woff2 +0 -0
- package/fonts/Moderat-Medium-Italic.woff2 +0 -0
- package/fonts/Moderat-Medium.woff2 +0 -0
- package/form/components/email-helper-text-box/email-helper-text-box.d.ts +14 -0
- package/form/components/email-helper-text-box/index.d.ts +1 -0
- package/form/components/index.d.ts +3 -0
- package/form/components/password-rules/index.d.ts +1 -0
- package/form/components/password-rules/password-rules.d.ts +16 -0
- package/form/components/rating/index.d.ts +1 -0
- package/form/components/rating/rating.d.ts +31 -0
- package/form/index.d.ts +2 -0
- package/form/types/index.d.ts +1 -0
- package/form/types/search-form/index.d.ts +1 -0
- package/form/types/search-form/search-form.d.ts +21 -0
- package/general/button/button.d.ts +52 -0
- package/general/button/index.d.ts +2 -0
- package/general/index.d.ts +3 -0
- package/general/link/index.d.ts +1 -0
- package/general/link/link.d.ts +21 -0
- package/general/responsive-image/index.d.ts +2 -0
- package/general/responsive-image/responsive-image.helpers.d.ts +68 -0
- package/general/responsive-image/responsive-image.mock.d.ts +9 -0
- package/helpers/basic-reducer.d.ts +2 -0
- package/helpers/breakpoints.d.ts +5 -0
- package/helpers/index.d.ts +5 -0
- package/helpers/intl-wrapper.d.ts +6 -0
- package/helpers/pass-props-to-children.d.ts +3 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/use-effect-after-mount.d.ts +2 -0
- package/hooks/use-screen-width.d.ts +2 -0
- package/hooks/use-scroll-listener.d.ts +15 -0
- package/index.d.ts +12 -1
- package/index.js +160 -1
- package/index.mjs +20514 -6
- package/layout/download-section/download-section.d.ts +21 -0
- package/layout/download-section/index.d.ts +1 -0
- package/layout/index.d.ts +3 -0
- package/layout/logos/index.d.ts +1 -0
- package/layout/logos/logos.d.ts +24 -0
- package/layout/logos/logos.mock.d.ts +3 -0
- package/layout/page-layout/components/cookie-banner/cookie-banner.d.ts +6 -0
- package/layout/page-layout/components/cookie-banner/index.d.ts +1 -0
- package/layout/page-layout/components/footer/footer.d.ts +6 -0
- package/layout/page-layout/components/footer/footer.data.d.ts +6 -0
- package/layout/page-layout/components/footer/index.d.ts +1 -0
- package/layout/page-layout/components/header/__mocks__/header.data.d.ts +83 -0
- package/layout/page-layout/components/header/components/header-link/header-link.d.ts +13 -0
- package/layout/page-layout/components/header/components/header-link/index.d.ts +1 -0
- package/layout/page-layout/components/header/components/index.d.ts +1 -0
- package/layout/page-layout/components/header/header.d.ts +6 -0
- package/layout/page-layout/components/header/header.data.d.ts +112 -0
- package/layout/page-layout/components/header/header.helpers.d.ts +39 -0
- package/layout/page-layout/components/header/header.mock.d.ts +29 -0
- package/layout/page-layout/components/header/index.d.ts +2 -0
- package/layout/page-layout/components/index.d.ts +3 -0
- package/layout/page-layout/index.d.ts +2 -0
- package/layout/page-layout/page-layout.d.ts +16 -0
- package/loaders/index.d.ts +4 -0
- package/loaders/loading-block/index.d.ts +1 -0
- package/loaders/loading-block/loading-block.d.ts +18 -0
- package/loaders/loading-placeholder/index.d.ts +1 -0
- package/loaders/loading-placeholder/loading-placeholder.d.ts +11 -0
- package/loaders/loading-state/index.d.ts +1 -0
- package/loaders/loading-state/loading-state.d.ts +5 -0
- package/loaders/progress-bar/index.d.ts +1 -0
- package/loaders/progress-bar/progress-bar.d.ts +13 -0
- package/modals/modal/index.d.ts +1 -0
- package/modals/modal/modal.d.ts +9 -0
- package/navigation/filters/filters.d.ts +28 -0
- package/navigation/filters/index.d.ts +1 -0
- package/navigation/index.d.ts +4 -0
- package/navigation/load-more/index.d.ts +1 -0
- package/navigation/load-more/load-more.d.ts +28 -0
- package/navigation/logo/index.d.ts +1 -0
- package/navigation/logo/logo.d.ts +12 -0
- package/navigation/tags/index.d.ts +1 -0
- package/navigation/tags/tags.d.ts +20 -0
- package/navigation/tags/tags.helpers.d.ts +34 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/README.md +2 -20
- package/styles/base/_accessibility.scss +26 -0
- package/styles/base/_blockquotes.scss +29 -0
- package/styles/base/_fonts.scss +41 -0
- package/styles/base/_hr.scss +16 -0
- package/styles/{base-styles → base}/_index.scss +5 -1
- package/styles/base/_links.scss +16 -0
- package/styles/base/_lists.scss +27 -0
- package/styles/base/_overlays.scss +26 -0
- package/styles/base/_text.scss +84 -0
- package/styles/base/_titles.scss +176 -0
- package/styles/base/buttons/_buttons.scss +250 -0
- package/styles/base/buttons/_sizes.scss +12 -0
- package/styles/base/form/_fields.scss +60 -0
- package/styles/base/form/_index.scss +2 -0
- package/styles/base/form/_search-button.scss +32 -0
- package/styles/functions/_size-conversions.scss +3 -1
- package/styles/index.scss +4 -2
- package/styles/mixins/_backgrounds.scss +1 -5
- package/styles/mixins/_breakpoints.scss +4 -1
- package/styles/mixins/_browsers.scss +3 -0
- package/styles/mixins/_index.scss +2 -0
- package/styles/mixins/_selectors.scss +2 -5
- package/styles/mixins/_styles.scss +31 -0
- package/styles/variables/assets/_assets.scss +1 -3
- package/styles/variables/colors/_colors.scss +5 -0
- package/styles/variables/colors/_theme.scss +159 -1
- package/styles/variables/sizes/_common.scss +2 -1
- package/text/collapsible-section/collapsible-section.d.ts +13 -0
- package/text/collapsible-section/index.d.ts +1 -0
- package/text/empty-state-box/empty-state-box.d.ts +21 -0
- package/text/empty-state-box/index.d.ts +1 -0
- package/text/helper-text-box/helper-text-box.d.ts +14 -0
- package/text/helper-text-box/index.d.ts +1 -0
- package/text/hide-show-text-box/hide-show-text-box.d.ts +16 -0
- package/text/hide-show-text-box/hide-show-text-box.mock.d.ts +4 -0
- package/text/hide-show-text-box/index.d.ts +1 -0
- package/text/highlighted-text-box/highlighted-text-box.d.ts +13 -0
- package/text/highlighted-text-box/index.d.ts +1 -0
- package/text/index.d.ts +6 -0
- package/text/pill/index.d.ts +1 -0
- package/text/pill/pill.d.ts +9 -0
- package/user/index.d.ts +1 -0
- package/user/profile-picture/index.d.ts +1 -0
- package/user/profile-picture/profile-picture.d.ts +12 -0
- package/user/profile-picture/profile-picture.helpers.d.ts +3 -0
- package/demo/demo.d.ts +0 -4
- package/demo/index.d.ts +0 -1
- package/styles/base-styles/_accessibility.scss +0 -31
- package/styles/base-styles/_blockquotes.scss +0 -31
- package/styles/base-styles/_hr.scss +0 -17
- package/styles/base-styles/_links.scss +0 -18
- package/styles/base-styles/_lists.scss +0 -30
- package/styles/base-styles/_text.scss +0 -83
- package/styles/base-styles/_titles.scss +0 -132
- package/styles/base-styles/buttons/_buttons.scss +0 -236
- /package/styles/{base-styles → base}/buttons/_icons.scss +0 -0
- /package/styles/{base-styles → base}/buttons/_index.scss +0 -0
- /package/styles/{base-styles → base}/buttons/_mixins.scss +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import './../functions',
|
|
3
|
+
'./../mixins',
|
|
4
|
+
'./../variables';
|
|
5
|
+
|
|
6
|
+
$default: ('font-size': 16, 'font-size_md': 18, 'line-height': 24, 'line-height_md': 28, 'margin-bottom': 20); // The default size is the 'large paragraph' in Figma
|
|
7
|
+
$small: ('font-size': 12, 'font-size_md': 14, 'letter-spacing': 0.16, 'line-height': 16, 'margin-bottom': 16);
|
|
8
|
+
$medium: ('font-size': 14, 'font-size_md': 16, 'line-height': 16, 'line-height_md': 20, 'margin-bottom': 18);
|
|
9
|
+
$sup: ('font-size': 10);
|
|
10
|
+
|
|
11
|
+
@layer base {
|
|
12
|
+
p, li, small {
|
|
13
|
+
color: map.get($theme, 'text');
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
|
|
16
|
+
.error &, &.error { color: map.get($theme, 'text_error'); }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
p, li, dt, dd {
|
|
20
|
+
font-size: px-to-rem(map.get($default, 'font-size'));
|
|
21
|
+
line-height: px-to-rem(map.get($default, 'line-height'));
|
|
22
|
+
|
|
23
|
+
.text-small & {
|
|
24
|
+
font-size: px-to-rem(map.get($small, 'font-size'));
|
|
25
|
+
line-height: px-to-rem(map.get($small, 'line-height'));
|
|
26
|
+
letter-spacing: px-to-rem(map.get($small, 'letter-spacing'));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.text-medium & {
|
|
30
|
+
font-size: px-to-rem(map.get($medium, 'font-size'));
|
|
31
|
+
line-height: px-to-rem(map.get($medium, 'line-height'));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@include breakpoint('min-width', 'md') {
|
|
35
|
+
font-size: px-to-rem(map.get($default, 'font-size_md'));
|
|
36
|
+
line-height: px-to-rem(map.get($default, 'line-height_md'));
|
|
37
|
+
|
|
38
|
+
.text-small & {
|
|
39
|
+
font-size: px-to-rem(map.get($small, 'font-size_md'));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.text-medium & {
|
|
43
|
+
font-size: px-to-rem(map.get($medium, 'font-size_md'));
|
|
44
|
+
line-height: px-to-rem(map.get($medium, 'line-height_md'));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
p {
|
|
50
|
+
margin-bottom: px-to-rem(map.get($default, 'margin-bottom'));
|
|
51
|
+
|
|
52
|
+
.text-small & { margin-bottom: px-to-rem(map.get($small, 'margin-bottom')); }
|
|
53
|
+
|
|
54
|
+
.text-medium & { margin-bottom: px-to-rem(map.get($medium, 'margin-bottom')); }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
small {
|
|
58
|
+
font-size: px-to-rem(map.get($small, 'font-size'));
|
|
59
|
+
line-height: px-to-rem(map.get($small, 'line-height'));
|
|
60
|
+
|
|
61
|
+
@include breakpoint('min-width', 'md') {
|
|
62
|
+
font-size: px-to-rem(map.get($small, 'font-size_md'));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
strong { font-weight: 900; }
|
|
67
|
+
em, i { font-style: italic; }
|
|
68
|
+
|
|
69
|
+
sup, sub {
|
|
70
|
+
font-size: px-to-rem(map.get($sup, 'font-size'));
|
|
71
|
+
line-height: normal;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
sup {
|
|
75
|
+
vertical-align: super;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
sub {
|
|
79
|
+
vertical-align: sub;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
address { font-style: normal; }
|
|
83
|
+
|
|
84
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import './../functions',
|
|
3
|
+
'./../mixins',
|
|
4
|
+
'./../variables';
|
|
5
|
+
|
|
6
|
+
$pre-title: ('font-size': 14, 'font-size_md': 16, 'letter-spacing': 1.28, 'line-height': 16, 'line-height_md': 20, 'margin-bottom': 24);
|
|
7
|
+
$title: ('font-size': 32, 'font-size_md': 52, 'letter-spacing': -0.16, 'line-height': 40, 'line-height_md': 64, 'margin-bottom': 16, 'margin-bottom_md': 32);
|
|
8
|
+
$h1: ('font-size': 28, 'font-size_md': 40, 'line-height': 32, 'line-height_md': 48, 'letter-spacing': -0.16, 'margin-bottom': 16);
|
|
9
|
+
$h2: ('font-size': 24, 'font-size_md': 28, 'line-height': 32, 'line-height_md': 40, 'margin-top': 40, 'margin-bottom': 16);
|
|
10
|
+
$h3: ('font-size': 20, 'font-size_md': 24, 'line-height': 28, 'line-height_md': 32, 'margin-top': 60, 'margin-bottom': 20);
|
|
11
|
+
$h4: ('font-size': 18, 'font-size_md': 20, 'line-height': 24, 'line-height_md': 28, 'margin-top': 40, 'margin-bottom': 20);
|
|
12
|
+
$h5: ('font-size': 12, 'font-size_md': 14, 'line-height': 16, 'margin-top': 16, 'margin-bottom': 16);
|
|
13
|
+
$h6: ('font-size': 12, 'font-size_md': 11, 'line-height': 16);
|
|
14
|
+
$subtitle: ('font-size': 20, 'font-size_md': 24, 'line-height': 28, 'line-height_md': 32, 'margin-bottom': 20);
|
|
15
|
+
|
|
16
|
+
@mixin pre-title {
|
|
17
|
+
margin-bottom: px-to-rem(map.get($pre-title, 'margin-bottom'));
|
|
18
|
+
font-size: px-to-rem(map.get($pre-title, 'font-size'));
|
|
19
|
+
color: map.get($theme, 'title');
|
|
20
|
+
font-weight: 700;
|
|
21
|
+
line-height: px-to-rem(map.get($pre-title, 'line-height'));
|
|
22
|
+
letter-spacing: px-to-rem(map.get($pre-title, 'letter-spacing'));
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
|
|
25
|
+
@include breakpoint('min-width', 'md') {
|
|
26
|
+
font-size: px-to-rem(map.get($pre-title, 'font-size_md'));
|
|
27
|
+
line-height: px-to-rem(map.get($pre-title, 'line-height_md'));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@mixin title {
|
|
32
|
+
margin-bottom: px-to-rem(map.get($title, 'margin-bottom'));
|
|
33
|
+
font-size: px-to-rem(map.get($title, 'font-size'));
|
|
34
|
+
color: map.get($theme, 'title');
|
|
35
|
+
font-weight: 900;
|
|
36
|
+
line-height: px-to-rem(map.get($title, 'line-height'));
|
|
37
|
+
letter-spacing: px-to-rem(map.get($title, 'letter-spacing'));
|
|
38
|
+
|
|
39
|
+
@include breakpoint('min-width', 'md') {
|
|
40
|
+
font-size: px-to-rem(map.get($title, 'font-size_md'));
|
|
41
|
+
line-height: px-to-rem(map.get($title, 'line-height_md'));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@mixin h1 {
|
|
46
|
+
margin-bottom: px-to-rem(map.get($h1, 'margin-bottom'));
|
|
47
|
+
font-size: px-to-rem(map.get($h1, 'font-size'));
|
|
48
|
+
color: map.get($theme, 'title');
|
|
49
|
+
text-transform: none;
|
|
50
|
+
font-weight: 900;
|
|
51
|
+
line-height: px-to-rem(map.get($h1, 'line-height'));
|
|
52
|
+
letter-spacing: px-to-rem(map.get($h1, 'letter-spacing'));
|
|
53
|
+
|
|
54
|
+
@include breakpoint('min-width', 'md') {
|
|
55
|
+
font-size: px-to-rem(map.get($h1, 'font-size_md'));
|
|
56
|
+
line-height: px-to-rem(map.get($h1, 'line-height_md'));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@mixin h2 {
|
|
61
|
+
margin: px-to-rem(map.get($h2, 'margin-top')) 0 px-to-rem(map.get($h2, 'margin-bottom')) 0;
|
|
62
|
+
font-size: px-to-rem(map.get($h2, 'font-size'));
|
|
63
|
+
color: map.get($theme, 'title');
|
|
64
|
+
text-transform: none;
|
|
65
|
+
font-weight: 900;
|
|
66
|
+
line-height: px-to-rem(map.get($h2, 'line-height'));
|
|
67
|
+
|
|
68
|
+
@include breakpoint('min-width', 'md') {
|
|
69
|
+
font-size: px-to-rem(map.get($h2, 'font-size_md'));
|
|
70
|
+
line-height: px-to-rem(map.get($h2, 'line-height_md'));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@mixin h3 {
|
|
75
|
+
margin: px-to-rem(map.get($h3, 'margin-top')) 0 px-to-rem(map.get($h3, 'margin-bottom')) 0;
|
|
76
|
+
font-size: px-to-rem(map.get($h3, 'font-size'));
|
|
77
|
+
color: map.get($theme, 'title');
|
|
78
|
+
text-transform: none;
|
|
79
|
+
font-weight: 900;
|
|
80
|
+
line-height: px-to-rem(map.get($h3, 'line-height'));
|
|
81
|
+
|
|
82
|
+
@include breakpoint('min-width', 'md') {
|
|
83
|
+
font-size: px-to-rem(map.get($h3, 'font-size_md'));
|
|
84
|
+
line-height: px-to-rem(map.get($h3, 'line-height_md'));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@mixin h4 {
|
|
89
|
+
margin: px-to-rem(map.get($h4, 'margin-top')) 0 px-to-rem(map.get($h4, 'margin-bottom')) 0;
|
|
90
|
+
font-size: px-to-rem(map.get($h4, 'font-size'));
|
|
91
|
+
color: map.get($theme, 'title');
|
|
92
|
+
text-transform: none;
|
|
93
|
+
font-weight: 900;
|
|
94
|
+
line-height: px-to-rem(map.get($h4, 'line-height'));
|
|
95
|
+
|
|
96
|
+
@include breakpoint('min-width', 'md') {
|
|
97
|
+
font-size: px-to-rem(map.get($h4, 'font-size_md'));
|
|
98
|
+
line-height: px-to-rem(map.get($h4, 'line-height_md'));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@mixin h5 {
|
|
103
|
+
margin: px-to-rem(map.get($h5, 'margin-top')) 0 px-to-rem(map.get($h5, 'margin-bottom')) 0;
|
|
104
|
+
font-size: px-to-rem(map.get($h5, 'font-size'));
|
|
105
|
+
color: map.get($theme, 'title');
|
|
106
|
+
text-transform: uppercase;
|
|
107
|
+
font-weight: 700;
|
|
108
|
+
line-height: px-to-rem(map.get($h5, 'line-height'));
|
|
109
|
+
|
|
110
|
+
@include breakpoint('min-width', 'md') {
|
|
111
|
+
font-size: px-to-rem(map.get($h5, 'font-size_md'));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@mixin h6 {
|
|
116
|
+
font-size: px-to-rem(map.get($h6, 'font-size'));
|
|
117
|
+
color: map.get($theme, 'title');
|
|
118
|
+
text-transform: uppercase;
|
|
119
|
+
font-weight: 700;
|
|
120
|
+
line-height: px-to-rem(map.get($h6, 'line-height'));
|
|
121
|
+
|
|
122
|
+
@include breakpoint('min-width', 'md') {
|
|
123
|
+
font-size: px-to-rem(map.get($h6, 'font-size_md'));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@mixin subtitle {
|
|
128
|
+
margin-bottom: px-to-rem(map.get($subtitle, 'margin-bottom'));
|
|
129
|
+
font-size: px-to-rem(map.get($subtitle, 'font-size'));
|
|
130
|
+
color: map.get($theme, 'subtitle');
|
|
131
|
+
font-weight: 400;
|
|
132
|
+
line-height: px-to-rem(map.get($subtitle, 'line-height'));
|
|
133
|
+
|
|
134
|
+
@include breakpoint('min-width', 'md') {
|
|
135
|
+
font-size: px-to-rem(map.get($subtitle, 'font-size_md'));
|
|
136
|
+
line-height: px-to-rem(map.get($subtitle, 'line-height_md'));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@layer base {
|
|
141
|
+
.pre-title {
|
|
142
|
+
@include pre-title;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.title {
|
|
146
|
+
@include title;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
h1 {
|
|
150
|
+
@include h1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
h2 {
|
|
154
|
+
@include h2;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
h3 {
|
|
158
|
+
@include h3;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
h4 {
|
|
162
|
+
@include h4;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
h5 {
|
|
166
|
+
@include h5;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
h6 {
|
|
170
|
+
@include h6;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.subtitle {
|
|
174
|
+
@include subtitle;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@import './../../functions',
|
|
4
|
+
'./../../mixins',
|
|
5
|
+
'./../../variables';
|
|
6
|
+
@import './icons', './mixins', './sizes';
|
|
7
|
+
|
|
8
|
+
@layer base {
|
|
9
|
+
button, .button {
|
|
10
|
+
background: map.get($theme, 'button_primary_bg');
|
|
11
|
+
padding: px-to-rem(map.get($medium, 'padding-top')) px-to-rem(map.get($medium, 'padding-horizontal'))
|
|
12
|
+
px-to-rem(map.get($medium, 'padding-bottom')) px-to-rem(map.get($medium, 'padding-horizontal'));
|
|
13
|
+
position: relative;
|
|
14
|
+
text-align: center;
|
|
15
|
+
font-size: px-to-rem(map.get($medium, 'font-size'));
|
|
16
|
+
font-weight: 700;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
border-radius: 360rem; // Completely round corners. This could be any large number but 360 evokes a circle well!
|
|
19
|
+
border: none;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
|
|
24
|
+
&, &:hover, &:active, &:focus, &:focus-visible { color: map.get($theme, 'button_primary'); }
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
background: map.get($theme, 'button_primary_bg_hover');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:active {
|
|
31
|
+
background: map.get($theme, 'button_primary_bg_active');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:focus, &:focus-visible {
|
|
35
|
+
background: map.get($theme, 'button_primary_bg_focus');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@each $size, $styles in $sizes {
|
|
39
|
+
&.#{$size} {
|
|
40
|
+
padding: px-to-rem(map.get($styles, 'padding-top')) px-to-rem(map.get($styles, 'padding-horizontal'))
|
|
41
|
+
px-to-rem(map.get($styles, 'padding-bottom')) px-to-rem(map.get($styles, 'padding-horizontal'));
|
|
42
|
+
font-size: px-to-rem(map.get($styles, 'font-size'));
|
|
43
|
+
|
|
44
|
+
&.icon {
|
|
45
|
+
margin-top: px-to-rem(map.get($styles, 'icon-offset'));
|
|
46
|
+
|
|
47
|
+
&.left::before { margin-right: px-to-rem(map.get($styles, 'icon-gutter')); }
|
|
48
|
+
&.right::before { margin-left: px-to-rem(map.get($styles, 'icon-gutter')); }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.full-width {
|
|
54
|
+
width: 100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.destructive {
|
|
58
|
+
&, &:hover, &:active, &:focus, &:focus-visible {
|
|
59
|
+
background: map.get($theme, 'button_primary_destructive_bg');
|
|
60
|
+
color: map.get($theme, 'button_primary_destructive');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:hover, &:active {
|
|
64
|
+
background: map.get($theme, 'button_primary_destructive_bg_hover');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:focus, &:focus-visible {
|
|
68
|
+
box-shadow: $outline map.get($theme, 'button_primary_destructive_box-shadow');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.secondary {
|
|
74
|
+
background: map.get($theme, 'button_secondary_bg');
|
|
75
|
+
border: px-to-rem(map.get($secondary, 'border')) solid map.get($theme, 'button_secondary_border');
|
|
76
|
+
|
|
77
|
+
&, &:hover { color: map.get($theme, 'button_secondary'); }
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
background: map.get($theme, 'button_secondary_bg_hover');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&:active, &:focus, &:focus-visible {
|
|
84
|
+
color: map.get($theme, 'button_secondary_focus');
|
|
85
|
+
border-color: map.get($theme, 'button_secondary_border_focus');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:active {
|
|
89
|
+
background: map.get($theme, 'button_secondary_bg_active');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:focus, &:focus-visible {
|
|
93
|
+
background: map.get($theme, 'button_secondary_bg_focus');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.muted {
|
|
97
|
+
border-color: map.get($theme, 'button_secondary_border_muted');
|
|
98
|
+
|
|
99
|
+
&, &:hover, &:active, &:focus, &:focus-visible {
|
|
100
|
+
background: map.get($theme, 'button_secondary_bg_muted');
|
|
101
|
+
color: map.get($theme, 'button_secondary_muted');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:hover, &:focus, &:focus-visible {
|
|
105
|
+
color: map.get($theme, 'button_secondary_muted_hover');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&.disabled {
|
|
110
|
+
&, &:hover, &:active, &:focus, &:focus-visible {
|
|
111
|
+
background: map.get($theme, 'button_secondary_bg_disabled');
|
|
112
|
+
color: map.get($theme, 'button_secondary_disabled');
|
|
113
|
+
border-color: map.get($theme, 'button_secondary_border_disabled');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.tertiary {
|
|
119
|
+
@include transition(color text-decoration-color);
|
|
120
|
+
|
|
121
|
+
padding: px-to-rem(map.get($tertiary, 'padding-top')) px-to-rem(map.get($tertiary, 'padding-horizontal'))
|
|
122
|
+
px-to-rem(map.get($tertiary, 'padding-bottom')) px-to-rem(map.get($tertiary, 'padding-horizontal'));
|
|
123
|
+
bottom: px-to-rem(map.get($tertiary, 'padding-top'));
|
|
124
|
+
right: px-to-rem(map.get($tertiary, 'padding-horizontal'));
|
|
125
|
+
text-decoration: underline;
|
|
126
|
+
text-decoration-color: transparent;
|
|
127
|
+
|
|
128
|
+
&, &:focus, &:focus-visible {
|
|
129
|
+
background: map.get($theme, 'button_tertiary_bg');
|
|
130
|
+
color: map.get($theme, 'button_tertiary');
|
|
131
|
+
text-decoration-color: map.get($theme, 'button_tertiary_text-decoration');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&:hover, &:active {
|
|
135
|
+
text-decoration-color: currentcolor;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&:hover {
|
|
139
|
+
color: map.get($theme, 'button_tertiary_hover');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&:active {
|
|
143
|
+
color: map.get($theme, 'button_tertiary_active');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&.muted {
|
|
147
|
+
color: map.get($theme, 'button_tertiary_muted');
|
|
148
|
+
|
|
149
|
+
&:hover, &:focus, &:focus-visible {
|
|
150
|
+
color: map.get($theme, 'button_tertiary_muted_hover');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&.disabled {
|
|
155
|
+
&, &:hover, &:active, &:focus, &:focus-visible {
|
|
156
|
+
background: map.get($theme, 'button_tertiary_disabled_bg');
|
|
157
|
+
color: map.get($theme, 'button_tertiary_disabled');
|
|
158
|
+
text-decoration-color: map.get($theme, 'button_tertiary_disabled_text-decoration');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&.icon {
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
flex-flow: row;
|
|
167
|
+
align-content: center;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
|
|
170
|
+
&::before {
|
|
171
|
+
content: '';
|
|
172
|
+
background: currentcolor;
|
|
173
|
+
width: px-to-rem(map.get($medium, 'icon-width'));
|
|
174
|
+
height: px-to-rem(map.get($medium, 'icon-width'));
|
|
175
|
+
display: block;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&.left {
|
|
179
|
+
&::before { margin-right: px-to-rem(map.get($medium, 'icon-gutter')); }
|
|
180
|
+
|
|
181
|
+
&.no-text::before { margin-right: 0; }
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&.right {
|
|
185
|
+
&::before {
|
|
186
|
+
margin-left: px-to-rem(map.get($medium, 'icon-gutter'));
|
|
187
|
+
order: 2;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&.no-text::before { margin-left: 0; }
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@each $icon, $large-icon, $medium-icon, $small-icon in $icons {
|
|
194
|
+
$icon-sizes: ('large', $large-icon), ('medium', $medium-icon), ('small', $small-icon);
|
|
195
|
+
|
|
196
|
+
@at-root {
|
|
197
|
+
%icon-#{$icon} { @include icon-styling($icon, $icon-sizes); }
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&.#{$icon} {
|
|
201
|
+
@extend %icon-#{$icon};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&.hover_#{$icon} {
|
|
205
|
+
&:hover, &:focus, &:focus-visible {
|
|
206
|
+
@extend %icon-#{$icon};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&.animate {
|
|
213
|
+
&::before {
|
|
214
|
+
@include transition(transform, #{map.get($animation, 'duration')}s, ease);
|
|
215
|
+
|
|
216
|
+
transform: none;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&.bounce {
|
|
220
|
+
@include animate {
|
|
221
|
+
@keyframes bounce {
|
|
222
|
+
0%, 100% { transform: scale(1); }
|
|
223
|
+
|
|
224
|
+
70% {
|
|
225
|
+
transform: scale(#{map.get($animation-bounce, 'scale')});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&:focus, &:active, &.do-animation {
|
|
230
|
+
&::before { animation: bounce #{map.get($animation-bounce, 'duration')}s #{map.get($animation-bounce, 'iteration')}; }
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&.rotate-180::before {
|
|
237
|
+
transform: rotate(180deg);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&.disabled {
|
|
244
|
+
cursor: not-allowed;
|
|
245
|
+
opacity: 0.3;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The button defaults to the primary variant and medium styling so are not added as classes - they live on the default `button` styling
|
|
2
|
+
$large: ('font-size': 18, 'padding-top': 14, 'padding-horizontal': 24, 'padding-bottom': 16, 'icon-width': 18, 'icon-offset': 2, 'icon-gutter': 12);
|
|
3
|
+
$medium: ('font-size': 16, 'padding-top': 10, 'padding-horizontal': 24, 'padding-bottom': 12, 'icon-width': 16, 'icon-offset': 2, 'icon-gutter': 10);
|
|
4
|
+
$small: ('font-size': 14, 'padding-top': 8, 'padding-horizontal': 16, 'padding-bottom': 10, 'icon-width': 12, 'icon-offset': 2, 'icon-gutter': 8);
|
|
5
|
+
$sizes: ('large', $large), ('small', $small);
|
|
6
|
+
$secondary: ('border': 1);
|
|
7
|
+
|
|
8
|
+
// The tertiary styling has its own padding; regardless of size, we add a tiny amount of padding to accommodate
|
|
9
|
+
// the focus outline and to ensure any icons are centered
|
|
10
|
+
$tertiary: ('padding-top': 1.6, 'padding-horizontal': 8,'padding-bottom': 3.2);
|
|
11
|
+
$animation: ('duration': 0.2);
|
|
12
|
+
$animation-bounce: ('scale': 1.1, 'duration': 0.5, 'iteration': 1);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import './../../functions',
|
|
3
|
+
'./../../mixins',
|
|
4
|
+
'./../../variables';
|
|
5
|
+
|
|
6
|
+
$field: ('padding-vertical': 8, 'padding-horizontal': 16, 'font-size': 16, 'line-height': 24, 'border': 1, 'border-radius': 8);
|
|
7
|
+
|
|
8
|
+
@mixin field-styling {
|
|
9
|
+
background: map.get($theme, 'form_input_bg');
|
|
10
|
+
border: px-to-rem(map.get($field, 'border')) solid map.get($theme, 'form_input_border');
|
|
11
|
+
border-radius: px-to-rem(map.get($field, 'border-radius'));
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
outline: none;
|
|
14
|
+
|
|
15
|
+
&:focus, &:focus-visible {
|
|
16
|
+
box-shadow: $outline-width map.get($theme, 'form_input_focus_box-shadow');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.error {
|
|
20
|
+
border-color: map.get($theme, 'form_input_error_border');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@layer base {
|
|
25
|
+
input, .input, textarea {
|
|
26
|
+
@include field-styling;
|
|
27
|
+
|
|
28
|
+
width: 100%;
|
|
29
|
+
padding: px-to-rem(map.get($field, 'padding-vertical')) px-to-rem(map.get($field, 'padding-horizontal'));
|
|
30
|
+
font-size: px-to-rem(map.get($field, 'font-size'));
|
|
31
|
+
color: map.get($theme, 'form_input');
|
|
32
|
+
line-height: px-to-rem(map.get($field, 'line-height'));
|
|
33
|
+
|
|
34
|
+
::placeholder {
|
|
35
|
+
color: map.get($theme, 'form_input_placeholder');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Remove default styling, for consistency
|
|
39
|
+
&[type='search'] {
|
|
40
|
+
&::-ms-clear {
|
|
41
|
+
width: 0;
|
|
42
|
+
height: 0;
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&::-ms-reveal {
|
|
47
|
+
width: 0;
|
|
48
|
+
height: 0;
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&::-webkit-search-decoration,
|
|
53
|
+
&::-webkit-search-cancel-button,
|
|
54
|
+
&::-webkit-search-results-button,
|
|
55
|
+
&::-webkit-search-results-decoration {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import './../../functions',
|
|
3
|
+
'./../../mixins',
|
|
4
|
+
'./../../variables';
|
|
5
|
+
|
|
6
|
+
$search-icon: ('width': 24, 'height': 24);
|
|
7
|
+
|
|
8
|
+
@layer base {
|
|
9
|
+
button.search {
|
|
10
|
+
width: px-to-rem(map.get($search-icon, 'width'));
|
|
11
|
+
height: px-to-rem(map.get($search-icon, 'height'));
|
|
12
|
+
background: transparent;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
border: none;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
|
|
21
|
+
&::before {
|
|
22
|
+
@include transition(background, 0.3s, ease);
|
|
23
|
+
@include image('icons/magnifying-glass.svg', true);
|
|
24
|
+
|
|
25
|
+
content: '';
|
|
26
|
+
width: px-to-rem(map.get($search-icon, 'width'));
|
|
27
|
+
height: px-to-rem(map.get($search-icon, 'height'));
|
|
28
|
+
background: map.get($theme, 'form_search-button_bg');
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
// We want to use rem for accessibility, but Figma uses px (which is also a bit easier for us
|
|
5
5
|
// to read and reason about). This mixin does the conversion for us.
|
|
6
6
|
@function px-to-rem($size, $baseTextSize: 16) {
|
|
7
|
-
|
|
7
|
+
$new-size: math.div($size, $baseTextSize);
|
|
8
|
+
|
|
9
|
+
@return $new-size + rem;
|
|
8
10
|
}
|
package/styles/index.scss
CHANGED