@tempoxyz/ds 0.3.11 → 0.3.13
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/README.md +7 -6
- package/dist/docs/AGENTS.md +8 -5
- package/dist/docs/index.md +143 -135
- package/dist/docs/marketing/introduction/getting-started.md +241 -0
- package/dist/docs/{components → product/components}/accordion.md +8 -8
- package/dist/docs/{components → product/components}/address-card.md +5 -5
- package/dist/docs/{components → product/components}/agent-logo.md +5 -5
- package/dist/docs/{components → product/components}/alert-dialog.md +11 -11
- package/dist/docs/{components → product/components}/alert.md +11 -11
- package/dist/docs/{components → product/components}/amount-input.md +13 -13
- package/dist/docs/{components → product/components}/amount.md +8 -8
- package/dist/docs/{components → product/components}/app-shell.md +13 -13
- package/dist/docs/{components → product/components}/asset-chip.md +11 -11
- package/dist/docs/{components → product/components}/autocomplete.md +10 -9
- package/dist/docs/{components → product/components}/avatar.md +8 -8
- package/dist/docs/{components → product/components}/badge.md +9 -9
- package/dist/docs/{components → product/components}/badged-logo.md +6 -6
- package/dist/docs/{components → product/components}/banner.md +8 -8
- package/dist/docs/{components → product/components}/bar-chart.md +7 -7
- package/dist/docs/{components → product/components}/breadcrumbs.md +8 -8
- package/dist/docs/{components → product/components}/button-group.md +8 -8
- package/dist/docs/{components → product/components}/button.md +17 -17
- package/dist/docs/{components → product/components}/calendar.md +8 -8
- package/dist/docs/{components → product/components}/callout.md +5 -5
- package/dist/docs/{components → product/components}/checkbox-group.md +13 -13
- package/dist/docs/{components → product/components}/checkbox.md +12 -12
- package/dist/docs/{components → product/components}/choice-group.md +14 -14
- package/dist/docs/{components → product/components}/choicebox.md +9 -9
- package/dist/docs/{components → product/components}/code.md +5 -5
- package/dist/docs/{components → product/components}/combobox.md +9 -9
- package/dist/docs/{components → product/components}/container.md +7 -7
- package/dist/docs/{components → product/components}/copy-button.md +13 -13
- package/dist/docs/{components → product/components}/date-picker.md +11 -11
- package/dist/docs/{components → product/components}/dialog.md +17 -17
- package/dist/docs/{components → product/components}/drawer.md +11 -11
- package/dist/docs/{components → product/components}/empty.md +9 -9
- package/dist/docs/{components → product/components}/field.md +14 -14
- package/dist/docs/{components → product/components}/fieldset.md +6 -6
- package/dist/docs/{components → product/components}/frame.md +9 -9
- package/dist/docs/{components → product/components}/gauge.md +7 -7
- package/dist/docs/{components → product/components}/get-started-visual.md +4 -4
- package/dist/docs/{components → product/components}/grid.md +7 -7
- package/dist/docs/{components → product/components}/hero-visual.md +4 -4
- package/dist/docs/{components → product/components}/hex.md +9 -9
- package/dist/docs/{components → product/components}/icon-tile.md +8 -8
- package/dist/docs/{components → product/components}/identicon.md +7 -7
- package/dist/docs/{components → product/components}/inline.md +7 -7
- package/dist/docs/{components → product/components}/inset.md +8 -8
- package/dist/docs/{components → product/components}/kbd.md +8 -8
- package/dist/docs/{components → product/components}/list-group.md +24 -24
- package/dist/docs/{components → product/components}/loading-dots.md +8 -8
- package/dist/docs/{components → product/components}/menu.md +14 -14
- package/dist/docs/{components → product/components}/native-select.md +7 -7
- package/dist/docs/{components → product/components}/network-logo.md +7 -7
- package/dist/docs/{components → product/components}/number-field.md +8 -8
- package/dist/docs/{components → product/components}/otp-field.md +9 -9
- package/dist/docs/{components → product/components}/pagination.md +8 -8
- package/dist/docs/{components → product/components}/popover.md +11 -11
- package/dist/docs/{components → product/components}/progress.md +10 -10
- package/dist/docs/{components → product/components}/qr.md +8 -8
- package/dist/docs/{components → product/components}/radio-group.md +10 -10
- package/dist/docs/{components → product/components}/secret-value.md +8 -8
- package/dist/docs/{components → product/components}/select.md +13 -13
- package/dist/docs/{components → product/components}/separator.md +7 -7
- package/dist/docs/{components → product/components}/sidebar-menu.md +11 -11
- package/dist/docs/{components → product/components}/skeleton.md +9 -9
- package/dist/docs/{components → product/components}/slider.md +8 -8
- package/dist/docs/{components → product/components}/snippet.md +10 -10
- package/dist/docs/{components → product/components}/spinner.md +12 -12
- package/dist/docs/{components → product/components}/split-bar.md +5 -5
- package/dist/docs/{components → product/components}/split-button.md +11 -11
- package/dist/docs/{components → product/components}/stack.md +8 -8
- package/dist/docs/{components → product/components}/status-chip.md +7 -7
- package/dist/docs/{components → product/components}/status-indicator.md +6 -6
- package/dist/docs/{components → product/components}/status-row.md +7 -7
- package/dist/docs/{components → product/components}/stepper.md +9 -9
- package/dist/docs/{components → product/components}/success-hero.md +5 -5
- package/dist/docs/{components → product/components}/surface.md +11 -11
- package/dist/docs/{components → product/components}/switch.md +11 -11
- package/dist/docs/{components → product/components}/table.md +16 -16
- package/dist/docs/{components → product/components}/tabs.md +11 -11
- package/dist/docs/{components → product/components}/tempo-logo.md +4 -4
- package/dist/docs/{components → product/components}/text-input.md +14 -14
- package/dist/docs/{components → product/components}/textarea.md +7 -7
- package/dist/docs/{components → product/components}/toast.md +11 -11
- package/dist/docs/{components → product/components}/token-logo.md +16 -16
- package/dist/docs/{components → product/components}/token.md +10 -10
- package/dist/docs/{components → product/components}/tooltip.md +11 -11
- package/dist/docs/{components → product/components}/verification-code.md +4 -4
- package/dist/docs/{components → product/components}/visual.md +5 -5
- package/dist/docs/product/components.md +203 -0
- package/dist/docs/{foundations → product/foundations}/accessibility.md +16 -16
- package/dist/docs/{foundations → product/foundations}/agents.md +17 -17
- package/dist/docs/{foundations → product/foundations}/color.md +7 -7
- package/dist/docs/{foundations → product/foundations}/content/tone.md +7 -7
- package/dist/docs/{foundations → product/foundations}/content/voice.md +2 -2
- package/dist/docs/{foundations → product/foundations}/content/writing-style.md +8 -8
- package/dist/docs/{foundations → product/foundations}/iconography.md +11 -11
- package/dist/docs/{foundations → product/foundations}/intent.md +28 -28
- package/dist/docs/{foundations → product/foundations}/layout.md +22 -22
- package/dist/docs/product/foundations/linter.md +496 -0
- package/dist/docs/{foundations → product/foundations}/motion.md +7 -7
- package/dist/docs/{foundations → product/foundations}/radius-and-padding.md +3 -3
- package/dist/docs/{foundations → product/foundations}/typography.md +4 -4
- package/dist/docs/{introduction → product/introduction}/faq.md +22 -21
- package/dist/docs/{introduction → product/introduction}/getting-started.md +4 -4
- package/dist/docs/{patterns → product/patterns}/blockchain-values.md +20 -20
- package/dist/docs/{patterns → product/patterns}/dashboards.md +28 -28
- package/dist/docs/{patterns → product/patterns}/destructive-actions.md +16 -16
- package/dist/docs/{patterns → product/patterns}/empty-states.md +14 -14
- package/dist/docs/{patterns → product/patterns}/errors-and-validation.md +23 -23
- package/dist/docs/{patterns → product/patterns}/feedback-and-status.md +31 -31
- package/dist/docs/{patterns → product/patterns}/forms.md +24 -24
- package/dist/docs/{patterns → product/patterns}/loading.md +19 -19
- package/dist/docs/{patterns → product/patterns}/navigation.md +23 -23
- package/dist/docs/{patterns → product/patterns}/payments.md +20 -20
- package/dist/docs/{patterns → product/patterns}/responsive-layout.md +23 -23
- package/dist/docs/{patterns → product/patterns}/tables-and-lists.md +19 -19
- package/dist/docs/{products → product/products}/tempo-console.md +12 -12
- package/dist/docs/{products → product/products}/tempo-performance.md +11 -11
- package/dist/docs/{products → product/products}/tempo-wallet.md +12 -12
- package/dist/marketing/index.d.ts +4 -0
- package/dist/marketing/index.d.ts.map +1 -0
- package/dist/marketing/index.js +4 -0
- package/dist/marketing/index.js.map +1 -0
- package/dist/marketing/index.js.zyzz.json +1 -0
- package/dist/marketing/vars.d.ts +907 -0
- package/dist/marketing/vars.d.ts.map +1 -0
- package/dist/marketing/vars.js +15 -0
- package/dist/marketing/vars.js.map +1 -0
- package/dist/marketing/vars.js.zyzz.json +1 -0
- package/dist/marketing/zyzz.config.d.ts +4512 -0
- package/dist/marketing/zyzz.config.d.ts.map +1 -0
- package/dist/marketing/zyzz.config.js +63 -0
- package/dist/marketing/zyzz.config.js.map +1 -0
- package/dist/marketing/zyzz.config.js.zyzz.json +1 -0
- package/dist/oxlint/index.d.ts +12 -1
- package/dist/oxlint/index.d.ts.map +1 -1
- package/dist/oxlint/index.js +39 -1
- package/dist/oxlint/index.js.map +1 -1
- package/dist/oxlint/internal/Docs.d.ts +9 -0
- package/dist/oxlint/internal/Docs.d.ts.map +1 -0
- package/dist/oxlint/internal/Docs.js +15 -0
- package/dist/oxlint/internal/Docs.js.map +1 -0
- package/dist/oxlint/internal/Imports.d.ts +1 -1
- package/dist/oxlint/internal/Imports.d.ts.map +1 -1
- package/dist/oxlint/internal/Imports.js +2 -0
- package/dist/oxlint/internal/Imports.js.map +1 -1
- package/dist/oxlint/internal/Styles.d.ts +40 -0
- package/dist/oxlint/internal/Styles.d.ts.map +1 -0
- package/dist/oxlint/internal/Styles.js +194 -0
- package/dist/oxlint/internal/Styles.js.map +1 -0
- package/dist/oxlint/internal/Tokens.d.ts +16 -0
- package/dist/oxlint/internal/Tokens.d.ts.map +1 -0
- package/dist/oxlint/internal/Tokens.js +39 -0
- package/dist/oxlint/internal/Tokens.js.map +1 -0
- package/dist/oxlint/rules/NoCrossSurface.d.ts +2 -2
- package/dist/oxlint/rules/NoCrossSurface.js +3 -3
- package/dist/oxlint/rules/NoCrossSurface.js.map +1 -1
- package/dist/oxlint/rules/NoCustomValues.d.ts +11 -0
- package/dist/oxlint/rules/NoCustomValues.d.ts.map +1 -0
- package/dist/oxlint/rules/NoCustomValues.js +150 -0
- package/dist/oxlint/rules/NoCustomValues.js.map +1 -0
- package/dist/oxlint/rules/NoSingleKeyShortcuts.d.ts +11 -0
- package/dist/oxlint/rules/NoSingleKeyShortcuts.d.ts.map +1 -0
- package/dist/oxlint/rules/NoSingleKeyShortcuts.js +158 -0
- package/dist/oxlint/rules/NoSingleKeyShortcuts.js.map +1 -0
- package/dist/oxlint/rules/PreferComponent.d.ts +3 -2
- package/dist/oxlint/rules/PreferComponent.d.ts.map +1 -1
- package/dist/oxlint/rules/PreferComponent.js +11 -4
- package/dist/oxlint/rules/PreferComponent.js.map +1 -1
- package/dist/oxlint/rules/PreferLayout.d.ts +9 -0
- package/dist/oxlint/rules/PreferLayout.d.ts.map +1 -0
- package/dist/oxlint/rules/PreferLayout.js +90 -0
- package/dist/oxlint/rules/PreferLayout.js.map +1 -0
- package/dist/oxlint/rules/PreferProgress.d.ts +9 -0
- package/dist/oxlint/rules/PreferProgress.d.ts.map +1 -0
- package/dist/oxlint/rules/PreferProgress.js +43 -0
- package/dist/oxlint/rules/PreferProgress.js.map +1 -0
- package/dist/oxlint/rules/PreferSurface.d.ts +9 -0
- package/dist/oxlint/rules/PreferSurface.d.ts.map +1 -0
- package/dist/oxlint/rules/PreferSurface.js +55 -0
- package/dist/oxlint/rules/PreferSurface.js.map +1 -0
- package/dist/oxlint/rules/RequireAccessibleName.d.ts.map +1 -1
- package/dist/oxlint/rules/RequireAccessibleName.js +3 -1
- package/dist/oxlint/rules/RequireAccessibleName.js.map +1 -1
- package/dist/oxlint/rules/RequireScrollRegion.d.ts +11 -0
- package/dist/oxlint/rules/RequireScrollRegion.d.ts.map +1 -0
- package/dist/oxlint/rules/RequireScrollRegion.js +71 -0
- package/dist/oxlint/rules/RequireScrollRegion.js.map +1 -0
- package/dist/web/icons/index.js.zyzz.json +1 -0
- package/package.json +6 -1
- package/src/marketing/README.md +21 -0
- package/src/marketing/index.ts +3 -0
- package/src/marketing/vars.ts +751 -0
- package/src/marketing/zyzz.config.ts +376 -0
- package/src/oxlint/index.ts +40 -1
- package/src/oxlint/internal/Docs.ts +18 -0
- package/src/oxlint/internal/Imports.ts +2 -1
- package/src/oxlint/internal/Styles.ts +240 -0
- package/src/oxlint/internal/Tokens.ts +43 -0
- package/src/oxlint/rules/NoCrossSurface.ts +3 -3
- package/src/oxlint/rules/NoCustomValues.ts +170 -0
- package/src/oxlint/rules/NoSingleKeyShortcuts.ts +190 -0
- package/src/oxlint/rules/PreferComponent.ts +11 -4
- package/src/oxlint/rules/PreferLayout.ts +96 -0
- package/src/oxlint/rules/PreferProgress.ts +49 -0
- package/src/oxlint/rules/PreferSurface.ts +70 -0
- package/src/oxlint/rules/RequireAccessibleName.ts +3 -1
- package/src/oxlint/rules/RequireScrollRegion.ts +92 -0
- package/dist/docs/components.md +0 -203
- package/dist/docs/foundations/linter.md +0 -296
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { Config } from 'zyzz'
|
|
2
|
+
import { fontFace, global } from 'zyzz/web'
|
|
3
|
+
import { variables } from './vars.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Zyzz authoring helpers bound to the Marketing variables, so token strings such as
|
|
7
|
+
* `content.primary`, `'6'` and `body.b2` type-check and compile ahead of time.
|
|
8
|
+
*
|
|
9
|
+
* - `style(definition)` returns a callable that produces `className` and `style` props.
|
|
10
|
+
* - `variants({ base, variants, defaultVariants })` returns a callable that takes the variant
|
|
11
|
+
* selection.
|
|
12
|
+
* - `vars` holds references such as `vars.ease.snappy`. Call `vars({ colorScheme })` for props
|
|
13
|
+
* that apply the variables, and optionally a color scheme, to a scope.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* namespace styles {
|
|
17
|
+
* export const panel = style({ backgroundColor: 'background.elevated', padding: '24' })
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* <section {...styles.panel()} />
|
|
21
|
+
*/
|
|
22
|
+
export const { style, variants, vars } = Config.create({
|
|
23
|
+
cssOutput: 'atomic',
|
|
24
|
+
id: 'tds/marketing',
|
|
25
|
+
// React Native's axis shorthands. Zyzz reads config options as literal data, so each config repeats them.
|
|
26
|
+
shorthands: {
|
|
27
|
+
marginHorizontal: ['marginLeft', 'marginRight'],
|
|
28
|
+
marginVertical: ['marginTop', 'marginBottom'],
|
|
29
|
+
paddingHorizontal: ['paddingLeft', 'paddingRight'],
|
|
30
|
+
paddingVertical: ['paddingTop', 'paddingBottom'],
|
|
31
|
+
},
|
|
32
|
+
vars: variables,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// Inter's subsets, written by `scripts/subset-fonts.ts`. A browser downloads only the subsets whose
|
|
36
|
+
// `unicodeRange` the page's text uses, and a face declared later takes precedence where ranges
|
|
37
|
+
// overlap, so the order is intentional: `symbols` first and `latin` last, as Google Fonts orders them.
|
|
38
|
+
fontFace({
|
|
39
|
+
fontDisplay: 'swap',
|
|
40
|
+
fontFamily: 'Inter',
|
|
41
|
+
fontStyle: 'normal',
|
|
42
|
+
fontWeight: '100 900',
|
|
43
|
+
src: "url('../fonts/Inter-symbols.woff2') format('woff2')",
|
|
44
|
+
unicodeRange:
|
|
45
|
+
'U+02CD-036F,U+0E3F,U+1DC0-1DFF,U+2070-2298,U+2303-232B,U+2380-238B,U+23CE-23CF,U+2423-2468,U+24B6-24EA,U+25A0-26A0,U+2713-2788,U+27EF-27FA,U+2913,U+2A38,U+2B06-2B24,U+2E18,U+A92E,U+E000-E163,U+E1C3-E2DC,U+EE01-EEE1,U+F6C3,U+1F12F-1F16B,U+1F850-1F852',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
fontFace({
|
|
49
|
+
fontDisplay: 'swap',
|
|
50
|
+
fontFamily: 'Inter',
|
|
51
|
+
fontStyle: 'normal',
|
|
52
|
+
fontWeight: '100 900',
|
|
53
|
+
src: "url('../fonts/Inter-cyrillic-ext.woff2') format('woff2')",
|
|
54
|
+
unicodeRange: 'U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F',
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
fontFace({
|
|
58
|
+
fontDisplay: 'swap',
|
|
59
|
+
fontFamily: 'Inter',
|
|
60
|
+
fontStyle: 'normal',
|
|
61
|
+
fontWeight: '100 900',
|
|
62
|
+
src: "url('../fonts/Inter-cyrillic.woff2') format('woff2')",
|
|
63
|
+
unicodeRange: 'U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116',
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
fontFace({
|
|
67
|
+
fontDisplay: 'swap',
|
|
68
|
+
fontFamily: 'Inter',
|
|
69
|
+
fontStyle: 'normal',
|
|
70
|
+
fontWeight: '100 900',
|
|
71
|
+
src: "url('../fonts/Inter-greek-ext.woff2') format('woff2')",
|
|
72
|
+
unicodeRange: 'U+1F00-1FFF',
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
fontFace({
|
|
76
|
+
fontDisplay: 'swap',
|
|
77
|
+
fontFamily: 'Inter',
|
|
78
|
+
fontStyle: 'normal',
|
|
79
|
+
fontWeight: '100 900',
|
|
80
|
+
src: "url('../fonts/Inter-greek.woff2') format('woff2')",
|
|
81
|
+
unicodeRange: 'U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF',
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
fontFace({
|
|
85
|
+
fontDisplay: 'swap',
|
|
86
|
+
fontFamily: 'Inter',
|
|
87
|
+
fontStyle: 'normal',
|
|
88
|
+
fontWeight: '100 900',
|
|
89
|
+
src: "url('../fonts/Inter-vietnamese.woff2') format('woff2')",
|
|
90
|
+
unicodeRange:
|
|
91
|
+
'U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB',
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
fontFace({
|
|
95
|
+
fontDisplay: 'swap',
|
|
96
|
+
fontFamily: 'Inter',
|
|
97
|
+
fontStyle: 'normal',
|
|
98
|
+
fontWeight: '100 900',
|
|
99
|
+
src: "url('../fonts/Inter-latin-ext.woff2') format('woff2')",
|
|
100
|
+
unicodeRange:
|
|
101
|
+
'U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF',
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
fontFace({
|
|
105
|
+
fontDisplay: 'swap',
|
|
106
|
+
fontFamily: 'Inter',
|
|
107
|
+
fontStyle: 'normal',
|
|
108
|
+
fontWeight: '100 900',
|
|
109
|
+
src: "url('../fonts/Inter-latin.woff2') format('woff2')",
|
|
110
|
+
unicodeRange:
|
|
111
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
// The JetBrains Mono and Pilat subsets, also written by `scripts/subset-fonts.ts`. Each weight has a
|
|
115
|
+
// `latin` subset with Inter's Latin range and an `other` subset with every other character. The
|
|
116
|
+
// `latin` face is declared after the `other` face, so it takes precedence where their ranges overlap.
|
|
117
|
+
fontFace({
|
|
118
|
+
fontDisplay: 'swap',
|
|
119
|
+
fontFamily: 'JetBrains Mono',
|
|
120
|
+
fontStyle: 'normal',
|
|
121
|
+
fontWeight: 400,
|
|
122
|
+
src: "url('../fonts/JetBrainsMono-Regular-other.woff2') format('woff2')",
|
|
123
|
+
unicodeRange:
|
|
124
|
+
'U+0100-0259,U+02B9-04F5,U+0AEA,U+1E80-1EF9,U+2070-20BF,U+2102-2140,U+218A-2424,U+2500-25F6,U+266D-26A1,U+2713-27F7,U+2916-2988,U+2A00-2A06,U+2B58,U+E0A0-E0B3,U+FE62,U+FF5B-FF5D,U+16910,U+1D538-1D56B',
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
fontFace({
|
|
128
|
+
fontDisplay: 'swap',
|
|
129
|
+
fontFamily: 'JetBrains Mono',
|
|
130
|
+
fontStyle: 'normal',
|
|
131
|
+
fontWeight: 400,
|
|
132
|
+
src: "url('../fonts/JetBrainsMono-Regular-latin.woff2') format('woff2')",
|
|
133
|
+
unicodeRange:
|
|
134
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
fontFace({
|
|
138
|
+
fontDisplay: 'swap',
|
|
139
|
+
fontFamily: 'JetBrains Mono',
|
|
140
|
+
fontStyle: 'normal',
|
|
141
|
+
fontWeight: 500,
|
|
142
|
+
src: "url('../fonts/JetBrainsMono-Medium-other.woff2') format('woff2')",
|
|
143
|
+
unicodeRange:
|
|
144
|
+
'U+0100-0259,U+02B9-04F5,U+0AEA,U+1E80-1EF9,U+2070-20BF,U+2102-2140,U+218A-2424,U+2500-25F6,U+266D-26A1,U+2713-27F7,U+2916-2988,U+2A00-2A06,U+2B58,U+E0A0-E0B3,U+FE62,U+FF5B-FF5D,U+16910,U+1D538-1D56B',
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
fontFace({
|
|
148
|
+
fontDisplay: 'swap',
|
|
149
|
+
fontFamily: 'JetBrains Mono',
|
|
150
|
+
fontStyle: 'normal',
|
|
151
|
+
fontWeight: 500,
|
|
152
|
+
src: "url('../fonts/JetBrainsMono-Medium-latin.woff2') format('woff2')",
|
|
153
|
+
unicodeRange:
|
|
154
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
fontFace({
|
|
158
|
+
fontDisplay: 'swap',
|
|
159
|
+
fontFamily: 'JetBrains Mono',
|
|
160
|
+
fontStyle: 'normal',
|
|
161
|
+
fontWeight: 600,
|
|
162
|
+
src: "url('../fonts/JetBrainsMono-SemiBold-other.woff2') format('woff2')",
|
|
163
|
+
unicodeRange:
|
|
164
|
+
'U+0100-0259,U+02B9-04F5,U+0AEA,U+1E80-1EF9,U+2070-20BF,U+2102-2140,U+218A-2424,U+2500-25F6,U+266D-26A1,U+2713-27F7,U+2916-2988,U+2A00-2A06,U+2B58,U+E0A0-E0B3,U+FE62,U+FF5B-FF5D,U+16910,U+1D538-1D56B',
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
fontFace({
|
|
168
|
+
fontDisplay: 'swap',
|
|
169
|
+
fontFamily: 'JetBrains Mono',
|
|
170
|
+
fontStyle: 'normal',
|
|
171
|
+
fontWeight: 600,
|
|
172
|
+
src: "url('../fonts/JetBrainsMono-SemiBold-latin.woff2') format('woff2')",
|
|
173
|
+
unicodeRange:
|
|
174
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
fontFace({
|
|
178
|
+
fontDisplay: 'swap',
|
|
179
|
+
fontFamily: 'JetBrains Mono',
|
|
180
|
+
fontStyle: 'normal',
|
|
181
|
+
fontWeight: 700,
|
|
182
|
+
src: "url('../fonts/JetBrainsMono-Bold-other.woff2') format('woff2')",
|
|
183
|
+
unicodeRange:
|
|
184
|
+
'U+0100-0259,U+02B9-04F5,U+0AEA,U+1E80-1EF9,U+2070-20BF,U+2102-2140,U+218A-2424,U+2500-25F6,U+266D-26A1,U+2713-27F7,U+2916-2988,U+2A00-2A06,U+2B58,U+E0A0-E0B3,U+FE62,U+FF5B-FF5D,U+16910,U+1D538-1D56B',
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
fontFace({
|
|
188
|
+
fontDisplay: 'swap',
|
|
189
|
+
fontFamily: 'JetBrains Mono',
|
|
190
|
+
fontStyle: 'normal',
|
|
191
|
+
fontWeight: 700,
|
|
192
|
+
src: "url('../fonts/JetBrainsMono-Bold-latin.woff2') format('woff2')",
|
|
193
|
+
unicodeRange:
|
|
194
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
fontFace({
|
|
198
|
+
fontDisplay: 'swap',
|
|
199
|
+
fontFamily: 'Pilat',
|
|
200
|
+
fontStyle: 'normal',
|
|
201
|
+
fontWeight: 100,
|
|
202
|
+
src: "url('../fonts/Pilat-Thin-other.woff2') format('woff2')",
|
|
203
|
+
unicodeRange:
|
|
204
|
+
'U+0100-0192,U+01FA-0237,U+02C7-0328,U+03A9-03C0,U+1E80-1E85,U+1EF2-1EF3,U+2070-208E,U+2113-212E,U+2190-2199,U+2202-2265,U+25CA-25CC,U+FB00',
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
fontFace({
|
|
208
|
+
fontDisplay: 'swap',
|
|
209
|
+
fontFamily: 'Pilat',
|
|
210
|
+
fontStyle: 'normal',
|
|
211
|
+
fontWeight: 100,
|
|
212
|
+
src: "url('../fonts/Pilat-Thin-latin.woff2') format('woff2')",
|
|
213
|
+
unicodeRange:
|
|
214
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
fontFace({
|
|
218
|
+
fontDisplay: 'swap',
|
|
219
|
+
fontFamily: 'Pilat',
|
|
220
|
+
fontStyle: 'normal',
|
|
221
|
+
fontWeight: 300,
|
|
222
|
+
src: "url('../fonts/Pilat-Light-other.woff2') format('woff2')",
|
|
223
|
+
unicodeRange:
|
|
224
|
+
'U+0100-0192,U+01FA-0237,U+02C7-0328,U+03A9-03C0,U+1E80-1E85,U+1EF2-1EF3,U+2070-208E,U+2113-212E,U+2190-2199,U+2202-2265,U+25CA-25CC,U+FB00',
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
fontFace({
|
|
228
|
+
fontDisplay: 'swap',
|
|
229
|
+
fontFamily: 'Pilat',
|
|
230
|
+
fontStyle: 'normal',
|
|
231
|
+
fontWeight: 300,
|
|
232
|
+
src: "url('../fonts/Pilat-Light-latin.woff2') format('woff2')",
|
|
233
|
+
unicodeRange:
|
|
234
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
fontFace({
|
|
238
|
+
fontDisplay: 'swap',
|
|
239
|
+
fontFamily: 'Pilat',
|
|
240
|
+
fontStyle: 'normal',
|
|
241
|
+
fontWeight: 400,
|
|
242
|
+
src: "url('../fonts/Pilat-Regular-other.woff2') format('woff2')",
|
|
243
|
+
unicodeRange:
|
|
244
|
+
'U+0100-0192,U+01FA-0237,U+02C7-0328,U+03A9-03C0,U+1E80-1E85,U+1EF2-1EF3,U+2070-208E,U+2113-212E,U+2190-2199,U+2202-2265,U+25CA-25CC,U+FB00',
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
fontFace({
|
|
248
|
+
fontDisplay: 'swap',
|
|
249
|
+
fontFamily: 'Pilat',
|
|
250
|
+
fontStyle: 'normal',
|
|
251
|
+
fontWeight: 400,
|
|
252
|
+
src: "url('../fonts/Pilat-Regular-latin.woff2') format('woff2')",
|
|
253
|
+
unicodeRange:
|
|
254
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
fontFace({
|
|
258
|
+
fontDisplay: 'swap',
|
|
259
|
+
fontFamily: 'Pilat',
|
|
260
|
+
fontStyle: 'normal',
|
|
261
|
+
fontWeight: 500,
|
|
262
|
+
src: "url('../fonts/Pilat-Book-other.woff2') format('woff2')",
|
|
263
|
+
unicodeRange:
|
|
264
|
+
'U+0100-0192,U+01FA-0237,U+02C7-0328,U+03A9-03C0,U+1E80-1E85,U+1EF2-1EF3,U+2070-208E,U+2113-212E,U+2190-2199,U+2202-2265,U+25CA-25CC,U+FB00',
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
fontFace({
|
|
268
|
+
fontDisplay: 'swap',
|
|
269
|
+
fontFamily: 'Pilat',
|
|
270
|
+
fontStyle: 'normal',
|
|
271
|
+
fontWeight: 500,
|
|
272
|
+
src: "url('../fonts/Pilat-Book-latin.woff2') format('woff2')",
|
|
273
|
+
unicodeRange:
|
|
274
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
fontFace({
|
|
278
|
+
fontDisplay: 'swap',
|
|
279
|
+
fontFamily: 'Pilat',
|
|
280
|
+
fontStyle: 'normal',
|
|
281
|
+
fontWeight: 600,
|
|
282
|
+
src: "url('../fonts/Pilat-Demi-other.woff2') format('woff2')",
|
|
283
|
+
unicodeRange:
|
|
284
|
+
'U+0100-0192,U+01FA-0237,U+02C7-0328,U+03A9-03C0,U+1E80-1E85,U+1EF2-1EF3,U+2070-208E,U+2113-212E,U+2190-2199,U+2202-2265,U+25CA-25CC,U+FB00',
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
fontFace({
|
|
288
|
+
fontDisplay: 'swap',
|
|
289
|
+
fontFamily: 'Pilat',
|
|
290
|
+
fontStyle: 'normal',
|
|
291
|
+
fontWeight: 600,
|
|
292
|
+
src: "url('../fonts/Pilat-Demi-latin.woff2') format('woff2')",
|
|
293
|
+
unicodeRange:
|
|
294
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
fontFace({
|
|
298
|
+
fontDisplay: 'swap',
|
|
299
|
+
fontFamily: 'Pilat',
|
|
300
|
+
fontStyle: 'normal',
|
|
301
|
+
fontWeight: 700,
|
|
302
|
+
src: "url('../fonts/Pilat-Bold-other.woff2') format('woff2')",
|
|
303
|
+
unicodeRange:
|
|
304
|
+
'U+0100-0192,U+01FA-0237,U+02C7-0328,U+03A9-03C0,U+1E80-1E85,U+1EF2-1EF3,U+2070-208E,U+2113-212E,U+2190-2199,U+2202-2265,U+25CA-25CC,U+FB00',
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
fontFace({
|
|
308
|
+
fontDisplay: 'swap',
|
|
309
|
+
fontFamily: 'Pilat',
|
|
310
|
+
fontStyle: 'normal',
|
|
311
|
+
fontWeight: 700,
|
|
312
|
+
src: "url('../fonts/Pilat-Bold-latin.woff2') format('woff2')",
|
|
313
|
+
unicodeRange:
|
|
314
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
fontFace({
|
|
318
|
+
fontDisplay: 'swap',
|
|
319
|
+
fontFamily: 'Pilat',
|
|
320
|
+
fontStyle: 'normal',
|
|
321
|
+
fontWeight: 800,
|
|
322
|
+
src: "url('../fonts/Pilat-Heavy-other.woff2') format('woff2')",
|
|
323
|
+
unicodeRange:
|
|
324
|
+
'U+0100-0192,U+01FA-0237,U+02C7-0328,U+03A9-03C0,U+1E80-1E85,U+1EF2-1EF3,U+2070-208E,U+2113-212E,U+2190-2199,U+2202-2265,U+25CA-25CC,U+FB00',
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
fontFace({
|
|
328
|
+
fontDisplay: 'swap',
|
|
329
|
+
fontFamily: 'Pilat',
|
|
330
|
+
fontStyle: 'normal',
|
|
331
|
+
fontWeight: 800,
|
|
332
|
+
src: "url('../fonts/Pilat-Heavy-latin.woff2') format('woff2')",
|
|
333
|
+
unicodeRange:
|
|
334
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
fontFace({
|
|
338
|
+
fontDisplay: 'swap',
|
|
339
|
+
fontFamily: 'Pilat',
|
|
340
|
+
fontStyle: 'normal',
|
|
341
|
+
fontWeight: 900,
|
|
342
|
+
src: "url('../fonts/Pilat-Black-other.woff2') format('woff2')",
|
|
343
|
+
unicodeRange:
|
|
344
|
+
'U+0100-0192,U+01FA-0237,U+02C7-0328,U+03A9-03C0,U+1E80-1E85,U+1EF2-1EF3,U+2070-208E,U+2113-212E,U+2190-2199,U+2202-2265,U+25CA-25CC,U+FB00',
|
|
345
|
+
})
|
|
346
|
+
|
|
347
|
+
fontFace({
|
|
348
|
+
fontDisplay: 'swap',
|
|
349
|
+
fontFamily: 'Pilat',
|
|
350
|
+
fontStyle: 'normal',
|
|
351
|
+
fontWeight: 900,
|
|
352
|
+
src: "url('../fonts/Pilat-Black-latin.woff2') format('woff2')",
|
|
353
|
+
unicodeRange:
|
|
354
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
355
|
+
})
|
|
356
|
+
|
|
357
|
+
global({
|
|
358
|
+
// Squircles at 1.84 times the radius meet the 45 degree point of a round corner, which is where
|
|
359
|
+
// the designs' fully smoothed corners pass. Browsers without `corner-shape` skip the block.
|
|
360
|
+
// Pseudo-elements usually paint a state layer over their element, so they take its shape.
|
|
361
|
+
'@supports (corner-shape: squircle)': {
|
|
362
|
+
':root': { '--tds-corner-scale': '1.84' },
|
|
363
|
+
':where(*)': { cornerShape: 'squircle' },
|
|
364
|
+
':where(*)::after, :where(*)::before': { cornerShape: 'inherit' },
|
|
365
|
+
},
|
|
366
|
+
body: {
|
|
367
|
+
WebkitFontSmoothing: 'antialiased',
|
|
368
|
+
MozOsxFontSmoothing: 'grayscale',
|
|
369
|
+
color: vars.color.content.secondary,
|
|
370
|
+
fontFamily: vars.typography.body.b1.fontFamily,
|
|
371
|
+
fontSize: vars.typography.body.b1.fontSize,
|
|
372
|
+
fontWeight: vars.typography.body.b1.fontWeight,
|
|
373
|
+
letterSpacing: vars.typography.body.b1.letterSpacing,
|
|
374
|
+
lineHeight: vars.typography.body.b1.lineHeight,
|
|
375
|
+
},
|
|
376
|
+
})
|
package/src/oxlint/index.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/** Oxlint plugin and configurations that check how an app uses `@tempoxyz/ds`. @module */
|
|
2
2
|
import type { Plugin } from '@oxlint/plugins'
|
|
3
3
|
import * as NoCrossSurface from './rules/NoCrossSurface.ts'
|
|
4
|
+
import * as NoCustomValues from './rules/NoCustomValues.ts'
|
|
4
5
|
import * as NoInternalImports from './rules/NoInternalImports.ts'
|
|
5
6
|
import * as NoRawValues from './rules/NoRawValues.ts'
|
|
7
|
+
import * as NoSingleKeyShortcuts from './rules/NoSingleKeyShortcuts.ts'
|
|
6
8
|
import * as PreferComponent from './rules/PreferComponent.ts'
|
|
9
|
+
import * as PreferLayout from './rules/PreferLayout.ts'
|
|
10
|
+
import * as PreferProgress from './rules/PreferProgress.ts'
|
|
11
|
+
import * as PreferSurface from './rules/PreferSurface.ts'
|
|
7
12
|
import * as RequireAccessibleName from './rules/RequireAccessibleName.ts'
|
|
13
|
+
import * as RequireScrollRegion from './rules/RequireScrollRegion.ts'
|
|
8
14
|
|
|
9
15
|
/** An Oxlint rule severity. */
|
|
10
16
|
export type Severity = 'error' | 'off' | 'warn'
|
|
@@ -31,6 +37,27 @@ const zyzz: Config['rules'] = {
|
|
|
31
37
|
'zyzz/valid-styles': 'error',
|
|
32
38
|
}
|
|
33
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Enables the TDS and Zyzz rules for a marketing site that renders `@tempoxyz/ds/marketing`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* import { marketing } from '@tempoxyz/ds/oxlint'
|
|
46
|
+
*
|
|
47
|
+
* export default defineConfig({ lint: marketing })
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export const marketing: Config = {
|
|
51
|
+
jsPlugins: plugins,
|
|
52
|
+
rules: {
|
|
53
|
+
'tds/no-cross-surface': ['error', { surface: 'marketing' }],
|
|
54
|
+
'tds/no-internal-imports': 'error',
|
|
55
|
+
'tds/no-raw-values': 'warn',
|
|
56
|
+
'tds/require-accessible-name': 'error',
|
|
57
|
+
...zyzz,
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
34
61
|
/**
|
|
35
62
|
* Enables the TDS and Zyzz rules for an app that renders `@tempoxyz/ds/mobile`.
|
|
36
63
|
*
|
|
@@ -66,23 +93,35 @@ export const web: Config = {
|
|
|
66
93
|
jsPlugins: plugins,
|
|
67
94
|
rules: {
|
|
68
95
|
'tds/no-cross-surface': ['error', { surface: 'web' }],
|
|
96
|
+
'tds/no-custom-values': 'warn',
|
|
69
97
|
'tds/no-internal-imports': 'error',
|
|
70
98
|
'tds/no-raw-values': 'warn',
|
|
99
|
+
'tds/no-single-key-shortcuts': 'warn',
|
|
71
100
|
'tds/prefer-component': 'warn',
|
|
101
|
+
'tds/prefer-layout': 'warn',
|
|
102
|
+
'tds/prefer-progress': 'warn',
|
|
103
|
+
'tds/prefer-surface': 'warn',
|
|
72
104
|
'tds/require-accessible-name': 'error',
|
|
105
|
+
'tds/require-scroll-region': 'warn',
|
|
73
106
|
...zyzz,
|
|
74
107
|
},
|
|
75
108
|
}
|
|
76
109
|
|
|
77
|
-
/** Register through `jsPlugins` as `tds`, then enable `tds/*` rules or spread `web` or `
|
|
110
|
+
/** Register through `jsPlugins` as `tds`, then enable `tds/*` rules or spread `web`, `mobile`, or `marketing`. */
|
|
78
111
|
const plugin: Plugin = {
|
|
79
112
|
meta: { name: 'tds' },
|
|
80
113
|
rules: {
|
|
81
114
|
'no-cross-surface': NoCrossSurface.rule,
|
|
115
|
+
'no-custom-values': NoCustomValues.rule,
|
|
82
116
|
'no-internal-imports': NoInternalImports.rule,
|
|
83
117
|
'no-raw-values': NoRawValues.rule,
|
|
118
|
+
'no-single-key-shortcuts': NoSingleKeyShortcuts.rule,
|
|
84
119
|
'prefer-component': PreferComponent.rule,
|
|
120
|
+
'prefer-layout': PreferLayout.rule,
|
|
121
|
+
'prefer-progress': PreferProgress.rule,
|
|
122
|
+
'prefer-surface': PreferSurface.rule,
|
|
85
123
|
'require-accessible-name': RequireAccessibleName.rule,
|
|
124
|
+
'require-scroll-region': RequireScrollRegion.rule,
|
|
86
125
|
},
|
|
87
126
|
}
|
|
88
127
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Builds links to the Tempo Design System docs that lint messages cite. @module */
|
|
2
|
+
|
|
3
|
+
const origin = 'https://ds.tehq.dev/product'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns the docs page of a component, such as `https://ds.tehq.dev/product/components/list-group`
|
|
7
|
+
* for `ListGroup`. A part, such as `ListGroup.Meter`, links the page of its component.
|
|
8
|
+
*/
|
|
9
|
+
export function component(name: string): string {
|
|
10
|
+
const [head = name] = name.split('.')
|
|
11
|
+
|
|
12
|
+
return `${origin}/components/${head.replace(/(?<=[\da-z])(?=[A-Z])/g, '-').toLowerCase()}`
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Returns a docs page by its path under `/product`, such as `foundations/layout#spacing`. */
|
|
16
|
+
export function page(path: string): string {
|
|
17
|
+
return `${origin}/${path}`
|
|
18
|
+
}
|
|
@@ -3,7 +3,7 @@ import type { ESTree, Visitor } from '@oxlint/plugins'
|
|
|
3
3
|
import * as Module from 'node:module'
|
|
4
4
|
|
|
5
5
|
/** A library surface, named after the entrypoint that ships it. */
|
|
6
|
-
export type Surface = 'mobile' | 'web'
|
|
6
|
+
export type Surface = 'marketing' | 'mobile' | 'web'
|
|
7
7
|
|
|
8
8
|
// The manifest sits three levels up from both `src/oxlint/internal` and `dist/oxlint/internal`.
|
|
9
9
|
const manifest: { exports: Record<string, unknown>; name: string } = Module.createRequire(
|
|
@@ -29,6 +29,7 @@ export function surface(source: string): Surface | undefined {
|
|
|
29
29
|
|
|
30
30
|
const subpath = source.slice(name.length)
|
|
31
31
|
|
|
32
|
+
if (subpath === '/marketing' || subpath.startsWith('/marketing/')) return 'marketing'
|
|
32
33
|
if (subpath === '/mobile' || subpath.startsWith('/mobile/')) return 'mobile'
|
|
33
34
|
if (subpath === '' || subpath.startsWith('/fonts/') || subpath.startsWith('/icons')) return 'web'
|
|
34
35
|
return undefined
|