@orioncactuscorp/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +273 -0
- package/dist/components/Accordion/Accordion.css +1 -0
- package/dist/components/Accordion/Accordion.js +320 -0
- package/dist/components/Accordion/Accordion.module.scss.js +31 -0
- package/dist/components/Accordion.d.ts +6 -0
- package/dist/components/Accordion.js +9 -0
- package/dist/components/ActionArea/ActionArea.css +1 -0
- package/dist/components/ActionArea/ActionArea.js +158 -0
- package/dist/components/ActionArea/ActionArea.module.scss.js +9 -0
- package/dist/components/ActionArea.d.ts +6 -0
- package/dist/components/ActionArea.js +6 -0
- package/dist/components/Alert/Alert.css +1 -0
- package/dist/components/Alert/Alert.js +293 -0
- package/dist/components/Alert/Alert.module.scss.js +21 -0
- package/dist/components/Alert.d.ts +6 -0
- package/dist/components/Alert.js +10 -0
- package/dist/components/Background/Background.css +1 -0
- package/dist/components/Background/Background.js +45 -0
- package/dist/components/Background/Background.module.scss.js +21 -0
- package/dist/components/Background.d.ts +6 -0
- package/dist/components/Background.js +4 -0
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -0
- package/dist/components/BackgroundIconButton/BackgroundIconButton.js +61 -0
- package/dist/components/BackgroundIconButton/BackgroundIconButton.module.scss.js +13 -0
- package/dist/components/BackgroundIconButton.d.ts +6 -0
- package/dist/components/BackgroundIconButton.js +4 -0
- package/dist/components/Badge/Badge.css +1 -0
- package/dist/components/Badge/Badge.js +34 -0
- package/dist/components/Badge/Badge.module.scss.js +17 -0
- package/dist/components/Badge.d.ts +6 -0
- package/dist/components/Badge.js +4 -0
- package/dist/components/Button/Button.css +1 -0
- package/dist/components/Button/Button.js +151 -0
- package/dist/components/Button/Button.module.scss.js +29 -0
- package/dist/components/Button.d.ts +6 -0
- package/dist/components/Button.js +4 -0
- package/dist/components/Cell/Cell.css +1 -0
- package/dist/components/Cell/Cell.js +129 -0
- package/dist/components/Cell/Cell.module.scss.js +17 -0
- package/dist/components/Cell.d.ts +6 -0
- package/dist/components/Cell.js +5 -0
- package/dist/components/CheckMark/CheckMark.css +1 -0
- package/dist/components/CheckMark/CheckMark.js +44 -0
- package/dist/components/CheckMark/CheckMark.module.scss.js +7 -0
- package/dist/components/CheckMark.d.ts +6 -0
- package/dist/components/CheckMark.js +4 -0
- package/dist/components/Checkbox/Checkbox.css +1 -0
- package/dist/components/Checkbox/Checkbox.js +82 -0
- package/dist/components/Checkbox/Checkbox.module.scss.js +11 -0
- package/dist/components/Checkbox.d.ts +6 -0
- package/dist/components/Checkbox.js +4 -0
- package/dist/components/Divider/Divider.css +1 -0
- package/dist/components/Divider/Divider.js +41 -0
- package/dist/components/Divider/Divider.module.scss.js +17 -0
- package/dist/components/Divider.d.ts +6 -0
- package/dist/components/Divider.js +4 -0
- package/dist/components/Field/Field.css +1 -0
- package/dist/components/Field/Field.js +179 -0
- package/dist/components/Field/Field.module.scss.js +17 -0
- package/dist/components/Field/useFieldControlOverlayMetrics.js +44 -0
- package/dist/components/Field.d.ts +6 -0
- package/dist/components/Field.js +10 -0
- package/dist/components/Fieldset/Fieldset.css +1 -0
- package/dist/components/Fieldset/Fieldset.js +97 -0
- package/dist/components/Fieldset/Fieldset.module.scss.js +11 -0
- package/dist/components/Fieldset.d.ts +6 -0
- package/dist/components/Fieldset.js +8 -0
- package/dist/components/IconButton/IconButton.css +1 -0
- package/dist/components/IconButton/IconButton.js +49 -0
- package/dist/components/IconButton/IconButton.module.scss.js +11 -0
- package/dist/components/IconButton.d.ts +6 -0
- package/dist/components/IconButton.js +4 -0
- package/dist/components/Interaction/Interaction.css +1 -0
- package/dist/components/Interaction/Interaction.js +23 -0
- package/dist/components/Interaction/Interaction.module.scss.js +11 -0
- package/dist/components/Interaction.d.ts +6 -0
- package/dist/components/Interaction.js +4 -0
- package/dist/components/Loading/Loading.css +1 -0
- package/dist/components/Loading/Loading.js +47 -0
- package/dist/components/Loading/Loading.module.scss.js +21 -0
- package/dist/components/Loading.d.ts +6 -0
- package/dist/components/Loading.js +4 -0
- package/dist/components/Menu/Menu.css +1 -0
- package/dist/components/Menu/Menu.js +238 -0
- package/dist/components/Menu/Menu.module.scss.js +31 -0
- package/dist/components/Menu.d.ts +6 -0
- package/dist/components/Menu.js +9 -0
- package/dist/components/Modal/Modal.css +1 -0
- package/dist/components/Modal/Modal.js +628 -0
- package/dist/components/Modal/Modal.module.scss.js +48 -0
- package/dist/components/Modal/contexts.js +14 -0
- package/dist/components/Modal/modalScrollArbitration.js +134 -0
- package/dist/components/Modal/snapPoints.js +79 -0
- package/dist/components/Modal/useControllableState.js +17 -0
- package/dist/components/Modal/useElementSize.js +23 -0
- package/dist/components/Modal/useModalDrag.js +1498 -0
- package/dist/components/Modal/useModalPlacement.js +26 -0
- package/dist/components/Modal/useModalStackDepth.js +41 -0
- package/dist/components/Modal.d.ts +6 -0
- package/dist/components/Modal.js +11 -0
- package/dist/components/Radio/Radio.css +1 -0
- package/dist/components/Radio/Radio.js +68 -0
- package/dist/components/Radio/Radio.module.scss.js +11 -0
- package/dist/components/Radio.d.ts +6 -0
- package/dist/components/Radio.js +4 -0
- package/dist/components/ScrollArea/ScrollArea.css +1 -0
- package/dist/components/ScrollArea/ScrollArea.js +541 -0
- package/dist/components/ScrollArea/ScrollArea.module.scss.js +17 -0
- package/dist/components/ScrollArea/contexts.js +7 -0
- package/dist/components/ScrollArea.d.ts +6 -0
- package/dist/components/ScrollArea.js +8 -0
- package/dist/components/SectionHeader/SectionHeader.css +1 -0
- package/dist/components/SectionHeader/SectionHeader.js +48 -0
- package/dist/components/SectionHeader/SectionHeader.module.scss.js +7 -0
- package/dist/components/SectionHeader.d.ts +6 -0
- package/dist/components/SectionHeader.js +4 -0
- package/dist/components/Select/Select.css +1 -0
- package/dist/components/Select/Select.js +67 -0
- package/dist/components/Select/Select.module.scss.js +9 -0
- package/dist/components/Select/SelectContent.css +1 -0
- package/dist/components/Select/SelectContent.js +26 -0
- package/dist/components/Select/SelectContent.module.scss.js +15 -0
- package/dist/components/Select.d.ts +6 -0
- package/dist/components/Select.js +6 -0
- package/dist/components/SvgIcon.d.ts +6 -0
- package/dist/components/SvgIcon.js +4 -0
- package/dist/components/Switch/Switch.css +1 -0
- package/dist/components/Switch/Switch.js +46 -0
- package/dist/components/Switch/Switch.module.scss.js +8 -0
- package/dist/components/Switch.d.ts +6 -0
- package/dist/components/Switch.js +4 -0
- package/dist/components/TextArea/TextArea.css +1 -0
- package/dist/components/TextArea/TextArea.js +105 -0
- package/dist/components/TextArea/TextArea.module.scss.js +9 -0
- package/dist/components/TextArea/TextAreaContent.css +1 -0
- package/dist/components/TextArea/TextAreaContent.js +26 -0
- package/dist/components/TextArea/TextAreaContent.module.scss.js +15 -0
- package/dist/components/TextArea.d.ts +6 -0
- package/dist/components/TextArea.js +6 -0
- package/dist/components/TextButton/TextButton.css +1 -0
- package/dist/components/TextButton/TextButton.js +74 -0
- package/dist/components/TextButton/TextButton.module.scss.js +15 -0
- package/dist/components/TextButton.d.ts +6 -0
- package/dist/components/TextButton.js +4 -0
- package/dist/components/TextInput/TextInput.css +1 -0
- package/dist/components/TextInput/TextInput.js +69 -0
- package/dist/components/TextInput/TextInput.module.scss.js +9 -0
- package/dist/components/TextInput/TextInputContent.css +1 -0
- package/dist/components/TextInput/TextInputContent.js +26 -0
- package/dist/components/TextInput/TextInputContent.module.scss.js +15 -0
- package/dist/components/TextInput.d.ts +6 -0
- package/dist/components/TextInput.js +6 -0
- package/dist/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Tooltip/Tooltip.js +123 -0
- package/dist/components/Tooltip/Tooltip.module.scss.js +9 -0
- package/dist/components/Tooltip.d.ts +6 -0
- package/dist/components/Tooltip.js +8 -0
- package/dist/components/internal/slot.js +10 -0
- package/dist/foundations/atomic.css +1 -0
- package/dist/foundations/breakpoint.css +1 -0
- package/dist/foundations/color.global.css +1 -0
- package/dist/foundations/color.theme.dark.css +1 -0
- package/dist/foundations/color.theme.light.css +1 -0
- package/dist/foundations/motion.css +1 -0
- package/dist/foundations/reset.css +1 -0
- package/dist/foundations/space.css +1 -0
- package/dist/foundations/typo.css +1 -0
- package/dist/foundations/zindex.css +1 -0
- package/dist/foundations.css +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +102 -0
- package/dist/react/motion.d.ts +6 -0
- package/dist/react/motion.js +176 -0
- package/dist/react/spring.d.ts +2 -0
- package/dist/react/spring.js +87 -0
- package/dist/reset.css +2 -0
- package/dist/styles.css +41 -0
- package/dist/ui/src/components/Accordion/Accordion.d.ts +9 -0
- package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/ui/src/components/Accordion/index.d.ts +3 -0
- package/dist/ui/src/components/Accordion/index.d.ts.map +1 -0
- package/dist/ui/src/components/Accordion/types.d.ts +39 -0
- package/dist/ui/src/components/Accordion/types.d.ts.map +1 -0
- package/dist/ui/src/components/ActionArea/ActionArea.d.ts +8 -0
- package/dist/ui/src/components/ActionArea/ActionArea.d.ts.map +1 -0
- package/dist/ui/src/components/ActionArea/index.d.ts +3 -0
- package/dist/ui/src/components/ActionArea/index.d.ts.map +1 -0
- package/dist/ui/src/components/ActionArea/types.d.ts +34 -0
- package/dist/ui/src/components/ActionArea/types.d.ts.map +1 -0
- package/dist/ui/src/components/Alert/Alert.d.ts +17 -0
- package/dist/ui/src/components/Alert/Alert.d.ts.map +1 -0
- package/dist/ui/src/components/Alert/index.d.ts +3 -0
- package/dist/ui/src/components/Alert/index.d.ts.map +1 -0
- package/dist/ui/src/components/Alert/types.d.ts +43 -0
- package/dist/ui/src/components/Alert/types.d.ts.map +1 -0
- package/dist/ui/src/components/Background/Background.d.ts +4 -0
- package/dist/ui/src/components/Background/Background.d.ts.map +1 -0
- package/dist/ui/src/components/Background/index.d.ts +3 -0
- package/dist/ui/src/components/Background/index.d.ts.map +1 -0
- package/dist/ui/src/components/Background/types.d.ts +17 -0
- package/dist/ui/src/components/Background/types.d.ts.map +1 -0
- package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts +4 -0
- package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts.map +1 -0
- package/dist/ui/src/components/BackgroundIconButton/index.d.ts +3 -0
- package/dist/ui/src/components/BackgroundIconButton/index.d.ts.map +1 -0
- package/dist/ui/src/components/BackgroundIconButton/types.d.ts +16 -0
- package/dist/ui/src/components/BackgroundIconButton/types.d.ts.map +1 -0
- package/dist/ui/src/components/Badge/Badge.d.ts +4 -0
- package/dist/ui/src/components/Badge/Badge.d.ts.map +1 -0
- package/dist/ui/src/components/Badge/index.d.ts +3 -0
- package/dist/ui/src/components/Badge/index.d.ts.map +1 -0
- package/dist/ui/src/components/Badge/types.d.ts +9 -0
- package/dist/ui/src/components/Badge/types.d.ts.map +1 -0
- package/dist/ui/src/components/Button/Button.d.ts +4 -0
- package/dist/ui/src/components/Button/Button.d.ts.map +1 -0
- package/dist/ui/src/components/Button/index.d.ts +3 -0
- package/dist/ui/src/components/Button/index.d.ts.map +1 -0
- package/dist/ui/src/components/Button/types.d.ts +30 -0
- package/dist/ui/src/components/Button/types.d.ts.map +1 -0
- package/dist/ui/src/components/Cell/Cell.d.ts +5 -0
- package/dist/ui/src/components/Cell/Cell.d.ts.map +1 -0
- package/dist/ui/src/components/Cell/index.d.ts +3 -0
- package/dist/ui/src/components/Cell/index.d.ts.map +1 -0
- package/dist/ui/src/components/Cell/types.d.ts +23 -0
- package/dist/ui/src/components/Cell/types.d.ts.map +1 -0
- package/dist/ui/src/components/CheckMark/CheckMark.d.ts +4 -0
- package/dist/ui/src/components/CheckMark/CheckMark.d.ts.map +1 -0
- package/dist/ui/src/components/CheckMark/index.d.ts +3 -0
- package/dist/ui/src/components/CheckMark/index.d.ts.map +1 -0
- package/dist/ui/src/components/CheckMark/types.d.ts +6 -0
- package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -0
- package/dist/ui/src/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/ui/src/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/ui/src/components/Checkbox/index.d.ts +3 -0
- package/dist/ui/src/components/Checkbox/index.d.ts.map +1 -0
- package/dist/ui/src/components/Checkbox/types.d.ts +11 -0
- package/dist/ui/src/components/Checkbox/types.d.ts.map +1 -0
- package/dist/ui/src/components/Divider/Divider.d.ts +4 -0
- package/dist/ui/src/components/Divider/Divider.d.ts.map +1 -0
- package/dist/ui/src/components/Divider/index.d.ts +3 -0
- package/dist/ui/src/components/Divider/index.d.ts.map +1 -0
- package/dist/ui/src/components/Divider/types.d.ts +10 -0
- package/dist/ui/src/components/Divider/types.d.ts.map +1 -0
- package/dist/ui/src/components/Field/Field.d.ts +9 -0
- package/dist/ui/src/components/Field/Field.d.ts.map +1 -0
- package/dist/ui/src/components/Field/index.d.ts +3 -0
- package/dist/ui/src/components/Field/index.d.ts.map +1 -0
- package/dist/ui/src/components/Field/types.d.ts +30 -0
- package/dist/ui/src/components/Field/types.d.ts.map +1 -0
- package/dist/ui/src/components/Field/useFieldControlOverlayMetrics.d.ts +14 -0
- package/dist/ui/src/components/Field/useFieldControlOverlayMetrics.d.ts.map +1 -0
- package/dist/ui/src/components/Fieldset/Fieldset.d.ts +9 -0
- package/dist/ui/src/components/Fieldset/Fieldset.d.ts.map +1 -0
- package/dist/ui/src/components/Fieldset/index.d.ts +3 -0
- package/dist/ui/src/components/Fieldset/index.d.ts.map +1 -0
- package/dist/ui/src/components/Fieldset/types.d.ts +7 -0
- package/dist/ui/src/components/Fieldset/types.d.ts.map +1 -0
- package/dist/ui/src/components/IconButton/IconButton.d.ts +4 -0
- package/dist/ui/src/components/IconButton/IconButton.d.ts.map +1 -0
- package/dist/ui/src/components/IconButton/index.d.ts +3 -0
- package/dist/ui/src/components/IconButton/index.d.ts.map +1 -0
- package/dist/ui/src/components/IconButton/types.d.ts +16 -0
- package/dist/ui/src/components/IconButton/types.d.ts.map +1 -0
- package/dist/ui/src/components/Interaction/Interaction.d.ts +4 -0
- package/dist/ui/src/components/Interaction/Interaction.d.ts.map +1 -0
- package/dist/ui/src/components/Interaction/index.d.ts +3 -0
- package/dist/ui/src/components/Interaction/index.d.ts.map +1 -0
- package/dist/ui/src/components/Interaction/types.d.ts +6 -0
- package/dist/ui/src/components/Interaction/types.d.ts.map +1 -0
- package/dist/ui/src/components/Loading/Loading.d.ts +4 -0
- package/dist/ui/src/components/Loading/Loading.d.ts.map +1 -0
- package/dist/ui/src/components/Loading/index.d.ts +3 -0
- package/dist/ui/src/components/Loading/index.d.ts.map +1 -0
- package/dist/ui/src/components/Loading/types.d.ts +8 -0
- package/dist/ui/src/components/Loading/types.d.ts.map +1 -0
- package/dist/ui/src/components/Menu/Menu.d.ts +12 -0
- package/dist/ui/src/components/Menu/Menu.d.ts.map +1 -0
- package/dist/ui/src/components/Menu/index.d.ts +3 -0
- package/dist/ui/src/components/Menu/index.d.ts.map +1 -0
- package/dist/ui/src/components/Menu/types.d.ts +52 -0
- package/dist/ui/src/components/Menu/types.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/Modal.d.ts +19 -0
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/contexts.d.ts +33 -0
- package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/index.d.ts +3 -0
- package/dist/ui/src/components/Modal/index.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts +33 -0
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/snapPoints.d.ts +38 -0
- package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/types.d.ts +117 -0
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useControllableState.d.ts +6 -0
- package/dist/ui/src/components/Modal/useControllableState.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useElementSize.d.ts +6 -0
- package/dist/ui/src/components/Modal/useElementSize.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalDrag.d.ts +37 -0
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalPlacement.d.ts +3 -0
- package/dist/ui/src/components/Modal/useModalPlacement.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalStackDepth.d.ts +2 -0
- package/dist/ui/src/components/Modal/useModalStackDepth.d.ts.map +1 -0
- package/dist/ui/src/components/Radio/Radio.d.ts +4 -0
- package/dist/ui/src/components/Radio/Radio.d.ts.map +1 -0
- package/dist/ui/src/components/Radio/index.d.ts +3 -0
- package/dist/ui/src/components/Radio/index.d.ts.map +1 -0
- package/dist/ui/src/components/Radio/types.d.ts +10 -0
- package/dist/ui/src/components/Radio/types.d.ts.map +1 -0
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts +6 -0
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/ui/src/components/ScrollArea/contexts.d.ts +3 -0
- package/dist/ui/src/components/ScrollArea/contexts.d.ts.map +1 -0
- package/dist/ui/src/components/ScrollArea/index.d.ts +4 -0
- package/dist/ui/src/components/ScrollArea/index.d.ts.map +1 -0
- package/dist/ui/src/components/ScrollArea/types.d.ts +21 -0
- package/dist/ui/src/components/ScrollArea/types.d.ts.map +1 -0
- package/dist/ui/src/components/SectionHeader/SectionHeader.d.ts +4 -0
- package/dist/ui/src/components/SectionHeader/SectionHeader.d.ts.map +1 -0
- package/dist/ui/src/components/SectionHeader/index.d.ts +3 -0
- package/dist/ui/src/components/SectionHeader/index.d.ts.map +1 -0
- package/dist/ui/src/components/SectionHeader/types.d.ts +13 -0
- package/dist/ui/src/components/SectionHeader/types.d.ts.map +1 -0
- package/dist/ui/src/components/Select/Select.d.ts +4 -0
- package/dist/ui/src/components/Select/Select.d.ts.map +1 -0
- package/dist/ui/src/components/Select/SelectContent.d.ts +4 -0
- package/dist/ui/src/components/Select/SelectContent.d.ts.map +1 -0
- package/dist/ui/src/components/Select/index.d.ts +4 -0
- package/dist/ui/src/components/Select/index.d.ts.map +1 -0
- package/dist/ui/src/components/Select/types.d.ts +12 -0
- package/dist/ui/src/components/Select/types.d.ts.map +1 -0
- package/dist/ui/src/components/SvgIcon/SvgIcon.d.ts +2 -0
- package/dist/ui/src/components/SvgIcon/SvgIcon.d.ts.map +1 -0
- package/dist/ui/src/components/SvgIcon/index.d.ts +3 -0
- package/dist/ui/src/components/SvgIcon/index.d.ts.map +1 -0
- package/dist/ui/src/components/SvgIcon/types.d.ts +2 -0
- package/dist/ui/src/components/SvgIcon/types.d.ts.map +1 -0
- package/dist/ui/src/components/Switch/Switch.d.ts +4 -0
- package/dist/ui/src/components/Switch/Switch.d.ts.map +1 -0
- package/dist/ui/src/components/Switch/index.d.ts +3 -0
- package/dist/ui/src/components/Switch/index.d.ts.map +1 -0
- package/dist/ui/src/components/Switch/types.d.ts +8 -0
- package/dist/ui/src/components/Switch/types.d.ts.map +1 -0
- package/dist/ui/src/components/TextArea/TextArea.d.ts +4 -0
- package/dist/ui/src/components/TextArea/TextArea.d.ts.map +1 -0
- package/dist/ui/src/components/TextArea/TextAreaContent.d.ts +4 -0
- package/dist/ui/src/components/TextArea/TextAreaContent.d.ts.map +1 -0
- package/dist/ui/src/components/TextArea/index.d.ts +4 -0
- package/dist/ui/src/components/TextArea/index.d.ts.map +1 -0
- package/dist/ui/src/components/TextArea/types.d.ts +15 -0
- package/dist/ui/src/components/TextArea/types.d.ts.map +1 -0
- package/dist/ui/src/components/TextButton/TextButton.d.ts +4 -0
- package/dist/ui/src/components/TextButton/TextButton.d.ts.map +1 -0
- package/dist/ui/src/components/TextButton/index.d.ts +3 -0
- package/dist/ui/src/components/TextButton/index.d.ts.map +1 -0
- package/dist/ui/src/components/TextButton/types.d.ts +25 -0
- package/dist/ui/src/components/TextButton/types.d.ts.map +1 -0
- package/dist/ui/src/components/TextInput/TextInput.d.ts +4 -0
- package/dist/ui/src/components/TextInput/TextInput.d.ts.map +1 -0
- package/dist/ui/src/components/TextInput/TextInputContent.d.ts +4 -0
- package/dist/ui/src/components/TextInput/TextInputContent.d.ts.map +1 -0
- package/dist/ui/src/components/TextInput/index.d.ts +4 -0
- package/dist/ui/src/components/TextInput/index.d.ts.map +1 -0
- package/dist/ui/src/components/TextInput/types.d.ts +12 -0
- package/dist/ui/src/components/TextInput/types.d.ts.map +1 -0
- package/dist/ui/src/components/Tooltip/Tooltip.d.ts +8 -0
- package/dist/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/ui/src/components/Tooltip/index.d.ts +3 -0
- package/dist/ui/src/components/Tooltip/index.d.ts.map +1 -0
- package/dist/ui/src/components/Tooltip/types.d.ts +21 -0
- package/dist/ui/src/components/Tooltip/types.d.ts.map +1 -0
- package/dist/ui/src/components/internal/slot.d.ts +3 -0
- package/dist/ui/src/components/internal/slot.d.ts.map +1 -0
- package/dist/ui/src/components/types.d.ts +2 -0
- package/dist/ui/src/components/types.d.ts.map +1 -0
- package/dist/ui/src/index.d.ts +59 -0
- package/dist/ui/src/index.d.ts.map +1 -0
- package/dist/ui/src/react/motion/index.d.ts +27 -0
- package/dist/ui/src/react/motion/index.d.ts.map +1 -0
- package/dist/ui/src/react/spring/index.d.ts +33 -0
- package/dist/ui/src/react/spring/index.d.ts.map +1 -0
- package/dist/ui/src/utils/breakpoints.d.ts +6 -0
- package/dist/ui/src/utils/breakpoints.d.ts.map +1 -0
- package/dist/ui/src/utils/css.d.ts +3 -0
- package/dist/ui/src/utils/css.d.ts.map +1 -0
- package/dist/ui/src/utils/motion.d.ts +80 -0
- package/dist/ui/src/utils/motion.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/animator.d.ts +3 -0
- package/dist/ui/src/utils/spring/animator.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/constants.d.ts +13 -0
- package/dist/ui/src/utils/spring/constants.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/format.d.ts +5 -0
- package/dist/ui/src/utils/spring/format.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/model.d.ts +18 -0
- package/dist/ui/src/utils/spring/model.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/solver.d.ts +6 -0
- package/dist/ui/src/utils/spring/solver.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/static.d.ts +5 -0
- package/dist/ui/src/utils/spring/static.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/types.d.ts +141 -0
- package/dist/ui/src/utils/spring/types.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/validation.d.ts +5 -0
- package/dist/ui/src/utils/spring/validation.d.ts.map +1 -0
- package/dist/ui/src/utils/spring/value.d.ts +5 -0
- package/dist/ui/src/utils/spring/value.d.ts.map +1 -0
- package/dist/ui/src/utils/spring.d.ts +12 -0
- package/dist/ui/src/utils/spring.d.ts.map +1 -0
- package/dist/utils/breakpoints.d.ts +2 -0
- package/dist/utils/breakpoints.js +26 -0
- package/dist/utils/css.js +7 -0
- package/dist/utils/motion.d.ts +2 -0
- package/dist/utils/motion.js +343 -0
- package/dist/utils/spring/animator.js +179 -0
- package/dist/utils/spring/constants.js +15 -0
- package/dist/utils/spring/format.js +10 -0
- package/dist/utils/spring/model.js +120 -0
- package/dist/utils/spring/solver.js +78 -0
- package/dist/utils/spring/static.js +76 -0
- package/dist/utils/spring/validation.js +19 -0
- package/dist/utils/spring/value.js +65 -0
- package/dist/utils/spring.d.ts +2 -0
- package/dist/utils/spring.js +14 -0
- package/dist/vscode/oc-ui-vars.css +468 -0
- package/package.json +128 -0
- package/src/scss/foundations/_color.config.scss +14 -0
- package/src/scss/foundations/_responsive.config.scss +6 -0
- package/src/scss/foundations/atomic.scss +24 -0
- package/src/scss/foundations/breakpoint.scss +3 -0
- package/src/scss/foundations/color-theme.test.ts +99 -0
- package/src/scss/foundations/color.global.scss +210 -0
- package/src/scss/foundations/color.theme.dark.scss +80 -0
- package/src/scss/foundations/color.theme.light.scss +72 -0
- package/src/scss/foundations/motion.scss +46 -0
- package/src/scss/foundations/reset.scss +129 -0
- package/src/scss/foundations/responsive.test.ts +294 -0
- package/src/scss/foundations/space.scss +206 -0
- package/src/scss/foundations/typo.scss +381 -0
- package/src/scss/foundations/zindex.scss +12 -0
- package/src/scss/index.scss +18 -0
- package/src/scss/mixins/_breakpoint.scss +115 -0
- package/src/scss/mixins/_color.scss +29 -0
- package/src/scss/mixins/_color.test.ts +35 -0
- package/src/scss/mixins/_element.scss +52 -0
- package/src/scss/mixins/_element.test.ts +44 -0
- package/src/scss/mixins/_motion.scss +450 -0
- package/src/scss/mixins/_motion.test.ts +336 -0
- package/src/scss/mixins/_responsive.scss +366 -0
- package/src/scss/mixins/_spring.scss +396 -0
- package/src/scss/mixins/_spring.test.ts +128 -0
- package/src/scss/mixins/_typo.scss +67 -0
- package/src/scss/mixins/_typo.test.ts +28 -0
- package/src/scss/mixins/_utils.scss +26 -0
- package/src/scss/spring.scss +1 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:math';
|
|
4
|
+
@use 'sass:meta';
|
|
5
|
+
@use 'sass:string';
|
|
6
|
+
|
|
7
|
+
$oc-spring-preset-bounce: (
|
|
8
|
+
smooth: 0,
|
|
9
|
+
snappy: 0.15,
|
|
10
|
+
bouncy: 0.3,
|
|
11
|
+
) !default;
|
|
12
|
+
$oc-spring-epsilon: 0.0001 !default;
|
|
13
|
+
$oc-spring-stability-window: 100ms !default;
|
|
14
|
+
$oc-spring-time-step: 1ms !default;
|
|
15
|
+
$oc-spring-max-duration: 20s !default;
|
|
16
|
+
$oc-spring-samples-per-response: 64 !default;
|
|
17
|
+
$oc-spring-max-samples: 240 !default;
|
|
18
|
+
|
|
19
|
+
@function _oc-spring-round($value, $digits) {
|
|
20
|
+
$factor: math.pow(10, $digits);
|
|
21
|
+
|
|
22
|
+
@return math.div(math.round($value * $factor), $factor);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@function _oc-spring-seconds($time, $name) {
|
|
26
|
+
@if meta.type-of($time) != 'number' or not math.compatible($time, 1s) {
|
|
27
|
+
@error '#{$name} must be a time value.';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@if $time <= 0s {
|
|
31
|
+
@error '#{$name} must be greater than 0s.';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@return math.div($time, 1s);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@function _oc-spring-optional-seconds($time, $name) {
|
|
38
|
+
@if meta.type-of($time) != 'number' or not math.compatible($time, 1s) {
|
|
39
|
+
@error '#{$name} must be a time value.';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@if $time < 0s {
|
|
43
|
+
@error '#{$name} must be greater than or equal to 0s.';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@return math.div($time, 1s);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@function _oc-spring-number($value, $name) {
|
|
50
|
+
@if meta.type-of($value) != 'number' or not math.is-unitless($value) {
|
|
51
|
+
@error '#{$name} must be a unitless number.';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@return $value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@function _oc-spring-positive-number($value, $name) {
|
|
58
|
+
$number: _oc-spring-number($value, $name);
|
|
59
|
+
|
|
60
|
+
@if $number <= 0 {
|
|
61
|
+
@error '#{$name} must be greater than 0.';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@return $number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@function _oc-spring-bounce-to-damping-ratio($bounce) {
|
|
68
|
+
$bounce: _oc-spring-number($bounce, 'bounce');
|
|
69
|
+
|
|
70
|
+
@if $bounce <= -1 or $bounce >= 1 {
|
|
71
|
+
@error 'bounce must be greater than -1 and less than 1.';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@if $bounce > 0 {
|
|
75
|
+
@return 1 - $bounce;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@return math.div(1, $bounce + 1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@function _oc-spring-duration-parameters($duration, $bounce) {
|
|
82
|
+
$duration-seconds: _oc-spring-seconds($duration, 'duration');
|
|
83
|
+
$mass: 1;
|
|
84
|
+
$stiffness: math.div(4 * math.$pi * math.$pi * $mass, $duration-seconds * $duration-seconds);
|
|
85
|
+
$damping-ratio: _oc-spring-bounce-to-damping-ratio($bounce);
|
|
86
|
+
$damping: $damping-ratio * 2 * math.sqrt($mass * $stiffness);
|
|
87
|
+
|
|
88
|
+
@return (mass: $mass, stiffness: $stiffness, damping: $damping, perceptual-duration: $duration-seconds, bounce: $bounce);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@function _oc-spring-physical-parameters($mass, $stiffness, $damping) {
|
|
92
|
+
@return (mass: _oc-spring-positive-number($mass, 'mass'), stiffness: _oc-spring-positive-number($stiffness, 'stiffness'), damping: _oc-spring-positive-number($damping, 'damping'), perceptual-duration: null, bounce: null);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@function _oc-spring-resolve-parameters($duration, $preset, $extra-bounce, $bounce, $mass, $stiffness, $damping) {
|
|
96
|
+
$has-physical: $mass != null or $stiffness != null or $damping != null;
|
|
97
|
+
|
|
98
|
+
@if $has-physical {
|
|
99
|
+
@if $mass == null or $stiffness == null or $damping == null {
|
|
100
|
+
@error 'physical spring requires $mass, $stiffness, and $damping.';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@return _oc-spring-physical-parameters($mass, $stiffness, $damping);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@if $duration == null {
|
|
107
|
+
@error 'duration is required for preset and bounce springs.';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@if $bounce == null {
|
|
111
|
+
@if not map.has-key($oc-spring-preset-bounce, $preset) {
|
|
112
|
+
@error 'Unknown spring preset: #{$preset}.';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
$base-bounce: map.get($oc-spring-preset-bounce, $preset);
|
|
116
|
+
$bounce: $base-bounce + _oc-spring-number($extra-bounce, 'extra-bounce');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@return _oc-spring-duration-parameters($duration, $bounce);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@function _oc-spring-damping-ratio($parameters) {
|
|
123
|
+
$mass: map.get($parameters, mass);
|
|
124
|
+
$stiffness: map.get($parameters, stiffness);
|
|
125
|
+
$damping: map.get($parameters, damping);
|
|
126
|
+
|
|
127
|
+
@return math.div($damping, 2 * math.sqrt($stiffness * $mass));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@function _oc-spring-natural-response-duration($parameters) {
|
|
131
|
+
$mass: map.get($parameters, mass);
|
|
132
|
+
$stiffness: map.get($parameters, stiffness);
|
|
133
|
+
|
|
134
|
+
@return math.div(2 * math.$pi, math.sqrt(math.div($stiffness, $mass)));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@function _oc-spring-value($time, $parameters, $initial-velocity) {
|
|
138
|
+
$mass: map.get($parameters, mass);
|
|
139
|
+
$stiffness: map.get($parameters, stiffness);
|
|
140
|
+
$damping: map.get($parameters, damping);
|
|
141
|
+
$angular-frequency: math.sqrt(math.div($stiffness, $mass));
|
|
142
|
+
$damping-ratio: _oc-spring-damping-ratio($parameters);
|
|
143
|
+
$displacement: -1;
|
|
144
|
+
|
|
145
|
+
@if $damping-ratio < 1 {
|
|
146
|
+
$damped-frequency: $angular-frequency * math.sqrt(1 - $damping-ratio * $damping-ratio);
|
|
147
|
+
$velocity-coefficient: math.div($initial-velocity + $damping-ratio * $angular-frequency * $displacement, $damped-frequency);
|
|
148
|
+
|
|
149
|
+
@return 1 + math.pow(math.$e, -$damping-ratio * $angular-frequency * $time) * ($displacement * math.cos($damped-frequency * $time) + $velocity-coefficient * math.sin($damped-frequency * $time));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@if math.abs($damping-ratio - 1) < 0.0001 {
|
|
153
|
+
$velocity-coefficient: $initial-velocity + $angular-frequency * $displacement;
|
|
154
|
+
|
|
155
|
+
@return 1 + ($displacement + $velocity-coefficient * $time) * math.pow(math.$e, -$angular-frequency * $time);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
$ratio-root: math.sqrt($damping-ratio * $damping-ratio - 1);
|
|
159
|
+
$root-a: -$angular-frequency * ($damping-ratio - $ratio-root);
|
|
160
|
+
$root-b: -$angular-frequency * ($damping-ratio + $ratio-root);
|
|
161
|
+
$coefficient-a: math.div($initial-velocity - $root-b * $displacement, $root-a - $root-b);
|
|
162
|
+
$coefficient-b: $displacement - $coefficient-a;
|
|
163
|
+
|
|
164
|
+
@return 1 + $coefficient-a * math.pow(math.$e, $root-a * $time) + $coefficient-b * math.pow(math.$e, $root-b * $time);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@function _oc-spring-settle-seconds($parameters, $initial-velocity, $epsilon, $stability-window, $max-duration) {
|
|
168
|
+
$epsilon: _oc-spring-positive-number($epsilon, 'epsilon');
|
|
169
|
+
$initial-velocity: _oc-spring-number($initial-velocity, 'initial-velocity');
|
|
170
|
+
$stability-seconds: _oc-spring-optional-seconds($stability-window, 'stability-window');
|
|
171
|
+
$max-seconds: _oc-spring-seconds($max-duration, 'max-duration');
|
|
172
|
+
$step-seconds: _oc-spring-seconds($oc-spring-time-step, 'time-step');
|
|
173
|
+
$stable-steps: math.max(1, math.ceil(math.div($stability-seconds, $step-seconds)));
|
|
174
|
+
$stable-count: 0;
|
|
175
|
+
$max-steps: math.ceil(math.div($max-seconds, $step-seconds));
|
|
176
|
+
|
|
177
|
+
@for $step from 0 through $max-steps {
|
|
178
|
+
$time: $step * $step-seconds;
|
|
179
|
+
$value: _oc-spring-value($time, $parameters, $initial-velocity);
|
|
180
|
+
$next-value: _oc-spring-value($time + $step-seconds, $parameters, $initial-velocity);
|
|
181
|
+
|
|
182
|
+
@if math.abs($value - 1) < $epsilon and math.abs($next-value - $value) < $epsilon {
|
|
183
|
+
$stable-count: $stable-count + 1;
|
|
184
|
+
|
|
185
|
+
@if $stable-count >= $stable-steps {
|
|
186
|
+
@return math.max(0, $time - $stability-seconds);
|
|
187
|
+
}
|
|
188
|
+
} @else {
|
|
189
|
+
$stable-count: 0;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@error 'Spring did not settle within #{$max-duration}.';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@function _oc-spring-sample-count($samples, $parameters, $settle-seconds) {
|
|
197
|
+
@if $samples != auto {
|
|
198
|
+
$samples: _oc-spring-number($samples, 'samples');
|
|
199
|
+
|
|
200
|
+
@if math.round($samples) != $samples or $samples < 2 {
|
|
201
|
+
@error 'samples must be an integer greater than or equal to 2.';
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@return $samples;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
$response-duration: _oc-spring-natural-response-duration($parameters);
|
|
208
|
+
$duration-scale: math.max(1, math.div($settle-seconds, $response-duration));
|
|
209
|
+
|
|
210
|
+
@return math.min($oc-spring-max-samples, math.ceil($oc-spring-samples-per-response * $duration-scale));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@function _oc-spring-model($duration, $preset, $extra-bounce, $bounce, $mass, $stiffness, $damping, $initial-velocity, $epsilon, $stability-window, $max-duration) {
|
|
214
|
+
$parameters: _oc-spring-resolve-parameters($duration, $preset, $extra-bounce, $bounce, $mass, $stiffness, $damping);
|
|
215
|
+
$settle-seconds: _oc-spring-settle-seconds($parameters, $initial-velocity, $epsilon, $stability-window, $max-duration);
|
|
216
|
+
|
|
217
|
+
@return (parameters: $parameters, settle-seconds: $settle-seconds);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@function oc-spring-timing($duration: null, $preset: smooth, $extra-bounce: 0, $bounce: null, $mass: null, $stiffness: null, $damping: null, $initial-velocity: 0, $epsilon: $oc-spring-epsilon, $stability-window: $oc-spring-stability-window, $max-duration: $oc-spring-max-duration, $samples: auto) {
|
|
221
|
+
$model: _oc-spring-model($duration, $preset, $extra-bounce, $bounce, $mass, $stiffness, $damping, $initial-velocity, $epsilon, $stability-window, $max-duration);
|
|
222
|
+
$parameters: map.get($model, parameters);
|
|
223
|
+
$settle-seconds: map.get($model, settle-seconds);
|
|
224
|
+
$sample-count: _oc-spring-sample-count($samples, $parameters, $settle-seconds);
|
|
225
|
+
$segments: '';
|
|
226
|
+
|
|
227
|
+
@for $index from 0 through $sample-count {
|
|
228
|
+
$offset: math.div($index, $sample-count);
|
|
229
|
+
$value: _oc-spring-value($settle-seconds * $offset, $parameters, $initial-velocity);
|
|
230
|
+
|
|
231
|
+
@if $index == 0 {
|
|
232
|
+
$value: 0;
|
|
233
|
+
} @else if $index == $sample-count {
|
|
234
|
+
$value: 1;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
$segment: '#{_oc-spring-round($value, 4)} #{_oc-spring-round($offset * 100, 2)}%';
|
|
238
|
+
|
|
239
|
+
@if $segments == '' {
|
|
240
|
+
$segments: $segment;
|
|
241
|
+
} @else {
|
|
242
|
+
$segments: '#{$segments}, #{$segment}';
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@return string.unquote('linear(#{$segments})');
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@function oc-spring-settle-duration($duration: null, $preset: smooth, $extra-bounce: 0, $bounce: null, $mass: null, $stiffness: null, $damping: null, $initial-velocity: 0, $epsilon: $oc-spring-epsilon, $stability-window: $oc-spring-stability-window, $max-duration: $oc-spring-max-duration) {
|
|
250
|
+
$model: _oc-spring-model($duration, $preset, $extra-bounce, $bounce, $mass, $stiffness, $damping, $initial-velocity, $epsilon, $stability-window, $max-duration);
|
|
251
|
+
|
|
252
|
+
@return _oc-spring-round(map.get($model, settle-seconds), 4) * 1s;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@function oc-spring-duration-scale($duration, $preset: smooth, $extra-bounce: 0, $bounce: null, $initial-velocity: 0, $epsilon: $oc-spring-epsilon, $stability-window: $oc-spring-stability-window, $max-duration: $oc-spring-max-duration) {
|
|
256
|
+
$duration-seconds: _oc-spring-seconds($duration, 'duration');
|
|
257
|
+
$settle-duration: oc-spring-settle-duration($duration, $preset, $extra-bounce, $bounce, $initial-velocity: $initial-velocity, $epsilon: $epsilon, $stability-window: $stability-window, $max-duration: $max-duration);
|
|
258
|
+
|
|
259
|
+
@return _oc-spring-round(math.div(math.div($settle-duration, 1s), $duration-seconds), 4);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@function _oc-spring-transition-options($duration: null, $preset: smooth, $extra-bounce: 0, $bounce: null, $mass: null, $stiffness: null, $damping: null, $initial-velocity: 0, $delay: null, $epsilon: $oc-spring-epsilon, $stability-window: $oc-spring-stability-window, $max-duration: $oc-spring-max-duration, $samples: auto) {
|
|
263
|
+
$options: ();
|
|
264
|
+
$options: map.set($options, duration, $duration);
|
|
265
|
+
$options: map.set($options, preset, $preset);
|
|
266
|
+
$options: map.set($options, extra-bounce, $extra-bounce);
|
|
267
|
+
$options: map.set($options, bounce, $bounce);
|
|
268
|
+
$options: map.set($options, mass, $mass);
|
|
269
|
+
$options: map.set($options, stiffness, $stiffness);
|
|
270
|
+
$options: map.set($options, damping, $damping);
|
|
271
|
+
$options: map.set($options, initial-velocity, $initial-velocity);
|
|
272
|
+
$options: map.set($options, delay, $delay);
|
|
273
|
+
$options: map.set($options, epsilon, $epsilon);
|
|
274
|
+
$options: map.set($options, stability-window, $stability-window);
|
|
275
|
+
$options: map.set($options, max-duration, $max-duration);
|
|
276
|
+
$options: map.set($options, samples, $samples);
|
|
277
|
+
|
|
278
|
+
@return $options;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@function _oc-spring-transition-item($property, $options) {
|
|
282
|
+
$duration: map.get($options, duration);
|
|
283
|
+
$preset: map.get($options, preset);
|
|
284
|
+
$extra-bounce: map.get($options, extra-bounce);
|
|
285
|
+
$bounce: map.get($options, bounce);
|
|
286
|
+
$mass: map.get($options, mass);
|
|
287
|
+
$stiffness: map.get($options, stiffness);
|
|
288
|
+
$damping: map.get($options, damping);
|
|
289
|
+
$initial-velocity: map.get($options, initial-velocity);
|
|
290
|
+
$delay: map.get($options, delay);
|
|
291
|
+
$epsilon: map.get($options, epsilon);
|
|
292
|
+
$stability-window: map.get($options, stability-window);
|
|
293
|
+
$max-duration: map.get($options, max-duration);
|
|
294
|
+
$samples: map.get($options, samples);
|
|
295
|
+
$settle-duration: oc-spring-settle-duration($duration, $preset, $extra-bounce, $bounce, $mass, $stiffness, $damping, $initial-velocity, $epsilon, $stability-window, $max-duration);
|
|
296
|
+
$timing: oc-spring-timing($duration, $preset, $extra-bounce, $bounce, $mass, $stiffness, $damping, $initial-velocity, $epsilon, $stability-window, $max-duration, $samples);
|
|
297
|
+
|
|
298
|
+
@if $delay == null {
|
|
299
|
+
@return string.unquote('#{$property} #{$settle-duration} #{$timing}');
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
@return string.unquote('#{$property} #{$settle-duration} #{$timing} #{$delay}');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@function _oc-spring-validate-config-map($base-options, $config) {
|
|
306
|
+
@if list.length($config) == 0 {
|
|
307
|
+
@error 'oc-spring property config map must not be empty.';
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
@each $key, $value in $config {
|
|
311
|
+
@if not map.has-key($base-options, $key) {
|
|
312
|
+
@error 'Unknown oc-spring property config key: #{$key}.';
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@return $config;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
@function _oc-spring-options-from-config-map($base-options, $config) {
|
|
320
|
+
$config: _oc-spring-validate-config-map($base-options, $config);
|
|
321
|
+
$options: $base-options;
|
|
322
|
+
|
|
323
|
+
@each $key, $value in $config {
|
|
324
|
+
$options: map.set($options, $key, $value);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
@return $options;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
@function _oc-spring-options-from-config-list($base-options, $config) {
|
|
331
|
+
$length: list.length($config);
|
|
332
|
+
|
|
333
|
+
@if $length == 0 {
|
|
334
|
+
@error 'oc-spring property config tuple must not be empty.';
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
@if $length > 5 {
|
|
338
|
+
@error 'oc-spring property config tuple accepts up to 5 values: duration, preset, extra-bounce, delay, samples.';
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
$options: $base-options;
|
|
342
|
+
$keys: duration, preset, extra-bounce, delay, samples;
|
|
343
|
+
|
|
344
|
+
@for $index from 1 through $length {
|
|
345
|
+
$options: map.set($options, list.nth($keys, $index), list.nth($config, $index));
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@return $options;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
@function _oc-spring-options-from-config($base-options, $config) {
|
|
352
|
+
@if meta.type-of($config) == 'map' {
|
|
353
|
+
@return _oc-spring-options-from-config-map($base-options, $config);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
@if meta.type-of($config) == 'list' {
|
|
357
|
+
@return _oc-spring-options-from-config-list($base-options, $config);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@error 'oc-spring property config must be a tuple or map.';
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
@function oc-spring($property, $duration: null, $preset: smooth, $extra-bounce: 0, $bounce: null, $mass: null, $stiffness: null, $damping: null, $initial-velocity: 0, $delay: null, $epsilon: $oc-spring-epsilon, $stability-window: $oc-spring-stability-window, $max-duration: $oc-spring-max-duration, $samples: auto) {
|
|
364
|
+
$base-options: _oc-spring-transition-options($duration, $preset, $extra-bounce, $bounce, $mass, $stiffness, $damping, $initial-velocity, $delay, $epsilon, $stability-window, $max-duration, $samples);
|
|
365
|
+
|
|
366
|
+
@if meta.type-of($property) == 'map' {
|
|
367
|
+
@if list.length($property) == 0 {
|
|
368
|
+
@error 'oc-spring property map must not be empty.';
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
$transitions: ();
|
|
372
|
+
|
|
373
|
+
@each $item-property, $config in $property {
|
|
374
|
+
$item-options: _oc-spring-options-from-config($base-options, $config);
|
|
375
|
+
$transitions: list.append($transitions, _oc-spring-transition-item($item-property, $item-options), $separator: comma);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
@return $transitions;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@if meta.type-of($property) == 'list' {
|
|
382
|
+
@if list.length($property) == 0 {
|
|
383
|
+
@error 'oc-spring property list must not be empty.';
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
$transitions: ();
|
|
387
|
+
|
|
388
|
+
@each $item-property in $property {
|
|
389
|
+
$transitions: list.append($transitions, _oc-spring-transition-item($item-property, $base-options), $separator: comma);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
@return $transitions;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
@return _oc-spring-transition-item($property, $base-options);
|
|
396
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { compileString } from 'sass';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
describe('spring utilities', () => {
|
|
5
|
+
const compileSpring = (scss: string) =>
|
|
6
|
+
compileString(
|
|
7
|
+
`
|
|
8
|
+
@use 'spring' as *;
|
|
9
|
+
|
|
10
|
+
${scss}
|
|
11
|
+
`,
|
|
12
|
+
{
|
|
13
|
+
loadPaths: ['src/scss'],
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
it('emits a transition item with corrected settling duration', () => {
|
|
18
|
+
const result = compileSpring(`
|
|
19
|
+
.target {
|
|
20
|
+
transition: oc-spring(transform, 0.5s, bouncy, $samples: 8);
|
|
21
|
+
}
|
|
22
|
+
`);
|
|
23
|
+
|
|
24
|
+
expect(result.css).toContain('transition: transform 0.932s linear(');
|
|
25
|
+
expect(result.css).toContain('100%');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('accepts CSS transition-like positional extra bounce', () => {
|
|
29
|
+
const result = compileSpring(`
|
|
30
|
+
.target {
|
|
31
|
+
transition: oc-spring(transform, 0.5s, snappy, 0.1, $samples: 8);
|
|
32
|
+
}
|
|
33
|
+
`);
|
|
34
|
+
|
|
35
|
+
expect(result.css).toContain('transition: transform');
|
|
36
|
+
expect(result.css).toContain('linear(');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('supports custom bounce and physical springs', () => {
|
|
40
|
+
const result = compileSpring(`
|
|
41
|
+
.target {
|
|
42
|
+
transition:
|
|
43
|
+
oc-spring(transform, 0.6s, $bounce: 0.2, $samples: 8),
|
|
44
|
+
oc-spring(opacity, $mass: 1, $stiffness: 100, $damping: 10, $samples: 8);
|
|
45
|
+
}
|
|
46
|
+
`);
|
|
47
|
+
|
|
48
|
+
expect(result.css).toContain('transition: transform');
|
|
49
|
+
expect(result.css).toContain('opacity');
|
|
50
|
+
expect(result.css).toContain('linear(');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('emits transition lists for multiple properties with shared spring options', () => {
|
|
54
|
+
const result = compileSpring(`
|
|
55
|
+
.target {
|
|
56
|
+
transition: oc-spring((opacity, transform), 0.3s, snappy, $samples: 8);
|
|
57
|
+
}
|
|
58
|
+
`);
|
|
59
|
+
|
|
60
|
+
expect(result.css).toContain('transition: opacity 0.489s linear(');
|
|
61
|
+
expect(result.css).toContain(', transform 0.489s linear(');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('emits transition lists with property-specific spring options', () => {
|
|
65
|
+
const result = compileSpring(`
|
|
66
|
+
.target {
|
|
67
|
+
transition: oc-spring((
|
|
68
|
+
opacity: (0.2s, snappy),
|
|
69
|
+
transform: (0.3s, snappy, 0.1),
|
|
70
|
+
), $samples: 8);
|
|
71
|
+
}
|
|
72
|
+
`);
|
|
73
|
+
|
|
74
|
+
expect(result.css).toContain('transition: opacity');
|
|
75
|
+
expect(result.css).toContain(', transform');
|
|
76
|
+
expect(result.css).toContain('0.326s');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('supports named property config maps for advanced options', () => {
|
|
80
|
+
const result = compileSpring(`
|
|
81
|
+
.target {
|
|
82
|
+
transition: oc-spring((
|
|
83
|
+
opacity: (duration: 0.2s, preset: snappy, delay: 50ms, samples: 8),
|
|
84
|
+
transform: (mass: 1, stiffness: 100, damping: 10, samples: 8),
|
|
85
|
+
));
|
|
86
|
+
}
|
|
87
|
+
`);
|
|
88
|
+
|
|
89
|
+
expect(result.css).toContain('opacity');
|
|
90
|
+
expect(result.css).toContain('50ms');
|
|
91
|
+
expect(result.css).toContain('transform');
|
|
92
|
+
expect(result.css).toContain('linear(');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('rejects unknown property config keys', () => {
|
|
96
|
+
expect(() =>
|
|
97
|
+
compileSpring(`
|
|
98
|
+
.target {
|
|
99
|
+
transition: oc-spring((opacity: (duration: 0.2s, easing: snappy)));
|
|
100
|
+
}
|
|
101
|
+
`),
|
|
102
|
+
).toThrow('Unknown oc-spring property config key: easing.');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('rejects overlong property config tuples', () => {
|
|
106
|
+
expect(() =>
|
|
107
|
+
compileSpring(`
|
|
108
|
+
.target {
|
|
109
|
+
transition: oc-spring((opacity: (0.2s, snappy, 0.1, 50ms, 8, extra)));
|
|
110
|
+
}
|
|
111
|
+
`),
|
|
112
|
+
).toThrow('oc-spring property config tuple accepts up to 5 values');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('exposes timing and duration escape hatches', () => {
|
|
116
|
+
const result = compileSpring(`
|
|
117
|
+
.target {
|
|
118
|
+
transition-duration: oc-spring-settle-duration(0.5s, snappy);
|
|
119
|
+
transition-timing-function: oc-spring-timing(0.5s, snappy, $samples: 8);
|
|
120
|
+
--scale: #{oc-spring-duration-scale(0.5s, snappy)};
|
|
121
|
+
}
|
|
122
|
+
`);
|
|
123
|
+
|
|
124
|
+
expect(result.css).toContain('transition-duration: 0.815s;');
|
|
125
|
+
expect(result.css).toContain('transition-timing-function: linear(');
|
|
126
|
+
expect(result.css).toContain('--scale: 1.63;');
|
|
127
|
+
});
|
|
128
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use './breakpoint' as *;
|
|
4
|
+
@use './utils' as *;
|
|
5
|
+
|
|
6
|
+
@mixin typo($variant, $weight: normal) {
|
|
7
|
+
font-size: calc(var(--oc-typo-size-#{$variant}) * var(--oc-typo-scale, 1));
|
|
8
|
+
line-height: calc(var(--oc-typo-height-#{$variant}) * var(--oc-typo-scale, 1));
|
|
9
|
+
letter-spacing: var(--oc-typo-spacing-#{$variant});
|
|
10
|
+
|
|
11
|
+
@if $weight == normal {
|
|
12
|
+
font-weight: var(--oc-typo-weight-#{$variant}-normal);
|
|
13
|
+
} @else if $weight == bold {
|
|
14
|
+
font-weight: var(--oc-typo-weight-#{$variant}-bold);
|
|
15
|
+
} @else if $weight == medium {
|
|
16
|
+
font-weight: var(--oc-typo-weight-#{$variant}-medium);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@mixin typo-responsive($var-name, $config) {
|
|
21
|
+
@if map.has-key($config, default) {
|
|
22
|
+
--oc-#{$var-name}: #{toRem(map.get($config, default))};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@each $key, $value in $config {
|
|
26
|
+
@if $key != default {
|
|
27
|
+
$from: list.nth($value, 1);
|
|
28
|
+
$to: list.nth($value, 2);
|
|
29
|
+
$basis: list.nth($value, 3);
|
|
30
|
+
$anchor: to;
|
|
31
|
+
|
|
32
|
+
@if list.length($value) >= 4 {
|
|
33
|
+
$anchor: list.nth($value, 4);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$clamp: fluidClamp(toRem($from), $basis, $anchor, toRem($to));
|
|
37
|
+
|
|
38
|
+
@if $key == sm {
|
|
39
|
+
@include respond-to(sm) {
|
|
40
|
+
--oc-#{$var-name}: #{$clamp};
|
|
41
|
+
}
|
|
42
|
+
} @else if $key == md {
|
|
43
|
+
@include respond-to(md) {
|
|
44
|
+
--oc-#{$var-name}: #{$clamp};
|
|
45
|
+
}
|
|
46
|
+
} @else if $key == min-md {
|
|
47
|
+
@include respond-to(min, md) {
|
|
48
|
+
--oc-#{$var-name}: #{$clamp};
|
|
49
|
+
}
|
|
50
|
+
} @else if $key == lg {
|
|
51
|
+
@include respond-to(lg) {
|
|
52
|
+
--oc-#{$var-name}: #{$clamp};
|
|
53
|
+
}
|
|
54
|
+
} @else if $key == xl {
|
|
55
|
+
@include respond-to(xl) {
|
|
56
|
+
--oc-#{$var-name}: #{$clamp};
|
|
57
|
+
}
|
|
58
|
+
} @else if $key == hg {
|
|
59
|
+
@include respond-to(hg) {
|
|
60
|
+
--oc-#{$var-name}: #{$clamp};
|
|
61
|
+
}
|
|
62
|
+
} @else {
|
|
63
|
+
@warn "typo-responsive: '#{$key}' 는 지원하지 않는 breakpoint 키. 허용: sm, md, min-md, lg, xl, hg, default";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { compileString } from 'sass';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
describe('typo-responsive mixin', () => {
|
|
5
|
+
it('adds the oc prefix automatically', () => {
|
|
6
|
+
const result = compileString(
|
|
7
|
+
`
|
|
8
|
+
@use 'typo' as *;
|
|
9
|
+
@use 'breakpoint' as *;
|
|
10
|
+
|
|
11
|
+
:root {
|
|
12
|
+
@include typo-responsive(typo-size-heading2, (
|
|
13
|
+
default: 20,
|
|
14
|
+
md: (20, 20, 375),
|
|
15
|
+
min-md: (20, 22, $breakpoint-lg),
|
|
16
|
+
));
|
|
17
|
+
}
|
|
18
|
+
`,
|
|
19
|
+
{
|
|
20
|
+
loadPaths: ['src/scss/mixins'],
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
expect(result.css).toContain('--oc-typo-size-heading2: 1.25rem;');
|
|
25
|
+
expect(result.css).toContain('@media screen and (max-width: 768px)');
|
|
26
|
+
expect(result.css).toContain('@media screen and (min-width: 769px)');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
$rem-unit: 16;
|
|
4
|
+
|
|
5
|
+
@function toRem($px) {
|
|
6
|
+
@return math.div($px, $rem-unit) * 1rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function stripUnit($value) {
|
|
10
|
+
@if math.is-unitless($value) {
|
|
11
|
+
@return $value;
|
|
12
|
+
}
|
|
13
|
+
@return math.div($value, ($value * 0 + 1));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@function fluidClamp($from, $bp, $anchor: to, $to) {
|
|
17
|
+
$basis: $to;
|
|
18
|
+
@if $anchor == from {
|
|
19
|
+
$basis: $from;
|
|
20
|
+
}
|
|
21
|
+
$basis-num: stripUnit($basis);
|
|
22
|
+
$bp-num: stripUnit($bp);
|
|
23
|
+
$basis-px: $basis-num * $rem-unit;
|
|
24
|
+
|
|
25
|
+
@return clamp(#{$from}, calc(#{$basis-px} / #{$bp-num} * 100vw), #{$to});
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward './mixins/spring';
|