@tempoxyz/ds 0.3.13 → 0.3.14

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 (131) hide show
  1. package/dist/docs/AGENTS.md +7 -1
  2. package/dist/docs/product/components/button.md +1 -1
  3. package/dist/docs/product/components/table.md +1 -0
  4. package/dist/docs/product/foundations/agents.md +10 -1
  5. package/dist/docs/product/foundations/linter.md +27 -0
  6. package/dist/docs/product/foundations/typography.md +89 -24
  7. package/dist/docs/product/patterns/forms.md +1 -1
  8. package/dist/docs/product/patterns/tables-and-lists.md +206 -0
  9. package/dist/docs/product/products/tempo-performance.md +3 -5
  10. package/dist/oxlint/index.d.ts.map +1 -1
  11. package/dist/oxlint/index.js +3 -0
  12. package/dist/oxlint/index.js.map +1 -1
  13. package/dist/oxlint/rules/PreferTypography.d.ts +11 -0
  14. package/dist/oxlint/rules/PreferTypography.d.ts.map +1 -0
  15. package/dist/oxlint/rules/PreferTypography.js +68 -0
  16. package/dist/oxlint/rules/PreferTypography.js.map +1 -0
  17. package/dist/web/components/Accordion.js.zyzz.json +1 -1
  18. package/dist/web/components/AddressCard.js.zyzz.json +1 -1
  19. package/dist/web/components/AgentLogo.js.zyzz.json +1 -1
  20. package/dist/web/components/Alert.js.zyzz.json +1 -1
  21. package/dist/web/components/AlertDialog.js.zyzz.json +1 -1
  22. package/dist/web/components/Amount.js.zyzz.json +1 -1
  23. package/dist/web/components/AmountInput.js.zyzz.json +1 -1
  24. package/dist/web/components/AppShell.js.zyzz.json +1 -1
  25. package/dist/web/components/AssetChip.js.zyzz.json +1 -1
  26. package/dist/web/components/Autocomplete.js.zyzz.json +1 -1
  27. package/dist/web/components/Avatar.js.zyzz.json +1 -1
  28. package/dist/web/components/Badge.js.zyzz.json +1 -1
  29. package/dist/web/components/BadgedLogo.js.zyzz.json +1 -1
  30. package/dist/web/components/Banner.js.zyzz.json +1 -1
  31. package/dist/web/components/BarChart.js.zyzz.json +1 -1
  32. package/dist/web/components/Breadcrumbs.js.zyzz.json +1 -1
  33. package/dist/web/components/Button.css +1 -1
  34. package/dist/web/components/Button.d.ts +21 -1
  35. package/dist/web/components/Button.d.ts.map +1 -1
  36. package/dist/web/components/Button.js +3 -2
  37. package/dist/web/components/Button.js.map +1 -1
  38. package/dist/web/components/Button.js.zyzz.json +1 -1
  39. package/dist/web/components/ButtonGroup.js.zyzz.json +1 -1
  40. package/dist/web/components/Calendar.js.zyzz.json +1 -1
  41. package/dist/web/components/Callout.js.zyzz.json +1 -1
  42. package/dist/web/components/Checkbox.js.zyzz.json +1 -1
  43. package/dist/web/components/CheckboxGroup.js.zyzz.json +1 -1
  44. package/dist/web/components/ChoiceGroup.js.zyzz.json +1 -1
  45. package/dist/web/components/Choicebox.js.zyzz.json +1 -1
  46. package/dist/web/components/Code.js.zyzz.json +1 -1
  47. package/dist/web/components/Combobox.js.zyzz.json +1 -1
  48. package/dist/web/components/Container.js.zyzz.json +1 -1
  49. package/dist/web/components/CopyButton.js.zyzz.json +1 -1
  50. package/dist/web/components/DatePicker.js.zyzz.json +1 -1
  51. package/dist/web/components/Dialog.js.zyzz.json +1 -1
  52. package/dist/web/components/Drawer.js.zyzz.json +1 -1
  53. package/dist/web/components/Empty.js.zyzz.json +1 -1
  54. package/dist/web/components/Field.js.zyzz.json +1 -1
  55. package/dist/web/components/Fieldset.js.zyzz.json +1 -1
  56. package/dist/web/components/Frame.js.zyzz.json +1 -1
  57. package/dist/web/components/Gauge.js.zyzz.json +1 -1
  58. package/dist/web/components/GetStartedVisual.js.zyzz.json +1 -1
  59. package/dist/web/components/Grid.js.zyzz.json +1 -1
  60. package/dist/web/components/HeroVisual.js.zyzz.json +1 -1
  61. package/dist/web/components/Hex.js.zyzz.json +1 -1
  62. package/dist/web/components/IconTile.js.zyzz.json +1 -1
  63. package/dist/web/components/Identicon.js.zyzz.json +1 -1
  64. package/dist/web/components/Inline.js.zyzz.json +1 -1
  65. package/dist/web/components/Inset.js.zyzz.json +1 -1
  66. package/dist/web/components/Kbd.js.zyzz.json +1 -1
  67. package/dist/web/components/ListGroup.js.zyzz.json +1 -1
  68. package/dist/web/components/LoadingDots.js.zyzz.json +1 -1
  69. package/dist/web/components/Menu.js.zyzz.json +1 -1
  70. package/dist/web/components/NativeSelect.js.zyzz.json +1 -1
  71. package/dist/web/components/NetworkLogo.js.zyzz.json +1 -1
  72. package/dist/web/components/NumberField.js.zyzz.json +1 -1
  73. package/dist/web/components/OtpField.js.zyzz.json +1 -1
  74. package/dist/web/components/Pagination.js.zyzz.json +1 -1
  75. package/dist/web/components/Popover.js.zyzz.json +1 -1
  76. package/dist/web/components/Progress.js.zyzz.json +1 -1
  77. package/dist/web/components/Qr.js.zyzz.json +1 -1
  78. package/dist/web/components/RadioGroup.js.zyzz.json +1 -1
  79. package/dist/web/components/SecretValue.js.zyzz.json +1 -1
  80. package/dist/web/components/Select.js.zyzz.json +1 -1
  81. package/dist/web/components/Separator.js.zyzz.json +1 -1
  82. package/dist/web/components/SidebarMenu.js.zyzz.json +1 -1
  83. package/dist/web/components/Skeleton.js.zyzz.json +1 -1
  84. package/dist/web/components/Slider.js.zyzz.json +1 -1
  85. package/dist/web/components/Snippet.js.zyzz.json +1 -1
  86. package/dist/web/components/Spinner.js.zyzz.json +1 -1
  87. package/dist/web/components/SplitBar.js.zyzz.json +1 -1
  88. package/dist/web/components/SplitButton.js.zyzz.json +1 -1
  89. package/dist/web/components/Stack.js.zyzz.json +1 -1
  90. package/dist/web/components/StatusChip.js.zyzz.json +1 -1
  91. package/dist/web/components/StatusIndicator.js.zyzz.json +1 -1
  92. package/dist/web/components/StatusRow.js.zyzz.json +1 -1
  93. package/dist/web/components/Stepper.js.zyzz.json +1 -1
  94. package/dist/web/components/SuccessHero.js.zyzz.json +1 -1
  95. package/dist/web/components/Surface.js.zyzz.json +1 -1
  96. package/dist/web/components/Switch.js.zyzz.json +1 -1
  97. package/dist/web/components/Table.js.zyzz.json +1 -1
  98. package/dist/web/components/Tabs.css +1 -1
  99. package/dist/web/components/Tabs.d.ts +9 -9
  100. package/dist/web/components/Tabs.js.map +1 -1
  101. package/dist/web/components/Tabs.js.zyzz.json +1 -1
  102. package/dist/web/components/TempoLogo.js.zyzz.json +1 -1
  103. package/dist/web/components/TextInput.js.zyzz.json +1 -1
  104. package/dist/web/components/Textarea.js.zyzz.json +1 -1
  105. package/dist/web/components/Toast.css +1 -1
  106. package/dist/web/components/Toast.js +5 -5
  107. package/dist/web/components/Toast.js.map +1 -1
  108. package/dist/web/components/Toast.js.zyzz.json +1 -1
  109. package/dist/web/components/Token.js.zyzz.json +1 -1
  110. package/dist/web/components/TokenLogo.js.zyzz.json +1 -1
  111. package/dist/web/components/Tooltip.js.zyzz.json +1 -1
  112. package/dist/web/components/VerificationCode.js.zyzz.json +1 -1
  113. package/dist/web/components/Visual.js.zyzz.json +1 -1
  114. package/dist/web/components/internal/Field.js.zyzz.json +1 -1
  115. package/dist/web/components/internal/InputGroup.js.zyzz.json +1 -1
  116. package/dist/web/components/internal/Listbox.js.zyzz.json +1 -1
  117. package/dist/web/components/internal/Streaks.js.zyzz.json +1 -1
  118. package/dist/web/index.js.zyzz.json +1 -1
  119. package/dist/web/vars.d.ts +5 -5
  120. package/dist/web/vars.d.ts.map +1 -1
  121. package/dist/web/vars.js.map +1 -1
  122. package/dist/web/vars.js.zyzz.json +1 -1
  123. package/dist/web/zyzz.config.d.ts +25 -25
  124. package/dist/web/zyzz.config.js.zyzz.json +1 -1
  125. package/package.json +1 -1
  126. package/src/oxlint/index.ts +3 -0
  127. package/src/oxlint/rules/PreferTypography.ts +72 -0
  128. package/src/web/components/Button.tsx +24 -6
  129. package/src/web/components/Tabs.tsx +9 -9
  130. package/src/web/components/Toast.tsx +2 -2
  131. package/src/web/vars.ts +9 -7
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tempoxyz/ds",
3
3
  "type": "module",
