@blockle/blocks 0.20.0-alpha1 → 0.20.0-alpha1.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/dist/components/accessibility/VisuallyHidden/VisuallyHidden.cjs +4 -3
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.d.ts +5 -0
- package/dist/components/accessibility/VisuallyHidden/{VisuallyHidden.mjs → VisuallyHidden.js} +2 -2
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.spec.d.ts +1 -0
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
- package/dist/components/accessibility/VisuallyHidden/index.d.ts +1 -0
- package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.cjs +2 -1
- package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.d.ts +1 -0
- package/dist/components/accessibility/VisuallyHidden/{visually-hidden.css.mjs → visually-hidden.css.js} +1 -1
- package/dist/components/display/Divider/Divider.cjs +9 -8
- package/dist/components/display/Divider/Divider.d.ts +7 -0
- package/dist/components/display/Divider/{Divider.mjs → Divider.js} +4 -4
- package/dist/components/display/Divider/Divider.spec.d.ts +1 -0
- package/dist/components/display/Divider/Divider.stories.d.ts +6 -0
- package/dist/components/display/Divider/divider.css.cjs +4 -3
- package/dist/components/display/Divider/divider.css.d.ts +1 -0
- package/dist/components/display/Divider/{divider.css.mjs → divider.css.js} +2 -2
- package/dist/components/display/Divider/index.d.ts +1 -0
- package/dist/components/feedback/Progress/Progress.cjs +9 -8
- package/dist/components/feedback/Progress/Progress.d.ts +16 -0
- package/dist/components/feedback/Progress/{Progress.mjs → Progress.js} +3 -3
- package/dist/components/feedback/Progress/Progress.stories.d.ts +5 -0
- package/dist/components/feedback/Progress/index.d.ts +1 -0
- package/dist/components/feedback/Spinner/Spinner.cjs +7 -6
- package/dist/components/feedback/Spinner/Spinner.d.ts +9 -0
- package/dist/components/feedback/Spinner/{Spinner.mjs → Spinner.js} +3 -3
- package/dist/components/feedback/Spinner/Spinner.stories.d.ts +5 -0
- package/dist/components/feedback/Spinner/index.d.ts +1 -0
- package/dist/components/form/Button/Button.cjs +15 -14
- package/dist/components/form/Button/Button.css.cjs +4 -3
- package/dist/components/form/Button/Button.css.d.ts +1 -0
- package/dist/components/form/Button/{Button.css.mjs → Button.css.js} +2 -2
- package/dist/components/form/Button/Button.d.ts +21 -0
- package/dist/components/form/Button/{Button.mjs → Button.js} +7 -7
- package/dist/components/form/Button/Button.spec.d.ts +1 -0
- package/dist/components/form/Button/Button.stories.d.ts +7 -0
- package/dist/components/form/Button/index.d.ts +1 -0
- package/dist/components/form/Checkbox/Checkbox.cjs +12 -11
- package/dist/components/form/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/form/Checkbox/{Checkbox.mjs → Checkbox.js} +4 -4
- package/dist/components/form/Checkbox/Checkbox.spec.d.ts +1 -0
- package/dist/components/form/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/components/form/Checkbox/checkbox.css.cjs +7 -6
- package/dist/components/form/Checkbox/checkbox.css.d.ts +3 -0
- package/dist/components/form/Checkbox/{checkbox.css.mjs → checkbox.css.js} +4 -4
- package/dist/components/form/Checkbox/index.d.ts +1 -0
- package/dist/components/form/Input/Input.cjs +11 -10
- package/dist/components/form/Input/Input.d.ts +11 -0
- package/dist/components/form/Input/{Input.mjs → Input.js} +4 -4
- package/dist/components/form/Input/Input.spec.d.ts +1 -0
- package/dist/components/form/Input/Input.stories.d.ts +5 -0
- package/dist/components/form/Input/index.d.ts +1 -0
- package/dist/components/form/Input/input.css.cjs +4 -3
- package/dist/components/form/Input/input.css.d.ts +1 -0
- package/dist/components/form/Input/{input.css.mjs → input.css.js} +2 -2
- package/dist/components/form/Label/Label.cjs +6 -5
- package/dist/components/form/Label/Label.d.ts +18 -0
- package/dist/components/form/Label/{Label.mjs → Label.js} +3 -3
- package/dist/components/form/Label/Label.spec.d.ts +1 -0
- package/dist/components/form/Label/Label.stories.d.ts +6 -0
- package/dist/components/form/Label/index.d.ts +1 -0
- package/dist/components/form/Radio/Radio.cjs +12 -11
- package/dist/components/form/Radio/Radio.d.ts +8 -0
- package/dist/components/form/Radio/{Radio.mjs → Radio.js} +4 -4
- package/dist/components/form/Radio/Radio.spec.d.ts +1 -0
- package/dist/components/form/Radio/Radio.stories.d.ts +6 -0
- package/dist/components/form/Radio/RadioGroup.d.ts +8 -0
- package/dist/components/form/Radio/index.d.ts +2 -0
- package/dist/components/form/Radio/radio.css.cjs +7 -6
- package/dist/components/form/Radio/radio.css.d.ts +3 -0
- package/dist/components/form/Radio/{radio.css.mjs → radio.css.js} +4 -4
- package/dist/components/form/Select/Select.cjs +12 -11
- package/dist/components/form/Select/Select.d.ts +10 -0
- package/dist/components/form/Select/{Select.mjs → Select.js} +4 -4
- package/dist/components/form/Select/Select.stories.d.ts +5 -0
- package/dist/components/form/Select/index.d.ts +1 -0
- package/dist/components/form/Select/select.css.cjs +8 -7
- package/dist/components/form/Select/select.css.d.ts +3 -0
- package/dist/components/form/Select/{select.css.mjs → select.css.js} +4 -4
- package/dist/components/form/Slider/Slider.cjs +21 -19
- package/dist/components/form/Slider/Slider.d.ts +20 -0
- package/dist/components/form/Slider/{Slider.mjs → Slider.js} +7 -8
- package/dist/components/form/Slider/Slider.spec.d.ts +1 -0
- package/dist/components/form/Slider/Slider.stories.d.ts +6 -0
- package/dist/components/form/Slider/index.d.ts +1 -0
- package/dist/components/form/Slider/slider.css.cjs +12 -11
- package/dist/components/form/Slider/slider.css.d.ts +5 -0
- package/dist/components/form/Slider/{slider.css.mjs → slider.css.js} +6 -6
- package/dist/components/form/Slider/usePointerProgress.cjs +3 -0
- package/dist/components/form/Slider/usePointerProgress.d.ts +11 -0
- package/dist/components/form/Slider/{usePointerProgress.mjs → usePointerProgress.js} +2 -0
- package/dist/components/form/Switch/Switch.cjs +9 -7
- package/dist/components/form/Switch/Switch.d.ts +6 -0
- package/dist/components/form/Switch/{Switch.mjs → Switch.js} +4 -5
- package/dist/components/form/Switch/Switch.stories.d.ts +5 -0
- package/dist/components/form/Switch/index.d.ts +1 -0
- package/dist/components/form/Switch/switch.css.cjs +6 -5
- package/dist/components/form/Switch/switch.css.d.ts +2 -0
- package/dist/components/form/Switch/{switch.css.mjs → switch.css.js} +3 -3
- package/dist/components/layout/Box/Box.cjs +8 -7
- package/dist/components/layout/Box/Box.d.ts +11 -0
- package/dist/components/layout/Box/{Box.mjs → Box.js} +4 -4
- package/dist/components/layout/Box/Box.spec.d.ts +1 -0
- package/dist/components/layout/Box/Box.stories.d.ts +6 -0
- package/dist/components/layout/Box/index.d.ts +1 -0
- package/dist/components/layout/Inline/Inline.cjs +6 -5
- package/dist/components/layout/Inline/Inline.d.ts +13 -0
- package/dist/components/layout/Inline/{Inline.mjs → Inline.js} +2 -2
- package/dist/components/layout/Inline/Inline.stories.d.ts +6 -0
- package/dist/components/layout/Inline/index.d.ts +1 -0
- package/dist/components/layout/Stack/Stack.cjs +5 -4
- package/dist/components/layout/Stack/Stack.d.ts +17 -0
- package/dist/components/layout/Stack/{Stack.mjs → Stack.js} +2 -2
- package/dist/components/layout/Stack/Stack.stories.d.ts +6 -0
- package/dist/components/layout/Stack/index.d.ts +1 -0
- package/dist/components/navigation/Link/Link.cjs +7 -6
- package/dist/components/navigation/Link/Link.d.ts +11 -0
- package/dist/components/navigation/Link/{Link.mjs → Link.js} +3 -3
- package/dist/components/navigation/Link/Link.stories.d.ts +6 -0
- package/dist/components/navigation/Link/index.d.ts +1 -0
- package/dist/components/other/BlocksProvider/BlocksProvider.cjs +12 -10
- package/dist/components/other/BlocksProvider/BlocksProvider.d.ts +8 -0
- package/dist/components/other/BlocksProvider/{BlocksProvider.mjs → BlocksProvider.js} +5 -6
- package/dist/components/other/BlocksProvider/context.cjs +2 -0
- package/dist/components/other/BlocksProvider/context.d.ts +4 -0
- package/dist/components/other/BlocksProvider/{context.mjs → context.js} +1 -2
- package/dist/components/other/BlocksProvider/index.d.ts +2 -0
- package/dist/components/other/Portal/Portal.cjs +1 -0
- package/dist/components/other/Portal/Portal.d.ts +5 -0
- package/dist/components/other/Portal/index.d.ts +1 -0
- package/dist/components/overlay/Dialog/Dialog.cjs +22 -20
- package/dist/components/overlay/Dialog/Dialog.d.ts +10 -0
- package/dist/components/overlay/Dialog/{Dialog.mjs → Dialog.js} +11 -12
- package/dist/components/overlay/Dialog/Dialog.stories.d.ts +7 -0
- package/dist/components/overlay/Dialog/dialog.css.cjs +4 -3
- package/dist/components/overlay/Dialog/dialog.css.d.ts +1 -0
- package/dist/components/overlay/Dialog/{dialog.css.mjs → dialog.css.js} +2 -2
- package/dist/components/overlay/Dialog/dialogHelper.cjs +2 -0
- package/dist/components/overlay/Dialog/dialogHelper.d.ts +6 -0
- package/dist/components/overlay/Dialog/{dialogHelper.mjs → dialogHelper.js} +1 -0
- package/dist/components/overlay/Dialog/index.d.ts +1 -0
- package/dist/components/overlay/Popover/Popover.cjs +25 -23
- package/dist/components/overlay/Popover/Popover.d.ts +12 -0
- package/dist/components/overlay/Popover/{Popover.mjs → Popover.js} +12 -11
- package/dist/components/overlay/Popover/Popover.stories.d.ts +5 -0
- package/dist/components/overlay/Popover/popover-utils.cjs +1 -0
- package/dist/components/overlay/Popover/popover-utils.d.ts +2 -0
- package/dist/components/overlay/Tooltip/Tooltip.cjs +8 -6
- package/dist/components/overlay/Tooltip/Tooltip.d.ts +11 -0
- package/dist/components/overlay/Tooltip/{Tooltip.mjs → Tooltip.js} +4 -5
- package/dist/components/overlay/Tooltip/Tooltip.stories.d.ts +5 -0
- package/dist/components/overlay/Tooltip/index.d.ts +1 -0
- package/dist/components/typography/Heading/Heading.cjs +6 -5
- package/dist/components/typography/Heading/Heading.d.ts +8 -0
- package/dist/components/typography/Heading/{Heading.mjs → Heading.js} +3 -3
- package/dist/components/typography/Heading/heading.css.cjs +4 -3
- package/dist/components/typography/Heading/heading.css.d.ts +1 -0
- package/dist/components/typography/Heading/{heading.css.mjs → heading.css.js} +2 -2
- package/dist/components/typography/Heading/heading.stories.d.ts +12 -0
- package/dist/components/typography/Heading/index.d.ts +1 -0
- package/dist/components/typography/Text/Text.cjs +5 -4
- package/dist/components/typography/Text/Text.d.ts +12 -0
- package/dist/components/typography/Text/{Text.mjs → Text.js} +3 -3
- package/dist/components/typography/Text/Text.stories.d.ts +5 -0
- package/dist/components/typography/Text/index.d.ts +1 -0
- package/dist/components/typography/Text/text.css.cjs +4 -3
- package/dist/components/typography/Text/text.css.d.ts +1 -0
- package/dist/components/typography/Text/{text.css.mjs → text.css.js} +2 -2
- package/dist/entries/reset.d.ts +0 -0
- package/dist/entries/themes/momotaro.d.ts +1 -0
- package/dist/hooks/useClickOutside/useClickOutside.cjs +2 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +6 -0
- package/dist/hooks/useClickOutside/{useClickOutside.mjs → useClickOutside.js} +1 -0
- package/dist/hooks/useControlledValue/useControlledValue.cjs +2 -0
- package/dist/hooks/useControlledValue/useControlledValue.d.ts +8 -0
- package/dist/hooks/useControlledValue/{useControlledValue.mjs → useControlledValue.js} +1 -0
- package/dist/hooks/useFocusLock/index.d.ts +1 -0
- package/dist/hooks/useFocusLock/useFocusLock.d.ts +6 -0
- package/dist/hooks/useIsomorphicLayoutEffect/index.d.ts +1 -0
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +2 -0
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +5 -0
- package/dist/hooks/useIsomorphicLayoutEffect/{useIsomorphicLayoutEffect.mjs → useIsomorphicLayoutEffect.js} +1 -2
- package/dist/hooks/useKeyboard/index.d.ts +1 -0
- package/dist/hooks/useKeyboard/useKeyboard.cjs +2 -0
- package/dist/hooks/useKeyboard/useKeyboard.d.ts +6 -0
- package/dist/hooks/useKeyboard/{useKeyboard.mjs → useKeyboard.js} +1 -2
- package/dist/hooks/useLayer/index.d.ts +1 -0
- package/dist/hooks/useLayer/useLayer.cjs +2 -0
- package/dist/hooks/useLayer/useLayer.d.ts +1 -0
- package/dist/hooks/useLayer/{useLayer.mjs → useLayer.js} +1 -0
- package/dist/hooks/usePreventBodyScroll/index.d.ts +1 -0
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.cjs +3 -2
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.d.ts +1 -0
- package/dist/hooks/usePreventBodyScroll/{usePreventBodyScroll.mjs → usePreventBodyScroll.js} +1 -1
- package/dist/hooks/useRestoreFocus/index.d.ts +1 -0
- package/dist/hooks/useRestoreFocus/useRestoreFocus.cjs +2 -0
- package/dist/hooks/useRestoreFocus/useRestoreFocus.d.ts +4 -0
- package/dist/hooks/useRestoreFocus/{useRestoreFocus.mjs → useRestoreFocus.js} +1 -0
- package/dist/hooks/useRootAriaHidden/index.d.ts +1 -0
- package/dist/hooks/useRootAriaHidden/useRootAriaHidden.cjs +5 -4
- package/dist/hooks/useRootAriaHidden/useRootAriaHidden.d.ts +7 -0
- package/dist/hooks/useRootAriaHidden/{useRootAriaHidden.mjs → useRootAriaHidden.js} +1 -1
- package/dist/hooks/useVisibilityState/index.d.ts +1 -0
- package/dist/hooks/useVisibilityState/useVisibilityState.cjs +2 -0
- package/dist/hooks/useVisibilityState/useVisibilityState.d.ts +3 -0
- package/dist/hooks/useVisibilityState/{useVisibilityState.mjs → useVisibilityState.js} +1 -0
- package/dist/index.cjs +71 -71
- package/dist/index.d.ts +36 -1
- package/dist/index.js +73 -0
- package/dist/lib/asChildRenderer/createAsChildTemplate.cjs +4 -3
- package/dist/lib/asChildRenderer/createAsChildTemplate.d.ts +34 -0
- package/dist/lib/asChildRenderer/{createAsChildTemplate.mjs → createAsChildTemplate.js} +1 -1
- package/dist/lib/asChildRenderer/createAsChildTemplate.spec.d.ts +1 -0
- package/dist/lib/css/atoms/atomTypes.d.ts +37 -0
- package/dist/lib/css/atoms/atomicProperties.cjs +22 -21
- package/dist/lib/css/atoms/atomicProperties.d.ts +286 -0
- package/dist/lib/css/atoms/{atomicProperties.mjs → atomicProperties.js} +1 -1
- package/dist/lib/css/atoms/atoms.d.ts +1 -0
- package/dist/lib/css/atoms/breakpoints.cjs +2 -0
- package/dist/lib/css/atoms/breakpoints.d.ts +9 -0
- package/dist/lib/css/atoms/{breakpoints.mjs → breakpoints.js} +1 -0
- package/dist/lib/css/atoms/index.d.ts +2 -0
- package/dist/lib/css/atoms/sprinkles.css.cjs +25 -11
- package/dist/lib/css/atoms/sprinkles.css.d.ts +233 -0
- package/dist/lib/css/atoms/{sprinkles.css.mjs → sprinkles.css.js} +18 -5
- package/dist/lib/css/flexbox/flexbox.cjs +1 -0
- package/dist/lib/css/flexbox/flexbox.d.ts +15 -0
- package/dist/lib/css/layers/layers.css.cjs +1 -0
- package/dist/lib/css/layers/layers.css.d.ts +1 -0
- package/dist/lib/css/reset/reset.css.d.ts +1 -0
- package/dist/lib/css/style/style.cjs +4 -3
- package/dist/lib/css/style/style.d.ts +12 -0
- package/dist/lib/css/style/{style.mjs → style.js} +1 -1
- package/dist/lib/css/utils/cssUtils.cjs +1 -0
- package/dist/lib/css/utils/cssUtils.d.ts +1 -0
- package/dist/lib/react/mergeProps.cjs +5 -4
- package/dist/lib/react/mergeProps.d.ts +4 -0
- package/dist/lib/react/{mergeProps.mjs → mergeProps.js} +2 -2
- package/dist/lib/react/refs.cjs +1 -0
- package/dist/lib/react/refs.d.ts +3 -0
- package/dist/lib/theme/componentThemes.d.ts +134 -0
- package/dist/lib/theme/makeComponentTheme.cjs +1 -0
- package/dist/lib/theme/makeComponentTheme.d.ts +49 -0
- package/dist/lib/theme/makeTheme.cjs +4 -3
- package/dist/lib/theme/makeTheme.d.ts +14 -0
- package/dist/lib/theme/{makeTheme.mjs → makeTheme.js} +2 -2
- package/dist/lib/theme/makeVanillaTheme.cjs +1 -0
- package/dist/lib/theme/makeVanillaTheme.d.ts +16 -0
- package/dist/lib/theme/store/theme.cjs +1 -0
- package/dist/lib/theme/store/theme.d.ts +13 -0
- package/dist/lib/theme/tokens.cjs +1 -0
- package/dist/lib/theme/tokens.d.ts +2 -0
- package/dist/lib/theme/tokensType.d.ts +33 -0
- package/dist/lib/theme/vars.css.cjs +4 -3
- package/dist/lib/theme/vars.css.d.ts +75 -0
- package/dist/lib/theme/{vars.css.mjs → vars.css.js} +2 -2
- package/dist/lib/utils/atom-props.cjs +3 -2
- package/dist/lib/utils/atom-props.d.ts +4 -0
- package/dist/lib/utils/{atom-props.mjs → atom-props.js} +1 -1
- package/dist/lib/utils/classnames.cjs +1 -0
- package/dist/lib/utils/classnames.d.ts +3 -0
- package/dist/lib/utils/dom-focus.d.ts +2 -0
- package/dist/lib/utils/dom.cjs +1 -0
- package/dist/lib/utils/dom.d.ts +4 -0
- package/dist/lib/utils/helpers.d.ts +9 -0
- package/dist/lib/utils/math.cjs +1 -0
- package/dist/lib/utils/math.d.ts +2 -0
- package/dist/lib/utils/utils.d.ts +3 -0
- package/dist/reset.js +2 -0
- package/dist/themes/momotaro/components/button.css.cjs +60 -53
- package/dist/themes/momotaro/components/button.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{button.css.mjs → button.css.js} +45 -39
- package/dist/themes/momotaro/components/checkbox.css.cjs +35 -30
- package/dist/themes/momotaro/components/checkbox.css.d.ts +1 -0
- package/dist/themes/momotaro/components/checkbox.css.js +64 -0
- package/dist/themes/momotaro/components/dialog.css.cjs +52 -48
- package/dist/themes/momotaro/components/dialog.css.d.ts +1 -0
- package/dist/themes/momotaro/components/dialog.css.js +82 -0
- package/dist/themes/momotaro/components/divider.css.cjs +4 -3
- package/dist/themes/momotaro/components/divider.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{divider.css.mjs → divider.css.js} +2 -2
- package/dist/themes/momotaro/components/helpers.css.cjs +13 -9
- package/dist/themes/momotaro/components/helpers.css.d.ts +8 -0
- package/dist/themes/momotaro/components/{helpers.css.mjs → helpers.css.js} +10 -7
- package/dist/themes/momotaro/components/index.cjs +31 -30
- package/dist/themes/momotaro/components/index.d.ts +2 -0
- package/dist/themes/momotaro/components/index.js +35 -0
- package/dist/themes/momotaro/components/input.css.cjs +39 -32
- package/dist/themes/momotaro/components/input.css.d.ts +1 -0
- package/dist/themes/momotaro/components/input.css.js +48 -0
- package/dist/themes/momotaro/components/label.css.cjs +13 -12
- package/dist/themes/momotaro/components/label.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{label.css.mjs → label.css.js} +7 -7
- package/dist/themes/momotaro/components/link.css.cjs +31 -27
- package/dist/themes/momotaro/components/link.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{link.css.mjs → link.css.js} +27 -24
- package/dist/themes/momotaro/components/popover.css.cjs +5 -4
- package/dist/themes/momotaro/components/popover.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{popover.css.mjs → popover.css.js} +2 -2
- package/dist/themes/momotaro/components/progress.css.cjs +22 -18
- package/dist/themes/momotaro/components/progress.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{progress.css.mjs → progress.css.js} +18 -15
- package/dist/themes/momotaro/components/radio.css.cjs +35 -30
- package/dist/themes/momotaro/components/radio.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{radio.css.mjs → radio.css.js} +31 -27
- package/dist/themes/momotaro/components/select.css.cjs +29 -25
- package/dist/themes/momotaro/components/select.css.d.ts +1 -0
- package/dist/themes/momotaro/components/select.css.js +48 -0
- package/dist/themes/momotaro/components/slider.css.cjs +48 -44
- package/dist/themes/momotaro/components/slider.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{slider.css.mjs → slider.css.js} +31 -28
- package/dist/themes/momotaro/components/spinner.css.cjs +8 -7
- package/dist/themes/momotaro/components/spinner.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{spinner.css.mjs → spinner.css.js} +6 -6
- package/dist/themes/momotaro/components/switch.css.cjs +34 -30
- package/dist/themes/momotaro/components/switch.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{switch.css.mjs → switch.css.js} +31 -28
- package/dist/themes/momotaro/components/tooltip.css.cjs +7 -6
- package/dist/themes/momotaro/components/tooltip.css.d.ts +1 -0
- package/dist/themes/momotaro/components/{tooltip.css.mjs → tooltip.css.js} +2 -2
- package/dist/themes/momotaro/components/transitions.cjs +1 -0
- package/dist/themes/momotaro/components/transitions.d.ts +1 -0
- package/dist/themes/momotaro/index.d.ts +1 -0
- package/dist/themes/momotaro/momotaro.css.cjs +7 -6
- package/dist/themes/momotaro/momotaro.css.d.ts +1 -0
- package/dist/themes/momotaro/{momotaro.css.mjs → momotaro.css.js} +3 -3
- package/dist/themes/momotaro/tokens.css.cjs +12 -11
- package/dist/themes/momotaro/tokens.css.d.ts +2 -0
- package/dist/themes/momotaro/{tokens.css.mjs → tokens.css.js} +1 -1
- package/dist/themes/momotaro.cjs +2 -2
- package/dist/themes/momotaro.js +4 -0
- package/package.json +15 -16
- package/dist/components/accessibility/VisuallyHidden/index.cjs +0 -1
- package/dist/components/accessibility/VisuallyHidden/index.mjs +0 -1
- package/dist/components/display/Divider/index.cjs +0 -1
- package/dist/components/display/Divider/index.mjs +0 -1
- package/dist/components/feedback/Progress/index.cjs +0 -1
- package/dist/components/feedback/Progress/index.mjs +0 -1
- package/dist/components/feedback/Spinner/index.cjs +0 -1
- package/dist/components/feedback/Spinner/index.mjs +0 -1
- package/dist/components/form/Button/index.cjs +0 -1
- package/dist/components/form/Button/index.mjs +0 -1
- package/dist/components/form/Checkbox/index.cjs +0 -1
- package/dist/components/form/Checkbox/index.mjs +0 -1
- package/dist/components/form/Input/index.cjs +0 -1
- package/dist/components/form/Input/index.mjs +0 -1
- package/dist/components/form/Label/index.cjs +0 -1
- package/dist/components/form/Label/index.mjs +0 -1
- package/dist/components/form/Radio/RadioGroup.cjs +0 -1
- package/dist/components/form/Radio/RadioGroup.mjs +0 -1
- package/dist/components/form/Radio/index.cjs +0 -1
- package/dist/components/form/Radio/index.mjs +0 -1
- package/dist/components/form/Select/index.cjs +0 -1
- package/dist/components/form/Select/index.mjs +0 -1
- package/dist/components/form/Slider/index.cjs +0 -1
- package/dist/components/form/Slider/index.mjs +0 -1
- package/dist/components/form/Switch/index.cjs +0 -1
- package/dist/components/form/Switch/index.mjs +0 -1
- package/dist/components/layout/Box/index.cjs +0 -1
- package/dist/components/layout/Box/index.mjs +0 -1
- package/dist/components/layout/Inline/index.cjs +0 -1
- package/dist/components/layout/Inline/index.mjs +0 -1
- package/dist/components/layout/Stack/index.cjs +0 -1
- package/dist/components/layout/Stack/index.mjs +0 -1
- package/dist/components/navigation/Link/index.cjs +0 -1
- package/dist/components/navigation/Link/index.mjs +0 -1
- package/dist/components/other/BlocksProvider/index.cjs +0 -1
- package/dist/components/other/BlocksProvider/index.mjs +0 -1
- package/dist/components/other/Portal/index.cjs +0 -1
- package/dist/components/other/Portal/index.mjs +0 -1
- package/dist/components/overlay/Dialog/index.cjs +0 -1
- package/dist/components/overlay/Dialog/index.mjs +0 -1
- package/dist/components/overlay/Tooltip/index.cjs +0 -1
- package/dist/components/overlay/Tooltip/index.mjs +0 -1
- package/dist/components/typography/Heading/index.cjs +0 -1
- package/dist/components/typography/Heading/index.mjs +0 -1
- package/dist/components/typography/Text/index.cjs +0 -1
- package/dist/components/typography/Text/index.mjs +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/index.cjs +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/index.mjs +0 -1
- package/dist/hooks/useKeyboard/index.cjs +0 -1
- package/dist/hooks/useKeyboard/index.mjs +0 -1
- package/dist/hooks/useLayer/index.cjs +0 -1
- package/dist/hooks/useLayer/index.mjs +0 -1
- package/dist/hooks/usePreventBodyScroll/index.cjs +0 -1
- package/dist/hooks/usePreventBodyScroll/index.mjs +0 -1
- package/dist/hooks/useRestoreFocus/index.cjs +0 -1
- package/dist/hooks/useRestoreFocus/index.mjs +0 -1
- package/dist/hooks/useRootAriaHidden/index.cjs +0 -1
- package/dist/hooks/useRootAriaHidden/index.mjs +0 -1
- package/dist/hooks/useVisibilityState/index.cjs +0 -1
- package/dist/hooks/useVisibilityState/index.mjs +0 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +0 -73
- package/dist/lib/css/atoms/atoms.cjs +0 -2
- package/dist/lib/css/atoms/atoms.mjs +0 -1
- package/dist/lib/css/atoms/index.cjs +0 -2
- package/dist/lib/css/atoms/index.mjs +0 -1
- package/dist/momotaro.chunk.d.ts +0 -906
- package/dist/reset.d.mts +0 -2
- package/dist/reset.d.ts +0 -2
- package/dist/reset.mjs +0 -2
- package/dist/themes/momotaro/components/checkbox.css.mjs +0 -60
- package/dist/themes/momotaro/components/dialog.css.mjs +0 -79
- package/dist/themes/momotaro/components/index.mjs +0 -35
- package/dist/themes/momotaro/components/input.css.mjs +0 -42
- package/dist/themes/momotaro/components/select.css.mjs +0 -45
- package/dist/themes/momotaro/index.cjs +0 -2
- package/dist/themes/momotaro/index.mjs +0 -1
- package/dist/themes/momotaro.d.mts +0 -1
- package/dist/themes/momotaro.d.ts +0 -1
- package/dist/themes/momotaro.mjs +0 -4
- package/reset/index.d.ts +0 -1
- package/reset/package.json +0 -5
- /package/dist/components/other/Portal/{Portal.mjs → Portal.js} +0 -0
- /package/dist/components/overlay/Popover/{popover-utils.mjs → popover-utils.js} +0 -0
- /package/dist/lib/css/flexbox/{flexbox.mjs → flexbox.js} +0 -0
- /package/dist/lib/css/layers/{layers.css.mjs → layers.css.js} +0 -0
- /package/dist/lib/css/reset/{reset.css.mjs → reset.css.js} +0 -0
- /package/dist/lib/css/utils/{cssUtils.mjs → cssUtils.js} +0 -0
- /package/dist/lib/react/{refs.mjs → refs.js} +0 -0
- /package/dist/lib/theme/{makeComponentTheme.mjs → makeComponentTheme.js} +0 -0
- /package/dist/lib/theme/{makeVanillaTheme.mjs → makeVanillaTheme.js} +0 -0
- /package/dist/lib/theme/store/{theme.mjs → theme.js} +0 -0
- /package/dist/lib/theme/{tokens.mjs → tokens.js} +0 -0
- /package/dist/lib/utils/{classnames.mjs → classnames.js} +0 -0
- /package/dist/lib/utils/{dom.mjs → dom.js} +0 -0
- /package/dist/lib/utils/{math.mjs → math.js} +0 -0
- /package/dist/themes/momotaro/components/{transitions.mjs → transitions.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { alignItemsMap } from "../../../lib/css/flexbox/flexbox.
|
|
3
|
-
import { Box } from "../Box/Box.
|
|
2
|
+
import { alignItemsMap } from "../../../lib/css/flexbox/flexbox.js";
|
|
3
|
+
import { Box } from "../Box/Box.js";
|
|
4
4
|
const Stack = ({
|
|
5
5
|
tag: Tag = "div",
|
|
6
6
|
display = "flex",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Stack, StackProps } from './Stack';
|
|
3
|
+
declare const _default: Meta<typeof Stack>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: StoryObj<StackProps>;
|
|
6
|
+
export declare const List: StoryObj<StackProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stack, type StackProps } from './Stack';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const { Template, Slot } =
|
|
4
|
+
const createAsChildTemplate = require("../../../lib/asChildRenderer/createAsChildTemplate.cjs");
|
|
5
|
+
const theme = require("../../../lib/theme/store/theme.cjs");
|
|
6
|
+
const classnames = require("../../../lib/utils/classnames.cjs");
|
|
7
|
+
const { Template, Slot } = createAsChildTemplate.createAsChildTemplate("a");
|
|
7
8
|
const Link = ({
|
|
8
9
|
asChild,
|
|
9
10
|
children,
|
|
@@ -13,7 +14,7 @@ const Link = ({
|
|
|
13
14
|
variant,
|
|
14
15
|
...restProps
|
|
15
16
|
}) => {
|
|
16
|
-
const linkClassName =
|
|
17
|
+
const linkClassName = theme.getComponentStyles("link", {
|
|
17
18
|
base: true,
|
|
18
19
|
variants: { variant, underline }
|
|
19
20
|
});
|
|
@@ -22,7 +23,7 @@ const Link = ({
|
|
|
22
23
|
{
|
|
23
24
|
asChild,
|
|
24
25
|
ref,
|
|
25
|
-
className:
|
|
26
|
+
className: classnames.classnames(className, linkClassName),
|
|
26
27
|
...restProps,
|
|
27
28
|
children: /* @__PURE__ */ jsxRuntime.jsx(Slot, { children })
|
|
28
29
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MarginAtoms } from '../../../lib/css/atoms';
|
|
2
|
+
import { LinkTheme } from '../../../lib/theme/componentThemes';
|
|
3
|
+
import { HTMLElementProps } from '../../../lib/utils/utils';
|
|
4
|
+
export type LinkProps = {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
8
|
+
underline?: LinkTheme['variants']['underline'];
|
|
9
|
+
variant?: LinkTheme['variants']['variant'];
|
|
10
|
+
} & MarginAtoms & HTMLElementProps<HTMLAnchorElement>;
|
|
11
|
+
export declare const Link: React.FC<LinkProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createAsChildTemplate } from "../../../lib/asChildRenderer/createAsChildTemplate.
|
|
3
|
-
import { getComponentStyles } from "../../../lib/theme/store/theme.
|
|
4
|
-
import { classnames } from "../../../lib/utils/classnames.
|
|
2
|
+
import { createAsChildTemplate } from "../../../lib/asChildRenderer/createAsChildTemplate.js";
|
|
3
|
+
import { getComponentStyles } from "../../../lib/theme/store/theme.js";
|
|
4
|
+
import { classnames } from "../../../lib/utils/classnames.js";
|
|
5
5
|
const { Template, Slot } = createAsChildTemplate("a");
|
|
6
6
|
const Link = ({
|
|
7
7
|
asChild,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link, type LinkProps } from './Link';
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
5
|
const react = require("react");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const sprinkles_css = require("../../../lib/css/atoms/sprinkles.css.cjs");
|
|
7
|
+
const theme = require("../../../lib/theme/store/theme.cjs");
|
|
8
|
+
const classnames = require("../../../lib/utils/classnames.cjs");
|
|
9
|
+
const context = require("./context.cjs");
|
|
8
10
|
const BlocksProvider = ({
|
|
9
11
|
children,
|
|
10
|
-
theme,
|
|
12
|
+
theme: theme$1,
|
|
11
13
|
className,
|
|
12
14
|
...restProps
|
|
13
15
|
}) => {
|
|
@@ -18,13 +20,13 @@ const BlocksProvider = ({
|
|
|
18
20
|
}),
|
|
19
21
|
[]
|
|
20
22
|
);
|
|
21
|
-
|
|
22
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
theme.setTheme(theme$1);
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(context.BlocksProviderContext, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
25
|
"div",
|
|
24
26
|
{
|
|
25
|
-
className:
|
|
26
|
-
theme.vars,
|
|
27
|
-
|
|
27
|
+
className: classnames.classnames(
|
|
28
|
+
theme$1.vars,
|
|
29
|
+
sprinkles_css.atoms({ fontFamily: "primary" }),
|
|
28
30
|
className
|
|
29
31
|
),
|
|
30
32
|
inert: ariaHidden ? true : void 0,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useState, useMemo } from "react";
|
|
5
|
-
import { atoms } from "../../../lib/css/atoms/sprinkles.css.
|
|
6
|
-
import { setTheme } from "../../../lib/theme/store/theme.
|
|
7
|
-
import { classnames } from "../../../lib/utils/classnames.
|
|
8
|
-
import { BlocksProviderContext } from "./context.
|
|
4
|
+
import { atoms } from "../../../lib/css/atoms/sprinkles.css.js";
|
|
5
|
+
import { setTheme } from "../../../lib/theme/store/theme.js";
|
|
6
|
+
import { classnames } from "../../../lib/utils/classnames.js";
|
|
7
|
+
import { BlocksProviderContext } from "./context.js";
|
|
9
8
|
const BlocksProvider = ({
|
|
10
9
|
children,
|
|
11
10
|
theme,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Portal, type PortalProps } from './Portal';
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
5
|
const react = require("react");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
6
|
+
const useClickOutside = require("../../../hooks/useClickOutside/useClickOutside.cjs");
|
|
7
|
+
const theme = require("../../../lib/theme/store/theme.cjs");
|
|
8
|
+
const classnames = require("../../../lib/utils/classnames.cjs");
|
|
9
|
+
const dom = require("../../../lib/utils/dom.cjs");
|
|
10
|
+
const dialog_css = require("./dialog.css.cjs");
|
|
11
|
+
const dialogHelper = require("./dialogHelper.cjs");
|
|
12
|
+
const useRestoreFocus = require("../../../hooks/useRestoreFocus/useRestoreFocus.cjs");
|
|
13
|
+
const usePreventBodyScroll = require("../../../hooks/usePreventBodyScroll/usePreventBodyScroll.cjs");
|
|
14
|
+
const useKeyboard = require("../../../hooks/useKeyboard/useKeyboard.cjs");
|
|
15
|
+
const useIsomorphicLayoutEffect = require("../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs");
|
|
14
16
|
const Dialog = ({
|
|
15
17
|
children,
|
|
16
18
|
open,
|
|
@@ -19,16 +21,16 @@ const Dialog = ({
|
|
|
19
21
|
size,
|
|
20
22
|
...restProps
|
|
21
23
|
}) => {
|
|
22
|
-
const dialogClassName =
|
|
24
|
+
const dialogClassName = theme.getComponentStyles("dialog", {
|
|
23
25
|
dialog: true,
|
|
24
26
|
variants: { size }
|
|
25
27
|
});
|
|
26
28
|
const dialogRef = react.useRef(null);
|
|
27
29
|
const [enabled, setEnabled] = react.useState(true);
|
|
28
30
|
const [visible, setVisible] = react.useState(open);
|
|
29
|
-
|
|
30
|
-
const isNested =
|
|
31
|
-
|
|
31
|
+
useRestoreFocus.useRestoreFocus(open);
|
|
32
|
+
const isNested = dialogHelper.useNestedDialog(open);
|
|
33
|
+
usePreventBodyScroll.usePreventBodyScroll(open && !isNested);
|
|
32
34
|
const onEscape = react.useCallback(
|
|
33
35
|
(event) => {
|
|
34
36
|
event.preventDefault();
|
|
@@ -36,16 +38,16 @@ const Dialog = ({
|
|
|
36
38
|
},
|
|
37
39
|
[onRequestClose]
|
|
38
40
|
);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
useKeyboard.useKeyboard("Escape", onEscape, { enabled: open && enabled });
|
|
42
|
+
useClickOutside.useClickOutside(dialogRef, onRequestClose, { enabled: open && enabled });
|
|
43
|
+
useIsomorphicLayoutEffect.useIsomorphicLayoutEffect(() => {
|
|
42
44
|
var _a, _b;
|
|
43
45
|
if (open && visible) {
|
|
44
46
|
(_a = dialogRef.current) == null ? void 0 : _a.showModal();
|
|
45
47
|
} else if (open) {
|
|
46
48
|
setVisible(true);
|
|
47
49
|
} else {
|
|
48
|
-
if (!
|
|
50
|
+
if (!dom.hasAnimationDuration(dialogRef.current)) {
|
|
49
51
|
setVisible(false);
|
|
50
52
|
}
|
|
51
53
|
(_b = dialogRef.current) == null ? void 0 : _b.close();
|
|
@@ -60,13 +62,13 @@ const Dialog = ({
|
|
|
60
62
|
return null;
|
|
61
63
|
}
|
|
62
64
|
const dataOpen = typeof window === "undefined" && open ? true : void 0;
|
|
63
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(dialogHelper.DialogContext.Provider, { value: { setEnabled }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
66
|
"dialog",
|
|
65
67
|
{
|
|
66
68
|
ref: dialogRef,
|
|
67
69
|
"aria-modal": "true",
|
|
68
70
|
open: dataOpen,
|
|
69
|
-
className:
|
|
71
|
+
className: classnames.classnames(dialog_css.dialog, dialogClassName, className),
|
|
70
72
|
onAnimationEnd,
|
|
71
73
|
onTransitionEnd: onAnimationEnd,
|
|
72
74
|
...restProps,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DialogTheme } from '../../../lib/theme/componentThemes';
|
|
2
|
+
export type DialogProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
open: boolean;
|
|
5
|
+
onRequestClose: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
size?: DialogTheme['variants']['size'];
|
|
8
|
+
'aria-label'?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const Dialog: React.FC<DialogProps>;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
4
3
|
import { useRef, useState, useCallback } from "react";
|
|
5
|
-
import { useClickOutside } from "../../../hooks/useClickOutside/useClickOutside.
|
|
6
|
-
import { getComponentStyles } from "../../../lib/theme/store/theme.
|
|
7
|
-
import { classnames } from "../../../lib/utils/classnames.
|
|
8
|
-
import { hasAnimationDuration } from "../../../lib/utils/dom.
|
|
9
|
-
import { dialog } from "./dialog.css.
|
|
10
|
-
import { useNestedDialog, DialogContext } from "./dialogHelper.
|
|
11
|
-
import { useRestoreFocus } from "../../../hooks/useRestoreFocus/useRestoreFocus.
|
|
12
|
-
import { usePreventBodyScroll } from "../../../hooks/usePreventBodyScroll/usePreventBodyScroll.
|
|
13
|
-
import { useKeyboard } from "../../../hooks/useKeyboard/useKeyboard.
|
|
14
|
-
import { useIsomorphicLayoutEffect } from "../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.
|
|
4
|
+
import { useClickOutside } from "../../../hooks/useClickOutside/useClickOutside.js";
|
|
5
|
+
import { getComponentStyles } from "../../../lib/theme/store/theme.js";
|
|
6
|
+
import { classnames } from "../../../lib/utils/classnames.js";
|
|
7
|
+
import { hasAnimationDuration } from "../../../lib/utils/dom.js";
|
|
8
|
+
import { dialog } from "./dialog.css.js";
|
|
9
|
+
import { useNestedDialog, DialogContext } from "./dialogHelper.js";
|
|
10
|
+
import { useRestoreFocus } from "../../../hooks/useRestoreFocus/useRestoreFocus.js";
|
|
11
|
+
import { usePreventBodyScroll } from "../../../hooks/usePreventBodyScroll/usePreventBodyScroll.js";
|
|
12
|
+
import { useKeyboard } from "../../../hooks/useKeyboard/useKeyboard.js";
|
|
13
|
+
import { useIsomorphicLayoutEffect } from "../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";
|
|
15
14
|
const Dialog = ({
|
|
16
15
|
children,
|
|
17
16
|
open,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DialogProps } from './Dialog';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: StoryObj<DialogProps>;
|
|
6
|
+
export declare const WithAriaMarkup: StoryObj<DialogProps>;
|
|
7
|
+
export declare const Play: StoryObj<DialogProps>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
3
|
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
4
|
const css = require("@vanilla-extract/css");
|
|
4
|
-
const
|
|
5
|
+
const layers_css = require("../../../lib/css/layers/layers.css.cjs");
|
|
5
6
|
fileScope.setFileScope("src/components/overlay/Dialog/dialog.css.ts", "@blockle/blocks");
|
|
6
7
|
const dialog = css.style({
|
|
7
8
|
"@layer": {
|
|
8
|
-
[
|
|
9
|
+
[layers_css.blocksLayer]: {
|
|
9
10
|
position: "fixed",
|
|
10
11
|
inset: 0,
|
|
11
12
|
border: "none",
|
|
@@ -16,6 +17,6 @@ const dialog = css.style({
|
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
}
|
|
20
|
+
});
|
|
20
21
|
fileScope.endFileScope();
|
|
21
22
|
exports.dialog = dialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dialog: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
2
|
import { style } from "@vanilla-extract/css";
|
|
3
|
-
import { blocksLayer } from "../../../lib/css/layers/layers.css.
|
|
3
|
+
import { blocksLayer } from "../../../lib/css/layers/layers.css.js";
|
|
4
4
|
setFileScope("src/components/overlay/Dialog/dialog.css.ts", "@blockle/blocks");
|
|
5
5
|
const dialog = style({
|
|
6
6
|
"@layer": {
|
|
@@ -15,7 +15,7 @@ const dialog = style({
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
}
|
|
18
|
+
});
|
|
19
19
|
endFileScope();
|
|
20
20
|
export {
|
|
21
21
|
dialog
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dialog, type DialogProps } from './Dialog';
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
5
|
const react = require("react");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
6
|
+
const useClickOutside = require("../../../hooks/useClickOutside/useClickOutside.cjs");
|
|
7
|
+
const theme = require("../../../lib/theme/store/theme.cjs");
|
|
8
|
+
const classnames = require("../../../lib/utils/classnames.cjs");
|
|
9
|
+
const dom = require("../../../lib/utils/dom.cjs");
|
|
10
|
+
const popoverUtils = require("./popover-utils.cjs");
|
|
11
|
+
const useLayer = require("../../../hooks/useLayer/useLayer.cjs");
|
|
12
|
+
const useVisibilityState = require("../../../hooks/useVisibilityState/useVisibilityState.cjs");
|
|
13
|
+
const useIsomorphicLayoutEffect = require("../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs");
|
|
14
|
+
const useKeyboard = require("../../../hooks/useKeyboard/useKeyboard.cjs");
|
|
15
|
+
const Portal = require("../../other/Portal/Portal.cjs");
|
|
16
|
+
const Box = require("../../layout/Box/Box.cjs");
|
|
15
17
|
const Popover = ({
|
|
16
18
|
align = "bottom",
|
|
17
19
|
anchorElement,
|
|
@@ -23,11 +25,11 @@ const Popover = ({
|
|
|
23
25
|
style,
|
|
24
26
|
...restProps
|
|
25
27
|
}) => {
|
|
26
|
-
const layer =
|
|
27
|
-
const [visible, hide] =
|
|
28
|
+
const layer = useLayer.useLayer();
|
|
29
|
+
const [visible, hide] = useVisibilityState.useVisibilityState(open);
|
|
28
30
|
const [position, setPosition] = react.useState({ x: 0, y: 0 });
|
|
29
31
|
const popoverRef = react.useRef(null);
|
|
30
|
-
const containerClassName =
|
|
32
|
+
const containerClassName = theme.getComponentStyles(
|
|
31
33
|
"popover",
|
|
32
34
|
{ base: true },
|
|
33
35
|
false
|
|
@@ -36,7 +38,7 @@ const Popover = ({
|
|
|
36
38
|
if (!visible) {
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
|
-
const position2 =
|
|
41
|
+
const position2 = popoverUtils.getPopoverPosition(align, anchorElement, popoverRef);
|
|
40
42
|
setPosition({ x: position2[0], y: position2[1] });
|
|
41
43
|
}, [align, anchorElement, visible]);
|
|
42
44
|
react.useEffect(() => {
|
|
@@ -44,7 +46,7 @@ const Popover = ({
|
|
|
44
46
|
return;
|
|
45
47
|
}
|
|
46
48
|
function handleResize() {
|
|
47
|
-
const position2 =
|
|
49
|
+
const position2 = popoverUtils.getPopoverPosition(align, anchorElement, popoverRef);
|
|
48
50
|
setPosition({ x: position2[0], y: position2[1] });
|
|
49
51
|
}
|
|
50
52
|
window.addEventListener("resize", handleResize);
|
|
@@ -54,7 +56,7 @@ const Popover = ({
|
|
|
54
56
|
window.removeEventListener("scroll", handleResize);
|
|
55
57
|
};
|
|
56
58
|
}, [align, anchorElement, open, repositionOnScroll]);
|
|
57
|
-
|
|
59
|
+
useIsomorphicLayoutEffect.useIsomorphicLayoutEffect(() => {
|
|
58
60
|
var _a;
|
|
59
61
|
if (!open) {
|
|
60
62
|
(_a = popoverRef.current) == null ? void 0 : _a.removeAttribute("data-open");
|
|
@@ -79,24 +81,24 @@ const Popover = ({
|
|
|
79
81
|
if (open) {
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
|
-
if (!
|
|
84
|
+
if (!dom.hasAnimationDuration(popoverRef.current)) {
|
|
83
85
|
hide();
|
|
84
86
|
}
|
|
85
87
|
}, [hide, open]);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
useKeyboard.useKeyboard("Escape", onRequestClose, { enabled: visible });
|
|
89
|
+
useClickOutside.useClickOutside(popoverRef, onRequestClose, { enabled: visible });
|
|
88
90
|
if (!visible) {
|
|
89
91
|
return null;
|
|
90
92
|
}
|
|
91
93
|
const dataOpen = typeof window === "undefined" && open ? "" : void 0;
|
|
92
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
93
|
-
|
|
94
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Portal.Portal, { container: layer(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
Box.Box,
|
|
94
96
|
{
|
|
95
97
|
ref: popoverRef,
|
|
96
98
|
"data-open": dataOpen,
|
|
97
99
|
onAnimationEnd,
|
|
98
100
|
onTransitionEnd: onAnimationEnd,
|
|
99
|
-
className:
|
|
101
|
+
className: classnames.classnames(containerClassName, className),
|
|
100
102
|
position: "absolute",
|
|
101
103
|
style: {
|
|
102
104
|
...style,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLElementProps } from '../../../lib/utils/utils';
|
|
2
|
+
export type PopoverProps = {
|
|
3
|
+
align?: 'top' | 'bottom' | 'left' | 'right';
|
|
4
|
+
anchorElement: React.RefObject<HTMLElement | null>;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
onRequestClose: () => void;
|
|
8
|
+
open: boolean;
|
|
9
|
+
repositionOnScroll?: boolean;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
} & HTMLElementProps<HTMLDivElement>;
|
|
12
|
+
export declare const Popover: React.FC<PopoverProps>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { useState, useRef, useLayoutEffect, useEffect, useCallback } from "react";
|
|
3
|
-
import { useClickOutside } from "../../../hooks/useClickOutside/useClickOutside.
|
|
4
|
-
import { getComponentStyles } from "../../../lib/theme/store/theme.
|
|
5
|
-
import { classnames } from "../../../lib/utils/classnames.
|
|
6
|
-
import { hasAnimationDuration } from "../../../lib/utils/dom.
|
|
7
|
-
import { getPopoverPosition } from "./popover-utils.
|
|
8
|
-
import { useLayer } from "../../../hooks/useLayer/useLayer.
|
|
9
|
-
import { useVisibilityState } from "../../../hooks/useVisibilityState/useVisibilityState.
|
|
10
|
-
import { useIsomorphicLayoutEffect } from "../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.
|
|
11
|
-
import { useKeyboard } from "../../../hooks/useKeyboard/useKeyboard.
|
|
12
|
-
import { Portal } from "../../other/Portal/Portal.
|
|
13
|
-
import { Box } from "../../layout/Box/Box.
|
|
4
|
+
import { useClickOutside } from "../../../hooks/useClickOutside/useClickOutside.js";
|
|
5
|
+
import { getComponentStyles } from "../../../lib/theme/store/theme.js";
|
|
6
|
+
import { classnames } from "../../../lib/utils/classnames.js";
|
|
7
|
+
import { hasAnimationDuration } from "../../../lib/utils/dom.js";
|
|
8
|
+
import { getPopoverPosition } from "./popover-utils.js";
|
|
9
|
+
import { useLayer } from "../../../hooks/useLayer/useLayer.js";
|
|
10
|
+
import { useVisibilityState } from "../../../hooks/useVisibilityState/useVisibilityState.js";
|
|
11
|
+
import { useIsomorphicLayoutEffect } from "../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";
|
|
12
|
+
import { useKeyboard } from "../../../hooks/useKeyboard/useKeyboard.js";
|
|
13
|
+
import { Portal } from "../../other/Portal/Portal.js";
|
|
14
|
+
import { Box } from "../../layout/Box/Box.js";
|
|
14
15
|
const Popover = ({
|
|
15
16
|
align = "bottom",
|
|
16
17
|
anchorElement,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
5
|
const react = require("react");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const refs = require("../../../lib/react/refs.cjs");
|
|
7
|
+
const theme = require("../../../lib/theme/store/theme.cjs");
|
|
8
|
+
const Popover = require("../Popover/Popover.cjs");
|
|
7
9
|
const Tooltip = ({
|
|
8
10
|
align = "top",
|
|
9
11
|
children,
|
|
@@ -13,7 +15,7 @@ const Tooltip = ({
|
|
|
13
15
|
const id = react.useId();
|
|
14
16
|
const ref = react.useRef(null);
|
|
15
17
|
const [open, setOpen] = react.useState(false);
|
|
16
|
-
const tooltipClassName =
|
|
18
|
+
const tooltipClassName = theme.getComponentStyles("tooltip", {
|
|
17
19
|
base: true,
|
|
18
20
|
variants: { colorScheme }
|
|
19
21
|
});
|
|
@@ -48,11 +50,11 @@ const Tooltip = ({
|
|
|
48
50
|
}
|
|
49
51
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
50
52
|
react.cloneElement(child, {
|
|
51
|
-
ref:
|
|
53
|
+
ref: refs.composeRefs(ref, child.ref),
|
|
52
54
|
["aria-describedby"]: open ? id : void 0
|
|
53
55
|
}),
|
|
54
56
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
-
|
|
57
|
+
Popover.Popover,
|
|
56
58
|
{
|
|
57
59
|
id,
|
|
58
60
|
role: "tooltip",
|