@sanity/ui 5.0.0-alpha.23 → 5.0.0-alpha.24
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/dist/index.d.ts +15 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +76 -59
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/docs/components/button.dsds.yaml +24 -12
- package/docs/components/code.dsds.yaml +2 -0
- package/docs/components/eyebrow.dsds.yaml +3 -22
- package/docs/components/icon-button.dsds.yaml +9 -2
- package/docs/components/popover.dsds.yaml +8 -2
- package/docs/foundations/typography-guidelines.dsds.yaml +4 -4
- package/docs/icons/icon-access-denied.dsds.yaml +40 -0
- package/docs/icons/icon-activity.dsds.yaml +40 -0
- package/docs/icons/icon-add-circle.dsds.yaml +14 -0
- package/docs/icons/icon-add-comment.dsds.yaml +34 -0
- package/docs/icons/icon-add-document.dsds.yaml +34 -0
- package/docs/icons/icon-add-user.dsds.yaml +30 -0
- package/docs/icons/icon-add.dsds.yaml +57 -0
- package/docs/icons/icon-api.dsds.yaml +17 -0
- package/docs/icons/icon-archive.dsds.yaml +44 -0
- package/docs/icons/icon-arrow-down.dsds.yaml +38 -0
- package/docs/icons/icon-arrow-left.dsds.yaml +32 -0
- package/docs/icons/icon-arrow-right.dsds.yaml +32 -0
- package/docs/icons/icon-arrow-top-right.dsds.yaml +32 -0
- package/docs/icons/icon-arrow-up.dsds.yaml +44 -0
- package/docs/icons/icon-asterisk.dsds.yaml +18 -0
- package/docs/icons/icon-bar-chart.dsds.yaml +40 -0
- package/docs/icons/icon-basket.dsds.yaml +14 -0
- package/docs/icons/icon-bell.dsds.yaml +30 -0
- package/docs/icons/icon-bill.dsds.yaml +40 -0
- package/docs/icons/icon-binary-document.dsds.yaml +30 -0
- package/docs/icons/icon-block-content.dsds.yaml +30 -0
- package/docs/icons/icon-block-element.dsds.yaml +32 -0
- package/docs/icons/icon-blockquote.dsds.yaml +32 -0
- package/docs/icons/icon-bold.dsds.yaml +28 -0
- package/docs/icons/icon-bolt.dsds.yaml +18 -0
- package/docs/icons/icon-book.dsds.yaml +34 -0
- package/docs/icons/icon-bookmark-filled.dsds.yaml +14 -0
- package/docs/icons/icon-bookmark.dsds.yaml +14 -0
- package/docs/icons/icon-bottle.dsds.yaml +18 -0
- package/docs/icons/icon-bug.dsds.yaml +28 -0
- package/docs/icons/icon-bulb-filled.dsds.yaml +14 -0
- package/docs/icons/icon-bulb-outline.dsds.yaml +30 -0
- package/docs/icons/icon-calendar.dsds.yaml +36 -0
- package/docs/icons/icon-case.dsds.yaml +18 -0
- package/docs/icons/icon-chart-upward.dsds.yaml +40 -0
- package/docs/icons/icon-checkmark-circle.dsds.yaml +40 -0
- package/docs/icons/icon-checkmark.dsds.yaml +36 -0
- package/docs/icons/icon-chevron-down.dsds.yaml +46 -0
- package/docs/icons/icon-chevron-left.dsds.yaml +42 -0
- package/docs/icons/icon-chevron-right.dsds.yaml +42 -0
- package/docs/icons/icon-chevron-up.dsds.yaml +44 -0
- package/docs/icons/icon-circle.dsds.yaml +28 -0
- package/docs/icons/icon-clipboard-image.dsds.yaml +30 -0
- package/docs/icons/icon-clipboard.dsds.yaml +34 -0
- package/docs/icons/icon-clock.dsds.yaml +39 -0
- package/docs/icons/icon-close-circle.dsds.yaml +18 -0
- package/docs/icons/icon-close.dsds.yaml +51 -0
- package/docs/icons/icon-code-block.dsds.yaml +38 -0
- package/docs/icons/icon-code.dsds.yaml +40 -0
- package/docs/icons/icon-cog.dsds.yaml +38 -0
- package/docs/icons/icon-collapse.dsds.yaml +40 -0
- package/docs/icons/icon-color-wheel.dsds.yaml +30 -0
- package/docs/icons/icon-comment.dsds.yaml +38 -0
- package/docs/icons/icon-component.dsds.yaml +18 -0
- package/docs/icons/icon-compose-sparkles.dsds.yaml +36 -0
- package/docs/icons/icon-compose.dsds.yaml +38 -0
- package/docs/icons/icon-confetti.dsds.yaml +18 -0
- package/docs/icons/icon-controls.dsds.yaml +36 -0
- package/docs/icons/icon-copy.dsds.yaml +31 -0
- package/docs/icons/icon-credit-card.dsds.yaml +18 -0
- package/docs/icons/icon-crop.dsds.yaml +32 -0
- package/docs/icons/icon-cube.dsds.yaml +36 -0
- package/docs/icons/icon-dashboard.dsds.yaml +34 -0
- package/docs/icons/icon-database.dsds.yaml +40 -0
- package/docs/icons/icon-desktop.dsds.yaml +31 -0
- package/docs/icons/icon-diamond.dsds.yaml +18 -0
- package/docs/icons/icon-document-pdf.dsds.yaml +34 -0
- package/docs/icons/icon-document-remove.dsds.yaml +30 -0
- package/docs/icons/icon-document-sheet.dsds.yaml +34 -0
- package/docs/icons/icon-document-text.dsds.yaml +30 -0
- package/docs/icons/icon-document-video.dsds.yaml +30 -0
- package/docs/icons/icon-document-word.dsds.yaml +34 -0
- package/docs/icons/icon-document-zip.dsds.yaml +30 -0
- package/docs/icons/icon-document.dsds.yaml +52 -0
- package/docs/icons/icon-documents.dsds.yaml +30 -0
- package/docs/icons/icon-dot.dsds.yaml +32 -0
- package/docs/icons/icon-double-chevron-down.dsds.yaml +38 -0
- package/docs/icons/icon-double-chevron-left.dsds.yaml +34 -0
- package/docs/icons/icon-double-chevron-right.dsds.yaml +34 -0
- package/docs/icons/icon-double-chevron-up.dsds.yaml +36 -0
- package/docs/icons/icon-double-quote.dsds.yaml +14 -0
- package/docs/icons/icon-download.dsds.yaml +40 -0
- package/docs/icons/icon-drag-handle.dsds.yaml +28 -0
- package/docs/icons/icon-drop.dsds.yaml +30 -0
- package/docs/icons/icon-earth-americas.dsds.yaml +34 -0
- package/docs/icons/icon-earth-globe.dsds.yaml +34 -0
- package/docs/icons/icon-edit.dsds.yaml +34 -0
- package/docs/icons/icon-ellipsis-horizontal.dsds.yaml +32 -0
- package/docs/icons/icon-ellipsis-vertical.dsds.yaml +14 -0
- package/docs/icons/icon-empty.dsds.yaml +28 -0
- package/docs/icons/icon-enter-right.dsds.yaml +18 -0
- package/docs/icons/icon-enter.dsds.yaml +18 -0
- package/docs/icons/icon-envelope.dsds.yaml +34 -0
- package/docs/icons/icon-equal.dsds.yaml +14 -0
- package/docs/icons/icon-error-filled.dsds.yaml +14 -0
- package/docs/icons/icon-error-outline.dsds.yaml +38 -0
- package/docs/icons/icon-error-screen.dsds.yaml +14 -0
- package/docs/icons/icon-expand.dsds.yaml +36 -0
- package/docs/icons/icon-eye-closed.dsds.yaml +38 -0
- package/docs/icons/icon-eye-open.dsds.yaml +38 -0
- package/docs/icons/icon-face-happy.dsds.yaml +14 -0
- package/docs/icons/icon-face-indifferent.dsds.yaml +14 -0
- package/docs/icons/icon-face-sad.dsds.yaml +14 -0
- package/docs/icons/icon-feedback.dsds.yaml +30 -0
- package/docs/icons/icon-filter.dsds.yaml +38 -0
- package/docs/icons/icon-folder.dsds.yaml +36 -0
- package/docs/icons/icon-generate.dsds.yaml +18 -0
- package/docs/icons/icon-github.dsds.yaml +14 -0
- package/docs/icons/icon-groq.dsds.yaml +31 -0
- package/docs/icons/icon-hash.dsds.yaml +18 -0
- package/docs/icons/icon-heart-filled.dsds.yaml +18 -0
- package/docs/icons/icon-heart.dsds.yaml +18 -0
- package/docs/icons/icon-help-circle.dsds.yaml +38 -0
- package/docs/icons/icon-highlight.dsds.yaml +18 -0
- package/docs/icons/icon-home.dsds.yaml +28 -0
- package/docs/icons/icon-ice-cream.dsds.yaml +18 -0
- package/docs/icons/icon-image-remove.dsds.yaml +32 -0
- package/docs/icons/icon-image.dsds.yaml +36 -0
- package/docs/icons/icon-images.dsds.yaml +34 -0
- package/docs/icons/icon-inbox.dsds.yaml +14 -0
- package/docs/icons/icon-info-filled.dsds.yaml +14 -0
- package/docs/icons/icon-info-outline.dsds.yaml +38 -0
- package/docs/icons/icon-inline-element.dsds.yaml +32 -0
- package/docs/icons/icon-inline.dsds.yaml +18 -0
- package/docs/icons/icon-insert-above.dsds.yaml +32 -0
- package/docs/icons/icon-insert-below.dsds.yaml +32 -0
- package/docs/icons/icon-italic.dsds.yaml +28 -0
- package/docs/icons/icon-joystick.dsds.yaml +18 -0
- package/docs/icons/icon-json.dsds.yaml +36 -0
- package/docs/icons/icon-launch.dsds.yaml +34 -0
- package/docs/icons/icon-leave.dsds.yaml +35 -0
- package/docs/icons/icon-lemon.dsds.yaml +18 -0
- package/docs/icons/icon-link-removed.dsds.yaml +30 -0
- package/docs/icons/icon-link.dsds.yaml +36 -0
- package/docs/icons/icon-linkedin.dsds.yaml +14 -0
- package/docs/icons/icon-list.dsds.yaml +14 -0
- package/docs/icons/icon-lock.dsds.yaml +39 -0
- package/docs/icons/icon-logo-js.dsds.yaml +18 -0
- package/docs/icons/icon-logo-ts.dsds.yaml +18 -0
- package/docs/icons/icon-marker-removed.dsds.yaml +14 -0
- package/docs/icons/icon-marker.dsds.yaml +14 -0
- package/docs/icons/icon-master-detail.dsds.yaml +28 -0
- package/docs/icons/icon-menu.dsds.yaml +40 -0
- package/docs/icons/icon-microphone-slash.dsds.yaml +14 -0
- package/docs/icons/icon-microphone.dsds.yaml +14 -0
- package/docs/icons/icon-mobile-device.dsds.yaml +32 -0
- package/docs/icons/icon-moon.dsds.yaml +30 -0
- package/docs/icons/icon-number.dsds.yaml +30 -0
- package/docs/icons/icon-ok-hand.dsds.yaml +18 -0
- package/docs/icons/icon-olist.dsds.yaml +36 -0
- package/docs/icons/icon-overage.dsds.yaml +42 -0
- package/docs/icons/icon-package.dsds.yaml +34 -0
- package/docs/icons/icon-panel-left.dsds.yaml +38 -0
- package/docs/icons/icon-panel-right.dsds.yaml +40 -0
- package/docs/icons/icon-pause.dsds.yaml +32 -0
- package/docs/icons/icon-pin-filled.dsds.yaml +28 -0
- package/docs/icons/icon-pin-removed.dsds.yaml +14 -0
- package/docs/icons/icon-pin.dsds.yaml +32 -0
- package/docs/icons/icon-play.dsds.yaml +32 -0
- package/docs/icons/icon-plug.dsds.yaml +35 -0
- package/docs/icons/icon-presentation.dsds.yaml +18 -0
- package/docs/icons/icon-progress50.dsds.yaml +14 -0
- package/docs/icons/icon-progress75.dsds.yaml +14 -0
- package/docs/icons/icon-projects.dsds.yaml +14 -0
- package/docs/icons/icon-publish.dsds.yaml +38 -0
- package/docs/icons/icon-read-only.dsds.yaml +36 -0
- package/docs/icons/icon-redo.dsds.yaml +38 -0
- package/docs/icons/icon-refresh.dsds.yaml +38 -0
- package/docs/icons/icon-remove-circle.dsds.yaml +14 -0
- package/docs/icons/icon-remove.dsds.yaml +30 -0
- package/docs/icons/icon-reset.dsds.yaml +40 -0
- package/docs/icons/icon-restore.dsds.yaml +45 -0
- package/docs/icons/icon-retrieve.dsds.yaml +14 -0
- package/docs/icons/icon-retry.dsds.yaml +14 -0
- package/docs/icons/icon-revert.dsds.yaml +14 -0
- package/docs/icons/icon-robot.dsds.yaml +17 -0
- package/docs/icons/icon-rocket.dsds.yaml +34 -0
- package/docs/icons/icon-schema.dsds.yaml +36 -0
- package/docs/icons/icon-search.dsds.yaml +34 -0
- package/docs/icons/icon-select.dsds.yaml +38 -0
- package/docs/icons/icon-share.dsds.yaml +36 -0
- package/docs/icons/icon-sort.dsds.yaml +40 -0
- package/docs/icons/icon-sparkle.dsds.yaml +26 -0
- package/docs/icons/icon-sparkles.dsds.yaml +34 -0
- package/docs/icons/icon-spinner.dsds.yaml +38 -0
- package/docs/icons/icon-split-horizontal.dsds.yaml +32 -0
- package/docs/icons/icon-split-vertical.dsds.yaml +30 -0
- package/docs/icons/icon-square.dsds.yaml +18 -0
- package/docs/icons/icon-stack-compact.dsds.yaml +30 -0
- package/docs/icons/icon-stack.dsds.yaml +44 -0
- package/docs/icons/icon-star-filled.dsds.yaml +48 -0
- package/docs/icons/icon-star.dsds.yaml +51 -0
- package/docs/icons/icon-stop.dsds.yaml +32 -0
- package/docs/icons/icon-strikethrough.dsds.yaml +28 -0
- package/docs/icons/icon-string.dsds.yaml +38 -0
- package/docs/icons/icon-sun.dsds.yaml +30 -0
- package/docs/icons/icon-sync.dsds.yaml +36 -0
- package/docs/icons/icon-tablet-device.dsds.yaml +30 -0
- package/docs/icons/icon-tag.dsds.yaml +32 -0
- package/docs/icons/icon-tags.dsds.yaml +36 -0
- package/docs/icons/icon-target.dsds.yaml +14 -0
- package/docs/icons/icon-task.dsds.yaml +30 -0
- package/docs/icons/icon-terminal.dsds.yaml +30 -0
- package/docs/icons/icon-text.dsds.yaml +32 -0
- package/docs/icons/icon-th-large.dsds.yaml +34 -0
- package/docs/icons/icon-th-list.dsds.yaml +30 -0
- package/docs/icons/icon-thumbs-down.dsds.yaml +27 -0
- package/docs/icons/icon-thumbs-up.dsds.yaml +30 -0
- package/docs/icons/icon-tiers.dsds.yaml +18 -0
- package/docs/icons/icon-timeline.dsds.yaml +32 -0
- package/docs/icons/icon-toggle-arrow-right.dsds.yaml +39 -0
- package/docs/icons/icon-token.dsds.yaml +30 -0
- package/docs/icons/icon-transfer.dsds.yaml +32 -0
- package/docs/icons/icon-translate.dsds.yaml +32 -0
- package/docs/icons/icon-trash.dsds.yaml +34 -0
- package/docs/icons/icon-trend-upward.dsds.yaml +42 -0
- package/docs/icons/icon-triangle-outline.dsds.yaml +18 -0
- package/docs/icons/icon-trolley.dsds.yaml +18 -0
- package/docs/icons/icon-truncate.dsds.yaml +18 -0
- package/docs/icons/icon-twitter.dsds.yaml +18 -0
- package/docs/icons/icon-ulist.dsds.yaml +36 -0
- package/docs/icons/icon-unarchive.dsds.yaml +32 -0
- package/docs/icons/icon-underline.dsds.yaml +28 -0
- package/docs/icons/icon-undo.dsds.yaml +34 -0
- package/docs/icons/icon-unknown.dsds.yaml +36 -0
- package/docs/icons/icon-unlink.dsds.yaml +32 -0
- package/docs/icons/icon-unlock.dsds.yaml +41 -0
- package/docs/icons/icon-unpublish.dsds.yaml +38 -0
- package/docs/icons/icon-upload.dsds.yaml +40 -0
- package/docs/icons/icon-user.dsds.yaml +34 -0
- package/docs/icons/icon-users.dsds.yaml +34 -0
- package/docs/icons/icon-versions.dsds.yaml +14 -0
- package/docs/icons/icon-video.dsds.yaml +32 -0
- package/docs/icons/icon-warning-filled.dsds.yaml +14 -0
- package/docs/icons/icon-warning-outline.dsds.yaml +38 -0
- package/docs/icons/icon-wrench.dsds.yaml +18 -0
- package/docs/icons.dsds.yaml +767 -2512
- package/docs/index.dsds.yaml +76 -85
- package/docs/overview/component-reference.dsds.yaml +0 -2
- package/docs/overview/installation.dsds.yaml +20 -4
- package/docs/patterns/forms.dsds.yaml +6 -0
- package/docs/patterns/layouts.dsds.yaml +1 -1
- package/docs/patterns/loading-states.dsds.yaml +1 -1
- package/docs/tokens/dtcg/README.md +5 -3
- package/docs/tokens/dtcg/css/color.css +1 -1
- package/docs/tokens/dtcg/css/index.css +0 -1
- package/docs/tokens/dtcg/css/typography.css +23 -25
- package/docs/tokens/dtcg/json/color.tokens.json +2 -2
- package/docs/tokens/dtcg/json/typography.tokens.json +45 -45
- package/docs/tokens/typography.dsds.yaml +25 -25
- package/package.json +2 -2
- package/src/components/button/Button.tsx +14 -3
- package/src/components/button/button.css +23 -25
- package/src/components/button/button.props.ts +4 -0
- package/src/components/code/code.props.ts +3 -2
- package/src/components/eyebrow/Eyebrow.tsx +8 -3
- package/src/components/eyebrow/eyebrow.props.ts +10 -2
- package/src/components/heading/Heading.tsx +1 -1
- package/src/components/heading/heading.props.ts +4 -3
- package/src/components/popover/Popover.tsx +4 -3
- package/src/components/popover/popover.css +5 -3
- package/src/components/popover/popover.props.ts +9 -0
- package/src/components/text/text.props.ts +6 -1
- package/src/css/classes/system/typography.css +6 -6
- package/src/css/tokens/semantic.css +7 -7
- package/src/props/typography.ts +1 -5
- package/src/version.ts +2 -2
- package/docs/overview/designer-contribution-model.dsds.yaml +0 -77
- package/docs/overview/developer-contribution-model.dsds.yaml +0 -362
- package/docs/overview/resources.dsds.yaml +0 -34
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
38
38
|
"fontSize": {
|
|
39
39
|
"unit": "px",
|
|
40
|
-
"value":
|
|
40
|
+
"value": 15
|
|
41
41
|
},
|
|
42
42
|
"fontWeight": 400,
|
|
43
43
|
"letterSpacing": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
54
54
|
"fontSize": {
|
|
55
55
|
"unit": "px",
|
|
56
|
-
"value": 18
|
|
56
|
+
"value": 18
|
|
57
57
|
},
|
|
58
58
|
"fontWeight": 400,
|
|
59
59
|
"letterSpacing": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
70
70
|
"fontSize": {
|
|
71
71
|
"unit": "px",
|
|
72
|
-
"value": 21
|
|
72
|
+
"value": 21
|
|
73
73
|
},
|
|
74
74
|
"fontWeight": 400,
|
|
75
75
|
"letterSpacing": {
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"fontFamily": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
134
134
|
"fontSize": {
|
|
135
135
|
"unit": "px",
|
|
136
|
-
"value":
|
|
136
|
+
"value": 19
|
|
137
137
|
},
|
|
138
138
|
"fontWeight": 400,
|
|
139
139
|
"letterSpacing": {
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"fontFamily": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
150
150
|
"fontSize": {
|
|
151
151
|
"unit": "px",
|
|
152
|
-
"value":
|
|
152
|
+
"value": 22
|
|
153
153
|
},
|
|
154
154
|
"fontWeight": 400,
|
|
155
155
|
"letterSpacing": {
|
|
@@ -159,157 +159,157 @@
|
|
|
159
159
|
"lineHeight": 1.5
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
"
|
|
162
|
+
"eyebrow-0": {
|
|
163
163
|
"$type": "typography",
|
|
164
164
|
"$value": {
|
|
165
165
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
166
166
|
"fontSize": {
|
|
167
167
|
"unit": "px",
|
|
168
|
-
"value":
|
|
168
|
+
"value": 8.1
|
|
169
169
|
},
|
|
170
170
|
"fontWeight": 400,
|
|
171
171
|
"letterSpacing": {
|
|
172
172
|
"unit": "px",
|
|
173
|
-
"value": 0
|
|
173
|
+
"value": 0.5
|
|
174
174
|
},
|
|
175
|
-
"lineHeight": 1.
|
|
175
|
+
"lineHeight": 1.15
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
|
-
"
|
|
178
|
+
"eyebrow-1": {
|
|
179
179
|
"$type": "typography",
|
|
180
180
|
"$value": {
|
|
181
181
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
182
182
|
"fontSize": {
|
|
183
183
|
"unit": "px",
|
|
184
|
-
"value":
|
|
184
|
+
"value": 9.5
|
|
185
185
|
},
|
|
186
186
|
"fontWeight": 400,
|
|
187
187
|
"letterSpacing": {
|
|
188
188
|
"unit": "px",
|
|
189
|
-
"value": 0
|
|
189
|
+
"value": 0.5
|
|
190
190
|
},
|
|
191
|
-
"lineHeight": 1.
|
|
191
|
+
"lineHeight": 1.15
|
|
192
192
|
}
|
|
193
193
|
},
|
|
194
|
-
"
|
|
194
|
+
"eyebrow-2": {
|
|
195
195
|
"$type": "typography",
|
|
196
196
|
"$value": {
|
|
197
197
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
198
198
|
"fontSize": {
|
|
199
199
|
"unit": "px",
|
|
200
|
-
"value":
|
|
200
|
+
"value": 10.8
|
|
201
201
|
},
|
|
202
202
|
"fontWeight": 400,
|
|
203
203
|
"letterSpacing": {
|
|
204
204
|
"unit": "px",
|
|
205
|
-
"value": 0
|
|
205
|
+
"value": 0.5
|
|
206
206
|
},
|
|
207
|
-
"lineHeight": 1.
|
|
207
|
+
"lineHeight": 1.15
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
|
-
"
|
|
210
|
+
"eyebrow-3": {
|
|
211
211
|
"$type": "typography",
|
|
212
212
|
"$value": {
|
|
213
213
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
214
214
|
"fontSize": {
|
|
215
215
|
"unit": "px",
|
|
216
|
-
"value":
|
|
216
|
+
"value": 12.25
|
|
217
217
|
},
|
|
218
218
|
"fontWeight": 400,
|
|
219
219
|
"letterSpacing": {
|
|
220
220
|
"unit": "px",
|
|
221
221
|
"value": 0
|
|
222
222
|
},
|
|
223
|
-
"lineHeight": 1.
|
|
223
|
+
"lineHeight": 1.15
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
|
-
"
|
|
226
|
+
"eyebrow-4": {
|
|
227
227
|
"$type": "typography",
|
|
228
228
|
"$value": {
|
|
229
229
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
230
230
|
"fontSize": {
|
|
231
231
|
"unit": "px",
|
|
232
|
-
"value":
|
|
232
|
+
"value": 13.6
|
|
233
233
|
},
|
|
234
234
|
"fontWeight": 400,
|
|
235
235
|
"letterSpacing": {
|
|
236
236
|
"unit": "px",
|
|
237
|
-
"value":
|
|
237
|
+
"value": 0
|
|
238
238
|
},
|
|
239
|
-
"lineHeight": 1.
|
|
239
|
+
"lineHeight": 1.15
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
|
-
"
|
|
242
|
+
"eyebrow-5": {
|
|
243
243
|
"$type": "typography",
|
|
244
244
|
"$value": {
|
|
245
245
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
246
246
|
"fontSize": {
|
|
247
247
|
"unit": "px",
|
|
248
|
-
"value":
|
|
248
|
+
"value": 15
|
|
249
249
|
},
|
|
250
250
|
"fontWeight": 400,
|
|
251
251
|
"letterSpacing": {
|
|
252
252
|
"unit": "px",
|
|
253
|
-
"value":
|
|
253
|
+
"value": 0.5
|
|
254
254
|
},
|
|
255
|
-
"lineHeight": 1.
|
|
255
|
+
"lineHeight": 1.15
|
|
256
256
|
}
|
|
257
257
|
},
|
|
258
|
-
"
|
|
258
|
+
"heading-0": {
|
|
259
259
|
"$type": "typography",
|
|
260
260
|
"$value": {
|
|
261
261
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
262
262
|
"fontSize": {
|
|
263
263
|
"unit": "px",
|
|
264
|
-
"value":
|
|
264
|
+
"value": 13
|
|
265
265
|
},
|
|
266
266
|
"fontWeight": 400,
|
|
267
267
|
"letterSpacing": {
|
|
268
268
|
"unit": "px",
|
|
269
|
-
"value": 0
|
|
269
|
+
"value": 0
|
|
270
270
|
},
|
|
271
271
|
"lineHeight": 1.25
|
|
272
272
|
}
|
|
273
273
|
},
|
|
274
|
-
"
|
|
274
|
+
"heading-1": {
|
|
275
275
|
"$type": "typography",
|
|
276
276
|
"$value": {
|
|
277
277
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
278
278
|
"fontSize": {
|
|
279
279
|
"unit": "px",
|
|
280
|
-
"value":
|
|
280
|
+
"value": 16
|
|
281
281
|
},
|
|
282
282
|
"fontWeight": 400,
|
|
283
283
|
"letterSpacing": {
|
|
284
284
|
"unit": "px",
|
|
285
|
-
"value": 0
|
|
285
|
+
"value": 0
|
|
286
286
|
},
|
|
287
287
|
"lineHeight": 1.25
|
|
288
288
|
}
|
|
289
289
|
},
|
|
290
|
-
"
|
|
290
|
+
"heading-2": {
|
|
291
291
|
"$type": "typography",
|
|
292
292
|
"$value": {
|
|
293
293
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
294
294
|
"fontSize": {
|
|
295
295
|
"unit": "px",
|
|
296
|
-
"value":
|
|
296
|
+
"value": 21
|
|
297
297
|
},
|
|
298
298
|
"fontWeight": 400,
|
|
299
299
|
"letterSpacing": {
|
|
300
300
|
"unit": "px",
|
|
301
|
-
"value": 0
|
|
301
|
+
"value": 0
|
|
302
302
|
},
|
|
303
303
|
"lineHeight": 1.25
|
|
304
304
|
}
|
|
305
305
|
},
|
|
306
|
-
"
|
|
306
|
+
"heading-3": {
|
|
307
307
|
"$type": "typography",
|
|
308
308
|
"$value": {
|
|
309
309
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
310
310
|
"fontSize": {
|
|
311
311
|
"unit": "px",
|
|
312
|
-
"value":
|
|
312
|
+
"value": 27
|
|
313
313
|
},
|
|
314
314
|
"fontWeight": 400,
|
|
315
315
|
"letterSpacing": {
|
|
@@ -319,34 +319,34 @@
|
|
|
319
319
|
"lineHeight": 1.25
|
|
320
320
|
}
|
|
321
321
|
},
|
|
322
|
-
"
|
|
322
|
+
"heading-4": {
|
|
323
323
|
"$type": "typography",
|
|
324
324
|
"$value": {
|
|
325
325
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
326
326
|
"fontSize": {
|
|
327
327
|
"unit": "px",
|
|
328
|
-
"value":
|
|
328
|
+
"value": 33
|
|
329
329
|
},
|
|
330
330
|
"fontWeight": 400,
|
|
331
331
|
"letterSpacing": {
|
|
332
332
|
"unit": "px",
|
|
333
|
-
"value": 0
|
|
333
|
+
"value": -0.5
|
|
334
334
|
},
|
|
335
335
|
"lineHeight": 1.25
|
|
336
336
|
}
|
|
337
337
|
},
|
|
338
|
-
"
|
|
338
|
+
"heading-5": {
|
|
339
339
|
"$type": "typography",
|
|
340
340
|
"$value": {
|
|
341
341
|
"fontFamily": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Liberation Sans, sans-serif",
|
|
342
342
|
"fontSize": {
|
|
343
343
|
"unit": "px",
|
|
344
|
-
"value":
|
|
344
|
+
"value": 38
|
|
345
345
|
},
|
|
346
346
|
"fontWeight": 400,
|
|
347
347
|
"letterSpacing": {
|
|
348
348
|
"unit": "px",
|
|
349
|
-
"value":
|
|
349
|
+
"value": -1
|
|
350
350
|
},
|
|
351
351
|
"lineHeight": 1.25
|
|
352
352
|
}
|
|
@@ -178,8 +178,8 @@ entries:
|
|
|
178
178
|
source:
|
|
179
179
|
href: ./dtcg/json/typography.tokens.json#heading-5
|
|
180
180
|
- kind: token
|
|
181
|
-
id:
|
|
182
|
-
name:
|
|
181
|
+
id: eyebrow-0
|
|
182
|
+
name: eyebrow-0
|
|
183
183
|
description: Fine print labels.
|
|
184
184
|
metadata:
|
|
185
185
|
status:
|
|
@@ -187,10 +187,10 @@ entries:
|
|
|
187
187
|
group: typography
|
|
188
188
|
tokenType: typography
|
|
189
189
|
source:
|
|
190
|
-
href: ./dtcg/json/typography.tokens.json#
|
|
190
|
+
href: ./dtcg/json/typography.tokens.json#eyebrow-0
|
|
191
191
|
- kind: token
|
|
192
|
-
id:
|
|
193
|
-
name:
|
|
192
|
+
id: eyebrow-1
|
|
193
|
+
name: eyebrow-1
|
|
194
194
|
description: Compact form and UI labels.
|
|
195
195
|
metadata:
|
|
196
196
|
status:
|
|
@@ -198,10 +198,10 @@ entries:
|
|
|
198
198
|
group: typography
|
|
199
199
|
tokenType: typography
|
|
200
200
|
source:
|
|
201
|
-
href: ./dtcg/json/typography.tokens.json#
|
|
201
|
+
href: ./dtcg/json/typography.tokens.json#eyebrow-1
|
|
202
202
|
- kind: token
|
|
203
|
-
id:
|
|
204
|
-
name:
|
|
203
|
+
id: eyebrow-2
|
|
204
|
+
name: eyebrow-2
|
|
205
205
|
description: Small labels.
|
|
206
206
|
metadata:
|
|
207
207
|
status:
|
|
@@ -209,10 +209,10 @@ entries:
|
|
|
209
209
|
group: typography
|
|
210
210
|
tokenType: typography
|
|
211
211
|
source:
|
|
212
|
-
href: ./dtcg/json/typography.tokens.json#
|
|
212
|
+
href: ./dtcg/json/typography.tokens.json#eyebrow-2
|
|
213
213
|
- kind: token
|
|
214
|
-
id:
|
|
215
|
-
name:
|
|
214
|
+
id: eyebrow-3
|
|
215
|
+
name: eyebrow-3
|
|
216
216
|
description: Standard labels.
|
|
217
217
|
metadata:
|
|
218
218
|
status:
|
|
@@ -220,10 +220,10 @@ entries:
|
|
|
220
220
|
group: typography
|
|
221
221
|
tokenType: typography
|
|
222
222
|
source:
|
|
223
|
-
href: ./dtcg/json/typography.tokens.json#
|
|
223
|
+
href: ./dtcg/json/typography.tokens.json#eyebrow-3
|
|
224
224
|
- kind: token
|
|
225
|
-
id:
|
|
226
|
-
name:
|
|
225
|
+
id: eyebrow-4
|
|
226
|
+
name: eyebrow-4
|
|
227
227
|
description: Larger labels.
|
|
228
228
|
metadata:
|
|
229
229
|
status:
|
|
@@ -231,10 +231,10 @@ entries:
|
|
|
231
231
|
group: typography
|
|
232
232
|
tokenType: typography
|
|
233
233
|
source:
|
|
234
|
-
href: ./dtcg/json/typography.tokens.json#
|
|
234
|
+
href: ./dtcg/json/typography.tokens.json#eyebrow-4
|
|
235
235
|
- kind: token
|
|
236
|
-
id:
|
|
237
|
-
name:
|
|
236
|
+
id: eyebrow-5
|
|
237
|
+
name: eyebrow-5
|
|
238
238
|
description: Largest labels.
|
|
239
239
|
metadata:
|
|
240
240
|
status:
|
|
@@ -242,13 +242,13 @@ entries:
|
|
|
242
242
|
group: typography
|
|
243
243
|
tokenType: typography
|
|
244
244
|
source:
|
|
245
|
-
href: ./dtcg/json/typography.tokens.json#
|
|
245
|
+
href: ./dtcg/json/typography.tokens.json#eyebrow-5
|
|
246
246
|
- kind: entry
|
|
247
247
|
id: typography
|
|
248
248
|
name: Typography styles
|
|
249
|
-
description: Composite text styles for body, code, heading, and
|
|
249
|
+
description: Composite text styles for body, code, heading, and eyebrow roles, each binding a family, size, weight, and line height.
|
|
250
250
|
metadata:
|
|
251
|
-
tags: [typography, type, text, heading,
|
|
251
|
+
tags: [typography, type, text, heading, eyebrow, code, scale, line-height]
|
|
252
252
|
status:
|
|
253
253
|
status: stable
|
|
254
254
|
group: typography
|
|
@@ -277,7 +277,7 @@ entries:
|
|
|
277
277
|
freeform:
|
|
278
278
|
- title: Overview
|
|
279
279
|
body: |-
|
|
280
|
-
Each typography token bundles a font family, size, weight, and line height into one style. The set covers four roles: `body`, `code`, `heading`, and `
|
|
280
|
+
Each typography token bundles a font family, size, weight, and line height into one style. The set covers four roles: `body`, `code`, `heading`, and `eyebrow`. Every token carries the regular weight; the rendered weight comes from the component's `weight` prop (see Font weights).
|
|
281
281
|
- title: Roles and components
|
|
282
282
|
body: |-
|
|
283
283
|
| Token role | Component | Family | Default size |
|
|
@@ -285,19 +285,19 @@ entries:
|
|
|
285
285
|
| `body` | Text | `sans` | `2` |
|
|
286
286
|
| `code` | Code | `mono` | `2` |
|
|
287
287
|
| `heading` | Heading | `sans` | `2` |
|
|
288
|
-
| `
|
|
288
|
+
| `eyebrow` | Eyebrow | `sans` | — |
|
|
289
289
|
|
|
290
|
-
`heading` runs `0`–`5`, and Heading's `size` accepts all six steps. `body` and `code` run `0`–`4`. `
|
|
290
|
+
`heading` runs `0`–`5`, and Heading's `size` accepts all six steps. `body` and `code` run `0`–`4`. `eyebrow` runs `0`–`5`, and Eyebrow's `size` uses steps `0`–`4`. The `eyebrow` role belongs to Eyebrow.
|
|
291
291
|
- title: Sizes
|
|
292
292
|
body: |-
|
|
293
|
-
Each step is one token, named by role and step: `body-2`, `heading-4`, `
|
|
293
|
+
Each step is one token, named by role and step: `body-2`, `heading-4`, `eyebrow-1`. The size, line height and letter spacing of each live in `docs/tokens/dtcg/json/typography.tokens.json`. Read a role, such as `heading`, to see a whole ramp. Larger heading steps carry negative letter spacing.
|
|
294
294
|
|
|
295
295
|
| Role | Steps | Tokens |
|
|
296
296
|
| --- | --- | --- |
|
|
297
297
|
| `body` | `0`–`4` | `body-0` … `body-4` |
|
|
298
298
|
| `code` | `0`–`4` | `code-0` … `code-4` |
|
|
299
299
|
| `heading` | `0`–`5` | `heading-0` … `heading-5` |
|
|
300
|
-
| `
|
|
300
|
+
| `eyebrow` | `0`–`5` | `eyebrow-0` … `eyebrow-5` |
|
|
301
301
|
|
|
302
302
|
Run large steps (`heading` `4`–`5`, `body`/`code` `3`–`4`) tighter where needed.
|
|
303
303
|
- title: Related
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.24",
|
|
4
4
|
"description": "Sanity UI Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@sanity-labs/design-tokens": "0.0.2-alpha.
|
|
54
|
+
"@sanity-labs/design-tokens": "0.0.2-alpha.11",
|
|
55
55
|
"@sanity/icons": "^5.2.1",
|
|
56
56
|
"clsx": "^2.1.1",
|
|
57
57
|
"comment-json": "^5.0.0",
|
|
@@ -22,11 +22,12 @@ export function Button<T extends ElementType = 'button'>({
|
|
|
22
22
|
as,
|
|
23
23
|
children,
|
|
24
24
|
className,
|
|
25
|
-
disabled,
|
|
26
25
|
style,
|
|
27
26
|
iconStart: IconStart,
|
|
28
27
|
iconEnd: IconEnd,
|
|
29
28
|
loading,
|
|
29
|
+
onClick,
|
|
30
|
+
pressed,
|
|
30
31
|
text,
|
|
31
32
|
...rest
|
|
32
33
|
} = getProps({density, level, tone, ...props}, buttonProps)
|
|
@@ -41,8 +42,17 @@ export function Button<T extends ElementType = 'button'>({
|
|
|
41
42
|
)}
|
|
42
43
|
style={style}
|
|
43
44
|
data-ui="Button"
|
|
44
|
-
|
|
45
|
-
aria-
|
|
45
|
+
aria-busy={loading}
|
|
46
|
+
aria-disabled={loading}
|
|
47
|
+
aria-pressed={pressed}
|
|
48
|
+
onClick={
|
|
49
|
+
loading
|
|
50
|
+
? (e: Event) => {
|
|
51
|
+
e.preventDefault()
|
|
52
|
+
}
|
|
53
|
+
: onClick
|
|
54
|
+
}
|
|
55
|
+
type={Component === 'button' ? 'button' : undefined}
|
|
46
56
|
{...rest}
|
|
47
57
|
>
|
|
48
58
|
{loading && (
|
|
@@ -52,6 +62,7 @@ export function Button<T extends ElementType = 'button'>({
|
|
|
52
62
|
alignItems="center"
|
|
53
63
|
justifyContent="center"
|
|
54
64
|
data-ui="Button-Spinner"
|
|
65
|
+
aria-hidden="true"
|
|
55
66
|
>
|
|
56
67
|
<Spinner />
|
|
57
68
|
</Flex>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
.sui-Button {
|
|
5
5
|
--background-color: hsl(from var(--backdrop) h s l / var(--opacity-high));
|
|
6
6
|
--foreground-color: var(--foreground-high);
|
|
7
|
-
--hover-blend-color: var(--gray-500);
|
|
7
|
+
--hover-blend-color: light-dark(var(--gray-500), var(--gray-300));
|
|
8
8
|
background: var(--background-color);
|
|
9
9
|
box-shadow: inset 0 0 0 1px var(--border-color, transparent);
|
|
10
10
|
color: var(--foreground-color);
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
appearance: none;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.sui-Button[aria-pressed="true"],
|
|
16
17
|
.sui-Button:hover {
|
|
17
18
|
background: color-mix(
|
|
18
19
|
in srgb,
|
|
19
|
-
var(--hover-blend-color)
|
|
20
|
+
var(--hover-blend-color) 25%,
|
|
20
21
|
var(--background-color)
|
|
21
22
|
);
|
|
22
23
|
color: color-mix(
|
|
@@ -39,45 +40,31 @@
|
|
|
39
40
|
color: inherit;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
/* Visually hide button contents other than the spinner when loading=true */
|
|
44
|
+
.sui-Button[aria-busy="true"] > :not([data-ui="Button-Spinner"]) {
|
|
43
45
|
opacity: 0;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
/**
|
|
47
|
-
* Disabled
|
|
48
|
-
*/
|
|
49
|
-
.sui-Button[class*='sui-tone']:disabled {
|
|
50
|
-
--background-color: var(--inert-background);
|
|
51
|
-
--foreground-color: var(--inert-foreground);
|
|
52
|
-
--border-color: transparent;
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
48
|
/**
|
|
57
49
|
* Primary
|
|
58
50
|
*/
|
|
59
51
|
.sui-button-level-primary {
|
|
60
52
|
--background-color: var(--background-high-emphasized);
|
|
61
53
|
--foreground-color: var(--foreground-low-emphasized);
|
|
62
|
-
--hover-blend-color: light-dark(var(--gray-
|
|
54
|
+
--hover-blend-color: light-dark(var(--gray-50), var(--gray-600));
|
|
63
55
|
}
|
|
64
56
|
|
|
57
|
+
.sui-Button.sui-button-level-primary[aria-pressed="true"],
|
|
65
58
|
.sui-Button.sui-button-level-primary:hover {
|
|
66
|
-
background: color-mix(
|
|
67
|
-
in srgb,
|
|
68
|
-
var(--hover-blend-color) 12%,
|
|
69
|
-
var(--background-color)
|
|
70
|
-
);
|
|
71
59
|
color: var(--foreground-low-emphasized);
|
|
72
60
|
}
|
|
73
61
|
|
|
62
|
+
/* Primary critical */
|
|
74
63
|
.sui-button-level-primary.sui-tone-critical {
|
|
75
64
|
--background-color: var(--background-low-emphasized);
|
|
76
|
-
--hover-blend-color: light-dark(var(--red-
|
|
65
|
+
--hover-blend-color: light-dark(var(--red-50), var(--red-700));
|
|
77
66
|
}
|
|
78
67
|
|
|
79
|
-
|
|
80
|
-
|
|
81
68
|
/**
|
|
82
69
|
* Secondary
|
|
83
70
|
*/
|
|
@@ -85,16 +72,27 @@
|
|
|
85
72
|
--border-color: var(--separator-low)
|
|
86
73
|
}
|
|
87
74
|
|
|
75
|
+
/* Secondary critical */
|
|
88
76
|
.sui-button-level-secondary.sui-tone-critical {
|
|
89
77
|
--background-color: var(--background-low);
|
|
90
78
|
--foreground-color: var(--foreground-low);
|
|
91
|
-
--hover-blend-color: var(--red-500);
|
|
79
|
+
--hover-blend-color: light-dark(var(--red-400), var(--red-500));
|
|
92
80
|
}
|
|
93
81
|
|
|
94
82
|
/**
|
|
95
|
-
* Tertiary
|
|
83
|
+
* Tertiary critical
|
|
96
84
|
*/
|
|
97
85
|
.sui-button-level-tertiary.sui-tone-critical {
|
|
98
86
|
--foreground-color: var(--foreground-low);
|
|
99
|
-
--hover-blend-color: var(--red-500);
|
|
87
|
+
--hover-blend-color: light-dark(var(--red-400), var(--red-500));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Disabled
|
|
92
|
+
*/
|
|
93
|
+
.sui-Button[class*='sui-tone']:disabled {
|
|
94
|
+
background-color: var(--inert-background);
|
|
95
|
+
color: var(--inert-foreground);
|
|
96
|
+
--border-color: transparent;
|
|
97
|
+
pointer-events: none;
|
|
100
98
|
}
|
|
@@ -44,6 +44,10 @@ export interface ButtonProps<T extends React.ElementType = 'button'> {
|
|
|
44
44
|
* Places Button into a loading state.
|
|
45
45
|
*/
|
|
46
46
|
loading?: boolean
|
|
47
|
+
/**
|
|
48
|
+
* Visually styles the button in a pressed state, and sets aria-pressed to the provided value
|
|
49
|
+
*/
|
|
50
|
+
pressed?: boolean
|
|
47
51
|
/**
|
|
48
52
|
* Sets Button's text label.
|
|
49
53
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {marginProps} from '../../props/margin'
|
|
1
|
+
import {marginProps, type MarginProps} from '../../props/margin'
|
|
2
2
|
import {type TypographyProps, typographyProps} from '../../props/typography'
|
|
3
3
|
import {CODE_SIZE, type CodeSize} from '../../types/Code'
|
|
4
4
|
import {type PropDef} from '../../types/PropDef'
|
|
5
5
|
import type {Responsive} from '../../types/Responsive'
|
|
6
6
|
|
|
7
|
-
interface CodeBaseProps
|
|
7
|
+
interface CodeBaseProps
|
|
8
|
+
extends MarginProps, Omit<TypographyProps, 'align' | 'truncate' | 'weight'> {
|
|
8
9
|
/**
|
|
9
10
|
* Refractor language for syntax highlighting.
|
|
10
11
|
*/
|
|
@@ -10,10 +10,9 @@ const eyebrowClassName = suffixClassName('sui-Eyebrow')
|
|
|
10
10
|
/** @public */
|
|
11
11
|
export function Eyebrow<T extends ElementType = 'span'>({
|
|
12
12
|
size = 2,
|
|
13
|
-
weight = 'semibold',
|
|
14
13
|
...props
|
|
15
14
|
}: EyebrowProps<T> & Omit<ComponentPropsWithRef<T>, keyof EyebrowProps<T>>) {
|
|
16
|
-
const {as, children, className, style, ...rest} = getProps({size,
|
|
15
|
+
const {as, children, className, style, ...rest} = getProps({size, ...props}, eyebrowProps)
|
|
17
16
|
const Component = as || 'span'
|
|
18
17
|
|
|
19
18
|
if (props.truncate && props.trim) {
|
|
@@ -22,6 +21,7 @@ export function Eyebrow<T extends ElementType = 'span'>({
|
|
|
22
21
|
className={clsx(
|
|
23
22
|
eyebrowClassName,
|
|
24
23
|
className?.replace('sui-line-clamp', '').replace('sui-text-overflow', ''),
|
|
24
|
+
'sui-weight-semibold',
|
|
25
25
|
)}
|
|
26
26
|
style={style}
|
|
27
27
|
data-ui="Eyebrow"
|
|
@@ -41,7 +41,12 @@ export function Eyebrow<T extends ElementType = 'span'>({
|
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
43
|
<Component
|
|
44
|
-
className={clsx(
|
|
44
|
+
className={clsx(
|
|
45
|
+
eyebrowClassName,
|
|
46
|
+
props.truncate && 'sui-overflow-hidden',
|
|
47
|
+
'sui-weight-semibold',
|
|
48
|
+
className,
|
|
49
|
+
)}
|
|
45
50
|
style={style}
|
|
46
51
|
data-ui="Eyebrow"
|
|
47
52
|
{...rest}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import {marginProps, type MarginProps} from '../../props/margin'
|
|
2
|
+
import {toneProps, type ToneProps} from '../../props/tone'
|
|
1
3
|
import {type TypographyProps, typographyProps} from '../../props/typography'
|
|
2
4
|
import {EYEBROW_SIZE, type EyebrowSize} from '../../types/Eyebrow'
|
|
3
5
|
import {type PropDef} from '../../types/PropDef'
|
|
4
6
|
import type {Responsive} from '../../types/Responsive'
|
|
5
7
|
|
|
6
8
|
/** @public */
|
|
7
|
-
export interface EyebrowProps<T extends React.ElementType = 'span'>
|
|
9
|
+
export interface EyebrowProps<T extends React.ElementType = 'span'>
|
|
10
|
+
extends MarginProps, ToneProps, Omit<TypographyProps, 'weight'> {
|
|
8
11
|
/**
|
|
9
12
|
* HTML element to render.
|
|
10
13
|
*/
|
|
@@ -24,5 +27,10 @@ export const eyebrowProps: Record<string, PropDef> = {
|
|
|
24
27
|
className: 'text-eyebrow',
|
|
25
28
|
values: EYEBROW_SIZE,
|
|
26
29
|
},
|
|
27
|
-
|
|
30
|
+
muted: typographyProps['muted'] as PropDef,
|
|
31
|
+
align: typographyProps['align'] as PropDef,
|
|
32
|
+
trim: typographyProps['trim'] as PropDef,
|
|
33
|
+
truncate: typographyProps['truncate'] as PropDef,
|
|
34
|
+
...marginProps,
|
|
35
|
+
...toneProps,
|
|
28
36
|
}
|
|
@@ -21,6 +21,7 @@ export function Heading<T extends ElementType = 'h2'>({
|
|
|
21
21
|
className={clsx(
|
|
22
22
|
headingClassName,
|
|
23
23
|
className?.replace('sui-line-clamp', '').replace('sui-text-overflow', ''),
|
|
24
|
+
'sui-weight-bold',
|
|
24
25
|
)}
|
|
25
26
|
style={style}
|
|
26
27
|
data-ui="Heading"
|
|
@@ -29,7 +30,6 @@ export function Heading<T extends ElementType = 'h2'>({
|
|
|
29
30
|
<span
|
|
30
31
|
className={clsx(
|
|
31
32
|
'sui-overflow-hidden',
|
|
32
|
-
'sui-weight-bold',
|
|
33
33
|
props.truncate === 1 ? 'sui-text-overflow' : 'sui-line-clamp',
|
|
34
34
|
)}
|
|
35
35
|
>
|