@eldrajs/ui 0.3.0 → 0.3.1

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.
@@ -55,6 +55,10 @@
55
55
  --tw-content: "";
56
56
  --tw-outline-style: solid;
57
57
  --eldra-focus-alpha: 0;
58
+ --eldra-focus-rest-width: initial;
59
+ --eldra-focus-rest-offset: initial;
60
+ --eldra-focus-rest-color: initial;
61
+ --eldra-focus-rest-forced: initial;
58
62
  }
59
63
  }
60
64
  }
@@ -187,26 +191,6 @@
187
191
  container-type: inline-size;
188
192
  }
189
193
 
190
- .eldra\:eldra-field-invalid {
191
- position: relative;
192
- }
193
-
194
- .eldra\:eldra-field-invalid:after {
195
- content: "";
196
- inset: var(--eldra-field-border-width, 1px);
197
- border: var(--eldra-field-border-width, 1px) solid var(--eldra-color-danger);
198
- --eldra-field-invalid-radius: var(--eldra-field-radius, var(--eldra-input-radius, var(--eldra-radius-md)));
199
- border-radius: calc(var(--eldra-field-invalid-radius) - var(--eldra-field-border-width, 1px));
200
- pointer-events: none;
201
- position: absolute;
202
- }
203
-
204
- @media (forced-colors: active) {
205
- .eldra\:eldra-field-invalid:after {
206
- border-color: canvastext;
207
- }
208
- }
209
-
210
194
  .eldra\:eldra-radio-card-selected {
211
195
  position: relative;
212
196
  }
@@ -322,26 +306,27 @@
322
306
  }
323
307
 
324
308
  .eldra\:eldra-skeleton {
325
- background-color: var(--eldra-color-surface-strong);
309
+ background-color: var(--eldra-skeleton-color, var(--eldra-color-surface-strong));
326
310
  position: relative;
327
311
  overflow: hidden;
328
312
  }
329
313
 
330
314
  .eldra\:eldra-skeleton:after {
331
315
  content: "";
332
- background: linear-gradient(90deg, transparent, var(--eldra-color-background), transparent);
316
+ background: linear-gradient(90deg, transparent 15%, var(--eldra-skeleton-highlight, var(--eldra-color-background)) 50%, transparent 85%);
333
317
  position: absolute;
334
318
  inset: 0;
335
319
  }
336
320
 
337
321
  @supports (color: color-mix(in lab, red, red)) {
338
322
  .eldra\:eldra-skeleton:after {
339
- background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--eldra-color-background), transparent 40%), transparent);
323
+ background: linear-gradient(90deg, transparent 15%, var(--eldra-skeleton-highlight, color-mix(in oklab, var(--eldra-color-background), transparent 40%)) 50%, transparent 85%);
340
324
  }
341
325
  }
342
326
 
343
327
  .eldra\:eldra-skeleton:after {
344
- animation: eldra-shimmer 1.4s var(--eldra-ease-out) infinite;
328
+ animation: eldra-shimmer var(--eldra-skeleton-duration, 3s) var(--eldra-ease-in-out) infinite;
329
+ transform: translateX(-100%);
345
330
  }
346
331
 
347
332
  @media (prefers-reduced-motion: reduce) {
@@ -612,12 +597,13 @@
612
597
  margin-inline: auto;
613
598
  }
614
599
 
615
- .eldra\:-my-\[calc\(var\(--eldra-focus-offset\)_\+_var\(--eldra-focus-width\)\)\] {
616
- margin-block: calc(calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) * -1);
600
+ .eldra\:eldra-skeleton-text {
601
+ height: var(--eldra-skeleton-line-height, .875rem);
602
+ margin-block: var(--eldra-skeleton-line-gap, .3rem);
617
603
  }
618
604
 
619
- .eldra\:my-\[0\.3rem\] {
620
- margin-block: .3rem;
605
+ .eldra\:-my-\[calc\(var\(--eldra-focus-offset\)_\+_var\(--eldra-focus-width\)\)\] {
606
+ margin-block: calc(calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) * -1);
621
607
  }
