@dataengineeringformachinelearning/viking-ui 1.0.2 → 3.0.0-alpha.2

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 (129) hide show
  1. package/README.md +180 -41
  2. package/dist/deml-components.css +1122 -0
  3. package/dist/design-tokens.css +688 -0
  4. package/dist/elements/button/viking-button.d.ts +14 -0
  5. package/dist/elements/card/viking-card.d.ts +8 -0
  6. package/dist/elements/core/dom.d.ts +4 -0
  7. package/dist/elements/core/styles.d.ts +2 -0
  8. package/dist/elements/modal/viking-modal.d.ts +15 -0
  9. package/dist/fonts/inter/InterVariable-Italic.woff2 +0 -0
  10. package/dist/fonts/inter/InterVariable.woff2 +0 -0
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +4051 -0
  13. package/dist/lib/core/brand-icons.d.ts +29 -0
  14. package/dist/lib/core/icons.d.ts +132 -0
  15. package/dist/lib/core/integration-brand-icons.d.ts +18 -0
  16. package/dist/lib/core/lucide-paths.generated.d.ts +90 -0
  17. package/dist/lib/site-drakkar/site-drakkar.config.d.ts +50 -0
  18. package/dist/lib/site-drakkar/suite-search-items.d.ts +17 -0
  19. package/dist/viking-components.css +1837 -0
  20. package/dist/viking-tokens.json +318 -0
  21. package/dist/viking-ui-elements.js +1750 -0
  22. package/dist/viking-ui.css +1 -0
  23. package/dist/web/badge/viking-badge-wc.d.ts +28 -0
  24. package/dist/web/button/viking-button-wc.d.ts +28 -0
  25. package/dist/web/callout/viking-callout-wc.d.ts +27 -0
  26. package/dist/web/card/viking-card-wc.d.ts +29 -0
  27. package/dist/web/core/base.d.ts +12 -0
  28. package/dist/web/core/dom.d.ts +11 -0
  29. package/dist/web/core/icons-inline.d.ts +7 -0
  30. package/dist/web/core/styles.d.ts +12 -0
  31. package/dist/web/core/types.d.ts +10 -0
  32. package/dist/web/field/viking-field-wc.d.ts +32 -0
  33. package/dist/web/index.d.ts +15 -0
  34. package/dist/web/input/viking-input-wc.d.ts +32 -0
  35. package/dist/web/modal/viking-modal-wc.d.ts +50 -0
  36. package/dist/web/search-palette/viking-search-palette-wc.d.ts +64 -0
  37. package/dist/web/select/viking-select-wc.d.ts +48 -0
  38. package/dist/web/suite-header/viking-suite-header-wc.d.ts +36 -0
  39. package/dist/web/suite-search-palette/viking-suite-search-palette-wc.d.ts +39 -0
  40. package/dist/web/theme-toggle/viking-theme-toggle-wc.d.ts +19 -0
  41. package/dist/web/types.d.ts +40 -0
  42. package/dist/web-components/index.d.ts +1 -0
  43. package/dist/web-components.js +1750 -0
  44. package/dist/widget.js +1182 -0
  45. package/package.json +89 -30
  46. package/src/assets/fonts/inter/InterVariable-Italic.woff2 +0 -0
  47. package/src/assets/fonts/inter/InterVariable.woff2 +0 -0
  48. package/src/elements/button/viking-button.ts +201 -0
  49. package/src/elements/card/viking-card.ts +60 -0
  50. package/src/elements/core/dom.ts +33 -0
  51. package/src/elements/core/styles.ts +28 -0
  52. package/src/elements/modal/viking-modal.ts +154 -0
  53. package/src/index.ts +1 -0
  54. package/src/lib/core/brand-icons.ts +62 -0
  55. package/src/lib/core/icons.ts +206 -0
  56. package/src/lib/core/integration-brand-icons.ts +77 -0
  57. package/src/lib/core/lucide-paths.generated.ts +130 -0
  58. package/src/lib/site-drakkar/site-drakkar.config.ts +295 -0
  59. package/src/lib/site-drakkar/suite-search-items.ts +246 -0
  60. package/src/styles/_buttons.scss +301 -0
  61. package/src/styles/_component-primitives.scss +183 -0
  62. package/src/styles/_drakkar-buttons.scss +85 -0
  63. package/src/styles/_fonts.scss +22 -0
  64. package/src/styles/_forms.scss +66 -0
  65. package/src/styles/_input.scss +106 -0
  66. package/src/styles/_layout-enforcement.scss +166 -0
  67. package/src/styles/_layout-rhythm.scss +158 -0
  68. package/src/styles/_legacy-aliases.scss +212 -0
  69. package/src/styles/_series-colors.scss +24 -0
  70. package/src/styles/_static-primitives.scss +857 -0
  71. package/src/styles/_typography.scss +87 -0
  72. package/src/styles/_variables.scss +527 -0
  73. package/src/styles/components/a11y.scss +90 -0
  74. package/src/styles/components/badges.scss +102 -0
  75. package/src/styles/components/extracted-utilities.scss +459 -0
  76. package/src/styles/components/footer.scss +155 -0
  77. package/src/styles/components/icon-heading.scss +47 -0
  78. package/src/styles/components/icon-inline.scss +78 -0
  79. package/src/styles/components/layout.scss +59 -0
  80. package/src/styles/components/utilities.scss +131 -0
  81. package/src/styles/components/viking-inspired.scss +204 -0
  82. package/src/styles/components/whitepaper-cta.scss +130 -0
  83. package/src/styles/components-bundle.scss +9 -0
  84. package/src/styles/components.scss +175 -0
  85. package/src/styles/deml-components.scss +10 -0
  86. package/src/styles/index.scss +8 -0
  87. package/src/styles/layout-shell.scss +39 -11
  88. package/src/styles/page-shell.scss +663 -33
  89. package/src/styles/static-navbar.scss +862 -146
  90. package/src/styles/surfaces/backend.scss +142 -0
  91. package/src/styles/surfaces/docs-global.scss +73 -0
  92. package/src/styles/surfaces/docs-shell.scss +412 -0
  93. package/src/styles/surfaces/docs-showcase.scss +1051 -0
  94. package/src/styles/surfaces/marketing-cta.scss +62 -0
  95. package/src/styles/surfaces/marketing-docs-bento.scss +67 -0
  96. package/src/styles/surfaces/marketing-global.scss +748 -0
  97. package/src/styles/surfaces/marketing-landing.scss +1260 -0
  98. package/src/styles/surfaces/marketing-publication.scss +535 -0
  99. package/src/styles/surfaces/marketing-theme.scss +14 -0
  100. package/src/styles/surfaces/swagger-ui.scss +921 -0
  101. package/src/styles/tokens-export.scss +18 -0
  102. package/src/styles/tokens.scss +5 -0
  103. package/src/styles/viking-ui-bundle.scss +20 -2
  104. package/src/styles/viking-ui.scss +213 -51
  105. package/src/tokens/viking-tokens.json +318 -0
  106. package/src/web/badge/viking-badge-wc.ts +116 -0
  107. package/src/web/button/viking-button-wc.ts +165 -0
  108. package/src/web/callout/viking-callout-wc.ts +105 -0
  109. package/src/web/card/viking-card-wc.ts +66 -0
  110. package/src/web/core/base.ts +56 -0
  111. package/src/web/core/dom.ts +53 -0
  112. package/src/web/core/icons-inline.ts +44 -0
  113. package/src/web/core/styles.ts +1138 -0
  114. package/src/web/core/types.ts +19 -0
  115. package/src/web/field/viking-field-wc.ts +154 -0
  116. package/src/web/index.ts +73 -0
  117. package/src/web/input/viking-input-wc.ts +211 -0
  118. package/src/web/modal/viking-modal-wc.ts +187 -0
  119. package/src/web/search-palette/viking-search-palette-wc.ts +494 -0
  120. package/src/web/select/viking-select-wc.ts +218 -0
  121. package/src/web/suite-header/viking-suite-header-wc.ts +714 -0
  122. package/src/web/suite-search-palette/viking-suite-search-palette-wc.ts +234 -0
  123. package/src/web/theme-toggle/viking-theme-toggle-wc.ts +139 -0
  124. package/src/web/types.ts +37 -0
  125. package/src/web-components/index.ts +1 -0
  126. package/fesm2022/dataengineeringformachinelearning-viking-ui.mjs +0 -6114
  127. package/fesm2022/dataengineeringformachinelearning-viking-ui.mjs.map +0 -1
  128. package/types/dataengineeringformachinelearning-viking-ui.d.ts +0 -1397
  129. package/viking.manifest.json +0 -238
