@joanroucoux/cairn-ui 0.6.2 → 0.6.4

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.
@@ -506,21 +506,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
506
506
  }], propDecorators: { initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
507
507
  /**
508
508
  * Round hit area around a `ui-avatar` that links somewhere: 44px on touch, 40px from 64rem, with a
509
- * glow on hover and the press scale. The avatar itself keeps its own size.
509
+ * glow on hover and the press scale. On the current page (`aria-current="page"`, which `routerLinkActive`
510
+ * sets through `ariaCurrentWhenActive`) it holds a soft halo. The avatar itself keeps its own size.
510
511
  *
511
512
  * @example
512
513
  * <a uiAvatarLink routerLink="/profile"><ui-avatar initials="JR" label="Profile" size="auto" /></a>
513
514
  */
514
515
  class UiAvatarLink {
515
516
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiAvatarLink, deps: [], target: i0.ɵɵFactoryTarget.Directive });
516
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: UiAvatarLink, isStandalone: true, selector: "a[uiAvatarLink], button[uiAvatarLink]", host: { classAttribute: "rounded-pill grid size-11 lg:size-10 place-items-center cursor-pointer select-none touch-manipulation transition-[transform,background-color] duration-(--duration-press) ease-out hover:bg-(--glow) active:scale-(--press-scale) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)" }, ngImport: i0 });
517
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: UiAvatarLink, isStandalone: true, selector: "a[uiAvatarLink], button[uiAvatarLink]", host: { classAttribute: "rounded-pill grid size-11 lg:size-10 place-items-center cursor-pointer select-none touch-manipulation transition-[transform,background-color] duration-(--duration-press) ease-out hover:bg-(--glow) aria-[current=page]:bg-(--soft) active:scale-(--press-scale) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)" }, ngImport: i0 });
517
518
  }
518
519
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiAvatarLink, decorators: [{
519
520
  type: Directive,
520
521
  args: [{
521
522
  selector: 'a[uiAvatarLink], button[uiAvatarLink]',
522
523
  host: {
523
- class: 'rounded-pill grid size-11 lg:size-10 place-items-center cursor-pointer select-none touch-manipulation transition-[transform,background-color] duration-(--duration-press) ease-out hover:bg-(--glow) active:scale-(--press-scale) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)',
524
+ class: 'rounded-pill grid size-11 lg:size-10 place-items-center cursor-pointer select-none touch-manipulation transition-[transform,background-color] duration-(--duration-press) ease-out hover:bg-(--glow) aria-[current=page]:bg-(--soft) active:scale-(--press-scale) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)',
524
525
  },
525
526
  }]
526
527
  }] });
@@ -748,22 +749,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
748
749
  }], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], busy: [{ type: i0.Input, args: [{ isSignal: true, alias: "busy", required: false }] }] } });
749
750
 
750
751
  /** Available card variants. `CardVariant` is derived from this tuple. */
751
- const CARD_VARIANTS = ['default', 'elevated'];
752
+ const CARD_VARIANTS = ['default', 'elevated', 'inset'];
752
753
  /** Available card paddings. `CardPadding` is derived from this tuple. */
753
- const CARD_PADDINGS = ['none', 'sm', 'md', 'list', 'rows'];
754
+ const CARD_PADDINGS = ['none', 'xs', 'sm', 'md', 'list', 'rows', 'recap', 'panel'];
754
755
  /** Where the card surface (fill, border, radius) and its padding apply. `CardSurface` is derived from this tuple. */
755
756
  const CARD_SURFACES = ['always', 'lg', 'max-lg'];
757
+ /** Border of the card surface; `auto` follows the variant. `CardBorder` is derived from this tuple. */
758
+ const CARD_BORDERS = ['auto', 'none', 'border', 'hairline'];
756
759
  const BASE_CLASSES$3 = 'block';
