@sanity/ui 2.0.0-alpha.1 → 2.0.0-alpha.10

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.
Files changed (120) hide show
  1. package/dist/index.cjs.mjs +3 -0
  2. package/dist/index.d.ts +309 -411
  3. package/dist/index.esm.js +5098 -2428
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +5230 -2557
  6. package/dist/index.js.map +1 -1
  7. package/package.json +2 -2
  8. package/src/components/dialog/constants.ts +4 -0
  9. package/src/components/dialog/dialog.tsx +86 -24
  10. package/src/components/dialog/styles.ts +3 -4
  11. package/src/components/menu/__workshop__/closableMenuButton.tsx +2 -2
  12. package/src/components/menu/menuDivider.ts +2 -1
  13. package/src/components/menu/menuGroup.tsx +22 -23
  14. package/src/components/menu/menuItem.tsx +31 -37
  15. package/src/components/skeleton/styles.ts +8 -7
  16. package/src/components/tree/style.ts +19 -20
  17. package/src/primitives/_selectable/style.ts +25 -22
  18. package/src/primitives/avatar/avatar.tsx +8 -3
  19. package/src/primitives/avatar/avatarCounter.tsx +5 -4
  20. package/src/primitives/avatar/spotColors.ts +53 -0
  21. package/src/primitives/avatar/styles.ts +5 -7
  22. package/src/primitives/avatar/types.ts +14 -0
  23. package/src/primitives/badge/badge.tsx +5 -3
  24. package/src/primitives/badge/styles.ts +7 -8
  25. package/src/primitives/box/__workshop__/responsive.tsx +2 -2
  26. package/src/primitives/button/button.tsx +2 -2
  27. package/src/primitives/button/styles.ts +82 -16
  28. package/src/primitives/card/__workshop__/selected.tsx +8 -9
  29. package/src/primitives/card/card.tsx +43 -7
  30. package/src/primitives/card/styles.ts +30 -22
  31. package/src/primitives/card/types.ts +3 -1
  32. package/src/primitives/checkbox/styles.ts +20 -20
  33. package/src/primitives/code/code.tsx +15 -3
  34. package/src/primitives/code/styles.ts +51 -42
  35. package/src/primitives/heading/styles.ts +6 -5
  36. package/src/primitives/kbd/kbd.tsx +2 -1
  37. package/src/primitives/label/styles.ts +3 -2
  38. package/src/primitives/popover/popoverArrow.tsx +3 -2
  39. package/src/primitives/popover/popoverCard.tsx +6 -2
  40. package/src/primitives/radio/styles.ts +15 -15
  41. package/src/primitives/select/styles.ts +20 -22
  42. package/src/primitives/switch/styles.ts +13 -13
  43. package/src/primitives/text/__workshop__/colored.tsx +10 -11
  44. package/src/primitives/text/styles.ts +10 -9
  45. package/src/primitives/textArea/textArea.tsx +8 -12
  46. package/src/primitives/textInput/textInput.tsx +13 -13
  47. package/src/primitives/tooltip/__workshop__/props.tsx +20 -3
  48. package/src/primitives/tooltip/tooltipArrow.tsx +3 -2
  49. package/src/styles/border/borderStyle.ts +2 -1
  50. package/src/styles/colorVars/colorVarsStyle.ts +73 -32
  51. package/src/styles/focusRing/index.ts +6 -4
  52. package/src/styles/input/textInputStyle.ts +76 -93
  53. package/src/styles/margin/marginsStyle.test.ts +1 -2
  54. package/src/styles/padding/paddingStyle.test.ts +1 -2
  55. package/src/styles/shadow/shadowStyle.ts +5 -5
  56. package/src/theme/__workshop__/color.tsx +2 -2
  57. package/src/theme/__workshop__/index.ts +0 -5
  58. package/src/theme/lib/color-fns/blend/multiply.ts +2 -2
  59. package/src/theme/lib/color-fns/blend/screen.ts +2 -2
  60. package/src/theme/lib/color-fns/convert.ts +15 -1
  61. package/src/theme/lib/color-fns/parse.ts +7 -3
  62. package/src/theme/lib/color-fns/types.ts +11 -0
  63. package/src/theme/lib/theme/color/_legacy/createColorTheme.ts +7 -0
  64. package/src/theme/lib/theme/color/_legacy/index.ts +1 -0
  65. package/src/theme/lib/theme/color/_legacy/legacyColor.ts +3997 -0
  66. package/src/theme/lib/theme/color/cssVariables/cardVariables.ts +88 -0
  67. package/src/theme/lib/theme/color/cssVariables/createCssVars.ts +31 -0
  68. package/src/theme/lib/theme/color/cssVariables/cssVars.test.ts +262 -0
  69. package/src/theme/lib/theme/color/cssVariables/index.ts +1 -0
  70. package/src/theme/lib/theme/color/cssVariables/tints.ts +312 -0
  71. package/src/theme/lib/theme/color/cssVariables/tones.ts +67 -0
  72. package/src/theme/lib/theme/color/cssVariables/utils.test.ts +15 -0
  73. package/src/theme/lib/theme/color/cssVariables/utils.ts +9 -0
  74. package/src/theme/lib/theme/color/index.ts +3 -12
  75. package/src/theme/lib/theme/color/types.ts +6 -37
  76. package/src/theme/lib/theme/theme.ts +9 -4
  77. package/src/theme/studioTheme/color.ts +2 -641
  78. package/src/theme/studioTheme/helpers.ts +15 -1
  79. package/src/theme/studioTheme/theme.ts +13 -3
  80. package/src/theme/themeColorProvider.tsx +2 -0
  81. package/src/theme/themeProvider.tsx +28 -8
  82. package/src/theme/toneContext/toneContext.ts +12 -0
  83. package/src/theme/toneContext/toneProvider.tsx +31 -0
  84. package/src/theme/toneContext/types.ts +10 -0
  85. package/src/theme/toneContext/useToneContext.tsx +26 -0
  86. package/src/theme/types.ts +2 -4
  87. package/src/utils/elementQuery/__workshop__/customMedia.tsx +4 -3
  88. package/src/theme/__workshop__/canvas.tsx +0 -395
  89. package/src/theme/lib/theme/color/_generic/index.ts +0 -1
  90. package/src/theme/lib/theme/color/_generic/types.ts +0 -30
  91. package/src/theme/lib/theme/color/base/index.ts +0 -1
  92. package/src/theme/lib/theme/color/base/types.ts +0 -19
  93. package/src/theme/lib/theme/color/button/createButtonModes.ts +0 -20
  94. package/src/theme/lib/theme/color/button/createButtonTones.ts +0 -52
  95. package/src/theme/lib/theme/color/button/index.ts +0 -1
  96. package/src/theme/lib/theme/color/button/types.ts +0 -44
  97. package/src/theme/lib/theme/color/card/createCardStates.ts +0 -58
  98. package/src/theme/lib/theme/color/card/index.ts +0 -1
  99. package/src/theme/lib/theme/color/card/types.ts +0 -18
  100. package/src/theme/lib/theme/color/color.test.ts +0 -63
  101. package/src/theme/lib/theme/color/defaults.ts +0 -390
  102. package/src/theme/lib/theme/color/factory.ts +0 -138
  103. package/src/theme/lib/theme/color/input/createInputModes.ts +0 -84
  104. package/src/theme/lib/theme/color/input/index.ts +0 -1
  105. package/src/theme/lib/theme/color/input/types.ts +0 -28
  106. package/src/theme/lib/theme/color/muted/createMuted.ts +0 -56
  107. package/src/theme/lib/theme/color/muted/index.ts +0 -1
  108. package/src/theme/lib/theme/color/muted/types.ts +0 -24
  109. package/src/theme/lib/theme/color/selectable/createSelectableTones.ts +0 -73
  110. package/src/theme/lib/theme/color/selectable/index.ts +0 -1
  111. package/src/theme/lib/theme/color/selectable/types.ts +0 -29
  112. package/src/theme/lib/theme/color/solid/createSolidTones.ts +0 -56
  113. package/src/theme/lib/theme/color/solid/index.ts +0 -1
  114. package/src/theme/lib/theme/color/solid/types.ts +0 -24
  115. package/src/theme/lib/theme/color/spot/createSpot.ts +0 -21
  116. package/src/theme/lib/theme/color/spot/index.ts +0 -1
  117. package/src/theme/lib/theme/color/spot/types.ts +0 -28
  118. package/src/theme/lib/theme/color/syntax/index.ts +0 -1
  119. package/src/theme/lib/theme/color/syntax/types.ts +0 -41
  120. package/src/theme/studioTheme/tints.ts +0 -152
