@dataengineeringformachinelearning/viking-ui 3.0.0-alpha.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 +52 -12
- 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/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/cva.d.ts +15 -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-footer.d.ts +18 -0
- package/dist/lib/site-drakkar/site-navbar.d.ts +25 -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/package.json +1 -1
- package/src/assets/drakkar-favicon.svg +17 -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/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/cva.ts +33 -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-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/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/tokens/series-presets.ts +15 -0
- package/src/tokens/tailwind.preset.js +209 -0
- package/src/viking-ui.spec.ts +416 -0
- package/src/web/web-components.spec.ts +297 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VikingToggleGroup } from "./toggle-group";
|
|
2
|
+
/**
|
|
3
|
+
* viking-toggle — pressed-state button toggle.
|
|
4
|
+
*/
|
|
5
|
+
export declare class VikingToggle {
|
|
6
|
+
private readonly group;
|
|
7
|
+
constructor(group: VikingToggleGroup | null);
|
|
8
|
+
readonly pressed: import("@angular/core").ModelSignal<boolean>;
|
|
9
|
+
readonly value: import("@angular/core").InputSignal<string>;
|
|
10
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
11
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
12
|
+
readonly toggled: import("@angular/core").OutputEmitterRef<boolean>;
|
|
13
|
+
protected isPressed: () => boolean;
|
|
14
|
+
protected toggle: () => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy } from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* vikingTooltip — attribute directive tooltip.
|
|
4
|
+
* Shows on hover and keyboard focus; positions itself relative to the host.
|
|
5
|
+
*/
|
|
6
|
+
export declare class VikingTooltip implements OnDestroy {
|
|
7
|
+
private readonly host;
|
|
8
|
+
private readonly document;
|
|
9
|
+
constructor(host: ElementRef<HTMLElement>, document: Document);
|
|
10
|
+
readonly vikingTooltip: import("@angular/core").InputSignal<string>;
|
|
11
|
+
readonly tooltipPosition: import("@angular/core").InputSignal<"top" | "right" | "bottom" | "left">;
|
|
12
|
+
readonly tooltipKbd: import("@angular/core").InputSignal<string>;
|
|
13
|
+
protected readonly tooltipId: string;
|
|
14
|
+
private element;
|
|
15
|
+
protected visible: () => boolean;
|
|
16
|
+
protected show: () => void;
|
|
17
|
+
private position;
|
|
18
|
+
protected hide: () => void;
|
|
19
|
+
ngOnDestroy(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* viking-heading — consistent heading sizes.
|
|
3
|
+
*/
|
|
4
|
+
export declare class VikingHeading {
|
|
5
|
+
readonly size: import("@angular/core").InputSignal<"base" | "sm" | "lg" | "xl">;
|
|
6
|
+
readonly level: import("@angular/core").InputSignal<2 | 1 | 4 | 3>;
|
|
7
|
+
protected readonly ariaLevel: import("@angular/core").Signal<2 | 1 | 4 | 3>;
|
|
8
|
+
protected readonly hostClass: import("@angular/core").Signal<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* viking-text — body text with semantic variants.
|
|
3
|
+
*/
|
|
4
|
+
export declare class VikingText {
|
|
5
|
+
readonly variant: import("@angular/core").InputSignal<"strong" | "accent" | "muted" | "default">;
|
|
6
|
+
readonly inline: import("@angular/core").InputSignal<boolean>;
|
|
7
|
+
protected readonly hostClass: import("@angular/core").Signal<{
|
|
8
|
+
[x: string]: boolean;
|
|
9
|
+
"viking-text-inline": boolean;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type VikingUptimeStatus = "operational" | "partial_outage" | "major_outage" | "no_data";
|
|
2
|
+
/** viking-uptime-bar — timeline bar for uptime history visualizations. */
|
|
3
|
+
export declare class VikingUptimeBar {
|
|
4
|
+
readonly status: import("@angular/core").InputSignal<VikingUptimeStatus>;
|
|
5
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VikingControl } from "../core/cva";
|
|
2
|
+
/**
|
|
3
|
+
* viking-verification-code-field — labeled, centered OTP entry for MFA and phone verification flows.
|
|
4
|
+
*/
|
|
5
|
+
export declare class VikingVerificationCodeField extends VikingControl<string> {
|
|
6
|
+
readonly length: import("@angular/core").InputSignal<number>;
|
|
7
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
8
|
+
readonly description: import("@angular/core").InputSignal<string>;
|
|
9
|
+
readonly error: import("@angular/core").InputSignal<string>;
|
|
10
|
+
readonly required: import("@angular/core").InputSignal<boolean>;
|
|
11
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
12
|
+
readonly completed: import("@angular/core").OutputEmitterRef<string>;
|
|
13
|
+
protected readonly value: import("@angular/core").WritableSignal<string>;
|
|
14
|
+
protected readonly labelId: string;
|
|
15
|
+
protected readonly descriptionId: string;
|
|
16
|
+
protected readonly errorId: string;
|
|
17
|
+
writeValue(value: string): void;
|
|
18
|
+
protected onValueChange: (next: string) => void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VikingChartSeries } from "../../core/types";
|
|
2
|
+
/**
|
|
3
|
+
* viking-whitepaper-cta — Polars-style animated research CTA with bar grid + sparkline.
|
|
4
|
+
*/
|
|
5
|
+
export declare class VikingWhitepaperCta {
|
|
6
|
+
readonly tag: import("@angular/core").InputSignal<string>;
|
|
7
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
8
|
+
readonly description: import("@angular/core").InputSignal<string>;
|
|
9
|
+
readonly buttonLabel: import("@angular/core").InputSignal<string>;
|
|
10
|
+
readonly href: import("@angular/core").InputSignal<string>;
|
|
11
|
+
readonly external: import("@angular/core").InputSignal<boolean>;
|
|
12
|
+
protected readonly headingId = "viking-whitepaper-cta-title";
|
|
13
|
+
protected readonly barHeights: number[];
|
|
14
|
+
protected readonly sparklineSeries: VikingChartSeries[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface VikingWizardStep {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* viking-wizard — multi-step modal shell with progress and action slots.
|
|
7
|
+
*/
|
|
8
|
+
export declare class VikingWizard {
|
|
9
|
+
readonly steps: import("@angular/core").InputSignal<VikingWizardStep[]>;
|
|
10
|
+
readonly step: import("@angular/core").InputSignal<string>;
|
|
11
|
+
protected readonly activeStep: import("@angular/core").Signal<VikingWizardStep>;
|
|
12
|
+
protected readonly progressPercent: import("@angular/core").Signal<number>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export * from "./core/types";
|
|
2
|
+
export { VIKING_ICON_NAMES, VIKING_ICON_PATHS, VIKING_ICON_SIZE_PRESETS, VIKING_BRAND_ICON_NAMES, VIKING_LUCIDE_ICON_NAMES, MATERIAL_ICON_ALIASES, resolveVikingIcon, resolveVikingIconColor, resolveVikingIconSize, type VikingIconName, vikingIconViewBox, type VikingIconSizePreset, } from "./core/icons";
|
|
3
|
+
export { VIKING_BRAND_ICON_PATHS, VIKING_BRAND_ICON_FILLED_PATHS, VIKING_BRAND_ICON_NAMES_LIST, VIKING_DRAKKAR_ICON_PATHS, VIKING_DRAKKAR_ICON_FILLED_PATHS, VIKING_DRAKKAR_ICON_NAMES_LIST, type VikingBrandIconName, type VikingDrakkarIconName, } from "./core/brand-icons";
|
|
4
|
+
export { type VikingChartCurve, type VikingChartKind, type VikingDonutSegment, type VikingCommandItem, type VikingSelectOption, } from "./core/types";
|
|
5
|
+
export { type VikingSeriesPreset } from "./tokens/series-presets";
|
|
6
|
+
export { VikingControl, provideVikingCva } from "./lib/core/cva";
|
|
7
|
+
export { VikingBadgeWc, VikingButtonWc, VikingCalloutWc, VikingCardWc, VikingInputWc, VikingModalWc, VikingSearchPaletteWc, VikingSelectWc, VikingSuiteSearchPaletteWc, VikingThemeToggleWc, registerVikingBadgeWc, registerVikingButtonWc, registerVikingCalloutWc, registerVikingCardWc, registerVikingInputWc, registerVikingModalWc, registerVikingSearchPaletteWc, registerVikingSelectWc, registerVikingSuiteSearchPaletteWc, registerVikingThemeToggleWc, registerVikingElements, type VikingSearchPaletteItem, type VikingWcTone, } from "./web/index";
|
|
8
|
+
export * from "./lib/site-drakkar/site-drakkar.config";
|
|
9
|
+
export * from "./lib/site-drakkar/suite-search-items";
|
|
10
|
+
export * from "./lib/site-drakkar/site-navbar";
|
|
11
|
+
export * from "./lib/site-drakkar/site-footer";
|
|
12
|
+
export * from "./lib/theme-toggle/theme-toggle";
|
|
13
|
+
export * from "./lib/app-header/app-header";
|
|
14
|
+
export * from "./lib/app-sidebar/app-sidebar";
|
|
15
|
+
export * from "./lib/accordion/accordion";
|
|
16
|
+
export * from "./lib/auth-panel/auth-panel";
|
|
17
|
+
export * from "./lib/autocomplete/autocomplete";
|
|
18
|
+
export * from "./lib/avatar/avatar";
|
|
19
|
+
export * from "./lib/badge/badge";
|
|
20
|
+
export * from "./lib/bar/bar";
|
|
21
|
+
export * from "./lib/brand/brand";
|
|
22
|
+
export * from "./lib/breadcrumbs/breadcrumbs";
|
|
23
|
+
export * from "./lib/button/button";
|
|
24
|
+
export * from "./lib/button/button-group";
|
|
25
|
+
export * from "./lib/calendar/calendar";
|
|
26
|
+
export * from "./lib/callout/callout";
|
|
27
|
+
export * from "./lib/card/card";
|
|
28
|
+
export * from "./lib/card/card-title";
|
|
29
|
+
export * from "./lib/carousel/carousel";
|
|
30
|
+
export * from "./lib/chart/chart";
|
|
31
|
+
export * from "./lib/chart/chart-zoom";
|
|
32
|
+
export * from "./lib/confirm-dialog/confirm-dialog";
|
|
33
|
+
export * from "./lib/confirm-dialog/dialog.service";
|
|
34
|
+
export * from "./lib/chart-card-header/chart-card-header";
|
|
35
|
+
export * from "./lib/icon-heading/icon-heading";
|
|
36
|
+
export * from "./lib/chart-empty-state/chart-empty-state";
|
|
37
|
+
export * from "./lib/chart-panel/chart-panel";
|
|
38
|
+
export * from "./lib/checkbox/checkbox";
|
|
39
|
+
export * from "./lib/color-picker/color-picker";
|
|
40
|
+
export * from "./lib/command/command";
|
|
41
|
+
export * from "./lib/composer/composer";
|
|
42
|
+
export * from "./lib/context/context";
|
|
43
|
+
export * from "./lib/date-picker/date-picker";
|
|
44
|
+
export * from "./lib/dropdown/dropdown";
|
|
45
|
+
export * from "./lib/empty-state/empty-state";
|
|
46
|
+
export * from "./lib/editor/editor";
|
|
47
|
+
export * from "./lib/fab/fab";
|
|
48
|
+
export * from "./lib/field/field";
|
|
49
|
+
export * from "./lib/footer/footer";
|
|
50
|
+
export * from "./lib/form-section/form-section";
|
|
51
|
+
export * from "./lib/file-upload/file-upload";
|
|
52
|
+
export * from "./lib/gauge-arc/gauge-arc";
|
|
53
|
+
export * from "./lib/hud-panel/hud-panel";
|
|
54
|
+
export * from "./lib/icon/icon";
|
|
55
|
+
export * from "./lib/icon-badge/icon-badge";
|
|
56
|
+
export { VikingIconComponent } from "./lib/icon/icon";
|
|
57
|
+
export * from "./lib/icon-text/icon-text";
|
|
58
|
+
export * from "./lib/input/input";
|
|
59
|
+
export * from "./lib/kanban/kanban";
|
|
60
|
+
export * from "./lib/kbd/kbd";
|
|
61
|
+
export * from "./lib/label/label";
|
|
62
|
+
export * from "./lib/loading-overlay/loading-overlay";
|
|
63
|
+
export * from "./lib/metric-card/metric-card";
|
|
64
|
+
export * from "./lib/menubar/menubar";
|
|
65
|
+
export * from "./lib/modal/modal";
|
|
66
|
+
export * from "./lib/native-select/native-select";
|
|
67
|
+
export * from "./lib/navigation-menu/navigation-menu";
|
|
68
|
+
export type { VikingNavItem } from "./lib/navigation-menu/navigation-menu";
|
|
69
|
+
export * from "./lib/navbar/navbar";
|
|
70
|
+
export * from "./lib/otp-input/otp-input";
|
|
71
|
+
export * from "./lib/verification-code-field/verification-code-field";
|
|
72
|
+
export * from "./lib/page-back-link/page-back-link";
|
|
73
|
+
export * from "./lib/page-header/page-header";
|
|
74
|
+
export * from "./lib/pagination/pagination";
|
|
75
|
+
export * from "./lib/pillbox/pillbox";
|
|
76
|
+
export * from "./lib/popover/popover";
|
|
77
|
+
export * from "./lib/profile/profile";
|
|
78
|
+
export * from "./lib/progress/progress";
|
|
79
|
+
export * from "./lib/radio/radio";
|
|
80
|
+
export * from "./lib/ring-gauge/ring-gauge";
|
|
81
|
+
export * from "./lib/search-palette/search-palette";
|
|
82
|
+
export * from "./lib/select/select";
|
|
83
|
+
export * from "./lib/separator/separator";
|
|
84
|
+
export * from "./lib/scroll-area/scroll-area";
|
|
85
|
+
export * from "./lib/sheet/sheet";
|
|
86
|
+
export * from "./lib/sidebar-nav/sidebar-nav";
|
|
87
|
+
export * from "./lib/skeleton/skeleton";
|
|
88
|
+
export * from "./lib/spinner/spinner";
|
|
89
|
+
export * from "./lib/status-metric-row/status-metric-row";
|
|
90
|
+
export * from "./lib/slider/slider";
|
|
91
|
+
export * from "./lib/switch/switch";
|
|
92
|
+
export * from "./lib/table/table";
|
|
93
|
+
export * from "./lib/tabs/tab";
|
|
94
|
+
export * from "./lib/tabs/tab-panel";
|
|
95
|
+
export * from "./lib/tabs/tabs";
|
|
96
|
+
export * from "./lib/textarea/textarea";
|
|
97
|
+
export * from "./lib/toggle/toggle";
|
|
98
|
+
export * from "./lib/toggle/toggle-group";
|
|
99
|
+
export * from "./lib/time-picker/time-picker";
|
|
100
|
+
export * from "./lib/timeline/timeline";
|
|
101
|
+
export * from "./lib/toast/toast";
|
|
102
|
+
export * from "./lib/uptime-bar/uptime-bar";
|
|
103
|
+
export * from "./lib/whitepaper-cta/whitepaper-cta";
|
|
104
|
+
export * from "./lib/wizard/wizard";
|
|
105
|
+
export type { VikingUptimeStatus } from "./lib/uptime-bar/uptime-bar";
|
|
106
|
+
export * from "./lib/tooltip/tooltip";
|
|
107
|
+
export * from "./lib/typography/heading";
|
|
108
|
+
export * from "./lib/typography/text";
|
|
109
|
+
export * from "./lib/suite-search-palette/suite-search-palette";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Fixed series palette — keep in sync with viking-tokens.json and THEME.md §8.4 */
|
|
2
|
+
export declare const VIKING_SERIES_PRESETS: readonly ["var(--viking-electric-500)", "var(--viking-crimson-600)", "var(--viking-green-500)", "var(--viking-gold-500)", "var(--viking-crimson-500)", "var(--viking-blue-500)", "var(--viking-charcoal-700)", "var(--viking-metallic-500)"];
|
|
3
|
+
export declare const VIKING_SERIES_DEFAULT: "var(--viking-electric-500)";
|
|
4
|
+
export type VikingSeriesPreset = (typeof VIKING_SERIES_PRESETS)[number];
|
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" role="img" aria-label="Viking-UI">
|
|
2
|
+
<rect width="32" height="32" rx="6" fill="#111111"/>
|
|
3
|
+
<g
|
|
4
|
+
transform="translate(4, 4)"
|
|
5
|
+
fill="none"
|
|
6
|
+
stroke="#0d7377"
|
|
7
|
+
stroke-width="1.75"
|
|
8
|
+
stroke-linecap="round"
|
|
9
|
+
stroke-linejoin="round"
|
|
10
|
+
>
|
|
11
|
+
<path d="M12 10.189V14"/>
|
|
12
|
+
<path d="M12 2v3"/>
|
|
13
|
+
<path d="M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6"/>
|
|
14
|
+
<path d="M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76"/>
|
|
15
|
+
<path d="M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<rect x="2" y="4" width="20" height="16" rx="2"/>
|
|
3
|
+
<path d="M7 17V13M11 17V8M15 17V11"/>
|
|
4
|
+
<path d="M2 20h20"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DEML branded icon paths — optimized SVG geometry (not sourced from Lucide).
|
|
3
|
+
* Use via viking-icon name="deml" | "deml-compact" | "deml-lockup".
|
|
4
|
+
*/
|
|
5
|
+
export const VIKING_BRAND_ICON_PATHS = {
|
|
6
|
+
/** Primary bar-chart mark in rounded frame (outline). */
|
|
7
|
+
deml: '<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M8 17V13M12 17V8M16 17V11"/>',
|
|
8
|
+
/** Compact monogram for favicons and dense Drakkar shell. */
|
|
9
|
+
"deml-compact":
|
|
10
|
+
'<rect x="4" y="4" width="16" height="16" rx="3"/><path d="M9 16V12M12 16V9M15 16V13"/>',
|
|
11
|
+
/** Lockup mark with baseline accent bar. */
|
|
12
|
+
"deml-lockup":
|
|
13
|
+
'<rect x="3" y="3" width="18" height="14" rx="2"/><path d="M8 17V13M12 17V8M16 17V11"/><path d="M3 20h18"/>',
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
/** Drakkar — Viking-UI / site shell brand marks (Lucide ship, build-time inlined). */
|
|
17
|
+
export const VIKING_DRAKKAR_ICON_PATHS = {
|
|
18
|
+
/** Primary Drakkar longship mark (outline). */
|
|
19
|
+
drakkar:
|
|
20
|
+
'<path d="M12 10.189V14"/><path d="M12 2v3"/><path d="M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6"/><path d="M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76"/><path d="M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>',
|
|
21
|
+
/** Compact tile for favicons and dense navbar chrome. */
|
|
22
|
+
"drakkar-compact":
|
|
23
|
+
'<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M12 10.189V14"/><path d="M12 2v3"/><path d="M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6"/><path d="M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76"/><path d="M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>',
|
|
24
|
+
/** Lockup mark with baseline accent bar. */
|
|
25
|
+
"drakkar-lockup":
|
|
26
|
+
'<path d="M12 10.189V14"/><path d="M12 2v3"/><path d="M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6"/><path d="M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76"/><path d="M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M3 21h18"/>',
|
|
27
|
+
} as const;
|
|
28
|
+
|
|
29
|
+
/** Filled-path overrides for DEML brand marks. */
|
|
30
|
+
export const VIKING_BRAND_ICON_FILLED_PATHS: Partial<
|
|
31
|
+
Record<keyof typeof VIKING_BRAND_ICON_PATHS, string>
|
|
32
|
+
> = {
|
|
33
|
+
deml: '<path d="M5 4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4zM8 13h2.5v4H8v-4zM12 8h2.5v9H12V8zM16 11h2.5v6H16v-6z"/>',
|
|
34
|
+
"deml-compact":
|
|
35
|
+
'<path d="M6 5a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5zM9 12h1.5v4H9v-4zM12 9h1.5v7H12V9zM15 11h1.5v5H15v-5z"/>',
|
|
36
|
+
"deml-lockup":
|
|
37
|
+
'<path d="M4 4a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4zM8 13h2.5v4H8v-4zM12 8h2.5v9H12V8zM16 11h2.5v6H16v-6z"/><rect x="3" y="19" width="18" height="2" rx="1"/>',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Filled-path overrides for Drakkar brand marks. */
|
|
41
|
+
export const VIKING_DRAKKAR_ICON_FILLED_PATHS: Partial<
|
|
42
|
+
Record<keyof typeof VIKING_DRAKKAR_ICON_PATHS, string>
|
|
43
|
+
> = {
|
|
44
|
+
drakkar:
|
|
45
|
+
'<path d="M7 5h10a2 2 0 0 1 2 2v3.5L20.8 14.2l-7.8-3.5a1.8 1.8 0 0 0-1.4 0L3.2 14.2a10.5 10.5 0 0 0 2.6 7.2L5.2 13V7a2 2 0 0 0-2-2z"/><rect x="10.85" y="2" width="2.3" height="12" rx="0.4"/>',
|
|
46
|
+
"drakkar-compact":
|
|
47
|
+
'<path d="M3 3h18a2 2 0 0 1 2 2v18a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"/><path d="M7.5 12.5 12 9.8l4.5 2.7v2.2c0 .8-.5 1.4-1.2 1.7L12 17.8l-3.3-1.6c-.7-.3-1.2-.9-1.2-1.7v-2.2z"/><rect x="11" y="6" width="2" height="5.5" rx="0.35"/>',
|
|
48
|
+
"drakkar-lockup":
|
|
49
|
+
'<path d="M7 5h10a2 2 0 0 1 2 2v3.5L20.8 14.2l-7.8-3.5a1.8 1.8 0 0 0-1.4 0L3.2 14.2a10.5 10.5 0 0 0 2.6 7.2L5.2 13V7a2 2 0 0 0-2-2z"/><rect x="10.85" y="2" width="2.3" height="12" rx="0.4"/><rect x="3" y="20" width="18" height="2" rx="1"/>',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type VikingBrandIconName = keyof typeof VIKING_BRAND_ICON_PATHS;
|
|
53
|
+
|
|
54
|
+
export type VikingDrakkarIconName = keyof typeof VIKING_DRAKKAR_ICON_PATHS;
|
|
55
|
+
|
|
56
|
+
export const VIKING_BRAND_ICON_NAMES_LIST = Object.keys(
|
|
57
|
+
VIKING_BRAND_ICON_PATHS,
|
|
58
|
+
) as VikingBrandIconName[];
|
|
59
|
+
|
|
60
|
+
export const VIKING_DRAKKAR_ICON_NAMES_LIST = Object.keys(
|
|
61
|
+
VIKING_DRAKKAR_ICON_PATHS,
|
|
62
|
+
) as VikingDrakkarIconName[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
MATERIAL_ICON_ALIASES,
|
|
4
|
+
VIKING_ICON_PATHS,
|
|
5
|
+
resolveVikingIcon,
|
|
6
|
+
resolveVikingIconColor,
|
|
7
|
+
resolveVikingIconSize,
|
|
8
|
+
vikingIconViewBox,
|
|
9
|
+
} from "./icons";
|
|
10
|
+
|
|
11
|
+
describe("icons registry", () => {
|
|
12
|
+
it("resolves direct icon names case-insensitively", () => {
|
|
13
|
+
expect(resolveVikingIcon("search")).toBe("search");
|
|
14
|
+
expect(resolveVikingIcon("Shield")).toBe("shield");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("maps legacy Material icon ligatures to Viking keys", () => {
|
|
18
|
+
expect(resolveVikingIcon("trending_up")).toBe("trending-up");
|
|
19
|
+
expect(resolveVikingIcon("verified_user")).toBe("user-shield");
|
|
20
|
+
expect(MATERIAL_ICON_ALIASES["rocket_launch"]).toBe("rocket");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("falls back to info for unknown names", () => {
|
|
24
|
+
expect(resolveVikingIcon("does-not-exist")).toBe("info");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("resolves size presets to pixel dimensions", () => {
|
|
28
|
+
expect(resolveVikingIconSize(undefined, "sm")).toBe(16);
|
|
29
|
+
expect(resolveVikingIconSize(undefined, "md")).toBe(20);
|
|
30
|
+
expect(resolveVikingIconSize(undefined, "lg")).toBe(24);
|
|
31
|
+
expect(resolveVikingIconSize(28, null)).toBe(28);
|
|
32
|
+
expect(resolveVikingIconSize(undefined, null)).toBe(24);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("maps semantic color tokens to CSS custom properties", () => {
|
|
36
|
+
expect(resolveVikingIconColor("accent")).toBe("var(--viking-accent)");
|
|
37
|
+
expect(resolveVikingIconColor("danger")).toBe("var(--viking-danger)");
|
|
38
|
+
expect(resolveVikingIconColor("inherit")).toBeUndefined();
|
|
39
|
+
expect(resolveVikingIconColor("var(--custom)")).toBe("var(--custom)");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("uses a consistent 24×24 viewBox for registry icons", () => {
|
|
43
|
+
expect(vikingIconViewBox("check")).toBe("0 0 24 24");
|
|
44
|
+
expect(vikingIconViewBox("drakkar")).toBe("0 0 24 24");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("registers core Lucide and brand icons", () => {
|
|
48
|
+
expect(VIKING_ICON_PATHS["search"]).toBeTruthy();
|
|
49
|
+
expect(VIKING_ICON_PATHS["drakkar"]).toBeTruthy();
|
|
50
|
+
expect(VIKING_ICON_PATHS["deml"]).toBeTruthy();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zero-dependency inline SVG icon registry (24×24 stroke icons).
|
|
3
|
+
* Lucide paths are synced at build time; DEML brand marks are custom artwork.
|
|
4
|
+
*/
|
|
5
|
+
import { LUCIDE_ICON_PATHS } from "./lucide-paths.generated";
|
|
6
|
+
import {
|
|
7
|
+
VIKING_BRAND_ICON_FILLED_PATHS,
|
|
8
|
+
VIKING_BRAND_ICON_PATHS,
|
|
9
|
+
VIKING_BRAND_ICON_NAMES_LIST,
|
|
10
|
+
VIKING_DRAKKAR_ICON_FILLED_PATHS,
|
|
11
|
+
VIKING_DRAKKAR_ICON_PATHS,
|
|
12
|
+
VIKING_DRAKKAR_ICON_NAMES_LIST,
|
|
13
|
+
} from "./brand-icons";
|
|
14
|
+
import {
|
|
15
|
+
VIKING_INTEGRATION_ICON_PATHS,
|
|
16
|
+
VIKING_INTEGRATION_ICON_NAMES_LIST,
|
|
17
|
+
} from "./integration-brand-icons";
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
VIKING_DRAKKAR_ICON_NAMES_LIST,
|
|
21
|
+
VIKING_BRAND_ICON_NAMES_LIST,
|
|
22
|
+
} from "./brand-icons";
|
|
23
|
+
export {
|
|
24
|
+
VIKING_INTEGRATION_ICON_NAMES_LIST,
|
|
25
|
+
type VikingIntegrationIconName,
|
|
26
|
+
} from "./integration-brand-icons";
|
|
27
|
+
|
|
28
|
+
export type VikingIconName = keyof typeof VIKING_ICON_PATHS;
|
|
29
|
+
|
|
30
|
+
export type VikingIconSizePreset = "sm" | "md" | "lg";
|
|
31
|
+
|
|
32
|
+
export type VikingIconVariant = "outline" | "filled";
|
|
33
|
+
|
|
34
|
+
/** Semantic color tokens resolved to CSS custom properties. */
|
|
35
|
+
export type VikingIconColorToken =
|
|
36
|
+
| "inherit"
|
|
37
|
+
| "accent"
|
|
38
|
+
| "success"
|
|
39
|
+
| "warning"
|
|
40
|
+
| "danger"
|
|
41
|
+
| "info"
|
|
42
|
+
| "muted"
|
|
43
|
+
| "text";
|
|
44
|
+
|
|
45
|
+
/** Pixel sizes for sm / md / lg presets. */
|
|
46
|
+
export const VIKING_ICON_SIZE_PRESETS: Record<VikingIconSizePreset, number> = {
|
|
47
|
+
sm: 16,
|
|
48
|
+
md: 20,
|
|
49
|
+
lg: 24,
|
|
50
|
+
} as const;
|
|
51
|
+
|
|
52
|
+
/** Custom icons not covered by Lucide (hub topology, ML model tile, OAuth stubs). */
|
|
53
|
+
const VIKING_CUSTOM_ICON_PATHS = {
|
|
54
|
+
hub: '<circle cx="12" cy="12" r="3"/><path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1"/>',
|
|
55
|
+
model:
|
|
56
|
+
'<rect x="4" y="8" width="16" height="10" rx="2"/><path d="M8 8V6a4 4 0 0 1 8 0v2"/>',
|
|
57
|
+
google:
|
|
58
|
+
'<path d="M12 11.2v2.4h6.6c-.3 1.5-1.8 4.4-6.6 4.4-4 0-7.2-3.3-7.2-7.3S8 3.4 12 3.4c2.3 0 3.9 1 4.8 1.8l3.2-3.1C17.5.8 14.9 0 12 0 5.4 0 0 5.4 0 12s5.4 12 12 12c6.9 0 11.5-4.8 11.5-11.6 0-.8-.1-1.4-.2-1.9H12z"/>',
|
|
59
|
+
apple:
|
|
60
|
+
'<path d="M16.365 12.14c.02 2.53 2.21 3.38 2.23 3.39-.02.07-.35 1.21-1.16 2.4-.7 1.02-1.43 2.03-2.58 2.05-1.13.02-1.49-.67-2.78-.67-1.29 0-1.69.65-2.75.69-1.11.04-1.95-1.12-2.66-2.13-1.44-2.08-2.54-5.87-1.07-8.43.73-1.27 2.04-2.08 3.46-2.1 1.08-.02 2.1.72 2.78.72.67 0 2.14-.89 3.61-.76.61.03 2.33.25 3.44 1.88-.09.06-2.05 1.2-2.03 3.55M13.75 3.64c.59-.71 1-1.7.89-2.68-.86.03-1.9.57-2.52 1.28-.55.63-1.03 1.65-.9 2.62.95.07 1.92-.49 2.53-1.22"/>',
|
|
61
|
+
} as const;
|
|
62
|
+
|
|
63
|
+
export const VIKING_ICON_PATHS = {
|
|
64
|
+
...LUCIDE_ICON_PATHS,
|
|
65
|
+
...VIKING_BRAND_ICON_PATHS,
|
|
66
|
+
...VIKING_DRAKKAR_ICON_PATHS,
|
|
67
|
+
...VIKING_INTEGRATION_ICON_PATHS,
|
|
68
|
+
...VIKING_CUSTOM_ICON_PATHS,
|
|
69
|
+
} as const;
|
|
70
|
+
|
|
71
|
+
/** Filled-path overrides used when variant="filled" (brand marks, solid shapes). */
|
|
72
|
+
export const VIKING_ICON_FILLED_PATHS: Partial<Record<VikingIconName, string>> =
|
|
73
|
+
{
|
|
74
|
+
...VIKING_BRAND_ICON_FILLED_PATHS,
|
|
75
|
+
...VIKING_DRAKKAR_ICON_FILLED_PATHS,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** Legacy Material Icons ligature names → Viking icon registry keys. */
|
|
79
|
+
export const MATERIAL_ICON_ALIASES: Record<string, VikingIconName> = {
|
|
80
|
+
analytics: "deml",
|
|
81
|
+
security: "shield",
|
|
82
|
+
link: "link",
|
|
83
|
+
visibility: "eye",
|
|
84
|
+
shield: "shield",
|
|
85
|
+
trending_up: "trending-up",
|
|
86
|
+
lock: "lock",
|
|
87
|
+
fingerprint: "fingerprint",
|
|
88
|
+
gpp_maybe: "shield",
|
|
89
|
+
verified_user: "user-shield",
|
|
90
|
+
bolt: "bolt",
|
|
91
|
+
cloud: "cloud",
|
|
92
|
+
lan: "network",
|
|
93
|
+
hub: "hub",
|
|
94
|
+
speed: "speed",
|
|
95
|
+
rocket_launch: "rocket",
|
|
96
|
+
insights: "insights",
|
|
97
|
+
check: "check",
|
|
98
|
+
description: "file",
|
|
99
|
+
vpn_key: "key",
|
|
100
|
+
policy: "policy",
|
|
101
|
+
bug_report: "bug",
|
|
102
|
+
search: "search",
|
|
103
|
+
chevron_left: "chevron-left",
|
|
104
|
+
chevron_right: "chevron-right",
|
|
105
|
+
verified: "check-circle",
|
|
106
|
+
warning: "alert-triangle",
|
|
107
|
+
close: "x",
|
|
108
|
+
account_balance: "building",
|
|
109
|
+
send: "send",
|
|
110
|
+
check_circle: "check-circle",
|
|
111
|
+
play_circle: "play",
|
|
112
|
+
input: "terminal",
|
|
113
|
+
model_training: "model",
|
|
114
|
+
auto_awesome: "sparkle",
|
|
115
|
+
error_outline: "alert-circle",
|
|
116
|
+
home: "home",
|
|
117
|
+
cookie: "cookie",
|
|
118
|
+
search_off: "search-off",
|
|
119
|
+
person_add: "user",
|
|
120
|
+
storage: "aws-redshift",
|
|
121
|
+
data_object: "aws-redshift",
|
|
122
|
+
memory: "tensorflow",
|
|
123
|
+
psychology: "pytorch",
|
|
124
|
+
dns: "server",
|
|
125
|
+
login: "log-in",
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** Icons always rendered with fill (play triangle, dot grids). */
|
|
129
|
+
export const VIKING_FILLED_ICON_NAMES = [
|
|
130
|
+
"play",
|
|
131
|
+
"dots-horizontal",
|
|
132
|
+
"dots-vertical",
|
|
133
|
+
"grip-vertical",
|
|
134
|
+
] as const satisfies readonly VikingIconName[];
|
|
135
|
+
|
|
136
|
+
/** OAuth / vendor marks rendered with official brand artwork in viking-icon. */
|
|
137
|
+
export const VIKING_BRAND_ICON_NAMES = [
|
|
138
|
+
"google",
|
|
139
|
+
"apple",
|
|
140
|
+
...VIKING_BRAND_ICON_NAMES_LIST,
|
|
141
|
+
] as const satisfies readonly VikingIconName[];
|
|
142
|
+
|
|
143
|
+
const VIKING_ICON_COLOR_TOKENS: Record<
|
|
144
|
+
Exclude<VikingIconColorToken, "inherit">,
|
|
145
|
+
string
|
|
146
|
+
> = {
|
|
147
|
+
accent: "var(--viking-accent)",
|
|
148
|
+
success: "var(--viking-success)",
|
|
149
|
+
warning: "var(--viking-warning)",
|
|
150
|
+
danger: "var(--viking-danger)",
|
|
151
|
+
info: "var(--viking-info)",
|
|
152
|
+
muted: "var(--viking-text-muted)",
|
|
153
|
+
text: "var(--viking-text)",
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const vikingIconViewBox = (_name: VikingIconName): string => "0 0 24 24";
|
|
157
|
+
|
|
158
|
+
/** Resolve pixel size from preset or explicit value. */
|
|
159
|
+
export const resolveVikingIconSize = (
|
|
160
|
+
size: number | undefined,
|
|
161
|
+
preset: VikingIconSizePreset | null | undefined,
|
|
162
|
+
): number => {
|
|
163
|
+
if (preset) {
|
|
164
|
+
return VIKING_ICON_SIZE_PRESETS[preset];
|
|
165
|
+
}
|
|
166
|
+
return size ?? VIKING_ICON_SIZE_PRESETS.lg;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/** Resolve semantic color token or raw CSS value for icon tinting. */
|
|
170
|
+
export const resolveVikingIconColor = (
|
|
171
|
+
color: VikingIconColorToken | string | undefined,
|
|
172
|
+
): string | undefined => {
|
|
173
|
+
if (!color || color === "inherit") {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
if (color in VIKING_ICON_COLOR_TOKENS) {
|
|
177
|
+
return VIKING_ICON_COLOR_TOKENS[
|
|
178
|
+
color as Exclude<VikingIconColorToken, "inherit">
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
return color;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const VIKING_ICON_PATH_KEYS = new Set(Object.keys(VIKING_ICON_PATHS));
|
|
185
|
+
|
|
186
|
+
/** Resolve a Viking or legacy Material icon name to a registry key. */
|
|
187
|
+
export const resolveVikingIcon = (name: string): VikingIconName => {
|
|
188
|
+
const normalized = name.trim().toLowerCase().replace(/\s+/g, "_");
|
|
189
|
+
if (VIKING_ICON_PATH_KEYS.has(normalized)) {
|
|
190
|
+
return normalized as VikingIconName;
|
|
191
|
+
}
|
|
192
|
+
const alias = MATERIAL_ICON_ALIASES[normalized];
|
|
193
|
+
if (alias) {
|
|
194
|
+
return alias;
|
|
195
|
+
}
|
|
196
|
+
return "info";
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export const VIKING_ICON_NAMES = Object.keys(
|
|
200
|
+
VIKING_ICON_PATHS,
|
|
201
|
+
) as VikingIconName[];
|
|
202
|
+
|
|
203
|
+
/** Lucide-sourced icon names (for docs and showcase grouping). */
|
|
204
|
+
export const VIKING_LUCIDE_ICON_NAMES = Object.keys(
|
|
205
|
+
LUCIDE_ICON_PATHS,
|
|
206
|
+
) as (keyof typeof LUCIDE_ICON_PATHS)[];
|