@dataengineeringformachinelearning/viking-ui 1.0.2 → 3.0.0-alpha.4
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/LICENSE +201 -0
- package/README.md +217 -38
- package/dist/core/brand-icons.d.ts +29 -0
- package/dist/core/icons.d.ts +132 -0
- package/dist/core/integration-brand-icons.d.ts +18 -0
- package/dist/core/lucide-paths.generated.d.ts +90 -0
- package/dist/core/types.d.ts +56 -0
- package/dist/core/uid.d.ts +2 -0
- package/dist/deml-components.css +1122 -0
- package/dist/design-tokens.css +688 -0
- package/dist/elements/button/viking-button.d.ts +14 -0
- package/dist/elements/card/viking-card.d.ts +8 -0
- package/dist/elements/core/dom.d.ts +4 -0
- package/dist/elements/core/styles.d.ts +2 -0
- package/dist/elements/modal/viking-modal.d.ts +15 -0
- package/dist/fonts/inter/InterVariable-Italic.woff2 +0 -0
- package/dist/fonts/inter/InterVariable.woff2 +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4051 -0
- package/dist/lib/accordion/accordion.d.ts +19 -0
- package/dist/lib/app-header/app-header.d.ts +8 -0
- package/dist/lib/app-sidebar/app-sidebar.d.ts +10 -0
- package/dist/lib/auth-panel/auth-panel.d.ts +13 -0
- package/dist/lib/autocomplete/autocomplete.d.ts +25 -0
- package/dist/lib/avatar/avatar.d.ts +14 -0
- package/dist/lib/badge/badge.d.ts +16 -0
- package/dist/lib/bar/bar.d.ts +4 -0
- package/dist/lib/brand/brand.d.ts +8 -0
- package/dist/lib/breadcrumbs/breadcrumbs.d.ts +10 -0
- package/dist/lib/button/button-group.d.ts +6 -0
- package/dist/lib/button/button.d.ts +25 -0
- package/dist/lib/calendar/calendar.d.ts +22 -0
- package/dist/lib/callout/callout.d.ts +14 -0
- package/dist/lib/card/card-title.d.ts +12 -0
- package/dist/lib/card/card.d.ts +19 -0
- package/dist/lib/carousel/carousel.d.ts +13 -0
- package/dist/lib/chart/chart-zoom.d.ts +14 -0
- package/dist/lib/chart/chart.d.ts +119 -0
- package/dist/lib/chart-card-header/chart-card-header.d.ts +10 -0
- package/dist/lib/chart-empty-state/chart-empty-state.d.ts +13 -0
- package/dist/lib/chart-panel/chart-panel.d.ts +10 -0
- package/dist/lib/checkbox/checkbox.d.ts +13 -0
- package/dist/lib/color-picker/color-picker.d.ts +16 -0
- package/dist/lib/command/command.d.ts +23 -0
- package/dist/lib/composer/composer.d.ts +15 -0
- package/dist/lib/confirm-dialog/confirm-dialog.d.ts +18 -0
- package/dist/lib/confirm-dialog/dialog.service.d.ts +28 -0
- package/dist/lib/context/context.d.ts +17 -0
- package/dist/lib/core/brand-icons.d.ts +29 -0
- package/dist/lib/core/cva.d.ts +15 -0
- package/dist/lib/core/icons.d.ts +132 -0
- package/dist/lib/core/integration-brand-icons.d.ts +18 -0
- package/dist/lib/core/lucide-paths.generated.d.ts +90 -0
- package/dist/lib/date-picker/date-picker.d.ts +18 -0
- package/dist/lib/dropdown/dropdown.d.ts +29 -0
- package/dist/lib/editor/editor.d.ts +26 -0
- package/dist/lib/empty-state/empty-state.d.ts +9 -0
- package/dist/lib/fab/fab.d.ts +9 -0
- package/dist/lib/field/field.d.ts +14 -0
- package/dist/lib/file-upload/file-upload.d.ts +19 -0
- package/dist/lib/footer/footer.d.ts +6 -0
- package/dist/lib/form-section/form-section.d.ts +15 -0
- package/dist/lib/gauge-arc/gauge-arc.d.ts +8 -0
- package/dist/lib/hud-panel/hud-panel.d.ts +5 -0
- package/dist/lib/icon/icon.d.ts +44 -0
- package/dist/lib/icon-badge/icon-badge.d.ts +14 -0
- package/dist/lib/icon-heading/icon-heading.d.ts +9 -0
- package/dist/lib/icon-text/icon-text.d.ts +12 -0
- package/dist/lib/input/input.d.ts +23 -0
- package/dist/lib/kanban/kanban.d.ts +16 -0
- package/dist/lib/kbd/kbd.d.ts +5 -0
- package/dist/lib/label/label.d.ts +7 -0
- package/dist/lib/loading-overlay/loading-overlay.d.ts +10 -0
- package/dist/lib/menubar/menubar.d.ts +10 -0
- package/dist/lib/metric-card/metric-card.d.ts +9 -0
- package/dist/lib/modal/modal.d.ts +13 -0
- package/dist/lib/native-select/native-select.d.ts +17 -0
- package/dist/lib/navbar/navbar.d.ts +13 -0
- package/dist/lib/navigation-menu/navigation-menu.d.ts +13 -0
- package/dist/lib/otp-input/otp-input.d.ts +23 -0
- package/dist/lib/page-back-link/page-back-link.d.ts +11 -0
- package/dist/lib/page-header/page-header.d.ts +15 -0
- package/dist/lib/pagination/pagination.d.ts +10 -0
- package/dist/lib/pillbox/pillbox.d.ts +15 -0
- package/dist/lib/popover/popover.d.ts +15 -0
- package/dist/lib/profile/profile.d.ts +11 -0
- package/dist/lib/progress/progress.d.ts +12 -0
- package/dist/lib/radio/radio.d.ts +16 -0
- package/dist/lib/ring-gauge/ring-gauge.d.ts +8 -0
- package/dist/lib/scroll-area/scroll-area.d.ts +7 -0
- package/dist/lib/search-palette/search-palette.d.ts +16 -0
- package/dist/lib/select/select.d.ts +26 -0
- package/dist/lib/separator/separator.d.ts +8 -0
- package/dist/lib/sheet/sheet.d.ts +13 -0
- package/dist/lib/sidebar-nav/sidebar-nav.d.ts +46 -0
- package/dist/lib/site-drakkar/site-drakkar.config.d.ts +50 -0
- package/dist/lib/site-drakkar/site-footer.d.ts +18 -0
- package/dist/lib/site-drakkar/site-navbar.d.ts +25 -0
- package/dist/lib/site-drakkar/suite-search-items.d.ts +17 -0
- package/dist/lib/skeleton/skeleton.d.ts +8 -0
- package/dist/lib/slider/slider.d.ts +17 -0
- package/dist/lib/spinner/spinner.d.ts +7 -0
- package/dist/lib/status-metric-row/status-metric-row.d.ts +9 -0
- package/dist/lib/suite-search-palette/suite-search-palette.d.ts +25 -0
- package/dist/lib/switch/switch.d.ts +12 -0
- package/dist/lib/table/table.d.ts +10 -0
- package/dist/lib/tabs/tab-panel.d.ts +12 -0
- package/dist/lib/tabs/tab.d.ts +14 -0
- package/dist/lib/tabs/tabs.d.ts +10 -0
- package/dist/lib/textarea/textarea.d.ts +16 -0
- package/dist/lib/theme-toggle/theme-toggle.d.ts +9 -0
- package/dist/lib/time-picker/time-picker.d.ts +21 -0
- package/dist/lib/timeline/timeline.d.ts +14 -0
- package/dist/lib/toast/toast.d.ts +21 -0
- package/dist/lib/toggle/toggle-group.d.ts +9 -0
- package/dist/lib/toggle/toggle.d.ts +15 -0
- package/dist/lib/tooltip/tooltip.d.ts +20 -0
- package/dist/lib/typography/heading.d.ts +9 -0
- package/dist/lib/typography/text.d.ts +11 -0
- package/dist/lib/uptime-bar/uptime-bar.d.ts +6 -0
- package/dist/lib/verification-code-field/verification-code-field.d.ts +19 -0
- package/dist/lib/whitepaper-cta/whitepaper-cta.d.ts +15 -0
- package/dist/lib/wizard/wizard.d.ts +13 -0
- package/dist/public-api.d.ts +109 -0
- package/dist/tokens/series-presets.d.ts +4 -0
- package/dist/viking-components.css +1837 -0
- package/dist/viking-tokens.json +318 -0
- package/dist/viking-ui-elements.js +1750 -0
- package/dist/viking-ui.css +1 -0
- package/dist/web/badge/viking-badge-wc.d.ts +28 -0
- package/dist/web/button/viking-button-wc.d.ts +28 -0
- package/dist/web/callout/viking-callout-wc.d.ts +27 -0
- package/dist/web/card/viking-card-wc.d.ts +29 -0
- package/dist/web/core/base.d.ts +12 -0
- package/dist/web/core/dom.d.ts +11 -0
- package/dist/web/core/icons-inline.d.ts +7 -0
- package/dist/web/core/styles.d.ts +12 -0
- package/dist/web/core/types.d.ts +10 -0
- package/dist/web/field/viking-field-wc.d.ts +32 -0
- package/dist/web/index.d.ts +15 -0
- package/dist/web/input/viking-input-wc.d.ts +32 -0
- package/dist/web/modal/viking-modal-wc.d.ts +50 -0
- package/dist/web/search-palette/viking-search-palette-wc.d.ts +64 -0
- package/dist/web/select/viking-select-wc.d.ts +48 -0
- package/dist/web/suite-header/viking-suite-header-wc.d.ts +36 -0
- package/dist/web/suite-search-palette/viking-suite-search-palette-wc.d.ts +39 -0
- package/dist/web/theme-toggle/viking-theme-toggle-wc.d.ts +19 -0
- package/dist/web/types.d.ts +40 -0
- package/dist/web-components/index.d.ts +1 -0
- package/dist/web-components.js +1750 -0
- package/dist/widget.js +1182 -0
- package/package.json +89 -30
- package/src/assets/drakkar-favicon.svg +17 -0
- package/src/assets/fonts/inter/InterVariable-Italic.woff2 +0 -0
- package/src/assets/fonts/inter/InterVariable.woff2 +0 -0
- package/src/core/brand/deml-lockup.svg +5 -0
- package/src/core/brand/deml-mark-compact.svg +4 -0
- package/src/core/brand/deml-mark-filled.svg +3 -0
- package/src/core/brand/deml-mark-outline.svg +4 -0
- package/src/core/brand-icons.ts +62 -0
- package/src/core/icons.spec.ts +52 -0
- package/src/core/icons.ts +206 -0
- package/src/core/integration-brand-icons.ts +77 -0
- package/src/core/lucide-paths.generated.ts +130 -0
- package/src/core/types.ts +85 -0
- package/src/core/uid.ts +7 -0
- package/src/elements/button/viking-button.ts +201 -0
- package/src/elements/card/viking-card.ts +60 -0
- package/src/elements/core/dom.ts +33 -0
- package/src/elements/core/styles.ts +28 -0
- package/src/elements/modal/viking-modal.ts +154 -0
- package/src/index.ts +1 -0
- package/src/lib/accordion/accordion.ts +126 -0
- package/src/lib/app-header/app-header.scss +274 -0
- package/src/lib/app-header/app-header.ts +43 -0
- package/src/lib/app-sidebar/app-sidebar.scss +415 -0
- package/src/lib/app-sidebar/app-sidebar.ts +29 -0
- package/src/lib/auth-panel/auth-panel.spec.ts +132 -0
- package/src/lib/auth-panel/auth-panel.ts +228 -0
- package/src/lib/autocomplete/autocomplete.ts +223 -0
- package/src/lib/avatar/avatar.ts +126 -0
- package/src/lib/badge/badge.ts +182 -0
- package/src/lib/bar/bar.ts +31 -0
- package/src/lib/brand/brand.ts +60 -0
- package/src/lib/breadcrumbs/breadcrumbs.ts +81 -0
- package/src/lib/button/button-group.ts +40 -0
- package/src/lib/button/button.scss +96 -0
- package/src/lib/button/button.ts +98 -0
- package/src/lib/calendar/calendar.ts +253 -0
- package/src/lib/callout/callout.ts +211 -0
- package/src/lib/card/card-title.spec.ts +27 -0
- package/src/lib/card/card-title.ts +50 -0
- package/src/lib/card/card.ts +170 -0
- package/src/lib/carousel/carousel.ts +206 -0
- package/src/lib/chart/chart-zoom.spec.ts +65 -0
- package/src/lib/chart/chart-zoom.ts +71 -0
- package/src/lib/chart/chart.ts +1257 -0
- package/src/lib/chart-card-header/chart-card-header.ts +80 -0
- package/src/lib/chart-empty-state/chart-empty-state.ts +146 -0
- package/src/lib/chart-panel/chart-panel.ts +133 -0
- package/src/lib/checkbox/checkbox.ts +139 -0
- package/src/lib/color-picker/color-picker.ts +148 -0
- package/src/lib/command/command.ts +260 -0
- package/src/lib/composer/composer.ts +180 -0
- package/src/lib/confirm-dialog/confirm-dialog.ts +163 -0
- package/src/lib/confirm-dialog/dialog.service.ts +79 -0
- package/src/lib/context/context.ts +75 -0
- package/src/lib/core/brand-icons.ts +62 -0
- package/src/lib/core/cva.ts +33 -0
- package/src/lib/core/icons.ts +206 -0
- package/src/lib/core/integration-brand-icons.ts +77 -0
- package/src/lib/core/lucide-paths.generated.ts +130 -0
- package/src/lib/date-picker/date-picker.ts +139 -0
- package/src/lib/dropdown/dropdown.ts +188 -0
- package/src/lib/editor/editor.ts +170 -0
- package/src/lib/empty-state/empty-state.ts +100 -0
- package/src/lib/fab/fab.ts +76 -0
- package/src/lib/field/field.ts +111 -0
- package/src/lib/file-upload/file-upload.ts +208 -0
- package/src/lib/footer/footer.scss +155 -0
- package/src/lib/footer/footer.ts +28 -0
- package/src/lib/form-section/form-section.ts +200 -0
- package/src/lib/forms.spec.ts +92 -0
- package/src/lib/gauge-arc/gauge-arc.ts +85 -0
- package/src/lib/hud-panel/hud-panel.ts +27 -0
- package/src/lib/icon/icon.ts +284 -0
- package/src/lib/icon-badge/icon-badge.ts +87 -0
- package/src/lib/icon-heading/icon-heading.spec.ts +32 -0
- package/src/lib/icon-heading/icon-heading.ts +38 -0
- package/src/lib/icon-text/icon-text.ts +120 -0
- package/src/lib/input/input.ts +119 -0
- package/src/lib/kanban/kanban.ts +211 -0
- package/src/lib/kbd/kbd.ts +32 -0
- package/src/lib/label/label.ts +39 -0
- package/src/lib/loading-overlay/loading-overlay.ts +80 -0
- package/src/lib/menubar/menubar.ts +77 -0
- package/src/lib/metric-card/metric-card.ts +33 -0
- package/src/lib/modal/modal.ts +207 -0
- package/src/lib/native-select/native-select.ts +124 -0
- package/src/lib/navbar/navbar.ts +124 -0
- package/src/lib/navigation-menu/navigation-menu.ts +116 -0
- package/src/lib/otp-input/otp-input.ts +164 -0
- package/src/lib/page-back-link/page-back-link.ts +74 -0
- package/src/lib/page-header/page-header.ts +70 -0
- package/src/lib/pagination/pagination.ts +157 -0
- package/src/lib/pillbox/pillbox.ts +157 -0
- package/src/lib/popover/popover.ts +92 -0
- package/src/lib/profile/profile.ts +73 -0
- package/src/lib/progress/progress.ts +123 -0
- package/src/lib/radio/radio.ts +132 -0
- package/src/lib/ring-gauge/ring-gauge.ts +75 -0
- package/src/lib/scroll-area/scroll-area.ts +57 -0
- package/src/lib/search-palette/search-palette.scss +288 -0
- package/src/lib/search-palette/search-palette.ts +114 -0
- package/src/lib/select/select.ts +292 -0
- package/src/lib/separator/separator.ts +59 -0
- package/src/lib/sheet/sheet.ts +192 -0
- package/src/lib/sidebar-nav/sidebar-nav.scss +218 -0
- package/src/lib/sidebar-nav/sidebar-nav.ts +158 -0
- package/src/lib/site-drakkar/site-drakkar.config.ts +295 -0
- package/src/lib/site-drakkar/site-footer.ts +129 -0
- package/src/lib/site-drakkar/site-navbar.scss +2 -0
- package/src/lib/site-drakkar/site-navbar.ts +267 -0
- package/src/lib/site-drakkar/suite-search-items.spec.ts +61 -0
- package/src/lib/site-drakkar/suite-search-items.ts +246 -0
- package/src/lib/skeleton/skeleton.ts +51 -0
- package/src/lib/slider/slider.ts +133 -0
- package/src/lib/spinner/spinner.ts +75 -0
- package/src/lib/status-metric-row/status-metric-row.ts +74 -0
- package/src/lib/suite-search-palette/suite-search-palette.ts +95 -0
- package/src/lib/switch/switch.ts +131 -0
- package/src/lib/table/table.ts +137 -0
- package/src/lib/tabs/tab-panel.ts +61 -0
- package/src/lib/tabs/tab.ts +107 -0
- package/src/lib/tabs/tabs.ts +109 -0
- package/src/lib/textarea/textarea.ts +103 -0
- package/src/lib/theme-toggle/theme-toggle.spec.ts +40 -0
- package/src/lib/theme-toggle/theme-toggle.ts +39 -0
- package/src/lib/time-picker/time-picker.ts +197 -0
- package/src/lib/timeline/timeline.ts +152 -0
- package/src/lib/toast/toast.ts +196 -0
- package/src/lib/toggle/toggle-group.ts +60 -0
- package/src/lib/toggle/toggle.ts +101 -0
- package/src/lib/tooltip/tooltip.ts +119 -0
- package/src/lib/typography/heading.ts +52 -0
- package/src/lib/typography/text.ts +51 -0
- package/src/lib/uptime-bar/uptime-bar.ts +55 -0
- package/src/lib/verification-code-field/verification-code-field.ts +149 -0
- package/src/lib/whitepaper-cta/whitepaper-cta.scss +130 -0
- package/src/lib/whitepaper-cta/whitepaper-cta.ts +78 -0
- package/src/lib/wizard/wizard.ts +80 -0
- package/src/public-api.ts +172 -0
- package/src/styles/_buttons.scss +301 -0
- package/src/styles/_component-primitives.scss +183 -0
- package/src/styles/_drakkar-buttons.scss +85 -0
- package/src/styles/_fonts.scss +22 -0
- package/src/styles/_forms.scss +66 -0
- package/src/styles/_input.scss +106 -0
- package/src/styles/_layout-enforcement.scss +166 -0
- package/src/styles/_layout-rhythm.scss +158 -0
- package/src/styles/_legacy-aliases.scss +212 -0
- package/src/styles/_series-colors.scss +24 -0
- package/src/styles/_static-primitives.scss +857 -0
- package/src/styles/_typography.scss +87 -0
- package/src/styles/_variables.scss +527 -0
- package/src/styles/components/a11y.scss +90 -0
- package/src/styles/components/badges.scss +102 -0
- package/src/styles/components/extracted-utilities.scss +459 -0
- package/src/styles/components/footer.scss +155 -0
- package/src/styles/components/icon-heading.scss +47 -0
- package/src/styles/components/icon-inline.scss +78 -0
- package/src/styles/components/layout.scss +59 -0
- package/src/styles/components/utilities.scss +131 -0
- package/src/styles/components/viking-inspired.scss +204 -0
- package/src/styles/components/whitepaper-cta.scss +130 -0
- package/src/styles/components-bundle.scss +9 -0
- package/src/styles/components.scss +175 -0
- package/src/styles/deml-components.scss +10 -0
- package/src/styles/index.scss +8 -0
- package/src/styles/layout-shell.scss +39 -11
- package/src/styles/page-shell.scss +663 -33
- package/src/styles/static-navbar.scss +862 -146
- package/src/styles/surfaces/backend.scss +142 -0
- package/src/styles/surfaces/docs-global.scss +73 -0
- package/src/styles/surfaces/docs-shell.scss +412 -0
- package/src/styles/surfaces/docs-showcase.scss +1051 -0
- package/src/styles/surfaces/marketing-cta.scss +62 -0
- package/src/styles/surfaces/marketing-docs-bento.scss +67 -0
- package/src/styles/surfaces/marketing-global.scss +748 -0
- package/src/styles/surfaces/marketing-landing.scss +1260 -0
- package/src/styles/surfaces/marketing-publication.scss +535 -0
- package/src/styles/surfaces/marketing-theme.scss +14 -0
- package/src/styles/surfaces/swagger-ui.scss +921 -0
- package/src/styles/tokens-export.scss +18 -0
- package/src/styles/tokens.scss +5 -0
- package/src/styles/viking-ui-bundle.scss +20 -2
- package/src/styles/viking-ui.scss +213 -51
- package/src/tokens/series-presets.ts +15 -0
- package/src/tokens/tailwind.preset.js +209 -0
- package/src/tokens/viking-tokens.json +318 -0
- package/src/viking-ui.spec.ts +416 -0
- package/src/web/badge/viking-badge-wc.ts +116 -0
- package/src/web/button/viking-button-wc.ts +165 -0
- package/src/web/callout/viking-callout-wc.ts +105 -0
- package/src/web/card/viking-card-wc.ts +66 -0
- package/src/web/core/base.ts +56 -0
- package/src/web/core/dom.ts +53 -0
- package/src/web/core/icons-inline.ts +44 -0
- package/src/web/core/styles.ts +1138 -0
- package/src/web/core/types.ts +19 -0
- package/src/web/field/viking-field-wc.ts +154 -0
- package/src/web/index.ts +73 -0
- package/src/web/input/viking-input-wc.ts +211 -0
- package/src/web/modal/viking-modal-wc.ts +187 -0
- package/src/web/search-palette/viking-search-palette-wc.ts +494 -0
- package/src/web/select/viking-select-wc.ts +218 -0
- package/src/web/suite-header/viking-suite-header-wc.ts +714 -0
- package/src/web/suite-search-palette/viking-suite-search-palette-wc.ts +234 -0
- package/src/web/theme-toggle/viking-theme-toggle-wc.ts +139 -0
- package/src/web/types.ts +37 -0
- package/src/web/web-components.spec.ts +297 -0
- package/src/web-components/index.ts +1 -0
- package/fesm2022/dataengineeringformachinelearning-viking-ui.mjs +0 -6114
- package/fesm2022/dataengineeringformachinelearning-viking-ui.mjs.map +0 -1
- package/types/dataengineeringformachinelearning-viking-ui.d.ts +0 -1397
- package/viking.manifest.json +0 -238
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
2
|
+
import { VikingIcon } from "../icon/icon";
|
|
3
|
+
import { VikingIconName } from "../../core/icons";
|
|
4
|
+
import { VikingTone } from "../../core/types";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* viking-icon-text — icon aligned beside a title and optional description.
|
|
8
|
+
* Use for status rows (MFA enrolled, connected accounts, subscription state).
|
|
9
|
+
*/
|
|
10
|
+
@Component({
|
|
11
|
+
selector: "viking-icon-text",
|
|
12
|
+
imports: [VikingIcon],
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
host: {
|
|
15
|
+
class: "viking-icon-text",
|
|
16
|
+
"[class.viking-icon-text--muted]": "tone() === 'muted'",
|
|
17
|
+
},
|
|
18
|
+
template: `
|
|
19
|
+
<span
|
|
20
|
+
class="viking-icon-text-icon"
|
|
21
|
+
[class]="'viking-icon-text-icon--' + tone()"
|
|
22
|
+
>
|
|
23
|
+
@if (icon()) {
|
|
24
|
+
<viking-icon [name]="icon()!" [size]="iconSize()" />
|
|
25
|
+
} @else {
|
|
26
|
+
<ng-content select="[vikingIconTextIcon]" />
|
|
27
|
+
}
|
|
28
|
+
</span>
|
|
29
|
+
<span class="viking-icon-text-body">
|
|
30
|
+
<strong class="viking-icon-text-title">{{ title() }}</strong>
|
|
31
|
+
@if (description()) {
|
|
32
|
+
<span class="viking-icon-text-desc">{{ description() }}</span>
|
|
33
|
+
} @else {
|
|
34
|
+
<ng-content select="[vikingIconTextDesc]" />
|
|
35
|
+
}
|
|
36
|
+
</span>
|
|
37
|
+
`,
|
|
38
|
+
styles: [
|
|
39
|
+
`
|
|
40
|
+
:host {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: flex-start;
|
|
43
|
+
gap: var(--viking-space-1-5, 12px);
|
|
44
|
+
min-width: 0;
|
|
45
|
+
flex: 1;
|
|
46
|
+
font-family: var(--viking-font-family);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.viking-icon-text-icon {
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
width: 24px;
|
|
55
|
+
height: 24px;
|
|
56
|
+
margin-top: 1px;
|
|
57
|
+
border-radius: var(--viking-radius-sm);
|
|
58
|
+
background: var(--viking-accent-soft);
|
|
59
|
+
color: var(--viking-text-muted);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.viking-icon-text-icon--success {
|
|
63
|
+
color: var(--viking-success);
|
|
64
|
+
background: color-mix(in srgb, var(--viking-success) 14%, transparent);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.viking-icon-text-icon--info {
|
|
68
|
+
color: var(--viking-info);
|
|
69
|
+
background: color-mix(in srgb, var(--viking-info) 14%, transparent);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.viking-icon-text-icon--warning {
|
|
73
|
+
color: var(--viking-warning);
|
|
74
|
+
background: color-mix(in srgb, var(--viking-warning) 14%, transparent);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.viking-icon-text-icon--danger {
|
|
78
|
+
color: var(--viking-danger);
|
|
79
|
+
background: color-mix(in srgb, var(--viking-danger) 14%, transparent);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.viking-icon-text-icon--accent {
|
|
83
|
+
color: var(--viking-accent-strong);
|
|
84
|
+
background: var(--viking-accent-soft);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.viking-icon-text-body {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
gap: var(--viking-space-half, 4px);
|
|
91
|
+
min-width: 0;
|
|
92
|
+
padding-top: 1px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.viking-icon-text-title {
|
|
96
|
+
display: block;
|
|
97
|
+
font-size: var(--viking-font-size, 16px);
|
|
98
|
+
font-weight: var(--viking-font-weight-semibold, 600);
|
|
99
|
+
color: var(--viking-text);
|
|
100
|
+
line-height: var(--viking-line-height-tight, 1.25);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.viking-icon-text-desc {
|
|
104
|
+
display: block;
|
|
105
|
+
margin: 0;
|
|
106
|
+
font-size: var(--viking-font-size-sm, 14px);
|
|
107
|
+
font-weight: var(--viking-font-weight-regular, 400);
|
|
108
|
+
color: var(--viking-text-muted);
|
|
109
|
+
line-height: var(--viking-line-height-relaxed, 1.625);
|
|
110
|
+
}
|
|
111
|
+
`,
|
|
112
|
+
],
|
|
113
|
+
})
|
|
114
|
+
export class VikingIconText {
|
|
115
|
+
readonly icon = input<VikingIconName | null>(null);
|
|
116
|
+
readonly title = input.required<string>();
|
|
117
|
+
readonly description = input<string>("");
|
|
118
|
+
readonly tone = input<VikingTone>("muted");
|
|
119
|
+
readonly iconSize = input<number>(16);
|
|
120
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
CUSTOM_ELEMENTS_SCHEMA,
|
|
5
|
+
input,
|
|
6
|
+
model,
|
|
7
|
+
output,
|
|
8
|
+
} from "@angular/core";
|
|
9
|
+
import { VikingControl, provideVikingCva } from "../core/cva";
|
|
10
|
+
import { VikingIcon } from "../icon/icon";
|
|
11
|
+
import { VikingIconName } from "../../core/icons";
|
|
12
|
+
import { VikingSpinner } from "../spinner/spinner";
|
|
13
|
+
import { registerVikingElements } from "../../web/index";
|
|
14
|
+
import type { VikingInputWc } from "../../web/input/viking-input-wc";
|
|
15
|
+
|
|
16
|
+
registerVikingElements();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* viking-input — thin Angular wrapper around `viking-input-wc`.
|
|
20
|
+
* ControlValueAccessor-compatible.
|
|
21
|
+
*/
|
|
22
|
+
@Component({
|
|
23
|
+
selector: "viking-input",
|
|
24
|
+
imports: [VikingIcon, VikingSpinner],
|
|
25
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
26
|
+
providers: [provideVikingCva(VikingInput)],
|
|
27
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
|
+
template: `
|
|
29
|
+
<viking-input-wc
|
|
30
|
+
[attr.type]="type()"
|
|
31
|
+
[attr.placeholder]="placeholder()"
|
|
32
|
+
[attr.value]="value()"
|
|
33
|
+
[attr.disabled]="isDisabled() ? '' : null"
|
|
34
|
+
[attr.loading]="loading() ? '' : null"
|
|
35
|
+
[attr.clearable]="clearable() ? '' : null"
|
|
36
|
+
[attr.autocomplete]="autocomplete() || null"
|
|
37
|
+
[attr.aria-label]="label() || placeholder() || 'Text input'"
|
|
38
|
+
(input)="onWcInput($event)"
|
|
39
|
+
(blur)="onTouched()"
|
|
40
|
+
(viking-cleared)="clear()"
|
|
41
|
+
>
|
|
42
|
+
@if (icon()) {
|
|
43
|
+
<viking-icon
|
|
44
|
+
slot="leading"
|
|
45
|
+
class="viking-input-icon"
|
|
46
|
+
[name]="icon()!"
|
|
47
|
+
[size]="20"
|
|
48
|
+
/>
|
|
49
|
+
}
|
|
50
|
+
@if (loading()) {
|
|
51
|
+
<viking-spinner slot="trailing" [size]="16" label="Loading input" />
|
|
52
|
+
} @else if (iconTrailing()) {
|
|
53
|
+
<viking-icon
|
|
54
|
+
slot="trailing"
|
|
55
|
+
class="viking-input-icon"
|
|
56
|
+
[name]="iconTrailing()!"
|
|
57
|
+
[size]="20"
|
|
58
|
+
/>
|
|
59
|
+
}
|
|
60
|
+
@if (kbd()) {
|
|
61
|
+
<kbd slot="trailing" class="viking-input-kbd">{{ kbd() }}</kbd>
|
|
62
|
+
}
|
|
63
|
+
</viking-input-wc>
|
|
64
|
+
`,
|
|
65
|
+
styles: [
|
|
66
|
+
`
|
|
67
|
+
:host {
|
|
68
|
+
display: block;
|
|
69
|
+
}
|
|
70
|
+
.viking-input-icon {
|
|
71
|
+
color: var(--viking-text-muted);
|
|
72
|
+
}
|
|
73
|
+
.viking-input-kbd {
|
|
74
|
+
font-family: var(--viking-font-family-mono);
|
|
75
|
+
font-size: var(--viking-font-size-xs);
|
|
76
|
+
color: var(--viking-text-muted);
|
|
77
|
+
background: var(--viking-surface-alt);
|
|
78
|
+
border: 1px solid var(--viking-border);
|
|
79
|
+
border-radius: var(--viking-radius-xs);
|
|
80
|
+
padding: 0 var(--viking-space-half);
|
|
81
|
+
line-height: 1.4;
|
|
82
|
+
}
|
|
83
|
+
`,
|
|
84
|
+
],
|
|
85
|
+
})
|
|
86
|
+
export class VikingInput extends VikingControl<string> {
|
|
87
|
+
readonly value = model<string>("");
|
|
88
|
+
readonly type = input<string>("text");
|
|
89
|
+
readonly placeholder = input<string>("");
|
|
90
|
+
readonly label = input<string>("");
|
|
91
|
+
readonly icon = input<VikingIconName | null>(null);
|
|
92
|
+
readonly iconTrailing = input<VikingIconName | null>(null);
|
|
93
|
+
readonly kbd = input<string | null>(null);
|
|
94
|
+
readonly clearable = input<boolean>(false);
|
|
95
|
+
readonly loading = input<boolean>(false);
|
|
96
|
+
readonly disabled = input<boolean>(false);
|
|
97
|
+
readonly autocomplete = input<string>("");
|
|
98
|
+
|
|
99
|
+
readonly cleared = output<void>();
|
|
100
|
+
|
|
101
|
+
protected isDisabled = (): boolean => this.disabled() || this.formDisabled();
|
|
102
|
+
|
|
103
|
+
writeValue(value: string): void {
|
|
104
|
+
this.value.set(value ?? "");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
protected onWcInput = (event: Event): void => {
|
|
108
|
+
const wc = event.currentTarget as VikingInputWc | null;
|
|
109
|
+
const next = wc?.value ?? this.value();
|
|
110
|
+
this.value.set(next);
|
|
111
|
+
this.onChange(next);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
protected clear = (): void => {
|
|
115
|
+
this.value.set("");
|
|
116
|
+
this.onChange("");
|
|
117
|
+
this.cleared.emit();
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
model,
|
|
5
|
+
output,
|
|
6
|
+
signal,
|
|
7
|
+
} from "@angular/core";
|
|
8
|
+
import { VikingIcon } from "../icon/icon";
|
|
9
|
+
import { VikingBadge } from "../badge/badge";
|
|
10
|
+
import {
|
|
11
|
+
VikingKanbanCard,
|
|
12
|
+
VikingKanbanColumn,
|
|
13
|
+
VikingKanbanMove,
|
|
14
|
+
} from "../../core/types";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* viking-kanban — drag & drop board.
|
|
18
|
+
* Native HTML5 drag and drop; emits `moved` and updates the `columns` model.
|
|
19
|
+
*/
|
|
20
|
+
@Component({
|
|
21
|
+
selector: "viking-kanban",
|
|
22
|
+
imports: [VikingIcon, VikingBadge],
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
template: `
|
|
25
|
+
<div
|
|
26
|
+
class="viking-kanban"
|
|
27
|
+
role="group"
|
|
28
|
+
aria-label="Kanban board"
|
|
29
|
+
tabindex="0"
|
|
30
|
+
>
|
|
31
|
+
@for (column of columns(); track column.id) {
|
|
32
|
+
<section
|
|
33
|
+
class="viking-kanban-column"
|
|
34
|
+
[attr.aria-label]="column.title"
|
|
35
|
+
[class.viking-drop-target]="dropColumnId() === column.id"
|
|
36
|
+
(dragover)="onDragOver($event, column.id)"
|
|
37
|
+
(dragleave)="dropColumnId.set(null)"
|
|
38
|
+
(drop)="onDrop($event, column.id)"
|
|
39
|
+
>
|
|
40
|
+
<header class="viking-kanban-header">
|
|
41
|
+
<span class="viking-kanban-title">{{ column.title }}</span>
|
|
42
|
+
<viking-badge size="sm">{{ column.cards.length }}</viking-badge>
|
|
43
|
+
</header>
|
|
44
|
+
<div class="viking-kanban-cards">
|
|
45
|
+
@for (card of column.cards; track card.id) {
|
|
46
|
+
<article
|
|
47
|
+
class="viking-kanban-card"
|
|
48
|
+
draggable="true"
|
|
49
|
+
[class.viking-dragging]="draggingId() === card.id"
|
|
50
|
+
(dragstart)="onDragStart(card, column.id)"
|
|
51
|
+
(dragend)="resetDrag()"
|
|
52
|
+
>
|
|
53
|
+
<div class="viking-kanban-card-header">
|
|
54
|
+
<span class="viking-kanban-card-title">{{ card.title }}</span>
|
|
55
|
+
<viking-icon
|
|
56
|
+
class="viking-kanban-grip"
|
|
57
|
+
name="grip-vertical"
|
|
58
|
+
[size]="16"
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
@if (card.description) {
|
|
62
|
+
<p class="viking-kanban-card-text">{{ card.description }}</p>
|
|
63
|
+
}
|
|
64
|
+
</article>
|
|
65
|
+
}
|
|
66
|
+
</div>
|
|
67
|
+
</section>
|
|
68
|
+
}
|
|
69
|
+
</div>
|
|
70
|
+
`,
|
|
71
|
+
styles: [
|
|
72
|
+
`
|
|
73
|
+
.viking-kanban:focus-visible {
|
|
74
|
+
outline: var(--viking-ring-width) solid var(--viking-ring);
|
|
75
|
+
outline-offset: var(--viking-ring-offset);
|
|
76
|
+
}
|
|
77
|
+
.viking-kanban {
|
|
78
|
+
display: grid;
|
|
79
|
+
grid-auto-flow: column;
|
|
80
|
+
grid-auto-columns: minmax(234px, 1fr);
|
|
81
|
+
gap: var(--viking-space-2);
|
|
82
|
+
overflow-x: auto;
|
|
83
|
+
padding-bottom: var(--viking-space-1);
|
|
84
|
+
font-family: var(--viking-font-family);
|
|
85
|
+
}
|
|
86
|
+
.viking-kanban-column {
|
|
87
|
+
background: var(--viking-surface-alt);
|
|
88
|
+
border: 1px solid var(--viking-border);
|
|
89
|
+
border-radius: var(--viking-radius);
|
|
90
|
+
padding: var(--viking-space-1);
|
|
91
|
+
transition: var(--viking-transition);
|
|
92
|
+
}
|
|
93
|
+
.viking-drop-target {
|
|
94
|
+
border-color: var(--viking-accent);
|
|
95
|
+
background: var(--viking-accent-soft);
|
|
96
|
+
}
|
|
97
|
+
.viking-kanban-header {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: space-between;
|
|
101
|
+
gap: var(--viking-space-1);
|
|
102
|
+
padding: var(--viking-space-1);
|
|
103
|
+
}
|
|
104
|
+
.viking-kanban-title {
|
|
105
|
+
font-size: var(--viking-font-size);
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
color: var(--viking-text);
|
|
108
|
+
text-transform: uppercase;
|
|
109
|
+
letter-spacing: 0.04em;
|
|
110
|
+
}
|
|
111
|
+
.viking-kanban-cards {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
gap: var(--viking-space-1);
|
|
115
|
+
min-height: var(--viking-space-4);
|
|
116
|
+
}
|
|
117
|
+
.viking-kanban-card {
|
|
118
|
+
background: var(--viking-surface);
|
|
119
|
+
border: 1px solid var(--viking-border);
|
|
120
|
+
border-radius: calc(var(--viking-radius) / 1.2);
|
|
121
|
+
box-shadow: var(--viking-shadow-sm);
|
|
122
|
+
padding: var(--viking-space-1) var(--viking-space-2);
|
|
123
|
+
cursor: grab;
|
|
124
|
+
transition: var(--viking-transition);
|
|
125
|
+
}
|
|
126
|
+
.viking-kanban-card:hover {
|
|
127
|
+
border-color: var(--viking-accent-strong);
|
|
128
|
+
}
|
|
129
|
+
.viking-dragging {
|
|
130
|
+
opacity: 0.45;
|
|
131
|
+
}
|
|
132
|
+
.viking-kanban-card-header {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: space-between;
|
|
136
|
+
gap: var(--viking-space-1);
|
|
137
|
+
}
|
|
138
|
+
.viking-kanban-card-title {
|
|
139
|
+
font-size: var(--viking-font-size);
|
|
140
|
+
font-weight: 600;
|
|
141
|
+
color: var(--viking-text);
|
|
142
|
+
}
|
|
143
|
+
.viking-kanban-grip {
|
|
144
|
+
color: var(--viking-text-muted);
|
|
145
|
+
}
|
|
146
|
+
.viking-kanban-card-text {
|
|
147
|
+
margin: 3px 0 0;
|
|
148
|
+
font-size: var(--viking-font-size);
|
|
149
|
+
color: var(--viking-text-muted);
|
|
150
|
+
line-height: 1.45;
|
|
151
|
+
}
|
|
152
|
+
`,
|
|
153
|
+
],
|
|
154
|
+
})
|
|
155
|
+
export class VikingKanban {
|
|
156
|
+
readonly columns = model<VikingKanbanColumn[]>([]);
|
|
157
|
+
|
|
158
|
+
readonly moved = output<VikingKanbanMove>();
|
|
159
|
+
|
|
160
|
+
protected readonly draggingId = signal<string | null>(null);
|
|
161
|
+
protected readonly dropColumnId = signal<string | null>(null);
|
|
162
|
+
|
|
163
|
+
private dragSource: { card: VikingKanbanCard; columnId: string } | null =
|
|
164
|
+
null;
|
|
165
|
+
|
|
166
|
+
protected onDragStart = (card: VikingKanbanCard, columnId: string): void => {
|
|
167
|
+
this.dragSource = { card, columnId };
|
|
168
|
+
this.draggingId.set(card.id);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
protected onDragOver = (event: DragEvent, columnId: string): void => {
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
this.dropColumnId.set(columnId);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
protected onDrop = (event: DragEvent, toColumnId: string): void => {
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
const source = this.dragSource;
|
|
179
|
+
this.resetDrag();
|
|
180
|
+
if (!source || source.columnId === toColumnId) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
this.columns.update((columns) =>
|
|
184
|
+
columns.map((column) => {
|
|
185
|
+
if (column.id === source.columnId) {
|
|
186
|
+
return {
|
|
187
|
+
...column,
|
|
188
|
+
cards: column.cards.filter((card) => card.id !== source.card.id),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
if (column.id === toColumnId) {
|
|
192
|
+
return { ...column, cards: [...column.cards, source.card] };
|
|
193
|
+
}
|
|
194
|
+
return column;
|
|
195
|
+
}),
|
|
196
|
+
);
|
|
197
|
+
const target = this.columns().find((column) => column.id === toColumnId);
|
|
198
|
+
this.moved.emit({
|
|
199
|
+
cardId: source.card.id,
|
|
200
|
+
fromColumnId: source.columnId,
|
|
201
|
+
toColumnId,
|
|
202
|
+
toIndex: (target?.cards.length ?? 1) - 1,
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
protected resetDrag = (): void => {
|
|
207
|
+
this.draggingId.set(null);
|
|
208
|
+
this.dropColumnId.set(null);
|
|
209
|
+
this.dragSource = null;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* viking-kbd — keyboard hint chip.
|
|
5
|
+
*/
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "viking-kbd",
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
template: `<ng-content />`,
|
|
10
|
+
styles: [
|
|
11
|
+
`
|
|
12
|
+
:host {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
font-family: var(--viking-font-family);
|
|
17
|
+
font-size: var(--viking-font-size-ui);
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
line-height: 1.2;
|
|
20
|
+
color: var(--viking-text-muted);
|
|
21
|
+
background: var(--viking-surface-alt);
|
|
22
|
+
border: 1px solid var(--viking-border);
|
|
23
|
+
border-radius: calc(var(--viking-radius) / 2);
|
|
24
|
+
padding: 2px var(--viking-space-1);
|
|
25
|
+
min-width: 1.5rem;
|
|
26
|
+
box-shadow: inset 0 -1px 0
|
|
27
|
+
color-mix(in srgb, var(--viking-border) 65%, transparent);
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
],
|
|
31
|
+
})
|
|
32
|
+
export class VikingKbd {}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* viking-label — accessible form label.
|
|
5
|
+
*/
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "viking-label",
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
template: `
|
|
10
|
+
<label class="viking-label" [attr.for]="htmlFor() || null">
|
|
11
|
+
<ng-content />
|
|
12
|
+
@if (required()) {
|
|
13
|
+
<span class="viking-label-required" aria-hidden="true">*</span>
|
|
14
|
+
}
|
|
15
|
+
</label>
|
|
16
|
+
`,
|
|
17
|
+
styles: [
|
|
18
|
+
`
|
|
19
|
+
.viking-label {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: calc(var(--viking-space-1) / 4);
|
|
23
|
+
font-family: var(--viking-font-family);
|
|
24
|
+
font-size: var(--viking-font-size-ui);
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
color: var(--viking-text);
|
|
27
|
+
letter-spacing: 0.01em;
|
|
28
|
+
line-height: 1.3;
|
|
29
|
+
}
|
|
30
|
+
.viking-label-required {
|
|
31
|
+
color: var(--viking-accent);
|
|
32
|
+
}
|
|
33
|
+
`,
|
|
34
|
+
],
|
|
35
|
+
})
|
|
36
|
+
export class VikingLabel {
|
|
37
|
+
readonly htmlFor = input<string>("");
|
|
38
|
+
readonly required = input<boolean>(false);
|
|
39
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
2
|
+
import { VikingSpinner } from "../spinner/spinner";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* viking-loading-overlay — blocks interaction with a centered spinner.
|
|
6
|
+
* Use on cards, panels, or full-page surfaces during async operations.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: "viking-loading-overlay",
|
|
10
|
+
imports: [VikingSpinner],
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
host: {
|
|
13
|
+
role: "status",
|
|
14
|
+
"aria-live": "polite",
|
|
15
|
+
"[attr.aria-label]": "label()",
|
|
16
|
+
"[class.viking-loading-overlay-full]": "full()",
|
|
17
|
+
},
|
|
18
|
+
template: `
|
|
19
|
+
<div class="viking-loading-overlay-backdrop" aria-hidden="true"></div>
|
|
20
|
+
<div class="viking-loading-overlay-content">
|
|
21
|
+
<viking-spinner [size]="spinnerSize()" [label]="label()" />
|
|
22
|
+
@if (message()) {
|
|
23
|
+
<p class="viking-loading-overlay-message">{{ message() }}</p>
|
|
24
|
+
}
|
|
25
|
+
</div>
|
|
26
|
+
`,
|
|
27
|
+
styles: [
|
|
28
|
+
`
|
|
29
|
+
:host {
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset: 0;
|
|
32
|
+
z-index: 2;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
border-radius: inherit;
|
|
37
|
+
animation: viking-fade-in var(--viking-duration-fast)
|
|
38
|
+
var(--viking-ease-out);
|
|
39
|
+
}
|
|
40
|
+
:host(.viking-loading-overlay-full) {
|
|
41
|
+
position: fixed;
|
|
42
|
+
z-index: var(--viking-z-overlay);
|
|
43
|
+
border-radius: 0;
|
|
44
|
+
}
|
|
45
|
+
.viking-loading-overlay-backdrop {
|
|
46
|
+
position: absolute;
|
|
47
|
+
inset: 0;
|
|
48
|
+
background: color-mix(in srgb, var(--viking-bg) 55%, transparent);
|
|
49
|
+
backdrop-filter: blur(2px);
|
|
50
|
+
border-radius: inherit;
|
|
51
|
+
}
|
|
52
|
+
.viking-loading-overlay-content {
|
|
53
|
+
position: relative;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: var(--viking-space-1);
|
|
58
|
+
padding: var(--viking-space-2);
|
|
59
|
+
}
|
|
60
|
+
.viking-loading-overlay-message {
|
|
61
|
+
margin: 0;
|
|
62
|
+
font-family: var(--viking-font-family);
|
|
63
|
+
font-size: var(--viking-font-size-sm);
|
|
64
|
+
color: var(--viking-text-muted);
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
@media (prefers-reduced-motion: reduce) {
|
|
68
|
+
:host {
|
|
69
|
+
animation: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`,
|
|
73
|
+
],
|
|
74
|
+
})
|
|
75
|
+
export class VikingLoadingOverlay {
|
|
76
|
+
readonly label = input<string>("Loading");
|
|
77
|
+
readonly message = input<string>("");
|
|
78
|
+
readonly spinnerSize = input<number>(28);
|
|
79
|
+
readonly full = input<boolean>(false);
|
|
80
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* viking-menubar — horizontal application menu bar.
|
|
5
|
+
*/
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "viking-menubar",
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
host: {
|
|
10
|
+
role: "menubar",
|
|
11
|
+
class: "viking-menubar",
|
|
12
|
+
},
|
|
13
|
+
template: `<ng-content />`,
|
|
14
|
+
styles: [
|
|
15
|
+
`
|
|
16
|
+
:host {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-wrap: wrap;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--viking-space-1);
|
|
21
|
+
padding: var(--viking-space-1);
|
|
22
|
+
border: 1px solid var(--viking-border);
|
|
23
|
+
border-radius: var(--viking-radius);
|
|
24
|
+
background: var(--viking-surface);
|
|
25
|
+
font-family: var(--viking-font-family);
|
|
26
|
+
}
|
|
27
|
+
:host ::ng-deep .viking-menubar-item,
|
|
28
|
+
:host ::ng-deep button[role="menuitem"] {
|
|
29
|
+
font-size: var(--viking-font-size-ui);
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: var(--viking-space-1);
|
|
34
|
+
min-height: var(--viking-control-height-sm);
|
|
35
|
+
padding: 0 var(--viking-space-2);
|
|
36
|
+
border: 1px solid transparent;
|
|
37
|
+
border-radius: var(--viking-radius);
|
|
38
|
+
background: transparent;
|
|
39
|
+
color: var(--viking-text);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
transition: var(--viking-transition);
|
|
42
|
+
}
|
|
43
|
+
:host ::ng-deep .viking-menubar-item:hover,
|
|
44
|
+
:host ::ng-deep button[role="menuitem"]:hover {
|
|
45
|
+
background: var(--viking-accent-soft);
|
|
46
|
+
color: var(--viking-accent);
|
|
47
|
+
}
|
|
48
|
+
:host ::ng-deep .viking-menubar-item:focus-visible,
|
|
49
|
+
:host ::ng-deep button[role="menuitem"]:focus-visible {
|
|
50
|
+
outline: var(--viking-ring-width) solid var(--viking-ring);
|
|
51
|
+
outline-offset: var(--viking-ring-offset);
|
|
52
|
+
}
|
|
53
|
+
`,
|
|
54
|
+
],
|
|
55
|
+
})
|
|
56
|
+
export class VikingMenubar {}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* viking-menubar-item — menu item trigger for viking-menubar.
|
|
60
|
+
*/
|
|
61
|
+
@Component({
|
|
62
|
+
selector: "viking-menubar-item",
|
|
63
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
64
|
+
template: `
|
|
65
|
+
<button type="button" role="menuitem" class="viking-menubar-item">
|
|
66
|
+
<ng-content />
|
|
67
|
+
</button>
|
|
68
|
+
`,
|
|
69
|
+
styles: [
|
|
70
|
+
`
|
|
71
|
+
:host {
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
],
|
|
76
|
+
})
|
|
77
|
+
export class VikingMenubarItem {}
|