@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.
- package/README.md +35 -11
- package/dist/README.md +35 -11
- package/dist/design-tokens.css +300 -85
- package/dist/fesm2022/dataengineeringformachinelearning-viking-ui.mjs +135 -70
- package/dist/fesm2022/dataengineeringformachinelearning-viking-ui.mjs.map +1 -1
- package/dist/icons.js +306 -0
- package/dist/package.json +24 -5
- package/{src/lib/site-drakkar/site-drakkar.config.ts → dist/site-drakkar.js} +64 -130
- package/dist/src/tokens/viking-tokens.json +9 -7
- package/dist/types/dataengineeringformachinelearning-viking-ui.d.ts +98 -4
- package/dist/viking-components.css +161 -70
- package/dist/viking-tokens.json +9 -7
- package/dist/viking-ui-elements.js +45 -33
- package/dist/viking-ui.css +1 -1
- package/dist/web-components.js +46 -36
- package/package.json +30 -8
- package/dist/scripts/build-web-components.mjs +0 -37
- package/dist/src/web/badge/viking-badge-wc.ts +0 -116
- package/dist/src/web/button/viking-button-wc.ts +0 -165
- package/dist/src/web/callout/viking-callout-wc.ts +0 -105
- package/dist/src/web/card/viking-card-wc.ts +0 -70
- package/dist/src/web/core/base.ts +0 -56
- package/dist/src/web/core/dom.ts +0 -53
- package/dist/src/web/core/icons-inline.ts +0 -44
- package/dist/src/web/core/styles.ts +0 -1261
- package/dist/src/web/core/types.ts +0 -19
- package/dist/src/web/field/viking-field-wc.ts +0 -154
- package/dist/src/web/index.ts +0 -73
- package/dist/src/web/input/viking-input-wc.ts +0 -211
- package/dist/src/web/modal/viking-modal-wc.ts +0 -187
- package/dist/src/web/search-palette/viking-search-palette-wc.ts +0 -494
- package/dist/src/web/select/viking-select-wc.ts +0 -218
- package/dist/src/web/suite-header/viking-suite-header-wc.ts +0 -729
- package/dist/src/web/suite-search-palette/viking-suite-search-palette-wc.ts +0 -234
- package/dist/src/web/theme-toggle/viking-theme-toggle-wc.ts +0 -139
- package/dist/src/web/types.ts +0 -37
- package/dist/src/web/web-components.spec.ts +0 -297
- package/src/assets/drakkar-favicon.svg +0 -17
- package/src/assets/fonts/inter/InterVariable-Italic.woff2 +0 -0
- package/src/assets/fonts/inter/InterVariable.woff2 +0 -0
- package/src/core/brand/deml-lockup.svg +0 -5
- package/src/core/brand/deml-mark-compact.svg +0 -4
- package/src/core/brand/deml-mark-filled.svg +0 -3
- package/src/core/brand/deml-mark-outline.svg +0 -4
- package/src/core/brand-icons.ts +0 -62
- package/src/core/icons.spec.ts +0 -52
- package/src/core/icons.ts +0 -206
- package/src/core/integration-brand-icons.ts +0 -77
- package/src/core/lucide-paths.generated.ts +0 -130
- package/src/core/types.ts +0 -85
- package/src/core/uid.ts +0 -7
- package/src/elements/button/viking-button.ts +0 -201
- package/src/elements/card/viking-card.ts +0 -60
- package/src/elements/core/dom.ts +0 -33
- package/src/elements/core/styles.ts +0 -28
- package/src/elements/modal/viking-modal.ts +0 -154
- package/src/index.ts +0 -1
- package/src/lib/accordion/accordion.ts +0 -126
- package/src/lib/app-header/app-header.scss +0 -274
- package/src/lib/app-header/app-header.ts +0 -43
- package/src/lib/app-sidebar/app-sidebar.scss +0 -415
- package/src/lib/app-sidebar/app-sidebar.ts +0 -29
- package/src/lib/auth-panel/auth-panel.spec.ts +0 -132
- package/src/lib/auth-panel/auth-panel.ts +0 -228
- package/src/lib/autocomplete/autocomplete.ts +0 -223
- package/src/lib/avatar/avatar.ts +0 -126
- package/src/lib/badge/badge.ts +0 -182
- package/src/lib/bar/bar.ts +0 -31
- package/src/lib/brand/brand.ts +0 -60
- package/src/lib/breadcrumbs/breadcrumbs.ts +0 -81
- package/src/lib/button/button-group.ts +0 -40
- package/src/lib/button/button.scss +0 -119
- package/src/lib/button/button.ts +0 -98
- package/src/lib/calendar/calendar.ts +0 -253
- package/src/lib/callout/callout.ts +0 -211
- package/src/lib/card/card-title.spec.ts +0 -27
- package/src/lib/card/card-title.ts +0 -50
- package/src/lib/card/card.ts +0 -198
- package/src/lib/carousel/carousel.ts +0 -206
- package/src/lib/chart/chart-zoom.spec.ts +0 -65
- package/src/lib/chart/chart-zoom.ts +0 -71
- package/src/lib/chart/chart.ts +0 -1257
- package/src/lib/chart-card-header/chart-card-header.ts +0 -80
- package/src/lib/chart-empty-state/chart-empty-state.ts +0 -146
- package/src/lib/chart-panel/chart-panel.ts +0 -133
- package/src/lib/checkbox/checkbox.ts +0 -139
- package/src/lib/color-picker/color-picker.ts +0 -148
- package/src/lib/command/command.ts +0 -260
- package/src/lib/composer/composer.ts +0 -180
- package/src/lib/confirm-dialog/confirm-dialog.ts +0 -163
- package/src/lib/confirm-dialog/dialog.service.ts +0 -79
- package/src/lib/context/context.ts +0 -75
- package/src/lib/core/brand-icons.ts +0 -62
- package/src/lib/core/cva.ts +0 -33
- package/src/lib/core/icons.ts +0 -206
- package/src/lib/core/integration-brand-icons.ts +0 -77
- package/src/lib/core/lucide-paths.generated.ts +0 -130
- package/src/lib/date-picker/date-picker.ts +0 -139
- package/src/lib/dropdown/dropdown.ts +0 -188
- package/src/lib/editor/editor.ts +0 -170
- package/src/lib/empty-state/empty-state.ts +0 -100
- package/src/lib/fab/fab.ts +0 -76
- package/src/lib/field/field.ts +0 -111
- package/src/lib/file-upload/file-upload.ts +0 -208
- package/src/lib/footer/footer.scss +0 -155
- package/src/lib/footer/footer.ts +0 -28
- package/src/lib/form-section/form-section.ts +0 -200
- package/src/lib/forms.spec.ts +0 -92
- package/src/lib/gauge-arc/gauge-arc.ts +0 -85
- package/src/lib/hud-panel/hud-panel.ts +0 -27
- package/src/lib/icon/icon.ts +0 -284
- package/src/lib/icon-badge/icon-badge.ts +0 -87
- package/src/lib/icon-heading/icon-heading.spec.ts +0 -32
- package/src/lib/icon-heading/icon-heading.ts +0 -38
- package/src/lib/icon-text/icon-text.ts +0 -120
- package/src/lib/input/input.ts +0 -119
- package/src/lib/kanban/kanban.ts +0 -211
- package/src/lib/kbd/kbd.ts +0 -32
- package/src/lib/label/label.ts +0 -39
- package/src/lib/loading-overlay/loading-overlay.ts +0 -80
- package/src/lib/menubar/menubar.ts +0 -77
- package/src/lib/metric-card/metric-card.ts +0 -33
- package/src/lib/modal/modal.ts +0 -207
- package/src/lib/native-select/native-select.ts +0 -124
- package/src/lib/navbar/navbar.ts +0 -124
- package/src/lib/navigation-menu/navigation-menu.ts +0 -116
- package/src/lib/otp-input/otp-input.ts +0 -164
- package/src/lib/page-back-link/page-back-link.ts +0 -74
- package/src/lib/page-header/page-header.ts +0 -70
- package/src/lib/pagination/pagination.ts +0 -157
- package/src/lib/pillbox/pillbox.ts +0 -157
- package/src/lib/popover/popover.ts +0 -92
- package/src/lib/profile/profile.ts +0 -73
- package/src/lib/progress/progress.ts +0 -123
- package/src/lib/radio/radio.ts +0 -132
- package/src/lib/ring-gauge/ring-gauge.ts +0 -75
- package/src/lib/scroll-area/scroll-area.ts +0 -57
- package/src/lib/search-palette/search-palette.scss +0 -288
- package/src/lib/search-palette/search-palette.ts +0 -114
- package/src/lib/select/select.ts +0 -292
- package/src/lib/separator/separator.ts +0 -59
- package/src/lib/sheet/sheet.ts +0 -192
- package/src/lib/sidebar-nav/sidebar-nav.scss +0 -218
- package/src/lib/sidebar-nav/sidebar-nav.ts +0 -158
- package/src/lib/site-drakkar/site-footer.ts +0 -129
- package/src/lib/site-drakkar/site-navbar.scss +0 -2
- package/src/lib/site-drakkar/site-navbar.ts +0 -277
- package/src/lib/site-drakkar/suite-search-items.spec.ts +0 -61
- package/src/lib/site-drakkar/suite-search-items.ts +0 -246
- package/src/lib/skeleton/skeleton.ts +0 -51
- package/src/lib/slider/slider.ts +0 -133
- package/src/lib/spinner/spinner.ts +0 -75
- package/src/lib/status-metric-row/status-metric-row.ts +0 -74
- package/src/lib/suite-search-palette/suite-search-palette.ts +0 -95
- package/src/lib/switch/switch.ts +0 -131
- package/src/lib/table/table.ts +0 -137
- package/src/lib/tabs/tab-panel.ts +0 -61
- package/src/lib/tabs/tab.ts +0 -107
- package/src/lib/tabs/tabs.ts +0 -109
- package/src/lib/textarea/textarea.ts +0 -103
- package/src/lib/theme-toggle/theme-toggle.spec.ts +0 -40
- package/src/lib/theme-toggle/theme-toggle.ts +0 -39
- package/src/lib/time-picker/time-picker.ts +0 -197
- package/src/lib/timeline/timeline.ts +0 -152
- package/src/lib/toast/toast.ts +0 -196
- package/src/lib/toggle/toggle-group.ts +0 -60
- package/src/lib/toggle/toggle.ts +0 -101
- package/src/lib/tooltip/tooltip.ts +0 -119
- package/src/lib/typography/heading.ts +0 -52
- package/src/lib/typography/text.ts +0 -51
- package/src/lib/uptime-bar/uptime-bar.ts +0 -55
- package/src/lib/verification-code-field/verification-code-field.ts +0 -149
- package/src/lib/whitepaper-cta/whitepaper-cta.scss +0 -130
- package/src/lib/whitepaper-cta/whitepaper-cta.ts +0 -78
- package/src/lib/wizard/wizard.ts +0 -80
- package/src/public-api.ts +0 -172
- package/src/styles/_buttons.scss +0 -386
- package/src/styles/_component-primitives.scss +0 -183
- package/src/styles/_drakkar-buttons.scss +0 -85
- package/src/styles/_fonts.scss +0 -22
- package/src/styles/_forms.scss +0 -66
- package/src/styles/_input.scss +0 -106
- package/src/styles/_layout-enforcement.scss +0 -229
- package/src/styles/_layout-rhythm.scss +0 -158
- package/src/styles/_legacy-aliases.scss +0 -212
- package/src/styles/_series-colors.scss +0 -24
- package/src/styles/_static-primitives.scss +0 -857
- package/src/styles/_typography.scss +0 -87
- package/src/styles/_variables.scss +0 -527
- package/src/styles/components/a11y.scss +0 -90
- package/src/styles/components/badges.scss +0 -102
- package/src/styles/components/extracted-utilities.scss +0 -459
- package/src/styles/components/footer.scss +0 -155
- package/src/styles/components/icon-heading.scss +0 -47
- package/src/styles/components/icon-inline.scss +0 -101
- package/src/styles/components/layout.scss +0 -59
- package/src/styles/components/utilities.scss +0 -131
- package/src/styles/components/viking-inspired.scss +0 -204
- package/src/styles/components/whitepaper-cta.scss +0 -130
- package/src/styles/components-bundle.scss +0 -9
- package/src/styles/components.scss +0 -442
- package/src/styles/deml-components.scss +0 -10
- package/src/styles/index.scss +0 -8
- package/src/styles/layout-shell.scss +0 -111
- package/src/styles/page-shell.scss +0 -859
- package/src/styles/static-navbar.scss +0 -1215
- package/src/styles/surfaces/backend.scss +0 -154
- package/src/styles/surfaces/docs-global.scss +0 -73
- package/src/styles/surfaces/docs-shell.scss +0 -437
- package/src/styles/surfaces/docs-showcase.scss +0 -1153
- package/src/styles/surfaces/marketing-cta.scss +0 -62
- package/src/styles/surfaces/marketing-docs-bento.scss +0 -67
- package/src/styles/surfaces/marketing-global.scss +0 -748
- package/src/styles/surfaces/marketing-landing.scss +0 -1526
- package/src/styles/surfaces/marketing-publication.scss +0 -535
- package/src/styles/surfaces/marketing-theme.scss +0 -14
- package/src/styles/surfaces/swagger-ui.scss +0 -922
- package/src/styles/tokens-export.scss +0 -18
- package/src/styles/tokens.scss +0 -5
- package/src/styles/viking-ui-bundle.scss +0 -23
- package/src/styles/viking-ui.scss +0 -270
- package/src/tokens/series-presets.ts +0 -15
- package/src/tokens/tailwind.preset.js +0 -209
- package/src/tokens/viking-tokens.json +0 -318
- package/src/viking-ui.spec.ts +0 -416
- package/src/web/badge/viking-badge-wc.ts +0 -116
- package/src/web/button/viking-button-wc.ts +0 -165
- package/src/web/callout/viking-callout-wc.ts +0 -105
- package/src/web/card/viking-card-wc.ts +0 -70
- package/src/web/core/base.ts +0 -56
- package/src/web/core/dom.ts +0 -53
- package/src/web/core/icons-inline.ts +0 -44
- package/src/web/core/styles.ts +0 -1261
- package/src/web/core/types.ts +0 -19
- package/src/web/field/viking-field-wc.ts +0 -154
- package/src/web/index.ts +0 -73
- package/src/web/input/viking-input-wc.ts +0 -211
- package/src/web/modal/viking-modal-wc.ts +0 -187
- package/src/web/search-palette/viking-search-palette-wc.ts +0 -494
- package/src/web/select/viking-select-wc.ts +0 -218
- package/src/web/suite-header/viking-suite-header-wc.ts +0 -729
- package/src/web/suite-search-palette/viking-suite-search-palette-wc.ts +0 -234
- package/src/web/theme-toggle/viking-theme-toggle-wc.ts +0 -139
- package/src/web/types.ts +0 -37
- package/src/web/web-components.spec.ts +0 -297
- package/src/web-components/index.ts +0 -1
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
ViewEncapsulation,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
output,
|
|
8
|
-
} from "@angular/core";
|
|
9
|
-
import { VikingIcon } from "../icon/icon";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* viking-theme-toggle — navbar utility control for light/dark theme switching.
|
|
13
|
-
* Uses `.theme-toggle-btn` styles from viking-ui.css (static-navbar.scss).
|
|
14
|
-
*/
|
|
15
|
-
@Component({
|
|
16
|
-
selector: "viking-theme-toggle",
|
|
17
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
-
encapsulation: ViewEncapsulation.None,
|
|
19
|
-
imports: [VikingIcon],
|
|
20
|
-
host: { class: "viking-theme-toggle-host" },
|
|
21
|
-
template: `
|
|
22
|
-
<button
|
|
23
|
-
type="button"
|
|
24
|
-
class="theme-toggle-btn"
|
|
25
|
-
aria-label="Toggle light and dark theme"
|
|
26
|
-
(click)="toggle.emit()"
|
|
27
|
-
>
|
|
28
|
-
<viking-icon [name]="icon()" [size]="20" />
|
|
29
|
-
</button>
|
|
30
|
-
`,
|
|
31
|
-
})
|
|
32
|
-
export class VikingThemeToggle {
|
|
33
|
-
readonly theme = input<"light" | "dark">("dark");
|
|
34
|
-
readonly toggle = output<void>();
|
|
35
|
-
|
|
36
|
-
protected readonly icon = computed(() =>
|
|
37
|
-
this.theme() === "dark" ? "sun" : "moon",
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
ElementRef,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
model,
|
|
8
|
-
signal,
|
|
9
|
-
} from "@angular/core";
|
|
10
|
-
import { VikingControl, provideVikingCva } from "../core/cva";
|
|
11
|
-
import { VikingIcon } from "../icon/icon";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* viking-time-picker — dropdown time selection.
|
|
15
|
-
* Value is a 24h HH:MM string. ControlValueAccessor-compatible.
|
|
16
|
-
*/
|
|
17
|
-
@Component({
|
|
18
|
-
selector: "viking-time-picker",
|
|
19
|
-
imports: [VikingIcon],
|
|
20
|
-
providers: [provideVikingCva(VikingTimePicker)],
|
|
21
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
|
-
host: {
|
|
23
|
-
"(document:click)": "onDocumentClick($event)",
|
|
24
|
-
"(keydown.escape)": "open.set(false)",
|
|
25
|
-
},
|
|
26
|
-
template: `
|
|
27
|
-
<button
|
|
28
|
-
type="button"
|
|
29
|
-
class="viking-control viking-time-trigger"
|
|
30
|
-
[disabled]="disabled() || formDisabled()"
|
|
31
|
-
[attr.aria-expanded]="open()"
|
|
32
|
-
[attr.aria-label]="label() || placeholder()"
|
|
33
|
-
aria-haspopup="listbox"
|
|
34
|
-
(click)="open.set(!open())"
|
|
35
|
-
>
|
|
36
|
-
<viking-icon name="clock" [size]="20" />
|
|
37
|
-
<span
|
|
38
|
-
class="viking-time-value"
|
|
39
|
-
[class.viking-time-placeholder]="!value()"
|
|
40
|
-
>
|
|
41
|
-
{{ value() || placeholder() }}
|
|
42
|
-
</span>
|
|
43
|
-
<viking-icon
|
|
44
|
-
[name]="open() ? 'chevron-up' : 'chevron-down'"
|
|
45
|
-
[size]="18"
|
|
46
|
-
/>
|
|
47
|
-
</button>
|
|
48
|
-
@if (open()) {
|
|
49
|
-
<div class="viking-time-panel" role="listbox" aria-label="Choose time">
|
|
50
|
-
@for (slot of slots(); track slot) {
|
|
51
|
-
<button
|
|
52
|
-
type="button"
|
|
53
|
-
role="option"
|
|
54
|
-
class="viking-time-option"
|
|
55
|
-
[class.viking-selected]="slot === value()"
|
|
56
|
-
[attr.aria-selected]="slot === value()"
|
|
57
|
-
(click)="pick(slot)"
|
|
58
|
-
>
|
|
59
|
-
{{ slot }}
|
|
60
|
-
</button>
|
|
61
|
-
}
|
|
62
|
-
</div>
|
|
63
|
-
}
|
|
64
|
-
`,
|
|
65
|
-
styles: [
|
|
66
|
-
`
|
|
67
|
-
:host {
|
|
68
|
-
position: relative;
|
|
69
|
-
display: block;
|
|
70
|
-
}
|
|
71
|
-
.viking-time-trigger {
|
|
72
|
-
display: flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
gap: var(--viking-space-1);
|
|
75
|
-
width: 100%;
|
|
76
|
-
min-height: var(--viking-control-height);
|
|
77
|
-
padding: 0 var(--viking-space-2);
|
|
78
|
-
background: var(--viking-surface);
|
|
79
|
-
border: 1px solid var(--viking-border-strong);
|
|
80
|
-
border-radius: var(--viking-radius);
|
|
81
|
-
box-shadow: var(--viking-shadow-sm);
|
|
82
|
-
color: var(--viking-text-muted);
|
|
83
|
-
font-family: var(--viking-font-family);
|
|
84
|
-
font-size: var(--viking-font-size);
|
|
85
|
-
cursor: pointer;
|
|
86
|
-
transition: var(--viking-transition);
|
|
87
|
-
text-align: left;
|
|
88
|
-
}
|
|
89
|
-
.viking-time-trigger:hover:not(:disabled) {
|
|
90
|
-
border-color: var(--viking-accent-strong);
|
|
91
|
-
}
|
|
92
|
-
.viking-time-trigger:focus-visible {
|
|
93
|
-
outline: var(--viking-ring-width) solid var(--viking-ring);
|
|
94
|
-
outline-offset: var(--viking-ring-offset);
|
|
95
|
-
}
|
|
96
|
-
.viking-time-trigger:disabled {
|
|
97
|
-
opacity: var(--viking-state-disabled-opacity);
|
|
98
|
-
cursor: not-allowed;
|
|
99
|
-
}
|
|
100
|
-
.viking-time-value {
|
|
101
|
-
flex: 1;
|
|
102
|
-
color: var(--viking-text);
|
|
103
|
-
font-variant-numeric: tabular-nums;
|
|
104
|
-
}
|
|
105
|
-
.viking-time-placeholder {
|
|
106
|
-
color: var(--viking-text-muted);
|
|
107
|
-
}
|
|
108
|
-
.viking-time-panel {
|
|
109
|
-
position: absolute;
|
|
110
|
-
top: calc(100% + var(--viking-space-1));
|
|
111
|
-
left: 0;
|
|
112
|
-
right: 0;
|
|
113
|
-
display: flex;
|
|
114
|
-
flex-direction: column;
|
|
115
|
-
gap: 2px;
|
|
116
|
-
margin: 0;
|
|
117
|
-
padding: var(--viking-space-1);
|
|
118
|
-
background: var(--viking-surface);
|
|
119
|
-
border: 1px solid var(--viking-border-strong);
|
|
120
|
-
border-radius: var(--viking-radius);
|
|
121
|
-
box-shadow: var(--viking-shadow-md);
|
|
122
|
-
z-index: var(--viking-z-overlay);
|
|
123
|
-
max-height: 279px;
|
|
124
|
-
overflow: auto;
|
|
125
|
-
}
|
|
126
|
-
.viking-time-option {
|
|
127
|
-
padding: var(--viking-space-1);
|
|
128
|
-
border: none;
|
|
129
|
-
background: transparent;
|
|
130
|
-
text-align: left;
|
|
131
|
-
width: 100%;
|
|
132
|
-
border-radius: calc(var(--viking-radius) / 1.5);
|
|
133
|
-
font-family: var(--viking-font-family);
|
|
134
|
-
font-size: var(--viking-font-size);
|
|
135
|
-
color: var(--viking-text);
|
|
136
|
-
cursor: pointer;
|
|
137
|
-
font-variant-numeric: tabular-nums;
|
|
138
|
-
}
|
|
139
|
-
.viking-time-option:focus-visible {
|
|
140
|
-
outline: var(--viking-ring-width) solid var(--viking-ring);
|
|
141
|
-
outline-offset: -2px;
|
|
142
|
-
}
|
|
143
|
-
.viking-time-option:hover {
|
|
144
|
-
background: var(--viking-accent-soft);
|
|
145
|
-
}
|
|
146
|
-
.viking-selected {
|
|
147
|
-
color: var(--viking-accent);
|
|
148
|
-
font-weight: 600;
|
|
149
|
-
}
|
|
150
|
-
`,
|
|
151
|
-
],
|
|
152
|
-
})
|
|
153
|
-
export class VikingTimePicker extends VikingControl<string | null> {
|
|
154
|
-
readonly value = model<string | null>(null);
|
|
155
|
-
readonly placeholder = input<string>("Select time");
|
|
156
|
-
readonly label = input<string>("");
|
|
157
|
-
readonly disabled = input<boolean>(false);
|
|
158
|
-
/** Minute granularity for generated slots. */
|
|
159
|
-
readonly stepMinutes = input<number>(30);
|
|
160
|
-
|
|
161
|
-
constructor(private readonly host: ElementRef<HTMLElement>) {
|
|
162
|
-
super();
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
protected readonly open = signal(false);
|
|
166
|
-
|
|
167
|
-
protected readonly slots = computed<string[]>(() => {
|
|
168
|
-
const step = Math.max(5, this.stepMinutes());
|
|
169
|
-
const result: string[] = [];
|
|
170
|
-
for (let minutes = 0; minutes < 24 * 60; minutes += step) {
|
|
171
|
-
const hours = String(Math.floor(minutes / 60)).padStart(2, "0");
|
|
172
|
-
const mins = String(minutes % 60).padStart(2, "0");
|
|
173
|
-
result.push(`${hours}:${mins}`);
|
|
174
|
-
}
|
|
175
|
-
return result;
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
writeValue(value: string | null): void {
|
|
179
|
-
this.value.set(value);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
protected pick = (slot: string): void => {
|
|
183
|
-
this.value.set(slot);
|
|
184
|
-
this.onChange(slot);
|
|
185
|
-
this.onTouched();
|
|
186
|
-
this.open.set(false);
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
protected onDocumentClick = (event: Event): void => {
|
|
190
|
-
if (
|
|
191
|
-
this.open() &&
|
|
192
|
-
!this.host.nativeElement.contains(event.target as Node)
|
|
193
|
-
) {
|
|
194
|
-
this.open.set(false);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
2
|
-
import { VikingIcon } from "../icon/icon";
|
|
3
|
-
import { VikingIconName } from "../../core/icons";
|
|
4
|
-
import { VikingTone } from "../../core/types";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* viking-timeline — vertical event feed.
|
|
8
|
-
* Compose with viking-timeline-item.
|
|
9
|
-
*/
|
|
10
|
-
@Component({
|
|
11
|
-
selector: "viking-timeline",
|
|
12
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
-
host: { role: "list" },
|
|
14
|
-
template: `<ng-content />`,
|
|
15
|
-
styles: [
|
|
16
|
-
`
|
|
17
|
-
:host {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
],
|
|
23
|
-
})
|
|
24
|
-
export class VikingTimeline {}
|
|
25
|
-
|
|
26
|
-
/** A single event on viking-timeline. */
|
|
27
|
-
@Component({
|
|
28
|
-
selector: "viking-timeline-item",
|
|
29
|
-
imports: [VikingIcon],
|
|
30
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
31
|
-
host: { role: "listitem" },
|
|
32
|
-
template: `
|
|
33
|
-
<div class="viking-timeline-item">
|
|
34
|
-
<div class="viking-timeline-rail" aria-hidden="true">
|
|
35
|
-
<span
|
|
36
|
-
class="viking-timeline-marker"
|
|
37
|
-
[class]="'viking-marker-' + tone()"
|
|
38
|
-
>
|
|
39
|
-
@if (icon()) {
|
|
40
|
-
<viking-icon [name]="icon()!" [size]="14" />
|
|
41
|
-
}
|
|
42
|
-
</span>
|
|
43
|
-
<span class="viking-timeline-line"></span>
|
|
44
|
-
</div>
|
|
45
|
-
<div class="viking-timeline-content">
|
|
46
|
-
<div class="viking-timeline-header">
|
|
47
|
-
<span class="viking-timeline-heading">{{ heading() }}</span>
|
|
48
|
-
@if (timestamp()) {
|
|
49
|
-
<time class="viking-timeline-time">{{ timestamp() }}</time>
|
|
50
|
-
}
|
|
51
|
-
</div>
|
|
52
|
-
<div class="viking-timeline-body"><ng-content /></div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
`,
|
|
56
|
-
styles: [
|
|
57
|
-
`
|
|
58
|
-
:host:last-child .viking-timeline-line {
|
|
59
|
-
display: none;
|
|
60
|
-
}
|
|
61
|
-
.viking-timeline-item {
|
|
62
|
-
display: flex;
|
|
63
|
-
gap: var(--viking-space-2);
|
|
64
|
-
font-family: var(--viking-font-family);
|
|
65
|
-
}
|
|
66
|
-
.viking-timeline-rail {
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-direction: column;
|
|
69
|
-
align-items: center;
|
|
70
|
-
}
|
|
71
|
-
.viking-timeline-marker {
|
|
72
|
-
display: inline-flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
justify-content: center;
|
|
75
|
-
width: var(--viking-space-3);
|
|
76
|
-
height: var(--viking-space-3);
|
|
77
|
-
border-radius: var(--viking-radius-pill);
|
|
78
|
-
border: 2px solid var(--viking-border-strong);
|
|
79
|
-
background: var(--viking-surface);
|
|
80
|
-
color: var(--viking-text-muted);
|
|
81
|
-
flex-shrink: 0;
|
|
82
|
-
}
|
|
83
|
-
.viking-marker-accent {
|
|
84
|
-
border-color: var(--viking-accent);
|
|
85
|
-
color: var(--viking-accent);
|
|
86
|
-
}
|
|
87
|
-
.viking-marker-secondary {
|
|
88
|
-
border-color: var(--viking-accent-secondary);
|
|
89
|
-
color: var(--viking-accent-secondary);
|
|
90
|
-
}
|
|
91
|
-
.viking-marker-info {
|
|
92
|
-
border-color: var(--viking-info);
|
|
93
|
-
color: var(--viking-info);
|
|
94
|
-
}
|
|
95
|
-
.viking-marker-success {
|
|
96
|
-
border-color: var(--viking-success);
|
|
97
|
-
color: var(--viking-success);
|
|
98
|
-
}
|
|
99
|
-
.viking-marker-warning {
|
|
100
|
-
border-color: var(--viking-warning);
|
|
101
|
-
color: var(--viking-text);
|
|
102
|
-
}
|
|
103
|
-
.viking-marker-danger {
|
|
104
|
-
border-color: var(--viking-danger);
|
|
105
|
-
color: var(--viking-danger);
|
|
106
|
-
}
|
|
107
|
-
.viking-timeline-line {
|
|
108
|
-
flex: 1;
|
|
109
|
-
width: 2px;
|
|
110
|
-
min-height: var(--viking-space-2);
|
|
111
|
-
background: var(--viking-border);
|
|
112
|
-
}
|
|
113
|
-
.viking-timeline-content {
|
|
114
|
-
flex: 1;
|
|
115
|
-
padding-bottom: var(--viking-space-3);
|
|
116
|
-
min-width: 0;
|
|
117
|
-
}
|
|
118
|
-
.viking-timeline-header {
|
|
119
|
-
display: flex;
|
|
120
|
-
align-items: baseline;
|
|
121
|
-
justify-content: space-between;
|
|
122
|
-
gap: var(--viking-space-2);
|
|
123
|
-
flex-wrap: wrap;
|
|
124
|
-
}
|
|
125
|
-
.viking-timeline-heading {
|
|
126
|
-
font-size: var(--viking-font-size);
|
|
127
|
-
font-weight: 600;
|
|
128
|
-
color: var(--viking-text);
|
|
129
|
-
}
|
|
130
|
-
.viking-timeline-time {
|
|
131
|
-
font-size: var(--viking-font-size);
|
|
132
|
-
color: var(--viking-text-muted);
|
|
133
|
-
font-variant-numeric: tabular-nums;
|
|
134
|
-
}
|
|
135
|
-
.viking-timeline-body {
|
|
136
|
-
margin-top: 3px;
|
|
137
|
-
font-size: var(--viking-font-size);
|
|
138
|
-
color: var(--viking-text-muted);
|
|
139
|
-
line-height: 1.55;
|
|
140
|
-
}
|
|
141
|
-
.viking-timeline-body:empty {
|
|
142
|
-
display: none;
|
|
143
|
-
}
|
|
144
|
-
`,
|
|
145
|
-
],
|
|
146
|
-
})
|
|
147
|
-
export class VikingTimelineItem {
|
|
148
|
-
readonly heading = input.required<string>();
|
|
149
|
-
readonly timestamp = input<string>("");
|
|
150
|
-
readonly icon = input<VikingIconName | null>(null);
|
|
151
|
-
readonly tone = input<VikingTone>("muted");
|
|
152
|
-
}
|
package/src/lib/toast/toast.ts
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
Injectable,
|
|
5
|
-
input,
|
|
6
|
-
signal,
|
|
7
|
-
} from "@angular/core";
|
|
8
|
-
import { VikingIcon } from "../icon/icon";
|
|
9
|
-
import { VikingIconName } from "../../core/icons";
|
|
10
|
-
import { VikingToastInstance, VikingToastOptions } from "../../core/types";
|
|
11
|
-
|
|
12
|
-
const TONE_ICONS: Record<string, VikingIconName> = {
|
|
13
|
-
accent: "info",
|
|
14
|
-
success: "check-circle",
|
|
15
|
-
warning: "alert-triangle",
|
|
16
|
-
danger: "alert-circle",
|
|
17
|
-
muted: "info",
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* VikingToastService — imperative toast API.
|
|
22
|
-
* Render a single <viking-toaster> outlet near the app root.
|
|
23
|
-
*/
|
|
24
|
-
@Injectable({ providedIn: "root" })
|
|
25
|
-
export class VikingToastService {
|
|
26
|
-
private nextId = 1;
|
|
27
|
-
readonly toasts = signal<VikingToastInstance[]>([]);
|
|
28
|
-
|
|
29
|
-
readonly show = (options: VikingToastOptions): number => {
|
|
30
|
-
const toast: VikingToastInstance = {
|
|
31
|
-
id: this.nextId++,
|
|
32
|
-
heading: options.heading ?? "",
|
|
33
|
-
text: options.text,
|
|
34
|
-
tone: options.tone ?? "accent",
|
|
35
|
-
duration: options.duration ?? 4500,
|
|
36
|
-
};
|
|
37
|
-
this.toasts.update((list) => [...list, toast]);
|
|
38
|
-
if (toast.duration > 0) {
|
|
39
|
-
setTimeout(() => this.dismiss(toast.id), toast.duration);
|
|
40
|
-
}
|
|
41
|
-
return toast.id;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
readonly dismiss = (id: number): void => {
|
|
45
|
-
this.toasts.update((list) => list.filter((toast) => toast.id !== id));
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* viking-toaster — fixed-position outlet that renders active toasts.
|
|
51
|
-
*/
|
|
52
|
-
@Component({
|
|
53
|
-
selector: "viking-toaster",
|
|
54
|
-
imports: [VikingIcon],
|
|
55
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
56
|
-
host: { "[class.viking-toaster-top]": "position() === 'top-end'" },
|
|
57
|
-
template: `
|
|
58
|
-
@for (toast of service.toasts(); track toast.id) {
|
|
59
|
-
<div
|
|
60
|
-
class="viking-toast"
|
|
61
|
-
[class]="'viking-toast-' + toast.tone"
|
|
62
|
-
role="status"
|
|
63
|
-
>
|
|
64
|
-
<viking-icon
|
|
65
|
-
class="viking-toast-icon"
|
|
66
|
-
[name]="toneIcon(toast.tone)"
|
|
67
|
-
[size]="20"
|
|
68
|
-
/>
|
|
69
|
-
<div class="viking-toast-body">
|
|
70
|
-
@if (toast.heading) {
|
|
71
|
-
<p class="viking-toast-heading">{{ toast.heading }}</p>
|
|
72
|
-
}
|
|
73
|
-
<p class="viking-toast-text">{{ toast.text }}</p>
|
|
74
|
-
</div>
|
|
75
|
-
<button
|
|
76
|
-
type="button"
|
|
77
|
-
class="viking-toast-close"
|
|
78
|
-
aria-label="Dismiss notification"
|
|
79
|
-
(click)="service.dismiss(toast.id)"
|
|
80
|
-
>
|
|
81
|
-
<viking-icon name="x" [size]="16" />
|
|
82
|
-
</button>
|
|
83
|
-
</div>
|
|
84
|
-
}
|
|
85
|
-
`,
|
|
86
|
-
styles: [
|
|
87
|
-
`
|
|
88
|
-
:host {
|
|
89
|
-
position: fixed;
|
|
90
|
-
bottom: var(--viking-space-3);
|
|
91
|
-
right: var(--viking-space-3);
|
|
92
|
-
display: flex;
|
|
93
|
-
flex-direction: column;
|
|
94
|
-
gap: var(--viking-space-1);
|
|
95
|
-
z-index: var(--viking-z-toast);
|
|
96
|
-
max-width: min(414px, calc(100vw - var(--viking-space-4)));
|
|
97
|
-
}
|
|
98
|
-
@media (max-width: 767px) {
|
|
99
|
-
:host {
|
|
100
|
-
bottom: var(--viking-space-2);
|
|
101
|
-
right: var(--viking-space-2);
|
|
102
|
-
left: var(--viking-space-2);
|
|
103
|
-
max-width: none;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
:host(.viking-toaster-top) {
|
|
107
|
-
bottom: auto;
|
|
108
|
-
top: var(--viking-space-3);
|
|
109
|
-
}
|
|
110
|
-
.viking-toast {
|
|
111
|
-
display: flex;
|
|
112
|
-
align-items: flex-start;
|
|
113
|
-
gap: var(--viking-space-1);
|
|
114
|
-
padding: var(--viking-space-2);
|
|
115
|
-
background: var(--viking-surface);
|
|
116
|
-
border: 1px solid var(--viking-border-strong);
|
|
117
|
-
border-radius: var(--viking-radius);
|
|
118
|
-
box-shadow: var(--viking-shadow-md);
|
|
119
|
-
font-family: var(--viking-font-family);
|
|
120
|
-
animation: viking-toast-in var(--viking-duration) var(--viking-ease-out);
|
|
121
|
-
}
|
|
122
|
-
@keyframes viking-toast-in {
|
|
123
|
-
from {
|
|
124
|
-
transform: translateY(var(--viking-space-1));
|
|
125
|
-
opacity: 0;
|
|
126
|
-
}
|
|
127
|
-
to {
|
|
128
|
-
transform: translateY(0);
|
|
129
|
-
opacity: 1;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
@media (prefers-reduced-motion: reduce) {
|
|
133
|
-
.viking-toast {
|
|
134
|
-
animation: none;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
.viking-toast-icon {
|
|
138
|
-
margin-top: 2px;
|
|
139
|
-
}
|
|
140
|
-
.viking-toast-accent .viking-toast-icon {
|
|
141
|
-
color: var(--viking-accent);
|
|
142
|
-
}
|
|
143
|
-
.viking-toast-success .viking-toast-icon {
|
|
144
|
-
color: var(--viking-success);
|
|
145
|
-
}
|
|
146
|
-
.viking-toast-warning .viking-toast-icon {
|
|
147
|
-
color: var(--viking-warning);
|
|
148
|
-
}
|
|
149
|
-
.viking-toast-danger .viking-toast-icon {
|
|
150
|
-
color: var(--viking-danger);
|
|
151
|
-
}
|
|
152
|
-
.viking-toast-body {
|
|
153
|
-
flex: 1;
|
|
154
|
-
min-width: 0;
|
|
155
|
-
}
|
|
156
|
-
.viking-toast-heading {
|
|
157
|
-
margin: 0;
|
|
158
|
-
font-size: var(--viking-font-size);
|
|
159
|
-
font-weight: 600;
|
|
160
|
-
color: var(--viking-text);
|
|
161
|
-
}
|
|
162
|
-
.viking-toast-text {
|
|
163
|
-
margin: 0;
|
|
164
|
-
font-size: var(--viking-font-size);
|
|
165
|
-
color: var(--viking-text-muted);
|
|
166
|
-
line-height: 1.45;
|
|
167
|
-
}
|
|
168
|
-
.viking-toast-close {
|
|
169
|
-
display: inline-flex;
|
|
170
|
-
border: none;
|
|
171
|
-
background: transparent;
|
|
172
|
-
color: var(--viking-text-muted);
|
|
173
|
-
cursor: pointer;
|
|
174
|
-
padding: var(--viking-space-half);
|
|
175
|
-
border-radius: var(--viking-radius-pill);
|
|
176
|
-
transition: var(--viking-transition-interactive);
|
|
177
|
-
}
|
|
178
|
-
.viking-toast-close:hover {
|
|
179
|
-
color: var(--viking-text);
|
|
180
|
-
background: var(--viking-accent-soft);
|
|
181
|
-
}
|
|
182
|
-
.viking-toast-close:focus-visible {
|
|
183
|
-
outline: var(--viking-ring-width) solid var(--viking-ring);
|
|
184
|
-
outline-offset: 1px;
|
|
185
|
-
}
|
|
186
|
-
`,
|
|
187
|
-
],
|
|
188
|
-
})
|
|
189
|
-
export class VikingToaster {
|
|
190
|
-
readonly position = input<"bottom-end" | "top-end">("bottom-end");
|
|
191
|
-
|
|
192
|
-
constructor(protected readonly service: VikingToastService) {}
|
|
193
|
-
|
|
194
|
-
protected toneIcon = (tone: string): VikingIconName =>
|
|
195
|
-
TONE_ICONS[tone] ?? "info";
|
|
196
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
InjectionToken,
|
|
5
|
-
model,
|
|
6
|
-
} from "@angular/core";
|
|
7
|
-
|
|
8
|
-
export const VIKING_TOGGLE_GROUP = new InjectionToken<VikingToggleGroup>(
|
|
9
|
-
"VIKING_TOGGLE_GROUP",
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* viking-toggle-group — exclusive or multi toggle cluster.
|
|
14
|
-
*/
|
|
15
|
-
@Component({
|
|
16
|
-
selector: "viking-toggle-group",
|
|
17
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
-
providers: [{ provide: VIKING_TOGGLE_GROUP, useExisting: VikingToggleGroup }],
|
|
19
|
-
host: {
|
|
20
|
-
role: "group",
|
|
21
|
-
class: "viking-toggle-group",
|
|
22
|
-
"[class.viking-exclusive]": "exclusive()",
|
|
23
|
-
},
|
|
24
|
-
template: `<ng-content />`,
|
|
25
|
-
styles: [
|
|
26
|
-
`
|
|
27
|
-
:host {
|
|
28
|
-
display: inline-flex;
|
|
29
|
-
flex-wrap: wrap;
|
|
30
|
-
gap: 0;
|
|
31
|
-
border: 1px solid var(--viking-border-strong);
|
|
32
|
-
border-radius: var(--viking-radius);
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
box-shadow: var(--viking-shadow-sm);
|
|
35
|
-
}
|
|
36
|
-
:host ::ng-deep viking-toggle:not(:first-child) .viking-toggle {
|
|
37
|
-
border-left: none;
|
|
38
|
-
margin-left: -1px;
|
|
39
|
-
border-radius: 0;
|
|
40
|
-
}
|
|
41
|
-
:host ::ng-deep viking-toggle:first-child .viking-toggle {
|
|
42
|
-
border-top-right-radius: 0;
|
|
43
|
-
border-bottom-right-radius: 0;
|
|
44
|
-
}
|
|
45
|
-
:host ::ng-deep viking-toggle:last-child .viking-toggle {
|
|
46
|
-
border-top-left-radius: 0;
|
|
47
|
-
border-bottom-left-radius: 0;
|
|
48
|
-
}
|
|
49
|
-
:host ::ng-deep viking-toggle .viking-toggle {
|
|
50
|
-
min-width: var(--viking-btn-min-width, 120px);
|
|
51
|
-
border-radius: 0;
|
|
52
|
-
box-shadow: none;
|
|
53
|
-
}
|
|
54
|
-
`,
|
|
55
|
-
],
|
|
56
|
-
})
|
|
57
|
-
export class VikingToggleGroup {
|
|
58
|
-
readonly value = model<string>("");
|
|
59
|
-
readonly exclusive = model(true);
|
|
60
|
-
}
|