@koine/react 2.0.0-beta.1 → 2.0.0-beta.11
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/Alert/Alert.mjs +19 -7
- package/Alert/Alert.stories.mjs +18 -0
- package/Animations/Reveal.mjs +39 -13
- package/Animations/Underline.d.ts +1 -1
- package/Animations/Underline.mjs +14 -4
- package/Animations/useReveal.mjs +42 -40
- package/Autocomplete/AutocompleteDownshift.mjs +156 -157
- package/Autocomplete/AutocompleteDownshiftMultiselect.mjs +351 -352
- package/Autocomplete/AutocompleteMui.d.ts +1 -1
- package/Autocomplete/AutocompleteMui.mjs +126 -89
- package/Autocomplete/AutocompleteReach.mjs +110 -111
- package/Autocomplete/components.d.ts +12 -16
- package/Autocomplete/components.mjs +76 -23
- package/Autocomplete/helpers.mjs +11 -5
- package/Autocomplete/index.mjs +4 -3
- package/Bg/BgColor.d.ts +2 -7
- package/Bg/BgColor.mjs +36 -15
- package/Bg/BgPhoto.mjs +66 -11
- package/Bg/BgSvg.mjs +17 -7
- package/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/Breadcrumbs/Breadcrumbs.mjs +82 -18
- package/Buttons/Button.d.ts +1 -1
- package/Buttons/Button.mjs +73 -9
- package/Buttons/ButtonComposite.d.ts +1 -1
- package/Buttons/ButtonComposite.mjs +99 -22
- package/Buttons/ButtonFab.d.ts +1 -3
- package/Buttons/ButtonFab.mjs +6 -4
- package/Buttons/ButtonLink.d.ts +1 -1
- package/Buttons/ButtonLink.mjs +14 -7
- package/Buttons/IconButton.d.ts +1 -3
- package/Buttons/IconButton.mjs +18 -6
- package/Calendar/CalendarDaygridCell.d.ts +2 -2
- package/Calendar/CalendarDaygridCell.mjs +64 -26
- package/Calendar/CalendarDaygridNav.d.ts +1 -1
- package/Calendar/CalendarDaygridNav.mjs +41 -12
- package/Calendar/CalendarDaygridTable.d.ts +3 -3
- package/Calendar/CalendarDaygridTable.mjs +97 -30
- package/Calendar/CalendarLegend.d.ts +1 -1
- package/Calendar/CalendarLegend.mjs +20 -6
- package/Calendar/calendar-api-google.d.ts +1 -1
- package/Calendar/calendar-api-google.mjs +75 -105
- package/Calendar/types.mjs +1 -1
- package/Calendar/useCalendar.d.ts +2 -2
- package/Calendar/useCalendar.mjs +184 -142
- package/Calendar/utils.mjs +101 -94
- package/Carousel/Carousel.mjs +377 -378
- package/Carousel/CarouselCss.d.ts +3 -20
- package/Carousel/CarouselCss.mjs +38 -16
- package/Collapsable/Collapsable.mjs +1 -1
- package/Collapsable/CollapsableReach.mjs +1 -3
- package/Collapsable/index.mjs +1 -2
- package/Debug/Debug.mjs +20 -6
- package/Details/Details.d.ts +5 -5
- package/Details/Details.mjs +64 -37
- package/Details/Details.stories.mjs +21 -0
- package/Dialog/DialogMui.d.ts +10 -327
- package/Dialog/DialogMui.mjs +50 -25
- package/Dialog/DialogMui.stories.mjs +20 -0
- package/Dialog/css/bare.d.ts +9 -327
- package/Dialog/css/bare.mjs +15 -17
- package/Dialog/css/index.stories.mjs +75 -0
- package/Dialog/m/bare.d.ts +2 -398
- package/Dialog/m/bare.mjs +114 -51
- package/Dialog/m/basic.mjs +10 -10
- package/Dialog/m/index.mjs +4 -4
- package/Dialog/sc/bare.d.ts +27 -405
- package/Dialog/sc/bare.mjs +40 -29
- package/Dialog/sc/framer.d.ts +15 -422
- package/Dialog/sc/framer.mjs +9 -9
- package/Dialog/sc/framerMaterial.d.ts +15 -422
- package/Dialog/sc/framerMaterial.mjs +9 -9
- package/Dialog/sc/index.stories.mjs +48 -0
- package/Dialog/sc/material.d.ts +27 -405
- package/Dialog/sc/material.mjs +37 -17
- package/Dialog/tw/bare.d.ts +9 -327
- package/Dialog/tw/bare.mjs +15 -28
- package/Dialog/tw/elegant.d.ts +9 -327
- package/Dialog/tw/elegant.mjs +15 -17
- package/Dialog/tw/framer.d.ts +3 -354
- package/Dialog/tw/framer.mjs +9 -9
- package/Dialog/tw/framerMaterial.d.ts +3 -354
- package/Dialog/tw/framerMaterial.mjs +9 -9
- package/Dialog/tw/index.stories.mjs +83 -0
- package/Dialog/tw/material.d.ts +9 -327
- package/Dialog/tw/material.mjs +15 -17
- package/Editor/Editor--tiptap.d.ts +1 -1
- package/Editor/Editor--tiptap.mjs +45 -18
- package/Editor/components.d.ts +3 -5
- package/Editor/components.mjs +26 -8
- package/FaviconTags.mjs +64 -0
- package/Form/Form.mjs +81 -47
- package/Form/sc/bare.d.ts +11 -11
- package/Form/sc/bare.mjs +21 -12
- package/Forms/Checkbox/Checkbox.d.ts +4 -4
- package/Forms/Checkbox/Checkbox.mjs +29 -11
- package/Forms/Feedback/Feedback.mjs +11 -6
- package/Forms/Field/Field.d.ts +2 -4
- package/Forms/Field/Field.mjs +35 -16
- package/Forms/Field/FieldControl.mjs +39 -19
- package/Forms/Field/FieldHint.d.ts +1 -1
- package/Forms/Field/FieldHint.mjs +5 -3
- package/Forms/Input/Input.d.ts +5 -5
- package/Forms/Input/Input.mjs +30 -11
- package/Forms/InputGroup/InputGroup.d.ts +4 -4
- package/Forms/InputGroup/InputGroup.mjs +52 -10
- package/Forms/Label/Label.d.ts +1 -1
- package/Forms/Label/Label.mjs +23 -5
- package/Forms/Password/Password.d.ts +1 -1
- package/Forms/Password/Password.mjs +48 -12
- package/Forms/Radio/Radio.mjs +50 -18
- package/Forms/Switch/Switch.d.ts +2 -2
- package/Forms/Switch/Switch.mjs +52 -12
- package/Forms/Textarea/Textarea.d.ts +1 -1
- package/Forms/Textarea/Textarea.mjs +21 -7
- package/Forms/Textarea/TextareaRich.mjs +39 -19
- package/Forms/Toggle/Toggle-tailwind.mjs +0 -1
- package/Forms/Toggle/Toggle.d.ts +7 -7
- package/Forms/Toggle/Toggle.mjs +113 -21
- package/Forms/Toggle/useToggle-tailwind.mjs +0 -1
- package/Forms/Toggle/useToggle.mjs +86 -68
- package/Forms/antispam.mjs +19 -21
- package/Forms/helpers.mjs +25 -19
- package/Forms/styles.d.ts +3 -7
- package/Forms/styles.mjs +50 -18
- package/Gauge/Gauge.mjs +99 -100
- package/Grid/Grid.d.ts +7 -30
- package/Grid/Grid.mjs +54 -32
- package/Hamburger/Hamburger.mjs +64 -37
- package/Header/useHeader.mjs +23 -18
- package/Hidden/Hidden.d.ts +1 -1
- package/Hidden/Hidden.mjs +9 -9
- package/Img/sc/bare.d.ts +1 -1
- package/Img/sc/bare.mjs +31 -34
- package/Img/types.mjs +1 -1
- package/Link/Link.d.ts +1 -3
- package/Link/Link.mjs +1 -3
- package/Link/LinkBlank.d.ts +2 -5
- package/Link/LinkBlank.mjs +25 -10
- package/Menu/Menu.d.ts +1 -1
- package/Menu/Menu.mjs +10 -3
- package/Menu/MenuMui.mjs +1 -2
- package/MenuItem/MenuItem.d.ts +1 -4
- package/MenuItem/MenuItem.mjs +19 -3
- package/MenuItem/MenuItemMui.mjs +0 -1
- package/MenuItem/useMenuItem.mjs +45 -27
- package/Meta/Meta.mjs +5 -3
- package/NoJs/NoJs.mjs +7 -4
- package/Pagination/PaginationNav.d.ts +1 -1
- package/Pagination/PaginationNav.mjs +90 -29
- package/Pagination/PaginationResults.mjs +31 -8
- package/Pill/Pill.d.ts +4 -4
- package/Pill/Pill.mjs +36 -6
- package/Progress/ProgressCircular.mjs +48 -10
- package/Progress/ProgressLinear.mjs +39 -19
- package/Progress/ProgressOverlay.mjs +56 -16
- package/Rating/Rating.d.ts +5 -5
- package/Rating/Rating.mjs +118 -34
- package/Rating/index.mjs +37 -24
- package/Select/SelectDownshift.mjs +37 -38
- package/Select/components.d.ts +1 -1
- package/Select/components.mjs +21 -8
- package/Select/index.mjs +2 -3
- package/Sidebar/Sidebar.mjs +57 -17
- package/Spacing/Spacing.d.ts +1 -1
- package/Spacing/Spacing.mjs +27 -17
- package/Sticky/Sticky.mjs +218 -219
- package/Sticky/StickyCss.mjs +8 -4
- package/Sticky/index.mjs +1 -1
- package/Tabs/TabsMui.d.ts +9 -298
- package/Tabs/TabsMui.mjs +39 -27
- package/Tabs/TabsMui.stories.mjs +20 -0
- package/Tabs/sc/bare.mjs +1 -3
- package/Tabs/sc/index.stories.mjs +0 -0
- package/Tabs/tw/bare.d.ts +7 -296
- package/Tabs/tw/bare.mjs +11 -13
- package/Tabs/tw/index.stories.mjs +25 -0
- package/Tabs/tw/material.d.ts +7 -332
- package/Tabs/tw/material.mjs +11 -15
- package/Tabs/useTabs.mjs +24 -21
- package/Typography/CopyPasteVisible.d.ts +1 -1
- package/Typography/CopyPasteVisible.mjs +5 -3
- package/Typography/Native.d.ts +5 -5
- package/Typography/Native.mjs +45 -12
- package/Typography/ReadMore.mjs +100 -29
- package/Typography/TextLoop.mjs +75 -31
- package/Typography/TypeStairs.mjs +36 -24
- package/css/index.mjs +20 -21
- package/helpers/classed.mjs +21 -30
- package/helpers/classed.stories.mjs +121 -0
- package/helpers/createUseMediaQueryWidth.mjs +140 -140
- package/helpers/extend-component.mjs +7 -7
- package/helpers/mergeRefs.mjs +3 -4
- package/hooks/index.mjs +3 -3
- package/hooks/types.mjs +3 -1
- package/hooks/useAsyncFn.mjs +28 -26
- package/hooks/useDateLocale.mjs +22 -22
- package/hooks/useFirstMountState.mjs +2 -3
- package/hooks/useFixedOffset.mjs +23 -24
- package/hooks/useFocus.mjs +7 -5
- package/hooks/useInterval.mjs +15 -14
- package/hooks/useIsomorphicLayoutEffect.mjs +1 -4
- package/hooks/useKeyUp.mjs +9 -11
- package/hooks/useMeasure.mjs +74 -67
- package/hooks/useMountedState.mjs +5 -6
- package/hooks/useNavigateAway.mjs +26 -25
- package/hooks/usePrevious.mjs +9 -4
- package/hooks/usePreviousRef.mjs +2 -2
- package/hooks/useScrollPosition.mjs +28 -26
- package/hooks/useScrollThreshold.mjs +18 -13
- package/hooks/useScrollTo.mjs +6 -8
- package/hooks/useSmoothScroll.mjs +12 -16
- package/hooks/useSpinDelay.mjs +24 -22
- package/hooks/useTraceUpdate.mjs +8 -7
- package/hooks/useUpdateEffect.mjs +4 -5
- package/hooks/useWindowSize.mjs +13 -10
- package/index.mjs +4 -5
- package/m/MotionProvider.mjs +5 -4
- package/m/index.mjs +1 -2
- package/package.json +17 -18
- package/shared/index.mjs +35 -0
- package/styles/Body.d.ts +2 -2
- package/styles/Body.mjs +8 -5
- package/styles/Global.mjs +36 -5
- package/styles/index.mjs +5 -5
- package/styles/media.mjs +63 -68
- package/styles/spacing.mjs +26 -25
- package/styles/styled.mjs +23 -10
- package/styles/theme--vanilla.mjs +26 -19
- package/styles/theme.mjs +16 -19
- package/tw/index.mjs +20 -21
- package/twm/index.mjs +20 -21
- package/types.mjs +1 -1
- package/typings.d.ts +1 -0
- package/Alert/Alert.js +0 -14
- package/Alert/index.js +0 -4
- package/Alert/package.json +0 -6
- package/Animations/Reveal.js +0 -21
- package/Animations/Underline.js +0 -8
- package/Animations/index.js +0 -6
- package/Animations/package.json +0 -6
- package/Animations/useReveal.js +0 -75
- package/Autocomplete/AutocompleteDownshift.js +0 -161
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -356
- package/Autocomplete/AutocompleteMui.js +0 -180
- package/Autocomplete/AutocompleteReach.js +0 -115
- package/Autocomplete/components.js +0 -37
- package/Autocomplete/helpers.js +0 -34
- package/Autocomplete/index.js +0 -7
- package/Autocomplete/package.json +0 -6
- package/Bg/BgColor.js +0 -25
- package/Bg/BgPhoto.js +0 -20
- package/Bg/BgSvg.js +0 -16
- package/Bg/index.js +0 -6
- package/Bg/package.json +0 -6
- package/Breadcrumbs/Breadcrumbs.js +0 -31
- package/Breadcrumbs/index.js +0 -4
- package/Breadcrumbs/package.json +0 -6
- package/Buttons/Button.js +0 -17
- package/Buttons/ButtonComposite.js +0 -32
- package/Buttons/ButtonFab.js +0 -9
- package/Buttons/ButtonLink.js +0 -15
- package/Buttons/IconButton.js +0 -10
- package/Buttons/index.js +0 -8
- package/Buttons/package.json +0 -6
- package/Calendar/CalendarDaygridCell.js +0 -61
- package/Calendar/CalendarDaygridNav.js +0 -28
- package/Calendar/CalendarDaygridTable.js +0 -52
- package/Calendar/CalendarLegend.js +0 -19
- package/Calendar/calendar-api-google.js +0 -133
- package/Calendar/index.js +0 -9
- package/Calendar/package.json +0 -6
- package/Calendar/types.js +0 -2
- package/Calendar/useCalendar.js +0 -187
- package/Calendar/utils.js +0 -215
- package/Carousel/Carousel.js +0 -381
- package/Carousel/CarouselCss.js +0 -26
- package/Carousel/index.js +0 -4
- package/Carousel/package.json +0 -6
- package/Collapsable/Collapsable.js +0 -4
- package/Collapsable/CollapsableReach.js +0 -252
- package/Collapsable/index.js +0 -5
- package/Collapsable/package.json +0 -6
- package/Debug/Debug.js +0 -13
- package/Debug/index.js +0 -4
- package/Debug/package.json +0 -6
- package/Details/Details.js +0 -66
- package/Details/index.js +0 -4
- package/Details/package.json +0 -6
- package/Dialog/DialogMui.js +0 -83
- package/Dialog/css/bare.js +0 -24
- package/Dialog/index.js +0 -5
- package/Dialog/m/bare.js +0 -55
- package/Dialog/m/basic.js +0 -35
- package/Dialog/m/index.js +0 -8
- package/Dialog/m/package.json +0 -6
- package/Dialog/package.json +0 -6
- package/Dialog/sc/bare.js +0 -46
- package/Dialog/sc/framer.js +0 -19
- package/Dialog/sc/framerMaterial.js +0 -19
- package/Dialog/sc/material.js +0 -24
- package/Dialog/tw/bare.js +0 -45
- package/Dialog/tw/elegant.js +0 -23
- package/Dialog/tw/framer.js +0 -19
- package/Dialog/tw/framerMaterial.js +0 -19
- package/Dialog/tw/material.js +0 -23
- package/Editor/Editor--tiptap.js +0 -31
- package/Editor/components.js +0 -15
- package/Editor/index.js +0 -4
- package/Editor/package.json +0 -6
- package/FaviconTags/FaviconTags.js +0 -20
- package/FaviconTags/FaviconTags.mjs +0 -16
- package/FaviconTags/index.d.ts +0 -2
- package/FaviconTags/index.js +0 -7
- package/FaviconTags/index.mjs +0 -2
- package/FaviconTags/package.json +0 -6
- package/Form/Form.js +0 -65
- package/Form/index.js +0 -4
- package/Form/package.json +0 -6
- package/Form/sc/bare.js +0 -23
- package/Forms/Checkbox/Checkbox.js +0 -21
- package/Forms/Checkbox/index.js +0 -4
- package/Forms/Checkbox/package.json +0 -6
- package/Forms/Feedback/Feedback.js +0 -13
- package/Forms/Feedback/index.js +0 -4
- package/Forms/Feedback/package.json +0 -6
- package/Forms/Field/Field.js +0 -35
- package/Forms/Field/FieldControl.js +0 -51
- package/Forms/Field/FieldHint.js +0 -7
- package/Forms/Field/index.js +0 -5
- package/Forms/Field/package.json +0 -6
- package/Forms/Input/Input.js +0 -20
- package/Forms/Input/index.js +0 -4
- package/Forms/Input/package.json +0 -6
- package/Forms/InputGroup/InputGroup.js +0 -19
- package/Forms/InputGroup/index.js +0 -4
- package/Forms/InputGroup/package.json +0 -6
- package/Forms/Label/Label.js +0 -9
- package/Forms/Label/index.js +0 -4
- package/Forms/Label/package.json +0 -6
- package/Forms/Password/Password.js +0 -20
- package/Forms/Password/index.js +0 -4
- package/Forms/Password/package.json +0 -6
- package/Forms/Radio/Radio.js +0 -28
- package/Forms/Radio/index.js +0 -4
- package/Forms/Radio/package.json +0 -6
- package/Forms/Switch/Switch.js +0 -23
- package/Forms/Switch/index.js +0 -4
- package/Forms/Switch/package.json +0 -6
- package/Forms/Textarea/Textarea.js +0 -15
- package/Forms/Textarea/TextareaRich.js +0 -31
- package/Forms/Textarea/index.js +0 -5
- package/Forms/Textarea/package.json +0 -6
- package/Forms/Toggle/Toggle-tailwind.js +0 -99
- package/Forms/Toggle/Toggle.js +0 -36
- package/Forms/Toggle/index.js +0 -4
- package/Forms/Toggle/package.json +0 -6
- package/Forms/Toggle/useToggle-tailwind.js +0 -202
- package/Forms/Toggle/useToggle.js +0 -149
- package/Forms/antispam.js +0 -66
- package/Forms/helpers.js +0 -54
- package/Forms/index.js +0 -19
- package/Forms/package.json +0 -6
- package/Forms/styles.js +0 -32
- package/Gauge/Gauge.js +0 -106
- package/Grid/Grid.js +0 -56
- package/Grid/index.js +0 -4
- package/Grid/package.json +0 -6
- package/Hamburger/Hamburger.js +0 -56
- package/Hamburger/index.js +0 -4
- package/Hamburger/package.json +0 -6
- package/Header/index.js +0 -4
- package/Header/package.json +0 -6
- package/Header/useHeader.js +0 -35
- package/Hidden/Hidden.js +0 -13
- package/Hidden/index.js +0 -4
- package/Hidden/package.json +0 -6
- package/Img/index.js +0 -4
- package/Img/package.json +0 -6
- package/Img/sc/bare.js +0 -42
- package/Img/types.js +0 -2
- package/Link/Link.js +0 -7
- package/Link/LinkBlank.js +0 -21
- package/Link/index.js +0 -5
- package/Link/package.json +0 -6
- package/Menu/Menu.js +0 -7
- package/Menu/MenuMui.js +0 -165
- package/Menu/index.js +0 -4
- package/Menu/package.json +0 -6
- package/MenuItem/MenuItem.js +0 -7
- package/MenuItem/MenuItemMui.js +0 -32
- package/MenuItem/index.js +0 -4
- package/MenuItem/package.json +0 -6
- package/MenuItem/useMenuItem.js +0 -64
- package/Meta/Meta.js +0 -10
- package/Meta/index.js +0 -7
- package/Meta/package.json +0 -6
- package/NoJs/NoJs.js +0 -11
- package/NoJs/index.js +0 -7
- package/NoJs/package.json +0 -6
- package/Pagination/PaginationNav.js +0 -65
- package/Pagination/PaginationResults.js +0 -15
- package/Pagination/index.js +0 -5
- package/Pagination/package.json +0 -6
- package/Pill/Pill.js +0 -10
- package/Pill/index.js +0 -4
- package/Pill/package.json +0 -6
- package/Progress/ProgressCircular.js +0 -19
- package/Progress/ProgressLinear.js +0 -28
- package/Progress/ProgressOverlay.js +0 -28
- package/Progress/index.js +0 -6
- package/Progress/package.json +0 -6
- package/Rating/Rating.js +0 -75
- package/Rating/index.js +0 -57
- package/Rating/package.json +0 -6
- package/Select/SelectDownshift.js +0 -41
- package/Select/components.js +0 -15
- package/Select/index.js +0 -7
- package/Select/package.json +0 -6
- package/Sidebar/Sidebar.js +0 -27
- package/Sidebar/index.js +0 -4
- package/Sidebar/package.json +0 -6
- package/Spacing/Spacing.js +0 -49
- package/Spacing/index.js +0 -4
- package/Spacing/package.json +0 -6
- package/Sticky/Sticky.js +0 -222
- package/Sticky/StickyCss.js +0 -10
- package/Sticky/index.js +0 -5
- package/Sticky/package.json +0 -6
- package/Tabs/TabsMui.js +0 -52
- package/Tabs/index.js +0 -4
- package/Tabs/package.json +0 -6
- package/Tabs/sc/bare.js +0 -87
- package/Tabs/tw/bare.js +0 -20
- package/Tabs/tw/material.js +0 -21
- package/Tabs/useTabs.js +0 -47
- package/Typography/CopyPasteVisible.js +0 -7
- package/Typography/Native.js +0 -17
- package/Typography/ReadMore.js +0 -47
- package/Typography/TextLoop.js +0 -51
- package/Typography/TypeStairs.js +0 -52
- package/Typography/index.js +0 -8
- package/Typography/package.json +0 -6
- package/css/index.js +0 -36
- package/css/package.json +0 -6
- package/helpers/classed.js +0 -78
- package/helpers/createUseMediaQueryWidth.js +0 -183
- package/helpers/extend-component.js +0 -17
- package/helpers/index.js +0 -7
- package/helpers/mergeRefs.js +0 -17
- package/helpers/package.json +0 -6
- package/hooks/index.js +0 -44
- package/hooks/package.json +0 -6
- package/hooks/types.js +0 -2
- package/hooks/useAsyncFn.js +0 -41
- package/hooks/useDateLocale.js +0 -41
- package/hooks/useFirstMountState.js +0 -17
- package/hooks/useFixedOffset.js +0 -62
- package/hooks/useFocus.js +0 -16
- package/hooks/useInterval.js +0 -32
- package/hooks/useIsomorphicLayoutEffect.js +0 -13
- package/hooks/useKeyUp.js +0 -27
- package/hooks/useMeasure.js +0 -171
- package/hooks/useMountedState.js +0 -20
- package/hooks/useNavigateAway.js +0 -73
- package/hooks/usePrevious.js +0 -16
- package/hooks/usePreviousRef.js +0 -13
- package/hooks/useScrollPosition.js +0 -73
- package/hooks/useScrollThreshold.js +0 -33
- package/hooks/useScrollTo.js +0 -27
- package/hooks/useSmoothScroll.js +0 -44
- package/hooks/useSpinDelay.js +0 -54
- package/hooks/useTraceUpdate.js +0 -26
- package/hooks/useUpdateEffect.js +0 -19
- package/hooks/useWindowSize.js +0 -34
- package/index.js +0 -8
- package/m/MotionProvider.js +0 -43
- package/m/index.js +0 -9
- package/m/lite.js +0 -4
- package/m/max.js +0 -4
- package/m/package.json +0 -6
- package/sc/index.js +0 -37
- package/sc/package.json +0 -6
- package/scm/index.js +0 -36
- package/scm/package.json +0 -6
- package/shared/index.js +0 -11
- package/shared/package.json +0 -6
- package/styles/Body.js +0 -16
- package/styles/Global.js +0 -21
- package/styles/index.js +0 -41
- package/styles/media.js +0 -161
- package/styles/package.json +0 -6
- package/styles/spacing.js +0 -52
- package/styles/styled.js +0 -17
- package/styles/theme--vanilla.js +0 -64
- package/styles/theme.js +0 -45
- package/tw/index.js +0 -36
- package/tw/package.json +0 -6
- package/twm/index.js +0 -36
- package/twm/package.json +0 -6
- package/types.js +0 -2
- /package/{FaviconTags/FaviconTags.d.ts → FaviconTags.d.ts} +0 -0
package/hooks/useWindowSize.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useWindowSize = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
var listenResize_1 = tslib_1.__importDefault(require("@koine/dom/listenResize"));
|
|
7
|
-
var listenResizeDebounced_1 = tslib_1.__importDefault(require("@koine/dom/listenResizeDebounced"));
|
|
8
|
-
/**
|
|
9
|
-
* # Use `window` size
|
|
10
|
-
*
|
|
11
|
-
* @param args Optionally pass {@link debounce} arguments (`wait` and `immediate`)
|
|
12
|
-
*
|
|
13
|
-
* @returns An array with:
|
|
14
|
-
* 1) _width_: using `window.innerWidth`
|
|
15
|
-
* 2) _height_: using `window.innerHeight`
|
|
16
|
-
*/
|
|
17
|
-
function useWindowSize(wait, immediate) {
|
|
18
|
-
var _a = (0, react_1.useState)(0), width = _a[0], widthSet = _a[1];
|
|
19
|
-
var _b = (0, react_1.useState)(0), height = _b[0], heightSet = _b[1];
|
|
20
|
-
(0, react_1.useEffect)(function () {
|
|
21
|
-
function updateSize() {
|
|
22
|
-
widthSet(window.innerWidth);
|
|
23
|
-
heightSet(window.innerHeight);
|
|
24
|
-
}
|
|
25
|
-
var listener = wait
|
|
26
|
-
? (0, listenResizeDebounced_1.default)(0, updateSize, wait, immediate)
|
|
27
|
-
: (0, listenResize_1.default)(updateSize);
|
|
28
|
-
updateSize();
|
|
29
|
-
return listener;
|
|
30
|
-
}, [wait, immediate]);
|
|
31
|
-
return [width, height];
|
|
32
|
-
}
|
|
33
|
-
exports.useWindowSize = useWindowSize;
|
|
34
|
-
exports.default = useWindowSize;
|
package/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./shared"), exports);
|
|
5
|
-
// we need to alias the star export otherwise the named exports would collide
|
|
6
|
-
// export * as css from "./css";
|
|
7
|
-
// export * as sc from "./sc";
|
|
8
|
-
// export * as tw from "./tw";
|
package/m/MotionProvider.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MotionProvider = void 0;
|
|
4
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
var framer_motion_1 = require("framer-motion");
|
|
6
|
-
/**
|
|
7
|
-
* `<LazyMotion />` provider wrapper from `framer-motion`
|
|
8
|
-
*
|
|
9
|
-
* @see https://www.framer.com/docs/guide-reduce-bundle-size/
|
|
10
|
-
*
|
|
11
|
-
* About the difference between `lite` and `max`
|
|
12
|
-
* @see https://www.framer.com/docs/guide-reduce-bundle-size/#available-features
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* `lite` version:
|
|
17
|
-
* ```tsx
|
|
18
|
-
* import { MotionProvider } from "@koine/react/m";
|
|
19
|
-
*
|
|
20
|
-
* const features = () => import("@koine/react/m/lite").then((m) => m.default);
|
|
21
|
-
*
|
|
22
|
-
* <MotionProvider features={features}>
|
|
23
|
-
* <App />
|
|
24
|
-
* </MotionProvider>
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* ### `max` version
|
|
28
|
-
* ```tsx
|
|
29
|
-
* import { MotionProvider } from "@koine/react/m";
|
|
30
|
-
*
|
|
31
|
-
* const features = () => import("@koine/react/m/max").then((m) => m.default);
|
|
32
|
-
*
|
|
33
|
-
* <MotionProvider features={features}>
|
|
34
|
-
* <App />
|
|
35
|
-
* </MotionProvider>
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
var MotionProvider = function (_a) {
|
|
39
|
-
var features = _a.features, children = _a.children;
|
|
40
|
-
return (0, jsx_runtime_1.jsx)(framer_motion_1.LazyMotion, { features: features, children: children });
|
|
41
|
-
};
|
|
42
|
-
exports.MotionProvider = MotionProvider;
|
|
43
|
-
exports.default = exports.MotionProvider;
|
package/m/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file
|
|
4
|
-
*
|
|
5
|
-
* In this file we only have exports related to `framer-motion`
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
var tslib_1 = require("tslib");
|
|
9
|
-
tslib_1.__exportStar(require("./MotionProvider"), exports);
|
package/m/lite.js
DELETED
package/m/max.js
DELETED
package/m/package.json
DELETED
package/sc/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KoineForm = exports.KoineDialog = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
tslib_1.__exportStar(require("../shared"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("../Alert"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("../Animations"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("../Autocomplete"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("../Bg"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("../Breadcrumbs"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("../Buttons"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("../Carousel"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("../Collapsable"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("../Debug"), exports);
|
|
15
|
-
var bare_1 = require("../Dialog/sc/bare");
|
|
16
|
-
Object.defineProperty(exports, "KoineDialog", { enumerable: true, get: function () { return bare_1.KoineDialog; } });
|
|
17
|
-
var bare_2 = require("../Form/sc/bare");
|
|
18
|
-
Object.defineProperty(exports, "KoineForm", { enumerable: true, get: function () { return bare_2.KoineForm; } });
|
|
19
|
-
tslib_1.__exportStar(require("../Forms"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("../Grid"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("../Hamburger"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("../Header"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("../Hidden"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("../Img"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("../Link"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("../MenuItem"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("../Pagination"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("../Pill"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("../Progress"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("../Rating"), exports);
|
|
31
|
-
// export * from "../Select";
|
|
32
|
-
tslib_1.__exportStar(require("../Sidebar"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("../Spacing"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("../Sticky"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("../styles"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("../Tabs"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("../Typography"), exports);
|
package/sc/package.json
DELETED
package/scm/index.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KoineDialog = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
tslib_1.__exportStar(require("../shared"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("../Alert"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("../Animations"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("../Autocomplete"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("../Bg"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("../Breadcrumbs"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("../Buttons"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("../Carousel"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("../Collapsable"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("../Debug"), exports);
|
|
15
|
-
var framer_1 = require("../Dialog/sc/framer");
|
|
16
|
-
Object.defineProperty(exports, "KoineDialog", { enumerable: true, get: function () { return framer_1.KoineDialog; } });
|
|
17
|
-
// export { KoineForm, type KoineFormProps} from "../Form/sc/framer";
|
|
18
|
-
tslib_1.__exportStar(require("../Forms"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("../Grid"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("../Hamburger"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("../Header"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("../Hidden"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("../Img"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("../Link"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("../MenuItem"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("../Pagination"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("../Pill"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("../Progress"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("../Rating"), exports);
|
|
30
|
-
// export * from "../Select";
|
|
31
|
-
tslib_1.__exportStar(require("../Sidebar"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("../Spacing"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("../Sticky"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("../styles"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("../Tabs"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("../Typography"), exports);
|
package/scm/package.json
DELETED
package/shared/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("../Calendar"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("../Dialog"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("../FaviconTags"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("../helpers"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("../hooks"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("../Meta"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("../NoJs"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("../types"), exports);
|
package/shared/package.json
DELETED
package/styles/Body.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BodyMain = exports.BodyRoot = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
exports.BodyRoot = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n"], ["\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n"])));
|
|
7
|
-
/**
|
|
8
|
-
* If you have background graphics to overlap you might need to add:
|
|
9
|
-
*
|
|
10
|
-
* ```css
|
|
11
|
-
* z-index: 1;
|
|
12
|
-
* position: relative;
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
exports.BodyMain = styled_components_1.default.main(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
|
|
16
|
-
var templateObject_1, templateObject_2;
|
package/styles/Global.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StylesGlobal = exports.stylesGlobal = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = require("styled-components");
|
|
6
|
-
/**
|
|
7
|
-
* App global style
|
|
8
|
-
*
|
|
9
|
-
* For examples of what to do here take a look at [Bootstrap's reset](https://github.com/twbs/bootstrap/blob/main/scss/_reboot.scss)
|
|
10
|
-
* and similar.
|
|
11
|
-
*
|
|
12
|
-
* What we do here:
|
|
13
|
-
* - set the base font family on all possible elements including placeholders prevent Chrome showing a standard font when using the autofill feature
|
|
14
|
-
* - @see https://stackoverflow.com/a/60987373/1938970
|
|
15
|
-
* - set the base font size on all possible elements to prevent weird zooming on input fields on iPhone iOS devices.
|
|
16
|
-
* - @see https://www.warrenchandler.com/2019/04/02/stop-iphones-from-zooming-in-on-form-fields/
|
|
17
|
-
* - @see https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/
|
|
18
|
-
*/
|
|
19
|
-
exports.stylesGlobal = "\n body {\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n\n body,\n button,\n input,\n textarea,\n select,\n select:-webkit-autofill::first-line,\n input:-webkit-autofill::first-line {\n font-family: var(--font), -apple-system, BlinkMacSystemFont, \"Segoe UI\",\n Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\",\n sans-serif;\n font-size: var(--fontSize);\n }\n\n html {\n box-sizing: border-box;\n @media (prefers-reduced-motion: no-preference) {\n scroll-behavior: smooth;\n }\n }\n\n *,\n *:before,\n *:after {\n box-sizing: inherit;\n -webkit-tap-highlight-color: transparent;\n }\n";
|
|
20
|
-
exports.StylesGlobal = (0, styled_components_1.createGlobalStyle)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["", ""], ["", ""])), exports.stylesGlobal);
|
|
21
|
-
var templateObject_1;
|
package/styles/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInitialThemeFromClient = exports.ThemeVanillaProvider = exports.ThemeVanillaContext = exports.THEME_KEY = exports.THEME_DEFAULT = exports.useTheme = exports.createTheme = exports.breakpoints = exports.stateFocus = exports.overlay = exports.invisible = exports.inset0 = exports.ellipsis = exports.centered = exports.colStretch = exports.spacingVertical = exports.spacingTop = exports.spacingBottom = exports.spacing = exports.useMedia = exports.up = exports.only = exports.min = exports.max = exports.generateMediaQueries = exports.down = exports.between = exports.stylesGlobal = exports.StylesGlobal = exports.BodyRoot = exports.BodyMain = void 0;
|
|
4
|
-
var Body_1 = require("./Body");
|
|
5
|
-
Object.defineProperty(exports, "BodyMain", { enumerable: true, get: function () { return Body_1.BodyMain; } });
|
|
6
|
-
Object.defineProperty(exports, "BodyRoot", { enumerable: true, get: function () { return Body_1.BodyRoot; } });
|
|
7
|
-
var Global_1 = require("./Global");
|
|
8
|
-
Object.defineProperty(exports, "StylesGlobal", { enumerable: true, get: function () { return Global_1.StylesGlobal; } });
|
|
9
|
-
Object.defineProperty(exports, "stylesGlobal", { enumerable: true, get: function () { return Global_1.stylesGlobal; } });
|
|
10
|
-
var media_1 = require("./media");
|
|
11
|
-
Object.defineProperty(exports, "between", { enumerable: true, get: function () { return media_1.between; } });
|
|
12
|
-
Object.defineProperty(exports, "down", { enumerable: true, get: function () { return media_1.down; } });
|
|
13
|
-
Object.defineProperty(exports, "generateMediaQueries", { enumerable: true, get: function () { return media_1.generateMediaQueries; } });
|
|
14
|
-
Object.defineProperty(exports, "max", { enumerable: true, get: function () { return media_1.max; } });
|
|
15
|
-
Object.defineProperty(exports, "min", { enumerable: true, get: function () { return media_1.min; } });
|
|
16
|
-
Object.defineProperty(exports, "only", { enumerable: true, get: function () { return media_1.only; } });
|
|
17
|
-
Object.defineProperty(exports, "up", { enumerable: true, get: function () { return media_1.up; } });
|
|
18
|
-
Object.defineProperty(exports, "useMedia", { enumerable: true, get: function () { return media_1.useMedia; } });
|
|
19
|
-
var spacing_1 = require("./spacing");
|
|
20
|
-
Object.defineProperty(exports, "spacing", { enumerable: true, get: function () { return spacing_1.spacing; } });
|
|
21
|
-
Object.defineProperty(exports, "spacingBottom", { enumerable: true, get: function () { return spacing_1.spacingBottom; } });
|
|
22
|
-
Object.defineProperty(exports, "spacingTop", { enumerable: true, get: function () { return spacing_1.spacingTop; } });
|
|
23
|
-
Object.defineProperty(exports, "spacingVertical", { enumerable: true, get: function () { return spacing_1.spacingVertical; } });
|
|
24
|
-
var styled_1 = require("./styled");
|
|
25
|
-
Object.defineProperty(exports, "colStretch", { enumerable: true, get: function () { return styled_1.colStretch; } });
|
|
26
|
-
Object.defineProperty(exports, "centered", { enumerable: true, get: function () { return styled_1.centered; } });
|
|
27
|
-
Object.defineProperty(exports, "ellipsis", { enumerable: true, get: function () { return styled_1.ellipsis; } });
|
|
28
|
-
Object.defineProperty(exports, "inset0", { enumerable: true, get: function () { return styled_1.inset0; } });
|
|
29
|
-
Object.defineProperty(exports, "invisible", { enumerable: true, get: function () { return styled_1.invisible; } });
|
|
30
|
-
Object.defineProperty(exports, "overlay", { enumerable: true, get: function () { return styled_1.overlay; } });
|
|
31
|
-
Object.defineProperty(exports, "stateFocus", { enumerable: true, get: function () { return styled_1.stateFocus; } });
|
|
32
|
-
var theme_1 = require("./theme");
|
|
33
|
-
Object.defineProperty(exports, "breakpoints", { enumerable: true, get: function () { return theme_1.breakpoints; } });
|
|
34
|
-
Object.defineProperty(exports, "createTheme", { enumerable: true, get: function () { return theme_1.createTheme; } });
|
|
35
|
-
Object.defineProperty(exports, "useTheme", { enumerable: true, get: function () { return theme_1.useTheme; } });
|
|
36
|
-
var theme__vanilla_1 = require("./theme--vanilla");
|
|
37
|
-
Object.defineProperty(exports, "THEME_DEFAULT", { enumerable: true, get: function () { return theme__vanilla_1.THEME_DEFAULT; } });
|
|
38
|
-
Object.defineProperty(exports, "THEME_KEY", { enumerable: true, get: function () { return theme__vanilla_1.THEME_KEY; } });
|
|
39
|
-
Object.defineProperty(exports, "ThemeVanillaContext", { enumerable: true, get: function () { return theme__vanilla_1.ThemeVanillaContext; } });
|
|
40
|
-
Object.defineProperty(exports, "ThemeVanillaProvider", { enumerable: true, get: function () { return theme__vanilla_1.ThemeVanillaProvider; } });
|
|
41
|
-
Object.defineProperty(exports, "getInitialThemeFromClient", { enumerable: true, get: function () { return theme__vanilla_1.getInitialThemeFromClient; } });
|
package/styles/media.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// TODO:FIXME: this should use code from `useMqWidthCreator`
|
|
3
|
-
var _a;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.generateMediaQueries = exports.useMedia = exports.only = exports.between = exports.down = exports.up = exports.max = exports.min = void 0;
|
|
6
|
-
var react_1 = require("react");
|
|
7
|
-
var theme_1 = require("./theme");
|
|
8
|
-
exports.min = (_a = generateMediaQueries(theme_1.breakpoints), _a.min), exports.max = _a.max, exports.up = _a.up, exports.down = _a.down, exports.between = _a.between, exports.only = _a.only;
|
|
9
|
-
function useMedia(media) {
|
|
10
|
-
var breakpoints = (0, theme_1.useTheme)().breakpoints;
|
|
11
|
-
var _a = (0, react_1.useState)(false), matches = _a[0], setMatches = _a[1];
|
|
12
|
-
var _b = media.split(":"), _c = _b[0], direction = _c === void 0 ? "min" : _c, breakpoint = _b[1];
|
|
13
|
-
var px = breakpoints[breakpoint];
|
|
14
|
-
if (direction === "max") {
|
|
15
|
-
px = px - 0.02;
|
|
16
|
-
}
|
|
17
|
-
var query = "(".concat(direction, "-width: ").concat(px, "px)");
|
|
18
|
-
(0, react_1.useEffect)(function () {
|
|
19
|
-
var mq = window.matchMedia(query);
|
|
20
|
-
var handleChange = function (event) {
|
|
21
|
-
setMatches(event.matches);
|
|
22
|
-
};
|
|
23
|
-
setMatches(mq.matches);
|
|
24
|
-
// Safari < 14 can't use addEventListener on a MediaQueryList
|
|
25
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#Browser_compatibility
|
|
26
|
-
if (!mq.addEventListener) {
|
|
27
|
-
// Update the state whenever the media query match state changes
|
|
28
|
-
mq.addListener(handleChange);
|
|
29
|
-
// Clean up on unmount and if the query changes
|
|
30
|
-
return function () {
|
|
31
|
-
mq.removeListener(handleChange);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
mq.addEventListener("change", handleChange);
|
|
35
|
-
return function () {
|
|
36
|
-
mq.removeEventListener("change", handleChange);
|
|
37
|
-
};
|
|
38
|
-
}, [query]);
|
|
39
|
-
return matches;
|
|
40
|
-
}
|
|
41
|
-
exports.useMedia = useMedia;
|
|
42
|
-
/**
|
|
43
|
-
* Generate media queries helpers
|
|
44
|
-
*
|
|
45
|
-
* Usage:
|
|
46
|
-
* ```jsx
|
|
47
|
-
* import { generateMediaQueries } from "@koine/react";
|
|
48
|
-
*
|
|
49
|
-
* export const breakpoints = {
|
|
50
|
-
* xs: 0,
|
|
51
|
-
* sm: 440,
|
|
52
|
-
* md: 768,
|
|
53
|
-
* lg: 1024,
|
|
54
|
-
* xl: 1368,
|
|
55
|
-
* xxl: 1690,
|
|
56
|
-
* } as const;
|
|
57
|
-
*
|
|
58
|
-
* export const { min, max, up, down, between, only } = generateMediaQueries(breakpoints);
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* Consider the following syntaxes, using normal CSS is just slightly
|
|
62
|
-
* longer but it aovid js imports, reduce the js overhead and improve CSS
|
|
63
|
-
* highlighting in the editor.
|
|
64
|
-
*
|
|
65
|
-
* Even if we would reduce the function signature to the bare minimum the advantage
|
|
66
|
-
* in terms of typing would not be much, also loosing in readability.
|
|
67
|
-
*
|
|
68
|
-
* ```css
|
|
69
|
-
* // but unfortunately this does not work
|
|
70
|
-
* @media (min-width: var(--b-sm)) {}
|
|
71
|
-
* @media (min-width: 480px) {}
|
|
72
|
-
*
|
|
73
|
-
* ${media("min", "sm")} {}
|
|
74
|
-
* ${mediaMin("sm")} {}
|
|
75
|
-
* ${min.sm} {}
|
|
76
|
-
* ${p => p.theme.min.sm}``
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* Related projects:
|
|
80
|
-
* @see https://github.com/mg901/styled-breakpoints
|
|
81
|
-
* @see https://github.com/morajabi/styled-media-query
|
|
82
|
-
*
|
|
83
|
-
* @see https://www.w3.org/TR/mediaqueries-5/#custom-mq The spec would allow for
|
|
84
|
-
* something like this syntax
|
|
85
|
-
*
|
|
86
|
-
* ```css
|
|
87
|
-
* @custom-media --narrow-window (max-width: 30em);
|
|
88
|
-
* @media (--narrow-window) {}
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
function generateMediaQueries(breakpoints) {
|
|
92
|
-
var temp = Object.keys(breakpoints).map(function (key) {
|
|
93
|
-
var br = key;
|
|
94
|
-
return [br, breakpoints[br]];
|
|
95
|
-
});
|
|
96
|
-
var sortedKeys = temp.sort(function (a, b) { return a[1] - b[1]; }).map(function (item) { return item[0]; });
|
|
97
|
-
var getNext = function (breakpoint) {
|
|
98
|
-
var index = sortedKeys.indexOf(breakpoint);
|
|
99
|
-
return sortedKeys[index + 1];
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* It behaves the same as `@media (min-width: ${value}px)`
|
|
103
|
-
* where value is the given breakpoint value.
|
|
104
|
-
* For ease of use this can be used both as a function `min("md")` and as an
|
|
105
|
-
* object literal `min.md`.
|
|
106
|
-
*/ // @ts-expect-error FIXME: at some point
|
|
107
|
-
var min = function (br) {
|
|
108
|
-
return "@media (min-width: ".concat(breakpoints[br], "px)");
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* It behaves the same as `@media (max-width: ${value}px)`
|
|
112
|
-
* where value is the given breakpoint value.
|
|
113
|
-
* For ease of use this can be used both as a function `max("md")` and as an
|
|
114
|
-
* object literal `max.md`.
|
|
115
|
-
*/ // @ts-expect-error FIXME: at some point
|
|
116
|
-
var max = function (br) {
|
|
117
|
-
return "@media (max-width: ".concat(breakpoints[br] - 0.02, "px)");
|
|
118
|
-
};
|
|
119
|
-
for (var br in breakpoints) {
|
|
120
|
-
var _br = br;
|
|
121
|
-
min[_br] = "@media (min-width: ".concat(breakpoints[_br], "px)");
|
|
122
|
-
max[_br] = "@media (max-width: ".concat(breakpoints[_br] - 0.02, "px)");
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* It behaves the same as `min`
|
|
126
|
-
* @inheritdoc {max}
|
|
127
|
-
*/
|
|
128
|
-
var up = min;
|
|
129
|
-
/**
|
|
130
|
-
* It behaves similarly to `max` but you will use the "next" breakpoint,
|
|
131
|
-
* specifying CSS that will apply from the given breakpoint and down.
|
|
132
|
-
*/
|
|
133
|
-
var down = function (br) {
|
|
134
|
-
var brNext = getNext(br);
|
|
135
|
-
// TODO: if br does not exists otherwise throw Error
|
|
136
|
-
return brNext && "@media (max-width: ".concat(breakpoints[brNext] - 0.02, "px)");
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Media query between the two given breakpoints
|
|
140
|
-
*/
|
|
141
|
-
var between = function (br1, br2) {
|
|
142
|
-
return "@media (min-width: ".concat(breakpoints[br1], "px) and (max-width: ").concat(breakpoints[br2] - 0.02, "px)");
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Media query to apply from the given breakpoint until the next, just for its
|
|
146
|
-
* full range
|
|
147
|
-
*/
|
|
148
|
-
var only = function (br) {
|
|
149
|
-
var brNext = getNext(br);
|
|
150
|
-
return brNext ? between(br, brNext) : min(br);
|
|
151
|
-
};
|
|
152
|
-
return {
|
|
153
|
-
min: min,
|
|
154
|
-
max: max,
|
|
155
|
-
up: up,
|
|
156
|
-
down: down,
|
|
157
|
-
between: between,
|
|
158
|
-
only: only,
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
exports.generateMediaQueries = generateMediaQueries;
|
package/styles/package.json
DELETED
package/styles/spacing.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.spacingVertical = exports.spacingBottom = exports.spacingTop = exports.spacing = void 0;
|
|
4
|
-
function _spacing(theme, size, factor, property, direction, devices) {
|
|
5
|
-
if (size === void 0) { size = "md"; }
|
|
6
|
-
if (factor === void 0) { factor = 1; }
|
|
7
|
-
if (property === void 0) { property = "padding"; }
|
|
8
|
-
if (direction === void 0) { direction = "top"; }
|
|
9
|
-
if (devices === void 0) { devices = ["mobile", "tablet", "desktop"]; }
|
|
10
|
-
var breakpoints = theme.breakpoints, DEVICES = theme.devices, SPACES = theme.spaces;
|
|
11
|
-
var css = "";
|
|
12
|
-
var prop = "".concat(property, "-").concat(direction);
|
|
13
|
-
if (!devices.length || devices[0] === "mobile") {
|
|
14
|
-
css += "@media(max-width: ".concat(breakpoints[DEVICES.mobile], "px){\n ").concat(prop, ": ").concat(SPACES["mobile"][size] * factor, "px;\n }");
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
for (var index = 0; index < devices.length; index++) {
|
|
18
|
-
var device = devices[index];
|
|
19
|
-
if (device === "mobile") {
|
|
20
|
-
css += "".concat(prop, ": ").concat(SPACES[device][size] * factor, "px;");
|
|
21
|
-
}
|
|
22
|
-
else if (device === "tablet") {
|
|
23
|
-
css += "@media(min-width: ".concat(breakpoints[DEVICES.tablet], "px){\n ").concat(prop, ": ").concat(SPACES["tablet"][size] * factor, "px;\n }");
|
|
24
|
-
}
|
|
25
|
-
else if (device === "desktop") {
|
|
26
|
-
css += "@media(min-width: ".concat(breakpoints[DEVICES.desktop], "px){\n ").concat(prop, ": ").concat(SPACES["desktop"][size] * factor, "px;\n }");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return css;
|
|
31
|
-
}
|
|
32
|
-
function spacing(size, factor, property, direction, devices) {
|
|
33
|
-
if (direction === "vertical") {
|
|
34
|
-
return (_spacing(this, size, factor, property, "top", devices) +
|
|
35
|
-
_spacing(this, size, factor, property, "bottom", devices));
|
|
36
|
-
}
|
|
37
|
-
return _spacing(this, size, factor, property, direction, devices);
|
|
38
|
-
}
|
|
39
|
-
exports.spacing = spacing;
|
|
40
|
-
function spacingTop(size, factor, property, devices) {
|
|
41
|
-
return _spacing(this, size, factor, property, "top", devices);
|
|
42
|
-
}
|
|
43
|
-
exports.spacingTop = spacingTop;
|
|
44
|
-
function spacingBottom(size, factor, property, devices) {
|
|
45
|
-
return _spacing(this, size, factor, property, "bottom", devices);
|
|
46
|
-
}
|
|
47
|
-
exports.spacingBottom = spacingBottom;
|
|
48
|
-
function spacingVertical(size, factor, property, devices) {
|
|
49
|
-
return (_spacing(this, size, factor, property, "top", devices) +
|
|
50
|
-
_spacing(this, size, factor, property, "bottom", devices));
|
|
51
|
-
}
|
|
52
|
-
exports.spacingVertical = spacingVertical;
|
package/styles/styled.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stateFocus = exports.invisible = exports.ellipsis = exports.centered = exports.overlay = exports.inset0 = exports.colStretch = void 0;
|
|
4
|
-
var colStretch = function (direction, bg) {
|
|
5
|
-
return "\n background: ".concat(bg, ";\n position: relative;\n\n &:before{\n z-index: -1;\n content: '';\n position: absolute;\n right: ").concat(direction === "left" ? "100%" : "-100vw", ";\n left: ").concat(direction === "right" ? "100%" : "-100vw", ";\n top: 0;\n bottom: 0;\n background: ").concat(bg, ";\n }\n ");
|
|
6
|
-
};
|
|
7
|
-
exports.colStretch = colStretch;
|
|
8
|
-
/** @see https://caniuse.com/?search=inset */
|
|
9
|
-
exports.inset0 = "top:0;left:0;right:0;bottom:0;";
|
|
10
|
-
exports.overlay = "position: absolute;".concat(exports.inset0);
|
|
11
|
-
exports.centered = "display: flex;align-items: center;justify-content: center;";
|
|
12
|
-
exports.ellipsis = "overflow: hidden;text-overflow: ellipsis;white-space: nowrap;";
|
|
13
|
-
/**
|
|
14
|
-
* @see import("@mui/utils").visuallyHidden https://github.com/mui-org/material-ui/blob/master/packages/mui-utils/src/visuallyHidden.ts
|
|
15
|
-
*/
|
|
16
|
-
exports.invisible = "border: 0;clip: rect(0 0 0 0);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;white-space: nowrap;width: 1px;";
|
|
17
|
-
exports.stateFocus = "outline: 0px;box-shadow: 0 0 0 0.2rem rgba(200, 200, 200, 0.25);";
|
package/styles/theme--vanilla.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ThemeVanillaProvider = exports.ThemeVanillaContext = exports.getInitialThemeFromClient = exports.THEME_DEFAULT = exports.THEME_KEY = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var react_1 = require("react");
|
|
7
|
-
var isBrowser_1 = tslib_1.__importDefault(require("@koine/utils/isBrowser"));
|
|
8
|
-
// import setCookie from "@koine/utils/setCookie";
|
|
9
|
-
// import parseCookie from "@koine/utils/parseCookie";
|
|
10
|
-
var useUpdateEffect_1 = tslib_1.__importDefault(require("../hooks/useUpdateEffect"));
|
|
11
|
-
exports.THEME_KEY = "theme";
|
|
12
|
-
exports.THEME_DEFAULT = "light";
|
|
13
|
-
// export const getInitialThemeFromRequest = (
|
|
14
|
-
// cookie?: string
|
|
15
|
-
// ): ThemeVanillaValue => {
|
|
16
|
-
// if (cookie) {
|
|
17
|
-
// const parsed = parseCookie<ThemeCookie>(cookie);
|
|
18
|
-
// return parsed?.theme;
|
|
19
|
-
// }
|
|
20
|
-
// return THEME_DEFAULT;
|
|
21
|
-
// };
|
|
22
|
-
var getInitialThemeFromClient = function () {
|
|
23
|
-
if (typeof window !== "undefined" && window.localStorage) {
|
|
24
|
-
var storedPrefs = window.localStorage.getItem(exports.THEME_KEY);
|
|
25
|
-
if (typeof storedPrefs === "string") {
|
|
26
|
-
return storedPrefs;
|
|
27
|
-
}
|
|
28
|
-
var userMedia = window.matchMedia("(prefers-color-scheme: dark)");
|
|
29
|
-
if (userMedia.matches) {
|
|
30
|
-
return "dark";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return exports.THEME_DEFAULT;
|
|
34
|
-
};
|
|
35
|
-
exports.getInitialThemeFromClient = getInitialThemeFromClient;
|
|
36
|
-
exports.ThemeVanillaContext = (0, react_1.createContext)({
|
|
37
|
-
theme: "light",
|
|
38
|
-
setTheme: undefined,
|
|
39
|
-
});
|
|
40
|
-
var ThemeVanillaProvider = function (_a) {
|
|
41
|
-
var initialTheme = _a.initialTheme, children = _a.children;
|
|
42
|
-
var _b = (0, react_1.useState)(initialTheme), theme = _b[0], setTheme = _b[1];
|
|
43
|
-
var rawSetTheme = function (rawTheme) {
|
|
44
|
-
if (!rawTheme || !isBrowser_1.default) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
var root = window.document.documentElement;
|
|
48
|
-
var isDark = rawTheme === "dark";
|
|
49
|
-
root.classList.remove(isDark ? "light" : "dark");
|
|
50
|
-
root.classList.add(rawTheme);
|
|
51
|
-
localStorage.setItem(exports.THEME_KEY, rawTheme);
|
|
52
|
-
// setCookie(THEME_KEY, rawTheme);
|
|
53
|
-
};
|
|
54
|
-
(0, react_1.useEffect)(function () {
|
|
55
|
-
var theme = (0, exports.getInitialThemeFromClient)();
|
|
56
|
-
setTheme(theme);
|
|
57
|
-
rawSetTheme(theme);
|
|
58
|
-
}, []);
|
|
59
|
-
(0, useUpdateEffect_1.default)(function () {
|
|
60
|
-
rawSetTheme(theme);
|
|
61
|
-
}, [theme]);
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)(exports.ThemeVanillaContext.Provider, { value: { theme: theme, setTheme: setTheme }, children: children }));
|
|
63
|
-
};
|
|
64
|
-
exports.ThemeVanillaProvider = ThemeVanillaProvider;
|