@koine/react 2.0.0-beta.37 → 2.0.0-beta.39
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/README.md +1 -0
- package/calendar/CalendarDaygridCell.d.ts +4 -4
- package/calendar/CalendarDaygridNav.d.ts +3 -3
- package/calendar/CalendarDaygridTable.d.ts +4 -4
- package/calendar/CalendarLegend.d.ts +3 -3
- package/calendar/calendar-api-google.d.ts +2 -2
- package/calendar/useCalendar.d.ts +5 -5
- package/calendar/useDateLocale.d.ts +2 -0
- package/calendar/utils.d.ts +11 -11
- package/calendar.cjs.d.ts +1 -0
- package/calendar.cjs.default.js +1 -0
- package/calendar.cjs.js +62 -0
- package/calendar.cjs.mjs +2 -0
- package/calendar.d.ts +7 -0
- package/calendar.esm.js +35 -0
- package/components/FaviconTags.d.ts +8 -0
- package/components/Meta.d.ts +4 -0
- package/components/NoJs.d.ts +2 -0
- package/forms/antispam.d.ts +6 -6
- package/forms.cjs.d.ts +1 -0
- package/forms.cjs.default.js +1 -0
- package/forms.cjs.js +11 -0
- package/forms.cjs.mjs +2 -0
- package/forms.d.ts +1 -0
- package/forms.esm.js +6 -0
- package/hooks/index.d.ts +19 -0
- package/{useAsyncFn.d.ts → hooks/useAsyncFn.d.ts} +3 -3
- package/hooks/useFirstMountState.d.ts +1 -0
- package/hooks/useFixedOffset.d.ts +1 -0
- package/hooks/useFocus.d.ts +1 -0
- package/hooks/useInterval.d.ts +1 -0
- package/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/hooks/useKeyUp.d.ts +1 -0
- package/{useMeasure.d.ts → hooks/useMeasure.d.ts} +2 -2
- package/hooks/useMountedState.d.ts +1 -0
- package/hooks/useNavigateAway.d.ts +2 -0
- package/hooks/usePrevious.d.ts +1 -0
- package/hooks/usePreviousRef.d.ts +1 -0
- package/{useReveal.d.ts → hooks/useReveal.d.ts} +1 -1
- package/hooks/useScrollPosition.d.ts +7 -0
- package/hooks/useScrollThreshold.d.ts +1 -0
- package/hooks/useScrollTo.d.ts +1 -0
- package/hooks/useSmoothScroll.d.ts +1 -0
- package/hooks/useSpinDelay.d.ts +1 -0
- package/hooks/useTraceUpdate.d.ts +1 -0
- package/hooks/useUpdateEffect.d.ts +2 -0
- package/hooks/useWindowSize.d.ts +2 -0
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +77 -0
- package/index.cjs.mjs +2 -0
- package/index.d.ts +3 -26
- package/index.esm.js +51 -0
- package/package.json +21 -646
- package/utils/classed.d.ts +8 -0
- package/{createUseMediaQueryWidth.d.ts → utils/createUseMediaQueryWidth.d.ts} +2 -2
- package/{extendComponent.d.ts → utils/extendComponent.d.ts} +2 -3
- package/utils/index.d.ts +5 -0
- package/utils/mergeRefs.d.ts +1 -0
- package/Alert/Alert.d.ts +0 -5
- package/Alert/Alert.js +0 -10
- package/Alert/index.d.ts +0 -1
- package/Alert/index.js +0 -1
- package/Animations/Reveal.d.ts +0 -3
- package/Animations/Reveal.js +0 -16
- package/Animations/Underline.d.ts +0 -1
- package/Animations/Underline.js +0 -5
- package/Animations/index.d.ts +0 -3
- package/Animations/index.js +0 -3
- package/Animations/useReveal.d.ts +0 -13
- package/Animations/useReveal.js +0 -43
- package/Autocomplete/AutocompleteDownshift.d.ts +0 -1
- package/Autocomplete/AutocompleteDownshift.js +0 -1
- package/Autocomplete/AutocompleteDownshiftMultiselect.d.ts +0 -1
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -1
- package/Autocomplete/AutocompleteMui.d.ts +0 -22
- package/Autocomplete/AutocompleteMui.js +0 -93
- package/Autocomplete/AutocompleteReach.d.ts +0 -1
- package/Autocomplete/AutocompleteReach.js +0 -1
- package/Autocomplete/components.d.ts +0 -12
- package/Autocomplete/components.js +0 -26
- package/Autocomplete/helpers.d.ts +0 -3
- package/Autocomplete/helpers.js +0 -16
- package/Autocomplete/index.d.ts +0 -2
- package/Autocomplete/index.js +0 -1
- package/Bg/BgColor.d.ts +0 -12
- package/Bg/BgColor.js +0 -16
- package/Bg/BgPhoto.d.ts +0 -8
- package/Bg/BgPhoto.js +0 -16
- package/Bg/BgSvg.d.ts +0 -4
- package/Bg/BgSvg.js +0 -9
- package/Bg/index.d.ts +0 -3
- package/Bg/index.js +0 -3
- package/Breadcrumbs/Breadcrumbs.d.ts +0 -13
- package/Breadcrumbs/Breadcrumbs.js +0 -27
- package/Breadcrumbs/index.d.ts +0 -1
- package/Breadcrumbs/index.js +0 -1
- package/Buttons/Button.d.ts +0 -14
- package/Buttons/Button.js +0 -10
- package/Buttons/ButtonComposite.d.ts +0 -22
- package/Buttons/ButtonComposite.js +0 -28
- package/Buttons/ButtonFab.d.ts +0 -4
- package/Buttons/ButtonFab.js +0 -6
- package/Buttons/ButtonLink.d.ts +0 -8
- package/Buttons/ButtonLink.js +0 -11
- package/Buttons/IconButton.d.ts +0 -8
- package/Buttons/IconButton.js +0 -7
- package/Buttons/index.d.ts +0 -5
- package/Buttons/index.js +0 -5
- package/Calendar/CalendarDaygridCell.d.ts +0 -35
- package/Calendar/CalendarDaygridCell.js +0 -46
- package/Calendar/CalendarDaygridNav.d.ts +0 -27
- package/Calendar/CalendarDaygridNav.js +0 -24
- package/Calendar/CalendarDaygridTable.d.ts +0 -25
- package/Calendar/CalendarDaygridTable.js +0 -45
- package/Calendar/CalendarLegend.d.ts +0 -18
- package/Calendar/CalendarLegend.js +0 -9
- package/Calendar/calendar-api-google.d.ts +0 -10
- package/Calendar/calendar-api-google.js +0 -124
- package/Calendar/index.d.ts +0 -6
- package/Calendar/index.js +0 -6
- package/Calendar/types.d.ts +0 -62
- package/Calendar/types.js +0 -1
- package/Calendar/useCalendar.d.ts +0 -35
- package/Calendar/useCalendar.js +0 -176
- package/Calendar/utils.d.ts +0 -11
- package/Calendar/utils.js +0 -185
- package/Carousel/Carousel.d.ts +0 -1
- package/Carousel/Carousel.js +0 -1
- package/Carousel/CarouselCss.d.ts +0 -13
- package/Carousel/CarouselCss.js +0 -19
- package/Carousel/index.d.ts +0 -1
- package/Carousel/index.js +0 -1
- package/Collapsable/Collapsable.d.ts +0 -1
- package/Collapsable/Collapsable.js +0 -1
- package/Collapsable/CollapsableReach.d.ts +0 -0
- package/Collapsable/CollapsableReach.js +0 -1
- package/Collapsable/index.d.ts +0 -1
- package/Collapsable/index.js +0 -1
- package/Debug/Debug.d.ts +0 -4
- package/Debug/Debug.js +0 -9
- package/Debug/index.d.ts +0 -1
- package/Debug/index.js +0 -1
- package/Details/Details.d.ts +0 -398
- package/Details/Details.js +0 -52
- package/Details/index.d.ts +0 -1
- package/Details/index.js +0 -1
- package/Dialog/DialogMui.d.ts +0 -165
- package/Dialog/DialogMui.js +0 -39
- package/Dialog/css/bare.d.ts +0 -171
- package/Dialog/css/bare.js +0 -21
- package/Dialog/index.d.ts +0 -2
- package/Dialog/index.js +0 -1
- package/Dialog/m/bare.d.ts +0 -4
- package/Dialog/m/bare.js +0 -3
- package/Dialog/m/basic.d.ts +0 -4
- package/Dialog/m/basic.js +0 -28
- package/Dialog/m/index.d.ts +0 -2
- package/Dialog/m/index.js +0 -4
- package/Dialog/sc/bare.d.ts +0 -61
- package/Dialog/sc/bare.js +0 -31
- package/Dialog/sc/framer.d.ts +0 -24
- package/Dialog/sc/framer.js +0 -16
- package/Dialog/sc/framerMaterial.d.ts +0 -24
- package/Dialog/sc/framerMaterial.js +0 -16
- package/Dialog/sc/material.d.ts +0 -60
- package/Dialog/sc/material.js +0 -21
- package/Dialog/tw/bare.d.ts +0 -208
- package/Dialog/tw/bare.js +0 -29
- package/Dialog/tw/elegant.d.ts +0 -270
- package/Dialog/tw/elegant.js +0 -21
- package/Dialog/tw/framer.d.ts +0 -108
- package/Dialog/tw/framer.js +0 -16
- package/Dialog/tw/framerMaterial.d.ts +0 -164
- package/Dialog/tw/framerMaterial.js +0 -16
- package/Dialog/tw/material.d.ts +0 -270
- package/Dialog/tw/material.js +0 -21
- package/Editor/Editor--tiptap.d.ts +0 -9
- package/Editor/Editor--tiptap.js +0 -26
- package/Editor/components.d.ts +0 -5
- package/Editor/components.js +0 -10
- package/Editor/index.d.ts +0 -1
- package/Editor/index.js +0 -1
- package/FaviconTags.d.ts +0 -9
- package/FaviconTags.js +0 -6
- package/Form/Form.d.ts +0 -125
- package/Form/Form.js +0 -60
- package/Form/index.d.ts +0 -1
- package/Form/index.js +0 -1
- package/Form/sc/bare.d.ts +0 -57
- package/Form/sc/bare.js +0 -20
- package/Forms/Checkbox/Checkbox.d.ts +0 -7
- package/Forms/Checkbox/Checkbox.js +0 -15
- package/Forms/Checkbox/index.d.ts +0 -1
- package/Forms/Checkbox/index.js +0 -1
- package/Forms/Feedback/Feedback.d.ts +0 -5
- package/Forms/Feedback/Feedback.js +0 -9
- package/Forms/Feedback/index.d.ts +0 -1
- package/Forms/Feedback/index.js +0 -1
- package/Forms/Field/Field.d.ts +0 -18
- package/Forms/Field/Field.js +0 -25
- package/Forms/Field/FieldControl.d.ts +0 -14
- package/Forms/Field/FieldControl.js +0 -35
- package/Forms/Field/FieldHint.d.ts +0 -1
- package/Forms/Field/FieldHint.js +0 -4
- package/Forms/Field/index.d.ts +0 -2
- package/Forms/Field/index.js +0 -2
- package/Forms/Input/Input.d.ts +0 -8
- package/Forms/Input/Input.js +0 -16
- package/Forms/Input/index.d.ts +0 -1
- package/Forms/Input/index.js +0 -1
- package/Forms/InputGroup/InputGroup.d.ts +0 -12
- package/Forms/InputGroup/InputGroup.js +0 -15
- package/Forms/InputGroup/index.d.ts +0 -1
- package/Forms/InputGroup/index.js +0 -1
- package/Forms/Label/Label.d.ts +0 -3
- package/Forms/Label/Label.js +0 -6
- package/Forms/Label/index.d.ts +0 -1
- package/Forms/Label/index.js +0 -1
- package/Forms/Password/Password.d.ts +0 -4
- package/Forms/Password/Password.js +0 -17
- package/Forms/Password/index.d.ts +0 -1
- package/Forms/Password/index.js +0 -1
- package/Forms/Radio/Radio.d.ts +0 -11
- package/Forms/Radio/Radio.js +0 -25
- package/Forms/Radio/index.d.ts +0 -1
- package/Forms/Radio/index.js +0 -1
- package/Forms/Switch/Switch.d.ts +0 -5
- package/Forms/Switch/Switch.js +0 -17
- package/Forms/Switch/index.d.ts +0 -1
- package/Forms/Switch/index.js +0 -1
- package/Forms/Textarea/Textarea.d.ts +0 -4
- package/Forms/Textarea/Textarea.js +0 -12
- package/Forms/Textarea/TextareaRich.d.ts +0 -5
- package/Forms/Textarea/TextareaRich.js +0 -26
- package/Forms/Textarea/index.d.ts +0 -2
- package/Forms/Textarea/index.js +0 -2
- package/Forms/Toggle/Toggle-tailwind.d.ts +0 -0
- package/Forms/Toggle/Toggle-tailwind.js +0 -1
- package/Forms/Toggle/Toggle.d.ts +0 -18
- package/Forms/Toggle/Toggle.js +0 -25
- package/Forms/Toggle/index.d.ts +0 -1
- package/Forms/Toggle/index.js +0 -1
- package/Forms/Toggle/useToggle-tailwind.d.ts +0 -0
- package/Forms/Toggle/useToggle-tailwind.js +0 -1
- package/Forms/Toggle/useToggle.d.ts +0 -16
- package/Forms/Toggle/useToggle.js +0 -85
- package/Forms/antispam.d.ts +0 -27
- package/Forms/antispam.js +0 -29
- package/Forms/helpers.d.ts +0 -18
- package/Forms/helpers.js +0 -35
- package/Forms/index.d.ts +0 -15
- package/Forms/index.js +0 -15
- package/Forms/styles.d.ts +0 -9
- package/Forms/styles.js +0 -19
- package/Gauge/Gauge.d.ts +0 -4
- package/Gauge/Gauge.js +0 -1
- package/Grid/Grid.d.ts +0 -32
- package/Grid/Grid.js +0 -52
- package/Grid/index.d.ts +0 -1
- package/Grid/index.js +0 -1
- package/Hamburger/Hamburger.d.ts +0 -5
- package/Hamburger/Hamburger.js +0 -47
- package/Hamburger/index.d.ts +0 -1
- package/Hamburger/index.js +0 -1
- package/Header/index.d.ts +0 -1
- package/Header/index.js +0 -1
- package/Header/useHeader.d.ts +0 -20
- package/Header/useHeader.js +0 -32
- package/Hidden/Hidden.d.ts +0 -6
- package/Hidden/Hidden.js +0 -10
- package/Hidden/index.d.ts +0 -1
- package/Hidden/index.js +0 -1
- package/Img/index.d.ts +0 -1
- package/Img/index.js +0 -1
- package/Img/sc/bare.d.ts +0 -2
- package/Img/sc/bare.js +0 -4
- package/Img/types.d.ts +0 -9
- package/Img/types.js +0 -1
- package/Link/Link.d.ts +0 -3
- package/Link/Link.js +0 -4
- package/Link/LinkBlank.d.ts +0 -5
- package/Link/LinkBlank.js +0 -15
- package/Link/index.d.ts +0 -2
- package/Link/index.js +0 -2
- package/Menu/Menu.d.ts +0 -1
- package/Menu/Menu.js +0 -4
- package/Menu/MenuMui.d.ts +0 -0
- package/Menu/MenuMui.js +0 -1
- package/Menu/index.d.ts +0 -1
- package/Menu/index.js +0 -1
- package/MenuItem/MenuItem.d.ts +0 -1
- package/MenuItem/MenuItem.js +0 -4
- package/MenuItem/MenuItemMui.d.ts +0 -0
- package/MenuItem/MenuItemMui.js +0 -1
- package/MenuItem/index.d.ts +0 -1
- package/MenuItem/index.js +0 -1
- package/MenuItem/useMenuItem.d.ts +0 -9
- package/MenuItem/useMenuItem.js +0 -42
- package/Meta.d.ts +0 -5
- package/Meta.js +0 -6
- package/NoJs.d.ts +0 -3
- package/NoJs.js +0 -7
- package/Pagination/PaginationNav.d.ts +0 -14
- package/Pagination/PaginationNav.js +0 -48
- package/Pagination/PaginationResults.d.ts +0 -3
- package/Pagination/PaginationResults.js +0 -11
- package/Pagination/index.d.ts +0 -2
- package/Pagination/index.js +0 -2
- package/Pill/Pill.d.ts +0 -5
- package/Pill/Pill.js +0 -7
- package/Pill/index.d.ts +0 -1
- package/Pill/index.js +0 -1
- package/Polymorphic.js +0 -1
- package/Progress/ProgressCircular.d.ts +0 -13
- package/Progress/ProgressCircular.js +0 -12
- package/Progress/ProgressLinear.d.ts +0 -15
- package/Progress/ProgressLinear.js +0 -21
- package/Progress/ProgressOverlay.d.ts +0 -4
- package/Progress/ProgressOverlay.js +0 -23
- package/Progress/index.d.ts +0 -3
- package/Progress/index.js +0 -3
- package/Rating/Rating.d.ts +0 -27
- package/Rating/Rating.js +0 -43
- package/Rating/index.d.ts +0 -8
- package/Rating/index.js +0 -45
- package/Select/SelectDownshift.d.ts +0 -5
- package/Select/SelectDownshift.js +0 -1
- package/Select/components.d.ts +0 -6
- package/Select/components.js +0 -12
- package/Select/index.d.ts +0 -2
- package/Select/index.js +0 -1
- package/Sidebar/Sidebar.d.ts +0 -3
- package/Sidebar/Sidebar.js +0 -23
- package/Sidebar/index.d.ts +0 -1
- package/Sidebar/index.js +0 -1
- package/Spacing/Spacing.d.ts +0 -17
- package/Spacing/Spacing.js +0 -32
- package/Spacing/index.d.ts +0 -1
- package/Spacing/index.js +0 -1
- package/Sticky/Sticky.d.ts +0 -2
- package/Sticky/Sticky.js +0 -1
- package/Sticky/StickyCss.d.ts +0 -5
- package/Sticky/StickyCss.js +0 -6
- package/Sticky/index.d.ts +0 -1
- package/Sticky/index.js +0 -1
- package/Tabs/TabsMui.d.ts +0 -84
- package/Tabs/TabsMui.js +0 -30
- package/Tabs/index.d.ts +0 -1
- package/Tabs/index.js +0 -1
- package/Tabs/sc/bare.d.ts +0 -0
- package/Tabs/sc/bare.js +0 -1
- package/Tabs/tw/bare.d.ts +0 -85
- package/Tabs/tw/bare.js +0 -17
- package/Tabs/tw/material.d.ts +0 -118
- package/Tabs/tw/material.js +0 -19
- package/Tabs/useTabs.d.ts +0 -21
- package/Tabs/useTabs.js +0 -44
- package/Typography/CopyPasteVisible.d.ts +0 -1
- package/Typography/CopyPasteVisible.js +0 -4
- package/Typography/Native.d.ts +0 -10
- package/Typography/Native.js +0 -14
- package/Typography/ReadMore.d.ts +0 -10
- package/Typography/ReadMore.js +0 -42
- package/Typography/TextLoop.d.ts +0 -16
- package/Typography/TextLoop.js +0 -45
- package/Typography/TypeStairs.d.ts +0 -6
- package/Typography/TypeStairs.js +0 -42
- package/Typography/index.d.ts +0 -5
- package/Typography/index.js +0 -5
- package/calendar/CalendarDaygridCell.js +0 -48
- package/calendar/CalendarDaygridNav.js +0 -24
- package/calendar/CalendarDaygridTable.js +0 -45
- package/calendar/CalendarLegend.js +0 -9
- package/calendar/calendar-api-google.js +0 -124
- package/calendar/index.d.ts +0 -6
- package/calendar/index.js +0 -6
- package/calendar/types.js +0 -1
- package/calendar/useCalendar.js +0 -176
- package/calendar/utils.js +0 -185
- package/classed.d.ts +0 -8
- package/classed.js +0 -43
- package/createUseMediaQueryWidth.js +0 -39
- package/css/index.d.ts +0 -1
- package/css/index.js +0 -1
- package/extendComponent.js +0 -9
- package/forms/antispam.js +0 -29
- package/forms/index.d.ts +0 -1
- package/forms/index.js +0 -1
- package/index.js +0 -24
- package/m/MotionProvider.d.ts +0 -6
- package/m/MotionProvider.js +0 -7
- package/m/index.d.ts +0 -1
- package/m/index.js +0 -1
- package/m/lite.d.ts +0 -2
- package/m/lite.js +0 -2
- package/m/max.d.ts +0 -2
- package/m/max.js +0 -2
- package/mergeRefs.d.ts +0 -2
- package/mergeRefs.js +0 -13
- package/sc/index.d.ts +0 -29
- package/sc/index.js +0 -29
- package/scm/index.d.ts +0 -28
- package/scm/index.js +0 -28
- package/shared/index.d.ts +0 -7
- package/shared/index.js +0 -7
- package/styles/Body.d.ts +0 -2
- package/styles/Body.js +0 -5
- package/styles/Global.d.ts +0 -2
- package/styles/Global.js +0 -5
- package/styles/index.d.ts +0 -7
- package/styles/index.js +0 -7
- package/styles/media.d.ts +0 -18
- package/styles/media.js +0 -75
- package/styles/spacing.d.ts +0 -12
- package/styles/spacing.js +0 -45
- package/styles/styled.d.ts +0 -8
- package/styles/styled.js +0 -9
- package/styles/theme--vanilla.d.ts +0 -17
- package/styles/theme--vanilla.js +0 -47
- package/styles/theme.d.ts +0 -53
- package/styles/theme.js +0 -30
- package/tw/index.d.ts +0 -1
- package/tw/index.js +0 -1
- package/twm/index.d.ts +0 -1
- package/twm/index.js +0 -1
- package/types.js +0 -1
- package/typings.d.ts +0 -6
- package/useAsyncFn.js +0 -33
- package/useDateLocale.d.ts +0 -3
- package/useDateLocale.js +0 -28
- package/useFirstMountState.d.ts +0 -2
- package/useFirstMountState.js +0 -10
- package/useFixedOffset.d.ts +0 -2
- package/useFixedOffset.js +0 -42
- package/useFocus.d.ts +0 -2
- package/useFocus.js +0 -9
- package/useInterval.d.ts +0 -2
- package/useInterval.js +0 -22
- package/useIsomorphicLayoutEffect.d.ts +0 -3
- package/useIsomorphicLayoutEffect.js +0 -6
- package/useKeyUp.d.ts +0 -2
- package/useKeyUp.js +0 -18
- package/useMeasure.js +0 -130
- package/useMountedState.d.ts +0 -2
- package/useMountedState.js +0 -13
- package/useNavigateAway.d.ts +0 -3
- package/useNavigateAway.js +0 -25
- package/usePrevious.d.ts +0 -2
- package/usePrevious.js +0 -10
- package/usePreviousRef.d.ts +0 -2
- package/usePreviousRef.js +0 -9
- package/useReveal.js +0 -43
- package/useScrollPosition.d.ts +0 -7
- package/useScrollPosition.js +0 -61
- package/useScrollThreshold.d.ts +0 -2
- package/useScrollThreshold.js +0 -27
- package/useScrollTo.d.ts +0 -2
- package/useScrollTo.js +0 -20
- package/useSmoothScroll.d.ts +0 -2
- package/useSmoothScroll.js +0 -32
- package/useSpinDelay.d.ts +0 -2
- package/useSpinDelay.js +0 -39
- package/useTraceUpdate.d.ts +0 -2
- package/useTraceUpdate.js +0 -19
- package/useUpdateEffect.d.ts +0 -3
- package/useUpdateEffect.js +0 -11
- package/useWindowSize.d.ts +0 -3
- package/useWindowSize.js +0 -20
- /package/{Polymorphic.d.ts → utils/Polymorphic.d.ts} +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { memo } from "react";
|
|
4
|
-
import styled from "styled-components";
|
|
5
|
-
var Root = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n min-width: 0;\n\n & svg {\n font-size: 2em !important;\n margin: 0 0.33em 0 0 !important;\n }\n"], ["\n ", "\n min-width: 0;\n\n & svg {\n font-size: 2em !important;\n margin: 0 0.33em 0 0 !important;\n }\n"])), function (p) {
|
|
6
|
-
return p.$icon ? "display: flex;" : "display: inline-block; text-align: left;";
|
|
7
|
-
});
|
|
8
|
-
var ButtonCompositeIcon = styled.svg(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n float: left;\n"], ["\n float: left;\n"])));
|
|
9
|
-
var BesidesIcon = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n text-align: left;\n line-height: 1.2;\n"], ["\n text-align: left;\n line-height: 1.2;\n"])));
|
|
10
|
-
var Main = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: block;\n font-size: 0.9em;\n\n &:last-child {\n margin-top: ", ";\n }\n"], ["\n display: block;\n font-size: 0.9em;\n\n &:last-child {\n margin-top: ", ";\n }\n"])), function (p) { return (p.$reverse && !p.$icon ? "0.5em" : "0"); });
|
|
11
|
-
var Sub = styled.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: block;\n text-transform: none;\n font-size: 0.7em;\n font-weight: 500;\n\n ", " + & {\n margin-top: ", ";\n }\n"], ["\n display: block;\n text-transform: none;\n font-size: 0.7em;\n font-weight: 500;\n\n ", " + & {\n margin-top: ", ";\n }\n"])), Main, function (p) { return (p.$reverse && !p.$icon ? "0.5em" : "0"); });
|
|
12
|
-
var Text = styled.span(templateObject_6 || (templateObject_6 = __makeTemplateObject([""], [""])));
|
|
13
|
-
var Inner = memo(function (_a) {
|
|
14
|
-
var textMain = _a.textMain, textSub = _a.textSub, text = _a.text, $reverse = _a.$reverse, $icon = _a.$icon;
|
|
15
|
-
return (_jsxs(_Fragment, { children: [$reverse ? (_jsxs(_Fragment, { children: [textSub && (_jsx(Sub, { "$icon": $icon, "$reverse": $reverse, children: textSub })), textMain && (_jsx(Main, { "$icon": $icon, "$reverse": $reverse, children: textMain }))] })) : (_jsxs(_Fragment, { children: [textMain && (_jsx(Main, { "$icon": $icon, "$reverse": $reverse, children: textMain })), textSub && (_jsx(Sub, { "$icon": $icon, "$reverse": $reverse, children: textSub }))] })), text && _jsx(Text, { children: text })] }));
|
|
16
|
-
});
|
|
17
|
-
export var KoineButtonComposite = function (_a) {
|
|
18
|
-
var Icon = _a.Icon, _b = _a.iconProps, iconProps = _b === void 0 ? {} : _b, textMain = _a.textMain, textSub = _a.textSub, textReverse = _a.textReverse, text = _a.text, _c = _a.Button, Button = _c === void 0 ? "button" : _c, _d = _a.ButtonLink, ButtonLink = _d === void 0 ? "a" : _d, props = __rest(_a, ["Icon", "iconProps", "textMain", "textSub", "textReverse", "text", "Button", "ButtonLink"]);
|
|
19
|
-
var Btn = props.href ? ButtonLink : Button;
|
|
20
|
-
var styledProps = {
|
|
21
|
-
$icon: !!Icon,
|
|
22
|
-
$reverse: textReverse,
|
|
23
|
-
$twoLines: !!(textMain && textSub && !Icon),
|
|
24
|
-
};
|
|
25
|
-
var innerProps = __assign({ textMain: textMain, textSub: textSub, text: text }, styledProps);
|
|
26
|
-
return (_jsxs(Root, __assign({ as: Btn }, props, styledProps, { children: [Icon && _jsx(ButtonCompositeIcon, __assign({ as: Icon }, iconProps)), Icon ? (_jsx(BesidesIcon, __assign({}, styledProps, { children: _jsx(Inner, __assign({}, innerProps)) }))) : (_jsx(Inner, __assign({}, innerProps)))] })));
|
|
27
|
-
};
|
|
28
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
package/Buttons/ButtonFab.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IconButtonProps } from "./IconButton.js";
|
|
2
|
-
export declare const buttonFab: import("styled-components").FlattenSimpleInterpolation;
|
|
3
|
-
export declare const IconButtonFab: any;
|
|
4
|
-
export type IconButtonFabProps = IconButtonProps & React.ComponentPropsWithRef<"button">;
|
package/Buttons/ButtonFab.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import styled, { css } from "styled-components";
|
|
3
|
-
import { IconButton } from "./IconButton.js";
|
|
4
|
-
export var buttonFab = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-shadow: 3px 3px 6px -4px rgb(0, 0, 0, 0.5);\n"], ["\n box-shadow: 3px 3px 6px -4px rgb(0, 0, 0, 0.5);\n"])));
|
|
5
|
-
export var IconButtonFab = styled(IconButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), buttonFab);
|
|
6
|
-
var templateObject_1, templateObject_2;
|
package/Buttons/ButtonLink.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { KoineLinkProps } from "../Link/index.js";
|
|
2
|
-
import { KoineComponent, KoineComponentProps } from "../types.js";
|
|
3
|
-
import { KoineButtonUiProps } from "./Button.js";
|
|
4
|
-
export type KoineButtonLinkProps = KoineButtonUiProps & KoineLinkProps;
|
|
5
|
-
export type ButtonLinkProps = KoineComponentProps<KoineButtonLinkProps, {
|
|
6
|
-
Link?: KoineComponent;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const KoineButtonLink: ({ href, Link, ...props }: React.PropsWithChildren<ButtonLinkProps>) => import("react/jsx-runtime").JSX.Element;
|
package/Buttons/ButtonLink.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import styled from "styled-components";
|
|
4
|
-
import { KoineButton } from "./Button.js";
|
|
5
|
-
var Root = styled(KoineButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-decoration: none;\n"], ["\n text-decoration: none;\n"])));
|
|
6
|
-
export var KoineButtonLink = function (_a) {
|
|
7
|
-
var href = _a.href, _b = _a.Link, Link = _b === void 0 ? "a" : _b, props = __rest(_a, ["href", "Link"]);
|
|
8
|
-
var isRelative = href && href.startsWith("/");
|
|
9
|
-
return isRelative ? (_jsx(Root, __assign({ href: href }, props, { as: Link }))) : (_jsx(Root, __assign({ href: href }, props, { as: "a" })));
|
|
10
|
-
};
|
|
11
|
-
var templateObject_1;
|
package/Buttons/IconButton.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { KoineButtonUiProps } from "./Button.js";
|
|
2
|
-
export declare const iconBtnStyleReset: import("styled-components").FlattenSimpleInterpolation;
|
|
3
|
-
export declare const iconBtnStyleBase: import("styled-components").FlattenSimpleInterpolation;
|
|
4
|
-
export declare const IconButton: any;
|
|
5
|
-
export type IconButtonUiProps = KoineButtonUiProps & {
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type IconButtonProps = IconButtonUiProps & React.ComponentPropsWithRef<"button">;
|
package/Buttons/IconButton.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import styled, { css } from "styled-components";
|
|
3
|
-
import { btnStyleContained, btnStyleOutlined, btnStyleReset, } from "./Button.js";
|
|
4
|
-
export var iconBtnStyleReset = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 100%;\n ", "\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 100%;\n ", "\n"])), btnStyleReset);
|
|
5
|
-
export var iconBtnStyleBase = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), iconBtnStyleReset);
|
|
6
|
-
export var IconButton = styled.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n"])), iconBtnStyleBase, function (p) { return p.$variant === "outlined" && btnStyleOutlined; }, function (p) { return p.$variant === "contained" && btnStyleContained; });
|
|
7
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
package/Buttons/index.d.ts
DELETED
package/Buttons/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { KoineComponent, KoineComponentProps } from "../types.js";
|
|
2
|
-
import type { CalendarView, CalendarViewDayProps, CalendarViewEvent, CalendarsMap } from "./types.js";
|
|
3
|
-
import { UseCalendarReturn } from "./useCalendar.js";
|
|
4
|
-
export type KoineCalendarDaygridCellProps = {
|
|
5
|
-
eventClicked?: UseCalendarReturn["eventClicked"];
|
|
6
|
-
setEventClicked: UseCalendarReturn["setEventClicked"];
|
|
7
|
-
eventHovered?: UseCalendarReturn["eventHovered"];
|
|
8
|
-
setEventHovered: UseCalendarReturn["setEventHovered"];
|
|
9
|
-
view: CalendarView;
|
|
10
|
-
maxEvents: number;
|
|
11
|
-
events: CalendarViewEvent[];
|
|
12
|
-
calendarsMap: CalendarsMap;
|
|
13
|
-
};
|
|
14
|
-
export type CalendarDaygridCellStyledProps = CalendarViewDayProps & {
|
|
15
|
-
$view: CalendarView;
|
|
16
|
-
$selected?: boolean;
|
|
17
|
-
$past?: boolean;
|
|
18
|
-
$color: string;
|
|
19
|
-
};
|
|
20
|
-
export type CalendarDaygridCellEventProps = React.ComponentPropsWithoutRef<"div"> & ((CalendarDaygridCellStyledProps & {
|
|
21
|
-
$placeholder?: false;
|
|
22
|
-
}) | {
|
|
23
|
-
$placeholder: true;
|
|
24
|
-
});
|
|
25
|
-
export type CalendarDaygridCellEventBtnProps = CalendarDaygridCellEventProps;
|
|
26
|
-
export type CalendarDaygridCellComponents = {
|
|
27
|
-
Cell?: KoineComponent;
|
|
28
|
-
CellOverflow?: KoineComponent;
|
|
29
|
-
CellEvent?: KoineComponent<CalendarDaygridCellEventProps>;
|
|
30
|
-
CellEventBtn?: KoineComponent<CalendarDaygridCellEventBtnProps>;
|
|
31
|
-
CellEventTitle?: KoineComponent;
|
|
32
|
-
CellEventStart?: KoineComponent;
|
|
33
|
-
};
|
|
34
|
-
export type CalendarDaygridCellProps = KoineComponentProps<KoineCalendarDaygridCellProps, CalendarDaygridCellComponents>;
|
|
35
|
-
export declare const CalendarDaygridCell: ({ eventClicked, setEventClicked, setEventHovered, view, maxEvents, events, calendarsMap, Cell, CellOverflow, CellEvent, CellEventBtn, CellEventTitle, CellEventStart, }: CalendarDaygridCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { __assign, __read } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Fragment, useState } from "react";
|
|
4
|
-
import { MdAdd as IconExpand, } from "react-icons/md";
|
|
5
|
-
import { getDisplayTime } from "./utils.js";
|
|
6
|
-
var styleBtn = {
|
|
7
|
-
overflow: "hidden",
|
|
8
|
-
whiteSpace: "nowrap",
|
|
9
|
-
textOverflow: "ellipsis",
|
|
10
|
-
};
|
|
11
|
-
export var CalendarDaygridCell = function (_a) {
|
|
12
|
-
var eventClicked = _a.eventClicked, setEventClicked = _a.setEventClicked, setEventHovered = _a.setEventHovered, view = _a.view, maxEvents = _a.maxEvents, events = _a.events, calendarsMap = _a.calendarsMap, _b = _a.Cell, Cell = _b === void 0 ? "div" : _b, _c = _a.CellOverflow, CellOverflow = _c === void 0 ? "div" : _c, _d = _a.CellEvent, CellEvent = _d === void 0 ? "div" : _d, _e = _a.CellEventBtn, CellEventBtn = _e === void 0 ? "div" : _e, _f = _a.CellEventTitle, CellEventTitle = _f === void 0 ? "span" : _f, _g = _a.CellEventStart, CellEventStart = _g === void 0 ? "span" : _g;
|
|
13
|
-
var _h = __read(useState(false), 2), isExpanded = _h[0], expand = _h[1];
|
|
14
|
-
var eventsWithoutPlaceholders = events.filter(function (event) { return !event.placeholder; });
|
|
15
|
-
return (_jsx(Cell, { children: events.map(function (event, i) {
|
|
16
|
-
if (i === maxEvents && !isExpanded) {
|
|
17
|
-
return (_jsxs(CellOverflow, { onClick: function () { return expand(true); }, children: [_jsx(IconExpand, {}), eventsWithoutPlaceholders.length - maxEvents] }, "overflowMessage" + i));
|
|
18
|
-
}
|
|
19
|
-
if (i > maxEvents && !isExpanded)
|
|
20
|
-
return null;
|
|
21
|
-
if (event.placeholder) {
|
|
22
|
-
return (_jsx(Fragment, { children: _jsx(CellEvent, { "$placeholder": true, children: _jsx(CellEventBtn, { "aria-hidden": "true", style: { visibility: "hidden" }, "$placeholder": true, children: _jsx(CellEventTitle, { children: "\u00A0" }) }) }) }, event.key));
|
|
23
|
-
}
|
|
24
|
-
var styleEvent = {
|
|
25
|
-
zIndex: event.firstOfMulti ? 1 : 0,
|
|
26
|
-
position: "relative",
|
|
27
|
-
width: event.firstOfMulti ? "".concat(100 * event.width, "%") : "100%",
|
|
28
|
-
};
|
|
29
|
-
if (!calendarsMap[event.calendar.id].on) {
|
|
30
|
-
styleBtn.display = "none";
|
|
31
|
-
}
|
|
32
|
-
var styledProps = {
|
|
33
|
-
$view: view,
|
|
34
|
-
$selected: (eventClicked === null || eventClicked === void 0 ? void 0 : eventClicked.uid) === event.uid,
|
|
35
|
-
$past: event.isPast,
|
|
36
|
-
$color: event.color,
|
|
37
|
-
$isOutOfRange: event.$isOutOfRange,
|
|
38
|
-
$isToday: event.$isToday,
|
|
39
|
-
};
|
|
40
|
-
return (_jsx(Fragment, { children: _jsx(CellEvent, __assign({ style: styleEvent }, styledProps, { children: _jsx(CellEventBtn, __assign({ role: "button", style: styleBtn }, styledProps, { onClick: function () {
|
|
41
|
-
return setEventClicked(function (prev) {
|
|
42
|
-
return (prev === null || prev === void 0 ? void 0 : prev.uid) === event.uid ? null : event;
|
|
43
|
-
});
|
|
44
|
-
}, onMouseEnter: function () { return setEventHovered(event); }, onMouseLeave: function () { return setEventHovered(null); }, children: event.allDay ? (_jsx(CellEventTitle, { children: event.title })) : (_jsxs(_Fragment, { children: [_jsx(CellEventStart, { children: getDisplayTime(event.start) }), _jsx(CellEventTitle, { children: event.title })] })) })) })) }, event.key));
|
|
45
|
-
}) }));
|
|
46
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { KoineComponent, KoineComponentProps } from "../types.js";
|
|
2
|
-
import type { CalendarRange, CalendarView } from "./types.js";
|
|
3
|
-
export type KoineCalendarDaygridNavProps = {
|
|
4
|
-
locale: string;
|
|
5
|
-
range: CalendarRange;
|
|
6
|
-
view: CalendarView;
|
|
7
|
-
todayInView?: boolean;
|
|
8
|
-
handlePrev: () => any;
|
|
9
|
-
handleNext: () => any;
|
|
10
|
-
handleToday: () => any;
|
|
11
|
-
handleView: (view: CalendarView) => any;
|
|
12
|
-
};
|
|
13
|
-
export type CalendarDaygridNavTitleProps = {
|
|
14
|
-
range: CalendarRange;
|
|
15
|
-
formatted: string;
|
|
16
|
-
};
|
|
17
|
-
export type CalendarDaygridNavProps = KoineComponentProps<KoineCalendarDaygridNavProps, {
|
|
18
|
-
NavRoot?: KoineComponent;
|
|
19
|
-
NavTitle?: KoineComponent<CalendarDaygridNavTitleProps>;
|
|
20
|
-
NavBtns?: KoineComponent;
|
|
21
|
-
NavBtnPrev?: KoineComponent;
|
|
22
|
-
NavBtnNext?: KoineComponent;
|
|
23
|
-
NavBtnToday?: KoineComponent;
|
|
24
|
-
NavBtnViewMonth?: KoineComponent;
|
|
25
|
-
NavBtnViewWeek?: KoineComponent;
|
|
26
|
-
}>;
|
|
27
|
-
export declare const KoineCalendarDaygridNav: ({ range, view, todayInView, handlePrev, handleNext, handleToday, handleView, locale: localeCode, NavRoot, NavTitle, NavBtns, NavBtnPrev, NavBtnNext, NavBtnToday, NavBtnViewMonth, NavBtnViewWeek, }: CalendarDaygridNavProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import format from "date-fns/format";
|
|
4
|
-
import { useDateLocale } from "../useDateLocale.js";
|
|
5
|
-
export var KoineCalendarDaygridNav = function (_a) {
|
|
6
|
-
var range = _a.range, view = _a.view, todayInView = _a.todayInView, handlePrev = _a.handlePrev, handleNext = _a.handleNext, handleToday = _a.handleToday, handleView = _a.handleView, localeCode = _a.locale, _b = _a.NavRoot, NavRoot = _b === void 0 ? "nav" : _b, _c = _a.NavTitle, NavTitle = _c === void 0 ? "div" : _c, _d = _a.NavBtns, NavBtns = _d === void 0 ? "div" : _d, _e = _a.NavBtnPrev, NavBtnPrev = _e === void 0 ? "button" : _e, _f = _a.NavBtnNext, NavBtnNext = _f === void 0 ? "button" : _f, _g = _a.NavBtnToday, NavBtnToday = _g === void 0 ? "button" : _g, _h = _a.NavBtnViewMonth, NavBtnViewMonth = _h === void 0 ? "button" : _h, _j = _a.NavBtnViewWeek, NavBtnViewWeek = _j === void 0 ? "button" : _j;
|
|
7
|
-
var _k = __read(range, 2), start = _k[0], end = _k[1];
|
|
8
|
-
var locale = useDateLocale(localeCode);
|
|
9
|
-
var opts = { locale: locale };
|
|
10
|
-
var formatted = "";
|
|
11
|
-
if (view === "month") {
|
|
12
|
-
formatted = format(start, "MMMM yyyy", opts);
|
|
13
|
-
}
|
|
14
|
-
if (view === "week") {
|
|
15
|
-
var inSameMonth = start.getMonth() === end.getMonth();
|
|
16
|
-
if (inSameMonth) {
|
|
17
|
-
formatted = format(start, "# MMMM yyyy", opts).replace("#", "".concat(start.getDate(), "-").concat(end.getDate()));
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
formatted = "".concat(format(start, "d MMMM", opts), " - ").concat(format(end, "d MMMM yyyy", opts));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return (_jsxs(NavRoot, { children: [_jsxs(NavBtns, { children: [_jsx(NavBtnPrev, { onClick: handlePrev }), _jsx(NavBtnNext, { onClick: handleNext }), _jsx(NavBtnToday, { onClick: handleToday, disabled: todayInView }), _jsx(NavBtnViewMonth, { onClick: function () { return handleView("month"); }, disabled: view === "month" }), _jsx(NavBtnViewWeek, { onClick: function () { return handleView("week"); }, disabled: view === "week" })] }), _jsx(NavTitle, { range: range, formatted: formatted })] }));
|
|
24
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { KoineComponent, KoineComponentProps } from "../types.js";
|
|
2
|
-
import { CalendarDaygridCellComponents, CalendarDaygridCellProps } from "./CalendarDaygridCell.js";
|
|
3
|
-
import type { CalendarEventsMap, CalendarRange, CalendarView, CalendarViewDayProps } from "./types.js";
|
|
4
|
-
export type CalendarDaygridTableBodyCellProps = CalendarViewDayProps;
|
|
5
|
-
export type CalendarDaygridTableBodyCellDateProps = CalendarViewDayProps;
|
|
6
|
-
export type KoineCalendarDaygridTableProps = {
|
|
7
|
-
maxEvents?: CalendarDaygridCellProps["maxEvents"];
|
|
8
|
-
locale: string;
|
|
9
|
-
events: CalendarEventsMap;
|
|
10
|
-
handlePrev: () => any;
|
|
11
|
-
handleNext: () => any;
|
|
12
|
-
view: CalendarView;
|
|
13
|
-
range: CalendarRange;
|
|
14
|
-
dayLabels?: string[];
|
|
15
|
-
} & Pick<CalendarDaygridCellProps, "eventClicked" | "setEventClicked" | "eventHovered" | "setEventHovered" | "calendarsMap">;
|
|
16
|
-
export type CalendarDaygridTableProps = KoineComponentProps<KoineCalendarDaygridTableProps, {
|
|
17
|
-
Table?: KoineComponent;
|
|
18
|
-
TableHead?: KoineComponent;
|
|
19
|
-
TableHeadCell?: KoineComponent;
|
|
20
|
-
TableBody?: KoineComponent;
|
|
21
|
-
TableBodyCell?: KoineComponent<CalendarDaygridTableBodyCellProps>;
|
|
22
|
-
TableBodyCellDate?: KoineComponent<CalendarDaygridTableBodyCellDateProps>;
|
|
23
|
-
TableBodyRow?: KoineComponent;
|
|
24
|
-
} & CalendarDaygridCellComponents>;
|
|
25
|
-
export declare const KoineCalendarDaygridTable: ({ locale: localeCode, handlePrev, handleNext, events, dayLabels, view, range, eventClicked, setEventClicked, eventHovered, setEventHovered, calendarsMap, maxEvents, Table, TableHead, TableHeadCell, TableBody, TableBodyRow, TableBodyCell, TableBodyCellDate, Cell, CellOverflow, CellEvent, CellEventBtn, CellEventTitle, CellEventStart, }: CalendarDaygridTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { __assign, __read } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import eachWeekOfInterval from "date-fns/eachWeekOfInterval";
|
|
4
|
-
import { useEffect, useMemo, useState } from "react";
|
|
5
|
-
import { useSwipeable } from "react-swipeable";
|
|
6
|
-
import { useDateLocale } from "../useDateLocale.js";
|
|
7
|
-
import { CalendarDaygridCell, } from "./CalendarDaygridCell.js";
|
|
8
|
-
import { processEventsInView } from "./utils.js";
|
|
9
|
-
function getView(range) {
|
|
10
|
-
var _a = __read(range, 2), start = _a[0], end = _a[1];
|
|
11
|
-
var weeks = eachWeekOfInterval({ start: start, end: end }, { weekStartsOn: 1 });
|
|
12
|
-
return {
|
|
13
|
-
month: start.getMonth(),
|
|
14
|
-
weeks: weeks,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export var KoineCalendarDaygridTable = function (_a) {
|
|
18
|
-
var localeCode = _a.locale, handlePrev = _a.handlePrev, handleNext = _a.handleNext, events = _a.events, dayLabels = _a.dayLabels, view = _a.view, range = _a.range, eventClicked = _a.eventClicked, setEventClicked = _a.setEventClicked, eventHovered = _a.eventHovered, setEventHovered = _a.setEventHovered, _b = _a.calendarsMap, calendarsMap = _b === void 0 ? {} : _b, _c = _a.maxEvents, maxEvents = _c === void 0 ? 5 : _c, _d = _a.Table, Table = _d === void 0 ? "table" : _d, _e = _a.TableHead, TableHead = _e === void 0 ? "thead" : _e, _f = _a.TableHeadCell, TableHeadCell = _f === void 0 ? "th" : _f, _g = _a.TableBody, TableBody = _g === void 0 ? "tbody" : _g, _h = _a.TableBodyRow, TableBodyRow = _h === void 0 ? "tr" : _h, _j = _a.TableBodyCell, TableBodyCell = _j === void 0 ? "td" : _j, _k = _a.TableBodyCellDate, TableBodyCellDate = _k === void 0 ? "div" : _k, Cell = _a.Cell, CellOverflow = _a.CellOverflow, CellEvent = _a.CellEvent, CellEventBtn = _a.CellEventBtn, CellEventTitle = _a.CellEventTitle, CellEventStart = _a.CellEventStart;
|
|
19
|
-
var restKoine = {
|
|
20
|
-
Cell: Cell,
|
|
21
|
-
CellOverflow: CellOverflow,
|
|
22
|
-
CellEvent: CellEvent,
|
|
23
|
-
CellEventBtn: CellEventBtn,
|
|
24
|
-
CellEventTitle: CellEventTitle,
|
|
25
|
-
CellEventStart: CellEventStart,
|
|
26
|
-
};
|
|
27
|
-
var _l = __read(useState(dayLabels || [0, 1, 2, 3, 4, 5, 6]), 2), days = _l[0], setDays = _l[1];
|
|
28
|
-
var _m = __read(useState([]), 2), weeksEvents = _m[0], setWeeksEvents = _m[1];
|
|
29
|
-
var locale = useDateLocale(localeCode);
|
|
30
|
-
var _o = useMemo(function () { return getView(range); }, [range]), month = _o.month, weeks = _o.weeks;
|
|
31
|
-
var swipeableHandlers = useSwipeable({
|
|
32
|
-
onSwipedLeft: handleNext,
|
|
33
|
-
onSwipedRight: handlePrev,
|
|
34
|
-
});
|
|
35
|
-
useEffect(function () {
|
|
36
|
-
setWeeksEvents(processEventsInView(events, view, month, weeks));
|
|
37
|
-
}, [events, view, month, weeks]);
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
if (locale && locale.localize && !dayLabels) {
|
|
40
|
-
setDays([1, 2, 3, 4, 5, 6, 0].map(function (i) { return locale.localize.day(i, { width: "abbreviated" }); }));
|
|
41
|
-
}
|
|
42
|
-
}, [locale, dayLabels]);
|
|
43
|
-
return (_jsxs(Table, __assign({}, swipeableHandlers, { children: [_jsx(TableHead, { children: _jsx("tr", { children: days.map(function (day) { return (_jsx(TableHeadCell, { scope: "column", children: day }, day)); }) }) }), _jsx(TableBody, { children: weeksEvents.map(function (week, i) { return (_jsx(TableBodyRow, __assign({}, week.props, { children: week.days.map(function (day) { return (_jsxs(TableBodyCell, __assign({}, day.props, { children: [_jsx(TableBodyCellDate, __assign({}, day.props, { children: day.label })), day.events.length > 0 && (_jsx(CalendarDaygridCell, __assign({ eventClicked: eventClicked, setEventClicked: setEventClicked, eventHovered: eventHovered, setEventHovered: setEventHovered, view: view, maxEvents: maxEvents, events: day.events,
|
|
44
|
-
timestamp: day.timestamp, calendarsMap: calendarsMap }, restKoine)))] }))); }) }))); }) })] })));
|
|
45
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { KoineComponent, KoineComponentProps } from "../types.js";
|
|
2
|
-
import type { CalendarsMap } from "./types.js";
|
|
3
|
-
export type KoineCalendarLegendProps = {
|
|
4
|
-
toggleCalendarVisibility: (id: string) => void;
|
|
5
|
-
calendarsMap: CalendarsMap;
|
|
6
|
-
};
|
|
7
|
-
export type CalendarLegendItemProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
8
|
-
$color: string;
|
|
9
|
-
$empty: boolean;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type CalendarLegendProps = KoineComponentProps<KoineCalendarLegendProps, {
|
|
13
|
-
LegendItem?: KoineComponent<CalendarLegendItemProps>;
|
|
14
|
-
LegendItemStatus?: KoineComponent;
|
|
15
|
-
LegendItemLabel?: KoineComponent;
|
|
16
|
-
LegendItemEvents?: KoineComponent;
|
|
17
|
-
}>;
|
|
18
|
-
export declare const KoineCalendarLegend: ({ calendarsMap, toggleCalendarVisibility, LegendItem, LegendItemStatus, LegendItemLabel, LegendItemEvents, }: CalendarLegendProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
export var KoineCalendarLegend = function (_a) {
|
|
4
|
-
var _b = _a.calendarsMap, calendarsMap = _b === void 0 ? {} : _b, toggleCalendarVisibility = _a.toggleCalendarVisibility, _c = _a.LegendItem, LegendItem = _c === void 0 ? "div" : _c, _d = _a.LegendItemStatus, LegendItemStatus = _d === void 0 ? "span" : _d, _e = _a.LegendItemLabel, LegendItemLabel = _e === void 0 ? "span" : _e, _f = _a.LegendItemEvents, LegendItemEvents = _f === void 0 ? "span" : _f;
|
|
5
|
-
return (_jsx(_Fragment, { children: Object.entries(calendarsMap).map(function (_a) {
|
|
6
|
-
var _b = __read(_a, 2), id = _b[0], calendar = _b[1];
|
|
7
|
-
return (_jsxs(LegendItem, { onClick: function () { return toggleCalendarVisibility(id); }, "$color": calendar.color, "$empty": calendar.events === 0, disabled: calendar.events === 0, children: [_jsx(LegendItemStatus, { children: calendar.on ? "\u2b24" : "\u2b58" }), _jsx(LegendItemLabel, { children: calendar.name }), _jsx(LegendItemEvents, { children: calendar.events })] }, "CalendarLegend." + id));
|
|
8
|
-
}) }));
|
|
9
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CalendarEventsMap, Calendars } from "./types.js";
|
|
2
|
-
type GetCalendarsEventsFromGoogleOptions = {
|
|
3
|
-
apiKey?: string;
|
|
4
|
-
start: Date;
|
|
5
|
-
end: Date;
|
|
6
|
-
timeZone?: string;
|
|
7
|
-
calendars: Calendars;
|
|
8
|
-
};
|
|
9
|
-
export declare function getCalendarsEventsFromGoogle({ calendars, ...options }: GetCalendarsEventsFromGoogleOptions): Promise<CalendarEventsMap>;
|
|
10
|
-
export {};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __rest } from "tslib";
|
|
2
|
-
import differenceInDays from "date-fns/differenceInDays";
|
|
3
|
-
import subDays from "date-fns/subDays";
|
|
4
|
-
import { arrayToLookup, isString, isUndefined } from "@koine/utils";
|
|
5
|
-
import { addCalendarEvents, getEventTimestamp } from "./utils.js";
|
|
6
|
-
var baseURL = "https://www.googleapis.com/calendar/v3/calendars/";
|
|
7
|
-
export function getCalendarsEventsFromGoogle(_a) {
|
|
8
|
-
var calendars = _a.calendars, options = __rest(_a, ["calendars"]);
|
|
9
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
10
|
-
var allEvents;
|
|
11
|
-
var _this = this;
|
|
12
|
-
return __generator(this, function (_b) {
|
|
13
|
-
switch (_b.label) {
|
|
14
|
-
case 0:
|
|
15
|
-
allEvents = {};
|
|
16
|
-
return [4, Promise.all(calendars.map(function (calendar) { return __awaiter(_this, void 0, void 0, function () {
|
|
17
|
-
var events;
|
|
18
|
-
return __generator(this, function (_a) {
|
|
19
|
-
switch (_a.label) {
|
|
20
|
-
case 0: return [4, getCalendarEventsFromGoogle(__assign({ calendar: calendar }, options))];
|
|
21
|
-
case 1:
|
|
22
|
-
events = _a.sent();
|
|
23
|
-
addCalendarEvents(events, allEvents);
|
|
24
|
-
return [2];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}); }))];
|
|
28
|
-
case 1:
|
|
29
|
-
_b.sent();
|
|
30
|
-
return [2, allEvents];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function getCalendarEventsFromGoogle(_a) {
|
|
36
|
-
var apiKey = _a.apiKey, calendar = _a.calendar, _b = _a.timeZone, timeZone = _b === void 0 ? "" : _b, start = _a.start, end = _a.end;
|
|
37
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
38
|
-
var events, params, url, response, data, e_1;
|
|
39
|
-
return __generator(this, function (_c) {
|
|
40
|
-
switch (_c.label) {
|
|
41
|
-
case 0:
|
|
42
|
-
events = {};
|
|
43
|
-
params = new URLSearchParams({
|
|
44
|
-
calendarId: calendar.id,
|
|
45
|
-
timeZone: timeZone,
|
|
46
|
-
singleEvents: "true",
|
|
47
|
-
maxAttendees: "1",
|
|
48
|
-
maxResults: "9999",
|
|
49
|
-
sanitizeHtml: "true",
|
|
50
|
-
timeMin: start.toISOString(),
|
|
51
|
-
timeMax: end.toISOString(),
|
|
52
|
-
key: apiKey || process.env["GOOGLE_CALENDAR_API_KEY"] || "",
|
|
53
|
-
}).toString();
|
|
54
|
-
url = baseURL + calendar.id + "/events?" + params;
|
|
55
|
-
_c.label = 1;
|
|
56
|
-
case 1:
|
|
57
|
-
_c.trys.push([1, 4, , 5]);
|
|
58
|
-
return [4, fetch(url, { method: "GET" })];
|
|
59
|
-
case 2:
|
|
60
|
-
response = _c.sent();
|
|
61
|
-
return [4, response.json()];
|
|
62
|
-
case 3:
|
|
63
|
-
data = (_c.sent());
|
|
64
|
-
calendar.name = calendar.name || data.summary;
|
|
65
|
-
data.items.forEach(function (googleEvent) {
|
|
66
|
-
var event = transformCalendarEventFromGoogle(googleEvent, calendar);
|
|
67
|
-
events[event.uid] = event;
|
|
68
|
-
});
|
|
69
|
-
return [3, 5];
|
|
70
|
-
case 4:
|
|
71
|
-
e_1 = _c.sent();
|
|
72
|
-
return [3, 5];
|
|
73
|
-
case 5: return [2, events];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function transformCalendarEventFromGoogle(event, calendar) {
|
|
79
|
-
var created = new Date(event.created);
|
|
80
|
-
var link = event.htmlLink;
|
|
81
|
-
var title = event.summary;
|
|
82
|
-
var status = event.status;
|
|
83
|
-
var start = new Date(event.start.date || event.start.dateTime);
|
|
84
|
-
var end = new Date(event.end.date || event.end.dateTime);
|
|
85
|
-
var color = calendar.color;
|
|
86
|
-
var allDay = isUndefined(event.end.dateTime) && isString(event.end.date);
|
|
87
|
-
var location = event.location || "";
|
|
88
|
-
var description = event.description || "";
|
|
89
|
-
var uid = created.getTime() + "" + start.getTime();
|
|
90
|
-
if (allDay && end > start) {
|
|
91
|
-
end = subDays(end, 1);
|
|
92
|
-
end.setHours(23, 59, 59);
|
|
93
|
-
}
|
|
94
|
-
var days = getDays();
|
|
95
|
-
var daysMap = arrayToLookup(days);
|
|
96
|
-
var multi = days.length > 1;
|
|
97
|
-
function getDays() {
|
|
98
|
-
var from = new Date(start);
|
|
99
|
-
var to = new Date(end);
|
|
100
|
-
var days = [getEventTimestamp(from)];
|
|
101
|
-
while (differenceInDays(to, from)) {
|
|
102
|
-
from.setDate(from.getDate() + 1);
|
|
103
|
-
days.push(getEventTimestamp(from));
|
|
104
|
-
}
|
|
105
|
-
return days;
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
calendar: calendar,
|
|
109
|
-
created: created,
|
|
110
|
-
link: link,
|
|
111
|
-
title: title,
|
|
112
|
-
status: status,
|
|
113
|
-
start: start,
|
|
114
|
-
end: end,
|
|
115
|
-
days: days,
|
|
116
|
-
daysMap: daysMap,
|
|
117
|
-
multi: multi,
|
|
118
|
-
color: color,
|
|
119
|
-
allDay: allDay,
|
|
120
|
-
location: location,
|
|
121
|
-
description: description,
|
|
122
|
-
uid: uid,
|
|
123
|
-
};
|
|
124
|
-
}
|
package/Calendar/index.d.ts
DELETED
package/Calendar/index.js
DELETED
package/Calendar/types.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export type Calendar = {
|
|
2
|
-
id: string;
|
|
3
|
-
color: string;
|
|
4
|
-
name?: string;
|
|
5
|
-
};
|
|
6
|
-
export type Calendars = Calendar[];
|
|
7
|
-
export type CalendarsMap = Record<Calendar["id"], Required<Calendar> & {
|
|
8
|
-
on?: boolean;
|
|
9
|
-
events?: number;
|
|
10
|
-
}>;
|
|
11
|
-
export type CalendarRange = [Date, Date];
|
|
12
|
-
export type CalendarView = "month" | "week";
|
|
13
|
-
export type CalendarEvent = {
|
|
14
|
-
calendar: Calendar;
|
|
15
|
-
days: number[];
|
|
16
|
-
daysMap: Record<number, 1>;
|
|
17
|
-
multi: boolean;
|
|
18
|
-
allDay: boolean;
|
|
19
|
-
link: string;
|
|
20
|
-
title: string;
|
|
21
|
-
status: string;
|
|
22
|
-
created: Date;
|
|
23
|
-
start: Date;
|
|
24
|
-
end: Date;
|
|
25
|
-
color: string;
|
|
26
|
-
location: string;
|
|
27
|
-
description: string;
|
|
28
|
-
uid: string;
|
|
29
|
-
};
|
|
30
|
-
export type CalendarEventsByTimestamp = Record<number, CalendarEventsMap>;
|
|
31
|
-
export type CalendarEventsMap = Record<CalendarEvent["uid"], CalendarEvent>;
|
|
32
|
-
export type CalendarViewWeeks = CalendarViewWeek[];
|
|
33
|
-
export type CalendarViewWeek = {
|
|
34
|
-
props: {
|
|
35
|
-
key: string;
|
|
36
|
-
};
|
|
37
|
-
days: CalendarViewDay[];
|
|
38
|
-
};
|
|
39
|
-
export type CalendarViewDay = {
|
|
40
|
-
props: {
|
|
41
|
-
key: string;
|
|
42
|
-
} & CalendarViewDayProps;
|
|
43
|
-
label: string;
|
|
44
|
-
timestamp: string;
|
|
45
|
-
events: CalendarViewEvent[];
|
|
46
|
-
};
|
|
47
|
-
export type CalendarViewDayProps = {
|
|
48
|
-
$isToday?: boolean;
|
|
49
|
-
$isOutOfRange?: boolean;
|
|
50
|
-
};
|
|
51
|
-
export type CalendarViewEvent = {
|
|
52
|
-
key: string;
|
|
53
|
-
placeholder: true;
|
|
54
|
-
top: number;
|
|
55
|
-
} | (CalendarEvent & CalendarViewDayProps & {
|
|
56
|
-
key: string;
|
|
57
|
-
placeholder?: false;
|
|
58
|
-
top: number;
|
|
59
|
-
width: number;
|
|
60
|
-
firstOfMulti?: boolean;
|
|
61
|
-
isPast?: boolean;
|
|
62
|
-
});
|
package/Calendar/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { KoineCalendarDaygridNavProps } from "./CalendarDaygridNav.js";
|
|
2
|
-
import type { KoineCalendarDaygridTableProps } from "./CalendarDaygridTable.js";
|
|
3
|
-
import type { KoineCalendarLegendProps } from "./CalendarLegend.js";
|
|
4
|
-
import type { CalendarEvent, CalendarEventsMap, CalendarView, Calendars } from "./types.js";
|
|
5
|
-
export type UseCalendarProps = {
|
|
6
|
-
locale: string;
|
|
7
|
-
calendars: Calendars;
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
events?: CalendarEventsMap;
|
|
10
|
-
start?: Date;
|
|
11
|
-
end?: Date;
|
|
12
|
-
view?: CalendarView;
|
|
13
|
-
timeZone?: string;
|
|
14
|
-
onError?: (e: any) => void;
|
|
15
|
-
};
|
|
16
|
-
export type UseCalendarReturn = ReturnType<typeof useCalendar>;
|
|
17
|
-
export type CalendarsUpdateActionEvents = {
|
|
18
|
-
type: "events";
|
|
19
|
-
payload: Record<string, number>;
|
|
20
|
-
};
|
|
21
|
-
export type CalendarsUpdateActionVisibility = {
|
|
22
|
-
type: "visibility";
|
|
23
|
-
payload: string | string[];
|
|
24
|
-
};
|
|
25
|
-
export type CalendarsUpdateAction = CalendarsUpdateActionEvents | CalendarsUpdateActionVisibility;
|
|
26
|
-
export declare function useCalendar({ locale, apiKey, calendars, events: initialEvents, start: initialStart, end: initialEnd, view: initialView, timeZone, onError, }: UseCalendarProps): {
|
|
27
|
-
view: "month" | "week";
|
|
28
|
-
eventClicked: CalendarEvent | null;
|
|
29
|
-
setEventClicked: import("react").Dispatch<import("react").SetStateAction<CalendarEvent | null>>;
|
|
30
|
-
eventHovered: CalendarEvent | null;
|
|
31
|
-
setEventHovered: import("react").Dispatch<import("react").SetStateAction<CalendarEvent | null>>;
|
|
32
|
-
getDaygridNavProps: () => KoineCalendarDaygridNavProps;
|
|
33
|
-
getDaygridTableProps: () => KoineCalendarDaygridTableProps;
|
|
34
|
-
getLegendProps: () => KoineCalendarLegendProps;
|
|
35
|
-
};
|