tyrell-components 1.0.0-TC52 → 1.0.0-TC53
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/css/tyrell-theme.css +25 -2
- package/css/tyrell.css +4 -0
- package/dist/tyrell-colors-static.css +1 -316
- package/dist/tyrell-theme.css +1 -1443
- package/dist/tyrell.css +1 -1390
- package/dist/tyrell.js +1 -1
- package/lib/base/ty-component.js +196 -196
- package/lib/components/button.d.ts +1 -1
- package/lib/components/button.js +260 -259
- package/lib/components/calendar-month.d.ts +2 -2
- package/lib/components/calendar-month.js +426 -416
- package/lib/components/calendar-navigation.js +238 -238
- package/lib/components/calendar.js +605 -602
- package/lib/components/checkbox.d.ts +1 -1
- package/lib/components/checkbox.js +273 -272
- package/lib/components/copy.d.ts +1 -1
- package/lib/components/copy.js +279 -278
- package/lib/components/date-picker.d.ts +1 -1
- package/lib/components/date-picker.js +1103 -1108
- package/lib/components/file-upload.js +404 -404
- package/lib/components/icon.js +141 -141
- package/lib/components/input.d.ts +1 -1
- package/lib/components/input.js +593 -596
- package/lib/components/modal.js +319 -319
- package/lib/components/option.js +167 -167
- package/lib/components/popup.js +233 -233
- package/lib/components/radio.d.ts +2 -2
- package/lib/components/radio.js +407 -406
- package/lib/components/resize-observer.js +67 -67
- package/lib/components/scroll-container.js +294 -294
- package/lib/components/select.d.ts +1 -1
- package/lib/components/select.js +1524 -1532
- package/lib/components/selected-tags.js +184 -184
- package/lib/components/step.js +62 -62
- package/lib/components/switch.d.ts +1 -1
- package/lib/components/switch.js +214 -213
- package/lib/components/tab.js +62 -62
- package/lib/components/tabs.js +507 -507
- package/lib/components/tag.d.ts +1 -1
- package/lib/components/tag.js +236 -235
- package/lib/components/textarea.d.ts +1 -1
- package/lib/components/textarea.js +457 -456
- package/lib/components/tooltip.js +283 -283
- package/lib/components/wizard.js +384 -384
- package/lib/icons/heroicons/micro.js +392 -392
- package/lib/icons/heroicons/mini.js +382 -382
- package/lib/icons/heroicons/outline.js +337 -337
- package/lib/icons/heroicons/solid.js +407 -407
- package/lib/icons/lucide.js +22843 -22843
- package/lib/icons/material/filled.js +9653 -9653
- package/lib/icons/material/outlined.js +10271 -10271
- package/lib/icons/material/round.js +10495 -10495
- package/lib/icons/material/sharp.js +9905 -9905
- package/lib/icons/material/two-tone.js +12792 -12792
- package/lib/index.js +21 -21
- package/lib/styles/button.js +176 -288
- package/lib/styles/calendar-month.js +123 -183
- package/lib/styles/calendar-navigation.js +60 -79
- package/lib/styles/calendar.js +8 -9
- package/lib/styles/checkbox.js +45 -72
- package/lib/styles/copy.js +67 -91
- package/lib/styles/custom-scrollbar.js +80 -100
- package/lib/styles/date-picker.js +261 -331
- package/lib/styles/field-size.d.ts +6 -0
- package/lib/styles/field-size.js +91 -0
- package/lib/styles/file-upload.js +139 -169
- package/lib/styles/icon.js +92 -156
- package/lib/styles/input.js +125 -241
- package/lib/styles/modal.js +67 -102
- package/lib/styles/option.d.ts +1 -1
- package/lib/styles/option.js +47 -67
- package/lib/styles/popup.js +34 -65
- package/lib/styles/radio.js +69 -96
- package/lib/styles/resize-observer.js +2 -5
- package/lib/styles/scroll-container.js +100 -130
- package/lib/styles/select-base.js +525 -778
- package/lib/styles/select.js +140 -228
- package/lib/styles/step.js +22 -29
- package/lib/styles/switch.js +34 -55
- package/lib/styles/tab.js +22 -29
- package/lib/styles/tabs.js +171 -252
- package/lib/styles/tag.js +135 -188
- package/lib/styles/textarea.d.ts +1 -1
- package/lib/styles/textarea.js +205 -271
- package/lib/styles/tooltip.js +3 -3
- package/lib/styles/wizard.js +170 -226
- package/lib/types/common.d.ts +2 -0
- package/lib/types/common.js +6 -5
- package/lib/utils/calendar-utils.js +100 -100
- package/lib/utils/custom-scrollbar.js +272 -272
- package/lib/utils/flavor-sheet.js +14 -14
- package/lib/utils/icon-registry.js +127 -127
- package/lib/utils/loader-registry.js +3 -3
- package/lib/utils/locale.js +34 -34
- package/lib/utils/mobile.js +1 -1
- package/lib/utils/number-format.js +54 -54
- package/lib/utils/positioning.js +212 -212
- package/lib/utils/property-capture.js +36 -36
- package/lib/utils/property-manager.js +125 -125
- package/lib/utils/resize-observer.js +23 -23
- package/lib/utils/scroll-lock.js +57 -57
- package/lib/utils/styles.js +17 -17
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -4
package/lib/styles/input.js
CHANGED
|
@@ -1,310 +1,194 @@
|
|
|
1
1
|
import { FLAVORS } from "../types/common.js";
|
|
2
|
+
import { fieldSizeVars } from "./field-size.js";
|
|
2
3
|
const inputFlavor = (f, fb) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const c = (s) => fb
|
|
5
|
+
? s
|
|
6
|
+
? `var(--ty-color-${f}${s}, var(--ty-color-${f}, var(--ty-color-${fb}${s})))`
|
|
7
|
+
: `var(--ty-color-${f}, var(--ty-color-${fb}))`
|
|
8
|
+
: s
|
|
9
|
+
? `var(--ty-color-${f}${s}, var(--ty-color-${f}))`
|
|
10
|
+
: `var(--ty-color-${f})`;
|
|
11
|
+
return `
|
|
11
12
|
:host([flavor="${f}"]) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
--input-accent: var(--ty-input-${f}-border, ${c("-soft")});
|
|
14
|
+
--input-accent-bold: ${c("")};
|
|
15
|
+
--input-ring: color-mix(in oklab, ${c("")} 15%, transparent);
|
|
15
16
|
}
|
|
16
17
|
:host([flavor="${f}+"]) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
--input-accent: ${c("")};
|
|
19
|
+
--input-accent-bold: ${c("-strong")};
|
|
20
|
+
--input-ring: color-mix(in oklab, ${c("-strong")} 15%, transparent);
|
|
20
21
|
}
|
|
21
22
|
:host([flavor="${f}-"]) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
--input-accent: ${c("-faint")};
|
|
24
|
+
--input-accent-bold: ${c("-soft")};
|
|
25
|
+
--input-ring: color-mix(in oklab, ${c("-soft")} 15%, transparent);
|
|
25
26
|
}
|
|
26
27
|
`;
|
|
27
28
|
};
|
|
28
29
|
export const inputCustomFlavorCss = (base) => inputFlavor(base, "neutral");
|
|
29
30
|
export const inputStyles = `
|
|
31
|
+
${fieldSizeVars}
|
|
30
32
|
:host {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
display: block;
|
|
34
|
+
font-family: inherit;
|
|
35
|
+
width: 100%;
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
:host([size="sm"]) {
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:host([size="lg"]) {
|
|
41
|
-
font-size: 18px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
37
|
.input-container {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
width: 100%;
|
|
41
|
+
box-sizing: border-box;
|
|
49
42
|
}
|
|
50
|
-
|
|
51
43
|
.ty-field-label {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
font-size: var(--ty-field-label-font);
|
|
45
|
+
line-height: var(--ty-field-label-leading);
|
|
46
|
+
letter-spacing: var(--ty-tracking-sm);
|
|
47
|
+
font-weight: var(--ty-font-medium);
|
|
48
|
+
color: var(--ty-label-color);
|
|
49
|
+
margin-bottom: var(--ty-field-label-gap);
|
|
50
|
+
padding-left: var(--ty-field-outer-pad-x);
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
61
53
|
}
|
|
62
|
-
|
|
63
54
|
.required-icon {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
color: var(--ty-color-danger);
|
|
58
|
+
width: 12px;
|
|
59
|
+
height: 12px;
|
|
60
|
+
margin-left: 4px;
|
|
61
|
+
vertical-align: middle;
|
|
71
62
|
}
|
|
72
|
-
|
|
73
63
|
.required-icon svg {
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
76
66
|
}
|
|
77
|
-
|
|
78
67
|
.input-wrapper {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
padding: 0 12px;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 0.5rem;
|
|
71
|
+
width: 100%;
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
border: 1px solid var(--input-accent, var(--input-border, var(--ty-input-border)));
|
|
74
|
+
border-radius: var(--ty-radius-base);
|
|
75
|
+
background: var(--input-bg, var(--input-bg, var(--ty-input-bg)));
|
|
76
|
+
transition: var(--ty-local-transition, all 0.15s ease-in-out);
|
|
77
|
+
min-height: var(--ty-field-height);
|
|
78
|
+
padding: 0 var(--ty-field-pad-x);
|
|
91
79
|
}
|
|
92
|
-
|
|
93
|
-
/* Wrapper states — --input-accent* are set by the flavor rules below;
|
|
94
|
-
without a flavor attribute they're unset and the default chrome chain
|
|
95
|
-
(per-instance --input-* var, then --ty-input-* token) applies. */
|
|
96
|
-
/* :not(.focused) — hover must never override focus. Without the guard this
|
|
97
|
-
rule out-ranks .focused by specificity, so hovering a FOCUSED unflavored
|
|
98
|
-
input swapped its primary focus border for the dimmer neutral hover
|
|
99
|
-
border (focus ring stayed, border dimmed — read as a glitch). Same
|
|
100
|
-
pattern as date-picker's :hover:not(.open). */
|
|
101
80
|
.input-wrapper:hover:not(.disabled):not(.focused) {
|
|
102
|
-
|
|
81
|
+
border-color: var(--input-accent-bold, var(--input-border-hover, var(--ty-input-border-hover)));
|
|
103
82
|
}
|
|
104
|
-
|
|
105
83
|
.input-wrapper.focused {
|
|
106
|
-
|
|
107
|
-
|
|
84
|
+
border-color: var(--input-accent-bold, var(--input-border-focus, var(--ty-input-border-focus)));
|
|
85
|
+
box-shadow: 0 0 0 3px var(--input-ring, var(--input-shadow-focus, var(--ty-input-shadow-focus)));
|
|
108
86
|
}
|
|
109
|
-
|
|
110
87
|
.input-wrapper.disabled {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
88
|
+
cursor: not-allowed;
|
|
89
|
+
opacity: 0.5;
|
|
90
|
+
background: var(--input-disabled-bg, var(--ty-input-disabled-bg));
|
|
91
|
+
border-color: var(--input-disabled-border, var(--ty-input-disabled-border));
|
|
115
92
|
}
|
|
116
|
-
|
|
117
93
|
::slotted([slot="start"]),
|
|
118
94
|
::slotted([slot="end"]) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
flex-shrink: 0;
|
|
99
|
+
color: var(--ty-color-text-soft);
|
|
124
100
|
}
|
|
125
|
-
|
|
126
|
-
/* Password reveal toggle (rendered for type="password") */
|
|
127
101
|
.password-toggle {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
width: 1.25rem;
|
|
107
|
+
height: 1.25rem;
|
|
108
|
+
padding: 0;
|
|
109
|
+
border: none;
|
|
110
|
+
background: none;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
color: var(--input-placeholder, var(--ty-input-placeholder));
|
|
113
|
+
transition: var(--ty-local-transition, color 0.15s ease-in-out);
|
|
140
114
|
}
|
|
141
115
|
.password-toggle:hover {
|
|
142
|
-
|
|
116
|
+
color: var(--input-color, var(--ty-input-color));
|
|
143
117
|
}
|
|
144
118
|
.password-toggle:focus-visible {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
119
|
+
outline: 2px solid var(--input-accent, var(--ty-color-primary));
|
|
120
|
+
outline-offset: 2px;
|
|
121
|
+
border-radius: 2px;
|
|
148
122
|
}
|
|
149
123
|
.password-toggle svg {
|
|
150
|
-
|
|
151
|
-
|
|
124
|
+
width: 1rem;
|
|
125
|
+
height: 1rem;
|
|
152
126
|
}
|
|
153
|
-
|
|
154
127
|
::slotted(ty-icon) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
128
|
+
width: 1em;
|
|
129
|
+
height: 1em;
|
|
130
|
+
flex-shrink: 0;
|
|
158
131
|
}
|
|
159
|
-
|
|
160
132
|
.error-message {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
133
|
+
font-size: var(--ty-font-xs);
|
|
134
|
+
line-height: var(--ty-leading-xs);
|
|
135
|
+
letter-spacing: var(--ty-tracking-xs);
|
|
136
|
+
color: var(--ty-color-danger);
|
|
137
|
+
margin-top: 4px;
|
|
138
|
+
padding-left: var(--ty-field-outer-pad-x);
|
|
167
139
|
}
|
|
168
|
-
|
|
169
140
|
.input-wrapper.error {
|
|
170
|
-
|
|
171
|
-
|
|
141
|
+
border-color: var(--ty-color-danger);
|
|
142
|
+
background: var(--ty-bg-danger-soft);
|
|
172
143
|
}
|
|
173
|
-
|
|
174
144
|
.input-wrapper.error.focused {
|
|
175
|
-
|
|
176
|
-
|
|
145
|
+
border-color: var(--ty-color-danger-bold);
|
|
146
|
+
box-shadow: 0 0 0 3px var(--input-shadow-focus, var(--ty-input-shadow-focus));
|
|
177
147
|
}
|
|
178
|
-
|
|
179
148
|
input {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
padding: 0;
|
|
195
|
-
margin: 0;
|
|
149
|
+
flex: 1;
|
|
150
|
+
min-width: 0;
|
|
151
|
+
box-sizing: border-box;
|
|
152
|
+
border: none;
|
|
153
|
+
outline: none;
|
|
154
|
+
background: transparent;
|
|
155
|
+
color: var(--input-color, var(--ty-input-color));
|
|
156
|
+
font-family: inherit;
|
|
157
|
+
font-size: var(--ty-field-font);
|
|
158
|
+
line-height: var(--ty-field-leading);
|
|
159
|
+
letter-spacing: var(--ty-field-tracking);
|
|
160
|
+
font-weight: var(--ty-font-normal);
|
|
161
|
+
padding: 0;
|
|
162
|
+
margin: 0;
|
|
196
163
|
}
|
|
197
|
-
|
|
198
|
-
/* Remove number input spinner arrows */
|
|
199
164
|
input[type="number"]::-webkit-outer-spin-button,
|
|
200
165
|
input[type="number"]::-webkit-inner-spin-button {
|
|
201
|
-
|
|
202
|
-
|
|
166
|
+
-webkit-appearance: none;
|
|
167
|
+
margin: 0;
|
|
203
168
|
}
|
|
204
|
-
|
|
205
169
|
input[type="number"] {
|
|
206
|
-
|
|
170
|
+
-moz-appearance: textfield;
|
|
207
171
|
}
|
|
208
|
-
|
|
209
172
|
input:disabled {
|
|
210
|
-
|
|
211
|
-
|
|
173
|
+
cursor: not-allowed;
|
|
174
|
+
color: var(--input-disabled-color, var(--ty-input-disabled-color));
|
|
212
175
|
}
|
|
213
|
-
|
|
214
176
|
input::placeholder {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.input-wrapper.sm {
|
|
220
|
-
min-height: var(--ty-size-sm);
|
|
221
|
-
padding: 0 10px;
|
|
222
|
-
border-radius: var(--ty-input-radius-sm, var(--ty-radius-base));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.input-wrapper.sm input {
|
|
226
|
-
font-size: var(--ty-font-sm);
|
|
227
|
-
line-height: var(--ty-leading-sm);
|
|
228
|
-
letter-spacing: var(--ty-tracking-sm);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.input-wrapper.md {
|
|
232
|
-
min-height: var(--ty-size-md);
|
|
233
|
-
padding: 0 12px;
|
|
234
|
-
border-radius: var(--ty-input-radius-md, var(--ty-radius-base));
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.input-wrapper.md input {
|
|
238
|
-
font-size: var(--ty-font-sm);
|
|
239
|
-
line-height: var(--ty-leading-sm);
|
|
240
|
-
letter-spacing: var(--ty-tracking-sm);
|
|
177
|
+
color: var(--input-placeholder, var(--ty-input-placeholder));
|
|
178
|
+
font-weight: 400;
|
|
241
179
|
}
|
|
242
|
-
|
|
243
|
-
.input-wrapper.lg {
|
|
244
|
-
min-height: var(--ty-size-lg);
|
|
245
|
-
padding: 0 14px;
|
|
246
|
-
border-radius: var(--ty-input-radius-lg, var(--ty-radius-base));
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.input-wrapper.lg input {
|
|
250
|
-
font-size: var(--ty-font-base);
|
|
251
|
-
line-height: var(--ty-leading-base);
|
|
252
|
-
letter-spacing: var(--ty-tracking-base);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/* Semantic flavor modifiers set --input-accent*, consumed above */
|
|
256
180
|
${FLAVORS.filter((f) => f !== "neutral").map((f) => inputFlavor(f)).join("")}
|
|
257
|
-
|
|
258
181
|
input:focus-visible {
|
|
259
|
-
|
|
182
|
+
outline: none;
|
|
260
183
|
}
|
|
261
|
-
|
|
262
184
|
@media (prefers-contrast: high) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
185
|
+
.input-wrapper {
|
|
186
|
+
border-width: 2px;
|
|
266
187
|
}
|
|
267
|
-
|
|
268
|
-
@media (prefers-reduced-motion: reduce) {
|
|
269
|
-
.input-wrapper {
|
|
270
|
-
transition: none;
|
|
271
|
-
}
|
|
272
188
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
min-height: 40px;
|
|
277
|
-
padding: 0 12px;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.input-wrapper.lg input {
|
|
281
|
-
font-size: var(--ty-font-sm);
|
|
282
|
-
line-height: var(--ty-leading-sm);
|
|
283
|
-
letter-spacing: var(--ty-tracking-sm);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.input-wrapper.xl {
|
|
287
|
-
min-height: 44px;
|
|
288
|
-
padding: 0 14px;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.input-wrapper.xl input {
|
|
292
|
-
font-size: var(--ty-font-base);
|
|
293
|
-
line-height: var(--ty-leading-base);
|
|
294
|
-
letter-spacing: var(--ty-tracking-base);
|
|
295
|
-
}
|
|
189
|
+
@media (prefers-reduced-motion: reduce) {
|
|
190
|
+
.input-wrapper {
|
|
191
|
+
transition: none;
|
|
296
192
|
}
|
|
297
|
-
|
|
298
|
-
@media (max-width: 480px) {
|
|
299
|
-
.input-wrapper.xl {
|
|
300
|
-
min-height: 40px;
|
|
301
|
-
padding: 0 12px;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.input-wrapper.xl input {
|
|
305
|
-
font-size: var(--ty-font-sm);
|
|
306
|
-
line-height: var(--ty-leading-sm);
|
|
307
|
-
letter-spacing: var(--ty-tracking-sm);
|
|
308
|
-
}
|
|
309
193
|
}
|
|
310
194
|
`;
|
package/lib/styles/modal.js
CHANGED
|
@@ -1,132 +1,97 @@
|
|
|
1
1
|
export const modalStyles = `
|
|
2
2
|
:host {
|
|
3
|
-
|
|
4
|
-
/* Don't interfere with layout */
|
|
3
|
+
display: contents;
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
/* Part of the modal wrapper functionality, not user content styling */
|
|
8
5
|
.close-button {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-moz-user-select: none;
|
|
33
|
-
-ms-user-select: none;
|
|
34
|
-
user-select: none;
|
|
35
|
-
}
|
|
36
|
-
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: -8px;
|
|
8
|
+
right: -8px;
|
|
9
|
+
background: transparent;
|
|
10
|
+
border: none;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
padding: 4px;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
transition: var(--ty-transition-colors);
|
|
15
|
+
z-index: 1;
|
|
16
|
+
color: #d8d8d8;
|
|
17
|
+
outline: none;
|
|
18
|
+
box-shadow: none;
|
|
19
|
+
-webkit-appearance: none;
|
|
20
|
+
-moz-appearance: none;
|
|
21
|
+
appearance: none;
|
|
22
|
+
-webkit-tap-highlight-color: transparent;
|
|
23
|
+
-webkit-touch-callout: none;
|
|
24
|
+
-webkit-user-select: none;
|
|
25
|
+
-moz-user-select: none;
|
|
26
|
+
-ms-user-select: none;
|
|
27
|
+
user-select: none;
|
|
28
|
+
}
|
|
37
29
|
.close-button:hover {
|
|
38
|
-
|
|
30
|
+
color: white;
|
|
39
31
|
}
|
|
40
|
-
|
|
41
|
-
/* Explicitly remove focus and active states for all interaction modes */
|
|
42
32
|
.close-button:focus,
|
|
43
33
|
.close-button:focus-visible,
|
|
44
34
|
.close-button:focus-within,
|
|
45
35
|
.close-button:active {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
outline: none !important;
|
|
37
|
+
box-shadow: none !important;
|
|
38
|
+
border: none !important;
|
|
39
|
+
background: transparent !important;
|
|
50
40
|
}
|
|
51
|
-
|
|
52
|
-
/* Override hover color even in focus/active states */
|
|
53
41
|
.close-button:hover,
|
|
54
42
|
.close-button:focus:hover,
|
|
55
43
|
.close-button:active:hover {
|
|
56
|
-
|
|
44
|
+
color: white;
|
|
57
45
|
}
|
|
58
|
-
|
|
59
46
|
.close-button.hide {
|
|
60
|
-
|
|
47
|
+
visibility: hidden;
|
|
61
48
|
}
|
|
62
|
-
|
|
63
|
-
/* Pure wrapper: only essential modal functionality, no styling of user content */
|
|
64
49
|
.ty-modal-dialog {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
/* No sizing - let user content determine size */
|
|
81
|
-
max-width: 85vw;
|
|
82
|
-
max-height: 90vh;
|
|
83
|
-
|
|
84
|
-
outline: none;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* Panel zoom-in synced with the backdrop fade (shadcn-style zoom-in-95).
|
|
88
|
-
Enter-only: animating exit on a native <dialog> means delaying close(). */
|
|
50
|
+
padding: 18px;
|
|
51
|
+
border: none;
|
|
52
|
+
margin: 0;
|
|
53
|
+
background: transparent;
|
|
54
|
+
position: fixed;
|
|
55
|
+
top: 50%;
|
|
56
|
+
left: 50%;
|
|
57
|
+
transform: translate(-50%, -50%);
|
|
58
|
+
z-index: 1000;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
max-width: 85vw;
|
|
61
|
+
max-height: 90vh;
|
|
62
|
+
outline: none;
|
|
63
|
+
}
|
|
89
64
|
.ty-modal-dialog[open] {
|
|
90
|
-
|
|
65
|
+
animation: ty-modal-enter var(--ty-modal-duration, 200ms) ease-out;
|
|
91
66
|
}
|
|
92
|
-
|
|
93
67
|
@keyframes ty-modal-enter {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/* Backdrop is part of modal functionality, not user content */
|
|
68
|
+
from {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
transform: translate(-50%, -50%) scale(0.93);
|
|
71
|
+
}
|
|
72
|
+
to {
|
|
73
|
+
opacity: 1;
|
|
74
|
+
transform: translate(-50%, -50%) scale(1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
106
77
|
.ty-modal-dialog::backdrop {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
78
|
+
background: var(--ty-modal-backdrop, rgba(0, 0, 0, 0.5));
|
|
79
|
+
backdrop-filter: var(--ty-modal-backdrop-blur, blur(2px));
|
|
80
|
+
animation: ty-modal-backdrop-enter var(--ty-modal-duration, 200ms) ease-out;
|
|
110
81
|
}
|
|
111
|
-
|
|
112
|
-
/* When backdrop is disabled */
|
|
113
82
|
.ty-modal-dialog:not([data-backdrop])::backdrop {
|
|
114
|
-
|
|
115
|
-
|
|
83
|
+
background: transparent;
|
|
84
|
+
backdrop-filter: none;
|
|
116
85
|
}
|
|
117
|
-
|
|
118
|
-
/* Minimal container - no styling imposed on user content */
|
|
119
86
|
.modal-content {
|
|
120
|
-
|
|
87
|
+
color: var(--ty-text);
|
|
121
88
|
}
|
|
122
|
-
|
|
123
89
|
@keyframes ty-modal-backdrop-enter {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
90
|
+
from {
|
|
91
|
+
opacity: 0;
|
|
92
|
+
}
|
|
93
|
+
to {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
131
96
|
}
|
|
132
97
|
`;
|
package/lib/styles/option.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Option Component Styles */
|
|
2
|
-
export declare const optionStyles = "\n.option-content {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--ty-spacing-2);\n box-sizing: border-box;\n width: 100%;\n\n cursor: pointer;\n user-select: none;\n\n transition: var(--ty-transition-all);\n\n /* Linear-paired typography */\n color: var(--ty-text);\n font-family: inherit;\n font-size: var(--ty-font-sm);\n line-height: var(--ty-leading-sm);\n letter-spacing: var(--ty-tracking-sm);\n padding: var(--ty-spacing-2) var(--ty-spacing-3);\n border-radius: var(--ty-radius-md);\n}\n\n/* Cloned copy (projected into the select's trigger field): host defaults to\n inline like any unstyled custom element, which ignores width/overflow \u2014\n force a block box so the parent's flex-basis:0 truncation (select.ts\n .select-stub.has-clone slot[name=\"selected\"]) actually clips it, and\n collapse the content to a single ellipsized line instead of wrapping. */\n:host([cloned]) {\n display: block;\n min-width: 0;\n overflow: hidden;\n}\n:host([cloned]) .option-content {\n display: block;\n padding: 0px;\n background: transparent;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.option-content:hover {\n background: var(--ty-bg-neutral-soft);\n}\n\n.option-content[highlighted] {\n background: var(--ty-bg-neutral-soft);\n color: var(--ty-text-strong);\n font-weight: var(--ty-font-semibold);\n}\n\n/* Selected: quiet \u2014 bolder text color only, no background slab, no weight change */\n.option-content[selected] {\n background: transparent;\n color: var(--ty-text-bold);\n}\n\n/* Lucide check \u2014 right-aligned, visible only on selected options */\n.option-check {\n display: none;\n flex-shrink: 0;\n width: 14px;\n height: 14px;\n margin-left: auto;\n color: var(--ty-color-primary);\n}\n\n.option-content[selected] .option-check {\n display: block;\n}\n\n/* Never show the check on the copy cloned into the select's trigger field */\n:host([cloned]) .option-check {\n display: none;\n}\n\n.option-content[selected]:hover {\n background: var(--ty-bg-neutral-soft);\n}\n\n.option-content[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.option-content[hidden] {}\n\n.option-content * {\n pointer-events: none;\n}\n";
|
|
2
|
+
export declare const optionStyles = "\n.option-content {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--ty-spacing-2);\n box-sizing: border-box;\n width: 100%;\n\n cursor: pointer;\n user-select: none;\n\n transition: var(--ty-transition-all);\n\n /* Linear-paired typography */\n color: var(--ty-text);\n font-family: inherit;\n font-size: var(--ty-font-sm);\n line-height: var(--ty-leading-sm);\n letter-spacing: var(--ty-tracking-sm);\n padding: var(--ty-spacing-2) var(--ty-spacing-3);\n border-radius: var(--ty-radius-md);\n}\n\n/* Cloned copy (projected into the select's trigger field): host defaults to\n inline like any unstyled custom element, which ignores width/overflow \u2014\n force a block box so the parent's flex-basis:0 truncation (select.ts\n .select-stub.has-clone slot[name=\"selected\"]) actually clips it, and\n collapse the content to a single ellipsized line instead of wrapping. */\n:host([cloned]) {\n display: block;\n min-width: 0;\n overflow: hidden;\n}\n\n/* The clone sits in the select's TRIGGER, so its type follows the field size\n ladder (styles/field-size.ts) rather than the dropdown list's own scale \u2014\n the --ty-field-* vars inherit from ty-select through the light DOM. The\n fallbacks cover a ty-option rendered outside a select. */\n:host([cloned]) .option-content {\n display: block;\n padding: 0px;\n background: transparent;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n font-size: var(--ty-field-font, var(--ty-font-sm));\n line-height: var(--ty-field-leading, var(--ty-leading-sm));\n letter-spacing: var(--ty-field-tracking, var(--ty-tracking-sm));\n}\n\n.option-content:hover {\n background: var(--ty-bg-neutral-soft);\n}\n\n.option-content[highlighted] {\n background: var(--ty-bg-neutral-soft);\n color: var(--ty-text-strong);\n font-weight: var(--ty-font-semibold);\n}\n\n/* Selected: quiet \u2014 bolder text color only, no background slab, no weight change */\n.option-content[selected] {\n background: transparent;\n color: var(--ty-text-bold);\n}\n\n/* Lucide check \u2014 right-aligned, visible only on selected options */\n.option-check {\n display: none;\n flex-shrink: 0;\n width: 14px;\n height: 14px;\n margin-left: auto;\n color: var(--ty-color-primary);\n}\n\n.option-content[selected] .option-check {\n display: block;\n}\n\n/* Never show the check on the copy cloned into the select's trigger field */\n:host([cloned]) .option-check {\n display: none;\n}\n\n.option-content[selected]:hover {\n background: var(--ty-bg-neutral-soft);\n}\n\n.option-content[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.option-content[hidden] {}\n\n.option-content * {\n pointer-events: none;\n}\n";
|