622
608
 
623
609
  .eldra\:my-auto {
@@ -963,6 +949,14 @@
963
949
  height: var(--eldra-range-track-height, .375rem);
964
950
  }
965
951
 
952
+ .eldra\:eldra-skeleton-box {
953
+ height: var(--eldra-skeleton-box-height, 1rem);
954
+ }
955
+
956
+ .eldra\:eldra-skeleton-title {
957
+ height: var(--eldra-skeleton-title-height, 1.5rem);
958
+ }
959
+
966
960
  .eldra\:h-0 {
967
961
  height: 0;
968
962
  }
@@ -975,10 +969,6 @@
975
969
  height: .625rem;
976
970
  }
977
971
 
978
- .eldra\:h-3\.5 {
979
- height: .875rem;
980
- }
981
-
982
972
  .eldra\:h-4\.5 {
983
973
  height: 1.125rem;
984
974
  }
@@ -3171,15 +3161,21 @@
3171
3161
  }
3172
3162
 
3173
3163
  .eldra\:eldra-focus {
3174
- outline-offset: var(--eldra-focus-offset);
3175
3164
  --eldra-focus-alpha: 0;
3176
- box-shadow: 0 0 0 var(--eldra-focus-offset) transparent, 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) transparent, var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3165
+ --eldra-focus-from-width: var(--eldra-focus-rest-width, 1px);
3166
+ --eldra-focus-from-offset: var(--eldra-focus-rest-offset, 0px);
3167
+ --eldra-focus-from-color: var(--eldra-focus-rest-color, transparent);
3168
+ --eldra-focus-gap: calc(var(--eldra-focus-from-offset) + (var(--eldra-focus-offset) - var(--eldra-focus-from-offset)) *
3169
+ var(--eldra-focus-alpha));
3170
+ --eldra-focus-reach: calc(var(--eldra-focus-gap) + var(--eldra-focus-from-width) +
3171
+ (var(--eldra-focus-width) - var(--eldra-focus-from-width)) * var(--eldra-focus-alpha));
3172
+ box-shadow: 0 0 0 var(--eldra-focus-gap) transparent, 0 0 0 var(--eldra-focus-gap) transparent, 0 0 0 var(--eldra-focus-gap) transparent, 0 0 0 var(--eldra-focus-reach) var(--eldra-focus-from-color), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3177
3173
  outline: 0 solid #0000;
3178
3174
  }
3179
3175
 
3180
3176
  @supports (color: color-mix(in lab, red, red)) {
3181
3177
  .eldra\:eldra-focus {
3182
- box-shadow: 0 0 0 var(--eldra-focus-offset) color-mix(in srgb, transparent, var(--eldra-color-focus-inner) calc(var(--eldra-focus-alpha) * 100%)), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) color-mix(in srgb, transparent, var(--eldra-color-focus) calc(var(--eldra-focus-alpha) * 100%)), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3178
+ box-shadow: 0 0 0 var(--eldra-focus-gap) color-mix(in srgb, transparent, var(--eldra-color-focus-inner) calc(var(--eldra-focus-alpha) * 100%)), 0 0 0 var(--eldra-focus-gap) color-mix(in srgb, transparent, var(--eldra-color-focus-inner) calc(var(--eldra-focus-alpha) * 100%)), 0 0 0 var(--eldra-focus-gap) color-mix(in srgb, transparent, var(--eldra-color-focus-inner) calc(var(--eldra-focus-alpha) * 100%)), 0 0 0 var(--eldra-focus-reach) color-mix(in srgb, var(--eldra-focus-from-color), var(--eldra-color-focus) calc(var(--eldra-focus-alpha) * 100%)), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3183
3179
  }
3184
3180
  }
3185
3181
 
@@ -3199,13 +3195,19 @@
3199
3195
 
3200
3196
  @supports not (color: color-mix(in srgb, red, red)) {
3201
3197
  .eldra\:eldra-focus:focus-visible {
3202
- box-shadow: 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3198
+ box-shadow: 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3203
3199
  }
3204
3200
  }
