tyrell-components 1.0.0-RC14 → 1.0.0-RC15

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 (113) hide show
  1. package/README.md +9 -1
  2. package/css/tyrell-theme.css +25 -2
  3. package/css/tyrell.css +4 -0
  4. package/dist/tyrell-colors-static.css +1 -316
  5. package/dist/tyrell-theme.css +1 -1443
  6. package/dist/tyrell.css +1 -1390
  7. package/dist/tyrell.js +1 -1
  8. package/lib/base/ty-component.js +196 -196
  9. package/lib/components/button.d.ts +1 -1
  10. package/lib/components/button.js +261 -259
  11. package/lib/components/calendar-month.d.ts +2 -2
  12. package/lib/components/calendar-month.js +439 -416
  13. package/lib/components/calendar-navigation.js +238 -238
  14. package/lib/components/calendar.d.ts +5 -3
  15. package/lib/components/calendar.js +611 -602
  16. package/lib/components/checkbox.d.ts +1 -1
  17. package/lib/components/checkbox.js +273 -272
  18. package/lib/components/copy.d.ts +1 -1
  19. package/lib/components/copy.js +280 -278
  20. package/lib/components/date-picker.d.ts +8 -1
  21. package/lib/components/date-picker.js +1128 -1108
  22. package/lib/components/file-upload.js +404 -404
  23. package/lib/components/icon.js +141 -141
  24. package/lib/components/input.d.ts +1 -1
  25. package/lib/components/input.js +593 -596
  26. package/lib/components/modal.js +319 -319
  27. package/lib/components/option.js +167 -167
  28. package/lib/components/popup.js +233 -233
  29. package/lib/components/radio.d.ts +2 -2
  30. package/lib/components/radio.js +407 -406
  31. package/lib/components/resize-observer.js +67 -67
  32. package/lib/components/scroll-container.js +292 -294
  33. package/lib/components/select.d.ts +71 -12
  34. package/lib/components/select.js +1605 -1529
  35. package/lib/components/selected-tags.d.ts +1 -1
  36. package/lib/components/selected-tags.js +188 -182
  37. package/lib/components/step.js +62 -62
  38. package/lib/components/switch.d.ts +1 -1
  39. package/lib/components/switch.js +214 -213
  40. package/lib/components/tab.js +62 -62
  41. package/lib/components/tabs.d.ts +1 -0
  42. package/lib/components/tabs.js +523 -492
  43. package/lib/components/tag.d.ts +1 -1
  44. package/lib/components/tag.js +236 -235
  45. package/lib/components/textarea.d.ts +1 -1
  46. package/lib/components/textarea.js +457 -456
  47. package/lib/components/tooltip.js +283 -283
  48. package/lib/components/wizard.js +384 -384
  49. package/lib/icons/heroicons/micro.js +392 -392
  50. package/lib/icons/heroicons/mini.js +382 -382
  51. package/lib/icons/heroicons/outline.js +337 -337
  52. package/lib/icons/heroicons/solid.js +407 -407
  53. package/lib/icons/lucide.js +22843 -22843
  54. package/lib/icons/material/filled.js +9653 -9653
  55. package/lib/icons/material/outlined.js +10271 -10271
  56. package/lib/icons/material/round.js +10495 -10495
  57. package/lib/icons/material/sharp.js +9905 -9905
  58. package/lib/icons/material/two-tone.js +12792 -12792
  59. package/lib/index.js +21 -21
  60. package/lib/styles/button.js +200 -302
  61. package/lib/styles/calendar-month.js +123 -183
  62. package/lib/styles/calendar-navigation.d.ts +1 -1
  63. package/lib/styles/calendar-navigation.js +64 -79
  64. package/lib/styles/calendar.d.ts +1 -1
  65. package/lib/styles/calendar.js +9 -9
  66. package/lib/styles/checkbox.js +45 -72
  67. package/lib/styles/copy.js +67 -91
  68. package/lib/styles/custom-scrollbar.js +80 -100
  69. package/lib/styles/date-picker.js +261 -331
  70. package/lib/styles/field-size.d.ts +6 -0
  71. package/lib/styles/field-size.js +91 -0
  72. package/lib/styles/file-upload.js +139 -169
  73. package/lib/styles/icon.js +92 -156
  74. package/lib/styles/input.js +125 -241
  75. package/lib/styles/modal.js +67 -102
  76. package/lib/styles/option.d.ts +1 -1
  77. package/lib/styles/option.js +47 -67
  78. package/lib/styles/popup.js +34 -65
  79. package/lib/styles/radio.js +69 -96
  80. package/lib/styles/resize-observer.js +2 -5
  81. package/lib/styles/scroll-container.js +100 -130
  82. package/lib/styles/select-base.js +596 -773
  83. package/lib/styles/select.js +140 -228
  84. package/lib/styles/step.js +22 -29
  85. package/lib/styles/switch.js +34 -55
  86. package/lib/styles/tab.d.ts +1 -1
  87. package/lib/styles/tab.js +22 -29
  88. package/lib/styles/tabs.d.ts +1 -1
  89. package/lib/styles/tabs.js +186 -180
  90. package/lib/styles/tag.js +135 -188
  91. package/lib/styles/textarea.d.ts +1 -1
  92. package/lib/styles/textarea.js +205 -271
  93. package/lib/styles/tooltip.js +3 -3
  94. package/lib/styles/wizard.js +170 -226
  95. package/lib/types/common.d.ts +2 -0
  96. package/lib/types/common.js +6 -5
  97. package/lib/utils/calendar-utils.js +100 -100
  98. package/lib/utils/custom-scrollbar.js +272 -272
  99. package/lib/utils/flavor-sheet.js +14 -14
  100. package/lib/utils/icon-registry.js +127 -127
  101. package/lib/utils/loader-registry.js +3 -3
  102. package/lib/utils/locale.js +34 -34
  103. package/lib/utils/mobile.js +1 -1
  104. package/lib/utils/number-format.js +54 -54
  105. package/lib/utils/positioning.js +212 -212
  106. package/lib/utils/property-capture.js +36 -36
  107. package/lib/utils/property-manager.js +125 -125
  108. package/lib/utils/resize-observer.js +23 -23
  109. package/lib/utils/scroll-lock.js +57 -57
  110. package/lib/utils/styles.js +17 -17
  111. package/lib/version.d.ts +1 -1
  112. package/lib/version.js +1 -1
  113. package/package.json +4 -4
@@ -1,962 +1,785 @@
1
1
  import { FLAVORS } from "../types/common.js";
2
+ import { fieldSizeVars } from "./field-size.js";
2
3
  import { customScrollbarStyles } from "./custom-scrollbar.js";
