@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
|
@@ -2,19 +2,38 @@
|
|
|
2
2
|
list-style-type: none;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.sui-
|
|
6
|
-
.sui-
|
|
7
|
-
|
|
5
|
+
.sui-ListItem,
|
|
6
|
+
.sui-ListItemButton {
|
|
7
|
+
--list-color: var(--foreground-high);
|
|
8
|
+
--list-color-muted: var(--foreground-low);
|
|
9
|
+
/*
|
|
10
|
+
* ListItemButton uses PressArea under the hood and can hook into
|
|
11
|
+
* its variables to set Text and Icon colors
|
|
12
|
+
*/
|
|
13
|
+
--press-area-color: var(--list-color);
|
|
14
|
+
--press-area-color-muted: var(--list-color-muted);
|
|
15
|
+
color: var(--list-color);
|
|
8
16
|
}
|
|
9
17
|
|
|
10
|
-
.sui-
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
.sui-ListItemButton {
|
|
19
|
+
--background-color: transparent;
|
|
20
|
+
background: var(--background-color);
|
|
13
21
|
}
|
|
14
22
|
|
|
15
|
-
.sui-
|
|
16
|
-
|
|
17
|
-
color: var(--
|
|
23
|
+
.sui-ListItemButton:hover,
|
|
24
|
+
.sui-ListItemButton:focus-visible {
|
|
25
|
+
--background-color: var(--background-low);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.sui-ListItemButton:disabled {
|
|
29
|
+
--list-color: var(--inert-foreground);
|
|
30
|
+
--list-color-muted: var(--inert-foreground);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sui-ListItemButton[aria-current="true"] {
|
|
34
|
+
--background-color: var(--active-background-emphasized);
|
|
35
|
+
--list-color: var(--active-foreground-emphasized);
|
|
36
|
+
--list-color-muted: var(--active-background-normal);
|
|
18
37
|
}
|
|
19
38
|
|
|
20
39
|
.sui-ListItemImage {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type {ComponentProps, ReactNode, ElementType} from 'react'
|
|
2
2
|
|
|
3
3
|
import {type GapProps, gapProps} from '../../props/gap'
|
|
4
4
|
import {heightProps} from '../../props/height'
|
|
@@ -6,16 +6,20 @@ import {paddingProps} from '../../props/padding'
|
|
|
6
6
|
import {DENSITY, type Density} from '../../types/Density'
|
|
7
7
|
import type {InteractiveAs} from '../../types/Interactive'
|
|
8
8
|
import type {ListTag} from '../../types/List'
|
|
9
|
-
import
|
|
9
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
10
|
+
import type {PropDef} from '../../types/PropDef'
|
|
10
11
|
import type {Responsive} from '../../types/Responsive'
|
|
11
12
|
|
|
12
13
|
/** @beta */
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
export type ListProps<T extends ListTag = 'ul'> = Polymorphic<
|
|
15
|
+
T,
|
|
16
|
+
Pick<GapProps, 'gap'> & {
|
|
17
|
+
/**
|
|
18
|
+
* HTML element to render.
|
|
19
|
+
*/
|
|
20
|
+
as?: T
|
|
21
|
+
}
|
|
22
|
+
>
|
|
19
23
|
|
|
20
24
|
export const listProps: Record<string, PropDef> = {
|
|
21
25
|
as: {
|
|
@@ -25,22 +29,50 @@ export const listProps: Record<string, PropDef> = {
|
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
/** @beta */
|
|
28
|
-
export interface ListItemProps extends
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
export interface ListItemProps extends ComponentProps<'li'> {}
|
|
33
|
+
|
|
34
|
+
/** @beta */
|
|
35
|
+
export type ListItemButtonProps<T extends ElementType = 'button'> = Polymorphic<
|
|
36
|
+
T,
|
|
37
|
+
{
|
|
38
|
+
/**
|
|
39
|
+
* Element or component to render for the press target.
|
|
40
|
+
*/
|
|
41
|
+
as?: InteractiveAs<T>
|
|
42
|
+
/**
|
|
43
|
+
* Marks the row as the current selection.
|
|
44
|
+
*/
|
|
45
|
+
current?: boolean
|
|
46
|
+
/**
|
|
47
|
+
* Sets horizontal padding, gap, and minimum row height together.
|
|
48
|
+
*/
|
|
49
|
+
density?: Responsive<Density>
|
|
50
|
+
/**
|
|
51
|
+
* Slot at the left edge of the row.
|
|
52
|
+
*/
|
|
53
|
+
start?: ReactNode
|
|
54
|
+
/**
|
|
55
|
+
* Slot at the right edge of the row.
|
|
56
|
+
*/
|
|
57
|
+
end?: ReactNode
|
|
58
|
+
/**
|
|
59
|
+
* Main label.
|
|
60
|
+
*/
|
|
61
|
+
text?: ReactNode
|
|
62
|
+
/**
|
|
63
|
+
* Text below the title.
|
|
64
|
+
*/
|
|
65
|
+
subtext?: ReactNode
|
|
66
|
+
}
|
|
67
|
+
>
|
|
42
68
|
|
|
43
|
-
export const
|
|
69
|
+
export const listButtonProps: Record<string, PropDef> = {
|
|
70
|
+
as: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
},
|
|
73
|
+
current: {
|
|
74
|
+
type: 'boolean',
|
|
75
|
+
},
|
|
44
76
|
density: {
|
|
45
77
|
type: 'composite',
|
|
46
78
|
values: DENSITY,
|
|
@@ -77,54 +109,13 @@ export const listItemProps: Record<string, PropDef> = {
|
|
|
77
109
|
start: {
|
|
78
110
|
type: 'string',
|
|
79
111
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/** @beta */
|
|
83
|
-
export interface ListButtonItemProps<T extends React.ElementType = 'button'> extends ListItemProps {
|
|
84
|
-
/**
|
|
85
|
-
* Element or component to render for the press target.
|
|
86
|
-
*/
|
|
87
|
-
as?: InteractiveAs<T>
|
|
88
|
-
/**
|
|
89
|
-
* Marks the row as the current selection.
|
|
90
|
-
*/
|
|
91
|
-
selected?: boolean
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export const listButtonItemProps: Record<string, PropDef> = {
|
|
95
|
-
as: {
|
|
112
|
+
text: {
|
|
96
113
|
type: 'string',
|
|
97
114
|
},
|
|
98
|
-
|
|
99
|
-
type: '
|
|
115
|
+
subtext: {
|
|
116
|
+
type: 'string',
|
|
100
117
|
},
|
|
101
|
-
...listItemProps,
|
|
102
118
|
}
|
|
103
119
|
|
|
104
120
|
/** @beta */
|
|
105
|
-
export interface
|
|
106
|
-
/**
|
|
107
|
-
* HTML element to render.
|
|
108
|
-
*/
|
|
109
|
-
as?: T
|
|
110
|
-
/**
|
|
111
|
-
* Main label.
|
|
112
|
-
*/
|
|
113
|
-
title?: React.ReactNode
|
|
114
|
-
/**
|
|
115
|
-
* Text below the title.
|
|
116
|
-
*/
|
|
117
|
-
subtitle?: React.ReactNode
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export const listItemTextProps: Record<string, PropDef> = {
|
|
121
|
-
as: {
|
|
122
|
-
type: 'string',
|
|
123
|
-
},
|
|
124
|
-
title: {
|
|
125
|
-
type: 'string',
|
|
126
|
-
},
|
|
127
|
-
subtitle: {
|
|
128
|
-
type: 'string',
|
|
129
|
-
},
|
|
130
|
-
}
|
|
121
|
+
export interface ListImageProps extends ComponentProps<'img'> {}
|
|
@@ -8,10 +8,11 @@ import {renderPortal} from '../../utils/renderPortal'
|
|
|
8
8
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
9
9
|
import {type PopoverProps, popoverProps} from './popover.props'
|
|
10
10
|
|
|
11
|
-
const popoverClassName = suffixClassName('sui-
|
|
11
|
+
const popoverClassName = suffixClassName('sui-Popover')
|
|
12
12
|
|
|
13
13
|
function PopoverRoot({
|
|
14
14
|
placement = 'bottom',
|
|
15
|
+
fullBleed = false,
|
|
15
16
|
...props
|
|
16
17
|
}: PopoverProps & {
|
|
17
18
|
triggerProps?: Record<string, unknown>
|
|
@@ -26,7 +27,7 @@ function PopoverRoot({
|
|
|
26
27
|
portal,
|
|
27
28
|
triggerProps: forwardedTriggerProps,
|
|
28
29
|
...rest
|
|
29
|
-
} = getProps({placement, ...props}, popoverProps)
|
|
30
|
+
} = getProps({placement, fullBleed, ...props}, popoverProps)
|
|
30
31
|
const reactId = useId()
|
|
31
32
|
const id = idProp || reactId
|
|
32
33
|
const [open, setOpen] = useState(false)
|
|
@@ -54,7 +55,7 @@ function PopoverRoot({
|
|
|
54
55
|
<div
|
|
55
56
|
className={clsx(
|
|
56
57
|
popoverClassName,
|
|
57
|
-
'sui-
|
|
58
|
+
'sui-radius3 sui-position-fixed sui-shadow2 sui-text-body1 sui-text-trim-edge',
|
|
58
59
|
className,
|
|
59
60
|
)}
|
|
60
61
|
style={{
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
.sui-
|
|
1
|
+
.sui-Popover {
|
|
2
2
|
visibility: hidden;
|
|
3
3
|
opacity: 0;
|
|
4
4
|
scale: 0.9;
|
|
5
5
|
transition: none;
|
|
6
|
+
--popover-color: var(--foreground-high);
|
|
7
|
+
color: var(--popover-color);
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
.sui-
|
|
10
|
+
.sui-Popover:popover-open {
|
|
9
11
|
visibility: visible;
|
|
10
12
|
opacity: 1;
|
|
11
13
|
scale: 1;
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
@starting-style {
|
|
16
|
-
.sui-
|
|
18
|
+
.sui-Popover:popover-open {
|
|
17
19
|
visibility: hidden;
|
|
18
20
|
opacity: 0;
|
|
19
21
|
scale: 0.9;
|
|
@@ -1,23 +1,29 @@
|
|
|
1
|
+
import type {ComponentProps, ReactElement, ReactNode} from 'react'
|
|
2
|
+
|
|
1
3
|
import {type PlacementProps, placementProps} from '../../props/placement'
|
|
2
|
-
import
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
5
|
|
|
4
6
|
/** @beta */
|
|
5
7
|
export interface PopoverProps
|
|
6
|
-
extends Omit<
|
|
8
|
+
extends Omit<ComponentProps<'div'>, 'children' | 'content'>, PlacementProps {
|
|
7
9
|
/**
|
|
8
10
|
* Shared anchor identifier.
|
|
9
11
|
* @remarks Set the same value on a Tooltip and a Popover to point both at one trigger.
|
|
10
12
|
*/
|
|
11
|
-
anchorName?:
|
|
13
|
+
anchorName?: ReactNode
|
|
12
14
|
/**
|
|
13
15
|
* The trigger element.
|
|
14
16
|
* @remarks Popover clones it and attaches the `popovertarget` attribute that opens the floating layer.
|
|
15
17
|
*/
|
|
16
|
-
children:
|
|
18
|
+
children: ReactElement<Record<string, unknown>>
|
|
17
19
|
/**
|
|
18
20
|
* The floating content.
|
|
19
21
|
*/
|
|
20
|
-
content?:
|
|
22
|
+
content?: ReactNode
|
|
23
|
+
/**
|
|
24
|
+
* Removes popover padding.
|
|
25
|
+
*/
|
|
26
|
+
fullBleed?: boolean
|
|
21
27
|
/**
|
|
22
28
|
* Renders the content into `document.body` through a React portal instead of inline.
|
|
23
29
|
*/
|
|
@@ -31,6 +37,11 @@ export const popoverProps: Record<string, PropDef> = {
|
|
|
31
37
|
content: {
|
|
32
38
|
type: 'string',
|
|
33
39
|
},
|
|
40
|
+
fullBleed: {
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
className: 'p0',
|
|
43
|
+
inverseClassName: 'p2',
|
|
44
|
+
},
|
|
34
45
|
portal: {
|
|
35
46
|
type: 'boolean',
|
|
36
47
|
},
|
|
@@ -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,9 +8,7 @@ import {type PressAreaProps, pressAreaProps} from './pressArea.props'
|
|
|
8
8
|
const pressAreaClassName = suffixClassName('sui-PressArea')
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
|
-
export function PressArea<T extends ElementType = 'button'>(
|
|
12
|
-
props: PressAreaProps<T> & Omit<ComponentPropsWithRef<T>, keyof PressAreaProps<T>>,
|
|
13
|
-
) {
|
|
11
|
+
export function PressArea<T extends ElementType = 'button'>(props: PressAreaProps<T>) {
|
|
14
12
|
const {as, children, className, style, ...rest} = getProps(props, pressAreaProps)
|
|
15
13
|
const Component = as || 'button'
|
|
16
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.sui-PressArea {
|
|
1
|
+
:where(.sui-PressArea) {
|
|
2
2
|
background: none;
|
|
3
3
|
font: inherit;
|
|
4
4
|
color: inherit;
|
|
@@ -16,7 +16,13 @@
|
|
|
16
16
|
pointer-events: none;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.sui-PressArea .sui-Text
|
|
19
|
+
.sui-PressArea .sui-Text {
|
|
20
|
+
--press-area-color: inherit;
|
|
21
|
+
color: var(--press-area-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.sui-PressArea .sui-Text:where(.sui-text-muted),
|
|
20
25
|
.sui-PressArea [data-sanity-icon] {
|
|
21
|
-
color: inherit;
|
|
26
|
+
--press-area-color-muted: inherit;
|
|
27
|
+
color: var(--press-area-color-muted);
|
|
22
28
|
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import type {InteractiveAs} from '../../types/Interactive'
|
|
2
|
-
import
|
|
4
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
5
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
6
|
|
|
4
7
|
/** @public */
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export type PressAreaProps<T extends ElementType = 'button'> = Polymorphic<
|
|
9
|
+
T,
|
|
10
|
+
{
|
|
11
|
+
/**
|
|
12
|
+
* Element or component to render.
|
|
13
|
+
*/
|
|
14
|
+
as?: InteractiveAs<T>
|
|
15
|
+
}
|
|
16
|
+
>
|
|
11
17
|
|
|
12
18
|
export const pressAreaProps: Record<string, PropDef> = {
|
|
13
19
|
as: {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type {ComponentProps} from 'react'
|
|
2
|
+
|
|
1
3
|
import {formElementDensityProps, type FormElementDensityProps} from '../../props/formElement'
|
|
2
|
-
import
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
5
|
|
|
4
6
|
/** @public */
|
|
5
|
-
export interface SelectProps extends
|
|
7
|
+
export interface SelectProps extends ComponentProps<'select'>, FormElementDensityProps {
|
|
6
8
|
/**
|
|
7
9
|
* Used to trigger styling for invalid states.
|
|
8
10
|
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
@@ -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 SkipToContentProps extends
|
|
6
|
+
export interface SkipToContentProps extends ComponentProps<'a'> {
|
|
5
7
|
/**
|
|
6
8
|
* Same-page fragment to jump to.
|
|
7
9
|
* @remarks Note: The hash character # is required for proper linking.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type {ComponentProps} from 'react'
|
|
2
|
+
|
|
1
3
|
import {ICON_SIZE, type IconSize} from '../../types/Icon'
|
|
2
|
-
import
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
5
|
import type {Responsive} from '../../types/Responsive'
|
|
4
6
|
|
|
5
7
|
/** @public */
|
|
6
|
-
export interface SpinnerProps extends
|
|
8
|
+
export interface SpinnerProps extends ComponentProps<'svg'> {
|
|
7
9
|
/**
|
|
8
10
|
* Size of the spinner icon.
|
|
9
11
|
*/
|
|
@@ -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 SwitchProps extends
|
|
6
|
+
export interface SwitchProps extends ComponentProps<'input'> {
|
|
5
7
|
/**
|
|
6
8
|
* Applies error styling to the switch track for invalid states.
|
|
7
9
|
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type {ComponentProps, ReactNode, ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import type {LayoutProps} from '../../props/layout'
|
|
2
4
|
import {toneProps, type ToneProps} from '../../props/tone'
|
|
3
|
-
import
|
|
5
|
+
import type {PropDef} from '../../types/PropDef'
|
|
4
6
|
|
|
5
7
|
/** @public */
|
|
6
|
-
export interface TabsProps extends
|
|
8
|
+
export interface TabsProps extends ComponentProps<'div'> {
|
|
7
9
|
/** The `value` of the active Tabs.Tab */
|
|
8
10
|
value: string
|
|
9
11
|
/** An updater function to set `value` - will be invoked with the `value` of the selected Tabs.Tab */
|
|
@@ -22,17 +24,15 @@ type TabsListLabelProps =
|
|
|
22
24
|
| {'aria-label': string; 'aria-labelledby'?: never}
|
|
23
25
|
|
|
24
26
|
/** @public */
|
|
25
|
-
export type TabsListProps = Omit<
|
|
27
|
+
export type TabsListProps = Omit<ComponentProps<'div'>, 'id' | 'role'> & TabsListLabelProps
|
|
26
28
|
|
|
27
29
|
export const tabsListProps: Record<string, PropDef> = {}
|
|
28
30
|
|
|
29
31
|
/** @public */
|
|
30
32
|
export interface TabProps
|
|
31
|
-
extends
|
|
32
|
-
Omit<React.ComponentProps<'button'>, 'aria-disabled' | 'disabled' | 'id' | 'role'>,
|
|
33
|
-
ToneProps {
|
|
33
|
+
extends Omit<ComponentProps<'button'>, 'aria-disabled' | 'disabled' | 'id' | 'role'>, ToneProps {
|
|
34
34
|
/** Optional icon for the tab */
|
|
35
|
-
icon?:
|
|
35
|
+
icon?: ElementType | ReactNode
|
|
36
36
|
/** Text label to display in the tab */
|
|
37
37
|
label: string
|
|
38
38
|
/** Unique string used to identify this tab and its matching Tabs.Panel */
|
|
@@ -53,8 +53,7 @@ export const tabProps: Record<string, PropDef> = {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/** @public */
|
|
56
|
-
export interface TabsPanelProps
|
|
57
|
-
extends Omit<React.ComponentProps<'div'>, 'id' | 'role'>, LayoutProps {
|
|
56
|
+
export interface TabsPanelProps extends Omit<ComponentProps<'div'>, 'id' | 'role'>, LayoutProps {
|
|
58
57
|
/** Unique string used to identify this panel and its matching Tabs.Tab */
|
|
59
58
|
value: string
|
|
60
59
|
}
|
|
@@ -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 TextProps, textProps} from './text.props'
|
|
|
8
8
|
const textClassName = suffixClassName('sui-Text')
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
|
-
export function Text<T extends ElementType = 'span'>({
|
|
12
|
-
size = 2,
|
|
13
|
-
...props
|
|
14
|
-
}: TextProps<T> & Omit<ComponentPropsWithRef<T>, keyof TextProps<T>>) {
|
|
11
|
+
export function Text<T extends ElementType = 'span'>({size = 2, ...props}: TextProps<T>) {
|
|
15
12
|
const {as, children, className, style, ...rest} = getProps({size, ...props}, textProps)
|
|
16
13
|
const Component = as || 'span'
|
|
17
14
|
|
|
@@ -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
|
-
import
|
|
6
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
7
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
8
|
import type {Responsive} from '../../types/Responsive'
|
|
4
9
|
import {TEXT_SIZE, type TextSize} from '../../types/Text'
|
|
5
10
|
|
|
6
11
|
/** @public */
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export type TextProps<T extends ElementType = 'span'> = Polymorphic<
|
|
13
|
+
T,
|
|
14
|
+
MarginProps &
|
|
15
|
+
ToneProps &
|
|
16
|
+
TypographyProps & {
|
|
17
|
+
/**
|
|
18
|
+
* HTML element to render.
|
|
19
|
+
*/
|
|
20
|
+
as?: T
|
|
21
|
+
/**
|
|
22
|
+
* Sets font size.
|
|
23
|
+
*/
|
|
24
|
+
size?: Responsive<TextSize>
|
|
25
|
+
}
|
|
26
|
+
>
|
|
17
27
|
|
|
18
28
|
export const textProps: Record<string, PropDef> = {
|
|
19
29
|
as: {
|
|
@@ -24,5 +34,7 @@ export const textProps: Record<string, PropDef> = {
|
|
|
24
34
|
className: 'text-body',
|
|
25
35
|
values: TEXT_SIZE,
|
|
26
36
|
},
|
|
37
|
+
...marginProps,
|
|
38
|
+
...toneProps,
|
|
27
39
|
...typographyProps,
|
|
28
40
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import type {ComponentProps} from 'react'
|
|
2
|
+
|
|
1
3
|
import {formElementDensityProps, type FormElementDensityProps} from '../../props/formElement'
|
|
2
4
|
import {type HeightProps, heightProps} from '../../props/height'
|
|
3
|
-
import
|
|
5
|
+
import type {PropDef} from '../../types/PropDef'
|
|
4
6
|
|
|
5
7
|
/** @public */
|
|
6
8
|
export interface TextAreaProps
|
|
7
|
-
extends
|
|
8
|
-
React.ComponentProps<'textarea'>,
|
|
9
|
-
FormElementDensityProps,
|
|
10
|
-
Pick<HeightProps, 'maxHeight'> {
|
|
9
|
+
extends ComponentProps<'textarea'>, FormElementDensityProps, Pick<HeightProps, 'maxHeight'> {
|
|
11
10
|
/**
|
|
12
11
|
* Sizes the textarea to its content via the CSS `field-sizing` property.
|
|
13
12
|
*/
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type {ComponentProps, HTMLInputTypeAttribute} from 'react'
|
|
2
|
+
|
|
1
3
|
import {formElementDensityProps, type FormElementDensityProps} from '../../props/formElement'
|
|
2
|
-
import
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
5
|
|
|
4
6
|
export const TEXT_INPUT_EXCLUDED_TYPES = [
|
|
5
7
|
'button',
|
|
@@ -18,11 +20,11 @@ export const TEXT_INPUT_EXCLUDED_TYPES = [
|
|
|
18
20
|
export type TextInputExcludedTypes = (typeof TEXT_INPUT_EXCLUDED_TYPES)[number]
|
|
19
21
|
|
|
20
22
|
/** @public */
|
|
21
|
-
export type TextInputType = Exclude<
|
|
23
|
+
export type TextInputType = Exclude<HTMLInputTypeAttribute, TextInputExcludedTypes>
|
|
22
24
|
|
|
23
25
|
/** @public */
|
|
24
26
|
export interface TextInputProps
|
|
25
|
-
extends Omit<
|
|
27
|
+
extends Omit<ComponentProps<'input'>, 'type'>, FormElementDensityProps {
|
|
26
28
|
/**
|
|
27
29
|
* Used to trigger styling for invalid states.
|
|
28
30
|
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import type {ComponentProps, ReactElement, ReactNode} from 'react'
|
|
2
|
+
|
|
1
3
|
import {type PlacementProps, placementProps} from '../../props/placement'
|
|
2
|
-
import
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
5
|
|
|
4
6
|
/** @beta */
|
|
5
7
|
export interface TooltipProps
|
|
6
|
-
extends Omit<
|
|
8
|
+
extends Omit<ComponentProps<'div'>, 'children' | 'content'>, PlacementProps {
|
|
7
9
|
/**
|
|
8
10
|
* Shared anchor identifier.
|
|
9
11
|
*/
|
|
10
|
-
anchorName?:
|
|
12
|
+
anchorName?: ReactNode
|
|
11
13
|
/**
|
|
12
14
|
* The trigger element.
|
|
13
15
|
*/
|
|
14
|
-
children:
|
|
16
|
+
children: ReactElement<Record<string, unknown>>
|
|
15
17
|
/**
|
|
16
18
|
* The tooltip label.
|
|
17
19
|
*/
|
|
18
|
-
content?:
|
|
20
|
+
content?: ReactNode
|
|
19
21
|
/**
|
|
20
22
|
* Renders the label into `document.body` through a React portal instead of inline.
|
|
21
23
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import {type
|
|
2
|
+
import {type ElementType, useRef, useState} from 'react'
|
|
3
3
|
|
|
4
4
|
import {getProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -8,9 +8,7 @@ import {type TooltipGroupProps, tooltipGroupProps} from './tooltipGroup.props'
|
|
|
8
8
|
const tooltipGroupClassName = suffixClassName('sui-TooltipGroup')
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
|
-
export function TooltipGroup<T extends ElementType = 'div'>(
|
|
12
|
-
props: TooltipGroupProps<T> & Omit<ComponentPropsWithRef<T>, keyof TooltipGroupProps<T>>,
|
|
13
|
-
) {
|
|
11
|
+
export function TooltipGroup<T extends ElementType = 'div'>(props: TooltipGroupProps<T>) {
|
|
14
12
|
const {as, children, className, style, ...rest} = getProps(props, tooltipGroupProps)
|
|
15
13
|
const Component = as || 'div'
|
|
16
14
|
const ref = useRef<HTMLElement>(null)
|