@digdir/designsystemet-types 0.0.0-react-side-effects-20260113071010

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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2024 Digitaliseringsdirektoratet (Digdir)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,52 @@
1
+ declare const emptyObjectSymbol: unique symbol;
2
+ type EmptyObject = {
3
+ [emptyObjectSymbol]?: never;
4
+ };
5
+ /**
6
+ * Base interface for available colors in Designsystemet.
7
+ * The CLI will generate augmentations of this interface to allow
8
+ * type safety of custom color names.
9
+ */
10
+ export interface ColorDefinitions {
11
+ }
12
+ export interface SeverityColorDefinitions {
13
+ }
14
+ /**
15
+ * If {@link ColorDefinitions} or {@link SeverityColorDefinitions} has been extended to include color names, return T,
16
+ * otherwise return the arbitrary string type.
17
+ */
18
+ type ColorWithFallback<T> = ColorDefinitions extends EmptyObject ? string : T;
19
+ /**
20
+ * Represents the available severity colors for the Designsystemet variables.
21
+ * These are predefined colors that can be used to indicate different levels of severity.
22
+ * - `'info'`: Use the info color.
23
+ * - `'success'`: Use the success color.
24
+ * - `'warning'`: Use the warning color.
25
+ * - `'danger'`: Use the danger color.
26
+ */
27
+ export type SeverityColors = ColorWithFallback<keyof SeverityColorDefinitions>;
28
+ /**
29
+ * Represents the available color options for the Designsystemet variables.
30
+ *
31
+ * These are augmented based on your theme configuration.
32
+ *
33
+ * Consist of both main and support colors
34
+ * @link https://theme.designsystemet.no
35
+ */
36
+ export type Color = ColorWithFallback<keyof ColorDefinitions>;
37
+ /**
38
+ * Represents the recommended size options for the Designsystemet variables.
39
+ * - `'sm'`: Use the small size.
40
+ * - `'md'`: Use the medium size.
41
+ * - `'lg'`: Use the large size.
42
+ */
43
+ export type Size = 'sm' | 'md' | 'lg';
44
+ /**
45
+ * Represents the available color scheme options for the Designsystemet variables.
46
+ * - `'light'`: Use the light color scheme.
47
+ * - `'dark'`: Use the dark color scheme.
48
+ * - `'auto'`: Automatically select the color scheme based on system preferences.
49
+ */
50
+ export type ColorScheme = 'light' | 'dark' | 'auto';
51
+ export {};
52
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,MAAM,CAAC;AAC/C,KAAK,WAAW,GAAG;IAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnD;;;;GAIG;AAGH,MAAM,WAAW,gBAAgB;CAAG;AAEpC,MAAM,WAAW,wBAAwB;CAAG;AAE5C;;;GAGG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI,gBAAgB,SAAS,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,wBAAwB,CAAC,CAAC;AAC/E;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAC9D;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACtC;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC"}
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@digdir/designsystemet-types",
3
+ "version": "0.0.0-react-side-effects-20260113071010",
4
+ "description": "Types used by Designsystemet themes",
5
+ "author": "Designsystemet team",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/digdir/designsystemet.git"
9
+ },
10
+ "homepage": "https://github.com/digdir/designsystemet/tree/main/packages/types",
11
+ "license": "MIT",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/types.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "./dist"
19
+ ],
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "scripts": {
24
+ "build": "tsc"
25
+ }
26
+ }