3
4
  const selectFlavor = (f, fb) => {
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 `
5
+ const c = (s) => fb
6
+ ? s
7
+ ? `var(--ty-color-${f}${s}, var(--ty-color-${f}, var(--ty-color-${fb}${s})))`
8
+ : `var(--ty-color-${f}, var(--ty-color-${fb}))`
9
+ : s
10
+ ? `var(--ty-color-${f}${s}, var(--ty-color-${f}))`
11
+ : `var(--ty-color-${f})`;
12
+ return `
12
13
  :host([flavor="${f}"]) {
13
- --select-accent: var(--ty-input-${f}-border, ${c("-soft")});
14
- --select-accent-bold: ${c("")};
15
- --select-ring: color-mix(in oklab, ${c("")} 15%, transparent);
14
+ --select-accent: var(--ty-input-${f}-border, ${c("-soft")});
15
+ --select-accent-bold: ${c("")};
16
+ --select-ring: color-mix(in oklab, ${c("")} 15%, transparent);
16
17
  }
17
18
  :host([flavor="${f}+"]) {
18
- --select-accent: ${c("")};
19
- --select-accent-bold: ${c("-strong")};
20
- --select-ring: color-mix(in oklab, ${c("-strong")} 15%, transparent);
19
+ --select-accent: ${c("")};
20
+ --select-accent-bold: ${c("-strong")};
21
+ --select-ring: color-mix(in oklab, ${c("-strong")} 15%, transparent);
21
22
  }
22
23
  :host([flavor="${f}-"]) {
23
- --select-accent: ${c("-faint")};
24
- --select-accent-bold: ${c("-soft")};
25
- --select-ring: color-mix(in oklab, ${c("-soft")} 15%, transparent);
24
+ --select-accent: ${c("-faint")};
25
+ --select-accent-bold: ${c("-soft")};
26
+ --select-ring: color-mix(in oklab, ${c("-soft")} 15%, transparent);
26
27
  }
27
28
  `;
28
29
  };
29
30
  export const selectCustomFlavorCss = (base) => selectFlavor(base, "neutral");
30
31
  export const selectBaseStyles = `
32
+ ${fieldSizeVars}
31
33
  :host {
32
- display: block;
33
- width: 100%;
34
- font-family: inherit;
35
- --mobile-border-color: var(--ty-border, #5858587d);
36
- }
37
-
38
- /* compact is a toolbar/filter-bar trigger — it must hug its own content so
39
- it can sit inline next to other toolbar items, not claim a full row.
40
- inline-block (not plain inline): a block box still ignores width and
41
- collapses vertical margin, which is what we're fixing above. */
34
+ display: block;
35
+ width: 100%;
36
+ font-family: inherit;
37
+ --mobile-border-color: var(--ty-border, #5858587d);
38
+ }
42
39
  :host([compact]) {
43
- display: inline-block;
44
- width: auto;
40
+ display: inline-block;
41
+ width: auto;
42
+ }
43
+ :host([has-trigger]) {
44
+ display: inline-block;
45
+ width: auto;
45
46
  }
46
-
47
47
  .dropdown-dialog {
48
- position: fixed;
49
- width: var(--dropdown-width, 200px);
50
- max-width: 100vw;
51
- margin: 0;
52
- padding: 0;
53
- border: none;
54
- background: transparent;
55
- box-sizing: border-box;
56
- padding: var(--dropdown-padding, 20px);
57
- /* Modal handles z-index automatically */
58
-
59
- opacity: 0;
60
- /* Panel-level entrance: individual scale/translate compose with the
61
- collision-shift transform below. The single-select skin flattens the
62
- inner .dropdown-options animation (select.ts: "panel appears as one"),
63
- so the dialog carries the motion for both skins. */
64
- scale: 0.96;
65
- translate: 0 -6px;
66
- transform-origin: top center;
67
- transition:
68
- opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
69
- scale var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
70
- translate var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
71
-
72
- transform: translate(var(--dropdown-offset-x, 0px), var(--dropdown-offset-y, 0px));
73
- top: -1000px;
74
- left: -1000px;
75
- }
76
-
77
- /* When opened via showModal(), apply flex layout and direction */
48
+ position: fixed;
49
+ width: var(--dropdown-width, 200px);
50
+ max-width: 100vw;
51
+ margin: 0;
52
+ padding: 0;
53
+ border: none;
54
+ background: transparent;
55
+ box-sizing: border-box;
56
+ padding: var(--dropdown-padding, 20px);
57
+ opacity: 0;
58
+ scale: 0.96;
59
+ translate: 0 -6px;
60
+ transform-origin: top center;
61
+ transition:
62
+ opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
63
+ scale var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
64
+ translate var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
65
+ transform: translate(var(--dropdown-offset-x, 0px), var(--dropdown-offset-y, 0px));
66
+ top: -1000px;
67
+ left: -1000px;
68
+ }
78
69
  .dropdown-dialog[open] {
79
- display: flex;
80
- flex-direction: column;
70
+ display: flex;
71
+ flex-direction: column;
81
72
  }
82
-
83
73
  .dropdown-dialog.position-below {
84
- left: var(--dropdown-x);
85
- top: var(--dropdown-y);
74
+ left: var(--dropdown-x);
75
+ top: var(--dropdown-y);
86
76
  }
87
-
88
77
  .dropdown-dialog.position-above {
89
- left: var(--dropdown-x);
90
- bottom: var(--dropdown-y);
91
- top: auto;
92
- flex-direction: column-reverse;
93
- translate: 0 6px;
94
- transform-origin: bottom center;
95
- }
96
-
78
+ left: var(--dropdown-x);
79
+ bottom: var(--dropdown-y);
80
+ top: auto;
81
+ flex-direction: column-reverse;
82
+ translate: 0 6px;
83
+ transform-origin: bottom center;
84
+ }
97
85
  .dropdown-dialog.position-above .dropdown-header {
98
- margin-top: 4px;
86
+ margin-top: 4px;
99
87
  }
100
-
101
88
  .dropdown-dialog.position-below .dropdown-header {
102
- margin-bottom: 4px;
89
+ margin-bottom: 4px;
103
90
  }
104
-
105
91
  .dropdown-dialog.position-below .dropdown-options {
106
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1), var(--ty-shadow-md);
92
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1), var(--ty-shadow-md);
107
93
  }
108
-
109
94
  .dropdown-dialog.position-above .dropdown-options {
110
- transform: translateY(6px) scale(0.96);
111
- transform-origin: bottom center;
95
+ transform: translateY(6px) scale(0.96);
96
+ transform-origin: bottom center;
112
97
  }
113
-
114
98
  .dropdown-dialog.open {
115
- opacity: 1;
116
- scale: 1;
117
- translate: 0 0;
99
+ opacity: 1;
100
+ scale: 1;
101
+ translate: 0 0;
118
102
  }
119
-
120
103
  .dropdown-dialog.open .dropdown-options {
121
- opacity: 1;
122
- transform: translateY(0) scale(1);
123
- }
124
-
125
- /* Transitions never start on an element that was display:none last frame —
126
- showModal() + .open land in the same frame, so the enter transition was
127
- silently skipped. @starting-style supplies the first-frame "from" values
128
- (this is the platform mechanism for animating dialog/top-layer entry). */
104
+ opacity: 1;
105
+ transform: translateY(0) scale(1);
106
+ }
129
107
  @starting-style {
130
- .dropdown-dialog.open {
131
- opacity: 0;
132
- scale: 0.96;
133
- translate: 0 -6px;
134
- }
135
-
136
- .dropdown-dialog.open.position-above {
137
- translate: 0 6px;
138
- }
139
-
140
- .dropdown-dialog.open .dropdown-options {
141
- opacity: 0;
142
- transform: translateY(-6px) scale(0.96);
143
- }
144
-
145
- .dropdown-dialog.open.position-above .dropdown-options {
146
- transform: translateY(6px) scale(0.96);
147
- }
148
- }
149
-
108
+ .dropdown-dialog.open {
109
+ opacity: 0;
110
+ scale: 0.96;
111
+ translate: 0 -6px;
112
+ }
113
+ .dropdown-dialog.open.position-above {
114
+ translate: 0 6px;
115
+ }
116
+ .dropdown-dialog.open .dropdown-options {
117
+ opacity: 0;
118
+ transform: translateY(-6px) scale(0.96);
119
+ }
120
+ .dropdown-dialog.open.position-above .dropdown-options {
121
+ transform: translateY(6px) scale(0.96);
122
+ }
123
+ }
150
124
  .dropdown-dialog::backdrop {
151
- background: transparent;
125
+ background: transparent;
152
126
  }
153
-
154
127
  .dropdown-header {
155
- display: flex;
156
- align-items: center;
157
- gap: var(--ty-spacing-2);
158
- position: relative;
128
+ display: flex;
129
+ align-items: center;
130
+ gap: var(--ty-spacing-2);
131
+ position: relative;
159
132
  }
