@sanity/ui 5.0.0-alpha.21 → 5.0.0-alpha.23

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 (128) hide show
  1. package/README.md +10 -0
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/styles.css +1 -1
  5. package/docs/components/avatar-counter.dsds.yaml +78 -0
  6. package/docs/components/avatar-stack.dsds.yaml +96 -0
  7. package/docs/components/avatar.dsds.yaml +115 -0
  8. package/docs/components/badge.dsds.yaml +126 -0
  9. package/docs/components/box.dsds.yaml +223 -0
  10. package/docs/components/button.dsds.yaml +284 -0
  11. package/docs/components/card.dsds.yaml +317 -0
  12. package/docs/components/checkbox.dsds.yaml +204 -0
  13. package/docs/components/code.dsds.yaml +167 -0
  14. package/docs/components/container.dsds.yaml +189 -0
  15. package/docs/components/dialog.dsds.yaml +343 -0
  16. package/docs/components/divider.dsds.yaml +93 -0
  17. package/docs/components/eyebrow.dsds.yaml +217 -0
  18. package/docs/components/flex.dsds.yaml +237 -0
  19. package/docs/components/grid.dsds.yaml +217 -0
  20. package/docs/components/h-stack.dsds.yaml +127 -0
  21. package/docs/components/heading.dsds.yaml +233 -0
  22. package/docs/components/hotkeys.dsds.yaml +60 -0
  23. package/docs/components/icon-button.dsds.yaml +220 -0
  24. package/docs/components/icon.dsds.yaml +275 -0
  25. package/docs/components/indicator-stack.dsds.yaml +98 -0
  26. package/docs/components/indicator.dsds.yaml +108 -0
  27. package/docs/components/inline.dsds.yaml +127 -0
  28. package/docs/components/kbd.dsds.yaml +59 -0
  29. package/docs/components/link.dsds.yaml +108 -0
  30. package/docs/components/list-button-item.dsds.yaml +103 -0
  31. package/docs/components/list-item-image.dsds.yaml +82 -0
  32. package/docs/components/list-item-text.dsds.yaml +80 -0
  33. package/docs/components/list-item.dsds.yaml +148 -0
  34. package/docs/components/list.dsds.yaml +162 -0
  35. package/docs/components/popover.dsds.yaml +208 -0
  36. package/docs/components/press-area.dsds.yaml +279 -0
  37. package/docs/components/radio.dsds.yaml +198 -0
  38. package/docs/components/select.dsds.yaml +214 -0
  39. package/docs/components/skip-to-content.dsds.yaml +110 -0
  40. package/docs/components/spinner.dsds.yaml +119 -0
  41. package/docs/components/switch.dsds.yaml +202 -0
  42. package/docs/components/tab.dsds.yaml +54 -0
  43. package/docs/components/tabs-list.dsds.yaml +56 -0
  44. package/docs/components/tabs-panel.dsds.yaml +54 -0
  45. package/docs/components/tabs.dsds.yaml +104 -0
  46. package/docs/components/text-area.dsds.yaml +170 -0
  47. package/docs/components/text-input.dsds.yaml +189 -0
  48. package/docs/components/text.dsds.yaml +268 -0
  49. package/docs/components/tooltip-group.dsds.yaml +90 -0
  50. package/docs/components/tooltip.dsds.yaml +216 -0
  51. package/docs/components/v-stack.dsds.yaml +155 -0
  52. package/docs/components/visually-hidden.dsds.yaml +112 -0
  53. package/docs/evals/cases.yaml +1319 -0
  54. package/docs/examples/checkbox-2.tsx +57 -0
  55. package/docs/examples/confirmation-dialogs-1.tsx +27 -0
  56. package/docs/examples/confirmation-dialogs-2.tsx +55 -0
  57. package/docs/examples/confirmation-dialogs-3.tsx +28 -0
  58. package/docs/examples/confirmation-dialogs-4.tsx +38 -0
  59. package/docs/examples/popover-1.tsx +48 -0
  60. package/docs/examples/popover-2.tsx +53 -0
  61. package/docs/foundations/accessibility-guidelines.dsds.yaml +301 -0
  62. package/docs/foundations/color-guidelines.dsds.yaml +308 -0
  63. package/docs/foundations/content-guidelines.dsds.yaml +285 -0
  64. package/docs/foundations/semantics.dsds.yaml +125 -0
  65. package/docs/foundations/spacing-guidelines.dsds.yaml +226 -0
  66. package/docs/foundations/typography-guidelines.dsds.yaml +322 -0
  67. package/docs/icons.dsds.yaml +2513 -0
  68. package/docs/index.dsds.yaml +515 -0
  69. package/docs/overview/api-essentials.dsds.yaml +221 -0
  70. package/docs/overview/component-reference.dsds.yaml +215 -0
  71. package/docs/overview/designer-contribution-model.dsds.yaml +77 -0
  72. package/docs/overview/developer-contribution-model.dsds.yaml +362 -0
  73. package/docs/overview/installation.dsds.yaml +238 -0
  74. package/docs/overview/quick-start.dsds.yaml +317 -0
  75. package/docs/overview/resources.dsds.yaml +34 -0
  76. package/docs/patterns/confirmation-dialogs.dsds.yaml +140 -0
  77. package/docs/patterns/error-messaging.dsds.yaml +58 -0
  78. package/docs/patterns/forms.dsds.yaml +356 -0
  79. package/docs/patterns/layouts.dsds.yaml +403 -0
  80. package/docs/patterns/loading-states.dsds.yaml +41 -0
  81. package/docs/patterns/messaging.dsds.yaml +72 -0
  82. package/docs/patterns/navigation.dsds.yaml +153 -0
  83. package/docs/patterns/responsive.dsds.yaml +590 -0
  84. package/docs/tokens/color.dsds.yaml +1158 -0
  85. package/docs/tokens/container-widths.dsds.yaml +131 -0
  86. package/docs/tokens/content.dsds.yaml +258 -0
  87. package/docs/tokens/content.tokens.json +180 -0
  88. package/docs/tokens/dtcg/README.md +39 -0
  89. package/docs/tokens/dtcg/css/color.css +107 -0
  90. package/docs/tokens/dtcg/css/container.css +12 -0
  91. package/docs/tokens/dtcg/css/fontFamily.css +10 -0
  92. package/docs/tokens/dtcg/css/fontWeight.css +10 -0
  93. package/docs/tokens/dtcg/css/index.css +13 -0
  94. package/docs/tokens/dtcg/css/radius.css +14 -0
  95. package/docs/tokens/dtcg/css/semantic.css +42 -0
  96. package/docs/tokens/dtcg/css/shadow.css +22 -0
  97. package/docs/tokens/dtcg/css/space.css +16 -0
  98. package/docs/tokens/dtcg/css/typography.css +69 -0
  99. package/docs/tokens/dtcg/json/color.tokens.json +911 -0
  100. package/docs/tokens/dtcg/json/container.tokens.json +44 -0
  101. package/docs/tokens/dtcg/json/fontFamily.tokens.json +10 -0
  102. package/docs/tokens/dtcg/json/fontWeight.tokens.json +18 -0
  103. package/docs/tokens/dtcg/json/radius.tokens.json +58 -0
  104. package/docs/tokens/dtcg/json/semantic.tokens.json +372 -0
  105. package/docs/tokens/dtcg/json/shadow.tokens.json +599 -0
  106. package/docs/tokens/dtcg/json/space.tokens.json +72 -0
  107. package/docs/tokens/dtcg/json/typography.tokens.json +354 -0
  108. package/docs/tokens/font-family.dsds.yaml +79 -0
  109. package/docs/tokens/font-weight.dsds.yaml +103 -0
  110. package/docs/tokens/radius.dsds.yaml +153 -0
  111. package/docs/tokens/semantic.dsds.yaml +397 -0
  112. package/docs/tokens/shadow.dsds.yaml +125 -0
  113. package/docs/tokens/space.dsds.yaml +185 -0
  114. package/docs/tokens/typography.dsds.yaml +316 -0
  115. package/llms.txt +108 -0
  116. package/package.json +6 -3
  117. package/skills/sanity-ui-5/SKILL.md +158 -0
  118. package/skills/sanity-ui-5/references/component-choice.md +37 -0
  119. package/skills/sanity-ui-5/references/components.md +145 -0
  120. package/skills/sanity-ui-5/references/forms-and-accessibility.md +189 -0
  121. package/skills/sanity-ui-5/references/migrating-from-v3.md +250 -0
  122. package/skills/sanity-ui-5/references/props-and-imports.md +169 -0
  123. package/skills/sanity-ui-5/references/setup.md +177 -0
  124. package/skills/sanity-ui-5/references/silent-failures.md +33 -0
  125. package/skills/sanity-ui-5/references/taste.md +53 -0
  126. package/skills/sanity-ui-5/references/tone-and-color.md +55 -0
  127. package/src/css/classes/system/shadow.css +45 -0
  128. package/src/version.ts +2 -2
