@lablup/ui-common 0.1.0-alpha.5 → 0.1.0-alpha.7

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.
Files changed (36) hide show
  1. package/dist/assets/components/BaseCard/BaseCard.css +1 -1
  2. package/dist/assets/components/Button/Button.css +1 -1
  3. package/dist/assets/components/DataTable/DataTable.css +1 -1
  4. package/dist/assets/components/Drawer/Drawer.css +1 -1
  5. package/dist/assets/components/EmptyState/EmptyState.css +1 -1
  6. package/dist/assets/components/ErrorState/ErrorState.css +1 -1
  7. package/dist/assets/components/Tabs/Tabs.css +1 -1
  8. package/dist/assets/components/Tooltip/Tooltip.css +1 -1
  9. package/dist/components/DataTable/DataTable.d.ts +16 -5
  10. package/dist/components/DataTable/DataTable2.js +31 -64
  11. package/dist/components/DataTable/DataTable2.js.map +1 -1
  12. package/dist/components/EmptyState/EmptyState.d.ts +10 -3
  13. package/dist/components/EmptyState/EmptyState2.js +31 -48
  14. package/dist/components/EmptyState/EmptyState2.js.map +1 -1
  15. package/dist/components/EmptyState/index.d.ts +6 -12
  16. package/dist/components/EmptyState/index.js +2 -3
  17. package/dist/components/ErrorState/ErrorState.d.ts +17 -4
  18. package/dist/components/ErrorState/ErrorState2.js +20 -23
  19. package/dist/components/ErrorState/ErrorState2.js.map +1 -1
  20. package/dist/components/ErrorState/index.d.ts +1 -1
  21. package/dist/components/Tabs/Tabs.d.ts +10 -23
  22. package/dist/components/Tabs/Tabs2.js +127 -146
  23. package/dist/components/Tabs/Tabs2.js.map +1 -1
  24. package/dist/components/Tabs/index.d.ts +2 -2
  25. package/dist/components/Tabs/index.js +2 -3
  26. package/dist/index.js +18 -20
  27. package/dist/styles/base.css +30 -8
  28. package/dist/styles/themes/orange-dark.css +3 -0
  29. package/dist/styles/themes/orange-light.css +6 -1
  30. package/package.json +1 -1
  31. package/dist/components/EmptyState/illustrations.d.ts +0 -50
  32. package/dist/components/EmptyState/illustrations.js +0 -571
  33. package/dist/components/EmptyState/illustrations.js.map +0 -1
  34. package/dist/components/Tabs/tabTags.d.ts +0 -9
  35. package/dist/components/Tabs/tabTags.js +0 -11
  36. package/dist/components/Tabs/tabTags.js.map +0 -1
@@ -1,79 +1,62 @@
1
1
  import { Button as e } from "../Button/Button2.js";
2
- import { BenchmarkIllustration as t, ChatIllustration as n, CreationsIllustration as r, ErrorIllustration as i, GenericIllustration as a, LogsIllustration as o, ModelsIllustration as s, ScheduleIllustration as c, StatisticsIllustration as l, TextIllustration as u } from "./illustrations.js";
3
2
  /* empty css */
4
- import { memo as d, useCallback as f, useMemo as p } from "react";
5
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
3
+ import { memo as t, useCallback as n, useMemo as r } from "react";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
6
5
  //#region src/components/EmptyState/EmptyState.tsx
