@kubex/zinc 1.1.184 → 2.0.0
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/.browserslistrc +2 -0
- package/.github/workflows/js_build_and_deploy.yaml +54 -1
- package/.github/workflows/test.yaml +27 -0
- package/dist/chunks/zn.UWJLIXDT.js +1 -0
- package/dist/custom-elements.json +10344 -2583
- package/dist/vscode.html-custom-data.json +1102 -125
- package/dist/web-types.json +2217 -224
- package/dist/zn.d.ts +2306 -417
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +2313 -1635
- package/docs/_includes/default.njk +4 -1
- package/docs/assets/scripts/docs.js +22 -6
- package/docs/assets/styles/docs.css +9 -2
- package/docs/data/report-table-day-compare.json +380 -0
- package/docs/data/report-table.json +314 -0
- package/docs/pages/components/avatar-group.md +57 -0
- package/docs/pages/components/badge.md +67 -0
- package/docs/pages/components/button.md +41 -1
- package/docs/pages/components/chat-message.md +16 -0
- package/docs/pages/components/checkbox.md +1 -1
- package/docs/pages/components/chip.md +25 -13
- package/docs/pages/components/color-picker.md +37 -0
- package/docs/pages/components/copy-button.md +2 -2
- package/docs/pages/components/data-table-filter.md +33 -50
- package/docs/pages/components/data-table-search.md +4 -4
- package/docs/pages/components/data-table.md +27 -3
- package/docs/pages/components/date-range.md +116 -0
- package/docs/pages/components/dialog.md +29 -37
- package/docs/pages/components/diff-row.md +28 -0
- package/docs/pages/components/diff.md +46 -0
- package/docs/pages/components/editor.md +55 -0
- package/docs/pages/components/filter-wrapper.md +20 -0
- package/docs/pages/components/icon.md +46 -1
- package/docs/pages/components/input.md +30 -11
- package/docs/pages/components/item.md +35 -0
- package/docs/pages/components/key-value.md +25 -0
- package/docs/pages/components/menu.md +74 -7
- package/docs/pages/components/nav-item.md +15 -0
- package/docs/pages/components/nav-list.md +132 -0
- package/docs/pages/components/navbar.md +100 -1
- package/docs/pages/components/page.md +242 -74
- package/docs/pages/components/priority-list.md +43 -5
- package/docs/pages/components/query-builder.md +23 -0
- package/docs/pages/components/radio-group.md +33 -1
- package/docs/pages/components/radio.md +1 -1
- package/docs/pages/components/report-table.md +202 -0
- package/docs/pages/components/stat.md +30 -0
- package/docs/pages/components/tile.md +11 -0
- package/docs/pages/components/tooltip.md +1 -1
- package/docs/pages/components/translation-grid.md +86 -0
- package/docs/pages/components/vertical-stepper.md +108 -64
- package/package.json +2 -1
- package/scss/_global-spacing.scss +2 -2
- package/scss/_root.scss +11 -171
- package/scss/boot.scss +14 -0
- package/scss/mixins/_helper-mixins.scss +24 -2
- package/scss/mixins/_motion-mixins.scss +126 -0
- package/scss/mixins/_spacing-mixins.scss +4 -3
- package/scss/mixins/_tab-indicator-mixins.scss +12 -0
- package/scss/mixins/_typography-mixins.scss +1 -1
- package/scss/mixins/index.scss +14 -0
- package/scss/shared/_base.scss +32 -1
- package/scss/shared/_button-mixin.scss +7 -5
- package/scss/shared/_table.scss +35 -4
- package/scss/shared/nav.scss +4 -0
- package/scss/shared/shimmer.scss +1 -1
- package/scss/table-controls.scss +206 -0
- package/scss/themes/_dark.scss +1 -3
- package/scss/themes/_index.scss +1 -1
- package/scss/themes/_light.scss +46 -6
- package/scss/themes/_modes.scss +11 -11
- package/scss/themes/_openbyte.scss +944 -0
- package/scss/themes/_typography.scss +4 -2
- package/scss/variables/index.scss +0 -9
- package/src/components/alert/alert.component.ts +14 -4
- package/src/components/alert/alert.scss +55 -69
- package/src/components/alert/alert.test.ts +8 -0
- package/src/components/animated-button/animated-button.component.ts +3 -2
- package/src/components/animated-button/animated-button.scss +6 -23
- package/src/components/animated-button/animated-button.test.ts +4 -3
- package/src/components/avatar-group/avatar-group.component.ts +84 -0
- package/src/components/avatar-group/avatar-group.scss +54 -0
- package/src/components/avatar-group/avatar-group.test.ts +59 -0
- package/src/components/avatar-group/index.ts +12 -0
- package/src/components/badge/badge.component.ts +49 -0
- package/src/components/badge/badge.scss +80 -0
- package/src/components/badge/badge.test.ts +34 -0
- package/src/components/badge/index.ts +12 -0
- package/src/components/bulk-actions/bulk-actions.component.ts +14 -2
- package/src/components/button/button.component.ts +242 -11
- package/src/components/button/button.scss +133 -25
- package/src/components/button/button.test.ts +122 -0
- package/src/components/button-menu/button-menu.component.ts +32 -11
- package/src/components/button-menu/button-menu.scss +5 -1
- package/src/components/channel-tile/channel-tile.component.ts +34 -27
- package/src/components/channel-tile/channel-tile.scss +76 -43
- package/src/components/chart/builders.test.ts +46 -0
- package/src/components/chart/builders.ts +27 -3
- package/src/components/chart/chart-live.test.ts +4 -6
- package/src/components/chart/chart.component.ts +125 -5
- package/src/components/chart/chart.scss +121 -0
- package/src/components/chart/chart.test.ts +81 -0
- package/src/components/chat-message/chat-message.component.ts +21 -1
- package/src/components/chat-message/chat-message.scss +13 -2
- package/src/components/chat-message/chat-message.test.ts +9 -0
- package/src/components/checkbox/checkbox.component.ts +61 -27
- package/src/components/checkbox/checkbox.scss +58 -25
- package/src/components/checkbox-group/checkbox-group.component.ts +7 -1
- package/src/components/chip/chip.component.ts +11 -1
- package/src/components/chip/chip.scss +91 -26
- package/src/components/chip/chip.test.ts +17 -0
- package/src/components/collapsible/collapsible.component.ts +17 -3
- package/src/components/collapsible/collapsible.scss +19 -10
- package/src/components/color-picker/color-picker.component.ts +277 -0
- package/src/components/color-picker/color-picker.scss +141 -0
- package/src/components/color-picker/color-picker.test.ts +57 -0
- package/src/components/color-picker/index.ts +12 -0
- package/src/components/cols/cols.component.ts +17 -3
- package/src/components/cols/cols.scss +24 -13
- package/src/components/cols/cols.test.ts +33 -0
- package/src/components/confirm/confirm.component.ts +20 -6
- package/src/components/confirm/confirm.test.ts +52 -0
- package/src/components/content-block/content-block.component.ts +38 -9
- package/src/components/content-block/content-block.scss +11 -5
- package/src/components/content-block/content-block.test.ts +26 -0
- package/src/components/copy-button/copy-button.component.ts +2 -2
- package/src/components/copy-button/copy-button.scss +17 -4
- package/src/components/data-select/data-select.component.ts +3 -1
- package/src/components/data-table/data-table.component.ts +364 -142
- package/src/components/data-table/data-table.scss +133 -60
- package/src/components/data-table/data-table.test.ts +356 -4
- package/src/components/data-table-filter/data-table-filter.component.ts +426 -406
- package/src/components/data-table-filter/data-table-filter.scss +176 -148
- package/src/components/data-table-filter/data-table-filter.test.ts +271 -273
- package/src/components/data-table-search/data-table-search.component.ts +4 -2
- package/src/components/data-table-search/data-table-search.scss +8 -1
- package/src/components/data-table-search/data-table-search.test.ts +29 -0
- package/src/components/date-range/date-range-math.test.ts +78 -0
- package/src/components/date-range/date-range-math.ts +105 -0
- package/src/components/date-range/date-range.component.ts +375 -0
- package/src/components/date-range/date-range.scss +272 -0
- package/src/components/date-range/date-range.test.ts +247 -0
- package/src/components/date-range/index.ts +12 -0
- package/src/components/datepicker/datepicker.component.ts +44 -7
- package/src/components/datepicker/datepicker.scss +9 -0
- package/src/components/datepicker/datepicker.test.ts +2 -2
- package/src/components/dialog/dialog.component.ts +38 -19
- package/src/components/dialog/dialog.scss +65 -36
- package/src/components/dialog/dialog.test.ts +14 -0
- package/src/components/diff/diff.component.ts +55 -0
- package/src/components/diff/diff.scss +46 -0
- package/src/components/diff/diff.test.ts +15 -0
- package/src/components/diff/index.ts +12 -0
- package/src/components/diff-row/diff-row.component.ts +75 -0
- package/src/components/diff-row/diff-row.scss +70 -0
- package/src/components/diff-row/diff-row.test.ts +37 -0
- package/src/components/diff-row/index.ts +12 -0
- package/src/components/dropdown/dropdown.component.ts +12 -10
- package/src/components/dropdown/dropdown.scss +2 -0
- package/src/components/editor/editor.component.ts +159 -11
- package/src/components/editor/editor.scss +250 -1
- package/src/components/editor/editor.test.ts +31 -3
- package/src/components/editor/modules/ai/panel/ai-panel.scss +0 -1
- package/src/components/editor/modules/attachment/attachment.ts +53 -31
- package/src/components/editor/modules/context-menu/context-menu.ts +17 -0
- package/src/components/editor/modules/dialog/dialog.component.ts +23 -1
- package/src/components/editor/modules/dialog/dialog.test.ts +28 -0
- package/src/components/editor/modules/emoji/emoji.ts +4 -5
- package/src/components/editor/modules/merge-field/merge-field.ts +83 -0
- package/src/components/editor/modules/toolbar/toolbar.component.ts +121 -68
- package/src/components/editor/modules/toolbar/toolbar.scss +38 -0
- package/src/components/editor/modules/toolbar/toolbar.ts +25 -1
- package/src/components/empty-state/empty-state.component.ts +6 -1
- package/src/components/empty-state/empty-state.scss +21 -4
- package/src/components/expanding-action/expanding-action.component.ts +22 -34
- package/src/components/expanding-action/expanding-action.scss +3 -45
- package/src/components/expanding-action/expanding-action.test.ts +2 -1
- package/src/components/file/file.component.ts +30 -2
- package/src/components/file/file.scss +6 -0
- package/src/components/filter-wrapper/filter-wrapper.component.ts +45 -10
- package/src/components/filter-wrapper/filter-wrapper.test.ts +58 -2
- package/src/components/flow-builder/flow-builder.component.ts +36 -3
- package/src/components/flow-builder/flow-builder.scss +0 -6
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.component.ts +8 -0
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.scss +10 -5
- package/src/components/flow-builder/modules/flow-node/flow-node.component.ts +17 -0
- package/src/components/flow-builder/modules/flow-node/flow-node.scss +10 -0
- package/src/components/form-actions/form-actions.component.ts +48 -2
- package/src/components/form-actions/form-actions.scss +1 -1
- package/src/components/form-group/form-group.component.ts +10 -3
- package/src/components/form-group/form-group.scss +37 -4
- package/src/components/form-group/form-group.test.ts +10 -0
- package/src/components/header/header.component.ts +11 -4
- package/src/components/header/header.scss +47 -5
- package/src/components/hover-container/hover-container.component.ts +4 -5
- package/src/components/icon/icon.component.ts +95 -9
- package/src/components/icon/icon.scss +70 -6
- package/src/components/icon/icon.test.ts +55 -0
- package/src/components/icon-picker/icon-picker.component.ts +35 -1
- package/src/components/inline-edit/inline-edit.component.ts +38 -8
- package/src/components/inline-edit/inline-edit.scss +128 -19
- package/src/components/input/input.component.ts +173 -297
- package/src/components/input/input.scss +65 -43
- package/src/components/input/input.test.ts +86 -4
- package/src/components/item/item.component.ts +12 -0
- package/src/components/item/item.scss +102 -3
- package/src/components/item/item.test.ts +23 -0
- package/src/components/key/key.component.ts +2 -2
- package/src/components/key/key.scss +11 -0
- package/src/components/key-value/index.ts +12 -0
- package/src/components/key-value/key-value.component.ts +160 -0
- package/src/components/key-value/key-value.scss +20 -0
- package/src/components/key-value/key-value.test.ts +22 -0
- package/src/components/markdown-editor/markdown-editor.component.ts +8 -1
- package/src/components/menu/menu.component.ts +21 -2
- package/src/components/menu/menu.scss +43 -23
- package/src/components/menu/menu.test.ts +33 -0
- package/src/components/menu-item/menu-item.component.ts +13 -2
- package/src/components/menu-item/menu-item.scss +56 -23
- package/src/components/menu-item/menu-item.test.ts +31 -0
- package/src/components/menu-item/submenu-controller.ts +25 -15
- package/src/components/menu-label/index.ts +12 -0
- package/src/components/menu-label/menu-label.component.ts +30 -0
- package/src/components/menu-label/menu-label.scss +18 -0
- package/src/components/nav-item/index.ts +12 -0
- package/src/components/nav-item/nav-item.component.ts +83 -0
- package/src/components/nav-item/nav-item.scss +128 -0
- package/src/components/nav-list/index.ts +12 -0
- package/src/components/nav-list/nav-list.component.ts +313 -0
- package/src/components/nav-list/nav-list.scss +87 -0
- package/src/components/nav-list/nav-list.test.ts +250 -0
- package/src/components/navbar/navbar.component.ts +235 -171
- package/src/components/navbar/navbar.scss +333 -169
- package/src/components/navbar/navbar.test.ts +63 -143
- package/src/components/page/page.component.ts +114 -29
- package/src/components/page/page.scss +223 -95
- package/src/components/page/page.test.ts +214 -3
- package/src/components/page-builder/page-builder.component.ts +51 -5
- package/src/components/page-builder/page-builder.scss +6 -1
- package/src/components/page-nav/page-nav.component.ts +25 -3
- package/src/components/page-nav/page-nav.scss +10 -2
- package/src/components/pagination/pagination.scss +1 -1
- package/src/components/panel/panel.component.ts +14 -13
- package/src/components/panel/panel.scss +14 -10
- package/src/components/panel/panel.test.ts +42 -0
- package/src/components/popup/popup.component.ts +20 -13
- package/src/components/popup/popup.test.ts +21 -1
- package/src/components/priority-list/priority-list.component.ts +157 -172
- package/src/components/priority-list/priority-list.scss +113 -17
- package/src/components/priority-list/priority-list.test.ts +301 -3
- package/src/components/progress-bar/progress-bar.component.ts +1 -1
- package/src/components/progress-bar/progress-bar.scss +16 -4
- package/src/components/progress-tile/progress-tile.scss +1 -1
- package/src/components/query-builder/query-builder.component.ts +85 -10
- package/src/components/query-builder/query-builder.scss +7 -1
- package/src/components/query-builder/query-builder.test.ts +40 -0
- package/src/components/radio/radio.component.ts +57 -18
- package/src/components/radio/radio.scss +101 -26
- package/src/components/radio-group/radio-group.component.ts +45 -7
- package/src/components/radio-group/radio-group.scss +17 -0
- package/src/components/radio-group/radio-group.test.ts +63 -2
- package/src/components/rating/rating.component.ts +23 -0
- package/src/components/rating/rating.scss +1 -1
- package/src/components/remarkd-editor/remarkd-editor.component.ts +60 -5
- package/src/components/remarkd-editor/remarkd-editor.scss +12 -4
- package/src/components/report-table/index.ts +12 -0
- package/src/components/report-table/report-format.test.ts +86 -0
- package/src/components/report-table/report-format.ts +72 -0
- package/src/components/report-table/report-math.test.ts +74 -0
- package/src/components/report-table/report-math.ts +252 -0
- package/src/components/report-table/report-table.component.ts +681 -0
- package/src/components/report-table/report-table.scss +328 -0
- package/src/components/report-table/report-table.test.ts +702 -0
- package/src/components/reveal/reveal.component.ts +15 -1
- package/src/components/reveal/reveal.scss +5 -0
- package/src/components/schedule-builder/schedule-builder.component.ts +23 -8
- package/src/components/scroll-container/scroll-container.component.ts +19 -1
- package/src/components/scroll-container/scroll-container.scss +6 -1
- package/src/components/select/select.component.ts +52 -36
- package/src/components/select/select.scss +42 -25
- package/src/components/select/select.test.ts +14 -2
- package/src/components/settings-container/settings-container.scss +18 -5
- package/src/components/sidebar/sidebar.component.ts +8 -1
- package/src/components/sidebar/sidebar.scss +6 -1
- package/src/components/skeleton/skeleton.component.ts +3 -3
- package/src/components/skeleton/skeleton.scss +6 -6
- package/src/components/skeleton/skeleton.test.ts +9 -0
- package/src/components/slash-menu/slash-menu.scss +1 -1
- package/src/components/slideout/slideout.component.ts +20 -3
- package/src/components/slideout/slideout.scss +13 -6
- package/src/components/slideout/slideout.test.ts +19 -0
- package/src/components/split-button/split-button.component.ts +1 -1
- package/src/components/split-pane/split-pane.component.ts +71 -8
- package/src/components/split-pane/split-pane.scss +145 -41
- package/src/components/split-pane/split-pane.test.ts +23 -3
- package/src/components/stat/stat.component.ts +209 -14
- package/src/components/stat/stat.scss +305 -5
- package/src/components/stat/stat.test.ts +143 -2
- package/src/components/status-indicator/status-indicator.scss +22 -21
- package/src/components/stepper/stepper.scss +3 -3
- package/src/components/tab/tab.component.ts +1 -0
- package/src/components/table/table.component.ts +12 -1
- package/src/components/table/table.scss +21 -13
- package/src/components/table/table.test.ts +17 -0
- package/src/components/tabs/tabs.component.ts +150 -37
- package/src/components/tabs/tabs.scss +48 -7
- package/src/components/tabs/tabs.test.ts +169 -0
- package/src/components/textarea/textarea.component.ts +25 -3
- package/src/components/textarea/textarea.scss +10 -0
- package/src/components/textarea/textarea.test.ts +8 -4
- package/src/components/theme-editor/theme-editor.scss +0 -6
- package/src/components/tile/tile.component.ts +32 -2
- package/src/components/tile/tile.scss +40 -7
- package/src/components/tile/tile.test.ts +10 -0
- package/src/components/toggle/toggle.component.ts +23 -7
- package/src/components/toggle/toggle.scss +36 -29
- package/src/components/toggle/toggle.test.ts +17 -0
- package/src/components/tooltip/tooltip.component.ts +3 -0
- package/src/components/tooltip/tooltip.scss +11 -6
- package/src/components/tooltip/tooltip.test.ts +12 -0
- package/src/components/translation-field/index.ts +12 -0
- package/src/components/translation-field/translation-field.component.ts +55 -0
- package/src/components/translation-field/translation-field.scss +101 -0
- package/src/components/translation-fields/index.ts +12 -0
- package/src/components/translation-fields/translation-fields.component.ts +80 -0
- package/src/components/translation-fields/translation-fields.scss +60 -0
- package/src/components/translation-grid/index.ts +12 -0
- package/src/components/translation-grid/translation-grid.component.ts +157 -0
- package/src/components/translation-grid/translation-grid.scss +138 -0
- package/src/components/translation-grid/translation-grid.test.ts +28 -0
- package/src/components/vertical-stepper/vertical-stepper.component.ts +35 -9
- package/src/components/vertical-stepper/vertical-stepper.scss +110 -39
- package/src/components/vertical-stepper/vertical-stepper.test.ts +35 -0
- package/src/components/well/well.scss +2 -2
- package/src/events/events.ts +2 -0
- package/src/events/zn-chart-click.ts +13 -0
- package/src/events/zn-report-change.ts +7 -0
- package/src/form-control.scss +36 -3
- package/src/internal/anchored-popover.ts +175 -0
- package/src/internal/animate.ts +19 -5
- package/src/internal/cosmic-border.ts +15 -0
- package/src/internal/form.ts +1 -1
- package/src/internal/hover-intent.ts +15 -0
- package/src/internal/input-modality.ts +15 -0
- package/src/internal/pointer-intent.ts +37 -0
- package/src/internal/reorder.ts +625 -0
- package/src/internal/scroll.ts +51 -3
- package/src/internal/selection-card.ts +1 -1
- package/src/internal/tab-indicator.ts +92 -0
- package/src/internal/table-sort.ts +25 -0
- package/src/internal/table-tabs.ts +108 -0
- package/src/internal/test-drag.ts +35 -0
- package/src/internal/theme-openbyte.test.ts +126 -0
- package/src/internal/theme.ts +4 -4
- package/src/internal/zinc-element.ts +2 -2
- package/src/selection-card.scss +25 -0
- package/src/types/web-test-runner-commands.d.ts +1 -0
- package/src/utilities/color.test.ts +43 -0
- package/src/utilities/color.ts +189 -0
- package/src/zinc.ts +14 -0
- package/.github/workflows/eleventy_build.yml +0 -42
- package/scss/themes/_aura.scss +0 -114
|
@@ -6,159 +6,327 @@ layout: component
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
```html:preview
|
|
9
|
-
<zn-page caption="
|
|
10
|
-
<zn-
|
|
9
|
+
<zn-page caption="Margot Foster" summary="Customer since March 2021 · London, UK">
|
|
10
|
+
<zn-badge slot="caption-badges" type="success" dot>Active</zn-badge>
|
|
11
|
+
<zn-button slot="actions" color="secondary" icon="mail@lu">Email</zn-button>
|
|
12
|
+
<zn-button slot="actions" color="primary" icon="plus@lu">New Subscription</zn-button>
|
|
11
13
|
|
|
12
14
|
<zn-tab caption="Overview">
|
|
13
|
-
|
|
15
|
+
<zn-sp>
|
|
16
|
+
<zn-panel caption="Contact">
|
|
17
|
+
<zn-sp divide no-gap>
|
|
18
|
+
<zn-item caption="Email">margot.foster@example.com</zn-item>
|
|
19
|
+
<zn-item caption="Phone">+44 20 7946 0958</zn-item>
|
|
20
|
+
<zn-item caption="Plan">Business, billed annually</zn-item>
|
|
21
|
+
</zn-sp>
|
|
22
|
+
</zn-panel>
|
|
23
|
+
</zn-sp>
|
|
14
24
|
</zn-tab>
|
|
15
25
|
|
|
16
|
-
<zn-tab caption="
|
|
17
|
-
|
|
26
|
+
<zn-tab caption="Subscriptions">
|
|
27
|
+
<zn-sp>
|
|
28
|
+
<zn-empty-state caption="No subscriptions" description="Subscriptions for this customer appear here." icon="repeat@lu"></zn-empty-state>
|
|
29
|
+
</zn-sp>
|
|
18
30
|
</zn-tab>
|
|
19
31
|
|
|
20
|
-
<zn-tab caption="
|
|
21
|
-
|
|
32
|
+
<zn-tab caption="Notes">
|
|
33
|
+
<zn-sp>
|
|
34
|
+
<zn-empty-state caption="No notes" description="Notes left by your team appear here." icon="sticky-note@lu"></zn-empty-state>
|
|
35
|
+
</zn-sp>
|
|
22
36
|
</zn-tab>
|
|
23
|
-
|
|
24
|
-
<zn-tab caption="Dynamic Tab" uri="/tab-three"></zn-tab>
|
|
25
37
|
</zn-page>
|
|
26
38
|
```
|
|
27
39
|
|
|
28
40
|
## Examples
|
|
29
41
|
|
|
30
|
-
### Header
|
|
42
|
+
### Header
|
|
31
43
|
|
|
32
|
-
|
|
44
|
+
Set `caption` and `summary` for the page title and its description, or use the `caption` and `description` slots for rich content. Put status badges in the `caption-badges` slot and controls in the `actions` slot.
|
|
33
45
|
|
|
34
46
|
```html:preview
|
|
35
|
-
<zn-page caption="
|
|
36
|
-
<zn-
|
|
37
|
-
<zn-button slot="actions" color="
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
<zn-page caption="INV-2024-0042" summary="Issued 4 March 2024 · Due in 14 days">
|
|
48
|
+
<zn-badge slot="caption-badges" type="warning">Past due</zn-badge>
|
|
49
|
+
<zn-button slot="actions" color="secondary" icon="download@lu">Download</zn-button>
|
|
50
|
+
<zn-button slot="actions" color="primary">Record Payment</zn-button>
|
|
51
|
+
|
|
52
|
+
<zn-tab caption="Details">
|
|
53
|
+
<zn-sp>
|
|
54
|
+
<zn-cols>
|
|
55
|
+
<zn-panel>
|
|
56
|
+
<zn-stat caption="Amount due" amount="1250" currency="£"></zn-stat>
|
|
57
|
+
</zn-panel>
|
|
58
|
+
<zn-panel>
|
|
59
|
+
<zn-stat caption="Paid" amount="0" currency="£"></zn-stat>
|
|
60
|
+
</zn-panel>
|
|
61
|
+
</zn-cols>
|
|
62
|
+
</zn-sp>
|
|
41
63
|
</zn-tab>
|
|
64
|
+
</zn-page>
|
|
65
|
+
```
|
|
42
66
|
|
|
43
|
-
|
|
44
|
-
Active customer content
|
|
45
|
-
</zn-tab>
|
|
67
|
+
### Breadcrumbs
|
|
46
68
|
|
|
47
|
-
|
|
48
|
-
|
|
69
|
+
Links in the `breadcrumb` slot show above the caption, separated by an icon. Breadcrumbs are hidden in `nested` and `modal` pages.
|
|
70
|
+
|
|
71
|
+
```html:preview
|
|
72
|
+
<zn-page caption="Security" summary="Sign-in and access settings for Acme Inc">
|
|
73
|
+
<a href="#" slot="breadcrumb">Settings</a>
|
|
74
|
+
<a href="#" slot="breadcrumb">Acme Inc</a>
|
|
75
|
+
|
|
76
|
+
<zn-tab caption="Overview">
|
|
77
|
+
<zn-sp>
|
|
78
|
+
<zn-panel caption="Sign-in">
|
|
79
|
+
<zn-sp divide no-gap>
|
|
80
|
+
<zn-item caption="Two-factor authentication">Required for all members</zn-item>
|
|
81
|
+
<zn-item caption="Session timeout">12 hours</zn-item>
|
|
82
|
+
</zn-sp>
|
|
83
|
+
</zn-panel>
|
|
84
|
+
</zn-sp>
|
|
49
85
|
</zn-tab>
|
|
50
86
|
</zn-page>
|
|
51
87
|
```
|
|
52
88
|
|
|
53
89
|
### Header Metadata
|
|
54
90
|
|
|
55
|
-
`
|
|
91
|
+
`previous-path` adds a back button, and `previous-target` sets where it opens. `entity-id` and `full-location` add copy buttons, shown while Alt is held. Hold Alt over this example to see them.
|
|
56
92
|
|
|
57
93
|
```html:preview
|
|
58
94
|
<zn-page
|
|
59
|
-
caption="
|
|
60
|
-
summary="
|
|
61
|
-
|
|
62
|
-
entity-id="
|
|
63
|
-
|
|
95
|
+
caption="Margot Foster"
|
|
96
|
+
summary="Customer"
|
|
97
|
+
previous-path="/customers"
|
|
98
|
+
entity-id="cus_8F2kD91xQ"
|
|
99
|
+
full-location="/customers/cus_8F2kD91xQ">
|
|
64
100
|
<zn-tab caption="Overview">
|
|
65
|
-
|
|
101
|
+
<zn-sp>
|
|
102
|
+
<zn-panel caption="Contact">
|
|
103
|
+
<zn-item caption="Email">margot.foster@example.com</zn-item>
|
|
104
|
+
</zn-panel>
|
|
105
|
+
</zn-sp>
|
|
66
106
|
</zn-tab>
|
|
67
107
|
</zn-page>
|
|
68
108
|
```
|
|
69
109
|
|
|
70
|
-
###
|
|
110
|
+
### Tabs
|
|
71
111
|
|
|
72
|
-
|
|
112
|
+
Each `zn-tab` becomes a tab. A tab gets its `id` from its caption, and a tab captioned Overview gets the empty id, which always shows first. Other tabs keep their source order unless `priority` is set: higher numbers come first. Add `selected` to open a tab other than the first.
|
|
113
|
+
|
|
114
|
+
Tabs stay in the page's light DOM, so styles scoped to where they are written still apply.
|
|
73
115
|
|
|
74
116
|
```html:preview
|
|
75
|
-
<zn-page caption="
|
|
76
|
-
<
|
|
77
|
-
|
|
117
|
+
<zn-page caption="Acme Inc" summary="Workspace">
|
|
118
|
+
<zn-tab caption="Billing" priority="10">
|
|
119
|
+
<zn-sp>
|
|
120
|
+
<zn-panel caption="Billing">
|
|
121
|
+
<zn-item caption="Payment method">Visa ending 4242</zn-item>
|
|
122
|
+
</zn-panel>
|
|
123
|
+
</zn-sp>
|
|
124
|
+
</zn-tab>
|
|
78
125
|
|
|
79
|
-
<zn-tab caption="
|
|
80
|
-
|
|
126
|
+
<zn-tab caption="Members" priority="20" selected>
|
|
127
|
+
<zn-sp>
|
|
128
|
+
<zn-panel caption="Members">
|
|
129
|
+
<zn-sp divide no-gap>
|
|
130
|
+
<zn-item caption="Margot Foster">Owner</zn-item>
|
|
131
|
+
<zn-item caption="Sam Patel">Admin</zn-item>
|
|
132
|
+
</zn-sp>
|
|
133
|
+
</zn-panel>
|
|
134
|
+
</zn-sp>
|
|
81
135
|
</zn-tab>
|
|
82
136
|
|
|
83
|
-
<zn-tab caption="
|
|
84
|
-
|
|
137
|
+
<zn-tab caption="Overview">
|
|
138
|
+
<zn-sp>
|
|
139
|
+
<zn-panel caption="Workspace">
|
|
140
|
+
<zn-item caption="Region">Europe (London)</zn-item>
|
|
141
|
+
</zn-panel>
|
|
142
|
+
</zn-sp>
|
|
85
143
|
</zn-tab>
|
|
86
144
|
</zn-page>
|
|
87
145
|
```
|
|
88
146
|
|
|
89
|
-
###
|
|
147
|
+
### Tab Icons
|
|
90
148
|
|
|
91
|
-
|
|
92
|
-
Tabs render in the order they appear in the page by default. Tabs with an empty id are shown first. Set `priority` on `zn-tab` to order the remaining tabs without changing their DOM position.
|
|
149
|
+
Set `icon` on a `zn-tab` to show an icon before its caption.
|
|
93
150
|
|
|
94
151
|
```html:preview
|
|
95
|
-
<zn-page caption="
|
|
96
|
-
<zn-tab caption="Overview">
|
|
97
|
-
<zn-
|
|
98
|
-
|
|
99
|
-
|
|
152
|
+
<zn-page caption="Margot Foster" summary="Customer">
|
|
153
|
+
<zn-tab caption="Overview" icon="layout-grid@lu">
|
|
154
|
+
<zn-sp>
|
|
155
|
+
<zn-panel caption="Contact">
|
|
156
|
+
<zn-item caption="Email">margot.foster@example.com</zn-item>
|
|
157
|
+
</zn-panel>
|
|
158
|
+
</zn-sp>
|
|
100
159
|
</zn-tab>
|
|
101
160
|
|
|
102
|
-
<zn-tab caption="
|
|
103
|
-
|
|
161
|
+
<zn-tab caption="History" icon="history@lu">
|
|
162
|
+
<zn-sp>
|
|
163
|
+
<zn-empty-state caption="No history yet" icon="history@lu"></zn-empty-state>
|
|
164
|
+
</zn-sp>
|
|
104
165
|
</zn-tab>
|
|
166
|
+
</zn-page>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Dynamic Tabs
|
|
105
170
|
|
|
106
|
-
|
|
107
|
-
|
|
171
|
+
Set `uri` on a `zn-tab` to load its content from that address when the tab is first opened.
|
|
172
|
+
|
|
173
|
+
```html:preview
|
|
174
|
+
<zn-page caption="Reports" summary="Revenue and usage across your workspace">
|
|
175
|
+
<zn-tab caption="Overview">
|
|
176
|
+
<zn-sp>
|
|
177
|
+
<zn-cols>
|
|
178
|
+
<zn-panel>
|
|
179
|
+
<zn-stat caption="Revenue" description="This month" amount="48250" previous="42100" currency="£" show-delta></zn-stat>
|
|
180
|
+
</zn-panel>
|
|
181
|
+
<zn-panel>
|
|
182
|
+
<zn-stat caption="Active customers" amount="1284" previous="1210" show-delta></zn-stat>
|
|
183
|
+
</zn-panel>
|
|
184
|
+
</zn-cols>
|
|
185
|
+
</zn-sp>
|
|
108
186
|
</zn-tab>
|
|
187
|
+
|
|
188
|
+
<zn-tab caption="Revenue" uri="/reports/revenue"></zn-tab>
|
|
189
|
+
<zn-tab caption="Usage" uri="/reports/usage"></zn-tab>
|
|
109
190
|
</zn-page>
|
|
110
191
|
```
|
|
111
192
|
|
|
112
|
-
###
|
|
193
|
+
### Nested Tabs
|
|
113
194
|
|
|
114
|
-
|
|
195
|
+
Put `zn-tab` elements inside a `zn-tab` to give that tab its own set of tabs. They show as a grey pill track below the main tab bar, so they read as secondary.
|
|
115
196
|
|
|
116
197
|
```html:preview
|
|
117
|
-
<zn-page caption="
|
|
118
|
-
<zn-tab caption="
|
|
119
|
-
|
|
198
|
+
<zn-page caption="Margot Foster" summary="Customer">
|
|
199
|
+
<zn-tab caption="Billing">
|
|
200
|
+
<zn-tab caption="Invoices">
|
|
201
|
+
<zn-sp>
|
|
202
|
+
<zn-panel caption="Invoices">
|
|
203
|
+
<zn-sp divide no-gap>
|
|
204
|
+
<zn-item caption="INV-2024-0042">£1,250.00 · Past due</zn-item>
|
|
205
|
+
<zn-item caption="INV-2024-0031">£1,250.00 · Paid</zn-item>
|
|
206
|
+
</zn-sp>
|
|
207
|
+
</zn-panel>
|
|
208
|
+
</zn-sp>
|
|
209
|
+
</zn-tab>
|
|
210
|
+
|
|
211
|
+
<zn-tab caption="Payment Methods">
|
|
212
|
+
<zn-sp>
|
|
213
|
+
<zn-panel caption="Payment methods">
|
|
214
|
+
<zn-item caption="Visa ending 4242">Default · Expires 08/27</zn-item>
|
|
215
|
+
</zn-panel>
|
|
216
|
+
</zn-sp>
|
|
217
|
+
</zn-tab>
|
|
120
218
|
</zn-tab>
|
|
121
219
|
|
|
122
|
-
<zn-tab caption="
|
|
123
|
-
|
|
220
|
+
<zn-tab caption="Notes">
|
|
221
|
+
<zn-sp>
|
|
222
|
+
<zn-empty-state caption="No notes" icon="sticky-note@lu"></zn-empty-state>
|
|
223
|
+
</zn-sp>
|
|
124
224
|
</zn-tab>
|
|
225
|
+
</zn-page>
|
|
226
|
+
```
|
|
125
227
|
|
|
126
|
-
|
|
127
|
-
|
|
228
|
+
A `zn-page` placed in a tab is a page of its own, with its own header and a normal tab bar.
|
|
229
|
+
|
|
230
|
+
### Navigation Style
|
|
231
|
+
|
|
232
|
+
`navigation-style` sets the tab design:
|
|
233
|
+
|
|
234
|
+
- `tabs` – a tab bar below the header. This is the default.
|
|
235
|
+
- `pills` – a pill track with no page header, for a page that only holds a second set of tabs. Nested tabs use it.
|
|
236
|
+
- `sidebar` – for tabs shown outside the page, such as in an app sidebar. The page hides its tab bar unless the `bottom` slot has content, and still loads tabs and keeps their history as the outside navigation selects them.
|
|
237
|
+
|
|
238
|
+
```html:preview
|
|
239
|
+
<zn-page caption="Margot Foster" summary="Customer">
|
|
240
|
+
<zn-tab caption="Billing">
|
|
241
|
+
<zn-page nested navigation-style="pills">
|
|
242
|
+
<zn-tab caption="Invoices">
|
|
243
|
+
<zn-sp>
|
|
244
|
+
<zn-panel caption="Invoices">
|
|
245
|
+
<zn-item caption="INV-2024-0042">£1,250.00 · Past due</zn-item>
|
|
246
|
+
</zn-panel>
|
|
247
|
+
</zn-sp>
|
|
248
|
+
</zn-tab>
|
|
249
|
+
<zn-tab caption="Credit Notes">
|
|
250
|
+
<zn-sp>
|
|
251
|
+
<zn-empty-state caption="No credit notes" icon="receipt@lu"></zn-empty-state>
|
|
252
|
+
</zn-sp>
|
|
253
|
+
</zn-tab>
|
|
254
|
+
</zn-page>
|
|
128
255
|
</zn-tab>
|
|
129
256
|
|
|
130
|
-
<zn-tab caption="
|
|
131
|
-
|
|
257
|
+
<zn-tab caption="Notes">
|
|
258
|
+
<zn-sp>
|
|
259
|
+
<zn-empty-state caption="No notes" icon="sticky-note@lu"></zn-empty-state>
|
|
260
|
+
</zn-sp>
|
|
132
261
|
</zn-tab>
|
|
133
262
|
</zn-page>
|
|
134
263
|
```
|
|
135
264
|
|
|
136
265
|
### Linking to a Tab
|
|
137
266
|
|
|
138
|
-
Give any element in the page
|
|
267
|
+
Give any element in the page a `tab` attribute holding a tab's `id` to open that tab when it is clicked. Links inside a nested `zn-page` or `zn-tabs` open tabs in that nested container.
|
|
139
268
|
|
|
140
269
|
```html:preview
|
|
141
|
-
<zn-page caption="
|
|
142
|
-
<zn-tab caption="
|
|
143
|
-
<zn-
|
|
270
|
+
<zn-page caption="Margot Foster" summary="Customer">
|
|
271
|
+
<zn-tab caption="Overview">
|
|
272
|
+
<zn-sp>
|
|
273
|
+
<zn-panel caption="Billing">
|
|
274
|
+
<zn-item caption="Outstanding balance">£1,250.00</zn-item>
|
|
275
|
+
<zn-button slot="actions" tab="invoices" color="secondary" size="small">View invoices</zn-button>
|
|
276
|
+
</zn-panel>
|
|
277
|
+
</zn-sp>
|
|
144
278
|
</zn-tab>
|
|
145
|
-
|
|
146
|
-
|
|
279
|
+
|
|
280
|
+
<zn-tab caption="Invoices">
|
|
281
|
+
<zn-sp>
|
|
282
|
+
<zn-panel caption="Invoices">
|
|
283
|
+
<zn-item caption="INV-2024-0042">£1,250.00 · Past due</zn-item>
|
|
284
|
+
</zn-panel>
|
|
285
|
+
</zn-sp>
|
|
147
286
|
</zn-tab>
|
|
148
287
|
</zn-page>
|
|
149
288
|
```
|
|
150
289
|
|
|
151
|
-
###
|
|
290
|
+
### Footer
|
|
152
291
|
|
|
153
|
-
|
|
292
|
+
Put actions in the `footer` slot to pin them below the content while it scrolls. Give `zn-form-actions` a `form` attribute so it can submit a form it sits outside of. In a modal page the footer takes the dialog footer's styling.
|
|
154
293
|
|
|
155
294
|
```html:preview
|
|
156
|
-
<zn-page caption="
|
|
157
|
-
<zn-tab caption="
|
|
158
|
-
|
|
295
|
+
<zn-page caption="New Customer" summary="Add a customer to Acme Inc" modal style="height: 420px;">
|
|
296
|
+
<zn-tab caption="Details">
|
|
297
|
+
<form id="page-footer-form">
|
|
298
|
+
<zn-sp>
|
|
299
|
+
<zn-input label="Full name" name="name" required></zn-input>
|
|
300
|
+
<zn-input label="Email" name="email" type="email" required></zn-input>
|
|
301
|
+
</zn-sp>
|
|
302
|
+
</form>
|
|
159
303
|
</zn-tab>
|
|
160
304
|
|
|
161
|
-
<zn-
|
|
162
|
-
|
|
305
|
+
<zn-form-actions slot="footer" form="page-footer-form" with-cancel submit-text="Add customer"
|
|
306
|
+
submit-icon="plus@lu"></zn-form-actions>
|
|
307
|
+
</zn-page>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Full Width
|
|
311
|
+
|
|
312
|
+
The header, tabs and content are capped at the container width (`--zn-container`) and centred. Add `full-width` to let them span the whole page, such as for wide tables. A `flush` page always spans it.
|
|
313
|
+
|
|
314
|
+
```html:preview
|
|
315
|
+
<zn-page caption="Transactions" summary="All payments across your workspace" full-width>
|
|
316
|
+
<zn-tab caption="Overview">
|
|
317
|
+
<zn-sp>
|
|
318
|
+
<zn-cols>
|
|
319
|
+
<zn-panel>
|
|
320
|
+
<zn-stat caption="Volume" description="Last 30 days" amount="182400" currency="£"></zn-stat>
|
|
321
|
+
</zn-panel>
|
|
322
|
+
<zn-panel>
|
|
323
|
+
<zn-stat caption="Payments" description="Last 30 days" amount="3192"></zn-stat>
|
|
324
|
+
</zn-panel>
|
|
325
|
+
<zn-panel>
|
|
326
|
+
<zn-stat caption="Declined" description="Last 30 days" amount="41"></zn-stat>
|
|
327
|
+
</zn-panel>
|
|
328
|
+
</zn-cols>
|
|
329
|
+
</zn-sp>
|
|
330
|
+
</zn-tab>
|
|
163
331
|
</zn-page>
|
|
164
332
|
```
|
|
@@ -165,6 +165,42 @@ Use the `action-{value}` slot to add interactive elements (buttons, links, etc.)
|
|
|
165
165
|
</zn-priority-list>
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
### Tile Items
|
|
169
|
+
|
|
170
|
+
Use `zn-tile` items for titled rows: the tile supplies the caption, description, icon square and its own actions, and
|
|
171
|
+
the list adds the handle, priority and ordering. A `locked` item stays where it is and nothing can move past it.
|
|
172
|
+
`move-buttons` adds up and down buttons to each movable item, ahead of any controls in the item's `action-{value}` slot.
|
|
173
|
+
A tile with an `href` stays clickable, underlining its caption on hover.
|
|
174
|
+
|
|
175
|
+
```html:preview
|
|
176
|
+
<zn-panel flush>
|
|
177
|
+
<zn-priority-list label="Steps" flush move-buttons>
|
|
178
|
+
<zn-tile value="offer" caption="Second chance" description="Offer · Default template · Student 20% (20%)" icon="tag@lu" icon-color="success">
|
|
179
|
+
<zn-chip slot="properties" icon="globe@lu" icon-size="12">1/12</zn-chip>
|
|
180
|
+
<small slot="properties">100% reach it</small>
|
|
181
|
+
</zn-tile>
|
|
182
|
+
<zn-button slot="action-offer" icon="pencil@lu" icon-size="16" icon-button="small" plain tooltip="Edit"></zn-button>
|
|
183
|
+
<zn-button slot="action-offer" icon="trash-2@lu" icon-size="16" icon-button="small" plain tooltip="Delete"></zn-button>
|
|
184
|
+
<zn-tile value="message" caption="Before you go" href="#" description="Message · Retention copy" icon="message-square@lu" icon-color="ai">
|
|
185
|
+
<zn-chip slot="properties" icon="globe@lu" icon-size="12">1/12</zn-chip>
|
|
186
|
+
<small slot="properties">81% reach it</small>
|
|
187
|
+
</zn-tile>
|
|
188
|
+
<zn-button slot="action-message" icon="pencil@lu" icon-size="16" icon-button="small" plain tooltip="Edit"></zn-button>
|
|
189
|
+
<zn-button slot="action-message" icon="trash-2@lu" icon-size="16" icon-button="small" plain tooltip="Delete"></zn-button>
|
|
190
|
+
<zn-tile value="survey" caption="Exit survey" description="Survey · Why are you leaving?" icon="circle-check@lu" icon-color="warning">
|
|
191
|
+
<zn-chip slot="properties" icon="globe@lu" icon-size="12">1/12</zn-chip>
|
|
192
|
+
<small slot="properties">64% reach it</small>
|
|
193
|
+
</zn-tile>
|
|
194
|
+
<zn-button slot="action-survey" icon="pencil@lu" icon-size="16" icon-button="small" plain tooltip="Edit"></zn-button>
|
|
195
|
+
<zn-button slot="action-survey" icon="trash-2@lu" icon-size="16" icon-button="small" plain tooltip="Delete"></zn-button>
|
|
196
|
+
<zn-tile value="confirm" caption="Confirmation" description="Separate confirmation step · always the final step"
|
|
197
|
+
locked>
|
|
198
|
+
<small slot="properties">58% reach it</small>
|
|
199
|
+
</zn-tile>
|
|
200
|
+
</zn-priority-list>
|
|
201
|
+
</zn-panel>
|
|
202
|
+
```
|
|
203
|
+
|
|
168
204
|
### Form Submission
|
|
169
205
|
|
|
170
206
|
When a `name` is set, the component generates hidden inputs for each item as `name[itemValue]=priority`. This example
|
|
@@ -225,9 +261,11 @@ priority assignments.
|
|
|
225
261
|
|
|
226
262
|
### Keyboard Navigation
|
|
227
263
|
|
|
228
|
-
|
|
264
|
+
The list is a single tab stop. Arrow Up, Arrow Down, Home and End move focus between items; hold Alt to reorder:
|
|
265
|
+
|
|
266
|
+
- **Alt + Arrow Up** — Move the focused item up one position
|
|
267
|
+
- **Alt + Arrow Down** — Move the focused item down one position
|
|
268
|
+
- **Alt + Home** — Move the focused item to the top
|
|
269
|
+
- **Alt + End** — Move the focused item to the bottom
|
|
229
270
|
|
|
230
|
-
|
|
231
|
-
- **Arrow Down** — Move the focused item down one position
|
|
232
|
-
- **Home** — Move the focused item to the top
|
|
233
|
-
- **End** — Move the focused item to the bottom
|
|
271
|
+
Locked items can't be moved, and other items can't move past them.
|
|
@@ -112,6 +112,26 @@ This example will show the produced query string from the selected parameters.
|
|
|
112
112
|
<div style="word-wrap: break-word;"><b>Query String:</b> </span><span class="query-string"></span></div>
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
+
### Starting Rules
|
|
116
|
+
|
|
117
|
+
Use `rules` to start with rules already added, in the same `key`, `comparator`, `value` shape the builder submits.
|
|
118
|
+
Add `repeatable` to let a filter be used more than once, for example to filter a date between two days.
|
|
119
|
+
|
|
120
|
+
```html:preview
|
|
121
|
+
<zn-query-builder
|
|
122
|
+
repeatable
|
|
123
|
+
filters="[
|
|
124
|
+
{"id":"email","name":"Email","operators":["eq","starts"]},
|
|
125
|
+
{"id":"rating","name":"Rating","type":"number","operators":["gte","lte"]}
|
|
126
|
+
]"
|
|
127
|
+
rules="[
|
|
128
|
+
{"key":"email","comparator":"starts","value":"sales@"},
|
|
129
|
+
{"key":"rating","comparator":"gte","value":"3"},
|
|
130
|
+
{"key":"rating","comparator":"lte","value":"5"}
|
|
131
|
+
]">
|
|
132
|
+
</zn-query-builder>
|
|
133
|
+
```
|
|
134
|
+
|
|
115
135
|
## Types
|
|
116
136
|
|
|
117
137
|
| Name |
|
|
@@ -140,6 +160,9 @@ This example will show the produced query string from the selected parameters.
|
|
|
140
160
|
| `NStarts` | Does Not Start With |
|
|
141
161
|
| `Wild` | Wildcard Match |
|
|
142
162
|
| `NWild` | Does Not Match Wildcard |
|
|
163
|
+
| `DnContain` | Does Not Contain |
|
|
164
|
+
| `LikeIn` | Like Any Of |
|
|
165
|
+
| `NLikeIn` | Not Like Any Of |
|
|
143
166
|
| `Fuzzy` | Fuzzy Match With |
|
|
144
167
|
| `NFuzzy` | Does Not Match Fuzzy With |
|
|
145
168
|
| `Gte` | Greater Than or Equals |
|
|
@@ -166,7 +166,8 @@ Contained radios can also render as richer [selection cards](/components/radio#s
|
|
|
166
166
|
description, and positioned indicator. The radio group continues to manage their single selection, validation,
|
|
167
167
|
keyboard navigation, and submitted form value.
|
|
168
168
|
|
|
169
|
-
Contained radios are rounded by default; add `square` to the group to square off every radio in it.
|
|
169
|
+
Contained radios are rounded by default; add `square` to the group to square off every radio in it. Add `centered`
|
|
170
|
+
to centre each radio's text, which suits short answers laid out as a row. With
|
|
170
171
|
`horizontal`, cards in a row are given equal height, and `--zn-radio-group-column-width` (default `152px`) sets the
|
|
171
172
|
minimum column width used by the grid.
|
|
172
173
|
|
|
@@ -175,6 +176,37 @@ Add `wrap` to lay the radios out as a wrapping row instead of an equal-width gri
|
|
|
175
176
|
its own content.
|
|
176
177
|
:::
|
|
177
178
|
|
|
179
|
+
### Scale
|
|
180
|
+
|
|
181
|
+
Add `scale` to lay the radios out as one row of segments, filling every segment up to the checked one. Use it for
|
|
182
|
+
ordered answers such as a 1 to 10 rating. Unlike a range input, the group has no value until one is picked, so
|
|
183
|
+
`required` still catches an unanswered scale. Arrow keys move along the scale.
|
|
184
|
+
|
|
185
|
+
```html:preview
|
|
186
|
+
<zn-radio-group name="tone" label="How well did the agent manage the customer's tone?" value="7" scale>
|
|
187
|
+
<zn-radio value="1">1</zn-radio>
|
|
188
|
+
<zn-radio value="2">2</zn-radio>
|
|
189
|
+
<zn-radio value="3">3</zn-radio>
|
|
190
|
+
<zn-radio value="4">4</zn-radio>
|
|
191
|
+
<zn-radio value="5">5</zn-radio>
|
|
192
|
+
<zn-radio value="6">6</zn-radio>
|
|
193
|
+
<zn-radio value="7">7</zn-radio>
|
|
194
|
+
<zn-radio value="8">8</zn-radio>
|
|
195
|
+
<zn-radio value="9">9</zn-radio>
|
|
196
|
+
<zn-radio value="10">10</zn-radio>
|
|
197
|
+
</zn-radio-group>
|
|
198
|
+
<br/>
|
|
199
|
+
<zn-radio-group name="empathy" label="Empathy" help-text="Unanswered until a segment is picked" scale required>
|
|
200
|
+
<zn-radio value="1">1</zn-radio>
|
|
201
|
+
<zn-radio value="2">2</zn-radio>
|
|
202
|
+
<zn-radio value="3">3</zn-radio>
|
|
203
|
+
<zn-radio value="4">4</zn-radio>
|
|
204
|
+
<zn-radio value="5">5</zn-radio>
|
|
205
|
+
</zn-radio-group>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Set `--zn-radio-scale-segment-height` and `--zn-radio-scale-segment-radius` on the radios to resize the segments.
|
|
209
|
+
|
|
178
210
|
### Disabling Options
|
|
179
211
|
|
|
180
212
|
Radios can be disabled by adding the `disabled` attribute to the respective options inside the radio group.
|
|
@@ -101,7 +101,7 @@ Use the `label` attribute to add a form control label above the radio group. Use
|
|
|
101
101
|
|
|
102
102
|
### Contained Style
|
|
103
103
|
|
|
104
|
-
Add the `contained` attribute to draw a card-like container around a radio. This style is useful for giving more emphasis to radio options.
|
|
104
|
+
Add the `contained` attribute to draw a card-like container around a radio. This style is useful for giving more emphasis to radio options. The container shows the selected state, so the radio indicator is hidden; set `control-position` to place one in the card.
|
|
105
105
|
|
|
106
106
|
```html:preview
|
|
107
107
|
<zn-radio name="payment" value="credit" description="Pay with Visa, Mastercard, or Amex" contained checked>Credit Card</zn-radio>
|