757
760
  const VARIANT_CLASSES = {
758
761
  default: {
759
- always: 'rounded-container bg-(--card) shadow-[inset_0_0_0_1px_var(--border)] text-(--card-foreground)',
760
- lg: 'lg:rounded-container lg:bg-(--card) lg:shadow-[inset_0_0_0_1px_var(--border)] lg:text-(--card-foreground)',
761
- 'max-lg': 'max-lg:rounded-container max-lg:bg-(--card) max-lg:shadow-[inset_0_0_0_1px_var(--border)] max-lg:text-(--card-foreground)',
762
+ always: 'rounded-container bg-(--card) text-(--card-foreground)',
763
+ lg: 'lg:rounded-container lg:bg-(--card) lg:text-(--card-foreground)',
764
+ 'max-lg': 'max-lg:rounded-container max-lg:bg-(--card) max-lg:text-(--card-foreground)',
762
765
  },
763
766
  elevated: {
764
- always: 'rounded-container bg-(--elevated) shadow-[inset_0_0_0_1px_var(--hairline)] text-(--foreground)',
765
- lg: 'lg:rounded-container lg:bg-(--elevated) lg:shadow-[inset_0_0_0_1px_var(--hairline)] lg:text-(--foreground)',
766
- 'max-lg': 'max-lg:rounded-container max-lg:bg-(--elevated) max-lg:shadow-[inset_0_0_0_1px_var(--hairline)] max-lg:text-(--foreground)',
767
+ always: 'rounded-container bg-(--elevated) text-(--foreground)',
768
+ lg: 'lg:rounded-container lg:bg-(--elevated) lg:text-(--foreground)',
769
+ 'max-lg': 'max-lg:rounded-container max-lg:bg-(--elevated) max-lg:text-(--foreground)',
770
+ },
771
+ inset: {
772
+ always: 'rounded-control bg-(--background) text-(--foreground)',
773
+ lg: 'lg:rounded-control lg:bg-(--background) lg:text-(--foreground)',
774
+ 'max-lg': 'max-lg:rounded-control max-lg:bg-(--background) max-lg:text-(--foreground)',
775
+ },
776
+ };
777
+ const AUTO_BORDERS = {
778
+ default: 'border',
779
+ elevated: 'hairline',
780
+ inset: 'none',
781
+ };
782
+ const BORDER_CLASSES = {
783
+ none: { always: '', lg: '', 'max-lg': '' },
784
+ border: {
785
+ always: 'shadow-[inset_0_0_0_1px_var(--border)]',
786
+ lg: 'lg:shadow-[inset_0_0_0_1px_var(--border)]',
787
+ 'max-lg': 'max-lg:shadow-[inset_0_0_0_1px_var(--border)]',
788
+ },
789
+ hairline: {
790
+ always: 'shadow-[inset_0_0_0_1px_var(--hairline)]',
791
+ lg: 'lg:shadow-[inset_0_0_0_1px_var(--hairline)]',
792
+ 'max-lg': 'max-lg:shadow-[inset_0_0_0_1px_var(--hairline)]',
767
793
  },
768
794
  };
