@sanity/ui 5.0.0-alpha.22 → 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/README.md +10 -0
- 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/avatar-counter.dsds.yaml +78 -0
- package/docs/components/avatar-stack.dsds.yaml +96 -0
- package/docs/components/avatar.dsds.yaml +115 -0
- package/docs/components/badge.dsds.yaml +126 -0
- package/docs/components/box.dsds.yaml +223 -0
- package/docs/components/button.dsds.yaml +296 -0
- package/docs/components/card.dsds.yaml +317 -0
- package/docs/components/checkbox.dsds.yaml +204 -0
- package/docs/components/code.dsds.yaml +169 -0
- package/docs/components/container.dsds.yaml +189 -0
- package/docs/components/dialog.dsds.yaml +343 -0
- package/docs/components/divider.dsds.yaml +93 -0
- package/docs/components/eyebrow.dsds.yaml +198 -0
- package/docs/components/flex.dsds.yaml +237 -0
- package/docs/components/grid.dsds.yaml +217 -0
- package/docs/components/h-stack.dsds.yaml +127 -0
- package/docs/components/heading.dsds.yaml +233 -0
- package/docs/components/hotkeys.dsds.yaml +60 -0
- package/docs/components/icon-button.dsds.yaml +227 -0
- package/docs/components/icon.dsds.yaml +275 -0
- package/docs/components/indicator-stack.dsds.yaml +98 -0
- package/docs/components/indicator.dsds.yaml +108 -0
- package/docs/components/inline.dsds.yaml +127 -0
- package/docs/components/kbd.dsds.yaml +59 -0
- package/docs/components/link.dsds.yaml +108 -0
- package/docs/components/list-button-item.dsds.yaml +103 -0
- package/docs/components/list-item-image.dsds.yaml +82 -0
- package/docs/components/list-item-text.dsds.yaml +80 -0
- package/docs/components/list-item.dsds.yaml +148 -0
- package/docs/components/list.dsds.yaml +162 -0
- package/docs/components/popover.dsds.yaml +214 -0
- package/docs/components/press-area.dsds.yaml +279 -0
- package/docs/components/radio.dsds.yaml +198 -0
- package/docs/components/select.dsds.yaml +214 -0
- package/docs/components/skip-to-content.dsds.yaml +110 -0
- package/docs/components/spinner.dsds.yaml +119 -0
- package/docs/components/switch.dsds.yaml +202 -0
- package/docs/components/tab.dsds.yaml +54 -0
- package/docs/components/tabs-list.dsds.yaml +56 -0
- package/docs/components/tabs-panel.dsds.yaml +54 -0
- package/docs/components/tabs.dsds.yaml +104 -0
- package/docs/components/text-area.dsds.yaml +170 -0
- package/docs/components/text-input.dsds.yaml +189 -0
- package/docs/components/text.dsds.yaml +268 -0
- package/docs/components/tooltip-group.dsds.yaml +90 -0
- package/docs/components/tooltip.dsds.yaml +216 -0
- package/docs/components/v-stack.dsds.yaml +155 -0
- package/docs/components/visually-hidden.dsds.yaml +112 -0
- package/docs/evals/cases.yaml +1319 -0
- package/docs/examples/checkbox-2.tsx +57 -0
- package/docs/examples/confirmation-dialogs-1.tsx +27 -0
- package/docs/examples/confirmation-dialogs-2.tsx +55 -0
- package/docs/examples/confirmation-dialogs-3.tsx +28 -0
- package/docs/examples/confirmation-dialogs-4.tsx +38 -0
- package/docs/examples/popover-1.tsx +48 -0
- package/docs/examples/popover-2.tsx +53 -0
- package/docs/foundations/accessibility-guidelines.dsds.yaml +301 -0
- package/docs/foundations/color-guidelines.dsds.yaml +308 -0
- package/docs/foundations/content-guidelines.dsds.yaml +285 -0
- package/docs/foundations/semantics.dsds.yaml +125 -0
- package/docs/foundations/spacing-guidelines.dsds.yaml +226 -0
- package/docs/foundations/typography-guidelines.dsds.yaml +322 -0
- 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 +768 -0
- package/docs/index.dsds.yaml +506 -0
- package/docs/overview/api-essentials.dsds.yaml +221 -0
- package/docs/overview/component-reference.dsds.yaml +213 -0
- package/docs/overview/installation.dsds.yaml +254 -0
- package/docs/overview/quick-start.dsds.yaml +317 -0
- package/docs/patterns/confirmation-dialogs.dsds.yaml +140 -0
- package/docs/patterns/error-messaging.dsds.yaml +58 -0
- package/docs/patterns/forms.dsds.yaml +362 -0
- package/docs/patterns/layouts.dsds.yaml +403 -0
- package/docs/patterns/loading-states.dsds.yaml +41 -0
- package/docs/patterns/messaging.dsds.yaml +72 -0
- package/docs/patterns/navigation.dsds.yaml +153 -0
- package/docs/patterns/responsive.dsds.yaml +590 -0
- package/docs/tokens/color.dsds.yaml +1158 -0
- package/docs/tokens/container-widths.dsds.yaml +131 -0
- package/docs/tokens/content.dsds.yaml +258 -0
- package/docs/tokens/content.tokens.json +180 -0
- package/docs/tokens/dtcg/README.md +41 -0
- package/docs/tokens/dtcg/css/color.css +107 -0
- package/docs/tokens/dtcg/css/container.css +12 -0
- package/docs/tokens/dtcg/css/fontFamily.css +10 -0
- package/docs/tokens/dtcg/css/fontWeight.css +10 -0
- package/docs/tokens/dtcg/css/index.css +12 -0
- package/docs/tokens/dtcg/css/radius.css +14 -0
- package/docs/tokens/dtcg/css/semantic.css +42 -0
- package/docs/tokens/dtcg/css/shadow.css +22 -0
- package/docs/tokens/dtcg/css/space.css +16 -0
- package/docs/tokens/dtcg/css/typography.css +67 -0
- package/docs/tokens/dtcg/json/color.tokens.json +911 -0
- package/docs/tokens/dtcg/json/container.tokens.json +44 -0
- package/docs/tokens/dtcg/json/fontFamily.tokens.json +10 -0
- package/docs/tokens/dtcg/json/fontWeight.tokens.json +18 -0
- package/docs/tokens/dtcg/json/radius.tokens.json +58 -0
- package/docs/tokens/dtcg/json/semantic.tokens.json +372 -0
- package/docs/tokens/dtcg/json/shadow.tokens.json +599 -0
- package/docs/tokens/dtcg/json/space.tokens.json +72 -0
- package/docs/tokens/dtcg/json/typography.tokens.json +354 -0
- package/docs/tokens/font-family.dsds.yaml +79 -0
- package/docs/tokens/font-weight.dsds.yaml +103 -0
- package/docs/tokens/radius.dsds.yaml +153 -0
- package/docs/tokens/semantic.dsds.yaml +397 -0
- package/docs/tokens/shadow.dsds.yaml +125 -0
- package/docs/tokens/space.dsds.yaml +185 -0
- package/docs/tokens/typography.dsds.yaml +316 -0
- package/llms.txt +108 -0
- package/package.json +6 -3
- package/skills/sanity-ui-5/SKILL.md +158 -0
- package/skills/sanity-ui-5/references/component-choice.md +37 -0
- package/skills/sanity-ui-5/references/components.md +145 -0
- package/skills/sanity-ui-5/references/forms-and-accessibility.md +189 -0
- package/skills/sanity-ui-5/references/migrating-from-v3.md +250 -0
- package/skills/sanity-ui-5/references/props-and-imports.md +169 -0
- package/skills/sanity-ui-5/references/setup.md +177 -0
- package/skills/sanity-ui-5/references/silent-failures.md +33 -0
- package/skills/sanity-ui-5/references/taste.md +53 -0
- package/skills/sanity-ui-5/references/tone-and-color.md +55 -0
- 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
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
kind: sanity.pattern
|
|
2
|
+
id: confirmation-dialogs
|
|
3
|
+
name: Confirmation & action dialogs
|
|
4
|
+
description: 'Sanity UI has one modal overlay (Dialog) and one floating layer (Popover), and no built-in lightweight inline confirm. This pattern shows how to choose between a full Dialog and a Popover-based inline confirm, and the rules every confirmation surface must follow regardless of which shape is used: an informed confirm button, and a guaranteed way to close.'
|
|
5
|
+
metadata:
|
|
6
|
+
tags:
|
|
7
|
+
- tutorial
|
|
8
|
+
- confirm
|
|
9
|
+
- confirmation
|
|
10
|
+
- dialog
|
|
11
|
+
- modal
|
|
12
|
+
- popover
|
|
13
|
+
- destructive
|
|
14
|
+
- delete
|
|
15
|
+
- focus trap
|
|
16
|
+
- escape
|
|
17
|
+
- dismissal
|
|
18
|
+
- critical
|
|
19
|
+
- alertdialog
|
|
20
|
+
status:
|
|
21
|
+
status: stable
|
|
22
|
+
sections:
|
|
23
|
+
- kind: guidelines
|
|
24
|
+
for: all
|
|
25
|
+
framing: how-to-use
|
|
26
|
+
items:
|
|
27
|
+
- level: must
|
|
28
|
+
statement: Anchor the inline confirm popover to the triggering element, not the viewport center. That's what makes it read as "confirming this row," not "confirming something."
|
|
29
|
+
- id: default-destructive-confirms-both-popover
|
|
30
|
+
level: must
|
|
31
|
+
statement: Default destructive confirms to `tone="critical"` on both the popover's accent and the confirm button, and give the confirm button `level="primary"`. The confirm button is the most important action on a confirmation surface — that is what the surface exists for — so it carries the primary level alongside the critical tone. Cancel is the secondary or tertiary action.
|
|
32
|
+
refines:
|
|
33
|
+
- to: shared-foundations#destructive-actions-use-critical-tone
|
|
34
|
+
- level: must
|
|
35
|
+
statement: 'Disable or hide the confirm action until an async impact check resolves — for example, counting how many other documents reference this one, or checking permissions. Once it resolves, name the consequence on the confirm button. A generic confirm gives a destructive action less friction than it needs, and lets someone confirm before they know what breaks.'
|
|
36
|
+
example:
|
|
37
|
+
title: Confirm waits on an async impact check
|
|
38
|
+
ref:
|
|
39
|
+
href: ../examples/confirmation-dialogs-3.tsx
|
|
40
|
+
rel: source
|
|
41
|
+
- id: guarantee-every-confirmation-surface-way
|
|
42
|
+
level: must
|
|
43
|
+
statement: Guarantee every confirmation surface a way out — Escape, click-outside, and an explicit Cancel/close control. A surface missing any of the three can trap whoever opened it.
|
|
44
|
+
- level: must
|
|
45
|
+
statement: 'When building a fully custom confirmation overlay instead of composing `Dialog` or `Popover`, wire Escape-to-close, click-outside, a backdrop dismissal, and an explicit close control yourself. Nothing gives you these for free outside of `Dialog` and `Popover`. Otherwise the surface can end up with no declared close handler at all — closeable by neither the keyboard nor a click.'
|
|
46
|
+
- level: should
|
|
47
|
+
statement: 'Name the resolved consequence on the confirm button itself once it''s known (for example, "Delete (3 refs)"), instead of leaving a generic "Confirm" label. "Delete (3 refs)" tells the user what they''re about to do; "Confirm" doesn''t. The confirm button must repeat the action verb, per the messaging pattern — even though the number in the label wasn''t known a moment ago.'
|
|
48
|
+
refines:
|
|
49
|
+
- to: content-guidelines#name-the-action
|
|
50
|
+
- level: must-not
|
|
51
|
+
statement: Never let one confirmation shape lose a dismissal path that another shape has. If the popover version of a confirm closes on Escape, click-outside, and Cancel, the Dialog version of that same confirm must close the same three ways. Consistency here isn't cosmetic — it's what a keyboard user learns to expect from every confirm in the product.
|
|
52
|
+
- level: must-not
|
|
53
|
+
statement: 'Do not hand-build a confirmation surface — a fixed-position `div` with a manual backdrop — instead of composing `Dialog`. A hand-built modal reproduces what `Dialog` already provides, and usually drops the parts that are easy to forget: focus trapping, Escape handling, and returning focus to the trigger on close.'
|
|
54
|
+
example:
|
|
55
|
+
title: Hand-built confirmation vs. Dialog
|
|
56
|
+
ref:
|
|
57
|
+
href: ../examples/confirmation-dialogs-4.tsx
|
|
58
|
+
rel: source
|
|
59
|
+
- kind: guidelines
|
|
60
|
+
for: agent
|
|
61
|
+
framing: how-to-use
|
|
62
|
+
items:
|
|
63
|
+
- level: must
|
|
64
|
+
statement: Use a full Dialog for destructive actions with rich content to show; use an inline Popover confirm, anchored to the trigger, for a single row's action.
|
|
65
|
+
- kind: steps
|
|
66
|
+
for: all
|
|
67
|
+
ordered: false
|
|
68
|
+
title: Accessibility checklist
|
|
69
|
+
items:
|
|
70
|
+
- title: Focus lands on Cancel (or the container), never on the destructive confirm button, when the surface opens.
|
|
71
|
+
- title: Escape, click-outside, and an explicit Cancel/close control all resolve to the same close behavior.
|
|
72
|
+
- title: The confirm button is disabled, not styled to look disabled, while an async impact check is pending.
|
|
73
|
+
- title: The confirm button's label names the action and, when known, its scale — not a bare "Confirm."
|
|
74
|
+
- title: Destructive confirms use `tone="critical"` on the confirm button, not color alone, and `level="primary"` — the confirm action is not visually demoted for being destructive.
|
|
75
|
+
- kind: section
|
|
76
|
+
for: all
|
|
77
|
+
freeform:
|
|
78
|
+
- title: Overview
|
|
79
|
+
body: 'Sanity UI has one modal overlay (`Dialog`) and one floating layer (`Popover`). It has no built-in "lightweight inline confirm." Studio composes exactly that on top of `Popover`, for confirms that don''t need a full modal. This page covers which shape to reach for. It also covers the one rule that holds no matter which you choose: a confirmation surface must have a guaranteed way to close.'
|
|
80
|
+
- title: Two shapes of confirmation
|
|
81
|
+
body: |-
|
|
82
|
+
| | Full `Dialog` | Inline confirm popover |
|
|
83
|
+
| --- | --- | --- |
|
|
84
|
+
| Use for | A destructive action with rich content: a document, or what else it references | A small, local action: one row's delete button, an inline discard |
|
|
85
|
+
| Anchoring | Centered, blocks the whole page | Anchored beside the trigger that opened it |
|
|
86
|
+
| Body content | A heading, body text, optionally a list or preview of affected items | One line of consequence text |
|
|
87
|
+
| Focus behavior | Traps focus; nothing behind it is reachable | Does not trap focus; the rest of the page stays interactive |
|
|
88
|
+
|
|
89
|
+
**Reach for a full `Dialog` when the confirmation needs to show something, not describe it.** A delete that also removes other documents needs to list those documents. That's rich content — it earns a dialog. A delete on one list row with nothing else at stake needs one sentence next to the row it affects.
|
|
90
|
+
- kind: section
|
|
91
|
+
for: all
|
|
92
|
+
freeform:
|
|
93
|
+
- title: The escape-hatch rule
|
|
94
|
+
body: |-
|
|
95
|
+
Every confirmation surface must guarantee a way out, regardless of mechanism: Escape, click-outside, or an explicit Cancel/close control.
|
|
96
|
+
|
|
97
|
+
| Surface | Closes via |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| `Dialog` | Header close icon, click-outside (via `closedby="any"`), Escape — all routed to the same `onClose` |
|
|
100
|
+
| Inline confirm popover | Escape, click-outside, or the Cancel button — route all three to the same handler |
|
|
101
|
+
| A fully custom overlay | Nothing automatic. You build every dismissal path yourself. |
|
|
102
|
+
- kind: section
|
|
103
|
+
for: agent
|
|
104
|
+
freeform:
|
|
105
|
+
- title: Intent
|
|
106
|
+
body: Choose a full Dialog when a confirmation needs to show something (a document or its references); choose an inline Popover confirm for a small, local action. Whichever shape is used, guarantee a way to close it, and never render a generic confirm button while an async impact check is still pending.
|
|
107
|
+
traits:
|
|
108
|
+
- traitType: variant
|
|
109
|
+
kind: enum
|
|
110
|
+
id: shape
|
|
111
|
+
name: Confirmation shape
|
|
112
|
+
description: Which surface a confirmation renders in, chosen by how much the confirmation needs to show.
|
|
113
|
+
values:
|
|
114
|
+
- id: dialog
|
|
115
|
+
name: Full Dialog
|
|
116
|
+
description: Use for a destructive action with rich content — a document, or what else it references. Centered, blocks the whole page, and traps focus so nothing behind it is reachable. Body content can include a heading, body text, and a list or preview of affected items.
|
|
117
|
+
examples:
|
|
118
|
+
- title: Confirmation built on Dialog
|
|
119
|
+
description: Dialog handles the backdrop, focus trap, and Escape for a full confirmation.
|
|
120
|
+
ref:
|
|
121
|
+
href: ../examples/confirmation-dialogs-1.tsx
|
|
122
|
+
rel: source
|
|
123
|
+
- id: inline-popover
|
|
124
|
+
name: Inline confirm popover
|
|
125
|
+
description: Use for a small, local action — one row's delete button, an inline discard. Anchored beside the trigger that opened it, does not trap focus, and the rest of the page stays interactive. Body content is one line of consequence text.
|
|
126
|
+
examples:
|
|
127
|
+
- title: Popover + Button composing an inline confirm
|
|
128
|
+
description: Popover and Button compose the whole thing. Anchor the popover to the row's own trigger element, and default its tone to critical for destructive confirms.
|
|
129
|
+
ref:
|
|
130
|
+
href: ../examples/confirmation-dialogs-2.tsx
|
|
131
|
+
rel: source
|
|
132
|
+
uses:
|
|
133
|
+
- to: dialog
|
|
134
|
+
note: Required part.
|
|
135
|
+
- to: popover
|
|
136
|
+
note: Required part.
|
|
137
|
+
- to: button
|
|
138
|
+
note: Required part.
|
|
139
|
+
- to: messaging
|
|
140
|
+
- to: error-messaging
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
kind: sanity.pattern
|
|
2
|
+
id: error-messaging
|
|
3
|
+
name: Error messaging
|
|
4
|
+
description: Guidelines for writing clear, actionable error messages that name the problem and direct users to the next step.
|
|
5
|
+
metadata:
|
|
6
|
+
tags:
|
|
7
|
+
- tutorial
|
|
8
|
+
- errors
|
|
9
|
+
- messaging
|
|
10
|
+
- copy
|
|
11
|
+
- accessibility
|
|
12
|
+
- feedback
|
|
13
|
+
- error
|
|
14
|
+
- error message
|
|
15
|
+
- validation
|
|
16
|
+
- field error
|
|
17
|
+
- tone
|
|
18
|
+
- critical
|
|
19
|
+
- WCAG
|
|
20
|
+
status:
|
|
21
|
+
status: stable
|
|
22
|
+
sections:
|
|
23
|
+
- kind: guidelines
|
|
24
|
+
for: all
|
|
25
|
+
framing: how-to-use
|
|
26
|
+
items:
|
|
27
|
+
- id: name-what-failed
|
|
28
|
+
level: must
|
|
29
|
+
statement: 'Name what failed: the thing, and what went wrong with it. Use plain words, with no error codes or stack traces. Use "Something went wrong" only as a last resort, when you can''t find the cause.'
|
|
30
|
+
refines:
|
|
31
|
+
- to: content-guidelines#plain-language
|
|
32
|
+
- id: state-next-step
|
|
33
|
+
level: must
|
|
34
|
+
statement: 'State the next step when the user can act. Example: "The image failed to upload. Try a file under 10 MB." When they cannot act, describe what the system is doing.'
|
|
35
|
+
- level: must
|
|
36
|
+
statement: 'For errors the user can''t fix, say what the system does. Never invent a step the user can''t take. Name who to contact instead. Example: "This didn''t save. We''re retrying — your work is safe."'
|
|
37
|
+
- id: field-error-names-field
|
|
38
|
+
level: must
|
|
39
|
+
statement: Field errors must identify their field. A message that floats free of its input fails WCAG 3.3.1 Error Identification. Place it with its input, and name that field's problem.
|
|
40
|
+
- id: error-message-length
|
|
41
|
+
level: should
|
|
42
|
+
statement: Keep messages to two sentences at most. Link to docs or offer a "Details" toggle for longer context.
|
|
43
|
+
- id: dont-blame-the-user
|
|
44
|
+
level: must-not
|
|
45
|
+
statement: Don't blame the user. Frame errors as states, not faults. Use "This file type is not allowed," not "You sent a bad file."
|
|
46
|
+
- kind: guidelines
|
|
47
|
+
for: agent
|
|
48
|
+
framing: how-to-use
|
|
49
|
+
items:
|
|
50
|
+
- level: must
|
|
51
|
+
statement: 'Lead an error message with the state ("**Error:** …") or pair tone="critical" with ErrorOutlineIcon.'
|
|
52
|
+
refines:
|
|
53
|
+
- to: shared-foundations#tone-paired-with-second-channel
|
|
54
|
+
- kind: section
|
|
55
|
+
for: agent
|
|
56
|
+
freeform:
|
|
57
|
+
- title: Intent
|
|
58
|
+
body: Apply these rules when writing or reviewing error message copy in Sanity UI components to ensure messages are clear, actionable, and accessible.
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
kind: sanity.pattern
|
|
2
|
+
id: forms
|
|
3
|
+
name: Forms
|
|
4
|
+
description: 'Shared guidance for form fields and their inputs (Checkbox, Radio, Switch, TextInput, TextArea, Select) and the copy inside and around them: labels, placeholders, helper text, errors, empty states, success confirmations, and buttons. Rules that hold for every form field live here once; each component page references them and adds only what is specific to that input.'
|
|
5
|
+
metadata:
|
|
6
|
+
tags:
|
|
7
|
+
- form
|
|
8
|
+
- forms
|
|
9
|
+
- input
|
|
10
|
+
- label
|
|
11
|
+
- checkbox
|
|
12
|
+
- radio
|
|
13
|
+
- switch
|
|
14
|
+
- text input
|
|
15
|
+
- text area
|
|
16
|
+
- select
|
|
17
|
+
- validation
|
|
18
|
+
- accessible name
|
|
19
|
+
- tutorial
|
|
20
|
+
- copy
|
|
21
|
+
- UX writing
|
|
22
|
+
- placeholder
|
|
23
|
+
- helper text
|
|
24
|
+
- error message
|
|
25
|
+
- empty state
|
|
26
|
+
- success confirmation
|
|
27
|
+
- buttons
|
|
28
|
+
- voice and tone
|
|
29
|
+
- content tokens
|
|
30
|
+
status:
|
|
31
|
+
status: stable
|
|
32
|
+
sections:
|
|
33
|
+
- kind: guidelines
|
|
34
|
+
for: all
|
|
35
|
+
framing: when-to-use
|
|
36
|
+
title: Choosing a control
|
|
37
|
+
items:
|
|
38
|
+
- id: choose-control-by-option-count
|
|
39
|
+
level: should
|
|
40
|
+
statement: 'Choose the selection control by what the user is choosing: Radio for 2–4 options, Select for 5–20, TextInput with a search pattern for more than 20. Use Checkbox when several options can be chosen at once, and Switch for a binary setting that takes effect immediately.'
|
|
41
|
+
- kind: guidelines
|
|
42
|
+
for: all
|
|
43
|
+
framing: how-to-use
|
|
44
|
+
title: Labels
|
|
45
|
+
items:
|
|
46
|
+
- id: disabled-input-helper-text
|
|
47
|
+
level: must
|
|
48
|
+
statement: A form field with a disabled input must have helper text. It says why the input is off and what turns it on.
|
|
49
|
+
- id: pair-with-visible-label
|
|
50
|
+
level: must
|
|
51
|
+
statement: Give every form field a visible label. The label tells a sighted user what the field is for, and gives the input its accessible name (WCAG 3.3.2 Labels or Instructions, Level A).
|
|
52
|
+
- refs:
|
|
53
|
+
- to: content-guidelines#sentence-case-all-system-set
|
|
54
|
+
rel: same-as
|
|
55
|
+
- id: label-short
|
|
56
|
+
level: should
|
|
57
|
+
statement: Keep labels short, descriptive, and noun phrases. Most fields need one to three words; go longer only when a shorter label would be ambiguous. A label names the field, not the action.
|
|
58
|
+
- refs:
|
|
59
|
+
- to: content-guidelines#label-length-by-element
|
|
60
|
+
rel: same-as
|
|
61
|
+
- id: mark-optional-fields
|
|
62
|
+
level: should
|
|
63
|
+
statement: Mark optional fields as optional in the label, as `Phone number (optional)`, rather than marking required ones. If most fields are optional, mark the required ones instead, and use one convention for the whole form.
|
|
64
|
+
- id: label-no-trailing-period
|
|
65
|
+
level: should-not
|
|
66
|
+
statement: Don't end a label with a period. Labels are not full sentences.
|
|
67
|
+
- id: label-no-trailing-colon
|
|
68
|
+
level: should-not
|
|
69
|
+
statement: Don't end a label with a colon. The visual relationship between a label and its input already conveys "this labels that".
|
|
70
|
+
- id: placeholder-not-a-label
|
|
71
|
+
level: must-not
|
|
72
|
+
statement: Don't use placeholder text as the label, or as a replacement for one. A placeholder disappears as soon as the user types and is unreliable for screen readers (WCAG 3.3.2). Pair the input with a visible label.
|
|
73
|
+
evidence:
|
|
74
|
+
- href: https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html
|
|
75
|
+
role: WCAG 3.3.2 Labels or Instructions
|
|
76
|
+
- id: no-nested-label-elements
|
|
77
|
+
level: must-not
|
|
78
|
+
statement: Don't nest a label element inside another label element. Nested labels are invalid HTML and break the accessible name.
|
|
79
|
+
- kind: guidelines
|
|
80
|
+
for: all
|
|
81
|
+
framing: how-to-use
|
|
82
|
+
title: Layout
|
|
83
|
+
items:
|
|
84
|
+
- id: stack-fields-vertically
|
|
85
|
+
level: should
|
|
86
|
+
statement: Lay out form fields (defined as the paired composition of label + input) vertically. Place fields side by side only for a small group of closely related fields.
|
|
87
|
+
- kind: guidelines
|
|
88
|
+
for: all
|
|
89
|
+
framing: how-to-use
|
|
90
|
+
title: State
|
|
91
|
+
items:
|
|
92
|
+
- id: pair-checked-with-onchange
|
|
93
|
+
level: must
|
|
94
|
+
statement: Pair `checked` with `onChange` on every controlled Checkbox, Radio and Switch. A control with `checked` set and no `onChange` looks interactive but never updates — a common generated-code bug.
|
|
95
|
+
- id: stack-options-vertically
|
|
96
|
+
level: should
|
|
97
|
+
statement: Lay out a group of Checkbox or Radio options vertically for easier scanning.
|
|
98
|
+
- id: no-mixed-controlled-uncontrolled
|
|
99
|
+
level: must-not
|
|
100
|
+
statement: Don't set both `checked` and `defaultChecked` on the same Checkbox, Radio or Switch. Choose one pattern — controlled or uncontrolled — per instance; mixing them produces inconsistent behaviour.
|
|
101
|
+
- id: no-pressed-for-form-values
|
|
102
|
+
level: must-not
|
|
103
|
+
statement: Don't use Button's `pressed` prop to toggle one or more values in a form. Use Checkbox or Radio instead.
|
|
104
|
+
alternatives:
|
|
105
|
+
- to: checkbox
|
|
106
|
+
- to: radio
|
|
107
|
+
- kind: guidelines
|
|
108
|
+
for: all
|
|
109
|
+
title: Accessibility
|
|
110
|
+
tags:
|
|
111
|
+
- accessibility
|
|
112
|
+
items:
|
|
113
|
+
- id: aria-label-overrides-name
|
|
114
|
+
level: must
|
|
115
|
+
statement: "`aria-label` overrides the accessible name screen readers announce. Prefer wrapping a fully descriptive `label` in `VisuallyHidden` first, and use `aria-label` only when that isn't practical. Checkbox, Radio and Switch forward it directly to the underlying `<input>`."
|
|
116
|
+
- id: aria-labelledby-references-name
|
|
117
|
+
level: must
|
|
118
|
+
statement: "`aria-labelledby` takes another element's `id` and uses that element's text as the control's accessible name, as an alternative to `aria-label`. Use it when the more specific descriptive text already exists elsewhere in the DOM. Checkbox, Radio and Switch forward it directly to the underlying `<input>`."
|
|
119
|
+
- id: label-available-to-screen-readers
|
|
120
|
+
level: must
|
|
121
|
+
statement: Give every form field a label that screen readers can reach. Keep the label visible by default. Hide it with VisuallyHidden only where the layout already shows what the field is for, such as a row checkbox in a table.
|
|
122
|
+
- id: programmatic-name-required
|
|
123
|
+
level: should
|
|
124
|
+
statement: An input with no programmatic name is a critical violation. Link a visible label to the input with `id` and `htmlFor`, or have the input render its own `<label>`. Use `aria-label` or `aria-labelledby` only when there is no visible text to link (WCAG 4.1.2 Name, Role, Value).
|
|
125
|
+
- id: error-prop-needs-visible-message
|
|
126
|
+
level: should
|
|
127
|
+
statement: When setting `hasError`, always render a visible error message near the field. The prop sets the error styling and `aria-invalid`, but it adds no description, so link the message with `aria-describedby`.
|
|
128
|
+
- id: border-contrast
|
|
129
|
+
level: should
|
|
130
|
+
statement: Field border color contrast must reach 3:1 against its background (WCAG 1.4.11).
|
|
131
|
+
- id: placeholder-contrast
|
|
132
|
+
level: should
|
|
133
|
+
statement: Placeholder text needs the a minumum 4.5:1 color contrast (WCAG 1.4.3).
|
|
134
|
+
- id: field-group-name
|
|
135
|
+
level: should
|
|
136
|
+
statement: '**A field inside a group still needs its own name.** A`legend` only names the group. Fields in a group require their own labels, or point at the legend with `aria-labelledby`.'
|
|
137
|
+
- id: error-described-in-text
|
|
138
|
+
level: should
|
|
139
|
+
statement: |-
|
|
140
|
+
A field in an error state needs the error described in text, linked to the field with `aria-describedby` so assistive technology announces the error with the field (WCAG 3.3.1). Write the message to the Error messaging rules: name what failed, and state the next step (`error-messaging#name-what-failed`, WCAG 3.3.3).
|
|
141
|
+
```tsx
|
|
142
|
+
// ✗ — axe critical: no accessible name, error is color-only
|
|
143
|
+
<TextInput hasError value={value} onChange={onChange} />
|
|
144
|
+
// ✓ — labeled, and the error is described in linked text
|
|
145
|
+
<VStack gap={2}>
|
|
146
|
+
<Text as="label" htmlFor="email">Email address</Text>
|
|
147
|
+
<TextInput id="email" hasError aria-describedby="email-error" value={value} onChange={onChange} />
|
|
148
|
+
<Text id="email-error" size={1} tone="critical">Error: Enter a valid email address.</Text>
|
|
149
|
+
</VStack>
|
|
150
|
+
```
|
|
151
|
+
- kind: guidelines
|
|
152
|
+
for: all
|
|
153
|
+
framing: how-to-use
|
|
154
|
+
tags:
|
|
155
|
+
- content
|
|
156
|
+
items:
|
|
157
|
+
- refs:
|
|
158
|
+
- to: error-messaging#name-what-failed
|
|
159
|
+
rel: same-as
|
|
160
|
+
- refs:
|
|
161
|
+
- to: error-messaging#state-next-step
|
|
162
|
+
rel: same-as
|
|
163
|
+
- refs:
|
|
164
|
+
- to: error-messaging#field-error-names-field
|
|
165
|
+
rel: same-as
|
|
166
|
+
- level: must
|
|
167
|
+
statement: Use action-oriented button labels that describe the action, not the state. "Submit," "OK," and "Done" don't say what will happen or that it has happened yet.
|
|
168
|
+
refines:
|
|
169
|
+
- to: content-guidelines#name-the-action
|
|
170
|
+
- level: must
|
|
171
|
+
statement: A destructive confirmation button must echo the action ("Delete project"), not read as a generic "Confirm."
|
|
172
|
+
refines:
|
|
173
|
+
- to: content-guidelines#name-the-action
|
|
174
|
+
- level: should
|
|
175
|
+
statement: Show an example in a placeholder, not a description of the field. `example@domain.com` beats "Enter your email address."
|
|
176
|
+
- level: should
|
|
177
|
+
statement: Keep placeholder text short — one example format or one short phrase. Placeholder text competes with what the user types.
|
|
178
|
+
- level: should
|
|
179
|
+
statement: In a top-of-form error summary, name the total number of fields needing attention and link or scroll to the first error field, instead of listing every error again. The inline field errors already list the specifics; the summary's job is to orient, not repeat.
|
|
180
|
+
- level: should
|
|
181
|
+
statement: State what happened in a success confirmation, and avoid exclamation points unless the context truly warrants excitement. "Project created." is specific; "Success!" and "You're all set!" say nothing about what happened.
|
|
182
|
+
- level: should
|
|
183
|
+
statement: Route a form string to a content token once the same string appears in three or more places. Recurring form strings — generic error tones, common placeholder shapes, common button labels — are candidates for tokenization once repeated. Route to Frontend Engineer for the implementation side; content designer owns the naming and canonical values.
|
|
184
|
+
- level: should-not
|
|
185
|
+
statement: Don't use placeholders to carry required format rules. If the format matters, use helper text below the field — it stays visible after the user starts typing, unlike a placeholder, which is also often low-contrast (WCAG 1.4.3).
|
|
186
|
+
- level: must-not
|
|
187
|
+
statement: Don't write an apologetic or hostile error tone. "Sorry, that email looks wrong" is wrong — the system isn't sorry, it's wrong. "INVALID INPUT" or "You entered this incorrectly" blames the user. Be factual and helpful instead.
|
|
188
|
+
- level: must-not
|
|
189
|
+
statement: Don't show empty-state copy while a Select's options are still loading — leave a combobox with only a disabled input and no message. The user can't tell if the system is broken or the list is empty.
|
|
190
|
+
- level: must-not
|
|
191
|
+
statement: Don't mix `Cancel`, `Back`, and `Close` on the same control — each implies a different result (abandon without saving, return to a previous step, dismiss with nothing pending).
|
|
192
|
+
example:
|
|
193
|
+
title: Examples
|
|
194
|
+
description: Cancel abandons the change without saving. Back returns to a previous step. Close dismisses a dialog when no action is pending.
|
|
195
|
+
- kind: steps
|
|
196
|
+
for: all
|
|
197
|
+
ordered: false
|
|
198
|
+
title: The form copy checklist
|
|
199
|
+
items:
|
|
200
|
+
- title: Every field has a clear label (not placeholder-as-label).
|
|
201
|
+
- title: Optional fields are marked; required is implied.
|
|
202
|
+
- optional: true
|
|
203
|
+
title: Placeholders show examples, not instructions.
|
|
204
|
+
- optional: true
|
|
205
|
+
title: Helper text adds information; no filler.
|
|
206
|
+
- title: Errors name the field and explain how to fix.
|
|
207
|
+
- title: Error tone is factual, not apologetic or hostile.
|
|
208
|
+
- title: Empty states are handled (Select, combobox, multi-select).
|
|
209
|
+
- title: Button labels describe actions, not states.
|
|
210
|
+
- optional: true
|
|
211
|
+
title: No "Submit", "OK", "Done", or "Success!".
|
|
212
|
+
- optional: true
|
|
213
|
+
title: Voice is consistent across the form.
|
|
214
|
+
- optional: true
|
|
215
|
+
title: Recurring copy has been considered for tokenization.
|
|
216
|
+
- kind: section
|
|
217
|
+
for: all
|
|
218
|
+
freeform:
|
|
219
|
+
- title: Overview
|
|
220
|
+
body: |-
|
|
221
|
+
A reference for writing the copy that lives inside and around form fields: labels, placeholders, helper text, error messages, empty states, and the small decisions that make forms feel cared for or sloppy.
|
|
222
|
+
|
|
223
|
+
The governing idea: **forms are mostly words.** The input is a rectangle; the words tell the user what to do, what's happening, and what went wrong. Sloppy form copy is sloppy design — no matter how clean the rectangles look.
|
|
224
|
+
- kind: guidelines
|
|
225
|
+
for: all
|
|
226
|
+
framing: how-to-use
|
|
227
|
+
title: Label copy
|
|
228
|
+
items:
|
|
229
|
+
- id: label-present-tense
|
|
230
|
+
level: should
|
|
231
|
+
statement: 'Write labels in the present tense, with the second person implied: `Delivery address`, not `Your delivery address`.'
|
|
232
|
+
example:
|
|
233
|
+
title: Examples
|
|
234
|
+
description: ✅ `Delivery address`, `Date of birth`. ❌ `Your delivery address`, `Enter your date of birth`.
|
|
235
|
+
- id: label-not-question-or-instruction
|
|
236
|
+
level: must-not
|
|
237
|
+
statement: Don't write a label as a question, an instruction, or a request. The label names the field; instructions go in helper text or a placeholder.
|
|
238
|
+
example:
|
|
239
|
+
title: Examples
|
|
240
|
+
description: ❌ `What's your name?`, `Please enter your password`, `Type your email below`. ✅ `Name`, `Password`.
|
|
241
|
+
- kind: guidelines
|
|
242
|
+
for: all
|
|
243
|
+
framing: how-to-use
|
|
244
|
+
title: Placeholder copy
|
|
245
|
+
items:
|
|
246
|
+
- id: placeholder-format
|
|
247
|
+
level: should
|
|
248
|
+
statement: Lead an example placeholder with `ex:`, and don't use `ex:` for a format or a constraint. Use sentence case, and no trailing punctuation unless the example includes it.
|
|
249
|
+
example:
|
|
250
|
+
title: Examples
|
|
251
|
+
description: '✅ `ex: Jane Cooper`, `(555) 123-4567`, `Letters and numbers only`, `you@example.com`. ❌ `[Your email here]`, `example@example.com`, `Name` (restates the label).'
|
|
252
|
+
- kind: guidelines
|
|
253
|
+
for: all
|
|
254
|
+
framing: how-to-use
|
|
255
|
+
title: Helper text
|
|
256
|
+
items:
|
|
257
|
+
- id: helper-text-when-to-use
|
|
258
|
+
level: should
|
|
259
|
+
statement: Use helper text when a field has a constraint the user needs upfront, a format to match, an optional field whose purpose isn't obvious, or a choice with lasting consequences.
|
|
260
|
+
example:
|
|
261
|
+
title: Examples
|
|
262
|
+
description: ✅ `Must be at least 12 characters with one number.`, `Use the format YYYY-MM-DD.`, `We'll only contact you about urgent issues.`
|
|
263
|
+
- id: helper-text-format
|
|
264
|
+
level: should
|
|
265
|
+
statement: Write helper text as a complete sentence in sentence case, ending with a period. Keep it under 100 characters, and under 60 when possible, in plain language.
|
|
266
|
+
- id: helper-text-no-filler
|
|
267
|
+
level: should-not
|
|
268
|
+
statement: Don't write helper text that repeats the label, the placeholder, or the error, or that adds no information. Leave it out instead.
|
|
269
|
+
example:
|
|
270
|
+
title: Examples
|
|
271
|
+
description: '❌ `Enter a valid email address` under an `Email address` label, or `Enter your name` under a placeholder of `ex: Jane Cooper`.'
|
|
272
|
+
- id: helper-text-not-for-irreversible
|
|
273
|
+
level: should-not
|
|
274
|
+
statement: Don't use helper text for an irreversible decision. Use a caution callout near the action instead.
|
|
275
|
+
example:
|
|
276
|
+
title: Examples
|
|
277
|
+
description: ❌ `Choose carefully. This can't be changed later.` as helper text.
|
|
278
|
+
- kind: guidelines
|
|
279
|
+
for: all
|
|
280
|
+
framing: how-to-use
|
|
281
|
+
title: Error copy
|
|
282
|
+
items:
|
|
283
|
+
- id: error-anatomy
|
|
284
|
+
level: should
|
|
285
|
+
statement: Name the field or problem, state the cause briefly, and say what to do when action is needed.
|
|
286
|
+
example:
|
|
287
|
+
title: Examples
|
|
288
|
+
description: ✅ `Email address is missing an @ symbol. Use the format name@example.com.` ❌ `Invalid input.`, `Please correct the errors above.`, `INVALID EMAIL`.
|
|
289
|
+
- id: error-format
|
|
290
|
+
level: should
|
|
291
|
+
statement: Write error messages in sentence case, ending with a period, in two sentences at most, as the error messaging pattern sets.
|
|
292
|
+
refs:
|
|
293
|
+
- to: error-messaging
|
|
294
|
+
rel: relates-to
|
|
295
|
+
- kind: guidelines
|
|
296
|
+
for: all
|
|
297
|
+
framing: how-to-use
|
|
298
|
+
title: Empty states
|
|
299
|
+
items:
|
|
300
|
+
- id: empty-select-default
|
|
301
|
+
level: should
|
|
302
|
+
statement: When a Select or combobox has nothing chosen yet, show `Select` or `Choose an option`. Don't decorate the placeholder with `-- Select --` or `[Choose]`.
|
|
303
|
+
- id: empty-no-matches
|
|
304
|
+
level: should
|
|
305
|
+
statement: When a search has no matches, say so briefly. Echo the query back when it helps.
|
|
306
|
+
example:
|
|
307
|
+
title: Examples
|
|
308
|
+
description: ✅ `No matches found.`, `No results for "[query]".`
|
|
309
|
+
- kind: guidelines
|
|
310
|
+
for: all
|
|
311
|
+
framing: how-to-use
|
|
312
|
+
title: Button verbs
|
|
313
|
+
items:
|
|
314
|
+
- id: button-verb-matches-action
|
|
315
|
+
level: should
|
|
316
|
+
statement: 'Match the button verb to the action: `Create` for creating, `Save changes` or `Update` for editing, and a destructive verb such as `Delete`, `Remove`, or `Cancel subscription` for destructive actions.'
|
|
317
|
+
example:
|
|
318
|
+
title: Examples
|
|
319
|
+
description: ✅ `Create project`, `Save changes`, `Send invitation`. ❌ `Submit`, `OK`, `Done` (past tense, but nothing is done yet).
|
|
320
|
+
- kind: guidelines
|
|
321
|
+
for: all
|
|
322
|
+
framing: how-to-use
|
|
323
|
+
title: Voice
|
|
324
|
+
items:
|
|
325
|
+
- id: voice-direct
|
|
326
|
+
level: should
|
|
327
|
+
statement: Be direct. Write `Name`, not `Could you please tell us your name?`
|
|
328
|
+
- id: voice-plain
|
|
329
|
+
level: should
|
|
330
|
+
statement: Be plain. Write `Must be at least 12 characters`, not `Please ensure your password meets the minimum length requirements.`
|
|
331
|
+
- id: voice-specific
|
|
332
|
+
level: should
|
|
333
|
+
statement: Be specific. Write `Email address must include an @ symbol`, not `Invalid email.`
|
|
334
|
+
- id: voice-kind
|
|
335
|
+
level: must-not
|
|
336
|
+
statement: Don't blame the user, and don't apologize on the software's behalf. Say what is true and what to do next.
|
|
337
|
+
- kind: guidelines
|
|
338
|
+
for: agent
|
|
339
|
+
framing: how-to-use
|
|
340
|
+
title: Extending the patterns
|
|
341
|
+
items:
|
|
342
|
+
- id: extend-doc-for-new-form-shapes
|
|
343
|
+
level: should
|
|
344
|
+
statement: When a new form shape isn't covered here, extend this doc before writing its copy, so the next person follows a pattern rather than an invention. Route publishing to the Technical Writer.
|
|
345
|
+
- kind: section
|
|
346
|
+
for: agent
|
|
347
|
+
freeform:
|
|
348
|
+
- title: Intent
|
|
349
|
+
body: Write form copy — labels, placeholders, helper text, errors, empty states, success confirmations, and buttons — that is direct, plain, specific, and kind, and that follows the format rules for each copy type below.
|
|
350
|
+
refs:
|
|
351
|
+
- to: checkbox
|
|
352
|
+
rel: relates-to
|
|
353
|
+
- to: radio
|
|
354
|
+
rel: relates-to
|
|
355
|
+
- to: switch
|
|
356
|
+
rel: relates-to
|
|
357
|
+
- to: text-input
|
|
358
|
+
rel: relates-to
|
|
359
|
+
- to: text-area
|
|
360
|
+
rel: relates-to
|
|
361
|
+
- to: select
|
|
362
|
+
rel: relates-to
|