@@ -0,0 +1,295 @@
1
+ import { VikingIconName } from "../core/icons";
2
+
3
+ /**
4
+ * Drakkar — the Viking longship that carries the site shell (navbar, footer, nav links)
5
+ * across marketing, app, and backend surfaces.
6
+ */
7
+
8
+ /** Which DEML surface the Drakkar shell is rendering on (navbar + footer). */
9
+ export type SiteDrakkarContext = "app" | "marketing" | "backend" | "docs";
10
+
11
+ export interface SiteUrls {
12
+ app: string;
13
+ marketing: string;
14
+ backend: string;
15
+ }
16
+
17
+ export interface SiteNavLink {
18
+ id: string;
19
+ label: string;
20
+ icon: VikingIconName;
21
+ appHref: string;
22
+ marketingHref: string;
23
+ external?: boolean;
24
+ requireAuth?: boolean;
25
+ /** Routes served by deml.app — resolved to absolute app URLs off-app. */
26
+ platform?: boolean;
27
+ }
28
+
29
+ export interface SiteFooterLink {
30
+ label: string;
31
+ appHref: string;
32
+ marketingHref: string;
33
+ external?: boolean;
34
+ action?: "cookie-settings" | "bug-report";
35
+ /** Routes served by deml.app — resolved to absolute app URLs off-app. */
36
+ platform?: boolean;
37
+ }
38
+
39
+ export interface SiteFooterColumn {
40
+ title: string;
41
+ links: SiteFooterLink[];
42
+ }
43
+
44
+ /** Primary navbar links (desktop + mobile). Shown on every surface. */
45
+ export const SITE_NAV_LINKS: readonly SiteNavLink[] = [
46
+ {
47
+ id: "explore",
48
+ label: "Explore",
49
+ icon: "globe",
50
+ appHref: "/explore",
51
+ marketingHref: "/explore",
52
+ platform: true,
53
+ },
54
+ {
55
+ id: "documentation",
56
+ label: "Documentation",
57
+ icon: "file",
58
+ appHref: "https://dataengineeringformachinelearning.com/documentation/",
59
+ marketingHref: "/documentation",
60
+ },
61
+ {
62
+ id: "dashboard",
63
+ label: "Dashboard",
64
+ icon: "home",
65
+ appHref: "/dashboard",
66
+ marketingHref: "/dashboard",
67
+ requireAuth: true,
68
+ platform: true,
69
+ },
70
+ {
71
+ id: "sites",
72
+ label: "Sites",
73
+ icon: "building",
74
+ appHref: "/settings",
75
+ marketingHref: "/settings",
76
+ requireAuth: true,
77
+ platform: true,
78
+ },
79
+ {
80
+ id: "account",
81
+ label: "Account",
82
+ icon: "user",
83
+ appHref: "/account",
84
+ marketingHref: "/account",
85
+ requireAuth: true,
86
+ platform: true,
87
+ },
88
+ ] as const;
89
+
90
+ export const SITE_FOOTER_COLUMNS: readonly SiteFooterColumn[] = [
91
+ {
92
+ title: "Platform",
93
+ links: [
94
+ {
95
+ label: "Explore",
96
+ appHref: "/explore",
97
+ marketingHref: "/explore",
98
+ platform: true,
99
+ },
100
+ {
101
+ label: "Dashboard",
102
+ appHref: "/dashboard",
103
+ marketingHref: "/dashboard",
104
+ platform: true,
105
+ },
106
+ {
107
+ label: "Sites",
108
+ appHref: "/settings",
109
+ marketingHref: "/settings",
110
+ platform: true,
111
+ },
112
+ {
113
+ label: "Account",
114
+ appHref: "/account",
115
+ marketingHref: "/account",
116
+ platform: true,
117
+ },
118
+ {
119
+ label: "Platform Status",
120
+ appHref: "/status/platform-status",
121
+ marketingHref: "/status/platform-status",
122
+ platform: true,
123
+ },
124
+ ],
125
+ },
126
+ {
127
+ title: "Resources",
128
+ links: [
129
+ {
130
+ label: "Documentation",
131
+ appHref: "https://dataengineeringformachinelearning.com/documentation/",
132
+ marketingHref: "/documentation",
133
+ },
134
+ {
135
+ label: "Whitepaper",
136
+ appHref: "https://dataengineeringformachinelearning.com/whitepaper/",
137
+ marketingHref: "/whitepaper",
138
+ },
139
+ {
140
+ label: "Book",
141
+ appHref: "https://dataengineeringformachinelearning.com/book/",
142
+ marketingHref: "/book",
143
+ },
144
+ ],
145
+ },
146
+ {
147
+ title: "Support",
148
+ links: [
149
+ {
150
+ label: "Platform Status",
151
+ appHref: "/status/platform-status",
152
+ marketingHref: "/status/platform-status",
153
+ platform: true,
154
+ },
155
+ {
156
+ label: "Report a Bug",
157
+ appHref: "#",
158
+ marketingHref: "#",
159
+ action: "bug-report",
160
+ },
161
+ ],
162
+ },
163
+ {
164
+ title: "Legal & Compliance",
165
+ links: [
166
+ {
167
+ label: "Privacy Policy",
168
+ appHref: "https://dataengineeringformachinelearning.com/privacy/",
169
+ marketingHref: "/privacy",
170
+ },
171
+ {
172
+ label: "Terms of Service",
173
+ appHref: "https://dataengineeringformachinelearning.com/terms/",
174
+ marketingHref: "/terms",
175
+ },
176
+ {
177
+ label: "SOC2 Compliance",
178
+ appHref: "https://dataengineeringformachinelearning.com/compliance/",
179
+ marketingHref: "/compliance",
180
+ },
181
+ {
182
+ label: "GDPR Compliance",
183
+ appHref: "https://dataengineeringformachinelearning.com/privacy/#gdpr",
184
+ marketingHref: "/privacy#gdpr",
185
+ },
186
+ {
187
+ label: "Cookie Settings",
188
+ appHref: "#",
189
+ marketingHref: "#",
190
+ action: "cookie-settings",
191
+ },
192
+ ],
193
+ },
194
+ ] as const;
195
+
196
+ export const BUG_REPORT_QUERY = "reportBug=1";
197
+ export const COOKIE_SETTINGS_QUERY = "cookieSettings=1";
198
+
199
+ const isAbsoluteUrl = (href: string): boolean => /^https?:\/\//i.test(href);
200
+
201
+ const joinBase = (base: string, path: string): string => {
202
+ if (isAbsoluteUrl(path)) {
203
+ return path;
204
+ }
205
+ const normalizedBase = base.replace(/\/$/, "");
206
+ const normalizedPath = path.startsWith("/") ? path : `/${path}`;
207
+ return `${normalizedBase}${normalizedPath}`;
208
+ };
209
+
210
+ export const bugReportHref = (urls: SiteUrls): string =>
211
+ `${joinBase(urls.app, "/")}?${BUG_REPORT_QUERY}`;
212
+
213
+ export const cookieSettingsHref = (urls: SiteUrls): string =>
214
+ `${joinBase(urls.marketing, "/")}?${COOKIE_SETTINGS_QUERY}`;
215
+
216
+ const resolveMarketingContentHref = (href: string, urls: SiteUrls): string => {
217
+ if (isAbsoluteUrl(href)) {
218
+ return href;
219
+ }
220
+ if (href.startsWith("mailto:")) {
221
+ return href;
222
+ }
223
+ return href.startsWith("/") ? href : joinBase(urls.marketing, href);
224
+ };
225
+
226
+ const resolvePlatformHref = (
227
+ href: string,
228
+ context: SiteDrakkarContext,
229
+ urls: SiteUrls,
230
+ ): string => {
231
+ if (context === "app") {
232
+ return href;
233
+ }
234
+ return joinBase(urls.app, href);
235
+ };
236
+
237
+ export const resolveNavHref = (
238
+ link: SiteNavLink,
239
+ context: SiteDrakkarContext,
240
+ urls: SiteUrls,
241
+ ): string => {
242
+ if (link.platform) {
243
+ return resolvePlatformHref(link.appHref, context, urls);
244
+ }
245
+ if (context === "app") {
246
+ return link.appHref;
247
+ }
248
+ return resolveMarketingContentHref(link.marketingHref, urls);
249
+ };
250
+
251
+ export const resolveFooterHref = (
252
+ link: SiteFooterLink,
253
+ context: SiteDrakkarContext,
254
+ urls: SiteUrls,
255
+ ): string => {
256
+ if (link.action === "bug-report") {
257
+ return context === "app" ? "#" : bugReportHref(urls);
258
+ }
259
+ if (link.action === "cookie-settings") {
260
+ return cookieSettingsHref(urls);
261
+ }
262
+ if (link.platform) {
263
+ return resolvePlatformHref(link.appHref, context, urls);
264
+ }
265
+ if (context === "app") {
266
+ return link.appHref;
267
+ }
268
+ return resolveMarketingContentHref(link.marketingHref, urls);
269
+ };
270
+
271
+ export const resolveBrandHref = (
272
+ context: SiteDrakkarContext,
273
+ urls: SiteUrls,
274
+ ): string => {
275
+ if (context === "marketing") {
276
+ return "/";
277
+ }
278
+ return urls.marketing;
279
+ };
280
+
281
+ /** Navbar links; auth-gated entries appear only when the session is active. */
282
+ export const visibleNavLinks = (
283
+ links: readonly SiteNavLink[],
284
+ isAuthenticated = false,
285
+ ): SiteNavLink[] =>
286
+ links.filter((link) => !link.requireAuth || isAuthenticated);
287
+
288
+ export const isAppRouterPath = (href: string): boolean =>
289
+ !isAbsoluteUrl(href) && href.startsWith("/");
290
+
291
+ export const DEFAULT_SITE_URLS: SiteUrls = {
292
+ app: "https://deml.app",
293
+ marketing: "https://dataengineeringformachinelearning.com",
294
+ backend: "https://backend.deml.app",
295
+ };
@@ -0,0 +1,246 @@
1
+ import type {
2
+ SiteDrakkarContext,
3
+ SiteFooterLink,
4
+ SiteNavLink,
5
+ SiteUrls,
6
+ } from "./site-drakkar.config";
7
+ import {
8
+ SITE_FOOTER_COLUMNS,
9
+ SITE_NAV_LINKS,
10
+ bugReportHref,
11
+ cookieSettingsHref,
12
+ resolveFooterHref,
13
+ resolveNavHref,
14
+ } from "./site-drakkar.config";
15
+
16
+ /** Curated command-palette entry for cross-surface navigation. */
17
+ export type SuiteSearchItem = {
18
+ title: string;
19
+ href: string;
20
+ snippet?: string;
21
+ group?: string;
22
+ keywords?: string[];
23
+ action?: "cookie-settings" | "bug-report";
24
+ };
25
+
26
+ const dedupeItems = (items: SuiteSearchItem[]): SuiteSearchItem[] => {
27
+ const seen = new Set<string>();
28
+ return items.filter((item) => {
29
+ const key = `${item.title}:${item.href}:${item.action ?? ""}`;
30
+ if (seen.has(key)) {
31
+ return false;
32
+ }
33
+ seen.add(key);
34
+ return true;
35
+ });
36
+ };
37
+
38
+ const navItem = (
39
+ link: SiteNavLink,
40
+ context: SiteDrakkarContext,
41
+ urls: SiteUrls,
42
+ ): SuiteSearchItem => ({
43
+ title: link.label,
44
+ href: resolveNavHref(link, context, urls),
45
+ snippet: `Open ${link.label}`,
46
+ group: "Platform",
47
+ keywords: [link.id, link.label.toLowerCase(), "navigate", "go"],
48
+ });
49
+
50
+ const footerItem = (
51
+ link: SiteFooterLink,
52
+ columnTitle: string,
53
+ context: SiteDrakkarContext,
54
+ urls: SiteUrls,
55
+ ): SuiteSearchItem => {
56
+ if (link.action === "cookie-settings") {
57
+ return {
58
+ title: link.label,
59
+ href: cookieSettingsHref(urls),
60
+ snippet: "Manage analytics and cookie preferences",
61
+ group: columnTitle,
62
+ keywords: ["cookies", "consent", "privacy", "gdpr"],
63
+ action: "cookie-settings",
64
+ };
65
+ }
66
+
67
+ if (link.action === "bug-report") {
68
+ return {
69
+ title: link.label,
70
+ href: context === "app" ? "#" : bugReportHref(urls),
71
+ snippet: "Submit a product issue or regression",
72
+ group: columnTitle,
73
+ keywords: ["bug", "issue", "support", "feedback"],
74
+ action: "bug-report",
75
+ };
76
+ }
77
+
78
+ return {
79
+ title: link.label,
80
+ href: resolveFooterHref(link, context, urls),
81
+ snippet: `Open ${link.label}`,
82
+ group: columnTitle,
83
+ keywords: [link.label.toLowerCase(), columnTitle.toLowerCase()],
84
+ };
85
+ };
86
+
87
+ /** Static entries that are not derived from Drakkar nav/footer config. */
88
+ const SUITE_SEARCH_EXTRAS: readonly Omit<SuiteSearchItem, "href">[] = [
89
+ {
90
+ title: "Viking-UI Components",
91
+ snippet: "Browse the design system showcase",
92
+ group: "Resources",
93
+ keywords: ["viking", "ui", "design system", "components", "showcase"],
94
+ },
95
+ {
96
+ title: "Design tokens",
97
+ snippet: "Canonical --viking-* token matrix",
98
+ group: "Resources",
99
+ keywords: ["tokens", "theme", "css", "variables"],
100
+ },
101
+ {
102
+ title: "API reference",
103
+ snippet: "OpenAPI schema and REST endpoints",
104
+ group: "Resources",
105
+ keywords: ["api", "openapi", "swagger", "rest"],
106
+ },
107
+ ];
108
+
109
+ const resolveExtraHref = (
110
+ extra: (typeof SUITE_SEARCH_EXTRAS)[number],
111
+ context: SiteDrakkarContext,
112
+ urls: SiteUrls,
113
+ ): string => {
114
+ switch (extra.title) {
115
+ case "Viking-UI Components":
116
+ return "https://ui.dataengineeringformachinelearning.com/components";
117
+ case "Design tokens":
118
+ return "https://ui.dataengineeringformachinelearning.com/tokens";
119
+ case "API reference":
120
+ return `${urls.backend.replace(/\/$/, "")}/api/docs`;
121
+ default:
122
+ return context === "app" ? urls.app : urls.marketing;
123
+ }
124
+ };
125
+
126
+ /** Viking-UI docs site entries (ui.dataengineeringformachinelearning.com). */
127
+ const DOCS_SEARCH_EXTRAS: readonly SuiteSearchItem[] = [
128
+ {
129
+ title: "Components",
130
+ href: "/components",
131
+ snippet: "Browse all documented primitives",
132
+ group: "Viking-UI",
133
+ keywords: ["components", "showcase", "registry"],
134
+ },
135
+ {
136
+ title: "Playground",
137
+ href: "/playground",
138
+ snippet: "Live Web Component sandbox",
139
+ group: "Viking-UI",
140
+ keywords: ["playground", "sandbox", "demo"],
141
+ },
142
+ {
143
+ title: "Architecture",
144
+ href: "/architecture",
145
+ snippet: "CSS + WC + Angular layers",
146
+ group: "Viking-UI",
147
+ keywords: ["architecture", "layers", "web component"],
148
+ },
149
+ {
150
+ title: "Design tokens",
151
+ href: "/tokens",
152
+ snippet: "Canonical --viking-* token matrix",
153
+ group: "Viking-UI",
154
+ keywords: ["tokens", "theme", "css", "variables"],
155
+ },
156
+ {
157
+ title: "Theming",
158
+ href: "/theming",
159
+ snippet: "Light/dark mode and sync pipeline",
160
+ group: "Viking-UI",
161
+ keywords: ["theming", "dark", "light", "mode"],
162
+ },
163
+ {
164
+ title: "Framework guides",
165
+ href: "/frameworks",
166
+ snippet: "Angular, Astro, Django setup",
167
+ group: "Viking-UI",
168
+ keywords: ["frameworks", "angular", "astro", "django"],
169
+ },
170
+ {
171
+ title: "Contributing",
172
+ href: "/contributing",
173
+ snippet: "Extend the Viking-UI kit",
174
+ group: "Viking-UI",
175
+ keywords: ["contributing", "extend", "primitives"],
176
+ },
177
+ ];
178
+
179
+ const resolveDocsHref = (href: string, docsOrigin: string): string =>
180
+ href.startsWith("http")
181
+ ? href
182
+ : `${docsOrigin.replace(/\/$/, "")}${href.startsWith("/") ? href : `/${href}`}`;
183
+
184
+ /**
185
+ * Builds curated command-palette links for deml.app, marketing, backend, and docs.
186
+ * Used by the static widget and Angular `viking-suite-search-palette`.
187
+ */
188
+ export const buildSuiteSearchItems = (
189
+ context: SiteDrakkarContext,
190
+ urls: SiteUrls,
191
+ options?: { docsOrigin?: string },
192
+ ): SuiteSearchItem[] => {
193
+ const paletteContext = context === "docs" ? "marketing" : context;
194
+
195
+ const items: SuiteSearchItem[] = [
196
+ ...SITE_NAV_LINKS.map((link) => navItem(link, paletteContext, urls)),
197
+ ...SITE_FOOTER_COLUMNS.flatMap((column) =>
198
+ column.links.map((link) =>
199
+ footerItem(link, column.title, paletteContext, urls),
200
+ ),
201
+ ),
202
+ ...SUITE_SEARCH_EXTRAS.map((extra) => ({
203
+ ...extra,
204
+ href: resolveExtraHref(extra, paletteContext, urls),
205
+ })),
206
+ ];
207
+
208
+ if (context === "app") {
209
+ items.push(
210
+ {
211
+ title: "Settings",
212
+ href: "/settings",
213
+ snippet: "Workspace domains, billing, and security",
214
+ group: "Platform",
215
+ keywords: ["settings", "sites", "workspace", "configuration"],
216
+ },
217
+ {
218
+ title: "Billing & subscription",
219
+ href: "/settings/billing",
220
+ snippet: "Manage plan, invoices, and payment methods",
221
+ group: "Platform",
222
+ keywords: ["billing", "stripe", "subscription", "payment"],
223
+ },
224
+ {
225
+ title: "Security settings",
226
+ href: "/settings/security",
227
+ snippet: "Keys, sessions, and access controls",
228
+ group: "Platform",
229
+ keywords: ["security", "keys", "auth", "rbac"],
230
+ },
231
+ );
232
+ }
233
+
234
+ if (context === "docs") {
235
+ const docsOrigin =
236
+ options?.docsOrigin ?? "https://ui.dataengineeringformachinelearning.com";
237
+ items.push(
238
+ ...DOCS_SEARCH_EXTRAS.map((extra) => ({
239
+ ...extra,
240
+ href: resolveDocsHref(extra.href, docsOrigin),
241
+ })),
242
+ );
243
+ }
244
+
245
+ return dedupeItems(items);
246
+ };