@ks-digital/designsystem-angular 0.0.1-alpha.30 → 0.0.1-alpha.31
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/__internals/index.d.ts
CHANGED
|
@@ -1,32 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Size } from '@digdir/designsystemet/types';
|
|
3
|
+
export { Color, SeverityColors, Size } from '@digdir/designsystemet/types';
|
|
2
4
|
|
|
3
|
-
/**
|
|
4
|
-
Lifted from https://github.com/digdir/designsystemet/blob/main/packages/react/src/colors.ts
|
|
5
|
-
**/
|
|
6
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
7
|
-
type EmptyObject = {
|
|
8
|
-
[emptyObjectSymbol]?: never;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Base interface for available colors in the design system.
|
|
12
|
-
* The CLI will generate augmentations of this interface to allow
|
|
13
|
-
* type safety of custom color names.
|
|
14
|
-
*/
|
|
15
|
-
interface MainAndSupportColors {
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* If {@link MainAndSupportColors} has been extended to include color names, return T,
|
|
19
|
-
* otherwise return the arbitrary string type.
|
|
20
|
-
*/
|
|
21
|
-
type ColorWithFallback<T> = MainAndSupportColors extends EmptyObject ? string : T;
|
|
22
|
-
type SeverityInfo = 'info';
|
|
23
|
-
type SeveritySuccess = 'success';
|
|
24
|
-
type SeverityWarning = 'warning';
|
|
25
|
-
type SeverityDanger = 'danger';
|
|
26
|
-
type SeverityColors = SeverityInfo | SeveritySuccess | SeverityWarning | SeverityDanger;
|
|
27
|
-
type Color = ColorWithFallback<'neutral' | keyof MainAndSupportColors>;
|
|
28
|
-
|
|
29
|
-
type Size = 'sm' | 'md' | 'lg';
|
|
30
5
|
declare class CommonInputs {
|
|
31
6
|
/**
|
|
32
7
|
* Changes size for descendant Designsystemet components. Select from predefined sizes.
|
|
@@ -51,4 +26,3 @@ declare const logIfDevMode: ({ component, message, }: {
|
|
|
51
26
|
declare const randomId: () => string;
|
|
52
27
|
|
|
53
28
|
export { CommonInputs, logIfDevMode, randomId };
|
|
54
|
-
export type { Color, MainAndSupportColors, SeverityColors, SeverityDanger, SeverityInfo, SeveritySuccess, SeverityWarning, Size };
|
package/alert/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import * as i1 from '@ks-digital/designsystem-angular/__internals';
|
|
3
|
-
import { SeverityColors } from '@ks-digital/designsystem-angular/__internals';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Alerts are used to inform users about important information, warnings, errors, or success.
|
|
@@ -9,7 +8,7 @@ declare class Alert {
|
|
|
9
8
|
/**
|
|
10
9
|
* The color variant of the alert.
|
|
11
10
|
*/
|
|
12
|
-
dataColor: i0.InputSignal<
|
|
11
|
+
dataColor: i0.InputSignal<string | undefined>;
|
|
13
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<Alert, never>;
|
|
14
13
|
static ɵcmp: i0.ɵɵComponentDeclaration<Alert, "ksd-alert", never, { "dataColor": { "alias": "data-color"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.CommonInputs; inputs: { "data-size": "data-size"; }; outputs: {}; }]>;
|
|
15
14
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, Directive, isDevMode } from '@angular/core';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
Lifted from https://github.com/digdir/designsystemet/blob/main/packages/react/src/colors.ts
|
|
6
|
-
**/
|
|
7
|
-
|
|
8
4
|
/* eslint-disable @angular-eslint/no-input-rename */
|
|
9
5
|
/**
|
|
10
6
|
* We use input aliasing to bridge the gap between Angular's camelCase property naming convention and our HTML data attributes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ks-digital-designsystem-angular-__internals.mjs","sources":["../../../../packages/angular/__internals/src/
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-__internals.mjs","sources":["../../../../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":["/* 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 type { Color, Size } from '@digdir/designsystemet/types'\nexport type { Color, SeverityColors, Size } from '@digdir/designsystemet/types'\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;AAEA;;;;;;AAMG;MAOU,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,C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