@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.
Files changed (246) hide show
  1. package/README.md +35 -11
  2. package/dist/README.md +35 -11
  3. package/dist/design-tokens.css +300 -85
  4. package/dist/fesm2022/dataengineeringformachinelearning-viking-ui.mjs +100 -64
  5. package/dist/fesm2022/dataengineeringformachinelearning-viking-ui.mjs.map +1 -1
  6. package/dist/icons.js +306 -0
  7. package/dist/package.json +24 -5
  8. package/{src/lib/site-drakkar/site-drakkar.config.ts → dist/site-drakkar.js} +64 -130
  9. package/dist/src/tokens/viking-tokens.json +9 -7
  10. package/dist/types/dataengineeringformachinelearning-viking-ui.d.ts +97 -3
  11. package/dist/viking-components.css +161 -70
  12. package/dist/viking-tokens.json +9 -7
  13. package/dist/viking-ui-elements.js +44 -32
  14. package/dist/viking-ui.css +1 -1
  15. package/dist/web-components.js +44 -32
  16. package/package.json +30 -8
  17. package/dist/scripts/build-web-components.mjs +0 -37
  18. package/dist/src/web/badge/viking-badge-wc.ts +0 -116
  19. package/dist/src/web/button/viking-button-wc.ts +0 -165
  20. package/dist/src/web/callout/viking-callout-wc.ts +0 -105
  21. package/dist/src/web/card/viking-card-wc.ts +0 -67
  22. package/dist/src/web/core/base.ts +0 -56
  23. package/dist/src/web/core/dom.ts +0 -53
  24. package/dist/src/web/core/icons-inline.ts +0 -44
  25. package/dist/src/web/core/styles.ts +0 -1261
  26. package/dist/src/web/core/types.ts +0 -19
  27. package/dist/src/web/field/viking-field-wc.ts +0 -154
  28. package/dist/src/web/index.ts +0 -73
  29. package/dist/src/web/input/viking-input-wc.ts +0 -211
  30. package/dist/src/web/modal/viking-modal-wc.ts +0 -187
  31. package/dist/src/web/search-palette/viking-search-palette-wc.ts +0 -495
  32. package/dist/src/web/select/viking-select-wc.ts +0 -218
  33. package/dist/src/web/suite-header/viking-suite-header-wc.ts +0 -729
  34. package/dist/src/web/suite-search-palette/viking-suite-search-palette-wc.ts +0 -234
  35. package/dist/src/web/theme-toggle/viking-theme-toggle-wc.ts +0 -139
  36. package/dist/src/web/types.ts +0 -37
  37. package/dist/src/web/web-components.spec.ts +0 -297
  38. package/src/assets/drakkar-favicon.svg +0 -17
  39. package/src/assets/fonts/inter/InterVariable-Italic.woff2 +0 -0
  40. package/src/assets/fonts/inter/InterVariable.woff2 +0 -0
  41. package/src/core/brand/deml-lockup.svg +0 -5
  42. package/src/core/brand/deml-mark-compact.svg +0 -4
  43. package/src/core/brand/deml-mark-filled.svg +0 -3
  44. package/src/core/brand/deml-mark-outline.svg +0 -4
  45. package/src/core/brand-icons.ts +0 -62
  46. package/src/core/icons.spec.ts +0 -52
  47. package/src/core/icons.ts +0 -206
  48. package/src/core/integration-brand-icons.ts +0 -77
  49. package/src/core/lucide-paths.generated.ts +0 -130
  50. package/src/core/types.ts +0 -85
  51. package/src/core/uid.ts +0 -7
  52. package/src/elements/button/viking-button.ts +0 -201
  53. package/src/elements/card/viking-card.ts +0 -60
  54. package/src/elements/core/dom.ts +0 -33
  55. package/src/elements/core/styles.ts +0 -28
  56. package/src/elements/modal/viking-modal.ts +0 -154
  57. package/src/index.ts +0 -1
  58. package/src/lib/accordion/accordion.ts +0 -126
  59. package/src/lib/app-header/app-header.scss +0 -274
  60. package/src/lib/app-header/app-header.ts +0 -43
  61. package/src/lib/app-sidebar/app-sidebar.scss +0 -415
  62. package/src/lib/app-sidebar/app-sidebar.ts +0 -29
  63. package/src/lib/auth-panel/auth-panel.spec.ts +0 -132
  64. package/src/lib/auth-panel/auth-panel.ts +0 -228
  65. package/src/lib/autocomplete/autocomplete.ts +0 -223
  66. package/src/lib/avatar/avatar.ts +0 -126
  67. package/src/lib/badge/badge.ts +0 -182
  68. package/src/lib/bar/bar.ts +0 -31
  69. package/src/lib/brand/brand.ts +0 -60
  70. package/src/lib/breadcrumbs/breadcrumbs.ts +0 -81
  71. package/src/lib/button/button-group.ts +0 -40
  72. package/src/lib/button/button.scss +0 -119
  73. package/src/lib/button/button.ts +0 -98
  74. package/src/lib/calendar/calendar.ts +0 -253
  75. package/src/lib/callout/callout.ts +0 -211
  76. package/src/lib/card/card-title.spec.ts +0 -27
  77. package/src/lib/card/card-title.ts +0 -50
  78. package/src/lib/card/card.ts +0 -200
  79. package/src/lib/carousel/carousel.ts +0 -206
  80. package/src/lib/chart/chart-zoom.spec.ts +0 -65
  81. package/src/lib/chart/chart-zoom.ts +0 -71
  82. package/src/lib/chart/chart.ts +0 -1257
  83. package/src/lib/chart-card-header/chart-card-header.ts +0 -80
  84. package/src/lib/chart-empty-state/chart-empty-state.ts +0 -146
  85. package/src/lib/chart-panel/chart-panel.ts +0 -133
  86. package/src/lib/checkbox/checkbox.ts +0 -139
  87. package/src/lib/color-picker/color-picker.ts +0 -148
  88. package/src/lib/command/command.ts +0 -260
  89. package/src/lib/composer/composer.ts +0 -180
  90. package/src/lib/confirm-dialog/confirm-dialog.ts +0 -163
  91. package/src/lib/confirm-dialog/dialog.service.ts +0 -79
  92. package/src/lib/context/context.ts +0 -75
  93. package/src/lib/core/brand-icons.ts +0 -62
  94. package/src/lib/core/cva.ts +0 -33
  95. package/src/lib/core/icons.ts +0 -206
  96. package/src/lib/core/integration-brand-icons.ts +0 -77
  97. package/src/lib/core/lucide-paths.generated.ts +0 -130
  98. package/src/lib/date-picker/date-picker.ts +0 -139
  99. package/src/lib/dropdown/dropdown.ts +0 -188
  100. package/src/lib/editor/editor.ts +0 -170
  101. package/src/lib/empty-state/empty-state.ts +0 -100
  102. package/src/lib/fab/fab.ts +0 -76
  103. package/src/lib/field/field.ts +0 -111
  104. package/src/lib/file-upload/file-upload.ts +0 -208
  105. package/src/lib/footer/footer.scss +0 -162
  106. package/src/lib/footer/footer.ts +0 -28
  107. package/src/lib/form-section/form-section.ts +0 -200
  108. package/src/lib/forms.spec.ts +0 -92
  109. package/src/lib/gauge-arc/gauge-arc.ts +0 -85
  110. package/src/lib/hud-panel/hud-panel.ts +0 -27
  111. package/src/lib/icon/icon.ts +0 -284
  112. package/src/lib/icon-badge/icon-badge.ts +0 -87
  113. package/src/lib/icon-heading/icon-heading.spec.ts +0 -32
  114. package/src/lib/icon-heading/icon-heading.ts +0 -38
  115. package/src/lib/icon-text/icon-text.ts +0 -120
  116. package/src/lib/input/input.ts +0 -119
  117. package/src/lib/kanban/kanban.ts +0 -211
  118. package/src/lib/kbd/kbd.ts +0 -32
  119. package/src/lib/label/label.ts +0 -39
  120. package/src/lib/loading-overlay/loading-overlay.ts +0 -80
  121. package/src/lib/menubar/menubar.ts +0 -77
  122. package/src/lib/metric-card/metric-card.ts +0 -33
  123. package/src/lib/modal/modal.ts +0 -207
  124. package/src/lib/native-select/native-select.ts +0 -124
  125. package/src/lib/navbar/navbar.ts +0 -124
  126. package/src/lib/navigation-menu/navigation-menu.ts +0 -116
  127. package/src/lib/otp-input/otp-input.ts +0 -164
  128. package/src/lib/page-back-link/page-back-link.ts +0 -74
  129. package/src/lib/page-header/page-header.ts +0 -70
  130. package/src/lib/pagination/pagination.ts +0 -157
  131. package/src/lib/pillbox/pillbox.ts +0 -157
  132. package/src/lib/popover/popover.ts +0 -92
  133. package/src/lib/profile/profile.ts +0 -73
  134. package/src/lib/progress/progress.ts +0 -123
  135. package/src/lib/radio/radio.ts +0 -132
  136. package/src/lib/ring-gauge/ring-gauge.ts +0 -75
  137. package/src/lib/scroll-area/scroll-area.ts +0 -57
  138. package/src/lib/search-palette/search-palette.scss +0 -288
  139. package/src/lib/search-palette/search-palette.ts +0 -114
  140. package/src/lib/select/select.ts +0 -292
  141. package/src/lib/separator/separator.ts +0 -59
  142. package/src/lib/sheet/sheet.ts +0 -192
  143. package/src/lib/sidebar-nav/sidebar-nav.scss +0 -218
  144. package/src/lib/sidebar-nav/sidebar-nav.ts +0 -158
  145. package/src/lib/site-drakkar/site-footer.ts +0 -133
  146. package/src/lib/site-drakkar/site-navbar.scss +0 -2
  147. package/src/lib/site-drakkar/site-navbar.ts +0 -286
  148. package/src/lib/site-drakkar/suite-search-items.spec.ts +0 -61
  149. package/src/lib/site-drakkar/suite-search-items.ts +0 -246
  150. package/src/lib/skeleton/skeleton.ts +0 -51
  151. package/src/lib/slider/slider.ts +0 -133
  152. package/src/lib/spinner/spinner.ts +0 -75
  153. package/src/lib/status-metric-row/status-metric-row.ts +0 -74
  154. package/src/lib/suite-search-palette/suite-search-palette.ts +0 -95
  155. package/src/lib/switch/switch.ts +0 -131
  156. package/src/lib/table/table.ts +0 -137
  157. package/src/lib/tabs/tab-panel.ts +0 -61
  158. package/src/lib/tabs/tab.ts +0 -107
  159. package/src/lib/tabs/tabs.ts +0 -109
  160. package/src/lib/textarea/textarea.ts +0 -103
  161. package/src/lib/theme-toggle/theme-toggle.spec.ts +0 -40
  162. package/src/lib/theme-toggle/theme-toggle.ts +0 -40
  163. package/src/lib/time-picker/time-picker.ts +0 -197
  164. package/src/lib/timeline/timeline.ts +0 -152
  165. package/src/lib/toast/toast.ts +0 -196
  166. package/src/lib/toggle/toggle-group.ts +0 -60
  167. package/src/lib/toggle/toggle.ts +0 -101
  168. package/src/lib/tooltip/tooltip.ts +0 -119
  169. package/src/lib/typography/heading.ts +0 -52
  170. package/src/lib/typography/text.ts +0 -51
  171. package/src/lib/uptime-bar/uptime-bar.ts +0 -55
  172. package/src/lib/verification-code-field/verification-code-field.ts +0 -149
  173. package/src/lib/whitepaper-cta/whitepaper-cta.scss +0 -130
  174. package/src/lib/whitepaper-cta/whitepaper-cta.ts +0 -78
  175. package/src/lib/wizard/wizard.ts +0 -80
  176. package/src/public-api.ts +0 -172
  177. package/src/styles/_buttons.scss +0 -386
  178. package/src/styles/_component-primitives.scss +0 -183
  179. package/src/styles/_drakkar-buttons.scss +0 -85
  180. package/src/styles/_fonts.scss +0 -22
  181. package/src/styles/_forms.scss +0 -66
  182. package/src/styles/_input.scss +0 -106
  183. package/src/styles/_layout-enforcement.scss +0 -229
  184. package/src/styles/_layout-rhythm.scss +0 -158
  185. package/src/styles/_legacy-aliases.scss +0 -212
  186. package/src/styles/_series-colors.scss +0 -24
  187. package/src/styles/_static-primitives.scss +0 -857
  188. package/src/styles/_typography.scss +0 -87
  189. package/src/styles/_variables.scss +0 -527
  190. package/src/styles/components/a11y.scss +0 -90
  191. package/src/styles/components/badges.scss +0 -102
  192. package/src/styles/components/extracted-utilities.scss +0 -459
  193. package/src/styles/components/footer.scss +0 -168
  194. package/src/styles/components/icon-heading.scss +0 -47
  195. package/src/styles/components/icon-inline.scss +0 -101
  196. package/src/styles/components/layout.scss +0 -59
  197. package/src/styles/components/utilities.scss +0 -131
  198. package/src/styles/components/viking-inspired.scss +0 -204
  199. package/src/styles/components/whitepaper-cta.scss +0 -130
  200. package/src/styles/components-bundle.scss +0 -9
  201. package/src/styles/components.scss +0 -442
  202. package/src/styles/deml-components.scss +0 -10
  203. package/src/styles/index.scss +0 -8
  204. package/src/styles/layout-shell.scss +0 -111
  205. package/src/styles/page-shell.scss +0 -859
  206. package/src/styles/static-navbar.scss +0 -1250
  207. package/src/styles/surfaces/backend.scss +0 -154
  208. package/src/styles/surfaces/docs-global.scss +0 -73
  209. package/src/styles/surfaces/docs-shell.scss +0 -437
  210. package/src/styles/surfaces/docs-showcase.scss +0 -1153
  211. package/src/styles/surfaces/marketing-cta.scss +0 -62
  212. package/src/styles/surfaces/marketing-docs-bento.scss +0 -67
  213. package/src/styles/surfaces/marketing-global.scss +0 -748
  214. package/src/styles/surfaces/marketing-landing.scss +0 -1526
  215. package/src/styles/surfaces/marketing-publication.scss +0 -535
  216. package/src/styles/surfaces/marketing-theme.scss +0 -14
  217. package/src/styles/surfaces/swagger-ui.scss +0 -1013
  218. package/src/styles/tokens-export.scss +0 -18
  219. package/src/styles/tokens.scss +0 -5
  220. package/src/styles/viking-ui-bundle.scss +0 -23
  221. package/src/styles/viking-ui.scss +0 -272
  222. package/src/tokens/series-presets.ts +0 -15
  223. package/src/tokens/tailwind.preset.js +0 -209
  224. package/src/tokens/viking-tokens.json +0 -318
  225. package/src/viking-ui.spec.ts +0 -416
  226. package/src/web/badge/viking-badge-wc.ts +0 -116
  227. package/src/web/button/viking-button-wc.ts +0 -165
  228. package/src/web/callout/viking-callout-wc.ts +0 -105
  229. package/src/web/card/viking-card-wc.ts +0 -67
  230. package/src/web/core/base.ts +0 -56
  231. package/src/web/core/dom.ts +0 -53
  232. package/src/web/core/icons-inline.ts +0 -44
  233. package/src/web/core/styles.ts +0 -1261
  234. package/src/web/core/types.ts +0 -19
  235. package/src/web/field/viking-field-wc.ts +0 -154
  236. package/src/web/index.ts +0 -73
  237. package/src/web/input/viking-input-wc.ts +0 -211
  238. package/src/web/modal/viking-modal-wc.ts +0 -187
  239. package/src/web/search-palette/viking-search-palette-wc.ts +0 -495
  240. package/src/web/select/viking-select-wc.ts +0 -218
  241. package/src/web/suite-header/viking-suite-header-wc.ts +0 -729
  242. package/src/web/suite-search-palette/viking-suite-search-palette-wc.ts +0 -234
  243. package/src/web/theme-toggle/viking-theme-toggle-wc.ts +0 -139
  244. package/src/web/types.ts +0 -37
  245. package/src/web/web-components.spec.ts +0 -297
  246. package/src/web-components/index.ts +0 -1
@@ -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
- }