@sanity/ui 4.0.0-beta.7 → 4.0.0-next.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/LICENSE +1 -1
- package/README.md +21 -7
- package/dist/_chunks/getScopedTheme.cjs +4043 -0
- package/dist/_chunks/getScopedTheme.cjs.map +1 -0
- package/dist/_chunks/getScopedTheme.js +3803 -0
- package/dist/_chunks/getScopedTheme.js.map +1 -0
- package/dist/_chunks/portalProvider.cjs +3750 -0
- package/dist/_chunks/portalProvider.cjs.map +1 -0
- package/dist/_chunks/portalProvider.d.cts +1067 -0
- package/dist/_chunks/portalProvider.d.cts.map +1 -0
- package/dist/_chunks/portalProvider.d.ts +1067 -0
- package/dist/_chunks/portalProvider.d.ts.map +1 -0
- package/dist/_chunks/portalProvider.js +3300 -0
- package/dist/_chunks/portalProvider.js.map +1 -0
- package/dist/_chunks/refractor.cjs +18 -0
- package/dist/_chunks/refractor.cjs.map +1 -0
- package/dist/_chunks/refractor.js +20 -0
- package/dist/_chunks/refractor.js.map +1 -0
- package/dist/_chunks/rgba.d.cts +929 -0
- package/dist/_chunks/rgba.d.cts.map +1 -0
- package/dist/_chunks/rgba.d.ts +929 -0
- package/dist/_chunks/rgba.d.ts.map +1 -0
- package/dist/_visual-editing.cjs +4 -0
- package/dist/_visual-editing.d.cts +2 -0
- package/dist/_visual-editing.d.ts +2 -0
- package/dist/_visual-editing.js +3 -0
- package/dist/index.cjs +3007 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1275 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +708 -1188
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2964 -4783
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +54 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +278 -0
- package/dist/theme.d.cts.map +1 -0
- package/dist/theme.d.ts +278 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +53 -0
- package/dist/theme.js.map +1 -0
- package/package.json +65 -88
- package/dist/_chunks-es/Syntax.js +0 -23
- package/dist/_chunks-es/Syntax.js.map +0 -1
- package/dist/index.css +0 -1
- package/exports/index.css +0 -1
- package/exports/index.ts +0 -125
- package/src/components/autocomplete/Autocomplete.tsx +0 -665
- package/src/components/autocomplete/AutocompleteOption.tsx +0 -42
- package/src/components/autocomplete/__workshop__/Async.tsx +0 -162
- package/src/components/autocomplete/__workshop__/ConstrainedHeight.tsx +0 -121
- package/src/components/autocomplete/__workshop__/Custom.tsx +0 -91
- package/src/components/autocomplete/__workshop__/Example.tsx +0 -70
- package/src/components/autocomplete/__workshop__/FocusAndBlur.tsx +0 -39
- package/src/components/autocomplete/__workshop__/Fullscreen.tsx +0 -307
- package/src/components/autocomplete/__workshop__/index.ts +0 -41
- package/src/components/autocomplete/__workshop__/mock/apiStore.ts +0 -49
- package/src/components/autocomplete/__workshop__/mock/countries.ts +0 -245
- package/src/components/autocomplete/__workshop__/types.ts +0 -4
- package/src/components/autocomplete/autocompleteReducer.ts +0 -47
- package/src/components/autocomplete/constants.ts +0 -28
- package/src/components/autocomplete/types.ts +0 -103
- package/src/components/breadcrumbs/Breadcrumbs.tsx +0 -163
- package/src/components/breadcrumbs/__workshop__/Example.tsx +0 -48
- package/src/components/breadcrumbs/__workshop__/index.ts +0 -16
- package/src/components/dialog/Dialog.tsx +0 -230
- package/src/components/dialog/DialogCard.tsx +0 -233
- package/src/components/dialog/DialogContext.ts +0 -21
- package/src/components/dialog/DialogProvider.tsx +0 -34
- package/src/components/dialog/__workshop__/Activate.tsx +0 -141
- package/src/components/dialog/__workshop__/AutoFocus.tsx +0 -29
- package/src/components/dialog/__workshop__/Layering.tsx +0 -41
- package/src/components/dialog/__workshop__/Nested.tsx +0 -71
- package/src/components/dialog/__workshop__/OnScroll.tsx +0 -51
- package/src/components/dialog/__workshop__/Panes.tsx +0 -75
- package/src/components/dialog/__workshop__/Position.tsx +0 -30
- package/src/components/dialog/__workshop__/Props.tsx +0 -93
- package/src/components/dialog/__workshop__/Provider.tsx +0 -11
- package/src/components/dialog/__workshop__/Wrapped.tsx +0 -76
- package/src/components/dialog/__workshop__/index.ts +0 -21
- package/src/components/dialog/isTargetWithinScope.ts +0 -14
- package/src/components/dialog/types.ts +0 -2
- package/src/components/dialog/useDialog.ts +0 -11
- package/src/components/hotkeys/Hotkeys.tsx +0 -70
- package/src/components/hotkeys/__workshop__/Plain.tsx +0 -9
- package/src/components/hotkeys/__workshop__/index.ts +0 -16
- package/src/components/menu/Menu.test.tsx +0 -125
- package/src/components/menu/Menu.tsx +0 -174
- package/src/components/menu/MenuButton.tsx +0 -231
- package/src/components/menu/MenuContext.ts +0 -19
- package/src/components/menu/MenuDivider.tsx +0 -32
- package/src/components/menu/MenuGroup.tsx +0 -240
- package/src/components/menu/MenuItem.tsx +0 -153
- package/src/components/menu/__workshop__/AsComponent.tsx +0 -45
- package/src/components/menu/__workshop__/AvatarMenu.tsx +0 -36
- package/src/components/menu/__workshop__/ClosableMenuButton.tsx +0 -47
- package/src/components/menu/__workshop__/ConstrainedInBoundary.tsx +0 -133
- package/src/components/menu/__workshop__/CustomMenuItem.tsx +0 -47
- package/src/components/menu/__workshop__/CustomSelectedState.tsx +0 -35
- package/src/components/menu/__workshop__/DataProps.tsx +0 -27
- package/src/components/menu/__workshop__/DisableFocusOnClose.tsx +0 -40
- package/src/components/menu/__workshop__/Groups.tsx +0 -164
- package/src/components/menu/__workshop__/MenuButton.tsx +0 -79
- package/src/components/menu/__workshop__/MenuGroupRight.tsx +0 -73
- package/src/components/menu/__workshop__/NestedMenu.tsx +0 -22
- package/src/components/menu/__workshop__/OnCloseMenuButton.tsx +0 -50
- package/src/components/menu/__workshop__/SelectedItem.tsx +0 -69
- package/src/components/menu/__workshop__/ShouldFocus.tsx +0 -42
- package/src/components/menu/__workshop__/Tones.tsx +0 -19
- package/src/components/menu/__workshop__/index.ts +0 -91
- package/src/components/menu/helpers.ts +0 -82
- package/src/components/menu/useMenu.ts +0 -21
- package/src/components/menu/useMenuController.ts +0 -245
- package/src/components/tab/Tab.tsx +0 -135
- package/src/components/tab/TabList.tsx +0 -157
- package/src/components/tab/TabListContext.ts +0 -10
- package/src/components/tab/TabPanel.tsx +0 -94
- package/src/components/tab/__workshop__/Example.tsx +0 -135
- package/src/components/tab/__workshop__/index.ts +0 -16
- package/src/components/tab/types.ts +0 -11
- package/src/components/toast/Toast.test.tsx +0 -103
- package/src/components/toast/Toast.tsx +0 -191
- package/src/components/toast/ToastContext.ts +0 -7
- package/src/components/toast/ToastLayer.tsx +0 -54
- package/src/components/toast/ToastProvider.tsx +0 -127
- package/src/components/toast/__workshop__/Hook.tsx +0 -71
- package/src/components/toast/__workshop__/Toast.tsx +0 -26
- package/src/components/toast/__workshop__/index.ts +0 -21
- package/src/components/toast/toastState.ts +0 -6
- package/src/components/toast/types.ts +0 -24
- package/src/components/toast/useToast.ts +0 -23
- package/src/components/tree/Tree.tsx +0 -248
- package/src/components/tree/TreeContext.ts +0 -10
- package/src/components/tree/TreeGroup.tsx +0 -46
- package/src/components/tree/TreeItem.tsx +0 -236
- package/src/components/tree/__workshop__/Basic.tsx +0 -108
- package/src/components/tree/__workshop__/TabFromElement.tsx +0 -84
- package/src/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/components/tree/__workshop__/index.ts +0 -23
- package/src/components/tree/helpers.ts +0 -105
- package/src/components/tree/types.ts +0 -24
- package/src/components/tree/useTree.ts +0 -17
- package/src/components/virtualList/VirtualList.tsx +0 -254
- package/src/components/virtualList/__workshop__/ChangingProps.tsx +0 -41
- package/src/components/virtualList/__workshop__/ElementScroll.tsx +0 -43
- package/src/components/virtualList/__workshop__/InfiniteList.tsx +0 -40
- package/src/components/virtualList/__workshop__/WindowScrolll.tsx +0 -23
- package/src/components/virtualList/__workshop__/index.ts +0 -31
- package/src/core/_keys.ts +0 -26
- package/src/core/constants.ts +0 -67
- package/src/core/getElementRef.ts +0 -29
- package/src/core/helpers/animation.ts +0 -26
- package/src/core/helpers/element.ts +0 -55
- package/src/core/helpers/focus.ts +0 -92
- package/src/core/helpers/props.ts +0 -51
- package/src/core/helpers/scroll.ts +0 -15
- package/src/core/lib/createGlobalScopedContext.ts +0 -39
- package/src/core/lib/globalScope.ts +0 -19
- package/src/core/lib/isArray.ts +0 -3
- package/src/core/lib/isRecord.ts +0 -3
- package/src/core/types.ts +0 -57
- package/src/hooks/useClickOutsideEvent.test.tsx +0 -114
- package/src/hooks/useClickOutsideEvent.ts +0 -66
- package/src/hooks/useCustomValidity.ts +0 -13
- package/src/hooks/useElementSize.ts +0 -19
- package/src/hooks/useGlobalKeyDown.ts +0 -23
- package/src/hooks/useMatchMedia.ts +0 -28
- package/src/hooks/useMediaIndex/__workshop__/Test.tsx +0 -14
- package/src/hooks/useMediaIndex/__workshop__/index.ts +0 -16
- package/src/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -21
- package/src/hooks/useMediaIndex/useMediaIndex.ts +0 -111
- package/src/hooks/useMounted.ts +0 -15
- package/src/hooks/usePrefersDark.hydration.test.tsx +0 -56
- package/src/hooks/usePrefersDark.test.tsx +0 -20
- package/src/hooks/usePrefersDark.ts +0 -16
- package/src/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
- package/src/hooks/usePrefersReducedMotion.test.tsx +0 -20
- package/src/hooks/usePrefersReducedMotion.ts +0 -16
- package/src/hooks/useResponsiveProp.ts +0 -14
- package/src/hooks/useUnique.ts +0 -54
- package/src/middleware/origin.ts +0 -47
- package/src/observers/elementSize.ts +0 -114
- package/src/primitives/_syntax/LazySyntax.tsx +0 -4
- package/src/primitives/_syntax/Syntax.tsx +0 -26
- package/src/primitives/avatar/Avatar.tsx +0 -145
- package/src/primitives/avatar/AvatarCounter.tsx +0 -69
- package/src/primitives/avatar/AvatarStack.tsx +0 -77
- package/src/primitives/avatar/__workshop__/AsButton.tsx +0 -12
- package/src/primitives/avatar/__workshop__/PropsStory.tsx +0 -24
- package/src/primitives/avatar/__workshop__/Stack.tsx +0 -27
- package/src/primitives/avatar/__workshop__/WithinButton.tsx +0 -51
- package/src/primitives/avatar/__workshop__/WithinMenuItem.tsx +0 -52
- package/src/primitives/avatar/__workshop__/index.ts +0 -36
- package/src/primitives/avatar/types.ts +0 -2
- package/src/primitives/badge/Badge.test.tsx +0 -16
- package/src/primitives/badge/Badge.tsx +0 -53
- package/src/primitives/badge/__workshop__/Props.tsx +0 -27
- package/src/primitives/badge/__workshop__/Tones.tsx +0 -15
- package/src/primitives/badge/__workshop__/index.ts +0 -26
- package/src/primitives/badge/__workshop__/within-button.tsx +0 -36
- package/src/primitives/box/Box.tsx +0 -73
- package/src/primitives/box/__workshop__/Props.tsx +0 -26
- package/src/primitives/box/__workshop__/Responsive.tsx +0 -19
- package/src/primitives/box/__workshop__/index.ts +0 -21
- package/src/primitives/button/Button.test.tsx +0 -30
- package/src/primitives/button/Button.tsx +0 -148
- package/src/primitives/button/__workshop__/Custom.tsx +0 -39
- package/src/primitives/button/__workshop__/CustomIcons.tsx +0 -37
- package/src/primitives/button/__workshop__/DataProps.tsx +0 -18
- package/src/primitives/button/__workshop__/Disabled.tsx +0 -43
- package/src/primitives/button/__workshop__/MixedChildren.tsx +0 -12
- package/src/primitives/button/__workshop__/Props.tsx +0 -60
- package/src/primitives/button/__workshop__/Stacked.tsx +0 -60
- package/src/primitives/button/__workshop__/Styled1.css.ts +0 -7
- package/src/primitives/button/__workshop__/Styled1.tsx +0 -11
- package/src/primitives/button/__workshop__/TextOverflow.tsx +0 -17
- package/src/primitives/button/__workshop__/UploadButton.tsx +0 -28
- package/src/primitives/button/__workshop__/index.ts +0 -61
- package/src/primitives/button/types.ts +0 -2
- package/src/primitives/card/Card.tsx +0 -124
- package/src/primitives/card/CardContext.ts +0 -10
- package/src/primitives/card/CardInternalContext.ts +0 -10
- package/src/primitives/card/CardInternalProvider.tsx +0 -15
- package/src/primitives/card/CardProvider.tsx +0 -16
- package/src/primitives/card/__workshop__/AsButton.tsx +0 -103
- package/src/primitives/card/__workshop__/AsComponent.tsx +0 -25
- package/src/primitives/card/__workshop__/Checkered.tsx +0 -25
- package/src/primitives/card/__workshop__/DataProps.tsx +0 -25
- package/src/primitives/card/__workshop__/Interactive.tsx +0 -29
- package/src/primitives/card/__workshop__/ListNavigation.tsx +0 -78
- package/src/primitives/card/__workshop__/Props.tsx +0 -59
- package/src/primitives/card/__workshop__/Selected.tsx +0 -62
- package/src/primitives/card/__workshop__/Styled.tsx +0 -11
- package/src/primitives/card/__workshop__/Tones.tsx +0 -26
- package/src/primitives/card/__workshop__/index.ts +0 -21
- package/src/primitives/card/types.ts +0 -21
- package/src/primitives/card/useCard.ts +0 -20
- package/src/primitives/checkbox/Checkbox.tsx +0 -80
- package/src/primitives/checkbox/__workshop__/Example.tsx +0 -25
- package/src/primitives/checkbox/__workshop__/Props.tsx +0 -35
- package/src/primitives/checkbox/__workshop__/ReadOnly.tsx +0 -16
- package/src/primitives/checkbox/__workshop__/Tones.tsx +0 -26
- package/src/primitives/checkbox/__workshop__/index.ts +0 -15
- package/src/primitives/code/Code.tsx +0 -47
- package/src/primitives/code/__workshop__/OpticalAlignment.tsx +0 -25
- package/src/primitives/code/__workshop__/Props.tsx +0 -20
- package/src/primitives/code/__workshop__/index.ts +0 -21
- package/src/primitives/container/Container.tsx +0 -43
- package/src/primitives/container/__workshop__/Example.tsx +0 -16
- package/src/primitives/container/__workshop__/index.ts +0 -16
- package/src/primitives/container/types.ts +0 -6
- package/src/primitives/flex/Flex.tsx +0 -38
- package/src/primitives/flex/__workshop__/Example.tsx +0 -26
- package/src/primitives/flex/__workshop__/Gap.tsx +0 -25
- package/src/primitives/flex/__workshop__/index.ts +0 -13
- package/src/primitives/flex/__workshop__/styles.css.ts +0 -12
- package/src/primitives/grid/Grid.tsx +0 -38
- package/src/primitives/grid/__workshop__/Responsive.tsx +0 -54
- package/src/primitives/grid/__workshop__/index.ts +0 -12
- package/src/primitives/heading/Heading.tsx +0 -68
- package/src/primitives/heading/__workshop__/OpticalAlignment.tsx +0 -27
- package/src/primitives/heading/__workshop__/Plain.tsx +0 -25
- package/src/primitives/heading/__workshop__/index.ts +0 -21
- package/src/primitives/inline/Inline.tsx +0 -37
- package/src/primitives/inline/__workshop__/Plain.tsx +0 -22
- package/src/primitives/inline/__workshop__/index.ts +0 -10
- package/src/primitives/kbd/Kbd.tsx +0 -36
- package/src/primitives/kbd/__workshop__/Plain.tsx +0 -9
- package/src/primitives/kbd/__workshop__/index.ts +0 -10
- package/src/primitives/label/Label.tsx +0 -67
- package/src/primitives/label/__workshop__/OpticalAlignment.tsx +0 -27
- package/src/primitives/label/__workshop__/Plain.tsx +0 -27
- package/src/primitives/label/__workshop__/index.ts +0 -21
- package/src/primitives/layer/Layer.test.tsx +0 -110
- package/src/primitives/layer/Layer.tsx +0 -35
- package/src/primitives/layer/LayerCard.tsx +0 -90
- package/src/primitives/layer/LayerContext.ts +0 -7
- package/src/primitives/layer/LayerProvider.tsx +0 -106
- package/src/primitives/layer/__workshop__/MultipleRoots.tsx +0 -49
- package/src/primitives/layer/__workshop__/Nested.tsx +0 -107
- package/src/primitives/layer/__workshop__/ResponsiveZOffset.tsx +0 -17
- package/src/primitives/layer/__workshop__/_debug.tsx +0 -17
- package/src/primitives/layer/__workshop__/index.ts +0 -26
- package/src/primitives/layer/getLayerContext.test.ts +0 -32
- package/src/primitives/layer/getLayerContext.ts +0 -21
- package/src/primitives/layer/types.ts +0 -9
- package/src/primitives/layer/useLayer.ts +0 -24
- package/src/primitives/popover/Popover.tsx +0 -291
- package/src/primitives/popover/PopoverLayer.tsx +0 -101
- package/src/primitives/popover/__workshop__/AlignedStory.tsx +0 -75
- package/src/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
- package/src/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
- package/src/primitives/popover/__workshop__/PlainStory.tsx +0 -67
- package/src/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
- package/src/primitives/popover/__workshop__/SidePanelStory.tsx +0 -95
- package/src/primitives/popover/__workshop__/TestStory.tsx +0 -97
- package/src/primitives/popover/__workshop__/index.ts +0 -56
- package/src/primitives/popover/__workshop__/portal-inheritance.tsx +0 -15
- package/src/primitives/popover/constants.ts +0 -20
- package/src/primitives/popover/floating-ui/size.ts +0 -75
- package/src/primitives/popover/types.ts +0 -12
- package/src/primitives/popover/useMiddleware.ts +0 -126
- package/src/primitives/radio/Radio.tsx +0 -64
- package/src/primitives/radio/__workshop__/Example.tsx +0 -63
- package/src/primitives/radio/__workshop__/Plain.tsx +0 -28
- package/src/primitives/radio/__workshop__/index.ts +0 -13
- package/src/primitives/select/Select.tsx +0 -76
- package/src/primitives/select/__workshop__/Plain.tsx +0 -37
- package/src/primitives/select/__workshop__/ReadOnly.tsx +0 -23
- package/src/primitives/select/__workshop__/index.ts +0 -13
- package/src/primitives/selectable/Selectable.tsx +0 -48
- package/src/primitives/selectable/__workshop__/DataProps.tsx +0 -24
- package/src/primitives/selectable/__workshop__/as-link.tsx +0 -13
- package/src/primitives/selectable/__workshop__/index.ts +0 -19
- package/src/primitives/skeleton/CodeSkeleton.tsx +0 -49
- package/src/primitives/skeleton/HeadingSkeleton.tsx +0 -48
- package/src/primitives/skeleton/LabelSkeleton.tsx +0 -47
- package/src/primitives/skeleton/Skeleton.tsx +0 -70
- package/src/primitives/skeleton/TextSkeleton.tsx +0 -49
- package/src/primitives/skeleton/__workshop__/Delay.tsx +0 -69
- package/src/primitives/skeleton/__workshop__/Skeleton.tsx +0 -63
- package/src/primitives/skeleton/__workshop__/index.ts +0 -13
- package/src/primitives/spinner/Spinner.tsx +0 -45
- package/src/primitives/spinner/SpinnerAnimatedIcon.tsx +0 -14
- package/src/primitives/spinner/__workshop__/Props.tsx +0 -13
- package/src/primitives/spinner/__workshop__/index.ts +0 -16
- package/src/primitives/srOnly/SrOnly.tsx +0 -33
- package/src/primitives/stack/Stack.tsx +0 -38
- package/src/primitives/stack/__workshop__/Plain.tsx +0 -30
- package/src/primitives/stack/__workshop__/index.ts +0 -16
- package/src/primitives/switch/Switch.tsx +0 -76
- package/src/primitives/switch/__workshop__/Example.tsx +0 -25
- package/src/primitives/switch/__workshop__/Props.tsx +0 -23
- package/src/primitives/switch/__workshop__/index.ts +0 -13
- package/src/primitives/text/InlineCode.tsx +0 -25
- package/src/primitives/text/Text.tsx +0 -68
- package/src/primitives/text/__workshop__/Example.tsx +0 -26
- package/src/primitives/text/__workshop__/OpticalAlignment.tsx +0 -27
- package/src/primitives/text/__workshop__/index.ts +0 -26
- package/src/primitives/text/__workshop__/inline-code.tsx +0 -13
- package/src/primitives/textArea/TextArea.tsx +0 -97
- package/src/primitives/textArea/__workshop__/Plain.tsx +0 -46
- package/src/primitives/textArea/__workshop__/index.ts +0 -16
- package/src/primitives/textInput/TextInput.tsx +0 -279
- package/src/primitives/textInput/__workshop__/ClearButton.tsx +0 -32
- package/src/primitives/textInput/__workshop__/CustomValidity.tsx +0 -17
- package/src/primitives/textInput/__workshop__/Plain.tsx +0 -102
- package/src/primitives/textInput/__workshop__/ReadOnly.tsx +0 -14
- package/src/primitives/textInput/__workshop__/States.tsx +0 -53
- package/src/primitives/textInput/__workshop__/Tones.tsx +0 -40
- package/src/primitives/textInput/__workshop__/Typed.tsx +0 -23
- package/src/primitives/textInput/__workshop__/index.ts +0 -46
- package/src/primitives/tooltip/Tooltip.test.tsx +0 -496
- package/src/primitives/tooltip/Tooltip.tsx +0 -546
- package/src/primitives/tooltip/TooltipLayer.tsx +0 -72
- package/src/primitives/tooltip/__workshop__/CustomPortal.tsx +0 -102
- package/src/primitives/tooltip/__workshop__/OverflowingBoundary.tsx +0 -74
- package/src/primitives/tooltip/__workshop__/Props.tsx +0 -107
- package/src/primitives/tooltip/__workshop__/ResizableBoundary.tsx +0 -91
- package/src/primitives/tooltip/__workshop__/index.ts +0 -31
- package/src/primitives/tooltip/constants.ts +0 -24
- package/src/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupContext.tsx +0 -13
- package/src/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupProvider.tsx +0 -96
- package/src/primitives/tooltip/tooltipDelayGroup/types.ts +0 -7
- package/src/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
- package/src/root/Root.tsx +0 -93
- package/src/root/RootProvider.tsx +0 -37
- package/src/root/__workshop__/Boundary.tsx +0 -43
- package/src/root/__workshop__/index.ts +0 -24
- package/src/root/__workshop__/primitives.tsx +0 -49
- package/src/root/__workshop__/tone-inheritance.tsx +0 -65
- package/src/utils/ErrorBoundary.tsx +0 -50
- package/src/utils/boundaryElement/BoundaryElementContext.ts +0 -7
- package/src/utils/boundaryElement/BoundaryElementProvider.tsx +0 -16
- package/src/utils/boundaryElement/__workshop__/Plain.tsx +0 -49
- package/src/utils/boundaryElement/__workshop__/index.ts +0 -16
- package/src/utils/boundaryElement/types.ts +0 -2
- package/src/utils/boundaryElement/useBoundaryElement.ts +0 -12
- package/src/utils/elementQuery/ElementQuery.tsx +0 -75
- package/src/utils/elementQuery/__workshop__/CustomMedia.tsx +0 -19
- package/src/utils/elementQuery/__workshop__/index.ts +0 -16
- package/src/utils/elementQuery/__workshop__/styles.css.ts +0 -31
- package/src/utils/elementQuery/helpers.ts +0 -27
- package/src/utils/portal/Portal.test.tsx +0 -105
- package/src/utils/portal/Portal.tsx +0 -42
- package/src/utils/portal/PortalContext.ts +0 -37
- package/src/utils/portal/PortalProvider.tsx +0 -38
- package/src/utils/portal/__workshop__/Named.tsx +0 -69
- package/src/utils/portal/__workshop__/index.ts +0 -16
- package/src/utils/portal/types.ts +0 -7
- package/src/utils/portal/usePortal.ts +0 -30
package/dist/theme.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { A as COLOR_CONFIG_INPUT_MODES, B as THEME_COLOR_BLEND_MODES, C as isColorOpacityValue, D as COLOR_CONFIG_BLEND_KEYS, E as COLOR_CONFIG_AVATAR_COLORS, F as isColorBlendModeValue, G as THEME_COLOR_SCHEMES, H as THEME_COLOR_CARD_TONES, I as isColorButtonMode, J as v2_v0, K as THEME_COLOR_STATES, L as isColorHueKey, M as COLOR_CONFIG_STATES, N as COLOR_CONFIG_STATE_KEYS, O as COLOR_CONFIG_CARD_KEYS, P as COLOR_CONFIG_STATE_TONES, R as isColorTintKey, S as isColorConfigStateTone, T as isColorValue, U as THEME_COLOR_INPUT_MODES, V as THEME_COLOR_BUTTON_MODES, W as THEME_COLOR_INPUT_STATES, _ as parseTokenValue, a as createColorTheme, b as isColorConfigBlendKey, c as multiply, d as hexToRgb, f as hslToRgb, g as mix, h as rgbaToRGBA, i as getTheme_v2, j as COLOR_CONFIG_INPUT_STATES, k as COLOR_CONFIG_CARD_TONES, l as rgba, m as rgbToHsl, n as v0_v2, o as buildTheme, p as rgbToHex, q as THEME_COLOR_STATE_TONES, r as is_v2, s as screen, t as getScopedTheme, u as parseColor, v as isColorConfigBaseKey, w as isColorTokenValue, x as isColorConfigStateKey, y as isColorConfigBaseTone, z as THEME_COLOR_AVATAR_COLORS } from "./_chunks/getScopedTheme.js";
|
|
2
|
+
/** @internal */
|
|
3
|
+
function getContrastRatio(bg, fg) {
|
|
4
|
+
let rgb1 = parseColor(bg), rgb2 = parseColor(fg), c1 = rgb_lrgb(rgb1), c2 = rgb_lrgb(rgb2), l1 = lrgb_luminance(c1), l2 = lrgb_luminance(c2);
|
|
5
|
+
return (Math.max(l1, l2) + .05) / (Math.min(l1, l2) + .05);
|
|
6
|
+
}
|
|
7
|
+
function rgb_lrgb({ r, g, b }) {
|
|
8
|
+
return [
|
|
9
|
+
rgb_lrgb1(r / 255),
|
|
10
|
+
rgb_lrgb1(g / 255),
|
|
11
|
+
rgb_lrgb1(b / 255)
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
function rgb_lrgb1(v) {
|
|
15
|
+
return v <= .04045 ? v / 12.92 : ((v + .055) / 1.055) ** 2.4;
|
|
16
|
+
}
|
|
17
|
+
function lrgb_luminance([r, g, b]) {
|
|
18
|
+
return .2126 * r + .7152 * g + .0722 * b;
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
function parseTokenKey(str) {
|
|
22
|
+
let segments = str.split("/"), segment0 = segments.shift() || "";
|
|
23
|
+
if (isColorConfigBaseTone(segment0)) {
|
|
24
|
+
let key = segments.join("/");
|
|
25
|
+
if (isColorConfigBaseKey(key) || isColorConfigBlendKey(key)) return {
|
|
26
|
+
type: "base",
|
|
27
|
+
tone: segment0,
|
|
28
|
+
key
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (segment0 === "button") {
|
|
32
|
+
let segment1 = segments.shift() || "";
|
|
33
|
+
if (isColorConfigStateTone(segment1)) {
|
|
34
|
+
let segment2 = segments.shift() || "";
|
|
35
|
+
if (isColorButtonMode(segment2)) {
|
|
36
|
+
let key = segments.join("/");
|
|
37
|
+
if (isColorConfigStateKey(key) || isColorConfigBlendKey(key)) return {
|
|
38
|
+
type: "button",
|
|
39
|
+
tone: segment1,
|
|
40
|
+
mode: segment2,
|
|
41
|
+
key
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** @internal */
|
|
48
|
+
function is_v0(themeProp) {
|
|
49
|
+
return themeProp._version === 0;
|
|
50
|
+
}
|
|
51
|
+
export { COLOR_CONFIG_AVATAR_COLORS, COLOR_CONFIG_BLEND_KEYS, COLOR_CONFIG_CARD_KEYS, COLOR_CONFIG_CARD_TONES, COLOR_CONFIG_INPUT_MODES, COLOR_CONFIG_INPUT_STATES, COLOR_CONFIG_STATES, COLOR_CONFIG_STATE_KEYS, COLOR_CONFIG_STATE_TONES, THEME_COLOR_AVATAR_COLORS, THEME_COLOR_BLEND_MODES, THEME_COLOR_BUTTON_MODES, THEME_COLOR_CARD_TONES, THEME_COLOR_INPUT_MODES, THEME_COLOR_INPUT_STATES, THEME_COLOR_SCHEMES, THEME_COLOR_STATES, THEME_COLOR_STATE_TONES, buildTheme, createColorTheme, getContrastRatio, getScopedTheme, getTheme_v2, hexToRgb, hslToRgb, isColorBlendModeValue, isColorButtonMode, isColorConfigBaseKey, isColorConfigBaseTone, isColorConfigBlendKey, isColorConfigStateKey, isColorConfigStateTone, isColorHueKey, isColorOpacityValue, isColorTintKey, isColorTokenValue, isColorValue, is_v0, is_v2, mix, multiply, parseColor, parseTokenKey, parseTokenValue, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen, v0_v2, v2_v0 };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","names":["parseColor","RGB","RGBA","getContrastRatio","bg","fg","rgb1","rgb2","c1","rgb_lrgb","c2","l1","lrgb_luminance","l2","Math","max","min","r","g","b","rgb_lrgb1","v","isColorButtonMode","isColorConfigBaseKey","isColorConfigBaseTone","isColorConfigBlendKey","isColorConfigStateKey","isColorConfigStateTone","TokenKeyNode","parseTokenKey","str","segments","split","segment0","shift","key","join","type","tone","segment1","segment2","mode","undefined"],"sources":["../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/versioning/is_v0.ts"],"sourcesContent":["import {parseColor} from './parse'\nimport {RGB, RGBA} from './types'\n\n/** @internal */\nexport function getContrastRatio(bg: string, fg: string): number {\n const rgb1 = parseColor(bg) // bg: RGB | RGBA, fg: RGB | RGBA\n const rgb2 = parseColor(fg)\n\n // convert the two colors from sRGB to linear-light RGB\n const c1 = rgb_lrgb(rgb1)\n const c2 = rgb_lrgb(rgb2)\n\n // compute the relative luminances\n const l1 = lrgb_luminance(c1)\n const l2 = lrgb_luminance(c2)\n\n // compute the contrast ratio\n return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05)\n}\n\nfunction rgb_lrgb({r, g, b}: RGB | RGBA): [number, number, number] {\n return [rgb_lrgb1(r / 255), rgb_lrgb1(g / 255), rgb_lrgb1(b / 255)]\n}\n\nfunction rgb_lrgb1(v: number) {\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4\n}\n\nfunction lrgb_luminance([r, g, b]: [number, number, number]) {\n return 0.2126 * r + 0.7152 * g + 0.0722 * b\n}\n","import {isColorButtonMode} from '../../system/color/_helpers'\nimport {\n isColorConfigBaseKey,\n isColorConfigBaseTone,\n isColorConfigBlendKey,\n isColorConfigStateKey,\n isColorConfigStateTone,\n} from '../helpers'\nimport {TokenKeyNode} from './types'\n\n/** @internal */\nexport function parseTokenKey(str: string): TokenKeyNode | undefined {\n const segments = str.split('/')\n const segment0 = segments.shift() || ''\n\n if (isColorConfigBaseTone(segment0)) {\n const key = segments.join('/')\n\n if (isColorConfigBaseKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n }\n\n if (segment0 === 'button') {\n const segment1 = segments.shift() || ''\n\n if (isColorConfigStateTone(segment1)) {\n const segment2 = segments.shift() || ''\n\n if (isColorButtonMode(segment2)) {\n const key = segments.join('/')\n\n if (isColorConfigStateKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n }\n }\n }\n\n return undefined\n}\n","import {RootTheme, RootTheme_v2} from '../system/theme'\n\n/** @internal */\nexport function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme {\n return themeProp._version === 0\n}\n"],"mappings":";;AAIA,SAAgBG,iBAAiBC,IAAYC,IAAoB;CAC/D,IAAMC,OAAON,WAAWI,EAAE,GACpBG,OAAOP,WAAWK,EAAE,GAGpBG,KAAKC,SAASH,IAAI,GAClBI,KAAKD,SAASF,IAAI,GAGlBI,KAAKC,eAAeJ,EAAE,GACtBK,KAAKD,eAAeF,EAAE;CAG5B,QAAQI,KAAKC,IAAIJ,IAAIE,EAAE,IAAI,QAASC,KAAKE,IAAIL,IAAIE,EAAE,IAAI;AACzD;AAEA,SAASJ,SAAS,EAACQ,GAAGC,GAAGC,KAA0C;CACjE,OAAO;EAACC,UAAUH,IAAI,GAAG;EAAGG,UAAUF,IAAI,GAAG;EAAGE,UAAUD,IAAI,GAAG;CAAC;AACpE;AAEA,SAASC,UAAUC,GAAW;CAC5B,OAAOA,KAAK,SAAUA,IAAI,UAAUA,IAAI,QAAS,UAAU;AAC7D;AAEA,SAAST,eAAe,CAACK,GAAGC,GAAGC,IAA8B;CAC3D,OAAO,QAASF,IAAI,QAASC,IAAI,QAASC;AAC5C;;ACnBA,SAAgBU,cAAcC,KAAuC;CACnE,IAAMC,WAAWD,IAAIE,MAAM,GAAG,GACxBC,WAAWF,SAASG,MAAM,KAAK;CAErC,IAAIV,sBAAsBS,QAAQ,GAAG;EACnC,IAAME,MAAMJ,SAASK,KAAK,GAAG;EAU7B,IARIb,qBAAqBY,GAAG,KAQxBV,sBAAsBU,GAAG,GAC3B,OAAO;GACLE,MAAM;GACNC,MAAML;GACNE;EACF;CAEJ;CAEA,IAAIF,aAAa,UAAU;EACzB,IAAMM,WAAWR,SAASG,MAAM,KAAK;EAErC,IAAIP,uBAAuBY,QAAQ,GAAG;GACpC,IAAMC,WAAWT,SAASG,MAAM,KAAK;GAErC,IAAIZ,kBAAkBkB,QAAQ,GAAG;IAC/B,IAAML,MAAMJ,SAASK,KAAK,GAAG;IAW7B,IATIV,sBAAsBS,GAAG,KASzBV,sBAAsBU,GAAG,GAC3B,OAAO;KACLE,MAAM;KACNC,MAAMC;KACNE,MAAMD;KACNL;IACF;GAEJ;EACF;CACF;AAGF;;AC/DA,SAAgB,MAAM,WAA6D;CACjF,OAAO,UAAU,aAAa;AAChC"}
|
package/package.json
CHANGED
|
@@ -1,129 +1,106 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-next.0",
|
|
4
4
|
"keywords": [
|
|
5
|
-
"react",
|
|
6
|
-
"ui",
|
|
7
|
-
"kit",
|
|
8
|
-
"library",
|
|
9
|
-
"primitives",
|
|
10
5
|
"components",
|
|
11
|
-
"
|
|
6
|
+
"design-system",
|
|
7
|
+
"primitives",
|
|
8
|
+
"react",
|
|
9
|
+
"sanity",
|
|
10
|
+
"ui"
|
|
12
11
|
],
|
|
13
|
-
"homepage": "https://www.sanity.io/
|
|
12
|
+
"homepage": "https://www.sanity.io/",
|
|
14
13
|
"bugs": {
|
|
15
14
|
"url": "https://github.com/sanity-io/ui/issues"
|
|
16
15
|
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "Sanity.io <hello@sanity.io>",
|
|
17
18
|
"repository": {
|
|
18
19
|
"type": "git",
|
|
19
20
|
"url": "git+https://github.com/sanity-io/ui.git",
|
|
20
21
|
"directory": "packages/ui"
|
|
21
22
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"sideEffects": [
|
|
25
|
-
"*.css"
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
26
25
|
],
|
|
27
26
|
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.cts",
|
|
31
|
+
"typesVersions": {
|
|
32
|
+
"*": {
|
|
33
|
+
"_visual-editing": [
|
|
34
|
+
"./dist/_visual-editing.d.cts"
|
|
35
|
+
],
|
|
36
|
+
"theme": [
|
|
37
|
+
"./dist/theme.d.cts"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
28
41
|
"exports": {
|
|
29
42
|
".": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
43
|
+
"import": "./dist/index.js",
|
|
44
|
+
"require": "./dist/index.cjs"
|
|
45
|
+
},
|
|
46
|
+
"./_visual-editing": {
|
|
47
|
+
"import": "./dist/_visual-editing.js",
|
|
48
|
+
"require": "./dist/_visual-editing.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./theme": {
|
|
51
|
+
"import": "./dist/theme.js",
|
|
52
|
+
"require": "./dist/theme.cjs"
|
|
32
53
|
},
|
|
33
|
-
"./index.css": "./dist/index.css",
|
|
34
54
|
"./package.json": "./package.json"
|
|
35
55
|
},
|
|
36
|
-
"main": "./dist/index.js",
|
|
37
|
-
"types": "./dist/index.d.ts",
|
|
38
|
-
"files": [
|
|
39
|
-
"dist",
|
|
40
|
-
"exports",
|
|
41
|
-
"src"
|
|
42
|
-
],
|
|
43
|
-
"browserslist": "extends @sanity/browserslist-config",
|
|
44
56
|
"dependencies": {
|
|
45
|
-
"@floating-ui/react-dom": "^2.1.
|
|
46
|
-
"@
|
|
47
|
-
"@sanity/icons": "^3.7.4",
|
|
48
|
-
"@vanilla-extract/dynamic": "^2.1.5",
|
|
57
|
+
"@floating-ui/react-dom": "^2.1.9",
|
|
58
|
+
"@juggle/resize-observer": "^3.4.0",
|
|
49
59
|
"csstype": "^3.2.3",
|
|
50
|
-
"motion": "^12.
|
|
60
|
+
"motion": "^12.43.0",
|
|
61
|
+
"react-compiler-runtime": "1.0.0",
|
|
62
|
+
"react-is": "^19.2.8",
|
|
51
63
|
"react-refractor": "^4.0.0",
|
|
52
|
-
"
|
|
53
|
-
"@sanity/
|
|
64
|
+
"use-effect-event": "^2.0.3",
|
|
65
|
+
"@sanity/color": "^3.0.8",
|
|
66
|
+
"@sanity/icons": "^5.2.1"
|
|
54
67
|
},
|
|
55
68
|
"devDependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@babel/preset-env": "^7.29.2",
|
|
58
|
-
"@babel/preset-react": "^7.28.5",
|
|
59
|
-
"@babel/preset-typescript": "^7.28.5",
|
|
60
|
-
"@playwright/test": "^1.59.1",
|
|
61
|
-
"@sanity/browserslist-config": "^1.0.5",
|
|
62
|
-
"@sanity/pkg-utils": "^10.4.14",
|
|
63
|
-
"@sanity/prettier-config": "^3.0.0",
|
|
69
|
+
"@sanity/tsdown-config": "^0.21.2",
|
|
64
70
|
"@testing-library/dom": "^10.4.1",
|
|
65
|
-
"@testing-library/jest-dom": "^
|
|
71
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
66
72
|
"@testing-library/react": "^16.3.2",
|
|
67
73
|
"@testing-library/user-event": "^14.6.1",
|
|
68
|
-
"@types/node": "^24.
|
|
69
|
-
"@types/react": "^19.2.
|
|
74
|
+
"@types/node": "^24.13.3",
|
|
75
|
+
"@types/react": "^19.2.17",
|
|
70
76
|
"@types/react-dom": "^19.2.3",
|
|
71
77
|
"@types/react-is": "^19.2.0",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"rimraf": "^6.1.3",
|
|
85
|
-
"tsconfig-paths": "^4.2.0",
|
|
86
|
-
"tsx": "^4.21.0",
|
|
87
|
-
"typescript": "6.0.2",
|
|
88
|
-
"vite": "^8.0.8",
|
|
89
|
-
"vite-tsconfig-paths": "^6.1.1",
|
|
90
|
-
"vitest": "^4.1.4",
|
|
91
|
-
"vitest-axe": "1.0.0-pre.5",
|
|
92
|
-
"@repo/typescript-config": "0.0.0",
|
|
93
|
-
"@repo/eslint-config": "0.0.0"
|
|
78
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
79
|
+
"jsdom": "^30.0.1",
|
|
80
|
+
"react": "^19.2.8",
|
|
81
|
+
"react-dom": "^19.2.8",
|
|
82
|
+
"rimraf": "^5.0.5",
|
|
83
|
+
"styled-components": "^6.4.4",
|
|
84
|
+
"tsdown": "^0.22.14",
|
|
85
|
+
"typescript": "7.0.2",
|
|
86
|
+
"unrun": "^0.3.1",
|
|
87
|
+
"vite": "^8.1.5",
|
|
88
|
+
"vitest": "^4.1.10",
|
|
89
|
+
"vitest-axe": "^1.0.0-pre.5"
|
|
94
90
|
},
|
|
95
91
|
"peerDependencies": {
|
|
96
|
-
"react": "^19.
|
|
97
|
-
"react-dom": "^19.
|
|
98
|
-
"
|
|
92
|
+
"react": "^18 || >=19.0.0-0",
|
|
93
|
+
"react-dom": "^18 || >=19.0.0-0",
|
|
94
|
+
"styled-components": "^5.2 || ^6"
|
|
99
95
|
},
|
|
100
96
|
"engines": {
|
|
101
97
|
"node": ">=20.19 <22 || >=22.12"
|
|
102
98
|
},
|
|
103
|
-
"publishConfig": {
|
|
104
|
-
"access": "public"
|
|
105
|
-
},
|
|
106
|
-
"esm.sh": {
|
|
107
|
-
"bundle": false
|
|
108
|
-
},
|
|
109
99
|
"scripts": {
|
|
110
|
-
"
|
|
111
|
-
"build": "run-s pkg:build pkg:check",
|
|
100
|
+
"build": "tsdown",
|
|
112
101
|
"clean": "rimraf dist",
|
|
113
|
-
"dev": "pnpm workshop:dev",
|
|
114
|
-
"figma:build": "pnpm run --filter 'figma-plugin-sanity-ui' build",
|
|
115
|
-
"format": "prettier --write --cache --ignore-unknown .",
|
|
116
|
-
"lint": "eslint .",
|
|
117
|
-
"pkg:build": "NODE_ENV=production pkg build --strict",
|
|
118
|
-
"pkg:check": "pkg --strict",
|
|
119
|
-
"playwright:dev": "PLAYWRIGHT_DEV=true playwright test --ui",
|
|
120
102
|
"test": "vitest run",
|
|
121
|
-
"test:
|
|
122
|
-
"
|
|
123
|
-
"test:e2e:ui": "playwright test --ui",
|
|
124
|
-
"typecheck": "tsc --build",
|
|
125
|
-
"workshop:build": "rimraf .workshop && workshop build",
|
|
126
|
-
"workshop:dev": "rimraf .workshop && workshop dev",
|
|
127
|
-
"workshop:preview": "workshop preview"
|
|
103
|
+
"test:watch": "vitest",
|
|
104
|
+
"watch": "tsdown --watch"
|
|
128
105
|
}
|
|
129
106
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { _syntax } from "@sanity/ui-css";
|
|
4
|
-
import { hasLanguage, Refractor } from "react-refractor";
|
|
5
|
-
function Syntax(props) {
|
|
6
|
-
const $ = c(6), {
|
|
7
|
-
language: languageProp,
|
|
8
|
-
value
|
|
9
|
-
} = props, language = typeof languageProp == "string" ? languageProp : void 0, registered = language ? hasLanguage(language) : !1;
|
|
10
|
-
if (!language || !registered) {
|
|
11
|
-
let t02;
|
|
12
|
-
return $[0] !== value ? (t02 = /* @__PURE__ */ jsx("code", { children: value }), $[0] = value, $[1] = t02) : t02 = $[1], t02;
|
|
13
|
-
}
|
|
14
|
-
let t0;
|
|
15
|
-
$[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = _syntax(), $[2] = t0) : t0 = $[2];
|
|
16
|
-
const t1 = typeof value == "string" ? value : "";
|
|
17
|
-
let t2;
|
|
18
|
-
return $[3] !== language || $[4] !== t1 ? (t2 = /* @__PURE__ */ jsx(Refractor, { className: t0, inline: !0, language, value: t1 }), $[3] = language, $[4] = t1, $[5] = t2) : t2 = $[5], t2;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
Syntax as default
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=Syntax.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Syntax.js","sources":["../../src/primitives/_syntax/Syntax.tsx"],"sourcesContent":["import {_syntax} from '@sanity/ui-css'\nimport {hasLanguage, Refractor} from 'react-refractor'\n\nexport interface SyntaxProps {\n language?: string\n value: React.ReactNode\n}\n\nexport default function Syntax(props: SyntaxProps): React.JSX.Element {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n const registered = language ? hasLanguage(language) : false\n\n if (!language || !registered) {\n return <code>{value}</code>\n }\n\n return (\n <Refractor\n className={_syntax()}\n inline\n language={language}\n value={typeof value === 'string' ? value : ''}\n />\n )\n}\n"],"names":["Syntax","props","$","_c","language","languageProp","value","undefined","registered","hasLanguage","t0","Symbol","for","_syntax","t1","t2"],"mappings":";;;;AAQA,SAAeA,OAAAC,OAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA,GACb;AAAA,IAAAC,UAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAxBA,eAAAE,QACjBC,aAAmBJ,WAAWK,YAAYL,QAAgB,IAAvC;AAEnB,MAAI,CAACA,YAAD,CAAcI,YAAU;AAAA,QAAAE;AAAA,WAAAR,SAAAI,SACnBI,MAAA,oBAAA,QAAA,EAAOJ,iBAAM,GAAOJ,OAAAI,OAAAJ,OAAAQ,OAAAA,MAAAR,EAAA,CAAA,GAApBQ;AAAAA,EAAoB;AAC5B,MAAAA;AAAAR,IAAA,CAAA,MAAAS,uBAAAC,IAAA,2BAAA,KAIcF,KAAAG,QAAAA,GAASX,OAAAQ,MAAAA,KAAAR,EAAA,CAAA;AAGb,QAAAY,YAAOR,SAAU,WAAjBA,QAAA;AAAsC,MAAAS;AAAA,SAAAb,EAAA,CAAA,MAAAE,YAAAF,SAAAY,MAJ/CC,yBAAC,WAAA,EACY,WAAAL,IACX,QAAA,IACUN,UACH,OAAAU,GAAAA,CAAsC,GAC7CZ,OAAAE,UAAAF,OAAAY,IAAAZ,OAAAa,MAAAA,KAAAb,EAAA,CAAA,GALFa;AAKE;"}
|
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import '@sanity/ui-css/index.css';
|
package/exports/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import '@sanity/ui-css/index.css';
|
package/exports/index.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
// re-export css (types, constants and vars)
|
|
2
|
-
export type {ResponsiveProp} from '@sanity/ui-css'
|
|
3
|
-
export {BREAKPOINTS, vars} from '@sanity/ui-css'
|
|
4
|
-
|
|
5
|
-
// re-export tokens (types and constants)
|
|
6
|
-
export type * from '@sanity/ui-tokens'
|
|
7
|
-
export * from '@sanity/ui-tokens/constants'
|
|
8
|
-
|
|
9
|
-
// components
|
|
10
|
-
export * from '../src/components/autocomplete/Autocomplete'
|
|
11
|
-
export * from '../src/components/autocomplete/types'
|
|
12
|
-
export * from '../src/components/breadcrumbs/Breadcrumbs'
|
|
13
|
-
export * from '../src/components/dialog/Dialog'
|
|
14
|
-
export * from '../src/components/dialog/DialogContext'
|
|
15
|
-
export * from '../src/components/dialog/DialogProvider'
|
|
16
|
-
export * from '../src/components/dialog/types'
|
|
17
|
-
export * from '../src/components/dialog/useDialog'
|
|
18
|
-
export * from '../src/components/hotkeys/Hotkeys'
|
|
19
|
-
export * from '../src/components/menu/Menu'
|
|
20
|
-
export * from '../src/components/menu/MenuButton'
|
|
21
|
-
export * from '../src/components/menu/MenuDivider'
|
|
22
|
-
export * from '../src/components/menu/MenuGroup'
|
|
23
|
-
export * from '../src/components/menu/MenuItem'
|
|
24
|
-
export * from '../src/components/tab/Tab'
|
|
25
|
-
export * from '../src/components/tab/TabList'
|
|
26
|
-
export * from '../src/components/tab/TabPanel'
|
|
27
|
-
export * from '../src/components/toast/Toast'
|
|
28
|
-
export * from '../src/components/toast/ToastProvider'
|
|
29
|
-
export * from '../src/components/toast/types'
|
|
30
|
-
export * from '../src/components/toast/useToast'
|
|
31
|
-
export * from '../src/components/tree/Tree'
|
|
32
|
-
export * from '../src/components/tree/TreeItem'
|
|
33
|
-
export * from '../src/components/tree/types'
|
|
34
|
-
export * from '../src/components/tree/useTree'
|
|
35
|
-
export * from '../src/components/virtualList/VirtualList'
|
|
36
|
-
|
|
37
|
-
// helpers
|
|
38
|
-
export * from '../src/core/helpers/animation'
|
|
39
|
-
export * from '../src/core/helpers/element'
|
|
40
|
-
export * from '../src/core/helpers/focus'
|
|
41
|
-
export * from '../src/core/helpers/props'
|
|
42
|
-
export * from '../src/core/helpers/scroll'
|
|
43
|
-
|
|
44
|
-
// hooks
|
|
45
|
-
export * from '../src/hooks/useClickOutsideEvent'
|
|
46
|
-
export * from '../src/hooks/useCustomValidity'
|
|
47
|
-
export * from '../src/hooks/useElementSize'
|
|
48
|
-
export * from '../src/hooks/useGlobalKeyDown'
|
|
49
|
-
export * from '../src/hooks/useMatchMedia'
|
|
50
|
-
export * from '../src/hooks/useMediaIndex/useMediaIndex'
|
|
51
|
-
export * from '../src/hooks/usePrefersDark'
|
|
52
|
-
export * from '../src/hooks/usePrefersReducedMotion'
|
|
53
|
-
|
|
54
|
-
// observers
|
|
55
|
-
export * from '../src/observers/elementSize'
|
|
56
|
-
|
|
57
|
-
// primitives
|
|
58
|
-
export * from '../src/primitives/_syntax/LazySyntax'
|
|
59
|
-
export * from '../src/primitives/avatar/Avatar'
|
|
60
|
-
export * from '../src/primitives/avatar/AvatarCounter'
|
|
61
|
-
export * from '../src/primitives/avatar/AvatarStack'
|
|
62
|
-
export * from '../src/primitives/avatar/types'
|
|
63
|
-
export * from '../src/primitives/badge/Badge'
|
|
64
|
-
export * from '../src/primitives/box/Box'
|
|
65
|
-
export * from '../src/primitives/button/Button'
|
|
66
|
-
export * from '../src/primitives/button/types'
|
|
67
|
-
export * from '../src/primitives/card/Card'
|
|
68
|
-
export * from '../src/primitives/card/CardProvider'
|
|
69
|
-
export * from '../src/primitives/card/types'
|
|
70
|
-
export {useCard} from '../src/primitives/card/useCard'
|
|
71
|
-
export * from '../src/primitives/checkbox/Checkbox'
|
|
72
|
-
export * from '../src/primitives/code/Code'
|
|
73
|
-
export * from '../src/primitives/container/Container'
|
|
74
|
-
export * from '../src/primitives/container/types'
|
|
75
|
-
export * from '../src/primitives/flex/Flex'
|
|
76
|
-
export * from '../src/primitives/grid/Grid'
|
|
77
|
-
export * from '../src/primitives/heading/Heading'
|
|
78
|
-
export * from '../src/primitives/inline/Inline'
|
|
79
|
-
export * from '../src/primitives/kbd/Kbd'
|
|
80
|
-
export * from '../src/primitives/label/Label'
|
|
81
|
-
export * from '../src/primitives/layer/Layer'
|
|
82
|
-
export * from '../src/primitives/layer/LayerProvider'
|
|
83
|
-
export * from '../src/primitives/layer/types'
|
|
84
|
-
export * from '../src/primitives/layer/useLayer'
|
|
85
|
-
export * from '../src/primitives/popover/Popover'
|
|
86
|
-
export * from '../src/primitives/popover/types'
|
|
87
|
-
export * from '../src/primitives/radio/Radio'
|
|
88
|
-
export * from '../src/primitives/select/Select'
|
|
89
|
-
export * from '../src/primitives/selectable/Selectable'
|
|
90
|
-
export * from '../src/primitives/skeleton/CodeSkeleton'
|
|
91
|
-
export * from '../src/primitives/skeleton/HeadingSkeleton'
|
|
92
|
-
export * from '../src/primitives/skeleton/LabelSkeleton'
|
|
93
|
-
export * from '../src/primitives/skeleton/Skeleton'
|
|
94
|
-
export * from '../src/primitives/skeleton/TextSkeleton'
|
|
95
|
-
export * from '../src/primitives/spinner/Spinner'
|
|
96
|
-
export * from '../src/primitives/srOnly/SrOnly'
|
|
97
|
-
export * from '../src/primitives/stack/Stack'
|
|
98
|
-
export * from '../src/primitives/switch/Switch'
|
|
99
|
-
export * from '../src/primitives/text/InlineCode'
|
|
100
|
-
export * from '../src/primitives/text/Text'
|
|
101
|
-
export * from '../src/primitives/textArea/TextArea'
|
|
102
|
-
export * from '../src/primitives/textInput/TextInput'
|
|
103
|
-
export * from '../src/primitives/tooltip/Tooltip'
|
|
104
|
-
export * from '../src/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupContext'
|
|
105
|
-
export * from '../src/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupProvider'
|
|
106
|
-
export * from '../src/primitives/tooltip/tooltipDelayGroup/types'
|
|
107
|
-
export {useTooltipDelayGroup} from '../src/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup'
|
|
108
|
-
|
|
109
|
-
// utils
|
|
110
|
-
export * from '../src/utils/boundaryElement/BoundaryElementProvider'
|
|
111
|
-
export * from '../src/utils/boundaryElement/types'
|
|
112
|
-
export {useBoundaryElement} from '../src/utils/boundaryElement/useBoundaryElement'
|
|
113
|
-
export * from '../src/utils/elementQuery/ElementQuery'
|
|
114
|
-
export * from '../src/utils/ErrorBoundary'
|
|
115
|
-
export * from '../src/utils/portal/Portal'
|
|
116
|
-
export * from '../src/utils/portal/PortalProvider'
|
|
117
|
-
export * from '../src/utils/portal/types'
|
|
118
|
-
export {usePortal} from '../src/utils/portal/usePortal'
|
|
119
|
-
|
|
120
|
-
// root
|
|
121
|
-
export * from '../src/root/Root'
|
|
122
|
-
export * from '../src/root/RootProvider'
|
|
123
|
-
|
|
124
|
-
// types
|
|
125
|
-
export * from '../src/core/types'
|