@entifix/react-controls 0.21.0 → 0.22.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/dist/i18n/catalog/en.d.ts.map +1 -1
- package/dist/i18n/catalog/en.js +4 -0
- package/dist/i18n/catalog/en.js.map +1 -1
- package/dist/i18n/catalog/es.d.ts +4 -0
- package/dist/i18n/catalog/es.d.ts.map +1 -1
- package/dist/i18n/catalog/es.js +4 -0
- package/dist/i18n/catalog/es.js.map +1 -1
- package/dist/i18n/catalog/index.d.ts +8 -0
- package/dist/i18n/catalog/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/primitives.d.ts +2 -0
- package/dist/primitives.d.ts.map +1 -1
- package/dist/primitives.js +2 -0
- package/dist/primitives.js.map +1 -1
- package/dist/ui/atoms/cell-value/cell-value.d.ts.map +1 -1
- package/dist/ui/atoms/cell-value/cell-value.js +11 -0
- package/dist/ui/atoms/cell-value/cell-value.js.map +1 -1
- package/dist/ui/atoms/media-image/index.d.ts +2 -0
- package/dist/ui/atoms/media-image/index.d.ts.map +1 -0
- package/dist/ui/atoms/media-image/index.js +3 -0
- package/dist/ui/atoms/media-image/index.js.map +1 -0
- package/dist/ui/atoms/media-image/media-image.d.ts +46 -0
- package/dist/ui/atoms/media-image/media-image.d.ts.map +1 -0
- package/dist/ui/atoms/media-image/media-image.js +57 -0
- package/dist/ui/atoms/media-image/media-image.js.map +1 -0
- package/dist/ui/atoms/status-tag/status-tag.d.ts +6 -2
- package/dist/ui/atoms/status-tag/status-tag.d.ts.map +1 -1
- package/dist/ui/atoms/status-tag/status-tag.js.map +1 -1
- package/dist/ui/molecules/media-gallery/media-gallery.d.ts +30 -3
- package/dist/ui/molecules/media-gallery/media-gallery.d.ts.map +1 -1
- package/dist/ui/molecules/media-gallery/media-gallery.js +26 -6
- package/dist/ui/molecules/media-gallery/media-gallery.js.map +1 -1
- package/dist/ui/molecules/summary-tile/index.d.ts +2 -0
- package/dist/ui/molecules/summary-tile/index.d.ts.map +1 -0
- package/dist/ui/molecules/summary-tile/index.js +3 -0
- package/dist/ui/molecules/summary-tile/index.js.map +1 -0
- package/dist/ui/molecules/summary-tile/summary-tile.d.ts +57 -0
- package/dist/ui/molecules/summary-tile/summary-tile.d.ts.map +1 -0
- package/dist/ui/molecules/summary-tile/summary-tile.js +114 -0
- package/dist/ui/molecules/summary-tile/summary-tile.js.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.d.ts +1 -1
- package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.js +2 -2
- package/dist/ui/organisms/entity-table/entity-table.js.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts +7 -0
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -1
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts +5 -4
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js +21 -6
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The widths a {@link MediaImageLoader} is asked for, narrow to wide. A fixed
|
|
4
|
+
* ladder rather than one per caller: every image on a host is cut at the same
|
|
5
|
+
* few sizes, which is what lets a resizing service cache them.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MEDIA_IMAGE_WIDTHS: readonly [320, 480, 640, 960, 1280, 1920];
|
|
8
|
+
/**
|
|
9
|
+
* The URL of `src` resized to `width` pixels wide. Supplied by the host, which
|
|
10
|
+
* knows which service, if any, can resize its images; without one, an image
|
|
11
|
+
* is served as it is.
|
|
12
|
+
*/
|
|
13
|
+
export type MediaImageLoader = (src: string, width: number) => string;
|
|
14
|
+
export interface MediaImageProps extends Omit<ComponentPropsWithoutRef<'img'>, 'src' | 'alt' | 'width' | 'height' | 'sizes' | 'srcSet' | 'loading' | 'decoding' | 'fetchPriority'> {
|
|
15
|
+
src: string;
|
|
16
|
+
/** What the image shows. Empty only for an image that adds nothing to the text beside it. */
|
|
17
|
+
alt: string;
|
|
18
|
+
/** Intrinsic width in pixels, when known. */
|
|
19
|
+
width?: number;
|
|
20
|
+
/** Intrinsic height in pixels, when known. */
|
|
21
|
+
height?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Width over height of the box the image is shown in. The box is reserved
|
|
24
|
+
* before the image arrives, so nothing below it moves when it does.
|
|
25
|
+
* Defaults to `1`, a square.
|
|
26
|
+
*/
|
|
27
|
+
aspectRatio?: number;
|
|
28
|
+
/** How wide the image is shown at, as a `sizes` attribute (`(min-width: 48rem) 50vw, 100vw`). */
|
|
29
|
+
sizes: string;
|
|
30
|
+
/**
|
|
31
|
+
* The image is the first thing a reader sees: fetched first and at once,
|
|
32
|
+
* never lazily. One per page at most.
|
|
33
|
+
*/
|
|
34
|
+
priority?: boolean;
|
|
35
|
+
/** Resizes `src` per width; given, the image offers one candidate per {@link MEDIA_IMAGE_WIDTHS}. */
|
|
36
|
+
loader?: MediaImageLoader;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* One image, sized for where it is shown. Its box is reserved by aspect
|
|
40
|
+
* ratio, so a late image shifts nothing; it is fetched lazily unless it is the
|
|
41
|
+
* `priority` one; and with a host `loader` it offers a `srcset` the browser
|
|
42
|
+
* picks the smallest fitting candidate from. Without a loader there is nothing
|
|
43
|
+
* to choose between, and no `srcset` is written. Server-safe.
|
|
44
|
+
*/
|
|
45
|
+
export declare function MediaImage({ src, alt, width, height, aspectRatio, sizes, priority, loader, className, style, ...props }: MediaImageProps): import("react").JSX.Element;
|
|
46
|
+
//# sourceMappingURL=media-image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-image.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/media-image/media-image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAItD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,2CAA4C,CAAC;AAE5E;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAEtE,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,wBAAwB,CAAC,KAAK,CAAC,EAC7B,KAAK,GACL,KAAK,GACL,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,GACT,UAAU,GACV,eAAe,CAClB;IACC,GAAG,EAAE,MAAM,CAAC;IACZ,6FAA6F;IAC7F,GAAG,EAAE,MAAM,CAAC;IACZ,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iGAAiG;IACjG,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qGAAqG;IACrG,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EACzB,GAAG,EACH,GAAG,EACH,KAAK,EACL,MAAM,EACN,WAAe,EACf,KAAK,EACL,QAAgB,EAChB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,eAAe,+BAqBjB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cn } from '../../utils/cn.js';
|
|
5
|
+
/**
|
|
6
|
+
* The widths a {@link MediaImageLoader} is asked for, narrow to wide. A fixed
|
|
7
|
+
* ladder rather than one per caller: every image on a host is cut at the same
|
|
8
|
+
* few sizes, which is what lets a resizing service cache them.
|
|
9
|
+
*/ export const MEDIA_IMAGE_WIDTHS = [
|
|
10
|
+
320,
|
|
11
|
+
480,
|
|
12
|
+
640,
|
|
13
|
+
960,
|
|
14
|
+
1280,
|
|
15
|
+
1920
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* One image, sized for where it is shown. Its box is reserved by aspect
|
|
19
|
+
* ratio, so a late image shifts nothing; it is fetched lazily unless it is the
|
|
20
|
+
* `priority` one; and with a host `loader` it offers a `srcset` the browser
|
|
21
|
+
* picks the smallest fitting candidate from. Without a loader there is nothing
|
|
22
|
+
* to choose between, and no `srcset` is written. Server-safe.
|
|
23
|
+
*/ export function MediaImage(_0) {
|
|
24
|
+
let { src, alt, width, height, aspectRatio = 1, sizes, priority = false, loader, className, style } = _0, props = _object_without_properties_loose(_0, [
|
|
25
|
+
"src",
|
|
26
|
+
"alt",
|
|
27
|
+
"width",
|
|
28
|
+
"height",
|
|
29
|
+
"aspectRatio",
|
|
30
|
+
"sizes",
|
|
31
|
+
"priority",
|
|
32
|
+
"loader",
|
|
33
|
+
"className",
|
|
34
|
+
"style"
|
|
35
|
+
]);
|
|
36
|
+
const srcSet = loader === undefined ? undefined : MEDIA_IMAGE_WIDTHS.map((w)=>`${loader(src, w)} ${w}w`).join(', ');
|
|
37
|
+
return /*#__PURE__*/ _jsx("img", _extends({
|
|
38
|
+
src: src,
|
|
39
|
+
alt: alt,
|
|
40
|
+
width: width,
|
|
41
|
+
height: height,
|
|
42
|
+
sizes: sizes,
|
|
43
|
+
srcSet: srcSet
|
|
44
|
+
}, priority ? {
|
|
45
|
+
fetchPriority: 'high'
|
|
46
|
+
} : {
|
|
47
|
+
loading: 'lazy',
|
|
48
|
+
decoding: 'async'
|
|
49
|
+
}, {
|
|
50
|
+
className: cn('block h-auto w-full object-contain', className),
|
|
51
|
+
style: _extends({
|
|
52
|
+
aspectRatio
|
|
53
|
+
}, style)
|
|
54
|
+
}, props));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=media-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/atoms/media-image/media-image.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\n/**\n * The widths a {@link MediaImageLoader} is asked for, narrow to wide. A fixed\n * ladder rather than one per caller: every image on a host is cut at the same\n * few sizes, which is what lets a resizing service cache them.\n */\nexport const MEDIA_IMAGE_WIDTHS = [320, 480, 640, 960, 1280, 1920] as const;\n\n/**\n * The URL of `src` resized to `width` pixels wide. Supplied by the host, which\n * knows which service, if any, can resize its images; without one, an image\n * is served as it is.\n */\nexport type MediaImageLoader = (src: string, width: number) => string;\n\nexport interface MediaImageProps extends Omit<\n ComponentPropsWithoutRef<'img'>,\n | 'src'\n | 'alt'\n | 'width'\n | 'height'\n | 'sizes'\n | 'srcSet'\n | 'loading'\n | 'decoding'\n | 'fetchPriority'\n> {\n src: string;\n /** What the image shows. Empty only for an image that adds nothing to the text beside it. */\n alt: string;\n /** Intrinsic width in pixels, when known. */\n width?: number;\n /** Intrinsic height in pixels, when known. */\n height?: number;\n /**\n * Width over height of the box the image is shown in. The box is reserved\n * before the image arrives, so nothing below it moves when it does.\n * Defaults to `1`, a square.\n */\n aspectRatio?: number;\n /** How wide the image is shown at, as a `sizes` attribute (`(min-width: 48rem) 50vw, 100vw`). */\n sizes: string;\n /**\n * The image is the first thing a reader sees: fetched first and at once,\n * never lazily. One per page at most.\n */\n priority?: boolean;\n /** Resizes `src` per width; given, the image offers one candidate per {@link MEDIA_IMAGE_WIDTHS}. */\n loader?: MediaImageLoader;\n}\n\n/**\n * One image, sized for where it is shown. Its box is reserved by aspect\n * ratio, so a late image shifts nothing; it is fetched lazily unless it is the\n * `priority` one; and with a host `loader` it offers a `srcset` the browser\n * picks the smallest fitting candidate from. Without a loader there is nothing\n * to choose between, and no `srcset` is written. Server-safe.\n */\nexport function MediaImage({\n src,\n alt,\n width,\n height,\n aspectRatio = 1,\n sizes,\n priority = false,\n loader,\n className,\n style,\n ...props\n}: MediaImageProps) {\n const srcSet =\n loader === undefined\n ? undefined\n : MEDIA_IMAGE_WIDTHS.map(w => `${loader(src, w)} ${w}w`).join(', ');\n return (\n <img\n src={src}\n alt={alt}\n width={width}\n height={height}\n sizes={sizes}\n srcSet={srcSet}\n {...(priority\n ? { fetchPriority: 'high' as const }\n : { loading: 'lazy' as const, decoding: 'async' as const })}\n className={cn('block h-auto w-full object-contain', className)}\n style={{ aspectRatio, ...style }}\n {...props}\n />\n );\n}\n"],"names":["cn","MEDIA_IMAGE_WIDTHS","MediaImage","src","alt","width","height","aspectRatio","sizes","priority","loader","className","style","props","srcSet","undefined","map","w","join","img","fetchPriority","loading","decoding"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AAEvC;;;;CAIC,GACD,OAAO,MAAMC,qBAAqB;IAAC;IAAK;IAAK;IAAK;IAAK;IAAM;CAAK,CAAU;AA6C5E;;;;;;CAMC,GACD,OAAO,SAASC,WAAW,EAYT;QAZS,EACzBC,GAAG,EACHC,GAAG,EACHC,KAAK,EACLC,MAAM,EACNC,cAAc,CAAC,EACfC,KAAK,EACLC,WAAW,KAAK,EAChBC,MAAM,EACNC,SAAS,EACTC,KAAK,EAEW,OADbC;;;;;;;;;;;;IAEH,MAAMC,SACJJ,WAAWK,YACPA,YACAd,mBAAmBe,GAAG,CAACC,CAAAA,IAAK,GAAGP,OAAOP,KAAKc,GAAG,CAAC,EAAEA,EAAE,CAAC,CAAC,EAAEC,IAAI,CAAC;IAClE,qBACE,KAACC;QACChB,KAAKA;QACLC,KAAKA;QACLC,OAAOA;QACPC,QAAQA;QACRE,OAAOA;QACPM,QAAQA;OACHL,WACD;QAAEW,eAAe;IAAgB,IACjC;QAAEC,SAAS;QAAiBC,UAAU;IAAiB;QAC3DX,WAAWX,GAAG,sCAAsCW;QACpDC,OAAO;YAAEL;WAAgBK;OACrBC;AAGV"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { EnumTone } from '@entifix/core';
|
|
1
2
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The tones a status reads in. One vocabulary with core's {@link EnumTone},
|
|
5
|
+
* so an enum member's declared `enumTones` render here unmapped.
|
|
6
|
+
*/
|
|
7
|
+
export type StatusTagTone = EnumTone;
|
|
4
8
|
export interface StatusTagProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
5
9
|
tone: StatusTagTone;
|
|
6
10
|
/** The status in words. Required and non-empty: colour is never the only carrier (WCAG 1.4.1). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-tag.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/status-tag/status-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"status-tag.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/status-tag/status-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKjE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;AAOrC,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,wBAAwB,CAAC,MAAM,CAAC,EAChC,UAAU,CACX;IACC,IAAI,EAAE,aAAa,CAAC;IACpB,kGAAkG;IAClG,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,+BAoBhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ui/atoms/status-tag/status-tag.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport { cn } from '../../utils/cn.js';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/atoms/status-tag/status-tag.tsx"],"sourcesContent":["import type { EnumTone } from '@entifix/core';\nimport type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport { cn } from '../../utils/cn.js';\nimport { TONE_SURFACE } from '../alert/tone.js';\n\n/**\n * The tones a status reads in. One vocabulary with core's {@link EnumTone},\n * so an enum member's declared `enumTones` render here unmapped.\n */\nexport type StatusTagTone = EnumTone;\n\nconst TONE_CLASS: Record<StatusTagTone, string> = {\n ...TONE_SURFACE,\n neutral: 'border-border bg-surface text-content-muted',\n};\n\nexport interface StatusTagProps extends Omit<\n ComponentPropsWithoutRef<'span'>,\n 'children'\n> {\n tone: StatusTagTone;\n /** The status in words. Required and non-empty: colour is never the only carrier (WCAG 1.4.1). */\n children: string;\n /** A glyph before the words; decorative, so hidden from assistive technology. */\n icon?: ReactNode;\n}\n\n/**\n * A record's status as a small tag: a tone and the words for it. The words are\n * mandatory, and an empty string throws rather than rendering a coloured dot\n * that means something only to people who can see the colour. Server-safe.\n */\nexport function StatusTag({\n tone,\n icon,\n className,\n children,\n ...props\n}: StatusTagProps) {\n if (children.trim() === '') {\n throw new Error(\n 'StatusTag needs its status in words: colour alone carries nothing for someone who cannot see it.',\n );\n }\n return (\n <span\n data-tone={tone}\n className={cn(\n 'inline-flex items-center gap-3xs rounded-full border px-2xs text-step-xs font-medium whitespace-nowrap',\n TONE_CLASS[tone],\n className,\n )}\n {...props}\n >\n {icon !== undefined && <span aria-hidden=\"true\">{icon}</span>}\n {children}\n </span>\n );\n}\n"],"names":["cn","TONE_SURFACE","TONE_CLASS","neutral","StatusTag","tone","icon","className","children","props","trim","Error","span","data-tone","undefined","aria-hidden"],"mappings":";;;AAGA,SAASA,EAAE,QAAQ,oBAAoB;AACvC,SAASC,YAAY,QAAQ,mBAAmB;AAQhD,MAAMC,aAA4C,aAC7CD;IACHE,SAAS;;AAcX;;;;CAIC,GACD,OAAO,SAASC,UAAU,EAMT;QANS,EACxBC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,QAAQ,EAEO,OADZC;;;;;;IAEH,IAAID,SAASE,IAAI,OAAO,IAAI;QAC1B,MAAM,IAAIC,MACR;IAEJ;IACA,qBACE,MAACC;QACCC,aAAWR;QACXE,WAAWP,GACT,0GACAE,UAAU,CAACG,KAAK,EAChBE;OAEEE;;YAEHH,SAASQ,2BAAa,KAACF;gBAAKG,eAAY;0BAAQT;;YAChDE;;;AAGP"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { type MediaImageLoader } from '../../atoms/media-image/index.js';
|
|
2
3
|
export interface MediaGalleryItem {
|
|
3
4
|
/** Unique within the gallery; the slide's element id is derived from it. */
|
|
4
5
|
readonly id: string;
|
|
5
6
|
readonly src: string;
|
|
6
7
|
/** What the image shows. Empty only for an image that adds nothing to the text beside it. */
|
|
7
8
|
readonly alt: string;
|
|
9
|
+
/** Intrinsic width in pixels, when known. */
|
|
10
|
+
readonly width?: number;
|
|
11
|
+
/** Intrinsic height in pixels, when known. */
|
|
12
|
+
readonly height?: number;
|
|
13
|
+
}
|
|
14
|
+
/** What the gallery decided for one slide, handed to a host's own renderer. */
|
|
15
|
+
export interface MediaGallerySlide {
|
|
16
|
+
/** The slide's position, from 0. */
|
|
17
|
+
readonly index: number;
|
|
18
|
+
/** The first slide is fetched first and at once; every other one lazily. */
|
|
19
|
+
readonly priority: boolean;
|
|
20
|
+
/** The `sizes` the slide is shown at. */
|
|
21
|
+
readonly sizes: string;
|
|
8
22
|
}
|
|
9
23
|
export interface MediaGalleryLabels {
|
|
10
24
|
/** The gallery's name — usually the product's. */
|
|
@@ -17,8 +31,21 @@ export interface MediaGalleryLabels {
|
|
|
17
31
|
export interface MediaGalleryProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
18
32
|
items: readonly MediaGalleryItem[];
|
|
19
33
|
labels: MediaGalleryLabels;
|
|
20
|
-
/**
|
|
21
|
-
|
|
34
|
+
/**
|
|
35
|
+
* How wide a slide is shown at, as a `sizes` attribute. Defaults to the full
|
|
36
|
+
* viewport width, which is right only when the gallery is.
|
|
37
|
+
*/
|
|
38
|
+
sizes?: string;
|
|
39
|
+
/** Width over height of every slide's box. Defaults to `1`, a square. */
|
|
40
|
+
aspectRatio?: number;
|
|
41
|
+
/** Resizes a slide's image per width, so the browser can fetch a smaller one. */
|
|
42
|
+
loader?: MediaImageLoader;
|
|
43
|
+
/**
|
|
44
|
+
* Renders one image; a {@link MediaImage} when omitted. A host rendering its
|
|
45
|
+
* own sized image receives the gallery's decisions for the slide, and the
|
|
46
|
+
* slide's box stays reserved around whatever it returns.
|
|
47
|
+
*/
|
|
48
|
+
renderMedia?: (item: MediaGalleryItem, slide: MediaGallerySlide) => ReactNode;
|
|
22
49
|
}
|
|
23
50
|
/**
|
|
24
51
|
* Product media as a horizontal scroller that works with scripting off and
|
|
@@ -27,5 +54,5 @@ export interface MediaGalleryProps extends Omit<ComponentPropsWithoutRef<'div'>,
|
|
|
27
54
|
* a figure with its position, and its previous and next links jump to the
|
|
28
55
|
* neighbouring slide's id, which the browser scrolls into view. Server-safe.
|
|
29
56
|
*/
|
|
30
|
-
export declare function MediaGallery({ items, labels, renderMedia, className, ...props }: MediaGalleryProps): import("react").JSX.Element;
|
|
57
|
+
export declare function MediaGallery({ items, labels, sizes, aspectRatio, loader, renderMedia, className, ...props }: MediaGalleryProps): import("react").JSX.Element;
|
|
31
58
|
//# sourceMappingURL=media-gallery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-gallery.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/media-gallery/media-gallery.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"media-gallery.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/media-gallery/media-gallery.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAC;AAG1C,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7D;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,wBAAwB,CAAC,KAAK,CAAC,EAC/B,UAAU,CACX;IACC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACnC,MAAM,EAAE,kBAAkB,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC;CAC/E;AAOD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,MAAM,EACN,KAAe,EACf,WAAe,EACf,MAAM,EACN,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,iBAAiB,+BAuEnB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
2
|
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { MediaImage } from '../../atoms/media-image/index.js';
|
|
4
5
|
import { cn } from '../../utils/cn.js';
|
|
5
6
|
const slideId = (item)=>`media-${item.id}`;
|
|
6
7
|
const STEP = 'flex min-h-(--target-min) items-center rounded-md px-2xs text-step-sm text-content focus-ring hover:underline';
|
|
@@ -11,13 +12,12 @@ const STEP = 'flex min-h-(--target-min) items-center rounded-md px-2xs text-step
|
|
|
11
12
|
* a figure with its position, and its previous and next links jump to the
|
|
12
13
|
* neighbouring slide's id, which the browser scrolls into view. Server-safe.
|
|
13
14
|
*/ export function MediaGallery(_0) {
|
|
14
|
-
let { items, labels, renderMedia =
|
|
15
|
-
src: item.src,
|
|
16
|
-
alt: item.alt,
|
|
17
|
-
className: "h-auto w-full object-contain"
|
|
18
|
-
}), className } = _0, props = _object_without_properties_loose(_0, [
|
|
15
|
+
let { items, labels, sizes = '100vw', aspectRatio = 1, loader, renderMedia, className } = _0, props = _object_without_properties_loose(_0, [
|
|
19
16
|
"items",
|
|
20
17
|
"labels",
|
|
18
|
+
"sizes",
|
|
19
|
+
"aspectRatio",
|
|
20
|
+
"loader",
|
|
21
21
|
"renderMedia",
|
|
22
22
|
"className"
|
|
23
23
|
]);
|
|
@@ -32,11 +32,31 @@ const STEP = 'flex min-h-(--target-min) items-center rounded-md px-2xs text-step
|
|
|
32
32
|
children: items.map((item, index)=>{
|
|
33
33
|
const previous = items[index - 1];
|
|
34
34
|
const next = items[index + 1];
|
|
35
|
+
const slide = {
|
|
36
|
+
index,
|
|
37
|
+
priority: index === 0,
|
|
38
|
+
sizes
|
|
39
|
+
};
|
|
35
40
|
return /*#__PURE__*/ _jsxs("figure", {
|
|
36
41
|
id: slideId(item),
|
|
37
42
|
className: "m-0 flex w-full shrink-0 snap-center flex-col gap-2xs",
|
|
38
43
|
children: [
|
|
39
|
-
|
|
44
|
+
/*#__PURE__*/ _jsx("div", {
|
|
45
|
+
className: "flex w-full items-center justify-center overflow-hidden",
|
|
46
|
+
style: {
|
|
47
|
+
aspectRatio
|
|
48
|
+
},
|
|
49
|
+
children: renderMedia === undefined ? /*#__PURE__*/ _jsx(MediaImage, {
|
|
50
|
+
src: item.src,
|
|
51
|
+
alt: item.alt,
|
|
52
|
+
width: item.width,
|
|
53
|
+
height: item.height,
|
|
54
|
+
aspectRatio: aspectRatio,
|
|
55
|
+
sizes: sizes,
|
|
56
|
+
priority: slide.priority,
|
|
57
|
+
loader: loader
|
|
58
|
+
}) : renderMedia(item, slide)
|
|
59
|
+
}),
|
|
40
60
|
/*#__PURE__*/ _jsxs("figcaption", {
|
|
41
61
|
className: "flex items-center justify-between gap-s text-step-xs text-content-muted",
|
|
42
62
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ui/molecules/media-gallery/media-gallery.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\nexport interface MediaGalleryItem {\n /** Unique within the gallery; the slide's element id is derived from it. */\n readonly id: string;\n readonly src: string;\n /** What the image shows. Empty only for an image that adds nothing to the text beside it. */\n readonly alt: string;\n}\n\nexport interface MediaGalleryLabels {\n /** The gallery's name — usually the product's. */\n readonly region: string;\n readonly previous: string;\n readonly next: string;\n /** A slide's position, e.g. `2 of 5`. */\n readonly position: (index: number, total: number) => string;\n}\n\nexport interface MediaGalleryProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'children'\n> {\n items: readonly MediaGalleryItem[];\n labels: MediaGalleryLabels;\n /** Renders one image; a
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/molecules/media-gallery/media-gallery.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport {\n MediaImage,\n type MediaImageLoader,\n} from '../../atoms/media-image/index.js';\nimport { cn } from '../../utils/cn.js';\n\nexport interface MediaGalleryItem {\n /** Unique within the gallery; the slide's element id is derived from it. */\n readonly id: string;\n readonly src: string;\n /** What the image shows. Empty only for an image that adds nothing to the text beside it. */\n readonly alt: string;\n /** Intrinsic width in pixels, when known. */\n readonly width?: number;\n /** Intrinsic height in pixels, when known. */\n readonly height?: number;\n}\n\n/** What the gallery decided for one slide, handed to a host's own renderer. */\nexport interface MediaGallerySlide {\n /** The slide's position, from 0. */\n readonly index: number;\n /** The first slide is fetched first and at once; every other one lazily. */\n readonly priority: boolean;\n /** The `sizes` the slide is shown at. */\n readonly sizes: string;\n}\n\nexport interface MediaGalleryLabels {\n /** The gallery's name — usually the product's. */\n readonly region: string;\n readonly previous: string;\n readonly next: string;\n /** A slide's position, e.g. `2 of 5`. */\n readonly position: (index: number, total: number) => string;\n}\n\nexport interface MediaGalleryProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'children'\n> {\n items: readonly MediaGalleryItem[];\n labels: MediaGalleryLabels;\n /**\n * How wide a slide is shown at, as a `sizes` attribute. Defaults to the full\n * viewport width, which is right only when the gallery is.\n */\n sizes?: string;\n /** Width over height of every slide's box. Defaults to `1`, a square. */\n aspectRatio?: number;\n /** Resizes a slide's image per width, so the browser can fetch a smaller one. */\n loader?: MediaImageLoader;\n /**\n * Renders one image; a {@link MediaImage} when omitted. A host rendering its\n * own sized image receives the gallery's decisions for the slide, and the\n * slide's box stays reserved around whatever it returns.\n */\n renderMedia?: (item: MediaGalleryItem, slide: MediaGallerySlide) => ReactNode;\n}\n\nconst slideId = (item: MediaGalleryItem) => `media-${item.id}`;\n\nconst STEP =\n 'flex min-h-(--target-min) items-center rounded-md px-2xs text-step-sm text-content focus-ring hover:underline';\n\n/**\n * Product media as a horizontal scroller that works with scripting off and\n * with a keyboard. The scroller is a named region and a Tab stop, so arrow\n * keys scroll it (WCAG 2.1.1, axe `scrollable-region-focusable`); each slide is\n * a figure with its position, and its previous and next links jump to the\n * neighbouring slide's id, which the browser scrolls into view. Server-safe.\n */\nexport function MediaGallery({\n items,\n labels,\n sizes = '100vw',\n aspectRatio = 1,\n loader,\n renderMedia,\n className,\n ...props\n}: MediaGalleryProps) {\n return (\n <div\n role=\"region\"\n aria-label={labels.region}\n // A scroller must take focus to be scrolled from the keyboard.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n className={cn(\n 'flex snap-x snap-mandatory gap-s overflow-x-auto scroll-smooth rounded-lg focus-ring motion-reduce:scroll-auto',\n className,\n )}\n {...props}\n >\n {items.map((item, index) => {\n const previous = items[index - 1];\n const next = items[index + 1];\n const slide: MediaGallerySlide = {\n index,\n priority: index === 0,\n sizes,\n };\n return (\n <figure\n key={item.id}\n id={slideId(item)}\n className=\"m-0 flex w-full shrink-0 snap-center flex-col gap-2xs\"\n >\n {/* The box is reserved before any image arrives, whoever renders\n it, so a late image shifts nothing below it. */}\n <div\n className=\"flex w-full items-center justify-center overflow-hidden\"\n style={{ aspectRatio }}\n >\n {renderMedia === undefined ? (\n <MediaImage\n src={item.src}\n alt={item.alt}\n width={item.width}\n height={item.height}\n aspectRatio={aspectRatio}\n sizes={sizes}\n priority={slide.priority}\n loader={loader}\n />\n ) : (\n renderMedia(item, slide)\n )}\n </div>\n <figcaption className=\"flex items-center justify-between gap-s text-step-xs text-content-muted\">\n {previous ? (\n <a href={`#${slideId(previous)}`} className={STEP}>\n {labels.previous}\n </a>\n ) : (\n <span />\n )}\n <span>{labels.position(index + 1, items.length)}</span>\n {next ? (\n <a href={`#${slideId(next)}`} className={STEP}>\n {labels.next}\n </a>\n ) : (\n <span />\n )}\n </figcaption>\n </figure>\n );\n })}\n </div>\n );\n}\n"],"names":["MediaImage","cn","slideId","item","id","STEP","MediaGallery","items","labels","sizes","aspectRatio","loader","renderMedia","className","props","div","role","aria-label","region","tabIndex","map","index","previous","next","slide","priority","figure","style","undefined","src","alt","width","height","figcaption","a","href","span","position","length"],"mappings":";;;AAEA,SACEA,UAAU,QAEL,mCAAmC;AAC1C,SAASC,EAAE,QAAQ,oBAAoB;AAwDvC,MAAMC,UAAU,CAACC,OAA2B,CAAC,MAAM,EAAEA,KAAKC,EAAE,EAAE;AAE9D,MAAMC,OACJ;AAEF;;;;;;CAMC,GACD,OAAO,SAASC,aAAa,EAST;QATS,EAC3BC,KAAK,EACLC,MAAM,EACNC,QAAQ,OAAO,EACfC,cAAc,CAAC,EACfC,MAAM,EACNC,WAAW,EACXC,SAAS,EAES,OADfC;;;;;;;;;IAEH,qBACE,KAACC;QACCC,MAAK;QACLC,cAAYT,OAAOU,MAAM;QACzB,+DAA+D;QAC/D,+DAA+D;QAC/DC,UAAU;QACVN,WAAWZ,GACT,kHACAY;OAEEC;kBAEHP,MAAMa,GAAG,CAAC,CAACjB,MAAMkB;YAChB,MAAMC,WAAWf,KAAK,CAACc,QAAQ,EAAE;YACjC,MAAME,OAAOhB,KAAK,CAACc,QAAQ,EAAE;YAC7B,MAAMG,QAA2B;gBAC/BH;gBACAI,UAAUJ,UAAU;gBACpBZ;YACF;YACA,qBACE,MAACiB;gBAECtB,IAAIF,QAAQC;gBACZU,WAAU;;kCAIV,KAACE;wBACCF,WAAU;wBACVc,OAAO;4BAAEjB;wBAAY;kCAEpBE,gBAAgBgB,0BACf,KAAC5B;4BACC6B,KAAK1B,KAAK0B,GAAG;4BACbC,KAAK3B,KAAK2B,GAAG;4BACbC,OAAO5B,KAAK4B,KAAK;4BACjBC,QAAQ7B,KAAK6B,MAAM;4BACnBtB,aAAaA;4BACbD,OAAOA;4BACPgB,UAAUD,MAAMC,QAAQ;4BACxBd,QAAQA;6BAGVC,YAAYT,MAAMqB;;kCAGtB,MAACS;wBAAWpB,WAAU;;4BACnBS,yBACC,KAACY;gCAAEC,MAAM,CAAC,CAAC,EAAEjC,QAAQoB,WAAW;gCAAET,WAAWR;0CAC1CG,OAAOc,QAAQ;+CAGlB,KAACc;0CAEH,KAACA;0CAAM5B,OAAO6B,QAAQ,CAAChB,QAAQ,GAAGd,MAAM+B,MAAM;;4BAC7Cf,qBACC,KAACW;gCAAEC,MAAM,CAAC,CAAC,EAAEjC,QAAQqB,OAAO;gCAAEV,WAAWR;0CACtCG,OAAOe,IAAI;+CAGd,KAACa;;;;eAvCAjC,KAAKC,EAAE;QA4ClB;;AAGN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/summary-tile/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/molecules/summary-tile/index.ts"],"sourcesContent":["export * from './summary-tile.js';\n"],"names":[],"mappings":"AAAA,cAAc,oBAAoB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type MoneyUnit } from '../../atoms/money/index.js';
|
|
3
|
+
import { type StatusTagTone } from '../../atoms/status-tag/index.js';
|
|
4
|
+
import { type ClusterProps } from '../../layout/cluster/index.js';
|
|
5
|
+
/** An amount of money a tile states instead of a count. */
|
|
6
|
+
export interface SummaryTileMoney {
|
|
7
|
+
readonly amount: number;
|
|
8
|
+
readonly currency: string;
|
|
9
|
+
readonly unit: MoneyUnit;
|
|
10
|
+
}
|
|
11
|
+
/** What the tile's figure means at a glance, in a tone and in words. */
|
|
12
|
+
export interface SummaryTileStatus {
|
|
13
|
+
readonly tone: StatusTagTone;
|
|
14
|
+
/** The words for it; the tone never stands alone. */
|
|
15
|
+
readonly label: string;
|
|
16
|
+
}
|
|
17
|
+
export interface SummaryTileProps {
|
|
18
|
+
/** What is counted — "Envíos por despachar". The tile's heading. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Where the counted records are: the tile is one link there. */
|
|
21
|
+
href: string;
|
|
22
|
+
/** How many. Ignored when {@link money} is given. */
|
|
23
|
+
count?: number;
|
|
24
|
+
/** An amount instead of a count — "Próximo pago". */
|
|
25
|
+
money?: SummaryTileMoney;
|
|
26
|
+
/** The figure's meaning as a tag beside it. */
|
|
27
|
+
status?: SummaryTileStatus;
|
|
28
|
+
/** Its own source's state: one tile failing leaves every other one standing. */
|
|
29
|
+
state: 'loading' | 'ready' | 'failed';
|
|
30
|
+
/** Reads the tile's source again. Without it, a failed tile offers no Retry. */
|
|
31
|
+
onRetry?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Routing escape hatch. It receives the tile's `href`, `className` and
|
|
34
|
+
* content, and must spread `className` onto what it renders; a plain `<a>`
|
|
35
|
+
* when omitted.
|
|
36
|
+
*/
|
|
37
|
+
renderLink?: (link: {
|
|
38
|
+
href: string;
|
|
39
|
+
className: string;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}) => ReactNode;
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One figure that leads somewhere: a heading, a count or an amount, and a
|
|
46
|
+
* status in words. The whole tile is one link to the records it counts, named
|
|
47
|
+
* by its heading and its figure. It loads, and fails, on its own — a failed
|
|
48
|
+
* tile says so in place and offers Retry while its neighbours keep their
|
|
49
|
+
* figures ([ADR 0028](../../../../../../../docs/adr/0028-states-an-organism-must-render.md)).
|
|
50
|
+
* Nothing is announced live: the figure is read once, when the reader
|
|
51
|
+
* reaches it.
|
|
52
|
+
*/
|
|
53
|
+
export declare function SummaryTile({ label, href, count, money, status, state, onRetry, renderLink, className, }: SummaryTileProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
54
|
+
export type SummaryTileListProps = Omit<ClusterProps, 'as' | 'role' | 'align'>;
|
|
55
|
+
/** Tiles side by side, wrapping as the width runs out; a list, so its size is read out. */
|
|
56
|
+
export declare function SummaryTileList({ children, ...props }: SummaryTileListProps): import("react").JSX.Element;
|
|
57
|
+
//# sourceMappingURL=summary-tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-tile.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/summary-tile/summary-tile.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKjE,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG3E,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAED,wEAAwE;AACxE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gFAAgF;IAChF,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IACtC,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,SAAS,CAAC;KACrB,KAAK,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,OAAO,EACP,UAAU,EACV,SAAS,GACV,EAAE,gBAAgB,+TAqElB;AAED,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAE/E,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,+BAQ3E"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
3
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
import { Children, isValidElement } from 'react';
|
|
6
|
+
import { useFormatters, useLocale, useT } from '../../../i18n/index.js';
|
|
7
|
+
import { Alert } from '../../atoms/alert/index.js';
|
|
8
|
+
import { Button } from '../../atoms/button/index.js';
|
|
9
|
+
import { Money } from '../../atoms/money/index.js';
|
|
10
|
+
import { Skeleton } from '../../atoms/skeleton/index.js';
|
|
11
|
+
import { StatusTag } from '../../atoms/status-tag/index.js';
|
|
12
|
+
import { Cluster } from '../../layout/cluster/index.js';
|
|
13
|
+
import { cn } from '../../utils/cn.js';
|
|
14
|
+
const SURFACE = 'flex min-h-(--target-min) flex-col gap-2xs rounded-xl border border-border bg-surface-elevated p-s text-content';
|
|
15
|
+
const LINK = 'block rounded-xl text-content no-underline focus-ring hover:shadow-overlay';
|
|
16
|
+
/**
|
|
17
|
+
* One figure that leads somewhere: a heading, a count or an amount, and a
|
|
18
|
+
* status in words. The whole tile is one link to the records it counts, named
|
|
19
|
+
* by its heading and its figure. It loads, and fails, on its own — a failed
|
|
20
|
+
* tile says so in place and offers Retry while its neighbours keep their
|
|
21
|
+
* figures ([ADR 0028](../../../../../../../docs/adr/0028-states-an-organism-must-render.md)).
|
|
22
|
+
* Nothing is announced live: the figure is read once, when the reader
|
|
23
|
+
* reaches it.
|
|
24
|
+
*/ export function SummaryTile({ label, href, count, money, status, state, onRetry, renderLink, className }) {
|
|
25
|
+
const t = useT();
|
|
26
|
+
const formatters = useFormatters();
|
|
27
|
+
const locale = useLocale();
|
|
28
|
+
const link = (content, linkClass)=>renderLink === undefined ? /*#__PURE__*/ _jsx("a", {
|
|
29
|
+
href: href,
|
|
30
|
+
className: linkClass,
|
|
31
|
+
children: content
|
|
32
|
+
}) : renderLink({
|
|
33
|
+
href,
|
|
34
|
+
className: linkClass,
|
|
35
|
+
children: content
|
|
36
|
+
});
|
|
37
|
+
if (state === 'failed') {
|
|
38
|
+
return /*#__PURE__*/ _jsxs("article", {
|
|
39
|
+
className: cn(SURFACE, className),
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ _jsx("h3", {
|
|
42
|
+
className: "text-step-sm font-semibold",
|
|
43
|
+
children: link(label, 'focus-ring rounded-sm text-content hover:underline')
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ _jsx(Alert, {
|
|
46
|
+
tone: "danger",
|
|
47
|
+
action: onRetry === undefined ? undefined : /*#__PURE__*/ _jsx(Button, {
|
|
48
|
+
type: "button",
|
|
49
|
+
variant: "secondary",
|
|
50
|
+
size: "sm",
|
|
51
|
+
onClick: onRetry,
|
|
52
|
+
children: t('state.retry')
|
|
53
|
+
}),
|
|
54
|
+
children: t('summary.failed', {
|
|
55
|
+
label
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const figure = state === 'loading' ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ _jsx(Skeleton, {
|
|
64
|
+
shape: "line",
|
|
65
|
+
className: "w-12"
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ _jsx("span", {
|
|
68
|
+
className: "sr-only",
|
|
69
|
+
children: t('summary.loading')
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}) : money !== undefined ? /*#__PURE__*/ _jsx(Money, {
|
|
73
|
+
amount: money.amount,
|
|
74
|
+
currency: money.currency,
|
|
75
|
+
unit: money.unit,
|
|
76
|
+
locale: locale
|
|
77
|
+
}) : formatters.number(count != null ? count : 0);
|
|
78
|
+
return link(/*#__PURE__*/ _jsxs("article", {
|
|
79
|
+
className: cn(SURFACE, className),
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsx("h3", {
|
|
82
|
+
className: "text-step-sm font-semibold",
|
|
83
|
+
children: label
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsx("div", {
|
|
86
|
+
className: "text-step-2 font-semibold tabular-nums",
|
|
87
|
+
children: figure
|
|
88
|
+
}),
|
|
89
|
+
state === 'ready' && status !== undefined && /*#__PURE__*/ _jsx(StatusTag, {
|
|
90
|
+
tone: status.tone,
|
|
91
|
+
className: "self-start",
|
|
92
|
+
children: status.label
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
}), LINK);
|
|
96
|
+
}
|
|
97
|
+
/** Tiles side by side, wrapping as the width runs out; a list, so its size is read out. */ export function SummaryTileList(_0) {
|
|
98
|
+
let { children } = _0, props = _object_without_properties_loose(_0, [
|
|
99
|
+
"children"
|
|
100
|
+
]);
|
|
101
|
+
return /*#__PURE__*/ _jsx(Cluster, _extends({
|
|
102
|
+
as: "ul",
|
|
103
|
+
role: "list",
|
|
104
|
+
gap: "s",
|
|
105
|
+
align: "stretch"
|
|
106
|
+
}, props, {
|
|
107
|
+
children: Children.map(children, (child)=>/*#__PURE__*/ isValidElement(child) ? /*#__PURE__*/ _jsx("li", {
|
|
108
|
+
className: "min-w-0",
|
|
109
|
+
children: child
|
|
110
|
+
}) : child)
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=summary-tile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/molecules/summary-tile/summary-tile.tsx"],"sourcesContent":["'use client';\n\nimport { Children, isValidElement, type ReactNode } from 'react';\n\nimport { useFormatters, useLocale, useT } from '../../../i18n/index.js';\nimport { Alert } from '../../atoms/alert/index.js';\nimport { Button } from '../../atoms/button/index.js';\nimport { Money, type MoneyUnit } from '../../atoms/money/index.js';\nimport { Skeleton } from '../../atoms/skeleton/index.js';\nimport { StatusTag, type StatusTagTone } from '../../atoms/status-tag/index.js';\nimport { Cluster, type ClusterProps } from '../../layout/cluster/index.js';\nimport { cn } from '../../utils/cn.js';\n\n/** An amount of money a tile states instead of a count. */\nexport interface SummaryTileMoney {\n readonly amount: number;\n readonly currency: string;\n readonly unit: MoneyUnit;\n}\n\n/** What the tile's figure means at a glance, in a tone and in words. */\nexport interface SummaryTileStatus {\n readonly tone: StatusTagTone;\n /** The words for it; the tone never stands alone. */\n readonly label: string;\n}\n\nexport interface SummaryTileProps {\n /** What is counted — \"Envíos por despachar\". The tile's heading. */\n label: string;\n /** Where the counted records are: the tile is one link there. */\n href: string;\n /** How many. Ignored when {@link money} is given. */\n count?: number;\n /** An amount instead of a count — \"Próximo pago\". */\n money?: SummaryTileMoney;\n /** The figure's meaning as a tag beside it. */\n status?: SummaryTileStatus;\n /** Its own source's state: one tile failing leaves every other one standing. */\n state: 'loading' | 'ready' | 'failed';\n /** Reads the tile's source again. Without it, a failed tile offers no Retry. */\n onRetry?: () => void;\n /**\n * Routing escape hatch. It receives the tile's `href`, `className` and\n * content, and must spread `className` onto what it renders; a plain `<a>`\n * when omitted.\n */\n renderLink?: (link: {\n href: string;\n className: string;\n children: ReactNode;\n }) => ReactNode;\n className?: string;\n}\n\nconst SURFACE =\n 'flex min-h-(--target-min) flex-col gap-2xs rounded-xl border border-border bg-surface-elevated p-s text-content';\nconst LINK =\n 'block rounded-xl text-content no-underline focus-ring hover:shadow-overlay';\n\n/**\n * One figure that leads somewhere: a heading, a count or an amount, and a\n * status in words. The whole tile is one link to the records it counts, named\n * by its heading and its figure. It loads, and fails, on its own — a failed\n * tile says so in place and offers Retry while its neighbours keep their\n * figures ([ADR 0028](../../../../../../../docs/adr/0028-states-an-organism-must-render.md)).\n * Nothing is announced live: the figure is read once, when the reader\n * reaches it.\n */\nexport function SummaryTile({\n label,\n href,\n count,\n money,\n status,\n state,\n onRetry,\n renderLink,\n className,\n}: SummaryTileProps) {\n const t = useT();\n const formatters = useFormatters();\n const locale = useLocale();\n const link = (content: ReactNode, linkClass: string) =>\n renderLink === undefined ? (\n <a href={href} className={linkClass}>\n {content}\n </a>\n ) : (\n renderLink({ href, className: linkClass, children: content })\n );\n\n if (state === 'failed') {\n return (\n <article className={cn(SURFACE, className)}>\n <h3 className=\"text-step-sm font-semibold\">\n {link(label, 'focus-ring rounded-sm text-content hover:underline')}\n </h3>\n <Alert\n tone=\"danger\"\n action={\n onRetry === undefined ? undefined : (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={onRetry}\n >\n {t('state.retry')}\n </Button>\n )\n }\n >\n {t('summary.failed', { label })}\n </Alert>\n </article>\n );\n }\n\n const figure =\n state === 'loading' ? (\n <>\n <Skeleton shape=\"line\" className=\"w-12\" />\n <span className=\"sr-only\">{t('summary.loading')}</span>\n </>\n ) : money !== undefined ? (\n <Money\n amount={money.amount}\n currency={money.currency}\n unit={money.unit}\n locale={locale}\n />\n ) : (\n formatters.number(count ?? 0)\n );\n\n return link(\n <article className={cn(SURFACE, className)}>\n <h3 className=\"text-step-sm font-semibold\">{label}</h3>\n <div className=\"text-step-2 font-semibold tabular-nums\">{figure}</div>\n {state === 'ready' && status !== undefined && (\n <StatusTag tone={status.tone} className=\"self-start\">\n {status.label}\n </StatusTag>\n )}\n </article>,\n LINK,\n );\n}\n\nexport type SummaryTileListProps = Omit<ClusterProps, 'as' | 'role' | 'align'>;\n\n/** Tiles side by side, wrapping as the width runs out; a list, so its size is read out. */\nexport function SummaryTileList({ children, ...props }: SummaryTileListProps) {\n return (\n <Cluster as=\"ul\" role=\"list\" gap=\"s\" align=\"stretch\" {...props}>\n {Children.map(children, child =>\n isValidElement(child) ? <li className=\"min-w-0\">{child}</li> : child,\n )}\n </Cluster>\n );\n}\n"],"names":["Children","isValidElement","useFormatters","useLocale","useT","Alert","Button","Money","Skeleton","StatusTag","Cluster","cn","SURFACE","LINK","SummaryTile","label","href","count","money","status","state","onRetry","renderLink","className","t","formatters","locale","link","content","linkClass","undefined","a","children","article","h3","tone","action","type","variant","size","onClick","figure","shape","span","amount","currency","unit","number","div","SummaryTileList","props","as","role","gap","align","map","child","li"],"mappings":"AAAA;;;;AAEA,SAASA,QAAQ,EAAEC,cAAc,QAAwB,QAAQ;AAEjE,SAASC,aAAa,EAAEC,SAAS,EAAEC,IAAI,QAAQ,yBAAyB;AACxE,SAASC,KAAK,QAAQ,6BAA6B;AACnD,SAASC,MAAM,QAAQ,8BAA8B;AACrD,SAASC,KAAK,QAAwB,6BAA6B;AACnE,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SAASC,SAAS,QAA4B,kCAAkC;AAChF,SAASC,OAAO,QAA2B,gCAAgC;AAC3E,SAASC,EAAE,QAAQ,oBAAoB;AA4CvC,MAAMC,UACJ;AACF,MAAMC,OACJ;AAEF;;;;;;;;CAQC,GACD,OAAO,SAASC,YAAY,EAC1BC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,KAAK,EACLC,OAAO,EACPC,UAAU,EACVC,SAAS,EACQ;IACjB,MAAMC,IAAIpB;IACV,MAAMqB,aAAavB;IACnB,MAAMwB,SAASvB;IACf,MAAMwB,OAAO,CAACC,SAAoBC,YAChCP,eAAeQ,0BACb,KAACC;YAAEf,MAAMA;YAAMO,WAAWM;sBACvBD;aAGHN,WAAW;YAAEN;YAAMO,WAAWM;YAAWG,UAAUJ;QAAQ;IAG/D,IAAIR,UAAU,UAAU;QACtB,qBACE,MAACa;YAAQV,WAAWZ,GAAGC,SAASW;;8BAC9B,KAACW;oBAAGX,WAAU;8BACXI,KAAKZ,OAAO;;8BAEf,KAACV;oBACC8B,MAAK;oBACLC,QACEf,YAAYS,YAAYA,0BACtB,KAACxB;wBACC+B,MAAK;wBACLC,SAAQ;wBACRC,MAAK;wBACLC,SAASnB;kCAERG,EAAE;;8BAKRA,EAAE,kBAAkB;wBAAET;oBAAM;;;;IAIrC;IAEA,MAAM0B,SACJrB,UAAU,0BACR;;0BACE,KAACZ;gBAASkC,OAAM;gBAAOnB,WAAU;;0BACjC,KAACoB;gBAAKpB,WAAU;0BAAWC,EAAE;;;SAE7BN,UAAUY,0BACZ,KAACvB;QACCqC,QAAQ1B,MAAM0B,MAAM;QACpBC,UAAU3B,MAAM2B,QAAQ;QACxBC,MAAM5B,MAAM4B,IAAI;QAChBpB,QAAQA;SAGVD,WAAWsB,MAAM,CAAC9B,gBAAAA,QAAS;IAG/B,OAAOU,mBACL,MAACM;QAAQV,WAAWZ,GAAGC,SAASW;;0BAC9B,KAACW;gBAAGX,WAAU;0BAA8BR;;0BAC5C,KAACiC;gBAAIzB,WAAU;0BAA0CkB;;YACxDrB,UAAU,WAAWD,WAAWW,2BAC/B,KAACrB;gBAAU0B,MAAMhB,OAAOgB,IAAI;gBAAEZ,WAAU;0BACrCJ,OAAOJ,KAAK;;;QAInBF;AAEJ;AAIA,yFAAyF,GACzF,OAAO,SAASoC,gBAAgB,EAA4C;QAA5C,EAAEjB,QAAQ,EAAkC,OAA7BkB;;;IAC7C,qBACE,KAACxC;QAAQyC,IAAG;QAAKC,MAAK;QAAOC,KAAI;QAAIC,OAAM;OAAcJ;kBACtDlD,SAASuD,GAAG,CAACvB,UAAUwB,CAAAA,sBACtBvD,eAAeuD,uBAAS,KAACC;gBAAGlC,WAAU;0BAAWiC;iBAAcA;;AAIvE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Entity } from '@entifix/core';
|
|
2
2
|
import type { EntityTableProps } from './entity-table.types.js';
|
|
3
|
-
export declare function EntityTable<TEntity extends Entity>({ entityConstructor, isLoading, skeleton, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, renderLink, onSelect, preferencesKey, showControls, pivotBreakpoint, filtering, sorting, onFilteringChange, onSortingChange, facets, selection, onSelectionChange, metadata, isMetadataLoading, onBulkUseCase, onUseCase, onRetry, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning, children, }: EntityTableProps<TEntity>): import("react").JSX.Element;
|
|
3
|
+
export declare function EntityTable<TEntity extends Entity>({ entityConstructor, isLoading, skeleton, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, renderLink, onSelect, preferencesKey, hiddenColumns, showControls, pivotBreakpoint, filtering, sorting, onFilteringChange, onSortingChange, facets, selection, onSelectionChange, metadata, isMetadataLoading, onBulkUseCase, onUseCase, onRetry, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning, children, }: EntityTableProps<TEntity>): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=entity-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-table.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/entity-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,EAaZ,MAAM,eAAe,CAAC;AAsDvB,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAsDjC,wBAAgB,WAAW,CAAC,OAAO,SAAS,MAAM,EAAE,EAClD,iBAAiB,EACjB,SAAS,EACT,QAAe,EACf,KAAK,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,UAAyB,EACzB,QAAQ,EACR,cAAc,EACd,YAAmB,EACnB,eAAe,EACf,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,iBAAyB,EACzB,aAAa,EACb,SAAS,EACT,OAAO,EACP,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAqB,EACrB,QAAQ,GACT,EAAE,gBAAgB,CAAC,OAAO,CAAC,+
|
|
1
|
+
{"version":3,"file":"entity-table.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/entity-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,EAaZ,MAAM,eAAe,CAAC;AAsDvB,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAsDjC,wBAAgB,WAAW,CAAC,OAAO,SAAS,MAAM,EAAE,EAClD,iBAAiB,EACjB,SAAS,EACT,QAAe,EACf,KAAK,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,UAAyB,EACzB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,YAAmB,EACnB,eAAe,EACf,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,iBAAyB,EACzB,aAAa,EACb,SAAS,EACT,OAAO,EACP,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAqB,EACrB,QAAQ,GACT,EAAE,gBAAgB,CAAC,OAAO,CAAC,+BAq/B3B"}
|
|
@@ -40,7 +40,7 @@ import { useResultAnnouncement } from './use-result-announcement.js';
|
|
|
40
40
|
* content that arrives below the fold anyway.
|
|
41
41
|
*/ const SKELETON_ROW_CAP = 5;
|
|
42
42
|
/** How many members a card shows as meta when none declares a `card` role. */ const UNDECLARED_META_CAP = 3;
|
|
43
|
-
export function EntityTable({ entityConstructor, isLoading, skeleton = true, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, renderLink = renderAnchor, onSelect, preferencesKey, showControls = true, pivotBreakpoint, filtering, sorting, onFilteringChange, onSortingChange, facets, selection, onSelectionChange, metadata, isMetadataLoading = false, onBulkUseCase, onUseCase, onRetry, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning = false, children }) {
|
|
43
|
+
export function EntityTable({ entityConstructor, isLoading, skeleton = true, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, renderLink = renderAnchor, onSelect, preferencesKey, hiddenColumns, showControls = true, pivotBreakpoint, filtering, sorting, onFilteringChange, onSortingChange, facets, selection, onSelectionChange, metadata, isMetadataLoading = false, onBulkUseCase, onUseCase, onRetry, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning = false, children }) {
|
|
44
44
|
var _ref, _ref1, _visibleColumns_find, _ref2;
|
|
45
45
|
const t = useT();
|
|
46
46
|
// A descriptor's label is a runtime catalog key — the typed gate cannot see
|
|
@@ -50,7 +50,7 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
50
50
|
const metaEntity = extractMetaEntity(entityConstructor);
|
|
51
51
|
const slots = readEntityTableSlots(children);
|
|
52
52
|
const [panel, setPanel] = useState('none');
|
|
53
|
-
const { columns, visibleColumns, hidden, setPersonalization } = useEntityTableColumns(entityConstructor, slots.columns, items[0], `entity-table:${(_ref = preferencesKey != null ? preferencesKey : metaEntity.key) != null ? _ref : metaEntity.name}
|
|
53
|
+
const { columns, visibleColumns, hidden, setPersonalization } = useEntityTableColumns(entityConstructor, slots.columns, items[0], `entity-table:${(_ref = preferencesKey != null ? preferencesKey : metaEntity.key) != null ? _ref : metaEntity.name}`, hiddenColumns);
|
|
54
54
|
// A picker's table is choosing *one* value; a multi-selection there would
|
|
55
55
|
// offer a set to a form member that holds a single reference, and the two
|
|
56
56
|
// controls would fight over the same row. This is a wiring mistake rather
|