@teseor/css 1.5.0 → 1.7.0

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.
Files changed (44) hide show
  1. package/dist/compiled.css +1 -1
  2. package/dist/index.css +16 -0
  3. package/package.json +1 -1
  4. package/src/04-components/forms/checkbox-group/checkbox-group-visual.png +0 -0
  5. package/src/04-components/forms/checkbox-group/checkbox-group.api.json +54 -0
  6. package/src/04-components/forms/checkbox-group/checkbox-group.docs.json +338 -0
  7. package/src/04-components/forms/checkbox-group/checkbox-group.visual.spec.ts +14 -0
  8. package/src/04-components/forms/checkbox-group/index.scss +84 -0
  9. package/src/04-components/forms/number-input/index.scss +153 -0
  10. package/src/04-components/forms/number-input/number-input-visual.png +0 -0
  11. package/src/04-components/forms/number-input/number-input.api.json +74 -0
  12. package/src/04-components/forms/number-input/number-input.docs.json +262 -0
  13. package/src/04-components/forms/number-input/number-input.visual.spec.ts +14 -0
  14. package/src/04-components/forms/password-input/index.scss +138 -0
  15. package/src/04-components/forms/password-input/password-input-visual.png +0 -0
  16. package/src/04-components/forms/password-input/password-input.api.json +84 -0
  17. package/src/04-components/forms/password-input/password-input.docs.json +276 -0
  18. package/src/04-components/forms/password-input/password-input.visual.spec.ts +14 -0
  19. package/src/04-components/forms/radio-group/index.scss +84 -0
  20. package/src/04-components/forms/radio-group/radio-group-visual.png +0 -0
  21. package/src/04-components/forms/radio-group/radio-group.api.json +54 -0
  22. package/src/04-components/forms/radio-group/radio-group.docs.json +350 -0
  23. package/src/04-components/forms/radio-group/radio-group.visual.spec.ts +14 -0
  24. package/src/04-components/forms/search-input/index.scss +172 -0
  25. package/src/04-components/forms/search-input/search-input-visual.png +0 -0
  26. package/src/04-components/forms/search-input/search-input.api.json +85 -0
  27. package/src/04-components/forms/search-input/search-input.docs.json +257 -0
  28. package/src/04-components/forms/search-input/search-input.visual.spec.ts +14 -0
  29. package/src/04-components/forms/slider/index.scss +153 -0
  30. package/src/04-components/forms/slider/slider-visual.png +0 -0
  31. package/src/04-components/forms/slider/slider.api.json +70 -0
  32. package/src/04-components/forms/slider/slider.docs.json +144 -0
  33. package/src/04-components/forms/slider/slider.visual.spec.ts +14 -0
  34. package/src/04-components/index.scss +8 -0
  35. package/src/04-components/layout/scroll-area/index.scss +92 -0
  36. package/src/04-components/layout/scroll-area/scroll-area-visual.png +0 -0
  37. package/src/04-components/layout/scroll-area/scroll-area.api.json +63 -0
  38. package/src/04-components/layout/scroll-area/scroll-area.docs.json +204 -0
  39. package/src/04-components/layout/scroll-area/scroll-area.visual.spec.ts +14 -0
  40. package/src/04-components/navigation/dropdown-menu/dropdown-menu-visual.png +0 -0
  41. package/src/04-components/navigation/dropdown-menu/dropdown-menu.api.json +37 -0
  42. package/src/04-components/navigation/dropdown-menu/dropdown-menu.docs.json +272 -0
  43. package/src/04-components/navigation/dropdown-menu/dropdown-menu.visual.spec.ts +14 -0
  44. package/src/04-components/navigation/dropdown-menu/index.scss +84 -0
