@sanity/ui 5.0.0-alpha.23 → 5.0.0-alpha.25
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 +147 -147
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +139 -157
- 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/avatar/avatar.props.ts +4 -2
- package/src/components/avatar-counter/avatarCounter.props.ts +4 -2
- package/src/components/avatar-stack/avatarStack.props.ts +4 -2
- package/src/components/badge/Badge.tsx +2 -5
- package/src/components/badge/badge.props.ts +15 -15
- package/src/components/box/Box.tsx +2 -5
- package/src/components/box/box.props.ts +18 -12
- package/src/components/button/Button.tsx +16 -5
- package/src/components/button/button.css +23 -25
- package/src/components/button/button.props.ts +49 -39
- package/src/components/card/Card.tsx +2 -2
- package/src/components/card/card.props.ts +19 -13
- package/src/components/checkbox/checkbox.props.ts +4 -2
- package/src/components/code/code.props.ts +8 -5
- package/src/components/container/Container.tsx +2 -2
- package/src/components/container/container.props.ts +17 -11
- package/src/components/dialog/Dialog.tsx +10 -5
- package/src/components/dialog/dialog.props.ts +11 -3
- package/src/components/divider/divider.props.ts +4 -2
- package/src/components/eyebrow/Eyebrow.tsx +10 -8
- package/src/components/eyebrow/eyebrow.props.ts +27 -12
- package/src/components/flex/Flex.tsx +2 -5
- package/src/components/flex/flex.props.ts +19 -12
- package/src/components/grid/Grid.tsx +2 -5
- package/src/components/grid/grid.props.ts +20 -16
- package/src/components/h-stack/HStack.tsx +2 -5
- package/src/components/h-stack/hStack.props.ts +7 -4
- package/src/components/heading/Heading.tsx +3 -6
- package/src/components/heading/heading.props.ts +20 -14
- package/src/components/hotkeys/hotkeys.props.ts +4 -2
- package/src/components/icon/icon.props.ts +3 -3
- package/src/components/icon-button/IconButton.tsx +2 -4
- package/src/components/icon-button/iconButton.props.ts +17 -17
- package/src/components/indicator/Indicator.tsx +2 -2
- package/src/components/indicator/indicator.props.ts +17 -11
- package/src/components/indicator-stack/IndicatorStack.tsx +2 -4
- package/src/components/indicator-stack/indicatorStack.props.ts +13 -7
- package/src/components/inline/Inline.tsx +2 -2
- package/src/components/inline/inline.props.ts +17 -11
- package/src/components/kbd/kbd.props.ts +4 -2
- package/src/components/link/link.props.ts +4 -2
- package/src/components/list/List.tsx +47 -97
- package/src/components/list/list.css +28 -9
- package/src/components/list/list.props.ts +59 -68
- package/src/components/popover/Popover.tsx +4 -3
- package/src/components/popover/popover.css +5 -3
- package/src/components/popover/popover.props.ts +16 -5
- package/src/components/press-area/PressArea.tsx +2 -4
- package/src/components/press-area/press-area.css +9 -3
- package/src/components/press-area/pressArea.props.ts +13 -7
- package/src/components/radio/radio.props.ts +2 -1
- package/src/components/select/select.props.ts +4 -2
- package/src/components/skip-to-content/skipToContent.props.ts +4 -2
- package/src/components/spinner/spinner.props.ts +4 -2
- package/src/components/switch/switch.props.ts +4 -2
- package/src/components/tabs/tabs.props.ts +8 -9
- package/src/components/text/Text.tsx +2 -5
- package/src/components/text/text.props.ts +23 -11
- package/src/components/text-area/textArea.props.ts +4 -5
- package/src/components/text-input/textInput.props.ts +5 -3
- package/src/components/tooltip/tooltip.props.ts +7 -5
- package/src/components/tooltip-group/TooltipGroup.tsx +2 -4
- package/src/components/tooltip-group/tooltipGroup.props.ts +13 -7
- package/src/components/v-stack/VStack.tsx +2 -5
- package/src/components/v-stack/vStack.props.ts +7 -4
- package/src/components/visually-hidden/VisuallyHidden.tsx +2 -4
- package/src/components/visually-hidden/visuallyHidden.props.ts +17 -11
- 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/types/Interactive.ts +3 -1
- package/src/types/Polymorphic.ts +9 -0
- 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
|
@@ -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
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type {ReactNode, ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import {gapProps} from '../../props/gap'
|
|
2
4
|
import {heightProps} from '../../props/height'
|
|
3
5
|
import {paddingProps} from '../../props/padding'
|
|
@@ -11,48 +13,56 @@ import {
|
|
|
11
13
|
type ButtonTone,
|
|
12
14
|
} from '../../types/Button'
|
|
13
15
|
import type {InteractiveAs} from '../../types/Interactive'
|
|
14
|
-
import
|
|
16
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
17
|
+
import type {PropDef} from '../../types/PropDef'
|
|
15
18
|
import type {Responsive} from '../../types/Responsive'
|
|
16
19
|
|
|
17
20
|
/** @public */
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
21
|
+
export type ButtonProps<T extends ElementType = 'button'> = Polymorphic<
|
|
22
|
+
T,
|
|
23
|
+
{
|
|
24
|
+
/**
|
|
25
|
+
* HTML element to render.
|
|
26
|
+
*/
|
|
27
|
+
as?: InteractiveAs<T>
|
|
28
|
+
/**
|
|
29
|
+
* Sets padding and gap together to specify size.
|
|
30
|
+
*/
|
|
31
|
+
density?: ButtonDensity
|
|
32
|
+
/**
|
|
33
|
+
* Sets Button to fill the width of its container.
|
|
34
|
+
*/
|
|
35
|
+
fullWidth?: Responsive<boolean>
|
|
36
|
+
/**
|
|
37
|
+
* Shows an icon in the start position (left side in left-to-right languages).
|
|
38
|
+
*/
|
|
39
|
+
iconStart?: ElementType | ReactNode
|
|
40
|
+
/**
|
|
41
|
+
* Shows an icon in the end position (right side in left-to-right languages).
|
|
42
|
+
*/
|
|
43
|
+
iconEnd?: ElementType | ReactNode
|
|
44
|
+
/**
|
|
45
|
+
* Sets the importance of Button's action.
|
|
46
|
+
*/
|
|
47
|
+
level?: ButtonLevel
|
|
48
|
+
/**
|
|
49
|
+
* Places Button into a loading state.
|
|
50
|
+
*/
|
|
51
|
+
loading?: boolean
|
|
52
|
+
/**
|
|
53
|
+
* Visually styles the button in a pressed state, and sets aria-pressed to the provided value
|
|
54
|
+
*/
|
|
55
|
+
pressed?: boolean
|
|
56
|
+
/**
|
|
57
|
+
* Sets Button's text label.
|
|
58
|
+
*/
|
|
59
|
+
text?: string
|
|
60
|
+
/**
|
|
61
|
+
* Sets Button's semantic meaning and related color.
|
|
62
|
+
*/
|
|
63
|
+
tone?: ButtonTone
|
|
64
|
+
}
|
|
65
|
+
>
|
|
56
66
|
|
|
57
67
|
export const buttonProps: Record<string, PropDef> = {
|
|
58
68
|
as: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import type {
|
|
2
|
+
import type {ElementType} from 'react'
|
|
3
3
|
|
|
4
4
|
import {getProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -12,7 +12,7 @@ export function Card<T extends ElementType = 'div'>({
|
|
|
12
12
|
density = 'regular',
|
|
13
13
|
tone = 'default',
|
|
14
14
|
...props
|
|
15
|
-
}: CardProps<T>
|
|
15
|
+
}: CardProps<T>) {
|
|
16
16
|
const {as, children, className, style, ...rest} = getProps({density, tone, ...props}, cardProps)
|
|
17
17
|
const Component = as || 'div'
|
|
18
18
|
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import {borderProps} from '../../props/border'
|
|
2
4
|
import {gapProps} from '../../props/gap'
|
|
3
5
|
import {type MarginProps, marginProps} from '../../props/margin'
|
|
4
6
|
import {paddingProps} from '../../props/padding'
|
|
5
7
|
import {toneWithDefaultProps, type ToneWithDefaultProps} from '../../props/tone'
|
|
6
8
|
import {DENSITY, type Density} from '../../types/Density'
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
10
|
+
import type {PropDef} from '../../types/PropDef'
|
|
11
|
+
import type {Responsive} from '../../types/Responsive'
|
|
9
12
|
|
|
10
13
|
/** @public */
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
export type CardProps<T extends ElementType = 'div'> = Polymorphic<
|
|
15
|
+
T,
|
|
16
|
+
MarginProps &
|
|
17
|
+
ToneWithDefaultProps & {
|
|
18
|
+
/**
|
|
19
|
+
* HTML element or component to render.
|
|
20
|
+
*/
|
|
21
|
+
as?: T
|
|
22
|
+
/**
|
|
23
|
+
* Sets padding, gap, and border-radius together to specify size. This prop is used in place of separate `padding`, `gap`, and `border-radius` props.
|
|
24
|
+
*/
|
|
25
|
+
density?: Responsive<Density>
|
|
26
|
+
}
|
|
27
|
+
>
|
|
22
28
|
|
|
23
29
|
export const cardProps: Record<string, PropDef> = {
|
|
24
30
|
as: {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type {ComponentProps} from 'react'
|
|
2
|
+
|
|
3
|
+
import type {PropDef} from '../../types/PropDef'
|
|
2
4
|
|
|
3
5
|
/** @beta */
|
|
4
|
-
export interface CheckboxProps extends
|
|
6
|
+
export interface CheckboxProps extends ComponentProps<'input'> {
|
|
5
7
|
/**
|
|
6
8
|
* Applies error styling to the checkbox mark for invalid states.
|
|
7
9
|
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {ComponentPropsWithRef} from 'react'
|
|
2
|
+
|
|
3
|
+
import {marginProps, type MarginProps} from '../../props/margin'
|
|
2
4
|
import {type TypographyProps, typographyProps} from '../../props/typography'
|
|
3
5
|
import {CODE_SIZE, type CodeSize} from '../../types/Code'
|
|
4
|
-
import
|
|
6
|
+
import type {PropDef} from '../../types/PropDef'
|
|
5
7
|
import type {Responsive} from '../../types/Responsive'
|
|
6
8
|
|
|
7
|
-
interface CodeBaseProps
|
|
9
|
+
interface CodeBaseProps
|
|
10
|
+
extends MarginProps, Omit<TypographyProps, 'align' | 'truncate' | 'weight'> {
|
|
8
11
|
/**
|
|
9
12
|
* Refractor language for syntax highlighting.
|
|
10
13
|
*/
|
|
@@ -23,10 +26,10 @@ export type CodeProps =
|
|
|
23
26
|
* @remarks Block code is wrapped in a `<pre>` tag.
|
|
24
27
|
*/
|
|
25
28
|
inline?: false
|
|
26
|
-
} & Omit<
|
|
29
|
+
} & Omit<ComponentPropsWithRef<'pre'>, keyof CodeBaseProps>)
|
|
27
30
|
| (CodeBaseProps & {
|
|
28
31
|
inline: true
|
|
29
|
-
} & Omit<
|
|
32
|
+
} & Omit<ComponentPropsWithRef<'span'>, keyof CodeBaseProps>)
|
|
30
33
|
|
|
31
34
|
export const codeProps: Record<string, PropDef> = {
|
|
32
35
|
inline: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import type {
|
|
2
|
+
import type {ElementType} from 'react'
|
|
3
3
|
|
|
4
4
|
import {getProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -12,7 +12,7 @@ export function Container<T extends ElementType = 'div'>({
|
|
|
12
12
|
marginX = 'auto',
|
|
13
13
|
size = 2,
|
|
14
14
|
...props
|
|
15
|
-
}: ContainerProps<T>
|
|
15
|
+
}: ContainerProps<T>) {
|
|
16
16
|
const {as, children, className, style, ...rest} = getProps(
|
|
17
17
|
{marginX, size, ...props},
|
|
18
18
|
containerProps,
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import {type LayoutProps, layoutProps} from '../../props/layout'
|
|
2
4
|
import {CONTAINER_SIZE, type ContainerSize} from '../../types/Container'
|
|
3
|
-
import
|
|
5
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
6
|
+
import type {PropDef} from '../../types/PropDef'
|
|
4
7
|
import type {Responsive} from '../../types/Responsive'
|
|
5
8
|
|
|
6
9
|
/** @public */
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export type ContainerProps<T extends ElementType = 'div'> = Polymorphic<
|
|
11
|
+
T,
|
|
12
|
+
LayoutProps & {
|
|
13
|
+
/**
|
|
14
|
+
* HTML element or component to render.
|
|
15
|
+
*/
|
|
16
|
+
as?: T
|
|
17
|
+
/**
|
|
18
|
+
* Maximum width of the container.
|
|
19
|
+
*/
|
|
20
|
+
size?: Responsive<ContainerSize>
|
|
21
|
+
}
|
|
22
|
+
>
|
|
17
23
|
|
|
18
24
|
export const containerProps: Record<string, PropDef> = {
|
|
19
25
|
as: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {CloseIcon} from '@sanity/icons/Close'
|
|
2
2
|
import clsx from 'clsx'
|
|
3
|
-
import {
|
|
3
|
+
import {useEffect, useId, useRef} from 'react'
|
|
4
4
|
|
|
5
5
|
import {getProps} from '../../utils/getProps'
|
|
6
6
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -8,7 +8,12 @@ import {Box} from '../box/Box'
|
|
|
8
8
|
import {Flex} from '../flex/Flex'
|
|
9
9
|
import {Heading} from '../heading/Heading'
|
|
10
10
|
import {IconButton} from '../icon-button/IconButton'
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
type DialogContentProps,
|
|
13
|
+
type DialogFooterProps,
|
|
14
|
+
type DialogProps,
|
|
15
|
+
dialogProps,
|
|
16
|
+
} from './dialog.props'
|
|
12
17
|
|
|
13
18
|
const dialogClassName = suffixClassName('sui-Dialog')
|
|
14
19
|
const dialogContentClassName = suffixClassName('sui-DialogContent')
|
|
@@ -84,7 +89,7 @@ function DialogRoot({open = false, size = 0, ...props}: DialogProps) {
|
|
|
84
89
|
)
|
|
85
90
|
}
|
|
86
91
|
|
|
87
|
-
function DialogContent(props:
|
|
92
|
+
function DialogContent(props: DialogContentProps) {
|
|
88
93
|
const {children, className, style, ...rest} = getProps(props, {})
|
|
89
94
|
|
|
90
95
|
return (
|
|
@@ -101,7 +106,7 @@ function DialogContent(props: ComponentProps<'div'>) {
|
|
|
101
106
|
)
|
|
102
107
|
}
|
|
103
108
|
|
|
104
|
-
function DialogFooter(props:
|
|
109
|
+
function DialogFooter(props: DialogFooterProps) {
|
|
105
110
|
const {children, className, style, ...rest} = getProps(props, {})
|
|
106
111
|
|
|
107
112
|
return (
|
|
@@ -136,4 +141,4 @@ export const Dialog = DialogRoot
|
|
|
136
141
|
DialogRoot.Content = DialogContent
|
|
137
142
|
DialogRoot.Footer = DialogFooter
|
|
138
143
|
|
|
139
|
-
export type {DialogProps}
|
|
144
|
+
export type {DialogProps, DialogContentProps, DialogFooterProps}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type {ComponentProps, ReactEventHandler} from 'react'
|
|
2
|
+
|
|
1
3
|
import {CONTAINER_SIZE, type ContainerSize} from '../../types/Container'
|
|
2
|
-
import
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
5
|
import type {Responsive} from '../../types/Responsive'
|
|
4
6
|
|
|
5
7
|
/** @beta */
|
|
6
|
-
export interface DialogProps extends Omit<
|
|
8
|
+
export interface DialogProps extends Omit<ComponentProps<'dialog'>, 'open'> {
|
|
7
9
|
/**
|
|
8
10
|
* Text for the dialog heading.
|
|
9
11
|
* @remarks Recommended for accessibility. The component sets `aria-labelledby` to the heading when you give this prop.
|
|
@@ -13,7 +15,7 @@ export interface DialogProps extends Omit<React.ComponentProps<'dialog'>, 'open'
|
|
|
13
15
|
* A function to call alongside the native `close` event.
|
|
14
16
|
* @remarks Use it to set `open` back to `false`. It runs for every close cause: the Escape key, a backdrop click, the close button, or a programmatic close.
|
|
15
17
|
*/
|
|
16
|
-
onClose:
|
|
18
|
+
onClose: ReactEventHandler<HTMLDialogElement>
|
|
17
19
|
/**
|
|
18
20
|
* Toggles the dialog's open state.
|
|
19
21
|
* @remarks `true` calls `showModal()` on the element. `false` calls `close()`.
|
|
@@ -43,3 +45,9 @@ export const dialogProps: Record<string, PropDef> = {
|
|
|
43
45
|
variable: '--top-anchor',
|
|
44
46
|
},
|
|
45
47
|
}
|
|
48
|
+
|
|
49
|
+
/** @beta */
|
|
50
|
+
export interface DialogContentProps extends ComponentProps<'div'> {}
|
|
51
|
+
|
|
52
|
+
/** @beta */
|
|
53
|
+
export interface DialogFooterProps extends ComponentProps<'div'> {}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type {ComponentProps} from 'react'
|
|
2
|
+
|
|
1
3
|
import {type MarginProps, marginProps} from '../../props/margin'
|
|
2
|
-
import
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
5
|
|
|
4
6
|
/** @public */
|
|
5
|
-
export interface DividerProps extends
|
|
7
|
+
export interface DividerProps extends ComponentProps<'hr'>, MarginProps {}
|
|
6
8
|
|
|
7
9
|
export const dividerProps: Record<string, PropDef> = {
|
|
8
10
|
...marginProps,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import type {
|
|
2
|
+
import type {ElementType} from 'react'
|
|
3
3
|
|
|
4
4
|
import {getProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -8,12 +8,8 @@ import {type EyebrowProps, eyebrowProps} from './eyebrow.props'
|
|
|
8
8
|
const eyebrowClassName = suffixClassName('sui-Eyebrow')
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
|
-
export function Eyebrow<T extends ElementType = 'span'>({
|
|
12
|
-
|
|
13
|
-
weight = 'semibold',
|
|
14
|
-
...props
|
|
15
|
-
}: EyebrowProps<T> & Omit<ComponentPropsWithRef<T>, keyof EyebrowProps<T>>) {
|
|
16
|
-
const {as, children, className, style, ...rest} = getProps({size, weight, ...props}, eyebrowProps)
|
|
11
|
+
export function Eyebrow<T extends ElementType = 'span'>({size = 2, ...props}: EyebrowProps<T>) {
|
|
12
|
+
const {as, children, className, style, ...rest} = getProps({size, ...props}, eyebrowProps)
|
|
17
13
|
const Component = as || 'span'
|
|
18
14
|
|
|
19
15
|
if (props.truncate && props.trim) {
|
|
@@ -22,6 +18,7 @@ export function Eyebrow<T extends ElementType = 'span'>({
|
|
|
22
18
|
className={clsx(
|
|
23
19
|
eyebrowClassName,
|
|
24
20
|
className?.replace('sui-line-clamp', '').replace('sui-text-overflow', ''),
|
|
21
|
+
'sui-weight-semibold',
|
|
25
22
|
)}
|
|
26
23
|
style={style}
|
|
27
24
|
data-ui="Eyebrow"
|
|
@@ -41,7 +38,12 @@ export function Eyebrow<T extends ElementType = 'span'>({
|
|
|
41
38
|
|
|
42
39
|
return (
|
|
43
40
|
<Component
|
|
44
|
-
className={clsx(
|
|
41
|
+
className={clsx(
|
|
42
|
+
eyebrowClassName,
|
|
43
|
+
props.truncate && 'sui-overflow-hidden',
|
|
44
|
+
'sui-weight-semibold',
|
|
45
|
+
className,
|
|
46
|
+
)}
|
|
45
47
|
style={style}
|
|
46
48
|
data-ui="Eyebrow"
|
|
47
49
|
{...rest}
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
3
|
+
import {marginProps, type MarginProps} from '../../props/margin'
|
|
4
|
+
import {toneProps, type ToneProps} from '../../props/tone'
|
|
1
5
|
import {type TypographyProps, typographyProps} from '../../props/typography'
|
|
2
6
|
import {EYEBROW_SIZE, type EyebrowSize} from '../../types/Eyebrow'
|
|
3
|
-
import
|
|
7
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
8
|
+
import type {PropDef} from '../../types/PropDef'
|
|
4
9
|
import type {Responsive} from '../../types/Responsive'
|
|
5
10
|
|
|
6
11
|
/** @public */
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export type EyebrowProps<T extends ElementType = 'span'> = Polymorphic<
|
|
13
|
+
T,
|
|
14
|
+
MarginProps &
|
|
15
|
+
ToneProps &
|
|
16
|
+
Omit<TypographyProps, 'weight'> & {
|
|
17
|
+
/**
|
|
18
|
+
* HTML element to render.
|
|
19
|
+
*/
|
|
20
|
+
as?: T
|
|
21
|
+
/**
|
|
22
|
+
* Sets font size. Uses the same scale as Label.
|
|
23
|
+
*/
|
|
24
|
+
size?: Responsive<EyebrowSize>
|
|
25
|
+
}
|
|
26
|
+
>
|
|
17
27
|
|
|
18
28
|
export const eyebrowProps: Record<string, PropDef> = {
|
|
19
29
|
as: {
|
|
@@ -24,5 +34,10 @@ export const eyebrowProps: Record<string, PropDef> = {
|
|
|
24
34
|
className: 'text-eyebrow',
|
|
25
35
|
values: EYEBROW_SIZE,
|
|
26
36
|
},
|
|
27
|
-
|
|
37
|
+
muted: typographyProps['muted'] as PropDef,
|
|
38
|
+
align: typographyProps['align'] as PropDef,
|
|
39
|
+
trim: typographyProps['trim'] as PropDef,
|
|
40
|
+
truncate: typographyProps['truncate'] as PropDef,
|
|
41
|
+
...marginProps,
|
|
42
|
+
...toneProps,
|
|
28
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import type {
|
|
2
|
+
import type {ElementType} from 'react'
|
|
3
3
|
|
|
4
4
|
import {getProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -8,10 +8,7 @@ import {type FlexProps, flexProps} from './flex.props'
|
|
|
8
8
|
const flexClassName = suffixClassName('sui-Flex')
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
|
-
export function Flex<T extends ElementType = 'div'>({
|
|
12
|
-
display = 'flex',
|
|
13
|
-
...props
|
|
14
|
-
}: FlexProps<T> & Omit<ComponentPropsWithRef<T>, keyof FlexProps<T>>) {
|
|
11
|
+
export function Flex<T extends ElementType = 'div'>({display = 'flex', ...props}: FlexProps<T>) {
|
|
15
12
|
const {as, children, className, style, ...rest} = getProps({display, ...props}, flexProps)
|
|
16
13
|
const Component = as || 'div'
|
|
17
14
|
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import {type FlexParentProps, flexParentProps} from '../../props/flexParent'
|
|
2
4
|
import {type GapProps, gapProps} from '../../props/gap'
|
|
3
5
|
import {type LayoutProps, layoutProps} from '../../props/layout'
|
|
4
6
|
import {DISPLAY_FLEX, type DisplayFlex} from '../../types/Display'
|
|
5
|
-
import
|
|
7
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
8
|
+
import type {PropDef} from '../../types/PropDef'
|
|
6
9
|
import type {Responsive} from '../../types/Responsive'
|
|
7
10
|
|
|
8
11
|
/** @public */
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
export type FlexProps<T extends ElementType = 'div'> = Polymorphic<
|
|
13
|
+
T,
|
|
14
|
+
FlexParentProps &
|
|
15
|
+
GapProps &
|
|
16
|
+
LayoutProps & {
|
|
17
|
+
/**
|
|
18
|
+
* HTML element or component to render.
|
|
19
|
+
*/
|
|
20
|
+
as?: T
|
|
21
|
+
/**
|
|
22
|
+
* CSS `display` property.
|
|
23
|
+
*/
|
|
24
|
+
display?: Responsive<DisplayFlex>
|
|
25
|
+
}
|
|
26
|
+
>
|
|
20
27
|
|
|
21
28
|
export const flexProps: Record<string, PropDef> = {
|
|
22
29
|
as: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import type {
|
|
2
|
+
import type {ElementType} from 'react'
|
|
3
3
|
|
|
4
4
|
import {getProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -8,10 +8,7 @@ import {type GridProps, gridProps} from './grid.props'
|
|
|
8
8
|
const gridClassName = suffixClassName('sui-Grid')
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
|
-
export function Grid<T extends ElementType = 'div'>({
|
|
12
|
-
display = 'grid',
|
|
13
|
-
...props
|
|
14
|
-
}: GridProps<T> & Omit<ComponentPropsWithRef<T>, keyof GridProps<T>>) {
|
|
11
|
+
export function Grid<T extends ElementType = 'div'>({display = 'grid', ...props}: GridProps<T>) {
|
|
15
12
|
const {as, children, className, style, ...rest} = getProps({display, ...props}, gridProps)
|
|
16
13
|
const Component = as || 'div'
|
|
17
14
|
|