@joanroucoux/cairn-ui 0.1.5 → 0.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.
@@ -13,52 +13,58 @@ type AvatarSize = (typeof AVATAR_SIZES)[number];
13
13
  declare class UiAvatar {
14
14
  readonly initials: _angular_core.InputSignal<string>;
15
15
  readonly label: _angular_core.InputSignal<string>;
16
- readonly size: _angular_core.InputSignal<"sm" | "md">;
16
+ readonly size: _angular_core.InputSignal<"md" | "sm">;
17
17
  protected readonly classes: _angular_core.Signal<string>;
18
18
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiAvatar, never>;
19
19
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiAvatar, "ui-avatar", never, { "initials": { "alias": "initials"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
20
20
  }
21
21
 
22
22
  /** Available badge variants. `BadgeVariant` is derived from this tuple. */
23
- declare const BADGE_VARIANTS: readonly ["primary", "secondary", "destructive", "outline"];
23
+ declare const BADGE_VARIANTS: readonly ["neutral", "outline"];
24
24
  type BadgeVariant = (typeof BADGE_VARIANTS)[number];
25
25
  /**
26
- * Small status descriptor for counts, states or labels.
26
+ * Small status descriptor for counts, states or labels, such as an instrument's asset class.
27
27
  *
28
28
  * @example
29
- * <ui-badge variant="secondary">Draft</ui-badge>
29
+ * <ui-badge>ETF</ui-badge>
30
30
  */
31
31
  declare class UiBadge {
32
- readonly variant: _angular_core.InputSignal<"primary" | "secondary" | "destructive" | "outline">;
32
+ readonly variant: _angular_core.InputSignal<"outline" | "neutral">;
33
33
  protected readonly classes: _angular_core.Signal<string>;
34
34
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiBadge, never>;
35
35
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiBadge, "ui-badge", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
36
36
  }
37
37
 
38
38
  /** Available button variants. `ButtonVariant` is derived from this tuple. */
39
- declare const BUTTON_VARIANTS: readonly ["primary", "secondary", "outline", "destructive", "ghost"];
39
+ declare const BUTTON_VARIANTS: readonly ["primary", "outline", "ghost", "destructive"];
40
40
  type ButtonVariant = (typeof BUTTON_VARIANTS)[number];
41
- /** Available button sizes. `md` is the 44px touch target Cairn asks for everywhere. */
42
- declare const BUTTON_SIZES: readonly ["sm", "md", "lg"];
41
+ /** Available button sizes. `md` is the touch target Cairn asks for everywhere. */
42
+ declare const BUTTON_SIZES: readonly ["md", "lg", "xl", "icon"];
43
43
  type ButtonSize = (typeof BUTTON_SIZES)[number];
44
44
  /**
45
45
  * Styled native button. Applied as an attribute so the host keeps every native
46
46
  * button behavior (type, disabled, form submission, accessibility) for free.
47
47
  *
48
48
  * Also applies to an anchor, for the one case where the action really is a navigation:
49
- * a download the browser has to perform itself. The element stays a link, and so does
50
- * its role - never use this to make an ordinary link look like a form control.
49
+ * a download the browser has to perform itself.
50
+ *
51
+ * `size="icon"` has no visible text: give it an `aria-label`.
52
+ *
53
+ * A `loading` button shows a spinner before its label and swallows clicks, so a slow first
54
+ * response cannot turn into a double submission.
51
55
  *
52
56
  * @example
53
- * <button ui-button variant="destructive" size="sm">Delete</button>
54
- * <a ui-button variant="outline" href="/api/holdings/export" download>Export</a>
57
+ * <button ui-button variant="destructive">Delete</button>
58
+ * <button ui-button size="icon" variant="ghost" aria-label="More actions">...</button>
55
59
  */
56
60
  declare class UiButton {
57
- readonly variant: _angular_core.InputSignal<"primary" | "secondary" | "destructive" | "outline" | "ghost">;
58
- readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
61
+ readonly variant: _angular_core.InputSignal<"primary" | "outline" | "ghost" | "destructive">;
62
+ readonly size: _angular_core.InputSignal<"md" | "lg" | "xl" | "icon">;
63
+ readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
59
64
  protected readonly classes: _angular_core.Signal<string>;
65
+ constructor();
60
66
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiButton, never>;
61
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiButton, "button[ui-button], a[ui-button]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
67
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiButton, "button[ui-button], a[ui-button]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
62
68
  }
63
69
 
64
70
  /** Available card variants. `CardVariant` is derived from this tuple. */
@@ -75,7 +81,7 @@ type CardPadding = (typeof CARD_PADDINGS)[number];
75
81
  */
76
82
  declare class UiCard {
77
83
  readonly variant: _angular_core.InputSignal<"default" | "elevated">;
78
- readonly padding: _angular_core.InputSignal<"sm" | "md" | "none">;
84
+ readonly padding: _angular_core.InputSignal<"md" | "sm" | "none">;
79
85
  protected readonly classes: _angular_core.Signal<string>;
80
86
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiCard, never>;
81
87
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiCard, "ui-card", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "padding": { "alias": "padding"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
@@ -178,10 +184,12 @@ declare class UiField {
178
184
  readonly labelHidden: _angular_core.InputSignalWithTransform<boolean, unknown>;
179
185
  readonly hint: _angular_core.InputSignal<string | undefined>;
180
186
  readonly error: _angular_core.InputSignal<string | undefined>;
187
+ /** Unit shown inside the control's right edge, such as `EUR` or `parts`. Not part of the control's value. */
188
+ readonly unit: _angular_core.InputSignal<string | undefined>;
181
189
  protected readonly hintId: string;
182
190
  protected readonly errorId: string;
183
191
  protected readonly control: _angular_core.Signal<UiControl | undefined>;
184
- protected readonly labelClasses: _angular_core.Signal<"sr-only" | "text-[13px] font-medium text-(--foreground)">;
192
+ protected readonly labelClasses: _angular_core.Signal<"sr-only" | "text-label font-medium text-(--muted-foreground)">;
185
193
  /**
186
194
  * The caller's own `error` wins: it is the only way to report something the control does not
187
195
  * know about, such as a search box refusing an empty query.
@@ -189,10 +197,10 @@ declare class UiField {
189
197
  protected readonly message: _angular_core.Signal<string | undefined>;
190
198
  constructor();
191
199
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiField, never>;
192
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiField, "ui-field", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "labelHidden": { "alias": "labelHidden"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; }, {}, ["control"], ["*"], true, never>;
200
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiField, "ui-field", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "labelHidden": { "alias": "labelHidden"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "unit": { "alias": "unit"; "required": false; "isSignal": true; }; }, {}, ["control"], ["*"], true, never>;
193
201
  }
194
202
 
195
- /** Available control sizes. `md` is the 44px touch target. */
203
+ /** Available control sizes. `md` is the 44/40px touch target. */
196
204
  declare const CONTROL_SIZES: readonly ["sm", "md"];
197
205
  type ControlSize = (typeof CONTROL_SIZES)[number];
198
206
  /**
@@ -207,7 +215,7 @@ type ControlSize = (typeof CONTROL_SIZES)[number];
207
215
  * <input uiInput type="email" placeholder="you@example.com" />
208
216
  */
209
217
  declare class UiInput implements UiControl {
210
- readonly size: _angular_core.InputSignal<"sm" | "md">;
218
+ readonly size: _angular_core.InputSignal<"md" | "sm">;
211
219
  readonly errors: _angular_core.InputSignal<readonly UiControlError[]>;
212
220
  readonly touched: _angular_core.InputSignal<boolean>;
213
221
  protected readonly classes: _angular_core.Signal<string>;
@@ -246,7 +254,7 @@ declare class UiMeter {
246
254
  readonly value: _angular_core.InputSignal<number>;
247
255
  readonly label: _angular_core.InputSignal<string>;
248
256
  readonly valueText: _angular_core.InputSignal<string>;
249
- readonly tone: _angular_core.InputSignal<2 | 4 | 5 | 3 | 1 | 6>;
257
+ readonly tone: _angular_core.InputSignal<4 | 1 | 2 | 3 | 5 | 6>;
250
258
  protected readonly percent: _angular_core.Signal<number>;
251
259
  protected readonly fillClasses: _angular_core.Signal<string>;
252
260
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiMeter, never>;
@@ -258,7 +266,8 @@ type SegmentedOption = {
258
266
  label: string;
259
267
  };
260
268
  /**
261
- * Exclusive choice within a small, known set: a time range, a unit, a mode.
269
+ * Exclusive choice within a small, known set: a time range, a unit, a mode. The selected option's
270
+ * background is a single thumb that slides under it in `transform`, instead of being redrawn.
262
271
  *
263
272
  * @example
264
273
  * <ui-segmented [options]="ranges" label="Time range" [(value)]="range" />
@@ -268,6 +277,7 @@ declare class UiSegmented {
268
277
  readonly label: _angular_core.InputSignal<string>;
269
278
  readonly value: _angular_core.ModelSignal<string>;
270
279
  protected readonly radios: _angular_core.Signal<readonly ElementRef<HTMLButtonElement>[]>;
280
+ protected readonly thumbIndex: _angular_core.Signal<number>;
271
281
  protected optionClasses(optionValue: string): string;
272
282
  protected tabIndexFor(optionValue: string): number;
273
283
  protected select(optionValue: string): void;
@@ -287,7 +297,7 @@ declare class UiSegmented {
287
297
  * <select uiSelect><option value="pea">PEA</option></select>
288
298
  */
289
299
  declare class UiSelect implements UiControl {
290
- readonly size: _angular_core.InputSignal<"sm" | "md">;
300
+ readonly size: _angular_core.InputSignal<"md" | "sm">;
291
301
  readonly errors: _angular_core.InputSignal<readonly UiControlError[]>;
292
302
  readonly touched: _angular_core.InputSignal<boolean>;
293
303
  protected readonly classes: _angular_core.Signal<string>;
@@ -296,19 +306,25 @@ declare class UiSelect implements UiControl {
296
306
  }
297
307
 
298
308
  /**
299
- * Decorative placeholder for content that is still loading. Deliberately hidden from
300
- * assistive technology: the calling screen keeps its own role="status" sentence.
309
+ * Decorative placeholder for content that is still loading, at the shape of the content it stands
310
+ * in for. Deliberately hidden from assistive technology: the calling screen keeps its own
311
+ * `role="status"` sentence.
312
+ *
313
+ * Pulses opacity from 1 to 0.45 and back over `--pulse-duration`, which `tokens.css` sets to `0ms`
314
+ * under `prefers-reduced-motion: reduce`: the pulse stops there with no branching in this component.
301
315
  *
302
316
  * @example
317
+ * <ui-skeleton shape="figure" />
303
318
  * <ui-skeleton [lines]="3" />
304
- * <ui-skeleton [height]="196" />
305
319
  */
306
320
  declare class UiSkeleton {
321
+ readonly shape: _angular_core.InputSignal<"text" | "figure" | "row" | "chart" | "ring">;
307
322
  readonly lines: _angular_core.InputSignal<number>;
308
323
  readonly height: _angular_core.InputSignal<number>;
324
+ protected readonly animation = "cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate";
309
325
  protected readonly bars: _angular_core.Signal<("62%" | "100%")[]>;
310
326
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiSkeleton, never>;
311
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSkeleton, "ui-skeleton", never, { "lines": { "alias": "lines"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
327
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSkeleton, "ui-skeleton", never, { "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "lines": { "alias": "lines"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
312
328
  }
313
329
 
314
330
  /** Available stat sizes. `StatSize` is derived from this tuple. */
@@ -332,7 +348,7 @@ type StatSize = (typeof STAT_SIZES)[number];
332
348
  declare class UiStat {
333
349
  readonly label: _angular_core.InputSignal<string>;
334
350
  readonly size: _angular_core.InputSignal<"hero" | "tile">;
335
- protected readonly labelClasses = "text-[13px] font-medium text-(--subtle-foreground)";
351
+ protected readonly labelClasses = "text-label font-medium text-(--subtle-foreground)";
336
352
  protected readonly valueClasses: _angular_core.Signal<string>;
337
353
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiStat, never>;
338
354
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiStat, "ui-stat", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["[uiStatValue]", "[uiStatDelta]", "[uiStatCaption]", "[uiStatAside]"], true, never>;
@@ -346,6 +362,20 @@ declare class UiTable {
346
362
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTable, never>;
347
363
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiTable, "table[uiTable]", never, {}, {}, never, never, true, never>;
348
364
  }
365
+ /**
366
+ * Body or group row. `group` draws the muted banner that opens each account inside a list of
367
+ * holdings: it carries no hover state of its own, unlike an ordinary row.
368
+ *
369
+ * @example
370
+ * <tr uiTr>...
371
+ * <tr uiTr group>...
372
+ */
373
+ declare class UiTr {
374
+ readonly group: _angular_core.InputSignalWithTransform<boolean, unknown>;
375
+ protected readonly classes: _angular_core.Signal<"min-h-(--row-min) rounded-control bg-(--muted) font-semibold" | "rounded-control hover:bg-(--glow)">;
376
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTr, never>;
377
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiTr, "tr[uiTr]", never, { "group": { "alias": "group"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
378
+ }
349
379
  /**
350
380
  * Column header. `numeric` right-aligns and lines the digits up; `from` holds a
351
381
  * secondary column back until the viewport is wide enough for it.
@@ -369,5 +399,5 @@ declare class UiTd {
369
399
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiTd, "td[uiTd]", never, { "numeric": { "alias": "numeric"; "required": false; "isSignal": true; }; "from": { "alias": "from"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
370
400
  }
371
401
 
372
- export { AVATAR_SIZES, BADGE_VARIANTS, BUTTON_SIZES, BUTTON_VARIANTS, CARD_PADDINGS, CARD_VARIANTS, CELL_BREAKPOINTS, CONTROL_SIZES, DELTA_EMPHASES, DIALOG_WIDTHS, METER_TONES, STAT_SIZES, UiAvatar, UiBadge, UiButton, UiCard, UiDelta, UiDialog, UiField, UiInput, UiMeter, UiSegmented, UiSelect, UiSkeleton, UiStat, UiTable, UiTd, UiTextarea, UiTh };
402
+ export { AVATAR_SIZES, BADGE_VARIANTS, BUTTON_SIZES, BUTTON_VARIANTS, CARD_PADDINGS, CARD_VARIANTS, CELL_BREAKPOINTS, CONTROL_SIZES, DELTA_EMPHASES, DIALOG_WIDTHS, METER_TONES, STAT_SIZES, UiAvatar, UiBadge, UiButton, UiCard, UiDelta, UiDialog, UiField, UiInput, UiMeter, UiSegmented, UiSelect, UiSkeleton, UiStat, UiTable, UiTd, UiTextarea, UiTh, UiTr };
373
403
  export type { AvatarSize, BadgeVariant, ButtonSize, ButtonVariant, CardPadding, CardVariant, CellBreakpoint, ControlSize, DeltaEmphasis, DialogWidth, MeterTone, SegmentedOption, StatSize, UiControlError };