@lablup/ui-common 0.1.0-alpha.1 → 0.1.0-alpha.11
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/README.md +9 -2
- package/dist/assets/components/BaseCard/BaseCard.css +1 -1
- package/dist/assets/components/Button/Button.css +1 -1
- package/dist/assets/components/DataTable/DataTable.css +1 -1
- package/dist/assets/components/Drawer/Drawer.css +1 -1
- package/dist/assets/components/EmptyState/EmptyState.css +1 -1
- package/dist/assets/components/ErrorState/ErrorState.css +1 -1
- package/dist/assets/components/PageHeader/PageHeader.css +1 -1
- package/dist/assets/components/StatCard/StatCard.css +1 -1
- package/dist/assets/components/Tabs/Tabs.css +1 -1
- package/dist/assets/components/Tooltip/Tooltip.css +1 -1
- package/dist/components/DataTable/DataTable.d.ts +16 -5
- package/dist/components/DataTable/DataTable2.js +31 -64
- package/dist/components/DataTable/DataTable2.js.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +12 -1
- package/dist/components/Drawer/Drawer2.js +39 -24
- package/dist/components/Drawer/Drawer2.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +10 -3
- package/dist/components/EmptyState/EmptyState2.js +31 -48
- package/dist/components/EmptyState/EmptyState2.js.map +1 -1
- package/dist/components/EmptyState/index.d.ts +6 -1
- package/dist/components/ErrorState/ErrorState.d.ts +17 -4
- package/dist/components/ErrorState/ErrorState2.js +20 -23
- package/dist/components/ErrorState/ErrorState2.js.map +1 -1
- package/dist/components/ErrorState/index.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +14 -1
- package/dist/components/PageHeader/PageHeader2.js +40 -24
- package/dist/components/PageHeader/PageHeader2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonCard.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonCard2.js +12 -3
- package/dist/components/Skeleton/SkeletonCard2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonRow.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonRow2.js +8 -3
- package/dist/components/Skeleton/SkeletonRow2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonText.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonText2.js +6 -5
- package/dist/components/Skeleton/SkeletonText2.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +10 -23
- package/dist/components/Tabs/Tabs2.js +127 -146
- package/dist/components/Tabs/Tabs2.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Tabs/index.js +2 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +3 -4
- package/dist/styles/base.css +130 -48
- package/dist/styles/themes/orange-dark.css +3 -0
- package/dist/styles/themes/orange-light.css +6 -1
- package/package.json +1 -1
- package/dist/components/EmptyState/illustrations.d.ts +0 -51
- package/dist/components/EmptyState/illustrations.js +0 -571
- package/dist/components/EmptyState/illustrations.js.map +0 -1
- package/dist/components/Tabs/tabTags.d.ts +0 -9
- package/dist/components/Tabs/tabTags.js +0 -11
- package/dist/components/Tabs/tabTags.js.map +0 -1
- package/dist/styles/themes/bliss-dark.css +0 -123
- package/dist/styles/themes/bliss-light.css +0 -123
- package/dist/styles/themes/glass-dark.css +0 -124
- package/dist/styles/themes/glass-light.css +0 -125
- package/dist/styles/themes/reverie-dark.css +0 -104
- package/dist/styles/themes/reverie-light.css +0 -104
- package/dist/styles/themes/stained-dark.css +0 -80
- package/dist/styles/themes/stained-light.css +0 -80
|
@@ -4,56 +4,53 @@ import { AlertCircleIcon as t } from "../../icons/AlertCircleIcon.js";
|
|
|
4
4
|
import { useCallback as n } from "react";
|
|
5
5
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/ErrorState/ErrorState.tsx
|
|
7
|
-
function a(
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
function o({ type: t = "generic", title: o, message: s, primaryAction: c, secondaryAction: l, className: u = "", showIcon: d = !0 }) {
|
|
11
|
-
let f = n(() => {
|
|
12
|
-
c?.onClick();
|
|
13
|
-
}, [c]), p = n(() => {
|
|
7
|
+
function a({ tone: a = "danger", icon: o, title: s, message: c, primaryAction: l, secondaryAction: u, className: d = "", showIcon: f = !0 }) {
|
|
8
|
+
let p = n(() => {
|
|
14
9
|
l?.onClick();
|
|
15
|
-
}, [l]), m =
|
|
10
|
+
}, [l]), m = n(() => {
|
|
11
|
+
u?.onClick();
|
|
12
|
+
}, [u]), h = [
|
|
16
13
|
"error-state",
|
|
17
|
-
`error-state--${
|
|
18
|
-
|
|
14
|
+
`error-state--${a}`,
|
|
15
|
+
d
|
|
19
16
|
].filter(Boolean).join(" ");
|
|
20
17
|
return /* @__PURE__ */ i("div", {
|
|
21
|
-
className:
|
|
18
|
+
className: h,
|
|
22
19
|
role: "alert",
|
|
23
20
|
"aria-live": "polite",
|
|
24
21
|
children: [
|
|
25
|
-
|
|
22
|
+
f && /* @__PURE__ */ r("div", {
|
|
26
23
|
className: "error-state__icon",
|
|
27
24
|
"aria-hidden": "true",
|
|
28
|
-
children:
|
|
25
|
+
children: o ?? /* @__PURE__ */ r(t, { size: 48 })
|
|
29
26
|
}),
|
|
30
27
|
/* @__PURE__ */ r("h2", {
|
|
31
28
|
className: "error-state__title",
|
|
32
|
-
children:
|
|
29
|
+
children: s
|
|
33
30
|
}),
|
|
34
31
|
/* @__PURE__ */ r("p", {
|
|
35
32
|
className: "error-state__message",
|
|
36
|
-
children:
|
|
33
|
+
children: c
|
|
37
34
|
}),
|
|
38
|
-
(
|
|
35
|
+
(l || u) && /* @__PURE__ */ i("div", {
|
|
39
36
|
className: "error-state__actions",
|
|
40
|
-
children: [
|
|
37
|
+
children: [l && /* @__PURE__ */ r(e, {
|
|
41
38
|
variant: "primary",
|
|
42
|
-
onClick:
|
|
39
|
+
onClick: p,
|
|
43
40
|
className: "error-state__action-btn error-state__action-btn--primary",
|
|
44
|
-
children:
|
|
45
|
-
}),
|
|
41
|
+
children: l.label
|
|
42
|
+
}), u && /* @__PURE__ */ r(e, {
|
|
46
43
|
variant: "secondary",
|
|
47
|
-
onClick:
|
|
44
|
+
onClick: m,
|
|
48
45
|
className: "error-state__action-btn error-state__action-btn--secondary",
|
|
49
|
-
children:
|
|
46
|
+
children: u.label
|
|
50
47
|
})]
|
|
51
48
|
})
|
|
52
49
|
]
|
|
53
50
|
});
|
|
54
51
|
}
|
|
55
52
|
//#endregion
|
|
56
|
-
export {
|
|
53
|
+
export { a as ErrorState };
|
|
57
54
|
|
|
58
55
|
//# sourceMappingURL=ErrorState2.js.map
|
|
59
56
|
import "../../assets/components/ErrorState/ErrorState.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorState2.js","names":[],"sources":["../../../src/components/ErrorState/ErrorState.tsx"],"sourcesContent":["/**\n * ErrorState Component\n *\n * Unified error state component with recovery actions.\n * Provides consistent error presentation across all pages with actionable buttons.\n *\n * Features:\n * -
|
|
1
|
+
{"version":3,"file":"ErrorState2.js","names":[],"sources":["../../../src/components/ErrorState/ErrorState.tsx"],"sourcesContent":["/**\n * ErrorState Component\n *\n * Unified error state component with recovery actions.\n * Provides consistent error presentation across all pages with actionable buttons.\n *\n * Features:\n * - Three visual tones\n * - Primary and secondary action buttons\n * - Accessible (ARIA attributes, focus management)\n * - Dark/light theme support\n */\n\nimport type { ReactNode } from \"react\";\nimport { useCallback } from \"react\";\nimport { AlertCircleIcon } from \"../../icons/AlertCircleIcon\";\nimport { Button } from \"../Button\";\nimport \"./ErrorState.css\";\n\n/**\n * How the error reads, not what it is about.\n *\n * This prop used to be a union of five names: network, configuration, model,\n * permission, generic. Two of those, and \"model\" in particular, are one\n * product's categories rather than anything a shared component can reason\n * about, and all five resolved to three colours anyway: network and permission\n * were the same amber, model and generic the same red. A consumer decides\n * which of its own error categories reads as which tone.\n */\nexport type ErrorTone = \"danger\" | \"warning\" | \"accent\";\n\nexport interface ErrorAction {\n label: string;\n onClick: () => void;\n}\n\nexport interface ErrorStateProps {\n /** How the error reads. Defaults to `danger`. */\n tone?: ErrorTone;\n /** Replaces the default alert icon. */\n icon?: ReactNode;\n /** Error title - main heading */\n title: string;\n /** Detailed error message */\n message: string;\n /** Primary action button (e.g., Retry, Go to Settings) */\n primaryAction?: ErrorAction;\n /** Secondary action button (e.g., View Logs, Report Issue) */\n secondaryAction?: ErrorAction;\n /** Additional CSS classes */\n className?: string;\n /** Whether to show error icon */\n showIcon?: boolean;\n}\n\n/**\n * ErrorState Component\n */\nexport function ErrorState({\n tone = \"danger\",\n icon,\n title,\n message,\n primaryAction,\n secondaryAction,\n className = \"\",\n showIcon = true,\n}: ErrorStateProps) {\n const handlePrimaryAction = useCallback(() => {\n primaryAction?.onClick();\n }, [primaryAction]);\n\n const handleSecondaryAction = useCallback(() => {\n secondaryAction?.onClick();\n }, [secondaryAction]);\n\n const containerClass = [\"error-state\", `error-state--${tone}`, className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={containerClass} role=\"alert\" aria-live=\"polite\">\n {showIcon && (\n <div className=\"error-state__icon\" aria-hidden=\"true\">\n {icon ?? <AlertCircleIcon size={48} />}\n </div>\n )}\n\n <h2 className=\"error-state__title\">{title}</h2>\n\n <p className=\"error-state__message\">{message}</p>\n\n {(primaryAction || secondaryAction) && (\n <div className=\"error-state__actions\">\n {primaryAction && (\n <Button\n variant=\"primary\"\n onClick={handlePrimaryAction}\n className=\"error-state__action-btn error-state__action-btn--primary\"\n >\n {primaryAction.label}\n </Button>\n )}\n\n {secondaryAction && (\n <Button\n variant=\"secondary\"\n onClick={handleSecondaryAction}\n className=\"error-state__action-btn error-state__action-btn--secondary\"\n >\n {secondaryAction.label}\n </Button>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AA0DA,SAAgB,EAAW,EACzB,UAAO,UACP,SACA,UACA,YACA,kBACA,oBACA,eAAY,IACZ,cAAW,MACO;CAClB,IAAM,IAAsB,QAAkB;EAC5C,GAAe,QAAQ;CACzB,GAAG,CAAC,CAAa,CAAC,GAEZ,IAAwB,QAAkB;EAC9C,GAAiB,QAAQ;CAC3B,GAAG,CAAC,CAAe,CAAC,GAEd,IAAiB;EAAC;EAAe,gBAAgB;EAAQ;CAAS,CAAC,CACtE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,kBAAC,OAAD;EAAK,WAAW;EAAgB,MAAK;EAAQ,aAAU;EAAvD,UAAA;GACG,KACC,kBAAC,OAAD;IAAK,WAAU;IAAoB,eAAY;IAC5C,UAAA,KAAQ,kBAAC,GAAD,EAAiB,MAAM,GAAK,CAAA;GAClC,CAAA;GAGP,kBAAC,MAAD;IAAI,WAAU;IAAsB,UAAA;GAAU,CAAA;GAE9C,kBAAC,KAAD;IAAG,WAAU;IAAwB,UAAA;GAAW,CAAA;IAE9C,KAAiB,MACjB,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,KACC,kBAAC,GAAD;KACE,SAAQ;KACR,SAAS;KACT,WAAU;KAET,UAAA,EAAc;IACT,CAAA,GAGT,KACC,kBAAC,GAAD;KACE,SAAQ;KACR,SAAS;KACT,WAAU;KAET,UAAA,EAAgB;IACX,CAAA,CAEP;;EAEJ;;AAET"}
|
|
@@ -8,6 +8,19 @@ export interface PageHeaderProps {
|
|
|
8
8
|
actions?: ReactNode;
|
|
9
9
|
/** Error message to display below the header */
|
|
10
10
|
error?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Secondary line under the message, for the raw detail a server returned.
|
|
13
|
+
* Kept separate so the message stays readable when the detail is long.
|
|
14
|
+
*/
|
|
15
|
+
errorDetail?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Callback for the Retry button, rendered before the dismiss control when
|
|
18
|
+
* set. Dismissal is a pure dismissal and must not retry, which is why these
|
|
19
|
+
* are two props rather than one.
|
|
20
|
+
*/
|
|
21
|
+
onRetry?: () => void;
|
|
22
|
+
/** Label for the Retry button. Default: "Retry" */
|
|
23
|
+
retryLabel?: string;
|
|
11
24
|
/** Callback when error is dismissed */
|
|
12
25
|
onErrorDismiss?: () => void;
|
|
13
26
|
/** Additional CSS class names */
|
|
@@ -15,4 +28,4 @@ export interface PageHeaderProps {
|
|
|
15
28
|
/** Accessible label for the error-dismiss button. Default: "Dismiss error" */
|
|
16
29
|
dismissErrorLabel?: string;
|
|
17
30
|
}
|
|
18
|
-
export declare function PageHeader({ title, description, actions, error, onErrorDismiss, className, dismissErrorLabel, }: PageHeaderProps): import("react").JSX.Element;
|
|
31
|
+
export declare function PageHeader({ title, description, actions, error, onErrorDismiss, className, errorDetail, onRetry, retryLabel, dismissErrorLabel, }: PageHeaderProps): import("react").JSX.Element;
|
|
@@ -1,43 +1,59 @@
|
|
|
1
|
+
import { Button as e } from "../Button/Button2.js";
|
|
1
2
|
/* empty css */
|
|
2
|
-
import { jsx as
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/PageHeader/PageHeader.tsx
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
className:
|
|
8
|
-
children: [/* @__PURE__ */
|
|
5
|
+
function r({ title: r, description: i, actions: a, error: o, onErrorDismiss: s, className: c = "", errorDetail: l, onRetry: u, retryLabel: d = "Retry", dismissErrorLabel: f = "Dismiss error" }) {
|
|
6
|
+
let p = ["page-header", c].filter(Boolean).join(" ");
|
|
7
|
+
return /* @__PURE__ */ n("header", {
|
|
8
|
+
className: p,
|
|
9
|
+
children: [/* @__PURE__ */ n("div", {
|
|
9
10
|
className: "page-header__content",
|
|
10
|
-
children: [/* @__PURE__ */
|
|
11
|
+
children: [/* @__PURE__ */ n("div", {
|
|
11
12
|
className: "page-header__text",
|
|
12
|
-
children: [/* @__PURE__ */
|
|
13
|
+
children: [/* @__PURE__ */ t("h1", {
|
|
13
14
|
className: "page-header__title",
|
|
14
|
-
children: n
|
|
15
|
-
}), r && /* @__PURE__ */ e("p", {
|
|
16
|
-
className: "page-header__description",
|
|
17
15
|
children: r
|
|
16
|
+
}), i && /* @__PURE__ */ t("p", {
|
|
17
|
+
className: "page-header__description",
|
|
18
|
+
children: i
|
|
18
19
|
})]
|
|
19
|
-
}),
|
|
20
|
+
}), a && /* @__PURE__ */ t("div", {
|
|
20
21
|
className: "page-header__actions",
|
|
21
|
-
children:
|
|
22
|
+
children: a
|
|
22
23
|
})]
|
|
23
|
-
}),
|
|
24
|
+
}), o && /* @__PURE__ */ n("div", {
|
|
24
25
|
className: "page-header__error",
|
|
25
26
|
role: "alert",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
27
|
-
className: "page-header__error-
|
|
28
|
-
children:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
children: [/* @__PURE__ */ n("div", {
|
|
28
|
+
className: "page-header__error-body",
|
|
29
|
+
children: [/* @__PURE__ */ t("span", {
|
|
30
|
+
className: "page-header__error-text",
|
|
31
|
+
children: o
|
|
32
|
+
}), l && /* @__PURE__ */ t("span", {
|
|
33
|
+
className: "page-header__error-detail",
|
|
34
|
+
children: l
|
|
35
|
+
})]
|
|
36
|
+
}), (u || s) && /* @__PURE__ */ n("div", {
|
|
37
|
+
className: "page-header__error-actions",
|
|
38
|
+
children: [u && /* @__PURE__ */ t(e, {
|
|
39
|
+
variant: "secondary",
|
|
40
|
+
size: "small",
|
|
41
|
+
className: "page-header__error-retry",
|
|
42
|
+
onClick: u,
|
|
43
|
+
children: d
|
|
44
|
+
}), s && /* @__PURE__ */ t("button", {
|
|
45
|
+
type: "button",
|
|
46
|
+
className: "page-header__error-dismiss",
|
|
47
|
+
onClick: s,
|
|
48
|
+
"aria-label": f,
|
|
49
|
+
children: "×"
|
|
50
|
+
})]
|
|
35
51
|
})]
|
|
36
52
|
})]
|
|
37
53
|
});
|
|
38
54
|
}
|
|
39
55
|
//#endregion
|
|
40
|
-
export {
|
|
56
|
+
export { r as PageHeader };
|
|
41
57
|
|
|
42
58
|
//# sourceMappingURL=PageHeader2.js.map
|
|
43
59
|
import "../../assets/components/PageHeader/PageHeader.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader2.js","names":[],"sources":["../../../src/components/PageHeader/PageHeader.tsx"],"sourcesContent":["/**\n * PageHeader Component\n *\n * Standardized page header with title, description, and optional action buttons.\n * Provides consistent styling and layout across all pages.\n *\n * @example\n * // Basic usage\n * <PageHeader\n * title=\"Models\"\n * description=\"Manage and browse your local models\"\n * />\n *\n * @example\n * // With action buttons\n * <PageHeader\n * title=\"Settings\"\n * description=\"Configure application settings\"\n * actions={\n * <>\n * <Button variant=\"secondary\">Import</Button>\n * <Button variant=\"primary\">Save</Button>\n * </>\n * }\n * />\n *\n * @example\n * // With error display\n * <PageHeader\n * title=\"Engines\"\n * description=\"Manage runtime engines\"\n * error={error}\n * onErrorDismiss={() => clearError()}\n * />\n */\n\nimport type { ReactNode } from \"react\";\nimport \"./PageHeader.css\";\n\nexport interface PageHeaderProps {\n /** Page title - displayed as h1 */\n title: string;\n /** Page description - displayed below title */\n description?: string;\n /** Optional action buttons or elements on the right side */\n actions?: ReactNode;\n /** Error message to display below the header */\n error?: string | null;\n /** Callback when error is dismissed */\n onErrorDismiss?: () => void;\n /** Additional CSS class names */\n className?: string;\n /** Accessible label for the error-dismiss button. Default: \"Dismiss error\" */\n dismissErrorLabel?: string;\n}\n\nexport function PageHeader({\n title,\n description,\n actions,\n error,\n onErrorDismiss,\n className = \"\",\n dismissErrorLabel = \"Dismiss error\",\n}: PageHeaderProps) {\n const classes = [\"page-header\", className].filter(Boolean).join(\" \");\n\n return (\n <header className={classes}>\n <div className=\"page-header__content\">\n <div className=\"page-header__text\">\n <h1 className=\"page-header__title\">{title}</h1>\n {description && <p className=\"page-header__description\">{description}</p>}\n </div>\n {actions && <div className=\"page-header__actions\">{actions}</div>}\n </div>\n {error && (\n <div className=\"page-header__error\" role=\"alert\">\n <span className=\"page-header__error-text\">{error}</span>\n {onErrorDismiss && (\n <button\n
|
|
1
|
+
{"version":3,"file":"PageHeader2.js","names":[],"sources":["../../../src/components/PageHeader/PageHeader.tsx"],"sourcesContent":["/**\n * PageHeader Component\n *\n * Standardized page header with title, description, and optional action buttons.\n * Provides consistent styling and layout across all pages.\n *\n * @example\n * // Basic usage\n * <PageHeader\n * title=\"Models\"\n * description=\"Manage and browse your local models\"\n * />\n *\n * @example\n * // With action buttons\n * <PageHeader\n * title=\"Settings\"\n * description=\"Configure application settings\"\n * actions={\n * <>\n * <Button variant=\"secondary\">Import</Button>\n * <Button variant=\"primary\">Save</Button>\n * </>\n * }\n * />\n *\n * @example\n * // With error display\n * <PageHeader\n * title=\"Engines\"\n * description=\"Manage runtime engines\"\n * error={error}\n * onErrorDismiss={() => clearError()}\n * />\n */\n\nimport type { ReactNode } from \"react\";\nimport { Button } from \"../Button\";\nimport \"./PageHeader.css\";\n\nexport interface PageHeaderProps {\n /** Page title - displayed as h1 */\n title: string;\n /** Page description - displayed below title */\n description?: string;\n /** Optional action buttons or elements on the right side */\n actions?: ReactNode;\n /** Error message to display below the header */\n error?: string | null;\n /**\n * Secondary line under the message, for the raw detail a server returned.\n * Kept separate so the message stays readable when the detail is long.\n */\n errorDetail?: string | null;\n /**\n * Callback for the Retry button, rendered before the dismiss control when\n * set. Dismissal is a pure dismissal and must not retry, which is why these\n * are two props rather than one.\n */\n onRetry?: () => void;\n /** Label for the Retry button. Default: \"Retry\" */\n retryLabel?: string;\n /** Callback when error is dismissed */\n onErrorDismiss?: () => void;\n /** Additional CSS class names */\n className?: string;\n /** Accessible label for the error-dismiss button. Default: \"Dismiss error\" */\n dismissErrorLabel?: string;\n}\n\nexport function PageHeader({\n title,\n description,\n actions,\n error,\n onErrorDismiss,\n className = \"\",\n errorDetail,\n onRetry,\n retryLabel = \"Retry\",\n dismissErrorLabel = \"Dismiss error\",\n}: PageHeaderProps) {\n const classes = [\"page-header\", className].filter(Boolean).join(\" \");\n\n return (\n <header className={classes}>\n <div className=\"page-header__content\">\n <div className=\"page-header__text\">\n <h1 className=\"page-header__title\">{title}</h1>\n {description && <p className=\"page-header__description\">{description}</p>}\n </div>\n {actions && <div className=\"page-header__actions\">{actions}</div>}\n </div>\n {error && (\n <div className=\"page-header__error\" role=\"alert\">\n <div className=\"page-header__error-body\">\n <span className=\"page-header__error-text\">{error}</span>\n {errorDetail && (\n <span className=\"page-header__error-detail\">{errorDetail}</span>\n )}\n </div>\n {(onRetry || onErrorDismiss) && (\n <div className=\"page-header__error-actions\">\n {onRetry && (\n <Button\n variant=\"secondary\"\n size=\"small\"\n className=\"page-header__error-retry\"\n onClick={onRetry}\n >\n {retryLabel}\n </Button>\n )}\n {onErrorDismiss && (\n <button\n type=\"button\"\n className=\"page-header__error-dismiss\"\n onClick={onErrorDismiss}\n aria-label={dismissErrorLabel}\n >\n ×\n </button>\n )}\n </div>\n )}\n </div>\n )}\n </header>\n );\n}\n"],"mappings":";;;;AAsEA,SAAgB,EAAW,EACzB,UACA,gBACA,YACA,UACA,mBACA,eAAY,IACZ,gBACA,YACA,gBAAa,SACb,uBAAoB,mBACF;CAClB,IAAM,IAAU,CAAC,eAAe,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAEnE,OACE,kBAAC,UAAD;EAAQ,WAAW;EAAnB,UAAA,CACE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KAAsB,UAAA;IAAU,CAAA,GAC7C,KAAe,kBAAC,KAAD;KAAG,WAAU;KAA4B,UAAA;IAAe,CAAA,CACrE;GACJ,CAAA,GAAA,KAAW,kBAAC,OAAD;IAAK,WAAU;IAAwB,UAAA;GAAa,CAAA,CAC7D;EACJ,CAAA,GAAA,KACC,kBAAC,OAAD;GAAK,WAAU;GAAqB,MAAK;GAAzC,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,QAAD;KAAM,WAAU;KAA2B,UAAA;IAAY,CAAA,GACtD,KACC,kBAAC,QAAD;KAAM,WAAU;KAA6B,UAAA;IAAkB,CAAA,CAE9D;GACH,CAAA,IAAA,KAAW,MACX,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,KACC,kBAAC,GAAD;KACE,SAAQ;KACR,MAAK;KACL,WAAU;KACV,SAAS;KAER,UAAA;IACK,CAAA,GAET,KACC,kBAAC,UAAD;KACE,MAAK;KACL,WAAU;KACV,SAAS;KACT,cAAY;KACb,UAAA;IAEO,CAAA,CAEP;GAEJ,CAAA,CAAA;EAED,CAAA,CAAA;;AAEZ"}
|
|
@@ -5,6 +5,8 @@ export interface SkeletonCardProps {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
/** Test ID for testing */
|
|
7
7
|
testId?: string;
|
|
8
|
+
/** Accessible name for each skeleton inside. Defaults to "Loading". */
|
|
9
|
+
loadingLabel?: string;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* SkeletonCard provides a loading placeholder for card components.
|
|
@@ -14,5 +16,5 @@ export interface SkeletonCardProps {
|
|
|
14
16
|
* - compact: Smaller card with reduced padding
|
|
15
17
|
* - stat: Statistics card layout
|
|
16
18
|
*/
|
|
17
|
-
export declare function SkeletonCard({ variant, className, testId, }: SkeletonCardProps): import("react").JSX.Element;
|
|
19
|
+
export declare function SkeletonCard({ variant, className, testId, loadingLabel, }: SkeletonCardProps): import("react").JSX.Element;
|
|
18
20
|
export default SkeletonCard;
|
|
@@ -2,29 +2,32 @@ import { Skeleton as e } from "./Skeleton2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Skeleton/SkeletonCard.tsx
|
|
5
|
-
function i({ variant: i = "default", className: a = "", testId: o }) {
|
|
6
|
-
let
|
|
5
|
+
function i({ variant: i = "default", className: a = "", testId: o, loadingLabel: s }) {
|
|
6
|
+
let c = [
|
|
7
7
|
"skeleton-card",
|
|
8
8
|
`skeleton-card--${i}`,
|
|
9
9
|
a
|
|
10
10
|
].filter(Boolean).join(" ");
|
|
11
11
|
return /* @__PURE__ */ n("div", {
|
|
12
|
-
className:
|
|
12
|
+
className: c,
|
|
13
13
|
"data-testid": o,
|
|
14
14
|
role: "status",
|
|
15
15
|
"aria-busy": "true",
|
|
16
16
|
children: i === "stat" ? /* @__PURE__ */ n(t, { children: /* @__PURE__ */ r("div", {
|
|
17
17
|
className: "skeleton-card__header",
|
|
18
18
|
children: [/* @__PURE__ */ n(e, {
|
|
19
|
+
loadingLabel: s,
|
|
19
20
|
width: "48px",
|
|
20
21
|
height: "48px",
|
|
21
22
|
variant: "circle"
|
|
22
23
|
}), /* @__PURE__ */ r("div", {
|
|
23
24
|
className: "skeleton-card__header-text",
|
|
24
25
|
children: [/* @__PURE__ */ n(e, {
|
|
26
|
+
loadingLabel: s,
|
|
25
27
|
width: "60%",
|
|
26
28
|
height: "16px"
|
|
27
29
|
}), /* @__PURE__ */ n(e, {
|
|
30
|
+
loadingLabel: s,
|
|
28
31
|
width: "40%",
|
|
29
32
|
height: "24px"
|
|
30
33
|
})]
|
|
@@ -33,6 +36,7 @@ function i({ variant: i = "default", className: a = "", testId: o }) {
|
|
|
33
36
|
/* @__PURE__ */ n("div", {
|
|
34
37
|
className: "skeleton-card__header",
|
|
35
38
|
children: /* @__PURE__ */ n(e, {
|
|
39
|
+
loadingLabel: s,
|
|
36
40
|
width: "70%",
|
|
37
41
|
height: "20px"
|
|
38
42
|
})
|
|
@@ -41,14 +45,17 @@ function i({ variant: i = "default", className: a = "", testId: o }) {
|
|
|
41
45
|
className: "skeleton-card__content",
|
|
42
46
|
children: [
|
|
43
47
|
/* @__PURE__ */ n(e, {
|
|
48
|
+
loadingLabel: s,
|
|
44
49
|
width: "100%",
|
|
45
50
|
height: "16px"
|
|
46
51
|
}),
|
|
47
52
|
/* @__PURE__ */ n(e, {
|
|
53
|
+
loadingLabel: s,
|
|
48
54
|
width: "90%",
|
|
49
55
|
height: "16px"
|
|
50
56
|
}),
|
|
51
57
|
/* @__PURE__ */ n(e, {
|
|
58
|
+
loadingLabel: s,
|
|
52
59
|
width: "80%",
|
|
53
60
|
height: "16px"
|
|
54
61
|
})
|
|
@@ -57,9 +64,11 @@ function i({ variant: i = "default", className: a = "", testId: o }) {
|
|
|
57
64
|
i !== "compact" && /* @__PURE__ */ r("div", {
|
|
58
65
|
className: "skeleton-card__footer",
|
|
59
66
|
children: [/* @__PURE__ */ n(e, {
|
|
67
|
+
loadingLabel: s,
|
|
60
68
|
width: "80px",
|
|
61
69
|
height: "32px"
|
|
62
70
|
}), /* @__PURE__ */ n(e, {
|
|
71
|
+
loadingLabel: s,
|
|
63
72
|
width: "80px",
|
|
64
73
|
height: "32px"
|
|
65
74
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonCard2.js","names":[],"sources":["../../../src/components/Skeleton/SkeletonCard.tsx"],"sourcesContent":["/**\n * SkeletonCard Component\n *\n * Skeleton placeholder for card components (model cards, stat cards, etc.).\n * Mimics the structure of a typical card with header, content, and footer areas.\n *\n * @example\n * // Basic usage\n * <SkeletonCard />\n *\n * @example\n * // Compact variant\n * <SkeletonCard variant=\"compact\" />\n */\n\nimport { Skeleton } from \"./Skeleton\";\nimport \"./SkeletonCard.css\";\n\nexport interface SkeletonCardProps {\n /** Card size variant */\n variant?: \"default\" | \"compact\" | \"stat\";\n /** Additional CSS class names */\n className?: string;\n /** Test ID for testing */\n testId?: string;\n}\n\n/**\n * SkeletonCard provides a loading placeholder for card components.\n *\n * Variants:\n * - default: Full card with header, content, and footer\n * - compact: Smaller card with reduced padding\n * - stat: Statistics card layout\n */\nexport function SkeletonCard({\n variant = \"default\",\n className = \"\",\n testId,\n}: SkeletonCardProps) {\n const classNames = [\"skeleton-card\", `skeleton-card--${variant}`, className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={classNames} data-testid={testId} role=\"status\" aria-busy=\"true\">\n {variant === \"stat\" ? (\n <>\n <div className=\"skeleton-card__header\">\n <Skeleton
|
|
1
|
+
{"version":3,"file":"SkeletonCard2.js","names":[],"sources":["../../../src/components/Skeleton/SkeletonCard.tsx"],"sourcesContent":["/**\n * SkeletonCard Component\n *\n * Skeleton placeholder for card components (model cards, stat cards, etc.).\n * Mimics the structure of a typical card with header, content, and footer areas.\n *\n * @example\n * // Basic usage\n * <SkeletonCard />\n *\n * @example\n * // Compact variant\n * <SkeletonCard variant=\"compact\" />\n */\n\nimport { Skeleton } from \"./Skeleton\";\nimport \"./SkeletonCard.css\";\n\nexport interface SkeletonCardProps {\n /** Card size variant */\n variant?: \"default\" | \"compact\" | \"stat\";\n /** Additional CSS class names */\n className?: string;\n /** Test ID for testing */\n testId?: string;\n /** Accessible name for each skeleton inside. Defaults to \"Loading\". */\n loadingLabel?: string;\n}\n\n/**\n * SkeletonCard provides a loading placeholder for card components.\n *\n * Variants:\n * - default: Full card with header, content, and footer\n * - compact: Smaller card with reduced padding\n * - stat: Statistics card layout\n */\nexport function SkeletonCard({\n variant = \"default\",\n className = \"\",\n testId,\n loadingLabel,\n}: SkeletonCardProps) {\n const classNames = [\"skeleton-card\", `skeleton-card--${variant}`, className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={classNames} data-testid={testId} role=\"status\" aria-busy=\"true\">\n {variant === \"stat\" ? (\n <>\n <div className=\"skeleton-card__header\">\n <Skeleton\n loadingLabel={loadingLabel}\n width=\"48px\"\n height=\"48px\"\n variant=\"circle\"\n />\n <div className=\"skeleton-card__header-text\">\n <Skeleton loadingLabel={loadingLabel} width=\"60%\" height=\"16px\" />\n <Skeleton loadingLabel={loadingLabel} width=\"40%\" height=\"24px\" />\n </div>\n </div>\n </>\n ) : (\n <>\n <div className=\"skeleton-card__header\">\n <Skeleton loadingLabel={loadingLabel} width=\"70%\" height=\"20px\" />\n </div>\n <div className=\"skeleton-card__content\">\n <Skeleton loadingLabel={loadingLabel} width=\"100%\" height=\"16px\" />\n <Skeleton loadingLabel={loadingLabel} width=\"90%\" height=\"16px\" />\n <Skeleton loadingLabel={loadingLabel} width=\"80%\" height=\"16px\" />\n </div>\n {variant !== \"compact\" && (\n <div className=\"skeleton-card__footer\">\n <Skeleton loadingLabel={loadingLabel} width=\"80px\" height=\"32px\" />\n <Skeleton loadingLabel={loadingLabel} width=\"80px\" height=\"32px\" />\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n\nexport default SkeletonCard;\n"],"mappings":";;;;AAqCA,SAAgB,EAAa,EAC3B,aAAU,WACV,eAAY,IACZ,WACA,mBACoB;CACpB,IAAM,IAAa;EAAC;EAAiB,kBAAkB;EAAW;CAAS,CAAC,CACzE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,kBAAC,OAAD;EAAK,WAAW;EAAY,eAAa;EAAQ,MAAK;EAAS,aAAU;EACtE,UAAA,MAAY,SACX,kBAAA,GAAA,EAAA,UACE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,GAAD;IACgB;IACd,OAAM;IACN,QAAO;IACP,SAAQ;GACT,CAAA,GACD,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAM,QAAO;IAAQ,CAAA,GACjE,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAM,QAAO;IAAQ,CAAA,CAC9D;GACF,CAAA,CAAA;EACL,CAAA,EAAA,CAAA,IAEF,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAM,QAAO;IAAQ,CAAA;GAC9D,CAAA;GACL,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,GAAD;MAAwB;MAAc,OAAM;MAAO,QAAO;KAAQ,CAAA;KAClE,kBAAC,GAAD;MAAwB;MAAc,OAAM;MAAM,QAAO;KAAQ,CAAA;KACjE,kBAAC,GAAD;MAAwB;MAAc,OAAM;MAAM,QAAO;KAAQ,CAAA;IAC9D;;GACJ,MAAY,aACX,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAO,QAAO;IAAQ,CAAA,GAClE,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAO,QAAO;IAAQ,CAAA,CAC/D;;EAEP,EAAA,CAAA;CAED,CAAA;AAET"}
|
|
@@ -9,6 +9,8 @@ export interface SkeletonRowProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
/** Test ID for testing */
|
|
11
11
|
testId?: string;
|
|
12
|
+
/** Accessible name for each skeleton inside. Defaults to "Loading". */
|
|
13
|
+
loadingLabel?: string;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* SkeletonRow provides a loading placeholder for list/table rows.
|
|
@@ -18,5 +20,5 @@ export interface SkeletonRowProps {
|
|
|
18
20
|
* - Optional action buttons
|
|
19
21
|
* - Multiple rows for lists
|
|
20
22
|
*/
|
|
21
|
-
export declare function SkeletonRow({ showAvatar, showActions, count, className, testId, }: SkeletonRowProps): import("react").JSX.Element;
|
|
23
|
+
export declare function SkeletonRow({ showAvatar, showActions, count, className, testId, loadingLabel, }: SkeletonRowProps): import("react").JSX.Element;
|
|
22
24
|
export default SkeletonRow;
|
|
@@ -2,9 +2,9 @@ import { Skeleton as e } from "./Skeleton2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Skeleton/SkeletonRow.tsx
|
|
5
|
-
function i({ showAvatar: i = !1, showActions: a = !1, count: o = 1, className: s = "", testId: c }) {
|
|
6
|
-
let
|
|
7
|
-
return /* @__PURE__ */ n(t, { children:
|
|
5
|
+
function i({ showAvatar: i = !1, showActions: a = !1, count: o = 1, className: s = "", testId: c, loadingLabel: l }) {
|
|
6
|
+
let u = Array.from({ length: o });
|
|
7
|
+
return /* @__PURE__ */ n(t, { children: u.map((t, o) => /* @__PURE__ */ r("div", {
|
|
8
8
|
className: `skeleton-row ${s}`,
|
|
9
9
|
"data-testid": c ? `${c}-${String(o)}` : void 0,
|
|
10
10
|
role: "status",
|
|
@@ -13,6 +13,7 @@ function i({ showAvatar: i = !1, showActions: a = !1, count: o = 1, className: s
|
|
|
13
13
|
i && /* @__PURE__ */ n("div", {
|
|
14
14
|
className: "skeleton-row__avatar",
|
|
15
15
|
children: /* @__PURE__ */ n(e, {
|
|
16
|
+
loadingLabel: l,
|
|
16
17
|
width: "40px",
|
|
17
18
|
height: "40px",
|
|
18
19
|
variant: "circle"
|
|
@@ -21,9 +22,11 @@ function i({ showAvatar: i = !1, showActions: a = !1, count: o = 1, className: s
|
|
|
21
22
|
/* @__PURE__ */ r("div", {
|
|
22
23
|
className: "skeleton-row__content",
|
|
23
24
|
children: [/* @__PURE__ */ n(e, {
|
|
25
|
+
loadingLabel: l,
|
|
24
26
|
width: "25%",
|
|
25
27
|
height: "14px"
|
|
26
28
|
}), /* @__PURE__ */ n(e, {
|
|
29
|
+
loadingLabel: l,
|
|
27
30
|
width: "100%",
|
|
28
31
|
height: "16px"
|
|
29
32
|
})]
|
|
@@ -31,9 +34,11 @@ function i({ showAvatar: i = !1, showActions: a = !1, count: o = 1, className: s
|
|
|
31
34
|
a && /* @__PURE__ */ r("div", {
|
|
32
35
|
className: "skeleton-row__actions",
|
|
33
36
|
children: [/* @__PURE__ */ n(e, {
|
|
37
|
+
loadingLabel: l,
|
|
34
38
|
width: "32px",
|
|
35
39
|
height: "32px"
|
|
36
40
|
}), /* @__PURE__ */ n(e, {
|
|
41
|
+
loadingLabel: l,
|
|
37
42
|
width: "32px",
|
|
38
43
|
height: "32px"
|
|
39
44
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonRow2.js","names":[],"sources":["../../../src/components/Skeleton/SkeletonRow.tsx"],"sourcesContent":["/**\n * SkeletonRow Component\n *\n * Skeleton placeholder for list rows and table rows.\n * Mimics the structure of a log entry or table row.\n *\n * @example\n * // Basic usage\n * <SkeletonRow />\n *\n * @example\n * // With avatar\n * <SkeletonRow showAvatar />\n */\n\nimport { Skeleton } from \"./Skeleton\";\nimport \"./SkeletonRow.css\";\n\nexport interface SkeletonRowProps {\n /** Show avatar/icon on the left */\n showAvatar?: boolean;\n /** Show action buttons on the right */\n showActions?: boolean;\n /** Number of rows to display */\n count?: number;\n /** Additional CSS class names */\n className?: string;\n /** Test ID for testing */\n testId?: string;\n}\n\n/**\n * SkeletonRow provides a loading placeholder for list/table rows.\n *\n * Features:\n * - Optional avatar/icon\n * - Optional action buttons\n * - Multiple rows for lists\n */\nexport function SkeletonRow({\n showAvatar = false,\n showActions = false,\n count = 1,\n className = \"\",\n testId,\n}: SkeletonRowProps) {\n const rows = Array.from({ length: count });\n\n return (\n <>\n {rows.map((_, index) => (\n <div\n key={index}\n className={`skeleton-row ${className}`}\n data-testid={testId ? `${testId}-${String(index)}` : undefined}\n role=\"status\"\n aria-busy=\"true\"\n >\n {showAvatar && (\n <div className=\"skeleton-row__avatar\">\n <Skeleton
|
|
1
|
+
{"version":3,"file":"SkeletonRow2.js","names":[],"sources":["../../../src/components/Skeleton/SkeletonRow.tsx"],"sourcesContent":["/**\n * SkeletonRow Component\n *\n * Skeleton placeholder for list rows and table rows.\n * Mimics the structure of a log entry or table row.\n *\n * @example\n * // Basic usage\n * <SkeletonRow />\n *\n * @example\n * // With avatar\n * <SkeletonRow showAvatar />\n */\n\nimport { Skeleton } from \"./Skeleton\";\nimport \"./SkeletonRow.css\";\n\nexport interface SkeletonRowProps {\n /** Show avatar/icon on the left */\n showAvatar?: boolean;\n /** Show action buttons on the right */\n showActions?: boolean;\n /** Number of rows to display */\n count?: number;\n /** Additional CSS class names */\n className?: string;\n /** Test ID for testing */\n testId?: string;\n /** Accessible name for each skeleton inside. Defaults to \"Loading\". */\n loadingLabel?: string;\n}\n\n/**\n * SkeletonRow provides a loading placeholder for list/table rows.\n *\n * Features:\n * - Optional avatar/icon\n * - Optional action buttons\n * - Multiple rows for lists\n */\nexport function SkeletonRow({\n showAvatar = false,\n showActions = false,\n count = 1,\n className = \"\",\n testId,\n loadingLabel,\n}: SkeletonRowProps) {\n const rows = Array.from({ length: count });\n\n return (\n <>\n {rows.map((_, index) => (\n <div\n key={index}\n className={`skeleton-row ${className}`}\n data-testid={testId ? `${testId}-${String(index)}` : undefined}\n role=\"status\"\n aria-busy=\"true\"\n >\n {showAvatar && (\n <div className=\"skeleton-row__avatar\">\n <Skeleton\n loadingLabel={loadingLabel}\n width=\"40px\"\n height=\"40px\"\n variant=\"circle\"\n />\n </div>\n )}\n <div className=\"skeleton-row__content\">\n <Skeleton loadingLabel={loadingLabel} width=\"25%\" height=\"14px\" />\n <Skeleton loadingLabel={loadingLabel} width=\"100%\" height=\"16px\" />\n </div>\n {showActions && (\n <div className=\"skeleton-row__actions\">\n <Skeleton loadingLabel={loadingLabel} width=\"32px\" height=\"32px\" />\n <Skeleton loadingLabel={loadingLabel} width=\"32px\" height=\"32px\" />\n </div>\n )}\n </div>\n ))}\n </>\n );\n}\n\nexport default SkeletonRow;\n"],"mappings":";;;;AAyCA,SAAgB,EAAY,EAC1B,gBAAa,IACb,iBAAc,IACd,WAAQ,GACR,eAAY,IACZ,WACA,mBACmB;CACnB,IAAM,IAAO,MAAM,KAAK,EAAE,QAAQ,EAAM,CAAC;CAEzC,OACE,kBAAA,GAAA,EAAA,UACG,EAAK,KAAK,GAAG,MACZ,kBAAC,OAAD;EAEE,WAAW,gBAAgB;EAC3B,eAAa,IAAS,GAAG,EAAO,GAAG,OAAO,CAAK,MAAM,KAAA;EACrD,MAAK;EACL,aAAU;EALZ,UAAA;GAOG,KACC,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAAC,GAAD;KACgB;KACd,OAAM;KACN,QAAO;KACP,SAAQ;IACT,CAAA;GACE,CAAA;GAEP,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAM,QAAO;IAAQ,CAAA,GACjE,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAO,QAAO;IAAQ,CAAA,CAC/D;;GACJ,KACC,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAO,QAAO;IAAQ,CAAA,GAClE,kBAAC,GAAD;KAAwB;KAAc,OAAM;KAAO,QAAO;IAAQ,CAAA,CAC/D;;EAEJ;CA1BE,GAAA,CA0BF,CACN,EACD,CAAA;AAEN"}
|
|
@@ -7,6 +7,8 @@ export interface SkeletonTextProps {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
/** Test ID for testing */
|
|
9
9
|
testId?: string;
|
|
10
|
+
/** Accessible name for each skeleton inside. Defaults to "Loading". */
|
|
11
|
+
loadingLabel?: string;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* SkeletonText provides a loading placeholder for text content.
|
|
@@ -16,5 +18,5 @@ export interface SkeletonTextProps {
|
|
|
16
18
|
* - Configurable line spacing
|
|
17
19
|
* - Accessible via aria-busy
|
|
18
20
|
*/
|
|
19
|
-
export declare function SkeletonText({ lines, spacing, className, testId, }: SkeletonTextProps): import("react").JSX.Element;
|
|
21
|
+
export declare function SkeletonText({ lines, spacing, className, testId, loadingLabel, }: SkeletonTextProps): import("react").JSX.Element;
|
|
20
22
|
export default SkeletonText;
|
|
@@ -2,18 +2,19 @@ import { Skeleton as e } from "./Skeleton2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Skeleton/SkeletonText.tsx
|
|
5
|
-
function n({ lines: n = 3, spacing: r = "normal", className: i = "", testId: a }) {
|
|
6
|
-
let
|
|
5
|
+
function n({ lines: n = 3, spacing: r = "normal", className: i = "", testId: a, loadingLabel: o }) {
|
|
6
|
+
let s = [
|
|
7
7
|
"skeleton-text",
|
|
8
8
|
`skeleton-text--${r}`,
|
|
9
9
|
i
|
|
10
|
-
].filter(Boolean).join(" "),
|
|
10
|
+
].filter(Boolean).join(" "), c = Array.from({ length: n }, (e, t) => t === n - 1 ? "60%" : t % 2 == 0 ? "100%" : "95%");
|
|
11
11
|
return /* @__PURE__ */ t("div", {
|
|
12
|
-
className:
|
|
12
|
+
className: s,
|
|
13
13
|
"data-testid": a,
|
|
14
14
|
role: "status",
|
|
15
15
|
"aria-busy": "true",
|
|
16
|
-
children:
|
|
16
|
+
children: c.map((n, r) => /* @__PURE__ */ t(e, {
|
|
17
|
+
loadingLabel: o,
|
|
17
18
|
width: n,
|
|
18
19
|
height: "1em",
|
|
19
20
|
variant: "text"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonText2.js","names":[],"sources":["../../../src/components/Skeleton/SkeletonText.tsx"],"sourcesContent":["/**\n * SkeletonText Component\n *\n * Skeleton placeholder for text content.\n * Provides multiple lines with varying widths for natural appearance.\n *\n * @example\n * // Basic usage (3 lines)\n * <SkeletonText />\n *\n * @example\n * // Custom number of lines\n * <SkeletonText lines={5} />\n */\n\nimport { Skeleton } from \"./Skeleton\";\nimport \"./SkeletonText.css\";\n\nexport interface SkeletonTextProps {\n /** Number of text lines to display */\n lines?: number;\n /** Spacing between lines */\n spacing?: \"compact\" | \"normal\" | \"relaxed\";\n /** Additional CSS class names */\n className?: string;\n /** Test ID for testing */\n testId?: string;\n}\n\n/**\n * SkeletonText provides a loading placeholder for text content.\n *\n * Features:\n * - Multiple lines with varying widths\n * - Configurable line spacing\n * - Accessible via aria-busy\n */\nexport function SkeletonText({\n lines = 3,\n spacing = \"normal\",\n className = \"\",\n testId,\n}: SkeletonTextProps) {\n const classNames = [\"skeleton-text\", `skeleton-text--${spacing}`, className]\n .filter(Boolean)\n .join(\" \");\n\n // Generate varying widths for natural appearance\n const widths = Array.from({ length: lines }, (_, i) => {\n if (i === lines - 1) {\n // Last line is shorter\n return \"60%\";\n }\n // Alternate between full and slightly shorter widths\n return i % 2 === 0 ? \"100%\" : \"95%\";\n });\n\n return (\n <div className={classNames} data-testid={testId} role=\"status\" aria-busy=\"true\">\n {widths.map((width, index) => (\n <Skeleton
|
|
1
|
+
{"version":3,"file":"SkeletonText2.js","names":[],"sources":["../../../src/components/Skeleton/SkeletonText.tsx"],"sourcesContent":["/**\n * SkeletonText Component\n *\n * Skeleton placeholder for text content.\n * Provides multiple lines with varying widths for natural appearance.\n *\n * @example\n * // Basic usage (3 lines)\n * <SkeletonText />\n *\n * @example\n * // Custom number of lines\n * <SkeletonText lines={5} />\n */\n\nimport { Skeleton } from \"./Skeleton\";\nimport \"./SkeletonText.css\";\n\nexport interface SkeletonTextProps {\n /** Number of text lines to display */\n lines?: number;\n /** Spacing between lines */\n spacing?: \"compact\" | \"normal\" | \"relaxed\";\n /** Additional CSS class names */\n className?: string;\n /** Test ID for testing */\n testId?: string;\n /** Accessible name for each skeleton inside. Defaults to \"Loading\". */\n loadingLabel?: string;\n}\n\n/**\n * SkeletonText provides a loading placeholder for text content.\n *\n * Features:\n * - Multiple lines with varying widths\n * - Configurable line spacing\n * - Accessible via aria-busy\n */\nexport function SkeletonText({\n lines = 3,\n spacing = \"normal\",\n className = \"\",\n testId,\n loadingLabel,\n}: SkeletonTextProps) {\n const classNames = [\"skeleton-text\", `skeleton-text--${spacing}`, className]\n .filter(Boolean)\n .join(\" \");\n\n // Generate varying widths for natural appearance\n const widths = Array.from({ length: lines }, (_, i) => {\n if (i === lines - 1) {\n // Last line is shorter\n return \"60%\";\n }\n // Alternate between full and slightly shorter widths\n return i % 2 === 0 ? \"100%\" : \"95%\";\n });\n\n return (\n <div className={classNames} data-testid={testId} role=\"status\" aria-busy=\"true\">\n {widths.map((width, index) => (\n <Skeleton\n loadingLabel={loadingLabel}\n key={index}\n width={width}\n height=\"1em\"\n variant=\"text\"\n />\n ))}\n </div>\n );\n}\n\nexport default SkeletonText;\n"],"mappings":";;;;AAuCA,SAAgB,EAAa,EAC3B,WAAQ,GACR,aAAU,UACV,eAAY,IACZ,WACA,mBACoB;CACpB,IAAM,IAAa;EAAC;EAAiB,kBAAkB;EAAW;CAAS,CAAC,CACzE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,GAGL,IAAS,MAAM,KAAK,EAAE,QAAQ,EAAM,IAAI,GAAG,MAC3C,MAAM,IAAQ,IAET,QAGF,IAAI,KAAM,IAAI,SAAS,KAC/B;CAED,OACE,kBAAC,OAAD;EAAK,WAAW;EAAY,eAAa;EAAQ,MAAK;EAAS,aAAU;EACtE,UAAA,EAAO,KAAK,GAAO,MAClB,kBAAC,GAAD;GACgB;GAEP;GACP,QAAO;GACP,SAAQ;EACT,GAJM,CAIN,CACF;CACE,CAAA;AAET"}
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { TabTagType, TabTagLabels } from './tabTags';
|
|
3
|
-
export type { TabTagType, TabTagLabels } from './tabTags';
|
|
4
|
-
export { TAG_CONFIG } from './tabTags';
|
|
5
2
|
export interface TabItem {
|
|
6
3
|
id: string;
|
|
7
4
|
label: string;
|
|
8
5
|
content: ReactNode;
|
|
9
6
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Optional extra trailing node rendered next to the tab label (e.g. a
|
|
21
|
-
* count badge). Distinct from `tag` (which uses a fixed preset). Use this
|
|
22
|
-
* when migrating segmented controls that rendered their own inline count
|
|
23
|
-
* pill alongside the label.
|
|
7
|
+
* Trailing node rendered next to the tab label: a count pill, a status
|
|
8
|
+
* badge, whatever the consumer's vocabulary calls for.
|
|
9
|
+
*
|
|
10
|
+
* This used to sit beside a `tag` prop that took one of four fixed names,
|
|
11
|
+
* required / recommended / beta / experimental, and rendered a Badge for
|
|
12
|
+
* it. Those are one product's guide vocabulary, and the arrangement had
|
|
13
|
+
* already split across the boundary: the badge variant lived here while the
|
|
14
|
+
* label text had to be passed in from the consumer's locale bundle. A
|
|
15
|
+
* consumer that wants that badge renders it here, and owns both halves.
|
|
24
16
|
*/
|
|
25
17
|
labelExtra?: ReactNode;
|
|
26
18
|
/**
|
|
@@ -98,10 +90,5 @@ export interface TabsProps {
|
|
|
98
90
|
scrollLeftLabel?: string;
|
|
99
91
|
/** Accessible label for the right scroll-arrow button. Default: "Scroll right" */
|
|
100
92
|
scrollRightLabel?: string;
|
|
101
|
-
/**
|
|
102
|
-
* English defaults for every guide-tag badge label (required / recommended
|
|
103
|
-
* / beta / experimental). Override individual entries to translate them.
|
|
104
|
-
*/
|
|
105
|
-
tagLabels?: TabTagLabels;
|
|
106
93
|
}
|
|
107
|
-
export declare function Tabs({ tabs, groups, defaultTab, activeTab: controlledTab, onTabChange, className, panelClassName, ariaLabel, showOverflowControls, showGroupLabels, overflowMode: explicitOverflowMode, variant, fillContainer, renderPanel, moreTabsLabel, selectTabLabel, scrollLeftLabel, scrollRightLabel,
|
|
94
|
+
export declare function Tabs({ tabs, groups, defaultTab, activeTab: controlledTab, onTabChange, className, panelClassName, ariaLabel, showOverflowControls, showGroupLabels, overflowMode: explicitOverflowMode, variant, fillContainer, renderPanel, moreTabsLabel, selectTabLabel, scrollLeftLabel, scrollRightLabel, }: TabsProps): import("react").JSX.Element;
|