@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,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Export Vue có kiểu, đầy đủ props và vòng đời kéo giãn có số đo."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import {
|
|
9
|
+
ResizablePanel,
|
|
10
|
+
type ResizablePanelDirection,
|
|
11
|
+
type ResizablePanelResizeEvent,
|
|
12
|
+
} from '@beehexa/vue-components';
|
|
13
|
+
import '@beehexa/vue-components/css';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Vue 3.5+ là peer; `@beehexa/design-tokens` là gói phụ thuộc duy nhất. Export CSS có kiểu
|
|
17
|
+
cho import side-effect ở chế độ strict và đã gồm CSS token gốc. Component dùng render
|
|
18
|
+
function TypeScript, nên dùng bản ESM đã build không cần trình biên dịch SFC hay Ant Design
|
|
19
|
+
Vue. Dùng tham chiếu gói cục bộ thật cho tới khi có bản phát hành registry được duyệt;
|
|
20
|
+
version gốc `0.0.0` là riêng tư, không phải một version đã phát hành.
|
|
21
|
+
|
|
22
|
+
## Props và slot
|
|
23
|
+
|
|
24
|
+
| Prop | Kiểu | Mặc định | Quy ước |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| `direction` | `'horizontal'` hoặc `'vertical'` | `'horizontal'` | Hai ô trái/phải hoặc trên/dưới. Bên dùng quyết định breakpoint. |
|
|
27
|
+
| `ratio` | `number` | `0.5` | Tỉ lệ yêu cầu của ô thứ nhất; `v-model:ratio`. |
|
|
28
|
+
| `min` | `number` | `100` | Mức tối thiểu (pixel CSS) cho mỗi ô; dùng `0` để thu gọn sát mép. |
|
|
29
|
+
| `max` | `number` | `Infinity` | Mức tối đa (pixel CSS) của ô thứ nhất. |
|
|
30
|
+
| `preserveMinimum` | `boolean` | `false` | Chế độ truy cập tài liệu chỉ định rõ: giữ `min` sẵn có của mỗi ô cộng rãnh vật lý theo trục đang dùng. Phần tử cha phải cho phép cuộn phần tràn thật; ô có giới hạn thông thường vẫn nới mức tối thiểu. |
|
|
31
|
+
| `minRatio` | `number` | `0` | Tỉ lệ dưới của ô thứ nhất, trong `[0, 1]`. |
|
|
32
|
+
| `maxRatio` | `number` | `1` | Tỉ lệ trên của ô thứ nhất, trong `[0, 1]`. |
|
|
33
|
+
| `secondVisible` | `boolean` | `true` | Ẩn/inert ô thứ hai mà không gỡ khỏi DOM; ô thứ nhất lấp đầy, tỉ lệ được khôi phục khi hiện lại. |
|
|
34
|
+
| `resizerSize` | `string` | `'90%'` | Độ dài CSS/phần trăm của đường chia hiển thị theo trục vuông góc, nằm giữa và không vượt độ dài phần tử chứa. |
|
|
35
|
+
| `separatorLabel` | `string` | `'Resize panels'` | Tên truy cập do bên dùng dịch. |
|
|
36
|
+
|
|
37
|
+
`#first` và `#second` cung cấp hai cây con của ô được giữ nguyên. Component không sở hữu
|
|
38
|
+
tiêu đề, model editor, mức zoom biểu đồ, ngôn ngữ ứng dụng hay trạng thái toàn màn hình.
|
|
39
|
+
|
|
40
|
+
Giới hạn pixel tối thiểu được nới đều khi phần tử chứa không đủ chỗ cho cả hai; giới hạn
|
|
41
|
+
tối đa chỉ định rõ thắng giới hạn tối thiểu mâu thuẫn. Giới hạn hiện hành bằng nhau sẽ tắt
|
|
42
|
+
tương tác nhưng giữ rãnh vật lý; giới hạn hai đầu bằng nhau thì ẩn luôn rãnh. Thay đổi giới
|
|
43
|
+
hạn hiện hành hủy cử chỉ đang diễn ra mà không gỡ ô nào.
|
|
44
|
+
Giới hạn tạm thời của phần tử chứa kẹp bố cục mà không thay tỉ lệ model đã yêu cầu.
|
|
45
|
+
Enter/nhấp đúp đặt lại về tỉ lệ ghi nhận lúc tạo, trong giới hạn hiện tại; thay đổi từ code
|
|
46
|
+
không định nghĩa lại điểm đặt lại đó.
|
|
47
|
+
|
|
48
|
+
## Sự kiện và kiểu
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
type ResizablePanelDirection = 'horizontal' | 'vertical';
|
|
52
|
+
interface ResizablePanelResizeEvent {
|
|
53
|
+
ratio: number;
|
|
54
|
+
direction: ResizablePanelDirection;
|
|
55
|
+
first: { width: number; height: number };
|
|
56
|
+
second: { width: number; height: number };
|
|
57
|
+
source: 'pointer' | 'keyboard' | 'container' | 'programmatic';
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
| Sự kiện | Payload | Khi nào |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| `update:ratio` | `number` | Con trỏ/bàn phím yêu cầu một tỉ lệ ô thứ nhất trong giới hạn. |
|
|
64
|
+
| `resize-start` | `ResizablePanelResizeEvent` | Bắt đầu kéo bằng con trỏ, bắt đầu cử chỉ bàn phím được hỗ trợ, hoặc bắt đầu đặt lại. |
|
|
65
|
+
| `resize` | `ResizablePanelResizeEvent` | Tỉ lệ đổi do tương tác; đo lần đầu/đo container; model, hướng, trạng thái hiện hay giới hạn đổi từ bên ngoài. |
|
|
66
|
+
| `resize-end` | `ResizablePanelResizeEvent` | Thả/hủy/mất capture/mất focus cửa sổ, nhả phím/mất focus, đặt lại xong, hoặc cử chỉ bị kết thúc do props thay đổi. |
|
|
67
|
+
|
|
68
|
+
Sự kiện có số đo chạy sau khi Vue cập nhật DOM và sang khung hình kế tiếp. Chiều rộng và
|
|
69
|
+
chiều cao lấy từ hình chữ nhật thật đã render của mỗi ô. Ô thứ hai bị ẩn báo 0; `ratio` vẫn
|
|
70
|
+
là tỉ lệ chia hiệu lực để khôi phục. Sự kiện di chuyển được gộp theo khung hình mà không đảo
|
|
71
|
+
thứ tự start/end. `v-model` của cha phản hồi lại như thường không biến sự kiện của người
|
|
72
|
+
dùng thành sự kiện từ code. Thay đổi từ container và từ code phát `resize` mà không tự tạo
|
|
73
|
+
start/end tương tác.
|
|
74
|
+
|
|
75
|
+
Dùng các kích thước này để bố cục lại editor/biểu đồ/quy trình đang giữ, không phải để đổi
|
|
76
|
+
key, model, zoom hay trạng thái gắn kết của nó. ResizeObserver và mọi listener, capture,
|
|
77
|
+
việc animation frame của cử chỉ đều được dọn khi gỡ component. Import/render phía server an
|
|
78
|
+
toàn; việc theo dõi bố cục bắt đầu khi gắn kết, và ID ô dùng `useId` an toàn SSR của Vue.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Tích hợp ô chia đôi mã nguồn/xem trước có giới hạn và đổi hướng theo màn hình."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Giữ nguyên mã nguồn và xem trước
|
|
6
|
+
|
|
7
|
+
Import CSS gốc một lần. Cung cấp phần tử cha có giới hạn và giữ các component trong slot
|
|
8
|
+
luôn gắn kết; panel lo việc cắt nội dung, ẩn hiện và cơ chế kéo giãn.
|
|
9
|
+
|
|
10
|
+
```vue
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { ref } from 'vue';
|
|
13
|
+
import { ResizablePanel, type ResizablePanelResizeEvent } from '@beehexa/vue-components';
|
|
14
|
+
import '@beehexa/vue-components/css';
|
|
15
|
+
|
|
16
|
+
const ratio = ref(0.62);
|
|
17
|
+
const previewVisible = ref(true);
|
|
18
|
+
const sourceHost = ref<HTMLElement>();
|
|
19
|
+
const previewHost = ref<HTMLElement>();
|
|
20
|
+
const paneSizes = ref<ResizablePanelResizeEvent>();
|
|
21
|
+
function resized(event: ResizablePanelResizeEvent) {
|
|
22
|
+
paneSizes.value = event;
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div style="height: 32rem; min-height: 0; min-width: 0">
|
|
28
|
+
<ResizablePanel
|
|
29
|
+
v-model:ratio="ratio"
|
|
30
|
+
:second-visible="previewVisible"
|
|
31
|
+
:min="0"
|
|
32
|
+
separator-label="Đổi kích thước mã nguồn và xem trước"
|
|
33
|
+
@resize="resized"
|
|
34
|
+
>
|
|
35
|
+
<template #first><div ref="sourceHost" style="height: 100%; min-height: 0" /></template>
|
|
36
|
+
<template #second><div ref="previewHost" style="height: 100%; min-height: 0" /></template>
|
|
37
|
+
</ResizablePanel>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Gắn instance editor/canvas được giữ nguyên vào hai phần tử chứa. Phản ứng với `paneSizes`
|
|
43
|
+
bằng API bố cục gốc của trình hiển thị; giữ nguyên model và mức zoom hiện có. Không thay
|
|
44
|
+
phần tử chứa hay gắn lại model chỉ để phản ứng với thay đổi chiều rộng/chiều cao.
|
|
45
|
+
Với `min=0`, Home/End có thể thu gọn hẳn một ô mà vẫn giữ instance của nó.
|
|
46
|
+
Enter hoặc nhấp đúp thanh chia khôi phục tỉ lệ ban đầu 0.62 trong giới hạn hiện hành.
|
|
47
|
+
|
|
48
|
+
## Đổi hướng theo màn hình và tên đã dịch
|
|
49
|
+
|
|
50
|
+
Ứng dụng vốn đã sở hữu trạng thái breakpoint và ngôn ngữ. Suy ra hướng từ trạng thái đó;
|
|
51
|
+
không đặt key cho panel hay phần tử con theo nó.
|
|
52
|
+
|
|
53
|
+
```vue
|
|
54
|
+
<ResizablePanel
|
|
55
|
+
v-model:ratio="ratio"
|
|
56
|
+
:direction="isMobile ? 'vertical' : 'horizontal'"
|
|
57
|
+
:separator-label="t('resizeSourceAndPreview')"
|
|
58
|
+
:min="100"
|
|
59
|
+
resizer-size="90%"
|
|
60
|
+
@resize="onPaneResize"
|
|
61
|
+
>
|
|
62
|
+
<template #first><SourceEditor /></template>
|
|
63
|
+
<template #second><WorkflowPreview /></template>
|
|
64
|
+
</ResizablePanel>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`isMobile`, `t`, các component editor/xem trước được giữ nguyên và callback bố cục lại thuộc
|
|
68
|
+
về bên dùng. Thư viện không áp breakpoint ứng dụng hay một singleton dịch thuật nào. Đổi
|
|
69
|
+
theme dùng biến CSS gốc ngay lập tức.
|
|
70
|
+
|
|
71
|
+
Cả hai ví dụ đều dành một rãnh vật lý theo token giữa hai ô. Ở ví dụ đổi hướng, kiểm tra
|
|
72
|
+
có ba chấm dọc nằm giữa trước khi đổi trục và ba chấm ngang nằm giữa sau khi đổi. Kích
|
|
73
|
+
thước tay nắm và vùng bấm không đổi để giả căn giữa; phóng chữ ở root phóng cả đường kính
|
|
74
|
+
chấm và khoảng cách, với lề bằng nhau quanh cả cụm chấm.
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Ô cố định/toàn màn hình được giữ nguyên
|
|
78
|
+
|
|
79
|
+
Với bề mặt toàn màn hình chỉ có ô thứ nhất, dùng `min=0` và hai giới hạn tỉ lệ bằng nhau là
|
|
80
|
+
`1`; chỉ có ô thứ hai thì dùng hai giới hạn bằng `0`. Cách này ẩn/tắt thanh chia mà không
|
|
81
|
+
di chuyển hay gỡ phần tử con trong slot. Khôi phục giới hạn thường sẽ khôi phục tỉ lệ chia
|
|
82
|
+
đã yêu cầu. Nếu chỉ cần tạm ẩn ô thứ hai, dùng `secondVisible`. Component không thêm khung
|
|
83
|
+
toàn màn hình hay modal; giữ nguyên hành vi toàn màn hình/overlay gốc của phần tử cha.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Hướng dẫn dùng ô chia đôi có thể kéo giãn, do beehexa.design sở hữu và giữ nguyên trạng thái."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Sở hữu và khi nào dùng
|
|
6
|
+
|
|
7
|
+
`ResizablePanel` thuộc gói `@beehexa/vue-components`, do beehexa.design sở hữu. Đây là
|
|
8
|
+
component Vue 3 đã được triển khai, không phải công thức Ant Design Vue hay thanh chia do
|
|
9
|
+
bên dùng tự làm. Phụ thuộc runtime duy nhất là gói design token gốc; Vue 3.5+ là peer.
|
|
10
|
+
Dùng cho editor nguồn/xem trước, ô sơ đồ/quy trình, vùng so sánh và drawer thật sự cần
|
|
11
|
+
kéo giãn. Bố cục tĩnh thông thường dùng các khối bố cục gốc; không làm thanh điều hướng
|
|
12
|
+
ứng dụng kéo giãn được.
|
|
13
|
+
|
|
14
|
+
## Bố cục có giới hạn
|
|
15
|
+
|
|
16
|
+
Cho component một chiều cao và chiều rộng khả dụng xác định. Các phần tử flex/grid xung
|
|
17
|
+
quanh phải cho phép co lại bằng `min-width: 0` và `min-height: 0`; không lấy chiều cao
|
|
18
|
+
container mới từ nội dung Monaco hay chiều cao tự nhiên của SVG Mermaid. Hai ô cộng với
|
|
19
|
+
rãnh chia (lấy từ token gốc) bằng đúng không gian khả dụng của phần tử chứa. Rãnh là một
|
|
20
|
+
phần tử anh em thật trong luồng bố cục, không phải vùng bấm phủ lên thanh cuộn của ô. Tay
|
|
21
|
+
nắm nằm gọn trong rãnh, tránh nội dung bị cắt và vùng cuộn của ô.
|
|
22
|
+
Khi không tương tác, cả root lẫn các ô đều không tạo stacking context: overlay cố định
|
|
23
|
+
lồng bên trong (Monaco, quy trình, kiểm tra) tham gia vào lớp overlay của phần tử cha
|
|
24
|
+
thật, nằm trên thanh chia bên ngoài. Không thêm `z-index` cố định cho ô hay cô lập root
|
|
25
|
+
để nâng tay nắm; làm vậy sẽ giữ chế độ toàn màn hình lồng bên trong nằm dưới thanh chia
|
|
26
|
+
anh em của nó.
|
|
27
|
+
Lớp bọc của ô là flex container dạng cột, co lại được: Card, editor hay canvas dạng lấp
|
|
28
|
+
đầy có thể giãn hết ô. Không thay luồng đó bằng kích thước theo nội dung, và không thêm
|
|
29
|
+
phần tử cuộn thứ hai quanh một phần tử con đã có giới hạn.
|
|
30
|
+
|
|
31
|
+
`horizontal` là hai ô trái/phải; `vertical` là hai ô trên/dưới. Bên dùng chọn hướng theo
|
|
32
|
+
quy tắc breakpoint sẵn có của mình. Thư viện không có breakpoint ứng dụng viết cứng bên
|
|
33
|
+
trong. Giữ nguyên component và các phần tử con trong slot khi đổi hướng trên mobile, khi
|
|
34
|
+
mở toàn màn hình hoặc khi ẩn một ô.
|
|
35
|
+
|
|
36
|
+
## Giữ nguyên trạng thái
|
|
37
|
+
|
|
38
|
+
Gắn tỉ lệ của ô thứ nhất trên **không gian của các ô, không tính rãnh** bằng `v-model:ratio`.
|
|
39
|
+
`secondVisible=false` cho ô thứ nhất lấp đầy phần tử chứa và ẩn/vô hiệu ô thứ hai mà không
|
|
40
|
+
gỡ nó khỏi DOM. Hiện lại sẽ khôi phục tỉ lệ đã yêu cầu trước đó. Ô có kích thước 0 cũng
|
|
41
|
+
vẫn được giữ: dùng `min=0` khi thật sự muốn thu gọn sát mép. Không đặt key cho model,
|
|
42
|
+
editor, canvas hay panel theo tỉ lệ, hướng, trạng thái hiện hay kích thước từ sự kiện
|
|
43
|
+
resize. Không xóa nội dung model, mức zoom hay chế độ toàn màn hình chỉ để ép đo lại.
|
|
44
|
+
Thanh chia đang focus giữ quyền xử lý phím của nó kể cả khi con trỏ vẫn nằm trên Workflow
|
|
45
|
+
Canvas gốc. Phần tử gốc sẵn có của nó mang dấu `.nokey` theo tài liệu của SDK; dấu này
|
|
46
|
+
không đặt trên ô nào hay trên root của panel, nên điều hướng đồ thị vẫn hoạt động trong
|
|
47
|
+
canvas. Không chặn sự kiện của document, không tắt keymap của đồ thị và không thêm bản vá
|
|
48
|
+
DOM ở phía bên dùng để phân xử.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
`min` giữ chỗ tối thiểu (tính bằng pixel CSS) cho mỗi ô, `max` giới hạn ô thứ nhất, còn
|
|
52
|
+
`minRatio`/`maxRatio` giới hạn tỉ lệ của nó. Giới hạn pixel tối thiểu và tối đa được tính
|
|
53
|
+
sau khi đã trừ rãnh thật, kể cả khi người đọc phóng to hoặc dùng con trỏ thô. Nếu phần tử
|
|
54
|
+
chứa không đủ chỗ cho cả hai giới hạn tối thiểu, chúng được nới đều hai bên thay vì gây
|
|
55
|
+
tràn. Giới hạn tối đa được chỉ định rõ thắng giới hạn tối thiểu mâu thuẫn. Giới hạn tạm
|
|
56
|
+
thời giữ nguyên tỉ lệ đã yêu cầu. Khi giới hạn hiệu lực bằng nhau, không kéo giãn được
|
|
57
|
+
nhưng vẫn giữ rãnh; khi giới hạn hai đầu bằng nhau, rãnh cũng bị bỏ cho ô toàn màn hình
|
|
58
|
+
được giữ lại (`min=0`). Ẩn ô thứ hai cũng bỏ rãnh.
|
|
59
|
+
|
|
60
|
+
Với trang tài liệu đầy đủ mà tiêu đề có thể chiếm hết chiều cao khả dụng,
|
|
61
|
+
`preserveMinimum` giữ phần `min` sẵn có cho mỗi ô đang hiện cộng với rãnh tương tác gốc
|
|
62
|
+
không giới hạn theo trục đang dùng. Vùng cuộn của document bên ngoài phải cho phép phần
|
|
63
|
+
tràn đó. Ẩn ô thứ hai chỉ giữ một giới hạn tối thiểu; đổi hướng sẽ chuyển giới hạn sang
|
|
64
|
+
trục kia mà không gỡ và gắn lại phần tử con. Mặc định vẫn là có giới hạn và nới đều giới
|
|
65
|
+
hạn tối thiểu. Đây không phải mức tối thiểu cho trình hiển thị dễ đọc, và không được ép
|
|
66
|
+
các ô trên mobile về mức tương đương 350px của bề mặt SDK.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## Thanh chia, theme và phản hồi
|
|
70
|
+
|
|
71
|
+
Đường chia hiển thị mặc định nằm giữa, dài 90% theo trục vuông góc, chừa 5% ở mỗi đầu.
|
|
72
|
+
Tay nắm luôn ở giữa (50%), nằm trên cả hai ô. Rãnh vật lý dùng `resize.target` /
|
|
73
|
+
`resize.touchTarget` và chứa trọn vùng bấm của con trỏ, giữ nó tránh xa thanh cuộn của ô.
|
|
74
|
+
`resizerSize` chỉ đổi đường hiển thị. Tay nắm có **đúng ba chấm tròn**, cách đều và đối
|
|
75
|
+
xứng quanh tâm của nó trên cả hai trục: xếp dọc cho hai ô trái/phải, xếp ngang cho hai ô
|
|
76
|
+
trên/dưới. `resize.dot.size` và `resize.dot.pitch` quy định kích thước chấm cố định; số
|
|
77
|
+
chấm không do gradient lặp, phần dư bị cắt hay độ lệch của bên dùng quyết định.
|
|
78
|
+
|
|
79
|
+
`resize.*` quy định màu đường chia, tay nắm, nền, trạng thái active và kích thước tay nắm.
|
|
80
|
+
Token viền và khoảng cách gốc quy định focus và chi tiết tay nắm. Import một lần entry CSS
|
|
81
|
+
có kiểu của gói; nó đã bao gồm CSS design token. Đổi sáng/tối theo theme root gốc ngay lập
|
|
82
|
+
tức, và kích thước tính bằng rem tôn trọng mức phóng chữ của người đọc. Không thêm selector
|
|
83
|
+
AntD tùy tiện, con trỏ trên body hay overlay z cao toàn cục. Chỉ khi đang kéo bằng con trỏ,
|
|
84
|
+
root và các ô mới tạm cô lập dưới lớp chắn kéo cục bộ, để nội dung editor/iframe không chặn
|
|
85
|
+
cử chỉ đó. Khi kết thúc cử chỉ, lớp chắn và stacking context của nó được gỡ bỏ. Kích thước
|
|
86
|
+
không bao giờ có hiệu ứng chuyển động.
|
|
87
|
+
|
|
88
|
+
## Bên dùng phản ứng khi kéo giãn
|
|
89
|
+
|
|
90
|
+
Lắng nghe `resize` để nhận kích thước ô đã đo **sau khi bố cục xong**. Dùng số đo đó để yêu
|
|
91
|
+
cầu các instance Monaco/Mermaid/quy trình đang giữ cập nhật bố cục. Payload gồm tỉ lệ,
|
|
92
|
+
hướng, chiều rộng và chiều cao của ô thứ nhất/thứ hai, và nguồn `pointer`, `keyboard`,
|
|
93
|
+
`container` hoặc `programmatic`. Ô thứ hai bị ẩn báo kích thước 0 trong khi tỉ lệ chia vẫn
|
|
94
|
+
được giữ. Cử chỉ tương tác còn phát `resize-start` và `resize-end`; cập nhật từ container
|
|
95
|
+
hoặc từ code không tự tạo vòng đời tương tác. Xem [Code](/vi/components/resizable-panel/code/)
|
|
96
|
+
cho toàn bộ hợp đồng và [Khả năng tiếp cận](/vi/components/resizable-panel/accessibility/)
|
|
97
|
+
cho yêu cầu về bàn phím và đặt tên.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Import CSS thanh cuộn một lần và đánh dấu các phần tử có cuộn.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Cài đặt
|
|
6
|
+
|
|
7
|
+
Mọi phần tử DOM gốc có cuộn dùng chung một kiểu thanh cuộn Beehexa, kể cả thân Table
|
|
8
|
+
của framework, vùng chứa Tree/list, drawer và portal popup gốc. Import module dùng cho
|
|
9
|
+
toàn ứng dụng một lần, cạnh token gốc:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import '@beehexa/design-tokens/css';
|
|
13
|
+
import '@beehexa/design-tokens/css/scrollbars';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Đặt `bh-scroll-region` trên các phần tử tràn (overflow) thật do ứng dụng tạo, như một
|
|
17
|
+
dấu đánh dấu phần tử sở hữu vùng cuộn, không phải lớp bọc trình bày bên ngoài. Vùng chứa
|
|
18
|
+
gốc của framework không cần class hay sửa node bên trong: chỉ cần import module là thanh
|
|
19
|
+
cuộn DOM gốc của chúng có cùng kiểu, kể cả các phần tử đo đạc ẩn ngoài màn hình. Cách vẽ
|
|
20
|
+
này không đổi overflow, chiều cao, rãnh bắt buộc, sự kiện hay kích thước ảo. Bố cục cung
|
|
21
|
+
cấp giới hạn thật và `overflow:auto` khi cần; đừng bao giờ ép hiện thanh trống chỉ để
|
|
22
|
+
thấy kiểu thanh cuộn.
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<!-- Existing application layout owns the bounded height and overflow:auto. -->
|
|
26
|
+
<section class="inspection-pane bh-scroll-region" aria-label="Inspection results">
|
|
27
|
+
<!-- The complete logical pane content, including its horizontal extent. -->
|
|
28
|
+
</section>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Mỗi ô (pane) logic dùng một phần tử cuộn, với rãnh liền mạch cho toàn bộ nội dung cuộn
|
|
32
|
+
của nó. Khung và lớp bọc slot của ô có thể kéo giãn không được vô tình trở thành phần tử
|
|
33
|
+
cuộn thêm. Các phần tử flex/grid cha không cuộn cần cho phép co lại (`min-width: 0` /
|
|
34
|
+
`min-height: 0`) khi phù hợp. Chỉ để tiêu đề nằm ngoài phần tử cuộn khi cố ý cố định nó;
|
|
35
|
+
không chia một ô thành nhiều dải cuộn chỉ để tạo kiểu thanh cuộn. Editor hay danh sách
|
|
36
|
+
cuộn độc lập là vùng cuộn con có chủ ý, không phải lý do đặt `overflow: auto` cho mọi
|
|
37
|
+
lớp bọc. Kiểm tra cả nội dung dài và ngắn, cả hai trục cùng lúc, khi đổi kích thước và
|
|
38
|
+
trên bố cục mobile; nội dung ngắn không được có thanh cuộn trống.
|
|
39
|
+
|
|
40
|
+
Cách vẽ này không đổi `scroll-behavior`, `overscroll-behavior`, touch action, xử lý con
|
|
41
|
+
lăn hay bàn phím. Kiểu liền mạch nghĩa là dùng chung cách vẽ và một phần tử cuộn liên
|
|
42
|
+
tục, không bắt buộc hiệu ứng cuộn mượt. Giữ cơ chế cuộn lan sang trang như bình thường;
|
|
43
|
+
không mặc định thêm `overscroll-behavior: contain`. Không bao giờ ẩn thanh cuộn bằng
|
|
44
|
+
`scrollbar-width: none`, `display: none` của WebKit, kích thước bằng 0 hay quy tắc ẩn
|
|
45
|
+
cũ của MS. Không để nội dung chỉ dùng để cuộn bị cử chỉ kéo/di chuyển chiếm quyền.
|
|
46
|
+
|
|
47
|
+
## Monaco Diff Overview và cập nhật kích thước
|
|
48
|
+
|
|
49
|
+
Monaco dùng `beehexaEditorOptions(locale, observedRootFontSize)` cho kích thước
|
|
50
|
+
thanh cuộn/slider và màu theme `scrollbarSlider` gốc. Dùng lại observer root;
|
|
51
|
+
giữ nguyên model, vùng chọn, undo, vị trí cuộn và cơ chế dispose.
|
|
52
|
+
|
|
53
|
+
Diff Overview là bản đồ thay đổi hai làn riêng, không phải thanh cuộn thứ hai.
|
|
54
|
+
Monaco cố định bản đồ rộng 30 px và marker viewport rộng bằng bản đồ, không có
|
|
55
|
+
API công khai cho chiều rộng marker. Source chỉ thu hẹp phần marker nhìn thấy
|
|
56
|
+
theo `scrollbar.width`, đặt sát cuối trục inline và dùng màu thumb bình thường,
|
|
57
|
+
hover, pressed cùng radius. Một `!important` có phạm vi ghi đè chiều rộng inline
|
|
58
|
+
gốc; vẫn giữ cả hai làn và các dấu thay đổi. Không đổi top/height của marker,
|
|
59
|
+
ủy quyền con trỏ, con lăn hay đồng bộ cuộn original/modified. Không tắt
|
|
60
|
+
`renderOverviewRuler` hoặc ẩn thanh cuộn thật của editor/modal để giả cùng chiều rộng.
|
|
61
|
+
|
|
62
|
+
Với DiffEditor của `monaco-editor-vue3`, gắn callback mount do
|
|
63
|
+
`useBeehexaMonacoDiffOptions(computedOptions)` trả về như trong
|
|
64
|
+
[editor companion](/tools/editors/#public-editor-companion). Khác code editor,
|
|
65
|
+
wrapper Vue này không theo dõi options sau mount; chỉ truyền prop computed không
|
|
66
|
+
cập nhật kích thước thanh cuộn khi reader root thay đổi. Cập nhật instance đang
|
|
67
|
+
giữ, không remount editor để đổi kích thước.
|
|
68
|
+
|
|
69
|
+
Kiểm tra sáng/tối, root16/root20, hai trục, kéo marker và cuộn đồng bộ hai phía,
|
|
70
|
+
thay đổi locale/root khi vẫn giữ model, cùng nội dung dài/ngắn và forced colors.
|
|
71
|
+
Giữ cơ chế cuộn, bàn phím, chạm và fallback hệ thống gốc.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
---
|
|
3
|
+
import TokenTable from '../../../components/TokenTable.astro';
|
|
4
|
+
|
|
5
|
+
## Tương phản, tương tác và cơ chế dự phòng của trình duyệt
|
|
6
|
+
|
|
7
|
+
Phần nổi bật là con trượt (thumb), không phải rãnh (track). Giữ màu gốc không trong
|
|
8
|
+
suốt của con trượt đủ khác với rãnh ở cả hai theme; khi đổi alias gốc của chúng,
|
|
9
|
+
kiểm tra cặp con trượt/rãnh đạt ít nhất 3:1. Trạng thái hover và active dùng vai trò
|
|
10
|
+
màu chữ đậm hơn, không dùng độ trong suốt hay một sắc độ tự đặt. Chữ và vòng focus
|
|
11
|
+
quanh vùng cuộn vẫn dùng vai trò màu chữ và màu focus riêng của chúng. Thanh cuộn
|
|
12
|
+
mảnh không phải cách nhập duy nhất: giữ nguyên khả năng cuộn bằng con lăn, chạm, bàn
|
|
13
|
+
phím và công nghệ hỗ trợ. Nếu vùng cuộn không thể với tới bằng cách khác, đặt tên
|
|
14
|
+
truy cập phù hợp và cho nó nhận focus bàn phím khi cần; không thêm điểm dừng Tab thừa
|
|
15
|
+
cho các component gốc vốn đã với tới được.
|
|
16
|
+
|
|
17
|
+
Trình duyệt có pseudo-element thanh cuộn WebKit dùng kích thước từ token cho cả chiều
|
|
18
|
+
rộng và chiều cao, màu rãnh và góc, bo tròn đầy đủ, cùng trạng thái hover/active thật
|
|
19
|
+
của con trượt. Stylesheet chọn cách vẽ này bằng feature query và để các thuộc tính
|
|
20
|
+
thanh cuộn chuẩn ở `auto`, vì khi các thuộc tính chuẩn khác `auto` thì Chromium hiện
|
|
21
|
+
đại không vẽ pseudo-element. Trình duyệt chỉ hỗ trợ chuẩn dùng kích thước `thin` gốc
|
|
22
|
+
và cùng màu con trượt/rãnh; API của chúng không có bo góc, góc giao hay pseudo-element
|
|
23
|
+
hover/kéo cho con trượt, nên màu hover/active theo trạng thái tương ứng của vùng cuộn.
|
|
24
|
+
Không khẳng định kích thước giống hệt từng pixel và không giả lập sự kiện con trượt
|
|
25
|
+
còn thiếu bằng JavaScript.
|
|
26
|
+
|
|
27
|
+
Thanh cuộn nổi (overlay) của hệ điều hành có thể giữ cách hiện, vùng bấm và kích thước
|
|
28
|
+
gốc. Giữ hành vi đó của nền tảng thay vì ép một rãnh cố định, ẩn thanh cuộn hay vẽ
|
|
29
|
+
thanh thay thế. Ở chế độ forced colors, cách vẽ tùy chỉnh không áp dụng: màu và kích
|
|
30
|
+
thước thanh cuộn hệ thống vẫn dùng được. Trình duyệt không hỗ trợ giữ thanh cuộn gốc.
|
|
31
|
+
Không cơ chế dự phòng nào trong số này cho phép ứng dụng tự đặt một kiểu thanh cuộn
|
|
32
|
+
khác cạnh tranh.
|
|
33
|
+
|
|
34
|
+
## Token
|
|
35
|
+
|
|
36
|
+
<TokenTable prefix="scrollbar" />
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Các phím, những gì Segmented control 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
|
+
**Segmented control đạt WCAG 2.2 mức AA khi được dùng như mô tả trên các trang này.** Component theo [mẫu Radio Group](https://www.w3.org/WAI/ARIA/apg/patterns/radio/) 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 segment đang chọn. |
|
|
14
|
+
| <kbd>←</kbd> <kbd>→</kbd> | Chọn segment trước hoặc sau. |
|
|
15
|
+
|
|
16
|
+
## Những gì Segmented control có sẵn
|
|
17
|
+
|
|
18
|
+
- `role="radiogroup"` với `role="radio"` và `aria-checked` trên mỗi segment.
|
|
19
|
+
- Segment đang chọn khác ở nền, bóng và màu chữ.
|
|
20
|
+
|
|
21
|
+
## Những gì đội của bạn cần làm
|
|
22
|
+
|
|
23
|
+
- Đặt `aria-label` cho control.
|
|
24
|
+
- Trong biểu mẫu có nút gửi, dùng radio.
|
|
25
|
+
|
|
26
|
+
## Tiêu chí WCAG
|
|
27
|
+
|
|
28
|
+
| Tiêu chí | Mức | Cách đạt |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| 1.4.1 Use of Color | A | Fill, shadow and text change together |
|
|
31
|
+
| 2.1.1 Keyboard | A | Arrow keys select |
|
|
32
|
+
| 4.1.2 Name, Role, Value | A | `aria-checked` |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cài đặt, props và các phần tạo nên Segmented control.
|
|
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/segmented-control.json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Cách dùng
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { ref } from 'vue'
|
|
18
|
+
import { SegmentedControl, SegmentedControlItem } from '@/components/ui/segmented-control'
|
|
19
|
+
|
|
20
|
+
const period = ref('week')
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="flex flex-col items-start gap-(--bh-space-100)">
|
|
25
|
+
<SegmentedControl v-model="period" aria-label="Khoảng thời gian">
|
|
26
|
+
<SegmentedControlItem value="day">Ngày</SegmentedControlItem>
|
|
27
|
+
<SegmentedControlItem value="week">Tuần</SegmentedControlItem>
|
|
28
|
+
<SegmentedControlItem value="month">Tháng</SegmentedControlItem>
|
|
29
|
+
</SegmentedControl>
|
|
30
|
+
<p class="m-0 text-(--bh-color-text-subtle)">Đang xem đồng bộ theo {{ period }}</p>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Prop | Giá trị | Ghi chú |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| `v-model` (`modelValue`) | chuỗi | Giá trị đang chọn |
|
|
40
|
+
| `aria-label` | chuỗi | Tên của lựa chọn, như "Khoảng thời gian" |
|
|
41
|
+
| SegmentedControlItem `value` | chuỗi | Bắt buộc |
|
|
42
|
+
| `disabled` | boolean | Cho cả control hoặc một mục |
|
|
43
|
+
|
|
44
|
+
## Dựng từ
|
|
45
|
+
|
|
46
|
+
Bọc RadioGroup của reka-ui: đây là nhóm radio trông như các segment.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ví dụ trực tiếp của Segmented control, kèm đúng file Vue tạo ra từng ví dụ.
|
|
3
|
+
---
|
|
4
|
+
import CodeExample from '../../../components/CodeExample.astro';
|
|
5
|
+
import SegmentedText from '../../../../registry/beehexa/examples/segmented-control/vi/SegmentedText.vue';
|
|
6
|
+
import SegmentedTextSource from '../../../../registry/beehexa/examples/segmented-control/vi/SegmentedText.vue?raw';
|
|
7
|
+
import SegmentedIcons from '../../../../registry/beehexa/examples/segmented-control/vi/SegmentedIcons.vue';
|
|
8
|
+
import SegmentedIconsSource from '../../../../registry/beehexa/examples/segmented-control/vi/SegmentedIcons.vue?raw';
|
|
9
|
+
|
|
10
|
+
Mỗi ví dụ là một file Vue hoàn chỉnh. Chép vào app đã cài registry, hoặc mở trong StackBlitz.
|
|
11
|
+
|
|
12
|
+
## Chữ
|
|
13
|
+
|
|
14
|
+
Hai tới năm lựa chọn ngắn. Thay đổi có hiệu lực ngay.
|
|
15
|
+
|
|
16
|
+
<CodeExample source={SegmentedTextSource} file="SegmentedText.vue">
|
|
17
|
+
<SegmentedText client:visible />
|
|
18
|
+
</CodeExample>
|
|
19
|
+
|
|
20
|
+
## Icon
|
|
21
|
+
|
|
22
|
+
Mỗi segment icon cần aria-label. Không trộn icon và chữ trong một control.
|
|
23
|
+
|
|
24
|
+
<CodeExample source={SegmentedIconsSource} file="SegmentedIcons.vue">
|
|
25
|
+
<SegmentedIcons client:visible />
|
|
26
|
+
</CodeExample>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cấu tạo, token, kích thước và khoảng cách của Segmented control.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Token
|
|
6
|
+
|
|
7
|
+
| Phần | Token và giá trị |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Rãnh | `color.background.neutral`, `radius.control`, padding `space.050`; cao 32 px với segment 24 px |
|
|
10
|
+
| Segment | Cao `size.control.small`, `font.label.default`, `color.text.subtle`, `radius.control.small` |
|
|
11
|
+
| Hover | `color.background.neutral.hover`, chữ `color.text` |
|
|
12
|
+
| Đang chọn | `color.surface`, `elevation.shadow.raised`, chữ `color.text` |
|
|
13
|
+
| Khoảng cách | `space.025` |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Khi nào dùng segmented control, cấu tạo, trạng thái, phím và khả năng tiếp cận.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> **Bản nháp.** Đề xuất từ khảo sát 18 design system, chưa được duyệt. Đã có trong registry để các đội dùng thử; API còn có thể đổi trước khi duyệt.
|
|
6
|
+
|
|
7
|
+
## Khi nào dùng
|
|
8
|
+
|
|
9
|
+
- Để đổi kiểu xem, khoảng thời gian hoặc định dạng của nội dung ngay bên cạnh: Ngày, Tuần, Tháng; Danh sách hoặc Lưới.
|
|
10
|
+
- Khi mọi lựa chọn vừa một hàng và thay đổi có hiệu lực ngay, không cần nút Lưu.
|
|
11
|
+
|
|
12
|
+
## Khi nào không dùng
|
|
13
|
+
|
|
14
|
+
- Cho hơn năm lựa chọn, hoặc nhãn dài. Dùng select.
|
|
15
|
+
- Trong biểu mẫu có bước gửi. Dùng radio.
|
|
16
|
+
- Để chạy thao tác. Dùng [nhóm nút](/vi/components/button-group/usage/).
|
|
17
|
+
|
|
18
|
+
## Cấu tạo
|
|
19
|
+
|
|
20
|
+
| Phần | Ghi chú |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| Rãnh | `color.background.neutral`, `radius.control`, lề trong `space.050` |
|
|
23
|
+
| Mục | Cao 24 px, `font.label.default`, chữ `color.text.subtle`; hover `color.background.neutral.hover` |
|
|
24
|
+
| Mục đang chọn | `color.surface` với `elevation.shadow.raised`, chữ `color.text` |
|
|
25
|
+
|
|
26
|
+
Mục chứa chữ, hoặc icon kèm `aria-label`. Không trộn hai kiểu trong một control.
|
|
27
|
+
|
|
28
|
+
## Bàn phím
|
|
29
|
+
|
|
30
|
+
| Phím | Tác dụng |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| Tab | Chuyển focus tới mục đang chọn |
|
|
33
|
+
| Phím mũi tên | Chọn mục trước hoặc sau |
|
|
34
|
+
|
|
35
|
+
## Khả năng tiếp cận
|
|
36
|
+
|
|
37
|
+
- `role="radiogroup"` có `aria-label`; mỗi mục là `role="radio"` có `aria-checked`.
|
|
38
|
+
- Mục đang chọn khác ở nền, bóng và màu chữ, không chỉ khác màu.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Các phím, những gì Split button có sẵn và những gì đội của bạn cần làm.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Mức tuân thủ
|
|
6
|
+
|
|
7
|
+
**Split button đạt WCAG 2.2 mức AA khi được dùng như mô tả trên các trang này.** Component theo [mẫu Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/) của WAI-ARIA Authoring Practices.
|
|
8
|
+
|
|
9
|
+
## Bàn phím
|
|
10
|
+
|
|
11
|
+
| Phím | Tác dụng |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| <kbd>Tab</kbd> | Tới nút thao tác, rồi tới nửa menu. |
|
|
14
|
+
| <kbd>Enter</kbd> hoặc <kbd>Space</kbd> | Chạy thao tác, hoặc mở menu ở nửa menu. |
|
|
15
|
+
| Phím trong menu | Như [menu button](/vi/components/menu-button/accessibility/). |
|
|
16
|
+
|
|
17
|
+
## Những gì Split button có sẵn
|
|
18
|
+
|
|
19
|
+
- Hai nút thật, mỗi nút có vòng focus và tên riêng.
|
|
20
|
+
- `role="group"` bao quanh cặp nút.
|
|
21
|
+
|
|
22
|
+
## Những gì đội của bạn cần làm
|
|
23
|
+
|
|
24
|
+
- Đặt tên nhóm theo thao tác và tên nửa menu theo những gì nó mở ra.
|
|
25
|
+
- Vô hiệu cả hai nửa cùng lúc, không bao giờ chỉ một nửa.
|
|
26
|
+
|
|
27
|
+
## Tiêu chí WCAG
|
|
28
|
+
|
|
29
|
+
| Tiêu chí | Mức | Cách đạt |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| 4.1.2 Name, Role, Value | A | Each half has a name; the menu half has `aria-expanded` |
|
|
32
|
+
| 2.4.7 Focus Visible | AA | Each half shows its own ring |
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cài đặt, props và các phần tạo nên Split button.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Cài đặt
|
|
6
|
+
|
|
7
|
+
Chạy trong app, sau `shadcn-vue init` và theme Beehexa ([Nút › Code](/vi/components/button/code/)):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx shadcn-vue@latest add https://beehexa.design/r/button.json
|
|
11
|
+
npx shadcn-vue@latest add https://beehexa.design/r/button-group.json
|
|
12
|
+
npx shadcn-vue@latest add https://beehexa.design/r/dropdown-menu.json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Cách dùng
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { ChevronDown } from '@lucide/vue'
|
|
20
|
+
import { Button } from '@/components/ui/button'
|
|
21
|
+
import { ButtonGroup } from '@/components/ui/button-group'
|
|
22
|
+
import {
|
|
23
|
+
DropdownMenu,
|
|
24
|
+
DropdownMenuContent,
|
|
25
|
+
DropdownMenuItem,
|
|
26
|
+
DropdownMenuTrigger,
|
|
27
|
+
} from '@/components/ui/dropdown-menu'
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<ButtonGroup aria-label="Chạy đồng bộ">
|
|
32
|
+
<Button>Chạy ngay</Button>
|
|
33
|
+
<DropdownMenu>
|
|
34
|
+
<DropdownMenuTrigger as-child>
|
|
35
|
+
<Button size="icon" aria-label="Cách chạy khác"><ChevronDown /></Button>
|
|
36
|
+
</DropdownMenuTrigger>
|
|
37
|
+
<DropdownMenuContent align="end">
|
|
38
|
+
<DropdownMenuItem>Chạy thử</DropdownMenuItem>
|
|
39
|
+
<DropdownMenuItem>Chạy cho một cửa hàng</DropdownMenuItem>
|
|
40
|
+
<DropdownMenuItem>Lên lịch…</DropdownMenuItem>
|
|
41
|
+
</DropdownMenuContent>
|
|
42
|
+
</DropdownMenu>
|
|
43
|
+
</ButtonGroup>
|
|
44
|
+
</template>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
| Prop | Giá trị | Ghi chú |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| ButtonGroup `aria-label` | chuỗi | Tên của thao tác, như "Chạy đồng bộ" |
|
|
52
|
+
| Nửa menu `aria-label` | chuỗi | Tên riêng, như "Cách chạy khác" |
|
|
53
|
+
| Hai nửa `variant` | Cùng một biến thể Button | Primary hoặc Mặc định |
|
|
54
|
+
|
|
55
|
+
## Dựng từ
|
|
56
|
+
|
|
57
|
+
Không có component riêng, giống shadcn-vue: một ButtonGroup liền nhau gồm một Button và một Button chỉ có icon mở Dropdown menu.
|