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,396 +1,326 @@
1
1
  import { FLAVORS } from "../types/common.js";
2
+ import { fieldSizeVars } from "./field-size.js";
2
3
  const datePickerFlavor = (f, fb) => {
3
- const c = (s) => fb
4
- ? s
5
- ? `var(--ty-color-${f}${s}, var(--ty-color-${f}, var(--ty-color-${fb}${s})))`
6
- : `var(--ty-color-${f}, var(--ty-color-${fb}))`
7
- : s
8
- ? `var(--ty-color-${f}${s}, var(--ty-color-${f}))`
9
- : `var(--ty-color-${f})`;
10
- return `
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
- --date-picker-accent: var(--ty-input-${f}-border, ${c("-soft")});
13
- --date-picker-accent-bold: ${c("")};
14
- --date-picker-ring: color-mix(in oklab, ${c("")} 15%, transparent);
13
+ --date-picker-accent: var(--ty-input-${f}-border, ${c("-soft")});
14
+ --date-picker-accent-bold: ${c("")};
15
+ --date-picker-ring: color-mix(in oklab, ${c("")} 15%, transparent);
15
16
  }
16
17
  :host([flavor="${f}+"]) {
17
- --date-picker-accent: ${c("")};
18
- --date-picker-accent-bold: ${c("-strong")};
19
- --date-picker-ring: color-mix(in oklab, ${c("-strong")} 15%, transparent);
18
+ --date-picker-accent: ${c("")};
19
+ --date-picker-accent-bold: ${c("-strong")};
20
+ --date-picker-ring: color-mix(in oklab, ${c("-strong")} 15%, transparent);
20
21
  }
21
22
  :host([flavor="${f}-"]) {
22
- --date-picker-accent: ${c("-faint")};
23
- --date-picker-accent-bold: ${c("-soft")};
24
- --date-picker-ring: color-mix(in oklab, ${c("-soft")} 15%, transparent);
23
+ --date-picker-accent: ${c("-faint")};
24
+ --date-picker-accent-bold: ${c("-soft")};
25
+ --date-picker-ring: color-mix(in oklab, ${c("-soft")} 15%, transparent);
25
26
  }
26
27
  `;
27
28
  };
28
29
  export const datePickerCustomFlavorCss = (base) => datePickerFlavor(base, "neutral");