160
-
161
133
  .dropdown-search-input {
162
- font-family: inherit;
163
- width: 100%;
164
- min-width: 0;
165
- box-sizing: border-box;
166
- background: var(--input-bg, var(--ty-input-bg));
167
- color: var(--input-color, var(--ty-input-color));
168
- border: 1px solid var(--input-border, var(--ty-input-border));
169
- border-radius: var(--ty-radius-md);
170
- font-family: inherit;
171
- font-size: var(--ty-font-sm);
172
- line-height: var(--ty-leading-sm);
173
- letter-spacing: var(--ty-tracking-sm);
174
- font-weight: var(--ty-font-normal);
175
- min-height: var(--ty-size-md);
176
- padding: var(--ty-spacing-2) var(--ty-spacing-3);
177
- padding-right: calc(var(--ty-spacing-3) + 1rem + var(--ty-spacing-2));
178
- transition: var(--ty-transition-all);
179
- outline: none;
180
- }
181
-
134
+ font-family: inherit;
135
+ width: 100%;
136
+ min-width: 0;
137
+ box-sizing: border-box;
138
+ background: var(--input-bg, var(--ty-input-bg));
139
+ color: var(--input-color, var(--ty-input-color));
140
+ border: 1px solid var(--input-border, var(--ty-input-border));
141
+ border-radius: var(--ty-radius-md);
142
+ font-family: inherit;
143
+ font-size: var(--ty-font-sm);
144
+ line-height: var(--ty-leading-sm);
145
+ letter-spacing: var(--ty-tracking-sm);
146
+ font-weight: var(--ty-font-normal);
147
+ min-height: var(--ty-size-md);
148
+ padding: var(--ty-spacing-2) var(--ty-spacing-3);
149
+ padding-right: calc(var(--ty-spacing-3) + 1rem + var(--ty-spacing-2));
150
+ transition: var(--ty-transition-all);
151
+ outline: none;
152
+ }
182
153
  .dropdown-search-input:focus {
183
- border-color: var(--input-border-focus, var(--ty-input-border-focus));
184
- box-shadow: 0 0 0 3px var(--input-shadow-focus, var(--ty-input-shadow-focus));
154
+ border-color: var(--input-border-focus, var(--ty-input-border-focus));
155
+ box-shadow: 0 0 0 3px var(--input-shadow-focus, var(--ty-input-shadow-focus));
185
156
  }
186
-
187
157
  .dropdown-search-input:disabled {
188
- background-color: var(--input-disabled-bg, var(--ty-input-disabled-bg));
189
- color: var(--input-disabled-color, var(--ty-input-disabled-color));
190
- cursor: not-allowed;
191
- opacity: 0.6;
158
+ background-color: var(--input-disabled-bg, var(--ty-input-disabled-bg));
159
+ color: var(--input-disabled-color, var(--ty-input-disabled-color));
160
+ cursor: not-allowed;
161
+ opacity: 0.6;
192
162
  }
193
-
194
163
  .dropdown-search-input::placeholder {
195
- color: var(--input-placeholder, var(--ty-input-placeholder));
164
+ color: var(--input-placeholder, var(--ty-input-placeholder));
196
165
  }
197
-
198
166
  .dropdown-search-chevron {
199
- position: absolute;
200
- top: 50%;
201
- right: var(--ty-spacing-3);
202
- transform: translateY(-50%);
203
- width: 1rem;
204
- height: 1rem;
205
- color: var(--input-placeholder, var(--ty-input-placeholder));
206
- transition: var(--ty-transition-transform);
207
- pointer-events: none;
208
- }
209
-
167
+ position: absolute;
168
+ top: 50%;
169
+ right: var(--ty-spacing-3);
170
+ transform: translateY(-50%);
171
+ width: 1rem;
172
+ height: 1rem;
173
+ color: var(--input-placeholder, var(--ty-input-placeholder));
174
+ transition: var(--ty-transition-transform);
175
+ pointer-events: none;
176
+ }
210
177
  .dropdown-search-chevron.open {
211
- transform: translateY(-50%) rotate(180deg);
178
+ transform: translateY(-50%) rotate(180deg);
212
179
  }
213
-
214
180
  .dropdown-search-chevron svg {
215
- width: 100%;
216
- height: 100%;
181
+ width: 100%;
182
+ height: 100%;
183
+ }
184
+ .select-stub {
185
+ min-height: var(--ty-size-md);
186
+ display: flex;
187
+ flex-wrap: wrap;
188
+ gap: 0.25rem;
189
+ align-items: center;
190
+ padding: 0 2.5rem 0 0.75rem;
191
+ transition: var(--ty-transition-all), opacity 0.2s ease;
192
+ outline: none;
193
+ background: var(--input-bg, var(--ty-input-bg));
194
+ color: var(--input-color, var(--ty-input-color));
195
+ border: 1px solid var(--select-accent, var(--input-border, var(--ty-input-border)));
196
+ border-radius: var(--ty-radius-md);
197
+ font-family: inherit;
198
+ font-size: var(--ty-field-font);
199
+ line-height: var(--ty-field-leading);
200
+ letter-spacing: var(--ty-field-tracking);
201
+ cursor: pointer;
202
+ position: relative;
203
+ width: 100%;
204
+ box-sizing: border-box;
217
205
  }
218
-
219
206
  .select-stub {
220
- min-height: var(--ty-size-md);
221
- display: flex;
222
- flex-wrap: wrap;
223
- gap: 0.25rem;
224
- align-items: center;
225
- padding: 0 2.5rem 0 0.75rem;
226
- transition: var(--ty-transition-all), opacity 0.2s ease;
227
- outline: none;
228
- background: var(--input-bg, var(--ty-input-bg));
229
- color: var(--input-color, var(--ty-input-color));
230
- border: 1px solid var(--select-accent, var(--input-border, var(--ty-input-border)));
231
- border-radius: var(--ty-radius-md);
232
- font-family: inherit;
233
- font-size: var(--ty-font-sm);
234
- line-height: var(--ty-leading-sm);
235
- letter-spacing: var(--ty-tracking-sm);
236
- cursor: pointer;
237
- position: relative;
238
- width: 100%;
239
- box-sizing: border-box;
240
- }
241
-
242
- /* buildStubClasses() always stamps exactly one size class on .select-stub.
243
- min-height comes from the shared --ty-size-* tokens (same ones ty-input
244
- and ty-date-picker consume) so a given size is the same height on every
245
- field. Right padding stays 2.5rem for chevron room. Zero vertical
246
- padding — same fix as ty-input: with align-items:center on a flex
247
- container, ANY vertical padding adds on top of min-height instead of
248
- being absorbed by it, so a padded stub silently overflows past the
249
- shared field height (measured +3px at sm/md before this was zeroed).
250
- min-height + centering alone gets the exact height. */
251
- .select-stub.sm {
252
- min-height: var(--ty-size-sm);
253
- padding: 0 2.5rem 0 0.625rem;
254
- font-size: var(--ty-font-sm);
255
- line-height: var(--ty-leading-sm);
256
- letter-spacing: var(--ty-tracking-sm);
257
- }
258
-
259
- /* md matches the base rule; listed for parity/overrides */
260
- .select-stub.md {
261
- min-height: var(--ty-size-md);
262
- padding: 0 2.5rem 0 0.75rem;
263
- }
264
-
265
- .select-stub.lg {
266
- min-height: var(--ty-size-lg);
267
- padding: 0 2.5rem 0 0.875rem;
268
- font-size: var(--ty-font-base);
269
- line-height: var(--ty-leading-base);
270
- letter-spacing: var(--ty-tracking-base);
271
- }
272
-
207
+ min-height: var(--ty-field-height);
208
+ padding: 0 2.5rem 0 var(--ty-field-pad-x);
209
+ }
273
210
  .select-stub:hover {
274
- border-color: var(--select-accent-bold, var(--input-border-hover, var(--ty-input-border-hover)));
211
+ border-color: var(--select-accent-bold, var(--input-border-hover, var(--ty-input-border-hover)));
275
212
  }
276
-
277
213
  .select-stub[disabled] {
278
- background-color: var(--input-disabled-bg, var(--ty-input-disabled-bg));
279
- color: var(--input-disabled-color, var(--ty-input-disabled-color));
280
- cursor: not-allowed;
281
- opacity: 0.6;
214
+ background-color: var(--input-disabled-bg, var(--ty-input-disabled-bg));
215
+ color: var(--input-disabled-color, var(--ty-input-disabled-color));
216
+ cursor: not-allowed;
217
+ opacity: 0.6;
282
218
  }
283
-
284
219
  .dropdown-wrapper:has(.dropdown-chevron.open) .select-stub {
285
- opacity: 0;
286
- pointer-events: none;
287
- }
288
-
289
- /* Open state — same escalation as ty-input's .focused: bolder border + ring.
290
- Applies whenever the stub stays visible while open (field skin without
291
- the opacity-hide above kicking in — e.g. single-select with no tags).
292
- :not(.custom-trigger) — that skin has its own unconditional box-shadow:
293
- none reset below; excluding it here keeps the two rules from competing
294
- on specificity (:has()/:not() here would otherwise outrank it).
295
- :not(:has(search:focus)) — the search row auto-focuses on open, which
296
- already carries its own real :focus ring (below); without this guard the
297
- stub's "fake" open-ring stacks on top of it, and the field reads as two
298
- simultaneously-focused controls. Real focus wins; the stub ring is only
299
- for select skins that have nothing else to show it. */
220
+ opacity: 0;
221
+ pointer-events: none;
222
+ }
300
223
  .dropdown-wrapper:has(.dropdown-chevron.open):not(:has(.dropdown-search-input:focus)) .select-stub:not(.custom-trigger),
