@sanity/ui 0.37.3 → 0.37.6-next.18
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/lib/dts/components/autocomplete/autocomplete.d.ts +56 -0
- package/lib/dts/components/autocomplete/autocomplete.d.ts.map +1 -0
- package/lib/dts/components/autocomplete/autocomplete.styles.d.ts +18 -0
- package/lib/dts/components/autocomplete/autocomplete.styles.d.ts.map +1 -0
- package/lib/dts/components/autocomplete/autocompleteOption.d.ts +10 -0
- package/lib/dts/components/autocomplete/autocompleteOption.d.ts.map +1 -0
- package/lib/dts/components/autocomplete/autocompleteReducer.d.ts +6 -0
- package/lib/dts/components/autocomplete/autocompleteReducer.d.ts.map +1 -0
- package/lib/dts/components/autocomplete/constants.d.ts +22 -0
- package/lib/dts/components/autocomplete/constants.d.ts.map +1 -0
- package/lib/dts/components/autocomplete/index.d.ts +3 -0
- package/lib/dts/components/autocomplete/index.d.ts.map +1 -0
- package/lib/dts/components/autocomplete/types.d.ts +87 -0
- package/lib/dts/components/autocomplete/types.d.ts.map +1 -0
- package/lib/dts/components/breadcrumbs/breadcrumbs.d.ts +14 -0
- package/lib/dts/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/lib/dts/components/breadcrumbs/breadcrumbs.styles.d.ts +4 -0
- package/lib/dts/components/breadcrumbs/breadcrumbs.styles.d.ts.map +1 -0
- package/lib/dts/components/breadcrumbs/index.d.ts +2 -0
- package/lib/dts/components/breadcrumbs/index.d.ts.map +1 -0
- package/lib/dts/components/dialog/dialog.d.ts +34 -0
- package/lib/dts/components/dialog/dialog.d.ts.map +1 -0
- package/lib/dts/components/dialog/dialogContext.d.ts +16 -0
- package/lib/dts/components/dialog/dialogContext.d.ts.map +1 -0
- package/lib/dts/components/dialog/dialogProvider.d.ts +17 -0
- package/lib/dts/components/dialog/dialogProvider.d.ts.map +1 -0
- package/lib/dts/components/dialog/index.d.ts +5 -0
- package/lib/dts/components/dialog/index.d.ts.map +1 -0
- package/lib/dts/components/dialog/styles.d.ts +12 -0
- package/lib/dts/components/dialog/styles.d.ts.map +1 -0
- package/lib/dts/components/dialog/useDialog.d.ts +7 -0
- package/lib/dts/components/dialog/useDialog.d.ts.map +1 -0
- package/lib/dts/components/hotkeys/hotkeys.d.ts +16 -0
- package/lib/dts/components/hotkeys/hotkeys.d.ts.map +1 -0
- package/lib/dts/components/hotkeys/index.d.ts +2 -0
- package/lib/dts/components/hotkeys/index.d.ts.map +1 -0
- package/lib/dts/components/index.d.ts +10 -0
- package/lib/dts/components/index.d.ts.map +1 -0
- package/lib/dts/components/menu/helpers.d.ts +13 -0
- package/lib/dts/components/menu/helpers.d.ts.map +1 -0
- package/lib/dts/components/menu/index.d.ts +6 -0
- package/lib/dts/components/menu/index.d.ts.map +1 -0
- package/lib/dts/components/menu/menu.d.ts +28 -0
- package/lib/dts/components/menu/menu.d.ts.map +1 -0
- package/lib/dts/components/menu/menuButton.d.ts +48 -0
- package/lib/dts/components/menu/menuButton.d.ts.map +1 -0
- package/lib/dts/components/menu/menuContext.d.ts +23 -0
- package/lib/dts/components/menu/menuContext.d.ts.map +1 -0
- package/lib/dts/components/menu/menuDivider.d.ts +7 -0
- package/lib/dts/components/menu/menuDivider.d.ts.map +1 -0
- package/lib/dts/components/menu/menuGroup.d.ts +22 -0
- package/lib/dts/components/menu/menuGroup.d.ts.map +1 -0
- package/lib/dts/components/menu/menuItem.d.ts +23 -0
- package/lib/dts/components/menu/menuItem.d.ts.map +1 -0
- package/lib/dts/components/menu/useMenu.d.ts +3 -0
- package/lib/dts/components/menu/useMenu.d.ts.map +1 -0
- package/lib/dts/components/menu/useMenuController.d.ts +25 -0
- package/lib/dts/components/menu/useMenuController.d.ts.map +1 -0
- package/lib/dts/components/skeleton/index.d.ts +3 -0
- package/lib/dts/components/skeleton/index.d.ts.map +1 -0
- package/lib/dts/components/skeleton/skeleton.d.ts +16 -0
- package/lib/dts/components/skeleton/skeleton.d.ts.map +1 -0
- package/lib/dts/components/skeleton/styles.d.ts +9 -0
- package/lib/dts/components/skeleton/styles.d.ts.map +1 -0
- package/lib/dts/components/skeleton/textSkeleton.d.ts +51 -0
- package/lib/dts/components/skeleton/textSkeleton.d.ts.map +1 -0
- package/lib/dts/components/tab/index.d.ts +4 -0
- package/lib/dts/components/tab/index.d.ts.map +1 -0
- package/lib/dts/components/tab/tab.d.ts +24 -0
- package/lib/dts/components/tab/tab.d.ts.map +1 -0
- package/lib/dts/components/tab/tabList.d.ts +13 -0
- package/lib/dts/components/tab/tabList.d.ts.map +1 -0
- package/lib/dts/components/tab/tabPanel.d.ts +17 -0
- package/lib/dts/components/tab/tabPanel.d.ts.map +1 -0
- package/lib/dts/components/toast/index.d.ts +5 -0
- package/lib/dts/components/toast/index.d.ts.map +1 -0
- package/lib/dts/components/toast/toast.d.ts +16 -0
- package/lib/dts/components/toast/toast.d.ts.map +1 -0
- package/lib/dts/components/toast/toastContext.d.ts +4 -0
- package/lib/dts/components/toast/toastContext.d.ts.map +1 -0
- package/lib/dts/components/toast/toastProvider.d.ts +16 -0
- package/lib/dts/components/toast/toastProvider.d.ts.map +1 -0
- package/lib/dts/components/toast/types.d.ts +21 -0
- package/lib/dts/components/toast/types.d.ts.map +1 -0
- package/lib/dts/components/toast/useToast.d.ts +6 -0
- package/lib/dts/components/toast/useToast.d.ts.map +1 -0
- package/lib/dts/components/tree/helpers.d.ts +5 -0
- package/lib/dts/components/tree/helpers.d.ts.map +1 -0
- package/lib/dts/components/tree/index.d.ts +5 -0
- package/lib/dts/components/tree/index.d.ts.map +1 -0
- package/lib/dts/components/tree/style.d.ts +9 -0
- package/lib/dts/components/tree/style.d.ts.map +1 -0
- package/lib/dts/components/tree/tree.d.ts +14 -0
- package/lib/dts/components/tree/tree.d.ts.map +1 -0
- package/lib/dts/components/tree/treeContext.d.ts +7 -0
- package/lib/dts/components/tree/treeContext.d.ts.map +1 -0
- package/lib/dts/components/tree/treeGroup.d.ts +6 -0
- package/lib/dts/components/tree/treeGroup.d.ts.map +1 -0
- package/lib/dts/components/tree/treeItem.d.ts +20 -0
- package/lib/dts/components/tree/treeItem.d.ts.map +1 -0
- package/lib/dts/components/tree/types.d.ts +24 -0
- package/lib/dts/components/tree/types.d.ts.map +1 -0
- package/lib/dts/components/tree/useTree.d.ts +6 -0
- package/lib/dts/components/tree/useTree.d.ts.map +1 -0
- package/lib/dts/constants.d.ts +3 -0
- package/lib/dts/constants.d.ts.map +1 -0
- package/lib/dts/helpers/animation.d.ts +9 -0
- package/lib/dts/helpers/animation.d.ts.map +1 -0
- package/lib/dts/helpers/element.d.ts +29 -0
- package/lib/dts/helpers/element.d.ts.map +1 -0
- package/lib/dts/helpers/focus.d.ts +21 -0
- package/lib/dts/helpers/focus.d.ts.map +1 -0
- package/lib/dts/helpers/index.d.ts +5 -0
- package/lib/dts/helpers/index.d.ts.map +1 -0
- package/lib/dts/helpers/scroll.d.ts +5 -0
- package/lib/dts/helpers/scroll.d.ts.map +1 -0
- package/lib/dts/hooks/_internal/index.d.ts +2 -0
- package/lib/dts/hooks/_internal/index.d.ts.map +1 -0
- package/lib/dts/hooks/_internal/useUnique.d.ts +11 -0
- package/lib/dts/hooks/_internal/useUnique.d.ts.map +1 -0
- package/lib/dts/hooks/index.d.ts +9 -0
- package/lib/dts/hooks/index.d.ts.map +1 -0
- package/lib/dts/hooks/useClickOutside.d.ts +9 -0
- package/lib/dts/hooks/useClickOutside.d.ts.map +1 -0
- package/lib/dts/hooks/useCustomValidity.d.ts +9 -0
- package/lib/dts/hooks/useCustomValidity.d.ts.map +1 -0
- package/lib/dts/hooks/useElementRect/index.d.ts +2 -0
- package/lib/dts/hooks/useElementRect/index.d.ts.map +1 -0
- package/lib/dts/hooks/useElementRect/useElementRect.d.ts +6 -0
- package/lib/dts/hooks/useElementRect/useElementRect.d.ts.map +1 -0
- package/lib/dts/hooks/useForwardedRef.d.ts +6 -0
- package/lib/dts/hooks/useForwardedRef.d.ts.map +1 -0
- package/lib/dts/hooks/useGlobalKeyDown.d.ts +5 -0
- package/lib/dts/hooks/useGlobalKeyDown.d.ts.map +1 -0
- package/lib/dts/hooks/useIsomorphicEffect.d.ts +6 -0
- package/lib/dts/hooks/useIsomorphicEffect.d.ts.map +1 -0
- package/lib/dts/hooks/useMediaIndex/index.d.ts +2 -0
- package/lib/dts/hooks/useMediaIndex/index.d.ts.map +1 -0
- package/lib/dts/hooks/useMediaIndex/lib/media.d.ts +12 -0
- package/lib/dts/hooks/useMediaIndex/lib/media.d.ts.map +1 -0
- package/lib/dts/hooks/useMediaIndex/useMediaIndex.d.ts +6 -0
- package/lib/dts/hooks/useMediaIndex/useMediaIndex.d.ts.map +1 -0
- package/lib/dts/hooks/usePrefersDark.d.ts +5 -0
- package/lib/dts/hooks/usePrefersDark.d.ts.map +1 -0
- package/lib/dts/hooks/useResponsiveProp.d.ts +6 -0
- package/lib/dts/hooks/useResponsiveProp.d.ts.map +1 -0
- package/lib/dts/index.d.ts +9 -0
- package/lib/dts/index.d.ts.map +1 -0
- package/lib/dts/lib/globalScope.d.ts +2 -0
- package/lib/dts/lib/globalScope.d.ts.map +1 -0
- package/lib/dts/lib/isRecord.d.ts +2 -0
- package/lib/dts/lib/isRecord.d.ts.map +1 -0
- package/lib/dts/primitives/_selectable/index.d.ts +2 -0
- package/lib/dts/primitives/_selectable/index.d.ts.map +1 -0
- package/lib/dts/primitives/_selectable/selectable.d.ts +9 -0
- package/lib/dts/primitives/_selectable/selectable.d.ts.map +1 -0
- package/lib/dts/primitives/_selectable/style.d.ts +12 -0
- package/lib/dts/primitives/_selectable/style.d.ts.map +1 -0
- package/lib/dts/primitives/avatar/avatar.d.ts +27 -0
- package/lib/dts/primitives/avatar/avatar.d.ts.map +1 -0
- package/lib/dts/primitives/avatar/avatarCounter.d.ts +15 -0
- package/lib/dts/primitives/avatar/avatarCounter.d.ts.map +1 -0
- package/lib/dts/primitives/avatar/avatarStack.d.ts +16 -0
- package/lib/dts/primitives/avatar/avatarStack.d.ts.map +1 -0
- package/lib/dts/primitives/avatar/index.d.ts +5 -0
- package/lib/dts/primitives/avatar/index.d.ts.map +1 -0
- package/lib/dts/primitives/avatar/styles.d.ts +18 -0
- package/lib/dts/primitives/avatar/styles.d.ts.map +1 -0
- package/lib/dts/primitives/avatar/types.d.ts +14 -0
- package/lib/dts/primitives/avatar/types.d.ts.map +1 -0
- package/lib/dts/primitives/badge/badge.d.ts +18 -0
- package/lib/dts/primitives/badge/badge.d.ts.map +1 -0
- package/lib/dts/primitives/badge/index.d.ts +2 -0
- package/lib/dts/primitives/badge/index.d.ts.map +1 -0
- package/lib/dts/primitives/badge/styles.d.ts +5 -0
- package/lib/dts/primitives/badge/styles.d.ts.map +1 -0
- package/lib/dts/primitives/badge/types.d.ts +9 -0
- package/lib/dts/primitives/badge/types.d.ts.map +1 -0
- package/lib/dts/primitives/box/box.d.ts +13 -0
- package/lib/dts/primitives/box/box.d.ts.map +1 -0
- package/lib/dts/primitives/box/index.d.ts +2 -0
- package/lib/dts/primitives/box/index.d.ts.map +1 -0
- package/lib/dts/primitives/button/button.d.ts +29 -0
- package/lib/dts/primitives/button/button.d.ts.map +1 -0
- package/lib/dts/primitives/button/index.d.ts +2 -0
- package/lib/dts/primitives/button/index.d.ts.map +1 -0
- package/lib/dts/primitives/button/styles.d.ts +15 -0
- package/lib/dts/primitives/button/styles.d.ts.map +1 -0
- package/lib/dts/primitives/card/card.d.ts +28 -0
- package/lib/dts/primitives/card/card.d.ts.map +1 -0
- package/lib/dts/primitives/card/index.d.ts +3 -0
- package/lib/dts/primitives/card/index.d.ts.map +1 -0
- package/lib/dts/primitives/card/styles.d.ts +7 -0
- package/lib/dts/primitives/card/styles.d.ts.map +1 -0
- package/lib/dts/primitives/card/types.d.ts +10 -0
- package/lib/dts/primitives/card/types.d.ts.map +1 -0
- package/lib/dts/primitives/checkbox/checkbox.d.ts +13 -0
- package/lib/dts/primitives/checkbox/checkbox.d.ts.map +1 -0
- package/lib/dts/primitives/checkbox/index.d.ts +2 -0
- package/lib/dts/primitives/checkbox/index.d.ts.map +1 -0
- package/lib/dts/primitives/checkbox/styles.d.ts +5 -0
- package/lib/dts/primitives/checkbox/styles.d.ts.map +1 -0
- package/lib/dts/primitives/code/code.d.ts +15 -0
- package/lib/dts/primitives/code/code.d.ts.map +1 -0
- package/lib/dts/primitives/code/index.d.ts +2 -0
- package/lib/dts/primitives/code/index.d.ts.map +1 -0
- package/lib/dts/primitives/code/styles.d.ts +4 -0
- package/lib/dts/primitives/code/styles.d.ts.map +1 -0
- package/lib/dts/primitives/container/container.d.ts +13 -0
- package/lib/dts/primitives/container/container.d.ts.map +1 -0
- package/lib/dts/primitives/container/index.d.ts +3 -0
- package/lib/dts/primitives/container/index.d.ts.map +1 -0
- package/lib/dts/primitives/container/styles.d.ts +6 -0
- package/lib/dts/primitives/container/styles.d.ts.map +1 -0
- package/lib/dts/primitives/container/types.d.ts +7 -0
- package/lib/dts/primitives/container/types.d.ts.map +1 -0
- package/lib/dts/primitives/flex/flex.d.ts +14 -0
- package/lib/dts/primitives/flex/flex.d.ts.map +1 -0
- package/lib/dts/primitives/flex/index.d.ts +2 -0
- package/lib/dts/primitives/flex/index.d.ts.map +1 -0
- package/lib/dts/primitives/grid/grid.d.ts +13 -0
- package/lib/dts/primitives/grid/grid.d.ts.map +1 -0
- package/lib/dts/primitives/grid/index.d.ts +2 -0
- package/lib/dts/primitives/grid/index.d.ts.map +1 -0
- package/lib/dts/primitives/heading/heading.d.ts +25 -0
- package/lib/dts/primitives/heading/heading.d.ts.map +1 -0
- package/lib/dts/primitives/heading/index.d.ts +2 -0
- package/lib/dts/primitives/heading/index.d.ts.map +1 -0
- package/lib/dts/primitives/heading/styles.d.ts +5 -0
- package/lib/dts/primitives/heading/styles.d.ts.map +1 -0
- package/lib/dts/primitives/heading/types.d.ts +8 -0
- package/lib/dts/primitives/heading/types.d.ts.map +1 -0
- package/lib/dts/primitives/helpers.d.ts +3 -0
- package/lib/dts/primitives/helpers.d.ts.map +1 -0
- package/lib/dts/primitives/index.d.ts +26 -0
- package/lib/dts/primitives/index.d.ts.map +1 -0
- package/lib/dts/primitives/inline/index.d.ts +2 -0
- package/lib/dts/primitives/inline/index.d.ts.map +1 -0
- package/lib/dts/primitives/inline/inline.d.ts +13 -0
- package/lib/dts/primitives/inline/inline.d.ts.map +1 -0
- package/lib/dts/primitives/inline/styles.d.ts +6 -0
- package/lib/dts/primitives/inline/styles.d.ts.map +1 -0
- package/lib/dts/primitives/inline/types.d.ts +7 -0
- package/lib/dts/primitives/inline/types.d.ts.map +1 -0
- package/lib/dts/primitives/kbd/index.d.ts +2 -0
- package/lib/dts/primitives/kbd/index.d.ts.map +1 -0
- package/lib/dts/primitives/kbd/kbd.d.ts +15 -0
- package/lib/dts/primitives/kbd/kbd.d.ts.map +1 -0
- package/lib/dts/primitives/label/index.d.ts +2 -0
- package/lib/dts/primitives/label/index.d.ts.map +1 -0
- package/lib/dts/primitives/label/label.d.ts +25 -0
- package/lib/dts/primitives/label/label.d.ts.map +1 -0
- package/lib/dts/primitives/label/styles.d.ts +7 -0
- package/lib/dts/primitives/label/styles.d.ts.map +1 -0
- package/lib/dts/primitives/popover/arrow.d.ts +3 -0
- package/lib/dts/primitives/popover/arrow.d.ts.map +1 -0
- package/lib/dts/primitives/popover/index.d.ts +2 -0
- package/lib/dts/primitives/popover/index.d.ts.map +1 -0
- package/lib/dts/primitives/popover/modifiers/getPopoverModifiers.d.ts +4 -0
- package/lib/dts/primitives/popover/modifiers/getPopoverModifiers.d.ts.map +1 -0
- package/lib/dts/primitives/popover/modifiers/index.d.ts +2 -0
- package/lib/dts/primitives/popover/modifiers/index.d.ts.map +1 -0
- package/lib/dts/primitives/popover/modifiers/types.d.ts +18 -0
- package/lib/dts/primitives/popover/modifiers/types.d.ts.map +1 -0
- package/lib/dts/primitives/popover/modifiers/usePopoverModifiers.d.ts +4 -0
- package/lib/dts/primitives/popover/modifiers/usePopoverModifiers.d.ts.map +1 -0
- package/lib/dts/primitives/popover/popover.d.ts +38 -0
- package/lib/dts/primitives/popover/popover.d.ts.map +1 -0
- package/lib/dts/primitives/radio/index.d.ts +2 -0
- package/lib/dts/primitives/radio/index.d.ts.map +1 -0
- package/lib/dts/primitives/radio/radio.d.ts +12 -0
- package/lib/dts/primitives/radio/radio.d.ts.map +1 -0
- package/lib/dts/primitives/radio/styles.d.ts +5 -0
- package/lib/dts/primitives/radio/styles.d.ts.map +1 -0
- package/lib/dts/primitives/select/index.d.ts +2 -0
- package/lib/dts/primitives/select/index.d.ts.map +1 -0
- package/lib/dts/primitives/select/select.d.ts +16 -0
- package/lib/dts/primitives/select/select.d.ts.map +1 -0
- package/lib/dts/primitives/select/styles.d.ts +13 -0
- package/lib/dts/primitives/select/styles.d.ts.map +1 -0
- package/lib/dts/primitives/spinner/index.d.ts +2 -0
- package/lib/dts/primitives/spinner/index.d.ts.map +1 -0
- package/lib/dts/primitives/spinner/spinner.d.ts +13 -0
- package/lib/dts/primitives/spinner/spinner.d.ts.map +1 -0
- package/lib/dts/primitives/stack/index.d.ts +2 -0
- package/lib/dts/primitives/stack/index.d.ts.map +1 -0
- package/lib/dts/primitives/stack/stack.d.ts +14 -0
- package/lib/dts/primitives/stack/stack.d.ts.map +1 -0
- package/lib/dts/primitives/stack/styles.d.ts +8 -0
- package/lib/dts/primitives/stack/styles.d.ts.map +1 -0
- package/lib/dts/primitives/switch/index.d.ts +2 -0
- package/lib/dts/primitives/switch/index.d.ts.map +1 -0
- package/lib/dts/primitives/switch/styles.d.ts +11 -0
- package/lib/dts/primitives/switch/styles.d.ts.map +1 -0
- package/lib/dts/primitives/switch/switch.d.ts +12 -0
- package/lib/dts/primitives/switch/switch.d.ts.map +1 -0
- package/lib/dts/primitives/text/index.d.ts +2 -0
- package/lib/dts/primitives/text/index.d.ts.map +1 -0
- package/lib/dts/primitives/text/styles.d.ts +7 -0
- package/lib/dts/primitives/text/styles.d.ts.map +1 -0
- package/lib/dts/primitives/text/text.d.ts +25 -0
- package/lib/dts/primitives/text/text.d.ts.map +1 -0
- package/lib/dts/primitives/textArea/index.d.ts +2 -0
- package/lib/dts/primitives/textArea/index.d.ts.map +1 -0
- package/lib/dts/primitives/textArea/textArea.d.ts +18 -0
- package/lib/dts/primitives/textArea/textArea.d.ts.map +1 -0
- package/lib/dts/primitives/textInput/index.d.ts +2 -0
- package/lib/dts/primitives/textInput/index.d.ts.map +1 -0
- package/lib/dts/primitives/textInput/textInput.d.ts +41 -0
- package/lib/dts/primitives/textInput/textInput.d.ts.map +1 -0
- package/lib/dts/primitives/tooltip/index.d.ts +2 -0
- package/lib/dts/primitives/tooltip/index.d.ts.map +1 -0
- package/lib/dts/primitives/tooltip/tooltip.d.ts +23 -0
- package/lib/dts/primitives/tooltip/tooltip.d.ts.map +1 -0
- package/lib/dts/primitives/tooltip/tooltipArrow.d.ts +6 -0
- package/lib/dts/primitives/tooltip/tooltipArrow.d.ts.map +1 -0
- package/lib/dts/primitives/types.d.ts +102 -0
- package/lib/dts/primitives/types.d.ts.map +1 -0
- package/lib/dts/styles/border/borderStyle.d.ts +5 -0
- package/lib/dts/styles/border/borderStyle.d.ts.map +1 -0
- package/lib/dts/styles/border/index.d.ts +3 -0
- package/lib/dts/styles/border/index.d.ts.map +1 -0
- package/lib/dts/styles/border/types.d.ts +11 -0
- package/lib/dts/styles/border/types.d.ts.map +1 -0
- package/lib/dts/styles/box/boxStyle.d.ts +6 -0
- package/lib/dts/styles/box/boxStyle.d.ts.map +1 -0
- package/lib/dts/styles/box/index.d.ts +3 -0
- package/lib/dts/styles/box/index.d.ts.map +1 -0
- package/lib/dts/styles/box/types.d.ts +11 -0
- package/lib/dts/styles/box/types.d.ts.map +1 -0
- package/lib/dts/styles/colorVars/colorVarsStyle.d.ts +7 -0
- package/lib/dts/styles/colorVars/colorVarsStyle.d.ts.map +1 -0
- package/lib/dts/styles/colorVars/index.d.ts +2 -0
- package/lib/dts/styles/colorVars/index.d.ts.map +1 -0
- package/lib/dts/styles/flex/flexItemStyle.d.ts +6 -0
- package/lib/dts/styles/flex/flexItemStyle.d.ts.map +1 -0
- package/lib/dts/styles/flex/flexStyle.d.ts +9 -0
- package/lib/dts/styles/flex/flexStyle.d.ts.map +1 -0
- package/lib/dts/styles/flex/index.d.ts +4 -0
- package/lib/dts/styles/flex/index.d.ts.map +1 -0
- package/lib/dts/styles/flex/types.d.ts +23 -0
- package/lib/dts/styles/flex/types.d.ts.map +1 -0
- package/lib/dts/styles/focusRing/index.d.ts +18 -0
- package/lib/dts/styles/focusRing/index.d.ts.map +1 -0
- package/lib/dts/styles/font/codeFontStyle.d.ts +9 -0
- package/lib/dts/styles/font/codeFontStyle.d.ts.map +1 -0
- package/lib/dts/styles/font/headingFontStyle.d.ts +9 -0
- package/lib/dts/styles/font/headingFontStyle.d.ts.map +1 -0
- package/lib/dts/styles/font/index.d.ts +7 -0
- package/lib/dts/styles/font/index.d.ts.map +1 -0
- package/lib/dts/styles/font/labelFontStyle.d.ts +9 -0
- package/lib/dts/styles/font/labelFontStyle.d.ts.map +1 -0
- package/lib/dts/styles/font/responsiveFont.d.ts +11 -0
- package/lib/dts/styles/font/responsiveFont.d.ts.map +1 -0
- package/lib/dts/styles/font/textAlignStyle.d.ts +9 -0
- package/lib/dts/styles/font/textAlignStyle.d.ts.map +1 -0
- package/lib/dts/styles/font/textFontStyle.d.ts +9 -0
- package/lib/dts/styles/font/textFontStyle.d.ts.map +1 -0
- package/lib/dts/styles/font/types.d.ts +28 -0
- package/lib/dts/styles/font/types.d.ts.map +1 -0
- package/lib/dts/styles/grid/gridItemStyle.d.ts +5 -0
- package/lib/dts/styles/grid/gridItemStyle.d.ts.map +1 -0
- package/lib/dts/styles/grid/gridStyle.d.ts +5 -0
- package/lib/dts/styles/grid/gridStyle.d.ts.map +1 -0
- package/lib/dts/styles/grid/index.d.ts +4 -0
- package/lib/dts/styles/grid/index.d.ts.map +1 -0
- package/lib/dts/styles/grid/types.d.ts +26 -0
- package/lib/dts/styles/grid/types.d.ts.map +1 -0
- package/lib/dts/styles/helpers.d.ts +23 -0
- package/lib/dts/styles/helpers.d.ts.map +1 -0
- package/lib/dts/styles/index.d.ts +4 -0
- package/lib/dts/styles/index.d.ts.map +1 -0
- package/lib/dts/styles/input/index.d.ts +3 -0
- package/lib/dts/styles/input/index.d.ts.map +1 -0
- package/lib/dts/styles/input/responsiveInputPaddingStyle.d.ts +26 -0
- package/lib/dts/styles/input/responsiveInputPaddingStyle.d.ts.map +1 -0
- package/lib/dts/styles/input/textInputStyle.d.ts +23 -0
- package/lib/dts/styles/input/textInputStyle.d.ts.map +1 -0
- package/lib/dts/styles/internal.d.ts +12 -0
- package/lib/dts/styles/internal.d.ts.map +1 -0
- package/lib/dts/styles/margin/index.d.ts +3 -0
- package/lib/dts/styles/margin/index.d.ts.map +1 -0
- package/lib/dts/styles/margin/marginStyle.d.ts +5 -0
- package/lib/dts/styles/margin/marginStyle.d.ts.map +1 -0
- package/lib/dts/styles/margin/types.d.ts +10 -0
- package/lib/dts/styles/margin/types.d.ts.map +1 -0
- package/lib/dts/styles/padding/index.d.ts +3 -0
- package/lib/dts/styles/padding/index.d.ts.map +1 -0
- package/lib/dts/styles/padding/paddingStyle.d.ts +5 -0
- package/lib/dts/styles/padding/paddingStyle.d.ts.map +1 -0
- package/lib/dts/styles/padding/types.d.ts +13 -0
- package/lib/dts/styles/padding/types.d.ts.map +1 -0
- package/lib/dts/styles/radius/index.d.ts +3 -0
- package/lib/dts/styles/radius/index.d.ts.map +1 -0
- package/lib/dts/styles/radius/radiusStyle.d.ts +5 -0
- package/lib/dts/styles/radius/radiusStyle.d.ts.map +1 -0
- package/lib/dts/styles/radius/types.d.ts +7 -0
- package/lib/dts/styles/radius/types.d.ts.map +1 -0
- package/lib/dts/styles/shadow/index.d.ts +3 -0
- package/lib/dts/styles/shadow/index.d.ts.map +1 -0
- package/lib/dts/styles/shadow/shadowStyle.d.ts +5 -0
- package/lib/dts/styles/shadow/shadowStyle.d.ts.map +1 -0
- package/lib/dts/styles/shadow/types.d.ts +7 -0
- package/lib/dts/styles/shadow/types.d.ts.map +1 -0
- package/lib/dts/styles/types.d.ts +8 -0
- package/lib/dts/styles/types.d.ts.map +1 -0
- package/lib/dts/theme/defaults.d.ts +3 -0
- package/lib/dts/theme/defaults.d.ts.map +1 -0
- package/lib/dts/theme/index.d.ts +9 -0
- package/lib/dts/theme/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/blend/index.d.ts +3 -0
- package/lib/dts/theme/lib/color-fns/blend/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/blend/multiply.d.ts +8 -0
- package/lib/dts/theme/lib/color-fns/blend/multiply.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/blend/screen.d.ts +8 -0
- package/lib/dts/theme/lib/color-fns/blend/screen.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/convert.d.ts +19 -0
- package/lib/dts/theme/lib/color-fns/convert.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/helpers/index.d.ts +2 -0
- package/lib/dts/theme/lib/color-fns/helpers/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/helpers/rgba.d.ts +5 -0
- package/lib/dts/theme/lib/color-fns/helpers/rgba.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/index.d.ts +6 -0
- package/lib/dts/theme/lib/color-fns/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/parse.d.ts +6 -0
- package/lib/dts/theme/lib/color-fns/parse.d.ts.map +1 -0
- package/lib/dts/theme/lib/color-fns/types.d.ts +17 -0
- package/lib/dts/theme/lib/color-fns/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/avatar.d.ts +10 -0
- package/lib/dts/theme/lib/theme/avatar.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/_generic/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/_generic/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/_generic/types.d.ts +30 -0
- package/lib/dts/theme/lib/theme/color/_generic/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/base/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/base/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/base/types.d.ts +20 -0
- package/lib/dts/theme/lib/theme/color/base/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/button/createButtonModes.d.ts +7 -0
- package/lib/dts/theme/lib/theme/color/button/createButtonModes.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/button/createButtonTones.d.ts +7 -0
- package/lib/dts/theme/lib/theme/color/button/createButtonTones.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/button/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/button/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/button/types.d.ts +40 -0
- package/lib/dts/theme/lib/theme/color/button/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/card/createCardStates.d.ts +8 -0
- package/lib/dts/theme/lib/theme/color/card/createCardStates.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/card/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/card/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/card/types.d.ts +17 -0
- package/lib/dts/theme/lib/theme/color/card/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/defaults.d.ts +3 -0
- package/lib/dts/theme/lib/theme/color/defaults.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/factory.d.ts +83 -0
- package/lib/dts/theme/lib/theme/color/factory.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/index.d.ts +13 -0
- package/lib/dts/theme/lib/theme/color/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/input/createInputModes.d.ts +7 -0
- package/lib/dts/theme/lib/theme/color/input/createInputModes.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/input/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/input/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/input/types.d.ts +26 -0
- package/lib/dts/theme/lib/theme/color/input/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/muted/createMuted.d.ts +6 -0
- package/lib/dts/theme/lib/theme/color/muted/createMuted.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/muted/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/muted/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/muted/types.d.ts +23 -0
- package/lib/dts/theme/lib/theme/color/muted/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/selectable/createSelectableTones.d.ts +7 -0
- package/lib/dts/theme/lib/theme/color/selectable/createSelectableTones.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/selectable/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/selectable/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/selectable/types.d.ts +27 -0
- package/lib/dts/theme/lib/theme/color/selectable/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/solid/createSolidTones.d.ts +6 -0
- package/lib/dts/theme/lib/theme/color/solid/createSolidTones.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/solid/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/solid/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/solid/types.d.ts +23 -0
- package/lib/dts/theme/lib/theme/color/solid/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/spot/createSpot.d.ts +5 -0
- package/lib/dts/theme/lib/theme/color/spot/createSpot.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/spot/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/spot/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/spot/types.d.ts +19 -0
- package/lib/dts/theme/lib/theme/color/spot/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/syntax/index.d.ts +2 -0
- package/lib/dts/theme/lib/theme/color/syntax/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/syntax/types.d.ts +42 -0
- package/lib/dts/theme/lib/theme/color/syntax/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/color/types.d.ts +55 -0
- package/lib/dts/theme/lib/theme/color/types.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/fonts.d.ts +50 -0
- package/lib/dts/theme/lib/theme/fonts.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/index.d.ts +8 -0
- package/lib/dts/theme/lib/theme/index.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/input.d.ts +23 -0
- package/lib/dts/theme/lib/theme/input.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/layer.d.ts +16 -0
- package/lib/dts/theme/lib/theme/layer.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/shadow.d.ts +19 -0
- package/lib/dts/theme/lib/theme/shadow.d.ts.map +1 -0
- package/lib/dts/theme/lib/theme/theme.d.ts +34 -0
- package/lib/dts/theme/lib/theme/theme.d.ts.map +1 -0
- package/lib/dts/theme/studioTheme/color.d.ts +2 -0
- package/lib/dts/theme/studioTheme/color.d.ts.map +1 -0
- package/lib/dts/theme/studioTheme/fonts.d.ts +3 -0
- package/lib/dts/theme/studioTheme/fonts.d.ts.map +1 -0
- package/lib/dts/theme/studioTheme/helpers.d.ts +3 -0
- package/lib/dts/theme/studioTheme/helpers.d.ts.map +1 -0
- package/lib/dts/theme/studioTheme/index.d.ts +2 -0
- package/lib/dts/theme/studioTheme/index.d.ts.map +1 -0
- package/lib/dts/theme/studioTheme/theme.d.ts +6 -0
- package/lib/dts/theme/studioTheme/theme.d.ts.map +1 -0
- package/lib/dts/theme/themeColorProvider.d.ts +15 -0
- package/lib/dts/theme/themeColorProvider.d.ts.map +1 -0
- package/lib/dts/theme/themeContext.d.ts +7 -0
- package/lib/dts/theme/themeContext.d.ts.map +1 -0
- package/lib/dts/theme/themeProvider.d.ts +17 -0
- package/lib/dts/theme/themeProvider.d.ts.map +1 -0
- package/lib/dts/theme/types.d.ts +36 -0
- package/lib/dts/theme/types.d.ts.map +1 -0
- package/lib/dts/theme/useRootTheme.d.ts +6 -0
- package/lib/dts/theme/useRootTheme.d.ts.map +1 -0
- package/lib/dts/theme/useTheme.d.ts +6 -0
- package/lib/dts/theme/useTheme.d.ts.map +1 -0
- package/lib/dts/types/avatar.d.ts +13 -0
- package/lib/dts/types/avatar.d.ts.map +1 -0
- package/lib/dts/types/badge.d.ts +9 -0
- package/lib/dts/types/badge.d.ts.map +1 -0
- package/lib/dts/types/box.d.ts +17 -0
- package/lib/dts/types/box.d.ts.map +1 -0
- package/lib/dts/types/button.d.ts +13 -0
- package/lib/dts/types/button.d.ts.map +1 -0
- package/lib/dts/types/card.d.ts +6 -0
- package/lib/dts/types/card.d.ts.map +1 -0
- package/lib/dts/types/common.d.ts +11 -0
- package/lib/dts/types/common.d.ts.map +1 -0
- package/lib/dts/types/dialog.d.ts +5 -0
- package/lib/dts/types/dialog.d.ts.map +1 -0
- package/lib/dts/types/flex.d.ts +21 -0
- package/lib/dts/types/flex.d.ts.map +1 -0
- package/lib/dts/types/grid.d.ts +13 -0
- package/lib/dts/types/grid.d.ts.map +1 -0
- package/lib/dts/types/gridItem.d.ts +25 -0
- package/lib/dts/types/gridItem.d.ts.map +1 -0
- package/lib/dts/types/index.d.ts +13 -0
- package/lib/dts/types/index.d.ts.map +1 -0
- package/lib/dts/types/popover.d.ts +5 -0
- package/lib/dts/types/popover.d.ts.map +1 -0
- package/lib/dts/types/selectable.d.ts +5 -0
- package/lib/dts/types/selectable.d.ts.map +1 -0
- package/lib/dts/utils/boundaryElement/boundaryElementContext.d.ts +4 -0
- package/lib/dts/utils/boundaryElement/boundaryElementContext.d.ts.map +1 -0
- package/lib/dts/utils/boundaryElement/boundaryElementProvider.d.ts +13 -0
- package/lib/dts/utils/boundaryElement/boundaryElementProvider.d.ts.map +1 -0
- package/lib/dts/utils/boundaryElement/index.d.ts +4 -0
- package/lib/dts/utils/boundaryElement/index.d.ts.map +1 -0
- package/lib/dts/utils/boundaryElement/types.d.ts +8 -0
- package/lib/dts/utils/boundaryElement/types.d.ts.map +1 -0
- package/lib/dts/utils/boundaryElement/useBoundaryElement.d.ts +6 -0
- package/lib/dts/utils/boundaryElement/useBoundaryElement.d.ts.map +1 -0
- package/lib/dts/utils/elementQuery/elementQuery.d.ts +15 -0
- package/lib/dts/utils/elementQuery/elementQuery.d.ts.map +1 -0
- package/lib/dts/utils/elementQuery/helpers.d.ts +3 -0
- package/lib/dts/utils/elementQuery/helpers.d.ts.map +1 -0
- package/lib/dts/utils/elementQuery/index.d.ts +2 -0
- package/lib/dts/utils/elementQuery/index.d.ts.map +1 -0
- package/lib/dts/utils/errorBoundary.d.ts +29 -0
- package/lib/dts/utils/errorBoundary.d.ts.map +1 -0
- package/lib/dts/utils/index.d.ts +9 -0
- package/lib/dts/utils/index.d.ts.map +1 -0
- package/lib/dts/utils/layer/index.d.ts +5 -0
- package/lib/dts/utils/layer/index.d.ts.map +1 -0
- package/lib/dts/utils/layer/layer.d.ts +13 -0
- package/lib/dts/utils/layer/layer.d.ts.map +1 -0
- package/lib/dts/utils/layer/layerContext.d.ts +4 -0
- package/lib/dts/utils/layer/layerContext.d.ts.map +1 -0
- package/lib/dts/utils/layer/layerProvider.d.ts +13 -0
- package/lib/dts/utils/layer/layerProvider.d.ts.map +1 -0
- package/lib/dts/utils/layer/types.d.ts +11 -0
- package/lib/dts/utils/layer/types.d.ts.map +1 -0
- package/lib/dts/utils/layer/useLayer.d.ts +6 -0
- package/lib/dts/utils/layer/useLayer.d.ts.map +1 -0
- package/lib/dts/utils/portal/index.d.ts +5 -0
- package/lib/dts/utils/portal/index.d.ts.map +1 -0
- package/lib/dts/utils/portal/portal.d.ts +16 -0
- package/lib/dts/utils/portal/portal.d.ts.map +1 -0
- package/lib/dts/utils/portal/portalContext.d.ts +5 -0
- package/lib/dts/utils/portal/portalContext.d.ts.map +1 -0
- package/lib/dts/utils/portal/portalProvider.d.ts +21 -0
- package/lib/dts/utils/portal/portalProvider.d.ts.map +1 -0
- package/lib/dts/utils/portal/types.d.ts +10 -0
- package/lib/dts/utils/portal/types.d.ts.map +1 -0
- package/lib/dts/utils/portal/usePortal.d.ts +6 -0
- package/lib/dts/utils/portal/usePortal.d.ts.map +1 -0
- package/lib/dts/utils/resizeObserver.d.ts +6 -0
- package/lib/dts/utils/resizeObserver.d.ts.map +1 -0
- package/lib/dts/utils/srOnly/index.d.ts +2 -0
- package/lib/dts/utils/srOnly/index.d.ts.map +1 -0
- package/lib/dts/utils/srOnly/srOnly.d.ts +13 -0
- package/lib/dts/utils/srOnly/srOnly.d.ts.map +1 -0
- package/lib/dts/utils/virtualList/index.d.ts +2 -0
- package/lib/dts/utils/virtualList/index.d.ts.map +1 -0
- package/lib/dts/utils/virtualList/virtualList.d.ts +29 -0
- package/lib/dts/utils/virtualList/virtualList.d.ts.map +1 -0
- package/lib/sanity-ui.js +9905 -0
- package/lib/sanity-ui.js.map +1 -0
- package/lib/sanity-ui.modern.js +10956 -0
- package/lib/sanity-ui.modern.js.map +1 -0
- package/lib/sanity-ui.module.js +9785 -0
- package/lib/sanity-ui.module.js.map +1 -0
- package/package.json +11 -11
- package/src/__workshop__/color/overview.tsx +103 -0
- package/src/__workshop__/constants.ts +287 -0
- package/src/__workshop__/index.ts +10 -0
- package/src/components/autocomplete/__fixtures__/countries.ts +245 -0
- package/src/components/autocomplete/__mocks__/apiStore.ts +49 -0
- package/src/components/autocomplete/__workshop__/.eslintrc +5 -0
- package/src/components/autocomplete/__workshop__/async.tsx +152 -0
- package/src/components/autocomplete/__workshop__/constrainedHeight.tsx +95 -0
- package/src/components/autocomplete/__workshop__/custom.tsx +83 -0
- package/src/components/autocomplete/__workshop__/example.tsx +78 -0
- package/src/components/autocomplete/__workshop__/focusAndBlur.tsx +34 -0
- package/src/components/autocomplete/__workshop__/fullscreen.tsx +293 -0
- package/src/components/autocomplete/__workshop__/index.ts +35 -0
- package/src/components/autocomplete/__workshop__/types.ts +4 -0
- package/src/components/autocomplete/autocomplete.styles.tsx +53 -0
- package/src/components/autocomplete/autocomplete.tsx +699 -0
- package/src/components/autocomplete/autocompleteOption.tsx +44 -0
- package/src/components/autocomplete/autocompleteReducer.ts +50 -0
- package/src/components/autocomplete/constants.ts +38 -0
- package/src/components/autocomplete/index.ts +2 -0
- package/src/components/autocomplete/types.ts +108 -0
- package/src/components/breadcrumbs/__workshop__/.eslintrc +5 -0
- package/src/components/breadcrumbs/__workshop__/example.tsx +56 -0
- package/src/components/breadcrumbs/__workshop__/index.ts +10 -0
- package/src/components/breadcrumbs/breadcrumbs.styles.ts +17 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +101 -0
- package/src/components/breadcrumbs/index.ts +1 -0
- package/src/components/dialog/__workshop__/.eslintrc +5 -0
- package/src/components/dialog/__workshop__/autoFocus.tsx +30 -0
- package/src/components/dialog/__workshop__/index.ts +12 -0
- package/src/components/dialog/__workshop__/layering.tsx +38 -0
- package/src/components/dialog/__workshop__/nested.tsx +51 -0
- package/src/components/dialog/__workshop__/onScroll.tsx +39 -0
- package/src/components/dialog/__workshop__/position.tsx +30 -0
- package/src/components/dialog/__workshop__/props.tsx +74 -0
- package/src/components/dialog/__workshop__/provider.tsx +12 -0
- package/src/components/dialog/dialog.tsx +339 -0
- package/src/components/dialog/dialogContext.ts +22 -0
- package/src/components/dialog/dialogProvider.tsx +32 -0
- package/src/components/dialog/index.ts +4 -0
- package/src/components/dialog/styles.ts +38 -0
- package/src/components/dialog/useDialog.ts +10 -0
- package/src/components/hotkeys/__workshop__/.eslintrc +5 -0
- package/src/components/hotkeys/__workshop__/index.ts +6 -0
- package/src/components/hotkeys/__workshop__/plain.tsx +10 -0
- package/src/components/hotkeys/hotkeys.tsx +53 -0
- package/src/components/hotkeys/index.ts +1 -0
- package/src/components/index.ts +9 -0
- package/src/components/menu/__workshop__/.eslintrc +5 -0
- package/src/components/menu/__workshop__/asComponent.tsx +44 -0
- package/src/components/menu/__workshop__/closableMenuButton.tsx +42 -0
- package/src/components/menu/__workshop__/constrainedInBoundary.tsx +142 -0
- package/src/components/menu/__workshop__/customMenuItem.tsx +40 -0
- package/src/components/menu/__workshop__/disableFocusOnClose.tsx +36 -0
- package/src/components/menu/__workshop__/groups.tsx +144 -0
- package/src/components/menu/__workshop__/index.ts +70 -0
- package/src/components/menu/__workshop__/menuButton.tsx +68 -0
- package/src/components/menu/__workshop__/menuGroupRight.tsx +59 -0
- package/src/components/menu/__workshop__/nestedMenu.tsx +23 -0
- package/src/components/menu/__workshop__/onCloseMenuButton.tsx +37 -0
- package/src/components/menu/__workshop__/selectedItem.tsx +50 -0
- package/src/components/menu/__workshop__/tones.tsx +26 -0
- package/src/components/menu/__workshop__/withoutArrow.tsx +31 -0
- package/src/components/menu/helpers.ts +82 -0
- package/src/components/menu/index.ts +5 -0
- package/src/components/menu/menu.test.tsx +127 -0
- package/src/components/menu/menu.tsx +167 -0
- package/src/components/menu/menuButton.tsx +256 -0
- package/src/components/menu/menuContext.ts +31 -0
- package/src/components/menu/menuDivider.ts +12 -0
- package/src/components/menu/menuGroup.tsx +200 -0
- package/src/components/menu/menuItem.tsx +179 -0
- package/src/components/menu/useMenu.ts +20 -0
- package/src/components/menu/useMenuController.ts +235 -0
- package/src/components/skeleton/__workshop__/.eslintrc +5 -0
- package/src/components/skeleton/__workshop__/delay.tsx +70 -0
- package/src/components/skeleton/__workshop__/index.ts +7 -0
- package/src/components/skeleton/__workshop__/skeleton.tsx +64 -0
- package/src/components/skeleton/index.ts +2 -0
- package/src/components/skeleton/skeleton.tsx +48 -0
- package/src/components/skeleton/styles.ts +50 -0
- package/src/components/skeleton/textSkeleton.tsx +114 -0
- package/src/components/tab/__workshop__/.eslintrc +5 -0
- package/src/components/tab/__workshop__/example.tsx +74 -0
- package/src/components/tab/__workshop__/index.ts +6 -0
- package/src/components/tab/index.ts +3 -0
- package/src/components/tab/tab.tsx +94 -0
- package/src/components/tab/tabList.tsx +59 -0
- package/src/components/tab/tabPanel.tsx +37 -0
- package/src/components/toast/__workshop__/.eslintrc +5 -0
- package/src/components/toast/__workshop__/hook.tsx +72 -0
- package/src/components/toast/__workshop__/index.ts +7 -0
- package/src/components/toast/__workshop__/toast.tsx +26 -0
- package/src/components/toast/index.ts +4 -0
- package/src/components/toast/toast.test.tsx +100 -0
- package/src/components/toast/toast.tsx +87 -0
- package/src/components/toast/toastContext.ts +9 -0
- package/src/components/toast/toastProvider.tsx +155 -0
- package/src/components/toast/types.ts +20 -0
- package/src/components/toast/useToast.ts +24 -0
- package/src/components/tree/__workshop__/.eslintrc +5 -0
- package/src/components/tree/__workshop__/basic.perf.ts +32 -0
- package/src/components/tree/__workshop__/basic.tsx +104 -0
- package/src/components/tree/__workshop__/index.ts +11 -0
- package/src/components/tree/helpers.ts +105 -0
- package/src/components/tree/index.ts +4 -0
- package/src/components/tree/style.ts +107 -0
- package/src/components/tree/tree.tsx +213 -0
- package/src/components/tree/treeContext.ts +12 -0
- package/src/components/tree/treeGroup.tsx +29 -0
- package/src/components/tree/treeItem.tsx +194 -0
- package/src/components/tree/types.ts +21 -0
- package/src/components/tree/useTree.ts +16 -0
- package/src/constants.ts +2 -0
- package/src/helpers/animation.ts +27 -0
- package/src/helpers/element.ts +48 -0
- package/src/helpers/focus.ts +100 -0
- package/src/helpers/index.ts +4 -0
- package/src/helpers/scroll.ts +15 -0
- package/src/hooks/_internal/index.ts +1 -0
- package/src/hooks/_internal/useUnique.ts +35 -0
- package/src/hooks/index.ts +8 -0
- package/src/hooks/useClickOutside.ts +99 -0
- package/src/hooks/useCustomValidity.ts +15 -0
- package/src/hooks/useElementRect/__workshop__/.eslintrc +5 -0
- package/src/hooks/useElementRect/__workshop__/example.tsx +30 -0
- package/src/hooks/useElementRect/__workshop__/index.ts +6 -0
- package/src/hooks/useElementRect/index.ts +1 -0
- package/src/hooks/useElementRect/useElementRect.ts +23 -0
- package/src/hooks/useForwardedRef.ts +21 -0
- package/src/hooks/useGlobalKeyDown.ts +12 -0
- package/src/hooks/useIsomorphicEffect.ts +6 -0
- package/src/hooks/useMediaIndex/__workshop__/.eslintrc +5 -0
- package/src/hooks/useMediaIndex/__workshop__/index.ts +6 -0
- package/src/hooks/useMediaIndex/__workshop__/test.tsx +15 -0
- package/src/hooks/useMediaIndex/index.ts +1 -0
- package/src/hooks/useMediaIndex/lib/media.ts +88 -0
- package/src/hooks/useMediaIndex/useMediaIndex.ts +18 -0
- package/src/hooks/usePrefersDark.ts +26 -0
- package/src/hooks/useResponsiveProp.ts +10 -0
- package/src/icons/__workshop__/.eslintrc +5 -0
- package/src/icons/__workshop__/index.tsx +6 -0
- package/src/icons/__workshop__/overview.tsx +76 -0
- package/src/index.ts +8 -0
- package/src/lib/globalScope.ts +19 -0
- package/src/lib/isRecord.ts +3 -0
- package/src/primitives/_selectable/index.ts +1 -0
- package/src/primitives/_selectable/selectable.tsx +12 -0
- package/src/primitives/_selectable/style.ts +111 -0
- package/src/primitives/avatar/__workshop__/.eslintrc +5 -0
- package/src/primitives/avatar/__workshop__/asButton.tsx +14 -0
- package/src/primitives/avatar/__workshop__/index.ts +15 -0
- package/src/primitives/avatar/__workshop__/stack.tsx +25 -0
- package/src/primitives/avatar/avatar.tsx +165 -0
- package/src/primitives/avatar/avatarCounter.tsx +77 -0
- package/src/primitives/avatar/avatarStack.tsx +93 -0
- package/src/primitives/avatar/index.ts +4 -0
- package/src/primitives/avatar/styles.ts +159 -0
- package/src/primitives/avatar/types.ts +15 -0
- package/src/primitives/badge/__workshop__/.eslintrc +5 -0
- package/src/primitives/badge/__workshop__/index.ts +15 -0
- package/src/primitives/badge/__workshop__/props.tsx +30 -0
- package/src/primitives/badge/__workshop__/tones.tsx +28 -0
- package/src/primitives/badge/badge.test.tsx +14 -0
- package/src/primitives/badge/badge.tsx +56 -0
- package/src/primitives/badge/index.ts +1 -0
- package/src/primitives/badge/styles.ts +20 -0
- package/src/primitives/badge/types.ts +9 -0
- package/src/primitives/box/__workshop__/.eslintrc +5 -0
- package/src/primitives/box/__workshop__/index.ts +7 -0
- package/src/primitives/box/__workshop__/props.tsx +20 -0
- package/src/primitives/box/__workshop__/responsive.tsx +21 -0
- package/src/primitives/box/box.tsx +124 -0
- package/src/primitives/box/index.ts +1 -0
- package/src/primitives/button/__workshop__/.eslintrc +5 -0
- package/src/primitives/button/__workshop__/custom.tsx +48 -0
- package/src/primitives/button/__workshop__/customIcons.tsx +31 -0
- package/src/primitives/button/__workshop__/index.ts +50 -0
- package/src/primitives/button/__workshop__/mixedChildren.tsx +13 -0
- package/src/primitives/button/__workshop__/props.tsx +51 -0
- package/src/primitives/button/__workshop__/sanityUploadButton.tsx +35 -0
- package/src/primitives/button/__workshop__/stacked.tsx +58 -0
- package/src/primitives/button/__workshop__/styled1.tsx +18 -0
- package/src/primitives/button/__workshop__/styled2.tsx +20 -0
- package/src/primitives/button/__workshop__/uploadButton.tsx +28 -0
- package/src/primitives/button/button.test.tsx +42 -0
- package/src/primitives/button/button.tsx +168 -0
- package/src/primitives/button/index.ts +1 -0
- package/src/primitives/button/styles.ts +81 -0
- package/src/primitives/card/__workshop__/.eslintrc +5 -0
- package/src/primitives/card/__workshop__/allTones.tsx +28 -0
- package/src/primitives/card/__workshop__/asButton.tsx +89 -0
- package/src/primitives/card/__workshop__/asComponent.tsx +27 -0
- package/src/primitives/card/__workshop__/checkered.tsx +17 -0
- package/src/primitives/card/__workshop__/index.ts +14 -0
- package/src/primitives/card/__workshop__/interactive.tsx +24 -0
- package/src/primitives/card/__workshop__/listNavigation.tsx +78 -0
- package/src/primitives/card/__workshop__/props.tsx +48 -0
- package/src/primitives/card/__workshop__/selected.tsx +98 -0
- package/src/primitives/card/__workshop__/styled.tsx +15 -0
- package/src/primitives/card/card.tsx +104 -0
- package/src/primitives/card/index.ts +2 -0
- package/src/primitives/card/styles.ts +148 -0
- package/src/primitives/card/types.ts +10 -0
- package/src/primitives/checkbox/__workshop__/.eslintrc +5 -0
- package/src/primitives/checkbox/__workshop__/example.tsx +23 -0
- package/src/primitives/checkbox/__workshop__/index.ts +9 -0
- package/src/primitives/checkbox/__workshop__/props.tsx +32 -0
- package/src/primitives/checkbox/__workshop__/readOnly.tsx +15 -0
- package/src/primitives/checkbox/__workshop__/tones.tsx +23 -0
- package/src/primitives/checkbox/checkbox.tsx +63 -0
- package/src/primitives/checkbox/index.ts +1 -0
- package/src/primitives/checkbox/styles.ts +97 -0
- package/src/primitives/code/__workshop__/.eslintrc +5 -0
- package/src/primitives/code/__workshop__/index.ts +15 -0
- package/src/primitives/code/__workshop__/opticalAlignment.tsx +49 -0
- package/src/primitives/code/__workshop__/props.tsx +21 -0
- package/src/primitives/code/code.tsx +36 -0
- package/src/primitives/code/index.ts +1 -0
- package/src/primitives/code/styles.ts +70 -0
- package/src/primitives/container/__workshop__/.eslintrc +5 -0
- package/src/primitives/container/__workshop__/example.tsx +20 -0
- package/src/primitives/container/__workshop__/index.ts +6 -0
- package/src/primitives/container/container.tsx +28 -0
- package/src/primitives/container/index.ts +2 -0
- package/src/primitives/container/styles.ts +23 -0
- package/src/primitives/container/types.ts +6 -0
- package/src/primitives/flex/__workshop__/.eslintrc +5 -0
- package/src/primitives/flex/__workshop__/example.tsx +34 -0
- package/src/primitives/flex/__workshop__/gap.tsx +26 -0
- package/src/primitives/flex/__workshop__/index.ts +7 -0
- package/src/primitives/flex/flex.tsx +49 -0
- package/src/primitives/flex/index.ts +1 -0
- package/src/primitives/grid/__workshop__/.eslintrc +5 -0
- package/src/primitives/grid/__workshop__/index.ts +6 -0
- package/src/primitives/grid/__workshop__/responsive.tsx +54 -0
- package/src/primitives/grid/grid.tsx +43 -0
- package/src/primitives/grid/index.ts +1 -0
- package/src/primitives/heading/__workshop__/.eslintrc +5 -0
- package/src/primitives/heading/__workshop__/index.ts +15 -0
- package/src/primitives/heading/__workshop__/opticalAlignment.tsx +55 -0
- package/src/primitives/heading/__workshop__/plain.tsx +32 -0
- package/src/primitives/heading/heading.tsx +81 -0
- package/src/primitives/heading/index.ts +1 -0
- package/src/primitives/heading/styles.ts +51 -0
- package/src/primitives/heading/types.ts +7 -0
- package/src/primitives/helpers.ts +11 -0
- package/src/primitives/index.ts +27 -0
- package/src/primitives/inline/__workshop__/.eslintrc +5 -0
- package/src/primitives/inline/__workshop__/index.ts +6 -0
- package/src/primitives/inline/__workshop__/plain.tsx +27 -0
- package/src/primitives/inline/index.ts +1 -0
- package/src/primitives/inline/inline.tsx +34 -0
- package/src/primitives/inline/styles.ts +31 -0
- package/src/primitives/inline/types.ts +6 -0
- package/src/primitives/kbd/__workshop__/.eslintrc +5 -0
- package/src/primitives/kbd/__workshop__/index.ts +6 -0
- package/src/primitives/kbd/__workshop__/plain.tsx +10 -0
- package/src/primitives/kbd/index.tsx +1 -0
- package/src/primitives/kbd/kbd.tsx +49 -0
- package/src/primitives/label/__workshop__/.eslintrc +5 -0
- package/src/primitives/label/__workshop__/index.ts +15 -0
- package/src/primitives/label/__workshop__/opticalAlignment.tsx +49 -0
- package/src/primitives/label/__workshop__/plain.tsx +24 -0
- package/src/primitives/label/index.ts +1 -0
- package/src/primitives/label/label.tsx +80 -0
- package/src/primitives/label/styles.ts +37 -0
- package/src/primitives/popover/__workshop__/.eslintrc +5 -0
- package/src/primitives/popover/__workshop__/index.ts +30 -0
- package/src/primitives/popover/__workshop__/margins.tsx +32 -0
- package/src/primitives/popover/__workshop__/matchReferenceWidth.tsx +32 -0
- package/src/primitives/popover/__workshop__/plain.tsx +69 -0
- package/src/primitives/popover/__workshop__/recursive.tsx +75 -0
- package/src/primitives/popover/__workshop__/rightAligned.tsx +57 -0
- package/src/primitives/popover/arrow.tsx +75 -0
- package/src/primitives/popover/index.ts +1 -0
- package/src/primitives/popover/modifiers/getPopoverModifiers.ts +137 -0
- package/src/primitives/popover/modifiers/index.ts +1 -0
- package/src/primitives/popover/modifiers/types.ts +18 -0
- package/src/primitives/popover/modifiers/usePopoverModifiers.ts +58 -0
- package/src/primitives/popover/popover.tsx +246 -0
- package/src/primitives/radio/__workshop__/.eslintrc +5 -0
- package/src/primitives/radio/__workshop__/example.tsx +63 -0
- package/src/primitives/radio/__workshop__/index.ts +7 -0
- package/src/primitives/radio/__workshop__/plain.tsx +29 -0
- package/src/primitives/radio/index.ts +1 -0
- package/src/primitives/radio/radio.tsx +41 -0
- package/src/primitives/radio/styles.ts +105 -0
- package/src/primitives/select/__workshop__/.eslintrc +5 -0
- package/src/primitives/select/__workshop__/index.ts +7 -0
- package/src/primitives/select/__workshop__/plain.tsx +28 -0
- package/src/primitives/select/__workshop__/readOnly.tsx +24 -0
- package/src/primitives/select/index.ts +1 -0
- package/src/primitives/select/select.tsx +77 -0
- package/src/primitives/select/styles.ts +161 -0
- package/src/primitives/spinner/__workshop__/.eslintrc +5 -0
- package/src/primitives/spinner/__workshop__/Props.tsx +15 -0
- package/src/primitives/spinner/__workshop__/index.ts +10 -0
- package/src/primitives/spinner/index.ts +1 -0
- package/src/primitives/spinner/spinner.tsx +42 -0
- package/src/primitives/stack/__workshop__/.eslintrc +5 -0
- package/src/primitives/stack/__workshop__/index.ts +10 -0
- package/src/primitives/stack/__workshop__/plain.tsx +32 -0
- package/src/primitives/stack/index.ts +1 -0
- package/src/primitives/stack/stack.tsx +35 -0
- package/src/primitives/stack/styles.ts +32 -0
- package/src/primitives/switch/__workshop__/.eslintrc +5 -0
- package/src/primitives/switch/__workshop__/example.tsx +23 -0
- package/src/primitives/switch/__workshop__/index.ts +7 -0
- package/src/primitives/switch/__workshop__/props.tsx +41 -0
- package/src/primitives/switch/index.ts +1 -0
- package/src/primitives/switch/styles.ts +163 -0
- package/src/primitives/switch/switch.tsx +58 -0
- package/src/primitives/text/__workshop__/.eslintrc +5 -0
- package/src/primitives/text/__workshop__/colored.tsx +28 -0
- package/src/primitives/text/__workshop__/example.tsx +39 -0
- package/src/primitives/text/__workshop__/index.ts +20 -0
- package/src/primitives/text/__workshop__/opticalAlignment.tsx +49 -0
- package/src/primitives/text/index.ts +1 -0
- package/src/primitives/text/styles.ts +59 -0
- package/src/primitives/text/text.tsx +81 -0
- package/src/primitives/textArea/__workshop__/.eslintrc +5 -0
- package/src/primitives/textArea/__workshop__/index.ts +10 -0
- package/src/primitives/textArea/__workshop__/plain.tsx +45 -0
- package/src/primitives/textArea/index.ts +1 -0
- package/src/primitives/textArea/textArea.tsx +86 -0
- package/src/primitives/textInput/__workshop__/.eslintrc +5 -0
- package/src/primitives/textInput/__workshop__/clearButton.tsx +24 -0
- package/src/primitives/textInput/__workshop__/customValidity.tsx +18 -0
- package/src/primitives/textInput/__workshop__/index.ts +45 -0
- package/src/primitives/textInput/__workshop__/multipleTones.tsx +21 -0
- package/src/primitives/textInput/__workshop__/plain.tsx +90 -0
- package/src/primitives/textInput/__workshop__/readOnly.tsx +6 -0
- package/src/primitives/textInput/__workshop__/states.tsx +46 -0
- package/src/primitives/textInput/__workshop__/tones.tsx +101 -0
- package/src/primitives/textInput/__workshop__/typed.tsx +16 -0
- package/src/primitives/textInput/index.ts +1 -0
- package/src/primitives/textInput/textInput.tsx +328 -0
- package/src/primitives/tooltip/__workshop__/.eslintrc +5 -0
- package/src/primitives/tooltip/__workshop__/index.ts +10 -0
- package/src/primitives/tooltip/__workshop__/props.tsx +22 -0
- package/src/primitives/tooltip/index.ts +1 -0
- package/src/primitives/tooltip/tooltip.tsx +186 -0
- package/src/primitives/tooltip/tooltipArrow.tsx +74 -0
- package/src/primitives/types.ts +131 -0
- package/src/styles/border/borderStyle.ts +57 -0
- package/src/styles/border/index.ts +2 -0
- package/src/styles/border/types.ts +10 -0
- package/src/styles/box/boxStyle.ts +72 -0
- package/src/styles/box/index.ts +2 -0
- package/src/styles/box/types.ts +11 -0
- package/src/styles/colorVars/colorVarsStyle.ts +41 -0
- package/src/styles/colorVars/index.ts +1 -0
- package/src/styles/flex/flexItemStyle.ts +26 -0
- package/src/styles/flex/flexStyle.ts +74 -0
- package/src/styles/flex/index.ts +3 -0
- package/src/styles/flex/types.ts +24 -0
- package/src/styles/focusRing/index.ts +23 -0
- package/src/styles/font/codeFontStyle.ts +12 -0
- package/src/styles/font/headingFontStyle.ts +12 -0
- package/src/styles/font/index.ts +6 -0
- package/src/styles/font/labelFontStyle.ts +12 -0
- package/src/styles/font/responsiveFont.ts +108 -0
- package/src/styles/font/textAlignStyle.ts +18 -0
- package/src/styles/font/textFontStyle.ts +12 -0
- package/src/styles/font/types.ts +33 -0
- package/src/styles/grid/gridItemStyle.ts +87 -0
- package/src/styles/grid/gridStyle.ts +115 -0
- package/src/styles/grid/index.ts +3 -0
- package/src/styles/grid/types.ts +37 -0
- package/src/styles/helpers.ts +70 -0
- package/src/styles/index.ts +5 -0
- package/src/styles/input/index.ts +2 -0
- package/src/styles/input/responsiveInputPaddingStyle.ts +80 -0
- package/src/styles/input/textInputStyle.ts +210 -0
- package/src/styles/internal.ts +12 -0
- package/src/styles/margin/index.ts +2 -0
- package/src/styles/margin/marginStyle.ts +20 -0
- package/src/styles/margin/marginsStyle.test.ts +31 -0
- package/src/styles/margin/types.ts +9 -0
- package/src/styles/padding/index.ts +2 -0
- package/src/styles/padding/paddingStyle.test.ts +31 -0
- package/src/styles/padding/paddingStyle.ts +20 -0
- package/src/styles/padding/types.ts +12 -0
- package/src/styles/radius/index.ts +2 -0
- package/src/styles/radius/radiusStyle.ts +13 -0
- package/src/styles/radius/types.ts +6 -0
- package/src/styles/shadow/index.ts +2 -0
- package/src/styles/shadow/shadowStyle.ts +31 -0
- package/src/styles/shadow/types.ts +6 -0
- package/src/styles/types.ts +8 -0
- package/src/theme/ThemeContext.ts +12 -0
- package/src/theme/__workshop__/.eslintrc +5 -0
- package/src/theme/__workshop__/canvas.tsx +395 -0
- package/src/theme/__workshop__/color.tsx +65 -0
- package/src/theme/__workshop__/index.ts +25 -0
- package/src/theme/__workshop__/layer.tsx +78 -0
- package/src/theme/__workshop__/nestedProvider.tsx +16 -0
- package/src/theme/defaults.ts +7 -0
- package/src/theme/index.ts +8 -0
- package/src/theme/lib/color-fns/blend/index.ts +2 -0
- package/src/theme/lib/color-fns/blend/multiply.ts +22 -0
- package/src/theme/lib/color-fns/blend/screen.ts +22 -0
- package/src/theme/lib/color-fns/color-fns.test.ts +63 -0
- package/src/theme/lib/color-fns/convert.ts +127 -0
- package/src/theme/lib/color-fns/helpers/index.ts +1 -0
- package/src/theme/lib/color-fns/helpers/rgba.ts +10 -0
- package/src/theme/lib/color-fns/index.ts +5 -0
- package/src/theme/lib/color-fns/parse.ts +56 -0
- package/src/theme/lib/color-fns/types.ts +17 -0
- package/src/theme/lib/theme/avatar.ts +9 -0
- package/src/theme/lib/theme/color/_generic/index.ts +1 -0
- package/src/theme/lib/theme/color/_generic/types.ts +29 -0
- package/src/theme/lib/theme/color/base/index.ts +1 -0
- package/src/theme/lib/theme/color/base/types.ts +19 -0
- package/src/theme/lib/theme/color/button/createButtonModes.ts +20 -0
- package/src/theme/lib/theme/color/button/createButtonTones.ts +52 -0
- package/src/theme/lib/theme/color/button/index.ts +1 -0
- package/src/theme/lib/theme/color/button/types.ts +44 -0
- package/src/theme/lib/theme/color/card/createCardStates.ts +58 -0
- package/src/theme/lib/theme/color/card/index.ts +1 -0
- package/src/theme/lib/theme/color/card/types.ts +18 -0
- package/src/theme/lib/theme/color/color.test.ts +60 -0
- package/src/theme/lib/theme/color/defaults.ts +382 -0
- package/src/theme/lib/theme/color/factory.ts +138 -0
- package/src/theme/lib/theme/color/index.ts +14 -0
- package/src/theme/lib/theme/color/input/createInputModes.ts +84 -0
- package/src/theme/lib/theme/color/input/index.ts +1 -0
- package/src/theme/lib/theme/color/input/types.ts +27 -0
- package/src/theme/lib/theme/color/muted/createMuted.ts +56 -0
- package/src/theme/lib/theme/color/muted/index.ts +1 -0
- package/src/theme/lib/theme/color/muted/types.ts +24 -0
- package/src/theme/lib/theme/color/selectable/createSelectableTones.ts +73 -0
- package/src/theme/lib/theme/color/selectable/index.ts +1 -0
- package/src/theme/lib/theme/color/selectable/types.ts +29 -0
- package/src/theme/lib/theme/color/solid/createSolidTones.ts +56 -0
- package/src/theme/lib/theme/color/solid/index.ts +1 -0
- package/src/theme/lib/theme/color/solid/types.ts +24 -0
- package/src/theme/lib/theme/color/spot/createSpot.ts +21 -0
- package/src/theme/lib/theme/color/spot/index.ts +1 -0
- package/src/theme/lib/theme/color/spot/types.ts +28 -0
- package/src/theme/lib/theme/color/syntax/index.ts +1 -0
- package/src/theme/lib/theme/color/syntax/types.ts +41 -0
- package/src/theme/lib/theme/color/types.ts +72 -0
- package/src/theme/lib/theme/fonts.ts +54 -0
- package/src/theme/lib/theme/index.ts +7 -0
- package/src/theme/lib/theme/input.ts +22 -0
- package/src/theme/lib/theme/layer.ts +9 -0
- package/src/theme/lib/theme/shadow.ts +20 -0
- package/src/theme/lib/theme/theme.ts +37 -0
- package/src/theme/studioTheme/color.ts +637 -0
- package/src/theme/studioTheme/fonts.ts +223 -0
- package/src/theme/studioTheme/helpers.ts +17 -0
- package/src/theme/studioTheme/index.ts +1 -0
- package/src/theme/studioTheme/theme.ts +68 -0
- package/src/theme/theme.test.tsx +104 -0
- package/src/theme/themeColorProvider.tsx +27 -0
- package/src/theme/themeProvider.tsx +61 -0
- package/src/theme/types.ts +39 -0
- package/src/theme/useRootTheme.ts +24 -0
- package/src/theme/useTheme.ts +10 -0
- package/src/types/avatar.ts +14 -0
- package/src/types/badge.ts +9 -0
- package/src/types/box.ts +19 -0
- package/src/types/button.ts +14 -0
- package/src/types/card.ts +6 -0
- package/src/types/common.ts +12 -0
- package/src/types/dialog.ts +4 -0
- package/src/types/flex.ts +30 -0
- package/src/types/grid.ts +14 -0
- package/src/types/gridItem.ts +29 -0
- package/src/types/index.ts +13 -0
- package/src/types/popover.ts +4 -0
- package/src/types/selectable.ts +4 -0
- package/src/utils/boundaryElement/__workshop__/.eslintrc +5 -0
- package/src/utils/boundaryElement/__workshop__/index.ts +10 -0
- package/src/utils/boundaryElement/__workshop__/plain.tsx +23 -0
- package/src/utils/boundaryElement/boundaryElement.test.tsx +99 -0
- package/src/utils/boundaryElement/boundaryElementContext.ts +10 -0
- package/src/utils/boundaryElement/boundaryElementProvider.tsx +21 -0
- package/src/utils/boundaryElement/index.ts +3 -0
- package/src/utils/boundaryElement/types.ts +7 -0
- package/src/utils/boundaryElement/useBoundaryElement.ts +25 -0
- package/src/utils/elementQuery/__workshop__/.eslintrc +5 -0
- package/src/utils/elementQuery/__workshop__/customMedia.tsx +31 -0
- package/src/utils/elementQuery/__workshop__/index.ts +10 -0
- package/src/utils/elementQuery/elementQuery.tsx +66 -0
- package/src/utils/elementQuery/helpers.ts +27 -0
- package/src/utils/elementQuery/index.ts +1 -0
- package/src/utils/errorBoundary.tsx +47 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/layer/__workshop__/.eslintrc +5 -0
- package/src/utils/layer/__workshop__/_debug.tsx +12 -0
- package/src/utils/layer/__workshop__/index.ts +20 -0
- package/src/utils/layer/__workshop__/multipleRoots.tsx +48 -0
- package/src/utils/layer/__workshop__/plain.tsx +87 -0
- package/src/utils/layer/__workshop__/responsiveZOffset.tsx +13 -0
- package/src/utils/layer/index.ts +4 -0
- package/src/utils/layer/layer.test.tsx +106 -0
- package/src/utils/layer/layer.tsx +53 -0
- package/src/utils/layer/layerContext.ts +9 -0
- package/src/utils/layer/layerProvider.tsx +46 -0
- package/src/utils/layer/types.ts +10 -0
- package/src/utils/layer/useLayer.ts +24 -0
- package/src/utils/portal/__workshop__/.eslintrc +5 -0
- package/src/utils/portal/__workshop__/index.ts +10 -0
- package/src/utils/portal/__workshop__/named.tsx +61 -0
- package/src/utils/portal/index.ts +4 -0
- package/src/utils/portal/portal.test.tsx +102 -0
- package/src/utils/portal/portal.ts +30 -0
- package/src/utils/portal/portalContext.ts +33 -0
- package/src/utils/portal/portalProvider.tsx +41 -0
- package/src/utils/portal/types.ts +9 -0
- package/src/utils/portal/usePortal.ts +24 -0
- package/src/utils/resizeObserver.ts +12 -0
- package/src/utils/srOnly/__workshop__/.eslintrc +5 -0
- package/src/utils/srOnly/index.ts +1 -0
- package/src/utils/srOnly/srOnly.tsx +34 -0
- package/src/utils/virtualList/__workshop__/.eslintrc +5 -0
- package/src/utils/virtualList/__workshop__/changingProps.tsx +36 -0
- package/src/utils/virtualList/__workshop__/elementScroll.tsx +24 -0
- package/src/utils/virtualList/__workshop__/index.ts +25 -0
- package/src/utils/virtualList/__workshop__/infiniteList.tsx +48 -0
- package/src/utils/virtualList/__workshop__/windowScrolll.tsx +22 -0
- package/src/utils/virtualList/index.ts +1 -0
- package/src/utils/virtualList/virtualList.tsx +164 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, {forwardRef} from 'react'
|
|
2
|
+
import styled from 'styled-components'
|
|
3
|
+
import {
|
|
4
|
+
boxStyle,
|
|
5
|
+
flexItemStyle,
|
|
6
|
+
FlexItemStyleProps,
|
|
7
|
+
responsiveBoxStyle,
|
|
8
|
+
ResponsiveBoxStyleProps,
|
|
9
|
+
responsiveGridItemStyle,
|
|
10
|
+
ResponsiveGridItemStyleProps,
|
|
11
|
+
responsivePaddingStyle,
|
|
12
|
+
ResponsivePaddingStyleProps,
|
|
13
|
+
responsiveMarginStyle,
|
|
14
|
+
ResponsiveMarginStyleProps,
|
|
15
|
+
} from '../../styles/internal'
|
|
16
|
+
import {
|
|
17
|
+
ResponsiveBoxProps,
|
|
18
|
+
ResponsiveFlexItemProps,
|
|
19
|
+
ResponsiveGridItemProps,
|
|
20
|
+
ResponsiveMarginProps,
|
|
21
|
+
ResponsivePaddingProps,
|
|
22
|
+
} from '../types'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export interface BoxProps
|
|
28
|
+
extends ResponsiveFlexItemProps,
|
|
29
|
+
ResponsiveBoxProps,
|
|
30
|
+
ResponsiveGridItemProps,
|
|
31
|
+
ResponsiveMarginProps,
|
|
32
|
+
ResponsivePaddingProps {
|
|
33
|
+
as?: React.ElementType | keyof JSX.IntrinsicElements
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const Root = styled.div<
|
|
37
|
+
FlexItemStyleProps &
|
|
38
|
+
ResponsiveBoxStyleProps &
|
|
39
|
+
ResponsiveGridItemStyleProps &
|
|
40
|
+
ResponsiveMarginStyleProps &
|
|
41
|
+
ResponsivePaddingStyleProps
|
|
42
|
+
>(
|
|
43
|
+
boxStyle,
|
|
44
|
+
flexItemStyle,
|
|
45
|
+
responsiveBoxStyle,
|
|
46
|
+
responsiveGridItemStyle,
|
|
47
|
+
responsiveMarginStyle,
|
|
48
|
+
responsivePaddingStyle
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export const Box = forwardRef(function Box(
|
|
55
|
+
props: BoxProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height'>,
|
|
56
|
+
ref: React.ForwardedRef<HTMLDivElement>
|
|
57
|
+
) {
|
|
58
|
+
const {
|
|
59
|
+
as: asProp = 'div',
|
|
60
|
+
column,
|
|
61
|
+
columnStart,
|
|
62
|
+
columnEnd,
|
|
63
|
+
display = 'block',
|
|
64
|
+
flex,
|
|
65
|
+
height,
|
|
66
|
+
margin = 0,
|
|
67
|
+
marginX,
|
|
68
|
+
marginY,
|
|
69
|
+
marginTop,
|
|
70
|
+
marginRight,
|
|
71
|
+
marginBottom,
|
|
72
|
+
marginLeft,
|
|
73
|
+
overflow,
|
|
74
|
+
padding = 0,
|
|
75
|
+
paddingX,
|
|
76
|
+
paddingY,
|
|
77
|
+
paddingTop,
|
|
78
|
+
paddingRight,
|
|
79
|
+
paddingBottom,
|
|
80
|
+
paddingLeft,
|
|
81
|
+
row,
|
|
82
|
+
rowStart,
|
|
83
|
+
rowEnd,
|
|
84
|
+
sizing,
|
|
85
|
+
...restProps
|
|
86
|
+
} = props
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<Root
|
|
90
|
+
data-as={asProp}
|
|
91
|
+
data-ui="Box"
|
|
92
|
+
{...restProps}
|
|
93
|
+
$column={column}
|
|
94
|
+
$columnStart={columnStart}
|
|
95
|
+
$columnEnd={columnEnd}
|
|
96
|
+
$display={display}
|
|
97
|
+
$flex={flex}
|
|
98
|
+
$height={height}
|
|
99
|
+
$margin={margin}
|
|
100
|
+
$marginX={marginX}
|
|
101
|
+
$marginY={marginY}
|
|
102
|
+
$marginTop={marginTop}
|
|
103
|
+
$marginRight={marginRight}
|
|
104
|
+
$marginBottom={marginBottom}
|
|
105
|
+
$marginLeft={marginLeft}
|
|
106
|
+
$overflow={overflow}
|
|
107
|
+
$padding={padding}
|
|
108
|
+
$paddingX={paddingX}
|
|
109
|
+
$paddingY={paddingY}
|
|
110
|
+
$paddingTop={paddingTop}
|
|
111
|
+
$paddingRight={paddingRight}
|
|
112
|
+
$paddingBottom={paddingBottom}
|
|
113
|
+
$paddingLeft={paddingLeft}
|
|
114
|
+
$row={row}
|
|
115
|
+
$rowStart={rowStart}
|
|
116
|
+
$rowEnd={rowEnd}
|
|
117
|
+
$sizing={sizing}
|
|
118
|
+
as={asProp}
|
|
119
|
+
ref={ref}
|
|
120
|
+
>
|
|
121
|
+
{props.children}
|
|
122
|
+
</Root>
|
|
123
|
+
)
|
|
124
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './box'
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {Button, Flex, Grid, Stack, Text} from '@sanity/ui'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import {WORKSHOP_BUTTON_TONE_OPTIONS} from '../../../__workshop__/constants'
|
|
4
|
+
|
|
5
|
+
export default function CustomStory() {
|
|
6
|
+
const tones = Object.entries(WORKSHOP_BUTTON_TONE_OPTIONS)
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<Flex align="center" height="fill" justify="center">
|
|
10
|
+
<Stack space={2}>
|
|
11
|
+
<Grid columns={5} gap={1}>
|
|
12
|
+
{tones.map(([title, tone]) => (
|
|
13
|
+
<Button key={tone} mode="ghost" padding={3} tone={tone}>
|
|
14
|
+
<Stack space={2}>
|
|
15
|
+
<Text>{title}</Text>
|
|
16
|
+
<Text muted>Muted</Text>
|
|
17
|
+
<Text muted>
|
|
18
|
+
<a href="#">Link</a>
|
|
19
|
+
</Text>
|
|
20
|
+
<Text>
|
|
21
|
+
<code>Code</code>
|
|
22
|
+
</Text>
|
|
23
|
+
<Text accent>Accent</Text>
|
|
24
|
+
</Stack>
|
|
25
|
+
</Button>
|
|
26
|
+
))}
|
|
27
|
+
</Grid>
|
|
28
|
+
<Grid columns={5} gap={1}>
|
|
29
|
+
{tones.map(([title, tone]) => (
|
|
30
|
+
<Button key={tone} mode="default" padding={3} tone={tone}>
|
|
31
|
+
<Stack space={2}>
|
|
32
|
+
<Text>{title}</Text>
|
|
33
|
+
<Text muted>Muted</Text>
|
|
34
|
+
<Text muted>
|
|
35
|
+
<a href="#">Link</a>
|
|
36
|
+
</Text>
|
|
37
|
+
<Text>
|
|
38
|
+
<code>Code</code>
|
|
39
|
+
</Text>
|
|
40
|
+
<Text accent>Accent</Text>
|
|
41
|
+
</Stack>
|
|
42
|
+
</Button>
|
|
43
|
+
))}
|
|
44
|
+
</Grid>
|
|
45
|
+
</Stack>
|
|
46
|
+
</Flex>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {RocketIcon} from '@sanity/icons'
|
|
2
|
+
import {Button, Flex, Inline} from '@sanity/ui'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
export default function CustomIconsStory() {
|
|
6
|
+
return (
|
|
7
|
+
<Flex align="center" height="fill" justify="center">
|
|
8
|
+
<Inline space={1}>
|
|
9
|
+
<Button fontSize={1} icon={RocketIcon} padding={2} space={2} text="Rocket" />
|
|
10
|
+
<Button fontSize={1} icon={CustomIcon} padding={2} space={2} text="Heart" />
|
|
11
|
+
</Inline>
|
|
12
|
+
</Flex>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function CustomIcon() {
|
|
17
|
+
return (
|
|
18
|
+
<svg
|
|
19
|
+
stroke="currentColor"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
strokeWidth="0"
|
|
22
|
+
viewBox="0 0 24 24"
|
|
23
|
+
height="1em"
|
|
24
|
+
width="1em"
|
|
25
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
+
>
|
|
27
|
+
<path fill="none" d="M0 0h24v24H0z"></path>
|
|
28
|
+
<path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"></path>
|
|
29
|
+
</svg>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {defineScope} from '@sanity/ui-workshop'
|
|
2
|
+
import {lazy} from 'react'
|
|
3
|
+
|
|
4
|
+
export default defineScope('primitives/button', 'Button', [
|
|
5
|
+
{
|
|
6
|
+
name: 'props',
|
|
7
|
+
title: 'Props',
|
|
8
|
+
component: lazy(() => import('./props')),
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'styled-1',
|
|
12
|
+
title: 'Styled #1',
|
|
13
|
+
component: lazy(() => import('./styled1')),
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'styled-2',
|
|
17
|
+
title: 'Styled #2',
|
|
18
|
+
component: lazy(() => import('./styled2')),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'stacked',
|
|
22
|
+
title: 'Stacked',
|
|
23
|
+
component: lazy(() => import('./stacked')),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'custom',
|
|
27
|
+
title: 'Custom',
|
|
28
|
+
component: lazy(() => import('./custom')),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'mixed-children',
|
|
32
|
+
title: 'Mixed children',
|
|
33
|
+
component: lazy(() => import('./mixedChildren')),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'upload-button',
|
|
37
|
+
title: 'Upload button',
|
|
38
|
+
component: lazy(() => import('./uploadButton')),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'sanity-upload-button-workaround',
|
|
42
|
+
title: 'SanityUploadButtonWorkaroundStory',
|
|
43
|
+
component: lazy(() => import('./sanityUploadButton')),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'custom-icons',
|
|
47
|
+
title: 'Custom icons',
|
|
48
|
+
component: lazy(() => import('./customIcons')),
|
|
49
|
+
},
|
|
50
|
+
])
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {AddIcon} from '@sanity/icons'
|
|
2
|
+
import {Button, Flex} from '@sanity/ui'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
export default function MixedChildrenStory() {
|
|
6
|
+
return (
|
|
7
|
+
<Flex align="center" height="fill" justify="center">
|
|
8
|
+
<Button fontSize={[2, 2, 3]} icon={AddIcon} mode="ghost" padding={[3, 3, 4]} text="Create">
|
|
9
|
+
<span style={{display: 'none'}}>test</span>
|
|
10
|
+
</Button>
|
|
11
|
+
</Flex>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {icons} from '@sanity/icons'
|
|
2
|
+
import {Button, Flex} from '@sanity/ui'
|
|
3
|
+
import {useAction, useBoolean, useSelect, useText} from '@sanity/ui-workshop'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import {
|
|
6
|
+
WORKSHOP_BUTTON_MODE_OPTIONS,
|
|
7
|
+
WORKSHOP_BUTTON_TEXT_ALIGN_OPTIONS,
|
|
8
|
+
WORKSHOP_BUTTON_TONE_OPTIONS,
|
|
9
|
+
WORKSHOP_FLEX_JUSTIFY_OPTIONS,
|
|
10
|
+
WORKSHOP_ICON_SYMBOL_OPTIONS,
|
|
11
|
+
WORKSHOP_TEXT_SIZE_OPTIONS,
|
|
12
|
+
WORKSHOP_SPACE_OPTIONS,
|
|
13
|
+
} from '../../../__workshop__/constants'
|
|
14
|
+
|
|
15
|
+
export default function ButtonStory() {
|
|
16
|
+
const disabled = useBoolean('Disabled', false, 'Props')
|
|
17
|
+
const fontSize = useSelect('Font size', WORKSHOP_TEXT_SIZE_OPTIONS, 2, 'Props')
|
|
18
|
+
const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS, 'add-circle', 'Props')
|
|
19
|
+
const iconRight = useSelect('Icon (right)', WORKSHOP_ICON_SYMBOL_OPTIONS, '', 'Props')
|
|
20
|
+
const justify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS, 'center', 'Props')
|
|
21
|
+
const mode = useSelect('Mode', WORKSHOP_BUTTON_MODE_OPTIONS, 'default', 'Props')
|
|
22
|
+
const paddingX = useSelect('Padding X', WORKSHOP_SPACE_OPTIONS, 3, 'Props')
|
|
23
|
+
const paddingY = useSelect('Padding Y', WORKSHOP_SPACE_OPTIONS, 3, 'Props')
|
|
24
|
+
const selected = useBoolean('Selected', false, 'Props')
|
|
25
|
+
const space = useSelect('Space', WORKSHOP_SPACE_OPTIONS, 3, 'Props')
|
|
26
|
+
const tone = useSelect('Tone', WORKSHOP_BUTTON_TONE_OPTIONS, 'default', 'Props')
|
|
27
|
+
const textAlign =
|
|
28
|
+
useSelect('Text align', WORKSHOP_BUTTON_TEXT_ALIGN_OPTIONS, undefined, 'Props') || undefined
|
|
29
|
+
const textProp = useText('Text', 'Label', 'Props')
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Flex align="center" height="fill" justify="center">
|
|
33
|
+
<Button
|
|
34
|
+
disabled={disabled}
|
|
35
|
+
fontSize={fontSize}
|
|
36
|
+
icon={icon && icons[icon]}
|
|
37
|
+
iconRight={iconRight && icons[iconRight]}
|
|
38
|
+
justify={justify}
|
|
39
|
+
mode={mode}
|
|
40
|
+
onClick={useAction('onClick')}
|
|
41
|
+
paddingX={paddingX}
|
|
42
|
+
paddingY={paddingY}
|
|
43
|
+
selected={selected}
|
|
44
|
+
space={space}
|
|
45
|
+
textAlign={textAlign}
|
|
46
|
+
text={textProp}
|
|
47
|
+
tone={tone}
|
|
48
|
+
/>
|
|
49
|
+
</Flex>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {UploadIcon} from '@sanity/icons'
|
|
2
|
+
import {Button, Flex} from '@sanity/ui'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import styled from 'styled-components'
|
|
5
|
+
|
|
6
|
+
const SanityUploadButton = styled(Button).attrs({forwardedAs: 'label'})`
|
|
7
|
+
& input {
|
|
8
|
+
-webkit-appearance: none;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
top: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
position: absolute;
|
|
16
|
+
max-width: 0;
|
|
17
|
+
width: stretch;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
& span:nth-child(2) {
|
|
21
|
+
width: 0;
|
|
22
|
+
flex: none;
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
`
|
|
26
|
+
|
|
27
|
+
export default function SanityUploadButtonWorkaroundStory() {
|
|
28
|
+
return (
|
|
29
|
+
<Flex align="center" height="fill" htmlFor="file" justify="center">
|
|
30
|
+
<SanityUploadButton icon={UploadIcon} tabIndex={0} text="Upload">
|
|
31
|
+
<input type="file" />
|
|
32
|
+
</SanityUploadButton>
|
|
33
|
+
</Flex>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {icons} from '@sanity/icons'
|
|
2
|
+
import {Box, Button, Card, Container, Flex, Stack} from '@sanity/ui'
|
|
3
|
+
import {useAction, useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import {
|
|
6
|
+
WORKSHOP_BUTTON_MODE_OPTIONS,
|
|
7
|
+
WORKSHOP_BUTTON_TONE_OPTIONS,
|
|
8
|
+
WORKSHOP_FLEX_JUSTIFY_OPTIONS,
|
|
9
|
+
WORKSHOP_ICON_SYMBOL_OPTIONS,
|
|
10
|
+
WORKSHOP_SPACE_OPTIONS,
|
|
11
|
+
WORKSHOP_TEXT_SIZE_OPTIONS,
|
|
12
|
+
} from '../../../__workshop__/constants'
|
|
13
|
+
|
|
14
|
+
export default function StackedStory() {
|
|
15
|
+
const tones = Object.entries(WORKSHOP_BUTTON_TONE_OPTIONS)
|
|
16
|
+
const disabled = useBoolean('Disabled', false, 'Props')
|
|
17
|
+
const fontSize = useSelect('Font size', WORKSHOP_TEXT_SIZE_OPTIONS, 2, 'Props')
|
|
18
|
+
const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS, 'add-circle', 'Props')
|
|
19
|
+
const iconRight = useSelect('Icon (right)', WORKSHOP_ICON_SYMBOL_OPTIONS, '', 'Props')
|
|
20
|
+
const justify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS, 'center', 'Props')
|
|
21
|
+
const mode = useSelect('Mode', WORKSHOP_BUTTON_MODE_OPTIONS, 'default', 'Props')
|
|
22
|
+
const onClick = useAction('onClick')
|
|
23
|
+
const paddingX = useSelect('Padding X', WORKSHOP_SPACE_OPTIONS, 3, 'Props')
|
|
24
|
+
const paddingY = useSelect('Padding Y', WORKSHOP_SPACE_OPTIONS, 3, 'Props')
|
|
25
|
+
const selected = useBoolean('Selected', false, 'Props')
|
|
26
|
+
const space = useSelect('Space', WORKSHOP_SPACE_OPTIONS, 3, 'Props')
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Card height="fill" tone="transparent">
|
|
30
|
+
<Flex align="center" height="fill" justify="center">
|
|
31
|
+
<Container width={0} style={{textAlign: 'center'}}>
|
|
32
|
+
<Box padding={4}>
|
|
33
|
+
<Stack space={1}>
|
|
34
|
+
{tones.map(([title, tone]) => (
|
|
35
|
+
<Button
|
|
36
|
+
disabled={disabled}
|
|
37
|
+
fontSize={fontSize}
|
|
38
|
+
icon={icon && icons[icon]}
|
|
39
|
+
iconRight={iconRight && icons[iconRight]}
|
|
40
|
+
justify={justify}
|
|
41
|
+
key={tone}
|
|
42
|
+
mode={mode}
|
|
43
|
+
onClick={onClick}
|
|
44
|
+
paddingX={paddingX}
|
|
45
|
+
paddingY={paddingY}
|
|
46
|
+
selected={selected}
|
|
47
|
+
space={space}
|
|
48
|
+
text={title}
|
|
49
|
+
tone={tone}
|
|
50
|
+
/>
|
|
51
|
+
))}
|
|
52
|
+
</Stack>
|
|
53
|
+
</Box>
|
|
54
|
+
</Container>
|
|
55
|
+
</Flex>
|
|
56
|
+
</Card>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {Button, Flex} from '@sanity/ui'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import styled from 'styled-components'
|
|
4
|
+
|
|
5
|
+
const StyledButton1 = styled.a`
|
|
6
|
+
&:hover {
|
|
7
|
+
background-color: red;
|
|
8
|
+
box-shadow: none;
|
|
9
|
+
}
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
export default function StyledButton1Story() {
|
|
13
|
+
return (
|
|
14
|
+
<Flex align="center" height="fill" justify="center">
|
|
15
|
+
<Button as={StyledButton1} href="#" text="Test" />
|
|
16
|
+
</Flex>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {Button, Flex} from '@sanity/ui'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import styled from 'styled-components'
|
|
4
|
+
|
|
5
|
+
const StyledButton2 = styled(Button)<{$color?: boolean}>`
|
|
6
|
+
&:hover {
|
|
7
|
+
background-color: red;
|
|
8
|
+
box-shadow: none;
|
|
9
|
+
}
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
export default function StyledButton2Story() {
|
|
13
|
+
const props = {href: '#', text: 'Test'}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Flex align="center" height="fill" justify="center">
|
|
17
|
+
<StyledButton2 $color forwardedAs="a" {...props} />
|
|
18
|
+
</Flex>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {Button, Flex} from '@sanity/ui'
|
|
2
|
+
import React, {useCallback, useRef} from 'react'
|
|
3
|
+
|
|
4
|
+
export default function UploadButtonStory() {
|
|
5
|
+
const inputRef = useRef<HTMLInputElement | null>(null)
|
|
6
|
+
|
|
7
|
+
const handleKeyDown = useCallback((event: React.KeyboardEvent) => {
|
|
8
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
9
|
+
inputRef.current?.click()
|
|
10
|
+
}
|
|
11
|
+
}, [])
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Flex align="center" height="fill" htmlFor="file" justify="center">
|
|
15
|
+
<Button
|
|
16
|
+
as="label"
|
|
17
|
+
onKeyDown={handleKeyDown}
|
|
18
|
+
tabIndex={0}
|
|
19
|
+
text={
|
|
20
|
+
<>
|
|
21
|
+
Upload
|
|
22
|
+
<input id="file" ref={inputRef} type="file" style={{display: 'none'}} />
|
|
23
|
+
</>
|
|
24
|
+
}
|
|
25
|
+
/>
|
|
26
|
+
</Flex>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {AddIcon} from '@sanity/icons'
|
|
2
|
+
import {screen} from '@testing-library/react'
|
|
3
|
+
import {axe} from 'jest-axe'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import {render} from '../../../test'
|
|
6
|
+
import {Button, ButtonProps} from './button'
|
|
7
|
+
|
|
8
|
+
describe('atoms/button', () => {
|
|
9
|
+
it('Axe: should have no violations', async () => {
|
|
10
|
+
const lightResult = render(<Button icon={AddIcon} text="Label" tone="positive" />, {
|
|
11
|
+
scheme: 'light',
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
expect(await axe(lightResult.container.outerHTML)).toHaveNoViolations()
|
|
15
|
+
|
|
16
|
+
const darkResult = render(<Button icon={AddIcon} text="Label" tone="positive" />, {
|
|
17
|
+
scheme: 'dark',
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
expect(await axe(darkResult.container.outerHTML)).toHaveNoViolations()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('should render text', () => {
|
|
24
|
+
render(<Button text="Button text" />)
|
|
25
|
+
|
|
26
|
+
expect(screen.getByText('Button text')).toBeInTheDocument()
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('should wrap button', () => {
|
|
30
|
+
function WrappedButton({button: buttonProps}: {button: ButtonProps}) {
|
|
31
|
+
return <Button {...buttonProps} />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const buttonProps: ButtonProps = {
|
|
35
|
+
text: 'Button text',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
render(<WrappedButton button={buttonProps} />)
|
|
39
|
+
|
|
40
|
+
expect(screen.getByText('Button text')).toBeInTheDocument()
|
|
41
|
+
})
|
|
42
|
+
})
|