@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,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Anatomy, colour tokens for every variant and state, sizes and spacing of Button.
|
|
3
|
+
---
|
|
4
|
+
import TokenTable from '../../../components/TokenTable.astro';
|
|
5
|
+
|
|
6
|
+
## Anatomy
|
|
7
|
+
|
|
8
|
+
**A button has one container and up to four parts inside it.** Only the label is required, except on an icon-only button.
|
|
9
|
+
|
|
10
|
+
1. **Container.** Carries the fill, the border and the radius.
|
|
11
|
+
2. **Leading icon.** Optional, 16 px, before the label.
|
|
12
|
+
3. **Label.** A verb or a verb and a noun, in sentence case.
|
|
13
|
+
4. **Trailing icon.** Only an external-link icon or a menu chevron.
|
|
14
|
+
5. **Spinner.** Takes the leading icon's place while the button is loading.
|
|
15
|
+
|
|
16
|
+
The focus ring sits outside the container: 2 px, 2 px away.
|
|
17
|
+
|
|
18
|
+
## Colour by variant and state
|
|
19
|
+
|
|
20
|
+
**Hover and pressed change the fill. Text keeps its rest colour; only the Default button's border darkens one step.** Disabled uses its own colours, never opacity.
|
|
21
|
+
|
|
22
|
+
| Variant | Rest | Hover | Pressed | Text |
|
|
23
|
+
| --- | --- | --- | --- | --- |
|
|
24
|
+
| Primary | `color.background.primary` | `color.background.primary.hover` | `color.background.primary.pressed` | `color.text.inverse` |
|
|
25
|
+
| Default | `color.surface`, border `color.border` | `button.background.subtle.hover`, border `color.border.hover` | `button.background.subtle.pressed`, border `color.border.hover` | `color.text` |
|
|
26
|
+
| Subtle | none | `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 | none | `color.background.danger.subtle.hover` | `color.background.danger.subtle.pressed` | `color.text.danger` |
|
|
29
|
+
| Link | none, underlined | none | none | `color.link`, `color.link.hover` on hover |
|
|
30
|
+
|
|
31
|
+
The primary button rests on graphite 12, the last step, so it moves back one step on hover and two when pressed.
|
|
32
|
+
|
|
33
|
+
| State | Filled and Default | Subtle, Subtle danger and Link |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| Unavailable (`aria-disabled`) and disabled | Fill `color.background.disabled`, text `color.text.disabled`, border `color.border.disabled` | No fill, no border; text `color.text.disabled` |
|
|
36
|
+
| Focus | Ring `color.border.focus`, `border.width.focused`, offset `state.focus.offset` | Same |
|
|
37
|
+
| Toggle on (`aria-pressed="true"`) | Default: fill `button.background.selected`, border `button.border.selected` | Subtle: the same fill and border |
|
|
38
|
+
| Open menu (`aria-expanded="true"`) | Default keeps `button.background.subtle.pressed` while the menu is open | Subtle does the same |
|
|
39
|
+
|
|
40
|
+
## Sizes
|
|
41
|
+
|
|
42
|
+
**Match the height of the fields next to the button.**
|
|
43
|
+
|
|
44
|
+
| Size | Height | Padding | Label | Radius | 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
|
+
An icon-only button is a square of the same height. On touch screens every button responds to a tap in at least `size.target.touch` (44 px); the visible size stays the same.
|
|
51
|
+
|
|
52
|
+
## Spacing
|
|
53
|
+
|
|
54
|
+
| Between | Token |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| Icon and label | `space.control.gap` (4 px) |
|
|
57
|
+
| Buttons in a row | `space.100` (8 px) |
|
|
58
|
+
| Icon-only buttons in a row | `space.150` (12 px) |
|
|
59
|
+
|
|
60
|
+
## Motion
|
|
61
|
+
|
|
62
|
+
| What | Token |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| Colour change on hover and press | `motion.control` |
|
|
65
|
+
| Wait before the spinner shows | `motion.wait.spinner` (300 ms) |
|
|
66
|
+
| One turn of the spinner | `motion.loop.spinner` (1 s) |
|
|
67
|
+
|
|
68
|
+
## Component tokens
|
|
69
|
+
|
|
70
|
+
Button has four component tokens. The hover and pressed pair exist because a button is never selected, so it can take a stronger hover than a table row; the selected pair keeps a toggle that is on clearly apart from that hover.
|
|
71
|
+
|
|
72
|
+
<TokenTable prefix="button" />
|
|
@@ -1,44 +1,133 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: When to use a button, which variant and size to pick, its states, placement and how to write the label.
|
|
2
3
|
---
|
|
3
4
|
|
|
4
5
|
## When to use
|
|
5
6
|
|
|
6
|
-
- To
|
|
7
|
-
- To open a dialog or start a flow.
|
|
7
|
+
- To start an action on the current screen: save, submit, test a connection, run a sync, delete.
|
|
8
|
+
- To open a dialog or a drawer, or to start a flow.
|
|
9
|
+
- To confirm or cancel in a dialog.
|
|
8
10
|
|
|
9
11
|
## When not to use
|
|
10
12
|
|
|
11
|
-
- To go to another page. Use a link.
|
|
12
|
-
- For
|
|
13
|
+
- To go to another page. Use a link; if it must look like a button, use an `a` element with the button classes.
|
|
14
|
+
- For a setting that takes effect at once. Use a [switch](/components/switch/usage/).
|
|
15
|
+
- For more than three related actions in one place. Keep the main one as a button and put the rest in a menu.
|
|
16
|
+
- To choose one value from a list. Use a select.
|
|
13
17
|
|
|
14
|
-
##
|
|
18
|
+
## Anatomy
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
| Part | Required | Notes |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| Container | Yes | Fill and edge set the emphasis. Subtle buttons have no fill until hover. |
|
|
23
|
+
| Label | Yes, except icon-only | Sentence case, starts with a verb, one line. |
|
|
24
|
+
| Icon | No | Before the label, `size.icon.default` (16 px), `space.control.gap` from the label. |
|
|
25
|
+
| Trailing icon | No | Only an external-link icon or a menu chevron. |
|
|
26
|
+
| Focus ring | Yes | `border.width.focused` in `color.border.focus`, `state.focus.offset` away. Never removed. |
|
|
19
27
|
|
|
20
|
-
##
|
|
28
|
+
## Variants
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
same size as page Button/Input/Select controls. No shell-specific skin.
|
|
24
|
-
- Account/avatar menus may legitimately use frameless `type="text"`; native Space
|
|
25
|
-
centers the Avatar and text. Do not globally turn text Buttons into default.
|
|
26
|
-
- Put icons in `#icon`, labels in one child, and name icon-only actions. The source
|
|
27
|
-
adapter supplies one scalable icon/text gap for AntD and external SVG icons.
|
|
28
|
-
- Small/default/large controls are24/32/40px at the nominal16px root; control
|
|
29
|
-
corners are radius050 (4px). Menu frames also050; Select popup remains100.
|
|
30
|
-
- Preserve hover/pressed/focus/disabled/loading and actual Dropdown open semantics.
|
|
31
|
-
`data-bh-target="responsive"` adds44px minimums only on coarse pointers.
|
|
32
|
-
- A light primary background with dark text in dark mode is the intentional
|
|
33
|
-
neutral-bold/inverse pair. Link actions keep their own link palette.
|
|
34
|
-
- A blue lower stripe on an unfocused primary Button is not a legitimate
|
|
35
|
-
variant. The source adapter removes native resting outline shadows while
|
|
36
|
-
retaining the separate gapped keyboard focus ring.
|
|
37
|
-
- Danger primary uses on-bold text; outlined/frameless danger uses readable
|
|
38
|
-
danger text. A primary danger `ghost` Button must not inherit the solid label.
|
|
30
|
+
Pick the emphasis first, then the tone.
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
| Variant | Use it for | Colours |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| Primary | The one main action in a screen or a dialog | `color.background.primary` with `color.text.inverse` |
|
|
35
|
+
| Default | Most actions, and every other action next to a primary one | `color.surface`, `color.border`, `color.text` |
|
|
36
|
+
| Subtle | Toolbars, table rows, card headers, and "Cancel" next to a primary button in a drawer | Transparent at rest; `color.background.neutral.subtle.hover` and `.pressed` |
|
|
37
|
+
| Danger | Confirms an action that deletes data or can’t be undone | `color.background.danger.bold` with `color.text.on-bold` |
|
|
38
|
+
| Danger tone on subtle | A destructive action in a row or list, such as "Remove" | `color.text.danger`; `color.background.danger.subtle.hover` and `.pressed` |
|
|
43
39
|
|
|
40
|
+
Combinations in one group:
|
|
44
41
|
|
|
42
|
+
| Combination | Allowed |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| One primary with default or subtle buttons | Yes |
|
|
45
|
+
| Danger with a default "Cancel" | Yes, in a confirmation dialog |
|
|
46
|
+
| Two primary buttons | No. If several actions are equally important, make them all default |
|
|
47
|
+
| Primary and danger together | No. In a confirmation, the danger button is the main action |
|
|
48
|
+
| Buttons of different sizes | No |
|
|
49
|
+
| Icons on some buttons only | No. All buttons in a group have an icon, or none do |
|
|
50
|
+
|
|
51
|
+
## Sizes
|
|
52
|
+
|
|
53
|
+
The button is as tall as the fields beside it, so a row of filters and actions lines up.
|
|
54
|
+
|
|
55
|
+
| Size | Height | Side padding | Label | Where |
|
|
56
|
+
| --- | --- | --- | --- | --- |
|
|
57
|
+
| Small | `size.control.small`, 24 px | `space.control.x.small` | `font.label.small` | Dense tables, their toolbars, filter bars |
|
|
58
|
+
| Default | `size.control.default`, 32 px | `space.control.x` | `font.label.default` | Everywhere else |
|
|
59
|
+
| Large | `size.control.large`, 40 px | `space.control.x.large` | `font.label.default` | Sign-in and onboarding pages; the main action on phones |
|
|
60
|
+
|
|
61
|
+
Every size keeps a target of at least 24 × 24 px; on touch screens the tap area grows to 44 × 44 px (`size.target.touch`). An icon-only button is a square of the same height.
|
|
62
|
+
|
|
63
|
+
## States
|
|
64
|
+
|
|
65
|
+
| State | What changes |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| Rest | The variant's colours |
|
|
68
|
+
| Hover | Fill one step up: `.hover` tokens |
|
|
69
|
+
| Pressed | Fill two steps up: `.pressed` tokens. Label, icon and edge keep their colours |
|
|
70
|
+
| Focus | The focus ring, on `:focus-visible` only |
|
|
71
|
+
| Loading | Colours stay; a spinner replaces the icon; the label says what is happening ("Syncing…"); clicks are ignored; `aria-busy="true"` |
|
|
72
|
+
| Unavailable | Disabled colours, but still focusable with `aria-disabled="true"`, and the reason is shown next to it |
|
|
73
|
+
| Disabled | `color.background.disabled`, `color.border.disabled`, `color.text.disabled`; removed from the tab order |
|
|
74
|
+
|
|
75
|
+
Disabled uses colours, never transparency. See [Interaction states](/foundations/styles/interaction-states/).
|
|
76
|
+
|
|
77
|
+
## Unavailable actions
|
|
78
|
+
|
|
79
|
+
A greyed-out button that gives no reason leaves people stuck. In order of preference:
|
|
80
|
+
|
|
81
|
+
1. Keep the button active, and when it is pressed, show what is missing (for example, the empty required field).
|
|
82
|
+
2. Show it as unavailable with `aria-disabled="true"` and write the reason next to it: "Connect an online store first."
|
|
83
|
+
3. Use native `disabled` only for a short wait the user already understands, such as while a form loads.
|
|
84
|
+
|
|
85
|
+
Don’t put the reason only in a tooltip on a disabled button: keyboard users can’t reach it.
|
|
86
|
+
|
|
87
|
+
## Placement and order
|
|
88
|
+
|
|
89
|
+
- **Dialogs, drawers, wizard footers:** buttons at the end of the row; the primary button last. "Cancel" or "Back" comes before it.
|
|
90
|
+
- **Page forms:** buttons at the start, under the last field; the primary button first.
|
|
91
|
+
- **Toolbars and table rows:** subtle buttons, small size in dense tables.
|
|
92
|
+
- Space buttons in a row with `space.100`.
|
|
93
|
+
|
|
94
|
+
## Width and long labels
|
|
95
|
+
|
|
96
|
+
- A button is as wide as its label. Use full width only in narrow panels and on phones.
|
|
97
|
+
- Never cut a label with an ellipsis: the action becomes unclear. Shorten the label instead. Vietnamese labels are often longer than English ones, so check both.
|
|
98
|
+
|
|
99
|
+
## Writing the label
|
|
100
|
+
|
|
101
|
+
- Start with a verb and name the object: "Sync orders", "Add mapping", "Delete connection".
|
|
102
|
+
- Sentence case, no full stop, no "OK", "Yes" or "Submit".
|
|
103
|
+
- In a dialog, the button answers the title: "Delete this connection?" → **Delete** and **Cancel**.
|
|
104
|
+
- Use the same verb for the same action everywhere:
|
|
105
|
+
|
|
106
|
+
| Action | English | Vietnamese |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| Keep changes | Save | Lưu |
|
|
109
|
+
| Stop without keeping changes | Cancel | Hủy |
|
|
110
|
+
| Close a panel that changes nothing | Close | Đóng |
|
|
111
|
+
| Make something new | Create | Tạo |
|
|
112
|
+
| Put an existing item into a list | Add | Thêm |
|
|
113
|
+
| Take out of a list, keep the item | Remove | Gỡ |
|
|
114
|
+
| Destroy the item | Delete | Xóa |
|
|
115
|
+
| Link two systems | Connect | Kết nối |
|
|
116
|
+
| Copy data between systems | Sync | Đồng bộ |
|
|
117
|
+
| Move through steps | Next, Back | Tiếp, Quay lại |
|
|
118
|
+
| End a flow | Done | Xong |
|
|
119
|
+
|
|
120
|
+
## Related buttons
|
|
121
|
+
|
|
122
|
+
| Need | Use |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| An action in a tight place, or close and copy | [Icon button](/components/icon-button/usage/) |
|
|
125
|
+
| Two or three buttons together | [Button group](/components/button-group/usage/) |
|
|
126
|
+
| Several related actions behind one button | [Menu button](/components/menu-button/usage/) |
|
|
127
|
+
| A default action with alternatives | [Split button](/components/split-button/usage/) |
|
|
128
|
+
| A mode that stays on or off | [Toggle button](/components/toggle-button/usage/) |
|
|
129
|
+
| One option out of two to five | [Segmented control](/components/segmented-control/usage/) |
|
|
130
|
+
| Tools for a canvas or editor | [Toolbar](/components/toolbar/usage/) |
|
|
131
|
+
| Actions on selected rows | [Action bar](/components/action-bar/usage/) |
|
|
132
|
+
|
|
133
|
+
A link that looks like a button is the Link variant of this component. Beehexa has no floating action button: products are desktop-first and no screen needs one.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Keys, what Button group gives you and what your team does.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Conformance
|
|
6
|
+
|
|
7
|
+
**Button group meets WCAG 2.2 level AA when used as described on these pages.**
|
|
8
|
+
|
|
9
|
+
## Keyboard
|
|
10
|
+
|
|
11
|
+
| Key | Action |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| <kbd>Tab</kbd> | Moves through the buttons one by one. |
|
|
14
|
+
| <kbd>Enter</kbd> or <kbd>Space</kbd> | Runs the focused button. |
|
|
15
|
+
|
|
16
|
+
## What Button group gives you
|
|
17
|
+
|
|
18
|
+
- `role="group"` around the buttons.
|
|
19
|
+
- The full focus ring of the focused button, above its neighbours.
|
|
20
|
+
|
|
21
|
+
## What your team does
|
|
22
|
+
|
|
23
|
+
- Name a joined group with `aria-label`.
|
|
24
|
+
- Give each icon-only button its own name.
|
|
25
|
+
- Use a toolbar, not a group, when there are many tools that need arrow keys.
|
|
26
|
+
|
|
27
|
+
## WCAG criteria
|
|
28
|
+
|
|
29
|
+
| Criterion | Level | How |
|
|
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: Install, props and the parts Button group is built from.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Run these in the app, after `shadcn-vue init` and the Beehexa theme ([Button › Code](/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
|
+
## Use
|
|
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="Dialog actions" class="justify-end">
|
|
24
|
+
<Button variant="outline">Cancel</Button>
|
|
25
|
+
<Button>Save connection</Button>
|
|
26
|
+
</ButtonGroup>
|
|
27
|
+
</template>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Props
|
|
31
|
+
|
|
32
|
+
| Prop | Values | Notes |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `variant` | `joined` (default), `spaced` | Joined matches the shadcn-vue ButtonGroup |
|
|
35
|
+
| `aria-label` | string | Names the whole set, such as "Date range" |
|
|
36
|
+
|
|
37
|
+
## Built on
|
|
38
|
+
|
|
39
|
+
A `div` with `role="group"`; the buttons inside are Beehexa Buttons.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Live examples of Button group, with the exact Vue file that renders each one.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import ButtonGroupSpaced from '../../../../registry/beehexa/examples/button-group/en/ButtonGroupSpaced.vue';
|
|
6
|
+
import ButtonGroupSpacedSource from '../../../../registry/beehexa/examples/button-group/en/ButtonGroupSpaced.vue?raw';
|
|
7
|
+
import ButtonGroupJoined from '../../../../registry/beehexa/examples/button-group/en/ButtonGroupJoined.vue';
|
|
8
|
+
import ButtonGroupJoinedSource from '../../../../registry/beehexa/examples/button-group/en/ButtonGroupJoined.vue?raw';
|
|
9
|
+
import ButtonGroupIcons from '../../../../registry/beehexa/examples/button-group/en/ButtonGroupIcons.vue';
|
|
10
|
+
import ButtonGroupIconsSource from '../../../../registry/beehexa/examples/button-group/en/ButtonGroupIcons.vue?raw';
|
|
11
|
+
|
|
12
|
+
Every example is a complete Vue file. Copy it into an app that has the registry installed, or open it in StackBlitz.
|
|
13
|
+
|
|
14
|
+
## Spaced
|
|
15
|
+
|
|
16
|
+
The actions at the end of a dialog: 8 px apart, primary last.
|
|
17
|
+
|
|
18
|
+
<CodeExample source={ButtonGroupSpacedSource} file="ButtonGroupSpaced.vue">
|
|
19
|
+
<ButtonGroupSpaced client:visible />
|
|
20
|
+
</CodeExample>
|
|
21
|
+
|
|
22
|
+
## Joined
|
|
23
|
+
|
|
24
|
+
Actions on one thing that read as one control. Only the outer corners are round; the touching borders overlap into one line.
|
|
25
|
+
|
|
26
|
+
<CodeExample source={ButtonGroupJoinedSource} file="ButtonGroupJoined.vue">
|
|
27
|
+
<ButtonGroupJoined client:visible />
|
|
28
|
+
</CodeExample>
|
|
29
|
+
|
|
30
|
+
## Icon-only buttons
|
|
31
|
+
|
|
32
|
+
Icon-only buttons in a spaced group sit 12 px apart.
|
|
33
|
+
|
|
34
|
+
<CodeExample source={ButtonGroupIconsSource} file="ButtonGroupIcons.vue">
|
|
35
|
+
<ButtonGroupIcons client:visible />
|
|
36
|
+
</CodeExample>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Button group",
|
|
3
|
+
"description": "Lays out a small set of related buttons as one unit, either spaced apart or joined into one control.",
|
|
4
|
+
"group": "Actions",
|
|
5
|
+
"vi": {
|
|
6
|
+
"title": "Nhóm nút",
|
|
7
|
+
"description": "Xếp một nhóm nhỏ các nút liên quan thành một khối, cách nhau hoặc ghép liền thành một control."
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Parts, tokens, sizes and spacing of Button group.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Tokens
|
|
6
|
+
|
|
7
|
+
| Part | Tokens and values |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Spaced gap | `space.100` (8 px); `space.150` (12 px) for icon-only buttons |
|
|
10
|
+
| Joined edges | Buttons overlap by `border.width.default`; inner corners 0, outer corners `radius.control` |
|
|
11
|
+
| Primary divider | `color.background.primary.hover` between two primary buttons |
|
|
12
|
+
| Hover and focus | The hovered or focused button sits above its neighbours |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: When to use button group, its parts, states, keys and accessibility.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> **Draft.** Proposed from the survey of 18 design systems and not yet approved. It is in the registry so teams can try it; the API may still change before approval.
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- **Spaced:** the actions at the end of a form, a dialog or a card. At most three buttons.
|
|
10
|
+
- **Joined:** actions on the same thing that read as one control, such as previous, today and next in a date range.
|
|
11
|
+
|
|
12
|
+
## When not to use
|
|
13
|
+
|
|
14
|
+
- To choose one option out of several. Use a [segmented control](/components/segmented-control/usage/).
|
|
15
|
+
- For more than three actions. Keep the main one and put the rest in a [menu button](/components/menu-button/usage/).
|
|
16
|
+
- For a row of tools that needs arrow-key navigation. Use a [toolbar](/components/toolbar/usage/).
|
|
17
|
+
|
|
18
|
+
## Layout
|
|
19
|
+
|
|
20
|
+
| Kind | Gap | Corners | Order |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| Spaced | `space.100` (8 px); `space.150` (12 px) for icon-only buttons | Each button keeps its own | Dialogs: end-aligned, primary last. Page forms: start-aligned, primary first (D10). |
|
|
23
|
+
| Joined | 0; the touching edges overlap into one line | Only the outer corners keep `radius.control`; inner corners are 0 (D2) | Left to right in reading order |
|
|
24
|
+
|
|
25
|
+
All buttons in a group have the same size. A joined group uses one variant for every button, Default or Subtle.
|
|
26
|
+
|
|
27
|
+
## Accessibility
|
|
28
|
+
|
|
29
|
+
- A joined group has `role="group"` and an `aria-label` that names the whole set.
|
|
30
|
+
- Each button keeps its own accessible name and focus ring. The focused button sits above its neighbours so the whole ring shows.
|
|
31
|
+
- Tab moves through the buttons one by one. Arrow keys are for a toolbar, not a group.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Keys, what Icon button gives you and what your team does.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Conformance
|
|
6
|
+
|
|
7
|
+
**Icon button meets WCAG 2.2 level AA when used as described on these pages.** It follows the [Button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/) of the WAI-ARIA Authoring Practices.
|
|
8
|
+
|
|
9
|
+
## Keyboard
|
|
10
|
+
|
|
11
|
+
| Key | Action |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| <kbd>Tab</kbd> | Moves focus to the button and opens its tooltip. |
|
|
14
|
+
| <kbd>Enter</kbd> or <kbd>Space</kbd> | Runs the action. |
|
|
15
|
+
| <kbd>Esc</kbd> | Closes the tooltip. |
|
|
16
|
+
|
|
17
|
+
## What Icon button gives you
|
|
18
|
+
|
|
19
|
+
- A native button with the Button focus ring, states and touch target.
|
|
20
|
+
- A tooltip that opens on hover and on keyboard focus and repeats the name.
|
|
21
|
+
- Copy button: a polite live region that says "Copied"; the icon change is not the only cue.
|
|
22
|
+
|
|
23
|
+
## What your team does
|
|
24
|
+
|
|
25
|
+
- Give every icon button an `aria-label` that says the action and the object when needed: "Delete mapping".
|
|
26
|
+
- Use a label instead when the icon is not well known.
|
|
27
|
+
- Keep extra information out of the tooltip; it only repeats the name.
|
|
28
|
+
|
|
29
|
+
## WCAG criteria
|
|
30
|
+
|
|
31
|
+
| Criterion | Level | How |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| 1.1.1 Non-text Content | A | `aria-label`; the icon is hidden |
|
|
34
|
+
| 2.5.8 Target Size (Minimum) | AA | 24 px or more; 44 px on touch |
|
|
35
|
+
| 4.1.2 Name, Role, Value | A | Native button with a name |
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Install, props and the parts Icon button is built from.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Run these in the app, after `shadcn-vue init` and the Beehexa theme ([Button › Code](/components/button/code/)):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx shadcn-vue@latest add https://beehexa.design/r/button.json
|
|
11
|
+
npx shadcn-vue@latest add https://beehexa.design/r/tooltip.json
|
|
12
|
+
npx shadcn-vue@latest add https://beehexa.design/r/copy-button.json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Use
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { Ellipsis, ListFilter, RefreshCw, Trash2 } from '@lucide/vue'
|
|
20
|
+
import { Button } from '@/components/ui/button'
|
|
21
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
|
|
22
|
+
|
|
23
|
+
const tools = [
|
|
24
|
+
{ label: 'Sync now', icon: RefreshCw },
|
|
25
|
+
{ label: 'Filter', icon: ListFilter },
|
|
26
|
+
{ label: 'More actions', icon: Ellipsis },
|
|
27
|
+
]
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<TooltipProvider>
|
|
32
|
+
<div class="flex items-center gap-(--bh-space-150)">
|
|
33
|
+
<Tooltip v-for="tool in tools" :key="tool.label">
|
|
34
|
+
<TooltipTrigger as-child>
|
|
35
|
+
<Button variant="ghost" size="icon" :aria-label="tool.label">
|
|
36
|
+
<component :is="tool.icon" />
|
|
37
|
+
</Button>
|
|
38
|
+
</TooltipTrigger>
|
|
39
|
+
<TooltipContent>{{ tool.label }}</TooltipContent>
|
|
40
|
+
</Tooltip>
|
|
41
|
+
<Tooltip>
|
|
42
|
+
<TooltipTrigger as-child>
|
|
43
|
+
<Button variant="ghost-destructive" size="icon" aria-label="Delete mapping">
|
|
44
|
+
<Trash2 />
|
|
45
|
+
</Button>
|
|
46
|
+
</TooltipTrigger>
|
|
47
|
+
<TooltipContent>Delete mapping</TooltipContent>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
</div>
|
|
50
|
+
</TooltipProvider>
|
|
51
|
+
</template>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Props
|
|
55
|
+
|
|
56
|
+
| Prop | Values | Notes |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| Button `size` | `icon-sm`, `icon`, `icon-lg` | Squares of 24, 32 and 40 px |
|
|
59
|
+
| Button `aria-label` | string | Required: the name, repeated in the tooltip |
|
|
60
|
+
| CopyButton `value` | string | Text that goes to the clipboard |
|
|
61
|
+
| CopyButton `label` | string, default `Copy` | Name and tooltip, such as "Copy API key" |
|
|
62
|
+
| CopyButton `copiedLabel` | string, default `Copied` | Said by the live region after copying |
|
|
63
|
+
|
|
64
|
+
## Built on
|
|
65
|
+
|
|
66
|
+
Icon button is the Button with an `icon` size, so it has no component of its own. Copy button is a small preset built from Button and Tooltip.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Live examples of Icon button, with the exact Vue file that renders each one.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import IconButtonBasic from '../../../../registry/beehexa/examples/icon-button/en/IconButtonBasic.vue';
|
|
6
|
+
import IconButtonBasicSource from '../../../../registry/beehexa/examples/icon-button/en/IconButtonBasic.vue?raw';
|
|
7
|
+
import IconButtonSizes from '../../../../registry/beehexa/examples/icon-button/en/IconButtonSizes.vue';
|
|
8
|
+
import IconButtonSizesSource from '../../../../registry/beehexa/examples/icon-button/en/IconButtonSizes.vue?raw';
|
|
9
|
+
import IconButtonClose from '../../../../registry/beehexa/examples/icon-button/en/IconButtonClose.vue';
|
|
10
|
+
import IconButtonCloseSource from '../../../../registry/beehexa/examples/icon-button/en/IconButtonClose.vue?raw';
|
|
11
|
+
import IconButtonCopy from '../../../../registry/beehexa/examples/icon-button/en/IconButtonCopy.vue';
|
|
12
|
+
import IconButtonCopySource from '../../../../registry/beehexa/examples/icon-button/en/IconButtonCopy.vue?raw';
|
|
13
|
+
|
|
14
|
+
Every example is a complete Vue file. Copy it into an app that has the registry installed, or open it in StackBlitz.
|
|
15
|
+
|
|
16
|
+
## Subtle, with a tooltip
|
|
17
|
+
|
|
18
|
+
The usual icon button: Subtle, square, 12 px apart, with its name in aria-label and the same name in a tooltip.
|
|
19
|
+
|
|
20
|
+
<CodeExample source={IconButtonBasicSource} file="IconButtonBasic.vue">
|
|
21
|
+
<IconButtonBasic client:visible />
|
|
22
|
+
</CodeExample>
|
|
23
|
+
|
|
24
|
+
## Sizes and emphasis
|
|
25
|
+
|
|
26
|
+
Squares of 24, 32 and 40 px. Default where the button must look like a control, Primary only for the one main action.
|
|
27
|
+
|
|
28
|
+
<CodeExample source={IconButtonSizesSource} file="IconButtonSizes.vue">
|
|
29
|
+
<IconButtonSizes client:visible />
|
|
30
|
+
</CodeExample>
|
|
31
|
+
|
|
32
|
+
## Close
|
|
33
|
+
|
|
34
|
+
The Close preset: Subtle, top right of a dialog or panel, named "Close". Esc closes too.
|
|
35
|
+
|
|
36
|
+
<CodeExample source={IconButtonCloseSource} file="IconButtonClose.vue">
|
|
37
|
+
<IconButtonClose client:visible />
|
|
38
|
+
</CodeExample>
|
|
39
|
+
|
|
40
|
+
## Copy
|
|
41
|
+
|
|
42
|
+
The Copy preset: after a click the icon turns into a check for 2 seconds and a polite live region says "Copied". No toast.
|
|
43
|
+
|
|
44
|
+
<CodeExample source={IconButtonCopySource} file="IconButtonCopy.vue">
|
|
45
|
+
<IconButtonCopy client:visible />
|
|
46
|
+
</CodeExample>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Icon button",
|
|
3
|
+
"description": "A button that shows only an icon, for actions in tight places such as toolbars and table rows.",
|
|
4
|
+
"group": "Actions",
|
|
5
|
+
"vi": {
|
|
6
|
+
"title": "Nút chỉ có icon",
|
|
7
|
+
"description": "Nút chỉ hiện icon, cho thao tác ở chỗ chật như thanh công cụ và dòng bảng."
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Parts, tokens, sizes and spacing of Icon button.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Tokens
|
|
6
|
+
|
|
7
|
+
| Part | Tokens and values |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Container | Square of `size.control.small`, `.default` or `.large`; radius as Button |
|
|
10
|
+
| Icon | `size.icon.default` (16 px), Lucide |
|
|
11
|
+
| Gap between icon buttons | `space.150` (12 px) |
|
|
12
|
+
| Colours | The Button variants and states, including toggle on |
|
|
13
|
+
| Tooltip | `color.surface.inverse`, `color.text.inverse`, `font.body.small`, 4 px from the button |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: When to use icon button, its parts, states, keys and accessibility.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> **Draft.** Proposed from the survey of 18 design systems and not yet approved. It is in the registry so teams can try it; the API may still change before approval.
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- In toolbars, table rows, card headers and editors, where a label would not fit.
|
|
10
|
+
- For actions whose icon is well known: close, more actions, refresh, delete, copy, filter.
|
|
11
|
+
|
|
12
|
+
## When not to use
|
|
13
|
+
|
|
14
|
+
- For the main action of a screen or dialog. Use a [button](/components/button/usage/) with a label.
|
|
15
|
+
- When the icon is not obvious. Add the label instead of a tooltip.
|
|
16
|
+
|
|
17
|
+
## Anatomy
|
|
18
|
+
|
|
19
|
+
| Part | Required | Notes |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| Container | Yes | A square of the button height: 24, 32 or 40 px. |
|
|
22
|
+
| Icon | Yes | Lucide, `size.icon.default` (16 px), decorative. |
|
|
23
|
+
| Accessible name | Yes | `aria-label`, shown also as a tooltip on hover and focus. |
|
|
24
|
+
|
|
25
|
+
## Variants and states
|
|
26
|
+
|
|
27
|
+
Icon button uses the Button variants: Subtle by default, Default where it must look like a control, Subtle danger for delete in a row. States are the Button states, including toggle on (`aria-pressed="true"`). Icon-only buttons in a row sit 12 px apart (`space.150`).
|
|
28
|
+
|
|
29
|
+
## Preset buttons
|
|
30
|
+
|
|
31
|
+
Two icon buttons have a fixed icon, label and behaviour. They are configurations of Icon button, not separate components.
|
|
32
|
+
|
|
33
|
+
| Preset | Icon | Name | Behaviour |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| Close | `x` | "Close", or "Close" plus what it closes when a page has several | Subtle. Top right of dialogs and drawers; Esc closes too. Small (24 px) inside tags and banners. |
|
|
36
|
+
| Copy | `copy` | "Copy" plus what it copies, such as "Copy API key" | Subtle, small next to the value. After a click the icon turns into `check` for 2 seconds and a polite live region says "Copied". No toast. |
|
|
37
|
+
|
|
38
|
+
## Accessibility
|
|
39
|
+
|
|
40
|
+
- The name is required. A screen reader reads only `aria-label`; the icon is `aria-hidden`.
|
|
41
|
+
- The tooltip repeats the name; it never holds extra information.
|
|
42
|
+
- The tap area grows to 44 px on touch screens while the visible square stays the same.
|