@godxjp/ui 20.0.0 → 20.2.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.
- package/README.md +8 -2
- package/dist/app/app-provider.js +37 -21
- package/dist/app/index.d.ts +2 -0
- package/dist/app/index.js +2 -0
- package/dist/app/storage.d.ts +17 -0
- package/dist/app/storage.js +28 -0
- package/dist/app/theme-axes.d.ts +2 -0
- package/dist/app/theme-axes.js +45 -0
- package/dist/components/charts/chart-cartesian.d.ts +2 -1
- package/dist/components/charts/chart-cartesian.js +52 -3
- package/dist/components/charts/chart-category-axis.d.ts +55 -0
- package/dist/components/charts/chart-category-axis.js +93 -0
- package/dist/components/charts/chart-frame.d.ts +10 -1
- package/dist/components/charts/chart-frame.js +19 -3
- package/dist/components/charts/compact-bar-trend.d.ts +1 -1
- package/dist/components/charts/compact-bar-trend.js +2 -0
- package/dist/components/charts/pie-chart.d.ts +1 -1
- package/dist/components/charts/pie-chart.js +12 -1
- package/dist/components/charts/recharts-peer.d.ts +49 -0
- package/dist/components/charts/recharts-peer.js +45 -0
- package/dist/components/data-display/card.d.ts +12 -1
- package/dist/components/data-display/card.js +22 -4
- package/dist/components/data-display/code-block.js +6 -2
- package/dist/components/data-display/data-table.d.ts +39 -4
- package/dist/components/data-display/data-table.js +802 -270
- package/dist/components/data-display/descriptions.d.ts +27 -6
- package/dist/components/data-display/descriptions.js +58 -17
- package/dist/components/data-display/index.d.ts +2 -0
- package/dist/components/data-display/index.js +2 -0
- package/dist/components/data-display/list-row.d.ts +10 -1
- package/dist/components/data-display/list-row.js +7 -1
- package/dist/components/data-display/popover.d.ts +9 -3
- package/dist/components/data-display/popover.js +65 -11
- package/dist/components/data-display/range-timeline.d.ts +38 -0
- package/dist/components/data-display/range-timeline.js +161 -0
- package/dist/components/data-display/scroll-area.js +13 -2
- package/dist/components/data-display/service-launcher-card.js +14 -12
- package/dist/components/data-display/table.d.ts +71 -3
- package/dist/components/data-display/table.js +56 -18
- package/dist/components/data-display/tree-list.js +4 -9
- package/dist/components/data-entry/calendar.d.ts +2 -2
- package/dist/components/data-entry/calendar.js +23 -3
- package/dist/components/data-entry/cascader.d.ts +1 -1
- package/dist/components/data-entry/cascader.js +188 -24
- package/dist/components/data-entry/color-picker.d.ts +1 -1
- package/dist/components/data-entry/color-picker.js +17 -5
- package/dist/components/data-entry/control-appearance.d.ts +64 -0
- package/dist/components/data-entry/control-appearance.js +39 -0
- package/dist/components/data-entry/control-surface.d.ts +61 -0
- package/dist/components/data-entry/control-surface.js +39 -0
- package/dist/components/data-entry/date-picker.d.ts +1 -1
- package/dist/components/data-entry/date-picker.js +344 -113
- package/dist/components/data-entry/date-range-picker.d.ts +1 -1
- package/dist/components/data-entry/date-range-picker.js +278 -140
- package/dist/components/data-entry/form-field.d.ts +1 -1
- package/dist/components/data-entry/form-field.js +39 -4
- package/dist/components/data-entry/form.d.ts +4 -0
- package/dist/components/data-entry/form.js +4 -2
- package/dist/components/data-entry/index.d.ts +7 -3
- package/dist/components/data-entry/index.js +10 -1
- package/dist/components/data-entry/input-otp.d.ts +1 -1
- package/dist/components/data-entry/input.d.ts +12 -34
- package/dist/components/data-entry/input.js +92 -24
- package/dist/components/data-entry/month-picker.d.ts +1 -1
- package/dist/components/data-entry/month-picker.js +47 -10
- package/dist/components/data-entry/month-range-picker.d.ts +1 -1
- package/dist/components/data-entry/month-range-picker.js +51 -11
- package/dist/components/data-entry/number-input.d.ts +7 -0
- package/dist/components/data-entry/number-input.js +147 -98
- package/dist/components/data-entry/password-input.d.ts +1 -1
- package/dist/components/data-entry/radio.d.ts +1 -1
- package/dist/components/data-entry/radio.js +61 -13
- package/dist/components/data-entry/search-input.d.ts +1 -1
- package/dist/components/data-entry/search-input.js +16 -2
- package/dist/components/data-entry/search-select.d.ts +2 -2
- package/dist/components/data-entry/search-select.js +209 -78
- package/dist/components/data-entry/select.d.ts +22 -4
- package/dist/components/data-entry/select.js +215 -163
- package/dist/components/data-entry/slider.d.ts +9 -1
- package/dist/components/data-entry/slider.js +87 -9
- package/dist/components/data-entry/switch.d.ts +3 -0
- package/dist/components/data-entry/switch.js +29 -3
- package/dist/components/data-entry/textarea.d.ts +14 -56
- package/dist/components/data-entry/textarea.js +80 -33
- package/dist/components/data-entry/time-picker.d.ts +2 -2
- package/dist/components/data-entry/time-picker.js +333 -109
- package/dist/components/data-entry/time-range-picker.d.ts +5 -0
- package/dist/components/data-entry/time-range-picker.js +89 -0
- package/dist/components/data-entry/transfer.d.ts +1 -1
- package/dist/components/data-entry/transfer.js +86 -28
- package/dist/components/data-entry/tree-select.d.ts +1 -1
- package/dist/components/data-entry/tree-select.js +201 -113
- package/dist/components/data-entry/tree-utils.js +7 -14
- package/dist/components/data-entry/upload-files.d.ts +2 -0
- package/dist/components/data-entry/upload-files.js +31 -0
- package/dist/components/data-entry/upload-request.d.ts +4 -0
- package/dist/components/data-entry/upload-request.js +53 -0
- package/dist/components/data-entry/upload-types.d.ts +28 -0
- package/dist/components/data-entry/upload-types.js +2 -0
- package/dist/components/data-entry/upload.d.ts +2 -2
- package/dist/components/data-entry/upload.js +475 -115
- package/dist/components/feedback/dialog.js +19 -19
- package/dist/components/feedback/sheet.js +3 -0
- package/dist/components/feedback/tooltip.js +3 -0
- package/dist/components/general/button.d.ts +2 -1
- package/dist/components/general/button.js +7 -1
- package/dist/components/general/index.d.ts +1 -0
- package/dist/components/general/index.js +2 -0
- package/dist/components/general/typography.d.ts +3 -0
- package/dist/components/general/typography.js +15 -1
- package/dist/components/general/visually-hidden.d.ts +3 -0
- package/dist/components/general/visually-hidden.js +9 -0
- package/dist/components/layout/app-launcher.d.ts +34 -0
- package/dist/components/layout/app-launcher.js +261 -0
- package/dist/components/layout/app-shell.d.ts +3 -1
- package/dist/components/layout/app-shell.js +34 -14
- package/dist/components/layout/auth-shell.d.ts +1 -1
- package/dist/components/layout/auth-shell.js +2 -0
- package/dist/components/layout/breadcrumb.d.ts +14 -2
- package/dist/components/layout/breadcrumb.js +46 -4
- package/dist/components/layout/flex.d.ts +1 -1
- package/dist/components/layout/flex.js +23 -2
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +5 -1
- package/dist/components/layout/org-switcher.js +20 -1
- package/dist/components/layout/page-container.d.ts +1 -1
- package/dist/components/layout/page-container.js +5 -3
- package/dist/components/layout/responsive-grid.d.ts +16 -2
- package/dist/components/layout/responsive-grid.js +29 -2
- package/dist/components/layout/sidebar.js +2 -1
- package/dist/components/layout/topbar-item.d.ts +3 -0
- package/dist/components/layout/topbar-item.js +18 -3
- package/dist/components/layout/topbar.d.ts +1 -1
- package/dist/components/layout/topbar.js +27 -6
- package/dist/components/navigation/dropdown-menu.d.ts +30 -2
- package/dist/components/navigation/dropdown-menu.js +73 -11
- package/dist/components/navigation/pagination.d.ts +2 -2
- package/dist/components/navigation/pagination.js +155 -83
- package/dist/components/navigation/steps.d.ts +2 -2
- package/dist/components/navigation/steps.js +29 -4
- package/dist/components/navigation/tabs.d.ts +5 -33
- package/dist/components/navigation/tabs.js +232 -64
- package/dist/components/ui/hover-card.js +3 -0
- package/dist/components/ui/input-otp.d.ts +26 -28
- package/dist/components/ui/input-otp.js +50 -7
- package/dist/components/ui/password-input.d.ts +36 -2
- package/dist/components/ui/password-input.js +27 -7
- package/dist/components/ui/rating.d.ts +25 -0
- package/dist/components/ui/rating.js +67 -27
- package/dist/components/ui/segmented.d.ts +9 -0
- package/dist/components/ui/segmented.js +17 -2
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +13 -0
- package/dist/components/ui/tag-input.d.ts +45 -0
- package/dist/components/ui/tag-input.js +109 -27
- package/dist/form/form-context.d.ts +29 -0
- package/dist/form/form-context.js +44 -4
- package/dist/form/form-field-array.d.ts +22 -0
- package/dist/form/form-field-array.js +50 -0
- package/dist/form/form-field-control.d.ts +2 -1
- package/dist/form/form-field-control.js +116 -40
- package/dist/form/form-root.d.ts +2 -1
- package/dist/form/form-root.js +142 -23
- package/dist/form/index.d.ts +3 -1
- package/dist/form/index.js +12 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +3 -1
- package/dist/i18n/messages/en.json +59 -6
- package/dist/i18n/messages/ja.json +59 -6
- package/dist/i18n/messages/vi.json +59 -6
- package/dist/i18n/translate.d.ts +19 -0
- package/dist/i18n/translate.js +24 -0
- package/dist/inertia/index.d.ts +20 -0
- package/dist/inertia/index.js +60 -1
- package/dist/lib/control-styles.d.ts +25 -3
- package/dist/lib/control-styles.js +9 -3
- package/dist/lib/datetime/picker-format.d.ts +8 -0
- package/dist/lib/datetime/picker-format.js +54 -0
- package/dist/lib/overlay-portal.d.ts +18 -0
- package/dist/lib/overlay-portal.js +17 -0
- package/dist/props/components/app.prop.d.ts +13 -2
- package/dist/props/components/charts.prop.d.ts +21 -0
- package/dist/props/components/data-display.prop.d.ts +55 -4
- package/dist/props/components/data-entry.prop.d.ts +687 -43
- package/dist/props/components/form.prop.d.ts +142 -4
- package/dist/props/components/general.prop.d.ts +30 -1
- package/dist/props/components/index.d.ts +2 -2
- package/dist/props/components/layout.prop.d.ts +255 -8
- package/dist/props/components/navigation.prop.d.ts +113 -3
- package/dist/props/registry.d.ts +376 -10
- package/dist/props/registry.js +493 -9
- package/dist/props/vocabulary/data.prop.d.ts +179 -1
- package/dist/props/vocabulary/index.d.ts +4 -4
- package/dist/props/vocabulary/interaction.prop.d.ts +51 -2
- package/dist/props/vocabulary/navigation.prop.d.ts +40 -0
- package/dist/props/vocabulary/shared.prop.d.ts +33 -0
- package/dist/styles/badge-layout.css +2 -1
- package/dist/styles/card-layout.css +36 -5
- package/dist/styles/chart-layout.css +17 -1
- package/dist/styles/control.css +520 -14
- package/dist/styles/data-display-layout.css +248 -7
- package/dist/styles/data-entry-layout.css +13 -0
- package/dist/styles/layout.css +221 -4
- package/dist/styles/navigation-layout.css +230 -1
- package/dist/styles/shell-layout.css +690 -21
- package/dist/styles/table-layout.css +95 -6
- package/dist/styles/text-layout.css +5 -0
- package/dist/tokens/base.css +1 -0
- package/dist/tokens/components/badge.css +1 -0
- package/dist/tokens/components/chart.css +6 -0
- package/dist/tokens/components/control.css +81 -3
- package/dist/tokens/components/data-display.css +9 -0
- package/dist/tokens/components/descriptions.css +11 -0
- package/dist/tokens/components/flex.css +8 -0
- package/dist/tokens/components/navigation.css +55 -0
- package/dist/tokens/components/shell.css +100 -5
- package/dist/tokens/components/table.css +14 -0
- package/dist/tokens/foundation.css +2 -0
- package/dist/tokens/semantic/layout.css +9 -0
- package/docs/CONSUMER-RULES.md +13 -0
- package/docs/DESIGN-AUTHORITY.md +43 -6
- package/docs/DEVELOPMENT.md +4 -3
- package/docs/FORMS.md +151 -6
- package/docs/FRAME-COVERAGE-REPORT.md +29 -16
- package/docs/README.md +1 -1
- package/docs/STANDARDS-vocabulary-tokens.md +1 -1
- package/docs/TESTING.md +15 -6
- package/docs/charts/cjk-category-axis.tsx +81 -0
- package/docs/data-display/card/index.tsx +22 -0
- package/docs/data-display/data-table/examples/antd-parity.tsx +257 -0
- package/docs/data-display/data-table/index.tsx +23 -0
- package/docs/data-display/descriptions.tsx +41 -0
- package/docs/data-display/list-row.tsx +6 -6
- package/docs/data-display/scroll-area.tsx +31 -25
- package/docs/data-display/table.tsx +104 -45
- package/docs/data-display/timeline.tsx +41 -0
- package/docs/data-entry/date-picker.tsx +85 -0
- package/docs/data-entry/date-range-picker.tsx +26 -0
- package/docs/data-entry/form-dynamic-fields.tsx +199 -0
- package/docs/data-entry/form.tsx +74 -4
- package/docs/data-entry/input-otp.tsx +24 -0
- package/docs/data-entry/input.tsx +46 -1
- package/docs/data-entry/month-range-picker.tsx +1 -1
- package/docs/data-entry/select.tsx +27 -0
- package/docs/data-entry/switch.tsx +41 -0
- package/docs/data-entry/textarea.tsx +38 -0
- package/docs/data-entry/time-picker.tsx +85 -1
- package/docs/data-entry/time-range-picker.tsx +55 -0
- package/docs/data-entry/transfer.tsx +17 -0
- package/docs/data-entry/upload.tsx +56 -12
- package/docs/feedback/tooltip.tsx +1 -1
- package/docs/general/activity.tsx +2 -2
- package/docs/general/button/index.tsx +14 -1
- package/docs/general/typography.tsx +14 -1
- package/docs/layout/app-launcher.tsx +195 -0
- package/docs/layout/app-shell-arrangements.tsx +5 -5
- package/docs/layout/app-shell.tsx +11 -0
- package/docs/layout/flex.tsx +50 -0
- package/docs/layout/responsive-grid.tsx +21 -1
- package/docs/layout/topbar.tsx +5 -9
- package/docs/navigation/app-setting-picker.tsx +11 -0
- package/docs/navigation/breadcrumb.tsx +48 -0
- package/docs/navigation/dropdown-menu.tsx +21 -0
- package/docs/navigation/pagination.tsx +52 -0
- package/docs/navigation/steps.tsx +37 -0
- package/docs/navigation/tabs.tsx +97 -1
- package/docs/query/button-refetch.tsx +1 -0
- package/docs/showcase/settings-security-mfa.tsx +3 -3
- package/package.json +24 -4
- package/scripts/_agent-setup.mjs +76 -9
- package/scripts/init-guinea-pig.mjs +26 -4
- package/scripts/ui-audit.mjs +243 -30
- package/scripts/visual-audit.mjs +45 -7
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Menu } from "lucide-react";
|
|
5
|
+
import { useMediaQuery } from "../../lib/hooks.js";
|
|
5
6
|
import { useTranslation } from "../../i18n/use-translation.js";
|
|
6
|
-
import { Button } from "../general/button.js";
|
|
7
7
|
import { Sheet, SheetBody, SheetContent, SheetHeader, SheetTrigger } from "../feedback/sheet.js";
|
|
8
8
|
import { NavSurfaceProvider } from "./nav-surface.js";
|
|
9
|
+
import { TopbarItem } from "./topbar-item.js";
|
|
10
|
+
function useAppShellNavigationMode() {
|
|
11
|
+
return useMediaQuery("(width <= 56.25rem)") ? "drawer" : "docked";
|
|
12
|
+
}
|
|
9
13
|
function AppShell({
|
|
10
14
|
sidebar,
|
|
11
15
|
topbar,
|
|
@@ -19,6 +23,8 @@ function AppShell({
|
|
|
19
23
|
responsiveNavigation = "drawer",
|
|
20
24
|
topbarSpan = "content",
|
|
21
25
|
navRail,
|
|
26
|
+
navRailPosition = "start",
|
|
27
|
+
navRailEnd,
|
|
22
28
|
navRailLabel,
|
|
23
29
|
mobileNav,
|
|
24
30
|
mobileNavLabel,
|
|
@@ -26,11 +32,17 @@ function AppShell({
|
|
|
26
32
|
onMobileNavOpenChange
|
|
27
33
|
}) {
|
|
28
34
|
const { t } = useTranslation();
|
|
29
|
-
const
|
|
35
|
+
const navigationMode = useAppShellNavigationMode();
|
|
36
|
+
const hasSidebar = sidebar !== void 0 && sidebar !== null && sidebar !== false;
|
|
37
|
+
const railContent = navRail === void 0 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
38
|
navRail,
|
|
39
|
+
navRailEnd !== void 0 ? /* @__PURE__ */ jsx("div", { className: "app-nav-rail-end", children: navRailEnd }) : null
|
|
40
|
+
] });
|
|
41
|
+
const drawerNav = mobileNav !== void 0 ? mobileNav : navRail !== void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
railContent,
|
|
31
43
|
sidebar
|
|
32
44
|
] }) : sidebar;
|
|
33
|
-
const hasDrawer = responsiveNavigation === "drawer" && drawerNav != null;
|
|
45
|
+
const hasDrawer = responsiveNavigation === "drawer" && drawerNav != null && drawerNav !== false;
|
|
34
46
|
const railInDrawer = mobileNav === void 0 && navRail !== void 0;
|
|
35
47
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false);
|
|
36
48
|
const drawerOpen = mobileNavOpen ?? uncontrolledOpen;
|
|
@@ -38,7 +50,11 @@ function AppShell({
|
|
|
38
50
|
const handleDrawerClick = (event) => {
|
|
39
51
|
const target = event.target;
|
|
40
52
|
const hit = target.closest("a[href], button, [role='menuitem']");
|
|
41
|
-
if (
|
|
53
|
+
if (!hit) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const opensSomething = hit.hasAttribute("aria-expanded") || hit.hasAttribute("aria-haspopup") || hit.classList.contains("sb-nav-group-trigger");
|
|
57
|
+
if (!opensSomething) {
|
|
42
58
|
setDrawerOpen(false);
|
|
43
59
|
}
|
|
44
60
|
};
|
|
@@ -54,7 +70,7 @@ function AppShell({
|
|
|
54
70
|
);
|
|
55
71
|
}
|
|
56
72
|
}
|
|
57
|
-
const logoInRail = logo !== void 0 && topbarSpan !== "full";
|
|
73
|
+
const logoInRail = hasSidebar && logo !== void 0 && topbarSpan !== "full";
|
|
58
74
|
const resolvedTopbar = topbar !== void 0 ? /* @__PURE__ */ jsxs("div", { className: "app-topbar-rail", children: [
|
|
59
75
|
!logoInRail && logo !== void 0 && /* @__PURE__ */ jsx("div", { className: "app-topbar-logo", children: logo }),
|
|
60
76
|
/* @__PURE__ */ jsx("div", { className: "app-topbar-custom", children: topbar })
|
|
@@ -64,26 +80,26 @@ function AppShell({
|
|
|
64
80
|
/* @__PURE__ */ jsx("div", { className: "app-topbar-spacer" }),
|
|
65
81
|
topbarRight !== void 0 && /* @__PURE__ */ jsx("div", { className: "app-topbar-right", children: topbarRight })
|
|
66
82
|
] });
|
|
67
|
-
const rail = /* @__PURE__ */ jsxs("aside", { className: "app-sidebar", "aria-label": t("layout.appShell.sidebarLabel"), children: [
|
|
83
|
+
const rail = hasSidebar ? /* @__PURE__ */ jsxs("aside", { className: "app-sidebar", "aria-label": t("layout.appShell.sidebarLabel"), children: [
|
|
68
84
|
logoInRail && /* @__PURE__ */ jsx("div", { className: "app-sidebar-logo", children: logo }),
|
|
69
85
|
sidebar
|
|
70
|
-
] });
|
|
86
|
+
] }) : null;
|
|
71
87
|
const navRailRegion = navRail === void 0 ? null : /* @__PURE__ */ jsx(
|
|
72
88
|
"aside",
|
|
73
89
|
{
|
|
74
90
|
className: "app-nav-rail",
|
|
91
|
+
"data-orientation": navRailPosition === "top" || navRailPosition === "bottom" ? "horizontal" : "vertical",
|
|
92
|
+
"data-edge": navRailPosition,
|
|
75
93
|
"aria-label": navRailLabel ?? t("layout.appShell.navRailLabel"),
|
|
76
|
-
children:
|
|
94
|
+
children: railContent
|
|
77
95
|
}
|
|
78
96
|
);
|
|
79
97
|
const bar = !hasTopbarContent && !hasDrawer ? null : /* @__PURE__ */ jsxs("header", { className: "app-topbar ui-scale-fixed", "aria-label": t("layout.appShell.headerLabel"), children: [
|
|
80
98
|
hasDrawer && /* @__PURE__ */ jsxs(Sheet, { open: drawerOpen, onOpenChange: setDrawerOpen, children: [
|
|
81
99
|
/* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
82
|
-
|
|
100
|
+
TopbarItem,
|
|
83
101
|
{
|
|
84
102
|
type: "button",
|
|
85
|
-
variant: "ghost",
|
|
86
|
-
size: "sm",
|
|
87
103
|
className: "app-mobile-nav-trigger",
|
|
88
104
|
"aria-label": t("layout.appShell.openNav"),
|
|
89
105
|
"aria-haspopup": "dialog",
|
|
@@ -105,7 +121,7 @@ function AppShell({
|
|
|
105
121
|
className: "app-mobile-nav-body px-[var(--app-shell-mobile-nav-inset)]",
|
|
106
122
|
onClick: handleDrawerClick,
|
|
107
123
|
children: railInDrawer ? /* @__PURE__ */ jsxs("div", { className: "app-mobile-nav-columns", children: [
|
|
108
|
-
/* @__PURE__ */ jsx("div", { className: "app-mobile-nav-rail", children:
|
|
124
|
+
/* @__PURE__ */ jsx("div", { className: "app-mobile-nav-rail", children: railContent }),
|
|
109
125
|
/* @__PURE__ */ jsx(NavSurfaceProvider, { surface: "drawer", children: /* @__PURE__ */ jsx("div", { className: "app-mobile-nav-sections", children: sidebar }) })
|
|
110
126
|
] }) : /* @__PURE__ */ jsx(NavSurfaceProvider, { surface: "drawer", children: drawerNav })
|
|
111
127
|
}
|
|
@@ -120,11 +136,14 @@ function AppShell({
|
|
|
120
136
|
"div",
|
|
121
137
|
{
|
|
122
138
|
className: "app-root",
|
|
123
|
-
"data-collapsed": sidebarCollapsed ? "true" : void 0,
|
|
139
|
+
"data-collapsed": hasSidebar && sidebarCollapsed ? "true" : void 0,
|
|
140
|
+
"data-sidebar": hasSidebar ? void 0 : "none",
|
|
124
141
|
"data-responsive-navigation": responsiveNavigation,
|
|
142
|
+
"data-navigation": navigationMode,
|
|
125
143
|
"data-topbar": hasTopbarContent ? void 0 : "none",
|
|
126
144
|
"data-topbar-span": topbarSpan === "full" ? "full" : void 0,
|
|
127
145
|
"data-nav-rail": navRail !== void 0 ? "" : void 0,
|
|
146
|
+
"data-nav-rail-position": navRail !== void 0 ? navRailPosition : void 0,
|
|
128
147
|
children: [
|
|
129
148
|
topbarSpan === "full" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
130
149
|
bar,
|
|
@@ -145,5 +164,6 @@ function AppShell({
|
|
|
145
164
|
);
|
|
146
165
|
}
|
|
147
166
|
export {
|
|
148
|
-
AppShell
|
|
167
|
+
AppShell,
|
|
168
|
+
useAppShellNavigationMode
|
|
149
169
|
};
|
|
@@ -7,4 +7,4 @@ export type { AuthShellProp, AuthShellProp as AuthShellProps, } from "../../prop
|
|
|
7
7
|
* locale picker, a theme toggle), and `measure="wide"` opens the content slot to the split login
|
|
8
8
|
* (a brand panel beside the card) that used to have no shell of its own.
|
|
9
9
|
*/
|
|
10
|
-
export declare function AuthShell({ brand, actions, footer, children, variant, preset, measure, density, className, }: AuthShellProp): import("react").JSX.Element;
|
|
10
|
+
export declare function AuthShell({ brand, actions, footer, children, variant, preset, measure, align, density, className, }: AuthShellProp): import("react").JSX.Element;
|
|
@@ -10,6 +10,7 @@ function AuthShell({
|
|
|
10
10
|
variant = "default",
|
|
11
11
|
preset = "default",
|
|
12
12
|
measure = "default",
|
|
13
|
+
align,
|
|
13
14
|
density,
|
|
14
15
|
className
|
|
15
16
|
}) {
|
|
@@ -22,6 +23,7 @@ function AuthShell({
|
|
|
22
23
|
"data-variant": variant,
|
|
23
24
|
"data-preset": preset === "default" ? void 0 : preset,
|
|
24
25
|
"data-measure": measure === "default" ? void 0 : measure,
|
|
26
|
+
"data-align": align,
|
|
25
27
|
"data-density": resolvedDensity,
|
|
26
28
|
className: cn("ui-auth-shell", className),
|
|
27
29
|
children: [
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import type { ElementType } from "react";
|
|
2
|
-
import type { BreadcrumbProp } from "../../props/vocabulary/navigation.prop.js";
|
|
2
|
+
import type { BreadcrumbItemRenderProp, BreadcrumbProp, BreadcrumbSeparatorProp } from "../../props/vocabulary/navigation.prop.js";
|
|
3
3
|
export type BreadcrumbProps = {
|
|
4
4
|
items: BreadcrumbProp;
|
|
5
5
|
linkComponent?: ElementType;
|
|
6
6
|
/** Override the `<nav>` landmark's accessible name. Defaults to a localized "Breadcrumb". */
|
|
7
7
|
ariaLabel?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Ant Design `separator`. Defaults to the chevron glyph. A string (`"/"`) or any node replaces
|
|
10
|
+
* it; `""` removes it. It is always `aria-hidden` — the trail's structure is carried by the
|
|
11
|
+
* `<ol>`/`<li>`, never by the glyph, so a screen reader never hears "slash" between segments.
|
|
12
|
+
*/
|
|
13
|
+
separator?: BreadcrumbSeparatorProp;
|
|
14
|
+
/**
|
|
15
|
+
* Ant Design `itemRender`. Replaces the anchor/text of ONE segment while this component keeps
|
|
16
|
+
* owning the `<nav>`, the `<ol>`/`<li>`, the separators and `aria-current` — the parts that make
|
|
17
|
+
* the trail a landmark. Use it to hand the trail a router `<Link>` (Inertia, react-router).
|
|
18
|
+
*/
|
|
19
|
+
itemRender?: BreadcrumbItemRenderProp;
|
|
8
20
|
};
|
|
9
|
-
export declare function Breadcrumb({ items, linkComponent: LinkComponent, ariaLabel, }: BreadcrumbProps): import("react").JSX.Element;
|
|
21
|
+
export declare function Breadcrumb({ items, linkComponent: LinkComponent, ariaLabel, separator, itemRender, }: BreadcrumbProps): import("react").JSX.Element;
|
|
@@ -1,21 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ChevronRight } from "lucide-react";
|
|
3
|
+
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
4
4
|
import { useTranslation } from "../../i18n/use-translation.js";
|
|
5
|
+
import {
|
|
6
|
+
DropdownMenu,
|
|
7
|
+
DropdownMenuContent,
|
|
8
|
+
DropdownMenuItem,
|
|
9
|
+
DropdownMenuTrigger
|
|
10
|
+
} from "../navigation/dropdown-menu.js";
|
|
5
11
|
function Breadcrumb({
|
|
6
12
|
items,
|
|
7
13
|
linkComponent: LinkComponent = "a",
|
|
8
|
-
ariaLabel
|
|
14
|
+
ariaLabel,
|
|
15
|
+
separator,
|
|
16
|
+
itemRender
|
|
9
17
|
}) {
|
|
10
18
|
const { t } = useTranslation();
|
|
19
|
+
const separatorNode = separator === void 0 ? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" }) : separator;
|
|
11
20
|
return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel ?? t("navigation.breadcrumb.ariaLabel"), className: "ui-breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: "ui-breadcrumb-list", children: items.map((item, index) => {
|
|
12
21
|
const isLast = index === items.length - 1;
|
|
13
22
|
return /* @__PURE__ */ jsxs("li", { className: "ui-breadcrumb-item", children: [
|
|
14
|
-
|
|
15
|
-
!isLast ? /* @__PURE__ */ jsx(
|
|
23
|
+
renderBreadcrumbSegment({ item, index, isLast, items, itemRender, LinkComponent }),
|
|
24
|
+
!isLast ? /* @__PURE__ */ jsx("span", { className: "ui-breadcrumb-separator", "aria-hidden": "true", children: separatorNode }) : null
|
|
16
25
|
] }, item.to ?? index);
|
|
17
26
|
}) }) });
|
|
18
27
|
}
|
|
28
|
+
function renderBreadcrumbSegment({
|
|
29
|
+
item,
|
|
30
|
+
index,
|
|
31
|
+
isLast,
|
|
32
|
+
items,
|
|
33
|
+
itemRender,
|
|
34
|
+
LinkComponent
|
|
35
|
+
}) {
|
|
36
|
+
if (itemRender) return itemRender(item, { index, isLast, items });
|
|
37
|
+
if (item.menu) {
|
|
38
|
+
const { items: menuItems, onSelect } = item.menu;
|
|
39
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
40
|
+
/* @__PURE__ */ jsxs(DropdownMenuTrigger, { className: "ui-breadcrumb-menu-trigger ui-focus-ring", children: [
|
|
41
|
+
item.label,
|
|
42
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "ui-breadcrumb-menu-icon", "aria-hidden": "true" })
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { placement: "bottomStart", children: menuItems.map((entry) => /* @__PURE__ */ jsx(
|
|
45
|
+
DropdownMenuItem,
|
|
46
|
+
{
|
|
47
|
+
disabled: entry.disabled,
|
|
48
|
+
onSelect: onSelect ? () => onSelect(entry.value) : void 0,
|
|
49
|
+
asChild: entry.to !== void 0,
|
|
50
|
+
children: entry.to !== void 0 ? /* @__PURE__ */ jsx(LinkComponent, { href: entry.to, to: entry.to, children: entry.label }) : entry.label
|
|
51
|
+
},
|
|
52
|
+
entry.value
|
|
53
|
+
)) })
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
if (item.to && !isLast) {
|
|
57
|
+
return /* @__PURE__ */ jsx(LinkComponent, { href: item.to, to: item.to, className: "ui-breadcrumb-link", children: item.label });
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsx("span", { className: "ui-breadcrumb-current", "aria-current": isLast ? "page" : void 0, children: item.label });
|
|
60
|
+
}
|
|
19
61
|
export {
|
|
20
62
|
Breadcrumb
|
|
21
63
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FlexProp } from "../../props/components/layout.prop.js";
|
|
2
2
|
export type { FlexAlignProp, FlexDirectionProp, FlexJustifyProp, FlexProp, FlexProp as FlexProps, } from "../../props/components/layout.prop.js";
|
|
3
|
-
export declare function Flex({ as: Element, direction, gap, gapRaw, pad, padRaw, align, justify, wrap, hideBelow, hideFrom, fill, width, className, style, children, ...props }: FlexProp): import("react").JSX.Element;
|
|
3
|
+
export declare function Flex({ as: Element, direction, grow, shrink, surface, bleed, reveal, gap, gapRaw, pad, padRaw, align, justify, wrap, hideBelow, hideFrom, fill, width, className, style, children, ...props }: FlexProp): import("react").JSX.Element;
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { mergeAriaIds } from "../../lib/field-a11y.js";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
-
import { flexGapClass, padStyle } from "../../lib/variants.js";
|
|
5
|
+
import { flexGapClass, padStyle, padStepToken } from "../../lib/variants.js";
|
|
6
6
|
const toCssLength = (value) => typeof value === "number" ? `${value}px` : value;
|
|
7
7
|
function Flex({
|
|
8
8
|
as: Element = "div",
|
|
9
9
|
direction = "row",
|
|
10
|
+
grow,
|
|
11
|
+
shrink,
|
|
12
|
+
surface,
|
|
13
|
+
bleed,
|
|
14
|
+
reveal,
|
|
10
15
|
gap = "md",
|
|
11
16
|
gapRaw,
|
|
12
17
|
pad,
|
|
@@ -37,10 +42,24 @@ function Flex({
|
|
|
37
42
|
"aria-describedby": mergeAriaIds(props["aria-describedby"], ariaErrorMessage)
|
|
38
43
|
};
|
|
39
44
|
}
|
|
45
|
+
const responsive = typeof direction === "object";
|
|
46
|
+
const axes = responsive ? direction : { base: direction };
|
|
47
|
+
const cssDirection = (axis) => axis === "col" ? "column" : axis;
|
|
48
|
+
const directionVars = responsive ? Object.fromEntries(
|
|
49
|
+
Object.entries(axes).map(([step, axis]) => [
|
|
50
|
+
`--flex-direction-${step}`,
|
|
51
|
+
cssDirection(axis)
|
|
52
|
+
])
|
|
53
|
+
) : {};
|
|
40
54
|
return /* @__PURE__ */ jsx(
|
|
41
55
|
Element,
|
|
42
56
|
{
|
|
43
|
-
"data-direction": direction,
|
|
57
|
+
"data-direction": responsive ? "responsive" : direction,
|
|
58
|
+
"data-grow": grow ? "" : void 0,
|
|
59
|
+
"data-shrink": shrink === false ? "false" : void 0,
|
|
60
|
+
"data-surface": surface,
|
|
61
|
+
"data-reveal": reveal,
|
|
62
|
+
"data-list": Element === "ul" ? "disc" : Element === "ol" ? "decimal" : void 0,
|
|
44
63
|
"data-align": align,
|
|
45
64
|
"data-justify": justify,
|
|
46
65
|
"data-wrap": wrap ? "true" : void 0,
|
|
@@ -53,6 +72,8 @@ function Flex({
|
|
|
53
72
|
"data-pad-raw": padRaw === void 0 ? void 0 : "",
|
|
54
73
|
style: {
|
|
55
74
|
...style,
|
|
75
|
+
...directionVars,
|
|
76
|
+
...bleed === void 0 ? void 0 : { marginInline: `calc(-1 * ${padStepToken(bleed)})` },
|
|
56
77
|
...gapRaw === void 0 ? void 0 : { gap: `${gapRaw}px` },
|
|
57
78
|
...width === void 0 ? void 0 : { inlineSize: toCssLength(width) },
|
|
58
79
|
...padStyle(pad, padRaw)
|
|
@@ -7,6 +7,8 @@ export { NavList } from "./nav-list.js";
|
|
|
7
7
|
export type { NavListProp, NavListProps } from "./nav-list.js";
|
|
8
8
|
export { AppShell } from "./app-shell.js";
|
|
9
9
|
export type { AppShellProps } from "./app-shell.js";
|
|
10
|
+
export { AppLauncher } from "./app-launcher.js";
|
|
11
|
+
export type { AppLauncherApp, AppLauncherGroup, AppLauncherLabels, AppLauncherProp, AppLauncherProps, } from "./app-launcher.js";
|
|
10
12
|
export { OrgSwitcher } from "./org-switcher.js";
|
|
11
13
|
export type { OrgSwitcherLabels, OrgSwitcherOrganization, OrgSwitcherProp, OrgSwitcherProps, } from "./org-switcher.js";
|
|
12
14
|
export { AuthShell } from "./auth-shell.js";
|
|
@@ -54,3 +56,4 @@ export { LegalDocumentShell } from "./legal-document-shell.js";
|
|
|
54
56
|
export type { LegalDocumentSectionProp, LegalDocumentShellProp, LegalDocumentShellProps, } from "./legal-document-shell.js";
|
|
55
57
|
export { ServiceRolePanel } from "./service-role-panel.js";
|
|
56
58
|
export type { ServiceRoleItemProp, ServiceRolePanelProp, ServiceRolePanelProps, } from "./service-role-panel.js";
|
|
59
|
+
export { useAppShellNavigationMode } from "./app-shell.js";
|
|
@@ -3,6 +3,7 @@ import { Flex } from "./flex.js";
|
|
|
3
3
|
import { ResizablePanel, ResizablePanelGroup, ResizableHandle } from "./resizable.js";
|
|
4
4
|
import { NavList } from "./nav-list.js";
|
|
5
5
|
import { AppShell } from "./app-shell.js";
|
|
6
|
+
import { AppLauncher } from "./app-launcher.js";
|
|
6
7
|
import { OrgSwitcher } from "./org-switcher.js";
|
|
7
8
|
import { AuthShell } from "./auth-shell.js";
|
|
8
9
|
import { AuthDivider } from "./auth-divider.js";
|
|
@@ -25,8 +26,10 @@ import { Separator } from "./separator.js";
|
|
|
25
26
|
import { AspectRatio } from "./aspect-ratio.js";
|
|
26
27
|
import { LegalDocumentShell } from "./legal-document-shell.js";
|
|
27
28
|
import { ServiceRolePanel } from "./service-role-panel.js";
|
|
29
|
+
import { useAppShellNavigationMode } from "./app-shell.js";
|
|
28
30
|
export {
|
|
29
31
|
AccountChip,
|
|
32
|
+
AppLauncher,
|
|
30
33
|
AppShell,
|
|
31
34
|
AspectRatio,
|
|
32
35
|
AuthAccountSummary,
|
|
@@ -58,5 +61,6 @@ export {
|
|
|
58
61
|
SplitPane,
|
|
59
62
|
Topbar,
|
|
60
63
|
TopbarItem,
|
|
61
|
-
createSidebarLink
|
|
64
|
+
createSidebarLink,
|
|
65
|
+
useAppShellNavigationMode
|
|
62
66
|
};
|
|
@@ -3,6 +3,14 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Check, ChevronsUpDown, Loader2, RotateCcw } from "lucide-react";
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import {
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogBody,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogHeader,
|
|
11
|
+
DialogTitle,
|
|
12
|
+
DialogTrigger
|
|
13
|
+
} from "../feedback/dialog.js";
|
|
6
14
|
import { Popover, PopoverContent, PopoverTrigger } from "../data-display/popover.js";
|
|
7
15
|
import {
|
|
8
16
|
Command,
|
|
@@ -163,7 +171,9 @@ function OrgSwitcher({
|
|
|
163
171
|
[controlled, onOpenChange]
|
|
164
172
|
);
|
|
165
173
|
const compactViewport = useSheetResponsiveMode("auto") === "bottom";
|
|
166
|
-
const
|
|
174
|
+
const responsivePair = responsive === "auto" || responsive === "dialog";
|
|
175
|
+
const sheet = responsive === "sheet" || responsivePair && compactViewport;
|
|
176
|
+
const dialog = responsive === "dialog" && !sheet;
|
|
167
177
|
const current = organizations.find((organization) => organization.id === value);
|
|
168
178
|
const fallbackName = current?.name ?? labels.title;
|
|
169
179
|
const triggerLabel = labels.trigger(fallbackName);
|
|
@@ -210,6 +220,15 @@ function OrgSwitcher({
|
|
|
210
220
|
)
|
|
211
221
|
] }) });
|
|
212
222
|
}
|
|
223
|
+
if (dialog) {
|
|
224
|
+
return /* @__PURE__ */ jsx("div", { className: cn("ui-org-switcher", className), "data-collapsed": collapsed || void 0, children: /* @__PURE__ */ jsxs(Dialog, { open: resolvedOpen, onOpenChange: setOpen, children: [
|
|
225
|
+
/* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: trigger }),
|
|
226
|
+
/* @__PURE__ */ jsxs(DialogContent, { className: "ui-org-switcher-dialog", children: [
|
|
227
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: labels.title }) }),
|
|
228
|
+
/* @__PURE__ */ jsx(DialogBody, { children: panel })
|
|
229
|
+
] })
|
|
230
|
+
] }) });
|
|
231
|
+
}
|
|
213
232
|
return /* @__PURE__ */ jsx("div", { className: cn("ui-org-switcher", className), "data-collapsed": collapsed || void 0, children: /* @__PURE__ */ jsxs(Popover, { open: resolvedOpen, onOpenChange: setOpen, children: [
|
|
214
233
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: trigger }),
|
|
215
234
|
/* @__PURE__ */ jsx(PopoverContent, { align: "start", className: "ui-org-switcher-popover", "aria-label": labels.title, children: panel })
|
|
@@ -2,7 +2,7 @@ import type { PageContainerProp, PageInsetProp } from "../../props/components/la
|
|
|
2
2
|
export type { PageContainerProp, PageContainerProp as PageContainerProps, } from "../../props/components/layout.prop.js";
|
|
3
3
|
export type { BreadcrumbItemProp, BreadcrumbItemProp as BreadcrumbItem, } from "../../props/vocabulary/navigation.prop.js";
|
|
4
4
|
export declare function PageContainerInset({ className, children, ...props }: PageInsetProp): import("react").JSX.Element;
|
|
5
|
-
declare function PageContainerRoot({ title, subtitle, status, extra, toolbar, footer, breadcrumb, breadcrumbLabel, breadcrumbAriaLabel, linkComponent: LinkComponent, headerLoading, density, variant, preset, headerLayout, headerScale, measure, stickyFooter, footerReveal, fill, children, className, }: PageContainerProp): import("react").JSX.Element;
|
|
5
|
+
declare function PageContainerRoot({ title, subtitle, status, extra, toolbar, footer, toolbarPad, footerPad, breadcrumb, breadcrumbLabel, breadcrumbAriaLabel, linkComponent: LinkComponent, headerLoading, density, variant, preset, headerLayout, headerScale, measure, stickyFooter, footerReveal, fill, children, className, }: PageContainerProp): import("react").JSX.Element;
|
|
6
6
|
export declare const PageContainer: typeof PageContainerRoot & {
|
|
7
7
|
Inset: typeof PageContainerInset;
|
|
8
8
|
};
|
|
@@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
4
4
|
import { ChevronRight } from "lucide-react";
|
|
5
5
|
import { useTranslation } from "../../i18n/use-translation.js";
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
7
|
-
import { densityClass, pageContainerVariantClass } from "../../lib/variants.js";
|
|
7
|
+
import { densityClass, pageContainerVariantClass, padStyle } from "../../lib/variants.js";
|
|
8
8
|
function scrollParent(el) {
|
|
9
9
|
let node = el?.parentElement ?? null;
|
|
10
10
|
while (node) {
|
|
@@ -40,6 +40,8 @@ function PageContainerRoot({
|
|
|
40
40
|
extra,
|
|
41
41
|
toolbar,
|
|
42
42
|
footer,
|
|
43
|
+
toolbarPad,
|
|
44
|
+
footerPad,
|
|
43
45
|
breadcrumb,
|
|
44
46
|
breadcrumbLabel,
|
|
45
47
|
breadcrumbAriaLabel,
|
|
@@ -146,9 +148,9 @@ function PageContainerRoot({
|
|
|
146
148
|
]
|
|
147
149
|
}
|
|
148
150
|
),
|
|
149
|
-
toolbar != null && /* @__PURE__ */ jsx("div", { className: "ui-page-toolbar", children: toolbar }),
|
|
151
|
+
toolbar != null && /* @__PURE__ */ jsx("div", { className: "ui-page-toolbar", style: padStyle(toolbarPad, void 0), children: toolbar }),
|
|
150
152
|
children != null && /* @__PURE__ */ jsx("div", { className: "ui-page-body", children }),
|
|
151
|
-
footer && /* @__PURE__ */ jsx("footer", { className: "ui-page-footer", children: footer })
|
|
153
|
+
footer && /* @__PURE__ */ jsx("footer", { className: "ui-page-footer", style: padStyle(footerPad, void 0), children: footer })
|
|
152
154
|
]
|
|
153
155
|
}
|
|
154
156
|
);
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { ResponsiveGridColumnsProp, ResponsiveGridPresetProp } from "../../props/components/layout.prop.js";
|
|
2
|
+
import type { ResponsiveGridColumnsProp, ResponsiveGridFlowProp, ResponsiveGridPresetProp } from "../../props/components/layout.prop.js";
|
|
3
|
+
import type { PadProp, PadRawProp } from "../../props/vocabulary/index.js";
|
|
3
4
|
import type { GapProp } from "../../props/vocabulary/layout.prop.js";
|
|
4
5
|
export type ResponsiveGridProps = {
|
|
6
|
+
pad?: PadProp;
|
|
7
|
+
padRaw?: PadRawProp;
|
|
5
8
|
/** Gap between cells, the same steps as Flex. Default `md`. */
|
|
6
9
|
gap?: GapProp;
|
|
7
10
|
/** Optional structural class override. */
|
|
8
11
|
className?: string;
|
|
9
12
|
columns?: ResponsiveGridColumnsProp;
|
|
13
|
+
/** Keep collections in a horizontal sequence; pair with ScrollArea orientation="horizontal". */
|
|
14
|
+
flow?: ResponsiveGridFlowProp;
|
|
10
15
|
/**
|
|
11
16
|
* Named column geometry for a recognised collection shape — see `ResponsiveGridPresetProp`.
|
|
12
17
|
* Wins over `columns` when both are set, so a caller migrating to a preset does not also need
|
|
@@ -15,4 +20,13 @@ export type ResponsiveGridProps = {
|
|
|
15
20
|
preset?: ResponsiveGridPresetProp;
|
|
16
21
|
children: ReactNode;
|
|
17
22
|
};
|
|
18
|
-
export declare function ResponsiveGrid({ columns, gap, preset, className, children, }: ResponsiveGridProps): import("react").JSX.Element;
|
|
23
|
+
export declare function ResponsiveGrid({ columns, flow, gap, pad, padRaw, preset, className, children, }: ResponsiveGridProps): import("react").JSX.Element;
|
|
24
|
+
export declare namespace ResponsiveGrid {
|
|
25
|
+
export { ResponsiveGridItem as Item };
|
|
26
|
+
}
|
|
27
|
+
/** A grid item owns its responsive span; no extra implicit columns on a narrow container. */
|
|
28
|
+
export declare function ResponsiveGridItem({ span, children, className, }: {
|
|
29
|
+
span?: ResponsiveGridColumnsProp;
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { padStyle } from "../../lib/variants.js";
|
|
2
3
|
import { cn } from "../../lib/utils.js";
|
|
3
4
|
const RESPONSIVE_GRID_PRESET_COLUMNS = {
|
|
4
5
|
"pricing-plans": { base: 1, sm: 3, md: 3, lg: 3 }
|
|
@@ -29,14 +30,40 @@ function toStyle(resolved) {
|
|
|
29
30
|
}
|
|
30
31
|
function ResponsiveGrid({
|
|
31
32
|
columns = 4,
|
|
33
|
+
flow = "rows",
|
|
32
34
|
gap,
|
|
35
|
+
pad,
|
|
36
|
+
padRaw,
|
|
33
37
|
preset,
|
|
34
38
|
className,
|
|
35
39
|
children
|
|
36
40
|
}) {
|
|
37
41
|
const resolved = preset ? RESPONSIVE_GRID_PRESET_COLUMNS[preset] : resolveColumns(columns);
|
|
38
|
-
return /* @__PURE__ */ jsx("div", { className: "ui-responsive-grid-scope", children: /* @__PURE__ */ jsx(
|
|
42
|
+
return /* @__PURE__ */ jsx("div", { className: "ui-responsive-grid-scope", children: /* @__PURE__ */ jsx(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: cn("ui-responsive-grid", className),
|
|
46
|
+
"data-gap": gap,
|
|
47
|
+
"data-flow": flow === "columns" ? "columns" : void 0,
|
|
48
|
+
style: { ...toStyle(resolved), ...padStyle(pad, padRaw) },
|
|
49
|
+
"data-pad-raw": padRaw === void 0 ? void 0 : "",
|
|
50
|
+
children
|
|
51
|
+
}
|
|
52
|
+
) });
|
|
39
53
|
}
|
|
54
|
+
function ResponsiveGridItem({
|
|
55
|
+
span = 1,
|
|
56
|
+
children,
|
|
57
|
+
className
|
|
58
|
+
}) {
|
|
59
|
+
const steps = typeof span === "number" ? { base: 1, sm: span, md: span, lg: span } : resolveColumns(span);
|
|
60
|
+
const style = Object.fromEntries(
|
|
61
|
+
Object.entries(steps).map(([step, value]) => [`--responsive-grid-item-${step}`, value])
|
|
62
|
+
);
|
|
63
|
+
return /* @__PURE__ */ jsx("div", { className: cn("ui-responsive-grid-item", className), style, children });
|
|
64
|
+
}
|
|
65
|
+
ResponsiveGrid.Item = ResponsiveGridItem;
|
|
40
66
|
export {
|
|
41
|
-
ResponsiveGrid
|
|
67
|
+
ResponsiveGrid,
|
|
68
|
+
ResponsiveGridItem
|
|
42
69
|
};
|
|
@@ -304,8 +304,9 @@ function Sidebar({
|
|
|
304
304
|
const resolvedSections = sections ?? [];
|
|
305
305
|
const surface = useNavSurface();
|
|
306
306
|
collapsed = surface === "drawer" ? false : collapsed;
|
|
307
|
+
const brandNode = typeof brand === "function" ? brand(collapsed) : brand;
|
|
307
308
|
return /* @__PURE__ */ jsxs("div", { className: "sb-root", "data-collapsed": collapsed ? "true" : void 0, children: [
|
|
308
|
-
brand !== void 0 ? /* @__PURE__ */ jsx(SidebarHeader, { children:
|
|
309
|
+
brand !== void 0 ? /* @__PURE__ */ jsx(SidebarHeader, { children: brandNode }) : product ? (() => {
|
|
309
310
|
const interactive = onProductClick != null;
|
|
310
311
|
const mark = /* @__PURE__ */ jsx(
|
|
311
312
|
"span",
|
|
@@ -11,6 +11,9 @@ export type { TopbarItemProp, TopbarItemProp as TopbarItemProps, } from "../../p
|
|
|
11
11
|
* file resolves, including nothing at all while the `--focus-outline` switch ships off.
|
|
12
12
|
*/
|
|
13
13
|
export declare const TopbarItem: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
14
|
+
hideBelow?: import("../../props/index.js").BreakpointProp;
|
|
15
|
+
badge?: React.ReactNode;
|
|
16
|
+
badgeTone?: import("../../props/components/layout.prop.js").SidebarBadgeToneProp;
|
|
14
17
|
asChild?: boolean;
|
|
15
18
|
children?: React.ReactNode;
|
|
16
19
|
className?: import("../../props/index.js").ClassNameProp;
|
|
@@ -1,17 +1,32 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Slot } from "../../lib/slot.js";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
-
const TopbarItem = React.forwardRef(function TopbarItem2({ asChild = false, className, type, ...props }, ref) {
|
|
5
|
+
const TopbarItem = React.forwardRef(function TopbarItem2({ asChild = false, className, type, hideBelow, badge, badgeTone, children, ...props }, ref) {
|
|
6
6
|
const Comp = asChild ? Slot : "button";
|
|
7
|
+
const showBadge = !asChild && badge !== void 0 && badge !== "";
|
|
8
|
+
const badgeNode = showBadge ? /* @__PURE__ */ jsx(
|
|
9
|
+
"span",
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "topbar-item-badge",
|
|
12
|
+
className: "ui-topbar-item-badge",
|
|
13
|
+
"data-tone": badgeTone === "destructive" ? "destructive" : void 0,
|
|
14
|
+
children: badge
|
|
15
|
+
}
|
|
16
|
+
) : null;
|
|
7
17
|
return /* @__PURE__ */ jsx(
|
|
8
18
|
Comp,
|
|
9
19
|
{
|
|
10
20
|
ref,
|
|
11
21
|
"data-slot": "topbar-item",
|
|
22
|
+
"data-hide-below": hideBelow,
|
|
12
23
|
className: cn("ui-topbar-item ui-focus-ring", className),
|
|
13
24
|
type: asChild ? void 0 : type ?? "button",
|
|
14
|
-
...props
|
|
25
|
+
...props,
|
|
26
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
+
children,
|
|
28
|
+
badgeNode
|
|
29
|
+
] })
|
|
15
30
|
}
|
|
16
31
|
);
|
|
17
32
|
});
|
|
@@ -4,4 +4,4 @@ export type { TopbarProp, TopbarProp as TopbarProps } from "../../props/componen
|
|
|
4
4
|
* Topbar — a PURE SLOT bar. It positions three clusters (`start` / `center` / `end`) and owns the
|
|
5
5
|
* bar's flex layout; it does NOT bake any chrome.
|
|
6
6
|
*/
|
|
7
|
-
export declare function Topbar({ start, center, end, className, children, ...props }: TopbarProp): import("react").JSX.Element;
|
|
7
|
+
export declare function Topbar({ start, center, end, className, children, height, pad, style, ...props }: TopbarProp): import("react").JSX.Element;
|
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { padStyle } from "../../lib/variants.js";
|
|
2
3
|
import { cn } from "../../lib/utils.js";
|
|
3
|
-
function Topbar({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
function Topbar({
|
|
5
|
+
start,
|
|
6
|
+
center,
|
|
7
|
+
end,
|
|
8
|
+
className,
|
|
9
|
+
children,
|
|
10
|
+
height,
|
|
11
|
+
pad,
|
|
12
|
+
style,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
"data-height": height,
|
|
19
|
+
style: { ...style, ...padStyle(pad, void 0) },
|
|
20
|
+
"data-slot": "topbar",
|
|
21
|
+
className: cn("ui-topbar", className),
|
|
22
|
+
...props,
|
|
23
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
start != null ? /* @__PURE__ */ jsx("div", { "data-slot": "topbar-start", className: "ui-topbar-start", children: start }) : null,
|
|
25
|
+
center != null ? /* @__PURE__ */ jsx("div", { "data-slot": "topbar-center", className: "ui-topbar-center", children: center }) : null,
|
|
26
|
+
end != null ? /* @__PURE__ */ jsx("div", { "data-slot": "topbar-end", className: "ui-topbar-end", children: end }) : null
|
|
27
|
+
] })
|
|
28
|
+
}
|
|
29
|
+
);
|
|
9
30
|
}
|
|
10
31
|
export {
|
|
11
32
|
Topbar
|