301
224
  .select-stub:focus,
302
225
  .select-stub:focus-visible {
303
- border-color: var(--select-accent-bold, var(--input-border-focus, var(--ty-input-border-focus)));
304
- box-shadow: 0 0 0 3px var(--select-ring, var(--input-shadow-focus, var(--ty-input-shadow-focus)));
305
- }
306
-
307
- /* Custom trigger (slot="trigger"): setupTriggerSlot() toggles this class when
308
- the consumer assigns their own content — the slot's fallback (start/selected/
309
- placeholder/end/chevron, i.e. the whole default field skin) is entirely
310
- replaced at that point, so the wrapping .select-stub itself must go bare.
311
- Without this, the stub's own border/background/padding and the open/focus
312
- ring above still wrapped the custom content in a second, unwanted outline. */
226
+ border-color: var(--select-accent-bold, var(--input-border-focus, var(--ty-input-border-focus)));
227
+ box-shadow: 0 0 0 3px var(--select-ring, var(--input-shadow-focus, var(--ty-input-shadow-focus)));
228
+ }
313
229
  .select-stub.custom-trigger {
314
- min-height: 0;
315
- padding: 0;
316
- border: none;
317
- background: transparent;
230
+ min-height: 0;
231
+ padding: 0;
232
+ border: none;
233
+ background: transparent;
318
234
  }
319
235
  .select-stub.custom-trigger:hover,
320
236
  .dropdown-wrapper:has(.dropdown-chevron.open) .select-stub.custom-trigger,
321
237
  .select-stub.custom-trigger:focus,
322
238
  .select-stub.custom-trigger:focus-visible {
323
- border-color: transparent;
324
- box-shadow: none;
239
+ border-color: transparent;
240
+ box-shadow: none;
325
241
  }
326
-
327
- /* Hide stub chips when mobile dialog is open (let modal show them) */
328
242
  .dropdown-mode-mobile .dropdown-wrapper:has(.mobile-dialog[open]) .select-chips {
329
- display: none;
243
+ display: none;
330
244
  }
331
-
332
- /* When tags are present, reduce padding to make room */
333
245
  .select-stub.has-tags {
334
- padding: 0.25rem 2.5rem 0.25rem 0.5rem;
335
- width: 100%;
246
+ padding: 0.25rem 2.5rem 0.25rem 0.5rem;
247
+ width: 100%;
336
248
  }
337
-
338
249
  .select-stub.has-tags slot[name="selected"] {
339
- display: flex;
340
- flex-wrap: wrap;
341
- gap: 0.25rem;
250
+ display: flex;
251
+ flex-wrap: wrap;
252
+ gap: 0.25rem;
342
253
  }
343
-
344
254
  .dropdown-chevron {
345
- position: absolute;
346
- top: 50%;
347
- right: var(--ty-spacing-3);
348
- transform: translateY(-50%);
349
- width: 1rem;
350
- height: 1rem;
351
- color: var(--input-placeholder, var(--ty-input-placeholder));
352
- transition: var(--ty-transition-transform);
353
- pointer-events: none;
354
- }
355
-
255
+ position: absolute;
256
+ top: 50%;
257
+ right: var(--ty-spacing-3);
258
+ transform: translateY(-50%);
259
+ width: 1rem;
260
+ height: 1rem;
261
+ color: var(--input-placeholder, var(--ty-input-placeholder));
262
+ transition: var(--ty-transition-transform);
263
+ pointer-events: none;
264
+ }
356
265
  .dropdown-chevron.open {
357
- transform: translateY(-50%) rotate(180deg);
266
+ transform: translateY(-50%) rotate(180deg);
358
267
  }
359
-
360
268
  .dropdown-chevron svg {
361
- width: 100%;
362
- height: 100%;
269
+ width: 100%;
270
+ height: 100%;
363
271
  }
364
-
365
-
366
272
  .select-chips {
367
- display: flex;
368
- flex-wrap: wrap;
369
- gap: 0.5rem;
370
- align-items: center;
371
- min-width: 0;
372
- }
373
-
374
- /* No flex-grow here — the placeholder only ever renders inside .select-stub,
375
- and select.ts sets flex: 1 1 0% on it. A bare flex-grow: 1 (implicit
376
- flex-basis:auto) is the wrap bug that fix exists to prevent; leaving it
377
- here would silently reintroduce it if the specific rule ever moved. */
273
+ display: flex;
274
+ flex-wrap: wrap;
275
+ gap: 0.5rem;
276
+ align-items: center;
277
+ min-width: 0;
278
+ }
378
279
  .dropdown-placeholder {
379
- color: var(--input-placeholder, var(--ty-input-placeholder, #9ca3af));
380
- font-size: var(--ty-font-sm);
381
- line-height: var(--ty-leading-sm);
382
- letter-spacing: var(--ty-tracking-sm);
383
- font-weight: var(--ty-font-light);
384
- font-style: italic;
385
- }
386
-
280
+ color: var(--input-placeholder, var(--ty-input-placeholder, #9ca3af));
281
+ font-size: var(--ty-field-font);
282
+ line-height: var(--ty-field-leading);
283
+ letter-spacing: var(--ty-field-tracking);
284
+ font-weight: var(--ty-font-light);
285
+ font-style: italic;
286
+ }
387
287
  .dropdown-placeholder.hidden {
388
- display: none;
288
+ display: none;
389
289
  }
390
-
391
290
  .dropdown-options {
392
- opacity: 0;
393
- /* Floating surface/border, not --input-* — this is a popup panel over
394
- arbitrary page content, not a form field. --ty-input-border resolves to
395
- the deliberately-faint resting-state input border (barely visible by
396
- design, escalates on hover/focus); reused here it made the popup's own
397
- edge nearly invisible against the page behind it. --ty-floating-border
398
- is the token tuned for exactly this: floating panels over content. */
399
- background: var(--ty-surface-floating);
400
- border: 1px solid var(--ty-floating-border);
401
- border-radius: var(--ty-radius-lg);
402
- max-height: 16rem;
403
- width: 100%;
404
- max-width: 100%;
405
- overflow-x: hidden;
406
- overflow-y: auto;
407
- scroll-behavior: smooth;
408
- box-sizing: border-box;
409
- position: relative;
410
- box-shadow:
411
- 0 20px 25px -5px rgba(0, 0, 0, 0.1),
412
- 0 10px 10px -5px rgba(0, 0, 0, 0.04);
413
-
414
- transform: translateY(-6px) scale(0.96);
415
- transform-origin: top center;
416
- transition:
417
- opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
418
- transform var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
419
-
420
- display: flex;
421
- flex-wrap: wrap;
422
- padding: 0.5rem;
423
- gap: 0.5rem;
424
-
425
- }
426
-
427
- /* Hide native scrollbar only when custom scrollbar is active */
291
+ opacity: 0;
292
+ background: var(--ty-surface-floating);
293
+ border: 1px solid var(--ty-floating-border);
294
+ border-radius: var(--ty-radius-lg);
295
+ max-height: 16rem;
296
+ width: 100%;
297
+ max-width: 100%;
298
+ overflow-x: hidden;
299
+ overflow-y: auto;
300
+ scroll-behavior: smooth;
301
+ box-sizing: border-box;
302
+ position: relative;
303
+ box-shadow:
304
+ 0 20px 25px -5px rgba(0, 0, 0, 0.1),
305
+ 0 10px 10px -5px rgba(0, 0, 0, 0.04);
306
+ transform: translateY(-6px) scale(0.96);
307
+ transform-origin: top center;
308
+ transition:
309
+ opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
310
+ transform var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
311
+ display: flex;
312
+ flex-wrap: wrap;
313
+ padding: 0.5rem;
314
+ gap: 0.5rem;
315
+ }
428
316
  .dropdown-options.ty-custom-scroll {
429
- scrollbar-width: none;
430
- -ms-overflow-style: none;
317
+ scrollbar-width: none;
318
+ -ms-overflow-style: none;
431
319
  }
432
-
433
320
  .dropdown-options.ty-custom-scroll::-webkit-scrollbar {
434
- display: none;
321
+ display: none;
435
322
  }
436
-
437
- /* Options wrapper - positioned container for scrollbar track */
438
323
  .dropdown-options-wrapper {
439
- position: relative;
324
+ position: relative;
440
325
  }
441
-
442
326
  .dropdown-options-wrapper:hover .ty-scrollbar-track-y.has-overflow {
443
- opacity: 1;
327
+ opacity: 1;
444
328
  }
445
-
446
329
  .dropdown-options ty-tag {
447
- user-select: none;
448
- transition: transform 0.1s ease;
330
+ user-select: none;
331
+ transition: transform 0.1s ease;
449
332
  }
450
-
451
333
  .dropdown-options ty-tag:hover {
452
- transform: scale(1.02);
334
+ transform: scale(1.02);
453
335
  }
454
-
455
336
  .dropdown-options ty-tag:active {
456
- transform: scale(0.98);
337
+ transform: scale(0.98);
457
338
  }
458
-
459
339
  .dropdown-options ty-tag[selected] {
460
- opacity: 0.5;
340
+ opacity: 0.5;
461
341
  }
462
-
463
342
  .select-chips ty-tag {
464
- max-width: 150px;
343
+ max-width: 150px;
465
344
  }
466
-
467
345
  @media (max-width: 640px) {
468
- .select-chips ty-tag {
469
- max-width: 100px;
470
- }
346
+ .select-chips ty-tag {
347
+ max-width: 100px;
348
+ }
471
349
  }
472
-
473
-
474
350
  .select-container {
475
- display: flex;
476
- flex-direction: column;
477
- /* No gap here — label→field spacing comes from .ty-field-label's
478
- margin-bottom (6px), same as ty-input/ty-date-picker/ty-textarea.
479
- A flex gap would STACK on that margin (flex margins don't collapse),
480
- which is exactly the 4px misalignment this used to cause. */
481
- }
482
-
351
+ display: flex;
352
+ flex-direction: column;
353
+ }
483
354
  .dropdown-wrapper {
484
- position: relative;
485
- display: block;
486
- width: 100%;
355
+ position: relative;
356
+ display: block;
357
+ width: 100%;
487
358
  }
488
-
489
359
  .ty-field-label {
490
- font-size: var(--ty-font-sm);
491
- line-height: var(--ty-leading-sm);
492
- letter-spacing: var(--ty-tracking-sm);
493
- font-weight: var(--ty-font-medium);
494
- color: var(--ty-label-color);
495
- margin-bottom: 6px;
496
- padding-left: 12px;
497
- display: flex;
498
- align-items: center;
499
- }
500
-
360
+ font-size: var(--ty-field-label-font);
361
+ line-height: var(--ty-field-label-leading);
362
+ letter-spacing: var(--ty-tracking-sm);
363
+ font-weight: var(--ty-font-medium);
364
+ color: var(--ty-label-color);
365
+ margin-bottom: var(--ty-field-label-gap);
366
+ padding-left: var(--ty-field-outer-pad-x);
367
+ display: flex;
368
+ align-items: center;
369
+ }
501
370
  .required-icon {
502
- display: inline-flex;
503
- align-items: center;
504
- color: #ef4444;
505
- width: 12px;
506
- height: 12px;
507
- vertical-align: middle;
508
- margin-left: 4px;
509
- }
510
-
371
+ display: inline-flex;
372
+ align-items: center;
373
+ color: #ef4444;
374
+ width: 12px;
375
+ height: 12px;
376
+ vertical-align: middle;
377
+ margin-left: 4px;
378
+ }
511
379
  .required-icon svg {
512
- width: 100%;
513
- height: 100%;
380
+ width: 100%;
381
+ height: 100%;
514
382
  }