3205
3201
 
3206
3202
  @media (forced-colors: active) {
3203
+ .eldra\:eldra-focus {
3204
+ outline-width: var(--eldra-focus-rest-forced, 0px);
3205
+ outline-color: canvastext;
3206
+ }
3207
+
3207
3208
  .eldra\:eldra-focus:focus-visible {
3208
3209
  outline-width: var(--eldra-focus-width);
3210
+ outline-offset: var(--eldra-focus-offset);
3209
3211
  outline-color: highlight;
3210
3212
  }
3211
3213
  }
@@ -3256,63 +3258,66 @@
3256
3258
 
3257
3259
  @supports not (color: color-mix(in srgb, red, red)) {
3258
3260
  .eldra\:eldra-focus-always:focus {
3259
- box-shadow: 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3261
+ box-shadow: 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3260
3262
  }
3261
3263
  }
3262
3264
 
3263
3265
  @media (forced-colors: active) {
3264
3266
  .eldra\:eldra-focus-always:focus {
3265
3267
  outline-width: var(--eldra-focus-width);
3268
+ outline-offset: var(--eldra-focus-offset);
3266
3269
  outline-color: highlight;
3267
3270
  }
3268
3271
  }
3269
3272
 
3270
- .eldra\:eldra-focus-inset-always:focus {
3273
+ .eldra\:eldra-focus-open[aria-expanded="true"] {
3271
3274
  --eldra-focus-alpha: 1;
3272
3275
  }
3273
3276
 
3274
3277
  @supports not (color: color-mix(in srgb, red, red)) {
3275
- .eldra\:eldra-focus-inset-always:focus {
3276
- box-shadow: inset 0 0 0 var(--eldra-focus-width) var(--eldra-color-focus), inset 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus-inner);
3278
+ .eldra\:eldra-focus-open[aria-expanded="true"] {
3279
+ box-shadow: 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3277
3280
  }
3278
3281
  }
3279
3282
 
3280
3283
  @media (forced-colors: active) {
3281
- .eldra\:eldra-focus-inset-always:focus {
3284
+ .eldra\:eldra-focus-open[aria-expanded="true"] {
3282
3285
  outline-width: var(--eldra-focus-width);
3286
+ outline-offset: var(--eldra-focus-offset);
3283
3287
  outline-color: highlight;
3284
3288
  }
3285
3289
  }
3286
3290
 
3287
- .eldra\:eldra-focus-open[aria-expanded="true"] {
3291
+ .eldra\:eldra-focus-proxy:has(:focus-visible) {
3288
3292
  --eldra-focus-alpha: 1;
3289
3293
  }
3290
3294
 
3291
3295
  @supports not (color: color-mix(in srgb, red, red)) {
3292
- .eldra\:eldra-focus-open[aria-expanded="true"] {
3293
- box-shadow: 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3296
+ .eldra\:eldra-focus-proxy:has(:focus-visible) {
3297
+ box-shadow: 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3294
3298
  }
3295
3299
  }
3296
3300
 
3297
3301
  @media (forced-colors: active) {
3298
- .eldra\:eldra-focus-open[aria-expanded="true"] {
3302
+ .eldra\:eldra-focus-proxy:has(:focus-visible) {
3299
3303
  outline-width: var(--eldra-focus-width);
3304
+ outline-offset: var(--eldra-focus-offset);
3300
3305
  outline-color: highlight;
3301
3306
  }
3302
3307
  }
3303
3308
 
3304
- .eldra\:eldra-focus-proxy:has(:focus-visible) {
3309
+ .eldra\:eldra-focus-inset-always:focus {
3305
3310
  --eldra-focus-alpha: 1;
3306
3311
  }
3307
3312
 
3308
3313
  @supports not (color: color-mix(in srgb, red, red)) {
3309
- .eldra\:eldra-focus-proxy:has(:focus-visible) {
3310
- box-shadow: 0 0 0 var(--eldra-focus-offset) var(--eldra-color-focus-inner), 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus), var(--tw-inset-shadow, 0 0 #0000), var(--tw-inset-ring-shadow, 0 0 #0000), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
3314
+ .eldra\:eldra-focus-inset-always:focus {
3315
+ box-shadow: inset 0 0 0 var(--eldra-focus-width) var(--eldra-color-focus), inset 0 0 0 calc(var(--eldra-focus-offset) + var(--eldra-focus-width)) var(--eldra-color-focus-inner);
3311
3316
  }
3312
3317
  }
3313
3318
 
3314
3319
  @media (forced-colors: active) {
3315
- .eldra\:eldra-focus-proxy:has(:focus-visible) {
3320
+ .eldra\:eldra-focus-inset-always:focus {
3316
3321
  outline-width: var(--eldra-focus-width);
3317
3322
  outline-color: highlight;
3318
3323
  }
@@ -3439,6 +3444,12 @@
3439
3444
  }
3440
3445
  }
3441
3446
 
3447
+ .eldra\:eldra-field-invalid {
3448
+ --eldra-focus-rest-width: var(--eldra-field-border-width, 1px);
3449
+ --eldra-focus-rest-color: var(--eldra-color-danger);
3450
+ --eldra-focus-rest-forced: var(--eldra-field-border-width, 1px);
3451
+ }
3452
+
3442
3453
  .eldra\:eldra-transition-colors {
3443
3454
  transition: color var(--eldra-duration-base) var(--eldra-ease-in-out), background-color var(--eldra-duration-base) var(--eldra-ease-in-out), border-color var(--eldra-duration-base) var(--eldra-ease-in-out), text-decoration-color var(--eldra-duration-base) var(--eldra-ease-in-out), text-decoration-thickness var(--eldra-duration-base) var(--eldra-ease-in-out), fill var(--eldra-duration-base) var(--eldra-ease-in-out), stroke var(--eldra-duration-base) var(--eldra-ease-in-out);
3444
3455
  }
@@ -3479,10 +3490,6 @@
3479
3490
  --eldra-avatar-initials-tracking: 0;
3480
3491
  }
3481
3492
 
3482
- .eldra\:\[--eldra-field-radius\:var\(--eldra-textarea-radius\,var\(--eldra-radius-md\)\)\] {
3483
- --eldra-field-radius: var(--eldra-textarea-radius, var(--eldra-radius-md));
3484
- }
3485
-
3486
3493
  .eldra\:\[--eldra-focus-offset\:4px\] {
3487
3494
  --eldra-focus-offset: 4px;
3488
3495
  }
@@ -4560,11 +4567,11 @@
4560
4567
  }
4561
4568
 
4562
4569
  @keyframes eldra-shimmer {
4563
- from {
4570
+ 0% {
4564
4571
  transform: translateX(-100%);
4565
4572
  }
4566
4573
 
4567
- to {
4574
+ 60%, 100% {
4568
4575
  transform: translateX(100%);
4569
4576
  }
4570
4577
  }
@@ -4575,6 +4582,26 @@
4575
4582
  initial-value: 0;
4576
4583
  }
4577
4584
 
4585
+ @property --eldra-focus-rest-width {
4586
+ syntax: "*";
4587
+ inherits: false
4588
+ }
4589
+
4590
+ @property --eldra-focus-rest-offset {
4591
+ syntax: "*";
4592
+ inherits: false
4593
+ }
4594
+
4595
+ @property --eldra-focus-rest-color {
4596
+ syntax: "*";
4597
+ inherits: false
4598
+ }
4599
+
4600
+ @property --eldra-focus-rest-forced {
4601
+ syntax: "*";
4602
+ inherits: false
4603
+ }
4604
+
4578
4605
  @keyframes eldra-popover-in {
4579
4606
  from {
4580
4607
  opacity: 0;
@@ -16,6 +16,13 @@ export interface UseDialogOptions {
16
16
  * it is focused only when it is a text field or marked `autofocus`; otherwise the dialog itself takes focus.
17
17
  */
18
18
  initialFocus?: Ref<HTMLElement | null>;
19
+ /**
20
+ * Whether the dialog may move focus to its first control on its own. Default `true`. With
21
+ * `false` it focuses the dialog itself however it opened, unless `initialFocus` or a control
22
+ * marked `autofocus` names a target: a form dialog then opens without focusing (and, on blur,
23
+ * validating) a field the user has not reached yet.
24
+ */
25
+ focusFirstControl?: boolean;
19
26
  /** Ran when `Esc` is pressed (the native `cancel` event), before the dialog actually closes. */
20
27
  onCancel?: () => void;
21
28
  }
@@ -52,7 +59,8 @@ export interface UseDialogReturn {
52
59
  * composable): the page behind does not scroll while the stack is non-empty (released only once
53
60
  * every open modal has closed), and `TOAST_HOST_KEY` tracks the **topmost** dialog a `Toaster`
54
61
  * should render into.
55
- * - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else the first
62
+ * - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else (unless
63
+ * `focusFirstControl: false`, which focuses the dialog itself instead) the first
56
64
  * meaningful control (never the close button — see `firstMeaningfulControl` above), else the close
57
65
  * button itself as a last resort, else whatever the platform already focused. Opened by a tap or
58
66
  * click, the dialog focuses itself instead unless that target is a text field or marked
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as parseLocaleNumber, A as focusInvalid, At as joinIds, B as FIELD_CLEAR_BUTTON_BOX, C as topLayerDialog, Ct as FORM_LAYOUT_KEY, D as normalizeText, Dt as ELDRA_SCOPE_KEY, E as matchRange, Et as useControllableModel, F as defaultCharacterMeaning, G as createNumberFormat, H as FIELD_LIVE, I as stripMask, J as defaultUnitFormat, K as currencyFractionDigits, L as CurrencyInput_default, M as filterNumericBeforeInput, N as Input_default, O as useListbox, Ot as provideEldraScope, P as applyMask, Q as localeSeparators, R as UnitInput_default, S as useOverlay, St as ICON_STROKE_WIDTH$4, T as useFloating, Tt as mergeClass, U as FIELD_SEARCH_APPEARANCE, V as FIELD_DISABLED, W as FIELD_SIZE, X as formatNumber, Y as formatCurrency, Z as formatUnit, _ as optionCursor, _t as FIELD_KEY, a as claimShortcut, at as provideEldraUiCurrency, b as MultiSelect_default, bt as Icon_default, c as SearchResultsPanel_default, ct as useEldraUiLocale, d as INPUT, dt as tagPadding, et as useSlotPresence, f as PLAIN_BOX_ONLY, ft as CheckboxGroup_default, g as labelRecipe, gt as FieldError_default, h as dotRecipe, ht as RequiredMark_default, i as SearchBar_default, it as LOCALE_KEY, j as Switch_default, jt as useUiId, k as FormLayout_default, kt as useEldraScope, l as RadioGroup_default, lt as TAG_FILL, m as PLAIN_OPTION, mt as VisuallyHidden_default, n as Textarea_default, nt as CURRENCY_KEY, o as ownsShortcut, ot as provideEldraUiLocale, p as PLAIN_COLUMNS, pt as Checkbox_default, q as currencySymbol, r as Select_default, rt as DEFAULT_UI_LOCALE, s as releaseShortcut, st as useEldraUiCurrency, t as VariantPicker_default, tt as useHeadingTag, u as HINT, ut as TAG_SHAPE, v as radioRecipe, vt as Button_default, w as useTeleportTarget, wt as FORM_SUBMITTING_KEY, x as usePopover, xt as ICON_SIZE_CLASS, y as QuantityStepper_default, yt as Spinner_default, z as FIELD_BASE } from "./VariantPicker-C-9sMXGI.js";
1
+ import { $ as parseLocaleNumber, A as focusInvalid, At as joinIds, B as FIELD_CLEAR_BUTTON_BOX, C as topLayerDialog, Ct as FORM_LAYOUT_KEY, D as normalizeText, Dt as ELDRA_SCOPE_KEY, E as matchRange, Et as useControllableModel, F as defaultCharacterMeaning, G as createNumberFormat, H as FIELD_LIVE, I as stripMask, J as defaultUnitFormat, K as currencyFractionDigits, L as CurrencyInput_default, M as filterNumericBeforeInput, N as Input_default, O as useListbox, Ot as provideEldraScope, P as applyMask, Q as localeSeparators, R as UnitInput_default, S as useOverlay, St as ICON_STROKE_WIDTH$4, T as useFloating, Tt as mergeClass, U as FIELD_SEARCH_APPEARANCE, V as FIELD_DISABLED, W as FIELD_SIZE, X as formatNumber, Y as formatCurrency, Z as formatUnit, _ as optionCursor, _t as FIELD_KEY, a as claimShortcut, at as provideEldraUiCurrency, b as MultiSelect_default, bt as Icon_default, c as SearchResultsPanel_default, ct as useEldraUiLocale, d as INPUT, dt as tagPadding, et as useSlotPresence, f as PLAIN_BOX_ONLY, ft as CheckboxGroup_default, g as labelRecipe, gt as FieldError_default, h as dotRecipe, ht as RequiredMark_default, i as SearchBar_default, it as LOCALE_KEY, j as Switch_default, jt as useUiId, k as FormLayout_default, kt as useEldraScope, l as RadioGroup_default, lt as TAG_FILL, m as PLAIN_OPTION, mt as VisuallyHidden_default, n as Textarea_default, nt as CURRENCY_KEY, o as ownsShortcut, ot as provideEldraUiLocale, p as PLAIN_COLUMNS, pt as Checkbox_default, q as currencySymbol, r as Select_default, rt as DEFAULT_UI_LOCALE, s as releaseShortcut, st as useEldraUiCurrency, t as VariantPicker_default, tt as useHeadingTag, u as HINT, ut as TAG_SHAPE, v as radioRecipe, vt as Button_default, w as useTeleportTarget, wt as FORM_SUBMITTING_KEY, x as usePopover, xt as ICON_SIZE_CLASS, y as QuantityStepper_default, yt as Spinner_default, z as FIELD_BASE } from "./VariantPicker-DDFlMvgJ.js";
2
2
  import { i as enUS, n as provideEldraUiMessages, r as useMessages, t as MESSAGES_KEY } from "./useMessages-B5nzZghs.js";
3
3
  import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onServerPrefetch, onUnmounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useSlots, useTemplateRef, vModelText, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
4
4
  import { dateTimeFormat } from "@eldrajs/sdk/format/date";
@@ -3579,6 +3579,7 @@ var Skeleton_default = /* @__PURE__ */ defineComponent({
3579
3579
  variant: { default: "text" },
3580
3580
  lines: { default: 1 },
3581
3581
  width: { default: void 0 },
3582
+ height: { default: void 0 },
3582
3583
  ratio: { default: "4x5" },
3583
3584
  size: { default: "2.5rem" },
3584
3585
  busyLabel: { default: null },
@@ -3616,8 +3617,19 @@ var Skeleton_default = /* @__PURE__ */ defineComponent({
3616
3617
  * rather than its own default percentage of it, so the rendered result is exactly `width` wide,
3617
3618
  * not a fraction of it.
3618
3619
  */
3619
- const rootClass = computed(() => ["eldra:block", !props.width && "eldra:w-full"]);
3620
- const rootStyle = computed(() => props.width ? { width: props.width } : void 0);
3620
+ const isBox = computed(() => props.variant === "box");
3621
+ const rootClass = computed(() => [
3622
+ "eldra:block",
3623
+ !props.width && "eldra:w-full",
3624
+ isBox.value && "eldra:eldra-skeleton eldra:eldra-skeleton-box eldra:rounded-md",
3625
+ isBox.value && props.classes?.line
3626
+ ]);
3627
+ const rootStyle = computed(() => {
3628
+ const style = {};
3629
+ if (props.width) style.width = props.width;
3630
+ if (props.height) style.height = props.height;
3631
+ return Object.keys(style).length ? style : void 0;
3632
+ });
3621
3633
  /**
3622
3634
  * Spec "Skeleton" → Properties, `width` row: "Vary text widths between 35% and 85%." Deterministic
3623
3635
  * rather than random, so a test can assert an exact value per line index: a fixed four-value
@@ -3654,8 +3666,8 @@ var Skeleton_default = /* @__PURE__ */ defineComponent({
3654
3666
  function lineClass(index) {
3655
3667
  const base = "eldra:eldra-skeleton eldra:block";
3656
3668
  const variant = props.variant;
3657
- if (variant === "text") return `${base} eldra:h-3.5 eldra:my-[0.3rem] eldra:rounded-sm ${textWidthClass(index)}`;
3658
- if (variant === "title") return `${base} eldra:h-6 eldra:rounded-sm ${props.width ? "eldra:w-full" : TITLE_WIDTH_CLASS}`;
3669
+ if (variant === "text") return `${base} eldra:eldra-skeleton-text eldra:rounded-sm ${textWidthClass(index)}`;
3670
+ if (variant === "title") return `${base} eldra:eldra-skeleton-title eldra:rounded-sm ${props.width ? "eldra:w-full" : TITLE_WIDTH_CLASS}`;
3659
3671
  return `${base} ${SHAPE_CLASS[variant]}`;
3660
3672
  }
3661
3673
  function lineStyle() {
@@ -3665,7 +3677,7 @@ var Skeleton_default = /* @__PURE__ */ defineComponent({
3665
3677
  };
3666
3678
  if (props.variant === "media") return { aspectRatio: mediaAspectRatio.value };
3667
3679
  }
3668
- const lines = computed(() => Array.from({ length: lineCount.value }, (_, index) => ({
3680
+ const lines = computed(() => Array.from({ length: isBox.value ? 0 : lineCount.value }, (_, index) => ({
3669
3681
  key: index,
3670
3682
  class: [lineClass(index), props.classes?.line],
3671
3683
  style: lineStyle()
@@ -4180,7 +4192,8 @@ function firstMeaningfulControl(root) {
4180
4192
  * composable): the page behind does not scroll while the stack is non-empty (released only once
4181
4193
  * every open modal has closed), and `TOAST_HOST_KEY` tracks the **topmost** dialog a `Toaster`
4182
4194
  * should render into.
4183
- * - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else the first
4195
+ * - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else (unless
4196
+ * `focusFirstControl: false`, which focuses the dialog itself instead) the first
4184
4197
  * meaningful control (never the close button — see `firstMeaningfulControl` above), else the close
4185
4198
  * button itself as a last resort, else whatever the platform already focused. Opened by a tap or
4186
4199
  * click, the dialog focuses itself instead unless that target is a text field or marked
@@ -4227,7 +4240,12 @@ function useDialog(options) {
4227
4240
  function focusInitial() {
4228
4241
  const el = dialog.value;
4229
4242
  if (el === null) return;
4230
- const target = options.initialFocus?.value ?? autofocusControl(el) ?? firstMeaningfulControl(el) ?? el.querySelector("[data-part=\"close\"]");
4243
+ const named = options.initialFocus?.value ?? autofocusControl(el);
4244
+ if (named == null && options.focusFirstControl === false) {
4245
+ focusSurface(el);
4246
+ return;
4247
+ }
4248
+ const target = named ?? firstMeaningfulControl(el) ?? el.querySelector("[data-part=\"close\"]");
4231
4249
  if (lastInputWasPointer && !takesFocusOnTap(target)) {
4232
4250
  focusSurface(el);
4233
4251
  return;
@@ -4403,6 +4421,7 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
4403
4421
  dialog: dialogEl,
4404
4422
  dismissable: () => props.dismissable,
4405
4423
  closeOnEscape: () => props.closeOnEscape,
4424
+ focusFirstControl: false,
4406
4425
  onCancel: () => emit("cancel")
4407
4426
  });
4408
4427
  /**