7
- var _ = {
8
- chat: n,
9
- models: s,
10
- creations: r,
11
- text: u,
12
- benchmark: t,
13
- logs: o,
14
- statistics: l,
15
- error: i,
16
- schedule: c,
17
- generic: a
18
- };
19
- function v({ illustration: t, title: n, description: r, primaryAction: i, secondaryAction: a, children: o, className: s = "", showIllustration: c = !0 }) {
20
- let l = i?.onClick, u = a?.onClick, d = f(() => {
21
- l?.();
22
- }, [l]), v = f(() => {
23
- u?.();
24
- }, [u]), y = p(() => _[t], [t]), b = p(() => [
25
- "empty-state",
26
- `empty-state--${t}`,
27
- s
28
- ].filter(Boolean).join(" "), [t, s]);
29
- return /* @__PURE__ */ g("div", {
30
- className: b,
6
+ function s({ illustration: t, title: s, description: c, primaryAction: l, secondaryAction: u, children: d, className: f = "", showIllustration: p = !0 }) {
7
+ let m = l?.onClick, h = u?.onClick, g = n(() => {
8
+ m?.();
9
+ }, [m]), _ = n(() => {
10
+ h?.();
11
+ }, [h]), v = r(() => ["empty-state", f].filter(Boolean).join(" "), [f]);
12
+ return /* @__PURE__ */ o("div", {
13
+ className: v,
31
14
  role: "status",
32
15
  "aria-live": "polite",
33
16
  children: [
34
- c && /* @__PURE__ */ h("div", {
17
+ p && t && /* @__PURE__ */ a("div", {
35
18
  className: "empty-state__illustration",
36
- children: /* @__PURE__ */ h(y, { className: "empty-state__icon" })
19
+ children: t
37
20
  }),
38
- /* @__PURE__ */ g("div", {
21
+ /* @__PURE__ */ o("div", {
39
22
  className: "empty-state__content",
40
23
  children: [
41
- /* @__PURE__ */ h("h3", {
24
+ /* @__PURE__ */ a("h3", {
42
25
  className: "empty-state__title",
43
- children: n
26
+ children: s
44
27
  }),
45
- /* @__PURE__ */ h("p", {
28
+ /* @__PURE__ */ a("p", {
46
29
  className: "empty-state__description",
47
- children: r
30
+ children: c
48
31
  }),
49
- o
32
+ d
50
33
  ]
51
34
  }),
52
- (i || a) && /* @__PURE__ */ g("div", {
35
+ (l || u) && /* @__PURE__ */ o("div", {
53
36
  className: "empty-state__actions",
54
- children: [i && /* @__PURE__ */ h(e, {
37
+ children: [l && /* @__PURE__ */ a(e, {
55
38
  variant: "primary",
56
- onClick: d,
39
+ onClick: g,
57
40
  className: "empty-state__action-btn empty-state__action-btn--primary",
58
- children: i.label
59
- }), a && /* @__PURE__ */ h(m, { children: a.href ? /* @__PURE__ */ h("a", {
60
- href: a.href,
41
+ children: l.label
42
+ }), u && /* @__PURE__ */ a(i, { children: u.href ? /* @__PURE__ */ a("a", {
43
+ href: u.href,
61
44
  className: "empty-state__action-link",
62
- onClick: v,
63
- children: a.label
64
- }) : /* @__PURE__ */ h(e, {
45
+ onClick: _,
46
+ children: u.label
47
+ }) : /* @__PURE__ */ a(e, {
65
48
  variant: "ghost",
66
- onClick: v,
49
+ onClick: _,
67
50
  className: "empty-state__action-btn empty-state__action-btn--secondary",
68
- children: a.label
51
+ children: u.label
69
52
  }) })]
70
53
  })
71
54
  ]
72
55
  });
73
56
  }
74
- var y = d(v);
57
+ var c = t(s);
75
58
  //#endregion
76
- export { y as EmptyState };
59
+ export { c as EmptyState };
77
60
 
78
61
  //# sourceMappingURL=EmptyState2.js.map
79
62
  import "../../assets/components/EmptyState/EmptyState.css";
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState2.js","names":[],"sources":["../../../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["/**\n * EmptyState Component\n *\n * Unified empty state component with consistent layout and styling.\n * Provides configurable illustration, title, description, and call-to-action buttons.\n *\n * Features:\n * - Multiple illustration types for different contexts\n * - Primary and secondary action buttons, plus a `children` slot for an\n * onboarding state that needs more than two (issue #3903)\n * - Accessible (ARIA attributes, semantic HTML)\n * - Dark/light theme support via design tokens\n * - Fade-in animation with reduced motion support\n * - Responsive design\n * - Memoized for optimal performance\n */\n\nimport { memo, useCallback, useMemo, type ReactNode } from \"react\";\nimport { Button } from \"../Button\";\nimport {\n ChatIllustration,\n ModelsIllustration,\n CreationsIllustration,\n TextIllustration,\n BenchmarkIllustration,\n LogsIllustration,\n StatisticsIllustration,\n ErrorIllustration,\n ScheduleIllustration,\n GenericIllustration,\n} from \"./illustrations\";\nimport \"./EmptyState.css\";\n\nexport type IllustrationType =\n | \"chat\"\n | \"models\"\n | \"creations\"\n | \"text\"\n | \"benchmark\"\n | \"logs\"\n | \"statistics\"\n | \"error\"\n | \"schedule\"\n | \"generic\";\n\nexport interface EmptyStateAction {\n label: string;\n onClick: () => void;\n}\n\nexport interface EmptyStateSecondaryAction {\n label: string;\n href?: string;\n onClick?: () => void;\n}\n\nexport interface EmptyStateProps {\n /** Type of illustration to display */\n illustration: IllustrationType;\n /** Main heading */\n title: string;\n /** Descriptive text */\n description: string;\n /** Primary action button */\n primaryAction?: EmptyStateAction;\n /** Secondary action (link or button) */\n secondaryAction?: EmptyStateSecondaryAction;\n /**\n * Extra content rendered under the description, inside the same text column.\n *\n * The two action props cover the common one-or-two-button case. An\n * onboarding state that has to offer more than that (e.g. the Data Hub's\n * three ingest paths, issue #3903) renders them here instead of growing a\n * page-local copy of this component.\n */\n children?: ReactNode;\n /** Additional CSS classes */\n className?: string;\n /** Whether to show illustration (default: true) */\n showIllustration?: boolean;\n}\n\n/**\n * Static map of illustration types to components.\n * Defined outside component to avoid recreation on each render.\n */\nconst illustrationMap: Record<\n IllustrationType,\n React.ComponentType<{ className?: string }>\n> = {\n chat: ChatIllustration,\n models: ModelsIllustration,\n creations: CreationsIllustration,\n text: TextIllustration,\n benchmark: BenchmarkIllustration,\n logs: LogsIllustration,\n statistics: StatisticsIllustration,\n error: ErrorIllustration,\n schedule: ScheduleIllustration,\n generic: GenericIllustration,\n};\n\n/**\n * EmptyState Component\n *\n * Displays an empty state with illustration, text, and optional actions.\n * Memoized to prevent unnecessary re-renders.\n */\nfunction EmptyStateComponent({\n illustration,\n title,\n description,\n primaryAction,\n secondaryAction,\n children,\n className = \"\",\n showIllustration = true,\n}: EmptyStateProps) {\n // Use stable callback references by extracting onClick functions\n const primaryOnClick = primaryAction?.onClick;\n const secondaryOnClick = secondaryAction?.onClick;\n\n const handlePrimaryAction = useCallback(() => {\n primaryOnClick?.();\n }, [primaryOnClick]);\n\n const handleSecondaryAction = useCallback(() => {\n secondaryOnClick?.();\n }, [secondaryOnClick]);\n\n // Memoize illustration component lookup\n const Illustration = useMemo(() => illustrationMap[illustration], [illustration]);\n\n // Memoize class name computation\n const containerClass = useMemo(\n () =>\n [\"empty-state\", `empty-state--${illustration}`, className]\n .filter(Boolean)\n .join(\" \"),\n [illustration, className],\n );\n\n return (\n <div className={containerClass} role=\"status\" aria-live=\"polite\">\n {showIllustration && (\n <div className=\"empty-state__illustration\">\n <Illustration className=\"empty-state__icon\" />\n </div>\n )}\n\n <div className=\"empty-state__content\">\n <h3 className=\"empty-state__title\">{title}</h3>\n <p className=\"empty-state__description\">{description}</p>\n {children}\n </div>\n\n {(primaryAction || secondaryAction) && (\n <div className=\"empty-state__actions\">\n {primaryAction && (\n <Button\n variant=\"primary\"\n onClick={handlePrimaryAction}\n className=\"empty-state__action-btn empty-state__action-btn--primary\"\n >\n {primaryAction.label}\n </Button>\n )}\n\n {secondaryAction && (\n <>\n {secondaryAction.href ? (\n <a\n href={secondaryAction.href}\n className=\"empty-state__action-link\"\n onClick={handleSecondaryAction}\n >\n {secondaryAction.label}\n </a>\n ) : (\n <Button\n variant=\"ghost\"\n onClick={handleSecondaryAction}\n className=\"empty-state__action-btn empty-state__action-btn--secondary\"\n >\n {secondaryAction.label}\n </Button>\n )}\n </>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport const EmptyState = memo(EmptyStateComponent);\n"],"mappings":";;;;;;AAsFA,IAAM,IAGF;CACF,MAAM;CACN,QAAQ;CACR,WAAW;CACX,MAAM;CACN,WAAW;CACX,MAAM;CACN,YAAY;CACZ,OAAO;CACP,UAAU;CACV,SAAS;AACX;AAQA,SAAS,EAAoB,EAC3B,iBACA,UACA,gBACA,kBACA,oBACA,aACA,eAAY,IACZ,sBAAmB,MACD;CAElB,IAAM,IAAiB,GAAe,SAChC,IAAmB,GAAiB,SAEpC,IAAsB,QAAkB;EAC5C,IAAiB;CACnB,GAAG,CAAC,CAAc,CAAC,GAEb,IAAwB,QAAkB;EAC9C,IAAmB;CACrB,GAAG,CAAC,CAAgB,CAAC,GAGf,IAAe,QAAc,EAAgB,IAAe,CAAC,CAAY,CAAC,GAG1E,IAAiB,QAEnB;EAAC;EAAe,gBAAgB;EAAgB;CAAS,CAAC,CACvD,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,GACb,CAAC,GAAc,CAAS,CAC1B;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW;EAAgB,MAAK;EAAS,aAAU;EAAxD,UAAA;GACG,KACC,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAAC,GAAD,EAAc,WAAU,oBAAqB,CAAA;GAC1C,CAAA;GAGP,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,MAAD;MAAI,WAAU;MAAsB,UAAA;KAAU,CAAA;KAC9C,kBAAC,KAAD;MAAG,WAAU;MAA4B,UAAA;KAAe,CAAA;KACvD;IACE;;IAEH,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,kBAAA,GAAA,EAAA,UACG,EAAgB,OACf,kBAAC,KAAD;KACE,MAAM,EAAgB;KACtB,WAAU;KACV,SAAS;KAER,UAAA,EAAgB;IAChB,CAAA,IAEH,kBAAC,GAAD;KACE,SAAQ;KACR,SAAS;KACT,WAAU;KAET,UAAA,EAAgB;IACX,CAAA,EAEV,CAAA,CAED;;EAEJ;;AAET;AAEA,IAAa,IAAa,EAAK,CAAmB"}
1
+ {"version":3,"file":"EmptyState2.js","names":[],"sources":["../../../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["/**\n * EmptyState Component\n *\n * Unified empty state component with consistent layout and styling.\n * Provides configurable illustration, title, description, and call-to-action buttons.\n *\n * Features:\n * - Multiple illustration types for different contexts\n * - Primary and secondary action buttons, plus a `children` slot for an\n * onboarding state that needs more than two (issue #3903)\n * - Accessible (ARIA attributes, semantic HTML)\n * - Dark/light theme support via design tokens\n * - Fade-in animation with reduced motion support\n * - Responsive design\n * - Memoized for optimal performance\n */\n\nimport { memo, useCallback, useMemo, type ReactNode } from \"react\";\nimport { Button } from \"../Button\";\nimport \"./EmptyState.css\";\n\nexport interface EmptyStateAction {\n label: string;\n onClick: () => void;\n}\n\nexport interface EmptyStateSecondaryAction {\n label: string;\n href?: string;\n onClick?: () => void;\n}\n\nexport interface EmptyStateProps {\n /**\n * The drawing shown above the text.\n *\n * This used to be one of ten names: chat, models, creations, benchmark,\n * logs, statistics, schedule and so on, each resolving to an SVG shipped\n * inside this package. Those names are one product's information\n * architecture, and no other consumer has a \"creations\" screen to draw for.\n * A consumer passes its own artwork and keeps its own vocabulary.\n */\n illustration?: ReactNode;\n /** Main heading */\n title: string;\n /** Descriptive text */\n description: string;\n /** Primary action button */\n primaryAction?: EmptyStateAction;\n /** Secondary action (link or button) */\n secondaryAction?: EmptyStateSecondaryAction;\n /**\n * Extra content rendered under the description, inside the same text column.\n *\n * The two action props cover the common one-or-two-button case. An\n * onboarding state that has to offer more than that (e.g. the Data Hub's\n * three ingest paths, issue #3903) renders them here instead of growing a\n * page-local copy of this component.\n */\n children?: ReactNode;\n /** Additional CSS classes */\n className?: string;\n /** Whether to show illustration (default: true) */\n showIllustration?: boolean;\n}\n\n/**\n * EmptyState Component\n *\n * Displays an empty state with illustration, text, and optional actions.\n * Memoized to prevent unnecessary re-renders.\n */\nfunction EmptyStateComponent({\n illustration,\n title,\n description,\n primaryAction,\n secondaryAction,\n children,\n className = \"\",\n showIllustration = true,\n}: EmptyStateProps) {\n // Use stable callback references by extracting onClick functions\n const primaryOnClick = primaryAction?.onClick;\n const secondaryOnClick = secondaryAction?.onClick;\n\n const handlePrimaryAction = useCallback(() => {\n primaryOnClick?.();\n }, [primaryOnClick]);\n\n const handleSecondaryAction = useCallback(() => {\n secondaryOnClick?.();\n }, [secondaryOnClick]);\n\n // Memoize class name computation\n const containerClass = useMemo(\n () => [\"empty-state\", className].filter(Boolean).join(\" \"),\n [className],\n );\n\n return (\n <div className={containerClass} role=\"status\" aria-live=\"polite\">\n {showIllustration && illustration && (\n <div className=\"empty-state__illustration\">{illustration}</div>\n )}\n\n <div className=\"empty-state__content\">\n <h3 className=\"empty-state__title\">{title}</h3>\n <p className=\"empty-state__description\">{description}</p>\n {children}\n </div>\n\n {(primaryAction || secondaryAction) && (\n <div className=\"empty-state__actions\">\n {primaryAction && (\n <Button\n variant=\"primary\"\n onClick={handlePrimaryAction}\n className=\"empty-state__action-btn empty-state__action-btn--primary\"\n >\n {primaryAction.label}\n </Button>\n )}\n\n {secondaryAction && (\n <>\n {secondaryAction.href ? (\n <a\n href={secondaryAction.href}\n className=\"empty-state__action-link\"\n onClick={handleSecondaryAction}\n >\n {secondaryAction.label}\n </a>\n ) : (\n <Button\n variant=\"ghost\"\n onClick={handleSecondaryAction}\n className=\"empty-state__action-btn empty-state__action-btn--secondary\"\n >\n {secondaryAction.label}\n </Button>\n )}\n </>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport const EmptyState = memo(EmptyStateComponent);\n"],"mappings":";;;;;AAwEA,SAAS,EAAoB,EAC3B,iBACA,UACA,gBACA,kBACA,oBACA,aACA,eAAY,IACZ,sBAAmB,MACD;CAElB,IAAM,IAAiB,GAAe,SAChC,IAAmB,GAAiB,SAEpC,IAAsB,QAAkB;EAC5C,IAAiB;CACnB,GAAG,CAAC,CAAc,CAAC,GAEb,IAAwB,QAAkB;EAC9C,IAAmB;CACrB,GAAG,CAAC,CAAgB,CAAC,GAGf,IAAiB,QACf,CAAC,eAAe,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,GACzD,CAAC,CAAS,CACZ;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW;EAAgB,MAAK;EAAS,aAAU;EAAxD,UAAA;GACG,KAAoB,KACnB,kBAAC,OAAD;IAAK,WAAU;IAA6B,UAAA;GAAkB,CAAA;GAGhE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,MAAD;MAAI,WAAU;MAAsB,UAAA;KAAU,CAAA;KAC9C,kBAAC,KAAD;MAAG,WAAU;MAA4B,UAAA;KAAe,CAAA;KACvD;IACE;;IAEH,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,kBAAA,GAAA,EAAA,UACG,EAAgB,OACf,kBAAC,KAAD;KACE,MAAM,EAAgB;KACtB,WAAU;KACV,SAAS;KAER,UAAA,EAAgB;IAChB,CAAA,IAEH,kBAAC,GAAD;KACE,SAAQ;KACR,SAAS;KACT,WAAU;KAET,UAAA,EAAgB;IACX,CAAA,EAEV,CAAA,CAED;;EAEJ;;AAET;AAEA,IAAa,IAAa,EAAK,CAAmB"}
@@ -1,16 +1,10 @@
1
1
  /**
2
2
  * EmptyState Component - Barrel Export
3
- */
4
- export { EmptyState } from './EmptyState';
5
- export type { EmptyStateProps, EmptyStateAction, EmptyStateSecondaryAction, IllustrationType, } from './EmptyState';
6
- /**
7
- * The illustrations are also exported on their own.
8
3
  *
9
- * They shipped inside the package from the first release but no barrel named
10
- * them, so a consumer that composes its own empty state, which is the case
11
- * `EmptyState` cannot cover, had no way to reach one. Same shape as the
12
- * stylesheets in 0.1.0-alpha.1: present in the tarball, addressable by
13
- * nothing.
4
+ * The ten illustrations that used to ship here were one product's information
5
+ * architecture: chat, models, creations, benchmark, logs, statistics,
6
+ * schedule. No other consumer has a "creations" screen to draw for. A consumer
7
+ * passes its own artwork through `illustration` and keeps its own vocabulary.
14
8
  */
15
- export { ChatIllustration, ModelsIllustration, CreationsIllustration, BenchmarkIllustration, LogsIllustration, StatisticsIllustration, ErrorIllustration, TextIllustration, ScheduleIllustration, GenericIllustration, } from './illustrations';
16
- export type { IllustrationProps } from './illustrations';
9
+ export { EmptyState } from './EmptyState';
10
+ export type { EmptyStateProps, EmptyStateAction, EmptyStateSecondaryAction, } from './EmptyState';
@@ -1,3 +1,2 @@
1
- import { BenchmarkIllustration as e, ChatIllustration as t, CreationsIllustration as n, ErrorIllustration as r, GenericIllustration as i, LogsIllustration as a, ModelsIllustration as o, ScheduleIllustration as s, StatisticsIllustration as c, TextIllustration as l } from "./illustrations.js";
2
- import { EmptyState as u } from "./EmptyState2.js";
3
- export { e as BenchmarkIllustration, t as ChatIllustration, n as CreationsIllustration, u as EmptyState, r as ErrorIllustration, i as GenericIllustration, a as LogsIllustration, o as ModelsIllustration, s as ScheduleIllustration, c as StatisticsIllustration, l as TextIllustration };
1
+ import { EmptyState as e } from "./EmptyState2.js";
2
+ export { e as EmptyState };
@@ -1,11 +1,24 @@
1
- export type ErrorType = "network" | "configuration" | "model" | "permission" | "generic";
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * How the error reads, not what it is about.
4
+ *
5
+ * This prop used to be a union of five names: network, configuration, model,
6
+ * permission, generic. Two of those, and "model" in particular, are one
7
+ * product's categories rather than anything a shared component can reason
8
+ * about, and all five resolved to three colours anyway: network and permission
9
+ * were the same amber, model and generic the same red. A consumer decides
10
+ * which of its own error categories reads as which tone.
11
+ */
12
+ export type ErrorTone = "danger" | "warning" | "accent";
2
13
  export interface ErrorAction {
3
14
  label: string;
4
15
  onClick: () => void;
5
16
  }
6
17
  export interface ErrorStateProps {
7
- /** Error type determines icon and default styling */
8
- type?: ErrorType;
18
+ /** How the error reads. Defaults to `danger`. */
19
+ tone?: ErrorTone;
20
+ /** Replaces the default alert icon. */
21
+ icon?: ReactNode;
9
22
  /** Error title - main heading */
10
23
  title: string;
11
24
  /** Detailed error message */
@@ -22,4 +35,4 @@ export interface ErrorStateProps {
22
35
  /**
23
36
  * ErrorState Component
24
37
  */
25
- export declare function ErrorState({ type, title, message, primaryAction, secondaryAction, className, showIcon, }: ErrorStateProps): import("react").JSX.Element;
38
+ export declare function ErrorState({ tone, icon, title, message, primaryAction, secondaryAction, className, showIcon, }: ErrorStateProps): import("react").JSX.Element;
@@ -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(e) {
8
- return /* @__PURE__ */ r(t, { size: 48 });
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--${t}`,
18
- u
14
+ `error-state--${a}`,
15
+ d
19
16
  ].filter(Boolean).join(" ");
20
17
  return /* @__PURE__ */ i("div", {
21
- className: m,
18
+ className: h,
22
19
  role: "alert",
23
20
  "aria-live": "polite",
24
21
  children: [
25
- d && /* @__PURE__ */ r("div", {
22
+ f && /* @__PURE__ */ r("div", {
26
23
  className: "error-state__icon",
27
24
  "aria-hidden": "true",
28
- children: a(t)
25
+ children: o ?? /* @__PURE__ */ r(t, { size: 48 })
29
26
  }),
30
27
  /* @__PURE__ */ r("h2", {
31
28
  className: "error-state__title",
32
- children: o
29
+ children: s
33
30
  }),
34
31
  /* @__PURE__ */ r("p", {
35
32
  className: "error-state__message",
36
- children: s
33
+ children: c
37
34
  }),
38
- (c || l) && /* @__PURE__ */ i("div", {
35
+ (l || u) && /* @__PURE__ */ i("div", {
39
36
  className: "error-state__actions",
40
- children: [c && /* @__PURE__ */ r(e, {
37
+ children: [l && /* @__PURE__ */ r(e, {
41
38
  variant: "primary",
42
- onClick: f,
39
+ onClick: p,
43
40
  className: "error-state__action-btn error-state__action-btn--primary",
44
- children: c.label
45
- }), l && /* @__PURE__ */ r(e, {
41
+ children: l.label
42
+ }), u && /* @__PURE__ */ r(e, {
46
43
  variant: "secondary",
47
- onClick: p,
44
+ onClick: m,
48
45
  className: "error-state__action-btn error-state__action-btn--secondary",
49
- children: l.label
46
+ children: u.label
50
47
  })]
51
48
  })
52
49
  ]
53
50
  });
54
51
  }
55
52
  //#endregion
56
- export { o as ErrorState };
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 * - Error type variants (network, configuration, model, permission, generic)\n * - Primary and secondary action buttons\n * - Accessible (ARIA attributes, focus management)\n * - Dark/light theme support\n */\n\nimport { useCallback } from \"react\";\nimport { AlertCircleIcon } from \"../../icons/AlertCircleIcon\";\nimport { Button } from \"../Button\";\nimport \"./ErrorState.css\";\n\nexport type ErrorType =\n \"network\" | \"configuration\" | \"model\" | \"permission\" | \"generic\";\n\nexport interface ErrorAction {\n label: string;\n onClick: () => void;\n}\n\nexport interface ErrorStateProps {\n /** Error type determines icon and default styling */\n type?: ErrorType;\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 * Get icon for error type\n */\nfunction getErrorIcon(_type: ErrorType): React.ReactNode {\n // All error types use the same AlertCircleIcon for now\n // Can be extended with different icons per type in the future\n return <AlertCircleIcon size={48} />;\n}\n\n/**\n * ErrorState Component\n */\nexport function ErrorState({\n type = \"generic\",\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--${type}`, 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 {getErrorIcon(type)}\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":";;;;;;AA8CA,SAAS,EAAa,GAAmC;CAGvD,OAAO,kBAAC,GAAD,EAAiB,MAAM,GAAK,CAAA;AACrC;AAKA,SAAgB,EAAW,EACzB,UAAO,WACP,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,EAAa,CAAI;GACf,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
+ {"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"}
@@ -2,4 +2,4 @@
2
2
  * ErrorState Component Export
3
3
  */
4
4
  export { ErrorState } from './ErrorState';
5
- export type { ErrorStateProps, ErrorType, ErrorAction } from './ErrorState';
5
+ export type { ErrorStateProps, ErrorTone, ErrorAction } from './ErrorState';
@@ -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
- * Show a "Required" badge next to the tab label.
11
- * @deprecated Use `tag="required"` instead. Kept for backward compatibility.
12
- */
13
- required?: boolean;
14
- /**
15
- * Guide tag displayed after the tab label as a small badge.
16
- * When set, takes precedence over the `required` boolean.
17
- */
18
- tag?: TabTagType;
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, tagLabels, }: TabsProps): import("react").JSX.Element;
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;