@godxjp/ui 13.17.3 → 14.0.0

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 (63) hide show
  1. package/dist/components/charts/area-chart.d.ts +8 -0
  2. package/dist/components/charts/area-chart.js +8 -0
  3. package/dist/components/charts/bar-chart.d.ts +8 -0
  4. package/dist/components/charts/bar-chart.js +8 -0
  5. package/dist/components/charts/chart-cartesian.d.ts +31 -0
  6. package/dist/components/charts/chart-cartesian.js +178 -0
  7. package/dist/components/charts/chart-frame.d.ts +44 -0
  8. package/dist/components/charts/chart-frame.js +72 -0
  9. package/dist/components/charts/chart-summary.d.ts +21 -0
  10. package/dist/components/charts/chart-summary.js +23 -0
  11. package/dist/components/charts/index.d.ts +16 -0
  12. package/dist/components/charts/index.js +12 -0
  13. package/dist/components/charts/line-chart.d.ts +8 -0
  14. package/dist/components/charts/line-chart.js +8 -0
  15. package/dist/components/charts/pie-chart.d.ts +8 -0
  16. package/dist/components/charts/pie-chart.js +73 -0
  17. package/dist/components/data-display/card.d.ts +2 -1
  18. package/dist/components/data-display/index.d.ts +2 -0
  19. package/dist/components/data-display/index.js +2 -0
  20. package/dist/components/data-display/list-row.d.ts +24 -0
  21. package/dist/components/data-display/list-row.js +31 -0
  22. package/dist/components/data-entry/command.d.ts +10 -10
  23. package/dist/components/data-entry/transfer.js +1 -1
  24. package/dist/components/general/button.d.ts +1 -0
  25. package/dist/components/general/button.js +3 -0
  26. package/dist/components/general/index.d.ts +2 -0
  27. package/dist/components/general/index.js +4 -1
  28. package/dist/components/general/logo.d.ts +28 -0
  29. package/dist/components/general/logo.js +45 -0
  30. package/dist/components/layout/index.d.ts +1 -1
  31. package/dist/components/layout/sidebar.js +32 -24
  32. package/dist/components/layout/topbar.d.ts +19 -2
  33. package/dist/components/layout/topbar.js +7 -128
  34. package/dist/i18n/messages/en.json +5 -0
  35. package/dist/i18n/messages/ja.json +5 -0
  36. package/dist/i18n/messages/vi.json +5 -0
  37. package/dist/props/components/charts.prop.d.ts +89 -0
  38. package/dist/props/components/charts.prop.js +0 -0
  39. package/dist/props/components/general.prop.d.ts +5 -0
  40. package/dist/props/components/index.d.ts +2 -1
  41. package/dist/props/components/layout.prop.d.ts +16 -33
  42. package/dist/props/registry.d.ts +170 -11
  43. package/dist/props/registry.js +112 -11
  44. package/dist/styles/card-layout.css +5 -3
  45. package/dist/styles/chart-layout.css +37 -0
  46. package/dist/styles/data-display-layout.css +38 -0
  47. package/dist/styles/index.css +1 -0
  48. package/dist/styles/shell-layout.css +39 -0
  49. package/dist/styles/text-layout.css +3 -0
  50. package/dist/tokens/base.css +2 -0
  51. package/dist/tokens/components/card.css +5 -0
  52. package/dist/tokens/components/list-row.css +9 -0
  53. package/dist/tokens/components/logo.css +11 -0
  54. package/dist/tokens/foundation.css +13 -0
  55. package/package.json +42 -7
  56. package/scripts/_agent-setup.mjs +145 -0
  57. package/scripts/audit-hook.mjs +66 -0
  58. package/scripts/cli.mjs +26 -0
  59. package/scripts/init-agent-kit.mjs +52 -0
  60. package/scripts/postinstall.mjs +31 -0
  61. package/scripts/ui-audit.mjs +165 -3
  62. package/scripts/visual-audit-rules.mjs +119 -0
  63. package/scripts/visual-audit.mjs +261 -0
@@ -1,11 +1,11 @@
1
1
  import * as React from "react";