@@ -1,52 +0,0 @@
1
- import {ThemeColorBase} from '../base'
2
- import {ThemeColorBuilderOpts} from '../factory'
3
- import {ThemeColorMuted} from '../muted'
4
- import {ThemeColorSolid} from '../solid'
5
- import {ThemeColorButtonModeKey, ThemeColorButtonTones} from './types'
6
-
7
- export function createButtonTones(
8
- opts: ThemeColorBuilderOpts,
9
- base: ThemeColorBase,
10
- dark: boolean,
11
- solid: ThemeColorSolid,
12
- muted: ThemeColorMuted,
13
- mode: ThemeColorButtonModeKey,
14
- ): ThemeColorButtonTones {
15
- return {
16
- default: opts.button({
17
- base,
18
- dark,
19
- solid: solid.default,
20
- muted: muted.default,
21
- mode,
22
- }),
23
- primary: opts.button({
24
- base,
25
- dark,
26
- solid: solid.primary,
27
- muted: muted.primary,
28
- mode,
29
- }),
30
- positive: opts.button({
31
- base,
32
- dark,
33
- solid: solid.positive,
34
- muted: muted.positive,
35
- mode,
36
- }),
37
- caution: opts.button({
38
- base,
39
- dark,
40
- solid: solid.caution,
41
- muted: muted.caution,
42
- mode,
43
- }),
44
- critical: opts.button({
45
- base,
46
- dark,
47
- solid: solid.critical,
48
- muted: muted.critical,
49
- mode,
50
- }),
51
- }
52
- }
@@ -1 +0,0 @@
1
- export * from './types'
@@ -1,44 +0,0 @@
1
- import {ThemeColorGenericState} from '../_generic'
2
-
3
- /**
4
- * @public
5
- */
6
- export type ThemeColorButtonModeKey = 'default' | 'ghost' | 'bleed'
7
-
8
- /**
9
- * @deprecated Use `ThemeColorGenericState` instead.
10
- * @public
11
- */
12
- export type ThemeColorButtonState = ThemeColorGenericState
13
-
14
- /**
15
- * @public
16
- */
17
- export interface ThemeColorButtonStates {
18
- enabled: ThemeColorButtonState
19
- hovered: ThemeColorButtonState
20
- pressed: ThemeColorButtonState
21
- selected: ThemeColorButtonState
22
- disabled: ThemeColorButtonState
23
- }
24
-
25
- /**
26
- * TODO: Rename to `ThemeColorButtonMode`.
27
- * @public
28
- */
29
- export interface ThemeColorButtonTones {
30
- default: ThemeColorButtonStates
31
- primary: ThemeColorButtonStates
32
- positive: ThemeColorButtonStates
33
- caution: ThemeColorButtonStates
34
- critical: ThemeColorButtonStates
35
- }
36
-
37
- /**
38
- * @public
39
- */
40
- export interface ThemeColorButton {
41
- default: ThemeColorButtonTones
42
- ghost: ThemeColorButtonTones
43
- bleed: ThemeColorButtonTones
44
- }
@@ -1,58 +0,0 @@
1
- import {ThemeColorBase} from '../base'
2
- import {ThemeColorBuilderOpts} from '../factory'
3
- import {ThemeColorMuted} from '../muted'
4
- import {ThemeColorSolid} from '../solid'
5
- import {ThemeColorName} from '../types'
6
- import {ThemeColorCard} from './types'
7
-
8
- export function createCardStates(
9
- opts: ThemeColorBuilderOpts,
10
- base: ThemeColorBase,
11
- dark: boolean,
12
- name: ThemeColorName,
13
- solid: ThemeColorSolid,
14
- muted: ThemeColorMuted,
15
- ): ThemeColorCard {
16
- return {
17
- enabled: opts.card({
18
- base,
19
- dark,
20
- name,
21
- state: 'enabled',
22
- solid,
23
- muted,
24
- }),
25
- disabled: opts.card({
26
- base,
27
- dark,
28
- name,
29
- state: 'disabled',
30
- solid,
31
- muted,
32
- }),
33
- hovered: opts.card({
34
- base,
35
- dark,
36
- name,
37
- state: 'hovered',
38
- solid,
39
- muted,
40
- }),
41
- pressed: opts.card({
42
- base,
43
- dark,
44
- name,
45
- state: 'pressed',
46
- solid,
47
- muted,
48
- }),
49
- selected: opts.card({
50
- base,
51
- dark,
52
- name,
53
- state: 'selected',
54
- solid,
55
- muted,
56
- }),
57
- }
58
- }
@@ -1 +0,0 @@
1
- export * from './types'
@@ -1,18 +0,0 @@
1
- import {ThemeColorGenericState} from '../_generic'
2
-
3
- /**
4
- * @deprecated Use `ThemeColorGenericState` instead.
5
- * @public
6
- */
7
- export type ThemeColorCardState = ThemeColorGenericState
8
-
9
- /**
10
- * @public
11
- */
12
- export interface ThemeColorCard {
13
- enabled: ThemeColorCardState
14
- hovered: ThemeColorCardState
15
- pressed: ThemeColorCardState
16
- selected: ThemeColorCardState
17
- disabled: ThemeColorCardState
18
- }
@@ -1,63 +0,0 @@
1
- /** @jest-environment jsdom */
2
-
3
- import {createColorTheme} from './factory'
4
-
5
- describe('color', () => {
6
- describe('createColorTheme', () => {
7
- it('should generate base (scheme=light, name=default)', () => {
8
- const theme = createColorTheme()
9
- const scheme = 'light'
10
- const name = 'default'
11
- const color = theme[scheme][name]
12
-
13
- expect(color.base).toEqual({
14
- bg: 'hsl(0, 0%, 100%)',
15
- border: 'hsl(0, 0%, 95%)',
16
- fg: 'hsl(0, 0%, 0%)',
17
- focusRing: 'hsl(240, 100%, 50%)',
18
- shadow: {
19
- ambient: 'hsl(0, 0%, 0%)',
20
- outline: 'hsl(0, 0%, 0%)',
21
- penumbra: 'hsl(0, 0%, 0%)',
22
- umbra: 'hsl(0, 0%, 0%)',
23
- },
24
- skeleton: {
25
- from: 'hsl(0, 0%, 0%)',
26
- to: 'hsl(0, 0%, 0%)',
27
- },
28
- })
29
- })
30
-
31
- it('should generate muted states (scheme=light, name=default)', () => {
32
- const theme = createColorTheme()
33
- const scheme = 'light'
34
- const name = 'default'
35
- const color = theme[scheme][name]
36
-
37
- expect(color.muted.default.enabled).toEqual({
38
- bg: 'hsl(0, 0%, 95%)',
39
- bg2: 'hsl(0, 0%, 95%)',
40
- border: 'hsl(0, 0%, 70%)',
41
- fg: 'hsl(0, 0%, 20%)',
42
- iconColor: 'hsl(0, 0%, 20%)',
43
- muted: {
44
- fg: 'hsl(0, 0%, 0%)',
45
- },
46
- link: {
47
- fg: 'hsl(0, 0%, 0%)',
48
- },
49
- accent: {
50
- fg: 'hsl(0, 0%, 0%)',
51
- },
52
- code: {
53
- bg: 'hsl(0, 0%, 0%)',
54
- fg: 'hsl(0, 0%, 0%)',
55
- },
56
- skeleton: {
57
- from: 'hsl(0, 0%, 0%)',
58
- to: 'hsl(0, 0%, 0%)',
59
- },
60
- })
61
- })
62
- })
63
- })
@@ -1,390 +0,0 @@
1
- import {ThemeColorBuilderOpts} from './factory'
2
-
3
- const black = 'hsl(0, 0%, 0%)'
4
- const white = 'hsl(0, 0%, 100%)'
5
-
6
- const colors = {
7
- default: {
8
- lightest: 'hsl(0, 0%, 95%)',
9
- lighter: 'hsl(0, 0%, 70%)',
10
- light: 'hsl(0, 0%, 65%)',
11
- base: 'hsl(0, 0%, 50%)',
12
- dark: 'hsl(0, 0%, 35%)',
13
- darker: 'hsl(0, 0%, 20%)',
14
- darkest: 'hsl(0, 0%, 5%)',
15
- },
16
- transparent: {
17
- lightest: 'hsl(240, 100%, 95%)',
18
- lighter: 'hsl(240, 100%, 70%)',
19
- light: 'hsl(240, 100%, 65%)',
20
- base: 'hsl(240, 100%, 50%)',
21
- dark: 'hsl(240, 100%, 35%)',
22
- darker: 'hsl(240, 100%, 20%)',
23
- darkest: 'hsl(240, 100%, 5%)',
24
- },
25
- primary: {
26
- lightest: 'hsl(240, 100%, 95%)',
27
- lighter: 'hsl(240, 100%, 70%)',
28
- light: 'hsl(240, 100%, 65%)',
29
- base: 'hsl(240, 100%, 50%)',
30
- dark: 'hsl(240, 100%, 35%)',
31
- darker: 'hsl(240, 100%, 20%)',
32
- darkest: 'hsl(240, 100%, 5%)',
33
- },
34
- positive: {
35
- lightest: 'hsl(120, 100%, 95%)',
36
- lighter: 'hsl(120, 100%, 70%)',
37
- light: 'hsl(120, 100%, 65%)',
38
- base: 'hsl(120, 100%, 50%)',
39
- dark: 'hsl(120, 100%, 35%)',
40
- darker: 'hsl(120, 100%, 20%)',
41
- darkest: 'hsl(120, 100%, 5%)',
42
- },
43
- caution: {
44
- lightest: 'hsl(60, 100%, 95%)',
45
- lighter: 'hsl(60, 100%, 70%)',
46
- light: 'hsl(60, 100%, 65%)',
47
- base: 'hsl(60, 100%, 50%)',
48
- dark: 'hsl(60, 100%, 35%)',
49
- darker: 'hsl(60, 100%, 20%)',
50
- darkest: 'hsl(60, 100%, 5%)',
51
- },
52
- critical: {
53
- lightest: 'hsl(0, 100%, 95%)',
54
- lighter: 'hsl(0, 100%, 70%)',
55
- light: 'hsl(0, 100%, 65%)',
56
- base: 'hsl(0, 100%, 50%)',
57
- dark: 'hsl(0, 100%, 35%)',
58
- darker: 'hsl(0, 100%, 20%)',
59
- darkest: 'hsl(0, 100%, 5%)',
60
- },
61
- }
62
-
63
- const spots = {
64
- gray: 'hsl(0, 0%, 50%)',
65
- red: 'hsl(0, 100%, 50%)',
66
- orange: 'hsl(30, 100%, 50%)',
67
- yellow: 'hsl(60, 100%, 50%)',
68
- green: 'hsl(120, 100%, 50%)',
69
- cyan: 'hsl(180, 100%, 50%)',
70
- blue: 'hsl(240, 100%, 50%)',
71
- purple: 'hsl(270, 100%, 50%)',
72
- magenta: 'hsl(300, 100%, 50%)',
73
- }
74
-
75
- const tones = {
76
- transparent: {
77
- bg: [colors.transparent.darkest, colors.transparent.lightest],
78
- fg: [colors.transparent.lightest, colors.transparent.darkest],
79
- border: [colors.transparent.darker, colors.transparent.lighter],
80
- focusRing: [colors.transparent.base, colors.transparent.base],
81
- },
82
- primary: {
83
- bg: [colors.primary.darkest, colors.primary.lightest],
84
- fg: [colors.primary.lightest, colors.primary.darkest],
85
- border: [colors.primary.darker, colors.primary.lighter],
86
- focusRing: [colors.primary.base, colors.primary.base],
87
- },
88
- positive: {
89
- bg: [colors.positive.darkest, colors.positive.lightest],
90
- fg: [colors.positive.lightest, colors.positive.darkest],
91
- border: [colors.positive.darker, colors.positive.lighter],
92
- focusRing: [colors.positive.base, colors.positive.base],
93
- },
94
- caution: {
95
- bg: [colors.caution.darkest, colors.caution.lightest],
96
- fg: [colors.caution.lightest, colors.caution.darkest],
97
- border: [colors.caution.darker, colors.caution.lighter],
98
- focusRing: [colors.caution.base, colors.caution.base],
99
- },
100
- critical: {
101
- bg: [colors.critical.darkest, colors.critical.lightest],
102
- fg: [colors.critical.lightest, colors.critical.darkest],
103
- border: [colors.critical.darker, colors.critical.lighter],
104
- focusRing: [colors.critical.base, colors.critical.base],
105
- },
106
- }
107
-
108
- export const defaultOpts: ThemeColorBuilderOpts = {
109
- base: ({dark, name}) => {
110
- if (name === 'default') {
111
- return {
112
- bg: dark ? black : white,
113
- fg: dark ? white : black,
114
- border: dark ? colors.default.darkest : colors.default.lightest,
115
- focusRing: colors.primary.base,
116
- shadow: {
117
- outline: black,
118
- umbra: black,
119
- penumbra: black,
120
- ambient: black,
121
- },
122
- skeleton: {
123
- from: dark ? white : black,
124
- to: dark ? white : black,
125
- },
126
- }
127
- }
128
-
129
- // Variants:
130
- // - primary
131
- // - positive
132
- // - caution
133
- // - critical
134
- return {
135
- bg: tones[name].bg[dark ? 0 : 1],
136
- fg: tones[name].fg[dark ? 0 : 1],
137
- border: tones[name].border[dark ? 0 : 1],
138
- focusRing: tones[name].focusRing[dark ? 0 : 1],
139
- shadow: {
140
- outline: black,
141
- umbra: black,
142
- penumbra: black,
143
- ambient: black,
144
- },
145
- skeleton: {
146
- from: dark ? white : black,
147
- to: dark ? white : black,
148
- },
149
- }
150
- },
151
-
152
- solid: ({base, dark, state, tone}) => {
153
- const color = colors[tone]
154
-
155
- if (state === 'hovered') {
156
- return {
157
- bg: dark ? color.light : color.dark,
158
- bg2: dark ? color.light : color.dark,
159
- border: dark ? color.lighter : color.darker,
160
- fg: dark ? color.darkest : color.lightest,
161
- iconColor: dark ? color.darkest : color.lightest,
162
- muted: {
163
- fg: black,
164
- },
165
- accent: {
166
- fg: black,
167
- },
168
- link: {
169
- fg: black,
170
- },
171
- code: {
172
- bg: black,
173
- fg: black,
174
- },
175
- skeleton: base.skeleton,
176
- }
177
- }
178
-
179
- return {
180
- bg: color.base,
181
- bg2: color.base,
182
- border: dark ? color.light : color.dark,
183
- fg: dark ? color.darkest : color.lightest,
184
- iconColor: dark ? color.darkest : color.lightest,
185
- muted: {
186
- fg: black,
187
- },
188
- accent: {
189
- fg: black,
190
- },
191
- link: {
192
- fg: black,
193
- },
194
- code: {
195
- bg: black,
196
- fg: black,
197
- },
198
- skeleton: base.skeleton,
199
- }
200
- },
201
-
202
- muted: ({base, dark, state, tone}) => {
203
- const color = colors[tone]
204
-
205
- if (state === 'hovered') {
206
- return {
207
- bg: dark ? color.darker : color.lighter,
208
- bg2: dark ? color.darker : color.lighter,
209
- border: dark ? color.lighter : color.darker,
210
- fg: dark ? color.lightest : color.darkest,
211
- iconColor: dark ? color.lightest : color.darkest,
212
- muted: {
213
- fg: black,
214
- },
215
- accent: {
216
- fg: black,
217
- },
218
- link: {
219
- fg: black,
220
- },
221
- code: {
222
- bg: black,
223
- fg: black,
224
- },
225
- skeleton: base.skeleton,
226
- }
227
- }
228
-
229
- return {
230
- bg: dark ? color.darkest : color.lightest,
231
- bg2: dark ? color.darkest : color.lightest,
232
- border: dark ? color.darker : color.lighter,
233
- fg: dark ? color.lighter : color.darker,
234
- iconColor: dark ? color.lighter : color.darker,
235
- muted: {
236
- fg: black,
237
- },
238
- accent: {
239
- fg: black,
240
- },
241
- link: {
242
- fg: black,
243
- },
244
- code: {
245
- bg: black,
246
- fg: black,
247
- },
248
- skeleton: base.skeleton,
249
- }
250
- },
251
-
252
- button: ({base, mode, muted, solid}) => {
253
- if (mode === 'bleed') {
254
- return {
255
- ...muted,
256
- enabled: {
257
- bg: 'transparent',
258
- bg2: 'transparent',
259
- fg: muted.enabled.fg,
260
- iconColor: muted.enabled.fg,
261
- border: 'transparent',
262
- muted: {
263
- fg: black,
264
- },
265
- accent: {
266
- fg: black,
267
- },
268
- link: {
269
- fg: black,
270
- },
271
- code: {
272
- bg: black,
273
- fg: black,
274
- },
275
- skeleton: base.skeleton,
276
- },
277
- hovered: {
278
- bg: muted.enabled.bg,
279
- bg2: muted.enabled.bg,
280
- fg: muted.hovered.fg,
281
- iconColor: muted.hovered.fg,
282
- border: 'transparent',
283
- muted: {
284
- fg: black,
285
- },
286
- accent: {
287
- fg: black,
288
- },
289
- link: {
290
- fg: black,
291
- },
292
- code: {
293
- bg: black,
294
- fg: black,
295
- },
296
- skeleton: base.skeleton,
297
- },
298
- }
299
- }
300
-
301
- if (mode === 'ghost')
302
- return {
303
- ...solid,
304
- enabled: muted.enabled,
305
- }
306
-
307
- return solid
308
- },
309
-
310
- card: ({base}) => {
311
- return {
312
- bg: black,
313
- bg2: black,
314
- fg: black,
315
- iconColor: black,
316
- border: black,
317
- muted: {
318
- fg: black,
319
- },
320
- accent: {
321
- fg: black,
322
- },
323
- link: {
324
- fg: black,
325
- },
326
- code: {
327
- bg: black,
328
- fg: black,
329
- },
330
- skeleton: base.skeleton,
331
- }
332
- },
333
-
334
- input: () => {
335
- return {
336
- bg: black,
337
- bg2: black,
338
- fg: black,
339
- border: black,
340
- placeholder: black,
341
- }
342
- },
343
-
344
- selectable: ({muted, state, tone}) => {
345
- return muted[tone][state]
346
- },
347
-
348
- spot: ({key}) => {
349
- return spots[key]
350
- },
351
-
352
- syntax: () => ({
353
- atrule: black,
354
- attrName: black,
355
- attrValue: black,
356
- attribute: black,
357
- boolean: black,
358
- builtin: black,
359
- cdata: black,
360
- char: black,
361
- class: black,
362
- className: black,
363
- comment: black,
364
- constant: black,
365
- deleted: black,
366
- doctype: black,
367
- entity: black,
368
- function: black,
369
- hexcode: black,
370
- id: black,
371
- important: black,
372
- inserted: black,
373
- keyword: black,
374
- number: black,
375
- operator: black,
376
- prolog: black,
377
- property: black,
378
- pseudoClass: black,
379
- pseudoElement: black,
380
- punctuation: black,
381
- regex: black,
382
- selector: black,
383
- string: black,
384
- symbol: black,
385
- tag: black,
386
- unit: black,
387
- url: black,
388
- variable: black,
389
- }),
390
- }