@atls-ui/theme 0.3.0 → 0.5.0
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/CHANGELOG.md +31 -0
- package/dist/theme.d.ts +4 -0
- package/dist/theme.js +6 -0
- package/dist/tokens/borders/borders.d.ts +3 -0
- package/dist/tokens/borders/borders.js +32 -0
- package/dist/tokens/borders/constants.d.ts +10 -0
- package/dist/tokens/borders/constants.js +10 -0
- package/dist/tokens/borders/index.d.ts +4 -0
- package/dist/tokens/borders/index.js +3 -0
- package/dist/tokens/borders/interfaces.d.ts +19 -0
- package/dist/tokens/borders/interfaces.js +1 -0
- package/dist/tokens/borders/utils/createBorder.d.ts +3 -0
- package/dist/tokens/borders/utils/createBorder.js +1 -0
- package/dist/tokens/borders/utils/index.d.ts +1 -0
- package/dist/tokens/borders/utils/index.js +1 -0
- package/dist/tokens/colors/dark.js +1 -1
- package/dist/tokens/colors/light.js +1 -1
- package/dist/tokens/elevation/blurs.d.ts +13 -0
- package/dist/tokens/elevation/blurs.js +13 -0
- package/dist/tokens/elevation/elevations.d.ts +3 -0
- package/dist/tokens/elevation/elevations.js +155 -0
- package/dist/tokens/elevation/index.d.ts +6 -0
- package/dist/tokens/elevation/index.js +5 -0
- package/dist/tokens/elevation/interfaces.d.ts +31 -0
- package/dist/tokens/elevation/interfaces.js +1 -0
- package/dist/tokens/elevation/offsets.d.ts +10 -0
- package/dist/tokens/elevation/offsets.js +10 -0
- package/dist/tokens/elevation/spreads.d.ts +8 -0
- package/dist/tokens/elevation/spreads.js +8 -0
- package/dist/tokens/elevation/utils/createElevation.d.ts +3 -0
- package/dist/tokens/elevation/utils/createElevation.js +5 -0
- package/dist/tokens/elevation/utils/index.d.ts +1 -0
- package/dist/tokens/elevation/utils/index.js +1 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
# [0.5.0](https://github.com/atls/hyperion/compare/@atls-ui/theme@0.4.0...@atls-ui/theme@0.5.0) (2026-08-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* **theme:** align subtle action colors ([58f91ae](https://github.com/atls/hyperion/commit/58f91ae9bd16334a6845fbd77fa23e40fe5e2155))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
* **theme:** add web elevation tokens ([2c6639e](https://github.com/atls/hyperion/commit/2c6639ec0422c2bebac0b40852af7325994f2364))
|
|
15
|
+
* **theme:** expose web elevations ([a3b8e7d](https://github.com/atls/hyperion/commit/a3b8e7d2df052b382ad7b4d3bba08e79ec9d35d4))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# [0.4.0](https://github.com/atls/hyperion/compare/@atls-ui/theme@0.3.0...@atls-ui/theme@0.4.0) (2026-08-18)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
* **theme:** expose web borders ([6e0a7e8](https://github.com/atls/hyperion/commit/6e0a7e86272c8c36f819853ef3f9fd1ffbb6d000))
|
|
28
|
+
* **theme:** web borders tokens ([6422b3d](https://github.com/atls/hyperion/commit/6422b3d460623a752f14e48f312c3381a8b81ece))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
3
34
|
# [0.3.0](https://github.com/atls/hyperion/compare/@atls-ui/theme@0.2.0...@atls-ui/theme@0.3.0) (2026-08-13)
|
|
4
35
|
|
|
5
36
|
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { BordersTokens } from './tokens/index.js';
|
|
1
2
|
import type { Colors } from './tokens/index.js';
|
|
3
|
+
import type { ElevationsTokens } from './tokens/index.js';
|
|
2
4
|
import type { TypographyTokens } from './tokens/index.js';
|
|
3
5
|
export interface Theme {
|
|
6
|
+
borders: BordersTokens;
|
|
4
7
|
colors: Colors;
|
|
8
|
+
elevations: ElevationsTokens;
|
|
5
9
|
typography: TypographyTokens;
|
|
6
10
|
}
|
|
7
11
|
export declare const lightTheme: Theme;
|
package/dist/theme.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import { borders } from './tokens/index.js';
|
|
1
2
|
import { darkColors } from './tokens/index.js';
|
|
3
|
+
import { elevations } from './tokens/index.js';
|
|
2
4
|
import { lightColors } from './tokens/index.js';
|
|
3
5
|
import { typography } from './tokens/index.js';
|
|
4
6
|
export const lightTheme = {
|
|
7
|
+
borders: borders(lightColors),
|
|
5
8
|
colors: lightColors,
|
|
9
|
+
elevations: elevations(lightColors),
|
|
6
10
|
typography,
|
|
7
11
|
};
|
|
8
12
|
export const darkTheme = {
|
|
13
|
+
borders: borders(darkColors),
|
|
9
14
|
colors: darkColors,
|
|
15
|
+
elevations: elevations(darkColors),
|
|
10
16
|
typography,
|
|
11
17
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { borderStyles } from './constants.js';
|
|
2
|
+
import { borderWidths } from './constants.js';
|
|
3
|
+
import { createBorder } from './utils/index.js';
|
|
4
|
+
export const borders = (colors) => ({
|
|
5
|
+
neutral: {
|
|
6
|
+
default: createBorder(borderWidths.sm, borderStyles.solid, colors.surface.subtle),
|
|
7
|
+
hover: createBorder(borderWidths.sm, borderStyles.solid, colors.surface.muted),
|
|
8
|
+
pressed: createBorder(borderWidths.sm, borderStyles.solid, colors.surface.base),
|
|
9
|
+
focused: createBorder(borderWidths.sm, borderStyles.solid, colors.action.base),
|
|
10
|
+
disabled: createBorder(borderWidths.sm, borderStyles.solid, colors.surface.soft),
|
|
11
|
+
},
|
|
12
|
+
action: {
|
|
13
|
+
default: createBorder(borderWidths.sm, borderStyles.solid, colors.action.base),
|
|
14
|
+
hover: createBorder(borderWidths.sm, borderStyles.solid, colors.action.hover),
|
|
15
|
+
pressed: createBorder(borderWidths.sm, borderStyles.solid, colors.action.pressed),
|
|
16
|
+
focused: createBorder(borderWidths.md, borderStyles.solid, colors.action.base),
|
|
17
|
+
disabled: createBorder(borderWidths.sm, borderStyles.solid, colors.action.disabled),
|
|
18
|
+
},
|
|
19
|
+
danger: {
|
|
20
|
+
default: createBorder(borderWidths.sm, borderStyles.solid, colors.status.error),
|
|
21
|
+
hover: createBorder(borderWidths.sm, borderStyles.solid, colors.status.error),
|
|
22
|
+
pressed: createBorder(borderWidths.sm, borderStyles.solid, colors.status.error),
|
|
23
|
+
focused: createBorder(borderWidths.md, borderStyles.solid, colors.status.error),
|
|
24
|
+
disabled: createBorder(borderWidths.sm, borderStyles.solid, colors.surface.soft),
|
|
25
|
+
},
|
|
26
|
+
dropzone: {
|
|
27
|
+
default: createBorder(borderWidths.sm, borderStyles.dashed, colors.surface.muted),
|
|
28
|
+
hover: createBorder(borderWidths.sm, borderStyles.dashed, colors.action.hover),
|
|
29
|
+
focused: createBorder(borderWidths.md, borderStyles.dashed, colors.action.base),
|
|
30
|
+
disabled: createBorder(borderWidths.sm, borderStyles.dashed, colors.surface.soft),
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { borderStyles } from './constants.js';
|
|
2
|
+
import type { borderWidths } from './constants.js';
|
|
3
|
+
export type BorderStyle = (typeof borderStyles)[keyof typeof borderStyles];
|
|
4
|
+
export type BorderWidth = (typeof borderWidths)[keyof typeof borderWidths];
|
|
5
|
+
export interface BorderStates {
|
|
6
|
+
default: string;
|
|
7
|
+
hover: string;
|
|
8
|
+
focused: string;
|
|
9
|
+
disabled: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PressableBorderStates extends BorderStates {
|
|
12
|
+
pressed: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BordersTokens {
|
|
15
|
+
neutral: PressableBorderStates;
|
|
16
|
+
action: PressableBorderStates;
|
|
17
|
+
danger: PressableBorderStates;
|
|
18
|
+
dropzone: BorderStates;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const createBorder = (width, style, color) => `${width} ${style} ${color}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './createBorder.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./createBorder.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const shadowBlurs: {
|
|
2
|
+
readonly xs5: "1px";
|
|
3
|
+
readonly xs4: "2px";
|
|
4
|
+
readonly xs3: "3px";
|
|
5
|
+
readonly xs2: "4px";
|
|
6
|
+
readonly xs: "5px";
|
|
7
|
+
readonly sm: "6px";
|
|
8
|
+
readonly md: "8px";
|
|
9
|
+
readonly lg: "12px";
|
|
10
|
+
readonly xl: "14px";
|
|
11
|
+
readonly xl2: "16px";
|
|
12
|
+
readonly xl3: "20px";
|
|
13
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { shadowBlurs } from './blurs.js';
|
|
2
|
+
import { shadowOffsets } from './offsets.js';
|
|
3
|
+
import { shadowSpreads } from './spreads.js';
|
|
4
|
+
import { createElevation } from './utils/index.js';
|
|
5
|
+
export const elevations = (colors) => ({
|
|
6
|
+
xs: {
|
|
7
|
+
default: createElevation({
|
|
8
|
+
color: colors.elevation.xs,
|
|
9
|
+
offsetY: shadowOffsets.xs,
|
|
10
|
+
blur: shadowBlurs.xs4,
|
|
11
|
+
}),
|
|
12
|
+
hover: createElevation({
|
|
13
|
+
color: colors.elevation.xs,
|
|
14
|
+
offsetY: shadowOffsets.xs,
|
|
15
|
+
blur: shadowBlurs.xs3,
|
|
16
|
+
spread: shadowSpreads.xs,
|
|
17
|
+
}, {
|
|
18
|
+
color: colors.action.subtle,
|
|
19
|
+
offsetX: shadowOffsets.xs,
|
|
20
|
+
offsetY: shadowOffsets.md,
|
|
21
|
+
blur: shadowBlurs.sm,
|
|
22
|
+
spread: shadowSpreads.negativeSm,
|
|
23
|
+
}),
|
|
24
|
+
pressed: createElevation({
|
|
25
|
+
color: colors.elevation.xs,
|
|
26
|
+
offsetY: shadowOffsets.xs,
|
|
27
|
+
blur: shadowBlurs.xs5,
|
|
28
|
+
inset: true,
|
|
29
|
+
}, {
|
|
30
|
+
color: colors.elevation.xs,
|
|
31
|
+
offsetY: shadowOffsets.xs,
|
|
32
|
+
blur: shadowBlurs.xs5,
|
|
33
|
+
spread: shadowSpreads.negativeXs,
|
|
34
|
+
}),
|
|
35
|
+
disabled: createElevation({
|
|
36
|
+
color: colors.elevation.xs,
|
|
37
|
+
offsetY: shadowOffsets.xs,
|
|
38
|
+
blur: shadowBlurs.xs5,
|
|
39
|
+
}),
|
|
40
|
+
},
|
|
41
|
+
sm: {
|
|
42
|
+
default: createElevation({
|
|
43
|
+
color: colors.elevation.sm,
|
|
44
|
+
offsetY: shadowOffsets.sm,
|
|
45
|
+
blur: shadowBlurs.sm,
|
|
46
|
+
}),
|
|
47
|
+
hover: createElevation({
|
|
48
|
+
color: colors.elevation.sm,
|
|
49
|
+
offsetY: shadowOffsets.sm,
|
|
50
|
+
blur: shadowBlurs.md,
|
|
51
|
+
spread: shadowSpreads.xs,
|
|
52
|
+
}, {
|
|
53
|
+
color: colors.action.subtle,
|
|
54
|
+
offsetX: shadowOffsets.xs,
|
|
55
|
+
offsetY: shadowOffsets.lg,
|
|
56
|
+
blur: shadowBlurs.md,
|
|
57
|
+
spread: shadowSpreads.negativeSm,
|
|
58
|
+
}),
|
|
59
|
+
pressed: createElevation({
|
|
60
|
+
color: colors.elevation.sm,
|
|
61
|
+
offsetY: shadowOffsets.xs,
|
|
62
|
+
blur: shadowBlurs.xs4,
|
|
63
|
+
inset: true,
|
|
64
|
+
}, {
|
|
65
|
+
color: colors.elevation.sm,
|
|
66
|
+
offsetY: shadowOffsets.xs,
|
|
67
|
+
blur: shadowBlurs.xs3,
|
|
68
|
+
spread: shadowSpreads.negativeSm,
|
|
69
|
+
}),
|
|
70
|
+
disabled: createElevation({
|
|
71
|
+
color: colors.elevation.sm,
|
|
72
|
+
offsetY: shadowOffsets.xs,
|
|
73
|
+
blur: shadowBlurs.xs4,
|
|
74
|
+
}),
|
|
75
|
+
},
|
|
76
|
+
md: {
|
|
77
|
+
default: createElevation({
|
|
78
|
+
color: colors.elevation.md,
|
|
79
|
+
offsetY: shadowOffsets.lg,
|
|
80
|
+
blur: shadowBlurs.lg,
|
|
81
|
+
}),
|
|
82
|
+
hover: createElevation({
|
|
83
|
+
color: colors.elevation.md,
|
|
84
|
+
offsetY: shadowOffsets.lg,
|
|
85
|
+
blur: shadowBlurs.xl,
|
|
86
|
+
}, {
|
|
87
|
+
color: colors.action.subtle,
|
|
88
|
+
offsetX: shadowOffsets.xs,
|
|
89
|
+
offsetY: shadowOffsets.xl,
|
|
90
|
+
blur: shadowBlurs.xl,
|
|
91
|
+
spread: shadowSpreads.negativeLg,
|
|
92
|
+
}),
|
|
93
|
+
pressed: createElevation({
|
|
94
|
+
color: colors.elevation.md,
|
|
95
|
+
offsetY: shadowOffsets.xs,
|
|
96
|
+
blur: shadowBlurs.xs3,
|
|
97
|
+
inset: true,
|
|
98
|
+
}, {
|
|
99
|
+
color: colors.elevation.md,
|
|
100
|
+
offsetY: shadowOffsets.sm,
|
|
101
|
+
blur: shadowBlurs.sm,
|
|
102
|
+
spread: shadowSpreads.negativeXs,
|
|
103
|
+
}),
|
|
104
|
+
disabled: createElevation({
|
|
105
|
+
color: colors.elevation.md,
|
|
106
|
+
offsetY: shadowOffsets.sm,
|
|
107
|
+
blur: shadowBlurs.xs,
|
|
108
|
+
}),
|
|
109
|
+
},
|
|
110
|
+
lg: {
|
|
111
|
+
default: createElevation({
|
|
112
|
+
color: colors.elevation.lg,
|
|
113
|
+
offsetY: shadowOffsets.xl,
|
|
114
|
+
blur: shadowBlurs.lg,
|
|
115
|
+
spread: shadowSpreads.negativeLg,
|
|
116
|
+
}),
|
|
117
|
+
hover: createElevation({
|
|
118
|
+
color: colors.elevation.lg,
|
|
119
|
+
offsetY: shadowOffsets.xl2,
|
|
120
|
+
blur: shadowBlurs.xl2,
|
|
121
|
+
spread: shadowSpreads.negativeLg,
|
|
122
|
+
}, {
|
|
123
|
+
color: colors.action.subtle,
|
|
124
|
+
offsetX: shadowOffsets.xs,
|
|
125
|
+
offsetY: shadowOffsets.xl,
|
|
126
|
+
blur: shadowBlurs.md,
|
|
127
|
+
spread: shadowSpreads.negativeXs,
|
|
128
|
+
}),
|
|
129
|
+
pressed: createElevation({
|
|
130
|
+
color: colors.elevation.lg,
|
|
131
|
+
offsetY: shadowOffsets.sm,
|
|
132
|
+
blur: shadowBlurs.xs2,
|
|
133
|
+
inset: true,
|
|
134
|
+
}, {
|
|
135
|
+
color: colors.elevation.lg,
|
|
136
|
+
offsetY: shadowOffsets.md,
|
|
137
|
+
blur: shadowBlurs.md,
|
|
138
|
+
spread: shadowSpreads.negativeLg,
|
|
139
|
+
}),
|
|
140
|
+
disabled: createElevation({
|
|
141
|
+
color: colors.elevation.lg,
|
|
142
|
+
offsetY: shadowOffsets.md,
|
|
143
|
+
blur: shadowBlurs.sm,
|
|
144
|
+
spread: shadowSpreads.negativeMd,
|
|
145
|
+
}),
|
|
146
|
+
},
|
|
147
|
+
modal: {
|
|
148
|
+
default: createElevation({
|
|
149
|
+
color: colors.elevation.md,
|
|
150
|
+
offsetY: shadowOffsets.xl3,
|
|
151
|
+
blur: shadowBlurs.xl3,
|
|
152
|
+
spread: shadowSpreads.negativeSm,
|
|
153
|
+
}),
|
|
154
|
+
},
|
|
155
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Properties } from 'csstype';
|
|
2
|
+
import type { shadowBlurs } from './blurs.js';
|
|
3
|
+
import type { shadowOffsets } from './offsets.js';
|
|
4
|
+
import type { shadowSpreads } from './spreads.js';
|
|
5
|
+
export type Elevation = NonNullable<Properties['boxShadow']>;
|
|
6
|
+
export type ShadowBlur = (typeof shadowBlurs)[keyof typeof shadowBlurs];
|
|
7
|
+
export type ShadowOffset = (typeof shadowOffsets)[keyof typeof shadowOffsets];
|
|
8
|
+
export type ShadowSpread = (typeof shadowSpreads)[keyof typeof shadowSpreads];
|
|
9
|
+
export interface ShadowOptions {
|
|
10
|
+
color: string;
|
|
11
|
+
offsetX?: ShadowOffset;
|
|
12
|
+
offsetY: ShadowOffset;
|
|
13
|
+
blur: ShadowBlur;
|
|
14
|
+
spread?: ShadowSpread;
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ElevationStates {
|
|
18
|
+
default: Elevation;
|
|
19
|
+
}
|
|
20
|
+
export interface PressableElevationStates extends ElevationStates {
|
|
21
|
+
hover: Elevation;
|
|
22
|
+
pressed: Elevation;
|
|
23
|
+
disabled: Elevation;
|
|
24
|
+
}
|
|
25
|
+
export interface ElevationsTokens {
|
|
26
|
+
xs: PressableElevationStates;
|
|
27
|
+
sm: PressableElevationStates;
|
|
28
|
+
md: PressableElevationStates;
|
|
29
|
+
lg: PressableElevationStates;
|
|
30
|
+
modal: ElevationStates;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { shadowOffsets } from '../offsets.js';
|
|
2
|
+
import { shadowSpreads } from '../spreads.js';
|
|
3
|
+
export const createElevation = (...shadows) => shadows
|
|
4
|
+
.map(({ color, offsetX = shadowOffsets.none, offsetY, blur, spread = shadowSpreads.none, inset = false, }) => `${inset ? 'inset ' : ''}${offsetX} ${offsetY} ${blur} ${spread} ${color}`)
|
|
5
|
+
.join(', ');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './createElevation.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./createElevation.js";
|
package/dist/tokens/index.d.ts
CHANGED
package/dist/tokens/index.js
CHANGED