4
- "version": "0.3.13",
4
+ "version": "0.3.14",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "DESIGN.md",
@@ -9,6 +9,7 @@ import * as PreferComponent from './rules/PreferComponent.ts'
9
9
  import * as PreferLayout from './rules/PreferLayout.ts'
10
10
  import * as PreferProgress from './rules/PreferProgress.ts'
11
11
  import * as PreferSurface from './rules/PreferSurface.ts'
12
+ import * as PreferTypography from './rules/PreferTypography.ts'
12
13
  import * as RequireAccessibleName from './rules/RequireAccessibleName.ts'
13
14
  import * as RequireScrollRegion from './rules/RequireScrollRegion.ts'
14
15
 
@@ -101,6 +102,7 @@ export const web: Config = {
101
102
  'tds/prefer-layout': 'warn',
102
103
  'tds/prefer-progress': 'warn',
103
104
  'tds/prefer-surface': 'warn',
105
+ 'tds/prefer-typography': 'warn',
104
106
  'tds/require-accessible-name': 'error',
105
107
  'tds/require-scroll-region': 'warn',
106
108
  ...zyzz,
@@ -120,6 +122,7 @@ const plugin: Plugin = {
120
122
  'prefer-layout': PreferLayout.rule,
121
123
  'prefer-progress': PreferProgress.rule,
122
124
  'prefer-surface': PreferSurface.rule,
125
+ 'prefer-typography': PreferTypography.rule,
123
126
  'require-accessible-name': RequireAccessibleName.rule,
124
127
  'require-scroll-region': RequireScrollRegion.rule,
125
128
  },
@@ -0,0 +1,72 @@
1
+ /** Finds type styles that Zyzz definitions compose outside a `typography` set. @module */
2
+ import type { ESTree, Rule } from '@oxlint/plugins'
3
+ import * as Docs from '../internal/Docs.ts'
4
+ import * as Styles from '../internal/Styles.ts'
5
+
6
+ // Properties that a typography set bundles.
7
+ const type = /^(?:fontFamily|fontSize|fontWeight|letterSpacing|lineHeight)$/
8
+
9
+ const url = Docs.page('foundations/linter#set-type-with-a-typography-set')
10
+
11
+ /**
12
+ * Reports the type properties of one `style()` or `variants()` object when it sets two or more of
13
+ * `fontFamily`, `fontSize`, `fontWeight`, `letterSpacing`, and `lineHeight`, or one of them beside
14
+ * `typography`. Each composes a type style that no set defines. One property alone, such as a
15
+ * `fontSize` that sizes an icon or a mono `fontFamily` on inline code, passes, and so do `inherit`
16
+ * values, which reset native controls.
17
+ */
18
+ export const rule: Rule = {
19
+ meta: {
20
+ docs: { description: 'Set type with one `typography` set, not composed type properties.' },
21
+ messages: {
22
+ typography:
23
+ "'{{property}}' composes a type style outside a typography set. Use one `typography` set, such as 'body.b2'. See {{url}}",
24
+ },
25
+ schema: [],
26
+ type: 'suggestion',
27
+ },
28
+ create(context) {
29
+ function check(object: ESTree.ObjectExpression) {
30
+ const found: ESTree.Node[] = []
31
+ let typography = false
32
+
33
+ for (const property of object.properties) {
34
+ if (property.type !== 'Property') continue
35
+ if (property.value.type === 'ObjectExpression') {
36
+ check(property.value)
37
+ continue
38
+ }
39
+
40
+ // Compound variants hold an array of `{ when, style }` objects.
41
+ if (property.value.type === 'ArrayExpression') {
42
+ for (const element of property.value.elements)
43
+ if (element?.type === 'ObjectExpression') check(element)
44
+ continue
45
+ }
46
+
47
+ const name = Styles.key(property)
48
+
49
+ if (name === 'typography') typography = true
50
+ if (name === undefined || Styles.text(property.value) === 'inherit') continue
51
+ if (type.test(name)) found.push(property)
52
+ }
53
+
54
+ if (found.length === 0 || (found.length === 1 && !typography)) return
55
+
56
+ for (const property of found)
57
+ context.report({
58
+ data: { property: Styles.key(property) ?? '', url },
59
+ messageId: 'typography',
60
+ node: property,
61
+ })
62
+ }
63
+
64
+ return {
65
+ CallExpression(node) {
66
+ if (!Styles.helper(node.callee)) return
67
+ for (const argument of node.arguments.slice(0, 1))
68
+ if (argument.type === 'ObjectExpression') check(argument)
69
+ },
70
+ }
71
+ },
72
+ }
@@ -1,3 +1,4 @@
1
+ /** Renders action buttons and navigation links with the shared button designs. @module */
1
2
  import * as BaseUi from '@base-ui/react/button'
2
3
  import { useRender } from '@base-ui/react/use-render'
3
4
  import type { ComponentPropsWithRef } from 'react'
@@ -77,7 +78,7 @@ export namespace Button {
77
78
  disabled?: boolean | undefined
78
79
  /**
79
80
  * Disables the button, sets `aria-busy`, and renders a `Spinner` labelled "Loading" before
80
- * the label, which stays visible.
81
+ * the label, which stays visible. The spinner is centered in the leading space before it.
81
82
  *
82
83
  * @default false
83
84
  */
@@ -154,6 +155,7 @@ namespace styles {
154
155
  userSelect: 'none',
155
156
  whiteSpace: 'nowrap',
156
157
  selectors: {
158
+ '& > [role="progressbar"]': { position: 'relative' },
157
159
  '& > span > svg': { flexShrink: '0 !custom', fontSize: '16' },
158
160
  '&:active:not(:disabled)': {
159
161
  scale: 'press',
@@ -185,6 +187,7 @@ namespace styles {
185
187
  paddingInline: '0',
186
188
  // A loading icon button shows the spinner alone in the center of the circle.
187
189
  selectors: {
190
+ '& > [role="progressbar"]': { insetInlineStart: '0' },
188
191
  '& > span:last-child': { minWidth: '0 !custom' },
189
192
  '&[data-loading] > span:last-child': { display: 'none' },
190
193
  },
@@ -313,24 +316,34 @@ namespace styles {
313
316
  },
314
317
  // `xsmall` is a pill for actions inside a row or field. `large` and `medium` round at `sm`,
315
318
  // and `small` at `xs`. These keep an 80px minimum width, set on the label net of the
316
- // padding, so a flex row never shrinks a button below its label.
319
+ // padding, so a flex row never shrinks a button below its label. The loading spinner keeps its
320
+ // layout space and is centered between the leading edge and label with a logical offset.
317
321
  size: {
318
322
  large: {
319
323
  borderRadius: 'sm',
320
324
  height: '48',
321
325
  paddingInline: '32',
322
- selectors: { '& > span:last-child': { minWidth: '1rem !custom' } },
326
+ selectors: {
327
+ '& > [role="progressbar"]': { insetInlineStart: '-14px !custom' },
328
+ '& > span:last-child': { minWidth: '1rem !custom' },
329
+ },
323
330
  },
324
331
  medium: {
325
332
  borderRadius: 'sm',
326
333
  height: '40',
327
334
  paddingInline: '24',
328
- selectors: { '& > span:last-child': { minWidth: '2rem !custom' } },
335
+ selectors: {
336
+ '& > [role="progressbar"]': { insetInlineStart: '-10px !custom' },
337
+ '& > span:last-child': { minWidth: '2rem !custom' },
338
+ },
329
339
  },
330
340
  small: {
331
341
  height: '32',
332
342
  paddingInline: '16',
333
- selectors: { '& > span:last-child': { minWidth: '3rem !custom' } },
343
+ selectors: {
344
+ '& > [role="progressbar"]': { insetInlineStart: '-6px !custom' },
345
+ '& > span:last-child': { minWidth: '3rem !custom' },
346
+ },
334
347
  },
335
348
  xsmall: {
336
349
  borderRadius: 'full',
@@ -339,7 +352,11 @@ namespace styles {
339
352
  paddingInline: '12',
340
353
  typography: 'body.b3Strong',
341
354
  selectors: {
342
- '& > [role="progressbar"]': { height: '12', width: '12' },
355
+ '& > [role="progressbar"]': {
356
+ height: '12',
357
+ insetInlineStart: '-4px !custom',
358
+ width: '12',
359
+ },
343
360
  '& > span > svg': { fontSize: '12' },
344
361
  },
345
362
  },
@@ -401,6 +418,7 @@ namespace styles {
401
418
  padding: '0',
402
419
  typography: 'body.b2Strong',
403
420
  selectors: {
421
+ '& > [role="progressbar"]': { insetInlineStart: '0' },
404
422
  '& > span:last-child': { minWidth: '0 !custom' },
405
423
  '& > span > svg': { fontSize: '12' },
406
424
  '&:focus-visible': { outlineOffset: '2' },
@@ -221,13 +221,13 @@ namespace styles {
221
221
  '& > [role="tab"]': {
222
222
  height: '48',
223
223
  paddingInline: '32',
224
- typography: 'label.l2',
224
+ typography: 'body.b2Strong',
225
225
  },
226
226
  '& > [role="tab"]:is([data-active], [data-active]:hover)': {
227
- typography: 'label.l2',
227
+ typography: 'body.b2Strong',
228
228
  },
229
229
  '& > [role="tab"] [data-reserve]': {
230
- typography: 'label.l2',
230
+ typography: 'body.b2Strong',
231
231
  },
232
232
  },
233
233
  },
@@ -242,13 +242,13 @@ namespace styles {
242
242
  selectors: {
243
243
  '& > [role="tab"]': {
244
244
  paddingInline: '16',
245
- typography: 'label.l3',
245
+ typography: 'body.b3Strong',
246
246
  },
247
247
  '& > [role="tab"]:is([data-active], [data-active]:hover)': {
248
- typography: 'label.l3',
248
+ typography: 'body.b3Strong',
249
249
  },
250
250
  '& > [role="tab"] [data-reserve]': {
251
- typography: 'label.l3',
251
+ typography: 'body.b3Strong',
252
252
  },
253
253
  },
254
254
  },
@@ -359,13 +359,13 @@ namespace styles {
359
359
  minWidth: '5rem !custom',
360
360
  outlineOffset: '2',
361
361
  transitionProperty: 'background-color, color, outline-color, scale',
362
- typography: 'label.l2',
362
+ typography: 'body.b2Strong',
363
363
  },
364
364
  '& > [role="tab"]:is([data-active], [data-active]:hover)': {
365
- typography: 'label.l2',
365
+ typography: 'body.b2Strong',
366
366
  },
367
367
  '& > [role="tab"] [data-reserve]': {
368
- typography: 'label.l2',
368
+ typography: 'body.b2Strong',
369
369
  },
370
370
  // The fill marks the active tab, so the list hides the underline indicator.
371
371
  '& > span:not([role="tab"])': { display: 'none' },
@@ -286,7 +286,7 @@ namespace styles {
286
286
 
287
287
  // The title and description set their Pilat labels through the label typography sets.
288
288
  export const description = style(
289
- { color: 'content.secondary', margin: '0', typography: 'label.l3' },
289
+ { color: 'content.secondary', margin: '0', typography: 'body.b3Strong' },
290
290
  { id: 'tds/web/toast/description' },
291
291
  )
292
292
 
@@ -379,7 +379,7 @@ namespace styles {
379
379
  )
380
380
 
381
381
  export const title = style(
382
- { color: 'content.primary', margin: '0', typography: 'label.l2' },
382
+ { color: 'content.primary', margin: '0', typography: 'body.b2Strong' },
383
383
  { id: 'tds/web/toast/title' },
384
384
  )
385
385
 
package/src/web/vars.ts CHANGED
@@ -683,18 +683,19 @@ export const variables = Vars.define(
683
683
  lineHeight: '20.7px',
684
684
  },
685
685
  },
686
- // Labels set Pilat at the size and weight of B2 Strong and B3 Strong, tracked by 1% as the
687
- // Platform Tab and Toast draw them.
686
+ // Labels set Inter at the size and weight of B2 Strong and B3 Strong, tracked by 1%. Pilat is
687
+ // reserved for titles, so components set B2 Strong and B3 Strong, and the set remains for
688
+ // existing callers.
688
689
  label: {
689
690
  l2: {
690
- fontFamily: vars.fontFamily.heading,
691
+ fontFamily: vars.fontFamily.body,
691
692
  fontSize: '14px',
692
693
  fontWeight: 500,
693
694
  letterSpacing: '.14px',
694
695
  lineHeight: '20px',
695
696
  },
696
697
  l3: {
697
- fontFamily: vars.fontFamily.heading,
698
+ fontFamily: vars.fontFamily.body,
698
699
  fontSize: '12px',
699
700
  fontWeight: 500,
700
701
  letterSpacing: '.15px',
@@ -726,23 +727,24 @@ export const variables = Vars.define(
726
727
  lineHeight: '12px',
727
728
  },
728
729
  },
730
+ // Values set Inter, since Pilat is reserved for titles.
729
731
  value: {
730
732
  v1: {
731
- fontFamily: vars.fontFamily.heading,
733
+ fontFamily: vars.fontFamily.body,
732
734
  fontSize: '80px',
733
735
  fontWeight: 400,
734
736
  letterSpacing: '-2.4px',
735
737
  lineHeight: 'normal',
736
738
  },
737
739
  v2: {
738
- fontFamily: vars.fontFamily.heading,
740
+ fontFamily: vars.fontFamily.body,
739
741
  fontSize: '52px',
740
742
  fontWeight: 400,
741
743
  letterSpacing: '-1.56px',
742
744
  lineHeight: 'normal',
743
745
  },
744
746
  v3: {
745
- fontFamily: vars.fontFamily.heading,
747
+ fontFamily: vars.fontFamily.body,
746
748
  fontSize: '40px',
747
749
  fontWeight: 400,
748
750
  letterSpacing: '-1.2px',