@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,61 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { buildSuiteSearchItems } from "./suite-search-items";
|
|
3
|
+
|
|
4
|
+
const urls = {
|
|
5
|
+
app: "https://deml.app",
|
|
6
|
+
marketing: "https://dataengineeringformachinelearning.com",
|
|
7
|
+
backend: "https://backend.deml.app",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
describe("buildSuiteSearchItems", () => {
|
|
11
|
+
it("includes platform navigation and legal links for marketing", () => {
|
|
12
|
+
const items = buildSuiteSearchItems("marketing", urls);
|
|
13
|
+
const titles = items.map((item) => item.title);
|
|
14
|
+
|
|
15
|
+
expect(titles).toContain("Documentation");
|
|
16
|
+
expect(titles).toContain("Whitepaper");
|
|
17
|
+
expect(titles).toContain("Book");
|
|
18
|
+
expect(titles).toContain("Privacy Policy");
|
|
19
|
+
expect(titles).toContain("Terms of Service");
|
|
20
|
+
expect(titles).toContain("SOC2 Compliance");
|
|
21
|
+
expect(titles).toContain("Viking-UI Components");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("resolves app routes for deml.app context", () => {
|
|
25
|
+
const items = buildSuiteSearchItems("app", urls);
|
|
26
|
+
const dashboard = items.find((item) => item.title === "Dashboard");
|
|
27
|
+
|
|
28
|
+
expect(dashboard?.href).toBe("/dashboard");
|
|
29
|
+
expect(items.some((item) => item.title === "Billing & subscription")).toBe(
|
|
30
|
+
true,
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("matches keyword search metadata", () => {
|
|
35
|
+
const items = buildSuiteSearchItems("marketing", urls);
|
|
36
|
+
const privacy = items.find((item) => item.title === "Privacy Policy");
|
|
37
|
+
|
|
38
|
+
expect(
|
|
39
|
+
privacy?.keywords?.some((keyword) => keyword.includes("privacy")),
|
|
40
|
+
).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("includes Viking-UI docs entries for docs context", () => {
|
|
44
|
+
const items = buildSuiteSearchItems("docs", urls, {
|
|
45
|
+
docsOrigin: "https://ui.dataengineeringformachinelearning.com",
|
|
46
|
+
});
|
|
47
|
+
const titles = items.map((item) => item.title);
|
|
48
|
+
|
|
49
|
+
expect(titles).toContain("Components");
|
|
50
|
+
expect(titles).toContain("Playground");
|
|
51
|
+
expect(titles).toContain("Whitepaper");
|
|
52
|
+
expect(items.find((item) => item.title === "Components")?.href).toBe(
|
|
53
|
+
"https://ui.dataengineeringformachinelearning.com/components",
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("includes Settings shortcut for app context", () => {
|
|
58
|
+
const items = buildSuiteSearchItems("app", urls);
|
|
59
|
+
expect(items.some((item) => item.title === "Settings")).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SiteDrakkarContext,
|
|
3
|
+
SiteFooterLink,
|
|
4
|
+
SiteNavLink,
|
|
5
|
+
SiteUrls,
|
|
6
|
+
} from "./site-drakkar.config";
|
|
7
|
+
import {
|
|
8
|
+
SITE_FOOTER_COLUMNS,
|
|
9
|
+
SITE_NAV_LINKS,
|
|
10
|
+
bugReportHref,
|
|
11
|
+
cookieSettingsHref,
|
|
12
|
+
resolveFooterHref,
|
|
13
|
+
resolveNavHref,
|
|
14
|
+
} from "./site-drakkar.config";
|
|
15
|
+
|
|
16
|
+
/** Curated command-palette entry for cross-surface navigation. */
|
|
17
|
+
export type SuiteSearchItem = {
|
|
18
|
+
title: string;
|
|
19
|
+
href: string;
|
|
20
|
+
snippet?: string;
|
|
21
|
+
group?: string;
|
|
22
|
+
keywords?: string[];
|
|
23
|
+
action?: "cookie-settings" | "bug-report";
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const dedupeItems = (items: SuiteSearchItem[]): SuiteSearchItem[] => {
|
|
27
|
+
const seen = new Set<string>();
|
|
28
|
+
return items.filter((item) => {
|
|
29
|
+
const key = `${item.title}:${item.href}:${item.action ?? ""}`;
|
|
30
|
+
if (seen.has(key)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
seen.add(key);
|
|
34
|
+
return true;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const navItem = (
|
|
39
|
+
link: SiteNavLink,
|
|
40
|
+
context: SiteDrakkarContext,
|
|
41
|
+
urls: SiteUrls,
|
|
42
|
+
): SuiteSearchItem => ({
|
|
43
|
+
title: link.label,
|
|
44
|
+
href: resolveNavHref(link, context, urls),
|
|
45
|
+
snippet: `Open ${link.label}`,
|
|
46
|
+
group: "Platform",
|
|
47
|
+
keywords: [link.id, link.label.toLowerCase(), "navigate", "go"],
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const footerItem = (
|
|
51
|
+
link: SiteFooterLink,
|
|
52
|
+
columnTitle: string,
|
|
53
|
+
context: SiteDrakkarContext,
|
|
54
|
+
urls: SiteUrls,
|
|
55
|
+
): SuiteSearchItem => {
|
|
56
|
+
if (link.action === "cookie-settings") {
|
|
57
|
+
return {
|
|
58
|
+
title: link.label,
|
|
59
|
+
href: cookieSettingsHref(urls),
|
|
60
|
+
snippet: "Manage analytics and cookie preferences",
|
|
61
|
+
group: columnTitle,
|
|
62
|
+
keywords: ["cookies", "consent", "privacy", "gdpr"],
|
|
63
|
+
action: "cookie-settings",
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (link.action === "bug-report") {
|
|
68
|
+
return {
|
|
69
|
+
title: link.label,
|
|
70
|
+
href: context === "app" ? "#" : bugReportHref(urls),
|
|
71
|
+
snippet: "Submit a product issue or regression",
|
|
72
|
+
group: columnTitle,
|
|
73
|
+
keywords: ["bug", "issue", "support", "feedback"],
|
|
74
|
+
action: "bug-report",
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
title: link.label,
|
|
80
|
+
href: resolveFooterHref(link, context, urls),
|
|
81
|
+
snippet: `Open ${link.label}`,
|
|
82
|
+
group: columnTitle,
|
|
83
|
+
keywords: [link.label.toLowerCase(), columnTitle.toLowerCase()],
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** Static entries that are not derived from Drakkar nav/footer config. */
|
|
88
|
+
const SUITE_SEARCH_EXTRAS: readonly Omit<SuiteSearchItem, "href">[] = [
|
|
89
|
+
{
|
|
90
|
+
title: "Viking-UI Components",
|
|
91
|
+
snippet: "Browse the design system showcase",
|
|
92
|
+
group: "Resources",
|
|
93
|
+
keywords: ["viking", "ui", "design system", "components", "showcase"],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
title: "Design tokens",
|
|
97
|
+
snippet: "Canonical --viking-* token matrix",
|
|
98
|
+
group: "Resources",
|
|
99
|
+
keywords: ["tokens", "theme", "css", "variables"],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: "API reference",
|
|
103
|
+
snippet: "OpenAPI schema and REST endpoints",
|
|
104
|
+
group: "Resources",
|
|
105
|
+
keywords: ["api", "openapi", "swagger", "rest"],
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
const resolveExtraHref = (
|
|
110
|
+
extra: (typeof SUITE_SEARCH_EXTRAS)[number],
|
|
111
|
+
context: SiteDrakkarContext,
|
|
112
|
+
urls: SiteUrls,
|
|
113
|
+
): string => {
|
|
114
|
+
switch (extra.title) {
|
|
115
|
+
case "Viking-UI Components":
|
|
116
|
+
return "https://ui.dataengineeringformachinelearning.com/components";
|
|
117
|
+
case "Design tokens":
|
|
118
|
+
return "https://ui.dataengineeringformachinelearning.com/tokens";
|
|
119
|
+
case "API reference":
|
|
120
|
+
return `${urls.backend.replace(/\/$/, "")}/api/docs`;
|
|
121
|
+
default:
|
|
122
|
+
return context === "app" ? urls.app : urls.marketing;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/** Viking-UI docs site entries (ui.dataengineeringformachinelearning.com). */
|
|
127
|
+
const DOCS_SEARCH_EXTRAS: readonly SuiteSearchItem[] = [
|
|
128
|
+
{
|
|
129
|
+
title: "Components",
|
|
130
|
+
href: "/components",
|
|
131
|
+
snippet: "Browse all documented primitives",
|
|
132
|
+
group: "Viking-UI",
|
|
133
|
+
keywords: ["components", "showcase", "registry"],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
title: "Playground",
|
|
137
|
+
href: "/playground",
|
|
138
|
+
snippet: "Live Web Component sandbox",
|
|
139
|
+
group: "Viking-UI",
|
|
140
|
+
keywords: ["playground", "sandbox", "demo"],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
title: "Architecture",
|
|
144
|
+
href: "/architecture",
|
|
145
|
+
snippet: "CSS + WC + Angular layers",
|
|
146
|
+
group: "Viking-UI",
|
|
147
|
+
keywords: ["architecture", "layers", "web component"],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: "Design tokens",
|
|
151
|
+
href: "/tokens",
|
|
152
|
+
snippet: "Canonical --viking-* token matrix",
|
|
153
|
+
group: "Viking-UI",
|
|
154
|
+
keywords: ["tokens", "theme", "css", "variables"],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
title: "Theming",
|
|
158
|
+
href: "/theming",
|
|
159
|
+
snippet: "Light/dark mode and sync pipeline",
|
|
160
|
+
group: "Viking-UI",
|
|
161
|
+
keywords: ["theming", "dark", "light", "mode"],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
title: "Framework guides",
|
|
165
|
+
href: "/frameworks",
|
|
166
|
+
snippet: "Angular, Astro, Django setup",
|
|
167
|
+
group: "Viking-UI",
|
|
168
|
+
keywords: ["frameworks", "angular", "astro", "django"],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
title: "Contributing",
|
|
172
|
+
href: "/contributing",
|
|
173
|
+
snippet: "Extend the Viking-UI kit",
|
|
174
|
+
group: "Viking-UI",
|
|
175
|
+
keywords: ["contributing", "extend", "primitives"],
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
const resolveDocsHref = (href: string, docsOrigin: string): string =>
|
|
180
|
+
href.startsWith("http")
|
|
181
|
+
? href
|
|
182
|
+
: `${docsOrigin.replace(/\/$/, "")}${href.startsWith("/") ? href : `/${href}`}`;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Builds curated command-palette links for deml.app, marketing, backend, and docs.
|
|
186
|
+
* Used by the static widget and Angular `viking-suite-search-palette`.
|
|
187
|
+
*/
|
|
188
|
+
export const buildSuiteSearchItems = (
|
|
189
|
+
context: SiteDrakkarContext,
|
|
190
|
+
urls: SiteUrls,
|
|
191
|
+
options?: { docsOrigin?: string },
|
|
192
|
+
): SuiteSearchItem[] => {
|
|
193
|
+
const paletteContext = context === "docs" ? "marketing" : context;
|
|
194
|
+
|
|
195
|
+
const items: SuiteSearchItem[] = [
|
|
196
|
+
...SITE_NAV_LINKS.map((link) => navItem(link, paletteContext, urls)),
|
|
197
|
+
...SITE_FOOTER_COLUMNS.flatMap((column) =>
|
|
198
|
+
column.links.map((link) =>
|
|
199
|
+
footerItem(link, column.title, paletteContext, urls),
|
|
200
|
+
),
|
|
201
|
+
),
|
|
202
|
+
...SUITE_SEARCH_EXTRAS.map((extra) => ({
|
|
203
|
+
...extra,
|
|
204
|
+
href: resolveExtraHref(extra, paletteContext, urls),
|
|
205
|
+
})),
|
|
206
|
+
];
|
|
207
|
+
|
|
208
|
+
if (context === "app") {
|
|
209
|
+
items.push(
|
|
210
|
+
{
|
|
211
|
+
title: "Settings",
|
|
212
|
+
href: "/settings",
|
|
213
|
+
snippet: "Workspace domains, billing, and security",
|
|
214
|
+
group: "Platform",
|
|
215
|
+
keywords: ["settings", "sites", "workspace", "configuration"],
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
title: "Billing & subscription",
|
|
219
|
+
href: "/settings/billing",
|
|
220
|
+
snippet: "Manage plan, invoices, and payment methods",
|
|
221
|
+
group: "Platform",
|
|
222
|
+
keywords: ["billing", "stripe", "subscription", "payment"],
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
title: "Security settings",
|
|
226
|
+
href: "/settings/security",
|
|
227
|
+
snippet: "Keys, sessions, and access controls",
|
|
228
|
+
group: "Platform",
|
|
229
|
+
keywords: ["security", "keys", "auth", "rbac"],
|
|
230
|
+
},
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (context === "docs") {
|
|
235
|
+
const docsOrigin =
|
|
236
|
+
options?.docsOrigin ?? "https://ui.dataengineeringformachinelearning.com";
|
|
237
|
+
items.push(
|
|
238
|
+
...DOCS_SEARCH_EXTRAS.map((extra) => ({
|
|
239
|
+
...extra,
|
|
240
|
+
href: resolveDocsHref(extra.href, docsOrigin),
|
|
241
|
+
})),
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return dedupeItems(items);
|
|
246
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* viking-skeleton — loading placeholder.
|
|
5
|
+
*/
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "viking-skeleton",
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
host: {
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
"[class.viking-skeleton-circle]": "shape() === 'circle'",
|
|
12
|
+
"[style.width]": "width()",
|
|
13
|
+
"[style.height]": "height()",
|
|
14
|
+
},
|
|
15
|
+
template: ``,
|
|
16
|
+
styles: [
|
|
17
|
+
`
|
|
18
|
+
:host {
|
|
19
|
+
display: block;
|
|
20
|
+
border-radius: var(--viking-radius-sm);
|
|
21
|
+
background: linear-gradient(
|
|
22
|
+
100deg,
|
|
23
|
+
var(--viking-surface-alt) 38%,
|
|
24
|
+
color-mix(
|
|
25
|
+
in srgb,
|
|
26
|
+
var(--viking-text-muted) 10%,
|
|
27
|
+
var(--viking-surface-alt)
|
|
28
|
+
)
|
|
29
|
+
50%,
|
|
30
|
+
var(--viking-surface-alt) 62%
|
|
31
|
+
);
|
|
32
|
+
background-size: 200% 100%;
|
|
33
|
+
animation: viking-shimmer 1.6s ease-in-out infinite;
|
|
34
|
+
}
|
|
35
|
+
:host(.viking-skeleton-circle) {
|
|
36
|
+
border-radius: var(--viking-radius-pill);
|
|
37
|
+
}
|
|
38
|
+
@media (prefers-reduced-motion: reduce) {
|
|
39
|
+
:host {
|
|
40
|
+
animation: none;
|
|
41
|
+
background: var(--viking-surface-alt);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
45
|
+
],
|
|
46
|
+
})
|
|
47
|
+
export class VikingSkeleton {
|
|
48
|
+
readonly shape = input<"line" | "rect" | "circle">("line");
|
|
49
|
+
readonly width = input<string>("100%");
|
|
50
|
+
readonly height = input<string>("var(--viking-font-size-sm)");
|
|
51
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
computed,
|
|
5
|
+
input,
|
|
6
|
+
model,
|
|
7
|
+
} from "@angular/core";
|
|
8
|
+
import { VikingControl, provideVikingCva } from "../core/cva";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* viking-slider — range slider.
|
|
12
|
+
* ControlValueAccessor-compatible.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: "viking-slider",
|
|
16
|
+
providers: [provideVikingCva(VikingSlider)],
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
template: `
|
|
19
|
+
<div class="viking-slider-header">
|
|
20
|
+
@if (label()) {
|
|
21
|
+
<span class="viking-slider-label">{{ label() }}</span>
|
|
22
|
+
}
|
|
23
|
+
@if (showValue()) {
|
|
24
|
+
<output class="viking-slider-value">{{ value() }}</output>
|
|
25
|
+
}
|
|
26
|
+
</div>
|
|
27
|
+
<input
|
|
28
|
+
type="range"
|
|
29
|
+
[min]="min()"
|
|
30
|
+
[max]="max()"
|
|
31
|
+
[step]="step()"
|
|
32
|
+
[value]="value()"
|
|
33
|
+
[disabled]="disabled() || formDisabled()"
|
|
34
|
+
[attr.aria-label]="label() || 'Slider'"
|
|
35
|
+
[style.--viking-slider-fill.%]="fillPercent()"
|
|
36
|
+
(input)="onInput($event)"
|
|
37
|
+
(blur)="onTouched()"
|
|
38
|
+
/>
|
|
39
|
+
`,
|
|
40
|
+
styles: [
|
|
41
|
+
`
|
|
42
|
+
:host {
|
|
43
|
+
display: block;
|
|
44
|
+
font-family: var(--viking-font-family);
|
|
45
|
+
}
|
|
46
|
+
.viking-slider-header {
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
gap: var(--viking-space-2);
|
|
50
|
+
margin-bottom: calc(var(--viking-space-1) / 2);
|
|
51
|
+
font-size: var(--viking-font-size);
|
|
52
|
+
}
|
|
53
|
+
.viking-slider-label {
|
|
54
|
+
color: var(--viking-text);
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
}
|
|
57
|
+
.viking-slider-value {
|
|
58
|
+
color: var(--viking-text-muted);
|
|
59
|
+
font-variant-numeric: tabular-nums;
|
|
60
|
+
}
|
|
61
|
+
input[type="range"] {
|
|
62
|
+
appearance: none;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: var(--viking-space-1);
|
|
65
|
+
border-radius: var(--viking-radius-pill);
|
|
66
|
+
border: 1px solid var(--viking-border);
|
|
67
|
+
background: linear-gradient(
|
|
68
|
+
to right,
|
|
69
|
+
var(--viking-accent) var(--viking-slider-fill, 0%),
|
|
70
|
+
var(--viking-surface-alt) var(--viking-slider-fill, 0%)
|
|
71
|
+
);
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
margin: var(--viking-space-1) 0;
|
|
74
|
+
}
|
|
75
|
+
input[type="range"]:disabled {
|
|
76
|
+
opacity: var(--viking-state-disabled-opacity);
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
}
|
|
79
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
80
|
+
appearance: none;
|
|
81
|
+
width: var(--viking-space-2);
|
|
82
|
+
height: var(--viking-space-2);
|
|
83
|
+
border-radius: var(--viking-radius-pill);
|
|
84
|
+
background: var(--viking-surface);
|
|
85
|
+
border: 2px solid var(--viking-accent);
|
|
86
|
+
box-shadow: var(--viking-shadow-sm);
|
|
87
|
+
transition: transform 0.15s ease;
|
|
88
|
+
}
|
|
89
|
+
input[type="range"]::-webkit-slider-thumb:hover {
|
|
90
|
+
transform: scale(1.15);
|
|
91
|
+
}
|
|
92
|
+
input[type="range"]::-moz-range-thumb {
|
|
93
|
+
width: var(--viking-space-2);
|
|
94
|
+
height: var(--viking-space-2);
|
|
95
|
+
border-radius: var(--viking-radius-pill);
|
|
96
|
+
background: var(--viking-surface);
|
|
97
|
+
border: 2px solid var(--viking-accent);
|
|
98
|
+
box-shadow: var(--viking-shadow-sm);
|
|
99
|
+
}
|
|
100
|
+
input[type="range"]:focus-visible {
|
|
101
|
+
outline: var(--viking-ring-width) solid var(--viking-ring);
|
|
102
|
+
outline-offset: var(--viking-ring-offset);
|
|
103
|
+
}
|
|
104
|
+
`,
|
|
105
|
+
],
|
|
106
|
+
})
|
|
107
|
+
export class VikingSlider extends VikingControl<number> {
|
|
108
|
+
readonly value = model<number>(0);
|
|
109
|
+
readonly min = input<number>(0);
|
|
110
|
+
readonly max = input<number>(100);
|
|
111
|
+
readonly step = input<number>(1);
|
|
112
|
+
readonly label = input<string>("");
|
|
113
|
+
readonly showValue = input<boolean>(true);
|
|
114
|
+
readonly disabled = input<boolean>(false);
|
|
115
|
+
|
|
116
|
+
protected readonly fillPercent = computed(() => {
|
|
117
|
+
const range = this.max() - this.min();
|
|
118
|
+
if (range <= 0) {
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
return ((this.value() - this.min()) / range) * 100;
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
writeValue(value: number): void {
|
|
125
|
+
this.value.set(Number(value ?? 0));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
protected onInput = (event: Event): void => {
|
|
129
|
+
const next = Number((event.target as HTMLInputElement).value);
|
|
130
|
+
this.value.set(next);
|
|
131
|
+
this.onChange(next);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* viking-spinner — clinical loading indicator.
|
|
5
|
+
*/
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "viking-spinner",
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
host: {
|
|
10
|
+
role: "status",
|
|
11
|
+
"aria-live": "polite",
|
|
12
|
+
"[attr.aria-label]": "label()",
|
|
13
|
+
},
|
|
14
|
+
template: `
|
|
15
|
+
<svg
|
|
16
|
+
class="viking-spinner-svg"
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
[attr.width]="size()"
|
|
20
|
+
[attr.height]="size()"
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
>
|
|
23
|
+
<circle class="viking-spinner-track" cx="12" cy="12" r="9" />
|
|
24
|
+
<circle
|
|
25
|
+
class="viking-spinner-arc"
|
|
26
|
+
cx="12"
|
|
27
|
+
cy="12"
|
|
28
|
+
r="9"
|
|
29
|
+
stroke-linecap="round"
|
|
30
|
+
/>
|
|
31
|
+
</svg>
|
|
32
|
+
`,
|
|
33
|
+
styles: [
|
|
34
|
+
`
|
|
35
|
+
:host {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
color: var(--viking-accent);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.viking-spinner-svg {
|
|
41
|
+
--viking-spinner-stroke: 2;
|
|
42
|
+
shape-rendering: geometricPrecision;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.viking-spinner-track,
|
|
46
|
+
.viking-spinner-arc {
|
|
47
|
+
fill: none;
|
|
48
|
+
stroke-width: var(--viking-spinner-stroke);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.viking-spinner-track {
|
|
52
|
+
stroke: color-mix(in srgb, currentColor 14%, transparent);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.viking-spinner-arc {
|
|
56
|
+
stroke: currentColor;
|
|
57
|
+
stroke-dasharray: 42 84;
|
|
58
|
+
transform-origin: center;
|
|
59
|
+
animation: viking-spin var(--viking-duration-slow)
|
|
60
|
+
var(--viking-ease-default) infinite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
.viking-spinner-arc {
|
|
65
|
+
animation: none;
|
|
66
|
+
stroke-dasharray: 56 84;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`,
|
|
70
|
+
],
|
|
71
|
+
})
|
|
72
|
+
export class VikingSpinner {
|
|
73
|
+
readonly size = input<number>(20);
|
|
74
|
+
readonly label = input<string>("Loading");
|
|
75
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
2
|
+
import { VikingIcon } from "../icon/icon";
|
|
3
|
+
import type { VikingIconName } from "../../core/icons";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* viking-status-metric-row — icon + title/subtitle + value row for status cards.
|
|
7
|
+
*/
|
|
8
|
+
@Component({
|
|
9
|
+
selector: "viking-status-metric-row",
|
|
10
|
+
imports: [VikingIcon],
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
host: { class: "viking-status-metric-row ml-stat-panel" },
|
|
13
|
+
template: `
|
|
14
|
+
<div class="stat-info">
|
|
15
|
+
<viking-icon
|
|
16
|
+
[name]="icon()"
|
|
17
|
+
[size]="22"
|
|
18
|
+
color="accent"
|
|
19
|
+
[backdrop]="true"
|
|
20
|
+
/>
|
|
21
|
+
<div>
|
|
22
|
+
<span class="stat-title">{{ title() }}</span>
|
|
23
|
+
@if (subtitle()) {
|
|
24
|
+
<span class="stat-subtitle">{{ subtitle() }}</span>
|
|
25
|
+
}
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="stat-value-container">
|
|
29
|
+
<span class="stat-value"><ng-content />{{ value() }}</span>
|
|
30
|
+
</div>
|
|
31
|
+
`,
|
|
32
|
+
styles: [
|
|
33
|
+
`
|
|
34
|
+
:host {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
gap: var(--viking-space-2);
|
|
39
|
+
padding: var(--viking-space-2);
|
|
40
|
+
border: 1px solid var(--viking-border);
|
|
41
|
+
border-radius: var(--viking-radius-lg);
|
|
42
|
+
background: var(--viking-surface);
|
|
43
|
+
}
|
|
44
|
+
.stat-info {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: var(--viking-space-2);
|
|
48
|
+
min-width: 0;
|
|
49
|
+
}
|
|
50
|
+
.stat-title {
|
|
51
|
+
display: block;
|
|
52
|
+
font-size: var(--viking-font-size-sm);
|
|
53
|
+
font-weight: var(--viking-font-weight-semibold);
|
|
54
|
+
color: var(--viking-text);
|
|
55
|
+
}
|
|
56
|
+
.stat-subtitle {
|
|
57
|
+
display: block;
|
|
58
|
+
font-size: var(--viking-font-size-sm);
|
|
59
|
+
color: var(--viking-text-muted);
|
|
60
|
+
}
|
|
61
|
+
.stat-value {
|
|
62
|
+
font-size: calc(var(--viking-font-size) * 1.25);
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
color: var(--viking-text);
|
|
65
|
+
}
|
|
66
|
+
`,
|
|
67
|
+
],
|
|
68
|
+
})
|
|
69
|
+
export class VikingStatusMetricRow {
|
|
70
|
+
readonly icon = input.required<VikingIconName>();
|
|
71
|
+
readonly title = input.required<string>();
|
|
72
|
+
readonly subtitle = input<string>("");
|
|
73
|
+
readonly value = input<string | number>("");
|
|
74
|
+
}
|