@ks-digital/designsystem-angular 0.0.1-alpha.28 → 0.0.1-alpha.30

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.
@@ -0,0 +1,3 @@
1
+ # Internals
2
+
3
+ This entry point is intended only for internal use and may change without notice. Avoid depending on it directly in applications.
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/alert
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/alert`.
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/button
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/button`.
package/card/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/card
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/card`.
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/details
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/details`.
@@ -39,7 +39,7 @@ const logIfDevMode = ({ component, message, }) => {
39
39
  };
40
40
 
41
41
  const randomId = () => {
42
- return `:${Math.random().toString(36).slice(2, 7)}`;
42
+ return `${Math.random().toString(36).slice(2, 7)}`;
43
43
  };
44
44
 
45
45
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ks-digital-designsystem-angular-__internals.mjs","sources":["../../../../packages/angular/__internals/src/colors.ts","../../../../packages/angular/__internals/src/common-inputs.ts","../../../../packages/angular/__internals/src/log-if-devmode.ts","../../../../packages/angular/__internals/src/random-id.ts","../../../../packages/angular/__internals/src/ks-digital-designsystem-angular-__internals.ts"],"sourcesContent":["/**\nLifted from https://github.com/digdir/designsystemet/blob/main/packages/react/src/colors.ts\n**/\n\n// EmptyObject implementation from https://github.com/sindresorhus/type-fest/blob/main/source/empty-object.d.ts\ndeclare const emptyObjectSymbol: unique symbol\ntype EmptyObject = { [emptyObjectSymbol]?: never }\n\n/**\n * Base interface for available colors in the design system.\n * The CLI will generate augmentations of this interface to allow\n * type safety of custom color names.\n */\n\n// eslint-disable-next-line\nexport interface MainAndSupportColors {}\n\n/**\n * If {@link MainAndSupportColors} has been extended to include color names, return T,\n * otherwise return the arbitrary string type.\n */\ntype ColorWithFallback<T> = MainAndSupportColors extends EmptyObject\n ? string\n : T\n\nexport type SeverityInfo = 'info'\nexport type SeveritySuccess = 'success'\nexport type SeverityWarning = 'warning'\nexport type SeverityDanger = 'danger'\nexport type SeverityColors =\n | SeverityInfo\n | SeveritySuccess\n | SeverityWarning\n | SeverityDanger\n\nexport type Color = ColorWithFallback<'neutral' | keyof MainAndSupportColors>\n","/* eslint-disable @angular-eslint/no-input-rename */\n\n/**\n * We use input aliasing to bridge the gap between Angular's camelCase property naming convention and our HTML data attributes.\n * This approach allows us to use valid HTML data attributes as documented by Designsystemet while maintaining\n * proper TypeScript intellisense support.\n *\n * Todo: Some components are using only a subset of colors, e.g., SeverityColors for Alert. We should reconsider this directive\n */\n\nimport { Directive, input } from '@angular/core'\nimport { Color } from './colors'\n\nexport type Size = 'sm' | 'md' | 'lg'\n\n@Directive()\nexport class CommonInputs {\n /**\n * Changes size for descendant Designsystemet components. Select from predefined sizes.\n * @attribute data-size\n */\n dataSize = input<Size>(undefined, { alias: 'data-size' })\n\n /**\n * Changes color for descendant Designsystemet components.\n * Select from predefined colors and colors defined using theme.designsystemet.no.\n * @attribute data-color\n */\n dataColor = input<Color>(undefined, { alias: 'data-color' })\n}\n","import { isDevMode } from '@angular/core'\n\nexport const logIfDevMode = ({\n component,\n message,\n}: {\n component: string\n message: string\n}) => {\n if (isDevMode()) {\n console.log(`[${component}] ${message}`)\n }\n}\n","export const randomId = () => {\n return `:${Math.random().toString(36).slice(2, 7)}`\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;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,EAAE;AACrD;;ACFA;;AAEG;;;;"}
1
+ {"version":3,"file":"ks-digital-designsystem-angular-__internals.mjs","sources":["../../../../packages/angular/__internals/src/colors.ts","../../../../packages/angular/__internals/src/common-inputs.ts","../../../../packages/angular/__internals/src/log-if-devmode.ts","../../../../packages/angular/__internals/src/random-id.ts","../../../../packages/angular/__internals/src/ks-digital-designsystem-angular-__internals.ts"],"sourcesContent":["/**\nLifted from https://github.com/digdir/designsystemet/blob/main/packages/react/src/colors.ts\n**/\n\n// EmptyObject implementation from https://github.com/sindresorhus/type-fest/blob/main/source/empty-object.d.ts\ndeclare const emptyObjectSymbol: unique symbol\ntype EmptyObject = { [emptyObjectSymbol]?: never }\n\n/**\n * Base interface for available colors in the design system.\n * The CLI will generate augmentations of this interface to allow\n * type safety of custom color names.\n */\n\n// eslint-disable-next-line\nexport interface MainAndSupportColors {}\n\n/**\n * If {@link MainAndSupportColors} has been extended to include color names, return T,\n * otherwise return the arbitrary string type.\n */\ntype ColorWithFallback<T> = MainAndSupportColors extends EmptyObject\n ? string\n : T\n\nexport type SeverityInfo = 'info'\nexport type SeveritySuccess = 'success'\nexport type SeverityWarning = 'warning'\nexport type SeverityDanger = 'danger'\nexport type SeverityColors =\n | SeverityInfo\n | SeveritySuccess\n | SeverityWarning\n | SeverityDanger\n\nexport type Color = ColorWithFallback<'neutral' | keyof MainAndSupportColors>\n","/* eslint-disable @angular-eslint/no-input-rename */\n\n/**\n * We use input aliasing to bridge the gap between Angular's camelCase property naming convention and our HTML data attributes.\n * This approach allows us to use valid HTML data attributes as documented by Designsystemet while maintaining\n * proper TypeScript intellisense support.\n *\n * Todo: Some components are using only a subset of colors, e.g., SeverityColors for Alert. We should reconsider this directive\n */\n\nimport { Directive, input } from '@angular/core'\nimport { Color } from './colors'\n\nexport type Size = 'sm' | 'md' | 'lg'\n\n@Directive()\nexport class CommonInputs {\n /**\n * Changes size for descendant Designsystemet components. Select from predefined sizes.\n * @attribute data-size\n */\n dataSize = input<Size>(undefined, { alias: 'data-size' })\n\n /**\n * Changes color for descendant Designsystemet components.\n * Select from predefined colors and colors defined using theme.designsystemet.no.\n * @attribute data-color\n */\n dataColor = input<Color>(undefined, { alias: 'data-color' })\n}\n","import { isDevMode } from '@angular/core'\n\nexport const logIfDevMode = ({\n component,\n message,\n}: {\n component: string\n message: string\n}) => {\n if (isDevMode()) {\n console.log(`[${component}] ${message}`)\n }\n}\n","export const randomId = () => {\n return `${Math.random().toString(36).slice(2, 7)}`\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;AAEG;;ACFH;AAEA;;;;;;AAMG;MAQU,YAAY,CAAA;AACvB;;;AAGG;AACH,IAAA,QAAQ,GAAG,KAAK,CAAO,SAAS,4CAAI,KAAK,EAAE,WAAW,EAAA,CAAA,GAAA,CAApB,EAAE,KAAK,EAAE,WAAW,EAAE,GAAC;AAEzD;;;;AAIG;AACH,IAAA,SAAS,GAAG,KAAK,CAAQ,SAAS,6CAAI,KAAK,EAAE,YAAY,EAAA,CAAA,GAAA,CAArB,EAAE,KAAK,EAAE,YAAY,EAAE,GAAC;uGAZjD,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB;;;ACbM,MAAM,YAAY,GAAG,CAAC,EAC3B,SAAS,EACT,OAAO,GAIR,KAAI;IACH,IAAI,SAAS,EAAE,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,CAAA,CAAA,EAAI,SAAS,CAAA,EAAA,EAAK,OAAO,CAAA,CAAE,CAAC;IAC1C;AACF;;ACZO,MAAM,QAAQ,GAAG,MAAK;AAC3B,IAAA,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AACpD;;ACFA;;AAEG;;;;"}
@@ -0,0 +1,199 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, inject, ElementRef, signal, computed, ChangeDetectionStrategy, Component, model, contentChildren, effect } from '@angular/core';
3
+ import * as i1 from '@ks-digital/designsystem-angular/__internals';
4
+ import { randomId, CommonInputs } from '@ks-digital/designsystem-angular/__internals';
5
+
6
+ class TabsTab {
7
+ /**
8
+ * Unique value that will be set in the Tabs components state when the tab is activated
9
+ */
10
+ value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
11
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
12
+ elementRef = inject(ElementRef);
13
+ ariaControls = signal(undefined, ...(ngDevMode ? [{ debugName: "ariaControls" }] : []));
14
+ buttonId = computed(() => this.id() ?? 'tab-' + randomId(), ...(ngDevMode ? [{ debugName: "buttonId" }] : []));
15
+ tabs = inject(Tabs);
16
+ isFocused = computed(() => this.tabs.focusedValue() === this.value(), ...(ngDevMode ? [{ debugName: "isFocused" }] : []));
17
+ isSelected = computed(() => this.tabs.value() === this.value(), ...(ngDevMode ? [{ debugName: "isSelected" }] : []));
18
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: TabsTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
19
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.9", type: TabsTab, isStandalone: true, selector: "button[ksd-tabs-tab]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tab" }, listeners: { "click": "tabs.changeTab(value())", "keydown": "tabs.onKeyDown($event)" }, properties: { "id": "buttonId()", "attr.aria-controls": "ariaControls()", "attr.aria-selected": "isSelected()", "attr.tab-index": "isFocused() ? 0 : -1" }, classAttribute: "ds-button" }, hostDirectives: [{ directive: i1.CommonInputs, inputs: ["data-size", "data-size", "data-color", "data-color"] }], ngImport: i0, template: ` <ng-content /> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
20
+ }
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: TabsTab, decorators: [{
22
+ type: Component,
23
+ args: [{
24
+ selector: `button[ksd-tabs-tab]`,
25
+ template: ` <ng-content /> `,
26
+ host: {
27
+ role: 'tab',
28
+ class: 'ds-button',
29
+ '[id]': 'buttonId()',
30
+ '[attr.aria-controls]': 'ariaControls()',
31
+ '[attr.aria-selected]': 'isSelected()',
32
+ '[attr.tab-index]': 'isFocused() ? 0 : -1',
33
+ '(click)': 'tabs.changeTab(value())',
34
+ '(keydown)': 'tabs.onKeyDown($event)',
35
+ },
36
+ changeDetection: ChangeDetectionStrategy.OnPush,
37
+ imports: [],
38
+ hostDirectives: [
39
+ {
40
+ directive: CommonInputs,
41
+ inputs: ['data-size', 'data-color'],
42
+ },
43
+ ],
44
+ }]
45
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
46
+
47
+ class Tabs {
48
+ defaultValue = input(...(ngDevMode ? [undefined, { debugName: "defaultValue" }] : []));
49
+ value = model('', ...(ngDevMode ? [{ debugName: "value" }] : []));
50
+ focusedValue = computed(() => this.tabs()[this.focusedIndex()]?.value(), ...(ngDevMode ? [{ debugName: "focusedValue" }] : []));
51
+ tabs = contentChildren(TabsTab, ...(ngDevMode ? [{ debugName: "tabs", descendants: true }] : [{ descendants: true }]));
52
+ focusedIndex = signal(0, ...(ngDevMode ? [{ debugName: "focusedIndex" }] : []));
53
+ constructor() {
54
+ effect(() => {
55
+ if (!this.value()) {
56
+ const value = this.defaultValue();
57
+ if (undefined !== value) {
58
+ this.changeTab(value);
59
+ }
60
+ }
61
+ });
62
+ }
63
+ onKeyDown(event) {
64
+ switch (event.code) {
65
+ case 'ArrowLeft':
66
+ case 'ArrowUp':
67
+ this.focusTab((this.focusedIndex() + this.tabs().length - 1) % this.tabs().length);
68
+ event.preventDefault();
69
+ break;
70
+ case 'ArrowRight':
71
+ case 'ArrowDown':
72
+ this.focusTab((this.focusedIndex() + 1) % this.tabs().length);
73
+ event.preventDefault();
74
+ break;
75
+ case 'Enter':
76
+ case 'Space':
77
+ {
78
+ const value = this.focusedValue();
79
+ if (value) {
80
+ this.changeTab(value);
81
+ }
82
+ }
83
+ event.preventDefault();
84
+ break;
85
+ case 'Home':
86
+ this.focusTab(0);
87
+ event.preventDefault();
88
+ break;
89
+ case 'End':
90
+ this.focusTab(this.tabs().length - 1);
91
+ event.preventDefault();
92
+ break;
93
+ }
94
+ }
95
+ changeTab(value) {
96
+ const index = this.tabs().findIndex((tab) => tab.value() === value);
97
+ this.value.set(value);
98
+ this.focusTab(index);
99
+ }
100
+ focusTab(index) {
101
+ this.focusedIndex.set(index);
102
+ this.tabs()[index]?.elementRef.nativeElement.focus();
103
+ }
104
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
105
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.9", type: Tabs, isStandalone: true, selector: "ksd-tabs", inputs: { defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, queries: [{ propertyName: "tabs", predicate: TabsTab, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.CommonInputs, inputs: ["data-size", "data-size", "data-color", "data-color"] }], ngImport: i0, template: `
106
+ <div class="ds-tabs">
107
+ <ng-content select="ksd-tabs-list" />
108
+ <ng-content select="ksd-tabs-panel" />
109
+ </div>
110
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
111
+ }
112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Tabs, decorators: [{
113
+ type: Component,
114
+ args: [{
115
+ selector: `ksd-tabs`,
116
+ template: `
117
+ <div class="ds-tabs">
118
+ <ng-content select="ksd-tabs-list" />
119
+ <ng-content select="ksd-tabs-panel" />
120
+ </div>
121
+ `,
122
+ changeDetection: ChangeDetectionStrategy.OnPush,
123
+ hostDirectives: [
124
+ {
125
+ directive: CommonInputs,
126
+ inputs: ['data-size', 'data-color'],
127
+ },
128
+ ],
129
+ }]
130
+ }], ctorParameters: () => [], propDecorators: { defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabsTab), { ...{ descendants: true }, isSignal: true }] }] } });
131
+
132
+ class TabsList {
133
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: TabsList, deps: [], target: i0.ɵɵFactoryTarget.Component });
134
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.9", type: TabsList, isStandalone: true, selector: "ksd-tabs-list", host: { attributes: { "role": "tablist" } }, ngImport: i0, template: `<ng-content select="button[ksd-tabs-tab]" />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
135
+ }
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: TabsList, decorators: [{
137
+ type: Component,
138
+ args: [{
139
+ selector: `ksd-tabs-list`,
140
+ template: `<ng-content select="button[ksd-tabs-tab]" />`,
141
+ host: {
142
+ role: 'tablist',
143
+ },
144
+ changeDetection: ChangeDetectionStrategy.OnPush,
145
+ }]
146
+ }] });
147
+
148
+ class TabsPanel {
149
+ elementRef = inject(ElementRef);
150
+ group = inject(Tabs);
151
+ hasTabbableElement = signal(false, ...(ngDevMode ? [{ debugName: "hasTabbableElement" }] : []));
152
+ /**
153
+ * When this value is selected as the current state, render this TabsPanel component. Must match the value of a Tabs.Tab component.
154
+ */
155
+ value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
156
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
157
+ labelledBy = computed(() => this.group
158
+ .tabs()
159
+ .find((tab) => tab.value() === this.value())
160
+ ?.buttonId(), ...(ngDevMode ? [{ debugName: "labelledBy" }] : []));
161
+ panelId = computed(() => this.id() ?? 'tabpanel-' + randomId(), ...(ngDevMode ? [{ debugName: "panelId" }] : []));
162
+ isSelected = computed(() => this.group.value() === this.value(), ...(ngDevMode ? [{ debugName: "isSelected" }] : []));
163
+ tabIndex = computed(() => (this.hasTabbableElement() ? -1 : 0), ...(ngDevMode ? [{ debugName: "tabIndex" }] : []));
164
+ constructor() {
165
+ effect(() => {
166
+ this.group
167
+ .tabs()
168
+ .find((tab) => tab.value() === this.value())
169
+ ?.ariaControls.set(this.panelId());
170
+ });
171
+ }
172
+ ngAfterContentInit() {
173
+ this.hasTabbableElement.set(this.elementRef.nativeElement.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
174
+ }
175
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: TabsPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
176
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.9", type: TabsPanel, isStandalone: true, selector: "ksd-tabs-panel", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tabpanel" }, properties: { "id": "panelId()", "hidden": "!isSelected()", "attr.aria-labelledby": "labelledBy()", "tabIndex": "tabIndex()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
177
+ }
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: TabsPanel, decorators: [{
179
+ type: Component,
180
+ args: [{
181
+ selector: `ksd-tabs-panel`,
182
+ template: `<ng-content />`,
183
+ host: {
184
+ role: 'tabpanel',
185
+ '[id]': 'panelId()',
186
+ '[hidden]': '!isSelected()',
187
+ '[attr.aria-labelledby]': 'labelledBy()',
188
+ '[tabIndex]': 'tabIndex()',
189
+ },
190
+ changeDetection: ChangeDetectionStrategy.OnPush,
191
+ }]
192
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
193
+
194
+ /**
195
+ * Generated bundle index. Do not edit.
196
+ */
197
+
198
+ export { Tabs, TabsList, TabsPanel, TabsTab };
199
+ //# sourceMappingURL=ks-digital-designsystem-angular-tabs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ks-digital-designsystem-angular-tabs.mjs","sources":["../../../../packages/angular/tabs/src/tabs-tab.ts","../../../../packages/angular/tabs/src/tabs.ts","../../../../packages/angular/tabs/src/tabs-list.ts","../../../../packages/angular/tabs/src/tabs-panel.ts","../../../../packages/angular/tabs/src/ks-digital-designsystem-angular-tabs.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport {\n CommonInputs,\n randomId,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { Tabs } from './tabs'\n\n@Component({\n selector: `button[ksd-tabs-tab]`,\n template: ` <ng-content /> `,\n host: {\n role: 'tab',\n class: 'ds-button',\n '[id]': 'buttonId()',\n '[attr.aria-controls]': 'ariaControls()',\n '[attr.aria-selected]': 'isSelected()',\n '[attr.tab-index]': 'isFocused() ? 0 : -1',\n '(click)': 'tabs.changeTab(value())',\n '(keydown)': 'tabs.onKeyDown($event)',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [],\n hostDirectives: [\n {\n directive: CommonInputs,\n inputs: ['data-size', 'data-color'],\n },\n ],\n})\nexport class TabsTab {\n /**\n * Unique value that will be set in the Tabs components state when the tab is activated\n */\n readonly value = input.required<string>()\n readonly id = input<string>()\n readonly elementRef = inject(ElementRef)\n readonly ariaControls = signal<string | undefined>(undefined)\n readonly buttonId = computed(() => this.id() ?? 'tab-' + randomId())\n\n protected tabs = inject(Tabs)\n protected isFocused = computed(\n () => this.tabs.focusedValue() === this.value(),\n )\n protected isSelected = computed(() => this.tabs.value() === this.value())\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n effect,\n input,\n model,\n signal,\n} from '@angular/core'\nimport { CommonInputs } from '@ks-digital/designsystem-angular/__internals'\nimport { TabsTab } from './tabs-tab'\n\n@Component({\n selector: `ksd-tabs`,\n template: `\n <div class=\"ds-tabs\">\n <ng-content select=\"ksd-tabs-list\" />\n <ng-content select=\"ksd-tabs-panel\" />\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CommonInputs,\n inputs: ['data-size', 'data-color'],\n },\n ],\n})\nexport class Tabs {\n readonly defaultValue = input<string>()\n readonly value = model<string>('')\n readonly focusedValue = computed(() =>\n this.tabs()[this.focusedIndex()]?.value(),\n )\n readonly tabs = contentChildren(TabsTab, { descendants: true })\n private focusedIndex = signal<number>(0)\n\n constructor() {\n effect(() => {\n if (!this.value()) {\n const value = this.defaultValue()\n if (undefined !== value) {\n this.changeTab(value)\n }\n }\n })\n }\n\n onKeyDown(event: KeyboardEvent) {\n switch (event.code) {\n case 'ArrowLeft':\n case 'ArrowUp':\n this.focusTab(\n (this.focusedIndex() + this.tabs().length - 1) % this.tabs().length,\n )\n event.preventDefault()\n break\n case 'ArrowRight':\n case 'ArrowDown':\n this.focusTab((this.focusedIndex() + 1) % this.tabs().length)\n event.preventDefault()\n break\n case 'Enter':\n case 'Space':\n {\n const value = this.focusedValue()\n if (value) {\n this.changeTab(value)\n }\n }\n event.preventDefault()\n break\n case 'Home':\n this.focusTab(0)\n event.preventDefault()\n break\n case 'End':\n this.focusTab(this.tabs().length - 1)\n event.preventDefault()\n break\n }\n }\n\n public changeTab(value: string) {\n const index = this.tabs().findIndex((tab) => tab.value() === value)\n this.value.set(value)\n this.focusTab(index)\n }\n\n private focusTab(index: number) {\n this.focusedIndex.set(index)\n this.tabs()[index]?.elementRef.nativeElement.focus()\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: `ksd-tabs-list`,\n template: `<ng-content select=\"button[ksd-tabs-tab]\" />`,\n host: {\n role: 'tablist',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TabsList {}\n","import {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { randomId } from '@ks-digital/designsystem-angular/__internals'\nimport { Tabs } from './tabs'\n\n@Component({\n selector: `ksd-tabs-panel`,\n template: `<ng-content />`,\n host: {\n role: 'tabpanel',\n '[id]': 'panelId()',\n '[hidden]': '!isSelected()',\n '[attr.aria-labelledby]': 'labelledBy()',\n '[tabIndex]': 'tabIndex()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TabsPanel implements AfterContentInit {\n private elementRef = inject(ElementRef)\n private group = inject(Tabs)\n private hasTabbableElement = signal(false)\n\n /**\n * When this value is selected as the current state, render this TabsPanel component. Must match the value of a Tabs.Tab component.\n */\n readonly value = input.required<string>()\n readonly id = input<string>()\n\n protected readonly labelledBy = computed(() =>\n this.group\n .tabs()\n .find((tab) => tab.value() === this.value())\n ?.buttonId(),\n )\n protected readonly panelId = computed(\n () => this.id() ?? 'tabpanel-' + randomId(),\n )\n protected isSelected = computed(() => this.group.value() === this.value())\n protected tabIndex = computed(() => (this.hasTabbableElement() ? -1 : 0))\n\n constructor() {\n effect(() => {\n this.group\n .tabs()\n .find((tab) => tab.value() === this.value())\n ?.ariaControls.set(this.panelId())\n })\n }\n\n ngAfterContentInit(): void {\n this.hasTabbableElement.set(\n this.elementRef.nativeElement.querySelector(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n ),\n )\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAqCa,OAAO,CAAA;AAClB;;AAEG;AACM,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAU;IAChC,EAAE,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AACpB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,YAAY,GAAG,MAAM,CAAqB,SAAS,wDAAC;AACpD,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,EAAE,IAAI,MAAM,GAAG,QAAQ,EAAE,oDAAC;AAE1D,IAAA,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;AACnB,IAAA,SAAS,GAAG,QAAQ,CAC5B,MAAM,IAAI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digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/forms`.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/ks-no/designsystem.git",
6
6
  "directory": "packages/angular"
7
7
  },
8
- "version": "0.0.1-alpha.28",
8
+ "version": "0.0.1-alpha.30",
9
9
  "license": "MIT",
10
10
  "private": false,
11
11
  "publishConfig": {
@@ -70,6 +70,10 @@
70
70
  "types": "./spinner/index.d.ts",
71
71
  "default": "./fesm2022/ks-digital-designsystem-angular-spinner.mjs"
72
72
  },
73
+ "./tabs": {
74
+ "types": "./tabs/index.d.ts",
75
+ "default": "./fesm2022/ks-digital-designsystem-angular-tabs.mjs"
76
+ },
73
77
  "./validation-message": {
74
78
  "types": "./validation-message/index.d.ts",
75
79
  "default": "./fesm2022/ks-digital-designsystem-angular-validation-message.mjs"
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/paragraph
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/paragraph`.
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/popover
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/popover`.
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/search
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/search`.
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/spinner
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/spinner`.
package/tabs/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/tabs
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/tabs`.
@@ -0,0 +1,59 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ElementRef, AfterContentInit } from '@angular/core';
3
+ import * as i1 from '@ks-digital/designsystem-angular/__internals';
4
+
5
+ declare class TabsTab {
6
+ /**
7
+ * Unique value that will be set in the Tabs components state when the tab is activated
8
+ */
9
+ readonly value: _angular_core.InputSignal<string>;
10
+ readonly id: _angular_core.InputSignal<string | undefined>;
11
+ readonly elementRef: ElementRef<any>;
12
+ readonly ariaControls: _angular_core.WritableSignal<string | undefined>;
13
+ readonly buttonId: _angular_core.Signal<string>;
14
+ protected tabs: Tabs;
15
+ protected isFocused: _angular_core.Signal<boolean>;
16
+ protected isSelected: _angular_core.Signal<boolean>;
17
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabsTab, never>;
18
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabsTab, "button[ksd-tabs-tab]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.CommonInputs; inputs: { "data-size": "data-size"; "data-color": "data-color"; }; outputs: {}; }]>;
19
+ }
20
+
21
+ declare class Tabs {
22
+ readonly defaultValue: _angular_core.InputSignal<string | undefined>;
23
+ readonly value: _angular_core.ModelSignal<string>;
24
+ readonly focusedValue: _angular_core.Signal<string>;
25
+ readonly tabs: _angular_core.Signal<readonly TabsTab[]>;
26
+ private focusedIndex;
27
+ constructor();
28
+ onKeyDown(event: KeyboardEvent): void;
29
+ changeTab(value: string): void;
30
+ private focusTab;
31
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Tabs, never>;
32
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Tabs, "ksd-tabs", never, { "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["tabs"], ["ksd-tabs-list", "ksd-tabs-panel"], true, [{ directive: typeof i1.CommonInputs; inputs: { "data-size": "data-size"; "data-color": "data-color"; }; outputs: {}; }]>;
33
+ }
34
+
35
+ declare class TabsList {
36
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabsList, never>;
37
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabsList, "ksd-tabs-list", never, {}, {}, never, ["button[ksd-tabs-tab]"], true, never>;
38
+ }
39
+
40
+ declare class TabsPanel implements AfterContentInit {
41
+ private elementRef;
42
+ private group;
43
+ private hasTabbableElement;
44
+ /**
45
+ * When this value is selected as the current state, render this TabsPanel component. Must match the value of a Tabs.Tab component.
46
+ */
47
+ readonly value: _angular_core.InputSignal<string>;
48
+ readonly id: _angular_core.InputSignal<string | undefined>;
49
+ protected readonly labelledBy: _angular_core.Signal<string | undefined>;
50
+ protected readonly panelId: _angular_core.Signal<string>;
51
+ protected isSelected: _angular_core.Signal<boolean>;
52
+ protected tabIndex: _angular_core.Signal<0 | -1>;
53
+ constructor();
54
+ ngAfterContentInit(): void;
55
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabsPanel, never>;
56
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabsPanel, "ksd-tabs-panel", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
57
+ }
58
+
59
+ export { Tabs, TabsList, TabsPanel, TabsTab };
@@ -0,0 +1,3 @@
1
+ # @ks-digital/designsystem-angular/validation-message
2
+
3
+ Secondary entry point of `@ks-digital/designsystem-angular`. It can be used by importing from `@ks-digital/designsystem-angular/validation-message`.