@dataengineeringformachinelearning/viking-ui 4.0.4 → 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 +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,59 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, input } from "@angular/core";
2
-
3
- /**
4
- * viking-separator — horizontal/vertical rule with optional label
5
- *.
6
- */
7
- @Component({
8
- selector: "viking-separator",
9
- changeDetection: ChangeDetectionStrategy.OnPush,
10
- host: {
11
- role: "separator",
12
- "[attr.aria-orientation]": "orientation()",
13
- "[class.viking-vertical]": "orientation() === 'vertical'",
14
- },
15
- template: `
16
- @if (text() && orientation() === "horizontal") {
17
- <span class="viking-separator-line" aria-hidden="true"></span>
18
- <span class="viking-separator-text">{{ text() }}</span>
19
- <span class="viking-separator-line" aria-hidden="true"></span>
20
- } @else {
21
- <span class="viking-separator-line" aria-hidden="true"></span>
22
- }
23
- `,
24
- styles: [
25
- `
26
- :host {
27
- display: flex;
28
- align-items: center;
29
- gap: var(--viking-space-2);
30
- width: 100%;
31
- }
32
- :host(.viking-vertical) {
33
- width: auto;
34
- align-self: stretch;
35
- }
36
- .viking-separator-line {
37
- flex: 1;
38
- border-top: 1px solid var(--viking-border);
39
- }
40
- :host(.viking-vertical) .viking-separator-line {
41
- flex: none;
42
- border-top: none;
43
- border-left: 1px solid var(--viking-border);
44
- height: 100%;
45
- min-height: var(--viking-space-3);
46
- }
47
- .viking-separator-text {
48
- font-family: var(--viking-font-family);
49
- font-size: var(--viking-font-size);
50
- color: var(--viking-text-muted);
51
- white-space: nowrap;
52
- }
53
- `,
54
- ],
55
- })
56
- export class VikingSeparator {
57
- readonly orientation = input<"horizontal" | "vertical">("horizontal");
58
- readonly text = input<string>("");
59
- }
@@ -1,192 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- ElementRef,
5
- effect,
6
- inject,
7
- input,
8
- model,
9
- viewChild,
10
- } from "@angular/core";
11
- import { VikingIcon } from "../icon/icon";
12
-
13
- export type VikingSheetSide = "left" | "right";
14
-
15
- /**
16
- * viking-sheet — slide-over panel.
17
- */
18
- @Component({
19
- selector: "viking-sheet",
20
- imports: [VikingIcon],
21
- changeDetection: ChangeDetectionStrategy.OnPush,
22
- template: `
23
- <dialog
24
- #dialog
25
- class="viking-sheet"
26
- [class.viking-sheet-left]="side() === 'left'"
27
- tabindex="-1"
28
- [attr.aria-label]="heading() || 'Panel'"
29
- (close)="open.set(false)"
30
- (click)="onBackdropClick($event)"
31
- (keydown.escape)="dismissible() && open.set(false)"
32
- >
33
- <div class="viking-sheet-surface">
34
- <header class="viking-sheet-header">
35
- @if (heading()) {
36
- <h2 class="viking-sheet-heading">{{ heading() }}</h2>
37
- }
38
- @if (dismissible()) {
39
- <button
40
- type="button"
41
- class="viking-sheet-close"
42
- aria-label="Close panel"
43
- (click)="open.set(false)"
44
- >
45
- <viking-icon name="x" [size]="20" />
46
- </button>
47
- }
48
- </header>
49
- <div class="viking-sheet-body"><ng-content /></div>
50
- <footer class="viking-sheet-footer">
51
- <ng-content select="[vikingSheetActions]" />
52
- </footer>
53
- </div>
54
- </dialog>
55
- `,
56
- styles: [
57
- `
58
- .viking-sheet {
59
- margin: 0;
60
- padding: 0;
61
- border: none;
62
- background: transparent;
63
- max-width: none;
64
- max-height: none;
65
- width: 100%;
66
- height: 100%;
67
- position: fixed;
68
- inset: 0;
69
- }
70
- .viking-sheet::backdrop {
71
- background: var(--viking-overlay-backdrop);
72
- backdrop-filter: blur(6px);
73
- animation: viking-backdrop-in var(--viking-duration-fast)
74
- var(--viking-ease-default);
75
- }
76
- .viking-sheet-surface {
77
- position: fixed;
78
- top: 0;
79
- right: 0;
80
- display: flex;
81
- flex-direction: column;
82
- width: min(420px, 100vw);
83
- height: 100%;
84
- background: var(--viking-surface);
85
- border-left: 1px solid var(--viking-border-strong);
86
- box-shadow: var(--viking-shadow-lg);
87
- font-family: var(--viking-font-family);
88
- animation: viking-slide-in-right var(--viking-duration)
89
- var(--viking-ease-default);
90
- }
91
- .viking-sheet-left .viking-sheet-surface {
92
- right: auto;
93
- left: 0;
94
- border-left: none;
95
- border-right: 1px solid var(--viking-border-strong);
96
- }
97
- .viking-sheet-header {
98
- display: flex;
99
- align-items: flex-start;
100
- justify-content: space-between;
101
- gap: var(--viking-space-2);
102
- padding: var(--viking-space-2);
103
- border-bottom: 1px solid var(--viking-border);
104
- }
105
- .viking-sheet-heading {
106
- margin: 0;
107
- font-size: var(--viking-font-size-ui);
108
- font-weight: 700;
109
- letter-spacing: var(--header-letter-spacing, -0.02em);
110
- }
111
- .viking-sheet-close {
112
- display: inline-flex;
113
- align-items: center;
114
- justify-content: center;
115
- width: var(--viking-control-height-sm);
116
- height: var(--viking-control-height-sm);
117
- border: 1px solid transparent;
118
- background: transparent;
119
- color: var(--viking-text-muted);
120
- cursor: pointer;
121
- padding: 0;
122
- border-radius: var(--viking-radius);
123
- transition: var(--viking-transition-interactive);
124
- }
125
- .viking-sheet-close:hover {
126
- color: var(--viking-text);
127
- background: var(--viking-accent-soft);
128
- border-color: var(--viking-border-subtle);
129
- }
130
- .viking-sheet-close:active {
131
- transform: scale(var(--viking-state-active-scale));
132
- }
133
- .viking-sheet-close:focus-visible {
134
- outline: var(--viking-ring-width) solid var(--viking-ring);
135
- outline-offset: var(--viking-ring-offset);
136
- }
137
- .viking-sheet-body {
138
- flex: 1;
139
- overflow: auto;
140
- padding: var(--viking-space-2);
141
- font-size: var(--viking-font-size);
142
- color: var(--viking-text);
143
- line-height: 1.6;
144
- }
145
- .viking-sheet-footer {
146
- display: flex;
147
- flex-wrap: wrap;
148
- gap: var(--viking-space-2);
149
- justify-content: flex-end;
150
- align-items: center;
151
- padding: var(--viking-space-2);
152
- border-top: 1px solid var(--viking-border);
153
- }
154
- :host ::ng-deep .viking-sheet-footer [vikingSheetActions] {
155
- display: flex;
156
- flex-wrap: wrap;
157
- justify-content: flex-end;
158
- align-items: center;
159
- gap: var(--viking-space-2);
160
- width: 100%;
161
- }
162
- `,
163
- ],
164
- })
165
- export class VikingSheet {
166
- readonly open = model(false);
167
- readonly heading = input("");
168
- readonly dismissible = input(true);
169
- readonly side = input<VikingSheetSide>("right");
170
-
171
- private readonly dialogRef =
172
- viewChild.required<ElementRef<HTMLDialogElement>>("dialog");
173
-
174
- constructor() {
175
- effect(() => {
176
- const dialog = this.dialogRef().nativeElement;
177
- if (this.open() && !dialog.open) {
178
- dialog.showModal();
179
- } else if (!this.open() && dialog.open) {
180
- dialog.close();
181
- }
182
- });
183
- }
184
-
185
- protected onBackdropClick = (event: MouseEvent): void => {
186
- if (!this.dismissible()) return;
187
- const dialog = this.dialogRef().nativeElement;
188
- if (event.target === dialog) {
189
- this.open.set(false);
190
- }
191
- };
192
- }
@@ -1,218 +0,0 @@
1
- :host(.viking-sidebar-nav) {
2
- padding: var(--viking-space-1) var(--viking-space-1) var(--viking-space-1);
3
- display: flex;
4
- flex-direction: row;
5
- flex-wrap: wrap;
6
- align-items: center;
7
- gap: 6px;
8
- }
9
-
10
- @media (min-width: 901px) {
11
- :host(.viking-sidebar-nav) {
12
- padding: var(--viking-space-2) 0;
13
- flex-direction: column;
14
- flex-wrap: nowrap;
15
- gap: var(--viking-space-1);
16
- }
17
- }
18
-
19
- :host(.viking-sidebar-nav-link) {
20
- display: contents;
21
-
22
- a {
23
- display: flex;
24
- align-items: center;
25
- gap: var(--viking-space-1);
26
- padding: 10px 14px;
27
- color: var(--text-color);
28
- text-decoration: none;
29
- font-weight: var(--viking-font-weight-semibold);
30
- font-size: var(--viking-font-size-base);
31
- transition:
32
- color var(--viking-duration) var(--viking-ease-default),
33
- background-color var(--viking-duration) var(--viking-ease-default),
34
- border-color var(--viking-duration) var(--viking-ease-default);
35
- border-left: 3px solid transparent;
36
- border-bottom: 3px solid transparent;
37
- border-radius: var(--viking-radius);
38
- flex: 0 0 auto;
39
- min-height: 44px;
40
- white-space: nowrap;
41
- cursor: pointer;
42
- background: transparent;
43
- font-family: var(--viking-font-family);
44
- box-sizing: border-box;
45
- width: auto;
46
-
47
- &:hover {
48
- background-color: var(--sidebar-hover-bg);
49
- color: var(--text-color);
50
- }
51
-
52
- &:focus-visible {
53
- outline: var(--viking-ring-width) solid var(--viking-ring);
54
- outline-offset: var(--viking-ring-offset);
55
- }
56
-
57
- &.viking-sidebar-nav-link-active {
58
- background: var(--sidebar-active-bg);
59
- border-left-color: transparent;
60
- border-bottom-color: var(--sidebar-active-border);
61
- color: var(--sidebar-active-border);
62
- }
63
- }
64
- }
65
-
66
- @media (min-width: 901px) {
67
- :host(.viking-sidebar-nav-link) a {
68
- width: 100%;
69
- padding: var(--viking-space-1) var(--viking-space-2);
70
- border-bottom: none;
71
- border-left: 3px solid transparent;
72
- border-radius: 0;
73
- min-height: 0;
74
-
75
- &.viking-sidebar-nav-link-active {
76
- border-left-color: var(--sidebar-active-border);
77
- border-bottom-color: transparent;
78
- }
79
- }
80
- }
81
-
82
- :host(.viking-sidebar-nav-tree) {
83
- display: flex;
84
- flex-direction: column;
85
- flex: 1 1 100%;
86
- width: 100%;
87
- margin: 4px 0 0;
88
- padding-top: var(--viking-space-1);
89
- border-top: 1px solid var(--sidebar-border);
90
- }
91
-
92
- @media (min-width: 901px) {
93
- :host(.viking-sidebar-nav-tree) {
94
- flex: none;
95
- width: auto;
96
- margin: var(--viking-space-1) 0;
97
- padding-top: 0;
98
- border-top: none;
99
- }
100
- }
101
-
102
- :host(.viking-sidebar-nav-tree-header) {
103
- display: flex;
104
- align-items: center;
105
- justify-content: space-between;
106
- padding: var(--viking-space-1) var(--viking-space-2) var(--viking-space-1) 56px;
107
- color: var(--text-muted);
108
- font-size: var(--viking-font-size-base);
109
- font-weight: var(--viking-font-weight-bold);
110
- text-transform: uppercase;
111
- letter-spacing: var(--viking-letter-spacing-wide);
112
- cursor: pointer;
113
- transition: color var(--viking-duration) var(--viking-ease-default);
114
- font-family: var(--viking-font-family);
115
- border: none;
116
- background: transparent;
117
- width: 100%;
118
- text-align: left;
119
-
120
- &:hover {
121
- color: var(--text-color);
122
- }
123
-
124
- &:focus-visible {
125
- outline: var(--viking-ring-width) solid var(--viking-ring);
126
- outline-offset: var(--viking-ring-offset);
127
- }
128
- }
129
-
130
- :host(.viking-sidebar-nav-tree-children) {
131
- display: flex;
132
- flex-direction: column;
133
- padding: 0;
134
- margin: 0;
135
- border: none;
136
- }
137
-
138
- :host(.viking-sidebar-nav-tree-item) {
139
- display: flex;
140
- align-items: center;
141
- gap: var(--viking-space-1);
142
- padding: var(--viking-space-1) var(--viking-space-2) var(--viking-space-1) 56px;
143
- color: var(--text-muted);
144
- font-size: var(--viking-font-size-base);
145
- font-weight: var(--viking-font-weight-medium);
146
- cursor: pointer;
147
- transition:
148
- color var(--viking-duration) var(--viking-ease-default),
149
- background-color var(--viking-duration) var(--viking-ease-default),
150
- border-color var(--viking-duration) var(--viking-ease-default);
151
- border-left: 3px solid transparent;
152
- text-decoration: none;
153
- white-space: nowrap;
154
- overflow: hidden;
155
- text-overflow: ellipsis;
156
- background: transparent;
157
- font-family: var(--viking-font-family);
158
- border-top: none;
159
- border-right: none;
160
- border-bottom: none;
161
- width: 100%;
162
- text-align: left;
163
- box-sizing: border-box;
164
-
165
- &:hover {
166
- background-color: var(--sidebar-hover-bg);
167
- color: var(--text-color);
168
- }
169
-
170
- &:focus-visible {
171
- outline: var(--viking-ring-width) solid var(--viking-ring);
172
- outline-offset: var(--viking-ring-offset);
173
- }
174
-
175
- &.viking-sidebar-nav-tree-item-active {
176
- background: var(--sidebar-active-bg);
177
- border-left-color: var(--sidebar-active-border);
178
- color: var(--sidebar-active-border);
179
- font-weight: var(--viking-font-weight-semibold);
180
- }
181
-
182
- &.viking-sidebar-nav-tree-item-empty {
183
- font-style: italic;
184
- color: var(--text-muted);
185
- cursor: default;
186
-
187
- &:hover {
188
- background-color: transparent;
189
- color: var(--text-muted);
190
- }
191
- }
192
-
193
- &.viking-sidebar-nav-tree-item-accent {
194
- color: var(--status-accent);
195
- font-weight: var(--viking-font-weight-semibold);
196
- border-left: 3px solid transparent;
197
-
198
- &:hover {
199
- background-color: var(--sidebar-hover-bg);
200
- color: var(--status-accent);
201
- }
202
- }
203
- }
204
-
205
- .viking-sidebar-nav-tree-arrow {
206
- font-size: 20px;
207
- width: 20px;
208
- height: 20px;
209
- line-height: 20px;
210
- color: var(--text-muted);
211
- }
212
-
213
- .viking-sidebar-nav-tree-icon {
214
- font-size: var(--viking-icon-size-md, var(--base-font-size));
215
- width: var(--viking-icon-size-md, var(--base-font-size));
216
- height: var(--viking-icon-size-md, var(--base-font-size));
217
- line-height: var(--viking-icon-size-md, var(--base-font-size));
218
- }
@@ -1,158 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- input,
5
- output,
6
- ViewEncapsulation,
7
- } from "@angular/core";
8
- import { RouterLink, RouterLinkActive } from "@angular/router";
9
-
10
- /**
11
- * viking-sidebar-nav — composable sidebar navigation container.
12
- */
13
- @Component({
14
- selector: "viking-sidebar-nav",
15
- changeDetection: ChangeDetectionStrategy.OnPush,
16
- encapsulation: ViewEncapsulation.None,
17
- host: {
18
- class: "viking-sidebar-nav",
19
- role: "navigation",
20
- },
21
- template: `<ng-content />`,
22
- styleUrl: "./sidebar-nav.scss",
23
- })
24
- export class VikingSidebarNav {}
25
-
26
- /**
27
- * viking-sidebar-nav-link — router-aware sidebar nav item.
28
- */
29
- @Component({
30
- selector: "viking-sidebar-nav-link",
31
- imports: [RouterLink, RouterLinkActive],
32
- changeDetection: ChangeDetectionStrategy.OnPush,
33
- encapsulation: ViewEncapsulation.None,
34
- host: {
35
- class: "viking-sidebar-nav-link",
36
- },
37
- template: `
38
- <a
39
- [routerLink]="routerLink()"
40
- routerLinkActive="viking-sidebar-nav-link-active"
41
- [routerLinkActiveOptions]="routerLinkActiveOptions()"
42
- [title]="title()"
43
- [attr.aria-label]="title() || null"
44
- >
45
- <ng-content />
46
- </a>
47
- `,
48
- styleUrl: "./sidebar-nav.scss",
49
- })
50
- export class VikingSidebarNavLink {
51
- readonly routerLink = input.required<string | string[]>();
52
- readonly routerLinkActiveOptions = input<{ exact: boolean }>({ exact: true });
53
- readonly title = input<string>("");
54
- }
55
-
56
- /**
57
- * viking-sidebar-nav-tree — expandable tree section within sidebar nav.
58
- */
59
- @Component({
60
- selector: "viking-sidebar-nav-tree",
61
- changeDetection: ChangeDetectionStrategy.OnPush,
62
- encapsulation: ViewEncapsulation.None,
63
- host: { class: "viking-sidebar-nav-tree" },
64
- template: `<ng-content />`,
65
- styleUrl: "./sidebar-nav.scss",
66
- })
67
- export class VikingSidebarNavTree {}
68
-
69
- /**
70
- * viking-sidebar-nav-tree-header — collapsible tree section header.
71
- */
72
- @Component({
73
- selector: "viking-sidebar-nav-tree-header",
74
- changeDetection: ChangeDetectionStrategy.OnPush,
75
- encapsulation: ViewEncapsulation.None,
76
- host: {
77
- class: "viking-sidebar-nav-tree-header",
78
- role: "button",
79
- tabindex: "0",
80
- "[attr.aria-expanded]": "expanded()",
81
- "(click)": "onToggle()",
82
- "(keydown.enter)": "onToggle()",
83
- "(keydown.space)": "onSpace($event)",
84
- },
85
- template: `
86
- <span class="viking-sidebar-nav-tree-label">{{ label() }}</span>
87
- <ng-content select="[vikingSidebarTreeArrow]" />
88
- `,
89
- styleUrl: "./sidebar-nav.scss",
90
- })
91
- export class VikingSidebarNavTreeHeader {
92
- readonly label = input.required<string>();
93
- readonly expanded = input<boolean>(true);
94
- readonly toggled = output<void>();
95
-
96
- protected onToggle = (): void => {
97
- this.toggled.emit();
98
- };
99
-
100
- protected onSpace = (event: Event): void => {
101
- event.preventDefault();
102
- this.onToggle();
103
- };
104
- }
105
-
106
- /**
107
- * viking-sidebar-nav-tree-children — tree item list container.
108
- */
109
- @Component({
110
- selector: "viking-sidebar-nav-tree-children",
111
- changeDetection: ChangeDetectionStrategy.OnPush,
112
- encapsulation: ViewEncapsulation.None,
113
- host: { class: "viking-sidebar-nav-tree-children" },
114
- template: `<ng-content />`,
115
- styleUrl: "./sidebar-nav.scss",
116
- })
117
- export class VikingSidebarNavTreeChildren {}
118
-
119
- export type VikingSidebarNavTreeItemVariant = "default" | "empty" | "accent";
120
-
121
- /**
122
- * viking-sidebar-nav-tree-item — selectable tree leaf or action row.
123
- */
124
- @Component({
125
- selector: "viking-sidebar-nav-tree-item",
126
- changeDetection: ChangeDetectionStrategy.OnPush,
127
- encapsulation: ViewEncapsulation.None,
128
- host: {
129
- class: "viking-sidebar-nav-tree-item",
130
- role: "button",
131
- tabindex: "0",
132
- "[class.viking-sidebar-nav-tree-item-active]": "active()",
133
- "[class.viking-sidebar-nav-tree-item-empty]": "variant() === 'empty'",
134
- "[class.viking-sidebar-nav-tree-item-accent]": "variant() === 'accent'",
135
- "(click)": "onActivate($event)",
136
- "(keydown.enter)": "onActivate($event)",
137
- "(keydown.space)": "onSpace($event)",
138
- },
139
- template: `<ng-content />`,
140
- styleUrl: "./sidebar-nav.scss",
141
- })
142
- export class VikingSidebarNavTreeItem {
143
- readonly active = input<boolean>(false);
144
- readonly variant = input<VikingSidebarNavTreeItemVariant>("default");
145
- readonly activated = output<void>();
146
-
147
- protected onActivate = (event: Event): void => {
148
- if (this.variant() === "empty") {
149
- return;
150
- }
151
- this.activated.emit();
152
- };
153
-
154
- protected onSpace = (event: Event): void => {
155
- event.preventDefault();
156
- this.onActivate(event);
157
- };
158
- }