29
30
  export const datePickerStyles = `
31
+ ${fieldSizeVars}
30
32
  :host {
31
- display: block;
32
- width: auto;
33
- min-width: 200px;
34
- font-family: inherit;
35
-
36
- /* Theming tokens — date-picker stub. Thin shim over --ty-input-*: override
37
- these to retheme just the date-picker trigger, not other inputs. */
38
- --ty-date-picker-bg: var(--ty-input-bg);
39
- --ty-date-picker-color: var(--ty-input-color);
40
- --ty-date-picker-placeholder: var(--ty-input-placeholder);
41
- --ty-date-picker-border: var(--ty-input-border);
42
- --ty-date-picker-border-hover: var(--ty-input-border-hover);
43
- --ty-date-picker-border-focus: var(--ty-input-border-focus);
44
- --ty-date-picker-shadow-focus: var(--ty-input-shadow-focus);
45
- --ty-date-picker-disabled-bg: var(--ty-input-disabled-bg);
46
- --ty-date-picker-disabled-color: var(--ty-input-disabled-color);
47
- --ty-date-picker-radius: var(--ty-radius-md);
48
-
49
- /* Theming tokens — calendar popup surface. Shared with ty-calendar /
50
- ty-calendar-month theming. */
51
- --ty-calendar-surface-bg: var(--ty-surface-floating);
52
- --ty-calendar-surface-border: var(--ty-input-border);
53
- --ty-calendar-surface-shadow: var(--ty-shadow-lg, 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1));
54
- --ty-calendar-surface-radius: var(--ty-radius-lg);
55
-
56
- /* Theming tokens — time section */
57
- --ty-calendar-time-bg: transparent;
58
- --ty-calendar-time-border: var(--ty-border-faint);
59
- --ty-calendar-time-label-color: var(--ty-color-neutral);
60
- --ty-calendar-time-input-color: var(--ty-input-color);
61
- --ty-calendar-time-placeholder-color: var(--ty-input-placeholder);
62
- --ty-calendar-time-icon-color: var(--ty-color-neutral-soft);
63
- }
64
-
65
- /* Container structure (reuses dropdown patterns) */
33
+ display: block;
34
+ width: auto;
35
+ min-width: 200px;
36
+ font-family: inherit;
37
+ --ty-date-picker-bg: var(--ty-input-bg);
38
+ --ty-date-picker-color: var(--ty-input-color);
39
+ --ty-date-picker-placeholder: var(--ty-input-placeholder);
40
+ --ty-date-picker-border: var(--ty-input-border);
41
+ --ty-date-picker-border-hover: var(--ty-input-border-hover);
42
+ --ty-date-picker-border-focus: var(--ty-input-border-focus);
43
+ --ty-date-picker-shadow-focus: var(--ty-input-shadow-focus);
44
+ --ty-date-picker-disabled-bg: var(--ty-input-disabled-bg);
45
+ --ty-date-picker-disabled-color: var(--ty-input-disabled-color);
46
+ --ty-date-picker-radius: var(--ty-radius-md);
47
+ --ty-calendar-surface-bg: var(--ty-surface-floating);
48
+ --ty-calendar-surface-border: var(--ty-input-border);
49
+ --ty-calendar-surface-shadow: var(--ty-shadow-lg, 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1));
50
+ --ty-calendar-surface-radius: var(--ty-radius-lg);
51
+ --ty-calendar-time-bg: transparent;
52
+ --ty-calendar-time-border: var(--ty-border-faint);
53
+ --ty-calendar-time-label-color: var(--ty-color-neutral);
54
+ --ty-calendar-time-input-color: var(--ty-input-color);
55
+ --ty-calendar-time-placeholder-color: var(--ty-input-placeholder);
56
+ --ty-calendar-time-icon-color: var(--ty-color-neutral-soft);
57
+ }
66
58
  .dropdown-container {
67
- display: flex;
68
- flex-direction: column;
69
- width: 100%;
70
- box-sizing: border-box;
59
+ display: flex;
60
+ flex-direction: column;
61
+ width: 100%;
62
+ box-sizing: border-box;
71
63
  }
72
-
73
64
  .ty-field-label {
74
- font-size: var(--ty-font-sm);
75
- line-height: var(--ty-leading-sm);
76
- letter-spacing: var(--ty-tracking-sm);
77
- font-weight: var(--ty-font-medium);
78
- color: var(--ty-label-color);
79
- margin-bottom: 6px;
80
- padding-left: 12px;
81
- display: flex;
82
- align-items: center;
83
- }
84
-
65
+ font-size: var(--ty-field-label-font);
66
+ line-height: var(--ty-field-label-leading);
67
+ letter-spacing: var(--ty-tracking-sm);
68
+ font-weight: var(--ty-font-medium);
69
+ color: var(--ty-label-color);
70
+ margin-bottom: var(--ty-field-label-gap);
71
+ padding-left: var(--ty-field-outer-pad-x);
72
+ display: flex;
73
+ align-items: center;
74
+ }
85
75
  .required-icon {
86
- display: inline-flex;
87
- align-items: center;
88
- color: #ef4444;
89
- width: 12px;
90
- height: 12px;
91
- vertical-align: middle;
92
- margin-left: 4px;
93
- }
94
-
76
+ display: inline-flex;
77
+ align-items: center;
78
+ color: #ef4444;
79
+ width: 12px;
80
+ height: 12px;
81
+ vertical-align: middle;
82
+ margin-left: 4px;
83
+ }
95
84
  .dropdown-wrapper {
96
- position: relative;
97
- display: block;
98
- width: 100%;
85
+ position: relative;
86
+ display: block;
87
+ width: 100%;
99
88
  }
100
-
101
89
  .date-picker-stub ::slotted([slot="start"]) {
102
- display: flex;
103
- align-items: center;
104
- justify-content: center;
105
- flex-shrink: 0;
106
- margin-right: 0.5rem;
107
- color: var(--ty-color-text-soft);
108
- }
109
-
90
+ display: flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ flex-shrink: 0;
94
+ margin-right: 0.5rem;
95
+ color: var(--ty-color-text-soft);
96
+ }
110
97
  .date-picker-stub ::slotted(ty-icon[slot="start"]) {
111
- width: 1em;
112
- height: 1em;
98
+ width: 1em;
99
+ height: 1em;
113
100
  }
114
-
115
101
  .date-picker-stub {
116
- width: 100%;
117
- cursor: pointer;
118
- box-sizing: border-box;
119
- position: relative;
120
- display: flex;
121
- align-items: center;
122
- background: var(--ty-date-picker-bg);
123
- color: var(--ty-date-picker-color);
124
- border: 1px solid var(--date-picker-accent, var(--ty-date-picker-border));
125
- border-radius: var(--ty-date-picker-radius);
126
- font-family: inherit;
127
- font-size: var(--ty-font-sm);
128
- font-weight: var(--ty-font-normal);
129
- line-height: var(--ty-line-height-tight);
130
- min-height: var(--ty-size-md);
131
- padding: var(--ty-spacing-2) var(--ty-spacing-3);
132
- padding-right: calc(var(--ty-spacing-3) + 1rem + var(--ty-spacing-2));
133
- transition: var(--ty-transition-all), opacity 0.2s ease;
134
- outline: none;
135
- }
136
-
102
+ width: 100%;
103
+ cursor: pointer;
104
+ box-sizing: border-box;
105
+ position: relative;
106
+ display: flex;
107
+ align-items: center;
108
+ background: var(--ty-date-picker-bg);
109
+ color: var(--ty-date-picker-color);
110
+ border: 1px solid var(--date-picker-accent, var(--ty-date-picker-border));
111
+ border-radius: var(--ty-date-picker-radius);
112
+ font-family: inherit;
113
+ font-size: var(--ty-field-font);
114
+ font-weight: var(--ty-font-normal);
115
+ line-height: var(--ty-field-leading);
116
+ min-height: var(--ty-field-height);
117
+ padding: 0 var(--ty-field-pad-x);
118
+ padding-right: calc(var(--ty-field-pad-x) + 1rem + var(--ty-field-pad-x));
119
+ transition: var(--ty-transition-all), opacity 0.2s ease;
120
+ outline: none;
121
+ }
137
122
  .date-picker-stub:hover:not([disabled]):not(.open) {
138
- border-color: var(--date-picker-accent-bold, var(--ty-date-picker-border-hover));
123
+ border-color: var(--date-picker-accent-bold, var(--ty-date-picker-border-hover));
139
124
  }
140
-
141
125
  .date-picker-stub[disabled] {
142
- background-color: var(--ty-date-picker-disabled-bg);
143
- color: var(--ty-date-picker-disabled-color);
144
- cursor: not-allowed;
145
- opacity: 0.6;
126
+ background-color: var(--ty-date-picker-disabled-bg);
127
+ color: var(--ty-date-picker-disabled-color);
128
+ cursor: not-allowed;
129
+ opacity: 0.6;
146
130
  }
147
-
148
131
  .date-picker-stub:focus,
149
132
  .date-picker-stub.open {
150
- border-color: var(--date-picker-accent-bold, var(--ty-date-picker-border-focus));
151
- box-shadow: 0 0 0 3px var(--date-picker-ring, var(--ty-date-picker-shadow-focus));
152
- }
153
-
154
- .date-picker-stub.sm {
155
- min-height: var(--ty-size-sm);
156
- font-size: var(--ty-font-xs);
157
- padding: var(--ty-spacing-1) var(--ty-spacing-2);
158
- padding-right: calc(var(--ty-spacing-2) + 0.875rem + var(--ty-spacing-1));
159
- }
160
-
161
- .date-picker-stub.lg {
162
- min-height: var(--ty-size-lg);
163
- font-size: var(--ty-font-base);
164
- padding: var(--ty-spacing-2) var(--ty-spacing-4);
165
- padding-right: calc(var(--ty-spacing-4) + 1.125rem + var(--ty-spacing-2));
166
- }
167
-
168
- /* Flavor variants — set --date-picker-accent*, consumed by the stub rules above */
133
+ border-color: var(--date-picker-accent-bold, var(--ty-date-picker-border-focus));
134
+ box-shadow: 0 0 0 3px var(--date-picker-ring, var(--ty-date-picker-shadow-focus));
135
+ }
169
136
  ${FLAVORS.filter((f) => f !== "neutral").map((f) => datePickerFlavor(f)).join("")}
170
-
171
137
  .stub-text {
172
- flex: 1;
173
- white-space: nowrap;
174
- overflow: hidden;
175
- text-overflow: ellipsis;
176
- user-select: none;
177
- color: inherit;
178
- pointer-events: none;
179
- }
180
-
138
+ flex: 1;
139
+ white-space: nowrap;
140
+ overflow: hidden;
141
+ text-overflow: ellipsis;
142
+ user-select: none;
143
+ color: inherit;
144
+ pointer-events: none;
145
+ }
181
146
  .stub-text.placeholder {
182
- color: var(--ty-date-picker-placeholder);
147
+ color: var(--ty-date-picker-placeholder);
183
148
  }
184
-
185
149
  .stub-icons {
186
- display: flex;
187
- align-items: center;
188
- gap: var(--ty-spacing-1);
189
- position: absolute;
190
- right: var(--ty-spacing-3);
191
- top: 50%;
192
- transform: translateY(-50%);
193
- height: 1rem;
194
- pointer-events: none;
195
- z-index: 2;
196
- }
197
-
150
+ display: flex;
151
+ align-items: center;
152
+ gap: var(--ty-spacing-1);
153
+ position: absolute;
154
+ right: var(--ty-spacing-3);
155
+ top: 50%;
156
+ transform: translateY(-50%);
157
+ height: 1rem;
158
+ pointer-events: none;
159
+ z-index: 2;
160
+ }
198
161
  .stub-clear {
199
- display: flex;
200
- align-items: center;
201
- justify-content: center;
202
- width: 1rem;
203
- height: 1rem;
204
- padding: 0;
205
- border: none;
206
- background: none;
207
- color: var(--ty-color-neutral-soft);
208
- cursor: pointer;
209
- border-radius: var(--ty-radius-sm);
210
- transition: var(--ty-local-transition, all 0.15s ease);
211
- pointer-events: auto;
212
- }
213
-
162
+ display: flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ width: 1rem;
166
+ height: 1rem;
167
+ padding: 0;
168
+ border: none;
169
+ background: none;
170
+ color: var(--ty-color-neutral-soft);
171
+ cursor: pointer;
172
+ border-radius: var(--ty-radius-sm);
173
+ transition: var(--ty-local-transition, all 0.15s ease);
174
+ pointer-events: auto;
175
+ }
214
176
  .stub-clear:hover {
215
- /* Clear is a destructive utility action, not the field's semantic flavor
216
- — it stays neutral at rest and always warns danger-red on hover,
217
- regardless of the field's own flavor. (--ty-color-negative/
218
- --ty-bg-negative-faint used here previously don't exist as tokens —
219
- this silently fell back to unstyled inherited color.) */
220
- color: var(--ty-color-danger);
221
- background-color: var(--ty-bg-danger-soft);
222
- }
223
-
177
+ color: var(--ty-color-danger);
178
+ background-color: var(--ty-bg-danger-soft);
179
+ }
224
180
  .stub-arrow {
225
- display: flex;
226
- align-items: center;
227
- justify-content: center;
228
- width: 1rem;
229
- height: 1rem;
230
- color: var(--date-picker-accent, var(--ty-color-neutral-soft));
231
- }
232
-
181
+ display: flex;
182
+ align-items: center;
183
+ justify-content: center;
184
+ width: 1rem;
185
+ height: 1rem;
186
+ color: var(--date-picker-accent, var(--ty-color-neutral-soft));
187
+ }
233
188
  .date-picker-stub:hover .stub-arrow {
234
- color: var(--date-picker-accent-bold, var(--ty-color-neutral));
189
+ color: var(--date-picker-accent-bold, var(--ty-color-neutral));
235
190
  }
236
-
237
191
  .date-picker-stub:focus .stub-arrow,
238
192
  .date-picker-stub.open .stub-arrow {
239
- color: var(--date-picker-accent-bold, var(--ty-date-picker-border-focus));
193
+ color: var(--date-picker-accent-bold, var(--ty-date-picker-border-focus));
240
194
  }
241
-
242
- /* Calendar dialog (showModal positioning system) */
243
195
  .calendar-dialog {
244
- position: fixed;
245
- flex-direction: column;
246
- max-width: 90vw;
247
- margin: 0;
248
- padding: 0;
249
- border: none;
250
- background: transparent;
251
- box-sizing: border-box;
252
- padding: var(--calendar-padding, 8px);
253
-
254
- opacity: 0;
255
- /* Entrance motion uses the individual scale/translate properties so it
256
- composes with the collision-shift transform below (they apply first). */
257
- scale: 0.96;
258
- translate: 0 -6px;
259
- transform-origin: top center;
260
- transition:
261
- opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
262
- scale var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
263
- translate var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
264
-
265
- transform: translate(var(--calendar-offset-x, 0px), var(--calendar-offset-y, 0px));
266
- top: -1000px;
267
- left: -1000px;
268
- }
269
-
196
+ position: fixed;
197
+ flex-direction: column;
198
+ max-width: 90vw;
199
+ margin: 0;
200
+ padding: 0;
201
+ border: none;
202
+ background: transparent;
203
+ box-sizing: border-box;
204
+ padding: var(--calendar-padding, 8px);
205
+ opacity: 0;
206
+ scale: 0.96;
207
+ translate: 0 -6px;
208
+ transform-origin: top center;
209
+ transition:
210
+ opacity var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
211
+ scale var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
212
+ translate var(--ty-popup-duration, 180ms) var(--ty-popup-ease, cubic-bezier(0.34, 1.56, 0.64, 1));
213
+ transform: translate(var(--calendar-offset-x, 0px), var(--calendar-offset-y, 0px));
214
+ top: -1000px;
215
+ left: -1000px;
216
+ }
270
217
  .calendar-dialog.position-below {
271
- left: var(--calendar-x);
272
- top: var(--calendar-y);
218
+ left: var(--calendar-x);
219
+ top: var(--calendar-y);
273
220
  }
274
-
275
221
  .calendar-dialog.position-above {
276
- left: var(--calendar-x);
277
- bottom: var(--calendar-y);
278
- top: auto;
279
- flex-direction: column-reverse;
280
- translate: 0 6px;
281
- transform-origin: bottom center;
282
- }
283
-
222
+ left: var(--calendar-x);
223
+ bottom: var(--calendar-y);
224
+ top: auto;
225
+ flex-direction: column-reverse;
226
+ translate: 0 6px;
227
+ transform-origin: bottom center;
228
+ }
284
229
  .calendar-dialog.open {
285
- opacity: 1;
286
- scale: 1;
287
- translate: 0 0;
230
+ opacity: 1;
231
+ scale: 1;
232
+ translate: 0 0;
288
233
  }
289
-
290
- /* First-frame "from" values — see select-base.ts: transitions can't start on
291
- an element that was display:none last frame; @starting-style fixes that. */
292
234
  @starting-style {
293
- .calendar-dialog.open {
294
- opacity: 0;
295
- scale: 0.96;
296
- translate: 0 -6px;
297
- }
298
-
299
- .calendar-dialog.open.position-above {
300
- translate: 0 6px;
301
- }
302
- }
303
-
235
+ .calendar-dialog.open {
236
+ opacity: 0;
237
+ scale: 0.96;
238
+ translate: 0 -6px;
239
+ }
240
+ .calendar-dialog.open.position-above {
241
+ translate: 0 6px;
242
+ }
243
+ }
304
244
  .calendar-dialog::backdrop {
305
- background: transparent
245
+ background: transparent
306
246
  }
307
-
308
247
  .calendar-content {
309
- background-color: var(--ty-calendar-surface-bg);
310
- border: 1px solid var(--ty-calendar-surface-border);
311
- border-radius: var(--ty-calendar-surface-radius);
312
- box-shadow: var(--ty-calendar-surface-shadow);
313
- overflow: hidden;
314
- display: flex;
315
- flex-direction: column;
316
- align-items: center;
317
- }
318
-
319
- /* Native input is invisible — used only to trigger the OS picker */
248
+ background-color: var(--ty-calendar-surface-bg);
249
+ border: 1px solid var(--ty-calendar-surface-border);
250
+ border-radius: var(--ty-calendar-surface-radius);
251
+ box-shadow: var(--ty-calendar-surface-shadow);
252
+ overflow: hidden;
253
+ display: flex;
254
+ flex-direction: column;
255
+ align-items: center;
256
+ }
320
257
  .native-date-input {
321
- position: absolute;
322
- inset: 0;
323
- opacity: 0;
324
- width: 100%;
325
- height: 100%;
326
- margin: 0;
327
- padding: 0;
328
- border: none;
329
- cursor: pointer;
330
- z-index: 1;
331
- }
332
-
258
+ position: absolute;
259
+ inset: 0;
260
+ opacity: 0;
261
+ width: 100%;
262
+ height: 100%;
263
+ margin: 0;
264
+ padding: 0;
265
+ border: none;
266
+ cursor: pointer;
267
+ z-index: 1;
268
+ }
333
269
  .native-date-input::-webkit-calendar-picker-indicator {
334
- position: absolute;
335
- inset: 0;
336
- width: 100%;
337
- height: 100%;
338
- margin: 0;
339
- padding: 0;
340
- cursor: pointer;
341
- }
342
-
270
+ position: absolute;
271
+ inset: 0;
272
+ width: 100%;
273
+ height: 100%;
274
+ margin: 0;
275
+ padding: 0;
276
+ cursor: pointer;
277
+ }
343
278
  .time-section {
344
- display: flex;
345
- min-height: 2.5rem;
346
- align-items: center;
347
- justify-content: center;
348
- gap: 0.5rem;
349
- padding: 0.5rem 1rem;
350
- border-top: 1px solid var(--ty-calendar-time-border);
351
- background-color: var(--ty-calendar-time-bg);
352
- width: 100%;
353
- box-sizing: border-box;
354
- position: relative;
355
- }
356
-
279
+ display: flex;
280
+ min-height: 2.5rem;
281
+ align-items: center;
282
+ justify-content: center;
283
+ gap: 0.5rem;
284
+ padding: 0.5rem 1rem;
285
+ border-top: 1px solid var(--ty-calendar-time-border);
286
+ background-color: var(--ty-calendar-time-bg);
287
+ width: 100%;
288
+ box-sizing: border-box;
289
+ position: relative;
290
+ }
357
291
  .time-label {
358
- font-size: var(--ty-font-sm);
359
- font-weight: 500;
360
- color: var(--ty-calendar-time-label-color);
361
- flex-shrink: 0;
292
+ font-size: var(--ty-font-sm);
293
+ font-weight: 500;
294
+ color: var(--ty-calendar-time-label-color);
295
+ flex-shrink: 0;
362
296
  }
363
-
364
297
  .time-input {
365
- width: 3.5rem;
366
- border: 1px solid var(--ty-input-border);
367
- border-radius: var(--ty-radius-sm);
368
- background: var(--ty-input-bg);
369
- color: var(--ty-calendar-time-input-color);
370
- font-family: inherit;
371
- font-size: var(--ty-font-sm);
372
- font-variant-numeric: tabular-nums;
373
- text-align: center;
374
- padding: 0.25rem 0.375rem;
375
- outline: none;
376
- transition: var(--ty-transition-all);
377
- }
378
-
298
+ width: 3.5rem;
299
+ border: 1px solid var(--ty-input-border);
300
+ border-radius: var(--ty-radius-sm);
301
+ background: var(--ty-input-bg);
302
+ color: var(--ty-calendar-time-input-color);
303
+ font-family: inherit;
304
+ font-size: var(--ty-font-sm);
305
+ font-variant-numeric: tabular-nums;
306
+ text-align: center;
307
+ padding: 0.25rem 0.375rem;
308
+ outline: none;
309
+ transition: var(--ty-transition-all);
310
+ }
379
311
  .time-input:focus {
380
- border-color: var(--ty-input-border-focus);
381
- box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);
312
+ border-color: var(--ty-input-border-focus);
313
+ box-shadow: 0 0 0 3px var(--ty-input-shadow-focus);
382
314
  }
383
-
384
315
  .time-input::placeholder {
385
- color: var(--ty-calendar-time-placeholder-color);
316
+ color: var(--ty-calendar-time-placeholder-color);
386
317
  }
387
-
388
318
  .time-icon {
389
- display: flex;
390
- align-items: center;
391
- color: var(--ty-calendar-time-icon-color);
392
- width: 1rem;
393
- height: 1rem;
394
- flex-shrink: 0;
319
+ display: flex;
320
+ align-items: center;
321
+ color: var(--ty-calendar-time-icon-color);
322
+ width: 1rem;
323
+ height: 1rem;
324
+ flex-shrink: 0;
395
325
  }
396
326
  `;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Field Size Ladder
