@20minutes/hela 2.18.14 → 2.19.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/dist/assets/scripts/{closeArticleButton.d.ts → floatingButton.d.ts} +1 -0
- package/dist/components/atoms/Button/Button.d.ts +8 -4
- package/dist/components/atoms/IconButton/IconButton.d.ts +16 -0
- package/dist/components/atoms/IconButton/index.d.ts +1 -0
- package/dist/components/atoms/Link/Link.d.ts +3 -2
- package/dist/components/atoms/ScrollToTopButton/ScrollToTopButton.d.ts +2 -2
- package/dist/components/atoms/Slider/Slider.d.ts +3 -2
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/molecules/Expandable/Expandable.d.ts +2 -2
- package/dist/components/molecules/Header/HeaderSection/HeaderSection.d.ts +2 -2
- package/dist/components/molecules/Header/HeaderSideModal/HeaderSideModal.d.ts +2 -2
- package/dist/components/molecules/MediaLink/MediaLink.d.ts +4 -5
- package/dist/components/molecules/SocialBar/Chatbot.d.ts +6 -0
- package/dist/components/molecules/TagBar/TagBar.d.ts +1 -1
- package/dist/index.es.js +1215 -1170
- package/dist/index.umd.cjs +1 -1
- package/dist/js/scripts.es.js +261 -260
- package/dist/js/scripts.umd.cjs +1 -1
- package/dist/scss/abstracts/mixins/_buttons.scss +146 -0
- package/dist/scss/abstracts/mixins/_index.scss +1 -0
- package/dist/scss/abstracts/variables/_token-variables.scss +1 -1
- package/dist/style.css +1 -1
- package/package.json +17 -15
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../functions' as *;
|
|
3
|
+
@use '../variables' as *;
|
|
4
|
+
|
|
5
|
+
// ── Button color schemes ────────────────────────────────────────────
|
|
6
|
+
// Shared mixins consumed by both _button.scss and _icon-button.scss.
|
|
7
|
+
// --button-scheme-color is the dominant color of the scheme.
|
|
8
|
+
// Used by the ghost variant as text color (bg → text remapping).
|
|
9
|
+
|
|
10
|
+
@mixin button-color-primary {
|
|
11
|
+
--button-scheme-color: #{map.get($token-variables, 'color', 'primary', 'ultramarine')};
|
|
12
|
+
--button-base-background-color: #{map.get($token-variables, 'color', 'primary', 'ultramarine')};
|
|
13
|
+
--button-base-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
14
|
+
--button-base-border-color: #{map.get($token-variables, 'color', 'primary', 'ultramarine')};
|
|
15
|
+
--button-hover-background-color: #{map.get($token-variables, 'color', 'primary', 'ultramarine')};
|
|
16
|
+
--button-hover-background-opacity: 0.8;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@mixin button-color-secondary {
|
|
20
|
+
--button-scheme-color: #{map.get($token-variables, 'color', 'greyscale', 'black')};
|
|
21
|
+
--button-base-background-color: #{map.get($token-variables, 'color', 'greyscale', 'black')};
|
|
22
|
+
--button-base-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
23
|
+
--button-base-border-color: #{map.get($token-variables, 'color', 'greyscale', 'black')};
|
|
24
|
+
--button-hover-background-color: #{map.get($token-variables, 'color', 'greyscale', 'black')};
|
|
25
|
+
--button-hover-background-opacity: 0.8;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin button-color-tertiary {
|
|
29
|
+
--button-scheme-color: #{rgba(map.get($variables, 'color', 'greyscale', 'grey-900'), 0.6)};
|
|
30
|
+
--button-base-background-color: #{rgba(
|
|
31
|
+
map.get($variables, 'color', 'greyscale', 'grey-900'),
|
|
32
|
+
0.6
|
|
33
|
+
)};
|
|
34
|
+
--button-base-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
35
|
+
--button-hover-background-color: #{rgba(
|
|
36
|
+
map.get($variables, 'color', 'greyscale', 'grey-900'),
|
|
37
|
+
0.8
|
|
38
|
+
)};
|
|
39
|
+
--button-base-border-width: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin button-color-translucent {
|
|
43
|
+
--button-scheme-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
44
|
+
--button-base-background-color: transparent;
|
|
45
|
+
--button-base-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
46
|
+
--button-base-border-width: 1px;
|
|
47
|
+
--button-hover-background-color: #{rgba(map.get($variables, 'color', 'greyscale', 'white'), 0.1)};
|
|
48
|
+
--button-hover-background-opacity: 0.8;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@mixin button-color-dark {
|
|
52
|
+
--button-scheme-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-900')};
|
|
53
|
+
--button-base-background-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-900')};
|
|
54
|
+
--button-base-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
55
|
+
--button-base-border-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-500')};
|
|
56
|
+
--button-hover-background-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-500')};
|
|
57
|
+
--button-hover-background-opacity: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@mixin button-color-white {
|
|
61
|
+
--button-scheme-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
62
|
+
--button-base-background-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
63
|
+
--button-base-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-900')};
|
|
64
|
+
--button-base-border-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
65
|
+
--button-hover-background-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
66
|
+
--button-hover-background-opacity: 0.8;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@mixin button-color-blue-ice {
|
|
70
|
+
--button-scheme-color: #{map.get($token-variables, 'color', 'secondary', 'blue-ice')};
|
|
71
|
+
--button-base-background-color: #{map.get($token-variables, 'color', 'secondary', 'blue-ice')};
|
|
72
|
+
--button-base-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-900')};
|
|
73
|
+
--button-base-border-color: #{map.get($token-variables, 'color', 'secondary', 'blue-ice')};
|
|
74
|
+
--button-hover-background-color: #{map.get($token-variables, 'color', 'secondary', 'blue-ice')};
|
|
75
|
+
--button-hover-background-opacity: 0.8;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ── IconButton-specific color schemes ───────────────────────────────
|
|
79
|
+
|
|
80
|
+
@mixin icon-button-color-default {
|
|
81
|
+
--button-scheme-color: var(--color-base);
|
|
82
|
+
--button-base-background-color: var(--color-background-1);
|
|
83
|
+
--button-base-color: var(--color-base);
|
|
84
|
+
--button-hover-background-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-100')};
|
|
85
|
+
--button-hover-background-opacity: 0.8;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@mixin button-color-blue-dark {
|
|
89
|
+
--button-scheme-color: #{map.get($token-variables, 'color', 'secondary', 'blue-grey')};
|
|
90
|
+
--button-base-background-color: #{map.get($token-variables, 'color', 'secondary', 'blue-grey')};
|
|
91
|
+
--button-base-color: #{map.get($token-variables, 'color', 'greyscale', 'white')};
|
|
92
|
+
--button-hover-background-color: #{map.get($token-variables, 'color', 'secondary', 'blue-grey')};
|
|
93
|
+
--button-hover-background-opacity: 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// ── Variant mixins ──────────────────────────────────────────────────
|
|
97
|
+
// Shared structural overrides consumed by both _button.scss and _icon-button.scss.
|
|
98
|
+
|
|
99
|
+
@mixin button-variant-ghost {
|
|
100
|
+
--button-base-background-color: none;
|
|
101
|
+
--button-base-color: var(--button-scheme-color, inherit);
|
|
102
|
+
--button-base-border-width: 0;
|
|
103
|
+
--button-hover-background-color: transparent;
|
|
104
|
+
--button-hover-background-opacity: 0.6;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@mixin button-variant-outlined {
|
|
108
|
+
--button-base-background-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-50')};
|
|
109
|
+
--button-base-color: var(--button-scheme-color, inherit);
|
|
110
|
+
--button-base-border-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-200')};
|
|
111
|
+
--button-hover-background-color: #{map.get($token-variables, 'color', 'greyscale', 'grey-100')};
|
|
112
|
+
--button-base-border-width: 1px;
|
|
113
|
+
--button-hover-background-opacity: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ── State mixins ─────────────────────────────────────────────────────
|
|
117
|
+
|
|
118
|
+
// we want to hide the text without adding a span around it, can't find a better solution
|
|
119
|
+
// we want to keep the hover state
|
|
120
|
+
// we want to keep the original button size
|
|
121
|
+
@mixin button-is-loading($spinner-size: 24px) {
|
|
122
|
+
position: relative;
|
|
123
|
+
color: transparent;
|
|
124
|
+
background-color: var(--button-hover-background-color);
|
|
125
|
+
opacity: var(--button-hover-background-opacity);
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
|
|
128
|
+
.c-icon,
|
|
129
|
+
.c-btn__counter { /* stylelint-disable-line -- kebab-case */
|
|
130
|
+
opacity: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&::after {
|
|
134
|
+
content: '';
|
|
135
|
+
position: absolute;
|
|
136
|
+
right: calc(50% - #{rem($spinner-size * 0.5)});
|
|
137
|
+
top: calc(50% - #{rem($spinner-size * 0.5)});
|
|
138
|
+
width: #{rem($spinner-size)};
|
|
139
|
+
height: #{rem($spinner-size)};
|
|
140
|
+
border: 2px solid var(--button-base-color);
|
|
141
|
+
border-bottom-color: var(--button-hover-background-color);
|
|
142
|
+
border-radius: 50%;
|
|
143
|
+
box-sizing: border-box;
|
|
144
|
+
animation: rotation 1s linear infinite;
|
|
145
|
+
}
|
|
146
|
+
}
|