@lablup/ui-common 0.1.0-alpha.4 → 0.1.0-alpha.6
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/assets/components/ErrorState/ErrorState.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/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 -12
- package/dist/components/EmptyState/index.js +2 -3
- 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/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.js +18 -20
- package/package.json +1 -1
- package/dist/components/EmptyState/illustrations.d.ts +0 -50
- 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
|
@@ -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"}
|
|
@@ -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;
|