515
-
516
383
  :host([disabled]) .select-container {
517
- pointer-events: none;
384
+ pointer-events: none;
518
385
  }
519
-
520
386
  .dropdown-mode-mobile .mobile-dialog {
521
- position: fixed;
522
- top: 0;
523
- left: 0;
524
- right: 0;
525
- bottom: 0;
526
- width: 100vw;
527
- height: 100dvh; /* dvh, not vh — shrinks with the on-screen keyboard so the
528
- dialog never sits partly behind it */
529
- max-width: 100vw;
530
- max-height: 100dvh;
531
- margin: 0;
532
- padding: 0;
533
- padding-top: 6dvh; /* Sit higher than the old 10vh, but 4dvh left the
534
- floating label with no headroom — it sits above
535
- .mobile-search-header via position:absolute, so it
536
- needs room inside this padding, not just inside the
537
- content box, or it crowds the very top of the screen */
538
- border: none;
539
- background: transparent; /* Backdrop handles background */
540
- /* Note: Don't set display - browser controls <dialog> visibility */
541
- align-items: flex-start;
542
- justify-content: center;
543
- opacity: 0;
544
- transition: opacity 300ms ease;
545
- }
546
-
547
- /* When opened via showModal(), add flex layout */
387
+ position: fixed;
388
+ top: 0;
389
+ left: 0;
390
+ right: 0;
391
+ bottom: 0;
392
+ width: 100vw;
393
+ height: 100dvh;
394
+ max-width: 100vw;
395
+ max-height: 100dvh;
396
+ margin: 0;
397
+ padding: 0;
398
+ padding-top: 6dvh;
399
+ border: none;
400
+ background: transparent;
401
+ align-items: flex-start;
402
+ justify-content: center;
403
+ opacity: 0;
404
+ transition: opacity 300ms ease;
405
+ }
548
406
  .dropdown-mode-mobile .mobile-dialog[open] {
549
- display: flex;
407
+ display: flex;
550
408
  }
551
-
552
409
  .dropdown-mode-mobile .mobile-dialog.open {
553
- opacity: 1;
410
+ opacity: 1;
554
411
  }
555
-
556
- /* Native dialog backdrop with blur */
557
412
  .dropdown-mode-mobile .mobile-dialog::backdrop {
558
- background: rgba(0, 0, 0, 0.65); /* was 0.5 — needed more depth to reliably
559
- carry white header text/icons over a
560
- light page blurred behind it */
561
- backdrop-filter: blur(8px);
562
- -webkit-backdrop-filter: blur(8px);
413
+ background: rgba(0, 0, 0, 0.65);
414
+ backdrop-filter: blur(8px);
415
+ -webkit-backdrop-filter: blur(8px);
563
416
  }
564
-
565
417
  .dropdown-mode-mobile .mobile-dialog-content {
566
- position: relative;
567
- display: flex;
568
- flex-direction: column;
569
- width: calc(100% - 32px); /* Side margins */
570
- max-width: 400px;
571
- min-height: 200px;
572
- max-height: 90dvh; /* leaves room below the 6dvh padding-top, shrinks with keyboard */
573
- opacity: 0;
574
- transform: scale(0.95);
575
- transition:
576
- opacity 300ms cubic-bezier(0.16, 1, 0.3, 1),
577
- transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
578
- }
579
-
418
+ position: relative;
419
+ display: flex;
420
+ flex-direction: column;
421
+ width: calc(100% - 32px);
422
+ max-width: 400px;
423
+ min-height: 200px;
424
+ max-height: 90dvh;
425
+ opacity: 0;
426
+ transform: scale(0.95);
427
+ transition:
428
+ opacity 300ms cubic-bezier(0.16, 1, 0.3, 1),
429
+ transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
430
+ }
580
431
  .dropdown-mode-mobile .mobile-dialog.open .mobile-dialog-content {
581
- opacity: 1;
582
- transform: scale(1);
432
+ opacity: 1;
433
+ transform: scale(1);
583
434
  }
584
-
585
435
  .dropdown-mode-mobile .mobile-search-input:focus {
586
- border-color: var(--ty-border);
436
+ border-color: var(--ty-border);
587
437
  }
