@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
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {classMap} from "lit/directives/class-map.js";
|
|
2
|
+
import {type CSSResultGroup, html, nothing, unsafeCSS} from 'lit';
|
|
3
|
+
import {property} from 'lit/decorators.js';
|
|
4
|
+
import ZincElement from '../../internal/zinc-element';
|
|
5
|
+
|
|
6
|
+
import styles from './translation-grid.scss';
|
|
7
|
+
|
|
8
|
+
export type TranslationStatus = 'source' | 'translated' | 'outdated' | 'missing';
|
|
9
|
+
|
|
10
|
+
export interface TranslationGridLanguage {
|
|
11
|
+
code: string;
|
|
12
|
+
label: string;
|
|
13
|
+
/** The language's status when there are no `fields`. */
|
|
14
|
+
status?: TranslationStatus;
|
|
15
|
+
/** Where choosing the language goes, such as its translation form. */
|
|
16
|
+
href?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface TranslationGridCell {
|
|
20
|
+
status: TranslationStatus;
|
|
21
|
+
href?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TranslationGridField {
|
|
25
|
+
key: string;
|
|
26
|
+
label: string;
|
|
27
|
+
/** Each language's cell, keyed by language code. */
|
|
28
|
+
cells: Record<string, TranslationGridCell>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const STATUS_LABELS: Record<TranslationStatus, string> = {
|
|
32
|
+
source: 'Source',
|
|
33
|
+
translated: 'Translated',
|
|
34
|
+
outdated: 'Source changed',
|
|
35
|
+
missing: 'Missing',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @summary Shows how far each language's translation has got, with a column per language to choose and enable it,
|
|
40
|
+
* and optionally a row per translated field.
|
|
41
|
+
* @documentation https://zinc.style/components/translation-grid
|
|
42
|
+
* @status experimental
|
|
43
|
+
* @since 1.0
|
|
44
|
+
*
|
|
45
|
+
* @slot - Help text under the legend.
|
|
46
|
+
* @slot enable-{code} - The control that enables the language with that code, such as a `zn-checkbox` in a form.
|
|
47
|
+
* The Enable row only shows when at least one is given.
|
|
48
|
+
*
|
|
49
|
+
* @csspart base - The component's base wrapper.
|
|
50
|
+
*/
|
|
51
|
+
export default class ZnTranslationGrid extends ZincElement {
|
|
52
|
+
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
53
|
+
|
|
54
|
+
/** The languages, in column order, as a JSON array of `{code, label, status, href}`. */
|
|
55
|
+
@property({type: Array}) languages: TranslationGridLanguage[] = [];
|
|
56
|
+
|
|
57
|
+
/** A row per translated field, as a JSON array of `{key, label, cells}`; without it there is one Translation row. */
|
|
58
|
+
@property({type: Array}) fields: TranslationGridField[] = [];
|
|
59
|
+
|
|
60
|
+
/** The code of the language being edited. */
|
|
61
|
+
@property({reflect: true}) selected = '';
|
|
62
|
+
|
|
63
|
+
/** The key of the field being edited, when there are `fields`. */
|
|
64
|
+
@property({attribute: 'selected-field', reflect: true}) selectedField = '';
|
|
65
|
+
|
|
66
|
+
/** Where the language links open, as a console `data-target`; `self` replaces the content they sit in. */
|
|
67
|
+
@property({attribute: 'link-target'}) linkTarget = '';
|
|
68
|
+
|
|
69
|
+
/** Names the source in the legend, such as "English changed". */
|
|
70
|
+
@property({attribute: 'source-label'}) sourceLabel = 'English';
|
|
71
|
+
|
|
72
|
+
private _statusLabel(status: TranslationStatus) {
|
|
73
|
+
return status === 'outdated' ? `${this.sourceLabel} changed` : STATUS_LABELS[status];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private _link(href: string | undefined, selected: boolean, content: unknown, block: string, label: string,
|
|
77
|
+
status?: TranslationStatus) {
|
|
78
|
+
const classes = {
|
|
79
|
+
[block]: true,
|
|
80
|
+
[`${block}--${status}`]: !!status,
|
|
81
|
+
[`${block}--selected`]: selected,
|
|
82
|
+
};
|
|
83
|
+
if (!href || status === 'source') {
|
|
84
|
+
return html`<span class=${classMap(classes)} title=${label} aria-label=${label}>${content}</span>`;
|
|
85
|
+
}
|
|
86
|
+
return html`<a class=${classMap(classes)} href=${href} title=${label} aria-label=${label}
|
|
87
|
+
data-target=${this.linkTarget || nothing}
|
|
88
|
+
aria-current=${selected ? 'true' : nothing}>${content}</a>`;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private _cell(language: TranslationGridLanguage, cell: TranslationGridCell | undefined, selected: boolean, row = '') {
|
|
92
|
+
const status = cell?.status ?? 'missing';
|
|
93
|
+
const name = row ? `${row}, ${language.label}` : language.label;
|
|
94
|
+
return html`<td>${this._link(cell?.href, selected, nothing, 'translation-grid__cell',
|
|
95
|
+
`${name}: ${this._statusLabel(status)}`, status)}</td>`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private _rows() {
|
|
99
|
+
if (!this.fields.length) {
|
|
100
|
+
return html`
|
|
101
|
+
<tr>
|
|
102
|
+
<th scope="row">Translation</th>
|
|
103
|
+
${this.languages.map(language => this._cell(language,
|
|
104
|
+
{status: language.status ?? 'missing', href: language.href}, language.code === this.selected))}
|
|
105
|
+
</tr>`;
|
|
106
|
+
}
|
|
107
|
+
return this.fields.map(field => html`
|
|
108
|
+
<tr>
|
|
109
|
+
<th scope="row">${field.label}</th>
|
|
110
|
+
${this.languages.map(language => this._cell(language, field.cells[language.code],
|
|
111
|
+
field.key === this.selectedField && language.code === this.selected, field.label))}
|
|
112
|
+
</tr>`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private _legend(status: TranslationStatus) {
|
|
116
|
+
return html`
|
|
117
|
+
<span class="translation-grid__key">
|
|
118
|
+
<span class="translation-grid__cell translation-grid__cell--${status}"></span>${this._statusLabel(status)}
|
|
119
|
+
</span>`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
render() {
|
|
123
|
+
return html`
|
|
124
|
+
<div part="base" class="translation-grid">
|
|
125
|
+
<div class="translation-grid__scroll">
|
|
126
|
+
<table class="translation-grid__table">
|
|
127
|
+
<thead>
|
|
128
|
+
<tr>
|
|
129
|
+
<th scope="col">Field</th>
|
|
130
|
+
${this.languages.map(language => html`
|
|
131
|
+
<th scope="col">
|
|
132
|
+
${this._link(language.href, language.code === this.selected,
|
|
133
|
+
language.code.toUpperCase(), 'translation-grid__code', language.label)}
|
|
134
|
+
</th>`)}
|
|
135
|
+
</tr>
|
|
136
|
+
</thead>
|
|
137
|
+
<tbody>
|
|
138
|
+
${this.querySelector('[slot^="enable-"]') ? html`
|
|
139
|
+
<tr>
|
|
140
|
+
<th scope="row">Enable</th>
|
|
141
|
+
${this.languages.map(language => html`
|
|
142
|
+
<td><div class="translation-grid__slot"><slot name="enable-${language.code}"></slot></div></td>`)}
|
|
143
|
+
</tr>` : nothing}
|
|
144
|
+
${this._rows()}
|
|
145
|
+
</tbody>
|
|
146
|
+
</table>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="translation-grid__legend">
|
|
149
|
+
${this._legend('translated')}
|
|
150
|
+
${this._legend('outdated')}
|
|
151
|
+
${this._legend('missing')}
|
|
152
|
+
</div>
|
|
153
|
+
<div class="translation-grid__help"><slot></slot></div>
|
|
154
|
+
</div>
|
|
155
|
+
`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
@use "../../wc";
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.translation-grid {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: var(--zn-spacing-x-small);
|
|
11
|
+
color: rgb(var(--zn-text));
|
|
12
|
+
font-size: var(--zn-input-font-size-medium);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.translation-grid__scroll {
|
|
16
|
+
@include wc.scrollbars;
|
|
17
|
+
overflow-x: auto;
|
|
18
|
+
// Room for the selected cell's ring
|
|
19
|
+
padding: 4px;
|
|
20
|
+
margin: -4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.translation-grid__table {
|
|
24
|
+
width: 100%;
|
|
25
|
+
border-collapse: collapse;
|
|
26
|
+
|
|
27
|
+
th, td {
|
|
28
|
+
padding: var(--zn-spacing-x-small) var(--zn-spacing-2x-small);
|
|
29
|
+
border-bottom: 1px solid rgb(var(--zn-border-color));
|
|
30
|
+
text-align: center;
|
|
31
|
+
vertical-align: middle;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
th[scope="row"], th:first-child {
|
|
35
|
+
width: 120px;
|
|
36
|
+
padding-left: 0;
|
|
37
|
+
text-align: left;
|
|
38
|
+
font-weight: var(--zn-font-weight-medium);
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
tbody tr:last-child > * {
|
|
43
|
+
border-bottom: 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.translation-grid__slot {
|
|
48
|
+
display: flex;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
|
|
51
|
+
::slotted(*) {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.translation-grid__code {
|
|
57
|
+
display: inline-block;
|
|
58
|
+
padding: 4px 8px;
|
|
59
|
+
border-radius: var(--zn-input-border-radius-medium);
|
|
60
|
+
color: rgb(var(--zn-color-muted-text));
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
font-weight: var(--zn-font-weight-semibold);
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
|
|
65
|
+
&:is(a) {
|
|
66
|
+
color: rgb(var(--zn-text));
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
background-color: rgb(var(--zn-color-tab));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&--selected {
|
|
74
|
+
color: rgb(var(--zn-primary));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.translation-grid__cell {
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
display: inline-block;
|
|
81
|
+
width: 20px;
|
|
82
|
+
height: 20px;
|
|
83
|
+
border: 2px solid transparent;
|
|
84
|
+
border-radius: 6px;
|
|
85
|
+
vertical-align: middle;
|
|
86
|
+
|
|
87
|
+
&--source,
|
|
88
|
+
&--translated {
|
|
89
|
+
border-color: rgb(var(--zn-color-success));
|
|
90
|
+
background-color: rgb(var(--zn-color-success));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&--outdated {
|
|
94
|
+
border-style: dashed;
|
|
95
|
+
border-color: rgb(var(--zn-color-warning));
|
|
96
|
+
background-color: rgba(var(--zn-color-warning), 0.12);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&--missing {
|
|
100
|
+
border-color: var(--zn-input-border-color);
|
|
101
|
+
background-color: rgba(var(--zn-border-color), 0.35);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&--selected {
|
|
105
|
+
box-shadow: 0 0 0 2px rgb(var(--zn-panel)), 0 0 0 4px rgb(var(--zn-primary));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:is(a):focus-visible {
|
|
109
|
+
outline: none;
|
|
110
|
+
box-shadow: 0 0 0 2px rgb(var(--zn-panel)), 0 0 0 4px var(--zn-input-focus-ring-color);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.translation-grid__legend {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-wrap: wrap;
|
|
117
|
+
gap: var(--zn-spacing-2x-small) var(--zn-spacing-small);
|
|
118
|
+
color: rgb(var(--zn-color-muted-text));
|
|
119
|
+
font-size: var(--zn-input-help-text-font-size-medium);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.translation-grid__help {
|
|
123
|
+
margin-top: var(--zn-spacing-x-small);
|
|
124
|
+
color: rgb(var(--zn-color-muted-text));
|
|
125
|
+
font-size: var(--zn-input-help-text-font-size-medium);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.translation-grid__key {
|
|
129
|
+
display: inline-flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
gap: 6px;
|
|
132
|
+
|
|
133
|
+
.translation-grid__cell {
|
|
134
|
+
width: 14px;
|
|
135
|
+
height: 14px;
|
|
136
|
+
border-radius: var(--zn-border-radius-circle);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import '../../../dist/zn.min.js';
|
|
2
|
+
import {expect, fixture, html} from '@open-wc/testing';
|
|
3
|
+
import type ZnTranslationGrid from './translation-grid.component';
|
|
4
|
+
|
|
5
|
+
describe('<zn-translation-grid>', () => {
|
|
6
|
+
it('renders one Translation row without fields', async () => {
|
|
7
|
+
const el = await fixture<ZnTranslationGrid>(html`
|
|
8
|
+
<zn-translation-grid languages='[{"code":"en","label":"English","status":"source"},{"code":"fr","label":"French","status":"missing","href":"#fr"}]'>
|
|
9
|
+
<zn-checkbox slot="enable-fr"></zn-checkbox>
|
|
10
|
+
</zn-translation-grid>`);
|
|
11
|
+
const rows = el.shadowRoot!.querySelectorAll('tbody tr');
|
|
12
|
+
expect(rows).to.have.length(2);
|
|
13
|
+
expect(rows[1].querySelector('th')!.textContent).to.equal('Translation');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('renders a row per field and rings the selected cell', async () => {
|
|
17
|
+
const el = await fixture<ZnTranslationGrid>(html`
|
|
18
|
+
<zn-translation-grid selected="fr" selected-field="content"
|
|
19
|
+
languages='[{"code":"en","label":"English"},{"code":"fr","label":"French"}]'
|
|
20
|
+
fields='[{"key":"name","label":"Name","cells":{"en":{"status":"source"},"fr":{"status":"outdated","href":"#n"}}},{"key":"content","label":"Content","cells":{"en":{"status":"source"},"fr":{"status":"translated","href":"#c"}}}]'></zn-translation-grid>`);
|
|
21
|
+
const rows = el.shadowRoot!.querySelectorAll('tbody tr');
|
|
22
|
+
expect(rows).to.have.length(2);
|
|
23
|
+
expect(rows[0].querySelector('.translation-grid__cell--outdated')).to.exist;
|
|
24
|
+
const selected = el.shadowRoot!.querySelectorAll('.translation-grid__cell--selected');
|
|
25
|
+
expect(selected).to.have.length(1);
|
|
26
|
+
expect(selected[0].getAttribute('href')).to.equal('#c');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSResultGroup, html, unsafeCSS } from 'lit';
|
|
2
|
+
import { HasSlotController } from '../../internal/slot';
|
|
2
3
|
import { property } from 'lit/decorators.js';
|
|
3
4
|
import ZincElement from '../../internal/zinc-element';
|
|
4
5
|
|
|
@@ -15,8 +16,15 @@ import styles from './vertical-stepper.scss';
|
|
|
15
16
|
* @property {boolean} active - When true, highlights this step as the current active step in the process.
|
|
16
17
|
* @property {string} description - A descriptive text explaining what happens in this step or its current status.
|
|
17
18
|
* @property {string} caption - The main label/title for this step.
|
|
19
|
+
* @property {string} type - Marker colour: neutral, primary, success, error, warning, info or ai (AI-generated steps only). Overrides `active`.
|
|
20
|
+
* @property {boolean} selected - When true, rings the marker to show the step is picked.
|
|
21
|
+
* @property {boolean} dashed - When true, draws the marker's border dashed, for a step that is not yet final.
|
|
22
|
+
* @property {boolean} highlightLine - When true, colours the line below this step's marker, joining it to the next step.
|
|
18
23
|
*
|
|
24
|
+
* @slot - Content below the caption and description, such as metadata or chips.
|
|
19
25
|
* @slot icon - Optional slot for adding an icon or indicator before the step content.
|
|
26
|
+
* @slot suffix - Inline content after the caption and description, such as status chips.
|
|
27
|
+
* @slot actions - Controls aligned to the end of the step.
|
|
20
28
|
*
|
|
21
29
|
* @csspart vs - The main container for the vertical stepper.
|
|
22
30
|
* @csspart vs__left - The left section containing the icon and connecting line.
|
|
@@ -25,6 +33,8 @@ import styles from './vertical-stepper.scss';
|
|
|
25
33
|
* @csspart vs__right - The right section containing caption and description text.
|
|
26
34
|
* @csspart vs__caption - The caption/title text element.
|
|
27
35
|
* @csspart vs__description - The description text element.
|
|
36
|
+
* @csspart vs__content - The container for the default slot.
|
|
37
|
+
* @csspart vs__actions - The container for the actions slot.
|
|
28
38
|
*/
|
|
29
39
|
export default class ZnVerticalStepper extends ZincElement {
|
|
30
40
|
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
@@ -35,23 +45,39 @@ export default class ZnVerticalStepper extends ZincElement {
|
|
|
35
45
|
@property({ reflect: true }) description: string;
|
|
36
46
|
@property({ reflect: true }) caption: string;
|
|
37
47
|
|
|
48
|
+
@property({ reflect: true }) type: 'neutral' | 'primary' | 'success' | 'error' | 'warning' | 'info' | 'ai';
|
|
49
|
+
|
|
50
|
+
@property({ type: Boolean, reflect: true }) selected = false;
|
|
51
|
+
@property({ type: Boolean, reflect: true }) dashed = false;
|
|
52
|
+
@property({ attribute: 'highlight-line', type: Boolean, reflect: true }) highlightLine = false;
|
|
53
|
+
|
|
54
|
+
private readonly hasSlotController = new HasSlotController(this, '[default]', 'suffix', 'actions');
|
|
55
|
+
|
|
38
56
|
render() {
|
|
57
|
+
const hasContent = this.hasSlotController.test('[default]');
|
|
58
|
+
const hasSuffix = this.hasSlotController.test('suffix');
|
|
59
|
+
const hasActions = this.hasSlotController.test('actions');
|
|
39
60
|
return html`
|
|
40
|
-
<div class="vs">
|
|
41
|
-
<div class="vs__left">
|
|
42
|
-
<div class="vs__icon">
|
|
61
|
+
<div class="vs" part="vs">
|
|
62
|
+
<div class="vs__left" part="vs__left">
|
|
63
|
+
<div class="vs__icon" part="vs__icon">
|
|
43
64
|
<slot name="icon"></slot>
|
|
44
65
|
</div>
|
|
45
|
-
<div class="vs__line"></div>
|
|
66
|
+
<div class="vs__line" part="vs__line"></div>
|
|
46
67
|
</div>
|
|
47
|
-
<div class="vs__right">
|
|
48
|
-
<div class="
|
|
49
|
-
|
|
68
|
+
<div class="vs__right" part="vs__right">
|
|
69
|
+
<div class="vs__heading">
|
|
70
|
+
<span class="vs__caption" part="vs__caption">${this.caption}</span><span class="vs__description"
|
|
71
|
+
part="vs__description">${this.description}</span>
|
|
72
|
+
<slot name="suffix" class="vs__suffix" ?hidden=${!hasSuffix}></slot>
|
|
50
73
|
</div>
|
|
51
|
-
<div class="
|
|
52
|
-
|
|
74
|
+
<div class="vs__content" part="vs__content" ?hidden=${!hasContent}>
|
|
75
|
+
<slot></slot>
|
|
53
76
|
</div>
|
|
54
77
|
</div>
|
|
78
|
+
<div class="vs__actions" part="vs__actions" ?hidden=${!hasActions}>
|
|
79
|
+
<slot name="actions"></slot>
|
|
80
|
+
</div>
|
|
55
81
|
</div>
|
|
56
82
|
`;
|
|
57
83
|
}
|
|
@@ -1,67 +1,112 @@
|
|
|
1
1
|
@use "../../wc";
|
|
2
2
|
|
|
3
|
+
@mixin neutral-marker {
|
|
4
|
+
--marker-fg: rgb(var(--zn-color-muted-text));
|
|
5
|
+
--marker-bg: var(--zn-vertical-stepper-marker-background, rgba(var(--zn-border-color), .10));
|
|
6
|
+
--marker-line: var(--zn-vertical-stepper-line-color, rgba(var(--zn-border-color), .60));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
@include neutral-marker;
|
|
11
|
+
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
3
15
|
.vs {
|
|
4
16
|
display: flex;
|
|
5
|
-
|
|
6
|
-
flex-wrap: nowrap;
|
|
17
|
+
gap: var(--zn-spacing-small);
|
|
7
18
|
width: 100%;
|
|
8
19
|
|
|
9
20
|
&__left {
|
|
10
|
-
flex-shrink:
|
|
11
|
-
flex-grow: 0;
|
|
21
|
+
flex-shrink: 0;
|
|
12
22
|
display: flex;
|
|
13
23
|
flex-direction: column;
|
|
14
24
|
align-items: center;
|
|
15
|
-
margin: 0 var(--zn-spacing-small);
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
&__icon {
|
|
19
|
-
width: var(--zn-
|
|
20
|
-
height: var(--zn-
|
|
28
|
+
width: var(--zn-vertical-stepper-marker-size, 28px);
|
|
29
|
+
height: var(--zn-vertical-stepper-marker-size, 28px);
|
|
21
30
|
display: flex;
|
|
22
31
|
flex-shrink: 0;
|
|
23
32
|
align-items: center;
|
|
24
33
|
justify-content: center;
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
color: var(--marker-fg);
|
|
36
|
+
background-color: var(--marker-bg);
|
|
37
|
+
border: 1px solid var(--marker-line);
|
|
27
38
|
border-radius: 100%;
|
|
39
|
+
// Above the line, so a selected step's ring covers it.
|
|
40
|
+
position: relative;
|
|
41
|
+
z-index: 1;
|
|
42
|
+
font-size: 12px;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
transition: box-shadow var(--zn-transition-fast, 150ms);
|
|
28
45
|
}
|
|
29
46
|
|
|
30
47
|
&__line {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border-width: 1px;
|
|
34
|
-
border-top: none;
|
|
35
|
-
border-bottom: none;
|
|
36
|
-
background-color: rgba(var(--zn-input-bg));
|
|
48
|
+
width: var(--zn-vertical-stepper-line-width, 1px);
|
|
49
|
+
min-height: var(--zn-vertical-stepper-gap, var(--zn-spacing-medium));
|
|
37
50
|
flex-grow: 1;
|
|
51
|
+
background-color: var(--zn-vertical-stepper-line-color, rgba(var(--zn-border-color), .60));
|
|
38
52
|
}
|
|
39
53
|
|
|
40
54
|
&__right {
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
gap: var(--zn-spacing-x-small);
|
|
44
55
|
flex-grow: 1;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
min-width: 0;
|
|
57
|
+
// Centres a single line of text on the marker.
|
|
58
|
+
padding-top: calc((var(--zn-vertical-stepper-marker-size, 28px) - 20px) / 2);
|
|
59
|
+
padding-bottom: var(--zn-vertical-stepper-gap, var(--zn-spacing-medium));
|
|
60
|
+
font-size: var(--zn-vertical-stepper-caption-font-size, 14px);
|
|
61
|
+
line-height: 20px;
|
|
62
|
+
color: rgb(var(--zn-text-heading));
|
|
50
63
|
}
|
|
51
64
|
|
|
52
65
|
&__caption {
|
|
53
|
-
|
|
54
|
-
color: rgb(var(--zn-text-heading));
|
|
55
|
-
line-height: 20px;
|
|
66
|
+
display: inline;
|
|
56
67
|
font-weight: 600;
|
|
57
68
|
}
|
|
58
69
|
|
|
70
|
+
&__suffix {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
flex-wrap: wrap;
|
|
73
|
+
gap: var(--zn-spacing-2x-small);
|
|
74
|
+
margin-inline-start: var(--zn-spacing-x-small);
|
|
75
|
+
vertical-align: middle;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__content {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: var(--zn-spacing-x-small);
|
|
82
|
+
margin-top: var(--zn-spacing-2x-small);
|
|
83
|
+
font-size: var(--zn-font-size-small);
|
|
84
|
+
color: rgb(var(--zn-color-muted-text));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__actions {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
flex-wrap: wrap;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: flex-end;
|
|
93
|
+
gap: var(--zn-spacing-x-small);
|
|
94
|
+
min-height: var(--zn-vertical-stepper-marker-size, 28px);
|
|
95
|
+
padding-bottom: var(--zn-vertical-stepper-gap, var(--zn-spacing-medium));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[hidden] {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
59
101
|
|
|
60
102
|
&__description {
|
|
61
|
-
|
|
62
|
-
font-weight:
|
|
63
|
-
|
|
64
|
-
|
|
103
|
+
display: inline;
|
|
104
|
+
font-weight: var(--zn-vertical-stepper-description-font-weight, 400);
|
|
105
|
+
color: var(--zn-vertical-stepper-description-color, rgb(var(--zn-text-heading)));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&__caption:not(:empty) + &__description:not(:empty)::before {
|
|
109
|
+
content: " — ";
|
|
65
110
|
}
|
|
66
111
|
}
|
|
67
112
|
|
|
@@ -69,20 +114,46 @@
|
|
|
69
114
|
.vs__line {
|
|
70
115
|
display: none;
|
|
71
116
|
}
|
|
72
|
-
}
|
|
73
117
|
|
|
74
|
-
|
|
75
|
-
.
|
|
76
|
-
|
|
118
|
+
.vs__right,
|
|
119
|
+
.vs__actions {
|
|
120
|
+
padding-bottom: 0;
|
|
77
121
|
}
|
|
78
122
|
}
|
|
79
123
|
|
|
124
|
+
:host([dashed]) .vs__icon {
|
|
125
|
+
border-style: dashed;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([selected]) .vs__icon {
|
|
129
|
+
box-shadow: 0 0 0 2px var(--zn-vertical-stepper-ring-gap-color, rgb(var(--zn-panel))),
|
|
130
|
+
0 0 0 4px var(--zn-vertical-stepper-selected-color, rgb(var(--zn-primary)));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([highlight-line]) .vs__line {
|
|
134
|
+
background-color: var(--zn-vertical-stepper-selected-color, rgb(var(--zn-primary)));
|
|
135
|
+
}
|
|
136
|
+
|
|
80
137
|
:host([active]) {
|
|
81
|
-
.
|
|
82
|
-
|
|
83
|
-
|
|
138
|
+
--marker-fg: rgba(var(--zn-primary), .9);
|
|
139
|
+
--marker-bg: rgba(var(--zn-primary), .10);
|
|
140
|
+
--marker-line: rgba(var(--zn-primary), .30);
|
|
141
|
+
}
|
|
84
142
|
|
|
85
|
-
|
|
86
|
-
|
|
143
|
+
@each $type, $role in (error: danger, info: info, warning: warning, success: success, ai: ai) {
|
|
144
|
+
:host([type="#{$type}"]) {
|
|
145
|
+
--marker-fg: var(--zn-color-#{$role}-fg);
|
|
146
|
+
--marker-bg: var(--zn-color-#{$role}-bg);
|
|
147
|
+
--marker-line: var(--zn-color-#{$role}-line);
|
|
87
148
|
}
|
|
88
149
|
}
|
|
150
|
+
|
|
151
|
+
:host([type="primary"]) {
|
|
152
|
+
--marker-fg: rgba(var(--zn-primary), .9);
|
|
153
|
+
--marker-bg: rgba(var(--zn-primary), .10);
|
|
154
|
+
--marker-line: rgba(var(--zn-primary), .30);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host([type="neutral"]) {
|
|
158
|
+
@include neutral-marker;
|
|
159
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../../../dist/zn.min.js';
|
|
2
2
|
import { expect, fixture, html } from '@open-wc/testing';
|
|
3
|
+
import type ZnVerticalStepper from './vertical-stepper.component';
|
|
3
4
|
|
|
4
5
|
describe('<zn-vertical-stepper>', () => {
|
|
5
6
|
it('should render a component', async () => {
|
|
@@ -7,4 +8,38 @@ describe('<zn-vertical-stepper>', () => {
|
|
|
7
8
|
|
|
8
9
|
expect(el).to.exist;
|
|
9
10
|
});
|
|
11
|
+
|
|
12
|
+
it('hides the content, suffix and actions containers when nothing is slotted', async () => {
|
|
13
|
+
const el = await fixture<ZnVerticalStepper>(html` <zn-vertical-stepper caption="Step"></zn-vertical-stepper> `);
|
|
14
|
+
|
|
15
|
+
expect(el.shadowRoot!.querySelector('.vs__content')!.hasAttribute('hidden')).to.be.true;
|
|
16
|
+
expect(el.shadowRoot!.querySelector('.vs__suffix')!.hasAttribute('hidden')).to.be.true;
|
|
17
|
+
expect(el.shadowRoot!.querySelector('.vs__actions')!.hasAttribute('hidden')).to.be.true;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('shows slotted content, suffix and actions', async () => {
|
|
21
|
+
const el = await fixture<ZnVerticalStepper>(html`
|
|
22
|
+
<zn-vertical-stepper caption="Version 3">
|
|
23
|
+
<span slot="suffix">Live</span>
|
|
24
|
+
<span>Published 12 Oct 2026</span>
|
|
25
|
+
<button slot="actions">View</button>
|
|
26
|
+
</zn-vertical-stepper>
|
|
27
|
+
`);
|
|
28
|
+
|
|
29
|
+
expect(el.shadowRoot!.querySelector('.vs__content')!.hasAttribute('hidden')).to.be.false;
|
|
30
|
+
expect(el.shadowRoot!.querySelector('.vs__suffix')!.hasAttribute('hidden')).to.be.false;
|
|
31
|
+
expect(el.shadowRoot!.querySelector('.vs__actions')!.hasAttribute('hidden')).to.be.false;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('reflects selected, dashed and highlight-line', async () => {
|
|
35
|
+
const el = await fixture<ZnVerticalStepper>(html` <zn-vertical-stepper></zn-vertical-stepper> `);
|
|
36
|
+
el.selected = true;
|
|
37
|
+
el.dashed = true;
|
|
38
|
+
el.highlightLine = true;
|
|
39
|
+
await el.updateComplete;
|
|
40
|
+
|
|
41
|
+
expect(el.hasAttribute('selected')).to.be.true;
|
|
42
|
+
expect(el.hasAttribute('dashed')).to.be.true;
|
|
43
|
+
expect(el.hasAttribute('highlight-line')).to.be.true;
|
|
44
|
+
});
|
|
10
45
|
});
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
.well {
|
|
4
4
|
display: flex;
|
|
5
5
|
|
|
6
|
-
border-radius: 5px;
|
|
7
|
-
background: rgba(var(--zn-border-color), 0.7);
|
|
6
|
+
border-radius: var(--zn-well-border-radius, 5px);
|
|
7
|
+
background: var(--zn-well-background, rgba(var(--zn-border-color), 0.7));
|
|
8
8
|
border: 1px solid rgb(var(--zn-border-color));
|
|
9
9
|
|
|
10
10
|
padding: var(--zn-spacing-small, 0);
|
package/src/events/events.ts
CHANGED
|
@@ -18,7 +18,9 @@ export type {ZnFlowConnectEvent} from './zn-flow-connect';
|
|
|
18
18
|
export type {ZnPageChangeEvent} from './zn-page-change';
|
|
19
19
|
export type {ZnPageSelectionChangeEvent} from './zn-page-selection-change';
|
|
20
20
|
export type {ZnThemeChangeEvent} from './zn-theme-change';
|
|
21
|
+
export type {ZnReportChangeEvent} from './zn-report-change';
|
|
21
22
|
export type {ZnThemeSubmitEvent} from './zn-theme-submit';
|
|
22
23
|
export type {ZnSlashSelectEvent} from './zn-slash-select';
|
|
23
24
|
export type {ZnSlashInsertEvent} from './zn-slash-insert';
|
|
24
25
|
export type {ZnRepositionEvent} from './zn-reposition';
|
|
26
|
+
export type {ZnChartClickEvent} from './zn-chart-click';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ZnChartClickEvent = CustomEvent<{
|
|
2
|
+
seriesName: string;
|
|
3
|
+
/** The clicked category, or the data item's name. */
|
|
4
|
+
name: string;
|
|
5
|
+
dataIndex: number;
|
|
6
|
+
value: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
interface GlobalEventHandlersEventMap {
|
|
11
|
+
'zn-chart-click': ZnChartClickEvent;
|
|
12
|
+
}
|
|
13
|
+
}
|