@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,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ví dụ trực tiếp của Split button, kèm đúng file Vue tạo ra từng ví dụ.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import SplitButtonPrimary from '../../../../registry/beehexa/examples/split-button/vi/SplitButtonPrimary.vue';
|
|
6
|
+
import SplitButtonPrimarySource from '../../../../registry/beehexa/examples/split-button/vi/SplitButtonPrimary.vue?raw';
|
|
7
|
+
import SplitButtonDefault from '../../../../registry/beehexa/examples/split-button/vi/SplitButtonDefault.vue';
|
|
8
|
+
import SplitButtonDefaultSource from '../../../../registry/beehexa/examples/split-button/vi/SplitButtonDefault.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
|
+
## Primary
|
|
13
|
+
|
|
14
|
+
Thao tác mặc định chạy ngay; nửa có mũi tên mở các lựa chọn gần giống.
|
|
15
|
+
|
|
16
|
+
<CodeExample source={SplitButtonPrimarySource} file="SplitButtonPrimary.vue">
|
|
17
|
+
<SplitButtonPrimary client:visible />
|
|
18
|
+
</CodeExample>
|
|
19
|
+
|
|
20
|
+
## Mặc định
|
|
21
|
+
|
|
22
|
+
Cùng cặp nút ở kiểu Mặc định, cho thao tác không phải thao tác chính của màn hình.
|
|
23
|
+
|
|
24
|
+
<CodeExample source={SplitButtonDefaultSource} file="SplitButtonDefault.vue">
|
|
25
|
+
<SplitButtonDefault client:visible />
|
|
26
|
+
</CodeExample>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cấu tạo, token, kích thước và khoảng cách của Split button.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Token
|
|
6
|
+
|
|
7
|
+
| Phần | Token và giá trị |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Hình dạng | Liền nhau (D2): góc ngoài `radius.control`, góc trong 0, viền chồng nhau |
|
|
10
|
+
| Vạch chia nút chính | `color.background.primary.hover` |
|
|
11
|
+
| Nửa menu | Nút icon vuông với `chevron-down`; giữ dáng đang nhấn khi menu mở |
|
|
12
|
+
| Menu | Như Menu button |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Khi nào dùng split button, 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
|
+
- Khi một thao tác được dùng gần như mọi lúc và có hai, ba phương án gần giống: Chạy ngay, còn Chạy ở chế độ thử nằm trong menu.
|
|
10
|
+
|
|
11
|
+
## Khi nào không dùng
|
|
12
|
+
|
|
13
|
+
- Khi không có thao tác nào rõ ràng là mặc định. Dùng [nút mở menu](/vi/components/menu-button/usage/).
|
|
14
|
+
- Khi các phương án không liên quan nhau. Dùng các nút riêng.
|
|
15
|
+
|
|
16
|
+
## Cấu tạo
|
|
17
|
+
|
|
18
|
+
Hai nút thật ghép liền thành một control (D2): nút thao tác và một nút mở menu chỉ có icon `chevron-down`. Chỉ góc ngoài giữ `radius.control`; hai cạnh chạm nhau chồng thành một đường. Ở biến thể Primary, đường chia dùng `color.background.primary.hover`.
|
|
19
|
+
|
|
20
|
+
## Trạng thái
|
|
21
|
+
|
|
22
|
+
Mỗi nửa có hover, nhấn và focus riêng. Nửa menu giữ dáng đang nhấn khi menu còn mở. Disabled áp cho cả hai nửa cùng lúc.
|
|
23
|
+
|
|
24
|
+
## Khả năng tiếp cận
|
|
25
|
+
|
|
26
|
+
- Cặp nút nằm trong `role="group"` có `aria-label` gọi tên thao tác.
|
|
27
|
+
- Nửa menu có tên riêng, như "Cách chạy khác", kèm `aria-haspopup="menu"` và `aria-expanded`.
|
|
28
|
+
- Phím Tab tới từng nửa; menu dùng phím như [nút mở menu](/vi/components/menu-button/usage/).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Công tắc đạt WCAG 2.2 AA thế nào, các phím, những gì công tắc 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
|
+
**Công tắc đạt WCAG 2.2 mức AA khi được dùng như mô tả trên trang này.** Công tắc theo [mẫu Switch](https://www.w3.org/WAI/ARIA/apg/patterns/switch/) 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 công tắc. Công tắc vô hiệu bị bỏ qua. |
|
|
14
|
+
| <kbd>Space</kbd> | Bật hoặc tắt thiết lập. |
|
|
15
|
+
|
|
16
|
+
## Những gì công tắc có sẵn
|
|
17
|
+
|
|
18
|
+
- Phần tử `<button>` gốc với `role="switch"` và `aria-checked`, nên trình đọc màn hình đọc tên và cho biết đang bật hay tắt.
|
|
19
|
+
- Núm và nhãn so với rãnh: ít nhất 4.5:1 ở mọi trạng thái trừ vô hiệu, ở giao diện sáng và tối. Cặp thấp nhất đo được là 5.64:1.
|
|
20
|
+
- Viền khi tắt so với rãnh: ít nhất 3:1 (WCAG 1.4.11). Thấp nhất đo được là 3.00:1, khi tắt và hover ở giao diện sáng.
|
|
21
|
+
- Vòng focus: ít nhất 6.64:1 so với nền trang, surface, subtle và overlay.
|
|
22
|
+
- Trạng thái thể hiện bằng vị trí núm, không chỉ bằng màu.
|
|
23
|
+
|
|
24
|
+
## Những gì đội của bạn cần làm
|
|
25
|
+
|
|
26
|
+
- **Đặt tên.** Nhãn nói thiết lập làm gì: "Tự động đồng bộ đơn hàng", không viết "Bật". Đặt nhãn cạnh công tắc, hoặc dùng `aria-label`.
|
|
27
|
+
- **Lưu ngay.** Công tắc đổi thiết lập khi được nhấn. Nếu lưu mất thời gian, hiện trạng thái đang xử lý và báo khi xong hoặc khi lỗi.
|
|
28
|
+
- **Không đổi nhãn để mô tả trạng thái.** "Đồng bộ đang bật" cạnh một công tắc đang bật là nói một điều hai lần.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Công tắc thật dựng từ token switch. Nhấp vào hoặc nhấn Space để bật, tắt."
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import SwitchToggle from '../../../components/SwitchToggle.astro';
|
|
6
|
+
|
|
7
|
+
## Tắt và bật
|
|
8
|
+
|
|
9
|
+
Đặt nhãn cạnh công tắc và trỏ tới nhãn bằng `aria-labelledby`. Nhấp vào công tắc, hoặc Tab tới rồi nhấn <kbd>Space</kbd>.
|
|
10
|
+
|
|
11
|
+
<CodeExample code={`<span class="bh-switch-field">
|
|
12
|
+
<button class="bh-switch" type="button" role="switch" aria-checked="false" aria-labelledby="sw-sync"></button>
|
|
13
|
+
<span id="sw-sync">Tự động đồng bộ đơn hàng</span>
|
|
14
|
+
</span>
|
|
15
|
+
<span class="bh-switch-field">
|
|
16
|
+
<button class="bh-switch" type="button" role="switch" aria-checked="true" aria-labelledby="sw-email"></button>
|
|
17
|
+
<span id="sw-email">Gửi email khi đồng bộ lỗi</span>
|
|
18
|
+
</span>`} />
|
|
19
|
+
|
|
20
|
+
## Vô hiệu
|
|
21
|
+
|
|
22
|
+
Chỉ dùng khi thiết lập tạm thời không đổi được, và ghi lý do ngay cạnh.
|
|
23
|
+
|
|
24
|
+
<CodeExample code={`<span class="bh-switch-field">
|
|
25
|
+
<button class="bh-switch" type="button" role="switch" aria-checked="false" aria-labelledby="sw-off-disabled" aria-describedby="sw-off-why" disabled></button>
|
|
26
|
+
<span id="sw-off-disabled">Đồng bộ tồn kho</span>
|
|
27
|
+
</span>
|
|
28
|
+
<p class="bh-switch-hint" id="sw-off-why">Hãy bật đồng bộ đơn hàng trước.</p>
|
|
29
|
+
<span class="bh-switch-field">
|
|
30
|
+
<button class="bh-switch" type="button" role="switch" aria-checked="true" aria-labelledby="sw-on-disabled" aria-describedby="sw-on-why" disabled></button>
|
|
31
|
+
<span id="sw-on-disabled">Đồng bộ đơn hàng</span>
|
|
32
|
+
</span>
|
|
33
|
+
<p class="bh-switch-hint" id="sw-on-why">Chỉ quản trị viên workspace mới đổi được thiết lập này.</p>`} />
|
|
34
|
+
|
|
35
|
+
<SwitchToggle />
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Khi nào dùng công tắc, công tắc trông thế nào ở từng trạng thái, và các token nó dùng."
|
|
3
|
+
---
|
|
4
|
+
import TokenTable from '../../../components/TokenTable.astro';
|
|
5
|
+
|
|
6
|
+
## Khi nào dùng
|
|
7
|
+
|
|
8
|
+
- Để bật hoặc tắt một thiết lập có hiệu lực ngay, như tạm dừng một tác vụ đồng bộ.
|
|
9
|
+
|
|
10
|
+
## Khi nào không dùng
|
|
11
|
+
|
|
12
|
+
- Cho lựa chọn chỉ được lưu sau khi bấm nút Lưu của biểu mẫu. Dùng checkbox.
|
|
13
|
+
- Cho nhiều hơn hai lựa chọn. Dùng radio hoặc segmented control.
|
|
14
|
+
|
|
15
|
+
## Màu
|
|
16
|
+
|
|
17
|
+
**Bật là màu trung tính, không phải màu thành công. Tắt là đang dùng được, không phải vô hiệu.**
|
|
18
|
+
|
|
19
|
+
- Bật dùng màu của nút chính: rãnh `background.neutral.bold`, núm và nhãn màu đảo (inverse). Không dùng xanh lá thành công hay vàng thương hiệu, vì công tắc cho biết một thiết lập, không phải kết quả của một thao tác.
|
|
20
|
+
- Tắt có rãnh `background.neutral`, núm màu icon và viền `border.bold`, để người dùng thấy đây là control dùng được. Không dùng màu vô hiệu cho nó.
|
|
21
|
+
- Mỗi trạng thái có màu núm riêng, đi cặp với rãnh của nó, và màu nhãn cho chữ Bật, Tắt khi sản phẩm hiện chữ trong một rãnh rộng hơn. Không đặt một núm trắng cho cả hai rãnh: trên rãnh tắt màu sáng, núm trắng biến mất.
|
|
22
|
+
|
|
23
|
+
## Trạng thái
|
|
24
|
+
|
|
25
|
+
Mọi tên màu bên dưới đều bắt đầu bằng `color.`.
|
|
26
|
+
|
|
27
|
+
| Trạng thái | Tắt | Bật | Dấu hiệu khác |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| Thường | Rãnh `background.neutral`; núm `icon`; nhãn `text`; viền `border.bold` | Rãnh và viền `background.neutral.bold`; núm `icon.inverse`; nhãn `text.inverse` | Vị trí núm và `aria-checked` |
|
|
30
|
+
| Hover | Rãnh `.hover`; núm, nhãn, viền giữ nguyên | Rãnh và viền `.hover`; núm, nhãn giữ nguyên | Trạng thái bật/tắt không đổi |
|
|
31
|
+
| Nhấn | Rãnh `.pressed`; núm, nhãn giữ nguyên; viền graphite 10 | Rãnh và viền `.pressed`; núm, nhãn giữ nguyên | Viền khi tắt vẫn đạt 3:1 so với rãnh lúc nhấn |
|
|
32
|
+
| Focus | Cùng màu với trạng thái thường | Cùng màu với trạng thái thường | Vòng focus `switch.focus-ring`, dày 2 px, cách 2 px |
|
|
33
|
+
| Đang xử lý | Cùng màu với Tắt thường | Cùng màu với Bật thường | Spinner màu `switch.{off,on}.loading-icon`; không đổi được công tắc cho tới khi lưu xong |
|
|
34
|
+
| Vô hiệu | Màu vô hiệu cho rãnh, núm, nhãn và viền | Cùng màu vô hiệu; núm vẫn ở vị trí Bật | Không dùng độ trong suốt |
|
|
35
|
+
|
|
36
|
+
Bật hoạt động giống nút chính: rãnh nằm ở graphite 12, bậc cuối của thang, nên khi hover lùi một bậc (graphite 11), khi nhấn lùi hai bậc (graphite 10). Token đã làm sẵn việc này, ở cả giao diện sáng và tối.
|
|
37
|
+
|
|
38
|
+
## Kích thước
|
|
39
|
+
|
|
40
|
+
Rãnh 36 × 20 px (`switch.size.track.width`, `switch.size.track.height`), núm 16 px (`switch.size.thumb`), cả hai dùng `radius.full`. Vùng nhận click tối thiểu 24 × 24 px, và 44 × 44 px trên màn hình cảm ứng.
|
|
41
|
+
|
|
42
|
+
## Token
|
|
43
|
+
|
|
44
|
+
<TokenTable prefix="switch" />
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Các phím, những gì Toggle 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
|
+
**Toggle 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 (toggle 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 toggle. |
|
|
14
|
+
| <kbd>Enter</kbd> hoặc <kbd>Space</kbd> | Bật hoặc tắt. |
|
|
15
|
+
|
|
16
|
+
## Những gì Toggle button có sẵn
|
|
17
|
+
|
|
18
|
+
- `aria-pressed="true"` hoặc `"false"`, được đọc là "nút bật tắt, đang bật".
|
|
19
|
+
- Trạng thái bật thể hiện bằng nền và viền, không chỉ bằng màu.
|
|
20
|
+
|
|
21
|
+
## Những gì đội của bạn cần làm
|
|
22
|
+
|
|
23
|
+
- Giữ nguyên nhãn ở cả hai trạng thái.
|
|
24
|
+
- Dùng công tắc cho thiết lập được lưu.
|
|
25
|
+
|
|
26
|
+
## Tiêu chí WCAG
|
|
27
|
+
|
|
28
|
+
| Tiêu chí | Mức | Cách đạt |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| 1.4.11 Non-text Contrast | AA | Bold border on the on state |
|
|
31
|
+
| 4.1.2 Name, Role, Value | A | `aria-pressed` |
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cài đặt, props và các phần tạo nên Toggle 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/toggle.json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Cách dùng
|
|
15
|
+
|
|
16
|
+
```vue
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { Pin } from '@lucide/vue'
|
|
19
|
+
import { ref } from 'vue'
|
|
20
|
+
import { Toggle } from '@/components/ui/toggle'
|
|
21
|
+
|
|
22
|
+
const pinned = ref(true)
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="flex items-center gap-(--bh-space-100)">
|
|
27
|
+
<Toggle v-model="pinned" variant="outline"><Pin />Ghim</Toggle>
|
|
28
|
+
<Toggle><Pin />Ghim</Toggle>
|
|
29
|
+
<Toggle variant="outline" disabled><Pin />Ghim</Toggle>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
|
|
36
|
+
| Prop | Giá trị | Ghi chú |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `v-model` (`modelValue`) | boolean | Bật hoặc tắt |
|
|
39
|
+
| `variant` | `default`, `outline` | Nút Nhẹ hoặc Mặc định |
|
|
40
|
+
| `size` | Cỡ của Button | `sm`, `default`, `lg`, `icon-sm`, `icon`, `icon-lg` |
|
|
41
|
+
| `disabled` | boolean | |
|
|
42
|
+
|
|
43
|
+
## Dựng từ
|
|
44
|
+
|
|
45
|
+
Bọc Toggle của reka-ui với API Toggle của shadcn-vue và style của Button.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ví dụ trực tiếp của Toggle button, kèm đúng file Vue tạo ra từng ví dụ.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import ToggleBasic from '../../../../registry/beehexa/examples/toggle-button/vi/ToggleBasic.vue';
|
|
6
|
+
import ToggleBasicSource from '../../../../registry/beehexa/examples/toggle-button/vi/ToggleBasic.vue?raw';
|
|
7
|
+
import ToggleIcon from '../../../../registry/beehexa/examples/toggle-button/vi/ToggleIcon.vue';
|
|
8
|
+
import ToggleIconSource from '../../../../registry/beehexa/examples/toggle-button/vi/ToggleIcon.vue?raw';
|
|
9
|
+
import ToggleFilter from '../../../../registry/beehexa/examples/toggle-button/vi/ToggleFilter.vue';
|
|
10
|
+
import ToggleFilterSource from '../../../../registry/beehexa/examples/toggle-button/vi/ToggleFilter.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
|
+
## Bật và tắt
|
|
15
|
+
|
|
16
|
+
Toggle kiểu Mặc định (outline) và Nhẹ. Khi bật: nền graphite 5 với viền đậm, nên không bao giờ giống hover.
|
|
17
|
+
|
|
18
|
+
<CodeExample source={ToggleBasicSource} file="ToggleBasic.vue">
|
|
19
|
+
<ToggleBasic client:visible />
|
|
20
|
+
</CodeExample>
|
|
21
|
+
|
|
22
|
+
## Chỉ có icon
|
|
23
|
+
|
|
24
|
+
Toggle chỉ có icon đặt tên theo lựa chọn, không theo trạng thái: "Xuống dòng".
|
|
25
|
+
|
|
26
|
+
<CodeExample source={ToggleIconSource} file="ToggleIcon.vue">
|
|
27
|
+
<ToggleIcon client:visible />
|
|
28
|
+
</CodeExample>
|
|
29
|
+
|
|
30
|
+
## Lọc danh sách
|
|
31
|
+
|
|
32
|
+
Thay đổi có hiệu lực ngay, không cần nút Lưu.
|
|
33
|
+
|
|
34
|
+
<CodeExample source={ToggleFilterSource} file="ToggleFilter.vue">
|
|
35
|
+
<ToggleFilter client:visible />
|
|
36
|
+
</CodeExample>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cấu tạo, token, kích thước và khoảng cách của Toggle button.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Token
|
|
6
|
+
|
|
7
|
+
| Phần | Token và giá trị |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Tắt | Nút Mặc định hoặc Nhẹ ở trạng thái nghỉ |
|
|
10
|
+
| Bật | Nền `button.background.selected` (graphite 5), viền `button.border.selected` (`color.border.bold`), D15 |
|
|
11
|
+
| Hover, nhấn, focus, vô hiệu | Như Button |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Khi nào dùng toggle button, 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
|
+
- Để bật tắt một chế độ hoặc một tùy chọn hiển thị trong thanh công cụ hay phía trên danh sách: Ghim, Chỉ hiện lỗi, Xuống dòng.
|
|
10
|
+
|
|
11
|
+
## Khi nào không dùng
|
|
12
|
+
|
|
13
|
+
- Cho một thiết lập được lưu, như trong biểu mẫu cài đặt. Dùng [công tắc](/vi/components/switch/usage/).
|
|
14
|
+
- Để chọn một trong nhiều lựa chọn. Dùng [segmented control](/vi/components/segmented-control/usage/).
|
|
15
|
+
|
|
16
|
+
## Trạng thái
|
|
17
|
+
|
|
18
|
+
| Trạng thái | Hình thức |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Tắt | Nút Default hoặc Subtle lúc nghỉ |
|
|
21
|
+
| Bật | Nền `button.background.selected` (graphite 5) và viền `button.border.selected` (`color.border.bold`), D15 |
|
|
22
|
+
| Hover, nhấn, focus, disabled | Như Button. Nút đang bật giữ nền khi hover |
|
|
23
|
+
|
|
24
|
+
Nền "bật" cao hơn nền hover của nút hai bậc, nên nút đang bật không bao giờ giống nút đang hover. Viền đậm là dấu hiệu thứ hai, nên trạng thái không chỉ dựa vào màu nền.
|
|
25
|
+
|
|
26
|
+
## Nội dung
|
|
27
|
+
|
|
28
|
+
Nhãn giữ nguyên ở cả hai trạng thái, như "Ghim". Có thể đổi icon nếu giúp nhận biết (ghim viền và ghim đặc), không đổi nghĩa của nhãn.
|
|
29
|
+
|
|
30
|
+
## Khả năng tiếp cận
|
|
31
|
+
|
|
32
|
+
- `aria-pressed="true"` hoặc `"false"`. Trình đọc màn hình đọc "nút bật tắt, đang nhấn".
|
|
33
|
+
- Chữ trên nền "bật": 10,7:1 ở chế độ sáng, 10,3:1 ở chế độ tối. Viền đậm đạt 3,7:1 so với nền.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Các phím, những gì Toolbar 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
|
+
**Toolbar đạ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 Toolbar](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/) 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> | Vào công cụ dùng gần nhất; Tab tiếp theo rời toolbar. |
|
|
14
|
+
| <kbd>←</kbd> <kbd>→</kbd> | Di chuyển giữa các công cụ. |
|
|
15
|
+
| <kbd>Home</kbd>, <kbd>End</kbd> | Công cụ đầu và cuối. |
|
|
16
|
+
| <kbd>Enter</kbd> hoặc <kbd>Space</kbd> | Chạy hoặc bật tắt công cụ. |
|
|
17
|
+
|
|
18
|
+
## Những gì Toolbar có sẵn
|
|
19
|
+
|
|
20
|
+
- `role="toolbar"`, mỗi lúc chỉ một công cụ trong thứ tự Tab (roving tabindex).
|
|
21
|
+
- Công cụ bật tắt có `aria-pressed`, hoặc `aria-checked` trong nhóm chọn một.
|
|
22
|
+
|
|
23
|
+
## Những gì đội của bạn cần làm
|
|
24
|
+
|
|
25
|
+
- Đặt tên cho toolbar và từng công cụ chỉ có icon.
|
|
26
|
+
- Hiện tên mỗi công cụ trong tooltip.
|
|
27
|
+
|
|
28
|
+
## Tiêu chí WCAG
|
|
29
|
+
|
|
30
|
+
| Tiêu chí | Mức | Cách đạt |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| 2.1.1 Keyboard | A | Arrow keys, Home and End |
|
|
33
|
+
| 4.1.2 Name, Role, Value | A | `role="toolbar"` with a name |
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cài đặt, props và các phần tạo nên Toolbar.
|
|
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/toolbar.json
|
|
12
|
+
npx shadcn-vue@latest add https://beehexa.design/r/tooltip.json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Cách dùng
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { Grid3x3, Magnet, Maximize, Redo2, Undo2, ZoomIn, ZoomOut } from '@lucide/vue'
|
|
20
|
+
import { ref } from 'vue'
|
|
21
|
+
import { Toolbar, ToolbarButton, ToolbarSeparator, ToolbarToggleGroup, ToolbarToggleItem } from '@/components/ui/toolbar'
|
|
22
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
|
|
23
|
+
|
|
24
|
+
const history = [
|
|
25
|
+
{ label: 'Hoàn tác', icon: Undo2 },
|
|
26
|
+
{ label: 'Làm lại', icon: Redo2 },
|
|
27
|
+
]
|
|
28
|
+
const zoom = [
|
|
29
|
+
{ label: 'Thu nhỏ', icon: ZoomOut },
|
|
30
|
+
{ label: 'Phóng to', icon: ZoomIn },
|
|
31
|
+
{ label: 'Vừa màn hình', icon: Maximize },
|
|
32
|
+
]
|
|
33
|
+
const options = [
|
|
34
|
+
{ value: 'grid', label: 'Hiện lưới', icon: Grid3x3 },
|
|
35
|
+
{ value: 'snap', label: 'Bám lưới', icon: Magnet },
|
|
36
|
+
]
|
|
37
|
+
const on = ref(['grid'])
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<TooltipProvider>
|
|
42
|
+
<Toolbar aria-label="Công cụ sơ đồ">
|
|
43
|
+
<Tooltip v-for="tool in history" :key="tool.label">
|
|
44
|
+
<TooltipTrigger as-child>
|
|
45
|
+
<ToolbarButton :aria-label="tool.label"><component :is="tool.icon" /></ToolbarButton>
|
|
46
|
+
</TooltipTrigger>
|
|
47
|
+
<TooltipContent>{{ tool.label }}</TooltipContent>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
<ToolbarSeparator />
|
|
50
|
+
<Tooltip v-for="tool in zoom" :key="tool.label">
|
|
51
|
+
<TooltipTrigger as-child>
|
|
52
|
+
<ToolbarButton :aria-label="tool.label"><component :is="tool.icon" /></ToolbarButton>
|
|
53
|
+
</TooltipTrigger>
|
|
54
|
+
<TooltipContent>{{ tool.label }}</TooltipContent>
|
|
55
|
+
</Tooltip>
|
|
56
|
+
<ToolbarSeparator />
|
|
57
|
+
<ToolbarToggleGroup v-model="on" type="multiple">
|
|
58
|
+
<Tooltip v-for="tool in options" :key="tool.value">
|
|
59
|
+
<TooltipTrigger as-child>
|
|
60
|
+
<ToolbarToggleItem :value="tool.value" :aria-label="tool.label"><component :is="tool.icon" /></ToolbarToggleItem>
|
|
61
|
+
</TooltipTrigger>
|
|
62
|
+
<TooltipContent>{{ tool.label }}</TooltipContent>
|
|
63
|
+
</Tooltip>
|
|
64
|
+
</ToolbarToggleGroup>
|
|
65
|
+
</Toolbar>
|
|
66
|
+
</TooltipProvider>
|
|
67
|
+
</template>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Props
|
|
71
|
+
|
|
72
|
+
| Prop | Giá trị | Ghi chú |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| Toolbar `aria-label` | chuỗi | Bắt buộc, như "Công cụ sơ đồ" |
|
|
75
|
+
| Toolbar `orientation` | `horizontal` (mặc định), `vertical` | |
|
|
76
|
+
| ToolbarButton `variant`, `size` | Giá trị của Button; mặc định `ghost`, `icon` | |
|
|
77
|
+
| ToolbarToggleGroup `type` | `single`, `multiple` | `v-model` giữ giá trị hoặc danh sách |
|
|
78
|
+
|
|
79
|
+
## Dựng từ
|
|
80
|
+
|
|
81
|
+
Bọc Toolbar của reka-ui. Công cụ dùng style của Button; công cụ bật tắt dùng dáng bật của toggle button.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ví dụ trực tiếp của Toolbar, kèm đúng file Vue tạo ra từng ví dụ.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import ToolbarDiagram from '../../../../registry/beehexa/examples/toolbar/vi/ToolbarDiagram.vue';
|
|
6
|
+
import ToolbarDiagramSource from '../../../../registry/beehexa/examples/toolbar/vi/ToolbarDiagram.vue?raw';
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
## Công cụ sơ đồ
|
|
11
|
+
|
|
12
|
+
Lịch sử, thu phóng và tùy chọn hiển thị, chia nhóm bằng vạch. Lưới và Bám lưới là công cụ bật tắt.
|
|
13
|
+
|
|
14
|
+
<CodeExample source={ToolbarDiagramSource} file="ToolbarDiagram.vue">
|
|
15
|
+
<ToolbarDiagram client:visible />
|
|
16
|
+
</CodeExample>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cấu tạo, token, kích thước và khoảng cách của Toolbar.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Token
|
|
6
|
+
|
|
7
|
+
| Phần | Token và giá trị |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Khung | `color.surface`, viền `color.border`, `radius.control`, padding `space.050` |
|
|
10
|
+
| Công cụ | Nút icon kiểu Nhẹ, `size.control.default`, cách nhau `space.050` |
|
|
11
|
+
| Vạch chia | `border.width.default` màu `color.border`, hai bên `space.050` |
|
|
12
|
+
| Đang bật | `button.background.selected`, `button.border.selected` |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Khi nào dùng thanh công cụ, 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
|
+
- Phía trên canvas, sơ đồ hoặc editor: hoàn tác, làm lại, phóng to, vừa khung.
|
|
10
|
+
- Khi có hơn khoảng năm công cụ liên quan được dùng lặp lại nhiều.
|
|
11
|
+
|
|
12
|
+
## Khi nào không dùng
|
|
13
|
+
|
|
14
|
+
- Cho hai, ba thao tác ở cuối biểu mẫu. Dùng [nhóm nút](/vi/components/button-group/usage/).
|
|
15
|
+
- Cho điều hướng trang. Dùng tab hoặc menu.
|
|
16
|
+
|
|
17
|
+
## Cấu tạo
|
|
18
|
+
|
|
19
|
+
| Phần | Ghi chú |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| Khung | `color.surface`, viền `color.border`, `radius.control`, lề trong `space.050` |
|
|
22
|
+
| Công cụ | Nút chỉ có icon (Subtle), toggle button, nút mở menu |
|
|
23
|
+
| Đường chia | 1 px `color.border` giữa các nhóm công cụ |
|
|
24
|
+
|
|
25
|
+
## Bàn phím
|
|
26
|
+
|
|
27
|
+
| Phím | Tác dụng |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Tab | Vào thanh công cụ ở công cụ dùng gần nhất; Tab tiếp theo thì rời đi |
|
|
30
|
+
| Mũi tên trái và phải | Di chuyển giữa các công cụ |
|
|
31
|
+
| Home, End | Công cụ đầu và cuối |
|
|
32
|
+
|
|
33
|
+
## Khả năng tiếp cận
|
|
34
|
+
|
|
35
|
+
- `role="toolbar"` và `aria-label`, như "Công cụ sơ đồ".
|
|
36
|
+
- Mỗi lúc chỉ một công cụ nằm trong thứ tự Tab (roving tabindex).
|
|
@@ -29,8 +29,9 @@ Bảng này giải thích các chuẩn liên quan với nhau thế nào. Đây k
|
|
|
29
29
|
## Cách chúng tôi kiểm tra
|
|
30
30
|
|
|
31
31
|
- **Mỗi lần build** kiểm tương phản của mọi cặp màu chữ, icon và viền ở giao diện sáng và tối. Một cặp không đạt sẽ làm build dừng lại.
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
32
|
+
- **Ngày 4 tháng 11 năm 2026**, mọi trang của site này được kiểm bằng axe ở giao diện sáng và tối, và ở độ rộng 320 px.
|
|
33
|
+
- **Ngày 6 tháng 11 năm 2026**, cả 186 trang, tiếng Anh và tiếng Việt, được kiểm lại bằng axe theo các quy tắc WCAG 2.2 mức A và AA, ở giao diện sáng và tối. Lỗi trên các trang của chính site này đã được sửa; những lỗi còn lại ghi ở bảng dưới.
|
|
34
|
+
- Các team sản phẩm làm theo các bước kiểm trong [Kiểm thử](/vi/foundations/guidelines/accessibility/testing/) trước khi phát hành một màn hình.
|
|
34
35
|
|
|
35
36
|
## Lỗi đã biết
|
|
36
37
|
|
|
@@ -39,6 +40,7 @@ Bảng này giải thích các chuẩn liên quan với nhau thế nào. Đây k
|
|
|
39
40
|
| Trang tiếng Việt | Trang chưa có bản tiếng Việt hiện bản tiếng Anh, được đánh dấu là tiếng Anh cho trình đọc màn hình. | Đang làm |
|
|
40
41
|
| Báo cáo tuân thủ | Báo cáo tuân thủ (ACR) đầu tiên, theo mẫu VPAT®, sẽ bao gồm site này và Button, và sẽ được đăng trên trang này. | Đã lên kế hoạch |
|
|
41
42
|
| Trình đọc màn hình | Site này và Button chưa được kiểm với NVDA, JAWS, VoiceOver hay TalkBack. | Đã lên kế hoạch |
|
|
43
|
+
| Trang Theme Ant Design Vue | Trong các ví dụ framework chạy trực tiếp trên trang này, bốn ô select của Ant Design Vue 4.2.6 thiếu `aria-expanded` và trỏ tới danh sách chưa có trong trang khi chưa mở. | Đang làm |
|
|
42
44
|
|
|
43
45
|
## Góp ý
|
|
44
46
|
|
|
@@ -10,7 +10,7 @@ updated: 2026-11-04
|
|
|
10
10
|
|
|
11
11
|
## Trước khi bàn giao (designer)
|
|
12
12
|
|
|
13
|
-
- **Tương phản**: chữ và icon dùng các cặp token trong [
|
|
13
|
+
- **Tương phản**: chữ và icon dùng các cặp token trong [khả năng tiếp cận của màu](/vi/foundations/styles/color/accessibility/). Tự kiểm chữ trên hình và biểu đồ.
|
|
14
14
|
- **Không chỉ dùng màu**: mọi trạng thái, lỗi và lựa chọn đều có chữ, icon hoặc một dấu hiệu thứ hai.
|
|
15
15
|
- **Thứ tự focus**: đánh số các điểm dừng Tab trên frame. Ghi rõ focus đi đâu khi dialog, drawer hay menu mở và đóng.
|
|
16
16
|
- **Tên gọi**: viết điều trình đọc màn hình cần đọc cho mọi nút chỉ có icon và mọi hình. Đánh dấu hình trang trí là hình trang trí.
|