588
-
589
- /* Mobile search header - label floats above, search + close below */
590
438
  .dropdown-mode-mobile .mobile-search-header {
591
- flex-shrink: 0;
592
- display: flex;
593
- flex-direction: column;
594
- margin-bottom: 16px;
595
- padding: 0;
596
- background: transparent;
597
- position: relative;
598
- }
599
-
439
+ flex-shrink: 0;
440
+ display: flex;
441
+ flex-direction: column;
442
+ margin-bottom: 16px;
443
+ padding: 0;
444
+ background: transparent;
445
+ position: relative;
446
+ }
600
447
  .dropdown-mode-mobile .mobile-header-content {
601
- display: flex;
602
- align-items: center;
603
- gap: 12px;
604
- width: 100%;
605
- /* When search is disabled, updateSearchVisibility() hides the icon+input
606
- (see select.ts) but leaves the close button as the row's only child —
607
- without this it falls back to flex-start and strands the button on the
608
- left. Harmless when search IS shown: the input's flex:1 already
609
- consumes all remaining space, so justify-content never gets a say. */
610
- justify-content: flex-end;
611
- }
612
-
448
+ display: flex;
449
+ align-items: center;
450
+ gap: 12px;
451
+ width: 100%;
452
+ justify-content: flex-end;
453
+ }
613
454
  .dropdown-mode-mobile .mobile-header-label {
614
- position: absolute;
615
- bottom: 100%;
616
- left: 2px;
617
- margin-bottom: 8px; /* was 4px — too tight against the search row */
618
- font-size: var(--ty-font-base); /* was --ty-font-lg — read as oversized/heavy paired with 700 */
619
- line-height: var(--ty-leading-base);
620
- letter-spacing: var(--ty-tracking-base);
621
- font-weight: 600; /* was 700 — 700 at font-lg read as clunky */
622
- /* This sits on the dialog's ::backdrop (rgba(0,0,0,.65) + blur) — a fixed
623
- DARK overlay regardless of theme, not the theme's own surface color.
624
- A theme-toggling token (light mode → black) fights that: black text on
625
- a dark blurred backdrop is the wrong combination. Fixed white, same
626
- reasoning as ty-tooltip's deliberately theme-independent default in
627
- tyrell.css — this element's job is to pop against a dark backdrop in
628
- both themes, not to track the page's light/dark state. */
629
- color: #ffffff;
630
- pointer-events: none;
631
- }
632
-
633
- /* Close button — borderless ghost icon button (was a bordered circle badge,
634
- which read as a heavy, disconnected "chip" next to the plain search icon).
635
- Matches ty-button's ghost treatment: transparent at rest, soft neutral
636
- fill on hover/active, no border ever. */
455
+ position: absolute;
456
+ bottom: 100%;
457
+ left: 2px;
458
+ margin-bottom: 8px;
459
+ font-size: var(--ty-font-base);
460
+ line-height: var(--ty-leading-base);
461
+ letter-spacing: var(--ty-tracking-base);
462
+ font-weight: 600;
463
+ color: #ffffff;
464
+ pointer-events: none;
465
+ }
637
466
  .dropdown-mode-mobile .mobile-close-button {
638
- flex-shrink: 0;
639
- width: 32px;
640
- height: 32px;
641
- display: flex;
642
- align-items: center;
643
- justify-content: center;
644
- background: transparent;
645
- border: none;
646
- border-radius: 50%;
647
- /* Same reasoning as .mobile-header-label: fixed white, not a theme token —
648
- this sits on the dark ::backdrop blur in both themes, never on a theme
649
- surface. */
650
- color: #ffffff;
651
- cursor: pointer;
652
- transition: var(--ty-transition-all);
653
- padding: 0;
654
- }
655
-
656
- /* Hover/active fills also go fixed-white-tinted rather than theme neutral —
657
- --ty-bg-neutral-soft is a LIGHT fill in light mode, which would swallow
658
- the white icon it's meant to sit behind. */
467
+ flex-shrink: 0;
468
+ width: 32px;
469
+ height: 32px;
470
+ display: flex;
471
+ align-items: center;
472
+ justify-content: center;
473
+ background: transparent;
474
+ border: none;
475
+ border-radius: 50%;
476
+ color: #ffffff;
477
+ cursor: pointer;
478
+ transition: var(--ty-transition-all);
479
+ padding: 0;
480
+ }
659
481
  .dropdown-mode-mobile .mobile-close-button:hover {
660
- background: rgba(255, 255, 255, 0.15);
661
- color: #ffffff;
482
+ background: rgba(255, 255, 255, 0.15);
483
+ color: #ffffff;
662
484
  }
663
-
664
485
  .dropdown-mode-mobile .mobile-close-button:active {
665
- transform: scale(0.9);
666
- background: rgba(255, 255, 255, 0.25);
486
+ transform: scale(0.9);
487
+ background: rgba(255, 255, 255, 0.25);
667
488
  }
668
-
669
489
  .dropdown-mode-mobile .mobile-close-button svg {
670
- width: 18px;
671
- height: 18px;
490
+ width: 18px;
491
+ height: 18px;
672
492
  }
673
-
674
493
  .dropdown-mode-mobile .mobile-search-input {
675
- font-family: inherit;
676
- flex: 1;
677
- min-width: 0;
678
- box-sizing: border-box;
679
- background: var(--ty-surface-floating);
680
- color: var(--ty-text);
681
- border: 2px solid;
682
- border-color: var(--mobile-border-color);
683
- border-radius: var(--ty-radius-md);
684
- font-family: inherit;
685
- font-size: var(--ty-font-sm);
686
- line-height: var(--ty-leading-sm);
687
- letter-spacing: var(--ty-tracking-sm);
688
- font-weight: var(--ty-font-normal);
689
- padding: var(--ty-spacing-2) var(--ty-spacing-3);
690
- height: 40px;
691
- transition: var(--ty-transition-all);
692
- outline: none;
693
- }
694
-
494
+ font-family: inherit;
495
+ flex: 1;
496
+ min-width: 0;
497
+ box-sizing: border-box;
498
+ background: var(--ty-surface-floating);
499
+ color: var(--ty-text);
500
+ border: 2px solid;
501
+ border-color: var(--mobile-border-color);
502
+ border-radius: var(--ty-radius-md);
503
+ font-family: inherit;
504
+ font-size: var(--ty-font-sm);
505
+ line-height: var(--ty-leading-sm);
506
+ letter-spacing: var(--ty-tracking-sm);
507
+ font-weight: var(--ty-font-normal);
508
+ padding: var(--ty-spacing-2) var(--ty-spacing-3);
509
+ height: 40px;
510
+ transition: var(--ty-transition-all);
511
+ outline: none;
512
+ }
695
513
  .dropdown-mode-mobile .mobile-search-input::placeholder {
696
- color: var(--ty-text-faint);
514
+ color: var(--ty-text-faint);
697
515
  }
698
-
699
516
  .dropdown-mode-mobile .mobile-search-input:focus {
700
- border-color: var(--ty-border);
517
+ border-color: var(--ty-border);
701
518
  }
702
-
703
- /* Mobile body - contains both sections */
704
519
  .dropdown-mode-mobile .mobile-body {
705
- position: relative;
706
- display: flex;
707
- flex-direction: column;
708
- height: var(--body-height, 350px);
709
- max-height: 350px;
710
- overflow: hidden;
711
- background: var(--ty-surface-floating);
712
- border-radius: var(--ty-radius-lg);
713
- box-shadow:
714
- 0 20px 25px -5px rgba(0, 0, 0, 0.1),
715
- 0 10px 10px -5px rgba(0, 0, 0, 0.04);
716
- border: 2px solid;
717
- border-color: var(--mobile-border-color);
718
- }
719
-
720
- /* Section headers are labels, not buttons */
721
-
520
+ position: relative;
521
+ display: flex;
522
+ flex-direction: column;
523
+ height: var(--body-height, 350px);
524
+ max-height: 350px;
525
+ overflow: hidden;
526
+ background: var(--ty-surface-floating);
527
+ border-radius: var(--ty-radius-lg);
528
+ box-shadow:
529
+ 0 20px 25px -5px rgba(0, 0, 0, 0.1),
530
+ 0 10px 10px -5px rgba(0, 0, 0, 0.04);
531
+ border: 2px solid;
532
+ border-color: var(--mobile-border-color);
533
+ }
722
534
  .dropdown-mode-mobile .section-header {
723
- display: flex;
724
- align-items: center;
725
- justify-content: space-between;
726
- height: 36px;
727
- flex-shrink: 0;
728
- padding: 0 16px;
729
- font-size: 11px;
730
- font-weight: 600;
731
- text-transform: uppercase;
732
- letter-spacing: 0.06em;
733
- color: var(--ty-text-bold);
734
- background: transparent;
735
- cursor: default;
736
- user-select: none;
737
- }
738
-
535
+ display: flex;
536
+ align-items: center;
537
+ justify-content: space-between;
538
+ height: 36px;
539
+ flex-shrink: 0;
540
+ padding: 0 16px;
541
+ font-size: 11px;
542
+ font-weight: 600;
543
+ text-transform: uppercase;
544
+ letter-spacing: 0.06em;
545
+ color: var(--ty-text-bold);
546
+ background: transparent;
547
+ cursor: default;
548
+ user-select: none;
549
+ }
739
550
  .dropdown-mode-mobile .section-header .section-title {
740
- flex: 1;
551
+ flex: 1;
741
552
  }
