@uni-design-system/uni-angular 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,9 +25,23 @@ declare function resolveFocusTarget(element: HTMLElement): HTMLElement;
25
25
  /**
26
26
  * Visually hides content while keeping it available to screen readers.
27
27
  * Use for text alternatives (e.g. badge counts, icon-only affordances).
28
+ *
29
+ * `fixed`, not `absolute`, and that is load-bearing. An absolutely positioned
30
+ * box resolves its containing block to the nearest *positioned* ancestor —
31
+ * which, since the controls emitting these spans are `position: static`, is
32
+ * whatever positioned box happens to be above them in the consumer's layout,
33
+ * often several scroll containers up. The span then skips every intervening
34
+ * `overflow: auto` and lands in that distant ancestor's scrollable overflow,
35
+ * turning 1x1 of invisible text into real scrollable distance in a box that
36
+ * never opted into scrolling. A fixed box's containing block is the viewport,
37
+ * so it joins no ancestor's scrollable overflow at all.
38
+ *
39
+ * Caveat: inside a `transform`ed (or `filter`ed/`contain`ed) ancestor a fixed
40
+ * box re-anchors to that ancestor. Harmless here — the element is 1x1 and
41
+ * clipped to nothing, so where it lands never matters, only what it overflows.
28
42
  */
