@uni-design-system/uni-react 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +19769 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/index.js +19755 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/components/button/button.component.d.ts.map +1 -0
- package/dist/types/components/button/button.stories.d.ts.map +1 -0
- package/dist/types/components/button/index.d.ts.map +1 -0
- package/dist/types/components/card/card.component.d.ts.map +1 -0
- package/dist/types/components/card/card.stories.d.ts.map +1 -0
- package/dist/types/components/card/index.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/components/DragHandle/dragHandle.component.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/components/DragHandle/index.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/components/SortableItem/index.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/components/SortableItem/sortableItem.component.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/components/SortableItem/sortableItem.context.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/components/SortableOverlay/index.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/components/SortableOverlay/sortableOverlay.component.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/components/index.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/index.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/mockData.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/sortableList.component.d.ts.map +1 -0
- package/dist/types/components/draggable/SortableList/sortableList.stories.d.ts.map +1 -0
- package/dist/types/components/draggable/index.d.ts.map +1 -0
- package/dist/types/components/draggable/utilities/createRange.d.ts.map +1 -0
- package/dist/types/components/draggable/utilities/index.d.ts.map +1 -0
- package/dist/types/components/forms/index.d.ts.map +1 -0
- package/dist/types/components/forms/text-input/index.d.ts.map +1 -0
- package/dist/types/components/forms/text-input/text-input.component.d.ts.map +1 -0
- package/dist/types/components/forms/utils/validations.d.ts.map +1 -0
- package/dist/types/components/grainy-gradient-background/grainy-gradient-background.component.d.ts.map +1 -0
- package/dist/types/components/grainy-gradient-background/grainy-gradient-background.component.stories.d.ts.map +1 -0
- package/dist/types/components/icon-text-row/icon-text-row.component.d.ts.map +1 -0
- package/dist/types/components/icon-text-row/icon-text-row.stories.d.ts.map +1 -0
- package/dist/types/components/icon-text-row/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/modal/index.d.ts.map +1 -0
- package/dist/types/components/modal/modal-close-button.component.d.ts.map +1 -0
- package/dist/types/components/modal/modal.component.d.ts.map +1 -0
- package/dist/types/components/modal/modal.stories.d.ts.map +1 -0
- package/dist/types/components/switch/index.d.ts.map +1 -0
- package/dist/types/components/switch/switch.component.d.ts.map +1 -0
- package/dist/types/components/switch/switch.config.d.ts.map +1 -0
- package/dist/types/components/switch/switch.stories.d.ts.map +1 -0
- package/dist/types/core/background/background.component.d.ts.map +1 -0
- package/dist/types/core/background/background.stories.d.ts.map +1 -0
- package/dist/types/core/background/index.d.ts.map +1 -0
- package/dist/types/core/border/border.style.d.ts.map +1 -0
- package/dist/types/core/border/index.d.ts.map +1 -0
- package/dist/types/core/container/container.component.d.ts.map +1 -0
- package/dist/types/core/container/index.d.ts.map +1 -0
- package/dist/types/core/filter/filter.argTypes.d.ts.map +1 -0
- package/dist/types/core/filter/filter.component.d.ts.map +1 -0
- package/dist/types/core/filter/filter.config.d.ts.map +1 -0
- package/dist/types/core/filter/filter.model.d.ts.map +1 -0
- package/dist/types/core/filter/filter.style.d.ts.map +1 -0
- package/dist/types/core/filter/filter.types.d.ts.map +1 -0
- package/dist/types/core/filter/index.d.ts.map +1 -0
- package/dist/types/core/flex/flex.component.d.ts.map +1 -0
- package/dist/types/core/flex/flex.style.d.ts.map +1 -0
- package/dist/types/core/flex/index.d.ts.map +1 -0
- package/dist/types/core/hooks/index.d.ts.map +1 -0
- package/dist/types/core/hooks/use-media.d.ts.map +1 -0
- package/dist/types/core/hooks/use-toggle.d.ts.map +1 -0
- package/dist/types/core/icon/icon.component.d.ts.map +1 -0
- package/dist/types/core/icon/icon.stories.d.ts.map +1 -0
- package/dist/types/core/icon/index.d.ts.map +1 -0
- package/dist/{core → types/core}/image/image.argTypes.d.ts.map +1 -1
- package/dist/types/core/image/image.component.d.ts.map +1 -0
- package/dist/types/core/image/image.model.d.ts.map +1 -0
- package/dist/types/core/image/image.stories.d.ts.map +1 -0
- package/dist/types/core/image/image.style.d.ts.map +1 -0
- package/dist/types/core/image/image.types.d.ts.map +1 -0
- package/dist/types/core/image/index.d.ts.map +1 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/layout/index.d.ts.map +1 -0
- package/dist/types/core/layout/layout.context.d.ts.map +1 -0
- package/dist/types/core/layout/layout.hook.d.ts.map +1 -0
- package/dist/types/core/layout/layout.provider.d.ts.map +1 -0
- package/dist/types/core/overlay/index.d.ts.map +1 -0
- package/dist/types/core/overlay/overlay.component.d.ts.map +1 -0
- package/dist/types/core/overlay/overlay.config.d.ts.map +1 -0
- package/dist/types/core/overlay/overlay.model.d.ts.map +1 -0
- package/dist/types/core/overlay/overlay.stories.d.ts.map +1 -0
- package/dist/types/core/padding/index.d.ts.map +1 -0
- package/dist/types/core/padding/padding.style.d.ts.map +1 -0
- package/dist/types/core/shadow/index.d.ts.map +1 -0
- package/dist/types/core/shadow/shadow.style.d.ts.map +1 -0
- package/dist/types/core/text/index.d.ts.map +1 -0
- package/dist/types/core/text/text.component.d.ts.map +1 -0
- package/dist/types/core/text/text.stories.d.ts.map +1 -0
- package/dist/types/core/theme/index.d.ts.map +1 -0
- package/dist/types/core/theme/theming.d.ts.map +1 -0
- package/dist/types/core/transition/collapse/collapse.component.d.ts.map +1 -0
- package/dist/types/core/transition/collapse/index.d.ts.map +1 -0
- package/dist/types/core/transition/fade/fade.argTypes.d.ts.map +1 -0
- package/dist/types/core/transition/fade/fade.component.d.ts.map +1 -0
- package/dist/types/core/transition/fade/fade.stories.d.ts.map +1 -0
- package/dist/types/core/transition/fade/index.d.ts.map +1 -0
- package/dist/types/core/transition/index.d.ts.map +1 -0
- package/dist/types/core/transition/slide/index.d.ts.map +1 -0
- package/dist/types/core/transition/slide/slide.component.d.ts.map +1 -0
- package/dist/types/core/transition/slide/slide.stories.d.ts.map +1 -0
- package/dist/types/core/transition/transition.argTypes.d.ts.map +1 -0
- package/dist/types/core/transition/transition.utils.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/layouts/parallax-hero/parallax-hero.component.d.ts.map +1 -0
- package/dist/types/layouts/parallax-hero/parallax-hero.model.d.ts.map +1 -0
- package/dist/types/stories/Button.d.ts.map +1 -0
- package/dist/types/stories/Button.stories.d.ts.map +1 -0
- package/dist/types/stories/Header.d.ts.map +1 -0
- package/dist/types/stories/Header.stories.d.ts.map +1 -0
- package/dist/types/stories/Page.d.ts.map +1 -0
- package/dist/types/stories/Page.stories.d.ts.map +1 -0
- package/dist/types/tools/color-picker/color-picker.component.d.ts.map +1 -0
- package/dist/types/tools/color-picker/color-picker.stories.d.ts.map +1 -0
- package/dist/types/tools/color-swatch/color-swatch.component.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/storage-manager.d.ts.map +1 -0
- package/package.json +18 -9
- package/.storybook/main.ts +0 -26
- package/.storybook/manager.ts +0 -13
- package/.storybook/preview.ts +0 -21
- package/.turbo/turbo-build.log +0 -12
- package/CHANGELOG.md +0 -32
- package/dist/components/button/button.component.d.ts.map +0 -1
- package/dist/components/button/button.stories.d.ts.map +0 -1
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/card/card.component.d.ts.map +0 -1
- package/dist/components/card/card.stories.d.ts.map +0 -1
- package/dist/components/card/index.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/components/DragHandle/dragHandle.component.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/components/DragHandle/index.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/components/SortableItem/index.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/components/SortableItem/sortableItem.component.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/components/SortableItem/sortableItem.context.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/components/SortableOverlay/index.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/components/SortableOverlay/sortableOverlay.component.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/components/index.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/index.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/mockData.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/sortableList.component.d.ts.map +0 -1
- package/dist/components/draggable/SortableList/sortableList.stories.d.ts.map +0 -1
- package/dist/components/draggable/index.d.ts.map +0 -1
- package/dist/components/draggable/utilities/createRange.d.ts.map +0 -1
- package/dist/components/draggable/utilities/index.d.ts.map +0 -1
- package/dist/components/forms/index.d.ts.map +0 -1
- package/dist/components/forms/text-input/index.d.ts.map +0 -1
- package/dist/components/forms/text-input/text-input.component.d.ts.map +0 -1
- package/dist/components/forms/utils/validations.d.ts.map +0 -1
- package/dist/components/grainy-gradient-background/grainy-gradient-background.component.d.ts.map +0 -1
- package/dist/components/grainy-gradient-background/grainy-gradient-background.component.stories.d.ts.map +0 -1
- package/dist/components/icon-text-row/icon-text-row.component.d.ts.map +0 -1
- package/dist/components/icon-text-row/icon-text-row.stories.d.ts.map +0 -1
- package/dist/components/icon-text-row/index.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/modal/index.d.ts.map +0 -1
- package/dist/components/modal/modal-close-button.component.d.ts.map +0 -1
- package/dist/components/modal/modal.component.d.ts.map +0 -1
- package/dist/components/modal/modal.stories.d.ts.map +0 -1
- package/dist/components/switch/index.d.ts.map +0 -1
- package/dist/components/switch/switch.component.d.ts.map +0 -1
- package/dist/components/switch/switch.config.d.ts.map +0 -1
- package/dist/components/switch/switch.stories.d.ts.map +0 -1
- package/dist/core/background/background.component.d.ts.map +0 -1
- package/dist/core/background/background.stories.d.ts.map +0 -1
- package/dist/core/background/index.d.ts.map +0 -1
- package/dist/core/border/border.style.d.ts.map +0 -1
- package/dist/core/border/index.d.ts.map +0 -1
- package/dist/core/container/container.component.d.ts.map +0 -1
- package/dist/core/container/index.d.ts.map +0 -1
- package/dist/core/filter/filter.argTypes.d.ts.map +0 -1
- package/dist/core/filter/filter.component.d.ts.map +0 -1
- package/dist/core/filter/filter.config.d.ts.map +0 -1
- package/dist/core/filter/filter.model.d.ts.map +0 -1
- package/dist/core/filter/filter.style.d.ts.map +0 -1
- package/dist/core/filter/filter.types.d.ts.map +0 -1
- package/dist/core/filter/index.d.ts.map +0 -1
- package/dist/core/flex/flex.component.d.ts.map +0 -1
- package/dist/core/flex/flex.style.d.ts.map +0 -1
- package/dist/core/flex/index.d.ts.map +0 -1
- package/dist/core/hooks/index.d.ts.map +0 -1
- package/dist/core/hooks/use-media.d.ts.map +0 -1
- package/dist/core/hooks/use-toggle.d.ts.map +0 -1
- package/dist/core/icon/icon.component.d.ts.map +0 -1
- package/dist/core/icon/icon.stories.d.ts.map +0 -1
- package/dist/core/icon/index.d.ts.map +0 -1
- package/dist/core/image/image.component.d.ts.map +0 -1
- package/dist/core/image/image.model.d.ts.map +0 -1
- package/dist/core/image/image.stories.d.ts.map +0 -1
- package/dist/core/image/image.style.d.ts.map +0 -1
- package/dist/core/image/image.types.d.ts.map +0 -1
- package/dist/core/image/index.d.ts.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/layout/index.d.ts.map +0 -1
- package/dist/core/layout/layout.context.d.ts.map +0 -1
- package/dist/core/layout/layout.hook.d.ts.map +0 -1
- package/dist/core/layout/layout.provider.d.ts.map +0 -1
- package/dist/core/overlay/index.d.ts.map +0 -1
- package/dist/core/overlay/overlay.component.d.ts.map +0 -1
- package/dist/core/overlay/overlay.config.d.ts.map +0 -1
- package/dist/core/overlay/overlay.model.d.ts.map +0 -1
- package/dist/core/overlay/overlay.stories.d.ts.map +0 -1
- package/dist/core/padding/index.d.ts.map +0 -1
- package/dist/core/padding/padding.style.d.ts.map +0 -1
- package/dist/core/shadow/index.d.ts.map +0 -1
- package/dist/core/shadow/shadow.style.d.ts.map +0 -1
- package/dist/core/text/index.d.ts.map +0 -1
- package/dist/core/text/text.component.d.ts.map +0 -1
- package/dist/core/text/text.stories.d.ts.map +0 -1
- package/dist/core/theme/index.d.ts.map +0 -1
- package/dist/core/theme/theming.d.ts.map +0 -1
- package/dist/core/transition/collapse/collapse.component.d.ts.map +0 -1
- package/dist/core/transition/collapse/index.d.ts.map +0 -1
- package/dist/core/transition/fade/fade.argTypes.d.ts.map +0 -1
- package/dist/core/transition/fade/fade.component.d.ts.map +0 -1
- package/dist/core/transition/fade/fade.stories.d.ts.map +0 -1
- package/dist/core/transition/fade/index.d.ts.map +0 -1
- package/dist/core/transition/index.d.ts.map +0 -1
- package/dist/core/transition/slide/index.d.ts.map +0 -1
- package/dist/core/transition/slide/slide.component.d.ts.map +0 -1
- package/dist/core/transition/slide/slide.stories.d.ts.map +0 -1
- package/dist/core/transition/transition.argTypes.d.ts.map +0 -1
- package/dist/core/transition/transition.utils.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -13801
- package/dist/layouts/parallax-hero/parallax-hero.component.d.ts.map +0 -1
- package/dist/layouts/parallax-hero/parallax-hero.model.d.ts.map +0 -1
- package/dist/stories/Button.d.ts.map +0 -1
- package/dist/stories/Button.stories.d.ts.map +0 -1
- package/dist/stories/Header.d.ts.map +0 -1
- package/dist/stories/Header.stories.d.ts.map +0 -1
- package/dist/stories/Page.d.ts.map +0 -1
- package/dist/stories/Page.stories.d.ts.map +0 -1
- package/dist/tools/color-picker/color-picker.component.d.ts.map +0 -1
- package/dist/tools/color-picker/color-picker.stories.d.ts.map +0 -1
- package/dist/tools/color-swatch/color-swatch.component.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/storage-manager.d.ts.map +0 -1
- package/src/components/button/button.component.tsx +0 -138
- package/src/components/button/button.stories.tsx +0 -79
- package/src/components/button/index.ts +0 -1
- package/src/components/card/card.component.tsx +0 -61
- package/src/components/card/card.stories.tsx +0 -22
- package/src/components/card/index.ts +0 -1
- package/src/components/draggable/SortableList/components/DragHandle/dragHandle.component.tsx +0 -20
- package/src/components/draggable/SortableList/components/DragHandle/index.ts +0 -1
- package/src/components/draggable/SortableList/components/SortableItem/index.ts +0 -1
- package/src/components/draggable/SortableList/components/SortableItem/sortableItem.component.tsx +0 -54
- package/src/components/draggable/SortableList/components/SortableItem/sortableItem.context.ts +0 -14
- package/src/components/draggable/SortableList/components/SortableOverlay/index.ts +0 -1
- package/src/components/draggable/SortableList/components/SortableOverlay/sortableOverlay.component.tsx +0 -20
- package/src/components/draggable/SortableList/components/index.ts +0 -3
- package/src/components/draggable/SortableList/index.ts +0 -2
- package/src/components/draggable/SortableList/mockData.ts +0 -50
- package/src/components/draggable/SortableList/sortableList.component.tsx +0 -69
- package/src/components/draggable/SortableList/sortableList.stories.tsx +0 -71
- package/src/components/draggable/index.ts +0 -1
- package/src/components/draggable/utilities/createRange.ts +0 -8
- package/src/components/draggable/utilities/index.ts +0 -1
- package/src/components/forms/index.ts +0 -1
- package/src/components/forms/text-input/index.ts +0 -1
- package/src/components/forms/text-input/text-input.component.tsx +0 -14
- package/src/components/forms/utils/validations.ts +0 -62
- package/src/components/grainy-gradient-background/grainy-gradient-background.component.stories.tsx +0 -60
- package/src/components/grainy-gradient-background/grainy-gradient-background.component.tsx +0 -68
- package/src/components/icon-text-row/icon-text-row.component.tsx +0 -70
- package/src/components/icon-text-row/icon-text-row.stories.tsx +0 -18
- package/src/components/icon-text-row/index.ts +0 -1
- package/src/components/index.ts +0 -7
- package/src/components/modal/index.ts +0 -1
- package/src/components/modal/modal-close-button.component.tsx +0 -13
- package/src/components/modal/modal.component.tsx +0 -48
- package/src/components/modal/modal.stories.tsx +0 -25
- package/src/components/switch/index.ts +0 -1
- package/src/components/switch/switch.component.tsx +0 -59
- package/src/components/switch/switch.config.ts +0 -24
- package/src/components/switch/switch.stories.tsx +0 -12
- package/src/core/background/background.component.tsx +0 -47
- package/src/core/background/background.stories.tsx +0 -22
- package/src/core/background/index.ts +0 -1
- package/src/core/border/border.style.ts +0 -31
- package/src/core/border/index.ts +0 -1
- package/src/core/container/container.component.tsx +0 -20
- package/src/core/container/index.ts +0 -1
- package/src/core/filter/filter.argTypes.ts +0 -111
- package/src/core/filter/filter.component.tsx +0 -11
- package/src/core/filter/filter.config.ts +0 -68
- package/src/core/filter/filter.model.ts +0 -22
- package/src/core/filter/filter.style.ts +0 -22
- package/src/core/filter/filter.types.ts +0 -12
- package/src/core/filter/index.ts +0 -4
- package/src/core/flex/flex.component.tsx +0 -91
- package/src/core/flex/flex.style.ts +0 -106
- package/src/core/flex/index.ts +0 -2
- package/src/core/hooks/index.ts +0 -2
- package/src/core/hooks/use-media.ts +0 -29
- package/src/core/hooks/use-toggle.tsx +0 -23
- package/src/core/icon/icon.component.tsx +0 -19
- package/src/core/icon/icon.stories.tsx +0 -52
- package/src/core/icon/index.ts +0 -6
- package/src/core/image/image.argTypes.ts +0 -23
- package/src/core/image/image.component.tsx +0 -17
- package/src/core/image/image.model.ts +0 -10
- package/src/core/image/image.stories.tsx +0 -22
- package/src/core/image/image.style.ts +0 -19
- package/src/core/image/image.types.ts +0 -1
- package/src/core/image/index.ts +0 -2
- package/src/core/index.ts +0 -14
- package/src/core/layout/index.ts +0 -2
- package/src/core/layout/layout.context.tsx +0 -14
- package/src/core/layout/layout.hook.tsx +0 -11
- package/src/core/layout/layout.provider.tsx +0 -23
- package/src/core/overlay/index.ts +0 -2
- package/src/core/overlay/overlay.component.tsx +0 -27
- package/src/core/overlay/overlay.config.ts +0 -30
- package/src/core/overlay/overlay.model.ts +0 -13
- package/src/core/overlay/overlay.stories.tsx +0 -73
- package/src/core/padding/index.ts +0 -1
- package/src/core/padding/padding.style.ts +0 -35
- package/src/core/shadow/index.ts +0 -1
- package/src/core/shadow/shadow.style.ts +0 -5
- package/src/core/text/index.ts +0 -1
- package/src/core/text/text.component.tsx +0 -48
- package/src/core/text/text.stories.tsx +0 -66
- package/src/core/theme/index.ts +0 -1
- package/src/core/theme/theming.tsx +0 -30
- package/src/core/transition/collapse/collapse.component.tsx +0 -141
- package/src/core/transition/collapse/index.ts +0 -1
- package/src/core/transition/fade/fade.argTypes.ts +0 -5
- package/src/core/transition/fade/fade.component.tsx +0 -59
- package/src/core/transition/fade/fade.stories.tsx +0 -52
- package/src/core/transition/fade/index.ts +0 -1
- package/src/core/transition/index.ts +0 -3
- package/src/core/transition/slide/index.ts +0 -1
- package/src/core/transition/slide/slide.component.tsx +0 -111
- package/src/core/transition/slide/slide.stories.tsx +0 -38
- package/src/core/transition/transition.argTypes.ts +0 -10
- package/src/core/transition/transition.utils.ts +0 -165
- package/src/index.ts +0 -3
- package/src/layouts/parallax-hero/parallax-hero.component.tsx +0 -25
- package/src/layouts/parallax-hero/parallax-hero.model.ts +0 -12
- package/src/stories/Button.stories.ts +0 -54
- package/src/stories/Button.tsx +0 -37
- package/src/stories/Configure.mdx +0 -393
- package/src/stories/Header.stories.ts +0 -34
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -33
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- package/src/tools/color-picker/color-picker.component.tsx +0 -151
- package/src/tools/color-picker/color-picker.stories.tsx +0 -21
- package/src/tools/color-swatch/color-swatch.component.tsx +0 -68
- package/src/utils/index.ts +0 -1
- package/src/utils/storage-manager.ts +0 -51
- package/tsconfig.json +0 -13
- package/vite.config.ts +0 -29
- package/vitest.config.ts +0 -36
- package/vitest.shims.d.ts +0 -1
- /package/dist/{components → types/components}/button/button.component.d.ts +0 -0
- /package/dist/{components → types/components}/button/button.stories.d.ts +0 -0
- /package/dist/{components → types/components}/button/index.d.ts +0 -0
- /package/dist/{components → types/components}/card/card.component.d.ts +0 -0
- /package/dist/{components → types/components}/card/card.stories.d.ts +0 -0
- /package/dist/{components → types/components}/card/index.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/components/DragHandle/dragHandle.component.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/components/DragHandle/index.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/components/SortableItem/index.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/components/SortableItem/sortableItem.component.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/components/SortableItem/sortableItem.context.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/components/SortableOverlay/index.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/components/SortableOverlay/sortableOverlay.component.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/components/index.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/index.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/mockData.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/sortableList.component.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/SortableList/sortableList.stories.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/index.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/utilities/createRange.d.ts +0 -0
- /package/dist/{components → types/components}/draggable/utilities/index.d.ts +0 -0
- /package/dist/{components → types/components}/forms/index.d.ts +0 -0
- /package/dist/{components → types/components}/forms/text-input/index.d.ts +0 -0
- /package/dist/{components → types/components}/forms/text-input/text-input.component.d.ts +0 -0
- /package/dist/{components → types/components}/forms/utils/validations.d.ts +0 -0
- /package/dist/{components → types/components}/grainy-gradient-background/grainy-gradient-background.component.d.ts +0 -0
- /package/dist/{components → types/components}/grainy-gradient-background/grainy-gradient-background.component.stories.d.ts +0 -0
- /package/dist/{components → types/components}/icon-text-row/icon-text-row.component.d.ts +0 -0
- /package/dist/{components → types/components}/icon-text-row/icon-text-row.stories.d.ts +0 -0
- /package/dist/{components → types/components}/icon-text-row/index.d.ts +0 -0
- /package/dist/{components → types/components}/index.d.ts +0 -0
- /package/dist/{components → types/components}/modal/index.d.ts +0 -0
- /package/dist/{components → types/components}/modal/modal-close-button.component.d.ts +0 -0
- /package/dist/{components → types/components}/modal/modal.component.d.ts +0 -0
- /package/dist/{components → types/components}/modal/modal.stories.d.ts +0 -0
- /package/dist/{components → types/components}/switch/index.d.ts +0 -0
- /package/dist/{components → types/components}/switch/switch.component.d.ts +0 -0
- /package/dist/{components → types/components}/switch/switch.config.d.ts +0 -0
- /package/dist/{components → types/components}/switch/switch.stories.d.ts +0 -0
- /package/dist/{core → types/core}/background/background.component.d.ts +0 -0
- /package/dist/{core → types/core}/background/background.stories.d.ts +0 -0
- /package/dist/{core → types/core}/background/index.d.ts +0 -0
- /package/dist/{core → types/core}/border/border.style.d.ts +0 -0
- /package/dist/{core → types/core}/border/index.d.ts +0 -0
- /package/dist/{core → types/core}/container/container.component.d.ts +0 -0
- /package/dist/{core → types/core}/container/index.d.ts +0 -0
- /package/dist/{core → types/core}/filter/filter.argTypes.d.ts +0 -0
- /package/dist/{core → types/core}/filter/filter.component.d.ts +0 -0
- /package/dist/{core → types/core}/filter/filter.config.d.ts +0 -0
- /package/dist/{core → types/core}/filter/filter.model.d.ts +0 -0
- /package/dist/{core → types/core}/filter/filter.style.d.ts +0 -0
- /package/dist/{core → types/core}/filter/filter.types.d.ts +0 -0
- /package/dist/{core → types/core}/filter/index.d.ts +0 -0
- /package/dist/{core → types/core}/flex/flex.component.d.ts +0 -0
- /package/dist/{core → types/core}/flex/flex.style.d.ts +0 -0
- /package/dist/{core → types/core}/flex/index.d.ts +0 -0
- /package/dist/{core → types/core}/hooks/index.d.ts +0 -0
- /package/dist/{core → types/core}/hooks/use-media.d.ts +0 -0
- /package/dist/{core → types/core}/hooks/use-toggle.d.ts +0 -0
- /package/dist/{core → types/core}/icon/icon.component.d.ts +0 -0
- /package/dist/{core → types/core}/icon/icon.stories.d.ts +0 -0
- /package/dist/{core → types/core}/icon/index.d.ts +0 -0
- /package/dist/{core → types/core}/image/image.argTypes.d.ts +0 -0
- /package/dist/{core → types/core}/image/image.component.d.ts +0 -0
- /package/dist/{core → types/core}/image/image.model.d.ts +0 -0
- /package/dist/{core → types/core}/image/image.stories.d.ts +0 -0
- /package/dist/{core → types/core}/image/image.style.d.ts +0 -0
- /package/dist/{core → types/core}/image/image.types.d.ts +0 -0
- /package/dist/{core → types/core}/image/index.d.ts +0 -0
- /package/dist/{core → types/core}/index.d.ts +0 -0
- /package/dist/{core → types/core}/layout/index.d.ts +0 -0
- /package/dist/{core → types/core}/layout/layout.context.d.ts +0 -0
- /package/dist/{core → types/core}/layout/layout.hook.d.ts +0 -0
- /package/dist/{core → types/core}/layout/layout.provider.d.ts +0 -0
- /package/dist/{core → types/core}/overlay/index.d.ts +0 -0
- /package/dist/{core → types/core}/overlay/overlay.component.d.ts +0 -0
- /package/dist/{core → types/core}/overlay/overlay.config.d.ts +0 -0
- /package/dist/{core → types/core}/overlay/overlay.model.d.ts +0 -0
- /package/dist/{core → types/core}/overlay/overlay.stories.d.ts +0 -0
- /package/dist/{core → types/core}/padding/index.d.ts +0 -0
- /package/dist/{core → types/core}/padding/padding.style.d.ts +0 -0
- /package/dist/{core → types/core}/shadow/index.d.ts +0 -0
- /package/dist/{core → types/core}/shadow/shadow.style.d.ts +0 -0
- /package/dist/{core → types/core}/text/index.d.ts +0 -0
- /package/dist/{core → types/core}/text/text.component.d.ts +0 -0
- /package/dist/{core → types/core}/text/text.stories.d.ts +0 -0
- /package/dist/{core → types/core}/theme/index.d.ts +0 -0
- /package/dist/{core → types/core}/theme/theming.d.ts +0 -0
- /package/dist/{core → types/core}/transition/collapse/collapse.component.d.ts +0 -0
- /package/dist/{core → types/core}/transition/collapse/index.d.ts +0 -0
- /package/dist/{core → types/core}/transition/fade/fade.argTypes.d.ts +0 -0
- /package/dist/{core → types/core}/transition/fade/fade.component.d.ts +0 -0
- /package/dist/{core → types/core}/transition/fade/fade.stories.d.ts +0 -0
- /package/dist/{core → types/core}/transition/fade/index.d.ts +0 -0
- /package/dist/{core → types/core}/transition/index.d.ts +0 -0
- /package/dist/{core → types/core}/transition/slide/index.d.ts +0 -0
- /package/dist/{core → types/core}/transition/slide/slide.component.d.ts +0 -0
- /package/dist/{core → types/core}/transition/slide/slide.stories.d.ts +0 -0
- /package/dist/{core → types/core}/transition/transition.argTypes.d.ts +0 -0
- /package/dist/{core → types/core}/transition/transition.utils.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{layouts → types/layouts}/parallax-hero/parallax-hero.component.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/parallax-hero/parallax-hero.model.d.ts +0 -0
- /package/dist/{stories → types/stories}/Button.d.ts +0 -0
- /package/dist/{stories → types/stories}/Button.stories.d.ts +0 -0
- /package/dist/{stories → types/stories}/Header.d.ts +0 -0
- /package/dist/{stories → types/stories}/Header.stories.d.ts +0 -0
- /package/dist/{stories → types/stories}/Page.d.ts +0 -0
- /package/dist/{stories → types/stories}/Page.stories.d.ts +0 -0
- /package/dist/{tools → types/tools}/color-picker/color-picker.component.d.ts +0 -0
- /package/dist/{tools → types/tools}/color-picker/color-picker.stories.d.ts +0 -0
- /package/dist/{tools → types/tools}/color-swatch/color-swatch.component.d.ts +0 -0
- /package/dist/{utils → types/utils}/index.d.ts +0 -0
- /package/dist/{utils → types/utils}/storage-manager.d.ts +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Border, ColorToken, getValue, UniTheme } from '@uni-design-system/uni-core';
|
|
2
|
-
import { CSSProperties } from 'react';
|
|
3
|
-
|
|
4
|
-
export function BorderStyle(border: Border | undefined, theme: UniTheme): CSSProperties {
|
|
5
|
-
if (!border) return {};
|
|
6
|
-
|
|
7
|
-
const borderTopColor = extractColor(theme, border, 'colorTop');
|
|
8
|
-
const borderBottomColor = extractColor(theme, border, 'colorBottom');
|
|
9
|
-
const borderLeftColor = extractColor(theme, border, 'colorLeft');
|
|
10
|
-
const borderRightColor = extractColor(theme, border, 'colorRight');
|
|
11
|
-
const borderTopWidth = getValue(border, 'widthTop', 'width');
|
|
12
|
-
const borderBottomWidth = getValue(border, 'widthBottom', 'width');
|
|
13
|
-
const borderLeftWidth = getValue(border, 'widthLeft', 'width');
|
|
14
|
-
const borderRightWidth = getValue(border, 'widthRight', 'width');
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
borderTopColor,
|
|
18
|
-
borderBottomColor,
|
|
19
|
-
borderLeftColor,
|
|
20
|
-
borderRightColor,
|
|
21
|
-
borderTopWidth,
|
|
22
|
-
borderBottomWidth,
|
|
23
|
-
borderLeftWidth,
|
|
24
|
-
borderRightWidth,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function extractColor(theme: UniTheme, border: Border, key: string): string | undefined {
|
|
29
|
-
const colorToken = getValue(border, key, 'color') as ColorToken;
|
|
30
|
-
return colorToken ? theme.colors[colorToken] : undefined;
|
|
31
|
-
}
|
package/src/core/border/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './border.style';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { createContext, CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { ContainerColorToken } from '@uni-design-system/uni-core';
|
|
3
|
-
|
|
4
|
-
export interface ContainerProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
style: CSSProperties;
|
|
7
|
-
colorToken?: ContainerColorToken;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const ContainerContext = createContext<{ colorToken?: ContainerColorToken }>({});
|
|
11
|
-
|
|
12
|
-
export default function Container({ children, style, colorToken, ...rest }: ContainerProps) {
|
|
13
|
-
return (
|
|
14
|
-
<ContainerContext.Provider value={{ colorToken }}>
|
|
15
|
-
<div style={style} {...rest}>
|
|
16
|
-
{children}
|
|
17
|
-
</div>
|
|
18
|
-
</ContainerContext.Provider>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './container.component';
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// https://www.w3schools.com/csSref/css3_pr_filter.php
|
|
2
|
-
|
|
3
|
-
export const filterArgTypes = {
|
|
4
|
-
blur: {
|
|
5
|
-
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
6
|
-
table: {
|
|
7
|
-
type: { summary: 'number' },
|
|
8
|
-
defaultValue: { summary: '0' },
|
|
9
|
-
},
|
|
10
|
-
description:
|
|
11
|
-
'Applies a blur effect to the image. A larger value will create more blur.\n' +
|
|
12
|
-
'\n' +
|
|
13
|
-
'If no value is specified, 0 is used.',
|
|
14
|
-
},
|
|
15
|
-
brightness: {
|
|
16
|
-
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
17
|
-
table: {
|
|
18
|
-
type: { summary: 'number' },
|
|
19
|
-
defaultValue: { summary: '0' },
|
|
20
|
-
},
|
|
21
|
-
description:
|
|
22
|
-
'Adjusts the brightness of the image.\n' +
|
|
23
|
-
'\n' +
|
|
24
|
-
'0% will make the image completely black.\n' +
|
|
25
|
-
'100% (1) is default and represents the original image.\n' +
|
|
26
|
-
'Values over 100% will provide brighter results.',
|
|
27
|
-
},
|
|
28
|
-
contrast: {
|
|
29
|
-
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
30
|
-
table: {
|
|
31
|
-
type: { summary: 'number' },
|
|
32
|
-
defaultValue: { summary: '0' },
|
|
33
|
-
},
|
|
34
|
-
description:
|
|
35
|
-
'Adjusts the contrast of the image.\n' +
|
|
36
|
-
'\n' +
|
|
37
|
-
'0% will make the image completely black.\n' +
|
|
38
|
-
'100% (1) is default, and represents the original image.\n' +
|
|
39
|
-
'Values over 100% will provide results with more contrast.',
|
|
40
|
-
},
|
|
41
|
-
grayscale: {
|
|
42
|
-
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
43
|
-
table: {
|
|
44
|
-
type: { summary: 'number' },
|
|
45
|
-
defaultValue: { summary: '0' },
|
|
46
|
-
},
|
|
47
|
-
description:
|
|
48
|
-
'Converts the image to grayscale.\n' +
|
|
49
|
-
'\n' +
|
|
50
|
-
'0% (0) is default and represents the original image.\n' +
|
|
51
|
-
'100% will make the image completely gray (used for black and white images).',
|
|
52
|
-
},
|
|
53
|
-
'hue-rotate': {
|
|
54
|
-
control: { type: 'range', min: 0, max: 360, step: 1 },
|
|
55
|
-
table: {
|
|
56
|
-
type: { summary: 'number' },
|
|
57
|
-
defaultValue: { summary: '0' },
|
|
58
|
-
},
|
|
59
|
-
description:
|
|
60
|
-
'Applies a hue rotation on the image. The value defines the number of degrees around the color circle the image samples will be adjusted. 0deg is default, and represents the original image.',
|
|
61
|
-
},
|
|
62
|
-
invert: {
|
|
63
|
-
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
64
|
-
table: {
|
|
65
|
-
type: { summary: 'number' },
|
|
66
|
-
defaultValue: { summary: '0' },
|
|
67
|
-
},
|
|
68
|
-
description:
|
|
69
|
-
'Inverts the samples in the image.\n' +
|
|
70
|
-
'\n' +
|
|
71
|
-
'0% (0) is default and represents the original image.\n' +
|
|
72
|
-
'100% will make the image completely inverted.',
|
|
73
|
-
},
|
|
74
|
-
opacity: {
|
|
75
|
-
control: { type: 'range', min: 0, max: 1, step: 0.01 },
|
|
76
|
-
table: {
|
|
77
|
-
type: { summary: 'number' },
|
|
78
|
-
defaultValue: { summary: '1' },
|
|
79
|
-
},
|
|
80
|
-
description:
|
|
81
|
-
'Sets the opacity level for the image. The opacity-level describes the transparency-level, where:\n' +
|
|
82
|
-
'\n' +
|
|
83
|
-
'0% is completely transparent.\n' +
|
|
84
|
-
'100% (1) is default and represents the original image (no transparency).',
|
|
85
|
-
},
|
|
86
|
-
saturate: {
|
|
87
|
-
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
88
|
-
table: {
|
|
89
|
-
type: { summary: 'number' },
|
|
90
|
-
defaultValue: { summary: '0' },
|
|
91
|
-
},
|
|
92
|
-
description:
|
|
93
|
-
'Saturates the image.\n' +
|
|
94
|
-
'\n' +
|
|
95
|
-
'0% (0) will make the image completely un-saturated.\n' +
|
|
96
|
-
'100% is default and represents the original image.\n' +
|
|
97
|
-
'Values over 100% provides super-saturated results.',
|
|
98
|
-
},
|
|
99
|
-
sepia: {
|
|
100
|
-
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
101
|
-
table: {
|
|
102
|
-
type: { summary: 'number' },
|
|
103
|
-
defaultValue: { summary: '0' },
|
|
104
|
-
},
|
|
105
|
-
description:
|
|
106
|
-
'Converts the image to sepia.\n' +
|
|
107
|
-
'\n' +
|
|
108
|
-
'0% (0) is default and represents the original image.\n' +
|
|
109
|
-
'100% will make the image completely sepia.',
|
|
110
|
-
},
|
|
111
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import Container from '../container/container.component';
|
|
3
|
-
import { FilterStyle } from './filter.style';
|
|
4
|
-
import { FilterProps } from './filter.model';
|
|
5
|
-
|
|
6
|
-
export const Filter = (filterProps: PropsWithChildren<FilterProps>) => {
|
|
7
|
-
const { children } = filterProps;
|
|
8
|
-
const style = FilterStyle(filterProps);
|
|
9
|
-
|
|
10
|
-
return <Container style={style}>{children}</Container>;
|
|
11
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { FilterConfig } from './filter.model';
|
|
2
|
-
import { FilterType } from './filter.types';
|
|
3
|
-
|
|
4
|
-
export const FilterConfigs: Record<FilterType, FilterConfig> = {
|
|
5
|
-
blur: {
|
|
6
|
-
type: 'blur',
|
|
7
|
-
unit: 'px',
|
|
8
|
-
defaultValue: 4,
|
|
9
|
-
rangeLow: 0,
|
|
10
|
-
rangeHigh: 100,
|
|
11
|
-
},
|
|
12
|
-
brightness: {
|
|
13
|
-
type: 'brightness',
|
|
14
|
-
unit: '%',
|
|
15
|
-
defaultValue: 250,
|
|
16
|
-
rangeLow: 0,
|
|
17
|
-
rangeHigh: 100,
|
|
18
|
-
},
|
|
19
|
-
contrast: {
|
|
20
|
-
type: 'contrast',
|
|
21
|
-
unit: '%',
|
|
22
|
-
defaultValue: 180,
|
|
23
|
-
rangeLow: 0,
|
|
24
|
-
rangeHigh: 100,
|
|
25
|
-
},
|
|
26
|
-
grayscale: {
|
|
27
|
-
type: 'grayscale',
|
|
28
|
-
unit: '%',
|
|
29
|
-
defaultValue: 100,
|
|
30
|
-
rangeLow: 0,
|
|
31
|
-
rangeHigh: 100,
|
|
32
|
-
},
|
|
33
|
-
'hue-rotate': {
|
|
34
|
-
type: 'hue-rotate',
|
|
35
|
-
unit: 'deg',
|
|
36
|
-
defaultValue: 180,
|
|
37
|
-
rangeLow: 0,
|
|
38
|
-
rangeHigh: 360,
|
|
39
|
-
},
|
|
40
|
-
invert: {
|
|
41
|
-
type: 'invert',
|
|
42
|
-
unit: '%',
|
|
43
|
-
defaultValue: 100,
|
|
44
|
-
rangeLow: 0,
|
|
45
|
-
rangeHigh: 100,
|
|
46
|
-
},
|
|
47
|
-
opacity: {
|
|
48
|
-
type: 'opacity',
|
|
49
|
-
unit: '%',
|
|
50
|
-
defaultValue: 50,
|
|
51
|
-
rangeLow: 0,
|
|
52
|
-
rangeHigh: 100,
|
|
53
|
-
},
|
|
54
|
-
saturate: {
|
|
55
|
-
type: 'saturate',
|
|
56
|
-
unit: 'num',
|
|
57
|
-
defaultValue: 7,
|
|
58
|
-
rangeLow: 0,
|
|
59
|
-
rangeHigh: 100,
|
|
60
|
-
},
|
|
61
|
-
sepia: {
|
|
62
|
-
type: 'sepia',
|
|
63
|
-
unit: '%',
|
|
64
|
-
defaultValue: 100,
|
|
65
|
-
rangeLow: 0,
|
|
66
|
-
rangeHigh: 100,
|
|
67
|
-
},
|
|
68
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FilterType, FilterUnit } from './filter.types';
|
|
2
|
-
|
|
3
|
-
export interface FilterProps {
|
|
4
|
-
blur?: number;
|
|
5
|
-
brightness?: number;
|
|
6
|
-
contrast?: number;
|
|
7
|
-
grayscale?: number;
|
|
8
|
-
'hue-rotate'?: number;
|
|
9
|
-
invert?: number;
|
|
10
|
-
opacity?: number;
|
|
11
|
-
saturate?: number;
|
|
12
|
-
sepia?: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface FilterConfig {
|
|
16
|
-
type: FilterType;
|
|
17
|
-
value?: number;
|
|
18
|
-
unit?: FilterUnit;
|
|
19
|
-
defaultValue?: number;
|
|
20
|
-
rangeLow?: number;
|
|
21
|
-
rangeHigh?: number;
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { FilterConfig, FilterProps } from './filter.model';
|
|
3
|
-
import { FilterType } from './filter.types';
|
|
4
|
-
import { FilterConfigs } from './filter.config';
|
|
5
|
-
|
|
6
|
-
const getFilterConfig = (filterType: FilterType): FilterConfig | undefined => {
|
|
7
|
-
return FilterConfigs[filterType];
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const getFilterSetting = (type: FilterType, value?: number): string => {
|
|
11
|
-
if (!value) return '';
|
|
12
|
-
const unit = getFilterConfig(type)?.unit;
|
|
13
|
-
return `${type}(${value}${unit && unit !== 'num' ? unit : ''})`;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const FilterStyle = (filterSettings: Partial<FilterProps>): CSSProperties => {
|
|
17
|
-
const filterNames = Object.keys(filterSettings) as FilterType[];
|
|
18
|
-
|
|
19
|
-
const filterArray = filterNames.map((type) => getFilterSetting(type, filterSettings[type]));
|
|
20
|
-
console.log(filterArray);
|
|
21
|
-
return { filter: filterArray.join(' ') };
|
|
22
|
-
};
|
package/src/core/filter/index.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { CSSProperties, forwardRef } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
AlignContent,
|
|
5
|
-
FlexDirection,
|
|
6
|
-
FlexGrow,
|
|
7
|
-
FlexShrink,
|
|
8
|
-
FlexWrap,
|
|
9
|
-
JustifyContent,
|
|
10
|
-
} from '@uni-design-system/uni-core';
|
|
11
|
-
import { Property } from 'csstype';
|
|
12
|
-
|
|
13
|
-
export interface FlexOptions extends HTMLAttributes<HTMLDivElement> {
|
|
14
|
-
/**
|
|
15
|
-
* Shorthand for `alignItems` style prop
|
|
16
|
-
* @type AlignItems
|
|
17
|
-
*/
|
|
18
|
-
align?: AlignContent;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Shorthand for `justifyContent` style prop
|
|
22
|
-
* @type JustifyContent
|
|
23
|
-
*/
|
|
24
|
-
justify?: JustifyContent;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Shorthand for `flexWrap` style prop
|
|
28
|
-
* @type FlexWrap
|
|
29
|
-
*/
|
|
30
|
-
wrap?: FlexWrap;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Shorthand for `flexDirection` style prop
|
|
34
|
-
* @type FlexDirection
|
|
35
|
-
* @default "row"
|
|
36
|
-
*/
|
|
37
|
-
direction?: FlexDirection;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Shorthand for `flexBasis` style prop
|
|
41
|
-
* @type number
|
|
42
|
-
*/
|
|
43
|
-
basis?: number;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Shorthand for `flexGrow` style prop
|
|
47
|
-
* @type FlexGrow
|
|
48
|
-
*/
|
|
49
|
-
grow?: FlexGrow;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Shorthand for `flexShrink` style prop
|
|
53
|
-
* @type FlexShrink
|
|
54
|
-
*/
|
|
55
|
-
shrink?: FlexShrink;
|
|
56
|
-
|
|
57
|
-
gap?: Property.Gap<number | string>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface FlexProps extends FlexOptions {
|
|
61
|
-
children: ReactNode;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* React component used to create flexbox layouts.
|
|
66
|
-
*
|
|
67
|
-
* It renders a `div` with `display: flex` and
|
|
68
|
-
* comes with helpful style shorthand.
|
|
69
|
-
*
|
|
70
|
-
* @see Docs
|
|
71
|
-
*/
|
|
72
|
-
export const Flex = forwardRef<HTMLDivElement, FlexProps>((props, ref) => {
|
|
73
|
-
const { direction, align, justify, wrap, basis, grow, shrink, gap, style, ...rest } = props;
|
|
74
|
-
|
|
75
|
-
const styles: CSSProperties = {
|
|
76
|
-
display: 'flex',
|
|
77
|
-
flexDirection: direction,
|
|
78
|
-
alignItems: align,
|
|
79
|
-
justifyContent: justify,
|
|
80
|
-
flexWrap: wrap,
|
|
81
|
-
flexBasis: basis,
|
|
82
|
-
flexGrow: grow,
|
|
83
|
-
flexShrink: shrink,
|
|
84
|
-
gap,
|
|
85
|
-
...style,
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
return <div ref={ref} style={styles} {...rest} />;
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
Flex.displayName = 'Flex';
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { HorizontalAlign, VerticalAlign } from '@uni-design-system/uni-core';
|
|
3
|
-
|
|
4
|
-
export const flex: CSSProperties = { flex: 1 };
|
|
5
|
-
|
|
6
|
-
export const row: CSSProperties = {
|
|
7
|
-
display: 'flex',
|
|
8
|
-
flex: 1,
|
|
9
|
-
flexDirection: 'row',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const column: CSSProperties = {
|
|
13
|
-
flex: 1,
|
|
14
|
-
flexDirection: 'column',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const alignTop: CSSProperties = { alignItems: 'flex-start' };
|
|
18
|
-
export const alignCenter: CSSProperties = { alignItems: 'center' };
|
|
19
|
-
export const alignBottom: CSSProperties = { alignItems: 'flex-end' };
|
|
20
|
-
|
|
21
|
-
export const FlexVerticalAlignments: Record<VerticalAlign, CSSProperties> = {
|
|
22
|
-
top: alignTop,
|
|
23
|
-
middle: alignCenter,
|
|
24
|
-
bottom: alignBottom,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const justifyLeft: CSSProperties = { justifyContent: 'flex-start' };
|
|
28
|
-
export const justifyCenter: CSSProperties = { justifyContent: 'center' };
|
|
29
|
-
export const justifyRight: CSSProperties = { justifyContent: 'flex-end' };
|
|
30
|
-
|
|
31
|
-
export const FlexHorizontalAlignments: Record<HorizontalAlign, CSSProperties> = {
|
|
32
|
-
left: justifyLeft,
|
|
33
|
-
center: justifyCenter,
|
|
34
|
-
right: justifyRight,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const expand: CSSProperties = { flexGrow: 1 };
|
|
38
|
-
export const fix: CSSProperties = { flex: 0, flexGrow: 0 };
|
|
39
|
-
|
|
40
|
-
export const rowFlexItem: CSSProperties = {
|
|
41
|
-
flexGrow: 1,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const rowFixedItem: CSSProperties = {
|
|
45
|
-
flexGrow: 0,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const flexRowStart: CSSProperties = {
|
|
49
|
-
flexDirection: 'row',
|
|
50
|
-
justifyContent: 'flex-start',
|
|
51
|
-
alignItems: 'center',
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const flexRowCenter: CSSProperties = {
|
|
55
|
-
flexDirection: 'row',
|
|
56
|
-
justifyContent: 'center',
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const flexRowEnd: CSSProperties = {
|
|
61
|
-
flexDirection: 'row',
|
|
62
|
-
justifyContent: 'flex-end',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const spaceBetween: CSSProperties = {
|
|
67
|
-
justifyContent: 'space-between',
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const flexRowSpaceBetween: CSSProperties = {
|
|
71
|
-
flexDirection: 'row',
|
|
72
|
-
justifyContent: 'space-between',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const flexRowSpaceAround: CSSProperties = {
|
|
77
|
-
flexDirection: 'row',
|
|
78
|
-
justifyContent: 'space-around',
|
|
79
|
-
alignItems: 'center',
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const spaceEvenly: CSSProperties = {
|
|
83
|
-
justifyContent: 'space-evenly',
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const flexRowSpaceEvenly: CSSProperties = {
|
|
87
|
-
flexDirection: 'row',
|
|
88
|
-
justifyContent: 'space-evenly',
|
|
89
|
-
alignItems: 'center',
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export const flexColumnCenter: CSSProperties = {
|
|
93
|
-
flexDirection: 'column',
|
|
94
|
-
justifyContent: 'center',
|
|
95
|
-
alignItems: 'center',
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export const flexColumnSpaceAround: CSSProperties = {
|
|
99
|
-
flexDirection: 'column',
|
|
100
|
-
justifyContent: 'space-around',
|
|
101
|
-
alignItems: 'center',
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export const flexOff: CSSProperties = {
|
|
105
|
-
position: 'relative',
|
|
106
|
-
};
|
package/src/core/flex/index.ts
DELETED
package/src/core/hooks/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
export const useMedia = <T>(queries: string[], values: T[], defaultValue: T) => {
|
|
4
|
-
// Array containing a media query list for each query
|
|
5
|
-
const mediaQueryLists = queries.map((q) => window.matchMedia(q));
|
|
6
|
-
// Function that gets value based on matching media query
|
|
7
|
-
const getValue = () => {
|
|
8
|
-
// Get index of first media query that matches
|
|
9
|
-
const index = mediaQueryLists.findIndex((mql) => mql.matches);
|
|
10
|
-
// Return related value or defaultValue if none
|
|
11
|
-
return values?.[index] || defaultValue;
|
|
12
|
-
};
|
|
13
|
-
// State and setter for matched value
|
|
14
|
-
const [value, setValue] = useState<T>(getValue);
|
|
15
|
-
useEffect(
|
|
16
|
-
() => {
|
|
17
|
-
// Event listener callback
|
|
18
|
-
// Note: By defining getValue outside of useEffect we ensure that it has ...
|
|
19
|
-
// ... current values of hook args (as this hook callback is created once on mount).
|
|
20
|
-
const handler = () => setValue(getValue);
|
|
21
|
-
// Set a listener for each media query with above handler as callback.
|
|
22
|
-
mediaQueryLists.forEach((mql) => mql.addListener(handler));
|
|
23
|
-
// Remove listeners on cleanup
|
|
24
|
-
return () => mediaQueryLists.forEach((mql) => mql.removeListener(handler));
|
|
25
|
-
},
|
|
26
|
-
[] // Empty array ensures effect is only run on mount and unmount
|
|
27
|
-
);
|
|
28
|
-
return value;
|
|
29
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useMemo, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
type InitialState = boolean | (() => boolean);
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* React hook to manage boolean (on - off) states
|
|
7
|
-
*
|
|
8
|
-
* @param initialState the initial boolean state value
|
|
9
|
-
*
|
|
10
|
-
* @see Docs https://chakra-ui.com/docs/hooks/use-boolean
|
|
11
|
-
*/
|
|
12
|
-
export function useToggle(initialState: InitialState = false) {
|
|
13
|
-
const [value, setValue] = useState(initialState);
|
|
14
|
-
const callbacks = useMemo(
|
|
15
|
-
() => ({
|
|
16
|
-
on: () => setValue(true),
|
|
17
|
-
off: () => setValue(false),
|
|
18
|
-
toggle: () => setValue((prev) => !prev),
|
|
19
|
-
}),
|
|
20
|
-
[]
|
|
21
|
-
);
|
|
22
|
-
return [value, callbacks] as const;
|
|
23
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ContentColorToken } from '@uni-design-system/uni-core';
|
|
3
|
-
|
|
4
|
-
import { useTheme } from '../theme';
|
|
5
|
-
import { IconDictionary, type IconName } from '@uni-design-system/uni-react-icons/dist/cjs/src';
|
|
6
|
-
|
|
7
|
-
export interface IconProps {
|
|
8
|
-
name?: IconName;
|
|
9
|
-
color?: ContentColorToken;
|
|
10
|
-
height?: number;
|
|
11
|
-
width?: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function Icon({ name, color = 'on-surface', height = 24, width = 24 }: IconProps) {
|
|
15
|
-
if (!name) return <></>;
|
|
16
|
-
const { colors } = useTheme();
|
|
17
|
-
const Icon = IconDictionary[name];
|
|
18
|
-
return <Icon width={width} height={height} color={colors[color]} />;
|
|
19
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Icon, IconProps } from './icon.component';
|
|
3
|
-
import { Button } from '../../components';
|
|
4
|
-
import { IconKeys, IconName } from './index';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Typography/Icons',
|
|
8
|
-
component: Icon,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const IconPlayground = (args: IconProps) => <Icon {...args} />;
|
|
12
|
-
|
|
13
|
-
IconPlayground.args = {
|
|
14
|
-
name: IconKeys[0],
|
|
15
|
-
height: 48,
|
|
16
|
-
width: 48,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const IconManifest = (): JSX.Element => {
|
|
20
|
-
const [filteredIcons, setFilteredIcons] = useState<string[]>(IconKeys);
|
|
21
|
-
|
|
22
|
-
const Filter = (filter: string): string[] => {
|
|
23
|
-
return IconKeys.filter((name: string) => name.toLowerCase().indexOf(filter.toLowerCase()) > -1);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const copyToClipboard = async (iconName: string): Promise<void> => {
|
|
27
|
-
await navigator.clipboard.writeText(iconName);
|
|
28
|
-
alert(`Copied ${iconName} to clipboard.`);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<div>
|
|
33
|
-
<input
|
|
34
|
-
onChange={(e): void => setFilteredIcons(Filter(e.target.value))}
|
|
35
|
-
placeholder="Filter Icons by Name"
|
|
36
|
-
/>
|
|
37
|
-
<div>
|
|
38
|
-
{filteredIcons.map((iconName) => {
|
|
39
|
-
return (
|
|
40
|
-
<Button
|
|
41
|
-
buttonType="icon"
|
|
42
|
-
iconName={iconName as IconName}
|
|
43
|
-
onClick={(): Promise<void> => copyToClipboard(iconName)}
|
|
44
|
-
>
|
|
45
|
-
{iconName}
|
|
46
|
-
</Button>
|
|
47
|
-
);
|
|
48
|
-
})}
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
};
|
package/src/core/icon/index.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { filterArgTypes } from '../filter/filter.argTypes';
|
|
2
|
-
|
|
3
|
-
export const imageArgTypes = {
|
|
4
|
-
url: {
|
|
5
|
-
control: { type: 'text' },
|
|
6
|
-
table: { summary: 'string' },
|
|
7
|
-
},
|
|
8
|
-
fit: {
|
|
9
|
-
options: ['contain', 'cover', 'fill', 'none', 'scale-down'],
|
|
10
|
-
control: { type: 'inline-radio' },
|
|
11
|
-
table: {
|
|
12
|
-
type: { summary: 'string literal' },
|
|
13
|
-
defaultValue: { summary: 'cover' },
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
height: {
|
|
17
|
-
control: { type: 'number' },
|
|
18
|
-
},
|
|
19
|
-
width: {
|
|
20
|
-
control: { type: 'number' },
|
|
21
|
-
},
|
|
22
|
-
...filterArgTypes,
|
|
23
|
-
};
|