742
-
743
553
  .dropdown-mode-mobile .section-header .section-count {
744
- font-weight: 500;
745
- color: var(--ty-text-faint);
746
- margin-left: 0.25rem;
747
- }
748
-
749
- /* Selected strip: pinned, capped height, collapses when empty */
750
-
751
- .dropdown-mode-mobile .mobile-selected-section {
752
- display: flex;
753
- flex-direction: column;
754
- background: var(--ty-input-bg);
755
- overflow: hidden;
756
- flex: 0 0 auto;
757
- max-height: 40%;
758
- transition: max-height 200ms cubic-bezier(0.4, 0, 0.2, 1);
759
- }
760
-
761
- /* Empty: collapse to header only */
554
+ font-weight: 500;
555
+ color: var(--ty-text-faint);
556
+ margin-left: 0.25rem;
557
+ }
558
+ .dropdown-mode-mobile .mobile-body .section-header {
559
+ height: 36px;
560
+ flex: 0 0 36px;
561
+ }
562
+ .dropdown-mode-mobile .mobile-selected-section,
563
+ .dropdown-mode-mobile .mobile-available-section {
564
+ display: flex;
565
+ flex-direction: column;
566
+ background: var(--ty-input-bg);
567
+ overflow: hidden;
568
+ min-height: 36px;
569
+ flex: 0 1 36px;
570
+ transition: flex-grow 220ms cubic-bezier(0.4, 0, 0.2, 1);
571
+ }
572
+ .dropdown-mode-mobile .mobile-body[data-expanded="selected"] .mobile-selected-section,
573
+ .dropdown-mode-mobile .mobile-body[data-expanded="available"] .mobile-available-section {
574
+ flex-grow: 1;
575
+ }
762
576
  .dropdown-mode-mobile .mobile-selected-section[data-empty="true"] {
763
- max-height: 36px;
764
- flex: 0 0 36px;
577
+ flex-grow: 0;
765
578
  }
766
-
767
579
  .dropdown-mode-mobile .mobile-selected-section .section-content {
768
- flex: 1;
769
- min-height: 0;
770
- overflow-y: auto;
771
- overscroll-behavior: contain;
772
- padding: 0.75rem 1rem;
773
- display: flex;
774
- flex-wrap: wrap;
775
- gap: 0.5rem;
776
- align-content: flex-start;
777
- /* Soft fade at bottom edge — hints at scrollable overflow */
778
- -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 12px), transparent);
779
- mask-image: linear-gradient(to bottom, black calc(100% - 12px), transparent);
780
- }
781
-
782
- /* Available list takes the remaining space */
783
-
784
- .dropdown-mode-mobile .mobile-available-section {
785
- display: flex;
786
- flex-direction: column;
787
- background: var(--ty-input-bg);
788
- overflow: hidden;
789
- flex: 1 1 auto;
790
- min-height: 0;
791
- }
792
-
580
+ flex: 1;
581
+ min-height: 0;
582
+ overflow-y: auto;
583
+ overscroll-behavior: contain;
584
+ padding: 0.75rem 1rem;
585
+ display: flex;
586
+ flex-wrap: wrap;
587
+ gap: 0.5rem;
588
+ align-content: flex-start;
589
+ -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 12px), transparent);
590
+ mask-image: linear-gradient(to bottom, black calc(100% - 12px), transparent);
591
+ }
793
592
  .dropdown-mode-mobile .mobile-available-section .section-content {
794
- flex: 1;
795
- min-height: 0;
796
- overflow-y: auto;
797
- overscroll-behavior: contain;
798
- padding: 0.75rem 1rem;
799
- display: flex;
800
- flex-wrap: wrap;
801
- gap: 0.5rem;
802
- align-content: flex-start;
803
- }
804
-
805
- /* Selected strip collapses (no text needed).
806
- Available shows the empty message only when there are zero tags total. */
807
-
593
+ flex: 1;
594
+ min-height: 0;
595
+ overflow-y: auto;
596
+ overscroll-behavior: contain;
597
+ padding: 0.75rem 1rem;
598
+ display: flex;
599
+ flex-wrap: wrap;
600
+ gap: 0.5rem;
601
+ align-content: flex-start;
602
+ }
603
+ @media (prefers-reduced-motion: reduce) {
604
+ .dropdown-mode-mobile .mobile-selected-section,
605
+ .dropdown-mode-mobile .mobile-available-section {
606
+ transition: none;
607
+ }
608
+ }
609
+ .dropdown-mode-mobile .mobile-body .section-header {
610
+ display: flex;
611
+ align-items: center;
612
+ justify-content: space-between;
613
+ width: 100%;
614
+ border: none;
615
+ background: transparent;
616
+ font: inherit;
617
+ text-align: left;
618
+ cursor: pointer;
619
+ -webkit-tap-highlight-color: transparent;
620
+ }
621
+ .dropdown-mode-mobile .mobile-body .section-header svg {
622
+ width: 1rem;
623
+ height: 1rem;
624
+ flex-shrink: 0;
625
+ opacity: 0.5;
626
+ transition: transform 180ms ease;
627
+ }
628
+ .dropdown-mode-mobile .mobile-body .section-header[aria-expanded="true"] svg {
629
+ transform: rotate(180deg);
630
+ }
631
+ .dropdown-mode-mobile .mobile-selected-section[data-empty="true"] .section-header {
632
+ cursor: default;
633
+ }
634
+ .dropdown-mode-mobile .mobile-selected-section[data-empty="true"] .section-header svg {
635
+ display: none;
636
+ }
637
+ .dropdown-mode-mobile .mobile-selected-chip {
638
+ display: inline-flex;
639
+ align-items: center;
640
+ gap: 0.375rem;
641
+ padding: 0.25rem 0.5rem 0.25rem 0.625rem;
642
+ border: 1px solid var(--ty-border);
643
+ border-radius: 9999px;
644
+ background: var(--ty-surface-content);
645
+ color: var(--ty-text);
646
+ font: inherit;
647
+ font-size: var(--ty-font-sm);
648
+ line-height: var(--ty-leading-sm);
649
+ cursor: pointer;
650
+ transition: transform 0.1s ease, border-color 0.15s ease;
651
+ animation: ty-select-tag-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
652
+ }
653
+ .dropdown-mode-mobile .mobile-selected-chip svg {
654
+ width: 0.875rem;
655
+ height: 0.875rem;
656
+ flex-shrink: 0;
657
+ opacity: 0.6;
658
+ }
659
+ @media (hover: hover) {
660
+ .dropdown-mode-mobile .mobile-selected-chip:hover {
661
+ border-color: var(--ty-text-soft);
662
+ }
663
+ .dropdown-mode-mobile .mobile-selected-chip:hover svg {
664
+ opacity: 1;
665
+ }
666
+ }
667
+ .dropdown-mode-mobile .mobile-selected-chip:active {
668
+ transform: scale(0.96);
669
+ }
808
670
  .dropdown-mode-mobile .empty-state {
809
- display: none;
810
- width: 100%;
811
- padding: 2rem 1rem;
812
- text-align: center;
813
- color: var(--ty-text-faint);
814
- font-size: var(--ty-font-sm);
815
- line-height: var(--ty-leading-sm);
816
- letter-spacing: var(--ty-tracking-sm);
817
- font-style: italic;
818
- }
819
-
671
+ display: none;
672
+ width: 100%;
673
+ padding: 2rem 1rem;
674
+ text-align: center;
675
+ color: var(--ty-text-faint);
676
+ font-size: var(--ty-font-sm);
677
+ line-height: var(--ty-leading-sm);
678
+ letter-spacing: var(--ty-tracking-sm);
679
+ font-style: italic;
680
+ }
820
681
  .dropdown-mode-mobile .mobile-available-section[data-empty="true"] .empty-state {
821
- display: block;
682
+ display: block;
822
683
  }