29
43
  declare const visuallyHidden: {
30
- readonly position: "absolute";
44
+ readonly position: "fixed";
31
45
  readonly width: 1;
32
46
  readonly height: 1;
33
47
  readonly padding: 0;
@@ -539,6 +553,15 @@ interface PressRepeatConfig {
539
553
  onRelease?: (repeated: boolean) => void;
540
554
  /** Consulted on press; a disabled button must not start a run. */
541
555
  disabled?: () => boolean;
556
+ /**
557
+ * Put focus where it belongs for this control — normally its text field, the
558
+ * way a native spinner does. Called on press, because taking pointer capture
559
+ * means preventing the default, which would otherwise leave focus nowhere.
560
+ *
561
+ * Receives the pressed button, as a fallback for controls with no field to
562
+ * focus.
563
+ */
564
+ focus?: (button: HTMLElement | null) => void;
542
565
  /**
543
566
  * When this returns `false`, a press steps exactly once and the repeat timer
544
567
  * is never armed — `onRelease` still fires, with `repeated: false`. Lets a
@@ -1182,7 +1205,7 @@ declare class UniCheckboxComponent extends BaseComponent<UniCheckboxOptions> imp
1182
1205
  readonly touched: _angular_core.ModelSignal<boolean>;
1183
1206
  readonly invalid: _angular_core.InputSignal<boolean>;
1184
1207
  readonly dirty: _angular_core.InputSignal<boolean>;
1185
- /** Synced from required() validators by the Signal Forms [field] directive. */
1208
+ /** Synced from required() validators by the Signal Forms [formField] directive. */
1186
1209
  readonly required: _angular_core.InputSignal<boolean>;
1187
1210
  /**
1188
1211
  * Id(s) of external element(s) describing this control — typically your
@@ -1648,7 +1671,7 @@ declare class UniInputComponent implements FormValueControl<string> {
1648
1671
  readonly touched: _angular_core.ModelSignal<boolean>;
1649
1672
  readonly invalid: _angular_core.InputSignal<boolean>;
1650
1673
  readonly dirty: _angular_core.InputSignal<boolean>;
1651
- /** Synced from required() validators by the Signal Forms [field] directive. */
1674
+ /** Synced from required() validators by the Signal Forms [formField] directive. */
1652
1675
  readonly required: _angular_core.InputSignal<boolean>;
1653
1676
  /**
1654
1677
  * Id(s) of external element(s) describing this control — typically your
@@ -1871,7 +1894,7 @@ declare class UniMultiSelectDropdownComponent<T = unknown> extends BaseComponent
1871
1894
  readonly touched: _angular_core.ModelSignal<boolean>;
1872
1895
  readonly invalid: _angular_core.InputSignal<boolean>;
1873
1896
  readonly dirty: _angular_core.InputSignal<boolean>;
1874
- /** Synced from required() validators by the Signal Forms [field] directive. */
1897
+ /** Synced from required() validators by the Signal Forms [formField] directive. */
1875
1898
  readonly required: _angular_core.InputSignal<boolean>;
1876
1899
  /**
1877
1900
  * Id(s) of external element(s) describing this control — typically your
@@ -1986,7 +2009,7 @@ declare class UniRadioComponent extends BaseComponent<UniRadioOptions> implement
1986
2009
  readonly touched: _angular_core.ModelSignal<boolean>;
1987
2010
  readonly invalid: _angular_core.InputSignal<boolean>;
1988
2011
  readonly dirty: _angular_core.InputSignal<boolean>;
1989
- /** Synced from required() validators by the Signal Forms [field] directive. */
2012
+ /** Synced from required() validators by the Signal Forms [formField] directive. */
1990
2013
  readonly required: _angular_core.InputSignal<boolean>;
1991
2014
  /**
1992
2015
  * Id(s) of external element(s) describing this control — typically your
@@ -2124,7 +2147,7 @@ declare class UniSelectComponent<T> implements FormValueControl<T | null> {
2124
2147
  readonly touched: _angular_core.ModelSignal<boolean>;
2125
2148
  readonly invalid: _angular_core.InputSignal<boolean>;
2126
2149
  readonly dirty: _angular_core.InputSignal<boolean>;
2127
- /** Synced from required() validators by the Signal Forms [field] directive. */
2150
+ /** Synced from required() validators by the Signal Forms [formField] directive. */
2128
2151
  readonly required: _angular_core.InputSignal<boolean>;
2129
2152
  /**
2130
2153
  * Id(s) of external element(s) describing this control — typically your
@@ -2805,11 +2828,11 @@ declare class UniNumberRangeInputComponent extends BaseComponent<UniNumberRangeI
2805
2828
  /**
2806
2829
  * Theme-level options for `uni-quantity-stepper`.
2807
2830
  *
2808
- * Unlike the other numeric controls this does **not** inherit the shared
2809
- * `input` chrome it is not a field, has no label and no error border — so it
2810
- * carries its own container tokens. They default to the same values `input`
2811
- * uses, so a cart stepper and a form field look related out of the box, and a
2812
- * theme can part them without editing every field.
2831
+ * It is not a field no label, no error border, no `uni-input-box` — but it
2832
+ * sits beside fields in carts and table rows, so its container **defaults to
2833
+ * the shared `input` chrome**: colour, border, radius and the focus indicator
2834
+ * all follow whatever a theme does to its fields. The options below are
2835
+ * per-component overrides, for parting them deliberately.
2813
2836
  *
2814
2837
  * Height comes from the `sizes` block (`sm` 24 / `md` 32 / `lg` 40) rather than
2815
2838
  * an option, and it is the *outer* height, so an `md` stepper lines up with a
@@ -2818,8 +2841,11 @@ declare class UniNumberRangeInputComponent extends BaseComponent<UniNumberRangeI
2818
2841
  * and is therefore the dense desktop option.
2819
2842
  */
2820
2843
  interface UniQuantityStepperOptions {
2844
+ /** Container fill. Unset — the default — takes `input`'s. */
2821
2845
  color?: ContainerColorToken;
2846
+ /** Frame, and the rules either side of the value. Unset takes `input`'s. */
2822
2847
  border?: Border;
2848
+ /** Corner radius. Unset takes `input`'s. */
2823
2849
  borderRadius?: Radius;
2824
2850
  /**
2825
2851
  * Colour override for the rules between the buttons and the value. Unset —
@@ -2834,7 +2860,12 @@ interface UniQuantityStepperOptions {
2834
2860
  deleteIcon?: IconName;
2835
2861
  /** `font-variant-numeric: tabular-nums`, so held stepping does not jitter. */
2836
2862
  tabularNumerals?: boolean;
2837
- /** Minimum width of the value, e.g. `'3ch'`. Stops a step reflowing the row. */
2863
+ /**
2864
+ * Floor for the value cell, e.g. `'3ch'` — headroom so stepping 9 → 10 does
2865
+ * not reflow the row. Beyond it the cell grows with the digits, because the
2866
+ * input is sized from its content rather than the browser's 20-character
2867
+ * default.
2868
+ */
2838
2869
  valueWidth?: string | number;
2839
2870
  }
2840
2871
 
@@ -2929,7 +2960,12 @@ declare class UniQuantityStepperComponent extends BaseComponent<UniQuantityStepp
2929
2960
  protected readonly decrement: _uni_design_system_uni_angular.PressRepeat;
2930
2961
  protected onKeydown(event: KeyboardEvent): void;
2931
2962
  protected onBlur(): void;
2932
- protected focusField(): void;
2963
+ /**
2964
+ * Focus the field a stepper press should land in. With `editable=false` there
2965
+ * is no field and the buttons are the tab stops, so the pressed button takes
2966
+ * it instead.
2967
+ */
2968
+ protected focusField(fallback?: HTMLElement | null): void;
2933
2969
  protected readonly className: _angular_core.Signal<string>;
2934
2970
  /** Overall height, from the theme's `sizes` block. */
2935
2971
  private readonly height;
@@ -2943,8 +2979,30 @@ declare class UniQuantityStepperComponent extends BaseComponent<UniQuantityStepp
2943
2979
  protected readonly rootClass: _angular_core.Signal<string>;
2944
2980
  /** Square at the field height, so the pointer target is legal at every size. */
2945
2981
  protected readonly buttonClass: _angular_core.Signal<string>;
2982
+ /**
2983
+ * Container chrome, defaulting to the shared `input` entry rather than to
2984
+ * hardcoded tokens. It is not a field, but it sits beside them in carts and
2985
+ * table rows, so a theme that restyles `input` must carry it along — the
2986
+ * options below stay as per-component overrides for a deliberately different
2987
+ * look.
2988
+ */
2989
+ private readonly containerColor;
2990
+ private readonly containerBorder;
2991
+ private readonly containerRadius;
2946
2992
  /** The rules either side of the value, matching the frame around it. */
2947
2993
  private readonly dividerBorder;
2994
+ /**
2995
+ * Characters the value cell asks the browser to size itself for.
2996
+ *
2997
+ * Load-bearing: a bare `<input>` defaults to `size="20"`, and `flex-basis:
2998
+ * auto` resolves to that intrinsic width — so the control claimed ~230px
2999
+ * instead of the ~100px its buttons and `valueWidth` need, and stole track
3000
+ * width from anything beside it in a grid (`1fr` is `minmax(auto, 1fr)`, and
3001
+ * the `auto` floor includes this). Tracking the content keeps the cell honest
3002
+ * while still letting it grow with the digits, which a fixed `width` would
3003
+ * not. `valueWidth` remains the floor, via `min-width`.
3004
+ */
3005
+ protected readonly valueSize: _angular_core.Signal<number>;
2948
3006
  private valueBase;
2949
3007
  protected readonly inputClass: _angular_core.Signal<string>;
2950
3008
  /** Read-only presentation: centred text on the same grid as the input. */
@@ -3141,7 +3199,7 @@ declare class UniTextareaComponent implements FormValueControl<string> {
3141
3199
  readonly touched: _angular_core.ModelSignal<boolean>;
3142
3200
  readonly invalid: _angular_core.InputSignal<boolean>;
3143
3201
  readonly dirty: _angular_core.InputSignal<boolean>;
3144
- /** Synced from required() validators by the Signal Forms [field] directive. */
3202
+ /** Synced from required() validators by the Signal Forms [formField] directive. */
3145
3203
  readonly required: _angular_core.InputSignal<boolean>;
3146
3204
  /**
3147
3205
  * Id(s) of external element(s) describing this control — typically your
@@ -3282,13 +3340,26 @@ declare class UniTimeInputComponent extends BaseComponent<UniTimeInputOptions> i
3282
3340
 
3283
3341
  interface UniToggleOptions {
3284
3342
  /**
3285
- * The size of the toggle switch
3343
+ * @deprecated Track height in px, from before the toggle had a `sizes` block.
3344
+ * Still honoured — and still wins when set, since a theme carrying it opted
3345
+ * into the old derived-ratio geometry (width = 2x, knob = 0.8x) — but it
3346
+ * applies to every instance regardless of the `size` input. Prefer the
3347
+ * theme's `toggle.sizes` block, which gives each size token its own
3348
+ * `width` / `height` / `padding`.
3286
3349
  */
3287
3350
  size?: number;
3288
3351
  /** Off-state track color token. */
3289
3352
  trackColor?: ColorKey;
3290
3353
  /** Knob color token. */
3291
3354
  knobColor?: ColorKey;
3355
+ /**
3356
+ * Checked-state track color token. Falls back to the instance's `variant`,
3357
+ * which is where this color lived before it had a theme home. The matching
3358
+ * `checkedColor` input overrides it per instance.
3359
+ */
3360
+ checkedColor?: ColorKey;
3361
+ /** Motion token for the knob slide and track color change. */
3362
+ motion?: Motion;
3292
3363
  }
3293
3364
 
3294
3365
  declare class UniToggleComponent extends BaseComponent<UniToggleOptions> implements FormCheckboxControl {
@@ -3297,7 +3368,7 @@ declare class UniToggleComponent extends BaseComponent<UniToggleOptions> impleme
3297
3368
  readonly touched: _angular_core.ModelSignal<boolean>;
3298
3369
  readonly invalid: _angular_core.InputSignal<boolean>;
3299
3370
  readonly dirty: _angular_core.InputSignal<boolean>;
3300
- /** Synced from required() validators by the Signal Forms [field] directive. */
3371
+ /** Synced from required() validators by the Signal Forms [formField] directive. */
3301
3372
  readonly required: _angular_core.InputSignal<boolean>;
3302
3373
  /**
3303
3374
  * Id(s) of external element(s) describing this control — typically your
@@ -3305,15 +3376,37 @@ declare class UniToggleComponent extends BaseComponent<UniToggleOptions> impleme
3305
3376
  */
3306
3377
  readonly ariaDescribedBy: _angular_core.InputSignal<string>;
3307
3378
  readonly label: _angular_core.InputSignal<string>;
3379
+ /**
3380
+ * Checked-state track color token, overriding the theme's
3381
+ * `toggle.behavior.checkedColor`.
3382
+ *
3383
+ * This exists alongside the theme option because `variant` — where this color
3384
+ * used to live exclusively — defaults to `'primary'`, so the component cannot
3385
+ * tell "set to primary" from "not set". Without an input, a theme-level
3386
+ * `checkedColor` would silently make per-instance `variant` inert.
3387
+ */
3388
+ readonly checkedColor: _angular_core.InputSignal<string>;
3308
3389
  protected readonly showError: _angular_core.Signal<boolean>;
3309
3390
  markAsTouched(): void;
3310
3391
  handleChange(event: Event): void;
3392
+ /**
3393
+ * Track and knob geometry for the active `size`, read out of the theme's
3394
+ * `sizes` block as data — `width`, `height` and the knob's inset `padding`.
3395
+ *
3396
+ * Read rather than spread: `padding` must not reach the track as real CSS or
3397
+ * it would double up with the knob's own `top`/`left` offsets. `uni-calendar`
3398
+ * treats its size block the same way.
3399
+ */
3311
3400
  private readonly metrics;
3401
+ /** The resolved checked/accent color: input, then theme option, then variant. */
3402
+ private readonly accent;
3403
+ /** Knob slide and track color change, as a motion token — never `all`. */
3404
+ private readonly transitions;
3312
3405
  protected readonly toggleLabel: _angular_core.Signal<string>;
3313
3406
  protected readonly toggleInput: _angular_core.Signal<string>;
3314
3407
  getThemeColor(token: ColorToken): string;
3315
3408
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UniToggleComponent, never>;
3316
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniToggleComponent, "uni-toggle", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "dirty": { "alias": "dirty"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "touched": "touchedChange"; }, never, never, true, never>;
3409
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniToggleComponent, "uni-toggle", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "dirty": { "alias": "dirty"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "checkedColor": { "alias": "checkedColor"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "touched": "touchedChange"; }, never, never, true, never>;
3317
3410
  }
3318
3411
 
3319
3412
  /**
@@ -4078,10 +4171,147 @@ declare class UniDividerComponent {
4078
4171
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniDividerComponent, "uni-divider", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "border": { "alias": "border"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
4079
4172
  }
4080
4173
 
4174
+ /**
4175
+ * Theme-level options for the drawer's pinned footer action row. Inputs on the
4176
+ * component override these per instance; the theme sets the default posture.
4177
+ *
4178
+ * Mirrors `UniDialogButtonsOptions` knob for knob, with a panel's posture
4179
+ * rather than a dialog's: trailing actions instead of centered ones, and a
4180
+ * divider against the scrolling body above.
4181
+ */
4182
+ interface UniDrawerButtonsOptions {
4183
+ /** Space between the action buttons, as a spacing token. */
4184
+ gap?: NullableSize;
4185
+ /** Padding around the row, as a spacing token. */
4186
+ padding?: NullableSize;
4187
+ justifyContent?: JustifyContent;
4188
+ confirmButtonVariant?: Variant;
4189
+ cancelButtonVariant?: Variant;
4190
+ /** Size passed to both buttons. */
4191
+ buttonSize?: Size;
4192
+ /** Rule separating the footer from the scrolling body, as a border primitive. */
4193
+ divider?: Border;
4194
+ /** When true the two actions share the full row width as equal halves. */
4195
+ stretch?: boolean;
4196
+ /** Render cancel before confirm (confirm ends up on the trailing edge). */
4197
+ reverseOrder?: boolean;
4198
+ }
4199
+
4200
+ /**
4201
+ * The drawer's pinned footer action row — the save bar of an editor panel.
4202
+ *
4203
+ * Sits outside the scrolling body, so the actions stay reachable however long
4204
+ * the form is. Mirrors `[dialog-buttons]`; the difference is posture, which
4205
+ * lives in the `drawerButtons` theme options rather than here.
4206
+ */
4207
+ declare class UniDrawerButtonsComponent extends BaseComponent<UniDrawerButtonsOptions> {
4208
+ private readonly drawer;
4209
+ confirmButtonText: _angular_core.InputSignal<string>;
4210
+ confirmButtonVariant: _angular_core.InputSignal<Variant>;
4211
+ cancelButtonText: _angular_core.InputSignal<string>;
4212
+ cancelButtonVariant: _angular_core.InputSignal<Variant>;
4213
+ disableConfirm: _angular_core.InputSignal<boolean>;
4214
+ padding: _angular_core.InputSignal<NullableSize>;
4215
+ justifyContent: _angular_core.InputSignal<JustifyContent>;
4216
+ confirmed: _angular_core.OutputEmitterRef<void>;
4217
+ protected confirmVariant: _angular_core.Signal<Variant>;
4218
+ protected cancelVariant: _angular_core.Signal<Variant>;
4219
+ protected paddingValue: _angular_core.Signal<NullableSize>;
4220
+ protected justifyContentValue: _angular_core.Signal<JustifyContent>;
4221
+ protected gapValue: _angular_core.Signal<NullableSize>;
4222
+ protected buttonSize: _angular_core.Signal<Size>;
4223
+ /** A pinned row, sized by its content rather than by the body beside it. */
4224
+ protected readonly hostClass: _angular_core.Signal<string>;
4225
+ protected readonly className: _angular_core.Signal<string>;
4226
+ /**
4227
+ * Cancel routes through the drawer's own close decision, so a panel with
4228
+ * unsaved changes can veto it exactly as it vetoes Escape.
4229
+ */
4230
+ protected closeDrawer(): void;
4231
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UniDrawerButtonsComponent, never>;
4232
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniDrawerButtonsComponent, "[uni-drawer-buttons], [drawer-buttons]", never, { "confirmButtonText": { "alias": "confirmButtonText"; "required": false; "isSignal": true; }; "confirmButtonVariant": { "alias": "confirmButtonVariant"; "required": false; "isSignal": true; }; "cancelButtonText": { "alias": "cancelButtonText"; "required": false; "isSignal": true; }; "cancelButtonVariant": { "alias": "cancelButtonVariant"; "required": false; "isSignal": true; }; "disableConfirm": { "alias": "disableConfirm"; "required": false; "isSignal": true; }; "padding": { "alias": "padding"; "required": false; "isSignal": true; }; "justifyContent": { "alias": "justifyContent"; "required": false; "isSignal": true; }; }, { "confirmed": "confirmed"; }, never, never, true, never>;
4233
+ }
4234
+
4235
+ /**
4236
+ * Theme-level options for the drawer's pinned header row. Deliberately a
4237
+ * separate entry from `dialogHeader`: the two rows look alike but read
4238
+ * differently — a panel headline labels a region beside the page, where a
4239
+ * dialog's titles an interruption — so they want different defaults.
4240
+ */
4241
+ interface UniDrawerHeaderOptions {
4242
+ /** Row surface. Undefined inherits the drawer's own surface. */
4243
+ color?: ContainerColorToken;
4244
+ /** Fixed row height in px. */
4245
+ height?: number;
4246
+ /** Padding around the row, as a spacing token. */
4247
+ padding?: NullableSize;
4248
+ textRole?: TextRole;
4249
+ textColor?: ContentColorToken;
4250
+ textAlign?: 'left' | 'center' | 'right';
4251
+ /** Rule separating the header from the scrolling body, as a border primitive. */
4252
+ divider?: Border;
4253
+ closeButtonIcon?: IconName;
4254
+ closeButtonSymbol?: string;
4255
+ closeButtonSize?: Size;
4256
+ }
4257
+
4258
+ /**
4259
+ * The drawer's pinned header row: a title, and optionally a close button.
4260
+ *
4261
+ * Sits outside the scrolling body, so it stays put while the form beneath it
4262
+ * moves. Reached either by projecting it — `<div uni-drawer-header>` — or
4263
+ * implicitly, by giving `uni-drawer` a `headline`, in which case the drawer
4264
+ * renders one of these itself.
4265
+ */
4266
+ declare class UniDrawerHeaderComponent extends BaseComponent<UniDrawerHeaderOptions> {
4267
+ private readonly drawer;
4268
+ /** Title text. Falls back to the drawer's `headline`; projected content wins over both. */
4269
+ headline: _angular_core.InputSignal<string>;
4270
+ /** Attached to the title so the drawer is labelled by it. */
4271
+ protected readonly titleId: string;
4272
+ protected readonly title: _angular_core.Signal<string>;
4273
+ protected readonly showClose: _angular_core.Signal<boolean>;
4274
+ constructor();
4275
+ /** Never a bare close: the drawer decides, so a veto is honoured here too. */
4276
+ protected closeDrawer(): void;
4277
+ protected readonly className: _angular_core.Signal<string>;
4278
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UniDrawerHeaderComponent, never>;
4279
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniDrawerHeaderComponent, "[uni-drawer-header]", never, { "headline": { "alias": "headline"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
4280
+ }
4281
+
4081
4282
  /** How the drawer coexists with page content. */
4082
4283
  type DrawerMode = 'side' | 'over';
4083
4284
  /** Which edge the drawer attaches to (logical: start = left in LTR). */
4084
4285
  type DrawerPosition = 'start' | 'end';
4286
+ /** Surface treatment of the panel behind its content. */
4287
+ type DrawerBackground = 'solid' | 'glass' | 'gradient';
4288
+ /** Why the drawer is asking to close. */
4289
+ type DrawerCloseReason = 'close-button' | 'escape' | 'backdrop';
4290
+ /**
4291
+ * Emitted by `closeRequest` before the drawer closes. The drawer is *asking*;
4292
+ * with `disableAutoClose` set it will not act on its own, leaving the consumer
4293
+ * free to run an async confirmation and set `open` when it resolves.
4294
+ */
4295
+ interface UniDrawerCloseRequest {
4296
+ reason: DrawerCloseReason;
4297
+ }
4298
+ /**
4299
+ * The slice of the drawer its header and footer rows need.
4300
+ *
4301
+ * A token rather than the component class on purpose: the drawer renders a
4302
+ * `[uni-drawer-header]` itself when given a `headline`, so importing the
4303
+ * component class in both directions would be a cycle.
4304
+ */
4305
+ interface UniDrawerPanel {
4306
+ readonly headline: Signal<string | undefined>;
4307
+ readonly defaultCloseButton: Signal<boolean>;
4308
+ readonly titleId: string;
4309
+ readonly hasHeader: {
4310
+ set(value: boolean): void;
4311
+ };
4312
+ requestClose(reason: DrawerCloseReason): void;
4313
+ }
4314
+ declare const DRAWER_PANEL: InjectionToken<UniDrawerPanel>;
4085
4315
  /** Theme-level options for `uni-drawer`, resolved by token name. */
4086
4316
  interface UniDrawerOptions {
4087
4317
  /** Panel surface color token (with its paired on-color). */
@@ -4090,16 +4320,27 @@ interface UniDrawerOptions {
4090
4320
  width?: number;
4091
4321
  /** Edge rule separating a side drawer from content, as a border primitive. */
4092
4322
  divider?: Border;
4093
- /** Elevation shadow token for the overlay mode. */
4323
+ /** Elevation shadow token. Overlay mode only see `background`. */
4094
4324
  elevation?: Elevation;
4095
- /** Inner padding, as a spacing token. */
4325
+ /**
4326
+ * Inner padding of the *body* row, as a spacing token. The panel itself is
4327
+ * unpadded so that header and footer rows can pin flush to its edges.
4328
+ */
4096
4329
  padding?: OptionalSize;
4097
- /** Backdrop styling for the overlay mode. */
4330
+ /** Backdrop styling for the overlay mode. Ignored when `scrim` is false. */
4098
4331
  backdrop?: StyleExpression;
4332
+ /**
4333
+ * Whether the overlay mode dims the page behind it. False leaves
4334
+ * `::backdrop` transparent — the drawer still traps focus and is still
4335
+ * modal, it simply does not darken what it covers.
4336
+ */
4337
+ scrim?: boolean;
4338
+ /** Surface treatment of the panel. */
4339
+ background?: DrawerBackground;
4099
4340
  }
4100
4341
 
4101
4342
  /**
4102
- * Navigation drawer with two modes sharing one content slot:
4343
+ * Drawer with two modes sharing one three-row layout:
4103
4344
  *
4104
4345
  * - `side` — an in-flow `<aside>` that pushes content (dashboard sidenav);
4105
4346
  * opening/closing animates its width, and the divider border primitive
@@ -4108,19 +4349,86 @@ interface UniDrawerOptions {
4108
4349
  * scrim backdrop come from the platform (same machinery as `uni-dialog`),
4109
4350
  * sliding in from its edge.
4110
4351
  *
4111
- * Surface, width, divider, elevation, padding and backdrop all resolve from
4112
- * `drawer` theme tokens.
4352
+ * **The panel is never the scroll container.** It is a flex column of three
4353
+ * rows — an optional `[uni-drawer-header]`, the projected body, an optional
4354
+ * `[uni-drawer-buttons]` — and only the body scrolls. The panel itself is
4355
+ * `overflow: clip` on both axes. That is what lets a header and a save bar pin
4356
+ * while a long form scrolls between them, and it is why the theme's `padding`
4357
+ * option lands on the body row rather than the panel: padding on a scrolling
4358
+ * box scrolls away with its content.
4359
+ *
4360
+ * Surface, width, divider, elevation, padding, backdrop, scrim and background
4361
+ * all resolve from `drawer` theme tokens.
4113
4362
  */
4114
4363
  declare class UniDrawerComponent extends BaseComponent<UniDrawerOptions> {
4115
4364
  /** Two-way bindable open state: [(open)]. */
4116
4365
  readonly open: _angular_core.ModelSignal<boolean>;
4117
4366
  mode: _angular_core.InputSignal<DrawerMode>;
4118
4367
  position: _angular_core.InputSignal<DrawerPosition>;
4119
- /** Accessible name for the overlay mode's dialog. */
4368
+ /**
4369
+ * Accessible name for the overlay mode. Only consulted when the drawer has
4370
+ * no header to be labelled by.
4371
+ *
4372
+ * There is deliberately no default. A drawer used as an editor panel that
4373
+ * inherited the literal "Navigation" would announce itself as something it
4374
+ * is not, and a wrong accessible name is worse than a missing one — the
4375
+ * missing one is at least caught by any audit.
4376
+ */
4120
4377
  ariaLabel: _angular_core.InputSignal<string>;
4121
- protected readonly contentTemplate: _angular_core.Signal<TemplateRef<unknown>>;
4378
+ /**
4379
+ * Title for the drawer's header row. Shorthand for projecting a
4380
+ * `[uni-drawer-header]`; project one instead when the header needs more
4381
+ * than a title (a record counter, prev/next navigation).
4382
+ */
4383
+ headline: _angular_core.InputSignal<string>;
4384
+ /** Whether the header row renders a close button. */
4385
+ defaultCloseButton: _angular_core.InputSignal<boolean>;
4386
+ /** Panel width in px, overriding the theme's `drawer.behavior.width`. */
4387
+ width: _angular_core.InputSignal<number>;
4388
+ /**
4389
+ * Whether the overlay dims the page behind it, overriding the theme's
4390
+ * `drawer.behavior.scrim`. False leaves the backdrop transparent so the page
4391
+ * stays legible while the panel is open — an editor panel beside a board the
4392
+ * user is still reading.
4393
+ *
4394
+ * This does not make the drawer non-modal: focus is still trapped and the
4395
+ * page behind is still inert. It is a visibility choice, not a modality one.
4396
+ */
4397
+ scrim: _angular_core.InputSignal<boolean>;
4398
+ /**
4399
+ * CSS selector for the element to focus when the overlay opens. The native
4400
+ * default is the first focusable element, which in an editor panel is
4401
+ * usually the close button rather than the first field.
4402
+ */
4403
+ initialFocus: _angular_core.InputSignal<string>;
4404
+ /**
4405
+ * The drawer is *asking* to close — Escape, the backdrop, or a close/cancel
4406
+ * button. Pair with `disableAutoClose` to hold the panel open while an async
4407
+ * confirmation runs.
4408
+ */
4409
+ closeRequest: _angular_core.OutputEmitterRef<UniDrawerCloseRequest>;
4410
+ /**
4411
+ * When true the drawer never closes itself; it only emits `closeRequest` and
4412
+ * waits for the consumer to set `open`. Off by default, so a drawer that
4413
+ * ignores `closeRequest` behaves exactly as it always has.
4414
+ */
4415
+ disableAutoClose: _angular_core.InputSignal<boolean>;
4416
+ /** Set by a projected `[uni-drawer-header]` so it can pin flush to the top. */
4417
+ readonly hasHeader: _angular_core.WritableSignal<boolean>;
4418
+ /** Id referenced by aria-labelledby; the header row attaches it to its title. */
4419
+ readonly titleId: string;
4420
+ protected readonly labelledBy: _angular_core.Signal<string>;
4421
+ protected readonly headerTemplate: _angular_core.Signal<TemplateRef<unknown>>;
4422
+ protected readonly bodyTemplate: _angular_core.Signal<TemplateRef<unknown>>;
4423
+ protected readonly footerTemplate: _angular_core.Signal<TemplateRef<unknown>>;
4122
4424
  private readonly overlay;
4123
4425
  constructor();
4426
+ /**
4427
+ * The one place a close is decided, so every route in — Escape, the
4428
+ * backdrop, the header's close button, the footer's cancel — behaves
4429
+ * identically and is equally vetoable.
4430
+ */
4431
+ requestClose(reason: DrawerCloseReason): void;
4124
4432
  protected onBackdropClick(event: Event): void;
4125
4433
  /** Route Escape through the animated close, keeping `open` in sync. */
4126
4434
  protected onCancel(event: Event): void;
@@ -4128,10 +4436,23 @@ declare class UniDrawerComponent extends BaseComponent<UniDrawerOptions> {
4128
4436
  private readonly edge;
4129
4437
  private readonly slideIn;
4130
4438
  private readonly slideOut;
4439
+ /** Input wins over the theme option; the literal is the last-resort default. */
4440
+ private readonly panelWidth;
4441
+ private readonly showScrim;
4442
+ /**
4443
+ * The panel's surface. `solid` is the plain color pair; `glass` and
4444
+ * `gradient` derive from it, so a theme swaps treatment without restating
4445
+ * the color.
4446
+ */
4447
+ private readonly surface;
4448
+ /** The shared flex column: three rows, and never a scroll container itself. */
4449
+ private readonly shell;
4131
4450
  protected readonly sideClass: _angular_core.Signal<string>;
4132
4451
  protected readonly overClass: _angular_core.Signal<string>;
4452
+ /** The only scrolling row, and the only padded one. */
4453
+ protected readonly bodyClass: _angular_core.Signal<string>;
4133
4454
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UniDrawerComponent, never>;
4134
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniDrawerComponent, "uni-drawer", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, ["*"], true, never>;
4455
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniDrawerComponent, "uni-drawer", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "headline": { "alias": "headline"; "required": false; "isSignal": true; }; "defaultCloseButton": { "alias": "defaultCloseButton"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "scrim": { "alias": "scrim"; "required": false; "isSignal": true; }; "initialFocus": { "alias": "initialFocus"; "required": false; "isSignal": true; }; "disableAutoClose": { "alias": "disableAutoClose"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "closeRequest": "closeRequest"; }, never, ["[uni-drawer-header]", "[uni-drawer-buttons], [drawer-buttons]", "*"], true, never>;
4135
4456
  }
4136
4457
 
4137
4458
  interface UniDropdownOptions {
@@ -5600,5 +5921,5 @@ declare class DragAndDropDirective {
5600
5921
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DragAndDropDirective, "[uni-drag-n-drop], [dragAndDrop]", never, {}, { "fileDropped": "fileDropped"; }, never, never, true, never>;
5601
5922
  }
5602
5923
 
5603
- export { BodyRenderDirective, ConfirmationDialogComponent, DragAndDropDirective, FOCUSABLE_SELECTOR, ListboxNavigation, LocalStorageService, NotificationService, NotificationsComponent, RippleDirective, TRANSFORM_ORIGINS, ThemeService, UNI_FORMS, UNI_LAYOUT, UNI_THEMES, UniAlertComponent, UniAppBarComponent, UniAvatarComponent, UniAvatarGroupComponent, UniBackgroundComponent, UniBadgeComponent, UniBaseDatasource, UniBoxDirective, UniBreadcrumbComponent, UniButtonComponent, UniButtonGroupComponent, UniCalendarComponent, UniCalloutComponent, UniCardComponent, UniCardContentComponent, UniCardHeaderComponent, UniCenterDirective, UniCheckboxComponent, UniComboboxComponent, UniDataSearchComponent, UniDataTableComponent, UniDateInputComponent, UniDateTimeInputComponent, UniDebounceInputComponent, UniDialogButtonsComponent, UniDialogComponent, UniDialogHeaderComponent, UniDividerComponent, UniDrawerComponent, UniDropdownComponent, UniExpandAreaComponent, UniExpandComponent, UniExpandToggleComponent, UniFileDropZoneComponent, UniGridAreaDirective, UniGridDirective, UniIconButtonComponent, UniIconComponent, UniInputBoxComponent, UniInputComponent, UniJsonViewComponent, UniMenuComponent, UniMultiSelectComponent, UniMultiSelectDropdownComponent, UniNotificationBadgeComponent, UniNumberInputComponent, UniNumberRangeInputComponent, UniPaginatorComponent, UniPopoverComponent, UniProgressBarComponent, UniProgressGaugeComponent, UniQuantityStepperComponent, UniRadioComponent, UniRecordDatasource, UniRowDirective, UniScrollAreaComponent, UniSearchInputComponent, UniSelectComponent, UniServerSideDatasource, UniSkeletonComponent, UniSliderComponent, UniSnackbarComponent, UniSortHeaderComponent, UniStackDirective, UniStatComponent, UniSymbolComponent, UniTabComponent, UniTabsComponent, UniTagComponent, UniTagInputComponent, UniTextDirective, UniTextareaComponent, UniThemeBuilderComponent, UniThemeSwitchComponent, UniTimeInputComponent, UniToggleComponent, UniTooltipComponent, UniTourComponent, UniWrapDirective, acceptableFile, addDays, addMonths, anchorArrowStyles, anchorStyles, buildMonthGrid, clampDecimal, clearAnchorName, compareDecimal, createAnnouncer, createListboxNavigation, createPressRepeat, dayOfWeek, daysInMonth, decimalScale, discreteOverlayTransition, evaluateExpression, focusableElements, formatDate, formatMonthHeading, formatNumber, formatTime, fromScaled, getFileExtension, inclusiveDayCount, isCanonicalDecimal, isDivider, isToggleOpen, isValidDate, isoDate, joinDateTime, listboxPopupAttr, listboxPopupStyles, localeDatePlaceholder, localeDefaultHour12, localeFieldOrder, localeMonthNames, localeNumberParts, localeWeekStart, losesPrecision, monthOf, motionSafe, newAnchorName, newListboxAnchor, normalizeDecimal, parseDateText, parseNumber, parseTimeText, promoteListboxPopup, rawNumberText, resolveElement, resolveFocusTarget, resolveNumberFormat, restoreOverlayFocus, roundDecimal, setAnchorName, settleNumber, shiftDecimal, speakNumber, splitDateTime, spotlightStyles, stepDecimal, supportsAnchoredPopup, timeSlots, toAsciiDigits, toDecimal, toNumber, toScaled, todayIso, transformOriginFor, uniqueId, useTimer, visuallyHidden, weekdayNames };
5604
- export type { Alert, AnchorOffset, AnchorRect, Announcer, BrandPaletteConfig, BreadcrumbItem, ButtonGroupConfig, ButtonGroupItem, ColumnDefinition, Confirmation, DataLoader, DrawerMode, DrawerPosition, ImagePosition, ListboxNavigationConfig, MenuDivider, MenuItem, MenuItemWithLabel, MenuItemWithTemplate, Option, Options, PageRequest, PageResponse, Placement, PressRepeat, PressRepeatConfig, PressRepeatTiming, ScrollbarAppearance, SkeletonShape, SkeletonSweepDirection, Snackbar, Sort, SortDirection, SpotlightOptions, SpotlightStyles, UniAppBarOptions, UniAvatarGroupOptions, UniAvatarOptions, UniBreadcrumbOptions, UniCalendarMarker, UniCalendarMode, UniCalendarOptions, UniCalendarValue, UniCalloutDismissal, UniCalloutOptions, UniCheckboxOptions, UniComboboxOptions, UniComboboxRejection, UniDataSearchOptions, UniDataTableOptions, UniDatasource, UniDate, UniDateInputOptions, UniDateInputRejection, UniDateRange, UniDateTime, UniDateTimeInputOptions, UniDrawerOptions, UniExpandOptions, UniInputBoxOptions, UniInputMode, UniInputType, UniListboxPopupOptions, UniLocaleNumberParts, UniMenuItemOptions, UniMenuOptions, UniMonthGridCell, UniMultiSelectDropdownOptions, UniNotificationBadgeOptions, UniNumberClamp, UniNumberFormatConfig, UniNumberGrouping, UniNumberInputOptions, UniNumberParseResult, UniNumberPreset, UniNumberRange, UniNumberRangeInputOptions, UniNumberRangePart, UniNumberRangeRejection, UniNumberRejectReason, UniNumberRejection, UniNumberStepConfig, UniNumberStepped, UniPaginatorOptions, UniPopoverOptions, UniQuantityStepperOptions, UniRadioOption, UniRadioOptions, UniResolvedNumberFormat, UniRoundingMode, UniSearchInputOptions, UniSkeletonOptions, UniSliderMark, UniSliderOptions, UniSliderThumb, UniStatOptions, UniStepperLayout, UniTabsOptions, UniTagInputOptions, UniTagItem, UniTagOptions, UniTagRejection, UniTagSuggestion, UniTagValue, UniTextareaOptions, UniTime, UniTimeInputOptions, UniTimeInputRejection, UniToggleOptions, UniTourAdvance, UniTourOptions, UniTourStep, UniWeekdayName };
5924
+ export { BodyRenderDirective, ConfirmationDialogComponent, DRAWER_PANEL, DragAndDropDirective, FOCUSABLE_SELECTOR, ListboxNavigation, LocalStorageService, NotificationService, NotificationsComponent, RippleDirective, TRANSFORM_ORIGINS, ThemeService, UNI_FORMS, UNI_LAYOUT, UNI_THEMES, UniAlertComponent, UniAppBarComponent, UniAvatarComponent, UniAvatarGroupComponent, UniBackgroundComponent, UniBadgeComponent, UniBaseDatasource, UniBoxDirective, UniBreadcrumbComponent, UniButtonComponent, UniButtonGroupComponent, UniCalendarComponent, UniCalloutComponent, UniCardComponent, UniCardContentComponent, UniCardHeaderComponent, UniCenterDirective, UniCheckboxComponent, UniComboboxComponent, UniDataSearchComponent, UniDataTableComponent, UniDateInputComponent, UniDateTimeInputComponent, UniDebounceInputComponent, UniDialogButtonsComponent, UniDialogComponent, UniDialogHeaderComponent, UniDividerComponent, UniDrawerButtonsComponent, UniDrawerComponent, UniDrawerHeaderComponent, UniDropdownComponent, UniExpandAreaComponent, UniExpandComponent, UniExpandToggleComponent, UniFileDropZoneComponent, UniGridAreaDirective, UniGridDirective, UniIconButtonComponent, UniIconComponent, UniInputBoxComponent, UniInputComponent, UniJsonViewComponent, UniMenuComponent, UniMultiSelectComponent, UniMultiSelectDropdownComponent, UniNotificationBadgeComponent, UniNumberInputComponent, UniNumberRangeInputComponent, UniPaginatorComponent, UniPopoverComponent, UniProgressBarComponent, UniProgressGaugeComponent, UniQuantityStepperComponent, UniRadioComponent, UniRecordDatasource, UniRowDirective, UniScrollAreaComponent, UniSearchInputComponent, UniSelectComponent, UniServerSideDatasource, UniSkeletonComponent, UniSliderComponent, UniSnackbarComponent, UniSortHeaderComponent, UniStackDirective, UniStatComponent, UniSymbolComponent, UniTabComponent, UniTabsComponent, UniTagComponent, UniTagInputComponent, UniTextDirective, UniTextareaComponent, UniThemeBuilderComponent, UniThemeSwitchComponent, UniTimeInputComponent, UniToggleComponent, UniTooltipComponent, UniTourComponent, UniWrapDirective, acceptableFile, addDays, addMonths, anchorArrowStyles, anchorStyles, buildMonthGrid, clampDecimal, clearAnchorName, compareDecimal, createAnnouncer, createListboxNavigation, createPressRepeat, dayOfWeek, daysInMonth, decimalScale, discreteOverlayTransition, evaluateExpression, focusableElements, formatDate, formatMonthHeading, formatNumber, formatTime, fromScaled, getFileExtension, inclusiveDayCount, isCanonicalDecimal, isDivider, isToggleOpen, isValidDate, isoDate, joinDateTime, listboxPopupAttr, listboxPopupStyles, localeDatePlaceholder, localeDefaultHour12, localeFieldOrder, localeMonthNames, localeNumberParts, localeWeekStart, losesPrecision, monthOf, motionSafe, newAnchorName, newListboxAnchor, normalizeDecimal, parseDateText, parseNumber, parseTimeText, promoteListboxPopup, rawNumberText, resolveElement, resolveFocusTarget, resolveNumberFormat, restoreOverlayFocus, roundDecimal, setAnchorName, settleNumber, shiftDecimal, speakNumber, splitDateTime, spotlightStyles, stepDecimal, supportsAnchoredPopup, timeSlots, toAsciiDigits, toDecimal, toNumber, toScaled, todayIso, transformOriginFor, uniqueId, useTimer, visuallyHidden, weekdayNames };
5925
+ export type { Alert, AnchorOffset, AnchorRect, Announcer, BrandPaletteConfig, BreadcrumbItem, ButtonGroupConfig, ButtonGroupItem, ColumnDefinition, Confirmation, DataLoader, DrawerBackground, DrawerCloseReason, DrawerMode, DrawerPosition, ImagePosition, ListboxNavigationConfig, MenuDivider, MenuItem, MenuItemWithLabel, MenuItemWithTemplate, Option, Options, PageRequest, PageResponse, Placement, PressRepeat, PressRepeatConfig, PressRepeatTiming, ScrollbarAppearance, SkeletonShape, SkeletonSweepDirection, Snackbar, Sort, SortDirection, SpotlightOptions, SpotlightStyles, UniAppBarOptions, UniAvatarGroupOptions, UniAvatarOptions, UniBreadcrumbOptions, UniCalendarMarker, UniCalendarMode, UniCalendarOptions, UniCalendarValue, UniCalloutDismissal, UniCalloutOptions, UniCheckboxOptions, UniComboboxOptions, UniComboboxRejection, UniDataSearchOptions, UniDataTableOptions, UniDatasource, UniDate, UniDateInputOptions, UniDateInputRejection, UniDateRange, UniDateTime, UniDateTimeInputOptions, UniDrawerButtonsOptions, UniDrawerCloseRequest, UniDrawerHeaderOptions, UniDrawerOptions, UniDrawerPanel, UniExpandOptions, UniInputBoxOptions, UniInputMode, UniInputType, UniListboxPopupOptions, UniLocaleNumberParts, UniMenuItemOptions, UniMenuOptions, UniMonthGridCell, UniMultiSelectDropdownOptions, UniNotificationBadgeOptions, UniNumberClamp, UniNumberFormatConfig, UniNumberGrouping, UniNumberInputOptions, UniNumberParseResult, UniNumberPreset, UniNumberRange, UniNumberRangeInputOptions, UniNumberRangePart, UniNumberRangeRejection, UniNumberRejectReason, UniNumberRejection, UniNumberStepConfig, UniNumberStepped, UniPaginatorOptions, UniPopoverOptions, UniQuantityStepperOptions, UniRadioOption, UniRadioOptions, UniResolvedNumberFormat, UniRoundingMode, UniSearchInputOptions, UniSkeletonOptions, UniSliderMark, UniSliderOptions, UniSliderThumb, UniStatOptions, UniStepperLayout, UniTabsOptions, UniTagInputOptions, UniTagItem, UniTagOptions, UniTagRejection, UniTagSuggestion, UniTagValue, UniTextareaOptions, UniTime, UniTimeInputOptions, UniTimeInputRejection, UniToggleOptions, UniTourAdvance, UniTourOptions, UniTourStep, UniWeekdayName };