@@ -0,0 +1,397 @@
1
+ schemaVersion: '0.23.1'
2
+ name: Sanity UI
3
+ entries:
4
+ - kind: token
5
+ id: background-high
6
+ name: background-high
7
+ description: 'The stronger surface fill. Use for headers, wells and hovered rows in custom markup.'
8
+ metadata:
9
+ status:
10
+ status: stable
11
+ group: color.semantic
12
+ source:
13
+ href: ./dtcg/json/semantic.tokens.json#background-high
14
+ - kind: token
15
+ id: background-high-emphasized
16
+ name: background-high-emphasized
17
+ description: 'The fill of a strongly emphasized surface. Pair its text with `foreground-high-emphasized`.'
18
+ metadata:
19
+ status:
20
+ status: stable
21
+ group: color.semantic
22
+ source:
23
+ href: ./dtcg/json/semantic.tokens.json#background-high-emphasized
24
+ - kind: token
25
+ id: background-low
26
+ name: background-low
27
+ description: 'The base surface fill, behind page and card content.'
28
+ metadata:
29
+ status:
30
+ status: stable
31
+ group: color.semantic
32
+ source:
33
+ href: ./dtcg/json/semantic.tokens.json#background-low
34
+ - kind: token
35
+ id: background-low-emphasized
36
+ name: background-low-emphasized
37
+ description: 'The fill of a moderately emphasized surface. Pair its text with `foreground-low-emphasized`.'
38
+ metadata:
39
+ status:
40
+ status: stable
41
+ group: color.semantic
42
+ source:
43
+ href: ./dtcg/json/semantic.tokens.json#background-low-emphasized
44
+ - kind: token
45
+ id: separator-high
46
+ name: separator-high
47
+ description: 'The stronger border color, for dividers that must stand out.'
48
+ metadata:
49
+ status:
50
+ status: stable
51
+ group: color.semantic
52
+ source:
53
+ href: ./dtcg/json/semantic.tokens.json#separator-high
54
+ - kind: token
55
+ id: separator-low
56
+ name: separator-low
57
+ description: 'The default border and divider color. Use it for borders on custom markup, such as table cells.'
58
+ metadata:
59
+ status:
60
+ status: stable
61
+ group: color.semantic
62
+ source:
63
+ href: ./dtcg/json/semantic.tokens.json#separator-low
64
+ - kind: token
65
+ id: foreground-high
66
+ name: foreground-high
67
+ description: 'The primary text and icon color.'
68
+ metadata:
69
+ status:
70
+ status: stable
71
+ group: color.semantic
72
+ source:
73
+ href: ./dtcg/json/semantic.tokens.json#foreground-high
74
+ - kind: token
75
+ id: foreground-high-emphasized
76
+ name: foreground-high-emphasized
77
+ description: 'Text and icons on a `background-high-emphasized` fill.'
78
+ metadata:
79
+ status:
80
+ status: stable
81
+ group: color.semantic
82
+ source:
83
+ href: ./dtcg/json/semantic.tokens.json#foreground-high-emphasized
84
+ - kind: token
85
+ id: foreground-low
86
+ name: foreground-low
87
+ description: 'The secondary text and icon color, for muted content.'
88
+ metadata:
89
+ status:
90
+ status: stable
91
+ group: color.semantic
92
+ source:
93
+ href: ./dtcg/json/semantic.tokens.json#foreground-low
94
+ - kind: token
95
+ id: foreground-low-emphasized
96
+ name: foreground-low-emphasized
97
+ description: 'Text and icons on a `background-low-emphasized` fill.'
98
+ metadata:
99
+ status:
100
+ status: stable
101
+ group: color.semantic
102
+ source:
103
+ href: ./dtcg/json/semantic.tokens.json#foreground-low-emphasized
104
+ - kind: token
105
+ id: backdrop
106
+ name: backdrop
107
+ description: 'The page backdrop behind every surface.'
108
+ metadata:
109
+ status:
110
+ status: stable
111
+ group: color.semantic
112
+ source:
113
+ href: ./dtcg/json/semantic.tokens.json#backdrop
114
+ - kind: token
115
+ id: brand-background
116
+ name: brand-background
117
+ description: "Sanity's brand color. Use it for brand marks only, never for state or emphasis."
118
+ metadata:
119
+ status:
120
+ status: stable
121
+ group: color.semantic
122
+ source:
123
+ href: ./dtcg/json/semantic.tokens.json#brand-background
124
+ - kind: token
125
+ id: brand-foreground
126
+ name: brand-foreground
127
+ description: 'Text and marks on the brand color.'
128
+ metadata:
129
+ status:
130
+ status: stable
131
+ group: color.semantic
132
+ source:
133
+ href: ./dtcg/json/semantic.tokens.json#brand-foreground
134
+ - kind: token
135
+ id: placeholder-opacity
136
+ name: placeholder-opacity
137
+ description: 'The opacity of placeholder text in a field.'
138
+ metadata:
139
+ status:
140
+ status: stable
141
+ group: opacity
142
+ source:
143
+ href: ./dtcg/json/semantic.tokens.json#placeholder-opacity
144
+ - kind: token
145
+ id: overlay-opacity
146
+ name: overlay-opacity
147
+ description: 'The opacity of the dimmed layer behind a modal or overlay.'
148
+ metadata:
149
+ status:
150
+ status: stable
151
+ group: opacity
152
+ source:
153
+ href: ./dtcg/json/semantic.tokens.json#overlay-opacity
154
+ - kind: token
155
+ id: active-background-normal
156
+ name: active-background-normal
157
+ description: 'The fill of a selected or current item, such as the active row in a list.'
158
+ metadata:
159
+ status:
160
+ status: stable
161
+ group: color.semantic
162
+ source:
163
+ href: ./dtcg/json/semantic.tokens.json#active-background-normal
164
+ - kind: token
165
+ id: active-foreground-normal
166
+ name: active-foreground-normal
167
+ description: 'Text and icons on `active-background-normal`.'
168
+ metadata:
169
+ status:
170
+ status: stable
171
+ group: color.semantic
172
+ source:
173
+ href: ./dtcg/json/semantic.tokens.json#active-foreground-normal
174
+ - kind: token
175
+ id: active-background-emphasized
176
+ name: active-background-emphasized
177
+ description: 'The strong fill of a selected control.'
178
+ metadata:
179
+ status:
180
+ status: stable
181
+ group: color.semantic
182
+ source:
183
+ href: ./dtcg/json/semantic.tokens.json#active-background-emphasized
184
+ - kind: token
185
+ id: active-foreground-emphasized
186
+ name: active-foreground-emphasized
187
+ description: 'Text and icons on `active-background-emphasized`.'
188
+ metadata:
189
+ status:
190
+ status: stable
191
+ group: color.semantic
192
+ source:
193
+ href: ./dtcg/json/semantic.tokens.json#active-foreground-emphasized
194
+ - kind: token
195
+ id: error-background-emphasized
196
+ name: error-background-emphasized
197
+ description: 'The strong fill of an error state.'
198
+ metadata:
199
+ status:
200
+ status: stable
201
+ group: color.semantic
202
+ source:
203
+ href: ./dtcg/json/semantic.tokens.json#error-background-emphasized
204
+ - kind: token
205
+ id: error-foreground
206
+ name: error-foreground
207
+ description: 'The text color of an error message.'
208
+ metadata:
209
+ status:
210
+ status: stable
211
+ group: color.semantic
212
+ source:
213
+ href: ./dtcg/json/semantic.tokens.json#error-foreground
214
+ - kind: token
215
+ id: error-separator
216
+ name: error-separator
217
+ description: 'The border of a field in an error state.'
218
+ metadata:
219
+ status:
220
+ status: stable
221
+ group: color.semantic
222
+ source:
223
+ href: ./dtcg/json/semantic.tokens.json#error-separator
224
+ - kind: token
225
+ id: focus-outline
226
+ name: focus-outline
227
+ description: 'The focus ring. Apply it to custom interactive markup with `outline`.'
228
+ metadata:
229
+ status:
230
+ status: stable
231
+ group: color.semantic
232
+ source:
233
+ href: ./dtcg/json/semantic.tokens.json#focus-outline
234
+ - kind: token
235
+ id: focus-offset
236
+ name: focus-offset
237
+ description: 'The gap between an element and its focus ring, for `outline-offset`.'
238
+ metadata:
239
+ status:
240
+ status: stable
241
+ group: color.semantic
242
+ source:
243
+ href: ./dtcg/json/semantic.tokens.json#focus-offset
244
+ - kind: token
245
+ id: hover-lightness-delta
246
+ name: hover-lightness-delta
247
+ description: 'How far a hovered surface moves in lightness from its resting color.'
248
+ metadata:
249
+ status:
250
+ status: stable
251
+ group: motion
252
+ source:
253
+ href: ./dtcg/json/semantic.tokens.json#hover-lightness-delta
254
+ - kind: token
255
+ id: hover-transition
256
+ name: hover-transition
257
+ description: 'The transition for color changes on hover.'
258
+ metadata:
259
+ status:
260
+ status: stable
261
+ group: motion
262
+ source:
263
+ href: ./dtcg/json/semantic.tokens.json#hover-transition
264
+ - kind: token
265
+ id: inert-background
266
+ name: inert-background
267
+ description: 'The fill of a disabled control.'
268
+ metadata:
269
+ status:
270
+ status: stable
271
+ group: color.semantic
272
+ source:
273
+ href: ./dtcg/json/semantic.tokens.json#inert-background
274
+ - kind: token
275
+ id: inert-foreground
276
+ name: inert-foreground
277
+ description: 'The text color of a disabled control.'
278
+ metadata:
279
+ status:
280
+ status: stable
281
+ group: color.semantic
282
+ source:
283
+ href: ./dtcg/json/semantic.tokens.json#inert-foreground
284
+ - kind: token
285
+ id: fade-in-transition
286
+ name: fade-in-transition
287
+ description: 'The transition for elements that fade and scale in, such as popovers.'
288
+ metadata:
289
+ status:
290
+ status: stable
291
+ group: motion
292
+ source:
293
+ href: ./dtcg/json/semantic.tokens.json#fade-in-transition
294
+ - kind: token
295
+ id: opacity-low
296
+ name: opacity-low
297
+ description: 'The low opacity step. The low separator color is built on it.'
298
+ metadata:
299
+ status:
300
+ status: stable
301
+ group: opacity
302
+ source:
303
+ href: ./dtcg/json/semantic.tokens.json#opacity-low
304
+ - kind: token
305
+ id: opacity-mid
306
+ name: opacity-mid
307
+ description: 'The middle opacity step. Placeholder text and overlays use it.'
308
+ metadata:
309
+ status:
310
+ status: stable
311
+ group: opacity
312
+ source:
313
+ href: ./dtcg/json/semantic.tokens.json#opacity-mid
314
+ - kind: token
315
+ id: opacity-high
316
+ name: opacity-high
317
+ description: 'The high opacity step, for content that stays nearly solid.'
318
+ metadata:
319
+ status:
320
+ status: stable
321
+ group: opacity
322
+ source:
323
+ href: ./dtcg/json/semantic.tokens.json#opacity-high
324
+ - kind: token
325
+ id: opacity-full
326
+ name: opacity-full
327
+ description: 'Fully opaque, for resetting an inherited opacity.'
328
+ metadata:
329
+ status:
330
+ status: stable
331
+ group: opacity
332
+ source:
333
+ href: ./dtcg/json/semantic.tokens.json#opacity-full
334
+ - kind: entry
335
+ id: semantic-tokens
336
+ name: Semantic tokens
337
+ description: The theme-aware custom properties Sanity UI 5 builds from the palette, for colour, focus, opacity and motion in custom markup.
338
+ metadata:
339
+ tags:
340
+ [
341
+ color,
342
+ colour,
343
+ semantic,
344
+ css custom property,
345
+ background,
346
+ foreground,
347
+ separator,
348
+ border,
349
+ focus,
350
+ opacity,
351
+ dark mode,
352
+ tone,
353
+ ]
354
+ status:
355
+ status: stable
356
+ group: color.semantic
357
+ sections:
358
+ - kind: guidelines
359
+ for: all
360
+ framing: how-to-use
361
+ items:
362
+ - level: must
363
+ statement: >-
364
+ In custom markup that no component covers, take color from these properties, as
365
+ `var(--separator-low)` or `var(--foreground-high)`. Each resolves for light and dark
366
+ mode on its own.
367
+ checkedBy: manual
368
+ - level: should
369
+ statement: >-
370
+ Inside an element with a `tone`, the surface properties follow that tone:
371
+ `--background-*`, `--foreground-*` and `--separator-*` switch to the tone's ramp.
372
+ Read them there instead of choosing a tone color by hand.
373
+ - level: must-not
374
+ statement: >-
375
+ Do not use the names `--card-border-color`, `--card-bg-color`, `--card-fg-color` or
376
+ `--card-muted-bg-color`, and do not invent names like `--token-color-border`. They do not
377
+ exist, so the declaration does nothing.
378
+ checkedBy: manual
379
+ - level: must-not
380
+ statement: >-
381
+ Do not use these properties to restyle a design system component. They let custom markup
382
+ match the system; a component takes its color from `tone`.
383
+ checkedBy: manual
384
+ - kind: section
385
+ for: all
386
+ freeform:
387
+ - title: Overview
388
+ body: |-
389
+ Sanity UI 5 defines this layer in its own CSS, not in `@sanity-labs/design-tokens`. Each property is built from the palette with `light-dark()`, so one name serves both color schemes. This corpus keeps a generated copy in `tokens/dtcg/json/semantic.tokens.json`. Read `docs/tokens/dtcg/json/semantic.tokens.json` for every name with its light and dark value.
390
+ uses:
391
+ - to: color-palette
392
+ refs:
393
+ - to: color-guidelines
394
+ rel: relates-to
395
+ - href: ./dtcg/json/semantic.tokens.json
396
+ rel: source
397
+ role: DTCG source
@@ -0,0 +1,125 @@
1
+ schemaVersion: '0.23.1'
2
+ name: Sanity UI
3
+ entries:
4
+ - kind: token
5
+ id: shadow-0
6
+ name: shadow-0
7
+ description: No shadow (transparent). The flat base level.
8
+ metadata:
9
+ status:
10
+ status: stable
11
+ group: shadow
12
+ tokenType: shadow
13
+ source:
14
+ href: ./dtcg/json/shadow.tokens.json#shadow-0
15
+ - kind: token
16
+ id: shadow-1
17
+ name: shadow-1
18
+ description: Subtle hairline lift. Resting cards and raised surfaces.
19
+ metadata:
20
+ status:
21
+ status: stable
22
+ group: shadow
23
+ tokenType: shadow
24
+ source:
25
+ href: ./dtcg/json/shadow.tokens.json#shadow-1
26
+ - kind: token
27
+ id: shadow-2
28
+ name: shadow-2
29
+ description: Low lift. Hovered cards and small raised elements.
30
+ metadata:
31
+ status:
32
+ status: stable
33
+ group: shadow
34
+ tokenType: shadow
35
+ source:
36
+ href: ./dtcg/json/shadow.tokens.json#shadow-2
37
+ - kind: token
38
+ id: shadow-3
39
+ name: shadow-3
40
+ description: Medium lift. Popovers, dropdowns, and menus.
41
+ metadata:
42
+ status:
43
+ status: stable
44
+ group: shadow
45
+ tokenType: shadow
46
+ source:
47
+ href: ./dtcg/json/shadow.tokens.json#shadow-3
48
+ - kind: token
49
+ id: shadow-4
50
+ name: shadow-4
51
+ description: High lift. Modals and overlays.
52
+ metadata:
53
+ status:
54
+ status: stable
55
+ group: shadow
56
+ tokenType: shadow
57
+ source:
58
+ href: ./dtcg/json/shadow.tokens.json#shadow-4
59
+ - kind: token
60
+ id: shadow-5
61
+ name: shadow-5
62
+ description: Highest lift. Modals and top-layer surfaces.
63
+ metadata:
64
+ status:
65
+ status: stable
66
+ group: shadow
67
+ tokenType: shadow
68
+ source:
69
+ href: ./dtcg/json/shadow.tokens.json#shadow-5
70
+ - kind: entry
71
+ id: shadow
72
+ name: Shadow scale
73
+ description: The elevation shadow recipes that signal depth and layering on Sanity UI surfaces.
74
+ metadata:
75
+ tags: [elevation, shadow, depth, z-index, overlay, layering]
76
+ status:
77
+ status: stable
78
+ group: shadow
79
+ sections:
80
+ - kind: guidelines
81
+ for: all
82
+ framing: how-to-use
83
+ items:
84
+ - level: must
85
+ statement: Reference a named shadow level. Never paste an inline `box-shadow` onto a component.
86
+ - level: must
87
+ statement: Never rely on shadow alone to separate surfaces. Pair it with a tonal difference or a border, especially in dark mode, where shadows nearly vanish.
88
+ - level: should
89
+ statement: Assign a level by the element's role and stacking intent, not by look.
90
+ - level: should
91
+ statement: Use the lowest level that does the job. If everything is elevated, nothing reads as raised.
92
+ - level: should
93
+ statement: Let z-order follow the level. Don't fight it with ad hoc z-index values.
94
+ - kind: section
95
+ for: all
96
+ freeform:
97
+ - title: Overview
98
+ body: |-
99
+ Shadow tokens express elevation — which surfaces sit in front of which. Each token is a layered shadow recipe. All recipes share one light source from above. Shadow grows larger and softer as the level rises.
100
+ - title: The scale
101
+ body: |-
102
+ | Token | Level | Use for |
103
+ | --- | --- | --- |
104
+ | `shadow-0` | Flat | No shadow. The base surface. |
105
+ | `shadow-1` | Resting | Resting cards and raised surfaces. |
106
+ | `shadow-2` | Low | Hovered cards and small raised elements. |
107
+ | `shadow-3` | Medium | Popovers, dropdowns, and menus. |
108
+ | `shadow-4` | High | Modals and overlays. |
109
+ | `shadow-5` | Highest | Modals and top-layer surfaces. |
110
+
111
+ Elevation is relative and ordinal — it conveys order, not height. Higher levels read as more temporary and more in front.
112
+ - title: Related
113
+ body: |-
114
+ - **Elevation guidelines** — principles, rules, the grayscale and dark-mode tests, and the checklist.
115
+ - **Color guidelines** — dark-mode tonal elevation, where shadow nearly vanishes.
116
+ - **Motion** — elevation changes on hover or drag animate with the motion tokens.
117
+ - kind: section
118
+ for: agent
119
+ freeform:
120
+ - title: Intent
121
+ body: Choose a shadow level by the surface's role and stacking order. Pair elevation with a tonal or border difference.
122
+ refs:
123
+ - href: ./dtcg/json/shadow.tokens.json
124
+ rel: source
125
+ role: DTCG source
@@ -0,0 +1,185 @@
1
+ schemaVersion: '0.23.1'
2
+ name: Sanity UI
3
+ entries:
4
+ - kind: token
5
+ id: space-0
6
+ name: space-0
7
+ description: Removes padding, margin, or gap.
8
+ metadata:
9
+ status:
10
+ status: stable
11
+ group: space
12
+ tokenType: dimension
13
+ source:
14
+ href: ./dtcg/json/space.tokens.json#space-0
15
+ - kind: token
16
+ id: space-1
17
+ name: space-1
18
+ description: Tight gaps — a label with its input, an icon with text.
19
+ metadata:
20
+ status:
21
+ status: stable
22
+ group: space
23
+ tokenType: dimension
24
+ source:
25
+ href: ./dtcg/json/space.tokens.json#space-1
26
+ - kind: token
27
+ id: space-2
28
+ name: space-2
29
+ description: Compact padding — toolbars, sidebar items.
30
+ metadata:
31
+ status:
32
+ status: stable
33
+ group: space
34
+ tokenType: dimension
35
+ source:
36
+ href: ./dtcg/json/space.tokens.json#space-2
37
+ - kind: token
38
+ id: space-3
39
+ name: space-3
40
+ description: Standard padding — buttons, fields, compact cards. Card's `compact` density.
41
+ metadata:
42
+ status:
43
+ status: stable
44
+ group: space
45
+ tokenType: dimension
46
+ source:
47
+ href: ./dtcg/json/space.tokens.json#space-3
48
+ - kind: token
49
+ id: space-4
50
+ name: space-4
51
+ description: Generous padding — dashboard cards, form sections. Card's default (`regular`) density.
52
+ metadata:
53
+ status:
54
+ status: stable
55
+ group: space
56
+ tokenType: dimension
57
+ source:
58
+ href: ./dtcg/json/space.tokens.json#space-4
59
+ - kind: token
60
+ id: space-5
61
+ name: space-5
62
+ description: Section padding — onboarding, auth forms, section breaks.
63
+ metadata:
64
+ status:
65
+ status: stable
66
+ group: space
67
+ tokenType: dimension
68
+ source:
69
+ href: ./dtcg/json/space.tokens.json#space-5
70
+ - kind: token
71
+ id: space-6
72
+ name: space-6
73
+ description: Page-level section breaks. Not for component interiors.
74
+ metadata:
75
+ status:
76
+ status: stable
77
+ group: space
78
+ tokenType: dimension
79
+ source:
80
+ href: ./dtcg/json/space.tokens.json#space-6
81
+ - kind: token
82
+ id: space-7
83
+ name: space-7
84
+ description: Page-level layout.
85
+ metadata:
86
+ status:
87
+ status: stable
88
+ group: space
89
+ tokenType: dimension
90
+ source:
91
+ href: ./dtcg/json/space.tokens.json#space-7
92
+ - kind: token
93
+ id: space-8
94
+ name: space-8
95
+ description: Page-level layout.
96
+ metadata:
97
+ status:
98
+ status: stable
99
+ group: space
100
+ tokenType: dimension
101
+ source:
102
+ href: ./dtcg/json/space.tokens.json#space-8
103
+ - kind: token
104
+ id: space-9
105
+ name: space-9
106
+ description: Page-level layout.
107
+ metadata:
108
+ status:
109
+ status: stable
110
+ group: space
111
+ tokenType: dimension
112
+ source:
113
+ href: ./dtcg/json/space.tokens.json#space-9
114
+ - kind: entry
115
+ id: space
116
+ name: Space scale
117
+ description: The spacing scale for padding, margin, and gap across Sanity UI layout components.
118
+ metadata:
119
+ tags: [spacing, space, scale, padding, margin, gap, dimension, layout]
120
+ status:
121
+ status: stable
122
+ group: space
123
+ sections:
124
+ - kind: guidelines
125
+ for: all
126
+ framing: how-to-use
127
+ items:
128
+ - level: must
129
+ statement: Pass spacing as an integer in braces — `padding={2}`, `gap={3}`. A string like `padding="2"` is a TypeScript error.
130
+ - level: must
131
+ statement: Take every value from the scale. The scale is a Fibonacci sequence. Read the value of each step from `docs/tokens/dtcg/json/space.tokens.json`.
132
+ - refs:
133
+ - to: shared-foundations#inner-spacing-smaller-than-outer
134
+ rel: same-as
135
+ - level: should
136
+ statement: Prefer the parent's `gap` over a `margin` on each child.
137
+ - level: must-not
138
+ statement: Do not use steps `6`–`9` inside a component interior. Reserve them for page-level layout.
139
+ - level: must-not
140
+ statement: Do not hardcode the pixel values. Pass the step, so the value follows the token file when the scale changes.
141
+ - kind: guidelines
142
+ for: agent
143
+ framing: how-to-use
144
+ items:
145
+ - level: must
146
+ statement: Spacing props (padding, margin, gap, and their axis variants) take integer literals, not strings. `gap={3}` is correct; `gap='3'` and `gap='medium'` are TypeScript errors.
147
+ - kind: section
148
+ for: all
149
+ freeform:
150
+ - title: Overview
151
+ body: |-
152
+ The space scale holds Sanity UI's spacing values. Layout primitives use it for `padding`, `margin`, and `gap`. The scale has 10 steps, `0` through `9`. Step `0` removes spacing.
153
+ - title: The scale
154
+ body: |-
155
+ From step `2` up, each value is the sum of the two before it. Steps sit close together at small sizes and spread apart at large ones. Steps `6`–`9` are for page-level layout, not component interiors.
156
+
157
+ | Step | Token | Common use |
158
+ | --- | --- | --- |
159
+ | `0` | `space-0` | No spacing |
160
+ | `1` | `space-1` | Tight gaps — label with input, icon with text |
161
+ | `2` | `space-2` | Compact padding — toolbars, sidebar items |
162
+ | `3` | `space-3` | Standard padding — cards, buttons, fields |
163
+ | `4` | `space-4` | Generous padding — dashboard cards, form sections |
164
+ | `5` | `space-5` | Section padding — onboarding, auth forms |
165
+ | `6` | `space-6` | Page-level section breaks |
166
+ | `7` | `space-7` | Page-level |
167
+ | `8` | `space-8` | Page-level |
168
+ | `9` | `space-9` | Page-level |
169
+
170
+ The values live in `docs/tokens/dtcg/json/space.tokens.json`.
171
+ - title: Related
172
+ body: |-
173
+ - **Spacing guidelines** — principles, props, and grouping rules.
174
+ - **Box** and **Flex** — accept `padding` and `margin`.
175
+ - **Card** — sets inner spacing with `density`, not `padding`.
176
+ - **Flex**, **Grid**, **VStack**, **HStack** — accept `gap`.
177
+ - kind: section
178
+ for: agent
179
+ freeform:
180
+ - title: Intent
181
+ body: Apply the spacing scale by integer step, chosen by content density. Most component work lives in steps 0–5.
182
+ refs:
183
+ - href: ./dtcg/json/space.tokens.json
184
+ rel: source
185
+ role: DTCG source