toku-ui 5.1.0 → 5.2.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.
- package/dist/components/TCommandPalette/TCommandPalette.stories.d.ts +194 -0
- package/dist/components/TCommandPalette/TCommandPalette.stories.d.ts.map +1 -0
- package/dist/components/TCommandPalette/TCommandPalette.vue.d.ts +215 -0
- package/dist/components/TCommandPalette/TCommandPalette.vue.d.ts.map +1 -0
- package/dist/components/TCommandPalette/index.d.ts +3 -0
- package/dist/components/TCommandPalette/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.es.js +1235 -870
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import type { TCommandPaletteGroup } from './TCommandPalette.vue';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: {
|
|
6
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./TCommandPalette.vue").TCommandPaletteProps & {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
searchTerm?: string;
|
|
9
|
+
}> & Readonly<{
|
|
10
|
+
onSelect?: ((item: import("./TCommandPalette.vue").TCommandPaletteItem, group: TCommandPaletteGroup) => any) | undefined;
|
|
11
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
12
|
+
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
13
|
+
onHighlight?: ((item: import("./TCommandPalette.vue").TCommandPaletteItem | undefined, group: TCommandPaletteGroup | undefined) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
select: (item: import("./TCommandPalette.vue").TCommandPaletteItem, group: TCommandPaletteGroup) => any;
|
|
16
|
+
"update:open": (value: boolean) => any;
|
|
17
|
+
"update:searchTerm": (value: string) => any;
|
|
18
|
+
highlight: (item: import("./TCommandPalette.vue").TCommandPaletteItem | undefined, group: TCommandPaletteGroup | undefined) => any;
|
|
19
|
+
}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
20
|
+
P: {};
|
|
21
|
+
B: {};
|
|
22
|
+
D: {};
|
|
23
|
+
C: {};
|
|
24
|
+
M: {};
|
|
25
|
+
Defaults: {};
|
|
26
|
+
}, Readonly<import("./TCommandPalette.vue").TCommandPaletteProps & {
|
|
27
|
+
open?: boolean;
|
|
28
|
+
searchTerm?: string;
|
|
29
|
+
}> & Readonly<{
|
|
30
|
+
onSelect?: ((item: import("./TCommandPalette.vue").TCommandPaletteItem, group: TCommandPaletteGroup) => any) | undefined;
|
|
31
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
32
|
+
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
33
|
+
onHighlight?: ((item: import("./TCommandPalette.vue").TCommandPaletteItem | undefined, group: TCommandPaletteGroup | undefined) => any) | undefined;
|
|
34
|
+
}>, {}, {}, {}, {}, {}>;
|
|
35
|
+
__isFragment?: never;
|
|
36
|
+
__isTeleport?: never;
|
|
37
|
+
__isSuspense?: never;
|
|
38
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./TCommandPalette.vue").TCommandPaletteProps & {
|
|
39
|
+
open?: boolean;
|
|
40
|
+
searchTerm?: string;
|
|
41
|
+
}> & Readonly<{
|
|
42
|
+
onSelect?: ((item: import("./TCommandPalette.vue").TCommandPaletteItem, group: TCommandPaletteGroup) => any) | undefined;
|
|
43
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
44
|
+
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
45
|
+
onHighlight?: ((item: import("./TCommandPalette.vue").TCommandPaletteItem | undefined, group: TCommandPaletteGroup | undefined) => any) | undefined;
|
|
46
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
|
+
select: (item: import("./TCommandPalette.vue").TCommandPaletteItem, group: TCommandPaletteGroup) => any;
|
|
48
|
+
"update:open": (value: boolean) => any;
|
|
49
|
+
"update:searchTerm": (value: string) => any;
|
|
50
|
+
highlight: (item: import("./TCommandPalette.vue").TCommandPaletteItem | undefined, group: TCommandPaletteGroup | undefined) => any;
|
|
51
|
+
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
52
|
+
$slots: import("./TCommandPalette.vue").TCommandPaletteSlots;
|
|
53
|
+
});
|
|
54
|
+
tags: string[];
|
|
55
|
+
argTypes: {
|
|
56
|
+
groups: {
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
open: {
|
|
60
|
+
control: "boolean";
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
searchTerm: {
|
|
64
|
+
control: "text";
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
searchDelay: {
|
|
68
|
+
control: "number";
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
loading: {
|
|
72
|
+
control: "boolean";
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
placeholder: {
|
|
76
|
+
control: "text";
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
clearLabel: {
|
|
80
|
+
control: "text";
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
loadingLabel: {
|
|
84
|
+
control: "text";
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
autofocus: {
|
|
88
|
+
control: "boolean";
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
args: {
|
|
93
|
+
groups: TCommandPaletteGroup[];
|
|
94
|
+
open: true;
|
|
95
|
+
searchDelay: number;
|
|
96
|
+
loading: false;
|
|
97
|
+
placeholder: string;
|
|
98
|
+
autofocus: true;
|
|
99
|
+
};
|
|
100
|
+
parameters: {
|
|
101
|
+
a11y: {
|
|
102
|
+
test: string;
|
|
103
|
+
};
|
|
104
|
+
docs: {
|
|
105
|
+
description: {
|
|
106
|
+
component: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export default meta;
|
|
112
|
+
type Story = StoryObj<typeof meta>;
|
|
113
|
+
export declare const Playground: Story;
|
|
114
|
+
/**
|
|
115
|
+
* `loading` replaces the list with a skeleton built from the real row metrics, so results
|
|
116
|
+
* land exactly where the placeholder sat. The ARIA side of this — busy, no options, no
|
|
117
|
+
* listbox role — is asserted in the spec; here the axe gate covers it in a real browser.
|
|
118
|
+
*/
|
|
119
|
+
export declare const Loading: Story;
|
|
120
|
+
/**
|
|
121
|
+
* `active` marks the item currently applied, independent of the keyboard cursor. The first
|
|
122
|
+
* row carries both at once, which is the combination that puts accent-coloured text on the
|
|
123
|
+
* step-5 selection band — the axe gate covers that pairing here.
|
|
124
|
+
*/
|
|
125
|
+
export declare const ActiveItem: Story;
|
|
126
|
+
export declare const Empty: Story;
|
|
127
|
+
export declare const WithFooter: Story;
|
|
128
|
+
export declare const CustomItemSlot: Story;
|
|
129
|
+
/**
|
|
130
|
+
* The history the consumer keeps between sessions, rendered as an ordinary group. The clock
|
|
131
|
+
* icon comes from the `group-label` slot and each row uses `chip` to say which entity it
|
|
132
|
+
* was — the design's recent-searches block.
|
|
133
|
+
*
|
|
134
|
+
* **"Limpiar historial" sits in the footer, not in the group header as the design draws it.**
|
|
135
|
+
* A listbox may only own `option` and `group`, so a button in the heading is invalid ARIA
|
|
136
|
+
* and the axe gate fails the story. Measured, not assumed: such a button *is* focusable and
|
|
137
|
+
* the dialog cycles Tab through it, so the problem is not reachability — it is that the list
|
|
138
|
+
* stops being a well-formed list, and the options around it can be miscounted or skipped.
|
|
139
|
+
* The footer is outside the listbox, so a control there is valid. A real `option` row with
|
|
140
|
+
* an `onSelect` is the other valid home, and arrow keys reach it.
|
|
141
|
+
*/
|
|
142
|
+
export declare const RecentSearches: Story;
|
|
143
|
+
/**
|
|
144
|
+
* A matched customer plus the records hanging off them — payment methods, subscriptions,
|
|
145
|
+
* debts. The related tier is still ordinary groups, so arrow keys walk straight through it;
|
|
146
|
+
* only the presentation is nested, via the `data-group` hook and the `group-label` slot.
|
|
147
|
+
*/
|
|
148
|
+
export declare const CrossReferences: Story;
|
|
149
|
+
/**
|
|
150
|
+
* Enough results to overflow the panel. Arrow past the fold and the active row is scrolled
|
|
151
|
+
* into view on every move — the list scrolls, the focus does not.
|
|
152
|
+
*/
|
|
153
|
+
export declare const ScrollingResults: Story;
|
|
154
|
+
/**
|
|
155
|
+
* Every row treatment at once: an applied item, a disabled one, entity chips, per-item
|
|
156
|
+
* shortcuts, a long label that has to truncate, and a row with no icon or subtitle.
|
|
157
|
+
*/
|
|
158
|
+
export declare const RowVariants: Story;
|
|
159
|
+
/**
|
|
160
|
+
* Typing must not move anything. The clear button stays mounted and is hidden with
|
|
161
|
+
* `visibility`, so the input keeps its width instead of losing 34px — and the search row
|
|
162
|
+
* its height — the moment the first character lands.
|
|
163
|
+
*/
|
|
164
|
+
export declare const NoLayoutShift: Story;
|
|
165
|
+
/**
|
|
166
|
+
* `↑` `↓` cross group boundaries, skip disabled items and wrap around. Focus never leaves
|
|
167
|
+
* the input — the cursor is carried by `aria-activedescendant` alone.
|
|
168
|
+
*/
|
|
169
|
+
/**
|
|
170
|
+
* The three leading adornments. Records get a bare icon, commands a brand tile, and
|
|
171
|
+
* `tile` — the default — keeps the neutral box every existing consumer already renders.
|
|
172
|
+
*/
|
|
173
|
+
export declare const LeadingVariants: Story;
|
|
174
|
+
/**
|
|
175
|
+
* Match highlighting, done the way the consumer will do it. The palette never matches
|
|
176
|
+
* anything itself — that would disagree with whatever pass actually ranked the row — so
|
|
177
|
+
* the ranges come from outside and land in `item-text` and `item-suffix`, which sit
|
|
178
|
+
* inside* the spans that already carry the type and the truncation. The consumer supplies
|
|
179
|
+
* the `<mark>` and nothing else; it inherits size, weight, colour and the ellipsis.
|
|
180
|
+
*
|
|
181
|
+
* The last row is why both slots exist: it was surfaced by its email, so the label matches
|
|
182
|
+
* nothing and the only mark is in the subtitle.
|
|
183
|
+
*
|
|
184
|
+
* The splitter below is illustrative. Real ranges come from the consumer's ranking pass.
|
|
185
|
+
*/
|
|
186
|
+
export declare const HighlightedMatches: Story;
|
|
187
|
+
export declare const KeyboardNavigation: Story;
|
|
188
|
+
/** `Enter` runs the item's `onSelect`, emits `select` and closes the dialog. */
|
|
189
|
+
export declare const SelectWithEnter: Story;
|
|
190
|
+
/** A disabled item cannot be reached by keyboard, so `Enter` never selects it. */
|
|
191
|
+
export declare const DisabledItemIsNotSelectable: Story;
|
|
192
|
+
/** `Esc` is handled by the native `<dialog>`; the component syncs `open` back from it. */
|
|
193
|
+
export declare const EscapeCloses: Story;
|
|
194
|
+
//# sourceMappingURL=TCommandPalette.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TCommandPalette.stories.d.ts","sourceRoot":"","sources":["../../../src/components/TCommandPalette/TCommandPalette.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AA+BlE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJ8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAuFnC,eAAO,MAAM,UAAU,EAAE,KAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAcxB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KA0BnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAuBxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAsB5B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,KAoC5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAyD7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAa9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAsBzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KA2B3B,CAAC;AAEF;;;GAGG;AACH;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KA2B7B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,EAAE,KA4EhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KA2ChC,CAAC;AAOF,gFAAgF;AAChF,eAAO,MAAM,eAAe,EAAE,KAoB7B,CAAC;AAOF,kFAAkF;AAClF,eAAO,MAAM,2BAA2B,EAAE,KAYzC,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,YAAY,EAAE,KAU1B,CAAC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type { HeroIcon } from '@/types/heroicons';
|
|
2
|
+
/**
|
|
3
|
+
* A single row of the palette.
|
|
4
|
+
*
|
|
5
|
+
* Every field is presentational except `onSelect`. The component owns the
|
|
6
|
+
* mechanics (focus, keyboard, ARIA, scroll) and stays agnostic about what a
|
|
7
|
+
* result *means* — richer rendering goes through the `item` slot.
|
|
8
|
+
*/
|
|
9
|
+
export interface TCommandPaletteItem {
|
|
10
|
+
/** Primary text. Also the fallback accessible name of the option. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Text rendered before `label` — e.g. the entity the result belongs to. */
|
|
13
|
+
prefix?: string;
|
|
14
|
+
/** Secondary text rendered after `label` — subtitle or contextual datum. */
|
|
15
|
+
suffix?: string;
|
|
16
|
+
/** Heroicon name rendered as the leading adornment. */
|
|
17
|
+
icon?: HeroIcon;
|
|
18
|
+
/**
|
|
19
|
+
* How the leading adornment is drawn. `tile` (the default) is the neutral box;
|
|
20
|
+
* `plain` is a bare icon with no box, for rows that are records; `accent` is a brand
|
|
21
|
+
* tile, for rows that are commands. The `item-leading` slot cannot express this — it
|
|
22
|
+
* fills the box rather than replacing it, and the box is styled in scoped CSS a
|
|
23
|
+
* consumer cannot reach.
|
|
24
|
+
*/
|
|
25
|
+
iconVariant?: 'tile' | 'plain' | 'accent';
|
|
26
|
+
/**
|
|
27
|
+
* Entity badge. Rendered by the default template only when it is a string;
|
|
28
|
+
* any other shape is the `item` slot's business.
|
|
29
|
+
*/
|
|
30
|
+
chip?: unknown;
|
|
31
|
+
/** Keyboard shortcut hint, one `<kbd>` per entry. */
|
|
32
|
+
kbds?: string[];
|
|
33
|
+
/** Skipped by arrow navigation and not selectable. */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** Marks the item as the currently applied one. Independent of the keyboard cursor. */
|
|
36
|
+
active?: boolean;
|
|
37
|
+
/** Invoked before `select` is emitted. */
|
|
38
|
+
onSelect?: () => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A band of consecutive groups drawn as one block — the "related to X" tier of a result
|
|
42
|
+
* list, say. Purely a rendering device: the groups inside stay ordinary groups, so arrow
|
|
43
|
+
* navigation, `highlight` and `select` do not know sections exist.
|
|
44
|
+
*/
|
|
45
|
+
export interface TCommandPaletteSection {
|
|
46
|
+
/** Consecutive groups sharing this id render inside one element. */
|
|
47
|
+
id: string;
|
|
48
|
+
/**
|
|
49
|
+
* Heading rendered once above the run, taken from whichever group declares one first.
|
|
50
|
+
* The rest can carry `{ id }` alone.
|
|
51
|
+
*/
|
|
52
|
+
label?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A labelled run of items. Groups are a rendering and grouping device — arrow
|
|
56
|
+
* navigation crosses them as if the palette were one flat list.
|
|
57
|
+
*/
|
|
58
|
+
export interface TCommandPaletteGroup {
|
|
59
|
+
/** Stable identity of the group. Used as the Vue list key, never as a DOM id. */
|
|
60
|
+
id: string;
|
|
61
|
+
/** Optional heading rendered above the group's items. */
|
|
62
|
+
label?: string;
|
|
63
|
+
/** The group's rows, already resolved by the consumer. */
|
|
64
|
+
items: TCommandPaletteItem[];
|
|
65
|
+
/**
|
|
66
|
+
* Keeps the palette open when one of this group's rows is chosen. Default is to close, which is
|
|
67
|
+
* right for a row that navigates somewhere.
|
|
68
|
+
*
|
|
69
|
+
* It exists for rows whose whole purpose is to change what the palette is showing — a recent
|
|
70
|
+
* search that has to be run again, a group that expands — where closing throws away the result the
|
|
71
|
+
* user asked for. It is per group rather than per component because the same palette usually mixes
|
|
72
|
+
* both kinds.
|
|
73
|
+
*/
|
|
74
|
+
keepOpenOnSelect?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Reorders the group's items for the current term. It MUST NOT drop items —
|
|
77
|
+
* the palette never filters (see the component docs); this is a ranking hook
|
|
78
|
+
* so relevance scoring can live in the consumer instead of pulling a fuzzy
|
|
79
|
+
* search dependency into `toku-ui`.
|
|
80
|
+
*/
|
|
81
|
+
postFilter?: (searchTerm: string, items: TCommandPaletteItem[]) => TCommandPaletteItem[];
|
|
82
|
+
/**
|
|
83
|
+
* Draws this group inside a section block shared with the adjacent groups that declare
|
|
84
|
+
* the same `section.id`. Lets a consumer put one border, background or inset around a
|
|
85
|
+
* run of groups — which is impossible from outside, since groups render as siblings.
|
|
86
|
+
*/
|
|
87
|
+
section?: TCommandPaletteSection;
|
|
88
|
+
}
|
|
89
|
+
export interface TCommandPaletteProps {
|
|
90
|
+
/** Result groups, already resolved. The palette does not filter them. */
|
|
91
|
+
groups?: TCommandPaletteGroup[];
|
|
92
|
+
/** Whether the dialog is shown. Use `v-model:open`. */
|
|
93
|
+
open?: boolean;
|
|
94
|
+
/** Current query. Use `v-model:search-term`. */
|
|
95
|
+
searchTerm?: string;
|
|
96
|
+
/** Debounce in ms applied to `update:searchTerm`. The input stays immediate. */
|
|
97
|
+
searchDelay?: number;
|
|
98
|
+
/** Shows the loading indicator and marks the listbox busy. */
|
|
99
|
+
loading?: boolean;
|
|
100
|
+
/** Input placeholder. Doubles as the input's accessible name when no `aria-label` is forwarded. */
|
|
101
|
+
placeholder?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Accessible name of the clear-query button, which appears once the input has text.
|
|
104
|
+
* A prop rather than a literal because it is prose the palette itself renders.
|
|
105
|
+
*/
|
|
106
|
+
clearLabel?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Announced while `loading`. The skeleton is decorative, so without this the state
|
|
109
|
+
* is silent to assistive tech — an empty list has no role to carry `aria-busy`.
|
|
110
|
+
*/
|
|
111
|
+
loadingLabel?: string;
|
|
112
|
+
/** Focuses the input when the palette opens. */
|
|
113
|
+
autofocus?: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface TCommandPaletteEmits {
|
|
116
|
+
/** The active item changed, by keyboard or pointer. */
|
|
117
|
+
highlight: [item: TCommandPaletteItem | undefined, group: TCommandPaletteGroup | undefined];
|
|
118
|
+
/** An item was chosen with `Enter` or a click. */
|
|
119
|
+
select: [item: TCommandPaletteItem, group: TCommandPaletteGroup];
|
|
120
|
+
}
|
|
121
|
+
export interface TCommandPaletteItemSlotProps {
|
|
122
|
+
item: TCommandPaletteItem;
|
|
123
|
+
group: TCommandPaletteGroup;
|
|
124
|
+
/** True when the item carries the keyboard cursor. */
|
|
125
|
+
active: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface TCommandPaletteGroupSlotProps {
|
|
128
|
+
group: TCommandPaletteGroup;
|
|
129
|
+
/** Position of the group in `groups`, after `postFilter`. */
|
|
130
|
+
index: number;
|
|
131
|
+
}
|
|
132
|
+
export interface TCommandPaletteSectionSlotProps {
|
|
133
|
+
section: TCommandPaletteSection;
|
|
134
|
+
/** The groups drawn inside this section, in order. */
|
|
135
|
+
groups: TCommandPaletteGroup[];
|
|
136
|
+
}
|
|
137
|
+
export interface TCommandPaletteSlots {
|
|
138
|
+
/**
|
|
139
|
+
* Replaces a section's heading. Same contract as `group-label`: whatever this renders
|
|
140
|
+
* becomes the section's accessible name, and interactive controls do not belong here.
|
|
141
|
+
*/
|
|
142
|
+
'section-label'?: (props: TCommandPaletteSectionSlotProps) => unknown;
|
|
143
|
+
/**
|
|
144
|
+
* Replaces a group's heading. The palette still owns the heading element and its
|
|
145
|
+
* `aria-labelledby` wiring — this only fills it, so a consumer can add an icon or a
|
|
146
|
+
* count alongside the name.
|
|
147
|
+
*
|
|
148
|
+
* Whatever this renders **becomes the group's accessible name**, so it must always
|
|
149
|
+
* render the name: a branch that renders nothing for some groups leaves those groups
|
|
150
|
+
* with an empty one. Interactive controls do not belong here: a listbox may only own
|
|
151
|
+
* `option` and `group`, so a control inside one is invalid ARIA and degrades how the
|
|
152
|
+
* surrounding options are announced — a screen reader can miscount or skip them. It is
|
|
153
|
+
* not a reachability problem; the dialog does cycle focus through such a control. The
|
|
154
|
+
* fix is placement, not `tabindex`: use `footer`, or a real row with `onSelect`.
|
|
155
|
+
*/
|
|
156
|
+
'group-label'?: (props: TCommandPaletteGroupSlotProps) => unknown;
|
|
157
|
+
/** Replaces a whole row. */
|
|
158
|
+
item?: (props: TCommandPaletteItemSlotProps) => unknown;
|
|
159
|
+
/** Replaces the leading adornment of a row. */
|
|
160
|
+
'item-leading'?: (props: TCommandPaletteItemSlotProps) => unknown;
|
|
161
|
+
/** Replaces the label block of a row. */
|
|
162
|
+
'item-label'?: (props: TCommandPaletteItemSlotProps) => unknown;
|
|
163
|
+
/**
|
|
164
|
+
* Replaces only the label **text**, inside the span that already carries the title
|
|
165
|
+
* typography and the truncation. Use it to decorate the label — wrapping matched
|
|
166
|
+
* ranges in `<mark>`, say — without re-implementing the row's type or its ellipsis.
|
|
167
|
+
*
|
|
168
|
+
* Nested inside `item-label`'s default content, so a consumer that overrides
|
|
169
|
+
* `item-label` replaces this too. Whatever it renders becomes part of the option's
|
|
170
|
+
* accessible name, so it must still render the label.
|
|
171
|
+
*/
|
|
172
|
+
'item-text'?: (props: TCommandPaletteItemSlotProps) => unknown;
|
|
173
|
+
/**
|
|
174
|
+
* The same for the subtitle. It exists because the label is not where the match
|
|
175
|
+
* necessarily is: a row surfaced by email or RUT carries the matched field here, so
|
|
176
|
+
* decorating only the label would mark nothing on exactly those rows.
|
|
177
|
+
*
|
|
178
|
+
* Renders when the item has a `suffix` or this slot is filled, and carries the same
|
|
179
|
+
* contract as `item-text`.
|
|
180
|
+
*/
|
|
181
|
+
'item-suffix'?: (props: TCommandPaletteItemSlotProps) => unknown;
|
|
182
|
+
/** Replaces the trailing adornment of a row. */
|
|
183
|
+
'item-trailing'?: (props: TCommandPaletteItemSlotProps) => unknown;
|
|
184
|
+
/** Shown when no group has items. */
|
|
185
|
+
empty?: (props: {
|
|
186
|
+
searchTerm: string;
|
|
187
|
+
}) => unknown;
|
|
188
|
+
/** Persistent bar under the list — shortcut legends, counts. */
|
|
189
|
+
footer?: () => unknown;
|
|
190
|
+
}
|
|
191
|
+
declare const _default: typeof __VLS_export;
|
|
192
|
+
export default _default;
|
|
193
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<TCommandPaletteProps & {
|
|
194
|
+
open?: boolean;
|
|
195
|
+
searchTerm?: string;
|
|
196
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
197
|
+
select: (item: TCommandPaletteItem, group: TCommandPaletteGroup) => any;
|
|
198
|
+
"update:open": (value: boolean) => any;
|
|
199
|
+
"update:searchTerm": (value: string) => any;
|
|
200
|
+
highlight: (item: TCommandPaletteItem | undefined, group: TCommandPaletteGroup | undefined) => any;
|
|
201
|
+
}, string, import("vue").PublicProps, Readonly<TCommandPaletteProps & {
|
|
202
|
+
open?: boolean;
|
|
203
|
+
searchTerm?: string;
|
|
204
|
+
}> & Readonly<{
|
|
205
|
+
onSelect?: ((item: TCommandPaletteItem, group: TCommandPaletteGroup) => any) | undefined;
|
|
206
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
207
|
+
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
208
|
+
onHighlight?: ((item: TCommandPaletteItem | undefined, group: TCommandPaletteGroup | undefined) => any) | undefined;
|
|
209
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, TCommandPaletteSlots>;
|
|
210
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
211
|
+
new (): {
|
|
212
|
+
$slots: S;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
//# sourceMappingURL=TCommandPalette.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TCommandPalette/TCommandPalette.vue"],"names":[],"mappings":"AA40CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IAEd,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uDAAuD;IACvD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAE1C;;;OAGG;IACH,I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4BAA4B,KAAK,OAAO,CAAC;IAE/D;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,OAAO,CAAC;IACjE,gDAAgD;IAChD,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,OAAO,CAAC;IACnE,qCAAqC;IACrC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;IACnD,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC;CACxB;wBACoB,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;WAqVT,OAAO;iBACD,MAAM;;;;;;;WADZ,OAAO;iBACD,MAAM;;;;;;yGA+ZjB,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as TCommandPalette } from './TCommandPalette.vue';
|
|
2
|
+
export type { TCommandPaletteEmits, TCommandPaletteGroup, TCommandPaletteGroupSlotProps, TCommandPaletteItem, TCommandPaletteItemSlotProps, TCommandPaletteProps, TCommandPaletteSection, TCommandPaletteSectionSlotProps, TCommandPaletteSlots, } from './TCommandPalette.vue';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TCommandPalette/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACtB,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eA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