|
1 | | -// This file defines public types used in the Designsystemet |
2 | | - |
3 | | -// EmptyObject implementation from https://github.com/sindresorhus/type-fest/blob/main/source/empty-object.d.ts |
4 | | -declare const emptyObjectSymbol: unique symbol; |
5 | | -type EmptyObject = { [emptyObjectSymbol]?: never }; |
6 | | - |
7 | | -/** |
8 | | - * Base interface for available colors in Designsystemet. |
9 | | - * The CLI will generate augmentations of this interface to allow |
10 | | - * type safety of custom color names. |
11 | | - */ |
12 | | - |
13 | | -// biome-ignore lint/suspicious/noEmptyInterface: used for interface augmentation |
14 | | -export interface ColorDefinitions {} |
15 | | -// biome-ignore lint/suspicious/noEmptyInterface: used for interface augmentation |
16 | | -export interface SeverityColorDefinitions {} |
17 | | - |
18 | | -/** |
19 | | - * If {@link ColorDefinitions} or {@link SeverityColorDefinitions} has been extended to include color names, return T, |
20 | | - * otherwise return the arbitrary string type. |
| 1 | +/*! |
| 2 | + * This file is deprecated and will be removed in a future release. |
| 3 | + * Use @digdir/designsystemet-types instead |
21 | 4 | */ |
22 | | -type ColorWithFallback<T> = ColorDefinitions extends EmptyObject ? string : T; |
23 | 5 |
|
24 | | -/** |
25 | | - * Represents the available severity colors for the Designsystemet variables. |
26 | | - * These are predefined colors that can be used to indicate different levels of severity. |
27 | | - * - `'info'`: Use the info color. |
28 | | - * - `'success'`: Use the success color. |
29 | | - * - `'warning'`: Use the warning color. |
30 | | - * - `'danger'`: Use the danger color. |
31 | | - */ |
32 | | -export type SeverityColors = ColorWithFallback<keyof SeverityColorDefinitions>; |
33 | | -/** |
34 | | - * Represents the available color options for the Designsystemet variables. |
35 | | - * |
36 | | - * These are augmented based on your theme configuration. |
37 | | - * |
38 | | - * Consist of both main and support colors |
39 | | - * @link https://theme.designsystemet.no |
40 | | - */ |
41 | | -export type Color = ColorWithFallback<keyof ColorDefinitions>; |
42 | | -/** |
43 | | - * Represents the recommended size options for the Designsystemet variables. |
44 | | - * - `'sm'`: Use the small size. |
45 | | - * - `'md'`: Use the medium size. |
46 | | - * - `'lg'`: Use the large size. |
47 | | - */ |
48 | | -export type Size = 'sm' | 'md' | 'lg'; |
49 | | -/** |
50 | | - * Represents the available color scheme options for the Designsystemet variables. |
51 | | - * - `'light'`: Use the light color scheme. |
52 | | - * - `'dark'`: Use the dark color scheme. |
53 | | - * - `'auto'`: Automatically select the color scheme based on system preferences. |
54 | | - */ |
55 | | -export type ColorScheme = 'light' | 'dark' | 'auto'; |
| 6 | +export * from '@digdir/designsystemet-types'; |
0 commit comments