@@ -0,0 +1,153 @@
1
+ @use '../../../00-config/tokens/variables' as t;
2
+
3
+ // @component number-input
4
+ // @element div
5
+
6
+ @layer components.tokens {
7
+ .number-input {
8
+ --_height: var(--ui-number-input-height, var(--ui-row-2, #{t.$row-2}));
9
+ --_padding-x: var(--ui-number-input-padding-x, var(--ui-space-1, #{t.$space-1}));
10
+ --_font-size: var(--ui-number-input-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
11
+ --_radius: var(--ui-number-input-radius, var(--ui-radius-md, #{t.$radius-md}));
12
+ --_bg: var(--ui-number-input-bg, var(--ui-color-bg, #{t.$color-bg}));
13
+ --_border-color: var(--ui-number-input-border-color, var(--ui-color-border-strong, #{t.$color-border-strong}));
14
+ --_border-color-focus: var(--ui-number-input-border-color-focus, var(--ui-color-primary, #{t.$color-primary}));
15
+ --_text: var(--ui-number-input-text, var(--ui-color-text, #{t.$color-text}));
16
+ --_button-color: var(--ui-number-input-button-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
17
+ --_button-bg: var(--ui-number-input-button-bg, var(--ui-color-bg-muted, #{t.$color-bg-muted}));
18
+ --_button-hover-bg: var(--ui-number-input-button-hover-bg, var(--ui-color-border, #{t.$color-border}));
19
+ }
20
+
21
+ // @modifier size
22
+ .number-input--sm {
23
+ --_height: var(--ui-number-input-height-sm, calc(#{t.$row} * 1.5));
24
+ --_font-size: var(--ui-number-input-font-size-sm, var(--ui-font-size-xs, #{t.$font-size-xs}));
25
+ }
26
+
27
+ .number-input--lg {
28
+ --_height: var(--ui-number-input-height-lg, calc(#{t.$row} * 2.5));
29
+ --_padding-x: var(--ui-number-input-padding-x-lg, var(--ui-space-2, #{t.$space-2}));
30
+ --_font-size: var(--ui-number-input-font-size-lg, var(--ui-font-size-md, #{t.$font-size-md}));
31
+ }
32
+ }
33
+
34
+ @layer components.styles {
35
+ .number-input {
36
+ display: inline-flex;
37
+ align-items: center;
38
+
39
+ block-size: var(--_height);
40
+
41
+ background: var(--_bg);
42
+ border: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_border-color);
43
+ border-radius: var(--_radius);
44
+
45
+ transition:
46
+ border-color var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease),
47
+ box-shadow var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
48
+
49
+ &:focus-within {
50
+ border-color: var(--_border-color-focus);
51
+ box-shadow: 0 0 0 var(--ui-border-width-md, #{t.$border-width-md}) var(--ui-color-focus, #{t.$color-focus});
52
+ }
53
+
54
+ &--block {
55
+ inline-size: 100%;
56
+ }
57
+
58
+ &--disabled,
59
+ &:has(.number-input__field:disabled) {
60
+ opacity: 0.5;
61
+ cursor: not-allowed;
62
+ }
63
+ }
64
+
65
+ .number-input__field {
66
+ flex: 1;
67
+
68
+ block-size: 100%;
69
+ min-inline-size: 0;
70
+ padding: 0 var(--_padding-x);
71
+
72
+ font-family: inherit;
73
+ font-size: var(--_font-size);
74
+ line-height: 1;
75
+ text-align: center;
76
+ color: var(--_text);
77
+
78
+ background: transparent;
79
+ border: none;
80
+ outline: none;
81
+
82
+ // Hide native spinners
83
+ &::-webkit-outer-spin-button,
84
+ &::-webkit-inner-spin-button {
85
+ margin: 0;
86
+
87
+ appearance: none;
88
+ }
89
+
90
+ &[type='number'] {
91
+ appearance: textfield;
92
+ }
93
+ }
94
+
95
+ .number-input__decrement,
96
+ .number-input__increment {
97
+ display: flex;
98
+ flex-shrink: 0;
99
+ align-items: center;
100
+ justify-content: center;
101
+
102
+ block-size: 100%;
103
+ inline-size: var(--_height);
104
+ padding: 0;
105
+ margin: 0;
106
+
107
+ color: var(--_button-color);
108
+
109
+ background: var(--_button-bg);
110
+ border: none;
111
+ cursor: pointer;
112
+
113
+ transition: background var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
114
+
115
+ &:hover:not(:disabled) {
116
+ background: var(--_button-hover-bg);
117
+ }
118
+
119
+ &:focus-visible {
120
+ outline: 2px solid var(--ui-color-focus, #{t.$color-focus});
121
+ outline-offset: -2px;
122
+ }
123
+
124
+ &:disabled {
125
+ cursor: not-allowed;
126
+ }
127
+
128
+ svg {
129
+ block-size: var(--ui-size-sm, #{t.size(sm)});
130
+ inline-size: var(--ui-size-sm, #{t.size(sm)});
131
+
132
+ fill: none;
133
+ stroke: currentcolor;
134
+ stroke-width: 2;
135
+ stroke-linecap: round;
136
+ stroke-linejoin: round;
137
+ }
138
+ }
139
+
140
+ .number-input__decrement {
141
+ border-start-start-radius: calc(var(--_radius) - var(--ui-border-width-sm, #{t.$border-width-sm}));
142
+ border-end-start-radius: calc(var(--_radius) - var(--ui-border-width-sm, #{t.$border-width-sm}));
143
+
144
+ border-inline-end: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_border-color);
145
+ }
146
+
147
+ .number-input__increment {
148
+ border-start-end-radius: calc(var(--_radius) - var(--ui-border-width-sm, #{t.$border-width-sm}));
149
+ border-end-end-radius: calc(var(--_radius) - var(--ui-border-width-sm, #{t.$border-width-sm}));
150
+
151
+ border-inline-start: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_border-color);
152
+ }
153
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "number-input",
3
+ "element": "div",
4
+ "modifiers": {
5
+ "size": {
6
+ "values": ["sm", "lg"]
7
+ },
8
+ "block": {
9
+ "type": "boolean"
10
+ },
11
+ "disabled": {
12
+ "type": "boolean"
13
+ }
14
+ },
15
+ "elements": {
16
+ "field": {},
17
+ "decrement": {},
18
+ "increment": {}
19
+ },
20
+ "cssVars": [
21
+ {
22
+ "name": "--ui-number-input-height",
23
+ "default": "var(--ui-row-2)"
24
+ },
25
+ {
26
+ "name": "--ui-number-input-height-sm",
27
+ "default": "calc(var(--ui-row) * 1.5)"
28
+ },
29
+ {
30
+ "name": "--ui-number-input-height-lg",
31
+ "default": "calc(var(--ui-row) * 2.5)"
32
+ },
33
+ {
34
+ "name": "--ui-number-input-padding-x",
35
+ "default": "var(--ui-space-1)"
36
+ },
37
+ {
38
+ "name": "--ui-number-input-font-size",
39
+ "default": "var(--ui-font-size-sm)"
40
+ },
41
+ {
42
+ "name": "--ui-number-input-radius",
43
+ "default": "var(--ui-radius-md)"
44
+ },
45
+ {
46
+ "name": "--ui-number-input-bg",
47
+ "default": "var(--ui-color-bg)"
48
+ },
49
+ {
50
+ "name": "--ui-number-input-border-color",
51
+ "default": "var(--ui-color-border-strong)"
52
+ },
53
+ {
54
+ "name": "--ui-number-input-border-color-focus",
55
+ "default": "var(--ui-color-primary)"
56
+ },
57
+ {
58
+ "name": "--ui-number-input-text",
59
+ "default": "var(--ui-color-text)"
60
+ },
61
+ {
62
+ "name": "--ui-number-input-button-color",
63
+ "default": "var(--ui-color-text-muted)"
64
+ },
65
+ {
66
+ "name": "--ui-number-input-button-bg",
67
+ "default": "var(--ui-color-bg-muted)"
68
+ },
69
+ {
70
+ "name": "--ui-number-input-button-hover-bg",
71
+ "default": "var(--ui-color-border)"
72
+ }
73
+ ]
74
+ }
@@ -0,0 +1,262 @@
1
+ {
2
+ "id": "number-input",
3
+ "type": "component",
4
+ "title": "Number Input",
5
+ "description": "Numeric input with increment and decrement stepper buttons.",
6
+ "api": "./number-input.api.json",
7
+ "sections": [
8
+ {
9
+ "title": "Default",
10
+ "examples": [
11
+ {
12
+ "items": [
13
+ {
14
+ "tag": "div",
15
+ "class": "ui-number-input",
16
+ "children": [
17
+ {
18
+ "tag": "button",
19
+ "class": "ui-number-input__decrement",
20
+ "attrs": { "type": "button", "aria-label": "Decrease" },
21
+ "children": [
22
+ {
23
+ "tag": "svg",
24
+ "attrs": { "viewBox": "0 0 24 24" },
25
+ "children": [{ "tag": "path", "attrs": { "d": "M5 12h14" } }]
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ "tag": "input",
31
+ "class": "ui-number-input__field",
32
+ "attrs": { "type": "number", "value": "5" }
33
+ },
34
+ {
35
+ "tag": "button",
36
+ "class": "ui-number-input__increment",
37
+ "attrs": { "type": "button", "aria-label": "Increase" },
38
+ "children": [
39
+ {
40
+ "tag": "svg",
41
+ "attrs": { "viewBox": "0 0 24 24" },
42
+ "children": [
43
+ { "tag": "path", "attrs": { "d": "M12 5v14" } },
44
+ { "tag": "path", "attrs": { "d": "M5 12h14" } }
45
+ ]
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ ],
52
+ "code": "<div class=\"ui-number-input\">\n <button class=\"ui-number-input__decrement\" aria-label=\"Decrease\"><svg>...</svg></button>\n <input class=\"ui-number-input__field\" type=\"number\" value=\"5\">\n <button class=\"ui-number-input__increment\" aria-label=\"Increase\"><svg>...</svg></button>\n</div>"
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "title": "Sizes",
58
+ "examples": [
59
+ {
60
+ "layout": "stack",
61
+ "items": [
62
+ {
63
+ "tag": "div",
64
+ "class": "ui-number-input ui-number-input--sm",
65
+ "children": [
66
+ {
67
+ "tag": "button",
68
+ "class": "ui-number-input__decrement",
69
+ "attrs": { "type": "button", "aria-label": "Decrease" },
70
+ "children": [
71
+ {
72
+ "tag": "svg",
73
+ "attrs": { "viewBox": "0 0 24 24" },
74
+ "children": [{ "tag": "path", "attrs": { "d": "M5 12h14" } }]
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "tag": "input",
80
+ "class": "ui-number-input__field",
81
+ "attrs": { "type": "number", "value": "3" }
82
+ },
83
+ {
84
+ "tag": "button",
85
+ "class": "ui-number-input__increment",
86
+ "attrs": { "type": "button", "aria-label": "Increase" },
87
+ "children": [
88
+ {
89
+ "tag": "svg",
90
+ "attrs": { "viewBox": "0 0 24 24" },
91
+ "children": [
92
+ { "tag": "path", "attrs": { "d": "M12 5v14" } },
93
+ { "tag": "path", "attrs": { "d": "M5 12h14" } }
94
+ ]
95
+ }
96
+ ]
97
+ }
98
+ ]
99
+ },
100
+ {
101
+ "tag": "div",
102
+ "class": "ui-number-input",
103
+ "children": [
104
+ {
105
+ "tag": "button",
106
+ "class": "ui-number-input__decrement",
107
+ "attrs": { "type": "button", "aria-label": "Decrease" },
108
+ "children": [
109
+ {
110
+ "tag": "svg",
111
+ "attrs": { "viewBox": "0 0 24 24" },
112
+ "children": [{ "tag": "path", "attrs": { "d": "M5 12h14" } }]
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ "tag": "input",
118
+ "class": "ui-number-input__field",
119
+ "attrs": { "type": "number", "value": "5" }
120
+ },
121
+ {
122
+ "tag": "button",
123
+ "class": "ui-number-input__increment",
124
+ "attrs": { "type": "button", "aria-label": "Increase" },
125
+ "children": [
126
+ {
127
+ "tag": "svg",
128
+ "attrs": { "viewBox": "0 0 24 24" },
129
+ "children": [
130
+ { "tag": "path", "attrs": { "d": "M12 5v14" } },
131
+ { "tag": "path", "attrs": { "d": "M5 12h14" } }
132
+ ]
133
+ }
134
+ ]
135
+ }
136
+ ]
137
+ },
138
+ {
139
+ "tag": "div",
140
+ "class": "ui-number-input ui-number-input--lg",
141
+ "children": [
142
+ {
143
+ "tag": "button",
144
+ "class": "ui-number-input__decrement",
145
+ "attrs": { "type": "button", "aria-label": "Decrease" },
146
+ "children": [
147
+ {
148
+ "tag": "svg",
149
+ "attrs": { "viewBox": "0 0 24 24" },
150
+ "children": [{ "tag": "path", "attrs": { "d": "M5 12h14" } }]
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ "tag": "input",
156
+ "class": "ui-number-input__field",
157
+ "attrs": { "type": "number", "value": "10" }
158
+ },
159
+ {
160
+ "tag": "button",
161
+ "class": "ui-number-input__increment",
162
+ "attrs": { "type": "button", "aria-label": "Increase" },
163
+ "children": [
164
+ {
165
+ "tag": "svg",
166
+ "attrs": { "viewBox": "0 0 24 24" },
167
+ "children": [
168
+ { "tag": "path", "attrs": { "d": "M12 5v14" } },
169
+ { "tag": "path", "attrs": { "d": "M5 12h14" } }
170
+ ]
171
+ }
172
+ ]
173
+ }
174
+ ]
175
+ }
176
+ ],
177
+ "code": "<div class=\"ui-number-input ui-number-input--sm\">...</div>\n<div class=\"ui-number-input\">...</div>\n<div class=\"ui-number-input ui-number-input--lg\">...</div>"
178
+ }
179
+ ]
180
+ },
181
+ {
182
+ "title": "Disabled",
183
+ "examples": [
184
+ {
185
+ "items": [
186
+ {
187
+ "tag": "div",
188
+ "class": "ui-number-input ui-number-input--disabled",
189
+ "children": [
190
+ {
191
+ "tag": "button",
192
+ "class": "ui-number-input__decrement",
193
+ "attrs": { "type": "button", "aria-label": "Decrease", "disabled": "" },
194
+ "children": [
195
+ {
196
+ "tag": "svg",
197
+ "attrs": { "viewBox": "0 0 24 24" },
198
+ "children": [{ "tag": "path", "attrs": { "d": "M5 12h14" } }]
199
+ }
200
+ ]
201
+ },
202
+ {
203
+ "tag": "input",
204
+ "class": "ui-number-input__field",
205
+ "attrs": { "type": "number", "value": "0", "disabled": "" }
206
+ },
207
+ {
208
+ "tag": "button",
209
+ "class": "ui-number-input__increment",
210
+ "attrs": { "type": "button", "aria-label": "Increase", "disabled": "" },
211
+ "children": [
212
+ {
213
+ "tag": "svg",
214
+ "attrs": { "viewBox": "0 0 24 24" },
215
+ "children": [
216
+ { "tag": "path", "attrs": { "d": "M12 5v14" } },
217
+ { "tag": "path", "attrs": { "d": "M5 12h14" } }
218
+ ]
219
+ }
220
+ ]
221
+ }
222
+ ]
223
+ }
224
+ ],
225
+ "code": "<div class=\"ui-number-input ui-number-input--disabled\">\n <button disabled>...</button>\n <input type=\"number\" disabled>\n <button disabled>...</button>\n</div>"
226
+ }
227
+ ]
228
+ }
229
+ ],
230
+ "customization": [
231
+ {
232
+ "token": "--ui-number-input-height",
233
+ "default": "var(--ui-row-2)",
234
+ "description": "Default height"
235
+ },
236
+ {
237
+ "token": "--ui-number-input-height-sm",
238
+ "default": "calc(var(--ui-row) * 1.5)",
239
+ "description": "Small height"
240
+ },
241
+ {
242
+ "token": "--ui-number-input-height-lg",
243
+ "default": "calc(var(--ui-row) * 2.5)",
244
+ "description": "Large height"
245
+ },
246
+ {
247
+ "token": "--ui-number-input-button-bg",
248
+ "default": "var(--ui-color-bg-muted)",
249
+ "description": "Stepper button background"
250
+ },
251
+ {
252
+ "token": "--ui-number-input-button-hover-bg",
253
+ "default": "var(--ui-color-border)",
254
+ "description": "Stepper button hover background"
255
+ },
256
+ {
257
+ "token": "--ui-number-input-border-color-focus",
258
+ "default": "var(--ui-color-primary)",
259
+ "description": "Focus border color"
260
+ }
261
+ ]
262
+ }
@@ -0,0 +1,14 @@
1
+ import { resolve } from 'node:path';
2
+ import { expect, test } from '@playwright/test';
3
+ import { saveForLostPixel, setupVisualTestFromDocs, validateGridRhythm } from '../../../testing';
4
+
5
+ const DOCS_PATH = resolve(__dirname, 'number-input.docs.json');
6
+
7
+ test.describe('number-input visual regression', () => {
8
+ test('all variations', async ({ page }) => {
9
+ await setupVisualTestFromDocs(page, DOCS_PATH);
10
+ await validateGridRhythm(page, 'number-input');
11
+ await saveForLostPixel(page, 'number-input');
12
+ await expect(page.locator('body')).toHaveScreenshot('number-input-visual.png');
13
+ });
14
+ });
@@ -0,0 +1,138 @@
1
+ @use '../../../00-config/tokens/variables' as t;
2
+
3
+ // @component password-input
4
+ // @element div
5
+
6
+ @layer components.tokens {
7
+ .password-input {
8
+ --_height: var(--ui-password-input-height, var(--ui-row-2, #{t.$row-2}));
9
+ --_padding-x: var(--ui-password-input-padding-x, var(--ui-space-1, #{t.$space-1}));
10
+ --_font-size: var(--ui-password-input-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
11
+ --_radius: var(--ui-password-input-radius, var(--ui-radius-md, #{t.$radius-md}));
12
+ --_bg: var(--ui-password-input-bg, var(--ui-color-bg, #{t.$color-bg}));
13
+ --_border-color: var(--ui-password-input-border-color, var(--ui-color-border-strong, #{t.$color-border-strong}));
14
+ --_border-color-focus: var(--ui-password-input-border-color-focus, var(--ui-color-primary, #{t.$color-primary}));
15
+ --_text: var(--ui-password-input-text, var(--ui-color-text, #{t.$color-text}));
16
+ --_placeholder: var(--ui-password-input-placeholder, var(--ui-color-text-muted, #{t.$color-text-muted}));
17
+ --_toggle-color: var(--ui-password-input-toggle-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
18
+ --_toggle-hover-bg: var(--ui-password-input-toggle-hover-bg, var(--ui-color-bg-muted, #{t.$color-bg-muted}));
19
+ }
20
+
21
+ // @modifier size
22
+ .password-input--sm {
23
+ --_height: var(--ui-password-input-height-sm, calc(#{t.$row} * 1.5));
24
+ --_font-size: var(--ui-password-input-font-size-sm, var(--ui-font-size-xs, #{t.$font-size-xs}));
25
+ }
26
+
27
+ .password-input--lg {
28
+ --_height: var(--ui-password-input-height-lg, calc(#{t.$row} * 2.5));
29
+ --_padding-x: var(--ui-password-input-padding-x-lg, var(--ui-space-2, #{t.$space-2}));
30
+ --_font-size: var(--ui-password-input-font-size-lg, var(--ui-font-size-md, #{t.$font-size-md}));
31
+ }
32
+
33
+ // @modifier state
34
+ .password-input--error {
35
+ --_border-color: var(--ui-password-input-error-border, var(--ui-color-danger, #{t.$color-danger}));
36
+ --_border-color-focus: var(--ui-password-input-error-border, var(--ui-color-danger, #{t.$color-danger}));
37
+ }
38
+
39
+ .password-input--success {
40
+ --_border-color: var(--ui-password-input-success-border, var(--ui-color-success, #{t.$color-success}));
41
+ --_border-color-focus: var(--ui-password-input-success-border, var(--ui-color-success, #{t.$color-success}));
42
+ }
43
+ }
44
+
45
+ @layer components.styles {
46
+ .password-input {
47
+ display: inline-flex;
48
+ align-items: center;
49
+
50
+ block-size: var(--_height);
51
+
52
+ background: var(--_bg);
53
+ border: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_border-color);
54
+ border-radius: var(--_radius);
55
+
56
+ transition:
57
+ border-color var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease),
58
+ box-shadow var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
59
+
60
+ &:focus-within,
61
+ &--focus {
62
+ border-color: var(--_border-color-focus);
63
+ box-shadow: 0 0 0 var(--ui-border-width-md, #{t.$border-width-md}) var(--ui-color-focus, #{t.$color-focus});
64
+ }
65
+
66
+ &--block {
67
+ inline-size: 100%;
68
+ }
69
+
70
+ &--disabled,
71
+ &:has(.password-input__field:disabled) {
72
+ opacity: 0.5;
73
+ cursor: not-allowed;
74
+ }
75
+ }
76
+
77
+ .password-input__field {
78
+ flex: 1;
79
+
80
+ block-size: 100%;
81
+ min-inline-size: 0;
82
+ padding: 0;
83
+ padding-inline-start: var(--_padding-x);
84
+
85
+ font-family: inherit;
86
+ font-size: var(--_font-size);
87
+ line-height: 1;
88
+ color: var(--_text);
89
+
90
+ background: transparent;
91
+ border: none;
92
+ outline: none;
93
+
94
+ &::placeholder {
95
+ color: var(--_placeholder);
96
+ }
97
+ }
98
+
99
+ .password-input__toggle {
100
+ display: flex;
101
+ flex-shrink: 0;
102
+ align-items: center;
103
+ justify-content: center;
104
+
105
+ block-size: calc(var(--_height) - var(--ui-space-half, #{t.$space-0}) * 2);
106
+ inline-size: calc(var(--_height) - var(--ui-space-half, #{t.$space-0}) * 2);
107
+ margin-inline-end: calc(var(--ui-space-half, #{t.$space-0}));
108
+
109
+ color: var(--_toggle-color);
110
+
111
+ background: transparent;
112
+ border: none;
113
+ border-radius: var(--ui-radius-sm, #{t.$radius-sm});
114
+ cursor: pointer;
115
+
116
+ transition: background var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
117
+
118
+ &:hover {
119
+ background: var(--_toggle-hover-bg);
120
+ }
121
+
122
+ &:focus-visible {
123
+ outline: 2px solid var(--ui-color-focus, #{t.$color-focus});
124
+ outline-offset: -2px;
125
+ }
126
+
127
+ svg {
128
+ block-size: var(--ui-size-md, #{t.size(md)});
129
+ inline-size: var(--ui-size-md, #{t.size(md)});
130
+
131
+ fill: none;
132
+ stroke: currentcolor;
133
+ stroke-width: 2;
134
+ stroke-linecap: round;
135
+ stroke-linejoin: round;
136
+ }
137
+ }
138
+ }