@dataengineeringformachinelearning/viking-ui 4.0.4 → 4.0.6
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/README.md +35 -11
- package/dist/README.md +35 -11
- package/dist/design-tokens.css +300 -85
- package/dist/fesm2022/dataengineeringformachinelearning-viking-ui.mjs +100 -64
- package/dist/fesm2022/dataengineeringformachinelearning-viking-ui.mjs.map +1 -1
- package/dist/icons.js +306 -0
- package/dist/package.json +24 -5
- package/{src/lib/site-drakkar/site-drakkar.config.ts → dist/site-drakkar.js} +64 -130
- package/dist/src/tokens/viking-tokens.json +9 -7
- package/dist/types/dataengineeringformachinelearning-viking-ui.d.ts +97 -3
- package/dist/viking-components.css +161 -70
- package/dist/viking-tokens.json +9 -7
- package/dist/viking-ui-elements.js +44 -32
- package/dist/viking-ui.css +1 -1
- package/dist/web-components.js +44 -32
- package/package.json +30 -8
- package/dist/scripts/build-web-components.mjs +0 -37
- package/dist/src/web/badge/viking-badge-wc.ts +0 -116
- package/dist/src/web/button/viking-button-wc.ts +0 -165
- package/dist/src/web/callout/viking-callout-wc.ts +0 -105
- package/dist/src/web/card/viking-card-wc.ts +0 -67
- package/dist/src/web/core/base.ts +0 -56
- package/dist/src/web/core/dom.ts +0 -53
- package/dist/src/web/core/icons-inline.ts +0 -44
- package/dist/src/web/core/styles.ts +0 -1261
- package/dist/src/web/core/types.ts +0 -19
- package/dist/src/web/field/viking-field-wc.ts +0 -154
- package/dist/src/web/index.ts +0 -73
- package/dist/src/web/input/viking-input-wc.ts +0 -211
- package/dist/src/web/modal/viking-modal-wc.ts +0 -187
- package/dist/src/web/search-palette/viking-search-palette-wc.ts +0 -495
- package/dist/src/web/select/viking-select-wc.ts +0 -218
- package/dist/src/web/suite-header/viking-suite-header-wc.ts +0 -729
- package/dist/src/web/suite-search-palette/viking-suite-search-palette-wc.ts +0 -234
- package/dist/src/web/theme-toggle/viking-theme-toggle-wc.ts +0 -139
- package/dist/src/web/types.ts +0 -37
- package/dist/src/web/web-components.spec.ts +0 -297
- package/src/assets/drakkar-favicon.svg +0 -17
- 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 +0 -5
- package/src/core/brand/deml-mark-compact.svg +0 -4
- package/src/core/brand/deml-mark-filled.svg +0 -3
- package/src/core/brand/deml-mark-outline.svg +0 -4
- package/src/core/brand-icons.ts +0 -62
- package/src/core/icons.spec.ts +0 -52
- package/src/core/icons.ts +0 -206
- package/src/core/integration-brand-icons.ts +0 -77
- package/src/core/lucide-paths.generated.ts +0 -130
- package/src/core/types.ts +0 -85
- package/src/core/uid.ts +0 -7
- package/src/elements/button/viking-button.ts +0 -201
- package/src/elements/card/viking-card.ts +0 -60
- package/src/elements/core/dom.ts +0 -33
- package/src/elements/core/styles.ts +0 -28
- package/src/elements/modal/viking-modal.ts +0 -154
- package/src/index.ts +0 -1
- package/src/lib/accordion/accordion.ts +0 -126
- package/src/lib/app-header/app-header.scss +0 -274
- package/src/lib/app-header/app-header.ts +0 -43
- package/src/lib/app-sidebar/app-sidebar.scss +0 -415
- package/src/lib/app-sidebar/app-sidebar.ts +0 -29
- package/src/lib/auth-panel/auth-panel.spec.ts +0 -132
- package/src/lib/auth-panel/auth-panel.ts +0 -228
- package/src/lib/autocomplete/autocomplete.ts +0 -223
- package/src/lib/avatar/avatar.ts +0 -126
- package/src/lib/badge/badge.ts +0 -182
- package/src/lib/bar/bar.ts +0 -31
- package/src/lib/brand/brand.ts +0 -60
- package/src/lib/breadcrumbs/breadcrumbs.ts +0 -81
- package/src/lib/button/button-group.ts +0 -40
- package/src/lib/button/button.scss +0 -119
- package/src/lib/button/button.ts +0 -98
- package/src/lib/calendar/calendar.ts +0 -253
- package/src/lib/callout/callout.ts +0 -211
- package/src/lib/card/card-title.spec.ts +0 -27
- package/src/lib/card/card-title.ts +0 -50
- package/src/lib/card/card.ts +0 -200
- package/src/lib/carousel/carousel.ts +0 -206
- package/src/lib/chart/chart-zoom.spec.ts +0 -65
- package/src/lib/chart/chart-zoom.ts +0 -71
- package/src/lib/chart/chart.ts +0 -1257
- package/src/lib/chart-card-header/chart-card-header.ts +0 -80
- package/src/lib/chart-empty-state/chart-empty-state.ts +0 -146
- package/src/lib/chart-panel/chart-panel.ts +0 -133
- package/src/lib/checkbox/checkbox.ts +0 -139
- package/src/lib/color-picker/color-picker.ts +0 -148
- package/src/lib/command/command.ts +0 -260
- package/src/lib/composer/composer.ts +0 -180
- package/src/lib/confirm-dialog/confirm-dialog.ts +0 -163
- package/src/lib/confirm-dialog/dialog.service.ts +0 -79
- package/src/lib/context/context.ts +0 -75
- package/src/lib/core/brand-icons.ts +0 -62
- package/src/lib/core/cva.ts +0 -33
- package/src/lib/core/icons.ts +0 -206
- package/src/lib/core/integration-brand-icons.ts +0 -77
- package/src/lib/core/lucide-paths.generated.ts +0 -130
- package/src/lib/date-picker/date-picker.ts +0 -139
- package/src/lib/dropdown/dropdown.ts +0 -188
- package/src/lib/editor/editor.ts +0 -170
- package/src/lib/empty-state/empty-state.ts +0 -100
- package/src/lib/fab/fab.ts +0 -76
- package/src/lib/field/field.ts +0 -111
- package/src/lib/file-upload/file-upload.ts +0 -208
- package/src/lib/footer/footer.scss +0 -162
- package/src/lib/footer/footer.ts +0 -28
- package/src/lib/form-section/form-section.ts +0 -200
- package/src/lib/forms.spec.ts +0 -92
- package/src/lib/gauge-arc/gauge-arc.ts +0 -85
- package/src/lib/hud-panel/hud-panel.ts +0 -27
- package/src/lib/icon/icon.ts +0 -284
- package/src/lib/icon-badge/icon-badge.ts +0 -87
- package/src/lib/icon-heading/icon-heading.spec.ts +0 -32
- package/src/lib/icon-heading/icon-heading.ts +0 -38
- package/src/lib/icon-text/icon-text.ts +0 -120
- package/src/lib/input/input.ts +0 -119
- package/src/lib/kanban/kanban.ts +0 -211
- package/src/lib/kbd/kbd.ts +0 -32
- package/src/lib/label/label.ts +0 -39
- package/src/lib/loading-overlay/loading-overlay.ts +0 -80
- package/src/lib/menubar/menubar.ts +0 -77
- package/src/lib/metric-card/metric-card.ts +0 -33
- package/src/lib/modal/modal.ts +0 -207
- package/src/lib/native-select/native-select.ts +0 -124
- package/src/lib/navbar/navbar.ts +0 -124
- package/src/lib/navigation-menu/navigation-menu.ts +0 -116
- package/src/lib/otp-input/otp-input.ts +0 -164
- package/src/lib/page-back-link/page-back-link.ts +0 -74
- package/src/lib/page-header/page-header.ts +0 -70
- package/src/lib/pagination/pagination.ts +0 -157
- package/src/lib/pillbox/pillbox.ts +0 -157
- package/src/lib/popover/popover.ts +0 -92
- package/src/lib/profile/profile.ts +0 -73
- package/src/lib/progress/progress.ts +0 -123
- package/src/lib/radio/radio.ts +0 -132
- package/src/lib/ring-gauge/ring-gauge.ts +0 -75
- package/src/lib/scroll-area/scroll-area.ts +0 -57
- package/src/lib/search-palette/search-palette.scss +0 -288
- package/src/lib/search-palette/search-palette.ts +0 -114
- package/src/lib/select/select.ts +0 -292
- package/src/lib/separator/separator.ts +0 -59
- package/src/lib/sheet/sheet.ts +0 -192
- package/src/lib/sidebar-nav/sidebar-nav.scss +0 -218
- package/src/lib/sidebar-nav/sidebar-nav.ts +0 -158
- package/src/lib/site-drakkar/site-footer.ts +0 -133
- package/src/lib/site-drakkar/site-navbar.scss +0 -2
- package/src/lib/site-drakkar/site-navbar.ts +0 -286
- package/src/lib/site-drakkar/suite-search-items.spec.ts +0 -61
- package/src/lib/site-drakkar/suite-search-items.ts +0 -246
- package/src/lib/skeleton/skeleton.ts +0 -51
- package/src/lib/slider/slider.ts +0 -133
- package/src/lib/spinner/spinner.ts +0 -75
- package/src/lib/status-metric-row/status-metric-row.ts +0 -74
- package/src/lib/suite-search-palette/suite-search-palette.ts +0 -95
- package/src/lib/switch/switch.ts +0 -131
- package/src/lib/table/table.ts +0 -137
- package/src/lib/tabs/tab-panel.ts +0 -61
- package/src/lib/tabs/tab.ts +0 -107
- package/src/lib/tabs/tabs.ts +0 -109
- package/src/lib/textarea/textarea.ts +0 -103
- package/src/lib/theme-toggle/theme-toggle.spec.ts +0 -40
- package/src/lib/theme-toggle/theme-toggle.ts +0 -40
- package/src/lib/time-picker/time-picker.ts +0 -197
- package/src/lib/timeline/timeline.ts +0 -152
- package/src/lib/toast/toast.ts +0 -196
- package/src/lib/toggle/toggle-group.ts +0 -60
- package/src/lib/toggle/toggle.ts +0 -101
- package/src/lib/tooltip/tooltip.ts +0 -119
- package/src/lib/typography/heading.ts +0 -52
- package/src/lib/typography/text.ts +0 -51
- package/src/lib/uptime-bar/uptime-bar.ts +0 -55
- package/src/lib/verification-code-field/verification-code-field.ts +0 -149
- package/src/lib/whitepaper-cta/whitepaper-cta.scss +0 -130
- package/src/lib/whitepaper-cta/whitepaper-cta.ts +0 -78
- package/src/lib/wizard/wizard.ts +0 -80
- package/src/public-api.ts +0 -172
- package/src/styles/_buttons.scss +0 -386
- package/src/styles/_component-primitives.scss +0 -183
- package/src/styles/_drakkar-buttons.scss +0 -85
- package/src/styles/_fonts.scss +0 -22
- package/src/styles/_forms.scss +0 -66
- package/src/styles/_input.scss +0 -106
- package/src/styles/_layout-enforcement.scss +0 -229
- package/src/styles/_layout-rhythm.scss +0 -158
- package/src/styles/_legacy-aliases.scss +0 -212
- package/src/styles/_series-colors.scss +0 -24
- package/src/styles/_static-primitives.scss +0 -857
- package/src/styles/_typography.scss +0 -87
- package/src/styles/_variables.scss +0 -527
- package/src/styles/components/a11y.scss +0 -90
- package/src/styles/components/badges.scss +0 -102
- package/src/styles/components/extracted-utilities.scss +0 -459
- package/src/styles/components/footer.scss +0 -168
- package/src/styles/components/icon-heading.scss +0 -47
- package/src/styles/components/icon-inline.scss +0 -101
- package/src/styles/components/layout.scss +0 -59
- package/src/styles/components/utilities.scss +0 -131
- package/src/styles/components/viking-inspired.scss +0 -204
- package/src/styles/components/whitepaper-cta.scss +0 -130
- package/src/styles/components-bundle.scss +0 -9
- package/src/styles/components.scss +0 -442
- package/src/styles/deml-components.scss +0 -10
- package/src/styles/index.scss +0 -8
- package/src/styles/layout-shell.scss +0 -111
- package/src/styles/page-shell.scss +0 -859
- package/src/styles/static-navbar.scss +0 -1250
- package/src/styles/surfaces/backend.scss +0 -154
- package/src/styles/surfaces/docs-global.scss +0 -73
- package/src/styles/surfaces/docs-shell.scss +0 -437
- package/src/styles/surfaces/docs-showcase.scss +0 -1153
- package/src/styles/surfaces/marketing-cta.scss +0 -62
- package/src/styles/surfaces/marketing-docs-bento.scss +0 -67
- package/src/styles/surfaces/marketing-global.scss +0 -748
- package/src/styles/surfaces/marketing-landing.scss +0 -1526
- package/src/styles/surfaces/marketing-publication.scss +0 -535
- package/src/styles/surfaces/marketing-theme.scss +0 -14
- package/src/styles/surfaces/swagger-ui.scss +0 -1013
- package/src/styles/tokens-export.scss +0 -18
- package/src/styles/tokens.scss +0 -5
- package/src/styles/viking-ui-bundle.scss +0 -23
- package/src/styles/viking-ui.scss +0 -272
- package/src/tokens/series-presets.ts +0 -15
- package/src/tokens/tailwind.preset.js +0 -209
- package/src/tokens/viking-tokens.json +0 -318
- package/src/viking-ui.spec.ts +0 -416
- package/src/web/badge/viking-badge-wc.ts +0 -116
- package/src/web/button/viking-button-wc.ts +0 -165
- package/src/web/callout/viking-callout-wc.ts +0 -105
- package/src/web/card/viking-card-wc.ts +0 -67
- package/src/web/core/base.ts +0 -56
- package/src/web/core/dom.ts +0 -53
- package/src/web/core/icons-inline.ts +0 -44
- package/src/web/core/styles.ts +0 -1261
- package/src/web/core/types.ts +0 -19
- package/src/web/field/viking-field-wc.ts +0 -154
- package/src/web/index.ts +0 -73
- package/src/web/input/viking-input-wc.ts +0 -211
- package/src/web/modal/viking-modal-wc.ts +0 -187
- package/src/web/search-palette/viking-search-palette-wc.ts +0 -495
- package/src/web/select/viking-select-wc.ts +0 -218
- package/src/web/suite-header/viking-suite-header-wc.ts +0 -729
- package/src/web/suite-search-palette/viking-suite-search-palette-wc.ts +0 -234
- package/src/web/theme-toggle/viking-theme-toggle-wc.ts +0 -139
- package/src/web/types.ts +0 -37
- package/src/web/web-components.spec.ts +0 -297
- package/src/web-components/index.ts +0 -1
package/src/lib/toggle/toggle.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
Optional,
|
|
5
|
-
input,
|
|
6
|
-
model,
|
|
7
|
-
output,
|
|
8
|
-
} from "@angular/core";
|
|
9
|
-
import { VIKING_TOGGLE_GROUP, VikingToggleGroup } from "./toggle-group";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* viking-toggle — pressed-state button toggle.
|
|
13
|
-
*/
|
|
14
|
-
@Component({
|
|
15
|
-
selector: "viking-toggle",
|
|
16
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
17
|
-
template: `
|
|
18
|
-
<button
|
|
19
|
-
type="button"
|
|
20
|
-
class="viking-toggle"
|
|
21
|
-
[class.viking-pressed]="isPressed()"
|
|
22
|
-
[attr.aria-pressed]="isPressed()"
|
|
23
|
-
[disabled]="disabled()"
|
|
24
|
-
[attr.aria-label]="label() || null"
|
|
25
|
-
(click)="toggle()"
|
|
26
|
-
>
|
|
27
|
-
<ng-content />
|
|
28
|
-
</button>
|
|
29
|
-
`,
|
|
30
|
-
styles: [
|
|
31
|
-
`
|
|
32
|
-
:host {
|
|
33
|
-
display: inline-flex;
|
|
34
|
-
}
|
|
35
|
-
.viking-toggle {
|
|
36
|
-
font-family: var(--viking-font-family);
|
|
37
|
-
font-size: var(--viking-font-size-ui);
|
|
38
|
-
font-weight: 700;
|
|
39
|
-
display: inline-flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
gap: var(--viking-space-1);
|
|
43
|
-
min-height: var(--viking-control-height-sm);
|
|
44
|
-
min-width: var(--viking-btn-min-width, 120px);
|
|
45
|
-
padding: 0 var(--viking-space-2);
|
|
46
|
-
border: 1px solid var(--viking-border-strong);
|
|
47
|
-
border-radius: var(--viking-radius);
|
|
48
|
-
background: var(--viking-surface);
|
|
49
|
-
color: var(--viking-text);
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
transition: var(--viking-transition);
|
|
52
|
-
}
|
|
53
|
-
.viking-toggle:hover:not(:disabled) {
|
|
54
|
-
border-color: var(--viking-accent-strong);
|
|
55
|
-
background: var(--viking-accent-soft);
|
|
56
|
-
}
|
|
57
|
-
.viking-toggle:focus-visible {
|
|
58
|
-
outline: var(--viking-ring-width) solid var(--viking-ring);
|
|
59
|
-
outline-offset: var(--viking-ring-offset);
|
|
60
|
-
}
|
|
61
|
-
.viking-toggle.viking-pressed {
|
|
62
|
-
background: var(--viking-accent);
|
|
63
|
-
border-color: var(--viking-accent);
|
|
64
|
-
color: var(--viking-accent-content);
|
|
65
|
-
}
|
|
66
|
-
.viking-toggle:disabled {
|
|
67
|
-
opacity: var(--viking-state-disabled-opacity);
|
|
68
|
-
cursor: not-allowed;
|
|
69
|
-
}
|
|
70
|
-
`,
|
|
71
|
-
],
|
|
72
|
-
})
|
|
73
|
-
export class VikingToggle {
|
|
74
|
-
constructor(@Optional() private readonly group: VikingToggleGroup | null) {}
|
|
75
|
-
|
|
76
|
-
readonly pressed = model(false);
|
|
77
|
-
readonly value = input<string>("");
|
|
78
|
-
readonly disabled = input(false);
|
|
79
|
-
readonly label = input("");
|
|
80
|
-
|
|
81
|
-
readonly toggled = output<boolean>();
|
|
82
|
-
|
|
83
|
-
protected isPressed = (): boolean => {
|
|
84
|
-
if (this.group && this.value()) {
|
|
85
|
-
return this.group.value() === this.value();
|
|
86
|
-
}
|
|
87
|
-
return this.pressed();
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
protected toggle = (): void => {
|
|
91
|
-
if (this.disabled()) return;
|
|
92
|
-
if (this.group && this.value()) {
|
|
93
|
-
this.group.value.set(this.value());
|
|
94
|
-
this.toggled.emit(true);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const next = !this.pressed();
|
|
98
|
-
this.pressed.set(next);
|
|
99
|
-
this.toggled.emit(next);
|
|
100
|
-
};
|
|
101
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DOCUMENT,
|
|
3
|
-
Directive,
|
|
4
|
-
ElementRef,
|
|
5
|
-
Inject,
|
|
6
|
-
OnDestroy,
|
|
7
|
-
input,
|
|
8
|
-
} from "@angular/core";
|
|
9
|
-
|
|
10
|
-
let tooltipIdCounter = 0;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* vikingTooltip — attribute directive tooltip.
|
|
14
|
-
* Shows on hover and keyboard focus; positions itself relative to the host.
|
|
15
|
-
*/
|
|
16
|
-
@Directive({
|
|
17
|
-
selector: "[vikingTooltip]",
|
|
18
|
-
host: {
|
|
19
|
-
class: "viking-tooltip-host viking-focus-ring",
|
|
20
|
-
"(mouseenter)": "show()",
|
|
21
|
-
"(mouseleave)": "hide()",
|
|
22
|
-
"(focusin)": "show()",
|
|
23
|
-
"(focusout)": "hide()",
|
|
24
|
-
"(keydown.escape)": "hide()",
|
|
25
|
-
"[attr.aria-describedby]": "visible() ? tooltipId : null",
|
|
26
|
-
},
|
|
27
|
-
})
|
|
28
|
-
export class VikingTooltip implements OnDestroy {
|
|
29
|
-
constructor(
|
|
30
|
-
private readonly host: ElementRef<HTMLElement>,
|
|
31
|
-
@Inject(DOCUMENT) private readonly document: Document,
|
|
32
|
-
) {}
|
|
33
|
-
|
|
34
|
-
readonly vikingTooltip = input.required<string>();
|
|
35
|
-
readonly tooltipPosition = input<"top" | "bottom" | "left" | "right">("top");
|
|
36
|
-
readonly tooltipKbd = input<string>("");
|
|
37
|
-
|
|
38
|
-
protected readonly tooltipId = `viking-tooltip-${++tooltipIdCounter}`;
|
|
39
|
-
|
|
40
|
-
private element: HTMLElement | null = null;
|
|
41
|
-
|
|
42
|
-
protected visible = (): boolean => this.element !== null;
|
|
43
|
-
|
|
44
|
-
protected show = (): void => {
|
|
45
|
-
if (this.element || !this.vikingTooltip()) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const tip = this.document.createElement("div");
|
|
49
|
-
tip.id = this.tooltipId;
|
|
50
|
-
tip.setAttribute("role", "tooltip");
|
|
51
|
-
tip.className = "viking-tooltip";
|
|
52
|
-
|
|
53
|
-
const text = this.document.createElement("span");
|
|
54
|
-
text.className = "viking-tooltip-text";
|
|
55
|
-
text.textContent = this.vikingTooltip();
|
|
56
|
-
tip.appendChild(text);
|
|
57
|
-
|
|
58
|
-
if (this.tooltipKbd()) {
|
|
59
|
-
const kbd = this.document.createElement("kbd");
|
|
60
|
-
kbd.className = "viking-tooltip-kbd";
|
|
61
|
-
kbd.textContent = this.tooltipKbd();
|
|
62
|
-
tip.appendChild(kbd);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
this.document.body.appendChild(tip);
|
|
66
|
-
this.position(tip);
|
|
67
|
-
this.element = tip;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
private position = (tip: HTMLElement): void => {
|
|
71
|
-
const anchor = this.host.nativeElement.getBoundingClientRect();
|
|
72
|
-
const rect = tip.getBoundingClientRect();
|
|
73
|
-
const gap =
|
|
74
|
-
parseInt(
|
|
75
|
-
getComputedStyle(this.document.documentElement).getPropertyValue(
|
|
76
|
-
"--viking-space-1",
|
|
77
|
-
),
|
|
78
|
-
10,
|
|
79
|
-
) || 8;
|
|
80
|
-
const edge =
|
|
81
|
-
parseInt(
|
|
82
|
-
getComputedStyle(this.document.documentElement).getPropertyValue(
|
|
83
|
-
"--viking-space-1",
|
|
84
|
-
),
|
|
85
|
-
10,
|
|
86
|
-
) || 8;
|
|
87
|
-
|
|
88
|
-
let left = anchor.left + anchor.width / 2 - rect.width / 2;
|
|
89
|
-
let top = anchor.top - rect.height - gap;
|
|
90
|
-
|
|
91
|
-
switch (this.tooltipPosition()) {
|
|
92
|
-
case "bottom":
|
|
93
|
-
top = anchor.bottom + gap;
|
|
94
|
-
break;
|
|
95
|
-
case "left":
|
|
96
|
-
left = anchor.left - rect.width - gap;
|
|
97
|
-
top = anchor.top + anchor.height / 2 - rect.height / 2;
|
|
98
|
-
break;
|
|
99
|
-
case "right":
|
|
100
|
-
left = anchor.right + gap;
|
|
101
|
-
top = anchor.top + anchor.height / 2 - rect.height / 2;
|
|
102
|
-
break;
|
|
103
|
-
default:
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
tip.style.left = `${Math.max(edge, Math.min(left, window.innerWidth - rect.width - edge))}px`;
|
|
108
|
-
tip.style.top = `${Math.max(edge, top)}px`;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
protected hide = (): void => {
|
|
112
|
-
this.element?.remove();
|
|
113
|
-
this.element = null;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
ngOnDestroy(): void {
|
|
117
|
-
this.hide();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
computed,
|
|
5
|
-
input,
|
|
6
|
-
} from "@angular/core";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* viking-heading — consistent heading sizes.
|
|
10
|
-
*/
|
|
11
|
-
@Component({
|
|
12
|
-
selector: "viking-heading",
|
|
13
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
-
host: {
|
|
15
|
-
role: "heading",
|
|
16
|
-
"[attr.aria-level]": "ariaLevel()",
|
|
17
|
-
"[class]": "hostClass()",
|
|
18
|
-
},
|
|
19
|
-
template: `<ng-content />`,
|
|
20
|
-
styles: [
|
|
21
|
-
`
|
|
22
|
-
:host {
|
|
23
|
-
display: block;
|
|
24
|
-
font-family: var(--viking-font-family);
|
|
25
|
-
font-weight: 600;
|
|
26
|
-
color: var(--viking-text);
|
|
27
|
-
letter-spacing: var(--header-letter-spacing, -0.02em);
|
|
28
|
-
font-size: var(--viking-font-size-ui);
|
|
29
|
-
line-height: 1.25;
|
|
30
|
-
}
|
|
31
|
-
:host(.viking-heading-sm) {
|
|
32
|
-
font-size: var(--viking-font-size-sm);
|
|
33
|
-
}
|
|
34
|
-
:host(.viking-heading-lg) {
|
|
35
|
-
font-size: var(--viking-font-size);
|
|
36
|
-
}
|
|
37
|
-
:host(.viking-heading-xl) {
|
|
38
|
-
font-size: var(--viking-font-size-lg);
|
|
39
|
-
font-weight: 700;
|
|
40
|
-
}
|
|
41
|
-
`,
|
|
42
|
-
],
|
|
43
|
-
})
|
|
44
|
-
export class VikingHeading {
|
|
45
|
-
readonly size = input<"sm" | "base" | "lg" | "xl">("base");
|
|
46
|
-
readonly level = input<1 | 2 | 3 | 4>(3);
|
|
47
|
-
|
|
48
|
-
protected readonly ariaLevel = computed(() => this.level());
|
|
49
|
-
protected readonly hostClass = computed(
|
|
50
|
-
() => `viking-heading-${this.size()}`,
|
|
51
|
-
);
|
|
52
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
computed,
|
|
5
|
-
input,
|
|
6
|
-
} from "@angular/core";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* viking-text — body text with semantic variants.
|
|
10
|
-
*/
|
|
11
|
-
@Component({
|
|
12
|
-
selector: "viking-text",
|
|
13
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
-
host: { "[class]": "hostClass()" },
|
|
15
|
-
template: `<ng-content />`,
|
|
16
|
-
styles: [
|
|
17
|
-
`
|
|
18
|
-
:host {
|
|
19
|
-
display: block;
|
|
20
|
-
font-family: var(--viking-font-family);
|
|
21
|
-
font-size: var(--viking-font-size);
|
|
22
|
-
line-height: 1.65;
|
|
23
|
-
color: var(--viking-text);
|
|
24
|
-
}
|
|
25
|
-
:host(.viking-text-inline) {
|
|
26
|
-
display: inline;
|
|
27
|
-
}
|
|
28
|
-
:host(.viking-text-muted) {
|
|
29
|
-
color: var(--viking-text-muted);
|
|
30
|
-
}
|
|
31
|
-
:host(.viking-text-strong) {
|
|
32
|
-
font-weight: 600;
|
|
33
|
-
}
|
|
34
|
-
:host(.viking-text-accent) {
|
|
35
|
-
color: var(--viking-accent);
|
|
36
|
-
font-weight: 500;
|
|
37
|
-
}
|
|
38
|
-
`,
|
|
39
|
-
],
|
|
40
|
-
})
|
|
41
|
-
export class VikingText {
|
|
42
|
-
readonly variant = input<"default" | "muted" | "strong" | "accent">(
|
|
43
|
-
"default",
|
|
44
|
-
);
|
|
45
|
-
readonly inline = input<boolean>(false);
|
|
46
|
-
|
|
47
|
-
protected readonly hostClass = computed(() => ({
|
|
48
|
-
[`viking-text-${this.variant()}`]: this.variant() !== "default",
|
|
49
|
-
"viking-text-inline": this.inline(),
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
computed,
|
|
5
|
-
input,
|
|
6
|
-
} from "@angular/core";
|
|
7
|
-
|
|
8
|
-
export type VikingUptimeStatus =
|
|
9
|
-
| "operational"
|
|
10
|
-
| "partial_outage"
|
|
11
|
-
| "major_outage"
|
|
12
|
-
| "no_data";
|
|
13
|
-
|
|
14
|
-
/** viking-uptime-bar — timeline bar for uptime history visualizations. */
|
|
15
|
-
@Component({
|
|
16
|
-
selector: "viking-uptime-bar",
|
|
17
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
-
host: {
|
|
19
|
-
class: "viking-uptime-bar",
|
|
20
|
-
"[class.viking-uptime-partial]": "status() === 'partial_outage'",
|
|
21
|
-
"[class.viking-uptime-major]": "status() === 'major_outage'",
|
|
22
|
-
"[class.viking-uptime-nodata]": "status() === 'no_data'",
|
|
23
|
-
"[attr.title]": "title()",
|
|
24
|
-
},
|
|
25
|
-
template: "",
|
|
26
|
-
styles: [
|
|
27
|
-
`
|
|
28
|
-
:host {
|
|
29
|
-
display: block;
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
border-radius: var(--viking-radius);
|
|
33
|
-
background: var(--viking-success);
|
|
34
|
-
}
|
|
35
|
-
:host(.viking-uptime-partial) {
|
|
36
|
-
height: 70%;
|
|
37
|
-
align-self: flex-end;
|
|
38
|
-
background: var(--viking-warning);
|
|
39
|
-
}
|
|
40
|
-
:host(.viking-uptime-major) {
|
|
41
|
-
height: 40%;
|
|
42
|
-
align-self: flex-end;
|
|
43
|
-
background: var(--viking-danger);
|
|
44
|
-
}
|
|
45
|
-
:host(.viking-uptime-nodata) {
|
|
46
|
-
background: var(--viking-text-muted);
|
|
47
|
-
opacity: 0.35;
|
|
48
|
-
}
|
|
49
|
-
`,
|
|
50
|
-
],
|
|
51
|
-
})
|
|
52
|
-
export class VikingUptimeBar {
|
|
53
|
-
readonly status = input<VikingUptimeStatus>("operational");
|
|
54
|
-
readonly title = input<string>("");
|
|
55
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
input,
|
|
5
|
-
output,
|
|
6
|
-
signal,
|
|
7
|
-
} from "@angular/core";
|
|
8
|
-
import { VikingControl, provideVikingCva } from "../core/cva";
|
|
9
|
-
import { vikingUid } from "../../core/uid";
|
|
10
|
-
import { VikingOtpInput } from "../otp-input/otp-input";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* viking-verification-code-field — labeled, centered OTP entry for MFA and phone verification flows.
|
|
14
|
-
*/
|
|
15
|
-
@Component({
|
|
16
|
-
selector: "viking-verification-code-field",
|
|
17
|
-
imports: [VikingOtpInput],
|
|
18
|
-
providers: [provideVikingCva(VikingVerificationCodeField)],
|
|
19
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
-
host: {
|
|
21
|
-
class: "viking-verification-code-field",
|
|
22
|
-
"[class.viking-verification-code-field-invalid]": "!!error()",
|
|
23
|
-
},
|
|
24
|
-
template: `
|
|
25
|
-
<fieldset class="viking-verification-code-fieldset">
|
|
26
|
-
@if (label()) {
|
|
27
|
-
<legend class="viking-verification-code-label" [id]="labelId">
|
|
28
|
-
{{ label() }}
|
|
29
|
-
@if (required()) {
|
|
30
|
-
<span class="viking-verification-code-required" aria-hidden="true"
|
|
31
|
-
>*</span
|
|
32
|
-
>
|
|
33
|
-
}
|
|
34
|
-
</legend>
|
|
35
|
-
}
|
|
36
|
-
<div class="viking-verification-code-control">
|
|
37
|
-
<viking-otp-input
|
|
38
|
-
[length]="length()"
|
|
39
|
-
[value]="value()"
|
|
40
|
-
(valueChange)="onValueChange($event)"
|
|
41
|
-
[disabled]="disabled() || formDisabled()"
|
|
42
|
-
[label]="label()"
|
|
43
|
-
[centered]="true"
|
|
44
|
-
(completed)="completed.emit($event)"
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
47
|
-
</fieldset>
|
|
48
|
-
@if (description() && !error()) {
|
|
49
|
-
<p class="viking-verification-code-description" [id]="descriptionId">
|
|
50
|
-
{{ description() }}
|
|
51
|
-
</p>
|
|
52
|
-
}
|
|
53
|
-
@if (error()) {
|
|
54
|
-
<p class="viking-verification-code-error" [id]="errorId" role="alert">
|
|
55
|
-
{{ error() }}
|
|
56
|
-
</p>
|
|
57
|
-
}
|
|
58
|
-
`,
|
|
59
|
-
styles: [
|
|
60
|
-
`
|
|
61
|
-
:host {
|
|
62
|
-
display: block;
|
|
63
|
-
width: 100%;
|
|
64
|
-
font-family: var(--viking-font-family);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
:host(.viking-verification-code-field-invalid) {
|
|
68
|
-
animation: viking-shake var(--viking-duration-slow)
|
|
69
|
-
var(--viking-ease-default);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.viking-verification-code-fieldset {
|
|
73
|
-
margin: 0;
|
|
74
|
-
padding: 0;
|
|
75
|
-
border: 0;
|
|
76
|
-
min-width: 0;
|
|
77
|
-
width: 100%;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.viking-verification-code-label {
|
|
81
|
-
display: block;
|
|
82
|
-
width: 100%;
|
|
83
|
-
margin-bottom: var(--viking-space-1);
|
|
84
|
-
padding: 0;
|
|
85
|
-
font-size: var(--viking-font-size-sm);
|
|
86
|
-
font-weight: var(--viking-font-weight-semibold);
|
|
87
|
-
color: var(--viking-text);
|
|
88
|
-
letter-spacing: var(--viking-letter-spacing-wide);
|
|
89
|
-
line-height: var(--viking-line-height-tight);
|
|
90
|
-
text-align: center;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.viking-verification-code-required {
|
|
94
|
-
color: var(--viking-danger);
|
|
95
|
-
margin-left: 2px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.viking-verification-code-control {
|
|
99
|
-
display: flex;
|
|
100
|
-
justify-content: center;
|
|
101
|
-
width: 100%;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.viking-verification-code-description,
|
|
105
|
-
.viking-verification-code-error {
|
|
106
|
-
margin: var(--viking-space-1) 0 0;
|
|
107
|
-
font-size: var(--viking-font-size-sm);
|
|
108
|
-
line-height: var(--viking-line-height-normal);
|
|
109
|
-
text-align: center;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.viking-verification-code-description {
|
|
113
|
-
color: var(--viking-text-muted);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.viking-verification-code-error {
|
|
117
|
-
color: var(--viking-danger-text, var(--viking-danger));
|
|
118
|
-
font-weight: var(--viking-font-weight-semibold);
|
|
119
|
-
}
|
|
120
|
-
`,
|
|
121
|
-
],
|
|
122
|
-
})
|
|
123
|
-
export class VikingVerificationCodeField extends VikingControl<string> {
|
|
124
|
-
readonly length = input<number>(6);
|
|
125
|
-
readonly label = input<string>("Verification Code");
|
|
126
|
-
readonly description = input<string>("");
|
|
127
|
-
readonly error = input<string>("");
|
|
128
|
-
readonly required = input<boolean>(false);
|
|
129
|
-
readonly disabled = input<boolean>(false);
|
|
130
|
-
|
|
131
|
-
readonly completed = output<string>();
|
|
132
|
-
|
|
133
|
-
protected readonly value = signal<string>("");
|
|
134
|
-
protected readonly labelId = vikingUid("viking-verification-code-label");
|
|
135
|
-
protected readonly descriptionId = vikingUid(
|
|
136
|
-
"viking-verification-code-description",
|
|
137
|
-
);
|
|
138
|
-
protected readonly errorId = vikingUid("viking-verification-code-error");
|
|
139
|
-
|
|
140
|
-
writeValue(value: string): void {
|
|
141
|
-
this.value.set(value ?? "");
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
protected onValueChange = (next: string): void => {
|
|
145
|
-
this.value.set(next);
|
|
146
|
-
this.onChange(next);
|
|
147
|
-
this.onTouched();
|
|
148
|
-
};
|
|
149
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
.viking-whitepaper-cta {
|
|
2
|
-
position: relative;
|
|
3
|
-
max-width: 720px;
|
|
4
|
-
margin: 0 auto;
|
|
5
|
-
padding: var(--viking-space-4) var(--viking-space-3);
|
|
6
|
-
border-radius: var(--viking-radius-xl);
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
border: 1px solid color-mix(in srgb, var(--viking-accent) 22%, transparent);
|
|
9
|
-
background: color-mix(in srgb, var(--viking-accent) 6%, var(--viking-surface));
|
|
10
|
-
text-align: center;
|
|
11
|
-
box-shadow: var(--viking-shadow-sm);
|
|
12
|
-
transition: var(--viking-transition-colors);
|
|
13
|
-
|
|
14
|
-
@media (min-width: 768px) {
|
|
15
|
-
padding: var(--viking-space-5) var(--viking-space-4);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.viking-whitepaper-cta-bg {
|
|
20
|
-
position: absolute;
|
|
21
|
-
inset: 0;
|
|
22
|
-
pointer-events: none;
|
|
23
|
-
opacity: 0.5;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.viking-whitepaper-polars-grid {
|
|
27
|
-
position: absolute;
|
|
28
|
-
inset: 0;
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: flex-end;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
gap: var(--viking-space-half);
|
|
33
|
-
padding: 0 var(--viking-space-3);
|
|
34
|
-
mask-image: linear-gradient(to top, black 30%, transparent 85%);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.viking-bar,
|
|
38
|
-
.viking-whitepaper-polars-bar {
|
|
39
|
-
display: block;
|
|
40
|
-
flex: 1;
|
|
41
|
-
max-width: 28px;
|
|
42
|
-
height: calc(var(--viking-bar-height, 50) * 1%);
|
|
43
|
-
background: var(--viking-accent);
|
|
44
|
-
border-radius: var(--viking-radius-xs) var(--viking-radius-xs) 0 0;
|
|
45
|
-
opacity: 0.75;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.viking-whitepaper-polars-bar {
|
|
49
|
-
animation: vikingWhitepaperBarPulse 4s var(--viking-ease-default) infinite;
|
|
50
|
-
|
|
51
|
-
@for $i from 1 through 12 {
|
|
52
|
-
&:nth-child(#{$i}) {
|
|
53
|
-
animation-delay: #{$i * 0.12}s;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@keyframes vikingWhitepaperBarPulse {
|
|
59
|
-
0%,
|
|
60
|
-
100% {
|
|
61
|
-
opacity: 0.4;
|
|
62
|
-
transform: scaleY(1);
|
|
63
|
-
}
|
|
64
|
-
50% {
|
|
65
|
-
opacity: 0.75;
|
|
66
|
-
transform: scaleY(1.06);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@media (prefers-reduced-motion: reduce) {
|
|
71
|
-
.viking-whitepaper-polars-bar {
|
|
72
|
-
animation: none;
|
|
73
|
-
opacity: 0.5;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.viking-whitepaper-sparkline {
|
|
78
|
-
position: absolute;
|
|
79
|
-
bottom: 0;
|
|
80
|
-
left: 0;
|
|
81
|
-
width: 100%;
|
|
82
|
-
height: 40%;
|
|
83
|
-
opacity: 0.65;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.viking-whitepaper-cta-content {
|
|
87
|
-
position: relative;
|
|
88
|
-
z-index: 1;
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
align-items: center;
|
|
92
|
-
gap: var(--viking-space-1-5);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.viking-whitepaper-tag {
|
|
96
|
-
font-size: var(--viking-font-size-ui);
|
|
97
|
-
font-weight: var(--viking-font-weight-bold);
|
|
98
|
-
letter-spacing: var(--viking-letter-spacing-caps);
|
|
99
|
-
color: var(--viking-accent);
|
|
100
|
-
text-transform: uppercase;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.viking-whitepaper-title {
|
|
104
|
-
font-size: clamp(1.375rem, 3vw, 1.75rem);
|
|
105
|
-
font-weight: var(--viking-font-weight-bold);
|
|
106
|
-
margin: 0;
|
|
107
|
-
text-transform: uppercase;
|
|
108
|
-
letter-spacing: var(--viking-letter-spacing-tight);
|
|
109
|
-
color: var(--viking-text);
|
|
110
|
-
line-height: var(--viking-line-height-tight);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.viking-whitepaper-description {
|
|
114
|
-
color: var(--viking-text-muted);
|
|
115
|
-
margin: 0;
|
|
116
|
-
max-width: 30rem;
|
|
117
|
-
line-height: var(--viking-line-height-relaxed);
|
|
118
|
-
font-size: var(--viking-font-size);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.viking-whitepaper-btn {
|
|
122
|
-
margin-top: var(--viking-space-1);
|
|
123
|
-
color: var(--viking-accent-content);
|
|
124
|
-
|
|
125
|
-
&:hover,
|
|
126
|
-
&:focus-visible {
|
|
127
|
-
color: var(--viking-accent-content);
|
|
128
|
-
border-bottom-color: transparent;
|
|
129
|
-
}
|
|
130
|
-
}
|