2
2
  export declare const Command: React.ForwardRefExoticComponent<Omit<{
3
3
  children?: React.ReactNode;
4
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
4
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
5
5
  ref?: React.Ref<HTMLDivElement>;
6
6
  } & {
7
7
  asChild?: boolean;
8
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
8
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
9
9
  label?: string;
10
10
  shouldFilter?: boolean;
11
11
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -26,38 +26,38 @@ export declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pic
26
26
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
27
27
  export declare const CommandList: React.ForwardRefExoticComponent<Omit<{
28
28
  children?: React.ReactNode;
29
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
29
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
30
30
  ref?: React.Ref<HTMLDivElement>;
31
31
  } & {
32
32
  asChild?: boolean;
33
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
33
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
34
34
  label?: string;
35
35
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
36
  export declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
37
37
  children?: React.ReactNode;
38
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
38
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
39
39
  ref?: React.Ref<HTMLDivElement>;
40
40
  } & {
41
41
  asChild?: boolean;
42
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
42
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
43
43
  export declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
44
44
  children?: React.ReactNode;
45
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
45
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
46
46
  ref?: React.Ref<HTMLDivElement>;
47
47
  } & {
48
48
  asChild?: boolean;
49
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "heading" | "value"> & {
49
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "heading" | "value"> & {
50
50
  heading?: React.ReactNode;
51
51
  value?: string;
52
52
  forceMount?: boolean;
53
53
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
54
54
  export declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
55
55
  children?: React.ReactNode;
56
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
56
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
57
57
  ref?: React.Ref<HTMLDivElement>;
58
58
  } & {
59
59
  asChild?: boolean;
60
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
60
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "onSelect" | "disabled" | "value"> & {
61
61
  disabled?: boolean;
62
62
  onSelect?: (value: string) => void;
63
63
  value?: string;
@@ -68,7 +68,7 @@ function TransferPanel({
68
68
  className: disabled ? "pointer-events-none opacity-50" : void 0
69
69
  }
70
70
  ) }),
71
- /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx("ul", { className: "p-1", role: "group", "aria-labelledby": titleId, children: filtered.length === 0 ? /* @__PURE__ */ jsx("li", { className: "text-muted-foreground py-8 text-center text-sm", children: emptyText }) : filtered.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
71
+ /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx("ul", { className: "p-1", "aria-labelledby": titleId, children: filtered.length === 0 ? /* @__PURE__ */ jsx("li", { className: "text-muted-foreground py-8 text-center text-sm", children: emptyText }) : filtered.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
72
72
  "label",
73
73
  {
74
74
  className: cn(
@@ -9,6 +9,7 @@ export declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAtt
9
9
  variant?: import("../../props").ButtonVariantProp;
10
10
  size?: import("../../props").ButtonSizeProp;
11
11
  shape?: import("../../props").ShapeProp;
12
+ fullWidth?: boolean;
12
13
  asChild?: import("../../props").AsChildProp;
13
14
  onClick?: import("../../props").OnClickProp;
14
15
  disabled?: import("../../props").DisabledProp;
@@ -52,6 +52,7 @@ const Button = React.forwardRef(
52
52
  variant,
53
53
  size,
54
54
  shape,
55
+ fullWidth = false,
55
56
  asChild = false,
56
57
  loading = false,
57
58
  loadingText,
@@ -89,11 +90,13 @@ const Button = React.forwardRef(
89
90
  "data-variant": variant ?? "default",
90
91
  "data-size": size ?? "default",
91
92
  "data-shape": shape ?? "default",
93
+ "data-full-width": fullWidth ? "" : void 0,
92
94
  "data-loading": isLoading ? "" : void 0,
93
95
  "aria-busy": isLoading || void 0,
94
96
  disabled: isLoading || disabled,
95
97
  className: cn(
96
98
  "inline-flex shrink-0 items-center justify-center gap-2 text-sm font-medium whitespace-nowrap transition-all outline-none",
99
+ fullWidth && "w-full",
97
100
  "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
98
101
  "disabled:pointer-events-none disabled:opacity-50",
99
102
  "data-[loading]:pointer-events-none",
@@ -2,3 +2,5 @@ export { Button, buttonVariants } from "./button";
2
2
  export type { ButtonProps } from "./button";
3
3
  export { Text, Heading } from "./typography";
4
4
  export type { TextProps, HeadingProps, TextProp, HeadingProp } from "./typography";
5
+ export { Logo, logoVariants } from "./logo";
6
+ export type { LogoProps } from "./logo";
@@ -1,8 +1,11 @@
1
1
  import { Button, buttonVariants } from "./button";
2
2
  import { Text, Heading } from "./typography";
3
+ import { Logo, logoVariants } from "./logo";
3
4
  export {
4
5
  Button,
5
6
  Heading,
7
+ Logo,
6
8
  Text,
7
- buttonVariants
9
+ buttonVariants,
10
+ logoVariants
8
11
  };
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import type { ShapeProp } from "../../props/vocabulary";
3
+ declare const logoVariants: (props?: ({
4
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
5
+ shape?: "default" | "pill" | "sharp" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export interface LogoProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
8
+ /**
9
+ * Accessible product name. When set, the mark exposes `role="img"` + `aria-label` (use this when
10
+ * the Logo IS the accessible name — e.g. a home link). When omitted the mark is `aria-hidden`
11
+ * (decorative — assume an adjacent wordmark provides the name).
12
+ */
13
+ label?: string;
14
+ /** Box size — maps to the square size scale. Default `md`. */
15
+ size?: "xs" | "sm" | "md" | "lg";
16
+ /** Corner shape — `default` (--logo-radius) · `pill` (fully rounded) · `sharp` (square). */
17
+ shape?: ShapeProp;
18
+ /** The mark — a short lettermark string (default `"G"`) or a custom SVG/image node. */
19
+ glyph?: React.ReactNode;
20
+ }
21
+ /**
22
+ * Logo — the product brand-mark primitive. Use it INSTEAD of a hand-rolled
23
+ * `<span className="flex size-[2rem] rounded-md bg-primary font-bold …">g</span>` (typography-on-span,
24
+ * literal size/radius — cardinal rules #42/#46). Renders the lettermark (or a custom SVG) in a
25
+ * tokenized box that a service rethemes via `--primary` (fill) and `--logo-radius` (corner).
26
+ */
27
+ export declare const Logo: React.ForwardRefExoticComponent<LogoProps & React.RefAttributes<HTMLSpanElement>>;
28
+ export { logoVariants };
@@ -0,0 +1,45 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../../lib/utils";
5
+ const logoVariants = cva(
6
+ "inline-flex shrink-0 select-none items-center justify-center bg-primary font-bold leading-none text-primary-foreground [&_svg]:size-[60%]",
7
+ {
8
+ variants: {
9
+ size: {
10
+ xs: "size-[var(--logo-size-xs)] text-xs",
11
+ sm: "size-[var(--logo-size-sm)] text-sm",
12
+ md: "size-[var(--logo-size)] text-base",
13
+ lg: "size-[var(--logo-size-lg)] text-lg"
14
+ },
15
+ shape: {
16
+ default: "rounded-[var(--logo-radius)]",
17
+ pill: "rounded-[var(--radius-pill)]",
18
+ sharp: "rounded-[var(--radius-sharp)]"
19
+ }
20
+ },
21
+ defaultVariants: { size: "md", shape: "default" }
22
+ }
23
+ );
24
+ const Logo = React.forwardRef(
25
+ ({ glyph = "G", label, size, shape, className, ...props }, ref) => /* @__PURE__ */ jsx(
26
+ "span",
27
+ {
28
+ ref,
29
+ "data-slot": "logo",
30
+ "data-size": size ?? "md",
31
+ "data-shape": shape ?? "default",
32
+ role: label ? "img" : void 0,
33
+ "aria-label": label,
34
+ "aria-hidden": label ? void 0 : true,
35
+ className: cn(logoVariants({ size, shape }), className),
36
+ ...props,
37
+ children: glyph
38
+ }
39
+ )
40
+ );
41
+ Logo.displayName = "Logo";
42
+ export {
43
+ Logo,
44
+ logoVariants
45
+ };
@@ -10,7 +10,7 @@ export type { BreadcrumbProps } from "./breadcrumb";
10
10
  export { Sidebar, SidebarHeader, SidebarItem, SidebarSection } from "./sidebar";
11
11
  export type { SidebarItemData, SidebarProductProp as SidebarProduct, SidebarProp, SidebarProp as SidebarProps, SidebarSectionProp, } from "../../props/components/layout.prop";
12
12
  export { Topbar } from "./topbar";
13
- export type { TopbarProduct, TopbarProject, TopbarProps } from "./topbar";
13
+ export type { TopbarProp, TopbarProps } from "./topbar";
14
14
  export { ResponsiveGrid } from "./responsive-grid";
15
15
  export type { ResponsiveGridProps } from "./responsive-grid";
16
16
  export { SplitPane } from "./split-pane";
@@ -190,30 +190,38 @@ function Sidebar({
190
190
  const { t } = useTranslation();
191
191
  const resolvedSections = sections ?? [];
192
192
  return /* @__PURE__ */ jsxs("div", { className: "sb-root", "data-collapsed": collapsed ? "true" : void 0, children: [
193
- brand !== void 0 ? /* @__PURE__ */ jsx(SidebarHeader, { children: brand }) : product ? /* @__PURE__ */ jsxs(
194
- "button",
195
- {
196
- type: "button",
197
- className: "sb-product",
198
- onClick: onProductClick,
199
- "aria-label": product.name,
200
- children: [
201
- /* @__PURE__ */ jsx(
202
- "span",
203
- {
204
- className: "sb-logo-mark",
205
- style: { background: product.color ?? "hsl(var(--attention))" },
206
- children: product.name[0]?.toUpperCase() ?? "?"
207
- }
208
- ),
209
- !collapsed ? /* @__PURE__ */ jsxs("span", { className: "sb-product-meta", children: [
210
- /* @__PURE__ */ jsx("span", { className: "sb-product-name", children: product.name }),
211
- product.role ? /* @__PURE__ */ jsx("span", { className: "sb-product-tenant", children: product.role }) : null
212
- ] }) : null,
213
- !collapsed ? /* @__PURE__ */ jsx("span", { className: "sb-product-caret", children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true" }) }) : null
214
- ]
215
- }
216
- ) : null,
193
+ brand !== void 0 ? /* @__PURE__ */ jsx(SidebarHeader, { children: brand }) : product ? (() => {
194
+ const interactive = onProductClick != null;
195
+ const mark = /* @__PURE__ */ jsx(
196
+ "span",
197
+ {
198
+ className: "sb-logo-mark",
199
+ style: { background: product.color ?? "hsl(var(--attention))" },
200
+ children: product.name[0]?.toUpperCase() ?? "?"
201
+ }
202
+ );
203
+ const meta = !collapsed ? /* @__PURE__ */ jsxs("span", { className: "sb-product-meta", children: [
204
+ /* @__PURE__ */ jsx("span", { className: "sb-product-name", children: product.name }),
205
+ product.role ? /* @__PURE__ */ jsx("span", { className: "sb-product-tenant", children: product.role }) : null
206
+ ] }) : null;
207
+ return interactive ? /* @__PURE__ */ jsxs(
208
+ "button",
209
+ {
210
+ type: "button",
211
+ className: "sb-product",
212
+ onClick: onProductClick,
213
+ "aria-label": product.name,
214
+ children: [
215
+ mark,
216
+ meta,
217
+ !collapsed ? /* @__PURE__ */ jsx("span", { className: "sb-product-caret", children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true" }) }) : null
218
+ ]
219
+ }
220
+ ) : /* @__PURE__ */ jsxs("div", { className: "sb-product sb-product-static", children: [
221
+ mark,
222
+ meta
223
+ ] });
224
+ })() : null,
217
225
  /* @__PURE__ */ jsx("nav", { className: "sb-nav-scroll", "aria-label": t("layout.sidebar.ariaLabel"), children: children ?? resolvedSections.map((section, sectionIndex) => /* @__PURE__ */ jsx(
218
226
  SidebarSection,
219
227
  {
@@ -1,3 +1,20 @@
1
1
  import type { TopbarProp } from "../../props/components/layout.prop";
2
- export type { TopbarProductProp as TopbarProduct, TopbarProjectProp as TopbarProject, TopbarProp, TopbarProp as TopbarProps, } from "../../props/components/layout.prop";
3
- export declare function Topbar({ product, project, productMenu, projectMenu, projectPlaceholder, onProductOpen, onProjectOpen, onSearchOpen, onTweaksOpen, collapsed, onToggleCollapsed, rightSlot, unread, searchPlaceholder, onNotificationsOpen, user, }: TopbarProp): import("react/jsx-runtime").JSX.Element;
2
+ export type { TopbarProp, TopbarProp as TopbarProps } from "../../props/components/layout.prop";
3
+ /**
4
+ * Topbar — a PURE SLOT bar. It positions three clusters (`start` / `center` / `end`) and owns the
5
+ * bar's flex layout; it does NOT bake any chrome. There is no built-in product switcher, search
6
+ * box, notification bell, or language picker — the CONSUMER composes those from real primitives
7
+ * (brand `Logo`, a `Button` search trigger, `AppSettingPicker` for locale/theme, a `DropdownMenu`
8
+ * user menu) and drops them into a slot. Whether a control is icon-only, labelled, bordered, etc.
9
+ * is that control's OWN configuration — never the shell's to dictate.
10
+ *
11
+ * <Topbar
12
+ * start={<><SidebarToggle /><Logo label="…" /></>}
13
+ * center={<Button variant="outline" onClick={openSearch}><Search />検索</Button>}
14
+ * end={<><AppSettingPicker kind="locale" /><UserMenu /></>}
15
+ * />
16
+ *
17
+ * Use it as `AppShell`'s `topbar` slot, or place it directly. For full custom content, pass
18
+ * `children` instead of the three slots.
19
+ */
20
+ export declare function Topbar({ start, center, end, className, children, ...props }: TopbarProp): import("react/jsx-runtime").JSX.Element;
@@ -1,132 +1,11 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import {
3
- Bell,
4
- ChevronDown,
5
- PanelLeftClose,
6
- PanelLeftOpen,
7
- Search,
8
- SlidersHorizontal
9
- } from "lucide-react";
10
- import { DropdownMenu, DropdownMenuTrigger } from "../navigation/dropdown-menu";
11
- import { useTranslation } from "../../i18n/use-translation";
12
- function Topbar({
13
- product,
14
- project,
15
- productMenu,
16
- projectMenu,
17
- projectPlaceholder,
18
- onProductOpen,
19
- onProjectOpen,
20
- onSearchOpen,
21
- onTweaksOpen,
22
- collapsed = false,
23
- onToggleCollapsed,
24
- rightSlot,
25
- unread = false,
26
- searchPlaceholder,
27
- onNotificationsOpen,
28
- user
29
- }) {
30
- const { t } = useTranslation();
31
- const productChip = /* @__PURE__ */ jsxs(
32
- "button",
33
- {
34
- type: "button",
35
- className: "tb-chip",
36
- "aria-label": product.name,
37
- onClick: productMenu ? void 0 : onProductOpen,
38
- children: [
39
- /* @__PURE__ */ jsx(
40
- "span",
41
- {
42
- className: "tb-chip-icon",
43
- style: { background: product.color ?? "hsl(var(--attention))" },
44
- children: product.name[0]?.toUpperCase() ?? "?"
45
- }
46
- ),
47
- /* @__PURE__ */ jsx("span", { className: "tb-chip-label", children: product.name }),
48
- /* @__PURE__ */ jsx("span", { className: "tb-chip-caret", children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true" }) })
49
- ]
50
- }
51
- );
52
- const showProject = project != null || projectMenu != null;
53
- const projectChip = /* @__PURE__ */ jsxs(
54
- "button",
55
- {
56
- type: "button",
57
- className: `tb-chip ${project ? "" : "tb-chip-empty"}`,
58
- "aria-label": project ? project.name : projectPlaceholder ?? "",
59
- onClick: projectMenu ? void 0 : onProjectOpen,
60
- children: [
61
- /* @__PURE__ */ jsx("span", { className: "tb-chip-label", children: project ? project.name : projectPlaceholder ?? "\u2014" }),
62
- /* @__PURE__ */ jsx("span", { className: "tb-chip-caret", children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true" }) })
63
- ]
64
- }
65
- );
66
- return /* @__PURE__ */ jsxs(Fragment, { children: [
67
- onToggleCollapsed ? /* @__PURE__ */ jsx(
68
- "button",
69
- {
70
- type: "button",
71
- className: "tb-icon-btn",
72
- "aria-label": t("layout.topbar.toggleSidebar"),
73
- "aria-pressed": collapsed,
74
- onClick: onToggleCollapsed,
75
- children: collapsed ? /* @__PURE__ */ jsx(PanelLeftOpen, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(PanelLeftClose, { "aria-hidden": "true" })
76
- }
77
- ) : null,
78
- /* @__PURE__ */ jsxs("div", { className: "tb-switcher", children: [
79
- productMenu ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [
80
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: productChip }),
81
- productMenu
82
- ] }) : productChip,
83
- showProject ? /* @__PURE__ */ jsx("span", { className: "tb-chip-sep", children: "/" }) : null,
84
- showProject ? projectMenu ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [
85
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: projectChip }),
86
- projectMenu
87
- ] }) : projectChip : null
88
- ] }),
89
- /* @__PURE__ */ jsxs(
90
- "button",
91
- {
92
- type: "button",
93
- className: "tb-search",
94
- "aria-label": t("layout.topbar.search"),
95
- "aria-keyshortcuts": "Meta+K",
96
- onClick: onSearchOpen,
97
- children: [
98
- /* @__PURE__ */ jsx(Search, { "aria-hidden": "true" }),
99
- /* @__PURE__ */ jsx("span", { children: searchPlaceholder ?? t("layout.topbar.searchPlaceholder") }),
100
- /* @__PURE__ */ jsx("kbd", { className: "kbd", children: "\u2318K" })
101
- ]
102
- }
103
- ),
104
- rightSlot,
105
- onNotificationsOpen ? /* @__PURE__ */ jsxs(
106
- "button",
107
- {
108
- type: "button",
109
- className: "tb-icon-btn tb-bell",
110
- "aria-label": t("layout.topbar.notifications"),
111
- onClick: onNotificationsOpen,
112
- children: [
113
- /* @__PURE__ */ jsx(Bell, { "aria-hidden": "true" }),
114
- unread ? /* @__PURE__ */ jsx("span", { className: "tb-bell-dot", "aria-hidden": "true" }) : null
115
- ]
116
- }
117
- ) : null,
118
- user,
119
- onTweaksOpen ? /* @__PURE__ */ jsx(
120
- "button",
121
- {
122
- type: "button",
123
- className: "tb-icon-btn",
124
- "aria-label": t("layout.topbar.tweaks"),
125
- onClick: onTweaksOpen,
126
- children: /* @__PURE__ */ jsx(SlidersHorizontal, { "aria-hidden": "true" })
127
- }
128
- ) : null
129
- ] });
2
+ import { cn } from "../../lib/utils";
3
+ function Topbar({ start, center, end, className, children, ...props }) {
4
+ return /* @__PURE__ */ jsx("div", { "data-slot": "topbar", className: cn("ui-topbar", className), ...props, children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
5
+ start != null ? /* @__PURE__ */ jsx("div", { "data-slot": "topbar-start", className: "ui-topbar-start", children: start }) : null,
6
+ center != null ? /* @__PURE__ */ jsx("div", { "data-slot": "topbar-center", className: "ui-topbar-center", children: center }) : null,
7
+ end != null ? /* @__PURE__ */ jsx("div", { "data-slot": "topbar-end", className: "ui-topbar-end", children: end }) : null
8
+ ] }) });
130
9
  }
131
10
  export {
132
11
  Topbar
@@ -301,5 +301,10 @@
301
301
  },
302
302
  "query": {
303
303
  "loadMore": "Load more"
304
+ },
305
+ "chart": {
306
+ "empty": "No data to display",
307
+ "summaryCartesian": "Chart with {series} series across {points} data points",
308
+ "summaryPie": "Pie chart with {slices} slices"
304
309
  }
305
310
  }
@@ -298,5 +298,10 @@
298
298
  },
299
299
  "query": {
300
300
  "loadMore": "さらに読み込む"
301
+ },
302
+ "chart": {
303
+ "empty": "データがありません",
304
+ "summaryCartesian": "{series}系列・{points}データ点のグラフ",
305
+ "summaryPie": "{slices}区分の円グラフ"
301
306
  }
302
307
  }
@@ -298,5 +298,10 @@
298
298
  },
299
299
  "query": {
300
300
  "loadMore": "Tải thêm"
301
+ },
302
+ "chart": {
303
+ "empty": "Không có dữ liệu",
304
+ "summaryCartesian": "Biểu đồ gồm {series} chuỗi trên {points} điểm dữ liệu",
305
+ "summaryPie": "Biểu đồ tròn gồm {slices} phần"
301
306
  }
302
307
  }
@@ -0,0 +1,89 @@
1
+ /** Charts component prop types — @see docs/COMPONENTS.md#charts (tree-shaken `@godxjp/ui/charts`). */
2
+ import type { ClassNameProp, DescriptionProp, EmptyMessageProp, IdProp, LabelProp, SizeProp } from "../vocabulary";
3
+ /** A single row of chart data — category accessor + one numeric value per series. */
4
+ export type ChartDatum = Record<string, string | number | null | undefined>;
5
+ /** One plotted series — `dataKey` accesses the value, `label` is the already-translated legend text. */
6
+ export type ChartSeriesProp = {
7
+ /** Key into each datum holding this series' numeric value. */
8
+ dataKey: string;
9
+ /** Already-translated display label (legend + tooltip). Defaults to `dataKey`. */
10
+ label?: string;
11
+ /** CSS colour or token var. Defaults to the `--chart-1..6` palette by index. */
12
+ color?: string;
13
+ };
14
+ /** Shared base for the cartesian charts (Line / Bar / Area). */
15
+ type ChartCartesianBase = {
16
+ /** Row data. Each row is one category with a value per series. */
17
+ data: ChartDatum[];
18
+ /** One or more plotted series. */
19
+ series: ChartSeriesProp[];
20
+ /** Key into each datum holding the x-axis category label. */
21
+ categoryKey: string;
22
+ /** Accessible name + visible caption for the chart. REQUIRED (role="img" needs a name). */
23
+ label: LabelProp;
24
+ /** Extra context appended to the screen-reader description. */
25
+ description?: DescriptionProp;
26
+ /** Canvas height preset — `xs|sm|md|lg`. Ignored when `height` is set. */
27
+ size?: SizeProp;
28
+ /** Explicit canvas height in px (overrides `size`). */
29
+ height?: number;
30
+ /** Show the series legend. */
31
+ showLegend?: boolean;
32
+ /** Show the cartesian background grid. */
33
+ showGrid?: boolean;
34
+ /** `Intl.NumberFormat` options for axis ticks + tooltip values (locale is automatic). */
35
+ numberFormat?: Intl.NumberFormatOptions;
36
+ /** Message shown when `data` is empty. Defaults to a localized "no data". */
37
+ emptyMessage?: EmptyMessageProp;
38
+ className?: ClassNameProp;
39
+ id?: IdProp;
40
+ };
41
+ /** @see LineChart */
42
+ export type LineChartProp = ChartCartesianBase & {
43
+ /** Render smooth (monotone) lines instead of straight segments. */
44
+ curved?: boolean;
45
+ };
46
+ /** @see BarChart */
47
+ export type BarChartProp = ChartCartesianBase & {
48
+ /** Stack series into one bar instead of grouping side by side. */
49
+ stacked?: boolean;
50
+ /** Lay bars out horizontally (category on the y-axis). */
51
+ horizontal?: boolean;
52
+ };
53
+ /** @see AreaChart */
54
+ export type AreaChartProp = ChartCartesianBase & {
55
+ /** Stack series areas instead of overlaying them. */
56
+ stacked?: boolean;
57
+ /** Render smooth (monotone) areas instead of straight segments. */
58
+ curved?: boolean;
59
+ };
60
+ /** @see PieChart */
61
+ export type PieChartProp = {
62
+ /** Row data — one slice per row. */
63
+ data: ChartDatum[];
64
+ /** Key into each datum holding the slice's numeric value. */
65
+ dataKey: string;
66
+ /** Key into each datum holding the slice's category label. */
67
+ nameKey: string;
68
+ /** Per-slice colours, applied by index. Defaults to the `--chart-1..6` palette. */
69
+ colors?: string[];
70
+ /** Accessible name + visible caption for the chart. REQUIRED. */
71
+ label: LabelProp;
72
+ /** Extra context appended to the screen-reader description. */
73
+ description?: DescriptionProp;
74
+ /** Canvas height preset — `xs|sm|md|lg`. Ignored when `height` is set. */
75
+ size?: SizeProp;
76
+ /** Explicit canvas height in px (overrides `size`). */
77
+ height?: number;
78
+ /** Show the slice legend. */
79
+ showLegend?: boolean;
80
+ /** `Intl.NumberFormat` options for tooltip values (locale is automatic). */
81
+ numberFormat?: Intl.NumberFormatOptions;
82
+ /** Render a donut (hollow centre) instead of a full pie. */
83
+ donut?: boolean;
84
+ /** Message shown when `data` is empty. Defaults to a localized "no data". */
85
+ emptyMessage?: EmptyMessageProp;
86
+ className?: ClassNameProp;
87
+ id?: IdProp;
88
+ };
89
+ export {};
File without changes
@@ -35,6 +35,11 @@ export type ButtonProp = React.ButtonHTMLAttributes<HTMLButtonElement> & {
35
35
  size?: ButtonSizeProp;
36
36
  /** Corner shape — `default` (control radius) · `pill` (fully rounded) · `sharp` (square). */
37
37
  shape?: ShapeProp;
38
+ /**
39
+ * Span the full width of the container (`width:100%`) instead of sizing to content —
40
+ * the prop form of `className="w-full"` for stacked/auth/dialog-footer actions (rule #42).
41
+ */
42
+ fullWidth?: boolean;
38
43
  asChild?: AsChildProp;
39
44
  onClick?: OnClickProp;
40
45
  disabled?: DisabledProp;
@@ -1,7 +1,8 @@
1
- export type { AppShellProp, PageContainerProp, PageInsetProp, SidebarItemProp, SidebarProductProp, SidebarProp, SidebarSectionProp, TopbarProductProp, TopbarProjectProp, TopbarProp, } from "./layout.prop";
1
+ export type { AppShellProp, PageContainerProp, PageInsetProp, SidebarItemProp, SidebarProductProp, SidebarProp, SidebarSectionProp, TopbarProp, } from "./layout.prop";
2
2
  export type { ButtonProp } from "./general.prop";
3
3
  export type { InputProp, TextareaProp, FormFieldProp, SearchInputProp, CheckboxProp, CheckboxGroupProp, ChoiceOptionProp, RadioProp, RadioGroupProp, SwitchProp, SliderProp, CalendarProp, DatePickerProp, DateRangePickerProp, TimePickerProp, ColorPickerProp, UploadProp, UploadFileItemProp, UploadVariantProp, TreeOptionProp, TreeFieldNamesProp, CascaderProp, TreeSelectProp, ShowCheckedStrategyProp, TransferProp, TransferItemProp, } from "./data-entry.prop";
4
4
  export type { EmptyStateProp, DescriptionsProp, DescriptionsItemProp, BadgeProp, DataTableProp, } from "./data-display.prop";
5
+ export type { ChartDatum, ChartSeriesProp, LineChartProp, BarChartProp, AreaChartProp, PieChartProp, } from "./charts.prop";
5
6
  export type { AlertQueryErrorProp, AlertProp, AlertTitleProp, AlertContentProp, AlertDescriptionProp, AlertActionsProp, SkeletonRowsProp, } from "./feedback.prop";
6
7
  export type { DataStateProp, InfiniteQueryStateProp, InfiniteQueryHelpers, PrefetchLinkProp, } from "./query.prop";
7
8
  export type { PaginationProp, StepsProp, StepItemProp, StepStatusProp, TabsProp, TabItemProp, } from "./navigation.prop";