yukit-web 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npm/_cacache/content-v2/sha512/{5e/11/2c56cc46533cc988b1ad3c5e54316d97d92e480f8908d0cc332e741390cfff7bf152926325fd764bd8473272d85c1ac13198e6aca85480bdceab1d7324b2 → 97/95/180cae43a1622a037d001caebfd6174c0db3281f900accb8a830e81161691cd58358b0a0899edeba66e974ba60fee8b05c00edec773c2d72205f599bb95a} +1 -1
- package/.npm/_cacache/index-v5/64/dc/73c7a26f2e6eb0c711133d96c247da5ecf0eba708cd37c450a7b3c7cb488 +1 -1
- package/.npm/_logs/{2026-09-09T07_40_32_599Z-debug-0.log → 2026-09-10T12_40_42_688Z-debug-0.log} +10 -10
- package/.npm/_logs/{2026-09-09T07_40_33_128Z-debug-0.log → 2026-09-10T12_40_43_244Z-debug-0.log} +2 -2
- package/fesm2022/yukit-web.mjs +246 -18
- package/fesm2022/yukit-web.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/theme/tokens/component-colors.css +16 -0
- package/types/yukit-web.d.ts +239 -5
package/package.json
CHANGED
|
@@ -106,6 +106,14 @@
|
|
|
106
106
|
--input: var(--yuw-accent);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
[data-yuw-color] button.bg-background:not(:disabled):hover {
|
|
110
|
+
--muted: color-mix(in oklab, var(--yuw-accent) 5%, transparent);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[data-yuw-color] button.hover\:text-foreground:not(:disabled):hover {
|
|
114
|
+
--muted: color-mix(in oklab, var(--yuw-accent) 5%, transparent);
|
|
115
|
+
}
|
|
116
|
+
|
|
109
117
|
[data-yuw-color='secondary'] {
|
|
110
118
|
--border: var(--neutrals-outline-accent);
|
|
111
119
|
}
|
|
@@ -156,6 +164,14 @@
|
|
|
156
164
|
--secondary-foreground: var(--neutrals-white);
|
|
157
165
|
}
|
|
158
166
|
|
|
167
|
+
.dark [data-yuw-color] button.bg-background:not(:disabled):hover {
|
|
168
|
+
--muted: color-mix(in oklab, var(--yuw-accent) 50%, transparent) !important;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.dark [data-yuw-color] button.hover\:text-foreground:not(:disabled):hover {
|
|
172
|
+
--muted: color-mix(in oklab, var(--yuw-accent) 50%, transparent) !important;
|
|
173
|
+
}
|
|
174
|
+
|
|
159
175
|
html body yuw-button[data-yuw-color] button:disabled {
|
|
160
176
|
--yuw-accent: var(--neutrals-element-disabled);
|
|
161
177
|
--yuw-accent-foreground: var(--neutrals-white);
|
package/types/yukit-web.d.ts
CHANGED
|
@@ -24,12 +24,14 @@ import * as i1$9 from '@spartan-ng/brain/tooltip';
|
|
|
24
24
|
import { ToastOptions } from '@spartan-ng/brain/sonner';
|
|
25
25
|
export { toast as yuwToast } from '@spartan-ng/brain/sonner';
|
|
26
26
|
import * as i1$a from '@spartan-ng/brain/dialog';
|
|
27
|
+
import { BrnDialogState } from '@spartan-ng/brain/dialog';
|
|
27
28
|
import * as i1$b from '@spartan-ng/brain/alert-dialog';
|
|
28
29
|
import * as i1$c from 'yukit-web/helm/attachment';
|
|
29
30
|
import { HlmAttachmentAction } from 'yukit-web/helm/attachment';
|
|
30
31
|
import { RouterLink } from '@angular/router';
|
|
31
32
|
import * as i1$d from 'yukit-web/helm/sidebar';
|
|
32
33
|
export { HlmSidebarConfig as YuwSidebarConfigDto, HlmSidebarService as YuwSidebarService, SidebarVariant as YuwSidebarServiceVariantDto, provideHlmSidebarConfig as provideYuwSidebarConfig } from 'yukit-web/helm/sidebar';
|
|
34
|
+
import { CommandFilter } from '@spartan-ng/brain/command';
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* Merges class lists the shadcn/Spartan way: `clsx` resolves conditionals/arrays, `twMerge`
|
|
@@ -41,6 +43,37 @@ export { HlmSidebarConfig as YuwSidebarConfigDto, HlmSidebarService as YuwSideba
|
|
|
41
43
|
*/
|
|
42
44
|
declare function cn(...inputs: ClassValue[]): string;
|
|
43
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Applies dynamic classes to an element that is also styled by a helm directive.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* The helm layer owns the `class` attribute through its `classes()` utility, which keeps a
|
|
51
|
+
* registry of *sources* per element and rewrites the attribute whenever any of them changes. It
|
|
52
|
+
* also watches the attribute with a `MutationObserver` and treats every write it did not make
|
|
53
|
+
* itself as consumer-authored *base* classes, which it merges **last** so they win.
|
|
54
|
+
*
|
|
55
|
+
* An Angular `[class]` binding on the same element is exactly such a foreign write, so the first
|
|
56
|
+
* value it emits is captured as a base class and then beats every value the binding emits
|
|
57
|
+
* afterwards — the element is pinned to whatever it rendered with. Because `hlm()` merges through
|
|
58
|
+
* `twMerge`, only classes of the same Tailwind group are pinned, which is why a dynamic `size`
|
|
59
|
+
* (`h-10` vs `h-11`) freezes while an unrelated `class` input still appears to work.
|
|
60
|
+
*
|
|
61
|
+
* Binding `[yuwClass]` instead registers the value as a regular `classes()` source: it is
|
|
62
|
+
* replaceable on every change, and still merges after the helm directive's own variants, so it
|
|
63
|
+
* keeps the precedence a `[class]` binding had.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```html
|
|
67
|
+
* <button hlmBtn [size]="size()" [yuwClass]="_btnClass()">Save</button>
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare class YuwClassDirective {
|
|
71
|
+
readonly yuwClass: _angular_core.InputSignal<string>;
|
|
72
|
+
constructor();
|
|
73
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuwClassDirective, never>;
|
|
74
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<YuwClassDirective, "[yuwClass]", never, { "yuwClass": { "alias": "yuwClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
75
|
+
}
|
|
76
|
+
|
|
44
77
|
/**
|
|
45
78
|
* Registers a component as a form control, so `formControlName`/`formControl`/`ngModel` bind to it.
|
|
46
79
|
*
|
|
@@ -127,7 +160,10 @@ type YuwColorDto = 'primary' | 'secondary' | 'destructive' | 'success' | 'warnin
|
|
|
127
160
|
* Outputs:
|
|
128
161
|
* - `clicked`: Emits MouseEvent on click.
|
|
129
162
|
*
|
|
130
|
-
* `_btnClass` merges our variant layer with the consumer's `class`, which goes last so it wins.
|
|
163
|
+
* `_btnClass` merges our variant layer with the consumer's `class`, which goes last so it wins. It
|
|
164
|
+
* reaches the inner element through `[yuwClass]` rather than `[class]`: the helm layer owns the
|
|
165
|
+
* `class` attribute and treats a foreign write as consumer-authored base classes that it merges
|
|
166
|
+
* last, which would pin the first rendered value and stop `size` from ever changing again.
|
|
131
167
|
*
|
|
132
168
|
* The host carries `inline-flex` so it is a real box rather than an inline one: an overlay trigger
|
|
133
169
|
* directive composed onto `<yuw-button>` (see `YuwPopoverTriggerDirective`) anchors its panel to the
|
|
@@ -855,10 +891,10 @@ declare class YuwSearchInputComponent extends YuwValueAccessorBase<string> imple
|
|
|
855
891
|
protected readonly _collapsible: _angular_core.Signal<boolean>;
|
|
856
892
|
protected readonly _disabled: _angular_core.Signal<boolean>;
|
|
857
893
|
protected readonly _expandButtonClasses: _angular_core.Signal<string>;
|
|
858
|
-
protected readonly _expanded: _angular_core.Signal<boolean>;
|
|
859
894
|
protected readonly _fieldClasses: _angular_core.Signal<string>;
|
|
860
895
|
protected readonly _iconClasses: _angular_core.Signal<string>;
|
|
861
896
|
protected readonly _inputId: _angular_core.Signal<string>;
|
|
897
|
+
readonly expanded: _angular_core.Signal<boolean>;
|
|
862
898
|
protected readonly _showClear: _angular_core.Signal<boolean>;
|
|
863
899
|
protected readonly _showExpandButton: _angular_core.Signal<boolean>;
|
|
864
900
|
protected readonly _wrapperClasses: _angular_core.Signal<string>;
|
|
@@ -2104,11 +2140,14 @@ type YuwPopoverAlignDto = 'start' | 'center' | 'end';
|
|
|
2104
2140
|
* - `showTrigger`: Whether to render the trigger button. Set `false` when opening only via `[(open)]`.
|
|
2105
2141
|
* - `align`: Panel alignment relative to trigger (`'start'`, `'center'`, `'end'`). Default is `'center'`.
|
|
2106
2142
|
* - `sideOffset`: Pixel offset between the trigger and the panel. Default is `4`.
|
|
2143
|
+
* - `sideOffset`: Pixel offset for X sides. Positive px for right, negative for left side.
|
|
2107
2144
|
* - `title`: Optional header title text. User-facing text the consuming app is responsible for translating.
|
|
2108
2145
|
* - `description`: Optional header description text. User-facing text the consuming app is responsible for translating.
|
|
2109
2146
|
* - `panelClass`: Extra classes merged onto the popover panel (e.g. `w-80` to widen it). They win
|
|
2110
2147
|
* over the library defaults via `twMerge`.
|
|
2111
2148
|
* - `triggerVariant`: Button style variant for the trigger button.
|
|
2149
|
+
* - `triggerColor`: Brand color theme for the trigger button (any `YuwColorDto` value). Default is
|
|
2150
|
+
* `'secondary'`.
|
|
2112
2151
|
* - `triggerSize`: Button size for the trigger button.
|
|
2113
2152
|
* - `triggerTransparent`: Strips the trigger's background and border in every state (rest, hover,
|
|
2114
2153
|
* open), for triggers whose projected content is the whole control — an avatar, a name, a chevron.
|
|
@@ -2130,19 +2169,21 @@ type YuwPopoverAlignDto = 'start' | 'center' | 'end';
|
|
|
2130
2169
|
declare class YuwPopoverComponent {
|
|
2131
2170
|
readonly align: _angular_core.InputSignal<YuwPopoverAlignDto>;
|
|
2132
2171
|
readonly description: _angular_core.InputSignal<string | undefined>;
|
|
2172
|
+
readonly offsetX: _angular_core.InputSignal<number>;
|
|
2133
2173
|
readonly open: _angular_core.ModelSignal<boolean>;
|
|
2134
2174
|
readonly panelClass: _angular_core.InputSignal<string | undefined>;
|
|
2135
2175
|
readonly showTrigger: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
2136
2176
|
readonly sideOffset: _angular_core.InputSignal<number>;
|
|
2137
2177
|
readonly title: _angular_core.InputSignal<string | undefined>;
|
|
2138
2178
|
readonly triggerClass: _angular_core.InputSignal<string>;
|
|
2179
|
+
readonly triggerColor: _angular_core.InputSignal<YuwColorDto>;
|
|
2139
2180
|
readonly triggerSize: _angular_core.InputSignal<"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined>;
|
|
2140
2181
|
readonly triggerTransparent: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
2141
2182
|
readonly triggerVariant: _angular_core.InputSignal<"default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined>;
|
|
2142
2183
|
protected readonly _popoverState: _angular_core.Signal<"open" | "closed">;
|
|
2143
2184
|
protected onOpenChange(state: 'open' | 'closed'): void;
|
|
2144
2185
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuwPopoverComponent, never>;
|
|
2145
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<YuwPopoverComponent, "yuw-popover", never, { "align": { "alias": "align"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "showTrigger": { "alias": "showTrigger"; "required": false; "isSignal": true; }; "sideOffset": { "alias": "sideOffset"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "triggerClass": { "alias": "triggerClass"; "required": false; "isSignal": true; }; "triggerSize": { "alias": "triggerSize"; "required": false; "isSignal": true; }; "triggerTransparent": { "alias": "triggerTransparent"; "required": false; "isSignal": true; }; "triggerVariant": { "alias": "triggerVariant"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, ["[yuwPopoverTrigger]", "*"], true, never>;
|
|
2186
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<YuwPopoverComponent, "yuw-popover", never, { "align": { "alias": "align"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "offsetX": { "alias": "offsetX"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "showTrigger": { "alias": "showTrigger"; "required": false; "isSignal": true; }; "sideOffset": { "alias": "sideOffset"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "triggerClass": { "alias": "triggerClass"; "required": false; "isSignal": true; }; "triggerColor": { "alias": "triggerColor"; "required": false; "isSignal": true; }; "triggerSize": { "alias": "triggerSize"; "required": false; "isSignal": true; }; "triggerTransparent": { "alias": "triggerTransparent"; "required": false; "isSignal": true; }; "triggerVariant": { "alias": "triggerVariant"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, ["[yuwPopoverTrigger]", "*"], true, never>;
|
|
2146
2187
|
}
|
|
2147
2188
|
|
|
2148
2189
|
/**
|
|
@@ -3261,5 +3302,198 @@ declare const YUW_SIDEBAR_RAIL_PADDING = "22px";
|
|
|
3261
3302
|
declare const YUW_SIDEBAR_RAIL_ICON_SIZE = "20px";
|
|
3262
3303
|
declare const YUW_SIDEBAR_RAIL_WIDTH = "78px";
|
|
3263
3304
|
|
|
3264
|
-
|
|
3265
|
-
|
|
3305
|
+
/**
|
|
3306
|
+
* A single runnable entry of `<yuw-command>`.
|
|
3307
|
+
*
|
|
3308
|
+
* - `id`: identity of the entry, echoed back by `commandSelected` and used as the `@for` track key.
|
|
3309
|
+
* - `label`: text of the entry, supplied already translated — the component owns no user-facing copy.
|
|
3310
|
+
* - `searchText`: text the filter matches on, when matching `label` alone is not enough (aliases,
|
|
3311
|
+
* a keyword list, an accented-stripped form). Absent, `label` is what gets searched.
|
|
3312
|
+
* - `icon`: name of a registered `@ng-icons` icon. Because the *consumer* chooses this name, the
|
|
3313
|
+
* consuming app is responsible for `provideIcons()`-ing it; that is a component-level provider,
|
|
3314
|
+
* so a name registered on the component hosting the command resolves here through the injector
|
|
3315
|
+
* chain.
|
|
3316
|
+
* - `shortcut`: trailing key hint, rendered verbatim. Presentational only — it displays the
|
|
3317
|
+
* accelerator, it does not bind one. Platform-correct text is the consumer's job, the same as
|
|
3318
|
+
* translation: pass `'⌘K'` on Apple platforms and `'Ctrl+K'` elsewhere, deciding with
|
|
3319
|
+
* `Platform` from `@angular/cdk/platform`. The component renders the string as given, so a
|
|
3320
|
+
* hardcoded `'⌘K'` will show the Command glyph to Windows and Linux users too.
|
|
3321
|
+
* - `disabled`: blocks selection while keeping the entry visible and searchable.
|
|
3322
|
+
* - `action`: what to run when the entry is chosen. Present for the ordinary case where an entry
|
|
3323
|
+
* *is* its callback; entries needing wider context leave it out and let the parent handle
|
|
3324
|
+
* `commandSelected`, which fires for every entry either way.
|
|
3325
|
+
*/
|
|
3326
|
+
interface YuwCommandItemDto {
|
|
3327
|
+
id: string;
|
|
3328
|
+
label: string;
|
|
3329
|
+
searchText?: string;
|
|
3330
|
+
icon?: string;
|
|
3331
|
+
shortcut?: string;
|
|
3332
|
+
disabled?: boolean;
|
|
3333
|
+
action?: () => void;
|
|
3334
|
+
}
|
|
3335
|
+
/**
|
|
3336
|
+
* A titled run of {@link YuwCommandItemDto}s.
|
|
3337
|
+
*
|
|
3338
|
+
* `label` is optional so an ungrouped palette is expressible as a single group with no heading —
|
|
3339
|
+
* that is why there is no separate flat `items` input competing with this one. Supplied already
|
|
3340
|
+
* translated.
|
|
3341
|
+
*
|
|
3342
|
+
* A group whose items are all filtered out hides itself, heading and separator included.
|
|
3343
|
+
*/
|
|
3344
|
+
interface YuwCommandGroupDto {
|
|
3345
|
+
id: string;
|
|
3346
|
+
label?: string;
|
|
3347
|
+
items: YuwCommandItemDto[];
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
/** Default match used by both `<yuw-command>` and `<yuw-command-dialog>`, mirroring brain's own
|
|
3351
|
+
* case-insensitive substring filter. Exported so the dialog forwards one shared default rather
|
|
3352
|
+
* than declaring a second one that could drift. */
|
|
3353
|
+
declare const yuwCommandDefaultFilter: CommandFilter;
|
|
3354
|
+
/**
|
|
3355
|
+
* Searchable command palette rendering groups of runnable entries.
|
|
3356
|
+
*
|
|
3357
|
+
* Entries come from the `groups` input — no per-entry directives to declare — and are filtered as
|
|
3358
|
+
* the user types. Choosing one runs its own `action` when it has one and always emits
|
|
3359
|
+
* `commandSelected`, so an entry needing wider context than a bare callback is handled by the
|
|
3360
|
+
* parent instead.
|
|
3361
|
+
*
|
|
3362
|
+
* Inputs / Models:
|
|
3363
|
+
* - `groups`: Required entry definitions (`YuwCommandGroupDto[]`), rendered in order. A palette
|
|
3364
|
+
* with no headings is one group with no `label`.
|
|
3365
|
+
* - `search`: Two-way filter query. Emits `searchChange` as the user types; set it to filter
|
|
3366
|
+
* programmatically or to reset the palette after running something.
|
|
3367
|
+
* - `disabled`: Blocks the whole palette.
|
|
3368
|
+
* - `filter`: Match predicate `(searchText, query) => boolean`. Defaults to a case-insensitive
|
|
3369
|
+
* substring match; replace it for fuzzy or accent-insensitive matching. It receives an entry's
|
|
3370
|
+
* `searchText` (or its `label`), never its `id`.
|
|
3371
|
+
* - `color`: Token palette applied to the subtree via `data-yuw-color`.
|
|
3372
|
+
* - `emptyText`: Message shown when the query matches nothing. User-facing text — the consuming
|
|
3373
|
+
* app is responsible for providing it translated.
|
|
3374
|
+
* - `searchPlaceholder`: Placeholder of the search field. Same translation contract.
|
|
3375
|
+
* - `class`: Merged onto the palette surface, so a consumer can size it without forking.
|
|
3376
|
+
*
|
|
3377
|
+
* Outputs:
|
|
3378
|
+
* - `commandSelected`: Emits the chosen `YuwCommandItemDto` for every selection, whether or not it
|
|
3379
|
+
* carried an `action`.
|
|
3380
|
+
*
|
|
3381
|
+
* Usage:
|
|
3382
|
+
* ```html
|
|
3383
|
+
* <yuw-command
|
|
3384
|
+
* [groups]="groups"
|
|
3385
|
+
* [(search)]="query"
|
|
3386
|
+
* emptyText="No results found."
|
|
3387
|
+
* searchPlaceholder="Type a command…"
|
|
3388
|
+
* (commandSelected)="run($event)"
|
|
3389
|
+
* />
|
|
3390
|
+
* ```
|
|
3391
|
+
*/
|
|
3392
|
+
declare class YuwCommandComponent {
|
|
3393
|
+
readonly color: _angular_core.InputSignal<YuwColorDto | undefined>;
|
|
3394
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
3395
|
+
readonly emptyText: _angular_core.InputSignal<string | undefined>;
|
|
3396
|
+
readonly filter: _angular_core.InputSignal<CommandFilter>;
|
|
3397
|
+
readonly groups: _angular_core.InputSignal<YuwCommandGroupDto[]>;
|
|
3398
|
+
readonly search: _angular_core.ModelSignal<string>;
|
|
3399
|
+
readonly searchPlaceholder: _angular_core.InputSignal<string | undefined>;
|
|
3400
|
+
readonly userClass: _angular_core.InputSignal<string>;
|
|
3401
|
+
readonly commandSelected: _angular_core.OutputEmitterRef<YuwCommandItemDto>;
|
|
3402
|
+
/** Brain matches its filter against each item's `value`, so `value` carries the searchable text
|
|
3403
|
+
* while `id` stays the identity — precomputed here so the template neither calls a method nor
|
|
3404
|
+
* rebuilds the string on every change-detection pass. */
|
|
3405
|
+
protected readonly _groups: _angular_core.Signal<{
|
|
3406
|
+
items: {
|
|
3407
|
+
item: YuwCommandItemDto;
|
|
3408
|
+
searchValue: string;
|
|
3409
|
+
}[];
|
|
3410
|
+
id: string;
|
|
3411
|
+
label?: string;
|
|
3412
|
+
}[]>;
|
|
3413
|
+
protected onSelected(item: YuwCommandItemDto): void;
|
|
3414
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuwCommandComponent, never>;
|
|
3415
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<YuwCommandComponent, "yuw-command", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "groups": { "alias": "groups"; "required": true; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "search": "searchChange"; "commandSelected": "commandSelected"; }, never, never, true, never>;
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
/**
|
|
3419
|
+
* `<yuw-command>` hosted in a centred modal — the ⌘K palette shape.
|
|
3420
|
+
*
|
|
3421
|
+
* Wraps the palette rather than re-projecting it, so filtering, grouping and selection behave
|
|
3422
|
+
* identically to the inline component. Two behaviours belong to the modal and are handled here:
|
|
3423
|
+
* the query is cleared whenever the palette closes, so it never reopens still filtered by the last
|
|
3424
|
+
* search; and choosing an entry closes it, since picking *is* the confirmation.
|
|
3425
|
+
*
|
|
3426
|
+
* The opening accelerator is deliberately not bound here. A global hotkey is application policy —
|
|
3427
|
+
* it has to coexist with whatever else the app binds — so the consumer drives `open` from its own
|
|
3428
|
+
* listener. `shortcut` text on the entries is likewise the consumer's, and platform-dependent
|
|
3429
|
+
* (`⌘K` on Apple platforms, `Ctrl+K` elsewhere).
|
|
3430
|
+
*
|
|
3431
|
+
* Inputs / Models:
|
|
3432
|
+
* - `groups`: Required entry definitions (`YuwCommandGroupDto[]`), as `<yuw-command>` takes them.
|
|
3433
|
+
* - `open`: Two-way open/closed state. Drive via `[(open)]` from the trigger or hotkey.
|
|
3434
|
+
* - `search`: Two-way filter query. Reset to `''` on close.
|
|
3435
|
+
* - `closeOnSelect`: Whether choosing an entry closes the palette. Default `true`; set it `false`
|
|
3436
|
+
* for a palette whose entries toggle state and are expected to be used several times in a row.
|
|
3437
|
+
* - `title`: Accessible name of the modal, rendered visually hidden — a palette shows no heading
|
|
3438
|
+
* above its search field, but the dialog still needs a name. Required, user-facing text the
|
|
3439
|
+
* consuming app is responsible for translating.
|
|
3440
|
+
* - `description`: Visually hidden description of the modal, announced after `title`. Same
|
|
3441
|
+
* translation contract.
|
|
3442
|
+
* - `emptyText`, `searchPlaceholder`, `filter`, `color`: Forwarded to `<yuw-command>` unchanged;
|
|
3443
|
+
* `filter` shares its default, so the two components always match on the same rule.
|
|
3444
|
+
* - `panelClass`: Extra classes merged onto the modal panel. Use it to widen the palette or lift it
|
|
3445
|
+
* above centre (`mb-[24vh]`), where palettes are conventionally placed. Prefer a margin over
|
|
3446
|
+
* `-translate-y`: the panel animates with `zoom-*`, whose keyframes drive `transform`.
|
|
3447
|
+
* Resizing it needs a **definite width** plus an **`sm:`-prefixed** cap, e.g.
|
|
3448
|
+
* `w-[650px] max-w-[calc(100vw-2rem)] sm:max-w-[calc(100vw-2rem)]`. Both parts are load-bearing,
|
|
3449
|
+
* verified by measuring the rendered panel in Chrome:
|
|
3450
|
+
* - `.cdk-overlay-pane` is `position: absolute` with no width, so it shrink-wraps its content.
|
|
3451
|
+
* A percentage width (`w-full`) therefore resolves against the *content* width — about 80px —
|
|
3452
|
+
* not the viewport, and no `max-w-*` can widen it because nothing ever requests more. Only a
|
|
3453
|
+
* definite `w-[…]` makes the pane size itself.
|
|
3454
|
+
* - the cap must repeat under the `sm:` variant, because the helm's own cap is `sm:max-w-sm`
|
|
3455
|
+
* (384px) emitted late in the stylesheet. `twMerge` only collapses classes of the same
|
|
3456
|
+
* variant, so an unprefixed `max-w-*` leaves `sm:max-w-sm` in place and loses to it above
|
|
3457
|
+
* 640px — the class list looks right while the panel stays 384px wide.
|
|
3458
|
+
* Use `100vw` rather than `100%` in the cap: a percentage is relative to the shrink-wrapped pane
|
|
3459
|
+
* again. `min-w-*` is rarely needed, since the `vw` cap already tracks the viewport.
|
|
3460
|
+
*
|
|
3461
|
+
* Outputs:
|
|
3462
|
+
* - `commandSelected`: Emits the chosen entry, after running its own `action`.
|
|
3463
|
+
*
|
|
3464
|
+
* Usage:
|
|
3465
|
+
* ```html
|
|
3466
|
+
* <yuw-command-dialog
|
|
3467
|
+
* [groups]="groups"
|
|
3468
|
+
* [(open)]="paletteOpen"
|
|
3469
|
+
* title="Command palette"
|
|
3470
|
+
* emptyText="No results found."
|
|
3471
|
+
* searchPlaceholder="Type a command or search…"
|
|
3472
|
+
* panelClass="sm:max-w-lg mb-[24vh]"
|
|
3473
|
+
* (commandSelected)="run($event)"
|
|
3474
|
+
* />
|
|
3475
|
+
* ```
|
|
3476
|
+
*/
|
|
3477
|
+
declare class YuwCommandDialogComponent {
|
|
3478
|
+
readonly closeOnSelect: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
3479
|
+
readonly color: _angular_core.InputSignal<YuwColorDto | undefined>;
|
|
3480
|
+
readonly description: _angular_core.InputSignal<string | undefined>;
|
|
3481
|
+
readonly emptyText: _angular_core.InputSignal<string | undefined>;
|
|
3482
|
+
readonly filter: _angular_core.InputSignal<CommandFilter>;
|
|
3483
|
+
readonly groups: _angular_core.InputSignal<YuwCommandGroupDto[]>;
|
|
3484
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
3485
|
+
readonly panelClass: _angular_core.InputSignal<string | undefined>;
|
|
3486
|
+
readonly search: _angular_core.ModelSignal<string>;
|
|
3487
|
+
readonly searchPlaceholder: _angular_core.InputSignal<string | undefined>;
|
|
3488
|
+
readonly title: _angular_core.InputSignal<string>;
|
|
3489
|
+
readonly commandSelected: _angular_core.OutputEmitterRef<YuwCommandItemDto>;
|
|
3490
|
+
protected readonly _panelClasses: _angular_core.Signal<string>;
|
|
3491
|
+
protected readonly _state: _angular_core.Signal<BrnDialogState>;
|
|
3492
|
+
protected onSelected(item: YuwCommandItemDto): void;
|
|
3493
|
+
protected onStateChanged(state: BrnDialogState): void;
|
|
3494
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuwCommandDialogComponent, never>;
|
|
3495
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<YuwCommandDialogComponent, "yuw-command-dialog", never, { "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "groups": { "alias": "groups"; "required": true; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": true; "isSignal": true; }; }, { "open": "openChange"; "search": "searchChange"; "commandSelected": "commandSelected"; }, never, never, true, never>;
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
export { DATATABLE_ALIGN_CLASS, YUW_PASSWORD_REVEAL_STATES, YUW_SIDEBAR_RAIL_ICON_SIZE, YUW_SIDEBAR_RAIL_PADDING, YUW_SIDEBAR_RAIL_WIDTH, YuwAccordion, YuwAccordionContentComponent, YuwAccordionImports, YuwAccordionItem, YuwAccordionTriggerComponent, YuwAlertActionDirective, YuwAlertComponent, YuwAlertDescriptionDirective, YuwAlertDialogComponent, YuwAlertDialogMediaDirective, YuwAlertDialogTriggerDirective, YuwAlertImports, YuwAlertTitleDirective, YuwAttachmentActionDirective, YuwAttachmentActionsDirective, YuwAttachmentContentDirective, YuwAttachmentDescriptionDirective, YuwAttachmentDirective, YuwAttachmentGroupDirective, YuwAttachmentMediaDirective, YuwAttachmentTitleDirective, YuwAttachmentTriggerDirective, YuwAvatarComponent, YuwBadgeComponent, YuwBreadcrumbComponent, YuwButtonComponent, YuwButtonGroupComponent, YuwButtonGroupContentDirective, YuwCaptionDirective, YuwCardActionDirective, YuwCardContentDirective, YuwCardDescriptionDirective, YuwCardDirective, YuwCardFooterDirective, YuwCardHeaderDirective, YuwCardImports, YuwCardTitleDirective, YuwCheckboxComponent, YuwClassDirective, YuwComboboxComponent, YuwComboboxItemDirective, YuwCommandComponent, YuwCommandDialogComponent, YuwContextMenuCheckboxDirective, YuwContextMenuCheckboxIndicatorComponent, YuwContextMenuDirective, YuwContextMenuGroupDirective, YuwContextMenuImports, YuwContextMenuItemDirective, YuwContextMenuLabelDirective, YuwContextMenuRadioDirective, YuwContextMenuRadioIndicatorComponent, YuwContextMenuSeparatorDirective, YuwContextMenuShortcutDirective, YuwContextMenuSubDirective, YuwContextMenuSubIndicatorComponent, YuwContextMenuSubTriggerDirective, YuwContextMenuTriggerDirective, YuwDatatableComponent, YuwDatatablePaginationDirective, YuwDatatableRowSelect, YuwDatepickerComponent, YuwDialogCloseDirective, YuwDialogComponent, YuwDialogFooterDirective, YuwDialogImports, YuwDialogTriggerDirective, YuwEmptyContentDirective, YuwEmptyDescriptionDirective, YuwEmptyDirective, YuwEmptyHeaderDirective, YuwEmptyImports, YuwEmptyMediaDirective, YuwEmptyTitleDirective, YuwInputAddonImports, YuwInputComponent, YuwInputOtpComponent, YuwItemActionsDirective, YuwItemContentDirective, YuwItemDescriptionDirective, YuwItemDirective, YuwItemFooterDirective, YuwItemGroupDirective, YuwItemHeaderDirective, YuwItemImports, YuwItemMediaDirective, YuwItemSeparatorDirective, YuwItemTitleDirective, YuwLabel, YuwLeftAddonDirective, YuwPaginationComponent, YuwPasswordInputComponent, YuwPopoverComponent, YuwPopoverTriggerDirective, YuwRadioGroupComponent, YuwRightAddonDirective, YuwSearchInputComponent, YuwSheetCloseDirective, YuwSheetComponent, YuwSheetFooterDirective, YuwSheetImports, YuwSheetTriggerDirective, YuwSidebarComponent, YuwSidebarContentDirective, YuwSidebarContentExtraDirective, YuwSidebarFooterDirective, YuwSidebarFooterExtraDirective, YuwSidebarGroupContentDirective, YuwSidebarGroupDirective, YuwSidebarGroupLabelDirective, YuwSidebarHeaderDirective, YuwSidebarInsetDirective, YuwSidebarMenuAvatarButtonDirective, YuwSidebarMenuBadgeDirective, YuwSidebarMenuButtonDirective, YuwSidebarMenuDirective, YuwSidebarMenuItemDirective, YuwSidebarMenuSubButtonDirective, YuwSidebarMenuSubDirective, YuwSidebarMenuSubItemDirective, YuwSidebarRailDirective, YuwSidebarRailService, YuwSidebarSeparatorDirective, YuwSidebarSubmenuService, YuwSidebarTriggerComponent, YuwSidebarWrapperDirective, YuwSkeletonDirective, YuwSpinnerComponent, YuwSwitchComponent, YuwTBodyDirective, YuwTFootDirective, YuwTHeadDirective, YuwTabPanelDirective, YuwTableContainerDirective, YuwTableDirective, YuwTableImports, YuwTabsComponent, YuwTdDirective, YuwTextareaComponent, YuwThDirective, YuwToasterComponent, YuwTooltipDirective, YuwTrDirective, YuwValueAccessorBase, buildInputOtpGroups, cn, datatableCellVariants, datatableContainerVariants, datatableHeadVariants, datatableHeaderCellVariants, datatableRowVariants, getPaginationRange, provideValueAccessor, totalInputOtpLength, yuwCommandDefaultFilter };
|
|
3499
|
+
export type { YuwAlertDialogSizeDto, YuwAlertVariantDto, YuwAvatarGroupItemDto, YuwAvatarSizeDto, YuwBreadcrumbItemDto, YuwButtonGroupClickDto, YuwButtonGroupItemDto, YuwColorDto, YuwComboboxItemContext, YuwComboboxOptionDto, YuwComboboxValue, YuwCommandGroupDto, YuwCommandItemDto, YuwDatatableAlign, YuwDatatableAppearanceDto, YuwDatatableColumnDef, YuwDatepickerModeDto, YuwDatepickerValue, YuwFieldSizeDto, YuwInputModeDto, YuwInputOtpGroupDto, YuwInputOtpModeDto, YuwInputTypeDto, YuwPaginationRangeItem, YuwPaginationSizeDto, YuwPasswordRevealStateDto, YuwPopoverAlignDto, YuwRadioOptionDto, YuwSearchInputCollapseFromDto, YuwSheetScrollStrategyDto, YuwSheetSideDto, YuwSidebarAvatarDto, YuwSidebarCollapsibleDto, YuwSidebarContentDto, YuwSidebarGroupDto, YuwSidebarItemClickDto, YuwSidebarItemDto, YuwSidebarSideDto, YuwSidebarSubItemDto, YuwSidebarVariantDto, YuwSwitchSizeDto, YuwTabItemDto, YuwTabsActivationModeDto, YuwTabsOrientationDto, YuwTabsVariantDto, YuwTextFieldContract, YuwToasterPositionDto, YuwToasterThemeDto, YuwTooltipPositionDto };
|