823
-
824
684
  .dropdown-mode-mobile .mobile-selected-section[data-empty="true"] .section-content,
825
685
  .dropdown-mode-mobile .mobile-available-section[data-empty="true"] slot {
826
- display: none;
686
+ display: none;
827
687
  }
828
-
829
688
  .dropdown-mode-mobile .section-content ::slotted(ty-tag) {
830
- cursor: pointer;
831
- user-select: none;
832
- transition: transform 0.1s ease;
833
- margin: 2px 0;
834
- /* Fade + scale entry — replays on each (re)insertion when a tag moves
835
- between selected and available slots */
836
- animation: ty-select-tag-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
837
- }
838
-
689
+ cursor: pointer;
690
+ user-select: none;
691
+ transition: transform 0.1s ease;
692
+ margin: 2px 0;
693
+ animation: ty-select-tag-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
694
+ }
839
695
  @media (hover: hover) {
840
- .dropdown-mode-mobile .section-content ::slotted(ty-tag:hover) {
841
- transform: scale(1.02);
842
- }
696
+ .dropdown-mode-mobile .section-content ::slotted(ty-tag:hover) {
697
+ transform: scale(1.02);
698
+ }
843
699
  }
844
-
845
700
  .dropdown-mode-mobile .section-content ::slotted(ty-tag:active) {
846
- transform: scale(0.96);
701
+ transform: scale(0.96);
847
702
  }
848
-
849
703
  .dropdown-mode-mobile .section-content ::slotted(ty-tag[hidden]) {
850
- display: none !important;
704
+ display: none !important;
851
705
  }
852
-
853
706
  @keyframes ty-select-tag-enter {
854
- from { opacity: 0; transform: scale(0.85); }
855
- to { opacity: 1; transform: scale(1); }
707
+ from { opacity: 0; transform: scale(0.85); }
708
+ to { opacity: 1; transform: scale(1); }
856
709
  }
857
-
858
710
  @media (prefers-reduced-motion: reduce) {
859
- .dropdown-mode-mobile .section-content ::slotted(ty-tag) {
860
- animation: none;
861
- }
862
- }
863
-
864
- /* Spinner overlay shown inside the options area while the parent
865
- (external-search mode) is fetching. Search input stays usable.
866
-
867
- Carries its own surface so it stays visible even when the host
868
- has restyled the popup with a transparent or unusual background.
869
- Override with --ty-loader-bg / --ty-loader-radius / --ty-loader-border.
870
- */
711
+ .dropdown-mode-mobile .section-content ::slotted(ty-tag) {
712
+ animation: none;
713
+ }
714
+ }
871
715
  .dropdown-loading {
872
- display: none;
873
- align-items: center;
874
- justify-content: center;
875
- gap: var(--ty-spacing-2);
876
- padding: var(--ty-spacing-4) var(--ty-spacing-3);
877
- color: var(--ty-text-soft);
878
- font-size: var(--ty-font-sm);
879
- min-height: 4rem;
880
- /* Match the .dropdown-options popup look — same background, border, radius, shadow */
881
- background: var(--ty-loader-bg, var(--ty-surface-floating));
882
- border: 1px solid var(--ty-loader-border, var(--ty-floating-border));
883
- border-radius: var(--ty-loader-radius, var(--ty-radius-lg));
884
- box-shadow: var(--ty-loader-shadow, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04));
885
- box-sizing: border-box;
886
- }
887
-
716
+ display: none;
717
+ align-items: center;
718
+ justify-content: center;
719
+ gap: var(--ty-spacing-2);
720
+ padding: var(--ty-spacing-4) var(--ty-spacing-3);
721
+ color: var(--ty-text-soft);
722
+ font-size: var(--ty-font-sm);
723
+ min-height: 4rem;
724
+ background: var(--ty-loader-bg, var(--ty-surface-floating));
725
+ border: 1px solid var(--ty-loader-border, var(--ty-floating-border));
726
+ border-radius: var(--ty-loader-radius, var(--ty-radius-lg));
727
+ box-shadow: var(--ty-loader-shadow, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04));
728
+ box-sizing: border-box;
729
+ }
888
730
  .dropdown-options-wrapper.loading .dropdown-loading {
889
- display: flex;
731
+ display: flex;
890
732
  }
891
-
892
- /* Slot is transparent for layout — fallback (spinner + text) and user-provided
893
- slotted content both act as direct flex children of .dropdown-loading. */
894
733
  .dropdown-loading > slot[name="loading"] {
895
- display: contents;
734
+ display: contents;
896
735
  }
897
-
898
- /* Mobile: full-screen dialog is the surface — drop the card chrome,
899
- stack vertically, scale up so it feels native to a fullscreen view.
900
- Slotted content adapts automatically since the slot is display:contents. */
901
736
  .dropdown-mode-mobile .dropdown-loading {
902
- background: transparent;
903
- border: none;
904
- box-shadow: none;
905
- flex: 1;
906
- flex-direction: column;
907
- gap: var(--ty-spacing-3);
908
- padding: var(--ty-spacing-8) var(--ty-spacing-4);
909
- min-height: 12rem;
910
- }
911
-
737
+ background: transparent;
738
+ border: none;
739
+ box-shadow: none;
740
+ flex: 1;
741
+ flex-direction: column;
742
+ gap: var(--ty-spacing-3);
743
+ padding: var(--ty-spacing-8) var(--ty-spacing-4);
744
+ min-height: 12rem;
745
+ }
912
746
  .dropdown-mode-mobile .dropdown-loading-spinner {
913
- width: 2rem;
914
- height: 2rem;
747
+ width: 2rem;
748
+ height: 2rem;
915
749
  }
916
-
917
750
  .dropdown-mode-mobile .dropdown-loading-text {
918
- font-size: var(--ty-font-base);
751
+ font-size: var(--ty-font-base);
919
752
  }
920
-
921
753
  .dropdown-options-wrapper.loading .dropdown-options,
922
754
  .dropdown-options-wrapper.loading > slot#options-slot,
923
755
  .dropdown-options-wrapper.loading .empty-state {
924
- display: none;
756
+ display: none;
925
757
  }
926
-
927
758
  .dropdown-loading-spinner {
928
- display: inline-flex;
929
- align-items: center;
930
- justify-content: center;
931
- width: 1.125rem;
932
- height: 1.125rem;
933
- flex-shrink: 0;
934
- animation: ty-select-spin 0.7s linear infinite;
935
- /* Active-state indicator — full accent, not the soft resting shade */
936
- color: var(--select-accent-bold, var(--ty-color-primary));
937
- }
938
-
759
+ display: inline-flex;
760
+ align-items: center;
761
+ justify-content: center;
762
+ width: 1.125rem;
763
+ height: 1.125rem;
764
+ flex-shrink: 0;
765
+ animation: ty-select-spin 0.7s linear infinite;
766
+ color: var(--select-accent-bold, var(--ty-color-primary));
767
+ }
939
768
  .dropdown-loading-spinner svg {
940
- width: 100%;
941
- height: 100%;
769
+ width: 100%;
770
+ height: 100%;
942
771
  }
943
-
944
772
  .dropdown-loading-text {
945
- color: var(--ty-text-soft);
773
+ color: var(--ty-text-soft);
946
774
  }
947
-
948
775
  @keyframes ty-select-spin {
949
- to { transform: rotate(360deg); }
776
+ to { transform: rotate(360deg); }
950
777
  }
951
-
952
778
  @media (prefers-reduced-motion: reduce) {
953
- .dropdown-loading-spinner {
954
- animation-duration: 1.6s;
955
- }
779
+ .dropdown-loading-spinner {
780
+ animation-duration: 1.6s;
781
+ }
956
782
  }
957
-
958
783
  ${customScrollbarStyles}
959
-
960
- /* Flavor variants set --select-accent*, consumed above */
961
784
  ${FLAVORS.filter((f) => f !== "neutral").map((f) => selectFlavor(f)).join("")}
962
785
  `;