3
+ * One source of truth for how `size` scales every field component.
4
+ * Components consume the --ty-field-* vars; nothing hardcodes a size.
5
+ */
6
+ export declare const fieldSizeVars = "\n:host {\n --ty-field-height: var(--ty-size-sm, 2rem);\n --ty-field-pad-x: 10px;\n --ty-field-font: var(--ty-font-sm);\n --ty-field-leading: 20px;\n --ty-field-tracking: var(--ty-tracking-sm);\n --ty-field-label-font: var(--ty-font-xs);\n --ty-field-label-leading: var(--ty-leading-xs);\n --ty-field-label-gap: 5px;\n /* Text that sits OUTSIDE the field box (label, error message) has to line up\n with the value INSIDE it. The value is inset by the wrapper's 1px border\n plus --ty-field-pad-x; outside text only ever cleared the padding, so it\n started exactly 1px to the left of the value it labelled \u2014 at every rung,\n on every field. Resolved per rung: the calc reads whichever --ty-field-pad-x\n is winning on the host. */\n --ty-field-outer-pad-x: calc(var(--ty-field-pad-x) + 1px);\n --ty-field-control: 24px;\n --ty-field-icon: 16px;\n}\n\n:host([size=\"xs\"]) {\n --ty-field-height: var(--ty-size-xs, 1.75rem);\n --ty-field-pad-x: 8px;\n --ty-field-font: var(--ty-font-xs);\n --ty-field-leading: 16px;\n --ty-field-tracking: var(--ty-tracking-xs);\n --ty-field-label-font: var(--ty-font-xs);\n --ty-field-label-leading: var(--ty-leading-xs);\n --ty-field-label-gap: 4px;\n --ty-field-control: 20px;\n --ty-field-icon: 14px;\n}\n\n:host([size=\"md\"]) {\n --ty-field-height: var(--ty-size-md, 2.25rem);\n --ty-field-pad-x: 12px;\n --ty-field-font: var(--ty-font-sm);\n --ty-field-leading: 20px;\n --ty-field-tracking: var(--ty-tracking-sm);\n --ty-field-label-font: var(--ty-font-sm);\n --ty-field-label-leading: var(--ty-leading-sm);\n --ty-field-label-gap: 6px;\n --ty-field-control: 28px;\n --ty-field-icon: 18px;\n}\n\n:host([size=\"lg\"]) {\n --ty-field-height: var(--ty-size-lg, 2.5rem);\n --ty-field-pad-x: 14px;\n --ty-field-font: var(--ty-font-base);\n --ty-field-leading: 24px;\n --ty-field-tracking: var(--ty-tracking-base);\n --ty-field-label-font: var(--ty-font-sm);\n --ty-field-label-leading: var(--ty-leading-sm);\n --ty-field-label-gap: 6px;\n --ty-field-control: 32px;\n --ty-field-icon: 20px;\n}\n\n:host([size=\"xl\"]) {\n --ty-field-height: var(--ty-size-xl, 2.75rem);\n --ty-field-pad-x: 16px;\n --ty-field-font: var(--ty-font-lg);\n --ty-field-leading: 28px;\n --ty-field-tracking: var(--ty-tracking-base);\n --ty-field-label-font: var(--ty-font-base);\n --ty-field-label-leading: var(--ty-leading-base);\n --ty-field-label-gap: 8px;\n --ty-field-control: 36px;\n --ty-field-icon: 22px;\n}\n\n/* Narrow viewports drop the two biggest rungs one step \u2014 same ladder, no\n component-specific overrides.\n\n A stepped-down rung must carry the WHOLE rung: --ty-field-control is the\n in-field button box (ty-copy's copy button, the date-picker's icon), and it\n sets the wrapper's content height. Leave it at the original rung and the\n field ends up taller than --ty-field-height \u2014 the ladder silently breaks on\n exactly one component. */\n@media (max-width: 640px) {\n :host([size=\"lg\"]) {\n --ty-field-height: var(--ty-size-md, 2.25rem);\n --ty-field-pad-x: 12px;\n --ty-field-font: var(--ty-font-sm);\n --ty-field-leading: 20px;\n --ty-field-control: 28px;\n --ty-field-icon: 18px;\n }\n\n :host([size=\"xl\"]) {\n --ty-field-height: var(--ty-size-lg, 2.5rem);\n --ty-field-pad-x: 14px;\n --ty-field-font: var(--ty-font-base);\n --ty-field-leading: 24px;\n --ty-field-control: 32px;\n --ty-field-icon: 20px;\n }\n}\n\n@media (max-width: 480px) {\n :host([size=\"xl\"]) {\n --ty-field-height: var(--ty-size-md, 2.25rem);\n --ty-field-pad-x: 12px;\n --ty-field-font: var(--ty-font-sm);\n --ty-field-leading: 20px;\n --ty-field-control: 28px;\n --ty-field-icon: 18px;\n }\n}\n";