@ckwag/elements 0.0.1-dev.4ce9c14 → 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/README.md +18 -5
- package/dist/Badge/Badge.css +120 -0
- package/dist/Badge/Badge.d.ts +25 -0
- package/dist/Badge/Badge.d.ts.map +1 -0
- package/dist/Badge/Badge.js +42 -0
- package/dist/Badge/Badge.js.map +1 -0
- package/dist/Badge/index.d.ts +3 -0
- package/dist/Badge/index.d.ts.map +1 -0
- package/dist/Badge/index.js +2 -0
- package/dist/Badge/index.js.map +1 -0
- package/dist/Button/Button.css +78 -50
- package/dist/Button/Button.d.ts +12 -3
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +24 -3
- package/dist/Button/Button.js.map +1 -1
- package/dist/InlineMessage/InlineMessage.css +28 -38
- package/dist/InlineMessage/InlineMessage.d.ts +2 -2
- package/dist/InlineMessage/InlineMessage.d.ts.map +1 -1
- package/dist/InlineMessage/InlineMessage.js +8 -5
- package/dist/InlineMessage/InlineMessage.js.map +1 -1
- package/dist/InputField/InputField.css +41 -11
- package/dist/InputField/InputField.d.ts +8 -2
- package/dist/InputField/InputField.d.ts.map +1 -1
- package/dist/InputField/InputField.js +9 -2
- package/dist/InputField/InputField.js.map +1 -1
- package/dist/LoadingSpinner/LoadingSpinner.d.ts +15 -0
- package/dist/LoadingSpinner/LoadingSpinner.d.ts.map +1 -0
- package/dist/LoadingSpinner/LoadingSpinner.js +44 -0
- package/dist/LoadingSpinner/LoadingSpinner.js.map +1 -0
- package/dist/LoadingSpinner/index.d.ts +3 -0
- package/dist/LoadingSpinner/index.d.ts.map +1 -0
- package/dist/LoadingSpinner/index.js +2 -0
- package/dist/LoadingSpinner/index.js.map +1 -0
- package/dist/PasswordInput/PasswordInput.css +3 -7
- package/dist/PasswordInput/PasswordInput.js +1 -1
- package/dist/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.css +33 -9
- package/dist/SegmentedControl/SegmentedControl.d.ts +4 -4
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +4 -4
- package/dist/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/SegmentedControl/index.d.ts.map +1 -1
- package/dist/Select/Select.css +143 -0
- package/dist/Select/Select.d.ts +60 -0
- package/dist/Select/Select.d.ts.map +1 -0
- package/dist/Select/Select.js +55 -0
- package/dist/Select/Select.js.map +1 -0
- package/dist/Select/index.d.ts +3 -0
- package/dist/Select/index.d.ts.map +1 -0
- package/dist/Select/index.js +2 -0
- package/dist/Select/index.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +5 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -0
- package/dist/react/index.js.map +1 -1
- package/dist/styles.css +2 -0
- package/dist/styles.layered.css +7 -0
- package/package.json +9 -3
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
* Inline Message Styles
|
|
3
3
|
*
|
|
4
4
|
* Uses only semantic design tokens from @ckwag/elements-tokens.
|
|
5
|
-
* Variants: Info, Success, Error.
|
|
5
|
+
* Variants: Info, Success, Warning, Error.
|
|
6
6
|
* Responsive behavior follows the Figma Desktop/Mobile variants by default.
|
|
7
|
+
*
|
|
8
|
+
* Layout: the status bar is an inset flex item with rounded ends that stretches
|
|
9
|
+
* to the height of the content. The icon is as tall as one line of text and is
|
|
10
|
+
* top-aligned with the first line.
|
|
7
11
|
*/
|
|
8
12
|
|
|
9
13
|
/* ============================================
|
|
@@ -12,12 +16,15 @@
|
|
|
12
16
|
|
|
13
17
|
.ckw-inline-message {
|
|
14
18
|
--ckw-inline-message-status-color: var(--status-info-border);
|
|
19
|
+
--ckw-inline-message-gap: var(--spacing-s);
|
|
20
|
+
--ckw-inline-message-icon-size: var(--spacing-xl);
|
|
15
21
|
|
|
16
22
|
display: flex;
|
|
23
|
+
gap: var(--ckw-inline-message-gap);
|
|
17
24
|
width: 100%;
|
|
18
25
|
max-width: 100%;
|
|
19
|
-
|
|
20
|
-
border-radius: var(--border-radius-
|
|
26
|
+
padding: var(--spacing-m);
|
|
27
|
+
border-radius: var(--border-radius-m);
|
|
21
28
|
background-color: var(--background-default);
|
|
22
29
|
color: var(--text-primary);
|
|
23
30
|
font-family: var(--font-family-brand), sans-serif;
|
|
@@ -34,17 +41,22 @@
|
|
|
34
41
|
--ckw-inline-message-status-color: var(--status-success-border);
|
|
35
42
|
}
|
|
36
43
|
|
|
44
|
+
.ckw-inline-message--warning {
|
|
45
|
+
--ckw-inline-message-status-color: var(--status-warning-border);
|
|
46
|
+
}
|
|
47
|
+
|
|
37
48
|
.ckw-inline-message--error {
|
|
38
49
|
--ckw-inline-message-status-color: var(--status-error-border);
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
/* ============================================
|
|
42
|
-
Status
|
|
53
|
+
Status Bar
|
|
43
54
|
============================================ */
|
|
44
55
|
|
|
45
56
|
.ckw-inline-message__status {
|
|
46
|
-
flex: 0 0 var(--spacing-
|
|
47
|
-
|
|
57
|
+
flex: 0 0 var(--spacing-2xs);
|
|
58
|
+
align-self: stretch;
|
|
59
|
+
border-radius: var(--border-radius-full);
|
|
48
60
|
background-color: var(--ckw-inline-message-status-color);
|
|
49
61
|
}
|
|
50
62
|
|
|
@@ -56,26 +68,20 @@
|
|
|
56
68
|
display: flex;
|
|
57
69
|
flex: 1 1 auto;
|
|
58
70
|
min-width: 0;
|
|
59
|
-
gap: var(--
|
|
71
|
+
gap: var(--ckw-inline-message-gap);
|
|
60
72
|
align-items: flex-start;
|
|
61
|
-
padding: var(--spacing-m) var(--spacing-l);
|
|
62
|
-
background-color: var(--background-default);
|
|
63
73
|
}
|
|
64
74
|
|
|
65
75
|
.ckw-inline-message__icon {
|
|
66
76
|
display: flex;
|
|
67
77
|
align-items: center;
|
|
68
78
|
justify-content: center;
|
|
69
|
-
flex: 0 0
|
|
70
|
-
width:
|
|
71
|
-
height:
|
|
79
|
+
flex: 0 0 var(--ckw-inline-message-icon-size);
|
|
80
|
+
width: var(--ckw-inline-message-icon-size);
|
|
81
|
+
height: var(--ckw-inline-message-icon-size);
|
|
72
82
|
color: var(--ckw-inline-message-status-color);
|
|
73
83
|
}
|
|
74
84
|
|
|
75
|
-
.ckw-inline-message--has-title .ckw-inline-message__icon {
|
|
76
|
-
margin-top: var(--spacing-2xs);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
85
|
.ckw-inline-message__icon > svg {
|
|
80
86
|
width: 100%;
|
|
81
87
|
height: 100%;
|
|
@@ -108,19 +114,9 @@
|
|
|
108
114
|
Mobile Breakpoint
|
|
109
115
|
============================================ */
|
|
110
116
|
|
|
111
|
-
.ckw-inline-message--breakpoint-mobile
|
|
112
|
-
gap: var(--spacing-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.ckw-inline-message--breakpoint-mobile .ckw-inline-message__icon {
|
|
117
|
-
flex-basis: var(--spacing-xl);
|
|
118
|
-
width: var(--spacing-xl);
|
|
119
|
-
height: var(--spacing-xl);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.ckw-inline-message--breakpoint-mobile.ckw-inline-message--has-title .ckw-inline-message__icon {
|
|
123
|
-
margin-top: var(--spacing-2xs);
|
|
117
|
+
.ckw-inline-message--breakpoint-mobile {
|
|
118
|
+
--ckw-inline-message-gap: var(--spacing-xs);
|
|
119
|
+
--ckw-inline-message-icon-size: var(--spacing-l);
|
|
124
120
|
}
|
|
125
121
|
|
|
126
122
|
.ckw-inline-message--breakpoint-mobile .ckw-inline-message__title {
|
|
@@ -136,15 +132,9 @@
|
|
|
136
132
|
}
|
|
137
133
|
|
|
138
134
|
@media (max-width: 767px) {
|
|
139
|
-
.ckw-inline-message:not(.ckw-inline-message--breakpoint-desktop)
|
|
140
|
-
gap: var(--spacing-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.ckw-inline-message:not(.ckw-inline-message--breakpoint-desktop) .ckw-inline-message__icon {
|
|
145
|
-
flex-basis: var(--spacing-xl);
|
|
146
|
-
width: var(--spacing-xl);
|
|
147
|
-
height: var(--spacing-xl);
|
|
135
|
+
.ckw-inline-message:not(.ckw-inline-message--breakpoint-desktop) {
|
|
136
|
+
--ckw-inline-message-gap: var(--spacing-xs);
|
|
137
|
+
--ckw-inline-message-icon-size: var(--spacing-l);
|
|
148
138
|
}
|
|
149
139
|
|
|
150
140
|
.ckw-inline-message:not(.ckw-inline-message--breakpoint-desktop) .ckw-inline-message__title {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './InlineMessage.css';
|
|
3
|
-
export type InlineMessageStatus = '
|
|
4
|
-
export type InlineMessageBreakpoint = '
|
|
3
|
+
export type InlineMessageStatus = 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
export type InlineMessageBreakpoint = 'auto' | 'desktop' | 'mobile';
|
|
5
5
|
export interface InlineMessageProps {
|
|
6
6
|
/** Optional headline shown above the body text. */
|
|
7
7
|
title?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineMessage.d.ts","sourceRoot":"","sources":["../../src/InlineMessage/InlineMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InlineMessage.d.ts","sourceRoot":"","sources":["../../src/InlineMessage/InlineMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,qBAAqB,CAAC;AAE7B,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAC3E,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,oCAAoC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,mEAAmE;IACnE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mGAAmG;IACnG,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,iDAAiD;IACjD,IAAI,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACtB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,MAAe,EACf,IAAI,EACJ,QAAe,EACf,UAAmB,EACnB,IAAa,EACb,SAAS,GACV,EAAE,kBAAkB,qBA8BpB"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IconCheckCircleFilled, IconInformation, IconWarningCircleFilled, } from '@ckwag/elements-icons';
|
|
2
|
+
import { IconCheckCircleFilled, IconInformation, IconWarningCircleFilled, IconWarningFilled, } from '@ckwag/elements-icons';
|
|
3
3
|
import './InlineMessage.css';
|
|
4
4
|
function InlineMessageDefaultIcon({ status }) {
|
|
5
|
-
if (status === '
|
|
5
|
+
if (status === 'success') {
|
|
6
6
|
return React.createElement(IconCheckCircleFilled, null);
|
|
7
7
|
}
|
|
8
|
-
if (status === '
|
|
8
|
+
if (status === 'warning') {
|
|
9
|
+
return React.createElement(IconWarningFilled, null);
|
|
10
|
+
}
|
|
11
|
+
if (status === 'error') {
|
|
9
12
|
return React.createElement(IconWarningCircleFilled, null);
|
|
10
13
|
}
|
|
11
14
|
return React.createElement(IconInformation, null);
|
|
@@ -16,13 +19,13 @@ function InlineMessageDefaultIcon({ status }) {
|
|
|
16
19
|
* Use it for non-time-critical status updates, confirmations, limitations,
|
|
17
20
|
* or errors that should remain visible near the related content.
|
|
18
21
|
*/
|
|
19
|
-
export function InlineMessage({ title, children, status = '
|
|
22
|
+
export function InlineMessage({ title, children, status = 'info', icon, showIcon = true, breakpoint = 'auto', role = 'note', className, }) {
|
|
20
23
|
const rootClasses = [
|
|
21
24
|
'ckw-inline-message',
|
|
22
25
|
`ckw-inline-message--${status.toLowerCase()}`,
|
|
23
26
|
title ? 'ckw-inline-message--has-title' : '',
|
|
24
27
|
showIcon ? 'ckw-inline-message--has-icon' : '',
|
|
25
|
-
breakpoint !== '
|
|
28
|
+
breakpoint !== 'auto' ? `ckw-inline-message--breakpoint-${breakpoint.toLowerCase()}` : '',
|
|
26
29
|
className ?? '',
|
|
27
30
|
]
|
|
28
31
|
.filter(Boolean)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineMessage.js","sourceRoot":"","sources":["../../src/InlineMessage/InlineMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,uBAAuB,
|
|
1
|
+
{"version":3,"file":"InlineMessage.js","sourceRoot":"","sources":["../../src/InlineMessage/InlineMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,qBAAqB,CAAC;AA4B7B,SAAS,wBAAwB,CAAC,EAAE,MAAM,EAAiC;IACzE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,oBAAC,qBAAqB,OAAG,CAAC;IACnC,CAAC;IAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,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,EAAC,0BAA0B,IAAE,QAAQ,CAAO,CACtD,CACF,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Border strategy (no layout shift):
|
|
8
8
|
* - The base border is always border-weight-s (1px) via CSS border.
|
|
9
|
-
* - Hover
|
|
9
|
+
* - Hover turns the 1px border green (border-active); the outline ring is reserved for focus.
|
|
10
|
+
* - Focus keeps the white field and adds the green border plus a soft outline ring.
|
|
10
11
|
* - Active/Focus uses an inset box-shadow for the thick active border
|
|
11
12
|
* to avoid changing border-width (which causes layout shift).
|
|
12
13
|
* - Error uses the same inset box-shadow technique.
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
font-size: var(--label-s-size);
|
|
49
50
|
line-height: var(--label-s-height);
|
|
50
51
|
font-weight: var(--label-s-weight);
|
|
51
|
-
color: var(--text-
|
|
52
|
+
color: var(--text-secondary);
|
|
52
53
|
overflow: hidden;
|
|
53
54
|
text-overflow: ellipsis;
|
|
54
55
|
white-space: nowrap;
|
|
@@ -124,7 +125,7 @@
|
|
|
124
125
|
/* Hover — soft green outline */
|
|
125
126
|
.ckw-input-field:not(.ckw-input-field--error):not(.ckw-input-field--disabled)
|
|
126
127
|
.ckw-input-field__inner:hover {
|
|
127
|
-
|
|
128
|
+
border-color: var(--border-active);
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
/* Focus — green outline + dark green inset shadow + green background */
|
|
@@ -133,7 +134,6 @@
|
|
|
133
134
|
outline-color: var(--border-hover);
|
|
134
135
|
border-color: var(--border-active);
|
|
135
136
|
box-shadow: inset 0 0 0 1px var(--border-active);
|
|
136
|
-
background-color: var(--background-active);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
/* ============================================
|
|
@@ -149,9 +149,9 @@
|
|
|
149
149
|
padding: 0;
|
|
150
150
|
margin: 0;
|
|
151
151
|
font-family: var(--font-family-brand), sans-serif;
|
|
152
|
-
font-size: var(--body-m-
|
|
153
|
-
line-height: var(--body-m-
|
|
154
|
-
font-weight: var(--body-m-
|
|
152
|
+
font-size: var(--body-m-size);
|
|
153
|
+
line-height: var(--body-m-height);
|
|
154
|
+
font-weight: var(--body-m-weight);
|
|
155
155
|
color: var(--text-primary);
|
|
156
156
|
text-overflow: ellipsis;
|
|
157
157
|
white-space: nowrap;
|
|
@@ -162,6 +162,20 @@
|
|
|
162
162
|
color: var(--text-tertiary);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
/* ============================================
|
|
166
|
+
Prefix / Suffix
|
|
167
|
+
============================================ */
|
|
168
|
+
|
|
169
|
+
.ckw-input-field__affix {
|
|
170
|
+
flex-shrink: 0;
|
|
171
|
+
font-family: var(--font-family-brand), sans-serif;
|
|
172
|
+
font-size: var(--body-m-size);
|
|
173
|
+
line-height: var(--body-m-height);
|
|
174
|
+
font-weight: var(--body-m-weight);
|
|
175
|
+
color: var(--text-secondary);
|
|
176
|
+
white-space: nowrap;
|
|
177
|
+
}
|
|
178
|
+
|
|
165
179
|
/* ============================================
|
|
166
180
|
Trailing Icon
|
|
167
181
|
============================================ */
|
|
@@ -173,7 +187,7 @@
|
|
|
173
187
|
width: 20px;
|
|
174
188
|
height: 20px;
|
|
175
189
|
flex-shrink: 0;
|
|
176
|
-
color: var(--text-
|
|
190
|
+
color: var(--text-secondary);
|
|
177
191
|
}
|
|
178
192
|
|
|
179
193
|
.ckw-input-field__icon > svg {
|
|
@@ -181,6 +195,23 @@
|
|
|
181
195
|
height: 100%;
|
|
182
196
|
}
|
|
183
197
|
|
|
198
|
+
/* ============================================
|
|
199
|
+
Description (help text)
|
|
200
|
+
============================================ */
|
|
201
|
+
|
|
202
|
+
.ckw-input-field__description {
|
|
203
|
+
margin: 0;
|
|
204
|
+
font-family: var(--font-family-brand), sans-serif;
|
|
205
|
+
font-size: var(--caption-size);
|
|
206
|
+
line-height: var(--caption-height);
|
|
207
|
+
font-weight: var(--caption-weight);
|
|
208
|
+
color: var(--text-secondary);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ckw-input-field--disabled .ckw-input-field__description {
|
|
212
|
+
color: var(--text-tertiary);
|
|
213
|
+
}
|
|
214
|
+
|
|
184
215
|
/* ============================================
|
|
185
216
|
Error State
|
|
186
217
|
============================================ */
|
|
@@ -245,6 +276,7 @@
|
|
|
245
276
|
color: var(--text-tertiary);
|
|
246
277
|
}
|
|
247
278
|
|
|
279
|
+
.ckw-input-field--disabled .ckw-input-field__affix,
|
|
248
280
|
.ckw-input-field--disabled .ckw-input-field__icon {
|
|
249
281
|
color: var(--text-tertiary);
|
|
250
282
|
}
|
|
@@ -255,7 +287,7 @@
|
|
|
255
287
|
|
|
256
288
|
.ckw-input-field--state-hover:not(.ckw-input-field--error):not(.ckw-input-field--disabled)
|
|
257
289
|
.ckw-input-field__inner {
|
|
258
|
-
|
|
290
|
+
border-color: var(--border-active);
|
|
259
291
|
}
|
|
260
292
|
|
|
261
293
|
.ckw-input-field--state-active:not(.ckw-input-field--error):not(.ckw-input-field--disabled)
|
|
@@ -263,7 +295,6 @@
|
|
|
263
295
|
outline-color: var(--border-hover);
|
|
264
296
|
border-color: var(--border-active);
|
|
265
297
|
box-shadow: inset 0 0 0 1px var(--border-active);
|
|
266
|
-
background-color: var(--background-active);
|
|
267
298
|
}
|
|
268
299
|
|
|
269
300
|
.ckw-input-field--state-focus-visible:not(.ckw-input-field--error):not(.ckw-input-field--disabled)
|
|
@@ -271,5 +302,4 @@
|
|
|
271
302
|
outline-color: var(--border-hover);
|
|
272
303
|
border-color: var(--border-active);
|
|
273
304
|
box-shadow: inset 0 0 0 1px var(--border-active);
|
|
274
|
-
background-color: var(--background-active);
|
|
275
305
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './InputField.css';
|
|
3
|
-
export type InputFieldState = '
|
|
4
|
-
export interface InputFieldProps extends Omit<React.ComponentProps<'input'>, 'className' | 'type'> {
|
|
3
|
+
export type InputFieldState = 'default' | 'hover' | 'active' | 'error' | 'disabled';
|
|
4
|
+
export interface InputFieldProps extends Omit<React.ComponentProps<'input'>, 'className' | 'type' | 'prefix'> {
|
|
5
5
|
/** Label text above the input. */
|
|
6
6
|
label?: string;
|
|
7
7
|
/** Placeholder text shown when empty. */
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
/** Whether the field is optional (shows "(optional)" next to label). */
|
|
10
10
|
optional?: boolean;
|
|
11
|
+
/** Help text shown below the input, e.g. where to find a contract number. */
|
|
12
|
+
description?: React.ReactNode;
|
|
11
13
|
/** Error text shown below the input. Pass a non-empty string to trigger the error state. */
|
|
12
14
|
errorText?: string;
|
|
15
|
+
/** Short text before the value inside the field, e.g. a currency such as "CHF". */
|
|
16
|
+
prefix?: string;
|
|
17
|
+
/** Short text after the value inside the field, e.g. a unit such as "kWp". */
|
|
18
|
+
suffix?: string;
|
|
13
19
|
/** Trailing icon inside the input. */
|
|
14
20
|
icon?: React.ReactNode;
|
|
15
21
|
/** Info icon next to the label. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.d.ts","sourceRoot":"","sources":["../../src/InputField/InputField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,kBAAkB,CAAC;AAE1B,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAEpF,MAAM,WAAW,eAAgB,SAAQ,IAAI,
|
|
1
|
+
{"version":3,"file":"InputField.d.ts","sourceRoot":"","sources":["../../src/InputField/InputField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,kBAAkB,CAAC;AAE1B,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAEpF,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAC7B,WAAW,GAAG,MAAM,GAAG,QAAQ,CAChC;IACC,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,4FAA4F;IAC5F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACzD,iCAAiC;IACjC,IAAI,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACpC;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,uGA2GrB,CAAC"}
|
|
@@ -10,12 +10,16 @@ import './InputField.css';
|
|
|
10
10
|
* Hover and Active states are handled via CSS pseudo-classes in real usage;
|
|
11
11
|
* the explicit state prop is primarily for Storybook documentation.
|
|
12
12
|
*/
|
|
13
|
-
export const InputField = React.forwardRef(function InputField({ label = 'Label', placeholder = 'Placeholder', disabled = false, optional = false, errorText, icon, showInfo = false, onInfoClick, type = 'text', id, className, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, ...inputProps }, ref) {
|
|
13
|
+
export const InputField = React.forwardRef(function InputField({ label = 'Label', placeholder = 'Placeholder', disabled = false, optional = false, description, errorText, prefix, suffix, icon, showInfo = false, onInfoClick, type = 'text', id, className, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, ...inputProps }, ref) {
|
|
14
14
|
const hasError = Boolean(errorText);
|
|
15
15
|
const reactId = React.useId();
|
|
16
16
|
const inputId = id ?? `ckw-input-${reactId}`;
|
|
17
17
|
const errorId = hasError ? `ckw-input-error-${reactId}` : undefined;
|
|
18
|
-
const
|
|
18
|
+
const prefixId = prefix ? `ckw-input-prefix-${reactId}` : undefined;
|
|
19
|
+
const suffixId = suffix ? `ckw-input-suffix-${reactId}` : undefined;
|
|
20
|
+
const descriptionId = description ? `ckw-input-description-${reactId}` : undefined;
|
|
21
|
+
const describedBy = [ariaDescribedBy, prefixId, suffixId, descriptionId, errorId].filter(Boolean).join(' ') ||
|
|
22
|
+
undefined;
|
|
19
23
|
const rootClasses = [
|
|
20
24
|
'ckw-input-field',
|
|
21
25
|
hasError && 'ckw-input-field--error',
|
|
@@ -32,8 +36,11 @@ export const InputField = React.forwardRef(function InputField({ label = 'Label'
|
|
|
32
36
|
React.createElement(IconInformation, { size: 18 })))),
|
|
33
37
|
React.createElement("div", { className: "ckw-input-field__outer" },
|
|
34
38
|
React.createElement("div", { className: "ckw-input-field__inner" },
|
|
39
|
+
prefix && (React.createElement("span", { className: "ckw-input-field__affix", id: prefixId }, prefix)),
|
|
35
40
|
React.createElement("input", { ...inputProps, ref: ref, className: "ckw-input-field__input", id: inputId, type: type, placeholder: placeholder, disabled: disabled, "aria-invalid": hasError ? true : ariaInvalid, "aria-describedby": describedBy }),
|
|
41
|
+
suffix && (React.createElement("span", { className: "ckw-input-field__affix", id: suffixId }, suffix)),
|
|
36
42
|
icon && React.createElement("span", { className: "ckw-input-field__icon" }, icon))),
|
|
43
|
+
description && (React.createElement("p", { className: "ckw-input-field__description", id: descriptionId }, description)),
|
|
37
44
|
hasError && (React.createElement("div", { className: "ckw-input-field__error", id: errorId },
|
|
38
45
|
React.createElement("span", { className: "ckw-input-field__error-icon" },
|
|
39
46
|
React.createElement(IconWarningCircle, { size: 16 })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.js","sourceRoot":"","sources":["../../src/InputField/InputField.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"InputField.js","sourceRoot":"","sources":["../../src/InputField/InputField.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,kBAAkB,CAAC;AAuC1B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAoC,SAAS,UAAU,CAC/F,EACE,KAAK,GAAG,OAAO,EACf,WAAW,GAAG,aAAa,EAC3B,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,IAAI,EACJ,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,IAAI,GAAG,MAAM,EACb,EAAE,EACF,SAAS,EACT,kBAAkB,EAAE,eAAe,EACnC,cAAc,EAAE,WAAW,EAC3B,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,EAAE,IAAI,aAAa,OAAO,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAC,CAAC,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AG,EAAE,GAAG,EACR,SAAS,EAAC,wBAAwB,EAClC,EAAE,EAAE,OAAO,EACX,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,kBACJ,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,sBACzB,WAAW,GAC7B;gBACD,MAAM,IAAI,CACT,8BAAM,SAAS,EAAC,wBAAwB,EAAC,EAAE,EAAE,QAAQ,IAClD,MAAM,CACF,CACR;gBACA,IAAI,IAAI,8BAAM,SAAS,EAAC,uBAAuB,IAAE,IAAI,CAAQ,CAC1D,CACF;QAGL,WAAW,IAAI,CACd,2BAAG,SAAS,EAAC,8BAA8B,EAAC,EAAE,EAAE,aAAa,IAC1D,WAAW,CACV,CACL;QAGA,QAAQ,IAAI,CACX,6BAAK,SAAS,EAAC,wBAAwB,EAAC,EAAE,EAAE,OAAO;YACjD,8BAAM,SAAS,EAAC,6BAA6B;gBAC3C,oBAAC,iBAAiB,IAAC,IAAI,EAAE,EAAE,GAAI,CAC1B;YACP,8BAAM,SAAS,EAAC,6BAA6B,IAAE,SAAS,CAAQ,CAC5D,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface LoadingSpinnerProps {
|
|
3
|
+
/** Width and height of the spinner in pixels. */
|
|
4
|
+
size?: number;
|
|
5
|
+
/** Additional CSS class name. */
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Animated loading spinner with orbiting dots in CKW brand green shades.
|
|
10
|
+
*
|
|
11
|
+
* Uses an inline SVG with SMIL animations — no external dependencies needed.
|
|
12
|
+
* Each instance generates a unique filter ID to avoid SVG reference collisions.
|
|
13
|
+
*/
|
|
14
|
+
export declare function LoadingSpinner({ size, className }: LoadingSpinnerProps): React.JSX.Element;
|
|
15
|
+
//# sourceMappingURL=LoadingSpinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingSpinner.d.ts","sourceRoot":"","sources":["../../src/LoadingSpinner/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,SAAS,EAAE,EAAE,mBAAmB,qBAqJ3E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
let idCounter = 0;
|
|
3
|
+
/**
|
|
4
|
+
* Animated loading spinner with orbiting dots in CKW brand green shades.
|
|
5
|
+
*
|
|
6
|
+
* Uses an inline SVG with SMIL animations — no external dependencies needed.
|
|
7
|
+
* Each instance generates a unique filter ID to avoid SVG reference collisions.
|
|
8
|
+
*/
|
|
9
|
+
export function LoadingSpinner({ size = 20, className }) {
|
|
10
|
+
const [filterId] = React.useState(() => `ckw-spinner-filter-${++idCounter}`);
|
|
11
|
+
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, width: size, height: size, viewBox: "15 15 70 70", preserveAspectRatio: "xMidYMid", "aria-hidden": "true", role: "presentation", style: { display: 'block', shapeRendering: 'auto' } },
|
|
12
|
+
React.createElement("defs", null,
|
|
13
|
+
React.createElement("filter", { id: filterId, x: "-100%", y: "-100%", width: "300%", height: "300%", colorInterpolationFilters: "sRGB" },
|
|
14
|
+
React.createElement("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "2.4" }),
|
|
15
|
+
React.createElement("feComponentTransfer", { result: "cutoff" },
|
|
16
|
+
React.createElement("feFuncA", { type: "table", tableValues: "0 0 0 0 0 0 1 1 1 1 1" })))),
|
|
17
|
+
React.createElement("g", { filter: `url(#${filterId})` },
|
|
18
|
+
React.createElement("g", { transform: "translate(50 50)" },
|
|
19
|
+
React.createElement("g", null,
|
|
20
|
+
React.createElement("circle", { cx: "20", cy: "0", r: "5", fill: "#f2f5cc" },
|
|
21
|
+
React.createElement("animate", { attributeName: "r", keyTimes: "0;0.5;1", values: "3.6;8.4;3.6", dur: "5.556s", repeatCount: "indefinite", begin: "-0.18s" })),
|
|
22
|
+
React.createElement("animateTransform", { attributeName: "transform", type: "rotate", keyTimes: "0;1", values: "0;360", dur: "5.556s", repeatCount: "indefinite", begin: "0s" }))),
|
|
23
|
+
React.createElement("g", { transform: "translate(50 50)" },
|
|
24
|
+
React.createElement("g", null,
|
|
25
|
+
React.createElement("circle", { cx: "20", cy: "0", r: "5", fill: "#e4ec9a" },
|
|
26
|
+
React.createElement("animate", { attributeName: "r", keyTimes: "0;0.5;1", values: "3.6;8.4;3.6", dur: "2.778s", repeatCount: "indefinite", begin: "-0.144s" })),
|
|
27
|
+
React.createElement("animateTransform", { attributeName: "transform", type: "rotate", keyTimes: "0;1", values: "0;360", dur: "2.778s", repeatCount: "indefinite", begin: "-0.036s" }))),
|
|
28
|
+
React.createElement("g", { transform: "translate(50 50)" },
|
|
29
|
+
React.createElement("g", null,
|
|
30
|
+
React.createElement("circle", { cx: "20", cy: "0", r: "5", fill: "#d7e267" },
|
|
31
|
+
React.createElement("animate", { attributeName: "r", keyTimes: "0;0.5;1", values: "3.6;8.4;3.6", dur: "1.852s", repeatCount: "indefinite", begin: "-0.108s" })),
|
|
32
|
+
React.createElement("animateTransform", { attributeName: "transform", type: "rotate", keyTimes: "0;1", values: "0;360", dur: "1.852s", repeatCount: "indefinite", begin: "-0.072s" }))),
|
|
33
|
+
React.createElement("g", { transform: "translate(50 50)" },
|
|
34
|
+
React.createElement("g", null,
|
|
35
|
+
React.createElement("circle", { cx: "20", cy: "0", r: "5", fill: "#c9d935" },
|
|
36
|
+
React.createElement("animate", { attributeName: "r", keyTimes: "0;0.5;1", values: "3.6;8.4;3.6", dur: "1.389s", repeatCount: "indefinite", begin: "-0.072s" })),
|
|
37
|
+
React.createElement("animateTransform", { attributeName: "transform", type: "rotate", keyTimes: "0;1", values: "0;360", dur: "1.389s", repeatCount: "indefinite", begin: "-0.108s" }))),
|
|
38
|
+
React.createElement("g", { transform: "translate(50 50)" },
|
|
39
|
+
React.createElement("g", null,
|
|
40
|
+
React.createElement("circle", { cx: "20", cy: "0", r: "5", fill: "#bccf02" },
|
|
41
|
+
React.createElement("animate", { attributeName: "r", keyTimes: "0;0.5;1", values: "3.6;8.4;3.6", dur: "1.111s", repeatCount: "indefinite", begin: "-0.036s" })),
|
|
42
|
+
React.createElement("animateTransform", { attributeName: "transform", type: "rotate", keyTimes: "0;1", values: "0;360", dur: "1.111s", repeatCount: "indefinite", begin: "-0.144s" }))))));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=LoadingSpinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../src/LoadingSpinner/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAuB;IAC1E,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,sBAAsB,EAAE,SAAS,EAAE,CAAC,CAAC;IAE7E,OAAO,CACL,6BACE,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,aAAa,EACrB,mBAAmB,EAAC,UAAU,iBAClB,MAAM,EAClB,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EA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C,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,SAAS;wBACzC,iCACE,aAAa,EAAC,GAAG,EACjB,QAAQ,EAAC,SAAS,EAClB,MAAM,EAAC,aAAa,EACpB,GAAG,EAAC,QAAQ,EACZ,WAAW,EAAC,YAAY,EACxB,KAAK,EAAC,SAAS,GACf,CACK;oBACT,0CACE,aAAa,EAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAC,KAAK,EACd,MAAM,EAAC,OAAO,EACd,GAAG,EAAC,QAAQ,EACZ,WAAW,EAAC,YAAY,EACxB,KAAK,EAAC,SAAS,GACf,CACA,CACF,CACF,CACA,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/LoadingSpinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/LoadingSpinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -9,11 +9,6 @@
|
|
|
9
9
|
display: none;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.ckw-password-input .ckw-input-field__icon {
|
|
13
|
-
width: var(--spacing-xl);
|
|
14
|
-
height: var(--spacing-xl);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
12
|
.ckw-password-input__toggle {
|
|
18
13
|
display: flex;
|
|
19
14
|
align-items: center;
|
|
@@ -22,11 +17,12 @@
|
|
|
22
17
|
height: var(--spacing-xl);
|
|
23
18
|
flex-shrink: 0;
|
|
24
19
|
padding: 0;
|
|
25
|
-
|
|
20
|
+
/* 24px hit target inside the 20px icon slot, so the layout matches Input Field. */
|
|
21
|
+
margin: calc((var(--spacing-l) - var(--spacing-xl)) / 2);
|
|
26
22
|
border: none;
|
|
27
23
|
border-radius: var(--border-radius-full);
|
|
28
24
|
background: transparent;
|
|
29
|
-
color: var(--
|
|
25
|
+
color: var(--text-secondary);
|
|
30
26
|
cursor: pointer;
|
|
31
27
|
outline: none;
|
|
32
28
|
transition:
|
|
@@ -13,7 +13,7 @@ export const PasswordInput = React.forwardRef(function PasswordInput({ visible,
|
|
|
13
13
|
const [uncontrolledVisible, setUncontrolledVisible] = React.useState(defaultVisible);
|
|
14
14
|
const isControlled = visible !== undefined;
|
|
15
15
|
const isVisible = visible ?? uncontrolledVisible;
|
|
16
|
-
const { className: toggleButtonClassName, 'aria-label': toggleAriaLabel = '
|
|
16
|
+
const { className: toggleButtonClassName, 'aria-label': toggleAriaLabel = 'Passwort anzeigen oder verbergen', onClick: onToggleClick, onMouseDown: onToggleMouseDown, onPointerDown: onTogglePointerDown, ...toggleButtonProps } = visibilityToggleButtonProps ?? {};
|
|
17
17
|
const rootClasses = ['ckw-password-input', className ?? ''].filter(Boolean).join(' ');
|
|
18
18
|
const toggleClasses = ['ckw-password-input__toggle', toggleButtonClassName ?? '']
|
|
19
19
|
.filter(Boolean)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","sourceRoot":"","sources":["../../src/PasswordInput/PasswordInput.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,qBAAqB,CAAC;AAa7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAC3C,SAAS,aAAa,CACpB,EACE,OAAO,EACP,cAAc,GAAG,KAAK,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QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EACrC,IAAI,EACF,mCACM,iBAAiB,EACrB,SAAS,EAAE,aAAa,EACxB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,QAAQ,gBACN,eAAe,kBACb,SAAS,EACvB,OAAO,EAAE,sBAAsB,EAC/B,aAAa,EAAE,uBAAuB,EACtC,WAAW,EAAE,qBAAqB;YAElC,8BAAM,SAAS,EAAC,iCAAiC,iBAAa,MAAM,IACjE,cAAc,CACV,CACA,GAEX,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Uses only semantic design tokens from @ckwag/elements-tokens.
|
|
5
5
|
* Container is a pill-shaped track with a sliding indicator behind segments.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Variants: default (auto-width), fill (equal-width stretch)
|
|
8
8
|
* Content modes: label, icon-label, icon-compact
|
|
9
|
-
* States: Default, Hover, Active (sliding indicator)
|
|
9
|
+
* States: Default, Hover, Active (white sliding indicator with shadow-xs), Focus
|
|
10
10
|
*
|
|
11
11
|
* Icon-compact uses CSS grid `0fr → 1fr` on each segment to animate the label
|
|
12
12
|
* width. The indicator is positioned via offsetLeft/offsetWidth in a
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
gap: var(--spacing-3xs);
|
|
25
25
|
padding: var(--spacing-2xs);
|
|
26
26
|
background-color: var(--background-control);
|
|
27
|
-
|
|
27
|
+
/* inset border keeps the track at 40px, like the Figma component */
|
|
28
|
+
box-shadow: inset 0 0 0 var(--border-weight-s) var(--border-soft);
|
|
28
29
|
border-radius: var(--border-radius-full);
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -43,8 +44,8 @@
|
|
|
43
44
|
bottom: var(--spacing-2xs);
|
|
44
45
|
left: 0;
|
|
45
46
|
box-sizing: border-box;
|
|
46
|
-
background-color: var(--background-
|
|
47
|
-
|
|
47
|
+
background-color: var(--background-input);
|
|
48
|
+
box-shadow: var(--shadow-xs);
|
|
48
49
|
border-radius: var(--border-radius-full);
|
|
49
50
|
pointer-events: none;
|
|
50
51
|
will-change: transform, width;
|
|
@@ -159,7 +160,7 @@
|
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
.ckw-segmented-control__segment--active .ckw-segmented-control__label {
|
|
162
|
-
color: var(--text-
|
|
163
|
+
color: var(--text-primary);
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
/*
|
|
@@ -212,7 +213,7 @@
|
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
.ckw-segmented-control__segment--active .ckw-segmented-control__icon {
|
|
215
|
-
color: var(--text-
|
|
216
|
+
color: var(--text-primary);
|
|
216
217
|
}
|
|
217
218
|
|
|
218
219
|
/* ============================================
|
|
@@ -220,11 +221,11 @@
|
|
|
220
221
|
============================================ */
|
|
221
222
|
|
|
222
223
|
.ckw-segmented-control--state-hover
|
|
223
|
-
.ckw-segmented-control__segment:first-
|
|
224
|
+
.ckw-segmented-control__segment:first-of-type:not(.ckw-segmented-control__segment--active) {
|
|
224
225
|
background-color: var(--background-hover);
|
|
225
226
|
}
|
|
226
227
|
|
|
227
|
-
.ckw-segmented-control--state-focus-visible .ckw-segmented-control__segment:first-
|
|
228
|
+
.ckw-segmented-control--state-focus-visible .ckw-segmented-control__segment:first-of-type {
|
|
228
229
|
outline: var(--border-weight-m) solid var(--border-active);
|
|
229
230
|
outline-offset: 2px;
|
|
230
231
|
}
|
|
@@ -233,3 +234,26 @@
|
|
|
233
234
|
opacity: 0.4;
|
|
234
235
|
pointer-events: none;
|
|
235
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
|
+
}
|