@sanity/ui 2.10.0-corel.0 → 3.0.0-static.0
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/bin/ui.js +6 -0
- package/dist/_chunks-cjs/buildCommand.js +2836 -0
- package/dist/_chunks-cjs/buildCommand.js.map +1 -0
- package/dist/_chunks-cjs/getTheme_v2.js +1 -27
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +1 -27
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +1 -27
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +23 -0
- package/dist/cli.js.map +1 -0
- package/dist/css.d.mts +943 -0
- package/dist/css.d.ts +943 -0
- package/dist/css.esm.js +3135 -0
- package/dist/css.esm.js.map +1 -0
- package/dist/css.js +3135 -0
- package/dist/css.js.map +1 -0
- package/dist/css.mjs +3135 -0
- package/dist/css.mjs.map +1 -0
- package/dist/index.d.mts +175 -164
- package/dist/index.d.ts +175 -164
- package/dist/index.esm.js +864 -1955
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +870 -1962
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +864 -1955
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +25 -0
- package/dist/system.css +2953 -0
- package/dist/theme.d.mts +84 -22
- package/dist/theme.d.ts +84 -22
- package/dist/theme.esm.js +232 -283
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +232 -283
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +232 -283
- package/dist/theme.mjs.map +1 -1
- package/exports/css.ts +1 -0
- package/package.json +25 -4
- package/src/core/__workshop__/constants.ts +15 -15
- package/src/core/__workshop__/fontsPlugin.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.styles.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +12 -4
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -3
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -5
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +14 -2
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +14 -9
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/dialog.tsx +77 -92
- package/src/core/components/hotkeys/hotkeys.tsx +18 -29
- package/src/core/components/menu/menu.tsx +8 -5
- package/src/core/components/menu/menuDivider.ts +2 -1
- package/src/core/components/menu/menuGroup.tsx +16 -8
- package/src/core/components/menu/menuItem.tsx +23 -14
- package/src/core/components/skeleton/skeleton.tsx +1 -1
- package/src/core/components/skeleton/styles.ts +1 -1
- package/src/core/components/skeleton/textSkeleton.tsx +1 -1
- package/src/core/components/tab/tab.tsx +6 -7
- package/src/core/components/tab/tabList.tsx +3 -2
- package/src/core/components/toast/styles.ts +1 -1
- package/src/core/components/toast/toast.tsx +6 -4
- package/src/core/components/toast/toastProvider.tsx +31 -22
- package/src/core/components/tree/style.ts +1 -1
- package/src/core/components/tree/tree.tsx +8 -2
- package/src/core/components/tree/treeGroup.tsx +1 -1
- package/src/core/components/tree/treeItem.tsx +38 -25
- package/src/core/components/tree/types.ts +5 -1
- package/src/core/lib/styled/elements.ts +135 -0
- package/src/core/lib/styled/index.ts +2 -0
- package/src/core/lib/styled/members.ts +15 -0
- package/src/core/lib/styled/styled.ts +79 -0
- package/src/core/primitives/_selectable/selectable.tsx +27 -14
- package/src/core/primitives/avatar/avatar.tsx +52 -32
- package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
- package/src/core/primitives/avatar/avatarStack.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/tones.tsx +9 -16
- package/src/core/primitives/badge/badge.tsx +18 -20
- package/src/core/primitives/box/box.tsx +62 -74
- package/src/core/primitives/button/__workshop__/props.tsx +3 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/button.tsx +38 -45
- package/src/core/primitives/button/styles.ts +2 -2
- package/src/core/primitives/card/RootCardContext.ts +3 -0
- package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/card.tsx +44 -46
- package/src/core/primitives/card/styles.ts +1 -1
- package/src/core/primitives/checkbox/checkbox.tsx +6 -8
- package/src/core/primitives/code/code.tsx +23 -12
- package/src/core/primitives/code/styles.ts +1 -1
- package/src/core/primitives/container/container.tsx +7 -15
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +6 -19
- package/src/core/primitives/grid/grid.tsx +2 -1
- package/src/core/primitives/heading/heading.tsx +32 -19
- package/src/core/primitives/heading/styles.ts +1 -1
- package/src/core/primitives/inline/inline.tsx +22 -13
- package/src/core/primitives/kbd/kbd.tsx +30 -37
- package/src/core/primitives/label/label.tsx +15 -4
- package/src/core/primitives/label/styles.ts +1 -1
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -1
- package/src/core/primitives/popover/popover.tsx +21 -15
- package/src/core/primitives/popover/popoverCard.tsx +36 -38
- package/src/core/primitives/radio/radio.tsx +1 -1
- package/src/core/primitives/radio/styles.ts +1 -1
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/select/styles.ts +1 -1
- package/src/core/primitives/spinner/spinner.tsx +6 -20
- package/src/core/primitives/stack/stack.tsx +12 -10
- package/src/core/primitives/switch/styles.ts +9 -9
- package/src/core/primitives/switch/switch.tsx +20 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
- package/src/core/primitives/text/styles.ts +1 -2
- package/src/core/primitives/text/text.tsx +17 -21
- package/src/core/primitives/textArea/textArea.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/textInput.tsx +176 -123
- package/src/core/primitives/tooltip/tooltip.test.tsx +1 -0
- package/src/core/primitives/tooltip/tooltip.tsx +13 -13
- package/src/core/primitives/tooltip/tooltipCard.tsx +15 -14
- package/src/core/primitives/types.ts +35 -16
- package/src/core/styles/border/borderStyle.ts +6 -0
- package/src/core/styles/border/types.ts +1 -0
- package/src/core/styles/box/boxStyle.ts +6 -0
- package/src/core/styles/card/_cardColorStyle.ts +0 -8
- package/src/core/styles/flex/flexStyle.ts +0 -18
- package/src/core/styles/flex/types.ts +1 -3
- package/src/core/styles/grid/gridStyle.ts +0 -10
- package/src/core/styles/helpers.ts +9 -0
- package/src/core/styles/input/textInputStyle.ts +1 -1
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/themeProvider.tsx +1 -1
- package/src/core/theme/useTheme.ts +1 -1
- package/src/core/types/avatar.ts +6 -1
- package/src/core/types/button.ts +1 -0
- package/src/core/types/flex.ts +27 -26
- package/src/core/types/gridItem.ts +32 -24
- package/src/core/types/radius.ts +7 -4
- package/src/core/utils/arrow/arrow.tsx +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/layer/layer.tsx +28 -11
- package/src/core/utils/srOnly/srOnly.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
- package/src/css/_resp.ts +28 -0
- package/src/css/cli/buildCommand.ts +36 -0
- package/src/css/cli/index.ts +38 -0
- package/src/css/compile/comileRules.ts +59 -0
- package/src/css/compile/compileRule.ts +58 -0
- package/src/css/compile/compileSystem.ts +7 -0
- package/src/css/compile/compileTheme.ts +509 -0
- package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -0
- package/src/css/components/breadcrumbs/index.ts +1 -0
- package/src/css/components/breadcrumbs/rules.ts +7 -0
- package/src/css/components/dialog/classes.ts +29 -0
- package/src/css/components/dialog/index.ts +1 -0
- package/src/css/components/dialog/rules.ts +75 -0
- package/src/css/components/tree/index.ts +1 -0
- package/src/css/components/tree/rules.ts +52 -0
- package/src/css/components/tree/tree.ts +5 -0
- package/src/css/composeClassNames.ts +3 -0
- package/src/css/index.ts +47 -0
- package/src/css/primitives/avatar/avatar.ts +32 -0
- package/src/css/primitives/avatar/index.ts +2 -0
- package/src/css/primitives/avatar/rules.ts +190 -0
- package/src/css/primitives/avatar/types.ts +9 -0
- package/src/css/primitives/badge/badge.ts +8 -0
- package/src/css/primitives/badge/index.ts +2 -0
- package/src/css/primitives/badge/rules.ts +25 -0
- package/src/css/primitives/badge/types.ts +8 -0
- package/src/css/primitives/box/box.ts +34 -0
- package/src/css/primitives/box/index.ts +2 -0
- package/src/css/primitives/box/rules.ts +25 -0
- package/src/css/primitives/box/types.ts +49 -0
- package/src/css/primitives/button/button.ts +26 -0
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/rules.ts +58 -0
- package/src/css/primitives/card/card.ts +21 -0
- package/src/css/primitives/card/index.ts +1 -0
- package/src/css/primitives/card/rules.ts +93 -0
- package/src/{core/primitives/checkbox/styles.ts → css/primitives/checkbox/__styles.ts} +3 -3
- package/src/css/primitives/checkbox/checkbox.ts +9 -0
- package/src/css/primitives/checkbox/index.ts +1 -0
- package/src/css/primitives/checkbox/rules.ts +136 -0
- package/src/css/primitives/code/code.ts +9 -0
- package/src/css/primitives/code/index.ts +2 -0
- package/src/css/primitives/code/rules.ts +71 -0
- package/src/css/primitives/code/types.ts +10 -0
- package/src/css/primitives/container/container.ts +7 -0
- package/src/css/primitives/container/index.ts +2 -0
- package/src/css/primitives/container/rules.ts +8 -0
- package/src/css/primitives/container/types.ts +6 -0
- package/src/css/primitives/heading/heading.ts +16 -0
- package/src/css/primitives/heading/index.ts +2 -0
- package/src/css/primitives/heading/rules.ts +84 -0
- package/src/css/primitives/heading/types.ts +12 -0
- package/src/css/primitives/kbd/index.ts +2 -0
- package/src/css/primitives/kbd/kbd.ts +7 -0
- package/src/css/primitives/kbd/rules.ts +20 -0
- package/src/css/primitives/kbd/types.ts +5 -0
- package/src/css/primitives/label/index.ts +2 -0
- package/src/css/primitives/label/label.ts +16 -0
- package/src/css/primitives/label/rules.ts +85 -0
- package/src/css/primitives/label/types.ts +12 -0
- package/src/css/primitives/popover/index.ts +1 -0
- package/src/css/primitives/popover/popover.ts +5 -0
- package/src/css/primitives/popover/rules.ts +5 -0
- package/src/css/primitives/radio/index.ts +1 -0
- package/src/css/primitives/radio/radio.ts +5 -0
- package/src/css/primitives/radio/rules.ts +5 -0
- package/src/css/primitives/select/index.ts +1 -0
- package/src/css/primitives/select/rules.ts +5 -0
- package/src/css/primitives/select/select.ts +5 -0
- package/src/{core/primitives/_selectable/style.ts → css/primitives/selectable/__style.ts} +5 -4
- package/src/css/primitives/selectable/index.ts +2 -0
- package/src/css/primitives/selectable/rules.ts +27 -0
- package/src/css/primitives/selectable/selectable.ts +9 -0
- package/src/css/primitives/selectable/types.ts +6 -0
- package/src/css/primitives/spinner/index.ts +1 -0
- package/src/css/primitives/spinner/rules.ts +22 -0
- package/src/css/primitives/spinner/spinner.ts +5 -0
- package/src/css/primitives/switch/index.ts +1 -0
- package/src/css/primitives/switch/rules.ts +132 -0
- package/src/css/primitives/switch/switch.ts +5 -0
- package/src/css/primitives/text/index.ts +2 -0
- package/src/css/primitives/text/rules.ts +75 -0
- package/src/css/primitives/text/text.ts +16 -0
- package/src/css/primitives/text/types.ts +11 -0
- package/src/css/primitives/textArea/index.ts +1 -0
- package/src/css/primitives/textArea/rules.ts +5 -0
- package/src/css/primitives/textArea/textArea.ts +5 -0
- package/src/css/primitives/textInput/index.ts +1 -0
- package/src/css/primitives/textInput/rules.ts +226 -0
- package/src/css/primitives/textInput/textInput.ts +7 -0
- package/src/css/primitives/token/rules.ts +45 -0
- package/src/css/primitives/tooltip/index.ts +1 -0
- package/src/css/primitives/tooltip/rules.ts +17 -0
- package/src/css/primitives/tooltip/tooltip.ts +9 -0
- package/src/css/responsiveRules.ts +25 -0
- package/src/css/rules.ts +121 -0
- package/src/css/styles/border/border.ts +22 -0
- package/src/css/styles/border/index.ts +2 -0
- package/src/css/styles/border/rules.ts +24 -0
- package/src/css/styles/border/types.ts +10 -0
- package/src/css/styles/display/rules.ts +62 -0
- package/src/css/styles/flex/flex.ts +20 -0
- package/src/css/styles/flex/index.ts +2 -0
- package/src/css/styles/flex/rules.ts +28 -0
- package/src/css/styles/flex/types.ts +35 -0
- package/src/css/styles/flexItem/flexItem.ts +8 -0
- package/src/css/styles/flexItem/index.ts +2 -0
- package/src/css/styles/flexItem/rules.ts +11 -0
- package/src/css/styles/flexItem/types.ts +11 -0
- package/src/css/styles/font/font.ts +12 -0
- package/src/css/styles/font/index.ts +2 -0
- package/src/css/styles/font/rules.ts +125 -0
- package/src/css/styles/font/types.ts +6 -0
- package/src/css/styles/gap/gap.ts +8 -0
- package/src/css/styles/gap/index.ts +2 -0
- package/src/css/styles/gap/rules.ts +33 -0
- package/src/css/styles/gap/types.ts +9 -0
- package/src/css/styles/grid/rules.ts +35 -0
- package/src/css/styles/gridItem/gridItem.ts +15 -0
- package/src/css/styles/gridItem/index.ts +2 -0
- package/src/css/styles/gridItem/rules.ts +96 -0
- package/src/css/styles/gridItem/types.ts +41 -0
- package/src/css/styles/height/rules.ts +7 -0
- package/src/css/styles/margin/index.ts +2 -0
- package/src/css/styles/margin/margin.ts +15 -0
- package/src/css/styles/margin/rules.ts +59 -0
- package/src/css/styles/margin/types.ts +11 -0
- package/src/css/styles/maxWidth/index.ts +2 -0
- package/src/css/styles/maxWidth/maxWidth.ts +6 -0
- package/src/css/styles/maxWidth/rules.ts +36 -0
- package/src/css/styles/maxWidth/types.ts +6 -0
- package/src/css/styles/overflow/rules.ts +9 -0
- package/src/css/styles/padding/index.ts +2 -0
- package/src/css/styles/padding/padding.ts +15 -0
- package/src/css/styles/padding/rules.ts +59 -0
- package/src/css/styles/padding/types.ts +12 -0
- package/src/css/styles/pointerEvents/index.ts +2 -0
- package/src/css/styles/pointerEvents/pointerEvents.ts +6 -0
- package/src/css/styles/pointerEvents/rules.ts +11 -0
- package/src/css/styles/pointerEvents/types.ts +7 -0
- package/src/css/styles/position/index.ts +2 -0
- package/src/css/styles/position/position.ts +7 -0
- package/src/css/styles/position/rules.ts +31 -0
- package/src/css/styles/position/types.ts +13 -0
- package/src/css/styles/radius/index.ts +2 -0
- package/src/css/styles/radius/radius.ts +8 -0
- package/src/css/styles/radius/rules.ts +13 -0
- package/src/css/styles/radius/types.ts +7 -0
- package/src/css/styles/shadow/rules.ts +53 -0
- package/src/css/styles/width/index.ts +2 -0
- package/src/css/styles/width/rules.ts +7 -0
- package/src/css/styles/width/types.ts +8 -0
- package/src/css/styles/width/width.ts +6 -0
- package/src/css/types.ts +591 -0
- package/src/css/varNames.ts +381 -0
- package/src/css/vars.ts +313 -0
- package/src/theme/build/_deprecated/color/factory.ts +1 -1
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.ts +39 -45
- package/src/theme/build/renderColorTheme.ts +65 -239
- package/src/theme/build/resolveColorTokens.ts +115 -51
- package/src/theme/config/tokens/color/types.ts +18 -4
- package/src/theme/defaults/colorTokens.ts +10 -17
- package/src/theme/defaults/config.ts +1 -1
- package/src/theme/getScopedTheme.ts +2 -9
- package/src/theme/system/_constants.ts +25 -0
- package/src/theme/system/_types.ts +41 -0
- package/src/theme/system/color/_constants.ts +0 -8
- package/src/theme/system/color/badge.ts +7 -3
- package/src/theme/system/index.ts +2 -0
- package/src/theme/system/v0/color/_system.ts +4 -8
- package/src/theme/system/v0/color/color.ts +2 -3
- package/src/theme/versioning/themeColor_v0_v2.ts +0 -26
- package/src/theme/versioning/v0_v2.ts +0 -4
- package/src/core/components/breadcrumbs/__workshop__/buttons.tsx +0 -58
- package/src/core/components/dialog/styles.ts +0 -76
package/exports/css.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../src/css'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-static.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -27,12 +27,24 @@
|
|
|
27
27
|
"require": "./dist/index.js",
|
|
28
28
|
"default": "./dist/index.js"
|
|
29
29
|
},
|
|
30
|
+
"./css": {
|
|
31
|
+
"source": "./exports/css.ts",
|
|
32
|
+
"import": "./dist/css.mjs",
|
|
33
|
+
"require": "./dist/css.js",
|
|
34
|
+
"default": "./dist/css.js"
|
|
35
|
+
},
|
|
36
|
+
"./system.css": {
|
|
37
|
+
"default": "./dist/system.css"
|
|
38
|
+
},
|
|
30
39
|
"./theme": {
|
|
31
40
|
"source": "./exports/theme.ts",
|
|
32
41
|
"import": "./dist/theme.mjs",
|
|
33
42
|
"require": "./dist/theme.js",
|
|
34
43
|
"default": "./dist/theme.js"
|
|
35
44
|
},
|
|
45
|
+
"./sanity-theme.css": {
|
|
46
|
+
"default": "./dist/sanity-theme.css"
|
|
47
|
+
},
|
|
36
48
|
"./package.json": "./package.json"
|
|
37
49
|
},
|
|
38
50
|
"main": "./dist/index.js",
|
|
@@ -45,6 +57,9 @@
|
|
|
45
57
|
]
|
|
46
58
|
}
|
|
47
59
|
},
|
|
60
|
+
"bin": {
|
|
61
|
+
"ui": "./bin/ui.js"
|
|
62
|
+
},
|
|
48
63
|
"files": [
|
|
49
64
|
"dist",
|
|
50
65
|
"exports",
|
|
@@ -82,7 +97,10 @@
|
|
|
82
97
|
"@floating-ui/react-dom": "^2.1.2",
|
|
83
98
|
"@sanity/color": "^3.0.6",
|
|
84
99
|
"@sanity/icons": "^3.4.0",
|
|
100
|
+
"@sanity/ui": "^2.8.10",
|
|
101
|
+
"cac": "^6.7.14",
|
|
85
102
|
"csstype": "^3.1.3",
|
|
103
|
+
"dotenv-flow": "^4.1.0",
|
|
86
104
|
"framer-motion": "11.0.8",
|
|
87
105
|
"react-refractor": "^2.2.0",
|
|
88
106
|
"use-effect-event": "^1.0.2"
|
|
@@ -96,7 +114,7 @@
|
|
|
96
114
|
"@commitlint/config-conventional": "^19.2.2",
|
|
97
115
|
"@juggle/resize-observer": "^3.4.0",
|
|
98
116
|
"@sanity/pkg-utils": "^6.11.7",
|
|
99
|
-
"@sanity/prettier-config": "^1.0.
|
|
117
|
+
"@sanity/prettier-config": "^1.0.3",
|
|
100
118
|
"@sanity/semantic-release-preset": "^5.0.0",
|
|
101
119
|
"@sanity/ui-workshop": "^2.0.16",
|
|
102
120
|
"@storybook/addon-a11y": "^8.3.6",
|
|
@@ -132,6 +150,7 @@
|
|
|
132
150
|
"cypress": "^13.13.2",
|
|
133
151
|
"cypress-real-events": "^1.13.0",
|
|
134
152
|
"cz-conventional-changelog": "^3.3.0",
|
|
153
|
+
"esbuild-register": "^3.6.0",
|
|
135
154
|
"eslint": "^8.57.1",
|
|
136
155
|
"eslint-config-prettier": "^9.1.0",
|
|
137
156
|
"eslint-plugin-boundaries": "^4.2.2",
|
|
@@ -149,6 +168,7 @@
|
|
|
149
168
|
"jest-environment-jsdom": "^29.7.0",
|
|
150
169
|
"lint-staged": "^14.0.1",
|
|
151
170
|
"module-alias": "^2.2.3",
|
|
171
|
+
"npm-run-all": "^4.1.5",
|
|
152
172
|
"npm-run-all2": "^5.0.2",
|
|
153
173
|
"prettier": "^3.3.3",
|
|
154
174
|
"react": "^18.3.1",
|
|
@@ -162,7 +182,7 @@
|
|
|
162
182
|
"storybook": "^8.3.6",
|
|
163
183
|
"styled-components": "^6.1.13",
|
|
164
184
|
"tsconfig-paths": "^4.2.0",
|
|
165
|
-
"typescript": "5.
|
|
185
|
+
"typescript": "^5.6.3",
|
|
166
186
|
"vite": "^5.4.2",
|
|
167
187
|
"vite-tsconfig-paths": "^5.0.1"
|
|
168
188
|
},
|
|
@@ -182,7 +202,8 @@
|
|
|
182
202
|
"bundle": false
|
|
183
203
|
},
|
|
184
204
|
"scripts": {
|
|
185
|
-
"build": "
|
|
205
|
+
"bin:build": "./bin/ui.js build",
|
|
206
|
+
"build": "run-s clean pkg:build bin:build pkg:check figma:pkg:build",
|
|
186
207
|
"clean": "rimraf .workshop dist",
|
|
187
208
|
"commit": "cz",
|
|
188
209
|
"cypress:dev": "run-p dev cypress:open",
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
TextAlign,
|
|
15
15
|
TextInputType,
|
|
16
16
|
} from '@sanity/ui'
|
|
17
|
-
import {ThemeColorSpotKey, ThemeColorToneKey, ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
17
|
+
import {Space, ThemeColorSpotKey, ThemeColorToneKey, ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
18
18
|
|
|
19
19
|
export const WORKSHOP_AVATAR_SIZE_OPTIONS: {[key: string]: AvatarSize} = {
|
|
20
20
|
'0': 0,
|
|
21
|
-
'1': 1,
|
|
21
|
+
'1 (default)': 1,
|
|
22
22
|
'2': 2,
|
|
23
23
|
'3': 3,
|
|
24
24
|
}
|
|
@@ -60,12 +60,12 @@ export const WORKSHOP_BUTTON_TONE_OPTIONS: {[key: string]: ButtonTone} = {
|
|
|
60
60
|
export const WORKSHOP_CARD_AS_OPTIONS: {
|
|
61
61
|
[key: string]: 'div' | 'button' | 'span' | 'ol' | 'pre' | 'ul'
|
|
62
62
|
} = {
|
|
63
|
-
DIV: 'div',
|
|
64
|
-
BUTTON: 'button',
|
|
65
|
-
SPAN: 'span',
|
|
66
|
-
OL: 'ol',
|
|
67
|
-
PRE: 'pre',
|
|
68
|
-
UL: 'ul',
|
|
63
|
+
'DIV (default)': 'div',
|
|
64
|
+
'BUTTON': 'button',
|
|
65
|
+
'SPAN': 'span',
|
|
66
|
+
'OL': 'ol',
|
|
67
|
+
'PRE': 'pre',
|
|
68
|
+
'UL': 'ul',
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export const WORKSHOP_CARD_TONE_OPTIONS: {[key: string]: CardTone} = {
|
|
@@ -132,7 +132,7 @@ export const WORKSHOP_FONT_WEIGHT_OPTIONS: {[key: string]: ThemeFontWeightKey} =
|
|
|
132
132
|
export const WORKSHOP_HEADING_FONT_SIZE_OPTIONS = {
|
|
133
133
|
'0': 0,
|
|
134
134
|
'1': 1,
|
|
135
|
-
'2': 2,
|
|
135
|
+
'2 (default)': 2,
|
|
136
136
|
'3': 3,
|
|
137
137
|
'4': 4,
|
|
138
138
|
}
|
|
@@ -190,7 +190,7 @@ export const WORKSHOP_SHADOW_OPTIONS = {
|
|
|
190
190
|
'5': 5,
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
export const WORKSHOP_SPACE_OPTIONS = {
|
|
193
|
+
export const WORKSHOP_SPACE_OPTIONS: Record<string, Space> = {
|
|
194
194
|
'0': 0,
|
|
195
195
|
'1': 1,
|
|
196
196
|
'2': 2,
|
|
@@ -254,16 +254,16 @@ export const WORKSHOP_TEXT_OVERFLOW_OPTIONS: {[key: string]: 'ellipsis' | ''} =
|
|
|
254
254
|
export const WORKSHOP_TEXT_SIZE_OPTIONS = {
|
|
255
255
|
'0': 0,
|
|
256
256
|
'1': 1,
|
|
257
|
-
'2': 2,
|
|
257
|
+
'2 (default)': 2,
|
|
258
258
|
'3': 3,
|
|
259
259
|
'4': 4,
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
export const WORKSHOP_TEXT_WEIGHT_OPTIONS: {[key: string]: ThemeFontWeightKey | ''} = {
|
|
263
|
-
Regular: '
|
|
264
|
-
Medium: 'medium',
|
|
265
|
-
Semibold: 'semibold',
|
|
266
|
-
Bold: 'bold',
|
|
263
|
+
'Regular (default)': '',
|
|
264
|
+
'Medium': 'medium',
|
|
265
|
+
'Semibold': 'semibold',
|
|
266
|
+
'Bold': 'bold',
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
export const WORKSHOP_THEME_COLOR_TONE_OPTIONS: {[key: string]: ThemeColorToneKey} = {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {ChevronDownIcon} from '@sanity/icons'
|
|
2
|
+
import {ResponsiveProp} from '@sanity/ui/css'
|
|
3
|
+
import {FontTextSize, Space} from '@sanity/ui/theme'
|
|
2
4
|
import {
|
|
3
5
|
ChangeEvent,
|
|
4
6
|
ElementType,
|
|
@@ -50,7 +52,7 @@ export interface AutocompleteProps<Option extends BaseAutocompleteOption = BaseA
|
|
|
50
52
|
border?: boolean
|
|
51
53
|
customValidity?: string
|
|
52
54
|
filterOption?: (query: string, option: Option) => boolean
|
|
53
|
-
fontSize?:
|
|
55
|
+
fontSize?: ResponsiveProp<FontTextSize>
|
|
54
56
|
icon?: ElementType | ReactNode
|
|
55
57
|
id: string
|
|
56
58
|
/** @beta */
|
|
@@ -65,7 +67,8 @@ export interface AutocompleteProps<Option extends BaseAutocompleteOption = BaseA
|
|
|
65
67
|
openOnFocus?: boolean
|
|
66
68
|
/** The options to render. */
|
|
67
69
|
options?: Option[]
|
|
68
|
-
padding?:
|
|
70
|
+
padding?: ResponsiveProp<Space>
|
|
71
|
+
// padding?: number | number[]
|
|
69
72
|
popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'> &
|
|
70
73
|
Omit<HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'ref' | 'width'>
|
|
71
74
|
prefix?: ReactNode
|
|
@@ -466,11 +469,16 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<
|
|
|
466
469
|
if (v === 1) return 1
|
|
467
470
|
if (v === 2) return 1
|
|
468
471
|
|
|
469
|
-
return v - 2
|
|
472
|
+
return (v as Space) - 2
|
|
470
473
|
}),
|
|
471
474
|
[padding],
|
|
472
475
|
)
|
|
473
|
-
|
|
476
|
+
|
|
477
|
+
const openButtonPadding = useMemo(
|
|
478
|
+
() => padding.map((v) => Math.max((v as Space) - 1, 0)),
|
|
479
|
+
[padding],
|
|
480
|
+
)
|
|
481
|
+
|
|
474
482
|
const openButtonProps: AutocompleteOpenButtonProps = useMemo(
|
|
475
483
|
() => (typeof openButton === 'object' ? openButton : EMPTY_RECORD),
|
|
476
484
|
[openButton],
|
|
@@ -19,15 +19,13 @@ export default function Example() {
|
|
|
19
19
|
return (
|
|
20
20
|
<Flex align="center" height="fill" justify="center">
|
|
21
21
|
<Breadcrumbs
|
|
22
|
-
gapX={1}
|
|
23
|
-
gapY={3}
|
|
24
22
|
maxLength={maxLength}
|
|
25
23
|
separator={
|
|
26
24
|
<Text muted size={1}>
|
|
27
25
|
/
|
|
28
26
|
</Text>
|
|
29
27
|
}
|
|
30
|
-
|
|
28
|
+
space={2}
|
|
31
29
|
>
|
|
32
30
|
<Text size={1}>
|
|
33
31
|
<a href="#">Root</a>
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import {styled} from 'styled
|
|
1
|
+
import {styled} from '../../lib/styled'
|
|
2
|
+
import {Button} from '../../primitives'
|
|
2
3
|
|
|
3
|
-
export const Root = styled.
|
|
4
|
+
export const Root = styled.ol`
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
list-style: none;
|
|
9
|
+
align-items: center;
|
|
10
|
+
white-space: nowrap;
|
|
4
11
|
line-height: 0;
|
|
5
12
|
`
|
|
13
|
+
|
|
14
|
+
export const ExpandButton = styled(Button)`
|
|
15
|
+
appearance: none;
|
|
16
|
+
margin: -4px;
|
|
17
|
+
`
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
+
import {breadcrumbs, composeClassNames, GapStyleProps} from '@sanity/ui/css'
|
|
2
|
+
import {Space} from '@sanity/ui/theme'
|
|
1
3
|
import {Children, forwardRef, isValidElement, useCallback, useMemo, useRef, useState} from 'react'
|
|
2
4
|
import {useClickOutsideEvent} from '../../hooks'
|
|
3
5
|
import {Box, Button, ButtonProps, Flex, Popover, Stack, Text} from '../../primitives'
|
|
4
|
-
import {Root} from './breadcrumbs.styles'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @beta
|
|
8
9
|
*/
|
|
9
|
-
export interface BreadcrumbsProps {
|
|
10
|
+
export interface BreadcrumbsProps extends GapStyleProps {
|
|
10
11
|
expandButton?: Omit<ButtonProps, 'onClick' | 'selected'>
|
|
11
|
-
gap?: number | number[]
|
|
12
|
-
gapX?: number | number[]
|
|
13
|
-
gapY?: number | number[]
|
|
14
12
|
maxLength?: number
|
|
15
13
|
separator?: React.ReactNode
|
|
16
14
|
/** @deprecated - Use `gap`, `gapX`, `gapY` instead */
|
|
@@ -26,11 +24,12 @@ export const Breadcrumbs = forwardRef(function Breadcrumbs(
|
|
|
26
24
|
) {
|
|
27
25
|
const {
|
|
28
26
|
children,
|
|
27
|
+
className,
|
|
29
28
|
expandButton: expandButtonProps,
|
|
30
29
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
30
|
gap: _gapProp,
|
|
32
|
-
gapX = props.gap ?? props.space ?? 2,
|
|
33
|
-
gapY = props.gap ?? props.space ?? 2,
|
|
31
|
+
gapX = props.gap ?? (props.space as Space | undefined) ?? 2,
|
|
32
|
+
gapY = props.gap ?? (props.space as Space | undefined) ?? 2,
|
|
34
33
|
maxLength,
|
|
35
34
|
separator,
|
|
36
35
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -91,7 +90,12 @@ export const Breadcrumbs = forwardRef(function Breadcrumbs(
|
|
|
91
90
|
const len = items.length
|
|
92
91
|
|
|
93
92
|
return (
|
|
94
|
-
<
|
|
93
|
+
<nav
|
|
94
|
+
data-ui="Breadcrumbs"
|
|
95
|
+
{...restProps}
|
|
96
|
+
className={composeClassNames(className, breadcrumbs())}
|
|
97
|
+
ref={ref}
|
|
98
|
+
>
|
|
95
99
|
<Flex align="flex-start" as="ol" gapX={gapX} gapY={gapY} wrap="wrap">
|
|
96
100
|
{items.map((item, itemIndex) => (
|
|
97
101
|
<Flex align="flex-start" as="li" gapX={gapX} gapY={gapY} key={itemIndex}>
|
|
@@ -100,7 +104,8 @@ export const Breadcrumbs = forwardRef(function Breadcrumbs(
|
|
|
100
104
|
</Flex>
|
|
101
105
|
))}
|
|
102
106
|
</Flex>
|
|
103
|
-
</
|
|
107
|
+
</nav>
|
|
104
108
|
)
|
|
105
109
|
})
|
|
110
|
+
|
|
106
111
|
Breadcrumbs.displayName = 'ForwardRef(Breadcrumbs)'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {useCallback, useState} from 'react'
|
|
2
|
-
import {styled} from 'styled
|
|
2
|
+
import {styled} from '../../../lib/styled'
|
|
3
3
|
import {Box, Button, Card, Flex} from '../../../primitives'
|
|
4
4
|
import {BoundaryElementProvider, PortalProvider} from '../../../utils'
|
|
5
5
|
import {Menu, MenuButton, MenuItem} from '../../menu'
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import {CloseIcon} from '@sanity/icons'
|
|
2
|
+
import {
|
|
3
|
+
composeClassNames,
|
|
4
|
+
ContainerStyleProps,
|
|
5
|
+
dialog,
|
|
6
|
+
dialogCardRoot,
|
|
7
|
+
dialogContainer,
|
|
8
|
+
dialogContent,
|
|
9
|
+
dialogFooter,
|
|
10
|
+
dialogHeader,
|
|
11
|
+
dialogLayout,
|
|
12
|
+
PaddingStyleProps,
|
|
13
|
+
} from '@sanity/ui/css'
|
|
2
14
|
import {ThemeColorSchemeKey} from '@sanity/ui/theme'
|
|
3
15
|
import {forwardRef, useCallback, useEffect, useImperativeHandle, useRef} from 'react'
|
|
4
|
-
import {styled} from 'styled-components'
|
|
5
16
|
import {
|
|
6
17
|
containsOrEqualsElement,
|
|
7
18
|
focusFirstDescendant,
|
|
@@ -15,24 +26,15 @@ import {
|
|
|
15
26
|
usePrefersReducedMotion,
|
|
16
27
|
} from '../../hooks'
|
|
17
28
|
import {Box, Button, Card, Container, Flex, Text} from '../../primitives'
|
|
18
|
-
import {ResponsivePaddingProps, ResponsiveWidthProps} from '../../primitives/types'
|
|
19
|
-
import {responsivePaddingStyle, ResponsivePaddingStyleProps} from '../../styles/internal'
|
|
20
29
|
import {useTheme_v2} from '../../theme'
|
|
21
30
|
import {DialogPosition, Radius} from '../../types'
|
|
22
31
|
import {Layer, LayerProps, Portal, useBoundaryElement, useLayer, usePortal} from '../../utils'
|
|
23
|
-
import {
|
|
24
|
-
animationDialogStyle,
|
|
25
|
-
AnimationDialogStyleProps,
|
|
26
|
-
dialogStyle,
|
|
27
|
-
responsiveDialogPositionStyle,
|
|
28
|
-
ResponsiveDialogPositionStyleProps,
|
|
29
|
-
} from './styles'
|
|
30
32
|
import {useDialog} from './useDialog'
|
|
31
33
|
|
|
32
34
|
/**
|
|
33
35
|
* @public
|
|
34
36
|
*/
|
|
35
|
-
export interface DialogProps extends
|
|
37
|
+
export interface DialogProps extends PaddingStyleProps, ContainerStyleProps {
|
|
36
38
|
/**
|
|
37
39
|
* @beta
|
|
38
40
|
*/
|
|
@@ -41,6 +43,13 @@ export interface DialogProps extends ResponsivePaddingProps, ResponsiveWidthProp
|
|
|
41
43
|
* @beta
|
|
42
44
|
*/
|
|
43
45
|
__unstable_hideCloseButton?: boolean
|
|
46
|
+
/**
|
|
47
|
+
* Whether the dialog should animate in on mount.
|
|
48
|
+
*
|
|
49
|
+
* @beta
|
|
50
|
+
* @defaultValue false
|
|
51
|
+
*/
|
|
52
|
+
animate?: boolean
|
|
44
53
|
cardRadius?: Radius | Radius[]
|
|
45
54
|
cardShadow?: number | number[]
|
|
46
55
|
contentRef?: React.ForwardedRef<HTMLDivElement>
|
|
@@ -55,16 +64,9 @@ export interface DialogProps extends ResponsivePaddingProps, ResponsiveWidthProp
|
|
|
55
64
|
position?: DialogPosition | DialogPosition[]
|
|
56
65
|
scheme?: ThemeColorSchemeKey
|
|
57
66
|
zOffset?: number | number[]
|
|
58
|
-
/**
|
|
59
|
-
* Whether the dialog should animate in on mount.
|
|
60
|
-
*
|
|
61
|
-
* @beta
|
|
62
|
-
* @defaultValue false
|
|
63
|
-
*/
|
|
64
|
-
animate?: boolean
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
interface DialogCardProps extends
|
|
69
|
+
interface DialogCardProps extends ContainerStyleProps {
|
|
68
70
|
/**
|
|
69
71
|
* @beta
|
|
70
72
|
*/
|
|
@@ -99,55 +101,6 @@ function isTargetWithinScope(
|
|
|
99
101
|
)
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
const Root = styled(Layer)<
|
|
103
|
-
ResponsiveDialogPositionStyleProps & ResponsivePaddingStyleProps & AnimationDialogStyleProps
|
|
104
|
-
>(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle)
|
|
105
|
-
|
|
106
|
-
const DialogContainer = styled(Container)`
|
|
107
|
-
&:not([hidden]) {
|
|
108
|
-
display: flex;
|
|
109
|
-
}
|
|
110
|
-
width: 100%;
|
|
111
|
-
height: 100%;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
align-items: center;
|
|
114
|
-
justify-content: center;
|
|
115
|
-
`
|
|
116
|
-
|
|
117
|
-
const DialogCardRoot = styled(Card)`
|
|
118
|
-
&:not([hidden]) {
|
|
119
|
-
display: flex;
|
|
120
|
-
}
|
|
121
|
-
width: 100%;
|
|
122
|
-
min-height: 0;
|
|
123
|
-
max-height: 100%;
|
|
124
|
-
overflow: hidden;
|
|
125
|
-
overflow: clip;
|
|
126
|
-
`
|
|
127
|
-
|
|
128
|
-
const DialogLayout = styled(Flex)`
|
|
129
|
-
flex: 1;
|
|
130
|
-
min-height: 0;
|
|
131
|
-
width: 100%;
|
|
132
|
-
`
|
|
133
|
-
|
|
134
|
-
const DialogHeader = styled(Box)`
|
|
135
|
-
position: relative;
|
|
136
|
-
z-index: 2;
|
|
137
|
-
`
|
|
138
|
-
|
|
139
|
-
const DialogContent = styled(Box)`
|
|
140
|
-
position: relative;
|
|
141
|
-
z-index: 1;
|
|
142
|
-
overflow: auto;
|
|
143
|
-
outline: none;
|
|
144
|
-
`
|
|
145
|
-
|
|
146
|
-
const DialogFooter = styled(Box)`
|
|
147
|
-
position: relative;
|
|
148
|
-
z-index: 3;
|
|
149
|
-
`
|
|
150
|
-
|
|
151
104
|
const DialogCard = forwardRef(function DialogCard(
|
|
152
105
|
props: DialogCardProps,
|
|
153
106
|
forwardedRef: React.ForwardedRef<HTMLDivElement>,
|
|
@@ -236,11 +189,26 @@ const DialogCard = forwardRef(function DialogCard(
|
|
|
236
189
|
)
|
|
237
190
|
|
|
238
191
|
return (
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
192
|
+
<Container
|
|
193
|
+
align="center"
|
|
194
|
+
className={dialogContainer()}
|
|
195
|
+
data-ui="DialogCard"
|
|
196
|
+
direction="column"
|
|
197
|
+
display="flex"
|
|
198
|
+
justify="center"
|
|
199
|
+
width={width}
|
|
200
|
+
>
|
|
201
|
+
<Card
|
|
202
|
+
className={dialogCardRoot()}
|
|
203
|
+
display="flex"
|
|
204
|
+
radius={radius}
|
|
205
|
+
ref={ref}
|
|
206
|
+
scheme={scheme}
|
|
207
|
+
shadow={shadow}
|
|
208
|
+
>
|
|
209
|
+
<Flex className={dialogLayout()} direction="column" flex={1}>
|
|
242
210
|
{showHeader && (
|
|
243
|
-
<
|
|
211
|
+
<Box className={dialogHeader()} position="relative">
|
|
244
212
|
<Flex align="flex-start" padding={3}>
|
|
245
213
|
<Box flex={1} padding={2}>
|
|
246
214
|
{header && (
|
|
@@ -262,17 +230,26 @@ const DialogCard = forwardRef(function DialogCard(
|
|
|
262
230
|
</Box>
|
|
263
231
|
)}
|
|
264
232
|
</Flex>
|
|
265
|
-
</
|
|
233
|
+
</Box>
|
|
266
234
|
)}
|
|
267
|
-
|
|
268
|
-
|
|
235
|
+
<Box
|
|
236
|
+
className={dialogContent()}
|
|
237
|
+
flex={1}
|
|
238
|
+
overflow="auto"
|
|
239
|
+
position="relative"
|
|
240
|
+
ref={contentRef}
|
|
241
|
+
tabIndex={-1}
|
|
242
|
+
>
|
|
269
243
|
{children}
|
|
270
|
-
</
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
244
|
+
</Box>
|
|
245
|
+
{footer && (
|
|
246
|
+
<Box className={dialogFooter()} position="relative">
|
|
247
|
+
{footer}
|
|
248
|
+
</Box>
|
|
249
|
+
)}
|
|
250
|
+
</Flex>
|
|
251
|
+
</Card>
|
|
252
|
+
</Container>
|
|
276
253
|
)
|
|
277
254
|
})
|
|
278
255
|
|
|
@@ -284,10 +261,11 @@ DialogCard.displayName = 'ForwardRef(DialogCard)'
|
|
|
284
261
|
* @public
|
|
285
262
|
*/
|
|
286
263
|
export const Dialog = forwardRef(function Dialog(
|
|
287
|
-
props: DialogProps &
|
|
264
|
+
props: DialogProps &
|
|
265
|
+
Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'id' | 'width' | 'wrap'>,
|
|
288
266
|
ref: React.Ref<HTMLDivElement>,
|
|
289
267
|
) {
|
|
290
|
-
const
|
|
268
|
+
const context = useDialog()
|
|
291
269
|
const {layer} = useTheme_v2()
|
|
292
270
|
const {
|
|
293
271
|
__unstable_autoFocus: autoFocus = true,
|
|
@@ -295,6 +273,7 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
295
273
|
cardRadius: cardRadiusProp = 4,
|
|
296
274
|
cardShadow = 3,
|
|
297
275
|
children,
|
|
276
|
+
className,
|
|
298
277
|
contentRef,
|
|
299
278
|
footer,
|
|
300
279
|
header,
|
|
@@ -303,12 +282,12 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
303
282
|
onClickOutside,
|
|
304
283
|
onClose,
|
|
305
284
|
onFocus,
|
|
306
|
-
padding
|
|
285
|
+
padding = 3,
|
|
307
286
|
portal: portalProp,
|
|
308
|
-
position: positionProp =
|
|
287
|
+
position: positionProp = context.position || 'fixed',
|
|
309
288
|
scheme,
|
|
310
289
|
width: widthProp = 0,
|
|
311
|
-
zOffset: zOffsetProp =
|
|
290
|
+
zOffset: zOffsetProp = context.zOffset || layer.dialog.zOffset,
|
|
312
291
|
animate: _animate = false,
|
|
313
292
|
...restProps
|
|
314
293
|
} = props
|
|
@@ -318,7 +297,6 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
318
297
|
const portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element
|
|
319
298
|
const boundaryElement = useBoundaryElement().element
|
|
320
299
|
const cardRadius = useArrayProp(cardRadiusProp)
|
|
321
|
-
const padding = useArrayProp(paddingProp)
|
|
322
300
|
const position = useArrayProp(positionProp)
|
|
323
301
|
const width = useArrayProp(widthProp)
|
|
324
302
|
const zOffset = useArrayProp(zOffsetProp)
|
|
@@ -386,18 +364,24 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
386
364
|
|
|
387
365
|
return (
|
|
388
366
|
<Portal __unstable_name={portalProp}>
|
|
389
|
-
<
|
|
367
|
+
<Layer
|
|
390
368
|
{...restProps}
|
|
391
|
-
$animate={animate}
|
|
392
|
-
$padding={padding}
|
|
393
|
-
$position={position}
|
|
369
|
+
// $animate={animate}
|
|
370
|
+
// $padding={padding}
|
|
371
|
+
// $position={position}
|
|
394
372
|
aria-labelledby={labelId}
|
|
395
373
|
aria-modal
|
|
374
|
+
// className="root"
|
|
375
|
+
className={composeClassNames(className, dialog())}
|
|
376
|
+
data-animate={animate ? '' : undefined}
|
|
396
377
|
data-ui="Dialog"
|
|
378
|
+
display="flex"
|
|
397
379
|
id={id}
|
|
398
380
|
onActivate={onActivate}
|
|
399
381
|
onClick={handleRootClick}
|
|
400
382
|
onFocus={handleFocus}
|
|
383
|
+
padding={padding}
|
|
384
|
+
position={position}
|
|
401
385
|
ref={ref}
|
|
402
386
|
role="dialog"
|
|
403
387
|
zOffset={zOffset}
|
|
@@ -422,8 +406,9 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
422
406
|
{children}
|
|
423
407
|
</DialogCard>
|
|
424
408
|
<div ref={postDivRef} tabIndex={0} />
|
|
425
|
-
</
|
|
409
|
+
</Layer>
|
|
426
410
|
</Portal>
|
|
427
411
|
)
|
|
428
412
|
})
|
|
413
|
+
|
|
429
414
|
Dialog.displayName = 'ForwardRef(Dialog)'
|