@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,12 +1,14 @@
|
|
|
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
|
|
6
|
+
const useControlledValue = require("../../../hooks/useControlledValue/useControlledValue.cjs");
|
|
7
|
+
const theme = require("../../../lib/theme/store/theme.cjs");
|
|
8
|
+
const classnames = require("../../../lib/utils/classnames.cjs");
|
|
9
|
+
const math = require("../../../lib/utils/math.cjs");
|
|
10
|
+
const slider_css = require("./slider.css.cjs");
|
|
11
|
+
const usePointerProgress = require("./usePointerProgress.cjs");
|
|
10
12
|
const usableKeys = /* @__PURE__ */ new Set([
|
|
11
13
|
"ArrowLeft",
|
|
12
14
|
"ArrowRight",
|
|
@@ -34,25 +36,25 @@ const Slider = ({
|
|
|
34
36
|
precision = 2,
|
|
35
37
|
...restProps
|
|
36
38
|
}) => {
|
|
37
|
-
const baseClass =
|
|
39
|
+
const baseClass = theme.getComponentStyles("slider", {
|
|
38
40
|
base: true,
|
|
39
41
|
variants: { size, colorScheme, disabled }
|
|
40
42
|
});
|
|
41
|
-
const trackClass =
|
|
42
|
-
const filledTrackClass =
|
|
43
|
+
const trackClass = theme.getComponentStyles("slider", { track: true }, false);
|
|
44
|
+
const filledTrackClass = theme.getComponentStyles(
|
|
43
45
|
"slider",
|
|
44
46
|
{ filledTrack: true },
|
|
45
47
|
false
|
|
46
48
|
);
|
|
47
|
-
const thumbClass =
|
|
49
|
+
const thumbClass = theme.getComponentStyles("slider", { thumb: true }, false);
|
|
48
50
|
const containerRef = react.useRef(null);
|
|
49
|
-
const [currentValue, setValue] =
|
|
51
|
+
const [currentValue, setValue] = useControlledValue.useControlledValue({
|
|
50
52
|
defaultValue,
|
|
51
53
|
value,
|
|
52
54
|
onChange,
|
|
53
|
-
transformValue: (value2) =>
|
|
55
|
+
transformValue: (value2) => math.roundToPrecision(math.getBoundValue(value2, min, max, step), precision)
|
|
54
56
|
});
|
|
55
|
-
|
|
57
|
+
usePointerProgress.usePointerProgress({
|
|
56
58
|
container: containerRef,
|
|
57
59
|
orientation,
|
|
58
60
|
onChange(progress) {
|
|
@@ -91,16 +93,16 @@ const Slider = ({
|
|
|
91
93
|
"div",
|
|
92
94
|
{
|
|
93
95
|
ref: containerRef,
|
|
94
|
-
className:
|
|
95
|
-
|
|
96
|
-
orientation === "vertical" ?
|
|
96
|
+
className: classnames.classnames(
|
|
97
|
+
slider_css.container,
|
|
98
|
+
orientation === "vertical" ? slider_css.containerVertical : "",
|
|
97
99
|
baseClass
|
|
98
100
|
),
|
|
99
101
|
children: [
|
|
100
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
102
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classnames.classnames(slider_css.track, trackClass), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
101
103
|
"div",
|
|
102
104
|
{
|
|
103
|
-
className:
|
|
105
|
+
className: classnames.classnames(slider_css.filledTrack, filledTrackClass),
|
|
104
106
|
style: {
|
|
105
107
|
inlineSize: `${currentValue / max * 100}%`
|
|
106
108
|
}
|
|
@@ -110,7 +112,7 @@ const Slider = ({
|
|
|
110
112
|
"button",
|
|
111
113
|
{
|
|
112
114
|
type: "button",
|
|
113
|
-
className:
|
|
115
|
+
className: classnames.classnames(slider_css.thumb, thumbClass),
|
|
114
116
|
role: "slider",
|
|
115
117
|
"aria-valuemin": min,
|
|
116
118
|
"aria-valuemax": max,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SliderTheme } from '../../../lib/theme/componentThemes';
|
|
3
|
+
export type SliderProps = {
|
|
4
|
+
name?: string;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
step?: number;
|
|
8
|
+
value?: number;
|
|
9
|
+
defaultValue?: number;
|
|
10
|
+
onChange?: (value: number) => void;
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
'aria-labelledby'?: string;
|
|
13
|
+
'aria-valuetext'?: string;
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
size: SliderTheme['variants']['size'];
|
|
16
|
+
colorScheme: SliderTheme['variants']['colorScheme'];
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
precision?: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const Slider: React.FC<SliderProps>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useRef, useCallback } from "react";
|
|
5
|
-
import { useControlledValue } from "../../../hooks/useControlledValue/useControlledValue.
|
|
6
|
-
import { getComponentStyles } from "../../../lib/theme/store/theme.
|
|
7
|
-
import { classnames } from "../../../lib/utils/classnames.
|
|
8
|
-
import { roundToPrecision, getBoundValue } from "../../../lib/utils/math.
|
|
9
|
-
import { filledTrack, track, thumb, containerVertical, container } from "./slider.css.
|
|
10
|
-
import { usePointerProgress } from "./usePointerProgress.
|
|
4
|
+
import { useControlledValue } from "../../../hooks/useControlledValue/useControlledValue.js";
|
|
5
|
+
import { getComponentStyles } from "../../../lib/theme/store/theme.js";
|
|
6
|
+
import { classnames } from "../../../lib/utils/classnames.js";
|
|
7
|
+
import { roundToPrecision, getBoundValue } from "../../../lib/utils/math.js";
|
|
8
|
+
import { filledTrack, track, thumb, containerVertical, container } from "./slider.css.js";
|
|
9
|
+
import { usePointerProgress } from "./usePointerProgress.js";
|
|
11
10
|
const usableKeys = /* @__PURE__ */ new Set([
|
|
12
11
|
"ArrowLeft",
|
|
13
12
|
"ArrowRight",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Slider, SliderProps } from './Slider';
|
|
3
|
+
declare const _default: Meta<typeof Slider>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: StoryObj<SliderProps>;
|
|
6
|
+
export declare const WithState: StoryObj<SliderProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Slider, type SliderProps } from './Slider';
|
|
@@ -1,26 +1,27 @@
|
|
|
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/form/Slider/slider.css.ts", "@blockle/blocks");
|
|
6
7
|
const container = css.style({
|
|
7
8
|
"@layer": {
|
|
8
|
-
[
|
|
9
|
+
[layers_css.blocksLayer]: {
|
|
9
10
|
position: "relative",
|
|
10
11
|
writingMode: "horizontal-tb"
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
}
|
|
14
|
+
});
|
|
14
15
|
const containerVertical = css.style({
|
|
15
16
|
"@layer": {
|
|
16
|
-
[
|
|
17
|
+
[layers_css.blocksLayer]: {
|
|
17
18
|
writingMode: "vertical-lr"
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
+
});
|
|
21
22
|
const track = css.style({
|
|
22
23
|
"@layer": {
|
|
23
|
-
[
|
|
24
|
+
[layers_css.blocksLayer]: {
|
|
24
25
|
cursor: "pointer",
|
|
25
26
|
position: "absolute",
|
|
26
27
|
inlineSize: "100%",
|
|
@@ -33,10 +34,10 @@ const track = css.style({
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
}
|
|
37
|
+
});
|
|
37
38
|
const filledTrack = css.style({
|
|
38
39
|
"@layer": {
|
|
39
|
-
[
|
|
40
|
+
[layers_css.blocksLayer]: {
|
|
40
41
|
position: "absolute",
|
|
41
42
|
blockSize: "100%",
|
|
42
43
|
borderRadius: "inherit",
|
|
@@ -47,10 +48,10 @@ const filledTrack = css.style({
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
}
|
|
51
|
+
});
|
|
51
52
|
const thumb = css.style({
|
|
52
53
|
"@layer": {
|
|
53
|
-
[
|
|
54
|
+
[layers_css.blocksLayer]: {
|
|
54
55
|
cursor: "pointer",
|
|
55
56
|
position: "absolute",
|
|
56
57
|
blockSize: "100%",
|
|
@@ -65,7 +66,7 @@ const thumb = css.style({
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
}
|
|
69
|
+
});
|
|
69
70
|
fileScope.endFileScope();
|
|
70
71
|
exports.container = container;
|
|
71
72
|
exports.containerVertical = containerVertical;
|
|
@@ -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/form/Slider/slider.css.ts", "@blockle/blocks");
|
|
5
5
|
const container = style({
|
|
6
6
|
"@layer": {
|
|
@@ -9,14 +9,14 @@ const container = style({
|
|
|
9
9
|
writingMode: "horizontal-tb"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
}
|
|
12
|
+
});
|
|
13
13
|
const containerVertical = style({
|
|
14
14
|
"@layer": {
|
|
15
15
|
[blocksLayer]: {
|
|
16
16
|
writingMode: "vertical-lr"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
}
|
|
19
|
+
});
|
|
20
20
|
const track = style({
|
|
21
21
|
"@layer": {
|
|
22
22
|
[blocksLayer]: {
|
|
@@ -32,7 +32,7 @@ const track = style({
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
});
|
|
36
36
|
const filledTrack = style({
|
|
37
37
|
"@layer": {
|
|
38
38
|
[blocksLayer]: {
|
|
@@ -46,7 +46,7 @@ const filledTrack = style({
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
});
|
|
50
50
|
const thumb = style({
|
|
51
51
|
"@layer": {
|
|
52
52
|
[blocksLayer]: {
|
|
@@ -64,7 +64,7 @@ const thumb = style({
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
}
|
|
67
|
+
});
|
|
68
68
|
endFileScope();
|
|
69
69
|
export {
|
|
70
70
|
container,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
4
|
const react = require("react");
|
|
3
5
|
function getProgress(event, rect) {
|
|
4
6
|
const { clientX, clientY } = event;
|
|
@@ -41,4 +43,5 @@ function usePointerProgress({ container, orientation, onChange }) {
|
|
|
41
43
|
};
|
|
42
44
|
}, [container, onChange, orientation]);
|
|
43
45
|
}
|
|
46
|
+
exports.getProgress = getProgress;
|
|
44
47
|
exports.usePointerProgress = usePointerProgress;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type PointerProgressOptions<T extends React.RefObject<HTMLElement | null>> = {
|
|
2
|
+
container: T;
|
|
3
|
+
orientation: 'horizontal' | 'vertical';
|
|
4
|
+
onChange(progress: number): void;
|
|
5
|
+
};
|
|
6
|
+
export declare function getProgress(event: PointerEvent, rect: DOMRect): [x: number, y: number];
|
|
7
|
+
/**
|
|
8
|
+
* Utility hook to track pointer events and calculate progress based on the pointer position.
|
|
9
|
+
*/
|
|
10
|
+
export declare function usePointerProgress<T extends React.RefObject<HTMLElement | null>>({ container, orientation, onChange }: PointerProgressOptions<T>): void;
|
|
11
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { useEffect } from "react";
|
|
2
3
|
function getProgress(event, rect) {
|
|
3
4
|
const { clientX, clientY } = event;
|
|
@@ -41,5 +42,6 @@ function usePointerProgress({ container, orientation, onChange }) {
|
|
|
41
42
|
}, [container, onChange, orientation]);
|
|
42
43
|
}
|
|
43
44
|
export {
|
|
45
|
+
getProgress,
|
|
44
46
|
usePointerProgress
|
|
45
47
|
};
|
|
@@ -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 theme = require("../../../lib/theme/store/theme.cjs");
|
|
7
|
+
const classnames = require("../../../lib/utils/classnames.cjs");
|
|
8
|
+
const switch_css = require("./switch.css.cjs");
|
|
7
9
|
const Switch = ({
|
|
8
10
|
checked,
|
|
9
11
|
className,
|
|
@@ -15,8 +17,8 @@ const Switch = ({
|
|
|
15
17
|
const [isChecked, setIsChecked] = react.useState(
|
|
16
18
|
defaultChecked || checked || false
|
|
17
19
|
);
|
|
18
|
-
const baseClassName =
|
|
19
|
-
const sliderClassName =
|
|
20
|
+
const baseClassName = theme.getComponentStyles("switch", { base: true });
|
|
21
|
+
const sliderClassName = theme.getComponentStyles("switch", { slider: true }, false);
|
|
20
22
|
react.useEffect(() => {
|
|
21
23
|
if (checked !== void 0) {
|
|
22
24
|
setIsChecked(checked);
|
|
@@ -43,7 +45,7 @@ const Switch = ({
|
|
|
43
45
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
44
46
|
"div",
|
|
45
47
|
{
|
|
46
|
-
className:
|
|
48
|
+
className: classnames.classnames(className, switch_css.container, baseClassName),
|
|
47
49
|
"data-checked": isChecked,
|
|
48
50
|
onClick: (event) => {
|
|
49
51
|
if (event.target.tagName === "INPUT") {
|
|
@@ -57,7 +59,7 @@ const Switch = ({
|
|
|
57
59
|
{
|
|
58
60
|
ref,
|
|
59
61
|
type: "checkbox",
|
|
60
|
-
className:
|
|
62
|
+
className: switch_css.input,
|
|
61
63
|
checked: isChecked,
|
|
62
64
|
onChange: onChangeHandler,
|
|
63
65
|
...restProps
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLElementProps } from '../../../lib/utils/utils';
|
|
2
|
+
export type SwitchProps = {
|
|
3
|
+
onChange?: (value: boolean) => void;
|
|
4
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
5
|
+
} & Omit<HTMLElementProps<HTMLInputElement>, 'onChange'>;
|
|
6
|
+
export declare const Switch: React.FC<SwitchProps>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { useState, useEffect, useCallback } from "react";
|
|
5
|
-
import { getComponentStyles } from "../../../lib/theme/store/theme.
|
|
6
|
-
import { classnames } from "../../../lib/utils/classnames.
|
|
7
|
-
import { input, container } from "./switch.css.
|
|
4
|
+
import { getComponentStyles } from "../../../lib/theme/store/theme.js";
|
|
5
|
+
import { classnames } from "../../../lib/utils/classnames.js";
|
|
6
|
+
import { input, container } from "./switch.css.js";
|
|
8
7
|
const Switch = ({
|
|
9
8
|
checked,
|
|
10
9
|
className,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch, type SwitchProps } from './Switch';
|
|
@@ -1,26 +1,27 @@
|
|
|
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/form/Switch/switch.css.ts", "@blockle/blocks");
|
|
6
7
|
const container = css.style({
|
|
7
8
|
"@layer": {
|
|
8
|
-
[
|
|
9
|
+
[layers_css.blocksLayer]: {
|
|
9
10
|
cursor: "pointer",
|
|
10
11
|
userSelect: "none",
|
|
11
12
|
position: "relative"
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
}
|
|
15
|
+
});
|
|
15
16
|
const input = css.style({
|
|
16
17
|
"@layer": {
|
|
17
|
-
[
|
|
18
|
+
[layers_css.blocksLayer]: {
|
|
18
19
|
opacity: 0,
|
|
19
20
|
maxBlockSize: 0,
|
|
20
21
|
maxInlineSize: 0
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
}
|
|
24
|
+
});
|
|
24
25
|
fileScope.endFileScope();
|
|
25
26
|
exports.container = container;
|
|
26
27
|
exports.input = input;
|
|
@@ -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/form/Switch/switch.css.ts", "@blockle/blocks");
|
|
5
5
|
const container = style({
|
|
6
6
|
"@layer": {
|
|
@@ -10,7 +10,7 @@ const container = style({
|
|
|
10
10
|
position: "relative"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
}
|
|
13
|
+
});
|
|
14
14
|
const input = style({
|
|
15
15
|
"@layer": {
|
|
16
16
|
[blocksLayer]: {
|
|
@@ -19,7 +19,7 @@ const input = style({
|
|
|
19
19
|
maxInlineSize: 0
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
}
|
|
22
|
+
});
|
|
23
23
|
endFileScope();
|
|
24
24
|
export {
|
|
25
25
|
container,
|
|
@@ -1,10 +1,11 @@
|
|
|
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
|
|
7
|
-
const { Template, Slot } =
|
|
4
|
+
const createAsChildTemplate = require("../../../lib/asChildRenderer/createAsChildTemplate.cjs");
|
|
5
|
+
const atomProps = require("../../../lib/utils/atom-props.cjs");
|
|
6
|
+
const classnames = require("../../../lib/utils/classnames.cjs");
|
|
7
|
+
const sprinkles_css = require("../../../lib/css/atoms/sprinkles.css.cjs");
|
|
8
|
+
const { Template, Slot } = createAsChildTemplate.createAsChildTemplate("div");
|
|
8
9
|
const Box = ({
|
|
9
10
|
asChild,
|
|
10
11
|
className,
|
|
@@ -12,13 +13,13 @@ const Box = ({
|
|
|
12
13
|
ref,
|
|
13
14
|
...restProps
|
|
14
15
|
}) => {
|
|
15
|
-
const [atomsProps, otherProps] =
|
|
16
|
+
const [atomsProps, otherProps] = atomProps.getAtomsAndProps(restProps);
|
|
16
17
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
18
|
Template,
|
|
18
19
|
{
|
|
19
20
|
ref,
|
|
20
21
|
asChild,
|
|
21
|
-
className:
|
|
22
|
+
className: classnames.classnames(className, sprinkles_css.atoms(atomsProps)),
|
|
22
23
|
...otherProps,
|
|
23
24
|
children: /* @__PURE__ */ jsxRuntime.jsx(Slot, { children })
|
|
24
25
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Atoms } from '../../../lib/css/atoms/atomTypes';
|
|
3
|
+
import { HTMLElementProps } from '../../../lib/utils/utils';
|
|
4
|
+
export type BoxProps = {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
} & Atoms & HTMLElementProps<HTMLDivElement>;
|
|
11
|
+
export declare const Box: React.FC<BoxProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createAsChildTemplate } from "../../../lib/asChildRenderer/createAsChildTemplate.
|
|
3
|
-
import { getAtomsAndProps } from "../../../lib/utils/atom-props.
|
|
4
|
-
import { classnames } from "../../../lib/utils/classnames.
|
|
5
|
-
import { atoms } from "../../../lib/css/atoms/sprinkles.css.
|
|
2
|
+
import { createAsChildTemplate } from "../../../lib/asChildRenderer/createAsChildTemplate.js";
|
|
3
|
+
import { getAtomsAndProps } from "../../../lib/utils/atom-props.js";
|
|
4
|
+
import { classnames } from "../../../lib/utils/classnames.js";
|
|
5
|
+
import { atoms } from "../../../lib/css/atoms/sprinkles.css.js";
|
|
6
6
|
const { Template, Slot } = createAsChildTemplate("div");
|
|
7
7
|
const Box = ({
|
|
8
8
|
asChild,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Box, type BoxProps } from './Box';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
4
|
+
const flexbox = require("../../../lib/css/flexbox/flexbox.cjs");
|
|
5
|
+
const Box = require("../Box/Box.cjs");
|
|
5
6
|
const Inline = ({
|
|
6
7
|
alignX,
|
|
7
8
|
alignY,
|
|
@@ -12,14 +13,14 @@ const Inline = ({
|
|
|
12
13
|
...props
|
|
13
14
|
}) => {
|
|
14
15
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
-
|
|
16
|
+
Box.Box,
|
|
16
17
|
{
|
|
17
18
|
asChild: true,
|
|
18
19
|
display,
|
|
19
20
|
gap: spacing,
|
|
20
21
|
flexDirection: "row",
|
|
21
|
-
justifyContent: alignX ?
|
|
22
|
-
alignItems: alignY ?
|
|
22
|
+
justifyContent: alignX ? flexbox.justifyContentMap[alignX] : void 0,
|
|
23
|
+
alignItems: alignY ? flexbox.alignItemsMap[alignY] : void 0,
|
|
23
24
|
flexWrap: "wrap",
|
|
24
25
|
...props,
|
|
25
26
|
children: /* @__PURE__ */ jsxRuntime.jsx(Tag, { children })
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Atoms, MarginAtoms, PaddingAtoms, ResponsiveDisplayFlex } from '../../../lib/css/atoms';
|
|
2
|
+
import { AlignItemsMap, JustifyContentMap } from '../../../lib/css/flexbox/flexbox';
|
|
3
|
+
export type InlineProps = {
|
|
4
|
+
alignX?: keyof JustifyContentMap;
|
|
5
|
+
alignY?: keyof AlignItemsMap;
|
|
6
|
+
tag?: 'div' | 'ul' | 'ol' | 'nav';
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
display?: ResponsiveDisplayFlex;
|
|
10
|
+
spacing: Atoms['gap'];
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
} & MarginAtoms & PaddingAtoms;
|
|
13
|
+
export declare const Inline: React.FC<InlineProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { alignItemsMap, justifyContentMap } from "../../../lib/css/flexbox/flexbox.
|
|
3
|
-
import { Box } from "../Box/Box.
|
|
2
|
+
import { alignItemsMap, justifyContentMap } from "../../../lib/css/flexbox/flexbox.js";
|
|
3
|
+
import { Box } from "../Box/Box.js";
|
|
4
4
|
const Inline = ({
|
|
5
5
|
alignX,
|
|
6
6
|
alignY,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Inline, InlineProps } from './Inline';
|
|
3
|
+
declare const _default: Meta<typeof Inline>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: StoryObj<InlineProps>;
|
|
6
|
+
export declare const List: StoryObj<InlineProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Inline, type InlineProps } from './Inline';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
4
|
+
const flexbox = require("../../../lib/css/flexbox/flexbox.cjs");
|
|
5
|
+
const Box = require("../Box/Box.cjs");
|
|
5
6
|
const Stack = ({
|
|
6
7
|
tag: Tag = "div",
|
|
7
8
|
display = "flex",
|
|
@@ -14,13 +15,13 @@ const Stack = ({
|
|
|
14
15
|
console.warn('Stack: "start" prop is only valid with tag="ol"');
|
|
15
16
|
}
|
|
16
17
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
|
-
|
|
18
|
+
Box.Box,
|
|
18
19
|
{
|
|
19
20
|
asChild: true,
|
|
20
21
|
display,
|
|
21
22
|
gap: spacing,
|
|
22
23
|
flexDirection: "column",
|
|
23
|
-
alignItems: alignX ?
|
|
24
|
+
alignItems: alignX ? flexbox.alignItemsMap[alignX] : void 0,
|
|
24
25
|
...restProps,
|
|
25
26
|
children: /* @__PURE__ */ jsxRuntime.jsx(Tag, { children })
|
|
26
27
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Atoms, MarginAtoms, PaddingAtoms, ResponsiveDisplayFlex } from '../../../lib/css/atoms';
|
|
2
|
+
import { AlignItemsMap } from '../../../lib/css/flexbox/flexbox';
|
|
3
|
+
export type StackProps = {
|
|
4
|
+
alignX?: keyof AlignItemsMap;
|
|
5
|
+
tag?: 'div' | 'section' | 'ul' | 'ol';
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
display?: ResponsiveDisplayFlex;
|
|
9
|
+
spacing: Atoms['gap'];
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
role?: React.AriaRole;
|
|
12
|
+
/**
|
|
13
|
+
* Start prop is only valid when tag="ol"
|
|
14
|
+
*/
|
|
15
|
+
start?: number;
|
|
16
|
+
} & MarginAtoms & PaddingAtoms;
|
|
17
|
+
export declare const Stack: React.FC<StackProps>;
|