@joanroucoux/cairn-ui 0.7.0 → 0.7.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joanroucoux/cairn-ui",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Cairn UI — a monochrome, accessible Angular design system.",
5
5
  "keywords": [
6
6
  "angular",
@@ -3,7 +3,7 @@ import { InjectionToken, Signal, ElementRef } from '@angular/core';
3
3
 
4
4
  /**
5
5
  * Bar of actions fixed above the tab bar on iPhone: the primary actions of a detail screen, within
6
- * thumb reach. It sits 52px plus the safe area above the bottom edge, so it clears `ui-tab-bar`, and
6
+ * thumb reach. It sits `--tab-bar-height` (52px plus the safe area) above the bottom edge, so it clears `ui-tab-bar`, and
7
7
  * it is hidden from `64rem`, where the same actions live in the page itself. Its children share the
8
8
  * width equally. While it is on the page it publishes its height as `--action-bar-height` on the
9
9
  * root element, which `ui-toaster` adds to its offset so a confirmation never covers the actions.
@@ -364,6 +364,9 @@ type DialogCloseReason = (typeof DIALOG_CLOSE_REASONS)[number];
364
364
  /**
365
365
  * Modal dialog on the native <dialog>: a bottom sheet under `64rem`, centered above it.
366
366
  *
367
+ * `busy` keeps it open while its action runs: Escape, a click on the backdrop and a drag of the sheet do
368
+ * nothing and the cross is disabled. The owner disables its own buttons and still closes it through `open`.
369
+ *
367
370
  * @example
368
371
  * <ui-dialog heading="Buy" description="Ferrari" closeLabel="Close" width="528px" [open]="buying()" (dismissed)="buying.set(false)">
369
372
  * <p>Body</p>
@@ -380,6 +383,7 @@ declare class UiDialog {
380
383
  readonly truncateDescription: _angular_core.InputSignalWithTransform<boolean, unknown>;
381
384
  readonly width: _angular_core.InputSignal<"md" | "lg" | (string & {})>;
382
385
  readonly open: _angular_core.InputSignalWithTransform<boolean, unknown>;
386
+ readonly busy: _angular_core.InputSignalWithTransform<boolean, unknown>;
383
387
  readonly dismissed: _angular_core.OutputEmitterRef<void>;
384
388
  readonly closed: _angular_core.OutputEmitterRef<"drag" | "escape" | "backdrop" | "cross" | "programmatic">;
385
389
  protected readonly headingId: string;
@@ -398,11 +402,12 @@ declare class UiDialog {
398
402
  constructor();
399
403
  protected close(reason: DialogCloseReason): void;
400
404
  protected onCancel(event: Event): void;
405
+ protected onKeydown(event: KeyboardEvent): void;
401
406
  protected onPointerDown(event: MouseEvent): void;
402
407
  protected onClick(event: MouseEvent): void;
403
408
  protected onNativeClose(): void;
404
409
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiDialog, never>;
405
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiDialog, "ui-dialog", never, { "heading": { "alias": "heading"; "required": true; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "closeLabel": { "alias": "closeLabel"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "truncateDescription": { "alias": "truncateDescription"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; "closed": "closed"; }, never, ["*", "[dialogActions]"], true, never>;
410
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiDialog, "ui-dialog", never, { "heading": { "alias": "heading"; "required": true; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "closeLabel": { "alias": "closeLabel"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "truncateDescription": { "alias": "truncateDescription"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; "closed": "closed"; }, never, ["*", "[dialogActions]"], true, never>;
406
411
  }
407
412
 
408
413
  type DonutSlice = {
@@ -869,17 +874,35 @@ declare class UiMeter {
869
874
  }
870
875
 
871
876
  /**
872
- * Slides the remaining children of a list into place when one is removed or inserted (FLIP): it
873
- * measures every child before and after the change, then animates the shift in `translateY` over
874
- * `--duration-base` `--ease-out`. Pair it with `animate.leave="ui-leave-fade"` on the item so it fades
877
+ * Slides the items of a list into place when one is removed or inserted (FLIP): it measures every item
878
+ * before and after the change, from the top of the list itself, then animates the shift in `translateY`
879
+ * over `--duration-base` `--ease-out`. Pair it with `animate.leave="ui-leave-fade"` on the item so it fades
875
880
  * out first. Nothing moves under `prefers-reduced-motion`: the list closes up at once.
876
881
  *
882
+ * By default the items are the direct children of the list. Mark them with `uiFlipItem` instead when they
883
+ * sit deeper, for instance a page of several groups: put `uiFlipList` on the element around every group and
884
+ * `uiFlipItem` on each group heading and row, so a removal also slides the groups below. An item may sit
885
+ * inside another item (a row inside a card): it then moves by its own share and its card carries the rest.
886
+ * Only an item added or removed starts a slide; a change inside an item does not. Positions leave out the
887
+ * translate of any animation running inside the list (a slide in progress, an enter fade-up).
888
+ *
877
889
  * @example
878
890
  * <ul uiFlipList>
879
891
  * @for (key of keys(); track key.id) {
880
892
  * <li uiListRow animate.leave="ui-leave-fade">...</li>
881
893
  * }
882
894
  * </ul>
895
+ *
896
+ * <table uiTable uiFlipList>
897
+ * @for (group of groups(); track group.id) {
898
+ * <tbody>
899
+ * <tr uiTr group uiFlipItem>...</tr>
900
+ * @for (row of group.rows; track row.id) {
901
+ * <tr uiTr uiFlipItem animate.leave="ui-leave-fade">...</tr>
902
+ * }
903
+ * </tbody>
904
+ * }
905
+ * </table>
883
906
  */
884
907
  declare class UiFlipList {
885
908
  private readonly host;
@@ -888,14 +911,29 @@ declare class UiFlipList {
888
911
  private readonly resizes;
889
912
  private readonly running;
890
913
  private readonly watched;
914
+ private readonly items;
891
915
  private tops;
916
+ private shifts;
892
917
  constructor();
918
+ private tracked;
893
919
  private measure;
894
- private interruptedOffset;
895
920
  private onChange;
921
+ private parentItem;
896
922
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiFlipList, never>;
897
923
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiFlipList, "[uiFlipList]", never, {}, {}, never, never, true, never>;
898
924
  }
925
+ /**
926
+ * Marks an element as an item of the nearest `uiFlipList`, at any depth: a group heading, a row inside a
927
+ * group, a card. Once one item is marked, the list follows its marked items only.
928
+ *
929
+ * @example
930
+ * <tr uiTr uiFlipItem animate.leave="ui-leave-fade">...</tr>
931
+ */
932
+ declare class UiFlipItem {
933
+ constructor();
934
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiFlipItem, never>;
935
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiFlipItem, "[uiFlipItem]", never, {}, {}, never, never, true, never>;
936
+ }
899
937
 
900
938
  /**
901
939
  * Draws the eye to an element that just changed: scrolls it into view when it is off screen, holds the
@@ -905,6 +943,10 @@ declare class UiFlipList {
905
943
  * cells, on a `td[ui-group-cell]` the band, anywhere else the host. Under `prefers-reduced-motion` the
906
944
  * scroll is instant and the fade lasts 600 ms.
907
945
  *
946
+ * It starts on the next frame and, when the element is still playing a finite animation of its own (an
947
+ * `animate.enter` fade on a new row), once that animation has finished, waiting no longer than
948
+ * `--duration-base`: the element fades in, then lights up. Both can sit on the same element.
949
+ *
908
950
  * Give the element `scroll-margin-top` and `scroll-margin-bottom` equal to what is pinned above and
909
951
  * below it (header, tab bar, action bar): a row under them counts as off screen and is scrolled out.
910
952
  * For an arrival on a page opened at the element, scroll to it at once first (`scrollIntoView` in
@@ -1107,7 +1149,7 @@ declare class UiSkeleton {
1107
1149
  */
1108
1150
  declare class UiStaleLink {
1109
1151
  readonly chevron: _angular_core.InputSignalWithTransform<boolean, unknown>;
1110
- protected readonly classes: _angular_core.Signal<"inline-flex items-center gap-0.5 rounded-[4px] text-caption font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)" | "inline-flex items-center gap-0.5 rounded-[4px] text-caption font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) after:size-4 after:flex-none after:bg-current after:content-[''] after:mask-center after:mask-no-repeat after:mask-[url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m9%2018%206-6-6-6%27%2F%3E%3C%2Fsvg%3E)]">;
1152
+ protected readonly classes: _angular_core.Signal<"relative inline-flex items-center gap-0.5 rounded-[4px] text-caption font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-['']" | "relative inline-flex items-center gap-0.5 rounded-[4px] text-caption font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-[''] after:size-4 after:flex-none after:bg-current after:content-[''] after:mask-center after:mask-no-repeat after:mask-[url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m9%2018%206-6-6-6%27%2F%3E%3C%2Fsvg%3E)]">;
1111
1153
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiStaleLink, never>;
1112
1154
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiStaleLink, "a[uiStaleLink]", never, { "chevron": { "alias": "chevron"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1113
1155
  }
@@ -1154,7 +1196,9 @@ declare class UiSwitch {
1154
1196
  }
1155
1197
 
1156
1198
  /**
1157
- * Bottom navigation bar for iPhone: 52px of tabs plus the home indicator's safe area.
1199
+ * Bottom navigation bar for iPhone: 52px of tabs plus the home indicator's safe area. While it is on the
1200
+ * page it publishes that height as `--tab-bar-height` on the root element, which `ui-action-bar` and
1201
+ * `ui-toaster` sit above; use it rather than restating 52px for anything that must clear the bar.
1158
1202
  *
1159
1203
  * @example
1160
1204
  * <nav ui-tab-bar>
@@ -1162,6 +1206,7 @@ declare class UiSwitch {
1162
1206
  * </nav>
1163
1207
  */
1164
1208
  declare class UiTabBar {
1209
+ constructor();
1165
1210
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTabBar, never>;
1166
1211
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTabBar, "nav[ui-tab-bar]", never, {}, {}, never, ["*"], true, never>;
1167
1212
  }
@@ -1359,5 +1404,5 @@ declare class UiCellSub {
1359
1404
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<UiCellSub, "[uiCellSub]", never, { "narrow": { "alias": "narrow"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1360
1405
  }
1361
1406
 
1362
- export { ALERT_VARIANTS, AMOUNT_MASKINGS, AMOUNT_NUMERICS, ASYNC_ALIGNS, ASYNC_STATES, ASYNC_VARIANTS, AVATAR_SIZES, BACK_LINK_SIZES, BADGE_SIZES, BADGE_VARIANTS, BUTTON_SIZES, BUTTON_VARIANTS, CARD_PADDINGS, CARD_SURFACES, CARD_VARIANTS, CELL_BREAKPOINTS, CONTROL_SIZES, CONTROL_SURFACES, DELTA_EMPHASES, DELTA_SIZES, DELTA_WEIGHTS, DIALOG_CLOSE_REASONS, DIALOG_LAYOUTS, DIALOG_WIDTHS, FACT_SIZES, FACT_SUB_TONES, GROUP_SIZES, METER_SIZES, METER_TONES, ROW_GAPS, ROW_PADDINGS, ROW_SIZES, SEGMENTED_SIZES, SKELETON_SHAPES, STAT_SIZES, SUB_TONES, TABLE_ROWS, UI_AMOUNT_MASKED, UiActionBar, UiAlert, UiAmount, UiAsync, UiAvatar, UiAvatarLink, UiBackLink, UiBadge, UiButton, UiCard, UiCellSub, UiChoiceChips, UiDelta, UiDialog, UiDonut, UiEmpty, UiExternalLink, UiFact, UiFacts, UiField, UiFieldLeading, UiFieldTrailing, UiFilterChips, UiFlipList, UiGroup, UiGroupCell, UiHighlight, UiInput, UiLineChart, UiListRow, UiMenu, UiMenuItem, UiMenuTrigger, UiMeter, UiNavItem, UiRow, UiRowAction, UiRowItem, UiRowLink, UiRowTile, UiSegmented, UiSelect, UiSkeleton, UiStaleLink, UiStat, UiSwitch, UiTab, UiTabBar, UiTable, UiTd, UiTextarea, UiTh, UiToaster, UiToasts, UiTr, delayedState, formatAmount, injectReducedMotion };
1407
+ export { ALERT_VARIANTS, AMOUNT_MASKINGS, AMOUNT_NUMERICS, ASYNC_ALIGNS, ASYNC_STATES, ASYNC_VARIANTS, AVATAR_SIZES, BACK_LINK_SIZES, BADGE_SIZES, BADGE_VARIANTS, BUTTON_SIZES, BUTTON_VARIANTS, CARD_PADDINGS, CARD_SURFACES, CARD_VARIANTS, CELL_BREAKPOINTS, CONTROL_SIZES, CONTROL_SURFACES, DELTA_EMPHASES, DELTA_SIZES, DELTA_WEIGHTS, DIALOG_CLOSE_REASONS, DIALOG_LAYOUTS, DIALOG_WIDTHS, FACT_SIZES, FACT_SUB_TONES, GROUP_SIZES, METER_SIZES, METER_TONES, ROW_GAPS, ROW_PADDINGS, ROW_SIZES, SEGMENTED_SIZES, SKELETON_SHAPES, STAT_SIZES, SUB_TONES, TABLE_ROWS, UI_AMOUNT_MASKED, UiActionBar, UiAlert, UiAmount, UiAsync, UiAvatar, UiAvatarLink, UiBackLink, UiBadge, UiButton, UiCard, UiCellSub, UiChoiceChips, UiDelta, UiDialog, UiDonut, UiEmpty, UiExternalLink, UiFact, UiFacts, UiField, UiFieldLeading, UiFieldTrailing, UiFilterChips, UiFlipItem, UiFlipList, UiGroup, UiGroupCell, UiHighlight, UiInput, UiLineChart, UiListRow, UiMenu, UiMenuItem, UiMenuTrigger, UiMeter, UiNavItem, UiRow, UiRowAction, UiRowItem, UiRowLink, UiRowTile, UiSegmented, UiSelect, UiSkeleton, UiStaleLink, UiStat, UiSwitch, UiTab, UiTabBar, UiTable, UiTd, UiTextarea, UiTh, UiToaster, UiToasts, UiTr, delayedState, formatAmount, injectReducedMotion };
1363
1408
  export type { AlertVariant, AmountFormatOptions, AmountMasking, AmountNumeric, AsyncAlign, AsyncState, AsyncVariant, AvatarSize, AxisTicks, BackLinkSize, BadgeSize, BadgeVariant, ButtonSize, ButtonVariant, CardPadding, CardSurface, CardVariant, CellBreakpoint, ChartPoint, ChoiceChipOption, ControlSize, ControlSurface, DeltaEmphasis, DeltaSize, DeltaWeight, DialogCloseReason, DialogLayout, DialogWidth, DonutSlice, FactSize, FactSubTone, FilterChipOption, GroupSize, MeterSize, MeterTone, RowGap, RowPadding, RowSize, SegmentedOption, SegmentedSize, SkeletonShape, StatSize, SubTone, TableRow, Toast, TooltipSize, UiControlError };