@ckwag/elements 0.0.1-dev.3a85b8f → 0.0.1-dev.886549d
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/Badge/Badge.css +13 -0
- package/dist/Button/Button.css +76 -39
- package/dist/Button/Button.d.ts +11 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +22 -3
- package/dist/Button/Button.js.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.css +23 -0
- package/package.json +3 -3
package/dist/Badge/Badge.css
CHANGED
|
@@ -105,3 +105,16 @@
|
|
|
105
105
|
overflow: hidden;
|
|
106
106
|
text-overflow: ellipsis;
|
|
107
107
|
}
|
|
108
|
+
|
|
109
|
+
/* ============================================
|
|
110
|
+
Windows High Contrast (forced colors)
|
|
111
|
+
The background disappears there; a border keeps the badge shape.
|
|
112
|
+
============================================ */
|
|
113
|
+
|
|
114
|
+
@media (forced-colors: active) {
|
|
115
|
+
/* outline instead of border: keeps the badge at its normal size */
|
|
116
|
+
.ckw-badge {
|
|
117
|
+
outline: var(--border-weight-s) solid CanvasText;
|
|
118
|
+
outline-offset: calc(-1 * var(--border-weight-s));
|
|
119
|
+
}
|
|
120
|
+
}
|
package/dist/Button/Button.css
CHANGED
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Variants: Primary, Secondary, Tertiary
|
|
9
9
|
* Sizes: Large (default), Medium, Small
|
|
10
|
-
* States: Default, Hover, Active, Disabled
|
|
10
|
+
* States: Default, Hover, Active, Focus, Disabled, Loading
|
|
11
|
+
* Renders as <button>, or as <a> when `href` is set (disabled links use aria-disabled).
|
|
12
|
+
*
|
|
13
|
+
* Icons scale with the label (24px for Large, 20px for Medium and Small) and the
|
|
14
|
+
* side with an icon gets less padding (--has-leading-icon / --has-trailing-icon),
|
|
15
|
+
* so the button looks optically balanced, same as the Figma component.
|
|
11
16
|
*/
|
|
12
17
|
|
|
13
18
|
/* ============================================
|
|
@@ -15,6 +20,7 @@
|
|
|
15
20
|
============================================ */
|
|
16
21
|
|
|
17
22
|
.ckw-button {
|
|
23
|
+
box-sizing: border-box;
|
|
18
24
|
display: inline-flex;
|
|
19
25
|
align-items: center;
|
|
20
26
|
justify-content: center;
|
|
@@ -28,8 +34,6 @@
|
|
|
28
34
|
transition:
|
|
29
35
|
background-color 150ms ease,
|
|
30
36
|
background-image 150ms ease,
|
|
31
|
-
border-color 150ms ease,
|
|
32
|
-
border-width 150ms ease,
|
|
33
37
|
box-shadow 150ms ease,
|
|
34
38
|
opacity 150ms ease;
|
|
35
39
|
}
|
|
@@ -45,10 +49,11 @@
|
|
|
45
49
|
|
|
46
50
|
/* Large (default) — uses label-l tokens */
|
|
47
51
|
.ckw-button--large {
|
|
48
|
-
height:
|
|
49
|
-
min-width: 160px;
|
|
50
|
-
padding
|
|
51
|
-
padding-
|
|
52
|
+
height: var(--spacing-4xl);
|
|
53
|
+
min-width: 160px; /* no spacing token for 160 */
|
|
54
|
+
--ckw-button-padding: var(--spacing-l);
|
|
55
|
+
--ckw-button-padding-icon: var(--spacing-m);
|
|
56
|
+
--ckw-button-icon-size: var(--spacing-xl);
|
|
52
57
|
font-size: var(--label-l-size);
|
|
53
58
|
line-height: var(--label-l-height);
|
|
54
59
|
font-weight: var(--label-l-weight);
|
|
@@ -56,10 +61,11 @@
|
|
|
56
61
|
|
|
57
62
|
/* Medium — uses label-m tokens */
|
|
58
63
|
.ckw-button--medium {
|
|
59
|
-
height:
|
|
60
|
-
min-width: 144px;
|
|
61
|
-
padding
|
|
62
|
-
padding-
|
|
64
|
+
height: var(--spacing-4xl);
|
|
65
|
+
min-width: 144px; /* no spacing token for 144 */
|
|
66
|
+
--ckw-button-padding: var(--spacing-l);
|
|
67
|
+
--ckw-button-padding-icon: var(--spacing-m);
|
|
68
|
+
--ckw-button-icon-size: var(--spacing-l);
|
|
63
69
|
font-size: var(--label-m-size);
|
|
64
70
|
line-height: var(--label-m-height);
|
|
65
71
|
font-weight: var(--label-m-weight);
|
|
@@ -67,15 +73,30 @@
|
|
|
67
73
|
|
|
68
74
|
/* Small — uses label-m tokens */
|
|
69
75
|
.ckw-button--small {
|
|
70
|
-
height:
|
|
71
|
-
min-width:
|
|
72
|
-
padding
|
|
73
|
-
padding-
|
|
76
|
+
height: var(--spacing-3xl);
|
|
77
|
+
min-width: var(--spacing-8xl);
|
|
78
|
+
--ckw-button-padding: var(--spacing-m);
|
|
79
|
+
--ckw-button-padding-icon: var(--spacing-s);
|
|
80
|
+
--ckw-button-icon-size: var(--spacing-l);
|
|
74
81
|
font-size: var(--label-m-size);
|
|
75
82
|
line-height: var(--label-m-height);
|
|
76
83
|
font-weight: var(--label-m-weight);
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
/* Padding: the side with an icon gets less padding */
|
|
87
|
+
.ckw-button {
|
|
88
|
+
padding-left: var(--ckw-button-padding);
|
|
89
|
+
padding-right: var(--ckw-button-padding);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ckw-button--has-leading-icon {
|
|
93
|
+
padding-left: var(--ckw-button-padding-icon);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ckw-button--has-trailing-icon {
|
|
97
|
+
padding-right: var(--ckw-button-padding-icon);
|
|
98
|
+
}
|
|
99
|
+
|
|
79
100
|
/* Full width */
|
|
80
101
|
.ckw-button--full-width {
|
|
81
102
|
width: 100%;
|
|
@@ -105,25 +126,25 @@
|
|
|
105
126
|
z-index: -1;
|
|
106
127
|
}
|
|
107
128
|
|
|
108
|
-
.ckw-button--primary:hover:not(:disabled)::before {
|
|
129
|
+
.ckw-button--primary:hover:not(:disabled, [aria-disabled='true'])::before {
|
|
109
130
|
opacity: 0;
|
|
110
131
|
}
|
|
111
132
|
|
|
112
|
-
.ckw-button--primary:active:not(:disabled) {
|
|
133
|
+
.ckw-button--primary:active:not(:disabled, [aria-disabled='true']) {
|
|
113
134
|
background-color: var(--interactive-primary-active);
|
|
114
135
|
}
|
|
115
136
|
|
|
116
|
-
.ckw-button--primary:active:not(:disabled)::before {
|
|
137
|
+
.ckw-button--primary:active:not(:disabled, [aria-disabled='true'])::before {
|
|
117
138
|
opacity: 0;
|
|
118
139
|
}
|
|
119
140
|
|
|
120
|
-
.ckw-button--primary:disabled {
|
|
141
|
+
.ckw-button--primary:is(:disabled, [aria-disabled='true']) {
|
|
121
142
|
opacity: 0.4;
|
|
122
143
|
box-shadow: none;
|
|
123
144
|
cursor: not-allowed;
|
|
124
145
|
}
|
|
125
146
|
|
|
126
|
-
.ckw-button--primary:disabled::before {
|
|
147
|
+
.ckw-button--primary:is(:disabled, [aria-disabled='true'])::before {
|
|
127
148
|
opacity: 1;
|
|
128
149
|
}
|
|
129
150
|
|
|
@@ -134,21 +155,20 @@
|
|
|
134
155
|
.ckw-button--secondary {
|
|
135
156
|
background-color: var(--interactive-secondary);
|
|
136
157
|
color: var(--text-on-interactive-secondary);
|
|
137
|
-
border:
|
|
138
|
-
box-shadow:
|
|
158
|
+
/* inset shadow instead of border: no extra layout space, no shift on active (as in Figma) */
|
|
159
|
+
box-shadow: inset 0 0 0 var(--border-weight-s) var(--interactive-primary);
|
|
139
160
|
}
|
|
140
161
|
|
|
141
|
-
.ckw-button--secondary:hover:not(:disabled) {
|
|
162
|
+
.ckw-button--secondary:hover:not(:disabled, [aria-disabled='true']) {
|
|
142
163
|
background-color: var(--interactive-secondary-hover);
|
|
143
164
|
}
|
|
144
165
|
|
|
145
|
-
.ckw-button--secondary:active:not(:disabled) {
|
|
166
|
+
.ckw-button--secondary:active:not(:disabled, [aria-disabled='true']) {
|
|
146
167
|
background-color: var(--interactive-secondary-active);
|
|
147
|
-
|
|
148
|
-
border-color: var(--border-active);
|
|
168
|
+
box-shadow: inset 0 0 0 var(--border-weight-m) var(--border-active);
|
|
149
169
|
}
|
|
150
170
|
|
|
151
|
-
.ckw-button--secondary:disabled {
|
|
171
|
+
.ckw-button--secondary:is(:disabled, [aria-disabled='true']) {
|
|
152
172
|
opacity: 0.4;
|
|
153
173
|
cursor: not-allowed;
|
|
154
174
|
}
|
|
@@ -164,15 +184,15 @@
|
|
|
164
184
|
box-shadow: none;
|
|
165
185
|
}
|
|
166
186
|
|
|
167
|
-
.ckw-button--tertiary:hover:not(:disabled) {
|
|
187
|
+
.ckw-button--tertiary:hover:not(:disabled, [aria-disabled='true']) {
|
|
168
188
|
background-color: var(--interactive-secondary-hover);
|
|
169
189
|
}
|
|
170
190
|
|
|
171
|
-
.ckw-button--tertiary:active:not(:disabled) {
|
|
191
|
+
.ckw-button--tertiary:active:not(:disabled, [aria-disabled='true']) {
|
|
172
192
|
background-color: var(--interactive-secondary-active);
|
|
173
193
|
}
|
|
174
194
|
|
|
175
|
-
.ckw-button--tertiary:disabled {
|
|
195
|
+
.ckw-button--tertiary:is(:disabled, [aria-disabled='true']) {
|
|
176
196
|
opacity: 0.4;
|
|
177
197
|
cursor: not-allowed;
|
|
178
198
|
}
|
|
@@ -185,8 +205,8 @@
|
|
|
185
205
|
display: flex;
|
|
186
206
|
align-items: center;
|
|
187
207
|
justify-content: center;
|
|
188
|
-
width:
|
|
189
|
-
height:
|
|
208
|
+
width: var(--ckw-button-icon-size);
|
|
209
|
+
height: var(--ckw-button-icon-size);
|
|
190
210
|
flex-shrink: 0;
|
|
191
211
|
}
|
|
192
212
|
|
|
@@ -199,11 +219,6 @@
|
|
|
199
219
|
Loading spinner
|
|
200
220
|
============================================ */
|
|
201
221
|
|
|
202
|
-
.ckw-button__spinner {
|
|
203
|
-
width: 20px;
|
|
204
|
-
height: 20px;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
222
|
.ckw-button--loading {
|
|
208
223
|
cursor: progress;
|
|
209
224
|
}
|
|
@@ -240,8 +255,7 @@
|
|
|
240
255
|
|
|
241
256
|
.ckw-button--state-active.ckw-button--secondary {
|
|
242
257
|
background-color: var(--interactive-secondary-active);
|
|
243
|
-
|
|
244
|
-
border-color: var(--border-active);
|
|
258
|
+
box-shadow: inset 0 0 0 var(--border-weight-m) var(--border-active);
|
|
245
259
|
}
|
|
246
260
|
|
|
247
261
|
.ckw-button--state-active.ckw-button--tertiary {
|
|
@@ -252,3 +266,26 @@
|
|
|
252
266
|
outline: var(--border-weight-m) solid var(--border-active);
|
|
253
267
|
outline-offset: 2px;
|
|
254
268
|
}
|
|
269
|
+
|
|
270
|
+
/* ============================================
|
|
271
|
+
Windows High Contrast (forced colors)
|
|
272
|
+
Backgrounds and shadows are removed there, so every button gets a real
|
|
273
|
+
border in the system button colour and the gradient layer is hidden.
|
|
274
|
+
============================================ */
|
|
275
|
+
|
|
276
|
+
@media (forced-colors: active) {
|
|
277
|
+
.ckw-button {
|
|
278
|
+
border: var(--border-weight-s) solid ButtonText;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.ckw-button--primary::before {
|
|
282
|
+
display: none;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.ckw-button:is(:disabled, [aria-disabled='true']) {
|
|
286
|
+
border-color: GrayText;
|
|
287
|
+
color: GrayText;
|
|
288
|
+
/* GrayText already signals "disabled", opacity would fade it twice */
|
|
289
|
+
opacity: 1;
|
|
290
|
+
}
|
|
291
|
+
}
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import './Button.css';
|
|
3
3
|
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
4
4
|
export type ButtonSize = 'large' | 'medium' | 'small';
|
|
5
|
-
export interface ButtonProps extends React.ComponentProps<'button'> {
|
|
5
|
+
export interface ButtonProps extends Omit<React.ComponentProps<'button'>, 'ref'> {
|
|
6
6
|
/** The visible button label. */
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/** Visual style variant. */
|
|
@@ -17,6 +17,15 @@ export interface ButtonProps extends React.ComponentProps<'button'> {
|
|
|
17
17
|
trailingIcon?: React.ReactNode;
|
|
18
18
|
/** Shows a spinner in the leading slot, sets aria-busy, and disables interaction. */
|
|
19
19
|
loading?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Renders the button as a link (`<a href>`) with the same look, for actions that navigate.
|
|
22
|
+
* Keeps native link behaviour (open in new tab, copy link, screen reader "link").
|
|
23
|
+
*/
|
|
24
|
+
href?: string;
|
|
25
|
+
/** Link target, only used together with `href`. */
|
|
26
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
27
|
+
/** Link rel, only used with `href`. Defaults to "noopener noreferrer" for target="_blank". */
|
|
28
|
+
rel?: string;
|
|
20
29
|
}
|
|
21
30
|
/**
|
|
22
31
|
* Primary UI component for user interaction.
|
|
@@ -25,5 +34,5 @@ export interface ButtonProps extends React.ComponentProps<'button'> {
|
|
|
25
34
|
* (Large, Medium, Small), and optional leading/trailing icons. All styling
|
|
26
35
|
* uses semantic design tokens — no hardcoded colors.
|
|
27
36
|
*/
|
|
28
|
-
export declare const Button: React.ForwardRefExoticComponent<
|
|
37
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
29
38
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;IAC9E,gCAAgC;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4BAA4B;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,qCAAqC;IACrC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,MAAM,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC;IACzC,8FAA8F;IAC9F,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,2GAgGlB,CAAC"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -8,7 +8,8 @@ import './Button.css';
|
|
|
8
8
|
* (Large, Medium, Small), and optional leading/trailing icons. All styling
|
|
9
9
|
* uses semantic design tokens — no hardcoded colors.
|
|
10
10
|
*/
|
|
11
|
-
export const Button = React.forwardRef(function Button({ children, variant = 'primary', size = 'large', disabled = false, fullWidth = false, leadingIcon, trailingIcon, loading = false, className, type = 'button', 'aria-busy': ariaBusy, ...props }, ref) {
|
|
11
|
+
export const Button = React.forwardRef(function Button({ children, variant = 'primary', size = 'large', disabled = false, fullWidth = false, leadingIcon, trailingIcon, loading = false, className, type = 'button', href, target, rel, 'aria-busy': ariaBusy, ...props }, ref) {
|
|
12
|
+
const isDisabled = disabled || loading;
|
|
12
13
|
const variantClass = `ckw-button--${variant}`;
|
|
13
14
|
const sizeClass = `ckw-button--${size.toLowerCase()}`;
|
|
14
15
|
const classes = [
|
|
@@ -17,14 +18,32 @@ export const Button = React.forwardRef(function Button({ children, variant = 'pr
|
|
|
17
18
|
sizeClass,
|
|
18
19
|
fullWidth ? 'ckw-button--full-width' : '',
|
|
19
20
|
loading ? 'ckw-button--loading' : '',
|
|
21
|
+
loading || leadingIcon ? 'ckw-button--has-leading-icon' : '',
|
|
22
|
+
trailingIcon ? 'ckw-button--has-trailing-icon' : '',
|
|
20
23
|
className ?? '',
|
|
21
24
|
]
|
|
22
25
|
.filter(Boolean)
|
|
23
26
|
.join(' ');
|
|
24
|
-
|
|
27
|
+
const content = (React.createElement(React.Fragment, null,
|
|
25
28
|
loading ? (React.createElement("span", { className: "ckw-button__icon ckw-button__spinner", "aria-hidden": "true" },
|
|
26
|
-
React.createElement(LoadingSpinner, { size: 24 }))) : (leadingIcon && React.createElement("span", { className: "ckw-button__icon" }, leadingIcon)),
|
|
29
|
+
React.createElement(LoadingSpinner, { size: size === 'large' ? 24 : 20 }))) : (leadingIcon && React.createElement("span", { className: "ckw-button__icon" }, leadingIcon)),
|
|
27
30
|
children,
|
|
28
31
|
trailingIcon && React.createElement("span", { className: "ckw-button__icon" }, trailingIcon)));
|
|
32
|
+
if (href !== undefined) {
|
|
33
|
+
const { onClick, tabIndex, ...anchorProps } = props;
|
|
34
|
+
return (React.createElement("a", { ...anchorProps, ref: ref, className: classes,
|
|
35
|
+
// Only `disabled` drops the href. While `loading` it stays, so setting
|
|
36
|
+
// loading inside onClick does not cancel the navigation of that click.
|
|
37
|
+
href: disabled ? undefined : href, role: disabled ? 'link' : undefined, tabIndex: isDisabled ? -1 : tabIndex, target: target, rel: target === '_blank' ? (rel ?? 'noopener noreferrer') : rel, "aria-disabled": isDisabled || anchorProps['aria-disabled'], "aria-busy": loading ? true : ariaBusy, onClick: (event) => {
|
|
38
|
+
// A link without href still dispatches clicks, a disabled button does not.
|
|
39
|
+
if (isDisabled) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
onClick?.(event);
|
|
45
|
+
} }, content));
|
|
46
|
+
}
|
|
47
|
+
return (React.createElement("button", { ...props, ref: ref, className: classes, type: type, disabled: isDisabled, "aria-busy": loading ? true : ariaBusy }, content));
|
|
29
48
|
});
|
|
30
49
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,cAAc,CAAC;AA+BtB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,SAAS,MAAM,CACb,EACE,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,OAAO,EACd,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,YAAY,EACZ,OAAO,GAAG,KAAK,EACf,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,IAAI,EACJ,MAAM,EACN,GAAG,EACH,WAAW,EAAE,QAAQ,EACrB,GAAG,KAAK,EACT,EACD,GAAG;IAEH,MAAM,UAAU,GAAG,QAAQ,IAAI,OAAO,CAAC;IACvC,MAAM,YAAY,GAAG,eAAe,OAAO,EAAE,CAAC;IAC9C,MAAM,SAAS,GAAG,eAAe,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;IACtD,MAAM,OAAO,GAAG;QACd,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,SAAS,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE;QACzC,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE;QACpC,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,EAAE;QAC5D,YAAY,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE;QACnD,SAAS,IAAI,EAAE;KAChB;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,MAAM,OAAO,GAAG,CACd;QACG,OAAO,CAAC,CAAC,CAAC,CACT,8BAAM,SAAS,EAAC,sCAAsC,iBAAa,MAAM;YACvE,oBAAC,cAAc,IAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAI,CAC/C,CACR,CAAC,CAAC,CAAC,CACF,WAAW,IAAI,8BAAM,SAAS,EAAC,kBAAkB,IAAE,WAAW,CAAQ,CACvE;QACA,QAAQ;QACR,YAAY,IAAI,8BAAM,SAAS,EAAC,kBAAkB,IAAE,YAAY,CAAQ,CACxE,CACJ,CAAC;IAEF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,GACzC,KAAiE,CAAC;QACpE,OAAO,CACL,8BACM,WAAW,EACf,GAAG,EAAE,GAAmC,EACxC,SAAS,EAAE,OAAO;YAClB,uEAAuE;YACvE,uEAAuE;YACvE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACjC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACnC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EACpC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,GAAG,mBAChD,UAAU,IAAI,WAAW,CAAC,eAAe,CAAC,eAC9C,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EACpC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACjB,2EAA2E;gBAC3E,IAAI,UAAU,EAAE,CAAC;oBACf,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;oBACxB,OAAO;gBACT,CAAC;gBACD,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC,IAEA,OAAO,CACN,CACL,CAAC;IACJ,CAAC;IAED,OAAO,CACL,mCACM,KAAK,EACT,GAAG,EAAE,GAAmC,EACxC,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,UAAU,eACT,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,IAEnC,OAAO,CACD,CACV,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -234,3 +234,26 @@
|
|
|
234
234
|
opacity: 0.4;
|
|
235
235
|
pointer-events: none;
|
|
236
236
|
}
|
|
237
|
+
|
|
238
|
+
/* ============================================
|
|
239
|
+
Windows High Contrast (forced colors)
|
|
240
|
+
The track shadow and the white indicator disappear there, so the track gets
|
|
241
|
+
a real border and the selected segment a Highlight border.
|
|
242
|
+
============================================ */
|
|
243
|
+
|
|
244
|
+
@media (forced-colors: active) {
|
|
245
|
+
/* outline instead of border: keeps the track at 40px */
|
|
246
|
+
.ckw-segmented-control {
|
|
247
|
+
outline: var(--border-weight-s) solid CanvasText;
|
|
248
|
+
outline-offset: calc(-1 * var(--border-weight-s));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* the transparent segment border would otherwise be forced to a visible colour */
|
|
252
|
+
.ckw-segmented-control__segment {
|
|
253
|
+
border-color: Canvas;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.ckw-segmented-control__indicator {
|
|
257
|
+
border: var(--border-weight-m) solid Highlight;
|
|
258
|
+
}
|
|
259
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckwag/elements",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.886549d",
|
|
4
4
|
"description": "CKW Elements UI Components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@radix-ui/react-select": "^2.4.1",
|
|
51
|
-
"@ckwag/elements-icons": "0.0.1-dev.
|
|
52
|
-
"@ckwag/elements-tokens": "0.0.1-dev.
|
|
51
|
+
"@ckwag/elements-icons": "0.0.1-dev.886549d",
|
|
52
|
+
"@ckwag/elements-tokens": "0.0.1-dev.886549d"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": ">=18 <20",
|