769
795
  const PADDING_CLASSES$1 = {
@@ -772,6 +798,11 @@ const PADDING_CLASSES$1 = {
772
798
  lg: 'lg:p-0',
773
799
  'max-lg': 'max-lg:p-0',
774
800
  },
801
+ xs: {
802
+ always: 'p-1',
803
+ lg: 'lg:p-1',
804
+ 'max-lg': 'max-lg:p-1',
805
+ },
775
806
  sm: {
776
807
  always: 'p-3',
777
808
  lg: 'lg:p-3',
@@ -792,14 +823,27 @@ const PADDING_CLASSES$1 = {
792
823
  lg: 'lg:px-(--inset-card) lg:py-1',
793
824
  'max-lg': 'max-lg:px-(--inset-card) max-lg:py-1',
794
825
  },
826
+ recap: {
827
+ always: 'px-3 py-1',
828
+ lg: 'lg:px-3 lg:py-1',
829
+ 'max-lg': 'max-lg:px-3 max-lg:py-1',
830
+ },
831
+ panel: {
832
+ always: 'px-3 py-2.5 lg:px-4 lg:py-3',
833
+ lg: 'lg:px-4 lg:py-3',
834
+ 'max-lg': 'max-lg:px-3 max-lg:py-2.5',
835
+ },
795
836
  };
796
837
  /**
797
838
  * Surface that groups related content: a summary block, a table, a side panel. `surface` limits the
798
839
  * fill, border, radius and padding to one side of `64rem`, for a block that is a card on a desktop and
799
- * plain on an iPhone, or the reverse.
840
+ * plain on an iPhone, or the reverse. `variant="inset"` is the `--background` box that sits inside a
841
+ * card or a dialog: a picked title, a results list, a recap, an empty-state panel.
800
842
  *
801
843
  * @example
802
844
  * <ui-card variant="elevated" padding="sm">Total</ui-card>
845
+ * <ui-card variant="inset" border="hairline" padding="xs">Results</ui-card>
846
+ * <ui-card padding="none" clip>Table that touches the edges, clipped to the corners</ui-card>
803
847
  * <ui-card surface="max-lg">Card on an iPhone, plain on a desktop</ui-card>
804
848
  */
805
849
  class UiCard {
@@ -809,10 +853,26 @@ class UiCard {
809
853
  ...(ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []));
810
854
  surface = input('always', /* @ts-ignore */
811
855
  ...(ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []));
812
- classes = computed(() => `${BASE_CLASSES$3} ${VARIANT_CLASSES[this.variant()][this.surface()]} ${PADDING_CLASSES$1[this.padding()][this.surface()]}`, /* @ts-ignore */
856
+ border = input('auto', /* @ts-ignore */
857
+ ...(ngDevMode ? [{ debugName: "border" }] : /* istanbul ignore next */ []));
858
+ clip = input(false, { ...(ngDevMode ? { debugName: "clip" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
859
+ classes = computed(() => {
860
+ const variant = this.variant();
861
+ const surface = this.surface();
862
+ const border = this.border();
863
+ return [
864
+ BASE_CLASSES$3,
865
+ VARIANT_CLASSES[variant][surface],
866
+ BORDER_CLASSES[border === 'auto' ? AUTO_BORDERS[variant] : border][surface],
867
+ PADDING_CLASSES$1[this.padding()][surface],
868
+ this.clip() ? 'overflow-hidden' : '',
869
+ ]
870
+ .filter(Boolean)
871
+ .join(' ');
872
+ }, /* @ts-ignore */
813
873
  ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
814
874
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
815
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiCard, isStandalone: true, selector: "ui-card", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, surface: { classPropertyName: "surface", publicName: "surface", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
875
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiCard, isStandalone: true, selector: "ui-card", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, surface: { classPropertyName: "surface", publicName: "surface", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null }, clip: { classPropertyName: "clip", publicName: "clip", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
816
876
  }
817
877
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiCard, decorators: [{
818
878
  type: Component,
@@ -823,7 +883,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
823
883
  '[class]': 'classes()',
824
884
  },
825
885
  }]
826
- }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], surface: [{ type: i0.Input, args: [{ isSignal: true, alias: "surface", required: false }] }] } });
886
+ }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], surface: [{ type: i0.Input, args: [{ isSignal: true, alias: "surface", required: false }] }], border: [{ type: i0.Input, args: [{ isSignal: true, alias: "border", required: false }] }], clip: [{ type: i0.Input, args: [{ isSignal: true, alias: "clip", required: false }] }] } });
827
887
 
828
888
  /**
829
889
  * Resolves to the styled control projected into a field.
@@ -1852,16 +1912,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
1852
1912
  }] });
1853
1913
 
1854
1914
  /** Available fact row sizes. `FactSize` is derived from this tuple. */
1855
- const FACT_SIZES = ['md', 'sm', 'auto'];
1915
+ const FACT_SIZES = ['md', 'sm', 'auto', 'recap'];
1856
1916
  /** Colour of the line under a fact value. `stale` flags an out-of-date figure. */
1857
1917
  const FACT_SUB_TONES = ['subtle', 'stale'];
1858
1918
  const SIZE_CLASSES$2 = {
1859
- md: { row: 'py-3 [&:not(:first-child)]:shadow-[inset_0_1px_0_var(--hairline)]', value: 'text-body' },
1860
- sm: { row: 'py-2.5', value: 'text-label' },
1919
+ md: { row: 'gap-4 py-3 [&:not(:first-child)]:shadow-[inset_0_1px_0_var(--hairline)]', value: 'text-body' },
1920
+ sm: { row: 'gap-4 py-2.5', value: 'text-label' },
1861
1921
  auto: {
1862
- row: 'py-3 lg:py-2.5 max-lg:[&:not(:first-child)]:shadow-[inset_0_1px_0_var(--hairline)]',
1922
+ row: 'gap-4 py-3 lg:py-2.5 max-lg:[&:not(:first-child)]:shadow-[inset_0_1px_0_var(--hairline)]',
1863
1923
  value: 'text-body lg:text-label',
1864
1924
  },
1925
+ recap: { row: 'gap-3 py-[9px] [&:not(:first-child)]:shadow-[inset_0_1px_0_var(--hairline)]', value: 'text-label' },
1865
1926
  };
