@beehexa/design-rules 2611.5.5 → 2611.8.1
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 +1 -1
- package/dist/AGENTS.md +1 -1
- package/dist/catalog.json +3053 -777
- package/dist/docs/public/_redirects +2 -2
- package/dist/docs/public/r/action-bar.json +26 -0
- package/dist/docs/public/r/beehexa-theme.json +18 -0
- package/dist/docs/public/r/button-group.json +26 -0
- package/dist/docs/public/r/button.json +28 -0
- package/dist/docs/public/r/copy-button.json +26 -0
- package/dist/docs/public/r/dropdown-menu.json +56 -0
- package/dist/docs/public/r/index.json +66 -0
- package/dist/docs/public/r/segmented-control.json +31 -0
- package/dist/docs/public/r/toggle.json +26 -0
- package/dist/docs/public/r/toolbar.json +46 -0
- package/dist/docs/public/r/tooltip.json +41 -0
- package/dist/docs/scripts/color-pairs.mjs +2 -0
- package/dist/docs/src/components/ChildPages.astro +8 -1
- package/dist/docs/src/components/CodeExample.astro +123 -6
- package/dist/docs/src/components/ColorDemo.astro +21 -18
- package/dist/docs/src/components/ComponentTabs.astro +1 -1
- package/dist/docs/src/components/DocsFooter.astro +1 -1
- package/dist/docs/src/components/ElevationDemo.astro +2 -2
- package/dist/docs/src/components/HelpOptions.astro +8 -6
- package/dist/docs/src/components/IconBrowser.astro +2 -2
- package/dist/docs/src/components/LayoutDemo.astro +178 -99
- package/dist/docs/src/components/NativeControlsDemo.astro +169 -44
- package/dist/docs/src/components/NativeFlowDemo.astro +206 -0
- package/dist/docs/src/components/PhaseTable.astro +9 -5
- package/dist/docs/src/components/RoleGuides.astro +30 -22
- package/dist/docs/src/components/RuleDemo.astro +111 -0
- package/dist/docs/src/components/ShapeDemo.astro +25 -37
- package/dist/docs/src/components/SiteHeader.astro +1 -1
- package/dist/docs/src/components/SpacingDemo.astro +5 -3
- package/dist/docs/src/components/SwitchToggle.astro +13 -0
- package/dist/docs/src/components/SystemAreas.astro +9 -6
- package/dist/docs/src/components/TableOfContents.astro +1 -1
- package/dist/docs/src/components/TokenSearch.astro +64 -0
- package/dist/docs/src/components/TokenTable.astro +14 -9
- package/dist/docs/src/components/TypeDemo.astro +1 -1
- package/dist/docs/src/components/logos/LogoClearSpace.astro +1 -1
- package/dist/docs/src/content/components/action-bar/accessibility.mdx +32 -0
- package/dist/docs/src/content/components/action-bar/changelog.mdx +7 -0
- package/dist/docs/src/content/components/action-bar/code.mdx +69 -0
- package/dist/docs/src/content/components/action-bar/examples.mdx +16 -0
- package/dist/docs/src/content/components/action-bar/meta.json +9 -0
- package/dist/docs/src/content/components/action-bar/style.mdx +13 -0
- package/dist/docs/src/content/components/action-bar/usage.mdx +35 -0
- package/dist/docs/src/content/components/button/accessibility.mdx +10 -5
- package/dist/docs/src/content/components/button/changelog.mdx +26 -1
- package/dist/docs/src/content/components/button/code.mdx +130 -25
- package/dist/docs/src/content/components/button/examples.mdx +109 -23
- package/dist/docs/src/content/components/button/meta.json +5 -1
- package/dist/docs/src/content/components/button/style.mdx +72 -0
- package/dist/docs/src/content/components/button/usage.mdx +118 -29
- package/dist/docs/src/content/components/button-group/accessibility.mdx +32 -0
- package/dist/docs/src/content/components/button-group/changelog.mdx +7 -0
- package/dist/docs/src/content/components/button-group/code.mdx +39 -0
- package/dist/docs/src/content/components/button-group/examples.mdx +36 -0
- package/dist/docs/src/content/components/button-group/meta.json +9 -0
- package/dist/docs/src/content/components/button-group/style.mdx +12 -0
- package/dist/docs/src/content/components/button-group/usage.mdx +31 -0
- package/dist/docs/src/content/components/icon-button/accessibility.mdx +35 -0
- package/dist/docs/src/content/components/icon-button/changelog.mdx +7 -0
- package/dist/docs/src/content/components/icon-button/code.mdx +66 -0
- package/dist/docs/src/content/components/icon-button/examples.mdx +46 -0
- package/dist/docs/src/content/components/icon-button/meta.json +9 -0
- package/dist/docs/src/content/components/icon-button/style.mdx +13 -0
- package/dist/docs/src/content/components/icon-button/usage.mdx +42 -0
- package/dist/docs/src/content/components/menu-button/accessibility.mdx +36 -0
- package/dist/docs/src/content/components/menu-button/changelog.mdx +7 -0
- package/dist/docs/src/content/components/menu-button/code.mdx +55 -0
- package/dist/docs/src/content/components/menu-button/examples.mdx +26 -0
- package/dist/docs/src/content/components/menu-button/meta.json +9 -0
- package/dist/docs/src/content/components/menu-button/style.mdx +15 -0
- package/dist/docs/src/content/components/menu-button/usage.mdx +44 -0
- package/dist/docs/src/content/components/resizable-panel/meta.json +5 -1
- package/dist/docs/src/content/{foundations/styles/scrollbars.mdx → components/scrollbar/code.mdx} +20 -39
- package/dist/docs/src/content/components/scrollbar/meta.json +9 -0
- package/dist/docs/src/content/components/scrollbar/usage.mdx +36 -0
- package/dist/docs/src/content/components/segmented-control/accessibility.mdx +32 -0
- package/dist/docs/src/content/components/segmented-control/changelog.mdx +7 -0
- package/dist/docs/src/content/components/segmented-control/code.mdx +46 -0
- package/dist/docs/src/content/components/segmented-control/examples.mdx +26 -0
- package/dist/docs/src/content/components/segmented-control/meta.json +9 -0
- package/dist/docs/src/content/components/segmented-control/style.mdx +13 -0
- package/dist/docs/src/content/components/segmented-control/usage.mdx +38 -0
- package/dist/docs/src/content/components/split-button/accessibility.mdx +32 -0
- package/dist/docs/src/content/components/split-button/changelog.mdx +7 -0
- package/dist/docs/src/content/components/split-button/code.mdx +57 -0
- package/dist/docs/src/content/components/split-button/examples.mdx +26 -0
- package/dist/docs/src/content/components/split-button/meta.json +9 -0
- package/dist/docs/src/content/components/split-button/style.mdx +12 -0
- package/dist/docs/src/content/components/split-button/usage.mdx +28 -0
- package/dist/docs/src/content/components/switch/accessibility.mdx +28 -0
- package/dist/docs/src/content/components/switch/examples.mdx +35 -0
- package/dist/docs/src/content/components/switch/meta.json +9 -0
- package/dist/docs/src/content/components/switch/usage.mdx +44 -0
- package/dist/docs/src/content/components/toggle-button/accessibility.mdx +31 -0
- package/dist/docs/src/content/components/toggle-button/changelog.mdx +7 -0
- package/dist/docs/src/content/components/toggle-button/code.mdx +45 -0
- package/dist/docs/src/content/components/toggle-button/examples.mdx +36 -0
- package/dist/docs/src/content/components/toggle-button/meta.json +9 -0
- package/dist/docs/src/content/components/toggle-button/style.mdx +11 -0
- package/dist/docs/src/content/components/toggle-button/usage.mdx +33 -0
- package/dist/docs/src/content/components/toolbar/accessibility.mdx +33 -0
- package/dist/docs/src/content/components/toolbar/changelog.mdx +7 -0
- package/dist/docs/src/content/components/toolbar/code.mdx +81 -0
- package/dist/docs/src/content/components/toolbar/examples.mdx +16 -0
- package/dist/docs/src/content/components/toolbar/meta.json +9 -0
- package/dist/docs/src/content/components/toolbar/style.mdx +12 -0
- package/dist/docs/src/content/components/toolbar/usage.mdx +36 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/statement.mdx +4 -2
- package/dist/docs/src/content/foundations/guidelines/accessibility/testing.mdx +1 -1
- package/dist/docs/src/content/foundations/guidelines/content/messages.mdx +67 -0
- package/dist/docs/src/content/foundations/guidelines/content/numbers-dates-and-currency.mdx +72 -0
- package/dist/docs/src/content/foundations/guidelines/content/style-and-grammar.mdx +92 -0
- package/dist/docs/src/content/foundations/guidelines/content/terms.mdx +57 -0
- package/dist/docs/src/content/foundations/guidelines/content/voice-and-tone.mdx +48 -0
- package/dist/docs/src/content/foundations/guidelines/content.mdx +22 -17
- package/dist/docs/src/content/foundations/styles/border.mdx +1 -6
- package/dist/docs/src/content/foundations/styles/color/dark-mode.mdx +66 -6
- package/dist/docs/src/content/foundations/styles/color/usage.mdx +5 -5
- package/dist/docs/src/content/foundations/styles/data-visualization.mdx +2 -78
- package/dist/docs/src/content/foundations/styles/elevation.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/icons/code.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/icons/library.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/icons/usage.mdx +0 -3
- package/dist/docs/src/content/foundations/styles/interaction-states.mdx +13 -69
- package/dist/docs/src/content/foundations/styles/layout/app-frame.mdx +4 -9
- package/dist/docs/src/content/foundations/styles/layout/grid.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/layout/overlays.mdx +3 -0
- package/dist/docs/src/content/foundations/styles/logos/downloads-and-terms.mdx +3 -3
- package/dist/docs/src/content/foundations/styles/logos/using-the-logo.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/motion.mdx +3 -1
- package/dist/docs/src/content/foundations/styles/radius.mdx +32 -28
- package/dist/docs/src/content/foundations/styles/size-and-density.mdx +7 -6
- package/dist/docs/src/content/foundations/styles/spacing.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/typography/code.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/typography/usage.mdx +7 -0
- package/dist/docs/src/content/foundations/styles/z-index.mdx +3 -16
- package/dist/docs/src/content/foundations/tokens/all-tokens.mdx +51 -2
- package/dist/docs/src/content/foundations/tokens/index.mdx +91 -6
- package/dist/docs/src/content/get-started/content.mdx +25 -3
- package/dist/docs/src/content/get-started/design.mdx +34 -15
- package/dist/docs/src/content/get-started/develop.mdx +83 -28
- package/dist/docs/src/content/get-started/get-help.mdx +21 -5
- package/dist/docs/src/content/get-started/index.mdx +11 -12
- package/dist/docs/src/content/tools/ant-design-vue-theme.mdx +176 -48
- package/dist/docs/src/content/tools/application-content.mdx +52 -13
- package/dist/docs/src/content/tools/editors.mdx +36 -28
- package/dist/docs/src/content/tools/mermaid.mdx +42 -9
- package/dist/docs/src/content/tools/vueflow.mdx +199 -60
- package/dist/docs/src/content-vi/components/action-bar/accessibility.mdx +32 -0
- package/dist/docs/src/content-vi/components/action-bar/changelog.mdx +7 -0
- package/dist/docs/src/content-vi/components/action-bar/code.mdx +69 -0
- package/dist/docs/src/content-vi/components/action-bar/examples.mdx +16 -0
- package/dist/docs/src/content-vi/components/action-bar/style.mdx +13 -0
- package/dist/docs/src/content-vi/components/action-bar/usage.mdx +35 -0
- package/dist/docs/src/content-vi/components/button/accessibility.mdx +56 -0
- package/dist/docs/src/content-vi/components/button/changelog.mdx +31 -0
- package/dist/docs/src/content-vi/components/button/code.mdx +139 -0
- package/dist/docs/src/content-vi/components/button/examples.mdx +126 -0
- package/dist/docs/src/content-vi/components/button/style.mdx +72 -0
- package/dist/docs/src/content-vi/components/button/usage.mdx +133 -0
- package/dist/docs/src/content-vi/components/button-group/accessibility.mdx +32 -0
- package/dist/docs/src/content-vi/components/button-group/changelog.mdx +7 -0
- package/dist/docs/src/content-vi/components/button-group/code.mdx +39 -0
- package/dist/docs/src/content-vi/components/button-group/examples.mdx +36 -0
- package/dist/docs/src/content-vi/components/button-group/style.mdx +12 -0
- package/dist/docs/src/content-vi/components/button-group/usage.mdx +31 -0
- package/dist/docs/src/content-vi/components/icon-button/accessibility.mdx +35 -0
- package/dist/docs/src/content-vi/components/icon-button/changelog.mdx +7 -0
- package/dist/docs/src/content-vi/components/icon-button/code.mdx +66 -0
- package/dist/docs/src/content-vi/components/icon-button/examples.mdx +46 -0
- package/dist/docs/src/content-vi/components/icon-button/style.mdx +13 -0
- package/dist/docs/src/content-vi/components/icon-button/usage.mdx +42 -0
- package/dist/docs/src/content-vi/components/menu-button/accessibility.mdx +36 -0
- package/dist/docs/src/content-vi/components/menu-button/changelog.mdx +7 -0
- package/dist/docs/src/content-vi/components/menu-button/code.mdx +55 -0
- package/dist/docs/src/content-vi/components/menu-button/examples.mdx +26 -0
- package/dist/docs/src/content-vi/components/menu-button/style.mdx +15 -0
- package/dist/docs/src/content-vi/components/menu-button/usage.mdx +44 -0
- package/dist/docs/src/content-vi/components/resizable-panel/accessibility.mdx +58 -0
- package/dist/docs/src/content-vi/components/resizable-panel/changelog.mdx +20 -0
- package/dist/docs/src/content-vi/components/resizable-panel/code.mdx +78 -0
- package/dist/docs/src/content-vi/components/resizable-panel/examples.mdx +83 -0
- package/dist/docs/src/content-vi/components/resizable-panel/usage.mdx +97 -0
- package/dist/docs/src/content-vi/components/scrollbar/code.mdx +71 -0
- package/dist/docs/src/content-vi/components/scrollbar/usage.mdx +36 -0
- package/dist/docs/src/content-vi/components/segmented-control/accessibility.mdx +32 -0
- package/dist/docs/src/content-vi/components/segmented-control/changelog.mdx +7 -0
- package/dist/docs/src/content-vi/components/segmented-control/code.mdx +46 -0
- package/dist/docs/src/content-vi/components/segmented-control/examples.mdx +26 -0
- package/dist/docs/src/content-vi/components/segmented-control/style.mdx +13 -0
- package/dist/docs/src/content-vi/components/segmented-control/usage.mdx +38 -0
- package/dist/docs/src/content-vi/components/split-button/accessibility.mdx +32 -0
- package/dist/docs/src/content-vi/components/split-button/changelog.mdx +7 -0
- package/dist/docs/src/content-vi/components/split-button/code.mdx +57 -0
- package/dist/docs/src/content-vi/components/split-button/examples.mdx +26 -0
- package/dist/docs/src/content-vi/components/split-button/style.mdx +12 -0
- package/dist/docs/src/content-vi/components/split-button/usage.mdx +28 -0
- package/dist/docs/src/content-vi/components/switch/accessibility.mdx +28 -0
- package/dist/docs/src/content-vi/components/switch/examples.mdx +35 -0
- package/dist/docs/src/content-vi/components/switch/usage.mdx +44 -0
- package/dist/docs/src/content-vi/components/toggle-button/accessibility.mdx +31 -0
- package/dist/docs/src/content-vi/components/toggle-button/changelog.mdx +7 -0
- package/dist/docs/src/content-vi/components/toggle-button/code.mdx +45 -0
- package/dist/docs/src/content-vi/components/toggle-button/examples.mdx +36 -0
- package/dist/docs/src/content-vi/components/toggle-button/style.mdx +11 -0
- package/dist/docs/src/content-vi/components/toggle-button/usage.mdx +33 -0
- package/dist/docs/src/content-vi/components/toolbar/accessibility.mdx +33 -0
- package/dist/docs/src/content-vi/components/toolbar/changelog.mdx +7 -0
- package/dist/docs/src/content-vi/components/toolbar/code.mdx +81 -0
- package/dist/docs/src/content-vi/components/toolbar/examples.mdx +16 -0
- package/dist/docs/src/content-vi/components/toolbar/style.mdx +12 -0
- package/dist/docs/src/content-vi/components/toolbar/usage.mdx +36 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/statement.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/testing.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/guidelines/content/messages.mdx +67 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content/numbers-dates-and-currency.mdx +71 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content/style-and-grammar.mdx +91 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content/terms.mdx +57 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content/voice-and-tone.mdx +48 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content.mdx +24 -19
- package/dist/docs/src/content-vi/foundations/styles/border.mdx +1 -5
- package/dist/docs/src/content-vi/foundations/styles/color/dark-mode.mdx +65 -6
- package/dist/docs/src/content-vi/foundations/styles/color/palette.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/color/usage.mdx +7 -7
- package/dist/docs/src/content-vi/foundations/styles/data-visualization.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/elevation.mdx +3 -3
- package/dist/docs/src/content-vi/foundations/styles/icons/accessibility.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/icons/code.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/icons/library.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/icons/usage.mdx +1 -4
- package/dist/docs/src/content-vi/foundations/styles/illustration.mdx +3 -3
- package/dist/docs/src/content-vi/foundations/styles/interaction-states.mdx +13 -10
- package/dist/docs/src/content-vi/foundations/styles/layout/app-frame.mdx +4 -9
- package/dist/docs/src/content-vi/foundations/styles/layout/grid.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/layout/overlays.mdx +3 -0
- package/dist/docs/src/content-vi/foundations/styles/logos/downloads-and-terms.mdx +4 -4
- package/dist/docs/src/content-vi/foundations/styles/logos/product-logos.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/logos/using-the-logo.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/motion.mdx +3 -1
- package/dist/docs/src/content-vi/foundations/styles/opacity.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/radius.mdx +32 -28
- package/dist/docs/src/content-vi/foundations/styles/size-and-density.mdx +7 -6
- package/dist/docs/src/content-vi/foundations/styles/spacing.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/typography/code.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/typography/usage.mdx +7 -0
- package/dist/docs/src/content-vi/foundations/styles/z-index.mdx +3 -16
- package/dist/docs/src/content-vi/foundations/tokens/all-tokens.mdx +51 -2
- package/dist/docs/src/content-vi/foundations/tokens/index.mdx +90 -5
- package/dist/docs/src/content-vi/get-started/content.mdx +36 -0
- package/dist/docs/src/content-vi/get-started/design.mdx +49 -0
- package/dist/docs/src/content-vi/get-started/develop.mdx +110 -0
- package/dist/docs/src/content-vi/get-started/get-help.mdx +35 -0
- package/dist/docs/src/content-vi/get-started/index.mdx +49 -0
- package/dist/docs/src/content-vi/release-phases/index.mdx +11 -0
- package/dist/docs/src/content-vi/tools/ai-agents.mdx +36 -0
- package/dist/docs/src/content-vi/tools/ant-design-vue-theme.mdx +676 -0
- package/dist/docs/src/content-vi/tools/application-content.mdx +171 -0
- package/dist/docs/src/content-vi/tools/editors.mdx +254 -0
- package/dist/docs/src/content-vi/tools/eslint.mdx +15 -0
- package/dist/docs/src/content-vi/tools/index.mdx +7 -0
- package/dist/docs/src/content-vi/tools/mermaid.mdx +179 -0
- package/dist/docs/src/content-vi/tools/stylelint.mdx +18 -0
- package/dist/docs/src/content-vi/tools/vueflow.mdx +264 -0
- package/dist/docs/src/content.config.ts +13 -2
- package/dist/docs/src/lib/dates.ts +8 -0
- package/dist/docs/src/lib/i18n.ts +1 -0
- package/dist/docs/src/lib/icons.ts +2 -2
- package/dist/docs/src/lib/lucide-svg.ts +14 -0
- package/dist/docs/src/lib/navigation.ts +7 -4
- package/dist/docs/src/lib/token-descriptions-vi.ts +254 -12
- package/dist/docs/src/lib/tokens.ts +3 -0
- package/dist/docs/src/lib/utils.ts +9 -0
- package/dist/docs/src/styles/chrome.css +7 -7
- package/dist/docs/src/styles/color.css +31 -31
- package/dist/docs/src/styles/docs.css +75 -46
- package/dist/docs/src/styles/elevation.css +1 -1
- package/dist/docs/src/styles/global.css +28 -11
- package/dist/docs/src/styles/icons.css +16 -16
- package/dist/docs/src/styles/kit.css +71 -10
- package/dist/docs/src/styles/layout.css +16 -11
- package/dist/docs/src/styles/logos.css +24 -24
- package/dist/docs/src/styles/opacity.css +3 -3
- package/dist/docs/src/styles/registry.css +10 -0
- package/dist/docs/src/styles/rules.css +24 -0
- package/dist/docs/src/styles/shapes.css +2 -2
- package/dist/docs/src/styles/tokens.css +213 -120
- package/dist/docs/src/styles/tokens.js +69 -32
- package/dist/docs/src/styles/typography.css +9 -9
- package/dist/docs/src/styles/zindex.css +6 -5
- package/dist/docs/tokens/button.json +51 -0
- package/dist/docs/tokens/color.json +13 -8
- package/dist/docs/tokens/components.json +39 -0
- package/dist/docs/tokens/content.json +103 -10
- package/dist/docs/tokens/diagram.json +490 -49
- package/dist/docs/tokens/editor.json +128 -22
- package/dist/docs/tokens/flow.json +412 -80
- package/dist/docs/tokens/layout.json +13 -4
- package/dist/docs/tokens/motion.json +14 -0
- package/dist/docs/tokens/radius.json +9 -9
- package/dist/docs/tokens/renderer.json +8 -0
- package/dist/docs/tokens/resize.json +84 -15
- package/dist/docs/tokens/scrollbar.json +42 -7
- package/dist/docs/tokens/size.json +6 -6
- package/dist/docs/tokens/spacing.json +1 -1
- package/dist/docs/tokens/switch.json +306 -51
- package/dist/docs/tokens/typography.json +1 -1
- package/dist/docs/tokens/visualization.json +465 -53
- package/dist/docs/tokens/z-index.json +0 -10
- package/dist/index.js +3053 -777
- package/package.json +1 -1
- package/dist/docs/src/brand/structure-proposal.md +0 -227
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ví dụ trực tiếp của Button group, kèm đúng file Vue tạo ra từng ví dụ.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import ButtonGroupSpaced from '../../../../registry/beehexa/examples/button-group/vi/ButtonGroupSpaced.vue';
|
|
6
|
+
import ButtonGroupSpacedSource from '../../../../registry/beehexa/examples/button-group/vi/ButtonGroupSpaced.vue?raw';
|
|
7
|
+
import ButtonGroupJoined from '../../../../registry/beehexa/examples/button-group/vi/ButtonGroupJoined.vue';
|
|
8
|
+
import ButtonGroupJoinedSource from '../../../../registry/beehexa/examples/button-group/vi/ButtonGroupJoined.vue?raw';
|
|
9
|
+
import ButtonGroupIcons from '../../../../registry/beehexa/examples/button-group/vi/ButtonGroupIcons.vue';
|
|
10
|
+
import ButtonGroupIconsSource from '../../../../registry/beehexa/examples/button-group/vi/ButtonGroupIcons.vue?raw';
|
|
11
|
+
|
|
12
|
+
Mỗi ví dụ là một file Vue hoàn chỉnh. Chép vào app đã cài registry, hoặc mở trong StackBlitz.
|
|
13
|
+
|
|
14
|
+
## Cách nhau
|
|
15
|
+
|
|
16
|
+
Các thao tác cuối hộp thoại: cách nhau 8 px, nút chính đứng cuối.
|
|
17
|
+
|
|
18
|
+
<CodeExample source={ButtonGroupSpacedSource} file="ButtonGroupSpaced.vue">
|
|
19
|
+
<ButtonGroupSpaced client:visible />
|
|
20
|
+
</CodeExample>
|
|
21
|
+
|
|
22
|
+
## Liền nhau
|
|
23
|
+
|
|
24
|
+
Các thao tác trên cùng một đối tượng, đọc như một control. Chỉ góc ngoài được bo; viền chạm nhau chồng thành một đường.
|
|
25
|
+
|
|
26
|
+
<CodeExample source={ButtonGroupJoinedSource} file="ButtonGroupJoined.vue">
|
|
27
|
+
<ButtonGroupJoined client:visible />
|
|
28
|
+
</CodeExample>
|
|
29
|
+
|
|
30
|
+
## Nút chỉ có icon
|
|
31
|
+
|
|
32
|
+
Các nút chỉ có icon trong nhóm cách nhau 12 px.
|
|
33
|
+
|
|
34
|
+
<CodeExample source={ButtonGroupIconsSource} file="ButtonGroupIcons.vue">
|
|
35
|
+
<ButtonGroupIcons client:visible />
|
|
36
|
+
</CodeExample>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cấu tạo, token, kích thước và khoảng cách của Button group.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Token
|
|
6
|
+
|
|
7
|
+
| Phần | Token và giá trị |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Khoảng cách kiểu cách nhau | `space.100` (8 px); `space.150` (12 px) cho nút chỉ có icon |
|
|
10
|
+
| Cạnh kiểu liền nhau | Các nút chồng lên nhau một `border.width.default`; góc trong 0, góc ngoài `radius.control` |
|
|
11
|
+
| Vạch chia nút chính | `color.background.primary.hover` giữa hai nút chính |
|
|
12
|
+
| Hover và focus | Nút đang hover hay focus nằm trên các nút bên cạnh |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Khi nào dùng nhóm nút, cấu tạo, trạng thái, phím và khả năng tiếp cận.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> **Bản nháp.** Đề xuất từ khảo sát 18 design system, chưa được duyệt. Đã có trong registry để các đội dùng thử; API còn có thể đổi trước khi duyệt.
|
|
6
|
+
|
|
7
|
+
## Khi nào dùng
|
|
8
|
+
|
|
9
|
+
- **Cách nhau:** các thao tác ở cuối biểu mẫu, hộp thoại hoặc card. Tối đa ba nút.
|
|
10
|
+
- **Ghép liền:** các thao tác trên cùng một đối tượng, đọc như một control, như trước, hôm nay và sau trong khoảng ngày.
|
|
11
|
+
|
|
12
|
+
## Khi nào không dùng
|
|
13
|
+
|
|
14
|
+
- Để chọn một trong nhiều lựa chọn. Dùng [segmented control](/vi/components/segmented-control/usage/).
|
|
15
|
+
- Cho hơn ba thao tác. Giữ thao tác chính, đưa phần còn lại vào [nút mở menu](/vi/components/menu-button/usage/).
|
|
16
|
+
- Cho một hàng công cụ cần di chuyển bằng phím mũi tên. Dùng [thanh công cụ](/vi/components/toolbar/usage/).
|
|
17
|
+
|
|
18
|
+
## Bố cục
|
|
19
|
+
|
|
20
|
+
| Kiểu | Khoảng cách | Góc | Thứ tự |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| Cách nhau | `space.100` (8 px); `space.150` (12 px) với nút chỉ có icon | Mỗi nút giữ góc riêng | Hộp thoại: căn phải, nút chính đứng cuối. Biểu mẫu trên trang: căn trái, nút chính đứng đầu (D10). |
|
|
23
|
+
| Ghép liền | 0; hai cạnh chạm nhau chồng thành một đường | Chỉ góc ngoài giữ `radius.control`; góc trong là 0 (D2) | Từ trái sang phải theo thứ tự đọc |
|
|
24
|
+
|
|
25
|
+
Mọi nút trong nhóm cùng một cỡ. Nhóm ghép liền dùng một biến thể cho mọi nút, Default hoặc Subtle.
|
|
26
|
+
|
|
27
|
+
## Khả năng tiếp cận
|
|
28
|
+
|
|
29
|
+
- Nhóm ghép liền có `role="group"` và `aria-label` đặt tên cho cả nhóm.
|
|
30
|
+
- Mỗi nút giữ tên và vòng focus riêng. Nút đang focus nằm trên các nút bên cạnh để thấy đủ vòng focus.
|
|
31
|
+
- Phím Tab đi qua từng nút. Phím mũi tên là của thanh công cụ, không phải của nhóm nút.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Các phím, những gì Icon button có sẵn và những gì đội của bạn cần làm.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Mức tuân thủ
|
|
6
|
+
|
|
7
|
+
**Icon button đạt WCAG 2.2 mức AA khi được dùng như mô tả trên các trang này.** Component theo [mẫu Button](https://www.w3.org/WAI/ARIA/apg/patterns/button/) của WAI-ARIA Authoring Practices.
|
|
8
|
+
|
|
9
|
+
## Bàn phím
|
|
10
|
+
|
|
11
|
+
| Phím | Tác dụng |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| <kbd>Tab</kbd> | Đưa focus tới nút và mở tooltip. |
|
|
14
|
+
| <kbd>Enter</kbd> hoặc <kbd>Space</kbd> | Chạy thao tác. |
|
|
15
|
+
| <kbd>Esc</kbd> | Đóng tooltip. |
|
|
16
|
+
|
|
17
|
+
## Những gì Icon button có sẵn
|
|
18
|
+
|
|
19
|
+
- Nút gốc với vòng focus, trạng thái và vùng chạm của Button.
|
|
20
|
+
- Tooltip mở khi hover và khi focus bằng bàn phím, lặp lại tên nút.
|
|
21
|
+
- Copy button: live region lịch sự đọc "Đã sao chép"; đổi icon không phải tín hiệu duy nhất.
|
|
22
|
+
|
|
23
|
+
## Những gì đội của bạn cần làm
|
|
24
|
+
|
|
25
|
+
- Đặt `aria-label` nói rõ thao tác, kèm đối tượng khi cần: "Xóa mapping".
|
|
26
|
+
- Dùng nút có nhãn khi icon không quen thuộc.
|
|
27
|
+
- Không đặt thông tin thêm vào tooltip; tooltip chỉ lặp lại tên.
|
|
28
|
+
|
|
29
|
+
## Tiêu chí WCAG
|
|
30
|
+
|
|
31
|
+
| Tiêu chí | Mức | Cách đạt |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| 1.1.1 Non-text Content | A | `aria-label`; the icon is hidden |
|
|
34
|
+
| 2.5.8 Target Size (Minimum) | AA | 24 px or more; 44 px on touch |
|
|
35
|
+
| 4.1.2 Name, Role, Value | A | Native button with a name |
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cài đặt, props và các phần tạo nên Icon button.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Cài đặt
|
|
6
|
+
|
|
7
|
+
Chạy trong app, sau `shadcn-vue init` và theme Beehexa ([Nút › Code](/vi/components/button/code/)):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx shadcn-vue@latest add https://beehexa.design/r/button.json
|
|
11
|
+
npx shadcn-vue@latest add https://beehexa.design/r/tooltip.json
|
|
12
|
+
npx shadcn-vue@latest add https://beehexa.design/r/copy-button.json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Cách dùng
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { Ellipsis, ListFilter, RefreshCw, Trash2 } from '@lucide/vue'
|
|
20
|
+
import { Button } from '@/components/ui/button'
|
|
21
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
|
|
22
|
+
|
|
23
|
+
const tools = [
|
|
24
|
+
{ label: 'Đồng bộ ngay', icon: RefreshCw },
|
|
25
|
+
{ label: 'Bộ lọc', icon: ListFilter },
|
|
26
|
+
{ label: 'Thêm thao tác', icon: Ellipsis },
|
|
27
|
+
]
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<TooltipProvider>
|
|
32
|
+
<div class="flex items-center gap-(--bh-space-150)">
|
|
33
|
+
<Tooltip v-for="tool in tools" :key="tool.label">
|
|
34
|
+
<TooltipTrigger as-child>
|
|
35
|
+
<Button variant="ghost" size="icon" :aria-label="tool.label">
|
|
36
|
+
<component :is="tool.icon" />
|
|
37
|
+
</Button>
|
|
38
|
+
</TooltipTrigger>
|
|
39
|
+
<TooltipContent>{{ tool.label }}</TooltipContent>
|
|
40
|
+
</Tooltip>
|
|
41
|
+
<Tooltip>
|
|
42
|
+
<TooltipTrigger as-child>
|
|
43
|
+
<Button variant="ghost-destructive" size="icon" aria-label="Xóa mapping">
|
|
44
|
+
<Trash2 />
|
|
45
|
+
</Button>
|
|
46
|
+
</TooltipTrigger>
|
|
47
|
+
<TooltipContent>Xóa mapping</TooltipContent>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
</div>
|
|
50
|
+
</TooltipProvider>
|
|
51
|
+
</template>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Props
|
|
55
|
+
|
|
56
|
+
| Prop | Giá trị | Ghi chú |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| Button `size` | `icon-sm`, `icon`, `icon-lg` | Hình vuông 24, 32 và 40 px |
|
|
59
|
+
| Button `aria-label` | chuỗi | Bắt buộc: tên nút, hiện lại trong tooltip |
|
|
60
|
+
| CopyButton `value` | chuỗi | Nội dung chép vào clipboard |
|
|
61
|
+
| CopyButton `label` | chuỗi, mặc định `Copy` | Tên và tooltip, như "Sao chép API key" |
|
|
62
|
+
| CopyButton `copiedLabel` | chuỗi, mặc định `Copied` | Live region đọc câu này sau khi chép |
|
|
63
|
+
|
|
64
|
+
## Dựng từ
|
|
65
|
+
|
|
66
|
+
Icon button là Button với cỡ `icon`, nên không có component riêng. Copy button là preset nhỏ ghép từ Button và Tooltip.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ví dụ trực tiếp của Icon button, kèm đúng file Vue tạo ra từng ví dụ.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import IconButtonBasic from '../../../../registry/beehexa/examples/icon-button/vi/IconButtonBasic.vue';
|
|
6
|
+
import IconButtonBasicSource from '../../../../registry/beehexa/examples/icon-button/vi/IconButtonBasic.vue?raw';
|
|
7
|
+
import IconButtonSizes from '../../../../registry/beehexa/examples/icon-button/vi/IconButtonSizes.vue';
|
|
8
|
+
import IconButtonSizesSource from '../../../../registry/beehexa/examples/icon-button/vi/IconButtonSizes.vue?raw';
|
|
9
|
+
import IconButtonClose from '../../../../registry/beehexa/examples/icon-button/vi/IconButtonClose.vue';
|
|
10
|
+
import IconButtonCloseSource from '../../../../registry/beehexa/examples/icon-button/vi/IconButtonClose.vue?raw';
|
|
11
|
+
import IconButtonCopy from '../../../../registry/beehexa/examples/icon-button/vi/IconButtonCopy.vue';
|
|
12
|
+
import IconButtonCopySource from '../../../../registry/beehexa/examples/icon-button/vi/IconButtonCopy.vue?raw';
|
|
13
|
+
|
|
14
|
+
Mỗi ví dụ là một file Vue hoàn chỉnh. Chép vào app đã cài registry, hoặc mở trong StackBlitz.
|
|
15
|
+
|
|
16
|
+
## Nhẹ, có tooltip
|
|
17
|
+
|
|
18
|
+
Icon button thường gặp: kiểu Nhẹ, vuông, cách nhau 12 px, tên nằm trong aria-label và hiện lại trong tooltip.
|
|
19
|
+
|
|
20
|
+
<CodeExample source={IconButtonBasicSource} file="IconButtonBasic.vue">
|
|
21
|
+
<IconButtonBasic client:visible />
|
|
22
|
+
</CodeExample>
|
|
23
|
+
|
|
24
|
+
## Kích thước và mức nhấn
|
|
25
|
+
|
|
26
|
+
Hình vuông 24, 32 và 40 px. Kiểu Mặc định khi nút cần trông như một control, Primary chỉ cho thao tác chính duy nhất.
|
|
27
|
+
|
|
28
|
+
<CodeExample source={IconButtonSizesSource} file="IconButtonSizes.vue">
|
|
29
|
+
<IconButtonSizes client:visible />
|
|
30
|
+
</CodeExample>
|
|
31
|
+
|
|
32
|
+
## Đóng
|
|
33
|
+
|
|
34
|
+
Preset Đóng: kiểu Nhẹ, góc trên bên phải của hộp thoại hay panel, tên "Đóng". Phím Esc cũng đóng.
|
|
35
|
+
|
|
36
|
+
<CodeExample source={IconButtonCloseSource} file="IconButtonClose.vue">
|
|
37
|
+
<IconButtonClose client:visible />
|
|
38
|
+
</CodeExample>
|
|
39
|
+
|
|
40
|
+
## Sao chép
|
|
41
|
+
|
|
42
|
+
Preset Sao chép: sau khi bấm, icon đổi thành dấu tích trong 2 giây và một live region lịch sự đọc "Đã sao chép". Không dùng toast.
|
|
43
|
+
|
|
44
|
+
<CodeExample source={IconButtonCopySource} file="IconButtonCopy.vue">
|
|
45
|
+
<IconButtonCopy client:visible />
|
|
46
|
+
</CodeExample>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cấu tạo, token, kích thước và khoảng cách của Icon button.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Token
|
|
6
|
+
|
|
7
|
+
| Phần | Token và giá trị |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Khung | Hình vuông `size.control.small`, `.default` hoặc `.large`; bo góc như Button |
|
|
10
|
+
| Icon | `size.icon.default` (16 px), Lucide |
|
|
11
|
+
| Khoảng cách giữa các icon button | `space.150` (12 px) |
|
|
12
|
+
| Màu | Các biến thể và trạng thái của Button, kể cả đang bật |
|
|
13
|
+
| Tooltip | `color.surface.inverse`, `color.text.inverse`, `font.body.small`, cách nút 4 px |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Khi nào dùng nút chỉ có icon, cấu tạo, trạng thái, phím và khả năng tiếp cận.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> **Bản nháp.** Đề xuất từ khảo sát 18 design system, chưa được duyệt. Đã có trong registry để các đội dùng thử; API còn có thể đổi trước khi duyệt.
|
|
6
|
+
|
|
7
|
+
## Khi nào dùng
|
|
8
|
+
|
|
9
|
+
- Trong thanh công cụ, dòng bảng, đầu card và editor, nơi không đủ chỗ cho nhãn.
|
|
10
|
+
- Cho thao tác có icon quen thuộc: đóng, thêm thao tác, làm mới, xóa, sao chép, lọc.
|
|
11
|
+
|
|
12
|
+
## Khi nào không dùng
|
|
13
|
+
|
|
14
|
+
- Cho thao tác chính của màn hình hoặc hộp thoại. Dùng [nút](/vi/components/button/usage/) có nhãn.
|
|
15
|
+
- Khi icon không rõ nghĩa. Thêm nhãn thay vì dựa vào tooltip.
|
|
16
|
+
|
|
17
|
+
## Cấu tạo
|
|
18
|
+
|
|
19
|
+
| Phần | Bắt buộc | Ghi chú |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| Khung | Có | Hình vuông bằng chiều cao nút: 24, 32 hoặc 40 px. |
|
|
22
|
+
| Icon | Có | Lucide, `size.icon.default` (16 px), chỉ để trang trí. |
|
|
23
|
+
| Tên cho trình đọc màn hình | Có | `aria-label`, cũng hiện thành tooltip khi hover và focus. |
|
|
24
|
+
|
|
25
|
+
## Biến thể và trạng thái
|
|
26
|
+
|
|
27
|
+
Nút chỉ có icon dùng các biến thể của Button: mặc định là Subtle, dùng Default khi cần trông như một control, Subtle danger cho nút xóa trong dòng. Trạng thái giống Button, kể cả toggle đang bật (`aria-pressed="true"`). Các nút chỉ có icon trong một hàng cách nhau 12 px (`space.150`).
|
|
28
|
+
|
|
29
|
+
## Nút làm sẵn
|
|
30
|
+
|
|
31
|
+
Hai nút chỉ có icon có icon, tên và hành vi cố định. Chúng là cấu hình của nút chỉ có icon, không phải component riêng.
|
|
32
|
+
|
|
33
|
+
| Nút | Icon | Tên | Hành vi |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| Đóng | `x` | "Đóng", hoặc "Đóng" kèm tên thứ được đóng khi trang có nhiều nút đóng | Subtle. Góc trên bên phải hộp thoại và drawer; phím Esc cũng đóng. Cỡ nhỏ (24 px) trong tag và banner. |
|
|
36
|
+
| Sao chép | `copy` | "Sao chép" kèm tên thứ được sao chép, như "Sao chép API key" | Subtle, cỡ nhỏ cạnh giá trị. Sau khi bấm, icon đổi thành `check` trong 2 giây và live region đọc "Đã sao chép". Không dùng toast. |
|
|
37
|
+
|
|
38
|
+
## Khả năng tiếp cận
|
|
39
|
+
|
|
40
|
+
- Bắt buộc có tên. Trình đọc màn hình chỉ đọc `aria-label`; icon có `aria-hidden`.
|
|
41
|
+
- Tooltip nhắc lại tên, không chứa thông tin thêm.
|
|
42
|
+
- Trên màn hình cảm ứng, vùng chạm nở tới 44 px nhưng hình vuông nhìn thấy giữ nguyên.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Các phím, những gì Menu button có sẵn và những gì đội của bạn cần làm.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Mức tuân thủ
|
|
6
|
+
|
|
7
|
+
**Menu button đạt WCAG 2.2 mức AA khi được dùng như mô tả trên các trang này.** Component theo [mẫu Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/) của WAI-ARIA Authoring Practices.
|
|
8
|
+
|
|
9
|
+
## Bàn phím
|
|
10
|
+
|
|
11
|
+
| Phím | Tác dụng |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| <kbd>Enter</kbd>, <kbd>Space</kbd>, <kbd>↓</kbd> | Mở menu và focus mục đầu. |
|
|
14
|
+
| <kbd>↑</kbd> <kbd>↓</kbd> | Di chuyển giữa các mục. Gõ một chữ cái để nhảy tới mục. |
|
|
15
|
+
| <kbd>Enter</kbd> | Chạy mục và đóng menu. |
|
|
16
|
+
| <kbd>Esc</kbd> | Đóng menu và trả focus về nút. |
|
|
17
|
+
|
|
18
|
+
## Những gì Menu button có sẵn
|
|
19
|
+
|
|
20
|
+
- `aria-haspopup="menu"` và `aria-expanded` trên nút.
|
|
21
|
+
- `role="menu"` và `role="menuitem"`, với phím mũi tên, gõ để tìm và trả focus.
|
|
22
|
+
- Menu luôn nằm trong màn hình và lật hướng khi không đủ chỗ.
|
|
23
|
+
|
|
24
|
+
## Những gì đội của bạn cần làm
|
|
25
|
+
|
|
26
|
+
- Đặt tên nút icon kèm đối tượng: "Thêm thao tác cho Đơn hàng sang ERP".
|
|
27
|
+
- Mục menu là thao tác; dùng điều hướng để chuyển trang và select để chọn giá trị.
|
|
28
|
+
- Hỏi xác nhận trước khi chạy mục xóa.
|
|
29
|
+
|
|
30
|
+
## Tiêu chí WCAG
|
|
31
|
+
|
|
32
|
+
| Tiêu chí | Mức | Cách đạt |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| 2.1.1 Keyboard | A | Every item reachable with arrow keys |
|
|
35
|
+
| 2.4.3 Focus Order | A | Focus returns to the button on close |
|
|
36
|
+
| 4.1.2 Name, Role, Value | A | `aria-expanded` follows the menu |
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cài đặt, props và các phần tạo nên Menu button.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Cài đặt
|
|
6
|
+
|
|
7
|
+
Chạy trong app, sau `shadcn-vue init` và theme Beehexa ([Nút › Code](/vi/components/button/code/)):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx shadcn-vue@latest add https://beehexa.design/r/button.json
|
|
11
|
+
npx shadcn-vue@latest add https://beehexa.design/r/dropdown-menu.json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Cách dùng
|
|
15
|
+
|
|
16
|
+
```vue
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { ChevronDown, FileSpreadsheet, FileText, Link } from '@lucide/vue'
|
|
19
|
+
import { Button } from '@/components/ui/button'
|
|
20
|
+
import {
|
|
21
|
+
DropdownMenu,
|
|
22
|
+
DropdownMenuContent,
|
|
23
|
+
DropdownMenuItem,
|
|
24
|
+
DropdownMenuSeparator,
|
|
25
|
+
DropdownMenuTrigger,
|
|
26
|
+
} from '@/components/ui/dropdown-menu'
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<DropdownMenu>
|
|
31
|
+
<DropdownMenuTrigger as-child>
|
|
32
|
+
<Button variant="outline">Xuất<ChevronDown /></Button>
|
|
33
|
+
</DropdownMenuTrigger>
|
|
34
|
+
<DropdownMenuContent>
|
|
35
|
+
<DropdownMenuItem><FileText />Xuất CSV</DropdownMenuItem>
|
|
36
|
+
<DropdownMenuItem><FileSpreadsheet />Xuất Excel</DropdownMenuItem>
|
|
37
|
+
<DropdownMenuSeparator />
|
|
38
|
+
<DropdownMenuItem><Link />Sao chép liên kết</DropdownMenuItem>
|
|
39
|
+
</DropdownMenuContent>
|
|
40
|
+
</DropdownMenu>
|
|
41
|
+
</template>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Props
|
|
45
|
+
|
|
46
|
+
| Prop | Giá trị | Ghi chú |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| DropdownMenuTrigger `as-child` | boolean | Gắn hành vi menu lên Button bên trong |
|
|
49
|
+
| DropdownMenuContent `align` | `start` (mặc định), `center`, `end` | `end` cho nút ở cuối hàng |
|
|
50
|
+
| DropdownMenuItem `variant` | `default`, `destructive` | Tông nguy hiểm cho thao tác xóa |
|
|
51
|
+
| DropdownMenuItem `disabled` | boolean | Phím mũi tên bỏ qua |
|
|
52
|
+
|
|
53
|
+
## Dựng từ
|
|
54
|
+
|
|
55
|
+
Dropdown menu bọc DropdownMenu của reka-ui, cùng API với shadcn-vue. Menu button là một Button đặt trong `DropdownMenuTrigger as-child`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ví dụ trực tiếp của Menu button, kèm đúng file Vue tạo ra từng ví dụ.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import MenuButtonBasic from '../../../../registry/beehexa/examples/menu-button/vi/MenuButtonBasic.vue';
|
|
6
|
+
import MenuButtonBasicSource from '../../../../registry/beehexa/examples/menu-button/vi/MenuButtonBasic.vue?raw';
|
|
7
|
+
import MenuButtonMore from '../../../../registry/beehexa/examples/menu-button/vi/MenuButtonMore.vue';
|
|
8
|
+
import MenuButtonMoreSource from '../../../../registry/beehexa/examples/menu-button/vi/MenuButtonMore.vue?raw';
|
|
9
|
+
|
|
10
|
+
Mỗi ví dụ là một file Vue hoàn chỉnh. Chép vào app đã cài registry, hoặc mở trong StackBlitz.
|
|
11
|
+
|
|
12
|
+
## Có nhãn
|
|
13
|
+
|
|
14
|
+
Nút Mặc định có mũi tên. Menu chứa các thao tác liên quan; vạch chia tách các nhóm.
|
|
15
|
+
|
|
16
|
+
<CodeExample source={MenuButtonBasicSource} file="MenuButtonBasic.vue">
|
|
17
|
+
<MenuButtonBasic client:visible />
|
|
18
|
+
</CodeExample>
|
|
19
|
+
|
|
20
|
+
## Thêm thao tác trong một hàng
|
|
21
|
+
|
|
22
|
+
Nút icon "Thêm thao tác" ở cuối hàng. Xóa đứng cuối, tông nguy hiểm.
|
|
23
|
+
|
|
24
|
+
<CodeExample source={MenuButtonMoreSource} file="MenuButtonMore.vue">
|
|
25
|
+
<MenuButtonMore client:visible />
|
|
26
|
+
</CodeExample>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cấu tạo, token, kích thước và khoảng cách của Menu button.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Token
|
|
6
|
+
|
|
7
|
+
| Phần | Token và giá trị |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Nút khi menu mở | `button.background.subtle.pressed` (`aria-expanded="true"`) |
|
|
10
|
+
| Menu | `color.surface.overlay`, viền `color.border`, `elevation.shadow.overlay`, `radius.overlay`, padding `space.050`, `z-index.overlay`, cách nút 4 px |
|
|
11
|
+
| Mục | Cao `size.control.default`, `font.body.default`, padding `space.100`, `radius.control.small`; icon `color.icon.subtle` |
|
|
12
|
+
| Mục đang chọn | `color.surface.overlay.hover` |
|
|
13
|
+
| Mục nguy hiểm | `color.text.danger`, icon `color.icon.danger` |
|
|
14
|
+
| Vạch chia | `border.width.default` màu `color.border` |
|
|
15
|
+
| Phím tắt | `font.body.small`, `color.text.subtle` |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Khi nào dùng nút mở menu, cấu tạo, trạng thái, phím và khả năng tiếp cận.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> **Bản nháp.** Đề xuất từ khảo sát 18 design system, chưa được duyệt. Đã có trong registry để các đội dùng thử; API còn có thể đổi trước khi duyệt.
|
|
6
|
+
|
|
7
|
+
## Khi nào dùng
|
|
8
|
+
|
|
9
|
+
- Để gom nhiều thao tác liên quan không đủ chỗ làm nút: xuất CSV, xuất Excel, sao chép liên kết.
|
|
10
|
+
- Làm nút "Thêm thao tác" chỉ có icon ở cuối dòng hoặc đầu card.
|
|
11
|
+
|
|
12
|
+
## Khi nào không dùng
|
|
13
|
+
|
|
14
|
+
- Khi có một thao tác rõ ràng là mặc định. Dùng [split button](/vi/components/split-button/usage/).
|
|
15
|
+
- Để chọn giá trị cho biểu mẫu. Dùng select.
|
|
16
|
+
- Để chuyển sang trang khác. Dùng điều hướng.
|
|
17
|
+
|
|
18
|
+
## Cấu tạo
|
|
19
|
+
|
|
20
|
+
| Phần | Bắt buộc | Ghi chú |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| Nút | Có | Mọi biến thể và cỡ của Button. |
|
|
23
|
+
| Mũi tên | Có, trừ nút chỉ có icon | `chevron-down` sau nhãn. |
|
|
24
|
+
| Menu | Có | `color.surface.overlay`, `elevation.shadow.overlay`, `radius.overlay`, ở lớp `z-index.overlay`. |
|
|
25
|
+
| Mục menu | Có | Icon tùy chọn, nhãn, phím tắt tùy chọn. Hover `color.surface.overlay.hover`. |
|
|
26
|
+
|
|
27
|
+
## Trạng thái
|
|
28
|
+
|
|
29
|
+
Nút có các trạng thái của Button. Khi menu đang mở, nút giữ dáng đang nhấn (`aria-expanded="true"` dùng `button.background.subtle.pressed`).
|
|
30
|
+
|
|
31
|
+
## Bàn phím
|
|
32
|
+
|
|
33
|
+
| Phím | Tác dụng |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| Enter, Space, mũi tên xuống | Mở menu và focus mục đầu |
|
|
36
|
+
| Mũi tên lên | Mở menu và focus mục cuối |
|
|
37
|
+
| Mũi tên lên và xuống | Di chuyển giữa các mục |
|
|
38
|
+
| Enter | Chạy mục đó và đóng menu |
|
|
39
|
+
| Esc | Đóng menu và trả focus về nút |
|
|
40
|
+
|
|
41
|
+
## Khả năng tiếp cận
|
|
42
|
+
|
|
43
|
+
- Nút có `aria-haspopup="menu"` và `aria-expanded`.
|
|
44
|
+
- Menu có `role="menu"` và lấy tên từ nút; mỗi mục có `role="menuitem"`.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Hành vi với bàn phím, con trỏ, cảm ứng và công nghệ hỗ trợ của ô kéo giãn."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Ngữ nghĩa của thanh chia
|
|
6
|
+
|
|
7
|
+
Component gốc sở hữu phần tử nhận focus `role="separator"`. Bên dùng cung cấp
|
|
8
|
+
`separatorLabel` đã dịch và đúng ngữ cảnh, ví dụ “Đổi kích thước mã nguồn và xem trước”.
|
|
9
|
+
Không đặt thêm tay nắm kéo nhận focus bên trong nó, và không thay tên của nó bằng một ký
|
|
10
|
+
hiệu. Component gốc cấp ID ô duy nhất, an toàn khi render phía server, `aria-controls` cho
|
|
11
|
+
ô thứ nhất, và các thuộc tính giá trị/min/max dạng phần trăm. `aria-orientation` mô tả
|
|
12
|
+
**đường chia**: dọc khi hai ô trái/phải (horizontal), ngang khi hai ô trên/dưới (vertical).
|
|
13
|
+
|
|
14
|
+
Bố cục ẩn ô thứ hai hoặc có giới hạn cố định không có thanh chia hiển thị hay với tới được.
|
|
15
|
+
Nội dung ô thứ hai bị ẩn bằng display và inert nhưng vẫn giữ trong DOM. Muốn thu gọn sát
|
|
16
|
+
mép thật thì cần `min=0`; nội dung đã thu gọn vẫn giữ trong DOM và bị cắt phần tràn, nhưng
|
|
17
|
+
inert và bị loại khỏi cây trợ năng. Tab/Shift+Tab phải bỏ qua các control được giữ lại
|
|
18
|
+
trong đó. Khôi phục ô sẽ trả lại khả năng nhận focus gốc như thường, không thay control hay
|
|
19
|
+
trạng thái cục bộ của chúng.
|
|
20
|
+
|
|
21
|
+
## Thay thế thao tác kéo bằng bàn phím
|
|
22
|
+
|
|
23
|
+
- Trái/Phải di chuyển thanh chia khi chia trái/phải.
|
|
24
|
+
- Lên/Xuống di chuyển thanh chia khi chia trên/dưới.
|
|
25
|
+
- Mỗi lần bấm mũi tên di chuyển 1 điểm phần trăm; Shift+mũi tên di chuyển 10.
|
|
26
|
+
- Home và End chọn giới hạn dưới và trên hiện tại.
|
|
27
|
+
- Enter đặt lại tỉ lệ ban đầu, trong giới hạn hiện tại. Nhấp đúp cho con trỏ cũng đặt
|
|
28
|
+
lại như vậy, và không lan sự kiện vào ô.
|
|
29
|
+
- Giữ phím lặp tạo thành một vòng đời kéo giãn; thả phím được hỗ trợ hoặc rời thanh chia
|
|
30
|
+
sẽ kết thúc vòng đời đó. Phím tắt không liên quan không bị chặn.
|
|
31
|
+
|
|
32
|
+
Điểm đặt lại được ghi nhận khi component được tạo. Các cập nhật model, thay đổi container
|
|
33
|
+
và đổi hướng theo màn hình về sau không định nghĩa lại nó. Vòng focus hiển thị, lấy từ
|
|
34
|
+
token, nằm trên tay nắm. Dùng cùng một bố cục cho bàn phím, con trỏ và cảm ứng; không để
|
|
35
|
+
control đã vô hiệu vẫn nhận cử chỉ.
|
|
36
|
+
|
|
37
|
+
## Con trỏ và cảm ứng
|
|
38
|
+
|
|
39
|
+
Đường chia mảnh lấy từ token không phải vùng bấm. Vùng bấm trải theo trục vuông góc, lớn
|
|
40
|
+
lên từ `resize.target` thành `resize.touchTarget` với con trỏ thô, và chỉ dùng
|
|
41
|
+
`touch-action: none` trên bề mặt cử chỉ. Pointer capture và lớp chắn cục bộ phía trên các
|
|
42
|
+
ô tránh để editor/iframe chặn cử chỉ; việc chặn chọn chữ chỉ trong lúc kéo tránh bôi chọn
|
|
43
|
+
nội dung ô. Các control khác và document không bị ghi đè con trỏ hay vùng chọn vĩnh viễn.
|
|
44
|
+
|
|
45
|
+
Thả con trỏ, hủy con trỏ, mất capture, cửa sổ mất focus, giới hạn bị ẩn/khóa và đổi hướng
|
|
46
|
+
đều kết thúc cử chỉ. Khi hủy, tỉ lệ hợp lệ cuối cùng được giữ. Khi gỡ component, capture,
|
|
47
|
+
listener của document/window, các observer và việc bố cục đang chờ đều được gỡ. Mỗi
|
|
48
|
+
instance tự sở hữu trạng thái của nó.
|
|
49
|
+
|
|
50
|
+
## Tương phản, chuyển động và tùy chọn đọc
|
|
51
|
+
|
|
52
|
+
Tay nắm luôn nằm trên các ô bị cắt độc lập ở cả hai trục. Mặc định đường chia nằm giữa với
|
|
53
|
+
độ dài 90%, và tay nắm ở điểm giữa, không ở mép nơi có thể bị một ô che mất. Màu active và
|
|
54
|
+
focus dùng vai trò resize gốc và giá trị token sáng/tối; ở chế độ forced colors vẫn giữ
|
|
55
|
+
viền/chỉ báo focus bằng màu hệ thống. Phóng chữ theo rem của người đọc ảnh hưởng tới vùng
|
|
56
|
+
bấm và tay nắm có kích thước theo token. Không có hiệu ứng chuyển tiếp khi kéo giãn ở chế
|
|
57
|
+
độ giảm chuyển động (và cả khi kéo bình thường). Đổi ngôn ngữ cập nhật nhãn do bên dùng
|
|
58
|
+
cung cấp mà không dựng lại editor, model hay trạng thái zoom bên trong.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Lịch sử triển khai gốc của component ô kéo giãn cho Vue."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Triển khai gốc
|
|
6
|
+
|
|
7
|
+
- Thêm `ResizablePanel` Vue 3 thật trong `@beehexa/vue-components`, độc lập với Ant Design Vue.
|
|
8
|
+
- Thêm bố cục hai trục có giới hạn, tỉ lệ/giới hạn/trạng thái hiện phản ứng theo dữ liệu, và giữ nguyên instance trong slot.
|
|
9
|
+
- Thêm chế độ truy cập tài liệu `preserveMinimum` chỉ định rõ: giữ mức tối thiểu đã cấu hình của các ô cộng rãnh tương tác thật khi phần khung trang chiếm hết chỗ; giữ nguyên cách nới giới hạn mặc định và các phần tử con.
|
|
10
|
+
- Cho lớp bọc ô thành flex container dạng cột co lại được, để Card, Monaco và canvas có giới hạn lấp đầy ô thay vì co về chiều cao tự nhiên.
|
|
11
|
+
- Thêm đường chia dài 90% nằm giữa, với tay nắm ở điểm giữa hiển thị trên lớp cục bộ ở cả hai trục.
|
|
12
|
+
- Dành một rãnh thật có kích thước theo token ở cả hai trục; tỉ lệ/giới hạn pixel của ô và tọa độ con trỏ không tính rãnh, và vùng bấm cho con trỏ thô không còn che thanh cuộn của ô.
|
|
13
|
+
- Thay họa tiết tay nắm lặp lại bằng đúng ba chấm tròn theo token gốc, đối xứng và nằm giữa tay nắm (không đổi kích thước) ở cả hai hướng và mọi mức phóng chữ.
|
|
14
|
+
- Cho overlay cố định lồng bên trong dùng chung lớp xếp chồng của phần tử sở hữu overlay thật, thay vì bị kẹt dưới thanh chia anh em bên ngoài. Chỉ giữ stacking context của root/ô trong lúc đang kéo bằng con trỏ, cho lớp chắn iframe cục bộ.
|
|
15
|
+
- Thêm số đo kích thước có kiểu, sau khi bố cục xong, cho thay đổi từ con trỏ, bàn phím, container và code.
|
|
16
|
+
- Thêm pointer capture/hủy, lớp chắn iframe, giới hạn và đặt lại bằng bàn phím, giá trị thanh chia cho trợ năng, và dọn dẹp khi gỡ.
|
|
17
|
+
- Giữ ô thu gọn sát mép ở trạng thái inert và ngoài cây trợ năng mà vẫn giữ control/trạng thái trong DOM; di chuyển bằng bàn phím trở lại bình thường khi ô được khôi phục.
|
|
18
|
+
- Thêm hỗ trợ sáng/tối theo token gốc, phóng chữ, vùng bấm cho con trỏ thô, giảm chuyển động và forced colors.
|
|
19
|
+
|
|
20
|
+
Trang này mô tả phần triển khai đã viết, không phải một lần phát hành lên registry hay phê duyệt phát hành.
|