@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/Grid/Grid.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Col = exports.Row = exports.ContainerFluid = exports.Container = exports.GRID_GUTTER_DEFAULT = exports.GRID_COLUMNS = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
exports.GRID_COLUMNS = 12;
|
|
7
|
-
exports.GRID_GUTTER_DEFAULT = "half";
|
|
8
|
-
exports.Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n max-width: ", "px;\n margin: 0 auto;\n padding: 0 ", "px;\n ", "\n"], ["\n max-width: ", "px;\n margin: 0 auto;\n padding: 0 ", "px;\n ", "\n"])), function (p) { return p.theme.breakpoints[p.size]; }, function (p) { return p.theme.gutter[p.$gutter || exports.GRID_GUTTER_DEFAULT]; }, function (p) { return (p.clamp ? "overflow: hidden;" : ""); });
|
|
9
|
-
exports.ContainerFluid = styled_components_1.default.div(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n padding: 0 ", "px;\n"], ["\n padding: 0 ", "px;\n"])), function (p) { return p.theme.gutter[p.$gutter || exports.GRID_GUTTER_DEFAULT]; });
|
|
10
|
-
exports.Row = styled_components_1.default.div(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n margin: 0 -", "px;\n display: flex;\n ", "\n ", ";\n ", "\n"], ["\n margin: 0 -", "px;\n display: flex;\n ", "\n ", ";\n ", "\n"])), function (p) { return p.theme.gutter[p.$gutter || exports.GRID_GUTTER_DEFAULT]; }, function (p) { return (p.$noWrap ? "overflow: auto;" : "flex-wrap: wrap;"); }, function (p) { return (p.$valign ? "align-items: ".concat(p.$valign) : ""); }, function (p) {
|
|
11
|
-
return p.$reverse &&
|
|
12
|
-
"@media (".concat(p.$reverse.split(":")[0], "-width: ").concat(p.$reverse.split(":")[1], "px) {\n flex-direction: row-reverse;\n }");
|
|
13
|
-
});
|
|
14
|
-
exports.Col = styled_components_1.default.div(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n padding: 0 ", "px;\n display: ", ";\n ", ";\n ", ";\n"], ["\n padding: 0 ", "px;\n display: ", ";\n ", ";\n ", ";\n"])), function (p) { return p.theme.gutter[p.$gutter || exports.GRID_GUTTER_DEFAULT]; }, function (p) { return (p.$flex ? "flex" : "block"); }, function (p) { return (p.$valign ? "align-items: " + p.$valign : ""); }, function (p) { return getColCss(p); });
|
|
15
|
-
function getColWidth(breakpoints, breakpoint, value) {
|
|
16
|
-
var breakpointValue = breakpoints[breakpoint] + "px";
|
|
17
|
-
var width = (value * 100) / exports.GRID_COLUMNS;
|
|
18
|
-
var cssValue = "\n min-width: ".concat(width, "%;\n flex: 0 0 ").concat(width, "%;\n");
|
|
19
|
-
if (breakpoint === Object.keys(breakpoints)[0]) {
|
|
20
|
-
return cssValue;
|
|
21
|
-
}
|
|
22
|
-
return "\n @media (min-width: ".concat(breakpointValue, "){\n ").concat(cssValue, "\n }");
|
|
23
|
-
}
|
|
24
|
-
function getColCss(props) {
|
|
25
|
-
var $auto = props.$auto, $offset = props.$offset, $width = props.$width;
|
|
26
|
-
var breakpoints = props.theme.breakpoints;
|
|
27
|
-
var css = "";
|
|
28
|
-
if ($offset) {
|
|
29
|
-
var offsets = $offset.split(",");
|
|
30
|
-
for (var i = 0; i <= offsets.length; i++) {
|
|
31
|
-
if (offsets[i]) {
|
|
32
|
-
var _a = offsets[i].split(":"), offsetBreakpoint = _a[0], offsetSize = _a[1];
|
|
33
|
-
css += " \n @media(min-width: ".concat(breakpoints[offsetBreakpoint], "px){\n margin-left: ").concat((100 * offsetSize) / exports.GRID_COLUMNS, "%;\n }\n ");
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if ($width) {
|
|
38
|
-
// do nothing, width is set explicitly
|
|
39
|
-
}
|
|
40
|
-
else if ($auto) {
|
|
41
|
-
css += "flex: 0 0 auto; width: auto; max-width: none;";
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
for (var breakpoint in breakpoints) {
|
|
45
|
-
var value = props[breakpoint];
|
|
46
|
-
if (typeof value !== "undefined") {
|
|
47
|
-
css += getColWidth(breakpoints, breakpoint, value);
|
|
48
|
-
}
|
|
49
|
-
else if (breakpoint === "xs") {
|
|
50
|
-
css += getColWidth(breakpoints, breakpoint, 12);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return css;
|
|
55
|
-
}
|
|
56
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
package/Grid/index.js
DELETED
package/Grid/package.json
DELETED
package/Hamburger/Hamburger.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hamburger = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
/**
|
|
7
|
-
* @file
|
|
8
|
-
*
|
|
9
|
-
* Simplified from https://github.com/luukdv/hamburger-react
|
|
10
|
-
*/
|
|
11
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
12
|
-
var HamburgerLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n position: absolute;\n top: 30px;\n font-size: ", ";\n text-transform: uppercase;\n left: 7px;\n letter-spacing: 3px;\n"], ["\n position: absolute;\n top: 30px;\n font-size: ", ";\n text-transform: uppercase;\n left: 7px;\n letter-spacing: 3px;\n"])), function (_a) {
|
|
13
|
-
var $toggled = _a.$toggled;
|
|
14
|
-
return ($toggled ? "0" : "9px");
|
|
15
|
-
});
|
|
16
|
-
var area = 48;
|
|
17
|
-
var lines = 3;
|
|
18
|
-
var width = 32;
|
|
19
|
-
var room = Math.round((area - width) / 2);
|
|
20
|
-
var barHeightRaw = width / 12;
|
|
21
|
-
var barHeight = Math.round(barHeightRaw);
|
|
22
|
-
var space = 0.5;
|
|
23
|
-
var marginRaw = width / (lines * (space + (lines === 3 ? 1 : 1.25)));
|
|
24
|
-
var margin = Math.round(marginRaw);
|
|
25
|
-
var height = barHeight * lines + margin * (lines - 1);
|
|
26
|
-
var topOffset = Math.round((area - height) / 2);
|
|
27
|
-
var translate = 4.6325;
|
|
28
|
-
var deviation = (barHeightRaw - barHeight + (marginRaw - margin)) / (lines === 3 ? 1 : 2);
|
|
29
|
-
var move = parseFloat((width / translate - deviation / (4 / 3)).toFixed(2));
|
|
30
|
-
var time = 0.4;
|
|
31
|
-
var easing = "cubic-bezier(0, 0, 0, 1)";
|
|
32
|
-
var transition = "".concat(time, "s ").concat(easing);
|
|
33
|
-
var burgerStyles = {
|
|
34
|
-
marginRight: "-8px",
|
|
35
|
-
position: "relative",
|
|
36
|
-
width: "".concat(area, "px"),
|
|
37
|
-
height: "".concat(area, "px"),
|
|
38
|
-
userSelect: "none",
|
|
39
|
-
outline: "0px",
|
|
40
|
-
cursor: "pointer",
|
|
41
|
-
transition: transition,
|
|
42
|
-
};
|
|
43
|
-
var barStyles = {
|
|
44
|
-
position: "absolute",
|
|
45
|
-
width: "".concat(width, "px"),
|
|
46
|
-
height: "".concat(barHeight, "px"),
|
|
47
|
-
left: "".concat(room, "px"),
|
|
48
|
-
background: "currentColor",
|
|
49
|
-
transition: transition,
|
|
50
|
-
};
|
|
51
|
-
var Hamburger = function (_a) {
|
|
52
|
-
var toggled = _a.toggled, props = tslib_1.__rest(_a, ["toggled"]);
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ style: tslib_1.__assign(tslib_1.__assign({}, burgerStyles), { transform: "".concat(toggled ? "rotate(90deg)" : "none") }), tabIndex: 0 }, props, { children: [(0, jsx_runtime_1.jsx)("div", { style: tslib_1.__assign(tslib_1.__assign({}, barStyles), { top: "".concat(topOffset, "px"), transform: "".concat(toggled ? "rotate(-45deg) translate(0px, ".concat(move, "px)") : "none") }) }), (0, jsx_runtime_1.jsx)("div", { style: tslib_1.__assign(tslib_1.__assign({}, barStyles), { top: "".concat(topOffset + barHeight + margin, "px"), transform: "".concat(toggled ? "rotate(45deg) translate(0, -".concat(move, "px)") : "none") }) }), (0, jsx_runtime_1.jsx)(HamburgerLabel, { "$toggled": toggled, children: "Menu" })] })));
|
|
54
|
-
};
|
|
55
|
-
exports.Hamburger = Hamburger;
|
|
56
|
-
var templateObject_1;
|
package/Hamburger/index.js
DELETED
package/Hamburger/package.json
DELETED
package/Header/index.js
DELETED
package/Header/package.json
DELETED
package/Header/useHeader.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useHeader = void 0;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var useScrollPosition_1 = require("../hooks/useScrollPosition");
|
|
6
|
-
var theme_1 = require("../styles/theme");
|
|
7
|
-
var media_1 = require("../styles/media");
|
|
8
|
-
var useHeader = function () {
|
|
9
|
-
var _a = (0, react_1.useState)(false), isSticky = _a[0], setIsSticky = _a[1];
|
|
10
|
-
var themed = (0, theme_1.useTheme)().header;
|
|
11
|
-
var isDesktopLayout = (0, media_1.useMedia)("min:".concat(themed.breakpoint));
|
|
12
|
-
var valueIdx = isDesktopLayout ? 1 : 0;
|
|
13
|
-
var _b = (0, react_1.useState)(themed.height[valueIdx]), headerHeight = _b[0], setHeaderHeight = _b[1];
|
|
14
|
-
var _c = (0, react_1.useState)(themed.height[valueIdx]), placeholderHeight = _c[0], setPlaceholderHeight = _c[1];
|
|
15
|
-
var _d = (0, react_1.useState)(themed.logoWidth[valueIdx]), logoWidth = _d[0], setLogoWidth = _d[1];
|
|
16
|
-
(0, useScrollPosition_1.useScrollPosition)(function (currentPosition) {
|
|
17
|
-
var isPastThreshold = currentPosition.y * -1 > 40;
|
|
18
|
-
if (isSticky !== isPastThreshold)
|
|
19
|
-
setIsSticky(isPastThreshold);
|
|
20
|
-
}, [isSticky]);
|
|
21
|
-
(0, react_1.useEffect)(function () {
|
|
22
|
-
var valueIdx = isDesktopLayout ? 1 : 0;
|
|
23
|
-
setPlaceholderHeight(themed.height[valueIdx]);
|
|
24
|
-
setHeaderHeight(isSticky ? themed.heightSticky[valueIdx] : themed.height[valueIdx]);
|
|
25
|
-
setLogoWidth(isSticky ? themed.logoWidthSticky[valueIdx] : themed.logoWidth[valueIdx]);
|
|
26
|
-
}, [themed, isSticky, isDesktopLayout]);
|
|
27
|
-
return [
|
|
28
|
-
isSticky,
|
|
29
|
-
placeholderHeight,
|
|
30
|
-
headerHeight,
|
|
31
|
-
logoWidth,
|
|
32
|
-
];
|
|
33
|
-
};
|
|
34
|
-
exports.useHeader = useHeader;
|
|
35
|
-
exports.default = exports.useHeader;
|
package/Hidden/Hidden.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hidden = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
exports.Hidden = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
7
|
-
return "".concat(p.$min
|
|
8
|
-
? "\n @media (min-width: ".concat(p.theme.breakpoints[p.$min], "px) {\n display: none;\n }")
|
|
9
|
-
: "", " ").concat(p.$max
|
|
10
|
-
? "\n @media (max-width: ".concat(p.theme.breakpoints[p.$max], "px) {\n display: none;\n }")
|
|
11
|
-
: "");
|
|
12
|
-
});
|
|
13
|
-
var templateObject_1;
|
package/Hidden/index.js
DELETED
package/Hidden/package.json
DELETED
package/Img/index.js
DELETED
package/Img/package.json
DELETED
package/Img/sc/bare.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KoineImg = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
// export type KoineImgProps = {
|
|
7
|
-
// /** @default "cover" */
|
|
8
|
-
// $fit?: "cover" | "contain";
|
|
9
|
-
// };
|
|
10
|
-
exports.KoineImg = styled_components_1.default.img(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
|
|
11
|
-
var templateObject_1;
|
|
12
|
-
// export const KoineImg = styled.img<KoineImgProps>`
|
|
13
|
-
// object-fit: ${(p) => p.$fit || "cover"};
|
|
14
|
-
// `;
|
|
15
|
-
// /**
|
|
16
|
-
// * Replacement core component for native `<img />`
|
|
17
|
-
// *
|
|
18
|
-
// * Features:
|
|
19
|
-
// * - lazy load
|
|
20
|
-
// * - proportion cage
|
|
21
|
-
// */
|
|
22
|
-
// export const Img = ({
|
|
23
|
-
// className,
|
|
24
|
-
// style = {},
|
|
25
|
-
// lazyProps,
|
|
26
|
-
// ...props
|
|
27
|
-
// }: ImgProps) => {
|
|
28
|
-
// let { width, height, src } = props;
|
|
29
|
-
// width = width ? `${width}px` : "100%";
|
|
30
|
-
// height = height ? `${height}px` : "100%";
|
|
31
|
-
// const imgProps = { width, height, src };
|
|
32
|
-
// return (
|
|
33
|
-
// <ImgRoot style={{ width, height, ...style }} className={className}>
|
|
34
|
-
// <LazyLoad {...lazyProps}>
|
|
35
|
-
// <ImgNative {...imgProps} />
|
|
36
|
-
// </LazyLoad>
|
|
37
|
-
// <noscript>
|
|
38
|
-
// <img {...imgProps} />
|
|
39
|
-
// </noscript>
|
|
40
|
-
// </ImgRoot>
|
|
41
|
-
// );
|
|
42
|
-
// };
|
package/Img/types.js
DELETED
package/Link/Link.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KoineLink = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
exports.KoineLink = styled_components_1.default.a(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
|
|
7
|
-
var templateObject_1;
|
package/Link/LinkBlank.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LinkBlank = exports.LinkBlankIcon = exports.LinkBlankA = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
7
|
-
var md_1 = require("react-icons/md");
|
|
8
|
-
var media_1 = require("../styles/media");
|
|
9
|
-
exports.LinkBlankA = styled_components_1.default.a.attrs({
|
|
10
|
-
target: "_blank",
|
|
11
|
-
rel: "noopener",
|
|
12
|
-
})(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
|
|
13
|
-
// TODO: use `touch` class on <html> instead of relying on screenwidth,
|
|
14
|
-
// probably implement a lean Modernizr like thing with react-helmet
|
|
15
|
-
exports.LinkBlankIcon = (0, styled_components_1.default)(md_1.MdLaunch)(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n color: var(---grey100);\n font-size: inherit;\n margin-left: 3px;\n line-height: inherit;\n vertical-align: middle;\n width: 0px;\n transition: width 0.1s ease-in-out;\n ", " {\n width: 20px;\n opacity: 0.8;\n }\n"], ["\n color: var(---grey100);\n font-size: inherit;\n margin-left: 3px;\n line-height: inherit;\n vertical-align: middle;\n width: 0px;\n transition: width 0.1s ease-in-out;\n ", " {\n width: 20px;\n opacity: 0.8;\n }\n"])), media_1.max.sm);
|
|
16
|
-
var LinkBlank = function (_a) {
|
|
17
|
-
var children = _a.children, target = _a.target, rel = _a.rel, props = tslib_1.__rest(_a, ["children", "target", "rel"]);
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(exports.LinkBlankA, tslib_1.__assign({}, props, { children: [children, (0, jsx_runtime_1.jsx)(exports.LinkBlankIcon, {})] })));
|
|
19
|
-
};
|
|
20
|
-
exports.LinkBlank = LinkBlank;
|
|
21
|
-
var templateObject_1, templateObject_2;
|
package/Link/index.js
DELETED
package/Link/package.json
DELETED
package/Menu/Menu.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Menu = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
exports.Menu = styled_components_1.default.ul(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n z-index: 3;\n position: absolute;\n list-style-type: none;\n margin: 0;\n padding: 0;\n background: #fff;\n width: 100%;\n box-shadow: var(--shadow);\n"], ["\n z-index: 3;\n position: absolute;\n list-style-type: none;\n margin: 0;\n padding: 0;\n background: #fff;\n width: 100%;\n box-shadow: var(--shadow);\n"])));
|
|
7
|
-
var templateObject_1;
|
package/Menu/MenuMui.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import React, { forwardRef, useId, useMemo, useRef, useState } from "react";
|
|
3
|
-
// import { unstable_useEventCallback as useEventCallback } from "@mui/utils";
|
|
4
|
-
// import {
|
|
5
|
-
// motion as m,
|
|
6
|
-
// AnimatePresence,
|
|
7
|
-
// type HTMLMotionProps,
|
|
8
|
-
// } from "framer-motion";
|
|
9
|
-
// import {
|
|
10
|
-
// useMenu,
|
|
11
|
-
// MenuUnstyledContext,
|
|
12
|
-
// type MenuUnstyledContextType,
|
|
13
|
-
// type MenuUnstyledActions,
|
|
14
|
-
// } from "@mui/base/MenuUnstyled";
|
|
15
|
-
// import ModalUnstyled from "@mui/base/ModalUnstyled";
|
|
16
|
-
// import ClickAwayListener from "@mui/base/ClickAwayListener";
|
|
17
|
-
// import { usePopper, type PopperChildrenProps } from "react-popper";
|
|
18
|
-
// import clsx from "@koine/utils/clsx";
|
|
19
|
-
// const MenuRoot = m.div;
|
|
20
|
-
// const MenuBackdrop = () => <div className="fixed inset-0" />;
|
|
21
|
-
// /**
|
|
22
|
-
// * Props we control, cannot be overriden from implementers
|
|
23
|
-
// */
|
|
24
|
-
// type MenuButtonOwnProps = {
|
|
25
|
-
// "aria-controls"?: string;
|
|
26
|
-
// "aria-haspopup": true | "true";
|
|
27
|
-
// "aria-expanded"?: true | "true";
|
|
28
|
-
// onClick: (event: React.MouseEvent<HTMLButtonElement>) => unknown;
|
|
29
|
-
// onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => unknown;
|
|
30
|
-
// };
|
|
31
|
-
// type MenuButtonProps = Omit<
|
|
32
|
-
// React.ComponentPropsWithRef<"button">,
|
|
33
|
-
// keyof MenuButtonOwnProps
|
|
34
|
-
// > &
|
|
35
|
-
// MenuButtonOwnProps;
|
|
36
|
-
// export type MenuItemsProps = {
|
|
37
|
-
// /**
|
|
38
|
-
// * Closes the parent menu
|
|
39
|
-
// */
|
|
40
|
-
// close: () => unknown;
|
|
41
|
-
// };
|
|
42
|
-
// /**
|
|
43
|
-
// * Props we control, cannot be overriden from implementers
|
|
44
|
-
// */
|
|
45
|
-
// type MenuOwnProps = ReturnType<typeof useMenu>["getListboxProps"] & {
|
|
46
|
-
// onKeyDown: (event: React.KeyboardEvent) => unknown;
|
|
47
|
-
// style: React.StyleHTMLAttributes<HTMLDivElement>;
|
|
48
|
-
// };
|
|
49
|
-
// export type MenuProps = Omit<
|
|
50
|
-
// Omit<HTMLMotionProps<"div">, "children"> & {
|
|
51
|
-
// placement?: PopperChildrenProps["placement"];
|
|
52
|
-
// Button: (props: MenuButtonProps) => JSX.Element;
|
|
53
|
-
// children: (props: MenuItemsProps) => React.ReactNode;
|
|
54
|
-
// },
|
|
55
|
-
// keyof MenuOwnProps
|
|
56
|
-
// >;
|
|
57
|
-
// export const Menu = forwardRef(function Menu(props: MenuProps, ref) {
|
|
58
|
-
// const { Button, placement, children, className, ...htmlAttributes } = props;
|
|
59
|
-
// const id = useId();
|
|
60
|
-
// const buttonRef = useRef<HTMLButtonElement>(null);
|
|
61
|
-
// const menuActions = useRef<MenuUnstyledActions>(null);
|
|
62
|
-
// const [popperElement, setPopperElement] = useState(null);
|
|
63
|
-
// const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
|
|
64
|
-
// const open = Boolean(anchorEl);
|
|
65
|
-
// const { styles } = usePopper(anchorEl, popperElement, {
|
|
66
|
-
// placement,
|
|
67
|
-
// // strategy: "absolute",
|
|
68
|
-
// });
|
|
69
|
-
// const {
|
|
70
|
-
// registerItem,
|
|
71
|
-
// unregisterItem,
|
|
72
|
-
// getListboxProps,
|
|
73
|
-
// getItemProps,
|
|
74
|
-
// getItemState,
|
|
75
|
-
// } = useMenu({
|
|
76
|
-
// listboxId: id,
|
|
77
|
-
// listboxRef: setPopperElement,
|
|
78
|
-
// // these two make the Tab key behaviour correct, closing the menu on Tab
|
|
79
|
-
// // press and re-focusing the Button trigger element
|
|
80
|
-
// open,
|
|
81
|
-
// onClose: () => setAnchorEl(null),
|
|
82
|
-
// });
|
|
83
|
-
// const contextValue: MenuUnstyledContextType = {
|
|
84
|
-
// registerItem,
|
|
85
|
-
// unregisterItem,
|
|
86
|
-
// getItemState,
|
|
87
|
-
// getItemProps,
|
|
88
|
-
// open,
|
|
89
|
-
// };
|
|
90
|
-
// const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
91
|
-
// if (open) {
|
|
92
|
-
// setAnchorEl(null);
|
|
93
|
-
// } else {
|
|
94
|
-
// setAnchorEl(event.currentTarget);
|
|
95
|
-
// }
|
|
96
|
-
// };
|
|
97
|
-
// const handleButtonKeyDown = (
|
|
98
|
-
// event: React.KeyboardEvent<HTMLButtonElement>
|
|
99
|
-
// ) => {
|
|
100
|
-
// if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
101
|
-
// event.preventDefault();
|
|
102
|
-
// setAnchorEl(event.currentTarget);
|
|
103
|
-
// if (event.key === "ArrowUp") {
|
|
104
|
-
// menuActions.current?.highlightLastItem();
|
|
105
|
-
// }
|
|
106
|
-
// }
|
|
107
|
-
// };
|
|
108
|
-
// const close = useEventCallback(() => {
|
|
109
|
-
// setAnchorEl(null);
|
|
110
|
-
// buttonRef.current?.focus();
|
|
111
|
-
// });
|
|
112
|
-
// const renderChildren = useMemo(() => {
|
|
113
|
-
// const childrenProps: MenuItemsProps = { close };
|
|
114
|
-
// return children(childrenProps);
|
|
115
|
-
// }, [children, close]);
|
|
116
|
-
// return (
|
|
117
|
-
// <>
|
|
118
|
-
// <Button
|
|
119
|
-
// ref={buttonRef}
|
|
120
|
-
// id={id}
|
|
121
|
-
// aria-haspopup="true"
|
|
122
|
-
// aria-controls={open ? id : undefined}
|
|
123
|
-
// aria-expanded={open ? "true" : undefined}
|
|
124
|
-
// onClick={handleButtonClick}
|
|
125
|
-
// onKeyDown={handleButtonKeyDown}
|
|
126
|
-
// />
|
|
127
|
-
// <AnimatePresence>
|
|
128
|
-
// {open && (
|
|
129
|
-
// <ModalUnstyled
|
|
130
|
-
// slots={{ backdrop: MenuBackdrop }}
|
|
131
|
-
// onClose={close}
|
|
132
|
-
// onBackdropClick={close}
|
|
133
|
-
// open={open}
|
|
134
|
-
// >
|
|
135
|
-
// <div>
|
|
136
|
-
// <ClickAwayListener onClickAway={close}>
|
|
137
|
-
// <MenuRoot
|
|
138
|
-
// initial={{
|
|
139
|
-
// opacity: 0,
|
|
140
|
-
// }}
|
|
141
|
-
// animate={{
|
|
142
|
-
// opacity: 1,
|
|
143
|
-
// }}
|
|
144
|
-
// exit={{
|
|
145
|
-
// opacity: 0,
|
|
146
|
-
// }}
|
|
147
|
-
// className={clsx(className)}
|
|
148
|
-
// style={styles["popper"]}
|
|
149
|
-
// {...htmlAttributes}
|
|
150
|
-
// {...getListboxProps()}
|
|
151
|
-
// aria-labelledby={id}
|
|
152
|
-
// >
|
|
153
|
-
// <MenuUnstyledContext.Provider value={contextValue}>
|
|
154
|
-
// {renderChildren}
|
|
155
|
-
// </MenuUnstyledContext.Provider>
|
|
156
|
-
// </MenuRoot>
|
|
157
|
-
// </ClickAwayListener>
|
|
158
|
-
// </div>
|
|
159
|
-
// </ModalUnstyled>
|
|
160
|
-
// )}
|
|
161
|
-
// </AnimatePresence>
|
|
162
|
-
// </>
|
|
163
|
-
// );
|
|
164
|
-
// });
|
|
165
|
-
// export default Menu;
|
package/Menu/index.js
DELETED
package/Menu/package.json
DELETED
package/MenuItem/MenuItem.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuItem = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
exports.MenuItem = styled_components_1.default.li(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n padding: 8px 16px;\n\n &[aria-selected=\"true\"] {\n background: var(--accent400);\n }\n\n /** DEP: this is just for MultiselectMui? */\n &.Mui-focused,\n &[data-focus=\"true\"] {\n background: var(--accent300);\n color: white;\n }\n\n &:not([disabled]):hover {\n cursor: pointer;\n background: var(--accent300);\n }\n"], ["\n padding: 8px 16px;\n\n &[aria-selected=\"true\"] {\n background: var(--accent400);\n }\n\n /** DEP: this is just for MultiselectMui? */\n &.Mui-focused,\n &[data-focus=\"true\"] {\n background: var(--accent300);\n color: white;\n }\n\n &:not([disabled]):hover {\n cursor: pointer;\n background: var(--accent300);\n }\n"])));
|
|
7
|
-
var templateObject_1;
|
package/MenuItem/MenuItemMui.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import React, { forwardRef } from "react";
|
|
3
|
-
// import { useMenuItem } from "@mui/base/MenuItemUnstyled";
|
|
4
|
-
// // import { useMenuItem } from "./useMenuItem";
|
|
5
|
-
// import clsx from "@koine/utils/clsx";
|
|
6
|
-
// import { type MenuItemsProps } from "../Menu/MenuMui";
|
|
7
|
-
// import { Polymorphic } from "../typings";
|
|
8
|
-
// export type MenuItemProps = React.PropsWithChildren<Partial<MenuItemsProps>>;
|
|
9
|
-
// export const MenuItem = forwardRef(function MenuItem<
|
|
10
|
-
// T extends React.ElementType = "button"
|
|
11
|
-
// >(props: Polymorphic.Props<T, MenuItemProps>, ref: Polymorphic.Ref<T>) {
|
|
12
|
-
// const {
|
|
13
|
-
// as: As = "button",
|
|
14
|
-
// children,
|
|
15
|
-
// className,
|
|
16
|
-
// disabled: disabledProp,
|
|
17
|
-
// ...other
|
|
18
|
-
// } = props;
|
|
19
|
-
// const { getRootProps, disabled, focusVisible } = useMenuItem({
|
|
20
|
-
// ref,
|
|
21
|
-
// disabled: disabledProp,
|
|
22
|
-
// });
|
|
23
|
-
// return (
|
|
24
|
-
// <As
|
|
25
|
-
// className={clsx(focusVisible && "", disabled && "", className)}
|
|
26
|
-
// {...getRootProps(other)}
|
|
27
|
-
// >
|
|
28
|
-
// {children}
|
|
29
|
-
// </As>
|
|
30
|
-
// );
|
|
31
|
-
// }) as Polymorphic.ComponentForwarded<"button", MenuItemProps>;
|
|
32
|
-
// export default MenuItem;
|
package/MenuItem/index.js
DELETED
package/MenuItem/package.json
DELETED
package/MenuItem/useMenuItem.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMenuItem = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
var utils_1 = require("@mui/utils");
|
|
7
|
-
var useMenu_1 = tslib_1.__importDefault(require("@mui/base/useMenu"));
|
|
8
|
-
// import { unstable_useIsFocusVisible as useIsFocusVisible } from "@mui/utils";
|
|
9
|
-
function useMenuItem(props) {
|
|
10
|
-
var _a;
|
|
11
|
-
var _b = props.disabled, disabled = _b === void 0 ? false : _b, ref = props.rootRef, label = props.label;
|
|
12
|
-
var id = (0, react_1.useId)();
|
|
13
|
-
var _c = (0, useMenu_1.default)(), contextValue = _c.contextValue, open = _c.open;
|
|
14
|
-
// const { getRootProps } = useMenuItemUnstyled(props);
|
|
15
|
-
var itemRef = (0, react_1.useRef)(null);
|
|
16
|
-
var handleRef = (0, utils_1.unstable_useForkRef)(itemRef, ref);
|
|
17
|
-
if (contextValue === null) {
|
|
18
|
-
throw new Error("MenuItemUnstyled must be used within a MenuUnstyled");
|
|
19
|
-
}
|
|
20
|
-
var registerItem = contextValue.registerItem, getItemState = contextValue.getItemState;
|
|
21
|
-
(0, react_1.useEffect)(function () {
|
|
22
|
-
registerItem(id, { disabled: disabled, id: id, ref: itemRef, label: label });
|
|
23
|
-
// return () => unregisterItem(id);
|
|
24
|
-
}, [id, registerItem, /* unregisterItem, */ disabled, ref, label]);
|
|
25
|
-
// const { getRootProps: getButtonProps, focusVisible } = useButton({
|
|
26
|
-
// disabled,
|
|
27
|
-
// focusableWhenDisabled: true,
|
|
28
|
-
// ref: handleRef,
|
|
29
|
-
// });
|
|
30
|
-
// Ensure the menu item is focused when highlighted
|
|
31
|
-
var _d = (0, react_1.useState)(false), focusRequested = _d[0], requestFocus = _d[1];
|
|
32
|
-
var focusIfRequested = (0, react_1.useCallback)(function () {
|
|
33
|
-
if (focusRequested && itemRef.current != null) {
|
|
34
|
-
itemRef.current.focus();
|
|
35
|
-
requestFocus(false);
|
|
36
|
-
}
|
|
37
|
-
}, [focusRequested]);
|
|
38
|
-
(0, react_1.useEffect)(function () {
|
|
39
|
-
focusIfRequested();
|
|
40
|
-
});
|
|
41
|
-
// useDebugValue({ id, disabled, label });
|
|
42
|
-
var itemState = getItemState(id !== null && id !== void 0 ? id : "");
|
|
43
|
-
var highlighted = (itemState !== null && itemState !== void 0 ? itemState : { highlighted: false }).highlighted;
|
|
44
|
-
(0, react_1.useEffect)(function () {
|
|
45
|
-
requestFocus(highlighted && open);
|
|
46
|
-
}, [highlighted, open]);
|
|
47
|
-
return {
|
|
48
|
-
getRootProps: function (other) {
|
|
49
|
-
// const optionProps = menuContext.getItemProps(id, other);
|
|
50
|
-
return tslib_1.__assign(tslib_1.__assign({}, other), {
|
|
51
|
-
// ...getButtonProps(other),
|
|
52
|
-
// @ ts-expect-error type from @mui/base is not specific
|
|
53
|
-
// tabIndex: optionProps.tabIndex,
|
|
54
|
-
// @ ts-expect-error type from @mui/base is not specific
|
|
55
|
-
// id: optionProps.id,
|
|
56
|
-
role: "menuitem" });
|
|
57
|
-
},
|
|
58
|
-
disabled: (_a = itemState === null || itemState === void 0 ? void 0 : itemState.disabled) !== null && _a !== void 0 ? _a : false,
|
|
59
|
-
// focusVisible,
|
|
60
|
-
ref: handleRef,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
exports.useMenuItem = useMenuItem;
|
|
64
|
-
exports.default = useMenuItem;
|