@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
|
@@ -1,27 +1,31 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import {flexParentProps, type FlexParentProps} from '../../props/flexParent'
|
|
2
4
|
import {type GapProps, gapProps} from '../../props/gap'
|
|
3
5
|
import {type GridParentProps, gridParentProps} from '../../props/gridParent'
|
|
4
6
|
import {type LayoutProps, layoutProps} from '../../props/layout'
|
|
5
7
|
import {DISPLAY_GRID, type DisplayGrid} from '../../types/Display'
|
|
6
|
-
import
|
|
8
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
9
|
+
import type {PropDef} from '../../types/PropDef'
|
|
7
10
|
import type {Responsive} from '../../types/Responsive'
|
|
8
11
|
|
|
9
12
|
/** @public */
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
GridParentProps
|
|
14
|
-
GapProps
|
|
15
|
-
LayoutProps {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
13
|
+
export type GridProps<T extends ElementType = 'div'> = Polymorphic<
|
|
14
|
+
T,
|
|
15
|
+
Pick<FlexParentProps, 'alignItems' | 'justifyContent'> &
|
|
16
|
+
GridParentProps &
|
|
17
|
+
GapProps &
|
|
18
|
+
LayoutProps & {
|
|
19
|
+
/**
|
|
20
|
+
* HTML element or component to render.
|
|
21
|
+
*/
|
|
22
|
+
as?: T
|
|
23
|
+
/**
|
|
24
|
+
* CSS `display` property.
|
|
25
|
+
*/
|
|
26
|
+
display?: Responsive<DisplayGrid>
|
|
27
|
+
}
|
|
28
|
+
>
|
|
25
29
|
|
|
26
30
|
export const gridProps: Record<string, PropDef> = {
|
|
27
31
|
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 {type ComponentProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -9,10 +9,7 @@ import {type HStackProps} from './hStack.props'
|
|
|
9
9
|
const hStackClassName = suffixClassName('sui-HStack')
|
|
10
10
|
|
|
11
11
|
/** @public */
|
|
12
|
-
export function HStack<T extends ElementType = 'div'>({
|
|
13
|
-
className,
|
|
14
|
-
...props
|
|
15
|
-
}: HStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof HStackProps<T>>) {
|
|
12
|
+
export function HStack<T extends ElementType = 'div'>({className, ...props}: HStackProps<T>) {
|
|
16
13
|
return (
|
|
17
14
|
<Flex
|
|
18
15
|
className={clsx(hStackClassName, className)}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
3
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
1
4
|
import type {FlexProps} from '../flex/flex.props'
|
|
2
5
|
|
|
3
6
|
/** @public */
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
'as' | 'gap'
|
|
7
|
-
>
|
|
7
|
+
export type HStackProps<T extends ElementType = 'div'> = Polymorphic<
|
|
8
|
+
T,
|
|
9
|
+
Pick<FlexProps<T>, 'as' | 'gap'>
|
|
10
|
+
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import type {ComponentPropsWithRef, ElementType} from 'react'
|
|
3
2
|
|
|
3
|
+
import {type HeadingTag} from '../../types/Heading'
|
|
4
4
|
import {getProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
6
6
|
import {type HeadingProps, headingProps} from './heading.props'
|
|
@@ -8,10 +8,7 @@ import {type HeadingProps, headingProps} from './heading.props'
|
|
|
8
8
|
const headingClassName = suffixClassName('sui-Heading')
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
|
-
export function Heading<T extends
|
|
12
|
-
size = 2,
|
|
13
|
-
...props
|
|
14
|
-
}: HeadingProps & Omit<ComponentPropsWithRef<T>, keyof HeadingProps>) {
|
|
11
|
+
export function Heading<T extends HeadingTag = 'h2'>({size = 2, ...props}: HeadingProps<T>) {
|
|
15
12
|
const {as, children, className, style, ...rest} = getProps({size, ...props}, headingProps)
|
|
16
13
|
const Component = as || 'h2'
|
|
17
14
|
|
|
@@ -21,6 +18,7 @@ export function Heading<T extends ElementType = 'h2'>({
|
|
|
21
18
|
className={clsx(
|
|
22
19
|
headingClassName,
|
|
23
20
|
className?.replace('sui-line-clamp', '').replace('sui-text-overflow', ''),
|
|
21
|
+
'sui-weight-bold',
|
|
24
22
|
)}
|
|
25
23
|
style={style}
|
|
26
24
|
data-ui="Heading"
|
|
@@ -29,7 +27,6 @@ export function Heading<T extends ElementType = 'h2'>({
|
|
|
29
27
|
<span
|
|
30
28
|
className={clsx(
|
|
31
29
|
'sui-overflow-hidden',
|
|
32
|
-
'sui-weight-bold',
|
|
33
30
|
props.truncate === 1 ? 'sui-text-overflow' : 'sui-line-clamp',
|
|
34
31
|
)}
|
|
35
32
|
>
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import {marginProps} from '../../props/margin'
|
|
2
|
-
import {toneProps} from '../../props/tone'
|
|
1
|
+
import {marginProps, type MarginProps} from '../../props/margin'
|
|
2
|
+
import {toneProps, type ToneProps} from '../../props/tone'
|
|
3
3
|
import {type TypographyProps, typographyProps} from '../../props/typography'
|
|
4
4
|
import {HEADING_SIZE, HEADING_TAG, type HeadingSize, type HeadingTag} from '../../types/Heading'
|
|
5
|
-
import
|
|
5
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
6
|
+
import type {PropDef} from '../../types/PropDef'
|
|
6
7
|
import type {Responsive} from '../../types/Responsive'
|
|
7
8
|
|
|
8
9
|
/** @public */
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
export type HeadingProps<T extends HeadingTag = HeadingTag> = Polymorphic<
|
|
11
|
+
T,
|
|
12
|
+
MarginProps &
|
|
13
|
+
ToneProps &
|
|
14
|
+
Omit<TypographyProps, 'muted' | 'weight'> & {
|
|
15
|
+
/**
|
|
16
|
+
* Semantic heading element to render.
|
|
17
|
+
*/
|
|
18
|
+
as: T
|
|
19
|
+
/**
|
|
20
|
+
* Sets font size.
|
|
21
|
+
* @remarks Independent of `as`.
|
|
22
|
+
*/
|
|
23
|
+
size?: Responsive<HeadingSize>
|
|
24
|
+
}
|
|
25
|
+
>
|
|
20
26
|
|
|
21
27
|
export const headingProps: Record<string, PropDef> = {
|
|
22
28
|
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
|
/** @public */
|
|
4
|
-
export interface HotkeysProps extends
|
|
6
|
+
export interface HotkeysProps extends ComponentProps<'kbd'> {
|
|
5
7
|
/**
|
|
6
8
|
* The keys in the shortcut, in order. Each one renders as a KBD.
|
|
7
9
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {ComponentProps, SVGProps} from 'react'
|
|
1
|
+
import type {ComponentProps, ComponentType, ReactElement, SVGProps} from 'react'
|
|
2
2
|
|
|
3
3
|
import {type MarginProps, marginProps} from '../../props/margin'
|
|
4
4
|
import {type ToneProps, toneProps} from '../../props/tone'
|
|
5
5
|
import {type TypographyProps, typographyProps} from '../../props/typography'
|
|
6
6
|
import {ICON_SIZE, type IconSize} from '../../types/Icon'
|
|
7
|
-
import
|
|
7
|
+
import type {PropDef} from '../../types/PropDef'
|
|
8
8
|
import type {Responsive} from '../../types/Responsive'
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
@@ -13,7 +13,7 @@ export interface IconProps
|
|
|
13
13
|
/**
|
|
14
14
|
* The icon component to render.
|
|
15
15
|
*/
|
|
16
|
-
icon:
|
|
16
|
+
icon: ComponentType<SVGProps<SVGSVGElement>> | ReactElement<SVGProps<SVGSVGElement>>
|
|
17
17
|
/**
|
|
18
18
|
* Sets icon size.
|
|
19
19
|
*/
|
|
@@ -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'
|
|
@@ -10,9 +10,7 @@ import {type IconButtonProps, iconButtonProps} from './iconButton.props'
|
|
|
10
10
|
const iconButtonClassName = suffixClassName('sui-IconButton')
|
|
11
11
|
|
|
12
12
|
/** @public */
|
|
13
|
-
export function IconButton<T extends ElementType = 'button'>(
|
|
14
|
-
props: IconButtonProps<T> & Omit<ComponentPropsWithRef<T>, keyof IconButtonProps<T>>,
|
|
15
|
-
) {
|
|
13
|
+
export function IconButton<T extends ElementType = 'button'>(props: IconButtonProps<T>) {
|
|
16
14
|
const {as, className, style, icon: IconProp, ...rest} = getProps(props, iconButtonProps)
|
|
17
15
|
const Component = as || 'button'
|
|
18
16
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type {SVGProps} from 'react'
|
|
2
|
-
import type React from 'react'
|
|
1
|
+
import type {ComponentType, ElementType, SVGProps} from 'react'
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
5
5
|
import {type ButtonProps, buttonProps} from '../button/button.props'
|
|
6
6
|
|
|
7
7
|
/** @public */
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
'as' | 'density' | 'level' | 'loading' | 'tone'
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
export type IconButtonProps<T extends ElementType = 'button'> = Polymorphic<
|
|
9
|
+
T,
|
|
10
|
+
Pick<ButtonProps<T>, 'as' | 'density' | 'level' | 'loading' | 'tone'> & {
|
|
11
|
+
/**
|
|
12
|
+
* Accessible name for the button.
|
|
13
|
+
* @remarks Because IconButtons have no visible text, this is required.
|
|
14
|
+
*/
|
|
15
|
+
'aria-label': string
|
|
16
|
+
/**
|
|
17
|
+
* Icon to render.
|
|
18
|
+
*/
|
|
19
|
+
'icon': ComponentType<SVGProps<SVGSVGElement>>
|
|
20
|
+
}
|
|
21
|
+
>
|
|
22
22
|
|
|
23
23
|
export const iconButtonProps: Record<string, PropDef> = {
|
|
24
24
|
'aria-label': {
|
|
@@ -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 @@ const indicatorClassName = suffixClassName('sui-Indicator')
|
|
|
12
12
|
export function Indicator<T extends ElementType = 'span'>({
|
|
13
13
|
tone = 'neutral',
|
|
14
14
|
...props
|
|
15
|
-
}: IndicatorProps<T>
|
|
15
|
+
}: IndicatorProps<T>) {
|
|
16
16
|
const {as, children, className, style, label, ...rest} = getProps(
|
|
17
17
|
{tone, ...props},
|
|
18
18
|
indicatorProps,
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import {type ToneProps, toneProps} from '../../props/tone'
|
|
2
|
-
import
|
|
4
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
5
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
6
|
|
|
4
7
|
/** @beta */
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
export type IndicatorProps<T extends ElementType = 'span'> = Polymorphic<
|
|
9
|
+
T,
|
|
10
|
+
ToneProps & {
|
|
11
|
+
/**
|
|
12
|
+
* HTML element to render.
|
|
13
|
+
*/
|
|
14
|
+
as?: T
|
|
15
|
+
/**
|
|
16
|
+
* Accessible label.
|
|
17
|
+
*/
|
|
18
|
+
label?: string
|
|
19
|
+
}
|
|
20
|
+
>
|
|
15
21
|
|
|
16
22
|
export const indicatorProps: Record<string, PropDef> = {
|
|
17
23
|
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'
|
|
@@ -9,9 +9,7 @@ import {type IndicatorStackProps, indicatorStackProps} from './indicatorStack.pr
|
|
|
9
9
|
const indicatorStackClassName = suffixClassName('sui-IndicatorStack')
|
|
10
10
|
|
|
11
11
|
/** @public */
|
|
12
|
-
export function IndicatorStack<T extends ElementType = 'div'>(
|
|
13
|
-
props: IndicatorStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof IndicatorStackProps<T>>,
|
|
14
|
-
) {
|
|
12
|
+
export function IndicatorStack<T extends ElementType = 'div'>(props: IndicatorStackProps<T>) {
|
|
15
13
|
const {as, children, className, style, ...rest} = getProps(props, indicatorStackProps)
|
|
16
14
|
const Component = as || 'div'
|
|
17
15
|
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
3
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
4
|
+
import type {PropDef} from '../../types/PropDef'
|
|
2
5
|
|
|
3
6
|
/** @public */
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export type IndicatorStackProps<T extends ElementType = 'div'> = Polymorphic<
|
|
8
|
+
T,
|
|
9
|
+
{
|
|
10
|
+
/**
|
|
11
|
+
* HTML element to render.
|
|
12
|
+
*/
|
|
13
|
+
as?: T
|
|
14
|
+
}
|
|
15
|
+
>
|
|
10
16
|
|
|
11
17
|
export const indicatorStackProps: Record<string, PropDef> = {
|
|
12
18
|
as: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import {Children, type
|
|
2
|
+
import {Children, type ElementType} from 'react'
|
|
3
3
|
|
|
4
4
|
import {getProps} from '../../utils/getProps'
|
|
5
5
|
import {suffixClassName} from '../../utils/suffixClassName'
|
|
@@ -11,7 +11,7 @@ const inlineClassName = suffixClassName('sui-Inline')
|
|
|
11
11
|
/** @public */
|
|
12
12
|
export function Inline<T extends ElementType = 'div'>(
|
|
13
13
|
// oxlint-disable-next-line no-deprecated
|
|
14
|
-
props: InlineProps<T
|
|
14
|
+
props: InlineProps<T>,
|
|
15
15
|
) {
|
|
16
16
|
const {as, children: childrenProp, className, style, ...rest} = getProps(props, inlineProps)
|
|
17
17
|
const {className: childrenClassName} = getProps(props, inlineChildrenProps)
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
import type {ElementType} from 'react'
|
|
2
|
+
|
|
1
3
|
import {marginProps} from '../../props/margin'
|
|
2
4
|
import {type PaddingProps, paddingProps} from '../../props/padding'
|
|
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
|
import {SPACE, type SpaceInherit} from '../../types/Space'
|
|
6
9
|
|
|
7
10
|
/** @deprecated Use HStack component instead */
|
|
8
11
|
/** @public */
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
export type InlineProps<T extends ElementType = 'div'> = Polymorphic<
|
|
13
|
+
T,
|
|
14
|
+
PaddingProps & {
|
|
15
|
+
/**
|
|
16
|
+
* HTML element or component to render.
|
|
17
|
+
*/
|
|
18
|
+
as?: T
|
|
19
|
+
/**
|
|
20
|
+
* Space between children.
|
|
21
|
+
*/
|
|
22
|
+
gap?: Responsive<SpaceInherit>
|
|
23
|
+
}
|
|
24
|
+
>
|
|
19
25
|
|
|
20
26
|
export const inlineProps: Record<string, PropDef> = {
|
|
21
27
|
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
|
/** @public */
|
|
4
|
-
export interface KBDProps extends
|
|
6
|
+
export interface KBDProps extends ComponentProps<'kbd'> {
|
|
5
7
|
/**
|
|
6
8
|
* Sets KBD's key label.
|
|
7
9
|
*/
|
|
@@ -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 LinkProps extends
|
|
6
|
+
export interface LinkProps extends ComponentProps<'a'> {
|
|
5
7
|
/**
|
|
6
8
|
* Sets the link to `target="_blank"` and `rel="noopener noreferrer"`.
|
|
7
9
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import type {
|
|
2
|
+
import type {ElementType} from 'react'
|
|
3
3
|
|
|
4
4
|
import type {ListTag} from '../../types/List'
|
|
5
5
|
import {getProps} from '../../utils/getProps'
|
|
@@ -9,25 +9,20 @@ import {PressArea} from '../press-area/PressArea'
|
|
|
9
9
|
import {Text} from '../text/Text'
|
|
10
10
|
import {VStack} from '../v-stack/VStack'
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
type
|
|
12
|
+
listButtonProps,
|
|
13
|
+
type ListItemButtonProps,
|
|
14
|
+
type ListImageProps,
|
|
14
15
|
type ListItemProps,
|
|
15
|
-
listItemProps,
|
|
16
|
-
type ListItemTextProps,
|
|
17
|
-
listItemTextProps,
|
|
18
16
|
type ListProps,
|
|
19
17
|
listProps,
|
|
20
18
|
} from './list.props'
|
|
21
19
|
|
|
22
20
|
const listClassName = suffixClassName('sui-List')
|
|
23
21
|
const listItemClassName = suffixClassName('sui-ListItem')
|
|
24
|
-
const
|
|
25
|
-
const listItemTextClassName = suffixClassName('sui-ListItemText')
|
|
22
|
+
const listButtonClassName = suffixClassName('sui-ListItemButton')
|
|
26
23
|
const listItemImageClassName = suffixClassName('sui-ListItemImage')
|
|
27
24
|
|
|
28
|
-
function ListRoot<T extends ListTag = 'ul'>(
|
|
29
|
-
props: ListProps<T> & Omit<ComponentPropsWithRef<T>, keyof ListProps<T>>,
|
|
30
|
-
) {
|
|
25
|
+
function ListRoot<T extends ListTag = 'ul'>(props: ListProps<T>) {
|
|
31
26
|
const {as, children, className, style, ...rest} = getProps(props, listProps)
|
|
32
27
|
const Component = as || 'ul'
|
|
33
28
|
|
|
@@ -44,110 +39,66 @@ function ListRoot<T extends ListTag = 'ul'>(
|
|
|
44
39
|
)
|
|
45
40
|
}
|
|
46
41
|
|
|
47
|
-
function ListItem({
|
|
48
|
-
const {children, className, style, end, start, ...rest} = getProps(
|
|
49
|
-
{density, ...props},
|
|
50
|
-
listItemProps,
|
|
51
|
-
)
|
|
52
|
-
|
|
42
|
+
function ListItem({className, ...rest}: ListItemProps) {
|
|
53
43
|
return (
|
|
54
44
|
<li
|
|
55
|
-
className={clsx(
|
|
56
|
-
listItemClassName,
|
|
57
|
-
'sui-width-full sui-display-flex sui-align-items-center',
|
|
58
|
-
className,
|
|
59
|
-
)}
|
|
60
|
-
style={style}
|
|
61
45
|
data-ui="ListItem"
|
|
46
|
+
className={clsx(listItemClassName, 'sui-text-body1', className)}
|
|
62
47
|
{...rest}
|
|
63
|
-
|
|
64
|
-
{start}
|
|
65
|
-
|
|
66
|
-
<Flex flexGrow={1} gap="inherit">
|
|
67
|
-
{children}
|
|
68
|
-
</Flex>
|
|
69
|
-
|
|
70
|
-
{end}
|
|
71
|
-
</li>
|
|
48
|
+
/>
|
|
72
49
|
)
|
|
73
50
|
}
|
|
74
51
|
|
|
75
|
-
function
|
|
52
|
+
function ListItemButton<T extends ElementType = 'button'>({
|
|
76
53
|
density = 'regular',
|
|
77
54
|
...props
|
|
78
|
-
}:
|
|
79
|
-
const {as, children, className, style, end, start,
|
|
55
|
+
}: ListItemButtonProps<T>) {
|
|
56
|
+
const {as, children, className, style, text, subtext, end, start, current, ...rest} = getProps(
|
|
80
57
|
{density, ...props},
|
|
81
|
-
|
|
58
|
+
listButtonProps,
|
|
82
59
|
)
|
|
83
60
|
const Component = as || 'button'
|
|
84
61
|
|
|
85
62
|
return (
|
|
86
|
-
<
|
|
87
|
-
<PressArea
|
|
88
|
-
as={Component}
|
|
89
|
-
className={clsx(
|
|
90
|
-
listButtonItemClassName,
|
|
91
|
-
'sui-width-full sui-display-flex sui-align-items-center sui-radius2',
|
|
92
|
-
className,
|
|
93
|
-
)}
|
|
94
|
-
style={style}
|
|
95
|
-
data-ui="ListButtonItem"
|
|
96
|
-
data-selected={selected}
|
|
97
|
-
{...rest}
|
|
98
|
-
>
|
|
99
|
-
{start}
|
|
100
|
-
|
|
101
|
-
<Flex flexGrow={1} gap="inherit">
|
|
102
|
-
{children}
|
|
103
|
-
</Flex>
|
|
104
|
-
|
|
105
|
-
{end}
|
|
106
|
-
</PressArea>
|
|
107
|
-
</li>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function ListItemText<T extends ElementType = 'div'>(
|
|
112
|
-
props: ListItemTextProps<T> & Omit<ComponentPropsWithRef<T>, keyof ListItemTextProps<T>>,
|
|
113
|
-
) {
|
|
114
|
-
const {as, className, style, title, subtitle, ...rest} = getProps(props, listItemTextProps)
|
|
115
|
-
const Component = as || 'div'
|
|
116
|
-
|
|
117
|
-
return (
|
|
118
|
-
<Flex
|
|
63
|
+
<PressArea
|
|
119
64
|
as={Component}
|
|
120
|
-
className={clsx(
|
|
65
|
+
className={clsx(
|
|
66
|
+
listButtonClassName,
|
|
67
|
+
'sui-width-full sui-display-flex sui-align-items-center sui-radius2',
|
|
68
|
+
className,
|
|
69
|
+
)}
|
|
121
70
|
style={style}
|
|
122
|
-
data-ui="
|
|
123
|
-
|
|
124
|
-
justifyContent="center"
|
|
125
|
-
gap={2}
|
|
126
|
-
flexGrow={1}
|
|
71
|
+
data-ui="ListItemButton"
|
|
72
|
+
aria-current={current}
|
|
127
73
|
{...rest}
|
|
128
74
|
>
|
|
129
|
-
{
|
|
130
|
-
<Text size={1} weight="medium" trim truncate={1}>
|
|
131
|
-
{title}
|
|
132
|
-
</Text>
|
|
133
|
-
)}
|
|
75
|
+
{start}
|
|
134
76
|
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
77
|
+
<Flex flexDirection="column" justifyContent="center" gap={2} flexGrow={1}>
|
|
78
|
+
{text && (
|
|
79
|
+
<Text size={1} weight="medium" trim truncate={1}>
|
|
80
|
+
{text}
|
|
81
|
+
</Text>
|
|
82
|
+
)}
|
|
83
|
+
|
|
84
|
+
{subtext && (
|
|
85
|
+
<Text size={1} muted trim truncate={1}>
|
|
86
|
+
{subtext}
|
|
87
|
+
</Text>
|
|
88
|
+
)}
|
|
89
|
+
|
|
90
|
+
{children}
|
|
91
|
+
</Flex>
|
|
92
|
+
|
|
93
|
+
{end}
|
|
94
|
+
</PressArea>
|
|
141
95
|
)
|
|
142
96
|
}
|
|
143
97
|
|
|
144
|
-
function ListItemImage(
|
|
145
|
-
const {className, style, ...rest} = getProps(props, {})
|
|
146
|
-
|
|
98
|
+
function ListItemImage({className, ...rest}: ListImageProps) {
|
|
147
99
|
return (
|
|
148
100
|
<img
|
|
149
101
|
className={clsx(listItemImageClassName, 'sui-radius2', className)}
|
|
150
|
-
style={style}
|
|
151
102
|
data-ui="ListItemImage"
|
|
152
103
|
{...rest}
|
|
153
104
|
/>
|
|
@@ -157,11 +108,10 @@ function ListItemImage(props: ComponentProps<'img'>) {
|
|
|
157
108
|
ListRoot.displayName = 'List'
|
|
158
109
|
|
|
159
110
|
/** @beta */
|
|
160
|
-
export const List = ListRoot
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
ListRoot.ItemImage = ListItemImage
|
|
111
|
+
export const List = Object.assign(ListRoot, {
|
|
112
|
+
Item: ListItem,
|
|
113
|
+
ItemButton: ListItemButton,
|
|
114
|
+
ItemImage: ListItemImage,
|
|
115
|
+
})
|
|
166
116
|
|
|
167
|
-
export type {ListProps, ListItemProps,
|
|
117
|
+
export type {ListProps, ListItemProps, ListItemButtonProps, ListImageProps}
|