@godxjp/ui 19.6.0 → 20.1.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/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 +14 -3
- package/dist/components/data-display/card.js +22 -4
- package/dist/components/data-display/code-block.js +6 -2
- package/dist/components/data-display/collapsible.d.ts +23 -4
- package/dist/components/data-display/collapsible.js +119 -4
- 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 +5 -1
- package/dist/components/data-display/index.js +4 -0
- package/dist/components/data-display/legend.d.ts +15 -0
- package/dist/components/data-display/legend.js +11 -0
- package/dist/components/data-display/list-row.d.ts +10 -1
- package/dist/components/data-display/list-row.js +8 -2
- package/dist/components/data-display/popover.d.ts +60 -7
- package/dist/components/data-display/popover.js +268 -39
- package/dist/components/data-display/progress.d.ts +50 -2
- package/dist/components/data-display/progress.js +57 -9
- 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 +10 -10
- package/dist/components/data-display/table.d.ts +11 -3
- package/dist/components/data-display/table.js +48 -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 +79 -33
- package/dist/components/data-entry/cascader.d.ts +1 -1
- package/dist/components/data-entry/cascader.js +188 -24
- package/dist/components/data-entry/checkbox.d.ts +19 -6
- package/dist/components/data-entry/checkbox.js +55 -16
- package/dist/components/data-entry/choice-option.d.ts +1 -1
- 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 +2 -2
- package/dist/components/data-entry/date-range-picker.js +278 -140
- package/dist/components/data-entry/field.js +0 -1
- 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 +5 -3
- 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/label.d.ts +3 -2
- package/dist/components/data-entry/label.js +23 -10
- package/dist/components/data-entry/month-picker.d.ts +2 -2
- package/dist/components/data-entry/month-picker.js +47 -10
- package/dist/components/data-entry/month-range-picker.d.ts +2 -2
- 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 +99 -31
- package/dist/components/data-entry/tree-select-strategy.d.ts +1 -1
- package/dist/components/data-entry/tree-select.d.ts +1 -1
- package/dist/components/data-entry/tree-select.js +197 -92
- package/dist/components/data-entry/tree-utils.d.ts +1 -1
- 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 +482 -117
- package/dist/components/feedback/dialog.d.ts +105 -38
- package/dist/components/feedback/dialog.js +268 -193
- package/dist/components/feedback/overlay-close-focus.d.ts +31 -0
- package/dist/components/feedback/overlay-close-focus.js +31 -0
- package/dist/components/feedback/overlay-header-tone.d.ts +1 -1
- package/dist/components/feedback/sheet.d.ts +53 -11
- package/dist/components/feedback/sheet.js +150 -81
- package/dist/components/feedback/tooltip.d.ts +51 -7
- package/dist/components/feedback/tooltip.js +107 -25
- package/dist/components/general/button.d.ts +1 -1
- package/dist/components/general/button.js +7 -3
- package/dist/components/general/index.d.ts +1 -0
- package/dist/components/general/index.js +2 -0
- package/dist/components/general/logo.d.ts +17 -0
- package/dist/components/general/logo.js +22 -16
- 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 +228 -0
- package/dist/components/layout/app-shell.d.ts +3 -1
- package/dist/components/layout/app-shell.js +69 -12
- package/dist/components/layout/aspect-ratio.js +0 -1
- package/dist/components/layout/auth-divider.js +0 -1
- 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 +41 -3
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +5 -1
- package/dist/components/layout/nav-surface.d.ts +26 -0
- package/dist/components/layout/nav-surface.js +17 -0
- package/dist/components/layout/org-switcher.d.ts +5 -1
- package/dist/components/layout/org-switcher.js +25 -4
- 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/separator.js +0 -1
- package/dist/components/layout/sidebar.js +4 -1
- package/dist/components/layout/split-pane.d.ts +14 -1
- package/dist/components/layout/split-pane.js +26 -13
- package/dist/components/layout/topbar-item.d.ts +3 -0
- package/dist/components/layout/topbar-item.js +19 -5
- package/dist/components/layout/topbar.d.ts +1 -1
- package/dist/components/layout/topbar.js +27 -6
- package/dist/components/navigation/app-setting-picker.js +21 -2
- package/dist/components/navigation/app-setting-toggle.d.ts +16 -0
- package/dist/components/navigation/app-setting-toggle.js +96 -0
- package/dist/components/navigation/dropdown-menu.d.ts +227 -18
- package/dist/components/navigation/dropdown-menu.js +402 -118
- package/dist/components/navigation/index.d.ts +2 -0
- package/dist/components/navigation/index.js +2 -0
- package/dist/components/navigation/pagination-utils.d.ts +2 -1
- 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 +29 -16
- package/dist/components/navigation/tabs.js +374 -144
- package/dist/components/ui/accordion.d.ts +50 -5
- package/dist/components/ui/accordion.js +239 -33
- package/dist/components/ui/aspect-ratio.d.ts +23 -2
- package/dist/components/ui/aspect-ratio.js +15 -13
- package/dist/components/ui/avatar.d.ts +29 -4
- package/dist/components/ui/avatar.js +111 -25
- package/dist/components/ui/hover-card.d.ts +42 -4
- package/dist/components/ui/hover-card.js +183 -27
- package/dist/components/ui/input-otp.d.ts +26 -28
- package/dist/components/ui/input-otp.js +50 -7
- package/dist/components/ui/label.js +0 -1
- 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 +12 -3
- package/dist/components/ui/segmented.js +17 -2
- package/dist/components/ui/separator.d.ts +12 -2
- package/dist/components/ui/separator.js +30 -9
- package/dist/components/ui/tag-input.d.ts +45 -0
- package/dist/components/ui/tag-input.js +109 -27
- package/dist/components/ui/toggle-group.d.ts +50 -5
- package/dist/components/ui/toggle-group.js +79 -20
- package/dist/components/ui/toggle.d.ts +31 -5
- package/dist/components/ui/toggle.js +42 -3
- 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/messages/en.json +64 -5
- package/dist/i18n/messages/ja.json +64 -5
- package/dist/i18n/messages/vi.json +64 -5
- 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/slot.d.ts +32 -0
- package/dist/lib/slot.js +22 -0
- package/dist/lib/variants.d.ts +22 -3
- package/dist/lib/variants.js +56 -1
- package/dist/props/components/app.prop.d.ts +25 -1
- package/dist/props/components/charts.prop.d.ts +21 -0
- package/dist/props/components/data-display.prop.d.ts +72 -4
- package/dist/props/components/data-entry.prop.d.ts +718 -46
- package/dist/props/components/form.prop.d.ts +142 -4
- package/dist/props/components/general.prop.d.ts +17 -1
- package/dist/props/components/index.d.ts +3 -3
- package/dist/props/components/layout.prop.d.ts +281 -11
- package/dist/props/components/navigation.prop.d.ts +114 -4
- package/dist/props/registry.d.ts +397 -11
- package/dist/props/registry.js +526 -11
- package/dist/props/vocabulary/content.prop.d.ts +1 -1
- package/dist/props/vocabulary/data.prop.d.ts +179 -1
- package/dist/props/vocabulary/index.d.ts +5 -5
- package/dist/props/vocabulary/interaction.prop.d.ts +68 -3
- package/dist/props/vocabulary/layout.prop.d.ts +57 -1
- 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 +26 -4
- package/dist/styles/chart-layout.css +15 -0
- package/dist/styles/control.css +657 -15
- package/dist/styles/core.css +5 -2
- package/dist/styles/data-display-layout.css +313 -6
- package/dist/styles/data-entry-layout.css +13 -0
- package/dist/styles/focus-ring.css +4 -0
- package/dist/styles/index.css +5 -2
- package/dist/styles/layout.css +327 -4
- package/dist/styles/navigation-layout.css +227 -0
- package/dist/styles/shell-layout.css +369 -13
- package/dist/styles/table-layout.css +95 -6
- package/dist/styles/text-layout.css +10 -4
- package/dist/tokens/base.css +2 -1
- package/dist/tokens/components/badge.css +1 -0
- package/dist/tokens/components/chart.css +6 -0
- package/dist/tokens/components/control.css +79 -2
- package/dist/tokens/components/data-display.css +20 -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 +53 -3
- 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/COMPONENTS.md +9 -3
- package/docs/CONSUMER-RULES.md +13 -0
- package/docs/DESIGN-AUTHORITY.md +145 -83
- package/docs/DEVELOPMENT.md +4 -3
- package/docs/FORMS.md +151 -6
- package/docs/FRAME-COVERAGE-REPORT.md +32 -17
- package/docs/README.md +15 -15
- package/docs/STANDARDS-vocabulary-tokens.md +1 -1
- package/docs/TESTING.md +15 -6
- package/docs/WHAT-BELONGS-HERE.md +179 -0
- 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/legend.tsx +145 -0
- package/docs/data-display/progress.tsx +32 -0
- 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/segmented.tsx +1 -1
- package/docs/data-entry/select.tsx +29 -2
- 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/sheet.tsx +1 -1
- 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 +151 -0
- package/docs/layout/app-shell-arrangements.tsx +225 -0
- package/docs/layout/app-shell.tsx +11 -0
- package/docs/layout/aspect-ratio.tsx +1 -1
- 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 +37 -1
- package/docs/navigation/app-setting-toggle.tsx +111 -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/package.json +28 -8
- package/scripts/_agent-setup.mjs +182 -3
- package/scripts/consumer-rule.md +98 -0
- package/scripts/guinea-pig-skill.md +322 -0
- package/scripts/init-guinea-pig.mjs +84 -0
- package/scripts/postinstall.mjs +13 -2
- package/scripts/ui-audit.mjs +351 -37
- /package/dist/tokens/{antd.generated.css → derived.css} +0 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { AppShell, Flex, PageContainer, Sidebar, Topbar } from "@godxjp/ui/layout";
|
|
3
|
+
import type { SidebarSectionProp } from "@godxjp/ui/layout";
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
|
|
5
|
+
import { Button, Text } from "@godxjp/ui/general";
|
|
6
|
+
import {
|
|
7
|
+
Building2,
|
|
8
|
+
Hash,
|
|
9
|
+
LayoutDashboard,
|
|
10
|
+
MessagesSquare,
|
|
11
|
+
PanelLeftClose,
|
|
12
|
+
PanelLeftOpen,
|
|
13
|
+
Settings,
|
|
14
|
+
Users,
|
|
15
|
+
} from "lucide-react";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* AppShell · column arrangements.
|
|
19
|
+
*
|
|
20
|
+
* THE SHELL HAS TWO INDEPENDENT GEOMETRY AXES, and this page exists so they can be seen next to
|
|
21
|
+
* each other rather than rediscovered:
|
|
22
|
+
*
|
|
23
|
+
* - `topbarSpan` — how far the BAR reaches. "content" starts it beside the sidebar (the rail
|
|
24
|
+
* runs the full window height); "full" runs it edge to edge with the navigation beneath it.
|
|
25
|
+
* - `navRail` — how many navigation COLUMNS there are. Passing the slot adds a second,
|
|
26
|
+
* narrower track before the sidebar: the workspace/organization switcher shape.
|
|
27
|
+
*
|
|
28
|
+
* They are axes, not a preset list. All four combinations are real product shapes, so there is no
|
|
29
|
+
* invalid pairing and nothing to reconcile — which is why the rail is a SLOT and not a fourth
|
|
30
|
+
* value bolted onto `topbarSpan`.
|
|
31
|
+
*
|
|
32
|
+
* Composed only from real @godxjp/ui components.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
const WORKSPACE_RAIL: SidebarSectionProp[] = [
|
|
36
|
+
{
|
|
37
|
+
items: [
|
|
38
|
+
{ id: "home", label: "ホーム", icon: LayoutDashboard },
|
|
39
|
+
{ id: "chat", label: "チャット", icon: MessagesSquare },
|
|
40
|
+
{ id: "people", label: "メンバー", icon: Users },
|
|
41
|
+
{ id: "admin", label: "管理", icon: Settings },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const CHANNELS: SidebarSectionProp[] = [
|
|
47
|
+
{
|
|
48
|
+
label: "チャンネル",
|
|
49
|
+
items: [
|
|
50
|
+
{ id: "general", label: "general", icon: Hash },
|
|
51
|
+
{ id: "design", label: "design", icon: Hash },
|
|
52
|
+
{ id: "incident", label: "incident-2026", icon: Hash },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "ダイレクトメッセージ",
|
|
57
|
+
items: [
|
|
58
|
+
{ id: "dm-sato", label: "佐藤 花子", icon: Users },
|
|
59
|
+
{ id: "dm-tanaka", label: "田中 一郎", icon: Users },
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export default function Demo() {
|
|
65
|
+
const [withRail, setWithRail] = useState(true);
|
|
66
|
+
const [fullSpan, setFullSpan] = useState(false);
|
|
67
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
68
|
+
|
|
69
|
+
// The rail is ordinary navigation, so it is an ordinary <Sidebar> in icon-only mode — the shell
|
|
70
|
+
// owns the TRACK, never the content that goes in it.
|
|
71
|
+
const rail = (
|
|
72
|
+
<Sidebar aria-label="ワークスペース" activeId="chat" collapsed sections={WORKSPACE_RAIL} />
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<AppShell
|
|
77
|
+
topbarSpan={fullSpan ? "full" : "content"}
|
|
78
|
+
navRail={withRail ? rail : undefined}
|
|
79
|
+
navRailLabel="ワークスペース"
|
|
80
|
+
sidebarCollapsed={collapsed}
|
|
81
|
+
logo={
|
|
82
|
+
<Flex align="center" gap="sm">
|
|
83
|
+
<Building2 aria-hidden="true" />
|
|
84
|
+
<Text weight="medium">CoreChat</Text>
|
|
85
|
+
</Flex>
|
|
86
|
+
}
|
|
87
|
+
sidebar={
|
|
88
|
+
<Sidebar
|
|
89
|
+
aria-label="チャンネル"
|
|
90
|
+
activeId="general"
|
|
91
|
+
collapsed={collapsed}
|
|
92
|
+
sections={CHANNELS}
|
|
93
|
+
/>
|
|
94
|
+
}
|
|
95
|
+
topbar={
|
|
96
|
+
<Topbar
|
|
97
|
+
start={
|
|
98
|
+
<Button
|
|
99
|
+
size="sm"
|
|
100
|
+
variant="ghost"
|
|
101
|
+
aria-label={collapsed ? "サイドバーを開く" : "サイドバーを閉じる"}
|
|
102
|
+
aria-expanded={!collapsed}
|
|
103
|
+
onClick={() => setCollapsed((c) => !c)}
|
|
104
|
+
>
|
|
105
|
+
{collapsed ? (
|
|
106
|
+
<PanelLeftOpen aria-hidden="true" />
|
|
107
|
+
) : (
|
|
108
|
+
<PanelLeftClose aria-hidden="true" />
|
|
109
|
+
)}
|
|
110
|
+
</Button>
|
|
111
|
+
}
|
|
112
|
+
/>
|
|
113
|
+
}
|
|
114
|
+
>
|
|
115
|
+
<PageContainer
|
|
116
|
+
title="列の構成"
|
|
117
|
+
subtitle={`${withRail ? "3 列" : "2 列"} · topbarSpan="${fullSpan ? "full" : "content"}"${
|
|
118
|
+
collapsed ? " · 折りたたみ" : ""
|
|
119
|
+
}`}
|
|
120
|
+
extra={
|
|
121
|
+
<Flex gap="sm">
|
|
122
|
+
<Button
|
|
123
|
+
size="sm"
|
|
124
|
+
variant={withRail ? "default" : "outline"}
|
|
125
|
+
aria-pressed={withRail}
|
|
126
|
+
onClick={() => setWithRail((v) => !v)}
|
|
127
|
+
>
|
|
128
|
+
navRail
|
|
129
|
+
</Button>
|
|
130
|
+
<Button
|
|
131
|
+
size="sm"
|
|
132
|
+
variant={fullSpan ? "default" : "outline"}
|
|
133
|
+
aria-pressed={fullSpan}
|
|
134
|
+
onClick={() => setFullSpan((v) => !v)}
|
|
135
|
+
>
|
|
136
|
+
topbarSpan=full
|
|
137
|
+
</Button>
|
|
138
|
+
<Button
|
|
139
|
+
size="sm"
|
|
140
|
+
variant={collapsed ? "default" : "outline"}
|
|
141
|
+
aria-pressed={collapsed}
|
|
142
|
+
onClick={() => setCollapsed((v) => !v)}
|
|
143
|
+
>
|
|
144
|
+
折りたたみ
|
|
145
|
+
</Button>
|
|
146
|
+
</Flex>
|
|
147
|
+
}
|
|
148
|
+
>
|
|
149
|
+
<Flex direction="col" gap="lg">
|
|
150
|
+
<Card>
|
|
151
|
+
<CardHeader>
|
|
152
|
+
<CardTitle level={2}>2 本の軸は独立している</CardTitle>
|
|
153
|
+
<CardDescription>
|
|
154
|
+
上の 3 つのボタンは互いに干渉しない。<code>navRail</code> は「ナビゲーションの列が
|
|
155
|
+
何本か」を、<code>topbarSpan</code> は「バーがどこまで伸びるか」を答える別々の軸で、
|
|
156
|
+
4 通りの組み合わせはすべて実在するプロダクトの形なので、禁止すべき組み合わせは
|
|
157
|
+
存在しない。だから rail は <code>topbarSpan</code> に足した 4 つ目の値ではなく
|
|
158
|
+
スロットとして実装されている ― プリセット名を 4 つ覚える API にはしない。
|
|
159
|
+
</CardDescription>
|
|
160
|
+
<CardDescription>
|
|
161
|
+
列幅はすべてトークン。<code>--app-shell-nav-rail-width</code>(4rem)が rail、
|
|
162
|
+
<code>--app-shell-sidebar-width</code>(16rem)がサイドバー、
|
|
163
|
+
<code>--app-shell-sidebar-collapsed-width</code>(4rem)が折りたたみ時の
|
|
164
|
+
サイドバー。3 つ目は 19.x では <code>--app-shell-rail-width</code> という名前で、
|
|
165
|
+
20.0.0 で追加された本物の rail と正面衝突した ― 同じ 4rem、同じ「rail」の綴り、
|
|
166
|
+
意味は別物。エイリアスを残さず改名したのは、どちらの読み方でも
|
|
167
|
+
もっともらしい幅に解決してしまい、静かに壊れるため。
|
|
168
|
+
</CardDescription>
|
|
169
|
+
</CardHeader>
|
|
170
|
+
</Card>
|
|
171
|
+
|
|
172
|
+
<Card>
|
|
173
|
+
<CardHeader>
|
|
174
|
+
<CardTitle level={2}>折りたたみは 1 本の列だけを畳む</CardTitle>
|
|
175
|
+
<CardDescription>
|
|
176
|
+
「折りたたみ」を押すと、サイドバーの列だけが 16rem → 4rem になり、rail
|
|
177
|
+
は幅を保つ。Slack の挙動であり、折りたたみ中も rail
|
|
178
|
+
の行き先に手が届き続ける唯一の形。 rail まで一緒に畳むと、意味の分からない
|
|
179
|
+
アイコンの帯が 2 本並ぶだけになる。
|
|
180
|
+
</CardDescription>
|
|
181
|
+
</CardHeader>
|
|
182
|
+
<CardContent>
|
|
183
|
+
<Flex direction="col" gap="sm">
|
|
184
|
+
<Flex justify="between">
|
|
185
|
+
<Text tone="muted">rail</Text>
|
|
186
|
+
<Text mono>{withRail ? "4rem(固定)" : "—"}</Text>
|
|
187
|
+
</Flex>
|
|
188
|
+
<Flex justify="between">
|
|
189
|
+
<Text tone="muted">sidebar</Text>
|
|
190
|
+
<Text mono>{collapsed ? "4rem" : "16rem"}</Text>
|
|
191
|
+
</Flex>
|
|
192
|
+
<Flex justify="between">
|
|
193
|
+
<Text tone="muted">コンテンツ左端</Text>
|
|
194
|
+
<Text mono>
|
|
195
|
+
{withRail ? (collapsed ? "128px" : "320px") : collapsed ? "64px" : "256px"}
|
|
196
|
+
</Text>
|
|
197
|
+
</Flex>
|
|
198
|
+
</Flex>
|
|
199
|
+
</CardContent>
|
|
200
|
+
</Card>
|
|
201
|
+
|
|
202
|
+
<Card>
|
|
203
|
+
<CardHeader>
|
|
204
|
+
<CardTitle level={2}>900px 以下では両方の列が消える</CardTitle>
|
|
205
|
+
<CardDescription>
|
|
206
|
+
Frame の Dimensions を 900px 以下にすると、rail とサイドバーの両方が隠れ、
|
|
207
|
+
AppShell 所有のドロワーが navigation を引き受ける。 rail
|
|
208
|
+
を渡している場合、ドロワーの既定値は「rail のあとにサイドバー」になる ―
|
|
209
|
+
両方の列が隠れる幅で <code>sidebar</code> だけを既定にすると、rail
|
|
210
|
+
が運んでいるアプリ階層の行き先が 端末によって存在したりしなかったりする。
|
|
211
|
+
いくつかの画面幅にしか無いコントロールは、コントロールではなく罠。
|
|
212
|
+
</CardDescription>
|
|
213
|
+
<CardDescription>
|
|
214
|
+
グリッドのテンプレートから領域名が消えるだけでは要素は消えない ―
|
|
215
|
+
実測では、狭幅テンプレートを当てて <code>.app-sidebar</code> だけを隠した状態で
|
|
216
|
+
rail が暗黙の列に自動配置され、33×168px の断片としてページ本文の上に残った。
|
|
217
|
+
だから狭幅ブロックは rail を明示的に隠す。
|
|
218
|
+
</CardDescription>
|
|
219
|
+
</CardHeader>
|
|
220
|
+
</Card>
|
|
221
|
+
</Flex>
|
|
222
|
+
</PageContainer>
|
|
223
|
+
</AppShell>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
@@ -372,3 +372,14 @@ export default function Demo() {
|
|
|
372
372
|
</AppShell>
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
+
|
|
376
|
+
/** A dashboard keeps the canonical topbar and main area without a sidebar track. */
|
|
377
|
+
export function WithoutSidebar() {
|
|
378
|
+
return (
|
|
379
|
+
<AppShell topbar={<Topbar start={<Text>Workspace</Text>} />}>
|
|
380
|
+
<PageContainer title="Dashboard">
|
|
381
|
+
<Text>Project overview</Text>
|
|
382
|
+
</PageContainer>
|
|
383
|
+
</AppShell>
|
|
384
|
+
);
|
|
385
|
+
}
|
|
@@ -4,7 +4,7 @@ import { Skeleton } from "@godxjp/ui/feedback";
|
|
|
4
4
|
import { AspectRatio, Flex, PageContainer } from "@godxjp/ui/layout";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* AspectRatio ·
|
|
7
|
+
* AspectRatio · AspectRatio (thuộc tính CSS aspect-ratio, một node). Stabilises media/preview frames so
|
|
8
8
|
* they do not reflow during load. ratio = width / height (number). Children fill
|
|
9
9
|
* the constrained box · use object-fit: cover on images, width/height 100% on
|
|
10
10
|
* iframes and SVG charts. Do not use for unconstrained text content. Composed
|
package/docs/layout/flex.tsx
CHANGED
|
@@ -260,6 +260,56 @@ export default function Demo() {
|
|
|
260
260
|
</Flex>
|
|
261
261
|
</CardContent>
|
|
262
262
|
</Card>
|
|
263
|
+
|
|
264
|
+
<Card>
|
|
265
|
+
<CardHeader>
|
|
266
|
+
<CardTitle level={2}>レスポンシブな操作行</CardTitle>
|
|
267
|
+
</CardHeader>
|
|
268
|
+
<CardContent>
|
|
269
|
+
<Flex
|
|
270
|
+
id="responsive-actions"
|
|
271
|
+
direction={{ base: "col", lg: "row" }}
|
|
272
|
+
gap="md"
|
|
273
|
+
align="start"
|
|
274
|
+
>
|
|
275
|
+
<Flex fill>
|
|
276
|
+
<Text>画面幅に合わせて操作をまとめます。</Text>
|
|
277
|
+
</Flex>
|
|
278
|
+
<Button>保存</Button>
|
|
279
|
+
<Button variant="outline">キャンセル</Button>
|
|
280
|
+
</Flex>
|
|
281
|
+
</CardContent>
|
|
282
|
+
</Card>
|
|
283
|
+
<Card>
|
|
284
|
+
<CardHeader>
|
|
285
|
+
<CardTitle level={2}>軽い強調と行アクション</CardTitle>
|
|
286
|
+
</CardHeader>
|
|
287
|
+
<CardContent>
|
|
288
|
+
<Flex direction="col" gap="md">
|
|
289
|
+
<Flex id="hover-notice" surface="warning" pad={3} tabIndex={0}>
|
|
290
|
+
<Text>締切を確認してください。</Text>
|
|
291
|
+
<Flex reveal="hover" surface="popover" gap="xs" pad={1}>
|
|
292
|
+
<Button variant="ghost" size="sm">
|
|
293
|
+
編集
|
|
294
|
+
</Button>
|
|
295
|
+
<Button variant="ghost" size="sm">
|
|
296
|
+
解除
|
|
297
|
+
</Button>
|
|
298
|
+
</Flex>
|
|
299
|
+
</Flex>
|
|
300
|
+
<Flex as="ul" direction="col" gap="xs">
|
|
301
|
+
<li>添付ファイルを確認</li>
|
|
302
|
+
<li>担当者を選択</li>
|
|
303
|
+
</Flex>
|
|
304
|
+
<Flex surface="muted" pad={{ block: 2, inline: 3 }}>
|
|
305
|
+
<Text as="code" chip decoration="line-through">
|
|
306
|
+
old_status
|
|
307
|
+
</Text>
|
|
308
|
+
<Text>更新済み</Text>
|
|
309
|
+
</Flex>
|
|
310
|
+
</Flex>
|
|
311
|
+
</CardContent>
|
|
312
|
+
</Card>
|
|
263
313
|
</Flex>
|
|
264
314
|
</PageContainer>
|
|
265
315
|
);
|
|
@@ -217,7 +217,7 @@ export default function Demo() {
|
|
|
217
217
|
<CardDescription>
|
|
218
218
|
名前付きコレクション geometry: コンテナ幅が lg ステップ(64rem)に達するまでは 1
|
|
219
219
|
列、そこから 3 列に切り替わる。ResponsiveGrid には lg
|
|
220
|
-
より上のステップが無いため、1024px 相当でも 1440px 相当でも同じ 3 列になる
|
|
220
|
+
より上のステップが無いため、1024px 相当でも 1440px 相当でも同じ 3 列になる ·
|
|
221
221
|
課金プランカタログの「3/3/1」契約 (dxs-platform/platform#333)。`columns` の代わりに
|
|
222
222
|
`preset` を渡すだけで、呼び出し側がブレークポイント値を自作する必要がない。
|
|
223
223
|
</CardDescription>
|
|
@@ -254,6 +254,26 @@ export default function Demo() {
|
|
|
254
254
|
</ResponsiveGrid>
|
|
255
255
|
</CardContent>
|
|
256
256
|
</Card>
|
|
257
|
+
|
|
258
|
+
<Card>
|
|
259
|
+
<CardHeader>
|
|
260
|
+
<CardTitle level={2}>一覧と補助情報 2:1</CardTitle>
|
|
261
|
+
</CardHeader>
|
|
262
|
+
<CardContent>
|
|
263
|
+
<ResponsiveGrid columns={{ base: 1, lg: 3 }} pad={{ block: 2 }}>
|
|
264
|
+
<ResponsiveGrid.Item span={{ base: 1, lg: 2 }}>
|
|
265
|
+
<Flex id="grid-main" surface="muted" pad={3}>
|
|
266
|
+
<Text>メインの一覧</Text>
|
|
267
|
+
</Flex>
|
|
268
|
+
</ResponsiveGrid.Item>
|
|
269
|
+
<ResponsiveGrid.Item>
|
|
270
|
+
<Flex id="grid-rail" surface="muted" pad={3}>
|
|
271
|
+
<Text>補助情報</Text>
|
|
272
|
+
</Flex>
|
|
273
|
+
</ResponsiveGrid.Item>
|
|
274
|
+
</ResponsiveGrid>
|
|
275
|
+
</CardContent>
|
|
276
|
+
</Card>
|
|
257
277
|
</Flex>
|
|
258
278
|
</PageContainer>
|
|
259
279
|
);
|
package/docs/layout/topbar.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
|
-
import { AppShell, Flex, PageContainer, Sidebar, Topbar } from "@godxjp/ui/layout";
|
|
2
|
+
import { AppShell, Flex, PageContainer, Sidebar, Topbar, TopbarItem } from "@godxjp/ui/layout";
|
|
3
3
|
import type { SidebarSectionProp } from "@godxjp/ui/layout";
|
|
4
4
|
import {
|
|
5
5
|
Avatar,
|
|
@@ -154,18 +154,14 @@ export default function Demo() {
|
|
|
154
154
|
<Badge tone="warning" className="text-xs">
|
|
155
155
|
ステージング
|
|
156
156
|
</Badge>
|
|
157
|
-
<
|
|
158
|
-
variant="ghost"
|
|
159
|
-
size="icon-sm"
|
|
157
|
+
<TopbarItem
|
|
160
158
|
aria-label="通知"
|
|
161
|
-
|
|
159
|
+
badge={unread ? 12 : undefined}
|
|
160
|
+
badgeTone="destructive"
|
|
162
161
|
onClick={() => setUnread(false)}
|
|
163
162
|
>
|
|
164
163
|
<Bell />
|
|
165
|
-
|
|
166
|
-
<span className="bg-destructive absolute end-1.5 top-1.5 size-1.5 rounded-full" />
|
|
167
|
-
) : null}
|
|
168
|
-
</Button>
|
|
164
|
+
</TopbarItem>
|
|
169
165
|
<DropdownMenu>
|
|
170
166
|
<DropdownMenuTrigger asChild>
|
|
171
167
|
<Button variant="ghost" size="icon-sm" aria-label="アカウントメニュー">
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
CardTitle,
|
|
10
10
|
} from "@godxjp/ui/data-display";
|
|
11
11
|
import { Text } from "@godxjp/ui/general";
|
|
12
|
-
import { Flex, PageContainer, Topbar } from "@godxjp/ui/layout";
|
|
12
|
+
import { Flex, PageContainer, Topbar, TopbarItem } from "@godxjp/ui/layout";
|
|
13
13
|
import { AppSettingPicker } from "@godxjp/ui/navigation";
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -33,6 +33,17 @@ export default function Demo() {
|
|
|
33
33
|
subtitle="kind で 1 つの AppProvider 設定を読み書きする統合ピッカー"
|
|
34
34
|
>
|
|
35
35
|
<Flex direction="col" gap="lg">
|
|
36
|
+
<Card>
|
|
37
|
+
<CardHeader>
|
|
38
|
+
<CardTitle level={2}>インライン表示</CardTitle>
|
|
39
|
+
</CardHeader>
|
|
40
|
+
<CardContent>
|
|
41
|
+
<Flex gap="md" align="center">
|
|
42
|
+
<Text>表示言語</Text>
|
|
43
|
+
<AppSettingPicker kind="locale" appearance="inline" id="setting-inline" />
|
|
44
|
+
</Flex>
|
|
45
|
+
</CardContent>
|
|
46
|
+
</Card>
|
|
36
47
|
<Card>
|
|
37
48
|
<CardHeader>
|
|
38
49
|
<CardTitle level={2}>kind で対象設定を選ぶ</CardTitle>
|
|
@@ -123,6 +134,31 @@ export default function Demo() {
|
|
|
123
134
|
</CardContent>
|
|
124
135
|
</Card>
|
|
125
136
|
|
|
137
|
+
<Card>
|
|
138
|
+
<CardHeader>
|
|
139
|
+
<CardTitle level={2}>バーのセル(appearance="bar")</CardTitle>
|
|
140
|
+
<CardDescription>
|
|
141
|
+
<code>icon</code> と同じ構造上の省略を保ったまま、箱だけがバーの
|
|
142
|
+
<strong>セル</strong>になる。バーの高さいっぱいに伸び、角は
|
|
143
|
+
<code>--topbar-item-radius</code>(<code>TopbarItem</code> と同じつまみ)で四角い。
|
|
144
|
+
ホバーの面はバーそのものを塗る。
|
|
145
|
+
<code>icon</code> をバーに置くと <code>--control-height</code>
|
|
146
|
+
の丸い錠剤が背の高い帯の中に浮き、バー本来のクロームとは別系統に読める。
|
|
147
|
+
</CardDescription>
|
|
148
|
+
</CardHeader>
|
|
149
|
+
<CardContent>
|
|
150
|
+
<Topbar
|
|
151
|
+
start={<TopbarItem>プロジェクト</TopbarItem>}
|
|
152
|
+
end={
|
|
153
|
+
<>
|
|
154
|
+
<AppSettingPicker kind="locale" appearance="bar" id="topbar-locale-bar" />
|
|
155
|
+
<AppSettingPicker kind="theme" appearance="bar" id="topbar-theme-bar" />
|
|
156
|
+
</>
|
|
157
|
+
}
|
|
158
|
+
/>
|
|
159
|
+
</CardContent>
|
|
160
|
+
</Card>
|
|
161
|
+
|
|
126
162
|
<Card>
|
|
127
163
|
<CardHeader>
|
|
128
164
|
<CardTitle level={2}>無効化</CardTitle>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { AppProvider } from "@godxjp/ui/app";
|
|
2
|
+
import {
|
|
3
|
+
Avatar,
|
|
4
|
+
AvatarFallback,
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardDescription,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
} from "@godxjp/ui/data-display";
|
|
11
|
+
import { Text } from "@godxjp/ui/general";
|
|
12
|
+
import { Flex, PageContainer, Topbar } from "@godxjp/ui/layout";
|
|
13
|
+
import { AppSettingToggle } from "@godxjp/ui/navigation";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* AppSettingToggle — ONE button that steps a single AppProvider setting to its next value and
|
|
17
|
+
* shows that value as its glyph. The no-menu counterpart to AppSettingPicker: same binding
|
|
18
|
+
* contract, same option order, one tap instead of open-then-choose. `appearance="bar"` (the
|
|
19
|
+
* default) is a CELL of the bar — full bar height, the bar's own hover surface, square corners.
|
|
20
|
+
*/
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<AppProvider defaultLocale="ja" defaultTimeFormat="24h" persist={false}>
|
|
24
|
+
<PageContainer
|
|
25
|
+
title="AppSettingToggle"
|
|
26
|
+
subtitle="押すたびに次の値へ送る 1 ボタン。ドロップダウンなし。"
|
|
27
|
+
>
|
|
28
|
+
<Flex direction="col" gap="lg">
|
|
29
|
+
<Card>
|
|
30
|
+
<CardHeader>
|
|
31
|
+
<CardTitle level={2}>トップバーのセル(既定)</CardTitle>
|
|
32
|
+
<CardDescription>
|
|
33
|
+
appearance="bar" はバーの一部として全高で伸び、角は
|
|
34
|
+
--topbar-item-radius。--control-height の錠剤がバーの中に浮くことはない。
|
|
35
|
+
</CardDescription>
|
|
36
|
+
</CardHeader>
|
|
37
|
+
<CardContent>
|
|
38
|
+
<Topbar
|
|
39
|
+
start={
|
|
40
|
+
<Avatar className="rounded-md">
|
|
41
|
+
<AvatarFallback>G</AvatarFallback>
|
|
42
|
+
</Avatar>
|
|
43
|
+
}
|
|
44
|
+
end={
|
|
45
|
+
<>
|
|
46
|
+
<AppSettingToggle kind="theme" id="topbar-theme-toggle" />
|
|
47
|
+
<AppSettingToggle kind="density" id="topbar-density-toggle" />
|
|
48
|
+
<AppSettingToggle kind="fontSize" id="topbar-font-size-toggle" />
|
|
49
|
+
<AppSettingToggle kind="timeFormat" id="topbar-time-format-toggle" />
|
|
50
|
+
</>
|
|
51
|
+
}
|
|
52
|
+
/>
|
|
53
|
+
</CardContent>
|
|
54
|
+
</Card>
|
|
55
|
+
|
|
56
|
+
<Card>
|
|
57
|
+
<CardHeader>
|
|
58
|
+
<CardTitle level={2}>バー以外(appearance="icon")</CardTitle>
|
|
59
|
+
<CardDescription>
|
|
60
|
+
設定行やカードヘッダーなど、バーではない場所。--control-height
|
|
61
|
+
の正方形ゴーストボタン。
|
|
62
|
+
</CardDescription>
|
|
63
|
+
</CardHeader>
|
|
64
|
+
<CardContent>
|
|
65
|
+
<Flex direction="row" gap="md" align="center" wrap>
|
|
66
|
+
<Flex direction="row" gap="sm" align="center">
|
|
67
|
+
<Text weight="medium">テーマ</Text>
|
|
68
|
+
<AppSettingToggle kind="theme" appearance="icon" id="icon-theme-toggle" />
|
|
69
|
+
</Flex>
|
|
70
|
+
<Flex direction="row" gap="sm" align="center">
|
|
71
|
+
<Text weight="medium">時刻形式</Text>
|
|
72
|
+
<AppSettingToggle
|
|
73
|
+
kind="timeFormat"
|
|
74
|
+
appearance="icon"
|
|
75
|
+
id="icon-time-format-toggle"
|
|
76
|
+
/>
|
|
77
|
+
</Flex>
|
|
78
|
+
</Flex>
|
|
79
|
+
</CardContent>
|
|
80
|
+
</Card>
|
|
81
|
+
|
|
82
|
+
<Card>
|
|
83
|
+
<CardHeader>
|
|
84
|
+
<CardTitle level={2}>制御モードと無効化</CardTitle>
|
|
85
|
+
<CardDescription>
|
|
86
|
+
value + onValueChange で外部状態に紐づけ、disabled で操作を止める。
|
|
87
|
+
</CardDescription>
|
|
88
|
+
</CardHeader>
|
|
89
|
+
<CardContent>
|
|
90
|
+
<Flex direction="row" gap="md" align="center">
|
|
91
|
+
<AppSettingToggle
|
|
92
|
+
kind="density"
|
|
93
|
+
appearance="icon"
|
|
94
|
+
value="comfortable"
|
|
95
|
+
onValueChange={() => {}}
|
|
96
|
+
id="controlled-density-toggle"
|
|
97
|
+
/>
|
|
98
|
+
<AppSettingToggle
|
|
99
|
+
kind="theme"
|
|
100
|
+
appearance="icon"
|
|
101
|
+
disabled
|
|
102
|
+
id="disabled-theme-toggle"
|
|
103
|
+
/>
|
|
104
|
+
</Flex>
|
|
105
|
+
</CardContent>
|
|
106
|
+
</Card>
|
|
107
|
+
</Flex>
|
|
108
|
+
</PageContainer>
|
|
109
|
+
</AppProvider>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
@@ -129,6 +129,54 @@ export default function Demo() {
|
|
|
129
129
|
</Flex>
|
|
130
130
|
</CardContent>
|
|
131
131
|
</Card>
|
|
132
|
+
|
|
133
|
+
{/* Ant Design parity surface — separator / itemRender / item menu */}
|
|
134
|
+
<Card>
|
|
135
|
+
<CardHeader>
|
|
136
|
+
<CardTitle level={2}>separator · itemRender · menu (Ant Design パリティ)</CardTitle>
|
|
137
|
+
<CardDescription>
|
|
138
|
+
separator は既定のシェブロンを任意のノードに置き換える(空文字で消える)。常に
|
|
139
|
+
aria-hidden なので、読み上げは ol / li の構造のまま。menu は antd の
|
|
140
|
+
BreadcrumbItemType.menu で、その区切りを兄弟切り替えのメニューボタンにする
|
|
141
|
+
(パス付きエントリは role="menuitem" を保ったまま本物のアンカーになる)。
|
|
142
|
+
</CardDescription>
|
|
143
|
+
</CardHeader>
|
|
144
|
+
<CardContent>
|
|
145
|
+
<Flex direction="col" gap="sm">
|
|
146
|
+
<div id="antd-breadcrumb-slash">
|
|
147
|
+
<Breadcrumb
|
|
148
|
+
ariaLabel="区切り文字のパンくず"
|
|
149
|
+
separator="/"
|
|
150
|
+
items={[
|
|
151
|
+
{ label: "ホーム", to: "/" },
|
|
152
|
+
{ label: "会員管理", to: "/members" },
|
|
153
|
+
{ label: "田中 太郎" },
|
|
154
|
+
]}
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
157
|
+
<div id="antd-breadcrumb-menu">
|
|
158
|
+
<Breadcrumb
|
|
159
|
+
ariaLabel="プロジェクト切替のパンくず"
|
|
160
|
+
items={[
|
|
161
|
+
{ label: "ホーム", to: "/" },
|
|
162
|
+
{
|
|
163
|
+
label: "プロジェクト A",
|
|
164
|
+
to: "/p/a",
|
|
165
|
+
menu: {
|
|
166
|
+
items: [
|
|
167
|
+
{ value: "b", label: "プロジェクト B", to: "/p/b" },
|
|
168
|
+
{ value: "c", label: "プロジェクト C", to: "/p/c" },
|
|
169
|
+
{ value: "d", label: "プロジェクト D (準備中)", disabled: true },
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{ label: "設定" },
|
|
174
|
+
]}
|
|
175
|
+
/>
|
|
176
|
+
</div>
|
|
177
|
+
</Flex>
|
|
178
|
+
</CardContent>
|
|
179
|
+
</Card>
|
|
132
180
|
</Flex>
|
|
133
181
|
</PageContainer>
|
|
134
182
|
);
|
|
@@ -37,6 +37,27 @@ export default function Demo() {
|
|
|
37
37
|
subtitle="Radix dropdown · Trigger asChild + Content + Item/Separator/Sub"
|
|
38
38
|
>
|
|
39
39
|
<Flex direction="col" gap="lg">
|
|
40
|
+
<Card>
|
|
41
|
+
<CardHeader>
|
|
42
|
+
<CardTitle level={2}>メニュー幅</CardTitle>
|
|
43
|
+
</CardHeader>
|
|
44
|
+
<CardContent>
|
|
45
|
+
<Flex wrap gap="md">
|
|
46
|
+
{(["auto", "trigger", "sm", "md", "lg"] as const).map((width) => (
|
|
47
|
+
<DropdownMenu key={width}>
|
|
48
|
+
<DropdownMenuTrigger asChild>
|
|
49
|
+
<Button id={`menu-width-${width}`} variant="outline">
|
|
50
|
+
{width}
|
|
51
|
+
</Button>
|
|
52
|
+
</DropdownMenuTrigger>
|
|
53
|
+
<DropdownMenuContent width={width}>
|
|
54
|
+
<DropdownMenuItem>編集</DropdownMenuItem>
|
|
55
|
+
</DropdownMenuContent>
|
|
56
|
+
</DropdownMenu>
|
|
57
|
+
))}
|
|
58
|
+
</Flex>
|
|
59
|
+
</CardContent>
|
|
60
|
+
</Card>
|
|
40
61
|
{/* Row action menu — the most common use */}
|
|
41
62
|
<Card>
|
|
42
63
|
<CardHeader>
|