react-restyle-components 0.2.24 → 0.2.26
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/lib/package.json +5 -5
- package/lib/src/App.js +2 -2
- package/lib/src/core-components/atoms/button/Button.stories.d.ts +2 -17
- package/lib/src/core-components/atoms/button/Button.stories.js +2 -39
- package/lib/src/core-components/atoms/button/Button.types.d.ts +1 -12
- package/lib/src/core-components/atoms/button/button.component.d.ts +1 -0
- package/lib/src/core-components/atoms/button/button.component.js +7 -6
- package/lib/src/core-components/atoms/button/buttonGroup/ButtonGroup.stories.d.ts +0 -17
- package/lib/src/core-components/atoms/button/buttonGroup/ButtonGroup.stories.js +4 -232
- package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.d.ts +1 -0
- package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.js +2 -3
- package/lib/src/core-components/atoms/tooltip/Tooltip.stories.d.ts +1 -2
- package/lib/src/core-components/atoms/tooltip/Tooltip.stories.js +5 -5
- package/lib/src/core-components/atoms/tooltip/Tooltip.types.d.ts +0 -2
- package/lib/src/core-components/atoms/tooltip/tooltip.component.d.ts +1 -2
- package/lib/src/core-components/atoms/tooltip/tooltip.component.js +11 -11
- package/lib/src/core-components/index.d.ts +0 -2
- package/lib/src/core-components/index.js +0 -2
- package/lib/tc.css +1 -1
- package/package.json +5 -5
- package/lib/src/core-components/atoms/button/LinkButton.stories.d.ts +0 -302
- package/lib/src/core-components/atoms/button/LinkButton.stories.js +0 -52
- package/lib/src/core-components/atoms/button/ToggleButton.stories.d.ts +0 -337
- package/lib/src/core-components/atoms/button/ToggleButton.stories.js +0 -62
- package/lib/src/core-components/atoms/button/button.module.css +0 -477
- package/lib/src/core-components/atoms/button/linkButton.component.d.ts +0 -9
- package/lib/src/core-components/atoms/button/linkButton.component.js +0 -20
- package/lib/src/core-components/atoms/button/toggleButton.component.d.ts +0 -10
- package/lib/src/core-components/atoms/button/toggleButton.component.js +0 -21
- package/lib/src/core-components/atoms/tooltip/Tooltip.module.css +0 -44
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
:global .theme--dark {
|
|
2
|
-
--button_color: var(--N0);
|
|
3
|
-
|
|
4
|
-
--button_color_brand_secondary: var(--B300);
|
|
5
|
-
--button_bg_brand_secondary_hover: rgb(from var(--B400) r g b / 0.24);
|
|
6
|
-
|
|
7
|
-
--button_color_danger_secondary: var(--Red);
|
|
8
|
-
--button_bg_danger_secondary_hover: rgb(from var(--R500) r g b / 0.24);
|
|
9
|
-
|
|
10
|
-
--button_color_accent_secondary: var(--Accent);
|
|
11
|
-
--button_bg_accent_secondary_hover: rgb(from var(--A500) r g b / 0.24);
|
|
12
|
-
|
|
13
|
-
--button_color_neutral_primary: var(--N0);
|
|
14
|
-
--button_color_neutral_secondary: var(--Gl200);
|
|
15
|
-
--button_bg_neutral_primary: var(--Gl600);
|
|
16
|
-
--button_bg_neutral_primary_hover: var(--Gl700);
|
|
17
|
-
--button_bg_neutral_secondary_hover: rgb(from var(--Gl400) r g b / 0.24);
|
|
18
|
-
|
|
19
|
-
--button_color_disabled: var(--Gl500);
|
|
20
|
-
--button_bg_disabled_primary: var(--Gl800);
|
|
21
|
-
|
|
22
|
-
--button_color_toggle_secondary_unchecked: var(--Gl200);
|
|
23
|
-
--button_bg_toggle_primary_unchecked: var(--Gl800);
|
|
24
|
-
--button_bg_toggle_primary_unchecked_hover: var(--Gl700);
|
|
25
|
-
--button_bg_toggle_secondary_unchecked_hover: var(--Gl600);
|
|
26
|
-
--button_color_toggle_primary_brand: var(--B300);
|
|
27
|
-
--button_color_toggle_primary_accent: var(--A400);
|
|
28
|
-
}
|
|
29
|
-
:global .theme--light {
|
|
30
|
-
--button_color: var(--N0);
|
|
31
|
-
|
|
32
|
-
--button_color_brand_secondary: var(--B600);
|
|
33
|
-
--button_bg_brand_secondary_hover: var(--B50);
|
|
34
|
-
|
|
35
|
-
--button_color_danger_secondary: var(--R600);
|
|
36
|
-
--button_bg_danger_secondary_hover: var(--R50);
|
|
37
|
-
|
|
38
|
-
--button_color_accent_secondary: var(--A600);
|
|
39
|
-
--button_bg_accent_secondary_hover: var(--A50);
|
|
40
|
-
|
|
41
|
-
--button_color_neutral_primary: var(--N1000);
|
|
42
|
-
--button_color_neutral_secondary: var(--N600);
|
|
43
|
-
--button_bg_neutral_primary: var(--N50);
|
|
44
|
-
--button_bg_neutral_primary_hover: var(--N100);
|
|
45
|
-
--button_bg_neutral_secondary_hover: var(--N50);
|
|
46
|
-
|
|
47
|
-
--button_color_disabled: var(--N300);
|
|
48
|
-
--button_bg_disabled_primary: var(--N50);
|
|
49
|
-
--button_color_toggle_secondary_unchecked: var(--N600);
|
|
50
|
-
--button_bg_toggle_primary_unchecked: var(--N50);
|
|
51
|
-
--button_bg_toggle_primary_unchecked_hover: var(--N100);
|
|
52
|
-
--button_bg_toggle_secondary_unchecked_hover: var(--N50);
|
|
53
|
-
--button_color_toggle_primary_brand: var(--B500);
|
|
54
|
-
--button_color_toggle_primary_accent: var(--A600);
|
|
55
|
-
--button_group_divider_color_netural_primary: var(--N200);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
:where(.reset_button) {
|
|
59
|
-
background: none;
|
|
60
|
-
border: none;
|
|
61
|
-
border-radius: 0;
|
|
62
|
-
padding: 0;
|
|
63
|
-
margin: 0;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
font: inherit;
|
|
66
|
-
color: inherit;
|
|
67
|
-
text-shadow: unset;
|
|
68
|
-
user-select: none;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.visuallyHidden {
|
|
72
|
-
border: 0;
|
|
73
|
-
clip: rect(0 0 0 0);
|
|
74
|
-
height: 1px;
|
|
75
|
-
margin: -1px;
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
padding: 0;
|
|
78
|
-
position: absolute;
|
|
79
|
-
width: 1px;
|
|
80
|
-
white-space: nowrap;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
:where(.button) {
|
|
84
|
-
border-radius: var(--button_radius, 4px);
|
|
85
|
-
flex: var(--button_flex, none);
|
|
86
|
-
display: inline-flex;
|
|
87
|
-
align-items: center;
|
|
88
|
-
justify-content: var(--button-justify-content);
|
|
89
|
-
line-height: 0;
|
|
90
|
-
background-color: var(--button_bg);
|
|
91
|
-
color: var(--button_color, inherit);
|
|
92
|
-
gap: var(--button_gap, 4px);
|
|
93
|
-
height: var(--button_height);
|
|
94
|
-
font-size: var(--button_font_size);
|
|
95
|
-
padding-left: var(--button_padding);
|
|
96
|
-
padding-right: var(--button_padding);
|
|
97
|
-
--button_icon_width: auto;
|
|
98
|
-
background-clip: padding-box;
|
|
99
|
-
font-weight: 400;
|
|
100
|
-
box-sizing: border-box;
|
|
101
|
-
outline: none;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.button:where(.focus-visible:not(:disabled):focus-visible, .focus:not(:disabled):focus) {
|
|
105
|
-
box-shadow: var(--button_focus-shadow, 0 0 0 2px var(--global-focus-color));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.button:where(:disabled) {
|
|
109
|
-
cursor: default;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* Set size of svg icon in button */
|
|
113
|
-
.button :where(svg) {
|
|
114
|
-
width: var(--button_icon_size, var(--button_icon_width));
|
|
115
|
-
height: var(--button_icon_size, var(--button_icon_height));
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/* 02: Cross-color rules */
|
|
119
|
-
/* These rules apply across all color/intents */
|
|
120
|
-
|
|
121
|
-
/* All secondary buttons have no BG in default state: */
|
|
122
|
-
.button-level-secondary {
|
|
123
|
-
--button_bg: transparent;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* 03 Color specific rules */
|
|
127
|
-
/* Colors for different colors/intents */
|
|
128
|
-
|
|
129
|
-
/* 03A: 'Brand' colors */
|
|
130
|
-
/* Text colors */
|
|
131
|
-
.button-theme-brand:not(:disabled).button-level-secondary {
|
|
132
|
-
--button_color: var(--button_color_brand_secondary);
|
|
133
|
-
}
|
|
134
|
-
/* Bg colors */
|
|
135
|
-
.button-theme-brand:not(:disabled).button-level-primary {
|
|
136
|
-
--button_bg: var(--B500);
|
|
137
|
-
}
|
|
138
|
-
.button-theme-brand:not(:disabled).button-level-primary:where(:hover, [data-dropdownmenu-state='open']) {
|
|
139
|
-
--button_bg: var(--B600);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.button-theme-brand:not(:disabled).button-level-secondary:where(:hover, [data-dropdownmenu-state='open']) {
|
|
143
|
-
--button_bg: var(--button_bg_brand_secondary_hover);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/* 03B: 'Danger' colors */
|
|
147
|
-
/* Text colors */
|
|
148
|
-
.button-theme-danger:not(:disabled).button-level-secondary {
|
|
149
|
-
--button_color: var(--button_color_danger_secondary);
|
|
150
|
-
}
|
|
151
|
-
/* bg colors */
|
|
152
|
-
.button-theme-danger:not(:disabled).button-level-primary {
|
|
153
|
-
--button_bg: var(--R500);
|
|
154
|
-
}
|
|
155
|
-
.button-theme-danger:not(:disabled).button-level-primary:where(:hover, [data-dropdownmenu-state='open']) {
|
|
156
|
-
--button_bg: var(--R600);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.button-theme-danger:not(:disabled).button-level-secondary:where(:hover, [data-dropdownmenu-state='open']) {
|
|
160
|
-
--button_bg: var(--button_bg_danger_secondary_hover);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/* 03C: 'Accent' colors */
|
|
164
|
-
/* Text colors */
|
|
165
|
-
.button-theme-accent:not(:disabled).button-level-secondary {
|
|
166
|
-
--button_color: var(--button_color_accent_secondary);
|
|
167
|
-
}
|
|
168
|
-
/* bg colors */
|
|
169
|
-
.button-theme-accent:not(:disabled).button-level-primary {
|
|
170
|
-
--button_bg: var(--A500);
|
|
171
|
-
}
|
|
172
|
-
.button-theme-accent:not(:disabled).button-level-primary:where(:hover, [data-dropdownmenu-state='open']) {
|
|
173
|
-
--button_bg: var(--A600);
|
|
174
|
-
}
|
|
175
|
-
.button-theme-accent:not(:disabled).button-level-secondary:where(:hover, [data-dropdownmenu-state='open']) {
|
|
176
|
-
--button_bg: var(--button_bg_accent_secondary_hover);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/* 03D: 'Neutral' colors */
|
|
180
|
-
/* Text colors */
|
|
181
|
-
.button-theme-neutral:not(:disabled).button-level-primary {
|
|
182
|
-
--button_color: var(--button_color_neutral_primary);
|
|
183
|
-
}
|
|
184
|
-
.button-theme-neutral:not(:disabled).button-level-secondary {
|
|
185
|
-
--button_color: var(--button_color_neutral_secondary);
|
|
186
|
-
}
|
|
187
|
-
/* bg colors */
|
|
188
|
-
.button-theme-neutral:not(:disabled).button-level-primary {
|
|
189
|
-
--button_bg: var(--button_bg_neutral_primary);
|
|
190
|
-
}
|
|
191
|
-
.button-theme-neutral:not(:disabled).button-level-primary:where(:hover, [data-dropdownmenu-state='open']) {
|
|
192
|
-
--button_bg: var(--button_bg_neutral_primary_hover);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.button-theme-neutral:not(:disabled).button-level-secondary:where(:hover, [data-dropdownmenu-state='open']) {
|
|
196
|
-
--button_bg: var(--button_bg_neutral_secondary_hover);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.button:disabled {
|
|
200
|
-
/* text color */
|
|
201
|
-
--button_color: var(--button_color_disabled);
|
|
202
|
-
}
|
|
203
|
-
.button:disabled.button-level-primary {
|
|
204
|
-
/* bg color */
|
|
205
|
-
--button_bg: var(--button_bg_disabled_primary);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/* 05: UISize setup */
|
|
209
|
-
.button-size-xl {
|
|
210
|
-
--button_font_size: 18px;
|
|
211
|
-
--button_height: 56px;
|
|
212
|
-
--button_loading_size: 56px;
|
|
213
|
-
--button_icon_height: 24px;
|
|
214
|
-
--button_padding: 20px;
|
|
215
|
-
--button_gap: 8px;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.button-size-l {
|
|
219
|
-
--button_font_size: 18px;
|
|
220
|
-
--button_height: 48px;
|
|
221
|
-
--button_loading_size: 24px;
|
|
222
|
-
--button_icon_height: 24px;
|
|
223
|
-
--button_padding: 16px;
|
|
224
|
-
--button_gap: 8px;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.button-size-m {
|
|
228
|
-
--button_font_size: 16px;
|
|
229
|
-
--button_height: 40px;
|
|
230
|
-
--button_loading_size: 20px;
|
|
231
|
-
--button_icon_height: 20px;
|
|
232
|
-
--button_padding: 12px;
|
|
233
|
-
--button_gap: 8px;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.button-size-s {
|
|
237
|
-
--button_font_size: 14px;
|
|
238
|
-
--button_height: 32px;
|
|
239
|
-
--button_loading_size: 16px;
|
|
240
|
-
--button_icon_height: 16px;
|
|
241
|
-
--button_padding: 8px;
|
|
242
|
-
--button_gap: 4px;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.button-size-xs {
|
|
246
|
-
--button_font_size: 12px;
|
|
247
|
-
--button_height: 24px;
|
|
248
|
-
--button_loading_size: 12px;
|
|
249
|
-
--button_icon_height: 12px;
|
|
250
|
-
--button_padding: 8px;
|
|
251
|
-
--button_gap: 4px;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.button-size-xxs {
|
|
255
|
-
--button_font_size: 12px;
|
|
256
|
-
--button_height: 20px;
|
|
257
|
-
--button_loading_size: 12px;
|
|
258
|
-
--button_icon_height: 12px;
|
|
259
|
-
--button_padding: 4px;
|
|
260
|
-
--button_gap: 2px;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/* 06: Size adjustments for Icon Only buttons. */
|
|
264
|
-
/* The icons are a bit bigger than when it is text + icon: */
|
|
265
|
-
.button-icon-only.button-size-xl {
|
|
266
|
-
--button_icon_height: 28px;
|
|
267
|
-
--button_padding: 13px;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.button-icon-only.button-size-l {
|
|
271
|
-
--button_icon_height: 28px;
|
|
272
|
-
--button_padding: 9px;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.button-icon-only.button-size-m {
|
|
276
|
-
--button_icon_height: 24px;
|
|
277
|
-
--button_padding: 7px;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.button-icon-only.button-size-s {
|
|
281
|
-
--button_icon_height: 20px;
|
|
282
|
-
--button_padding: 5px;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.button-icon-only.button-size-xs {
|
|
286
|
-
--button_icon_height: 18px;
|
|
287
|
-
--button_padding: 1.5px;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.button-icon-only.button-size-xxs {
|
|
291
|
-
--button_icon_height: 14px;
|
|
292
|
-
--button_padding: 1.5px;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.button-icon-only {
|
|
296
|
-
min-width: var(--button_height);
|
|
297
|
-
place-content: center;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/* Loading styles */
|
|
301
|
-
@keyframes spin {
|
|
302
|
-
to {
|
|
303
|
-
transform: rotate(360deg);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
:where(.loading) {
|
|
307
|
-
color: transparent;
|
|
308
|
-
pointer-events: none;
|
|
309
|
-
position: relative;
|
|
310
|
-
& > * {
|
|
311
|
-
visibility: hidden;
|
|
312
|
-
}
|
|
313
|
-
&::after {
|
|
314
|
-
content: '';
|
|
315
|
-
position: absolute;
|
|
316
|
-
top: calc(50% - var(--button_loading_size) * 0.5);
|
|
317
|
-
left: calc(50% - var(--button_loading_size) * 0.5);
|
|
318
|
-
display: block;
|
|
319
|
-
width: var(--button_loading_size);
|
|
320
|
-
aspect-ratio: 1;
|
|
321
|
-
border: calc(var(--button_loading_size) / 8) solid var(--button_color);
|
|
322
|
-
border-top-color: transparent;
|
|
323
|
-
border-radius: 50%;
|
|
324
|
-
box-sizing: border-box;
|
|
325
|
-
animation: spin 1s linear infinite;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/* 07 LinkButton */
|
|
330
|
-
/* LinkButton uses the same styles as Button but applies to an <a> element. */
|
|
331
|
-
/* This rule handle some extra resets we need to do for links: */
|
|
332
|
-
.linkButton {
|
|
333
|
-
text-decoration: none;
|
|
334
|
-
width: fit-content;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/* 08 ToggleButton */
|
|
338
|
-
|
|
339
|
-
.label {
|
|
340
|
-
display: flex;
|
|
341
|
-
width: max-content;
|
|
342
|
-
&:not(:has(:disabled, .loading)) {
|
|
343
|
-
cursor: pointer;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/* inactive/unchecked styles: */
|
|
348
|
-
|
|
349
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton.button-level-secondary {
|
|
350
|
-
--button_color: var(--button_color_toggle_secondary_unchecked);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton.button-level-primary.button-theme-brand {
|
|
354
|
-
--button_color: var(--button_color_toggle_primary_brand);
|
|
355
|
-
}
|
|
356
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton.button-level-primary.button-theme-accent {
|
|
357
|
-
--button_color: var(--button_color_toggle_primary_accent);
|
|
358
|
-
}
|
|
359
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton.button-level-primary.button-theme-danger {
|
|
360
|
-
--button_color: var(--Red);
|
|
361
|
-
}
|
|
362
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton.button-level-primary.button-theme-neutral {
|
|
363
|
-
--button_color: var(--N500);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton {
|
|
367
|
-
--button_bg: var(--button_bg_toggle_primary_unchecked);
|
|
368
|
-
}
|
|
369
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton.button-level-secondary {
|
|
370
|
-
--button_bg: transparent;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton.button-level-primary:hover {
|
|
374
|
-
--button_bg: var(--button_bg_toggle_primary_unchecked_hover);
|
|
375
|
-
}
|
|
376
|
-
.checkbox:not(:checked):not(:disabled) + .toggleButton.button-level-secondary:hover {
|
|
377
|
-
--button_bg: var(--button_bg_toggle_secondary_unchecked_hover);
|
|
378
|
-
}
|
|
379
|
-
/* disabled checkbox styles: */
|
|
380
|
-
.checkbox:disabled + .toggleButton {
|
|
381
|
-
cursor: default;
|
|
382
|
-
pointer-events: none;
|
|
383
|
-
/* text color */
|
|
384
|
-
--button_color: var(--button_color_disabled);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
.checkbox:disabled + .toggleButton.button-level-primary {
|
|
388
|
-
/* bg color */
|
|
389
|
-
--button_bg: var(--button_bg_disabled_primary);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.checkbox:where(.focus-visible:not(:disabled):focus-visible, .focus:not(:disabled):focus) + .toggleButton {
|
|
393
|
-
box-shadow: var(--button_focus-shadow, 0 0 0 2px var(--global-focus-color));
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
.group {
|
|
397
|
-
display: flex;
|
|
398
|
-
border-radius: var(--button_radius, 4px);
|
|
399
|
-
|
|
400
|
-
&:where(.isverticalhug) {
|
|
401
|
-
height: max-content;
|
|
402
|
-
}
|
|
403
|
-
&:where(.ishorizontalhug) {
|
|
404
|
-
width: max-content;
|
|
405
|
-
}
|
|
406
|
-
&:where(.ishorizontalfill, .isverticalfill) {
|
|
407
|
-
--button_flex: 1 0 auto;
|
|
408
|
-
}
|
|
409
|
-
&:where(.ishorizontal.isverticalfill) {
|
|
410
|
-
& > * {
|
|
411
|
-
--button_height: auto;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
&:where(.ishorizontal) {
|
|
416
|
-
& > .button:not(:last-child),
|
|
417
|
-
& > *:not(:last-child) .button {
|
|
418
|
-
border-top-right-radius: 0;
|
|
419
|
-
border-bottom-right-radius: 0;
|
|
420
|
-
}
|
|
421
|
-
& > .button:not(:first-child),
|
|
422
|
-
& > *:not(:first-child) .button {
|
|
423
|
-
border-top-left-radius: 0;
|
|
424
|
-
border-bottom-left-radius: 0;
|
|
425
|
-
&::before {
|
|
426
|
-
width: 1px;
|
|
427
|
-
top: 0;
|
|
428
|
-
bottom: 0;
|
|
429
|
-
left: 0;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
&:where(.isvertical) {
|
|
434
|
-
flex-direction: column;
|
|
435
|
-
& > .button:not(:last-child),
|
|
436
|
-
& > *:not(:last-child) .button {
|
|
437
|
-
border-bottom-left-radius: 0;
|
|
438
|
-
border-bottom-right-radius: 0;
|
|
439
|
-
}
|
|
440
|
-
& > .button:not(:first-child),
|
|
441
|
-
& > *:not(:first-child) .button {
|
|
442
|
-
border-top-left-radius: 0;
|
|
443
|
-
border-top-right-radius: 0;
|
|
444
|
-
&::before {
|
|
445
|
-
height: 1px;
|
|
446
|
-
right: 0;
|
|
447
|
-
top: 0;
|
|
448
|
-
left: 0;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
& > .button:not(:first-child),
|
|
454
|
-
& > *:not(:first-child) .button {
|
|
455
|
-
position: relative;
|
|
456
|
-
&::before {
|
|
457
|
-
position: absolute;
|
|
458
|
-
display: block;
|
|
459
|
-
content: '';
|
|
460
|
-
background-color: color-mix(in srgb, var(--button_bg) 70%, white);
|
|
461
|
-
align-self: stretch;
|
|
462
|
-
}
|
|
463
|
-
&.button-theme-neutral.button-level-primary::before {
|
|
464
|
-
background-color: var(
|
|
465
|
-
--button_group_divider_color_netural_primary,
|
|
466
|
-
color-mix(in srgb, var(--button_bg) 70%, white)
|
|
467
|
-
);
|
|
468
|
-
}
|
|
469
|
-
&.button-level-secondary::before {
|
|
470
|
-
background-color: rgb(from var(--global-text-primary) r g b / 0.25);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
&:has(*:focus-visible, [data-dropdownmenu-state='open']) {
|
|
475
|
-
box-shadow: var(--button_focus-shadow, 0 0 0 2px rgb(from var(--global-focus-color) r g b / 0.3));
|
|
476
|
-
}
|
|
477
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Wraps a provided Link component in our button styles.
|
|
4
|
-
* Assumes your chosen Router library uses a Link component that uses a `to` prop.
|
|
5
|
-
*/
|
|
6
|
-
export declare const LinkButton: React.ForwardRefExoticComponent<Omit<import("./Button.types").ButtonProps, "loading"> & {
|
|
7
|
-
to: string;
|
|
8
|
-
Component: React.ForwardRefExoticComponent<import("react-router/dist/development/fog-of-war-DU_DzpDb").s & React.RefAttributes<HTMLAnchorElement>>;
|
|
9
|
-
} & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import s from './button.module.css';
|
|
5
|
-
import { Tooltip } from '../tooltip/tooltip.component';
|
|
6
|
-
/**
|
|
7
|
-
* Wraps a provided Link component in our button styles.
|
|
8
|
-
* Assumes your chosen Router library uses a Link component that uses a `to` prop.
|
|
9
|
-
*/
|
|
10
|
-
export const LinkButton = forwardRef(({ to, tooltip, className, level = 'primary', variant = 'brand', scale = 'm', iconOnly = false, children, Component, focus = 'visible', ...args }, ref) => {
|
|
11
|
-
const linkClasses = clsx(s.button, s.linkButton, s[`button-level-${level}`], s[`button-theme-${variant}`], s[`button-size-${scale}`], iconOnly && s[`button-icon-only`], focus === 'focus' && [s.focus], focus === 'visible' && s[`focus-visible`], className);
|
|
12
|
-
const link = (React.createElement(Component, { ref: ref, className: linkClasses, ...args, to: to }, children));
|
|
13
|
-
if (tooltip) {
|
|
14
|
-
return (React.createElement(Tooltip, { content: tooltip, padding: "s" }, link));
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
return link;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
LinkButton.displayName = 'LinkButton';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* A checkbox styled to look like our Button, for a toggleable state UI component.
|
|
4
|
-
*/
|
|
5
|
-
export declare const ToggleButton: React.ForwardRefExoticComponent<Omit<import("./Button.types").ButtonProps, "variant"> & {
|
|
6
|
-
labelClassName?: string | undefined;
|
|
7
|
-
contentClassName?: string | undefined;
|
|
8
|
-
active?: boolean | undefined;
|
|
9
|
-
variant?: "brand" | "accent" | undefined;
|
|
10
|
-
} & React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import s from './button.module.css';
|
|
4
|
-
import { Tooltip } from '../tooltip/tooltip.component';
|
|
5
|
-
/**
|
|
6
|
-
* A checkbox styled to look like our Button, for a toggleable state UI component.
|
|
7
|
-
*/
|
|
8
|
-
export const ToggleButton = forwardRef(({ tooltip, onChange, labelClassName, contentClassName, active, disabled = false, children, level = 'primary', variant = 'brand', scale = 'm', iconOnly = false, focus = 'visible', loading = false, ...restProps }, ref) => {
|
|
9
|
-
const controlled = typeof active === 'undefined' ? {} : { checked: active };
|
|
10
|
-
const labelClassNames = clsx(disabled && s.isDisabled, s.label, contentClassName);
|
|
11
|
-
const childrenClassNames = clsx(s.button, s.toggleButton, s[`button-level-${level}`], s[`button-theme-${variant}`], s[`button-size-${scale}`], loading && s.loading, iconOnly && s[`button-icon-only`], labelClassName);
|
|
12
|
-
const checkboxClassNames = clsx(s.checkbox, s.visuallyHidden, focus === 'focus' && [s.focus], focus === 'visible' && s[`focus-visible`]);
|
|
13
|
-
const renderContent = (React.createElement("label", { className: labelClassNames },
|
|
14
|
-
React.createElement("input", { ref: ref, type: "checkbox", onChange: onChange, disabled: disabled || loading, ...controlled, ...restProps, className: checkboxClassNames }),
|
|
15
|
-
React.createElement("span", { className: childrenClassNames }, children)));
|
|
16
|
-
if (!tooltip) {
|
|
17
|
-
return renderContent;
|
|
18
|
-
}
|
|
19
|
-
return (React.createElement(Tooltip, { content: tooltip, padding: "s" }, renderContent));
|
|
20
|
-
});
|
|
21
|
-
ToggleButton.displayName = 'ToggleButton';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
:global .theme--dark {
|
|
2
|
-
--tooltip_bg: var(--Gl600);
|
|
3
|
-
--tooltip_color: var(--N50);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
:global .theme--light {
|
|
7
|
-
--tooltip_bg: var(--N0);
|
|
8
|
-
--tooltip_color: var(--N600);
|
|
9
|
-
}
|
|
10
|
-
:where(.tooltip_content) {
|
|
11
|
-
font-size: 12px;
|
|
12
|
-
line-height: 1.4;
|
|
13
|
-
color: var(--tooltip_color);
|
|
14
|
-
background-color: var(--tooltip_bg);
|
|
15
|
-
opacity: 1;
|
|
16
|
-
filter: drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.24)) drop-shadow(0px 8px 24px rgba(0, 0, 0, 0.08));
|
|
17
|
-
max-width: min(500px, 90vw);
|
|
18
|
-
z-index: var(--tooltip-z-custom);
|
|
19
|
-
border-radius: 3px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.tooltip_content.tooltip_padding_s {
|
|
23
|
-
padding: 4px;
|
|
24
|
-
}
|
|
25
|
-
.tooltip_content.tooltip_padding_m {
|
|
26
|
-
padding: 8px;
|
|
27
|
-
}
|
|
28
|
-
.tooltip_content.tooltip_padding_l {
|
|
29
|
-
padding: 12px;
|
|
30
|
-
}
|
|
31
|
-
.tooltip_content.tooltip_padding_xl {
|
|
32
|
-
padding: 16px;
|
|
33
|
-
}
|
|
34
|
-
.tooltip_content.tooltip_padding_custom {
|
|
35
|
-
padding: var(--tooltip_padding);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.tooltip_arrow {
|
|
39
|
-
fill: var(--tooltip_bg);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.tooltip_reset_button {
|
|
43
|
-
all: unset;
|
|
44
|
-
}
|