1866
1927
  const SUB_TONE_CLASSES$1 = {
1867
1928
  subtle: 'text-(--subtle-foreground)',
@@ -1906,7 +1967,7 @@ class UiFact {
1906
1967
  ...(ngDevMode ? [{ debugName: "subTone" }] : /* istanbul ignore next */ []));
1907
1968
  size = input('md', /* @ts-ignore */
1908
1969
  ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
1909
- classes = computed(() => `flex items-baseline justify-between gap-4 ${SIZE_CLASSES$2[this.size()].row}`, /* @ts-ignore */
1970
+ classes = computed(() => `flex items-baseline justify-between ${SIZE_CLASSES$2[this.size()].row}`, /* @ts-ignore */
1910
1971
  ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
1911
1972
  valueClasses = computed(() => `${SIZE_CLASSES$2[this.size()].value} tabular-nums`, /* @ts-ignore */
1912
1973
  ...(ngDevMode ? [{ debugName: "valueClasses" }] : /* istanbul ignore next */ []));
@@ -3388,6 +3449,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
3388
3449
  host: { '[class]': 'classes()' },
3389
3450
  }]
3390
3451
  }], propDecorators: { ruled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ruled", required: false }] }] } });
3452
+ /**
3453
+ * The 36px filled tile that leads a row: an icon on a muted square with the control radius. Put it on
3454
+ * a `span` as the first child of a `ui-row` or a `uiListRow`.
3455
+ *
3456
+ * @example
3457
+ * <a ui-row size="xl" padding="sm" href="/export">
3458
+ * <span uiRowTile><svg lucideDownload [size]="18" /></span>
3459
+ * Export
3460
+ * </a>
3461
+ */
3462
+ class UiRowTile {
3463
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiRowTile, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3464
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: UiRowTile, isStandalone: true, selector: "[uiRowTile]", host: { classAttribute: "rounded-control grid size-9 flex-none place-items-center bg-(--muted)" }, ngImport: i0 });
3465
+ }
3466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiRowTile, decorators: [{
3467
+ type: Directive,
3468
+ args: [{
3469
+ selector: '[uiRowTile]',
3470
+ host: { class: 'rounded-control grid size-9 flex-none place-items-center bg-(--muted)' },
3471
+ }]
3472
+ }] });
3391
3473
 
3392
3474
  const nextId = (() => {
3393
3475
  let count = 0;
@@ -4158,5 +4240,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
4158
4240
  * Generated bundle index. Do not edit.
4159
4241
  */
4160
4242
 
4161
- 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_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, UiExternalLink, UiFact, UiFacts, UiField, UiFieldLeading, UiFieldTrailing, UiFilterChips, UiGroup, UiGroupCell, UiInput, UiLineChart, UiListRow, UiMenu, UiMenuItem, UiMenuTrigger, UiMeter, UiNavItem, UiRow, UiRowAction, UiRowItem, UiRowLink, UiSegmented, UiSelect, UiSkeleton, UiStat, UiSwitch, UiTab, UiTabBar, UiTable, UiTd, UiTextarea, UiTh, UiTr, formatAmount };
4243
+ 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_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, UiExternalLink, UiFact, UiFacts, UiField, UiFieldLeading, UiFieldTrailing, UiFilterChips, UiGroup, UiGroupCell, UiInput, UiLineChart, UiListRow, UiMenu, UiMenuItem, UiMenuTrigger, UiMeter, UiNavItem, UiRow, UiRowAction, UiRowItem, UiRowLink, UiRowTile, UiSegmented, UiSelect, UiSkeleton, UiStat, UiSwitch, UiTab, UiTabBar, UiTable, UiTd, UiTextarea, UiTh, UiTr, formatAmount };
4162
4244
  //# sourceMappingURL=joanroucoux-cairn-ui.mjs.map