@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,336 @@
|
|
|
1
|
+
import { compileString } from 'sass';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
describe('motion utilities', () => {
|
|
5
|
+
const compileMotion = (scss: string) =>
|
|
6
|
+
compileString(
|
|
7
|
+
`
|
|
8
|
+
@use 'mixins/motion' as *;
|
|
9
|
+
|
|
10
|
+
${scss}
|
|
11
|
+
`,
|
|
12
|
+
{
|
|
13
|
+
loadPaths: ['src/scss'],
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
it('emits transition items for semantic intent and pace', () => {
|
|
18
|
+
const result = compileMotion(`
|
|
19
|
+
.target {
|
|
20
|
+
transition: oc-motion((background-color, color, box-shadow), feedback, $pace: quick);
|
|
21
|
+
}
|
|
22
|
+
`);
|
|
23
|
+
|
|
24
|
+
expect(result.css).toContain(
|
|
25
|
+
'background-color calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-scale) * var(--oc-motion-pace-quick) * 1) var(--oc-motion-timing-feedback)',
|
|
26
|
+
);
|
|
27
|
+
expect(result.css).toContain(
|
|
28
|
+
'color calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-scale) * var(--oc-motion-pace-quick) * 1) var(--oc-motion-timing-feedback)',
|
|
29
|
+
);
|
|
30
|
+
expect(result.css).toContain(
|
|
31
|
+
'box-shadow calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-scale) * var(--oc-motion-pace-quick) * 1) var(--oc-motion-timing-feedback)',
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('keeps numeric duration scale separate from pace', () => {
|
|
36
|
+
const result = compileMotion(`
|
|
37
|
+
.target {
|
|
38
|
+
transition: oc-motion(opacity, feedback, $pace: slow, $duration-scale: 0.9);
|
|
39
|
+
}
|
|
40
|
+
`);
|
|
41
|
+
|
|
42
|
+
expect(result.css).toContain(
|
|
43
|
+
'opacity calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-scale) * var(--oc-motion-pace-slow) * 0.9) var(--oc-motion-timing-feedback)',
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('scales transform amplitude through motion scale tokens', () => {
|
|
48
|
+
const result = compileMotion(`
|
|
49
|
+
.feedback {
|
|
50
|
+
transform: scale(oc-motion-scale(0.95, feedback));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.reveal {
|
|
54
|
+
transform: scale(oc-motion-scale(var(--local-scale), reveal));
|
|
55
|
+
}
|
|
56
|
+
`);
|
|
57
|
+
|
|
58
|
+
expect(result.css).toContain(
|
|
59
|
+
'transform: scale(max(0, 1 + (0.95 - 1) * var(--oc-motion-scale-feedback)))',
|
|
60
|
+
);
|
|
61
|
+
expect(result.css).toContain(
|
|
62
|
+
'transform: scale(max(0, 1 + (var(--local-scale) - 1) * var(--oc-motion-scale-reveal)))',
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('scales transform distance through motion distance tokens', () => {
|
|
67
|
+
const result = compileMotion(`
|
|
68
|
+
.reveal {
|
|
69
|
+
transform: translateY(oc-motion-distance(-1rem, reveal));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.reject {
|
|
73
|
+
transform: translateX(oc-motion-distance(var(--local-distance), reject));
|
|
74
|
+
}
|
|
75
|
+
`);
|
|
76
|
+
|
|
77
|
+
expect(result.css).toContain(
|
|
78
|
+
'transform: translateY(calc(-1rem * var(--oc-motion-distance-scale-reveal)))',
|
|
79
|
+
);
|
|
80
|
+
expect(result.css).toContain(
|
|
81
|
+
'transform: translateX(calc(var(--local-distance) * var(--oc-motion-distance-scale-reject)))',
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('accepts a CSS duration token for non-spring motion', () => {
|
|
86
|
+
const result = compileMotion(`
|
|
87
|
+
.target {
|
|
88
|
+
@include oc-motion(opacity, feedback, $duration-token: var(--local-feedback-time));
|
|
89
|
+
}
|
|
90
|
+
`);
|
|
91
|
+
|
|
92
|
+
expect(result.css).toContain(
|
|
93
|
+
'opacity calc(var(--local-feedback-time) * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-feedback)',
|
|
94
|
+
);
|
|
95
|
+
expect(result.css).toContain(
|
|
96
|
+
'transition-duration: calc(var(--local-feedback-time) * var(--oc-motion-duration-scale-reduced) * var(--oc-motion-pace-normal) * 1);',
|
|
97
|
+
);
|
|
98
|
+
expect(result.css).toContain(
|
|
99
|
+
'transition-timing-function: var(--oc-motion-timing-feedback);',
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('uses smooth opacity and snappy transform for reveal motion', () => {
|
|
104
|
+
const result = compileMotion(`
|
|
105
|
+
.target {
|
|
106
|
+
transition: oc-motion((opacity, transform), reveal);
|
|
107
|
+
}
|
|
108
|
+
`);
|
|
109
|
+
|
|
110
|
+
expect(result.css).toContain(
|
|
111
|
+
'transition: opacity calc(0.561s * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) linear(',
|
|
112
|
+
);
|
|
113
|
+
expect(result.css).toContain(
|
|
114
|
+
', transform calc(0.58s * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) linear(',
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('uses spring timing for reject feedback motion', () => {
|
|
119
|
+
const result = compileMotion(`
|
|
120
|
+
.target {
|
|
121
|
+
transition: oc-motion(transform, reject);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.exit {
|
|
125
|
+
transition: oc-motion(transform, reject, $phase: exit);
|
|
126
|
+
}
|
|
127
|
+
`);
|
|
128
|
+
|
|
129
|
+
expect(result.css).toContain('.target {\n transition: transform calc(');
|
|
130
|
+
expect(result.css).toContain(
|
|
131
|
+
' * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) linear(',
|
|
132
|
+
);
|
|
133
|
+
expect(result.css).toContain(
|
|
134
|
+
'.exit {\n transition: transform calc(var(--oc-motion-duration-reject) * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-reject);',
|
|
135
|
+
);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('uses snappy spring timing for feedback settle motion', () => {
|
|
139
|
+
const result = compileMotion(`
|
|
140
|
+
.target {
|
|
141
|
+
transition: oc-motion(transform, feedback, $phase: settle);
|
|
142
|
+
}
|
|
143
|
+
`);
|
|
144
|
+
|
|
145
|
+
expect(result.css).toContain(
|
|
146
|
+
'transform calc(0.326s * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) linear(',
|
|
147
|
+
);
|
|
148
|
+
expect(result.css).not.toContain('var(--oc-motion-duration-feedback)');
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('keeps gesture settle on the token easing path', () => {
|
|
152
|
+
const result = compileMotion(`
|
|
153
|
+
.target {
|
|
154
|
+
transition: oc-motion(transform, gesture, $phase: settle);
|
|
155
|
+
}
|
|
156
|
+
`);
|
|
157
|
+
|
|
158
|
+
expect(result.css).toContain(
|
|
159
|
+
'transform calc(var(--oc-motion-duration-gesture-settle) * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-gesture-settle)',
|
|
160
|
+
);
|
|
161
|
+
expect(result.css).not.toContain('linear(');
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('applies runtime duration scale and pace tokens to spring-backed motion duration', () => {
|
|
165
|
+
const result = compileMotion(`
|
|
166
|
+
.target {
|
|
167
|
+
transition: oc-motion(transform, reveal, $pace: slow, $duration-scale: 0.9);
|
|
168
|
+
}
|
|
169
|
+
`);
|
|
170
|
+
|
|
171
|
+
expect(result.css).toContain(
|
|
172
|
+
'transform calc(0.58s * var(--oc-motion-duration-scale) * var(--oc-motion-pace-slow) * 0.9) linear(',
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it('uses smooth spring for reveal exit motion', () => {
|
|
177
|
+
const result = compileMotion(`
|
|
178
|
+
.target {
|
|
179
|
+
transition: oc-motion((opacity, transform), reveal, $phase: exit);
|
|
180
|
+
}
|
|
181
|
+
`);
|
|
182
|
+
|
|
183
|
+
expect(result.css).toContain(
|
|
184
|
+
'opacity calc(0.233s * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) linear(',
|
|
185
|
+
);
|
|
186
|
+
expect(result.css).toContain(
|
|
187
|
+
', transform calc(0.233s * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) linear(',
|
|
188
|
+
);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('emits reduced motion policy from the mixin', () => {
|
|
192
|
+
const result = compileMotion(`
|
|
193
|
+
.target {
|
|
194
|
+
@include oc-motion((opacity, transform), reveal);
|
|
195
|
+
}
|
|
196
|
+
`);
|
|
197
|
+
|
|
198
|
+
expect(result.css).toContain(
|
|
199
|
+
'transition: opacity calc(0.561s * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) linear(',
|
|
200
|
+
);
|
|
201
|
+
expect(result.css).toContain(
|
|
202
|
+
', transform calc(0.58s * var(--oc-motion-duration-scale) * var(--oc-motion-pace-normal) * 1) linear(',
|
|
203
|
+
);
|
|
204
|
+
expect(result.css).toContain('@media (prefers-reduced-motion: reduce)');
|
|
205
|
+
expect(result.css).toContain('transition-property: opacity;');
|
|
206
|
+
expect(result.css).toContain(
|
|
207
|
+
'transition-duration: calc(var(--oc-motion-duration-reveal) * var(--oc-motion-duration-scale-reduced) * var(--oc-motion-pace-normal) * 1);',
|
|
208
|
+
);
|
|
209
|
+
expect(result.css).toContain(
|
|
210
|
+
'transition-timing-function: var(--oc-motion-timing-reveal);',
|
|
211
|
+
);
|
|
212
|
+
expect(result.css).toContain('transform: none;');
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it('preserves spatial motion when explicitly requested', () => {
|
|
216
|
+
const result = compileMotion(`
|
|
217
|
+
.target {
|
|
218
|
+
@include oc-motion(transform, move, $reduced: preserve);
|
|
219
|
+
}
|
|
220
|
+
`);
|
|
221
|
+
|
|
222
|
+
const reducedCss = result.css.slice(
|
|
223
|
+
result.css.indexOf('@media (prefers-reduced-motion: reduce)'),
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
expect(reducedCss).toContain(
|
|
227
|
+
'transition-duration: calc(var(--oc-motion-duration-move) * var(--oc-motion-duration-scale-preserve) * var(--oc-motion-pace-normal) * 1);',
|
|
228
|
+
);
|
|
229
|
+
expect(reducedCss).toContain(
|
|
230
|
+
'transition-timing-function: var(--oc-motion-timing-move);',
|
|
231
|
+
);
|
|
232
|
+
expect(reducedCss).not.toContain('transform: none;');
|
|
233
|
+
expect(reducedCss).not.toContain('transition: none;');
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('removes reduced feedback motion when no feedback-safe property remains', () => {
|
|
237
|
+
const result = compileMotion(`
|
|
238
|
+
.target {
|
|
239
|
+
@include oc-motion(transform, feedback);
|
|
240
|
+
}
|
|
241
|
+
`);
|
|
242
|
+
|
|
243
|
+
const reducedCss = result.css.slice(
|
|
244
|
+
result.css.indexOf('@media (prefers-reduced-motion: reduce)'),
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
expect(reducedCss).toContain('transition: none;');
|
|
248
|
+
expect(reducedCss).toContain('transform: none;');
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it('does not emit reduced-motion media for function-only usage', () => {
|
|
252
|
+
const result = compileMotion(`
|
|
253
|
+
.target {
|
|
254
|
+
transition: oc-motion(opacity, feedback);
|
|
255
|
+
}
|
|
256
|
+
`);
|
|
257
|
+
|
|
258
|
+
expect(result.css).not.toContain('prefers-reduced-motion');
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it('rejects numeric pace values', () => {
|
|
262
|
+
expect(() =>
|
|
263
|
+
compileMotion(`
|
|
264
|
+
.target {
|
|
265
|
+
transition: oc-motion(opacity, feedback, $pace: 0.85);
|
|
266
|
+
}
|
|
267
|
+
`),
|
|
268
|
+
).toThrow('Unknown oc-motion pace: 0.85. Use quick, normal, or slow.');
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it('rejects negative duration scale values', () => {
|
|
272
|
+
expect(() =>
|
|
273
|
+
compileMotion(`
|
|
274
|
+
.target {
|
|
275
|
+
transition: oc-motion(opacity, feedback, $duration-scale: -0.1);
|
|
276
|
+
}
|
|
277
|
+
`),
|
|
278
|
+
).toThrow('oc-motion $duration-scale must be greater than or equal to 0.');
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
it('rejects unit scale values', () => {
|
|
282
|
+
expect(() =>
|
|
283
|
+
compileMotion(`
|
|
284
|
+
.target {
|
|
285
|
+
transform: scale(oc-motion-scale(95%, feedback));
|
|
286
|
+
}
|
|
287
|
+
`),
|
|
288
|
+
).toThrow('oc-motion-scale $scale must be a unitless number.');
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it('rejects negative scale values', () => {
|
|
292
|
+
expect(() =>
|
|
293
|
+
compileMotion(`
|
|
294
|
+
.target {
|
|
295
|
+
transform: scale(oc-motion-scale(-0.1, feedback));
|
|
296
|
+
}
|
|
297
|
+
`),
|
|
298
|
+
).toThrow('oc-motion-scale $scale must be greater than or equal to 0.');
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
it('rejects unknown phase values', () => {
|
|
302
|
+
expect(() =>
|
|
303
|
+
compileMotion(`
|
|
304
|
+
.target {
|
|
305
|
+
transition: oc-motion(opacity, reveal, $phase: leave);
|
|
306
|
+
}
|
|
307
|
+
`),
|
|
308
|
+
).toThrow(
|
|
309
|
+
'Unknown oc-motion phase: leave. Use change, enter, exit, settle, or loop.',
|
|
310
|
+
);
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
it('rejects duration token overrides for spring-backed motion', () => {
|
|
314
|
+
expect(() =>
|
|
315
|
+
compileMotion(`
|
|
316
|
+
.target {
|
|
317
|
+
transition: oc-motion(opacity, reveal, $duration-token: var(--local-reveal-time));
|
|
318
|
+
}
|
|
319
|
+
`),
|
|
320
|
+
).toThrow(
|
|
321
|
+
'oc-motion $duration-token is not supported for spring-backed motion.',
|
|
322
|
+
);
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
it('rejects unknown reduced policies', () => {
|
|
326
|
+
expect(() =>
|
|
327
|
+
compileMotion(`
|
|
328
|
+
.target {
|
|
329
|
+
@include oc-motion(opacity, feedback, $reduced: shrink);
|
|
330
|
+
}
|
|
331
|
+
`),
|
|
332
|
+
).toThrow(
|
|
333
|
+
'Unknown oc-motion reduced policy: shrink. Use auto, preserve, fade, static, or feedback.',
|
|
334
|
+
);
|
|
335
|
+
});
|
|
336
|
+
});
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:math';
|
|
4
|
+
@use 'sass:meta';
|
|
5
|
+
@use '../foundations/responsive.config' as *;
|
|
6
|
+
@use './breakpoint' as *;
|
|
7
|
+
@use './utils' as *;
|
|
8
|
+
|
|
9
|
+
$oc-responsive-stop-order: (min, sm, md, lg, xl, hg);
|
|
10
|
+
$oc-responsive-point-order: (min-sm, min-md, min-lg, min-xl, min-hg);
|
|
11
|
+
|
|
12
|
+
@function oc-responsive-active-stops($stops: null, $stops-name: '$oc-responsive-stops') {
|
|
13
|
+
$active-stops: $oc-responsive-stops;
|
|
14
|
+
$active-stops-name: '$oc-responsive-stops';
|
|
15
|
+
|
|
16
|
+
@if $stops != null {
|
|
17
|
+
$active-stops: $stops;
|
|
18
|
+
$active-stops-name: $stops-name;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@if list.length($active-stops) == 0 {
|
|
22
|
+
@error "#{$active-stops-name} must include at least one responsive stop.";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@return $active-stops;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@function oc-responsive-active-start($stops: null, $stops-name: '$oc-responsive-stops') {
|
|
29
|
+
$active-stops: oc-responsive-active-stops($stops, $stops-name);
|
|
30
|
+
|
|
31
|
+
@return list.nth($active-stops, 1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@function oc-responsive-active-end($stops: null, $stops-name: '$oc-responsive-stops') {
|
|
35
|
+
$active-stops: oc-responsive-active-stops($stops, $stops-name);
|
|
36
|
+
|
|
37
|
+
@return list.nth($active-stops, list.length($active-stops));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@function oc-responsive-static-stop($stops: null, $stops-name: '$oc-responsive-stops') {
|
|
41
|
+
@if $oc-responsive-static-stop != null {
|
|
42
|
+
@return $oc-responsive-static-stop;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@return oc-responsive-active-start($stops, $stops-name);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@function oc-responsive-stop-index($stop) {
|
|
49
|
+
$index: list.index($oc-responsive-stop-order, $stop);
|
|
50
|
+
|
|
51
|
+
@if $index == null {
|
|
52
|
+
@error "Unknown responsive stop '#{$stop}'.";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@return $index;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@function oc-responsive-token-has-stop($values, $stop) {
|
|
59
|
+
@return map.has-key($values, $stop) and map.get($values, $stop) != null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@function oc-responsive-clamp-stop($stop, $stops: null, $stops-name: '$oc-responsive-stops') {
|
|
63
|
+
$index: oc-responsive-stop-index($stop);
|
|
64
|
+
$active-start: oc-responsive-active-start($stops, $stops-name);
|
|
65
|
+
$active-end: oc-responsive-active-end($stops, $stops-name);
|
|
66
|
+
$start-index: oc-responsive-stop-index($active-start);
|
|
67
|
+
$end-index: oc-responsive-stop-index($active-end);
|
|
68
|
+
|
|
69
|
+
@if $index < $start-index {
|
|
70
|
+
@return $active-start;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@if $index > $end-index {
|
|
74
|
+
@return $active-end;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@return $stop;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@function oc-responsive-resolve-stop-value($values, $stop) {
|
|
81
|
+
@if oc-responsive-token-has-stop($values, $stop) {
|
|
82
|
+
@return map.get($values, $stop);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
$stop-index: oc-responsive-stop-index($stop);
|
|
86
|
+
|
|
87
|
+
@for $index from $stop-index through 1 {
|
|
88
|
+
$candidate: list.nth($oc-responsive-stop-order, $index);
|
|
89
|
+
|
|
90
|
+
@if oc-responsive-token-has-stop($values, $candidate) {
|
|
91
|
+
@return map.get($values, $candidate);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@for $index from $stop-index through list.length($oc-responsive-stop-order) {
|
|
96
|
+
$candidate: list.nth($oc-responsive-stop-order, $index);
|
|
97
|
+
|
|
98
|
+
@if oc-responsive-token-has-stop($values, $candidate) {
|
|
99
|
+
@return map.get($values, $candidate);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@error "Responsive token has no stop values.";
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@function oc-responsive-max-active-defined-stop($values, $stops: null, $stops-name: '$oc-responsive-stops', $token-name: null) {
|
|
107
|
+
$active-stops: oc-responsive-active-stops($stops, $stops-name);
|
|
108
|
+
$target-stop: null;
|
|
109
|
+
|
|
110
|
+
@each $stop in $active-stops {
|
|
111
|
+
@if oc-responsive-token-has-stop($values, $stop) {
|
|
112
|
+
$target-stop: $stop;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@if $target-stop == null {
|
|
117
|
+
@if $token-name != null {
|
|
118
|
+
@error "Responsive token '#{$token-name}' has no values in #{$stops-name}.";
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@error "Responsive token has no values in #{$stops-name}.";
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@return $target-stop;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@function oc-responsive-resolve-target-stop($values, $target, $stops: null, $stops-name: '$oc-responsive-stops', $token-name: null) {
|
|
128
|
+
@if $target == max-active-defined {
|
|
129
|
+
@return oc-responsive-max-active-defined-stop($values, $stops, $stops-name, $token-name);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@return $target;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@function oc-responsive-rem($value) {
|
|
136
|
+
@if meta.type-of($value) == 'number' and math.is-unitless($value) {
|
|
137
|
+
@return toRem($value);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@return $value;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@function oc-responsive-segment-value($values, $from-stop, $to-stop, $basis, $anchor: to, $stops: null, $stops-name: '$oc-responsive-stops') {
|
|
144
|
+
$effective-from-stop: oc-responsive-clamp-stop($from-stop, $stops, $stops-name);
|
|
145
|
+
$effective-to-stop: oc-responsive-clamp-stop($to-stop, $stops, $stops-name);
|
|
146
|
+
$from: oc-responsive-rem(oc-responsive-resolve-stop-value($values, $effective-from-stop));
|
|
147
|
+
$to: oc-responsive-rem(oc-responsive-resolve-stop-value($values, $effective-to-stop));
|
|
148
|
+
|
|
149
|
+
@if $oc-responsive-mode == static {
|
|
150
|
+
@return oc-responsive-rem(oc-responsive-resolve-stop-value($values, oc-responsive-static-stop($stops, $stops-name)));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@if $from == $to {
|
|
154
|
+
@return $to;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@if $oc-responsive-mode == fluid {
|
|
158
|
+
@return fluidClamp($from, $basis, $anchor, $to);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@error "Unknown responsive mode '#{$oc-responsive-mode}'.";
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@function oc-responsive-point-order-index($point-name) {
|
|
165
|
+
$index: list.index($oc-responsive-point-order, $point-name);
|
|
166
|
+
|
|
167
|
+
@if $index == null {
|
|
168
|
+
@error "Unknown responsive profile point '#{$point-name}'.";
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@return $index;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@function oc-responsive-point-media($point-name) {
|
|
175
|
+
@if meta.type-of($point-name) == 'list' and list.length($point-name) == 2 {
|
|
176
|
+
@return $point-name;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@if $point-name == min-sm {
|
|
180
|
+
@return (min, sm);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@if $point-name == min-md {
|
|
184
|
+
@return (min, md);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@if $point-name == min-lg {
|
|
188
|
+
@return (min, lg);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@if $point-name == min-xl {
|
|
192
|
+
@return (min, xl);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@if $point-name == min-hg {
|
|
196
|
+
@return (min, hg);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@error "Unknown responsive profile point '#{$point-name}'.";
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@mixin oc-responsive-media($media) {
|
|
203
|
+
@if meta.type-of($media) == 'list' and list.length($media) == 2 {
|
|
204
|
+
@include respond-to(list.nth($media, 1), list.nth($media, 2)) {
|
|
205
|
+
@content;
|
|
206
|
+
}
|
|
207
|
+
} @else {
|
|
208
|
+
@include respond-to($media) {
|
|
209
|
+
@content;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@mixin oc-emit-responsive-token-values($namespace, $tokens, $stop, $only: null) {
|
|
215
|
+
@each $token, $values in $tokens {
|
|
216
|
+
@if $only == null or list.index($only, $token) != null {
|
|
217
|
+
$target-stop: oc-responsive-resolve-target-stop($values, $stop, null, '$oc-responsive-stops', $token);
|
|
218
|
+
|
|
219
|
+
--oc-#{$namespace}-#{$token}: #{oc-responsive-rem(oc-responsive-resolve-stop-value($values, $target-stop))};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
@mixin oc-emit-stepped-point-responsive-token-values($namespace, $tokens, $target, $stops: null, $stops-name: '$oc-responsive-stops') {
|
|
225
|
+
@each $token, $values in $tokens {
|
|
226
|
+
$target-stop: oc-responsive-resolve-target-stop($values, $target, $stops, $stops-name, $token);
|
|
227
|
+
|
|
228
|
+
--oc-#{$namespace}-#{$token}: #{oc-responsive-rem(oc-responsive-resolve-stop-value($values, $target-stop))};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@mixin oc-emit-stepped-point-responsive-tokens($namespace, $tokens, $profile, $stops: null, $stops-name: '$oc-responsive-stops', $profile-name: '$oc-responsive-profile') {
|
|
233
|
+
@if meta.type-of($profile) != 'map' {
|
|
234
|
+
@error "#{$profile-name} must be a map.";
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
$profile-type: map.get($profile, type);
|
|
238
|
+
|
|
239
|
+
@if $profile-type != stepped-points {
|
|
240
|
+
@error "Unknown responsive profile type '#{$profile-type}'.";
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
$points: map.get($profile, points);
|
|
244
|
+
|
|
245
|
+
@if meta.type-of($points) != 'map' {
|
|
246
|
+
@error "#{$profile-name}.points must be a map.";
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@if not map.has-key($points, base) {
|
|
250
|
+
@error "#{$profile-name}.points must include base.";
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
@each $point-name, $target in $points {
|
|
254
|
+
@if $point-name != base {
|
|
255
|
+
$point-index: oc-responsive-point-order-index($point-name);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@include oc-emit-stepped-point-responsive-token-values($namespace, $tokens, map.get($points, base), $stops, $stops-name);
|
|
260
|
+
|
|
261
|
+
@each $point-name in $oc-responsive-point-order {
|
|
262
|
+
@if map.has-key($points, $point-name) {
|
|
263
|
+
$target: map.get($points, $point-name);
|
|
264
|
+
|
|
265
|
+
@include oc-responsive-media(oc-responsive-point-media($point-name)) {
|
|
266
|
+
@include oc-emit-stepped-point-responsive-token-values($namespace, $tokens, $target, $stops, $stops-name);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@mixin oc-emit-stepped-responsive-tokens($namespace, $tokens, $stops: null, $stops-name: '$oc-responsive-stops') {
|
|
273
|
+
$active-stops: oc-responsive-active-stops($stops, $stops-name);
|
|
274
|
+
$default-stop: list.nth($active-stops, 1);
|
|
275
|
+
|
|
276
|
+
@include oc-emit-responsive-token-values($namespace, $tokens, $default-stop);
|
|
277
|
+
|
|
278
|
+
@if list.length($active-stops) > 1 {
|
|
279
|
+
@for $index from 2 through list.length($active-stops) {
|
|
280
|
+
$stop: list.nth($active-stops, $index);
|
|
281
|
+
|
|
282
|
+
@include respond-to(min, $stop) {
|
|
283
|
+
@include oc-emit-responsive-token-values($namespace, $tokens, $stop);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@mixin oc-emit-responsive-tokens($namespace, $tokens, $segments, $stops: null, $stops-name: '$oc-responsive-stops', $profile: null, $profile-name: '$oc-responsive-profile') {
|
|
290
|
+
@if $oc-responsive-mode == stepped {
|
|
291
|
+
@if $profile != null {
|
|
292
|
+
@include oc-emit-stepped-point-responsive-tokens($namespace, $tokens, $profile, $stops, $stops-name, $profile-name);
|
|
293
|
+
} @else {
|
|
294
|
+
@include oc-emit-stepped-responsive-tokens($namespace, $tokens, $stops, $stops-name);
|
|
295
|
+
}
|
|
296
|
+
} @else if $oc-responsive-mode != fluid and $oc-responsive-mode != static {
|
|
297
|
+
@error "Unknown responsive mode '#{$oc-responsive-mode}'.";
|
|
298
|
+
} @else if $profile != null {
|
|
299
|
+
@error "#{$profile-name} requires $oc-responsive-mode: stepped.";
|
|
300
|
+
} @else {
|
|
301
|
+
$default-segment: map.get($segments, default);
|
|
302
|
+
$default-stop: map.get($default-segment, stop);
|
|
303
|
+
|
|
304
|
+
@each $token, $values in $tokens {
|
|
305
|
+
--oc-#{$namespace}-#{$token}: #{oc-responsive-segment-value($values, $default-stop, $default-stop, 1, to, $stops, $stops-name)};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@if $oc-responsive-mode != static {
|
|
309
|
+
@each $segment-name, $segment in $segments {
|
|
310
|
+
@if $segment-name != default {
|
|
311
|
+
$media: map.get($segment, media);
|
|
312
|
+
$from-stop: map.get($segment, from);
|
|
313
|
+
$to-stop: map.get($segment, to);
|
|
314
|
+
$basis: map.get($segment, basis);
|
|
315
|
+
$anchor: to;
|
|
316
|
+
$only: null;
|
|
317
|
+
|
|
318
|
+
@if map.has-key($segment, anchor) {
|
|
319
|
+
$anchor: map.get($segment, anchor);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@if map.has-key($segment, only) {
|
|
323
|
+
$only: map.get($segment, only);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
@include oc-responsive-media($media) {
|
|
327
|
+
@each $token, $values in $tokens {
|
|
328
|
+
@if $only == null or list.index($only, $token) != null {
|
|
329
|
+
$token-anchor: $anchor;
|
|
330
|
+
$token-basis: $basis;
|
|
331
|
+
$token-from-stop: $from-stop;
|
|
332
|
+
$token-to-stop: $to-stop;
|
|
333
|
+
|
|
334
|
+
@if map.has-key($segment, token-overrides) {
|
|
335
|
+
$token-overrides: map.get($segment, token-overrides);
|
|
336
|
+
|
|
337
|
+
@if map.has-key($token-overrides, $token) {
|
|
338
|
+
$token-override: map.get($token-overrides, $token);
|
|
339
|
+
|
|
340
|
+
@if map.has-key($token-override, anchor) {
|
|
341
|
+
$token-anchor: map.get($token-override, anchor);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
@if map.has-key($token-override, basis) {
|
|
345
|
+
$token-basis: map.get($token-override, basis);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@if map.has-key($token-override, from) {
|
|
349
|
+
$token-from-stop: map.get($token-override, from);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
@if map.has-key($token-override, to) {
|
|
353
|
+
$token-to-stop: map.get($token-override, to);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
--oc-#{$namespace}-#{$token}: #{oc-responsive-segment-value($values, $token-from-stop, $token-to-stop, $token-basis, $token-anchor, $stops, $stops-name)};
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|