@wildmason/aegis 2.2.0 → 2.3.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.
|
@@ -138,6 +138,12 @@ interface SelectOption {
|
|
|
138
138
|
label: string;
|
|
139
139
|
/** When true, the option is visible but cannot be selected. */
|
|
140
140
|
disabled?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* A second, muted line under the label, in the dropdown list only. The
|
|
143
|
+
* option keeps its label as its accessible name and takes this line as its
|
|
144
|
+
* description. Leave it out and the option renders as it always has.
|
|
145
|
+
*/
|
|
146
|
+
description?: string;
|
|
141
147
|
}
|
|
142
148
|
|
|
143
149
|
/**
|
|
@@ -160,6 +166,12 @@ declare class WmAnchoredScrollStrategy implements ScrollStrategy {
|
|
|
160
166
|
detach(): void;
|
|
161
167
|
}
|
|
162
168
|
|
|
169
|
+
/** How the trigger is drawn. See `WmSelect.appearance`. */
|
|
170
|
+
type WmSelectAppearance = 'field' | 'chip';
|
|
171
|
+
/** The trigger's status colour. See `WmSelect.tone`. */
|
|
172
|
+
type WmSelectTone = 'neutral' | 'danger';
|
|
173
|
+
/** How wide the panel is. See `WmSelect.panelWidth`. */
|
|
174
|
+
type WmSelectPanelWidth = 'trigger' | 'content' | number;
|
|
163
175
|
/**
|
|
164
176
|
* WmSelect — Accessible dropdown select built on Angular CDK Overlay.
|
|
165
177
|
*
|
|
@@ -177,20 +189,26 @@ declare class WmAnchoredScrollStrategy implements ScrollStrategy {
|
|
|
177
189
|
* - Yes/No choices → use a Toggle or two radio buttons
|
|
178
190
|
*
|
|
179
191
|
* Options API:
|
|
180
|
-
* options: SelectOption[] — Array of { value, label, disabled? } objects.
|
|
192
|
+
* options: SelectOption[] — Array of { value, label, disabled?, description? } objects.
|
|
181
193
|
*
|
|
182
194
|
* Two-way binding:
|
|
183
195
|
* <wm-select [(value)]="selectedValue" [options]="myOptions" />
|
|
184
196
|
*
|
|
197
|
+
* A compact choice in a row of others, which reads "Opus model":
|
|
198
|
+
* <wm-select appearance="chip" suffix="model" aria-label="Model" [options]="models" [(value)]="model" />
|
|
199
|
+
*
|
|
185
200
|
* Accessibility:
|
|
186
201
|
* - Trigger has role="combobox", aria-expanded, aria-haspopup="listbox"
|
|
187
202
|
* - Panel has role="listbox"; each option has role="option" + aria-selected
|
|
188
203
|
* - Disabled options have aria-disabled="true"
|
|
204
|
+
* - An option with a description is named by its label (aria-labelledby) and
|
|
205
|
+
* described by the second line (aria-describedby)
|
|
189
206
|
* - Focus is trapped inside the open panel (cdkTrapFocus)
|
|
190
207
|
* - Clicking the backdrop closes the panel and returns focus to the trigger
|
|
191
208
|
* - Keyboard: Enter/Space on trigger opens; Escape closes; arrow keys
|
|
192
209
|
* navigate options (relies on natural tab order within the panel)
|
|
193
|
-
* - Always pair with a visible label via <wm-label> or aria-label on the host
|
|
210
|
+
* - Always pair with a visible label via <wm-label> or aria-label on the host.
|
|
211
|
+
* A chip has no visible label of its own, so it always needs the aria-label
|
|
194
212
|
*/
|
|
195
213
|
declare class WmSelect {
|
|
196
214
|
/**
|
|
@@ -203,6 +221,8 @@ declare class WmSelect {
|
|
|
203
221
|
* keeps the coordinates it was born with while the trigger scrolls away.
|
|
204
222
|
*/
|
|
205
223
|
protected readonly scrollStrategy: WmAnchoredScrollStrategy;
|
|
224
|
+
/** Prefix for the ids that tie an option to its label and description. */
|
|
225
|
+
protected readonly uid: string;
|
|
206
226
|
/** Array of options to display. */
|
|
207
227
|
options: _angular_core.InputSignal<SelectOption[]>;
|
|
208
228
|
/** The currently selected value. Two-way bindable. */
|
|
@@ -211,15 +231,49 @@ declare class WmSelect {
|
|
|
211
231
|
placeholder: _angular_core.InputSignal<string>;
|
|
212
232
|
/** Disables the trigger and prevents the panel from opening. */
|
|
213
233
|
disabled: _angular_core.InputSignal<boolean>;
|
|
234
|
+
/**
|
|
235
|
+
* `field` (the default) is a full-width form control with a border.
|
|
236
|
+
* `chip` is a compact, filled trigger as wide as its words, for a row of
|
|
237
|
+
* choices such as a composer's model and permissions.
|
|
238
|
+
*/
|
|
239
|
+
appearance: _angular_core.InputSignal<WmSelectAppearance>;
|
|
240
|
+
/**
|
|
241
|
+
* A muted word after the chosen label, in the trigger only: `suffix="model"`
|
|
242
|
+
* reads "Opus model". It names the choice where no label sits beside it. It
|
|
243
|
+
* is left out while the placeholder shows.
|
|
244
|
+
*/
|
|
245
|
+
suffix: _angular_core.InputSignal<string>;
|
|
246
|
+
/**
|
|
247
|
+
* `danger` draws the trigger in the danger status colours, for a choice that
|
|
248
|
+
* is risky to keep, such as running without permission prompts.
|
|
249
|
+
*/
|
|
250
|
+
tone: _angular_core.InputSignal<WmSelectTone>;
|
|
251
|
+
/**
|
|
252
|
+
* `trigger` holds the panel to the trigger's width. `content` lets it grow to
|
|
253
|
+
* its widest option, from the trigger's width up to 24rem, where a
|
|
254
|
+
* description wraps. A number is a fixed width in pixels. Left unset, a
|
|
255
|
+
* field's panel matches the trigger and a chip's panel fits its content.
|
|
256
|
+
*/
|
|
257
|
+
panelWidth: _angular_core.InputSignal<WmSelectPanelWidth>;
|
|
214
258
|
protected isOpen: _angular_core.WritableSignal<boolean>;
|
|
215
259
|
protected selectedOption: _angular_core.Signal<SelectOption>;
|
|
260
|
+
protected readonly sizing: _angular_core.Signal<WmSelectPanelWidth>;
|
|
216
261
|
private hostEl;
|
|
217
|
-
|
|
262
|
+
/**
|
|
263
|
+
* The trigger's width, measured as the panel opens. A width read on every
|
|
264
|
+
* check would differ between Angular's update pass and its no-changes pass
|
|
265
|
+
* whenever the trigger is resizing, which a chip does while its text renders.
|
|
266
|
+
*/
|
|
267
|
+
private readonly triggerWidth;
|
|
268
|
+
protected readonly overlayWidth: _angular_core.Signal<string | number>;
|
|
269
|
+
protected readonly overlayMinWidth: _angular_core.Signal<string | number>;
|
|
270
|
+
/** The overlay has no max-width input, so the cap sits on the panel it holds. */
|
|
271
|
+
protected readonly panelMaxWidth: _angular_core.Signal<"" | "24rem">;
|
|
218
272
|
protected positions: ConnectedPosition[];
|
|
219
273
|
protected toggleOpen(): void;
|
|
220
274
|
protected selectOption(opt: SelectOption): void;
|
|
221
275
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WmSelect, never>;
|
|
222
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WmSelect, "wm-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
276
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WmSelect, "wm-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "suffix": { "alias": "suffix"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
223
277
|
}
|
|
224
278
|
|
|
225
279
|
/**
|
|
@@ -1610,4 +1664,4 @@ declare class WmRichTooltip {
|
|
|
1610
1664
|
declare function onViewportChange(handler: () => void): () => void;
|
|
1611
1665
|
|
|
1612
1666
|
export { Checkbox, GhostField, NumberInput, PageHeader, Toggle, WmAnchoredScrollStrategy, WmAutoFocus, WmButton, WmButtonDirective, WmCombobox, WmDialog, WmModal, WmPopover, WmRichTooltip, WmRichTooltipContent, WmRichTooltipTrigger, WmSelect, WmSlider, WmTab, WmTabs, WmToastContainer, WmToastService, WmToggleGroup, WmToggleGroupItem, WmTooltip, onViewportChange };
|
|
1613
|
-
export type { ButtonSize, ButtonVariant, ComboboxOption, DialogSize, SelectOption, Toast, ToastType, WmSliderTick, WmSliderTickFn, WmSliderTrack, WmToggleGroupAppearance, WmToggleGroupSize, WmTooltipPosition, WmTooltipRelation };
|
|
1667
|
+
export type { ButtonSize, ButtonVariant, ComboboxOption, DialogSize, SelectOption, Toast, ToastType, WmSelectAppearance, WmSelectPanelWidth, WmSelectTone, WmSliderTick, WmSliderTickFn, WmSliderTrack, WmToggleGroupAppearance, WmToggleGroupSize, WmTooltipPosition, WmTooltipRelation };
|
package/package.json
CHANGED
package/themes.css
CHANGED
|
@@ -1107,7 +1107,8 @@
|
|
|
1107
1107
|
/* Text — Crisp Soft White with hint of mint */
|
|
1108
1108
|
--wm-text-primary: #d8e0d8;
|
|
1109
1109
|
--wm-text-secondary: #c2ccc2;
|
|
1110
|
-
|
|
1110
|
+
/* Muted sits visibly below secondary (Matt, 2026-10-02): #c0cac0 was 1% from #c2ccc2. */
|
|
1111
|
+
--wm-text-muted: #949d94;
|
|
1111
1112
|
--wm-text-placeholder: #687068;
|
|
1112
1113
|
|
|
1113
1114
|
/* Borders — Deep Stone */
|