@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,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Nút đạt WCAG 2.2 AA thế nào, các phím, những gì nút 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
|
+
**Nút đạt WCAG 2.2 mức AA khi được dùng như mô tả trên trang này.** Nút 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. Nút vô hiệu bị bỏ qua; nút chưa dùng được (`aria-disabled`) và nút đang xử lý thì không. |
|
|
14
|
+
| <kbd>Enter</kbd> hoặc <kbd>Space</kbd> | Kích hoạt nút. |
|
|
15
|
+
|
|
16
|
+
## Những gì nút có sẵn
|
|
17
|
+
|
|
18
|
+
- Phần tử `<button>` gốc với `type="button"`, nên có sẵn vai trò, cách dùng bàn phím và focus của một nút.
|
|
19
|
+
- Vòng focus 2 px màu `color.border.focus`, cách nút 2 px (`border.width.focused`, `state.focus.offset`).
|
|
20
|
+
- Chiều cao 24, 32 và 40 px, đều đạt vùng chạm tối thiểu 24 × 24 px; trên màn hình cảm ứng, vùng chạm tăng lên 44 × 44 px (`size.target.touch`).
|
|
21
|
+
- Chữ và nền đạt 4.5:1 ở mọi trạng thái trừ vô hiệu, ở giao diện sáng và tối.
|
|
22
|
+
- Trạng thái vô hiệu bị bỏ khỏi thứ tự Tab và được đọc là không dùng được.
|
|
23
|
+
- Trạng thái chưa dùng được (`aria-disabled="true"`) vẫn nằm trong thứ tự Tab, nên người dùng tới được và đọc được lý do bên cạnh.
|
|
24
|
+
- Trạng thái đang xử lý giữ màu và focus của nút; spinner bị ẩn với trình đọc màn hình.
|
|
25
|
+
|
|
26
|
+
## Những gì đội của bạn cần làm
|
|
27
|
+
|
|
28
|
+
- **Đặt tên.** Bắt đầu nhãn bằng động từ: "Đồng bộ đơn hàng", không viết "OK". Nút chỉ có icon cần `aria-label` nói rõ thao tác, như "Xóa cửa hàng".
|
|
29
|
+
- **Dùng liên kết để chuyển trang.** Nút làm một việc; liên kết dẫn tới một trang.
|
|
30
|
+
- **Nói điều đã xảy ra.** Khi nút hiện trạng thái đang xử lý, hãy thông báo kết quả khi xong, ví dụ bằng toast hoặc live region: "Đã đồng bộ đơn hàng".
|
|
31
|
+
- **Tránh vô hiệu hóa.** Nút vô hiệu không giải thích được vì sao. Nên giữ nút hoạt động và chỉ ra điều còn thiếu khi người dùng bấm. Nếu nút buộc phải trông như chưa dùng được, dùng `aria-disabled="true"`, nối lý do bằng `aria-describedby`, và bỏ qua cú nhấp trong code.
|
|
32
|
+
- **Đang xử lý.** Đặt `aria-busy="true"`, đổi nhãn để nói việc đang làm, bỏ qua cú nhấp cho tới khi xong, rồi thông báo kết quả.
|
|
33
|
+
- **Thẻ mới.** Liên kết mở thẻ mới phải nói điều đó bằng chữ ẩn: "(mở trong thẻ mới)".
|
|
34
|
+
- **Nút bật/tắt** đặt `aria-pressed="true"` hoặc `"false"`, hoặc đổi nhãn, như "Tạm dừng" và "Phát".
|
|
35
|
+
|
|
36
|
+
## Tiêu chí WCAG
|
|
37
|
+
|
|
38
|
+
| Tiêu chí | Mức | Nút đáp ứng thế nào |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| 1.4.3 Contrast (Minimum) | AA | Nhãn đạt 4.5:1 ở mọi trạng thái đang dùng được |
|
|
41
|
+
| 1.4.11 Non-text Contrast | AA | Viền và vòng focus đạt 3:1 |
|
|
42
|
+
| 2.1.1 Keyboard | A | Nút gốc: Tab, Enter và Space |
|
|
43
|
+
| 2.4.7 Focus Visible | AA | Vòng focus 2 px khi `:focus-visible` |
|
|
44
|
+
| 2.5.3 Label in Name | A | Tên truy cập là nhãn nhìn thấy |
|
|
45
|
+
| 2.5.8 Target Size (Minimum) | AA | Mọi chiều cao đều ít nhất 24 px |
|
|
46
|
+
| 4.1.2 Name, Role, Value | A | Vai trò nút gốc; tên từ nhãn hoặc `aria-label` |
|
|
47
|
+
|
|
48
|
+
## Kiểm tra
|
|
49
|
+
|
|
50
|
+
| Kiểm tra | Trạng thái | Ngày |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| Tự động (axe, WCAG 2.2 AA), sáng và tối | Đạt | 4 tháng 11 năm 2026 |
|
|
53
|
+
| Bàn phím | Đạt | 4 tháng 11 năm 2026 |
|
|
54
|
+
| Vùng chạm, cỡ màn hình điện thoại | Đạt | 4 tháng 11 năm 2026 |
|
|
55
|
+
| Trình đọc màn hình (NVDA, VoiceOver) | Dự kiến | |
|
|
56
|
+
| Trạng thái đang xử lý và chưa dùng được, bàn phím và axe | Dự kiến | |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## 0.3.0 – 7 tháng 11 năm 2026
|
|
5
|
+
|
|
6
|
+
- Sửa lỗi: Primary và Danger không đổi màu khi nhấn, vì rule hover nặng hơn rule nhấn.
|
|
7
|
+
- Nút Subtle và Default: nền khi hover và khi nhấn đậm hơn (graphite 3 và 4), qua hai token component `button.background.subtle.hover` và `button.background.subtle.pressed`. Dòng bảng và mục menu không đổi.
|
|
8
|
+
- Nút Default: viền đậm lên một bậc khi hover và khi nhấn (`color.border.hover`).
|
|
9
|
+
- Toggle đang bật (`aria-pressed="true"`): nền `button.background.selected` kèm viền đậm.
|
|
10
|
+
- Subtle, Subtle danger và Link: không nền, không viền khi chưa dùng được hoặc disabled; chỉ chữ chuyển xám.
|
|
11
|
+
- Nút mở menu giữ dáng đang nhấn khi menu còn mở (`aria-expanded="true"`).
|
|
12
|
+
- Spinner là icon `loader-circle` của Lucide, hiện sau 300 ms, mỗi giây một vòng.
|
|
13
|
+
- Icon lấy từ gói Lucide thay cho SVG viết tay.
|
|
14
|
+
- Thêm tab Thông số: cấu tạo, token màu theo biến thể và trạng thái, kích thước, khoảng cách và chuyển động.
|
|
15
|
+
- Ví dụ: bản xem trước có thể đặt trên nền ca rô trong suốt, nền sáng hoặc nền tối.
|
|
16
|
+
- Sửa lỗi: nút đang xử lý hiện cả icon lẫn spinner; giờ spinner thế chỗ icon.
|
|
17
|
+
- Chưa dùng được: lý do chuyển từ dòng chữ dưới nút sang tooltip (component Tooltip mới), như cả năm hệ đã khảo sát có hướng dẫn cho nút disabled focus được.
|
|
18
|
+
- Ví dụ là file Vue thật: sao chép, mở trong StackBlitz, thu gọn code dài, thấy tên file.
|
|
19
|
+
- Sửa lỗi: chữ trong bản xem trước nền sáng hoặc tối giữ màu của trang.
|
|
20
|
+
|
|
21
|
+
## 0.2.0 – 7 tháng 11 năm 2026
|
|
22
|
+
|
|
23
|
+
- Trạng thái nhấn cho mọi biến thể, kích cỡ nhỏ và lớn, nút chỉ có icon, toàn chiều rộng, và tông nguy hiểm trên nút nhẹ.
|
|
24
|
+
- Trạng thái đang xử lý (`aria-busy`) và chưa dùng được (`aria-disabled` kèm lý do).
|
|
25
|
+
- Thêm tab Code: class, thuộc tính, design token và giới hạn.
|
|
26
|
+
- shadcn-vue: registry của Beehexa gồm Button và theme nối biến của shadcn-vue với token Beehexa (`/r/button.json`, `/r/beehexa-theme.json`).
|
|
27
|
+
- Cách dùng: cấu tạo, các cách kết hợp được phép, vị trí và thứ tự, và bảng động từ Anh–Việt cho nhãn.
|
|
28
|
+
|
|
29
|
+
## 0.1.0 – 20 tháng 10 năm 2026
|
|
30
|
+
|
|
31
|
+
- Tài liệu đầu tiên cho Nút. Early Access.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Class, thuộc tính và design token của Button, mã cho từng trạng thái, và những gì Button chưa làm.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## shadcn-vue
|
|
6
|
+
|
|
7
|
+
Tab Ví dụ dùng chính component này. Với app Vue dùng [shadcn-vue](https://www.shadcn-vue.com/) và Tailwind CSS v4, Beehexa có registry riêng. Button giữ nguyên API của shadcn-vue, nên mã sẵn có vẫn chạy, nhưng dùng design token của Beehexa thay cho giá trị mặc định của shadcn.
|
|
8
|
+
|
|
9
|
+
### Cài đặt
|
|
10
|
+
|
|
11
|
+
Chạy trong app, sau `shadcn-vue init`:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @beehexa/design-tokens
|
|
15
|
+
npx shadcn-vue@latest add https://beehexa.design/r/beehexa-theme.json
|
|
16
|
+
npx shadcn-vue@latest add https://beehexa.design/r/button.json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Rồi import token và theme sau Tailwind:
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
@import 'tailwindcss';
|
|
23
|
+
@import '@beehexa/design-tokens/css';
|
|
24
|
+
@import './assets/beehexa-shadcn.css';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Theme nối các biến màu và bo góc của shadcn-vue với token Beehexa, nên các component shadcn-vue khác cũng theo màu Beehexa. Giao diện tối theo `data-theme="dark"` trên `<html>`, giống site này.
|
|
28
|
+
|
|
29
|
+
### Dùng
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import { Ellipsis } from '@lucide/vue'
|
|
34
|
+
import { Button } from '@/components/ui/button'
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<Button variant="outline">Kiểm tra kết nối</Button>
|
|
39
|
+
<Button :loading="saving">{{ saving ? 'Đang lưu…' : 'Lưu kết nối' }}</Button>
|
|
40
|
+
<Button variant="ghost-destructive" size="sm">Gỡ</Button>
|
|
41
|
+
<Button variant="ghost" size="icon" aria-label="Thêm thao tác">
|
|
42
|
+
<Ellipsis />
|
|
43
|
+
</Button>
|
|
44
|
+
<Button as-child variant="outline">
|
|
45
|
+
<a href="/connections">Tất cả kết nối</a>
|
|
46
|
+
</Button>
|
|
47
|
+
</template>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Props
|
|
51
|
+
|
|
52
|
+
| Prop | Giá trị | Mặc định | Ý nghĩa ở Beehexa |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| `variant` | `default` | `default` | Chính |
|
|
55
|
+
| | `outline`, `secondary` | | Mặc định. Beehexa không có nút phụ tô nền, nên hai giá trị trông giống nhau |
|
|
56
|
+
| | `ghost` | | Nhẹ |
|
|
57
|
+
| | `destructive` | | Nguy hiểm |
|
|
58
|
+
| | `ghost-destructive` | | Tông nguy hiểm trên nút nhẹ (Beehexa thêm) |
|
|
59
|
+
| | `link` | | Thao tác nằm trong đoạn chữ; luôn gạch chân |
|
|
60
|
+
| `size` | `sm`, `default`, `lg` | `default` | 24, 32 và 40 px; `xs` giống `sm` |
|
|
61
|
+
| | `icon-sm`, `icon`, `icon-lg` | | Nút vuông chỉ có icon 24, 32 và 40 px; `icon-xs` giống `icon-sm` |
|
|
62
|
+
| `loading` | `boolean` | `false` | Beehexa thêm: spinner thay icon, `aria-busy`, bỏ qua cú nhấp |
|
|
63
|
+
| `as`, `asChild` | | `'button'` | Dùng phần tử khác, như liên kết của router |
|
|
64
|
+
|
|
65
|
+
Truyền `aria-disabled="true"` cùng `aria-describedby` cho nút chưa dùng được: nút vẫn focus được và bỏ qua cú nhấp. Chỉ dùng `disabled` cho lúc chờ ngắn.
|
|
66
|
+
|
|
67
|
+
Mã nguồn nằm trong `registry/beehexa/` của repo beehexa.design; `node scripts/build-registry.mjs` ghi các file được phục vụ ở `/r/`.
|
|
68
|
+
|
|
69
|
+
## HTML và CSS, không dùng framework
|
|
70
|
+
|
|
71
|
+
Trên site này và ở mọi trang không dùng Vue, Button chỉ dùng CSS: thêm class vào thẻ `button` gốc, hoặc vào thẻ `a` khi nút dẫn sang trang khác. Style nằm trong bộ kit của site và chỉ dùng design token.
|
|
72
|
+
|
|
73
|
+
| Class | Tác dụng |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| `bh-button` | Bắt buộc. Biến thể mặc định, kích cỡ mặc định |
|
|
76
|
+
| `bh-button-primary` | Biến thể chính |
|
|
77
|
+
| `bh-button-subtle` | Biến thể nhẹ: không nền, không viền khi nghỉ |
|
|
78
|
+
| `bh-button-danger` | Nguy hiểm. Đi cùng `bh-button-subtle` thì thành tông nguy hiểm trên nút nhẹ |
|
|
79
|
+
| `bh-button-small`, `bh-button-large` | 24 px hoặc 40 px thay cho 32 px |
|
|
80
|
+
| `bh-button-icon` | Chỉ có icon: hình vuông cao bằng nút |
|
|
81
|
+
| `bh-button-block` | Toàn chiều rộng |
|
|
82
|
+
| `bh-button-row` | Một hàng nút cách nhau `space.100`; thêm `is-end` để dồn về cuối |
|
|
83
|
+
|
|
84
|
+
## Thuộc tính
|
|
85
|
+
|
|
86
|
+
| Thuộc tính | Khi nào |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| `type="button"` | Luôn luôn, trừ khi nút gửi biểu mẫu (`type="submit"`) |
|
|
89
|
+
| `aria-label` | Nút chỉ có icon. Nếu nút cũng có chữ hiện ra, tên phải chứa chữ đó |
|
|
90
|
+
| `aria-busy="true"` | Khi đang xử lý. Code của bạn bỏ qua cú nhấp cho tới khi gỡ thuộc tính này |
|
|
91
|
+
| `aria-disabled="true"` cùng `aria-describedby` | Chưa dùng được nhưng vẫn focus được; trỏ tới đoạn chữ ghi lý do |
|
|
92
|
+
| `disabled` | Chỉ cho lúc chờ ngắn; gỡ nút khỏi thứ tự Tab |
|
|
93
|
+
| `aria-haspopup`, `aria-expanded` | Nút mở menu |
|
|
94
|
+
| `aria-pressed` | Nút bật/tắt trong thanh công cụ |
|
|
95
|
+
| `target="_blank" rel="noopener noreferrer"` | Liên kết mở thẻ mới; thêm icon liên kết ra ngoài và chữ ẩn "(mở trong thẻ mới)" |
|
|
96
|
+
|
|
97
|
+
## Mã cho từng trạng thái
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<!-- Đang xử lý: giữ nhãn, thay icon bằng spinner -->
|
|
101
|
+
<button class="bh-button bh-button-primary" type="button" aria-busy="true">
|
|
102
|
+
<svg aria-hidden="true" class="bh-button-spinner" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>
|
|
103
|
+
Đang đồng bộ…
|
|
104
|
+
</button>
|
|
105
|
+
|
|
106
|
+
<!-- Chưa dùng được: lý do là phần mô tả của nút, hiện trong tooltip khi hover và focus -->
|
|
107
|
+
<button class="bh-button bh-button-primary" type="button"
|
|
108
|
+
aria-disabled="true" aria-describedby="sync-why">Chạy đồng bộ</button>
|
|
109
|
+
<div role="tooltip" id="sync-why" hidden>Kết nối cửa hàng online trước.</div>
|
|
110
|
+
|
|
111
|
+
<!-- Chỉ có icon -->
|
|
112
|
+
<button class="bh-button bh-button-subtle bh-button-icon" type="button"
|
|
113
|
+
aria-label="Đồng bộ ngay" title="Đồng bộ ngay">…icon…</button>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Spinner là icon `loader-circle` của Lucide. `kit.css` làm nó quay và chỉ hiện khi chờ quá `motion.wait.spinner` (300 ms), để thao tác nhanh không bị nháy. Khi người dùng bật giảm chuyển động, spinner quay chậm lại chứ không dừng: nó cho biết việc đang chạy.
|
|
117
|
+
|
|
118
|
+
## Design token
|
|
119
|
+
|
|
120
|
+
Button dùng token chức năng và bốn token component cho nền hover, nhấn và trạng thái bật của nút trung tính (xem tab Thông số). Cả bốn đều trỏ về token chức năng, nên khi đổi theme nút tự đổi theo.
|
|
121
|
+
|
|
122
|
+
| Phần | Token |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| Chính | `color.background.primary`, `.hover`, `.pressed`; `color.text.inverse` |
|
|
125
|
+
| Mặc định | `color.surface`, `color.border`, `color.text`; `button.background.subtle.hover`, `.pressed`; `color.border.hover` |
|
|
126
|
+
| Nhẹ | trong suốt; `button.background.subtle.hover`, `.pressed` |
|
|
127
|
+
| Đang bật và menu đang mở | `button.background.selected`, `button.border.selected`; `button.background.subtle.pressed` |
|
|
128
|
+
| Nguy hiểm | `color.background.danger.bold`, `.hover`, `.pressed`; `color.text.on-bold` |
|
|
129
|
+
| Tông nguy hiểm trên nút nhẹ | `color.text.danger`; `color.background.danger.subtle.hover`, `.pressed` |
|
|
130
|
+
| Vô hiệu và chưa dùng được | `color.background.disabled`, `color.border.disabled`, `color.text.disabled` |
|
|
131
|
+
| Focus | `color.border.focus`, `border.width.focused`, `state.focus.offset` |
|
|
132
|
+
| Kích cỡ | `size.control.small`, `.default`, `.large`; `space.control.x.small`, `space.control.x`, `space.control.x.large`; `space.control.gap`; `size.icon.default` |
|
|
133
|
+
| Hình dạng và chữ | `radius.control`, `radius.control.small`; `border.width.default`; `font.label.default`, `font.label.small` |
|
|
134
|
+
| Chuyển động | `motion.control` cho đổi màu |
|
|
135
|
+
|
|
136
|
+
## Giới hạn
|
|
137
|
+
|
|
138
|
+
- Nhãn không xuống dòng. Hãy viết ngắn.
|
|
139
|
+
- Các loại nút liên quan là component riêng: [icon button](/vi/components/icon-button/usage/), [button group](/vi/components/button-group/usage/), [menu button](/vi/components/menu-button/usage/), [split button](/vi/components/split-button/usage/), [toggle button](/vi/components/toggle-button/usage/), [toolbar](/vi/components/toolbar/usage/), [action bar](/vi/components/action-bar/usage/) và [segmented control](/vi/components/segmented-control/usage/).
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Nút thật cho mọi biến thể, kích cỡ và trạng thái, kèm đúng file Vue tạo ra từng ví dụ.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import ButtonEmphasis from '../../../../registry/beehexa/examples/button/vi/ButtonEmphasis.vue';
|
|
6
|
+
import ButtonEmphasisSource from '../../../../registry/beehexa/examples/button/vi/ButtonEmphasis.vue?raw';
|
|
7
|
+
import ButtonDanger from '../../../../registry/beehexa/examples/button/vi/ButtonDanger.vue';
|
|
8
|
+
import ButtonDangerSource from '../../../../registry/beehexa/examples/button/vi/ButtonDanger.vue?raw';
|
|
9
|
+
import ButtonSizes from '../../../../registry/beehexa/examples/button/vi/ButtonSizes.vue';
|
|
10
|
+
import ButtonSizesSource from '../../../../registry/beehexa/examples/button/vi/ButtonSizes.vue?raw';
|
|
11
|
+
import ButtonWithIcon from '../../../../registry/beehexa/examples/button/vi/ButtonWithIcon.vue';
|
|
12
|
+
import ButtonWithIconSource from '../../../../registry/beehexa/examples/button/vi/ButtonWithIcon.vue?raw';
|
|
13
|
+
import ButtonIconOnly from '../../../../registry/beehexa/examples/button/vi/ButtonIconOnly.vue';
|
|
14
|
+
import ButtonIconOnlySource from '../../../../registry/beehexa/examples/button/vi/ButtonIconOnly.vue?raw';
|
|
15
|
+
import ButtonLoading from '../../../../registry/beehexa/examples/button/vi/ButtonLoading.vue';
|
|
16
|
+
import ButtonLoadingSource from '../../../../registry/beehexa/examples/button/vi/ButtonLoading.vue?raw';
|
|
17
|
+
import ButtonUnavailable from '../../../../registry/beehexa/examples/button/vi/ButtonUnavailable.vue';
|
|
18
|
+
import ButtonUnavailableSource from '../../../../registry/beehexa/examples/button/vi/ButtonUnavailable.vue?raw';
|
|
19
|
+
import ButtonDisabled from '../../../../registry/beehexa/examples/button/vi/ButtonDisabled.vue';
|
|
20
|
+
import ButtonDisabledSource from '../../../../registry/beehexa/examples/button/vi/ButtonDisabled.vue?raw';
|
|
21
|
+
import ButtonFullWidth from '../../../../registry/beehexa/examples/button/vi/ButtonFullWidth.vue';
|
|
22
|
+
import ButtonFullWidthSource from '../../../../registry/beehexa/examples/button/vi/ButtonFullWidth.vue?raw';
|
|
23
|
+
import ButtonOrder from '../../../../registry/beehexa/examples/button/vi/ButtonOrder.vue';
|
|
24
|
+
import ButtonOrderSource from '../../../../registry/beehexa/examples/button/vi/ButtonOrder.vue?raw';
|
|
25
|
+
import ButtonAsLink from '../../../../registry/beehexa/examples/button/vi/ButtonAsLink.vue';
|
|
26
|
+
import ButtonAsLinkSource from '../../../../registry/beehexa/examples/button/vi/ButtonAsLink.vue?raw';
|
|
27
|
+
import ButtonLink from '../../../../registry/beehexa/examples/button/vi/ButtonLink.vue';
|
|
28
|
+
import ButtonLinkSource from '../../../../registry/beehexa/examples/button/vi/ButtonLink.vue?raw';
|
|
29
|
+
|
|
30
|
+
Mỗi ví dụ là một file Vue đầy đủ dùng Button của Beehexa cho shadcn-vue, cùng component với tab Code. Sao chép vào app đã cài registry, hoặc mở trong StackBlitz để sửa thử.
|
|
31
|
+
|
|
32
|
+
## Mức nhấn
|
|
33
|
+
|
|
34
|
+
Một nút chính cho thao tác chính, nút mặc định cho các thao tác còn lại, nút nhẹ ở nơi viền gây rối mắt.
|
|
35
|
+
|
|
36
|
+
<CodeExample source={ButtonEmphasisSource} file="ButtonEmphasis.vue">
|
|
37
|
+
<ButtonEmphasis client:visible />
|
|
38
|
+
</CodeExample>
|
|
39
|
+
|
|
40
|
+
## Nguy hiểm
|
|
41
|
+
|
|
42
|
+
Nút nguy hiểm dùng để xác nhận thao tác xóa dữ liệu hoặc không thể hoàn tác. Trong một dòng của bảng, dùng tông nguy hiểm trên nút nhẹ.
|
|
43
|
+
|
|
44
|
+
<CodeExample source={ButtonDangerSource} file="ButtonDanger.vue">
|
|
45
|
+
<ButtonDanger client:visible />
|
|
46
|
+
</CodeExample>
|
|
47
|
+
|
|
48
|
+
## Kích cỡ
|
|
49
|
+
|
|
50
|
+
Chọn chiều cao bằng với ô nhập bên cạnh: nhỏ (24 px) trong bảng dày và thanh công cụ, mặc định (32 px) ở mọi nơi khác, lớn (40 px) ở trang đăng nhập và onboarding.
|
|
51
|
+
|
|
52
|
+
<CodeExample source={ButtonSizesSource} file="ButtonSizes.vue">
|
|
53
|
+
<ButtonSizes client:visible />
|
|
54
|
+
</CodeExample>
|
|
55
|
+
|
|
56
|
+
## Có icon
|
|
57
|
+
|
|
58
|
+
Icon đặt trước nhãn. Icon phía sau chỉ dùng cho liên kết ra ngoài hoặc mũi tên mở menu. Icon chỉ để trang trí; Lucide tự gắn aria-hidden.
|
|
59
|
+
|
|
60
|
+
<CodeExample source={ButtonWithIconSource} file="ButtonWithIcon.vue">
|
|
61
|
+
<ButtonWithIcon client:visible />
|
|
62
|
+
</CodeExample>
|
|
63
|
+
|
|
64
|
+
## Chỉ có icon
|
|
65
|
+
|
|
66
|
+
Hình vuông, cao bằng một nút. Tên đặt trong aria-label và cũng hiện khi hover và focus. Các nút chỉ có icon trong một hàng cách nhau 12 px. Xem thêm [nút chỉ có icon](/vi/components/icon-button/usage/).
|
|
67
|
+
|
|
68
|
+
<CodeExample source={ButtonIconOnlySource} file="ButtonIconOnly.vue">
|
|
69
|
+
<ButtonIconOnly client:visible />
|
|
70
|
+
</CodeExample>
|
|
71
|
+
|
|
72
|
+
## Đang xử lý
|
|
73
|
+
|
|
74
|
+
Nút giữ nguyên màu và focus. Sau 300 ms spinner thay cho icon, nhãn nói việc đang làm, và mọi cú nhấp bị bỏ qua cho tới khi xong.
|
|
75
|
+
|
|
76
|
+
<CodeExample source={ButtonLoadingSource} file="ButtonLoading.vue">
|
|
77
|
+
<ButtonLoading client:visible />
|
|
78
|
+
</CodeExample>
|
|
79
|
+
|
|
80
|
+
## Chưa dùng được, kèm lý do
|
|
81
|
+
|
|
82
|
+
Khi một thao tác chưa chạy được, giữ nút focus được bằng aria-disabled và ghi lý do trong tooltip, như số đông design system có nút disabled focus được: cả năm hệ có hướng dẫn cho loại nút này đều đặt lý do trong tooltip, không hệ nào đặt dòng chữ dưới nút. Người dùng bàn phím tới được nút, và tooltip mở cả khi focus lẫn khi hover.
|
|
83
|
+
|
|
84
|
+
<CodeExample source={ButtonUnavailableSource} file="ButtonUnavailable.vue">
|
|
85
|
+
<ButtonUnavailable client:visible />
|
|
86
|
+
</CodeExample>
|
|
87
|
+
|
|
88
|
+
## Vô hiệu
|
|
89
|
+
|
|
90
|
+
Thuộc tính disabled gỡ nút khỏi thứ tự Tab. Chỉ dùng cho một lúc chờ ngắn mà người dùng đã hiểu, như khi biểu mẫu đang tải.
|
|
91
|
+
|
|
92
|
+
<CodeExample source={ButtonDisabledSource} file="ButtonDisabled.vue">
|
|
93
|
+
<ButtonDisabled client:visible />
|
|
94
|
+
</CodeExample>
|
|
95
|
+
|
|
96
|
+
## Toàn chiều rộng
|
|
97
|
+
|
|
98
|
+
Cho các panel hẹp và màn hình điện thoại, như biểu mẫu đăng nhập.
|
|
99
|
+
|
|
100
|
+
<CodeExample source={ButtonFullWidthSource} file="ButtonFullWidth.vue">
|
|
101
|
+
<ButtonFullWidth client:visible />
|
|
102
|
+
</CodeExample>
|
|
103
|
+
|
|
104
|
+
## Thứ tự trong hộp thoại và trên trang
|
|
105
|
+
|
|
106
|
+
Trong hộp thoại, drawer và chân trang wizard, nút nằm ở cuối và nút chính đứng sau cùng. Trong biểu mẫu trên trang, nút nằm ở đầu và nút chính đứng trước.
|
|
107
|
+
|
|
108
|
+
<CodeExample source={ButtonOrderSource} file="ButtonOrder.vue">
|
|
109
|
+
<ButtonOrder client:visible />
|
|
110
|
+
</CodeExample>
|
|
111
|
+
|
|
112
|
+
## Liên kết trông như nút
|
|
113
|
+
|
|
114
|
+
Khi nút dẫn tới trang khác, dùng as="a" để nút thành thẻ a. Nó giữ hành vi của liên kết: mở tab mới, sao chép địa chỉ.
|
|
115
|
+
|
|
116
|
+
<CodeExample source={ButtonAsLinkSource} file="ButtonAsLink.vue">
|
|
117
|
+
<ButtonAsLink client:visible />
|
|
118
|
+
</CodeExample>
|
|
119
|
+
|
|
120
|
+
## Link
|
|
121
|
+
|
|
122
|
+
Hành động nằm trong câu chữ. Luôn có gạch chân.
|
|
123
|
+
|
|
124
|
+
<CodeExample source={ButtonLinkSource} file="ButtonLink.vue">
|
|
125
|
+
<ButtonLink client:visible />
|
|
126
|
+
</CodeExample>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cấu tạo, token màu cho mọi biến thể và trạng thái, kích thước và khoảng cách của Button.
|
|
3
|
+
---
|
|
4
|
+
import TokenTable from '../../../components/TokenTable.astro';
|
|
5
|
+
|
|
6
|
+
## Cấu tạo
|
|
7
|
+
|
|
8
|
+
**Một nút có một khung và tối đa bốn phần bên trong.** Chỉ nhãn là bắt buộc, trừ nút chỉ có icon.
|
|
9
|
+
|
|
10
|
+
1. **Khung.** Mang nền, viền và bo góc.
|
|
11
|
+
2. **Icon đứng trước.** Không bắt buộc, 16 px, đặt trước nhãn.
|
|
12
|
+
3. **Nhãn.** Một động từ, hoặc động từ và danh từ, viết hoa chữ đầu câu.
|
|
13
|
+
4. **Icon đứng sau.** Chỉ dùng cho icon mở tab mới hoặc mũi tên menu.
|
|
14
|
+
5. **Spinner.** Thay chỗ icon đứng trước khi nút đang xử lý.
|
|
15
|
+
|
|
16
|
+
Vòng focus nằm ngoài khung: dày 2 px, cách khung 2 px.
|
|
17
|
+
|
|
18
|
+
## Màu theo biến thể và trạng thái
|
|
19
|
+
|
|
20
|
+
**Hover và nhấn đổi nền. Chữ giữ màu lúc nghỉ; chỉ viền của nút Default đậm lên một bậc.** Disabled dùng màu riêng, không bao giờ giảm độ mờ.
|
|
21
|
+
|
|
22
|
+
| Biến thể | Nghỉ | Hover | Nhấn | Chữ |
|
|
23
|
+
| --- | --- | --- | --- | --- |
|
|
24
|
+
| Primary | `color.background.primary` | `color.background.primary.hover` | `color.background.primary.pressed` | `color.text.inverse` |
|
|
25
|
+
| Default | `color.surface`, viền `color.border` | `button.background.subtle.hover`, viền `color.border.hover` | `button.background.subtle.pressed`, viền `color.border.hover` | `color.text` |
|
|
26
|
+
| Subtle | không có | `button.background.subtle.hover` | `button.background.subtle.pressed` | `color.text` |
|
|
27
|
+
| Danger | `color.background.danger.bold` | `color.background.danger.bold.hover` | `color.background.danger.bold.pressed` | `color.text.on-bold` |
|
|
28
|
+
| Subtle danger | không có | `color.background.danger.subtle.hover` | `color.background.danger.subtle.pressed` | `color.text.danger` |
|
|
29
|
+
| Link | không có, gạch chân | không có | không có | `color.link`, khi hover `color.link.hover` |
|
|
30
|
+
|
|
31
|
+
Nút Primary nằm trên graphite 12, bậc cuối thang, nên khi hover lùi một bậc và khi nhấn lùi hai bậc.
|
|
32
|
+
|
|
33
|
+
| Trạng thái | Nút có nền và Default | Subtle, Subtle danger và Link |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| Chưa dùng được (`aria-disabled`) và disabled | Nền `color.background.disabled`, chữ `color.text.disabled`, viền `color.border.disabled` | Không nền, không viền; chữ `color.text.disabled` |
|
|
36
|
+
| Focus | Vòng `color.border.focus`, `border.width.focused`, cách `state.focus.offset` | Như bên trái |
|
|
37
|
+
| Toggle đang bật (`aria-pressed="true"`) | Default: nền `button.background.selected`, viền `button.border.selected` | Subtle: cùng nền và viền đó |
|
|
38
|
+
| Menu đang mở (`aria-expanded="true"`) | Default giữ `button.background.subtle.pressed` khi menu còn mở | Subtle cũng vậy |
|
|
39
|
+
|
|
40
|
+
## Kích thước
|
|
41
|
+
|
|
42
|
+
**Nút cao bằng ô nhập đặt cạnh nó.**
|
|
43
|
+
|
|
44
|
+
| Cỡ | Chiều cao | Lề trong | Nhãn | Bo góc | Icon |
|
|
45
|
+
| --- | --- | --- | --- | --- | --- |
|
|
46
|
+
| Small | `size.control.small` (24 px) | `space.control.x.small` (8 px) | `font.label.small` | `radius.control.small` (4 px) | `size.icon.default` (16 px) |
|
|
47
|
+
| Default | `size.control.default` (32 px) | `space.control.x` (12 px) | `font.label.default` | `radius.control` (6 px) | `size.icon.default` (16 px) |
|
|
48
|
+
| Large | `size.control.large` (40 px) | `space.control.x.large` (16 px) | `font.label.default` | `radius.control` (6 px) | `size.icon.default` (16 px) |
|
|
49
|
+
|
|
50
|
+
Nút chỉ có icon là hình vuông cùng chiều cao. Trên màn hình cảm ứng, mọi nút nhận chạm trong vùng ít nhất `size.target.touch` (44 px); kích thước nhìn thấy không đổi.
|
|
51
|
+
|
|
52
|
+
## Khoảng cách
|
|
53
|
+
|
|
54
|
+
| Giữa | Token |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| Icon và nhãn | `space.control.gap` (4 px) |
|
|
57
|
+
| Các nút trong một hàng | `space.100` (8 px) |
|
|
58
|
+
| Các nút chỉ có icon trong một hàng | `space.150` (12 px) |
|
|
59
|
+
|
|
60
|
+
## Chuyển động
|
|
61
|
+
|
|
62
|
+
| Thứ gì | Token |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| Đổi màu khi hover và nhấn | `motion.control` |
|
|
65
|
+
| Thời gian chờ trước khi hiện spinner | `motion.wait.spinner` (300 ms) |
|
|
66
|
+
| Một vòng quay của spinner | `motion.loop.spinner` (1 s) |
|
|
67
|
+
|
|
68
|
+
## Token component
|
|
69
|
+
|
|
70
|
+
Button có bốn token component. Cặp hover và nhấn tồn tại vì nút không bao giờ ở trạng thái chọn, nên có thể dùng màu hover đậm hơn dòng bảng; cặp selected giữ toggle đang bật tách hẳn khỏi màu hover đó.
|
|
71
|
+
|
|
72
|
+
<TokenTable prefix="button" />
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Khi nào dùng nút, chọn biến thể và kích cỡ nào, các trạng thái, vị trí và cách viết nhãn.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Khi nào dùng
|
|
6
|
+
|
|
7
|
+
- Để bắt đầu một thao tác trên màn hình hiện tại: lưu, gửi, kiểm tra kết nối, chạy đồng bộ, xóa.
|
|
8
|
+
- Để mở hộp thoại hoặc drawer, hoặc bắt đầu một luồng.
|
|
9
|
+
- Để xác nhận hoặc hủy trong hộp thoại.
|
|
10
|
+
|
|
11
|
+
## Khi nào không dùng
|
|
12
|
+
|
|
13
|
+
- Để chuyển sang trang khác. Dùng liên kết; nếu cần trông như nút, dùng thẻ `a` với các class của nút.
|
|
14
|
+
- Cho một thiết lập có hiệu lực ngay. Dùng [công tắc](/vi/components/switch/usage/).
|
|
15
|
+
- Cho hơn ba thao tác liên quan ở cùng một chỗ. Giữ thao tác chính là nút, đưa phần còn lại vào menu.
|
|
16
|
+
- Để chọn một giá trị trong danh sách. Dùng ô chọn.
|
|
17
|
+
|
|
18
|
+
## Cấu tạo
|
|
19
|
+
|
|
20
|
+
| Phần | Bắt buộc | Ghi chú |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| Khung | Có | Nền và viền thể hiện mức nhấn. Nút nhẹ không có nền cho tới khi hover. |
|
|
23
|
+
| Nhãn | Có, trừ nút chỉ có icon | Viết hoa chữ đầu câu, bắt đầu bằng động từ, một dòng. |
|
|
24
|
+
| Icon | Không | Đặt trước nhãn, `size.icon.default` (16 px), cách nhãn `space.control.gap`. |
|
|
25
|
+
| Icon phía sau | Không | Chỉ dùng icon liên kết ra ngoài hoặc mũi tên mở menu. |
|
|
26
|
+
| Vòng focus | Có | `border.width.focused` màu `color.border.focus`, cách nút `state.focus.offset`. Không bao giờ bỏ. |
|
|
27
|
+
|
|
28
|
+
## Biến thể
|
|
29
|
+
|
|
30
|
+
Chọn mức nhấn trước, rồi chọn tông.
|
|
31
|
+
|
|
32
|
+
| Biến thể | Dùng cho | Màu |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| Chính | Thao tác chính duy nhất trong một màn hình hoặc hộp thoại | `color.background.primary` với `color.text.inverse` |
|
|
35
|
+
| Mặc định | Phần lớn thao tác, và mọi thao tác khác đặt cạnh nút chính | `color.surface`, `color.border`, `color.text` |
|
|
36
|
+
| Nhẹ | Thanh công cụ, dòng trong bảng, đầu thẻ, và nút "Hủy" cạnh nút chính trong drawer | Trong suốt khi nghỉ; `color.background.neutral.subtle.hover` và `.pressed` |
|
|
37
|
+
| Nguy hiểm | Xác nhận thao tác xóa dữ liệu hoặc không thể hoàn tác | `color.background.danger.bold` với `color.text.on-bold` |
|
|
38
|
+
| Tông nguy hiểm trên nút nhẹ | Thao tác phá hủy trong một dòng hay danh sách, như "Gỡ" | `color.text.danger`; `color.background.danger.subtle.hover` và `.pressed` |
|
|
39
|
+
|
|
40
|
+
Các cách kết hợp trong một nhóm:
|
|
41
|
+
|
|
42
|
+
| Kết hợp | Được phép |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| Một nút chính với các nút mặc định hoặc nút nhẹ | Có |
|
|
45
|
+
| Nút nguy hiểm với nút "Hủy" mặc định | Có, trong hộp thoại xác nhận |
|
|
46
|
+
| Hai nút chính | Không. Nếu nhiều thao tác quan trọng như nhau, để tất cả là nút mặc định |
|
|
47
|
+
| Nút chính cùng nút nguy hiểm | Không. Trong hộp thoại xác nhận, nút nguy hiểm là thao tác chính |
|
|
48
|
+
| Các nút khác kích cỡ | Không |
|
|
49
|
+
| Chỉ một vài nút có icon | Không. Hoặc mọi nút trong nhóm có icon, hoặc không nút nào có |
|
|
50
|
+
|
|
51
|
+
## Kích cỡ
|
|
52
|
+
|
|
53
|
+
Nút cao bằng các ô nhập bên cạnh, để một hàng bộ lọc và thao tác thẳng hàng.
|
|
54
|
+
|
|
55
|
+
| Kích cỡ | Chiều cao | Đệm hai bên | Nhãn | Dùng ở |
|
|
56
|
+
| --- | --- | --- | --- | --- |
|
|
57
|
+
| Nhỏ | `size.control.small`, 24 px | `space.control.x.small` | `font.label.small` | Bảng dày, thanh công cụ của bảng, thanh lọc |
|
|
58
|
+
| Mặc định | `size.control.default`, 32 px | `space.control.x` | `font.label.default` | Mọi nơi khác |
|
|
59
|
+
| Lớn | `size.control.large`, 40 px | `space.control.x.large` | `font.label.default` | Trang đăng nhập và onboarding; thao tác chính trên điện thoại |
|
|
60
|
+
|
|
61
|
+
Mọi kích cỡ giữ vùng bấm ít nhất 24 × 24 px; trên màn hình cảm ứng vùng chạm tăng lên 44 × 44 px (`size.target.touch`). Nút chỉ có icon là hình vuông cùng chiều cao.
|
|
62
|
+
|
|
63
|
+
## Trạng thái
|
|
64
|
+
|
|
65
|
+
| Trạng thái | Thay đổi gì |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| Nghỉ | Màu của biến thể |
|
|
68
|
+
| Hover | Nền lên một bậc: token `.hover` |
|
|
69
|
+
| Nhấn | Nền lên hai bậc: token `.pressed`. Nhãn, icon và viền giữ nguyên màu |
|
|
70
|
+
| Focus | Vòng focus, chỉ khi `:focus-visible` |
|
|
71
|
+
| Đang xử lý | Giữ màu; spinner thay cho icon; nhãn nói việc đang làm ("Đang đồng bộ…"); bỏ qua cú nhấp; `aria-busy="true"` |
|
|
72
|
+
| Chưa dùng được | Màu vô hiệu, nhưng vẫn focus được với `aria-disabled="true"`, và ghi lý do bên cạnh |
|
|
73
|
+
| Vô hiệu | `color.background.disabled`, `color.border.disabled`, `color.text.disabled`; bị gỡ khỏi thứ tự Tab |
|
|
74
|
+
|
|
75
|
+
Trạng thái vô hiệu dùng màu, không dùng độ trong suốt. Xem [Trạng thái tương tác](/vi/foundations/styles/interaction-states/).
|
|
76
|
+
|
|
77
|
+
## Thao tác chưa dùng được
|
|
78
|
+
|
|
79
|
+
Một nút xám không có lý do khiến người dùng bế tắc. Theo thứ tự ưu tiên:
|
|
80
|
+
|
|
81
|
+
1. Giữ nút hoạt động, và khi bấm thì chỉ ra điều còn thiếu (ví dụ ô bắt buộc đang trống).
|
|
82
|
+
2. Hiện nút ở trạng thái chưa dùng được với `aria-disabled="true"` và ghi lý do bên cạnh: "Hãy kết nối cửa hàng online trước."
|
|
83
|
+
3. Chỉ dùng `disabled` gốc cho một lúc chờ ngắn mà người dùng đã hiểu, như khi biểu mẫu đang tải.
|
|
84
|
+
|
|
85
|
+
Đừng chỉ đặt lý do trong tooltip của một nút vô hiệu: người dùng bàn phím không tới được nó.
|
|
86
|
+
|
|
87
|
+
## Vị trí và thứ tự
|
|
88
|
+
|
|
89
|
+
- **Hộp thoại, drawer, chân trang wizard:** nút ở cuối hàng; nút chính đứng sau cùng. "Hủy" hoặc "Quay lại" đứng trước nó.
|
|
90
|
+
- **Biểu mẫu trên trang:** nút ở đầu hàng, dưới ô cuối cùng; nút chính đứng trước.
|
|
91
|
+
- **Thanh công cụ và dòng trong bảng:** nút nhẹ, kích cỡ nhỏ trong bảng dày.
|
|
92
|
+
- Các nút trong một hàng cách nhau `space.100`.
|
|
93
|
+
|
|
94
|
+
## Chiều rộng và nhãn dài
|
|
95
|
+
|
|
96
|
+
- Nút rộng bằng nhãn. Chỉ dùng toàn chiều rộng trong panel hẹp và trên điện thoại.
|
|
97
|
+
- Không bao giờ cắt nhãn bằng dấu ba chấm: thao tác sẽ không rõ. Hãy rút ngắn nhãn. Nhãn tiếng Việt thường dài hơn tiếng Anh, nên kiểm tra cả hai.
|
|
98
|
+
|
|
99
|
+
## Cách viết nhãn
|
|
100
|
+
|
|
101
|
+
- Bắt đầu bằng động từ và nêu đối tượng: "Đồng bộ đơn hàng", "Thêm ánh xạ", "Xóa kết nối".
|
|
102
|
+
- Chỉ viết hoa chữ đầu, không dấu chấm, không "OK", "Có" hay "Gửi đi" chung chung.
|
|
103
|
+
- Trong hộp thoại, nút trả lời tiêu đề: "Xóa kết nối này?" → **Xóa** và **Hủy**.
|
|
104
|
+
- Dùng cùng một động từ cho cùng một thao tác ở mọi nơi:
|
|
105
|
+
|
|
106
|
+
| Thao tác | Tiếng Anh | Tiếng Việt |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| Giữ thay đổi | Save | Lưu |
|
|
109
|
+
| Dừng, không giữ thay đổi | Cancel | Hủy |
|
|
110
|
+
| Đóng panel không thay đổi gì | Close | Đóng |
|
|
111
|
+
| Tạo mới | Create | Tạo |
|
|
112
|
+
| Đưa mục có sẵn vào danh sách | Add | Thêm |
|
|
113
|
+
| Bỏ khỏi danh sách, giữ mục | Remove | Gỡ |
|
|
114
|
+
| Hủy bỏ hẳn mục | Delete | Xóa |
|
|
115
|
+
| Nối hai hệ thống | Connect | Kết nối |
|
|
116
|
+
| Sao chép dữ liệu giữa hai hệ thống | Sync | Đồng bộ |
|
|
117
|
+
| Đi qua các bước | Next, Back | Tiếp, Quay lại |
|
|
118
|
+
| Kết thúc luồng | Done | Xong |
|
|
119
|
+
|
|
120
|
+
## Các loại nút liên quan
|
|
121
|
+
|
|
122
|
+
| Cần | Dùng |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| Thao tác ở chỗ chật, hoặc đóng và sao chép | [Nút chỉ có icon](/vi/components/icon-button/usage/) |
|
|
125
|
+
| Hai, ba nút đi cùng nhau | [Nhóm nút](/vi/components/button-group/usage/) |
|
|
126
|
+
| Nhiều thao tác liên quan sau một nút | [Nút mở menu](/vi/components/menu-button/usage/) |
|
|
127
|
+
| Thao tác mặc định kèm phương án khác | [Split button](/vi/components/split-button/usage/) |
|
|
128
|
+
| Chế độ giữ bật hoặc tắt | [Toggle button](/vi/components/toggle-button/usage/) |
|
|
129
|
+
| Một trong hai đến năm lựa chọn | [Segmented control](/vi/components/segmented-control/usage/) |
|
|
130
|
+
| Công cụ cho canvas hoặc editor | [Thanh công cụ](/vi/components/toolbar/usage/) |
|
|
131
|
+
| Thao tác cho các dòng đã chọn | [Thanh thao tác](/vi/components/action-bar/usage/) |
|
|
132
|
+
|
|
133
|
+
Liên kết trông như nút là biến thể Link của component này. Beehexa không có nút nổi (FAB): sản phẩm ưu tiên desktop và chưa màn hình nào cần.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Các phím, những gì Button group 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
|
+
**Button group đạt WCAG 2.2 mức AA khi được dùng như mô tả trên các trang này.**
|
|
8
|
+
|
|
9
|
+
## Bàn phím
|
|
10
|
+
|
|
11
|
+
| Phím | Tác dụng |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| <kbd>Tab</kbd> | Đi qua từng nút. |
|
|
14
|
+
| <kbd>Enter</kbd> hoặc <kbd>Space</kbd> | Chạy nút đang focus. |
|
|
15
|
+
|
|
16
|
+
## Những gì Button group có sẵn
|
|
17
|
+
|
|
18
|
+
- `role="group"` bao quanh các nút.
|
|
19
|
+
- Vòng focus đầy đủ của nút đang focus, nằm trên các nút bên cạnh.
|
|
20
|
+
|
|
21
|
+
## Những gì đội của bạn cần làm
|
|
22
|
+
|
|
23
|
+
- Đặt `aria-label` cho nhóm liền nhau.
|
|
24
|
+
- Đặt tên riêng cho từng nút chỉ có icon.
|
|
25
|
+
- Khi có nhiều công cụ cần phím mũi tên, dùng toolbar thay vì nhóm.
|
|
26
|
+
|
|
27
|
+
## Tiêu chí WCAG
|
|
28
|
+
|
|
29
|
+
| Tiêu chí | Mức | Cách đạt |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| 1.3.1 Info and Relationships | A | `role="group"` with a name |
|
|
32
|
+
| 2.4.7 Focus Visible | AA | The ring shows whole above neighbours |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cài đặt, props và các phần tạo nên Button group.
|
|
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/button-group.json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Cách dùng
|
|
15
|
+
|
|
16
|
+
```vue
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { Button } from '@/components/ui/button'
|
|
19
|
+
import { ButtonGroup } from '@/components/ui/button-group'
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<ButtonGroup variant="spaced" aria-label="Thao tác của hộp thoại" class="justify-end">
|
|
24
|
+
<Button variant="outline">Hủy</Button>
|
|
25
|
+
<Button>Lưu kết nối</Button>
|
|
26
|
+
</ButtonGroup>
|
|
27
|
+
</template>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Props
|
|
31
|
+
|
|
32
|
+
| Prop | Giá trị | Ghi chú |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `variant` | `joined` (mặc định), `spaced` | Joined giống ButtonGroup của shadcn-vue |
|
|
35
|
+
| `aria-label` | chuỗi | Đặt tên cho cả nhóm, như "Khoảng ngày" |
|
|
36
|
+
|
|
37
|
+
## Dựng từ
|
|
38
|
+
|
|
39
|
+
Một `div` có `role="group"`; các nút bên trong là Button của Beehexa.
|