@nuee/tokens 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuee/tokens",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@ export const colorPalette = stylex.defineVars({
26
26
  primaryContrast: "oklch(24.353% 0 0)",
27
27
  primaryContrastDark: "oklch(93.846% 0.0041 121.56)",
28
28
  redWeak: "oklch(88.842% 0.0501 22.71)",
29
- redWeakDark: "oklch(79.615% 0.1170 24.47 / 24%)",
29
+ redWeakDark: "oklch(79.615% 0.1170 24.47 / 32%)",
30
30
  redMuted: "oklch(82.720% 0.0510 21.28)",
31
31
  redMutedDark: "oklch(71.697% 0.1767 23.77)",
32
32
  redSolid: "oklch(39.780% 0.1604 22.34)",
@@ -45,7 +45,7 @@ export const colorPalette = stylex.defineVars({
45
45
  orangeContrast: "oklch(39.668% 0.0989 54.41)",
46
46
  orangeContrastDark: "oklch(87.437% 0.0803 57.28)",
47
47
  yellowWeak: "oklch(89.932% 0.0846 84.60)",
48
- yellowWeakDark: "oklch(78.635% 0.1457 89.67 / 24%)",
48
+ yellowWeakDark: "oklch(78.635% 0.1457 89.67 / 32%)",
49
49
  yellowMuted: "oklch(82.759% 0.0996 85.33)",
50
50
  yellowMutedDark: "oklch(69.931% 0.1403 90)",
51
51
  yellowSolid: "oklch(39.679% 0.0811 89.57)",
@@ -55,7 +55,7 @@ export const colorPalette = stylex.defineVars({
55
55
  yellowFeedback: "oklch(48.284% 0.0987 90.04)",
56
56
  yellowBadge: "oklch(87.026% 0.1672 89.94)",
57
57
  greenWeak: "oklch(88.883% 0.0603 141.35)",
58
- greenWeakDark: "oklch(77.164% 0.1234 143.03 / 24%)",
58
+ greenWeakDark: "oklch(77.164% 0.1234 143.03 / 32%)",
59
59
  greenMuted: "oklch(82.794% 0.0607 140.55)",
60
60
  greenMutedDark: "oklch(68.460% 0.1219 143.49)",
61
61
  greenSolid: "oklch(39.780% 0.1319 141.35)",
@@ -74,7 +74,7 @@ export const colorPalette = stylex.defineVars({
74
74
  cyanContrast: "oklch(39.727% 0.0705 215.91)",
75
75
  cyanContrastDark: "oklch(86.361% 0.0691 217.16)",
76
76
  blueWeak: "oklch(88.873% 0.0494 253.08)",
77
- blueWeakDark: "oklch(78.788% 0.1067 269.17 / 24%)",
77
+ blueWeakDark: "oklch(78.788% 0.1067 269.17 / 32%)",
78
78
  blueMuted: "oklch(82.782% 0.0497 254.11)",
79
79
  blueMutedDark: "oklch(70.325% 0.1529 263.59)",
80
80
  blueSolid: "oklch(39.777% 0.1328 255.38)",
@@ -104,6 +104,7 @@ export const colorPalette = stylex.defineVars({
104
104
  alphaBlack10: "oklch(0% 0 0 / 10%)",
105
105
  alphaBlack20: "oklch(0% 0 0 / 20%)",
106
106
  alphaBlack30: "oklch(0% 0 0 / 30%)",
107
+ alphaBlack40: "oklch(0% 0 0 / 40%)",
107
108
  alphaBlack50: "oklch(0% 0 0 / 50%)",
108
109
  alphaBlack80: "oklch(0% 0 0 / 80%)",
109
110
  alphaWhite5: "oklch(100% 0 0 / 5%)",
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { colorPalette, colorPaletteGroups } from "./color-palette.stylex";
2
2
  export {
3
3
  colorVars,
4
+ layerVars,
4
5
  motionVars,
5
6
  opacityVars,
6
7
  radiusVars,
@@ -6,11 +6,16 @@ export const colorVars = stylex.defineVars({
6
6
  bgCanvas: colorPalette.neutral100,
7
7
  bgSurface: colorPalette.neutral0,
8
8
  bgSurfacePressed: "oklch(97% 0 0)",
9
+ bgInverse: colorPalette.neutral950,
9
10
  bgSubtle: colorPalette.neutral50,
10
11
  bgRaised: colorPalette.neutral0,
11
12
  bgRaisedPressed: "oklch(97% 0 0)",
13
+ bgCurrent: colorPalette.alphaBlack6,
14
+ bgOverlay: colorPalette.alphaBlack40,
15
+ bgSkeleton: colorPalette.neutral200,
12
16
  bgActionPrimary: colorPalette.primarySolid,
13
17
  bgActionDestructive: colorPalette.redFeedback,
18
+ bgMessageOutgoing: colorPalette.primarySolid,
14
19
  bgFeedbackInfo: colorPalette.blueWeak,
15
20
  bgFeedbackSuccess: colorPalette.greenWeak,
16
21
  bgFeedbackWarning: colorPalette.yellowWeak,
@@ -18,10 +23,11 @@ export const colorVars = stylex.defineVars({
18
23
  fgPrimary: colorPalette.neutral950,
19
24
  fgSecondary: colorPalette.neutral600,
20
25
  fgTertiary: colorPalette.neutral500,
21
- fgDisabled: colorPalette.alphaBlack50,
26
+ fgDisabled: colorPalette.neutral500,
22
27
  fgInverse: colorPalette.neutral0,
23
28
  fgOnActionPrimary: colorPalette.neutral0,
24
29
  fgOnActionDestructive: colorPalette.neutral0,
30
+ fgOnMessageOutgoing: colorPalette.neutral0,
25
31
  fgAction: colorPalette.primarySolid,
26
32
  fgFeedbackInfo: colorPalette.blueSolid,
27
33
  fgFeedbackSuccess: colorPalette.greenFeedback,
@@ -37,16 +43,19 @@ export const colorVars = stylex.defineVars({
37
43
  strokeFeedbackError: colorPalette.redMuted,
38
44
  interactionDefault: "transparent",
39
45
  interactionHover: colorPalette.alphaBlack6,
40
- interactionPressed: "oklch(97% 0 0)",
46
+ // Translucent state layers preserve the underlying surface; press is stronger than hover.
47
+ interactionPressed: colorPalette.alphaBlack10,
41
48
  interactionSolidHover: colorPalette.alphaWhite10,
42
49
  interactionSolidPressed: colorPalette.alphaWhite20,
43
- interactionSelected: "oklch(97% 0 0)",
50
+ // Persistent selected surface for segmented controls, matching the explicit light theme.
51
+ interactionSelected: colorPalette.neutral0,
44
52
  interactionDisabled: colorPalette.alphaBlack8,
45
53
  interactionFocus: colorPalette.blueBadge,
46
54
  });
47
55
 
48
56
  export const spacingVars = stylex.defineVars({
49
57
  space0: "0",
58
+ space0_5: "0.125rem",
50
59
  space1: "0.25rem",
51
60
  space2: "0.5rem",
52
61
  space3: "0.75rem",
@@ -59,13 +68,19 @@ export const spacingVars = stylex.defineVars({
59
68
  });
60
69
 
61
70
  export const sizeVars = stylex.defineVars({
71
+ controlXs: "1.5rem",
62
72
  controlSm: "2rem",
63
73
  controlMd: "2.25rem",
64
74
  controlLg: "2.5rem",
75
+ iconXs: "0.75rem",
65
76
  iconSm: "0.875rem",
66
77
  iconMd: "1rem",
78
+ iconLg: "1.25rem",
79
+ contentXs: "18rem",
67
80
  contentSm: "24rem",
68
81
  contentMd: "32rem",
82
+ trackSm: "0.375rem",
83
+ trackMd: "0.5rem",
69
84
  touchTarget: "2.75rem",
70
85
  stroke: "0.0625rem",
71
86
  focusRing: "0.125rem",
@@ -75,6 +90,7 @@ export const radiusVars = stylex.defineVars({
75
90
  sm: "0.375rem",
76
91
  md: "0.5rem",
77
92
  lg: "0.75rem",
93
+ xl: "1rem",
78
94
  full: "9999px",
79
95
  });
80
96
 
@@ -84,8 +100,20 @@ export const shadowVars = stylex.defineVars({
84
100
  overlay: "0 4px 16px oklch(0% 0 0 / 12%)",
85
101
  });
86
102
 
103
+ export const layerVars = stylex.defineVars({
104
+ modalBackdrop: "50",
105
+ modal: "51",
106
+ popup: "60",
107
+ notification: "70",
108
+ });
109
+
87
110
  export const typographyVars = stylex.defineVars({
111
+ /** @deprecated Use fontFamilyBody or fontFamilyHeading instead. */
88
112
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
113
+ fontFamilyBody:
114
+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
115
+ fontFamilyHeading:
116
+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
89
117
  fontSizeXs: "0.75rem",
90
118
  fontSizeSm: "0.875rem",
91
119
  fontSizeMd: "1rem",
@@ -99,13 +127,16 @@ export const typographyVars = stylex.defineVars({
99
127
  });
100
128
 
101
129
  export const opacityVars = stylex.defineVars({
102
- disabled: "0.8",
130
+ disabled: "0.6",
103
131
  });
104
132
 
105
133
  export const motionVars = stylex.defineVars({
134
+ durationInstant: "0.01ms",
106
135
  durationFast: "120ms",
107
136
  durationNormal: "180ms",
108
137
  durationSlow: "240ms",
138
+ durationLoading: "700ms",
139
+ durationLoadingReduced: "1.5s",
109
140
  easingStandard: "cubic-bezier(0.2, 0, 0, 1)",
110
141
  easingEnter: "cubic-bezier(0.16, 1, 0.3, 1)",
111
142
  easingExit: "cubic-bezier(0.4, 0, 1, 1)",
@@ -7,11 +7,16 @@ export const lightColorTheme = stylex.createTheme(colorVars, {
7
7
  bgCanvas: colorPalette.neutral100,
8
8
  bgSurface: colorPalette.neutral0,
9
9
  bgSurfacePressed: "oklch(97% 0 0)",
10
+ bgInverse: colorPalette.neutral950,
10
11
  bgSubtle: colorPalette.neutral50,
11
12
  bgRaised: colorPalette.neutral0,
12
13
  bgRaisedPressed: "oklch(97% 0 0)",
14
+ bgCurrent: colorPalette.alphaBlack6,
15
+ bgOverlay: colorPalette.alphaBlack40,
16
+ bgSkeleton: colorPalette.neutral200,
13
17
  bgActionPrimary: colorPalette.primarySolid,
14
18
  bgActionDestructive: colorPalette.redFeedback,
19
+ bgMessageOutgoing: colorPalette.primarySolid,
15
20
  bgFeedbackInfo: colorPalette.blueWeak,
16
21
  bgFeedbackSuccess: colorPalette.greenWeak,
17
22
  bgFeedbackWarning: colorPalette.yellowWeak,
@@ -19,10 +24,11 @@ export const lightColorTheme = stylex.createTheme(colorVars, {
19
24
  fgPrimary: colorPalette.neutral950,
20
25
  fgSecondary: colorPalette.neutral600,
21
26
  fgTertiary: colorPalette.neutral500,
22
- fgDisabled: colorPalette.alphaBlack50,
27
+ fgDisabled: colorPalette.neutral500,
23
28
  fgInverse: colorPalette.neutral0,
24
29
  fgOnActionPrimary: colorPalette.neutral0,
25
30
  fgOnActionDestructive: colorPalette.neutral0,
31
+ fgOnMessageOutgoing: colorPalette.neutral0,
26
32
  fgAction: colorPalette.primarySolid,
27
33
  fgFeedbackInfo: colorPalette.blueSolid,
28
34
  fgFeedbackSuccess: colorPalette.greenFeedback,
@@ -38,43 +44,49 @@ export const lightColorTheme = stylex.createTheme(colorVars, {
38
44
  strokeFeedbackError: colorPalette.redMuted,
39
45
  interactionDefault: "transparent",
40
46
  interactionHover: colorPalette.alphaBlack6,
41
- interactionPressed: "oklch(97% 0 0)",
47
+ interactionPressed: colorPalette.alphaBlack10,
42
48
  interactionSolidHover: colorPalette.alphaWhite10,
43
49
  interactionSolidPressed: colorPalette.alphaWhite20,
44
- interactionSelected: "oklch(97% 0 0)",
50
+ interactionSelected: colorPalette.neutral0,
45
51
  interactionDisabled: colorPalette.alphaBlack8,
46
52
  interactionFocus: colorPalette.blueBadge,
47
53
  });
48
54
 
49
55
  export const darkColorTheme = stylex.createTheme(colorVars, {
50
56
  bgCanvas: colorPalette.neutral950,
51
- bgSurface: colorPalette.alphaWhite5,
52
- bgSurfacePressed: colorPalette.alphaWhite10,
53
- bgSubtle: colorPalette.alphaWhite8,
54
- bgRaised: colorPalette.neutral850,
55
- bgRaisedPressed: colorPalette.neutral800,
56
- bgActionPrimary: colorPalette.primarySolidDark,
57
+ bgSurface: colorPalette.neutral900,
58
+ bgSurfacePressed: colorPalette.neutral800,
59
+ bgInverse: colorPalette.neutral800,
60
+ bgSubtle: colorPalette.neutral850,
61
+ bgRaised: colorPalette.neutral800,
62
+ bgRaisedPressed: colorPalette.neutral700,
63
+ bgCurrent: colorPalette.alphaWhite8,
64
+ bgOverlay: colorPalette.alphaBlack40,
65
+ bgSkeleton: colorPalette.neutral700,
66
+ bgActionPrimary: colorPalette.neutral100,
57
67
  bgActionDestructive: colorPalette.redFeedback,
68
+ bgMessageOutgoing: colorPalette.neutral100,
58
69
  bgFeedbackInfo: colorPalette.blueWeakDark,
59
70
  bgFeedbackSuccess: colorPalette.greenWeakDark,
60
71
  bgFeedbackWarning: colorPalette.yellowWeakDark,
61
72
  bgFeedbackError: colorPalette.redWeakDark,
62
- fgPrimary: colorPalette.neutral50,
63
- fgSecondary: colorPalette.neutral300,
64
- fgTertiary: colorPalette.neutral400,
65
- fgDisabled: colorPalette.alphaWhite50,
66
- fgInverse: colorPalette.neutral950,
73
+ fgPrimary: colorPalette.neutral100,
74
+ fgSecondary: colorPalette.neutral400,
75
+ fgTertiary: colorPalette.neutral500,
76
+ fgDisabled: colorPalette.neutral500,
77
+ fgInverse: colorPalette.neutral200,
67
78
  fgOnActionPrimary: colorPalette.neutral950,
68
- fgOnActionDestructive: colorPalette.neutral0,
69
- fgAction: colorPalette.primaryContrastDark,
79
+ fgOnActionDestructive: colorPalette.neutral200,
80
+ fgOnMessageOutgoing: colorPalette.neutral950,
81
+ fgAction: colorPalette.primarySolidDark,
70
82
  fgFeedbackInfo: colorPalette.blueContrastDark,
71
83
  fgFeedbackSuccess: colorPalette.greenContrastDark,
72
84
  fgFeedbackWarning: colorPalette.yellowContrastDark,
73
85
  fgFeedbackError: colorPalette.redContrastDark,
74
- strokeDefault: colorPalette.neutral700,
75
- strokeStrong: colorPalette.neutral600,
76
- strokeFocus: colorPalette.blueSolidDark,
77
- strokeAction: colorPalette.primarySolidDark,
86
+ strokeDefault: colorPalette.neutral800,
87
+ strokeStrong: colorPalette.neutral700,
88
+ strokeFocus: colorPalette.blueBadge,
89
+ strokeAction: colorPalette.neutral100,
78
90
  strokeFeedbackInfo: colorPalette.blueMutedDark,
79
91
  strokeFeedbackSuccess: colorPalette.greenMutedDark,
80
92
  strokeFeedbackWarning: colorPalette.yellowMutedDark,
@@ -84,9 +96,9 @@ export const darkColorTheme = stylex.createTheme(colorVars, {
84
96
  interactionPressed: colorPalette.alphaWhite10,
85
97
  interactionSolidHover: colorPalette.alphaBlack10,
86
98
  interactionSolidPressed: colorPalette.alphaBlack20,
87
- interactionSelected: colorPalette.primaryWeakDark,
88
- interactionDisabled: colorPalette.alphaWhite10,
89
- interactionFocus: colorPalette.blueSolidDark,
99
+ interactionSelected: colorPalette.neutral800,
100
+ interactionDisabled: colorPalette.neutral700,
101
+ interactionFocus: colorPalette.blueBadge,
90
102
  });
91
103
 
92
104
  export const lightShadowTheme = stylex.createTheme(shadowVars, {
@@ -96,7 +108,7 @@ export const lightShadowTheme = stylex.createTheme(shadowVars, {
96
108
  });
97
109
 
98
110
  export const darkShadowTheme = stylex.createTheme(shadowVars, {
99
- subtle: "0 1px 4px oklch(0% 0 0 / 50%)",
100
- floating: "0 2px 10px oklch(0% 0 0 / 68%)",
101
- overlay: "0 4px 16px oklch(0% 0 0 / 80%)",
111
+ subtle: "0 0 0 1px oklch(100% 0 0 / 6%), 0 1px 4px oklch(0% 0 0 / 36%)",
112
+ floating: "0 0 0 1px oklch(100% 0 0 / 8%), 0 8px 24px oklch(0% 0 0 / 52%)",
113
+ overlay: "0 0 0 1px oklch(100% 0 0 / 10%), 0 16px 40px oklch(0% 0 0 / 64%)",
102
114
  });