@dataengineeringformachinelearning/viking-ui 4.0.3 → 4.0.5

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 +135 -70
  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 +98 -4
  11. package/dist/viking-components.css +161 -70
  12. package/dist/viking-tokens.json +9 -7
  13. package/dist/viking-ui-elements.js +45 -33
  14. package/dist/viking-ui.css +1 -1
  15. package/dist/web-components.js +46 -36
  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 -70
  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 -494
  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 -198
  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 -155
  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 -129
  146. package/src/lib/site-drakkar/site-navbar.scss +0 -2
  147. package/src/lib/site-drakkar/site-navbar.ts +0 -277
  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 -39
  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 -155
  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 -1215
  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 -922
  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 -270
  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 -70
  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 -494
  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,129 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- input,
5
- output,
6
- } from "@angular/core";
7
- import { RouterLink } from "@angular/router";
8
- import { VikingFooter } from "../footer/footer";
9
- import {
10
- cookieSettingsHref,
11
- DEFAULT_SITE_URLS,
12
- isAppRouterPath,
13
- resolveFooterHref,
14
- SITE_FOOTER_COLUMNS,
15
- SiteDrakkarContext,
16
- SiteFooterLink,
17
- SiteUrls,
18
- } from "./site-drakkar.config";
19
-
20
- /**
21
- * viking-site-footer — canonical site footer shared across DEML surfaces.
22
- */
23
- @Component({
24
- selector: "viking-site-footer",
25
- changeDetection: ChangeDetectionStrategy.OnPush,
26
- imports: [RouterLink, VikingFooter],
27
- template: `
28
- <viking-footer>
29
- <nav
30
- vikingFooterDirectory
31
- class="viking-footer-directory footer-directory"
32
- aria-label="Footer Directory"
33
- >
34
- @for (column of columns; track column.title) {
35
- <div class="footer-column">
36
- <h3 class="footer-column-title">{{ column.title }}</h3>
37
- <ul class="footer-list">
38
- @for (link of column.links; track link.label) {
39
- <li>
40
- @if (link.action === "cookie-settings") {
41
- @if (context() === "marketing") {
42
- <a href="#" (click)="onCookieSettings($event)">{{
43
- link.label
44
- }}</a>
45
- } @else {
46
- <a [href]="cookieSettingsUrl()">{{ link.label }}</a>
47
- }
48
- } @else if (link.action === "bug-report") {
49
- @if (context() === "app") {
50
- <a href="#" (click)="onBugReport($event)">{{
51
- link.label
52
- }}</a>
53
- } @else {
54
- <a [href]="resolveHref(link)">{{ link.label }}</a>
55
- }
56
- } @else if (context() === "app" && isAppRoute(link)) {
57
- <a [routerLink]="link.appHref">{{ link.label }}</a>
58
- } @else {
59
- <a [href]="resolveHref(link)">{{ link.label }}</a>
60
- }
61
- </li>
62
- }
63
- </ul>
64
- </div>
65
- }
66
- </nav>
67
-
68
- <ng-container vikingFooterBottom>
69
- <div class="footer-badges-top">
70
- <span
71
- class="usa-badge viking-usa-badge"
72
- id="usa-badge"
73
- (mouseenter)="usaBadgeHover.emit($event)"
74
- >
75
- <span
76
- class="usa-badge-icon viking-usa-badge-icon"
77
- aria-hidden="true"
78
- >🇺🇸</span
79
- >
80
- <span>Made in the U.S.A</span>
81
- </span>
82
- </div>
83
-
84
- <div class="footer-compliance-row">
85
- <div class="copyright-info">
86
- <span class="copyright-text">
87
- Copyright © {{ year() }} Data Engineering for Machine Learning by
88
- <a
89
- href="https://joealongi.dev/"
90
- target="_blank"
91
- rel="noopener noreferrer"
92
- >Joe Alongi</a
93
- >. All rights reserved.
94
- </span>
95
- </div>
96
- </div>
97
- </ng-container>
98
- </viking-footer>
99
- `,
100
- })
101
- export class VikingSiteFooter {
102
- readonly context = input<SiteDrakkarContext>("app");
103
- readonly urls = input<SiteUrls>(DEFAULT_SITE_URLS);
104
- readonly year = input<number>(new Date().getFullYear());
105
-
106
- readonly cookieSettings = output<Event>();
107
- readonly bugReport = output<Event>();
108
- readonly usaBadgeHover = output<MouseEvent>();
109
-
110
- protected readonly columns = SITE_FOOTER_COLUMNS;
111
-
112
- protected readonly cookieSettingsUrl = () => cookieSettingsHref(this.urls());
113
-
114
- protected resolveHref = (link: SiteFooterLink): string =>
115
- resolveFooterHref(link, this.context(), this.urls());
116
-
117
- protected isAppRoute = (link: SiteFooterLink): boolean =>
118
- !link.action && isAppRouterPath(link.appHref);
119
-
120
- protected onCookieSettings(event: Event): void {
121
- event.preventDefault();
122
- this.cookieSettings.emit(event);
123
- }
124
-
125
- protected onBugReport(event: Event): void {
126
- event.preventDefault();
127
- this.bugReport.emit(event);
128
- }
129
- }
@@ -1,2 +0,0 @@
1
- // Navbar styles live in static-navbar.scss (global viking-ui.css + app styles.scss).
2
- // ViewEncapsulation.None — do not @use static-navbar here (duplicates ~46kB into component budget).
@@ -1,277 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- ViewEncapsulation,
5
- computed,
6
- input,
7
- output,
8
- signal,
9
- } from "@angular/core";
10
- import { RouterLink, RouterLinkActive } from "@angular/router";
11
- import { VikingButton } from "../button/button";
12
- import { VikingIcon } from "../icon/icon";
13
- import { VikingThemeToggle } from "../theme-toggle/theme-toggle";
14
- import {
15
- DEFAULT_SITE_URLS,
16
- isAppRouterPath,
17
- resolveBrandHref,
18
- resolveNavHref,
19
- SITE_NAV_LINKS,
20
- SiteDrakkarContext,
21
- SiteUrls,
22
- visibleNavLinks,
23
- } from "./site-drakkar.config";
24
-
25
- /**
26
- * viking-site-navbar — canonical site header shared across DEML surfaces.
27
- * Uses `.navbar` markup + viking-ui.css (same structure as marketing/backend static HTML).
28
- */
29
- @Component({
30
- selector: "viking-site-navbar",
31
- changeDetection: ChangeDetectionStrategy.OnPush,
32
- encapsulation: ViewEncapsulation.None,
33
- imports: [
34
- RouterLink,
35
- RouterLinkActive,
36
- VikingButton,
37
- VikingIcon,
38
- VikingThemeToggle,
39
- ],
40
- styleUrl: "./site-navbar.scss",
41
- template: `
42
- <header class="navbar">
43
- <div class="navbar-content">
44
- <div class="navbar-left">
45
- @if (context() === "app") {
46
- <a
47
- [href]="brandHref()"
48
- class="navbar-brand"
49
- aria-label="Go to marketing homepage"
50
- (click)="onBrandClick($event)"
51
- >
52
- <viking-icon
53
- name="drakkar"
54
- [size]="28"
55
- color="accent"
56
- class="brand-icon navbar-logo"
57
- />
58
- </a>
59
- } @else {
60
- <a
61
- [href]="brandHref()"
62
- class="navbar-brand"
63
- aria-label="Go to homepage"
64
- >
65
- <viking-icon
66
- name="drakkar"
67
- [size]="28"
68
- color="accent"
69
- class="brand-icon navbar-logo"
70
- />
71
- </a>
72
- }
73
- </div>
74
-
75
- <nav class="navbar-center desktop-nav" aria-label="Main navigation">
76
- @for (link of navLinks(); track link.id) {
77
- @if (context() === "app" && isAppRouterPath(link.appHref)) {
78
- <a
79
- [routerLink]="link.appHref"
80
- routerLinkActive="active"
81
- [routerLinkActiveOptions]="{
82
- exact: link.appHref === '/explore',
83
- }"
84
- class="nav-btn"
85
- >
86
- <viking-icon [name]="link.icon" [size]="16" />
87
- <span>{{ link.label }}</span>
88
- </a>
89
- } @else {
90
- <a [href]="resolveHref(link)" class="nav-btn">
91
- <viking-icon [name]="link.icon" [size]="16" />
92
- <span>{{ link.label }}</span>
93
- </a>
94
- }
95
- }
96
- </nav>
97
-
98
- <div class="navbar-right">
99
- @if (showSearch()) {
100
- <div class="navbar-search" role="search">
101
- <viking-button
102
- variant="outline"
103
- [square]="true"
104
- [compact]="true"
105
- icon="search"
106
- label="Open search (⌘K)"
107
- (pressed)="openSearch()"
108
- />
109
- </div>
110
- }
111
-
112
- <div class="desktop-auth">
113
- @if (!isAuthenticated()) {
114
- <viking-button
115
- variant="primary"
116
- icon="arrow-right"
117
- class="auth-btn"
118
- [loading]="isBusy()"
119
- (pressed)="login.emit()"
120
- >
121
- Sign In
122
- </viking-button>
123
- } @else {
124
- <viking-button
125
- variant="primary"
126
- icon="home"
127
- class="auth-btn"
128
- [href]="urls().app + '/dashboard'"
129
- >
130
- Dashboard
131
- </viking-button>
132
- <viking-button
133
- variant="ghost"
134
- class="auth-btn auth-signout-btn"
135
- [loading]="isBusy()"
136
- (pressed)="logout.emit()"
137
- >Sign Out</viking-button
138
- >
139
- }
140
- </div>
141
-
142
- <viking-theme-toggle
143
- [theme]="theme()"
144
- (toggle)="themeToggle.emit()"
145
- />
146
-
147
- <viking-button
148
- variant="outline"
149
- [square]="true"
150
- class="menu-toggle-btn"
151
- [icon]="mobileMenuOpen() ? 'x' : 'menu'"
152
- [label]="
153
- mobileMenuOpen()
154
- ? 'Close navigation menu'
155
- : 'Toggle navigation menu'
156
- "
157
- (pressed)="toggleMobileMenu()"
158
- />
159
- </div>
160
- </div>
161
-
162
- <nav
163
- class="mobile-menu"
164
- [class.open]="mobileMenuOpen()"
165
- aria-label="Mobile navigation"
166
- >
167
- @for (link of navLinks(); track link.id + "-mobile") {
168
- @if (context() === "app" && isAppRouterPath(link.appHref)) {
169
- <a
170
- [routerLink]="link.appHref"
171
- routerLinkActive="active"
172
- [routerLinkActiveOptions]="{ exact: link.appHref === '/explore' }"
173
- class="mobile-nav-btn"
174
- (click)="closeMobileMenu()"
175
- >
176
- <viking-icon [name]="link.icon" [size]="16" />
177
- <span>{{ link.label }}</span>
178
- </a>
179
- } @else {
180
- <a
181
- [href]="resolveHref(link)"
182
- class="mobile-nav-btn"
183
- (click)="closeMobileMenu()"
184
- >
185
- <viking-icon [name]="link.icon" [size]="16" />
186
- <span>{{ link.label }}</span>
187
- </a>
188
- }
189
- }
190
-
191
- <div class="mobile-divider"></div>
192
-
193
- @if (!isAuthenticated()) {
194
- <viking-button
195
- variant="primary"
196
- icon="arrow-right"
197
- class="mobile-auth-btn auth-btn"
198
- [loading]="isBusy()"
199
- [fullWidth]="true"
200
- (pressed)="login.emit(); closeMobileMenu()"
201
- >
202
- Sign In
203
- </viking-button>
204
- } @else {
205
- <viking-button
206
- variant="primary"
207
- icon="home"
208
- class="mobile-auth-btn auth-btn"
209
- [fullWidth]="true"
210
- [href]="urls().app + '/dashboard'"
211
- (pressed)="closeMobileMenu()"
212
- >
213
- Dashboard
214
- </viking-button>
215
- <viking-button
216
- variant="ghost"
217
- class="mobile-auth-btn auth-btn auth-signout-btn"
218
- [loading]="isBusy()"
219
- [fullWidth]="true"
220
- (pressed)="logout.emit(); closeMobileMenu()"
221
- >
222
- Sign Out
223
- </viking-button>
224
- }
225
- </nav>
226
- </header>
227
- `,
228
- })
229
- export class VikingSiteNavbar {
230
- readonly context = input<SiteDrakkarContext>("app");
231
- readonly urls = input<SiteUrls>(DEFAULT_SITE_URLS);
232
- readonly isAuthenticated = input<boolean>(false);
233
- readonly isBusy = input<boolean>(false);
234
- readonly theme = input<"light" | "dark">("dark");
235
- readonly showSearch = input<boolean>(false);
236
-
237
- readonly login = output<void>();
238
- readonly logout = output<void>();
239
- readonly themeToggle = output<void>();
240
- readonly searchOpen = output<void>();
241
-
242
- protected readonly mobileMenuOpen = signal(false);
243
-
244
- protected readonly navLinks = computed(() =>
245
- visibleNavLinks(SITE_NAV_LINKS, this.isAuthenticated()),
246
- );
247
-
248
- protected readonly brandHref = computed(() =>
249
- resolveBrandHref(this.context(), this.urls()),
250
- );
251
-
252
- protected resolveHref = (link: (typeof SITE_NAV_LINKS)[number]): string =>
253
- resolveNavHref(link, this.context(), this.urls());
254
-
255
- protected isAppRouterPath = isAppRouterPath;
256
-
257
- protected onBrandClick(event: MouseEvent): void {
258
- event.preventDefault();
259
- window.location.href = this.brandHref();
260
- }
261
-
262
- protected toggleMobileMenu(): void {
263
- this.mobileMenuOpen.update((open) => !open);
264
- }
265
-
266
- protected closeMobileMenu(): void {
267
- this.mobileMenuOpen.set(false);
268
- }
269
-
270
- protected openSearch(): void {
271
- this.searchOpen.emit();
272
- const widgets = (
273
- globalThis as { DemlWidgets?: { openSearch?: () => void } }
274
- ).DemlWidgets;
275
- widgets?.openSearch?.();
276
- }
277
- }
@@ -1,61 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { buildSuiteSearchItems } from "./suite-search-items";
3
-
4
- const urls = {
5
- app: "https://deml.app",
6
- marketing: "https://dataengineeringformachinelearning.com",
7
- backend: "https://backend.deml.app",
8
- };
9
-
10
- describe("buildSuiteSearchItems", () => {
11
- it("includes platform navigation and legal links for marketing", () => {
12
- const items = buildSuiteSearchItems("marketing", urls);
13
- const titles = items.map((item) => item.title);
14
-
15
- expect(titles).toContain("Documentation");
16
- expect(titles).toContain("Whitepaper");
17
- expect(titles).toContain("Book");
18
- expect(titles).toContain("Privacy Policy");
19
- expect(titles).toContain("Terms of Service");
20
- expect(titles).toContain("SOC2 Compliance");
21
- expect(titles).toContain("Viking-UI Components");
22
- });
23
-
24
- it("resolves app routes for deml.app context", () => {
25
- const items = buildSuiteSearchItems("app", urls);
26
- const dashboard = items.find((item) => item.title === "Dashboard");
27
-
28
- expect(dashboard?.href).toBe("/dashboard");
29
- expect(items.some((item) => item.title === "Billing & subscription")).toBe(
30
- true,
31
- );
32
- });
33
-
34
- it("matches keyword search metadata", () => {
35
- const items = buildSuiteSearchItems("marketing", urls);
36
- const privacy = items.find((item) => item.title === "Privacy Policy");
37
-
38
- expect(
39
- privacy?.keywords?.some((keyword) => keyword.includes("privacy")),
40
- ).toBe(true);
41
- });
42
-
43
- it("includes Viking-UI docs entries for docs context", () => {
44
- const items = buildSuiteSearchItems("docs", urls, {
45
- docsOrigin: "https://ui.dataengineeringformachinelearning.com",
46
- });
47
- const titles = items.map((item) => item.title);
48
-
49
- expect(titles).toContain("Components");
50
- expect(titles).toContain("Playground");
51
- expect(titles).toContain("Whitepaper");
52
- expect(items.find((item) => item.title === "Components")?.href).toBe(
53
- "https://ui.dataengineeringformachinelearning.com/components",
54
- );
55
- });
56
-
57
- it("includes Settings shortcut for app context", () => {
58
- const items = buildSuiteSearchItems("app", urls);
59
- expect(items.some((item) => item.title === "Settings")).toBe(true);
60
- });
61
- });