@koine/react 1.1.9 → 1.1.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.js +12 -8
- package/Alert/Alert.mjs +10 -0
- package/Alert/index.js +4 -1
- package/Alert/index.mjs +1 -0
- package/Alert/package.json +2 -2
- package/Animations/Reveal.js +18 -14
- package/Animations/Reveal.mjs +17 -0
- package/Animations/Underline.js +7 -4
- package/Animations/Underline.mjs +5 -0
- package/Animations/index.js +6 -3
- package/Animations/index.mjs +3 -0
- package/Animations/package.json +2 -2
- package/Animations/useReveal.js +11 -7
- package/{node/Animations/useReveal.js → Animations/useReveal.mjs} +7 -11
- package/Autocomplete/AutocompleteDownshift.js +5 -2
- package/{node/Autocomplete/AutocompleteDownshift.js → Autocomplete/AutocompleteDownshift.mjs} +2 -5
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +5 -2
- package/{node/Autocomplete/AutocompleteDownshiftMultiselect.js → Autocomplete/AutocompleteDownshiftMultiselect.mjs} +2 -5
- package/Autocomplete/AutocompleteMui.js +33 -35
- package/{node/Autocomplete/AutocompleteMui.js → Autocomplete/AutocompleteMui.mjs} +35 -33
- package/Autocomplete/AutocompleteReach.js +5 -2
- package/{node/Autocomplete/AutocompleteReach.js → Autocomplete/AutocompleteReach.mjs} +2 -5
- package/Autocomplete/components.js +25 -22
- package/Autocomplete/components.mjs +34 -0
- package/Autocomplete/helpers.js +11 -5
- package/{node/Autocomplete/helpers.js → Autocomplete/helpers.mjs} +6 -9
- package/Autocomplete/index.js +5 -1
- package/Autocomplete/index.mjs +3 -0
- package/Autocomplete/package.json +2 -2
- package/Bg/BgColor.js +14 -10
- package/Bg/BgColor.mjs +21 -0
- package/Bg/BgPhoto.js +13 -9
- package/Bg/BgPhoto.mjs +16 -0
- package/Bg/BgSvg.js +10 -6
- package/Bg/BgSvg.mjs +12 -0
- package/Bg/index.js +6 -3
- package/Bg/index.mjs +3 -0
- package/Bg/package.json +2 -2
- package/Breadcrumbs/Breadcrumbs.js +22 -18
- package/Breadcrumbs/Breadcrumbs.mjs +27 -0
- package/Breadcrumbs/index.js +4 -1
- package/Breadcrumbs/index.mjs +1 -0
- package/Breadcrumbs/package.json +2 -2
- package/Buttons/Button.js +12 -9
- package/Buttons/Button.mjs +14 -0
- package/Buttons/ButtonComposite.js +20 -16
- package/Buttons/ButtonComposite.mjs +28 -0
- package/Buttons/ButtonFab.js +8 -5
- package/Buttons/ButtonFab.mjs +6 -0
- package/Buttons/ButtonLink.js +12 -8
- package/Buttons/ButtonLink.mjs +11 -0
- package/Buttons/IconButton.js +9 -6
- package/Buttons/IconButton.mjs +7 -0
- package/Buttons/index.js +8 -5
- package/Buttons/index.mjs +5 -0
- package/Buttons/package.json +2 -2
- package/Calendar/CalendarDaygridCell.js +16 -12
- package/{node/Calendar/CalendarDaygridCell.js → Calendar/CalendarDaygridCell.mjs} +12 -16
- package/Calendar/CalendarDaygridNav.js +14 -9
- package/Calendar/CalendarDaygridNav.mjs +23 -0
- package/Calendar/CalendarDaygridTable.js +23 -19
- package/{node/Calendar/CalendarDaygridTable.js → Calendar/CalendarDaygridTable.mjs} +19 -23
- package/Calendar/CalendarLegend.js +9 -5
- package/Calendar/CalendarLegend.mjs +16 -0
- package/Calendar/calendar-api-google.js +27 -21
- package/{node/Calendar/calendar-api-google.js → Calendar/calendar-api-google.mjs} +23 -25
- package/Calendar/index.js +9 -6
- package/Calendar/index.mjs +6 -0
- package/Calendar/package.json +2 -2
- package/Calendar/types.js +2 -1
- package/Calendar/types.mjs +1 -0
- package/Calendar/useCalendar.js +43 -39
- package/{node/Calendar/useCalendar.js → Calendar/useCalendar.mjs} +39 -43
- package/Calendar/utils.js +44 -31
- package/{node/Calendar/utils.js → Calendar/utils.mjs} +31 -44
- package/Carousel/Carousel.js +4 -1
- package/{node/Carousel/Carousel.js → Carousel/Carousel.mjs} +1 -4
- package/Carousel/CarouselCss.js +17 -13
- package/Carousel/CarouselCss.mjs +22 -0
- package/Carousel/index.js +4 -1
- package/Carousel/index.mjs +1 -0
- package/Carousel/package.json +2 -2
- package/Collapsable/Collapsable.js +4 -1
- package/Collapsable/Collapsable.mjs +1 -0
- package/{node/Collapsable/CollapsableReach.js → Collapsable/CollapsableReach.mjs} +0 -0
- package/Collapsable/index.js +4 -1
- package/Collapsable/index.mjs +2 -0
- package/Collapsable/package.json +2 -2
- package/Debug/Debug.js +10 -6
- package/Debug/Debug.mjs +9 -0
- package/Debug/index.js +4 -1
- package/Debug/index.mjs +1 -0
- package/Debug/package.json +2 -2
- package/Details/Details.d.ts +1 -1
- package/Details/Details.js +30 -27
- package/Details/Details.mjs +63 -0
- package/Details/index.js +4 -1
- package/Details/index.mjs +1 -0
- package/Details/package.json +2 -2
- package/Dialog/DialogMui.d.ts +2 -2
- package/Dialog/DialogMui.js +28 -25
- package/{node/Dialog/DialogMui.js → Dialog/DialogMui.mjs} +25 -28
- package/Dialog/css/bare.js +21 -18
- package/Dialog/css/bare.mjs +21 -0
- package/Dialog/index.js +5 -1
- package/Dialog/index.mjs +1 -0
- package/Dialog/m/bare.js +26 -23
- package/Dialog/m/bare.mjs +52 -0
- package/Dialog/m/basic.js +7 -3
- package/{node/Dialog/m/basic.js → Dialog/m/basic.mjs} +3 -7
- package/Dialog/m/index.js +7 -3
- package/Dialog/m/index.mjs +4 -0
- package/Dialog/m/package.json +2 -2
- package/Dialog/package.json +2 -2
- package/Dialog/sc/bare.js +24 -21
- package/Dialog/sc/bare.mjs +43 -0
- package/Dialog/sc/framer.js +18 -15
- package/Dialog/sc/framer.mjs +16 -0
- package/Dialog/sc/framerMaterial.js +18 -15
- package/Dialog/sc/framerMaterial.mjs +16 -0
- package/Dialog/sc/material.js +22 -19
- package/Dialog/sc/material.mjs +21 -0
- package/Dialog/tw/bare.d.ts +6 -6
- package/Dialog/tw/bare.js +21 -18
- package/Dialog/tw/bare.mjs +42 -0
- package/Dialog/tw/elegant.d.ts +6 -6
- package/Dialog/tw/elegant.js +21 -18
- package/Dialog/tw/elegant.mjs +20 -0
- package/Dialog/tw/framer.d.ts +2 -2
- package/Dialog/tw/framer.js +18 -15
- package/Dialog/tw/framer.mjs +16 -0
- package/Dialog/tw/framerMaterial.d.ts +4 -4
- package/Dialog/tw/framerMaterial.js +18 -15
- package/Dialog/tw/framerMaterial.mjs +16 -0
- package/Dialog/tw/material.d.ts +6 -6
- package/Dialog/tw/material.js +21 -18
- package/Dialog/tw/material.mjs +20 -0
- package/Editor/Editor--tiptap.js +20 -15
- package/Editor/Editor--tiptap.mjs +26 -0
- package/Editor/components.js +14 -9
- package/Editor/components.mjs +10 -0
- package/Editor/index.js +4 -1
- package/Editor/index.mjs +1 -0
- package/Editor/package.json +2 -2
- package/FaviconTags/FaviconTags.js +8 -4
- package/FaviconTags/FaviconTags.mjs +16 -0
- package/FaviconTags/index.js +7 -2
- package/FaviconTags/index.mjs +2 -0
- package/FaviconTags/package.json +2 -2
- package/Form/Form.d.ts +1 -1
- package/Form/Form.js +28 -24
- package/Form/Form.mjs +61 -0
- package/Form/index.js +4 -1
- package/Form/index.mjs +1 -0
- package/Form/package.json +2 -2
- package/Form/sc/bare.js +21 -18
- package/Form/sc/bare.mjs +20 -0
- package/Forms/Checkbox/Checkbox.d.ts +1 -1
- package/Forms/Checkbox/Checkbox.js +16 -13
- package/Forms/Checkbox/Checkbox.mjs +18 -0
- package/Forms/Checkbox/index.js +4 -1
- package/Forms/Checkbox/index.mjs +1 -0
- package/Forms/Checkbox/package.json +2 -2
- package/Forms/Feedback/Feedback.js +10 -6
- package/Forms/Feedback/Feedback.mjs +9 -0
- package/Forms/Feedback/index.js +4 -1
- package/Forms/Feedback/index.mjs +1 -0
- package/Forms/Feedback/package.json +2 -2
- package/Forms/Field/Field.js +14 -10
- package/Forms/Field/Field.mjs +31 -0
- package/Forms/Field/FieldControl.js +18 -14
- package/Forms/Field/FieldControl.mjs +47 -0
- package/Forms/Field/FieldHint.js +6 -3
- package/Forms/Field/FieldHint.mjs +4 -0
- package/Forms/Field/index.js +5 -2
- package/Forms/Field/index.mjs +2 -0
- package/Forms/Field/package.json +2 -2
- package/Forms/Input/Input.d.ts +1 -1
- package/Forms/Input/Input.js +17 -14
- package/Forms/Input/Input.mjs +17 -0
- package/Forms/Input/index.js +4 -1
- package/Forms/Input/index.mjs +1 -0
- package/Forms/Input/package.json +2 -2
- package/Forms/InputGroup/InputGroup.js +17 -13
- package/Forms/InputGroup/InputGroup.mjs +15 -0
- package/Forms/InputGroup/index.js +4 -1
- package/Forms/InputGroup/index.mjs +1 -0
- package/Forms/InputGroup/package.json +2 -2
- package/Forms/Label/Label.js +8 -5
- package/Forms/Label/Label.mjs +6 -0
- package/Forms/Label/index.js +4 -1
- package/Forms/Label/index.mjs +1 -0
- package/Forms/Label/package.json +2 -2
- package/Forms/Password/Password.d.ts +1 -1
- package/Forms/Password/Password.js +17 -14
- package/Forms/Password/Password.mjs +17 -0
- package/Forms/Password/index.js +4 -1
- package/Forms/Password/index.mjs +1 -0
- package/Forms/Password/package.json +2 -2
- package/Forms/Radio/Radio.d.ts +1 -1
- package/Forms/Radio/Radio.js +22 -19
- package/Forms/Radio/Radio.mjs +25 -0
- package/Forms/Radio/index.js +4 -1
- package/Forms/Radio/index.mjs +1 -0
- package/Forms/Radio/package.json +2 -2
- package/Forms/Switch/Switch.d.ts +1 -1
- package/Forms/Switch/Switch.js +16 -13
- package/Forms/Switch/Switch.mjs +20 -0
- package/Forms/Switch/index.js +4 -1
- package/Forms/Switch/index.mjs +1 -0
- package/Forms/Switch/package.json +2 -2
- package/Forms/Textarea/Textarea.js +13 -10
- package/Forms/Textarea/Textarea.mjs +12 -0
- package/Forms/Textarea/TextareaRich.js +15 -12
- package/Forms/Textarea/TextareaRich.mjs +28 -0
- package/Forms/Textarea/index.js +5 -2
- package/Forms/Textarea/index.mjs +2 -0
- package/Forms/Textarea/package.json +2 -2
- package/{node/Forms/Toggle/Toggle-tailwind.js → Forms/Toggle/Toggle-tailwind.mjs} +0 -0
- package/Forms/Toggle/Toggle.js +26 -21
- package/Forms/Toggle/Toggle.mjs +31 -0
- package/Forms/Toggle/index.js +4 -1
- package/Forms/Toggle/index.mjs +1 -0
- package/Forms/Toggle/package.json +2 -2
- package/{node/Forms/Toggle/useToggle-tailwind.js → Forms/Toggle/useToggle-tailwind.mjs} +0 -0
- package/Forms/Toggle/useToggle.js +19 -15
- package/{node/Forms/Toggle/useToggle.js → Forms/Toggle/useToggle.mjs} +15 -19
- package/Forms/antispam.d.ts +1 -1
- package/Forms/antispam.js +16 -8
- package/{node/Forms/antispam.js → Forms/antispam.mjs} +10 -13
- package/Forms/helpers.js +16 -7
- package/{node/Forms/helpers.js → Forms/helpers.mjs} +8 -14
- package/Forms/index.js +18 -15
- package/Forms/index.mjs +16 -0
- package/Forms/package.json +2 -2
- package/Forms/styles.js +19 -16
- package/Forms/styles.mjs +29 -0
- package/Gauge/Gauge.js +5 -1
- package/{node/Gauge/Gauge.js → Gauge/Gauge.mjs} +1 -5
- package/Grid/Grid.js +13 -10
- package/Grid/Grid.mjs +53 -0
- package/Grid/index.js +4 -1
- package/Grid/index.mjs +1 -0
- package/Grid/package.json +2 -2
- package/Hamburger/Hamburger.js +11 -7
- package/Hamburger/Hamburger.mjs +52 -0
- package/Hamburger/index.js +4 -1
- package/Hamburger/index.mjs +1 -0
- package/Hamburger/package.json +2 -2
- package/Header/index.js +4 -1
- package/Header/index.mjs +1 -0
- package/Header/package.json +2 -2
- package/Header/useHeader.d.ts +1 -1
- package/Header/useHeader.js +18 -13
- package/Header/useHeader.mjs +31 -0
- package/Hidden/Hidden.js +6 -3
- package/Hidden/Hidden.mjs +10 -0
- package/Hidden/index.js +4 -1
- package/Hidden/index.mjs +1 -0
- package/Hidden/package.json +2 -2
- package/Img/index.js +4 -1
- package/Img/index.mjs +1 -0
- package/Img/package.json +2 -2
- package/Img/sc/bare.js +6 -3
- package/{node/Img/sc/bare.js → Img/sc/bare.mjs} +3 -6
- package/Img/types.js +2 -1
- package/Img/types.mjs +1 -0
- package/Link/Link.js +6 -3
- package/Link/Link.mjs +4 -0
- package/Link/LinkBlank.js +15 -11
- package/Link/LinkBlank.mjs +17 -0
- package/Link/index.js +5 -2
- package/Link/index.mjs +2 -0
- package/Link/package.json +2 -2
- package/Menu/Menu.js +6 -3
- package/Menu/Menu.mjs +4 -0
- package/Menu/MenuMui.js +29 -26
- package/Menu/MenuMui.mjs +75 -0
- package/Menu/index.js +4 -1
- package/Menu/index.mjs +1 -0
- package/Menu/package.json +2 -2
- package/MenuItem/MenuItem.js +6 -3
- package/MenuItem/MenuItem.mjs +4 -0
- package/MenuItem/MenuItemMui.js +13 -10
- package/MenuItem/MenuItemMui.mjs +15 -0
- package/MenuItem/index.js +4 -1
- package/MenuItem/index.mjs +1 -0
- package/MenuItem/package.json +2 -2
- package/MenuItem/useMenuItem.js +20 -16
- package/{node/MenuItem/useMenuItem.js → MenuItem/useMenuItem.mjs} +16 -20
- package/Meta/Meta.js +8 -4
- package/Meta/Meta.mjs +6 -0
- package/Meta/index.js +7 -2
- package/Meta/index.mjs +2 -0
- package/Meta/package.json +2 -2
- package/NoJs/NoJs.js +8 -4
- package/NoJs/NoJs.mjs +7 -0
- package/NoJs/index.js +7 -2
- package/NoJs/index.mjs +2 -0
- package/NoJs/package.json +2 -2
- package/Pagination/PaginationNav.js +22 -18
- package/Pagination/PaginationNav.mjs +61 -0
- package/Pagination/PaginationResults.js +12 -8
- package/Pagination/PaginationResults.mjs +11 -0
- package/Pagination/index.js +5 -2
- package/Pagination/index.mjs +2 -0
- package/Pagination/package.json +2 -2
- package/Pill/Pill.js +9 -6
- package/Pill/Pill.mjs +7 -0
- package/Pill/index.js +4 -1
- package/Pill/index.mjs +1 -0
- package/Pill/package.json +2 -2
- package/Progress/ProgressCircular.js +14 -10
- package/Progress/ProgressCircular.mjs +15 -0
- package/Progress/ProgressLinear.js +13 -9
- package/Progress/ProgressLinear.mjs +24 -0
- package/Progress/ProgressOverlay.js +20 -16
- package/Progress/ProgressOverlay.mjs +24 -0
- package/Progress/index.js +6 -3
- package/Progress/index.mjs +3 -0
- package/Progress/package.json +2 -2
- package/Rating/Rating.js +26 -21
- package/Rating/Rating.mjs +70 -0
- package/Rating/index.js +13 -5
- package/{node/Rating/index.js → Rating/index.mjs} +5 -13
- package/Rating/package.json +2 -2
- package/Select/SelectDownshift.js +4 -1
- package/{node/Select/SelectDownshift.js → Select/SelectDownshift.mjs} +1 -4
- package/Select/components.js +13 -10
- package/Select/components.mjs +12 -0
- package/Select/index.js +5 -1
- package/Select/index.mjs +3 -0
- package/Select/package.json +2 -2
- package/Sidebar/Sidebar.js +21 -17
- package/Sidebar/Sidebar.mjs +23 -0
- package/Sidebar/index.js +4 -1
- package/Sidebar/index.mjs +1 -0
- package/Sidebar/package.json +2 -2
- package/Spacing/Spacing.js +15 -11
- package/Spacing/Spacing.mjs +45 -0
- package/Spacing/index.js +4 -1
- package/Spacing/index.mjs +1 -0
- package/Spacing/package.json +2 -2
- package/Sticky/Sticky.js +4 -1
- package/{node/Sticky/Sticky.js → Sticky/Sticky.mjs} +1 -4
- package/Sticky/StickyCss.js +9 -5
- package/Sticky/StickyCss.mjs +6 -0
- package/Sticky/index.js +4 -1
- package/Sticky/index.mjs +1 -0
- package/Sticky/package.json +2 -2
- package/Tabs/TabsMui.d.ts +2 -2
- package/Tabs/TabsMui.js +28 -25
- package/Tabs/TabsMui.mjs +46 -0
- package/Tabs/index.js +4 -1
- package/Tabs/index.mjs +1 -0
- package/Tabs/package.json +2 -2
- package/{node/Tabs/sc/bare.js → Tabs/sc/bare.mjs} +0 -0
- package/Tabs/tw/bare.js +17 -14
- package/Tabs/tw/bare.mjs +17 -0
- package/Tabs/tw/material.d.ts +6 -6
- package/Tabs/tw/material.js +17 -14
- package/Tabs/tw/material.mjs +18 -0
- package/Tabs/useTabs.js +12 -8
- package/{node/Tabs/useTabs.js → Tabs/useTabs.mjs} +8 -12
- package/Typography/CopyPasteVisible.js +6 -3
- package/Typography/CopyPasteVisible.mjs +4 -0
- package/Typography/Native.js +16 -13
- package/Typography/Native.mjs +14 -0
- package/Typography/ReadMore.js +28 -24
- package/Typography/ReadMore.mjs +43 -0
- package/Typography/TextLoop.js +21 -16
- package/{node/Typography/TextLoop.js → Typography/TextLoop.mjs} +16 -21
- package/Typography/TypeStairs.js +11 -8
- package/{node/Typography/TypeStairs.js → Typography/TypeStairs.mjs} +8 -11
- package/Typography/index.js +8 -5
- package/Typography/index.mjs +5 -0
- package/Typography/package.json +2 -2
- package/css/index.js +7 -2
- package/{node/tw/index.js → css/index.mjs} +2 -7
- package/css/package.json +2 -2
- package/helpers/classed.js +10 -6
- package/{node/helpers/classed.js → helpers/classed.mjs} +6 -10
- package/helpers/createUseMediaQueryWidth.d.ts +1 -1
- package/helpers/createUseMediaQueryWidth.js +18 -11
- package/{node/helpers/createUseMediaQueryWidth.js → helpers/createUseMediaQueryWidth.mjs} +13 -15
- package/helpers/extend-component.js +10 -6
- package/helpers/extend-component.mjs +13 -0
- package/helpers/index.js +7 -4
- package/helpers/index.mjs +4 -0
- package/helpers/mergeRefs.js +6 -2
- package/{node/helpers/mergeRefs.js → helpers/mergeRefs.mjs} +2 -6
- package/helpers/package.json +2 -2
- package/hooks/index.js +24 -21
- package/hooks/index.mjs +22 -0
- package/hooks/package.json +2 -2
- package/hooks/types.js +2 -1
- package/hooks/types.mjs +1 -0
- package/hooks/useAsyncFn.js +14 -10
- package/{node/hooks/useAsyncFn.js → hooks/useAsyncFn.mjs} +10 -14
- package/hooks/useDateLocale.js +14 -12
- package/{node/hooks/useDateLocale.js → hooks/useDateLocale.mjs} +10 -17
- package/hooks/useEffectOnce.js +8 -4
- package/hooks/useEffectOnce.mjs +9 -0
- package/hooks/useFirstMountState.js +8 -4
- package/hooks/useFirstMountState.mjs +13 -0
- package/hooks/useFixedOffset.js +21 -13
- package/{node/hooks/useFixedOffset.js → hooks/useFixedOffset.mjs} +16 -17
- package/hooks/useFocus.js +8 -4
- package/hooks/useFocus.mjs +12 -0
- package/hooks/useInterval.js +14 -10
- package/{node/hooks/useInterval.js → hooks/useInterval.mjs} +10 -14
- package/hooks/useIsomorphicLayoutEffect.js +10 -6
- package/hooks/useIsomorphicLayoutEffect.mjs +9 -0
- package/hooks/useKeyUp.js +12 -8
- package/{node/hooks/useKeyUp.js → hooks/useKeyUp.mjs} +8 -12
- package/hooks/useMeasure.js +30 -22
- package/{node/hooks/useMeasure.js → hooks/useMeasure.mjs} +26 -26
- package/hooks/useMount.js +8 -4
- package/hooks/useMount.mjs +10 -0
- package/hooks/useMountedState.js +10 -6
- package/hooks/useMountedState.mjs +16 -0
- package/hooks/useNavigateAway.js +13 -8
- package/{node/hooks/useNavigateAway.js → hooks/useNavigateAway.mjs} +8 -12
- package/hooks/usePrevious.js +8 -4
- package/hooks/usePrevious.mjs +12 -0
- package/hooks/usePreviousRef.js +9 -5
- package/hooks/usePreviousRef.mjs +9 -0
- package/hooks/useScrollPosition.js +16 -11
- package/{node/hooks/useScrollPosition.js → hooks/useScrollPosition.mjs} +11 -15
- package/hooks/useScrollThreshold.js +15 -10
- package/hooks/useScrollThreshold.mjs +28 -0
- package/hooks/useScrollTo.js +11 -6
- package/{node/hooks/useScrollTo.js → hooks/useScrollTo.mjs} +6 -10
- package/hooks/useSmoothScroll.js +18 -12
- package/hooks/useSmoothScroll.mjs +39 -0
- package/hooks/useTraceUpdate.js +9 -5
- package/{node/hooks/useTraceUpdate.js → hooks/useTraceUpdate.mjs} +5 -9
- package/hooks/useUpdateEffect.js +10 -6
- package/hooks/useUpdateEffect.mjs +15 -0
- package/hooks/useWindowSize.d.ts +1 -1
- package/hooks/useWindowSize.js +15 -9
- package/hooks/useWindowSize.mjs +29 -0
- package/index.js +4 -1
- package/{node/index.js → index.mjs} +1 -4
- package/m/MotionProvider.d.ts +1 -1
- package/m/MotionProvider.js +10 -6
- package/{node/m/MotionProvider.js → m/MotionProvider.mjs} +6 -10
- package/m/index.js +4 -1
- package/m/index.mjs +6 -0
- package/m/lite.js +4 -2
- package/m/lite.mjs +2 -0
- package/m/max.js +4 -2
- package/m/max.mjs +2 -0
- package/m/package.json +2 -2
- package/package.json +8 -7
- package/sc/index.js +36 -30
- package/sc/index.mjs +31 -0
- package/sc/package.json +2 -2
- package/scm/index.js +34 -29
- package/scm/index.mjs +31 -0
- package/scm/package.json +2 -2
- package/shared/index.js +11 -8
- package/shared/index.mjs +8 -0
- package/shared/package.json +2 -2
- package/styles/Body.js +7 -4
- package/styles/Body.mjs +13 -0
- package/styles/Global.js +7 -4
- package/styles/Global.mjs +18 -0
- package/styles/index.js +10 -7
- package/styles/index.mjs +7 -0
- package/styles/media.js +13 -8
- package/{node/styles/media.js → styles/media.mjs} +8 -13
- package/styles/package.json +2 -2
- package/styles/spacing.js +11 -4
- package/{node/styles/spacing.js → styles/spacing.mjs} +4 -11
- package/styles/styled.js +11 -7
- package/styles/styled.mjs +13 -0
- package/styles/theme--vanilla.js +32 -23
- package/styles/theme--vanilla.mjs +58 -0
- package/styles/theme.js +12 -8
- package/{node/styles/theme.js → styles/theme.mjs} +8 -12
- package/tw/index.js +7 -2
- package/{node/css/index.js → tw/index.mjs} +2 -7
- package/tw/package.json +2 -2
- package/twm/index.js +7 -2
- package/{node/twm/index.js → twm/index.mjs} +2 -7
- package/twm/package.json +2 -2
- package/types.js +2 -1
- package/types.mjs +1 -0
- package/node/Alert/Alert.js +0 -14
- package/node/Alert/index.js +0 -4
- package/node/Animations/Reveal.js +0 -21
- package/node/Animations/Underline.js +0 -8
- package/node/Animations/index.js +0 -6
- package/node/Autocomplete/components.js +0 -37
- package/node/Autocomplete/index.js +0 -7
- package/node/Bg/BgColor.js +0 -25
- package/node/Bg/BgPhoto.js +0 -20
- package/node/Bg/BgSvg.js +0 -16
- package/node/Bg/index.js +0 -6
- package/node/Breadcrumbs/Breadcrumbs.js +0 -31
- package/node/Breadcrumbs/index.js +0 -4
- package/node/Buttons/Button.js +0 -17
- package/node/Buttons/ButtonComposite.js +0 -32
- package/node/Buttons/ButtonFab.js +0 -9
- package/node/Buttons/ButtonLink.js +0 -15
- package/node/Buttons/IconButton.js +0 -10
- package/node/Buttons/index.js +0 -8
- package/node/Calendar/CalendarDaygridNav.js +0 -28
- package/node/Calendar/CalendarLegend.js +0 -20
- package/node/Calendar/index.js +0 -9
- package/node/Calendar/types.js +0 -2
- package/node/Carousel/CarouselCss.js +0 -26
- package/node/Carousel/index.js +0 -4
- package/node/Collapsable/Collapsable.js +0 -4
- package/node/Collapsable/index.js +0 -5
- package/node/Debug/Debug.js +0 -13
- package/node/Debug/index.js +0 -4
- package/node/Details/Details.js +0 -66
- package/node/Details/index.js +0 -4
- package/node/Dialog/css/bare.js +0 -24
- package/node/Dialog/index.js +0 -5
- package/node/Dialog/m/bare.js +0 -55
- package/node/Dialog/m/index.js +0 -8
- package/node/Dialog/sc/bare.js +0 -46
- package/node/Dialog/sc/framer.js +0 -19
- package/node/Dialog/sc/framerMaterial.js +0 -19
- package/node/Dialog/sc/material.js +0 -24
- package/node/Dialog/tw/bare.js +0 -45
- package/node/Dialog/tw/elegant.js +0 -23
- package/node/Dialog/tw/framer.js +0 -19
- package/node/Dialog/tw/framerMaterial.js +0 -19
- package/node/Dialog/tw/material.js +0 -23
- package/node/Editor/Editor--tiptap.js +0 -31
- package/node/Editor/components.js +0 -15
- package/node/Editor/index.js +0 -4
- package/node/FaviconTags/FaviconTags.js +0 -20
- package/node/FaviconTags/index.js +0 -7
- package/node/Form/Form.js +0 -65
- package/node/Form/index.js +0 -4
- package/node/Form/sc/bare.js +0 -23
- package/node/Forms/Checkbox/Checkbox.js +0 -21
- package/node/Forms/Checkbox/index.js +0 -4
- package/node/Forms/Feedback/Feedback.js +0 -13
- package/node/Forms/Feedback/index.js +0 -4
- package/node/Forms/Field/Field.js +0 -35
- package/node/Forms/Field/FieldControl.js +0 -51
- package/node/Forms/Field/FieldHint.js +0 -7
- package/node/Forms/Field/index.js +0 -5
- package/node/Forms/Input/Input.js +0 -20
- package/node/Forms/Input/index.js +0 -4
- package/node/Forms/InputGroup/InputGroup.js +0 -19
- package/node/Forms/InputGroup/index.js +0 -4
- package/node/Forms/Label/Label.js +0 -9
- package/node/Forms/Label/index.js +0 -4
- package/node/Forms/Password/Password.js +0 -20
- package/node/Forms/Password/index.js +0 -4
- package/node/Forms/Radio/Radio.js +0 -28
- package/node/Forms/Radio/index.js +0 -4
- package/node/Forms/Switch/Switch.js +0 -23
- package/node/Forms/Switch/index.js +0 -4
- package/node/Forms/Textarea/Textarea.js +0 -15
- package/node/Forms/Textarea/TextareaRich.js +0 -31
- package/node/Forms/Textarea/index.js +0 -5
- package/node/Forms/Toggle/Toggle.js +0 -36
- package/node/Forms/Toggle/index.js +0 -4
- package/node/Forms/index.js +0 -19
- package/node/Forms/styles.js +0 -32
- package/node/Grid/Grid.js +0 -56
- package/node/Grid/index.js +0 -4
- package/node/Hamburger/Hamburger.js +0 -56
- package/node/Hamburger/index.js +0 -4
- package/node/Header/index.js +0 -4
- package/node/Header/useHeader.js +0 -34
- package/node/Hidden/Hidden.js +0 -13
- package/node/Hidden/index.js +0 -4
- package/node/Img/index.js +0 -4
- package/node/Img/types.js +0 -2
- package/node/Link/Link.js +0 -7
- package/node/Link/LinkBlank.js +0 -21
- package/node/Link/index.js +0 -5
- package/node/Menu/Menu.js +0 -7
- package/node/Menu/MenuMui.js +0 -78
- package/node/Menu/index.js +0 -4
- package/node/MenuItem/MenuItem.js +0 -7
- package/node/MenuItem/MenuItemMui.js +0 -18
- package/node/MenuItem/index.js +0 -4
- package/node/Meta/Meta.js +0 -10
- package/node/Meta/index.js +0 -7
- package/node/NoJs/NoJs.js +0 -11
- package/node/NoJs/index.js +0 -7
- package/node/Pagination/PaginationNav.js +0 -65
- package/node/Pagination/PaginationResults.js +0 -15
- package/node/Pagination/index.js +0 -5
- package/node/Pill/Pill.js +0 -10
- package/node/Pill/index.js +0 -4
- package/node/Progress/ProgressCircular.js +0 -19
- package/node/Progress/ProgressLinear.js +0 -28
- package/node/Progress/ProgressOverlay.js +0 -28
- package/node/Progress/index.js +0 -6
- package/node/Rating/Rating.js +0 -75
- package/node/Select/components.js +0 -15
- package/node/Select/index.js +0 -7
- package/node/Sidebar/Sidebar.js +0 -27
- package/node/Sidebar/index.js +0 -4
- package/node/Spacing/Spacing.js +0 -49
- package/node/Spacing/index.js +0 -4
- package/node/Sticky/StickyCss.js +0 -10
- package/node/Sticky/index.js +0 -4
- package/node/Tabs/TabsMui.js +0 -49
- package/node/Tabs/index.js +0 -4
- package/node/Tabs/tw/bare.js +0 -20
- package/node/Tabs/tw/material.js +0 -21
- package/node/Typography/CopyPasteVisible.js +0 -7
- package/node/Typography/Native.js +0 -17
- package/node/Typography/ReadMore.js +0 -47
- package/node/Typography/index.js +0 -8
- package/node/helpers/extend-component.js +0 -17
- package/node/helpers/index.js +0 -7
- package/node/hooks/index.js +0 -25
- package/node/hooks/types.js +0 -2
- package/node/hooks/useEffectOnce.js +0 -13
- package/node/hooks/useFirstMountState.js +0 -17
- package/node/hooks/useFocus.js +0 -16
- package/node/hooks/useIsomorphicLayoutEffect.js +0 -12
- package/node/hooks/useMount.js +0 -14
- package/node/hooks/useMountedState.js +0 -20
- package/node/hooks/usePrevious.js +0 -16
- package/node/hooks/usePreviousRef.js +0 -13
- package/node/hooks/useScrollThreshold.js +0 -32
- package/node/hooks/useSmoothScroll.js +0 -42
- package/node/hooks/useUpdateEffect.js +0 -19
- package/node/hooks/useWindowSize.js +0 -32
- package/node/m/index.js +0 -9
- package/node/m/lite.js +0 -4
- package/node/m/max.js +0 -4
- package/node/sc/index.js +0 -37
- package/node/scm/index.js +0 -36
- package/node/shared/index.js +0 -11
- package/node/styles/Body.js +0 -16
- package/node/styles/Global.js +0 -21
- package/node/styles/index.js +0 -10
- package/node/styles/styled.js +0 -17
- package/node/styles/theme--vanilla.js +0 -61
- package/node/types.js +0 -2
package/Form/Form.d.ts
CHANGED
package/Form/Form.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KoineForm = exports.Form = exports.Fail = exports.Ok = exports.Collapsable = exports.Progress = exports.Overlay = exports.Root = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
// import type { MotionProps } from "framer-motion";
|
|
8
|
+
var helpers_1 = require("../helpers");
|
|
9
|
+
exports.Root = "form";
|
|
10
|
+
exports.Overlay = "div";
|
|
11
|
+
exports.Progress = "div";
|
|
12
|
+
exports.Collapsable = "div";
|
|
13
|
+
exports.Ok = null;
|
|
14
|
+
exports.Fail = null;
|
|
15
|
+
var Form = function (_a) {
|
|
13
16
|
var _Root = _a.Root, _Overlay = _a.Overlay, _Progress = _a.Progress, _Collapsable = _a.Collapsable, ok = _a.ok, fail = _a.fail, loading = _a.loading, _Ok = _a.Ok, _b = _a.okProps, okProps = _b === void 0 ? {
|
|
14
17
|
children: "Sent!",
|
|
15
18
|
} : _b, _Fail = _a.Fail, _c = _a.failProps, failProps = _c === void 0 ? {
|
|
16
19
|
children: "Failed.",
|
|
17
|
-
} : _c, collapseOnOk = _a.collapseOnOk, collapseOnFail = _a.collapseOnFail, _d = _a.okTimeout, okTimeout = _d === void 0 ? 3000 : _d, _e = _a.failTimeout, failTimeout = _e === void 0 ? 3000 : _e, children = _a.children, props = __rest(_a, ["Root", "Overlay", "Progress", "Collapsable", "ok", "fail", "loading", "Ok", "okProps", "Fail", "failProps", "collapseOnOk", "collapseOnFail", "okTimeout", "failTimeout", "children"]);
|
|
18
|
-
var _f = useState(""), open = _f[0], setOpen = _f[1];
|
|
20
|
+
} : _c, collapseOnOk = _a.collapseOnOk, collapseOnFail = _a.collapseOnFail, _d = _a.okTimeout, okTimeout = _d === void 0 ? 3000 : _d, _e = _a.failTimeout, failTimeout = _e === void 0 ? 3000 : _e, children = _a.children, props = tslib_1.__rest(_a, ["Root", "Overlay", "Progress", "Collapsable", "ok", "fail", "loading", "Ok", "okProps", "Fail", "failProps", "collapseOnOk", "collapseOnFail", "okTimeout", "failTimeout", "children"]);
|
|
21
|
+
var _f = (0, react_1.useState)(""), open = _f[0], setOpen = _f[1];
|
|
19
22
|
var commonProps = {
|
|
20
23
|
head: null,
|
|
21
24
|
components: {
|
|
22
25
|
HeadIcon: null,
|
|
23
26
|
},
|
|
24
27
|
};
|
|
25
|
-
useEffect(function () {
|
|
28
|
+
(0, react_1.useEffect)(function () {
|
|
26
29
|
if (!loading) {
|
|
27
30
|
if (ok)
|
|
28
31
|
setOpen("ok");
|
|
@@ -30,7 +33,7 @@ export var Form = function (_a) {
|
|
|
30
33
|
setOpen("fail");
|
|
31
34
|
}
|
|
32
35
|
}, [ok, fail, loading]);
|
|
33
|
-
useEffect(function () {
|
|
36
|
+
(0, react_1.useEffect)(function () {
|
|
34
37
|
var timeout;
|
|
35
38
|
if (open === "fail" && failTimeout) {
|
|
36
39
|
timeout = setTimeout(function () { return setOpen(""); }, failTimeout);
|
|
@@ -49,13 +52,14 @@ export var Form = function (_a) {
|
|
|
49
52
|
formExpanded = false;
|
|
50
53
|
if (collapseOnOk && ok)
|
|
51
54
|
formExpanded = false;
|
|
52
|
-
return (
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)(exports.Root, tslib_1.__assign({ method: "post", noValidate: true }, props, { children: [(0, jsx_runtime_1.jsx)(exports.Collapsable, tslib_1.__assign({}, commonProps, { "$open": formExpanded, recalc: loading, body: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [children, loading && ((0, jsx_runtime_1.jsx)(exports.Overlay, { children: (0, jsx_runtime_1.jsx)(exports.Progress, {}) }))] }) })), (0, jsx_runtime_1.jsx)(exports.Collapsable, tslib_1.__assign({}, commonProps, { "$open": open === "ok" && !loading, body: (0, jsx_runtime_1.jsx)(exports.Ok, tslib_1.__assign({}, okProps)) })), (0, jsx_runtime_1.jsx)(exports.Collapsable, tslib_1.__assign({}, commonProps, { "$open": open === "fail" && !loading, body: (0, jsx_runtime_1.jsx)(exports.Fail, tslib_1.__assign({}, failProps)) }))] })));
|
|
53
56
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
exports.Form = Form;
|
|
58
|
+
exports.KoineForm = (0, helpers_1.extendComponent)(exports.Form, {
|
|
59
|
+
Root: exports.Root,
|
|
60
|
+
Overlay: exports.Overlay,
|
|
61
|
+
Progress: exports.Progress,
|
|
62
|
+
Collapsable: exports.Collapsable,
|
|
63
|
+
Ok: exports.Ok,
|
|
64
|
+
Fail: exports.Fail,
|
|
61
65
|
});
|
package/Form/Form.mjs
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
// import type { MotionProps } from "framer-motion";
|
|
5
|
+
import { extendComponent, } from "../helpers";
|
|
6
|
+
export var Root = "form";
|
|
7
|
+
export var Overlay = "div";
|
|
8
|
+
export var Progress = "div";
|
|
9
|
+
export var Collapsable = "div";
|
|
10
|
+
export var Ok = null;
|
|
11
|
+
export var Fail = null;
|
|
12
|
+
export var Form = function (_a) {
|
|
13
|
+
var _Root = _a.Root, _Overlay = _a.Overlay, _Progress = _a.Progress, _Collapsable = _a.Collapsable, ok = _a.ok, fail = _a.fail, loading = _a.loading, _Ok = _a.Ok, _b = _a.okProps, okProps = _b === void 0 ? {
|
|
14
|
+
children: "Sent!",
|
|
15
|
+
} : _b, _Fail = _a.Fail, _c = _a.failProps, failProps = _c === void 0 ? {
|
|
16
|
+
children: "Failed.",
|
|
17
|
+
} : _c, collapseOnOk = _a.collapseOnOk, collapseOnFail = _a.collapseOnFail, _d = _a.okTimeout, okTimeout = _d === void 0 ? 3000 : _d, _e = _a.failTimeout, failTimeout = _e === void 0 ? 3000 : _e, children = _a.children, props = __rest(_a, ["Root", "Overlay", "Progress", "Collapsable", "ok", "fail", "loading", "Ok", "okProps", "Fail", "failProps", "collapseOnOk", "collapseOnFail", "okTimeout", "failTimeout", "children"]);
|
|
18
|
+
var _f = useState(""), open = _f[0], setOpen = _f[1];
|
|
19
|
+
var commonProps = {
|
|
20
|
+
head: null,
|
|
21
|
+
components: {
|
|
22
|
+
HeadIcon: null,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
if (!loading) {
|
|
27
|
+
if (ok)
|
|
28
|
+
setOpen("ok");
|
|
29
|
+
else if (fail)
|
|
30
|
+
setOpen("fail");
|
|
31
|
+
}
|
|
32
|
+
}, [ok, fail, loading]);
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
var timeout;
|
|
35
|
+
if (open === "fail" && failTimeout) {
|
|
36
|
+
timeout = setTimeout(function () { return setOpen(""); }, failTimeout);
|
|
37
|
+
}
|
|
38
|
+
else if (open === "ok" && okTimeout) {
|
|
39
|
+
timeout = setTimeout(function () { return setOpen(""); }, okTimeout);
|
|
40
|
+
}
|
|
41
|
+
return function () {
|
|
42
|
+
if (timeout) {
|
|
43
|
+
clearTimeout(timeout);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}, [open, failTimeout, okTimeout]);
|
|
47
|
+
var formExpanded = true;
|
|
48
|
+
if (collapseOnFail && fail)
|
|
49
|
+
formExpanded = false;
|
|
50
|
+
if (collapseOnOk && ok)
|
|
51
|
+
formExpanded = false;
|
|
52
|
+
return (_jsxs(Root, __assign({ method: "post", noValidate: true }, props, { children: [_jsx(Collapsable, __assign({}, commonProps, { "$open": formExpanded, recalc: loading, body: _jsxs(_Fragment, { children: [children, loading && (_jsx(Overlay, { children: _jsx(Progress, {}) }))] }) })), _jsx(Collapsable, __assign({}, commonProps, { "$open": open === "ok" && !loading, body: _jsx(Ok, __assign({}, okProps)) })), _jsx(Collapsable, __assign({}, commonProps, { "$open": open === "fail" && !loading, body: _jsx(Fail, __assign({}, failProps)) }))] })));
|
|
53
|
+
};
|
|
54
|
+
export var KoineForm = extendComponent(Form, {
|
|
55
|
+
Root: Root,
|
|
56
|
+
Overlay: Overlay,
|
|
57
|
+
Progress: Progress,
|
|
58
|
+
Collapsable: Collapsable,
|
|
59
|
+
Ok: Ok,
|
|
60
|
+
Fail: Fail,
|
|
61
|
+
});
|
package/Form/index.js
CHANGED
package/Form/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Form";
|
package/Form/package.json
CHANGED
package/Form/sc/bare.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KoineForm = exports.Feedback = exports.Overlay = exports.Root = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
+
var styled_1 = require("../../styles/styled");
|
|
7
|
+
var Collapsable_1 = require("../../Collapsable");
|
|
8
|
+
var Progress_1 = require("../../Progress");
|
|
9
|
+
var Alert_1 = require("../../Alert");
|
|
10
|
+
var helpers_1 = require("../../helpers");
|
|
11
|
+
var _ = tslib_1.__importStar(require("../Form"));
|
|
12
|
+
exports.Root = (0, styled_components_1.default)(_.Root)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
13
|
+
exports.Overlay = (0, styled_components_1.default)(_.Overlay)(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n z-index: 4;\n ", "\n ", "\n background: rgba(var(--bodyBg--rgb),.8);\n pointer-events: none;\n backdrop-filter: blur(2px);\n"], ["\n z-index: 4;\n ", "\n ", "\n background: rgba(var(--bodyBg--rgb),.8);\n pointer-events: none;\n backdrop-filter: blur(2px);\n"])), styled_1.overlay, styled_1.centered);
|
|
14
|
+
exports.Feedback = (0, styled_components_1.default)(Alert_1.Alert)(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n padding: 2em 0;\n"], ["\n padding: 2em 0;\n"])));
|
|
15
|
+
exports.KoineForm = (0, helpers_1.extendComponent)(_.KoineForm, {
|
|
16
|
+
Root: exports.Root,
|
|
17
|
+
Overlay: exports.Overlay,
|
|
18
|
+
Progress: Progress_1.ProgressCircular,
|
|
19
|
+
Collapsable: Collapsable_1.Collapsable,
|
|
20
|
+
Ok: exports.Feedback,
|
|
21
|
+
Fail: exports.Feedback,
|
|
19
22
|
});
|
|
20
23
|
var templateObject_1, templateObject_2, templateObject_3;
|
package/Form/sc/bare.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { overlay, centered } from "../../styles/styled";
|
|
4
|
+
import { Collapsable } from "../../Collapsable";
|
|
5
|
+
import { ProgressCircular } from "../../Progress";
|
|
6
|
+
import { Alert } from "../../Alert";
|
|
7
|
+
import { extendComponent } from "../../helpers";
|
|
8
|
+
import * as _ from "../Form";
|
|
9
|
+
export var Root = styled(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
10
|
+
export var Overlay = styled(_.Overlay)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: 4;\n ", "\n ", "\n background: rgba(var(--bodyBg--rgb),.8);\n pointer-events: none;\n backdrop-filter: blur(2px);\n"], ["\n z-index: 4;\n ", "\n ", "\n background: rgba(var(--bodyBg--rgb),.8);\n pointer-events: none;\n backdrop-filter: blur(2px);\n"])), overlay, centered);
|
|
11
|
+
export var Feedback = styled(Alert)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 2em 0;\n"], ["\n padding: 2em 0;\n"])));
|
|
12
|
+
export var KoineForm = extendComponent(_.KoineForm, {
|
|
13
|
+
Root: Root,
|
|
14
|
+
Overlay: Overlay,
|
|
15
|
+
Progress: ProgressCircular,
|
|
16
|
+
Collapsable: Collapsable,
|
|
17
|
+
Ok: Feedback,
|
|
18
|
+
Fail: Feedback,
|
|
19
|
+
});
|
|
20
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -8,4 +8,4 @@ export type CheckboxProps = UseToggleProps;
|
|
|
8
8
|
/**
|
|
9
9
|
* All logic and invisible Inputs come from the `useToggle` hook
|
|
10
10
|
*/
|
|
11
|
-
export declare const Checkbox: import("react").ForwardRefExoticComponent<Pick<UseToggleProps, "key" | "value" | "id" | "width" | "title" | "color" | "form" | "slot" | "style" | "pattern" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "step" | "disabled" | "type" | "
|
|
11
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Pick<UseToggleProps, "key" | "value" | "id" | "width" | "title" | "color" | "form" | "slot" | "style" | "pattern" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "step" | "disabled" | "type" | "capture" | "height" | "options" | "min" | "max" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "crossOrigin" | "alt" | "src" | "autoComplete" | "accept" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "size" | keyof import("..").FormControlProps<any> | "valueTrue" | "valueFalse"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Checkbox = exports.CheckboxLabel = exports.CheckboxIndicator = exports.CheckboxToggle = exports.CheckboxRoot = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
8
|
+
var Toggle_1 = require("../Toggle");
|
|
9
|
+
var useToggle_1 = require("../Toggle/useToggle");
|
|
10
|
+
exports.CheckboxRoot = styled_components_1.default.label(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n display: flex;\n align-items: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n cursor: pointer;\n"])));
|
|
11
|
+
exports.CheckboxToggle = (0, styled_components_1.default)(Toggle_1.Toggle)(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
|
|
12
|
+
exports.CheckboxIndicator = (0, styled_components_1.default)(Toggle_1.ToggleIndicatorSquared)(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject([""], [""])));
|
|
13
|
+
exports.CheckboxLabel = (0, styled_components_1.default)(Toggle_1.ToggleLabel)(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n font-size: 0.8em;\n"], ["\n font-size: 0.8em;\n"])));
|
|
11
14
|
/**
|
|
12
15
|
* All logic and invisible Inputs come from the `useToggle` hook
|
|
13
16
|
*/
|
|
14
|
-
|
|
15
|
-
var _a = useToggle(props, ref), rootProps = _a.rootProps, Inputs = _a.Inputs, label = _a.label;
|
|
16
|
-
return (
|
|
17
|
+
exports.Checkbox = (0, react_1.forwardRef)(function Checkbox(props, ref) {
|
|
18
|
+
var _a = (0, useToggle_1.useToggle)(props, ref), rootProps = _a.rootProps, Inputs = _a.Inputs, label = _a.label;
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(exports.CheckboxRoot, tslib_1.__assign({}, rootProps, { children: [(0, jsx_runtime_1.jsxs)(exports.CheckboxToggle, { children: [Inputs, (0, jsx_runtime_1.jsx)(exports.CheckboxIndicator, {})] }), label && (0, jsx_runtime_1.jsx)(exports.CheckboxLabel, { children: label })] })));
|
|
17
20
|
});
|
|
18
21
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __assign, __makeTemplateObject } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import { Toggle, ToggleLabel, ToggleIndicatorSquared } from "../Toggle";
|
|
6
|
+
import { useToggle } from "../Toggle/useToggle";
|
|
7
|
+
export var CheckboxRoot = styled.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n cursor: pointer;\n"])));
|
|
8
|
+
export var CheckboxToggle = styled(Toggle)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
|
|
9
|
+
export var CheckboxIndicator = styled(ToggleIndicatorSquared)(templateObject_3 || (templateObject_3 = __makeTemplateObject([""], [""])));
|
|
10
|
+
export var CheckboxLabel = styled(ToggleLabel)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 0.8em;\n"], ["\n font-size: 0.8em;\n"])));
|
|
11
|
+
/**
|
|
12
|
+
* All logic and invisible Inputs come from the `useToggle` hook
|
|
13
|
+
*/
|
|
14
|
+
export var Checkbox = forwardRef(function Checkbox(props, ref) {
|
|
15
|
+
var _a = useToggle(props, ref), rootProps = _a.rootProps, Inputs = _a.Inputs, label = _a.label;
|
|
16
|
+
return (_jsxs(CheckboxRoot, __assign({}, rootProps, { children: [_jsxs(CheckboxToggle, { children: [Inputs, _jsx(CheckboxIndicator, {})] }), label && _jsx(CheckboxLabel, { children: label })] })));
|
|
17
|
+
});
|
|
18
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
package/Forms/Checkbox/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Checkbox";
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Feedback = 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 Root = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n margin-top: 0.2em;\n font-size: 12px;\n ", "\n"], ["\n margin-top: 0.2em;\n font-size: 12px;\n ", "\n"])), function (p) { return (p.$danger ? "color: var(--danger);" : ""); });
|
|
8
|
+
var Feedback = function (_a) {
|
|
6
9
|
var $danger = _a.$danger, children = _a.children;
|
|
7
|
-
return (
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(Root, tslib_1.__assign({ role: "alert", "$danger": $danger }, { children: children })));
|
|
8
11
|
};
|
|
12
|
+
exports.Feedback = Feedback;
|
|
9
13
|
var templateObject_1;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __assign, __makeTemplateObject } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
var Root = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-top: 0.2em;\n font-size: 12px;\n ", "\n"], ["\n margin-top: 0.2em;\n font-size: 12px;\n ", "\n"])), function (p) { return (p.$danger ? "color: var(--danger);" : ""); });
|
|
5
|
+
export var Feedback = function (_a) {
|
|
6
|
+
var $danger = _a.$danger, children = _a.children;
|
|
7
|
+
return (_jsx(Root, __assign({ role: "alert", "$danger": $danger }, { children: children })));
|
|
8
|
+
};
|
|
9
|
+
var templateObject_1;
|
package/Forms/Feedback/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Feedback";
|
package/Forms/Field/Field.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Field = exports.FieldRoot = exports.FieldBase = exports.field = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var styled_components_1 = tslib_1.__importStar(require("styled-components"));
|
|
7
|
+
var Feedback_1 = require("../Feedback");
|
|
8
|
+
exports.field = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n padding-bottom: 20px;\n"], ["\n padding-bottom: 20px;\n"])));
|
|
9
|
+
exports.FieldBase = styled_components_1.default.div(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), exports.field);
|
|
10
|
+
exports.FieldRoot = (0, styled_components_1.default)(exports.FieldBase)(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
8
11
|
return (p.$danger &&
|
|
9
12
|
"\n color: var(--danger);\n \n textarea,\n input,\n select {\n color: var(--danger);\n }\n ");
|
|
10
13
|
});
|
|
11
|
-
|
|
12
|
-
var name = _a.name, t = _a.t, error = _a.error, errors = _a.errors, children = _a.children, props = __rest(_a, ["name", "t", "error", "errors", "children"]);
|
|
14
|
+
var Field = function (_a) {
|
|
15
|
+
var name = _a.name, t = _a.t, error = _a.error, errors = _a.errors, children = _a.children, props = tslib_1.__rest(_a, ["name", "t", "error", "errors", "children"]);
|
|
13
16
|
var err = (errors && name ? errors[name] : error);
|
|
14
17
|
var msg = "";
|
|
15
18
|
if (err) {
|
|
@@ -26,6 +29,7 @@ export var Field = function (_a) {
|
|
|
26
29
|
// useEffect(() => {
|
|
27
30
|
// i18n.addResourceBundle(locale, "core.Forms", null);
|
|
28
31
|
// }, []);
|
|
29
|
-
return (
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(exports.FieldRoot, tslib_1.__assign({ "$danger": !!err }, props, { children: [children, msg && (0, jsx_runtime_1.jsx)(Feedback_1.Feedback, tslib_1.__assign({ "$danger": true }, { children: msg }))] })));
|
|
30
33
|
};
|
|
34
|
+
exports.Field = Field;
|
|
31
35
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import styled, { css } from "styled-components";
|
|
4
|
+
import { Feedback } from "../Feedback";
|
|
5
|
+
export var field = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-bottom: 20px;\n"], ["\n padding-bottom: 20px;\n"])));
|
|
6
|
+
export var FieldBase = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), field);
|
|
7
|
+
export var FieldRoot = styled(FieldBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
8
|
+
return (p.$danger &&
|
|
9
|
+
"\n color: var(--danger);\n \n textarea,\n input,\n select {\n color: var(--danger);\n }\n ");
|
|
10
|
+
});
|
|
11
|
+
export var Field = function (_a) {
|
|
12
|
+
var name = _a.name, t = _a.t, error = _a.error, errors = _a.errors, children = _a.children, props = __rest(_a, ["name", "t", "error", "errors", "children"]);
|
|
13
|
+
var err = (errors && name ? errors[name] : error);
|
|
14
|
+
var msg = "";
|
|
15
|
+
if (err) {
|
|
16
|
+
if (name && t && err.type !== "plain") {
|
|
17
|
+
msg = t("errors.".concat(name, ".").concat(err.type || err.message));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
msg = err.message;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// dynamic i18n namespace loading does not seem to work yet
|
|
24
|
+
// const t = useT("core.Forms");
|
|
25
|
+
// const { locale } = useRouter();
|
|
26
|
+
// useEffect(() => {
|
|
27
|
+
// i18n.addResourceBundle(locale, "core.Forms", null);
|
|
28
|
+
// }, []);
|
|
29
|
+
return (_jsxs(FieldRoot, __assign({ "$danger": !!err }, props, { children: [children, msg && _jsx(Feedback, __assign({ "$danger": true }, { children: msg }))] })));
|
|
30
|
+
};
|
|
31
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldControl = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var react_hook_form_1 = require("react-hook-form");
|
|
8
|
+
var decode_1 = tslib_1.__importDefault(require("@koine/utils/decode"));
|
|
9
|
+
var Field_1 = require("./Field");
|
|
10
|
+
var FieldHint_1 = require("./FieldHint");
|
|
11
|
+
var styles_1 = require("../styles");
|
|
9
12
|
/**
|
|
10
13
|
*
|
|
11
14
|
* - it expects the `field` object from our `useForm` wrapper around react-hook-form
|
|
@@ -16,12 +19,12 @@ import { InputHoneypot } from "../styles";
|
|
|
16
19
|
* ```json
|
|
17
20
|
* ```
|
|
18
21
|
*/
|
|
19
|
-
|
|
20
|
-
var control = _a.control, register = _a.register, setValue = _a.setValue, maybeEncodedName = _a.name, label = _a.label, placeholder = _a.placeholder, hint = _a.hint, t = _a.t, _b = _a.showError, showError = _b === void 0 ? true : _b, children = _a.children, encode = _a.encode, props = __rest(_a, ["control", "register", "setValue", "name", "label", "placeholder", "hint", "t", "showError", "children", "encode"]);
|
|
21
|
-
var name = encode ?
|
|
22
|
-
var errors = useFormState({ name: name, control: control }).errors;
|
|
22
|
+
var FieldControl = function (_a) {
|
|
23
|
+
var control = _a.control, register = _a.register, setValue = _a.setValue, maybeEncodedName = _a.name, label = _a.label, placeholder = _a.placeholder, hint = _a.hint, t = _a.t, _b = _a.showError, showError = _b === void 0 ? true : _b, children = _a.children, encode = _a.encode, props = tslib_1.__rest(_a, ["control", "register", "setValue", "name", "label", "placeholder", "hint", "t", "showError", "children", "encode"]);
|
|
24
|
+
var name = encode ? (0, decode_1.default)(maybeEncodedName) : maybeEncodedName;
|
|
25
|
+
var errors = (0, react_hook_form_1.useFormState)({ name: name, control: control }).errors;
|
|
23
26
|
var error = showError && errors[name] ? errors[name] : null;
|
|
24
|
-
var FormFieldContent = useMemo(function () {
|
|
27
|
+
var FormFieldContent = (0, react_1.useMemo)(function () {
|
|
25
28
|
return children({
|
|
26
29
|
control: control,
|
|
27
30
|
register: register,
|
|
@@ -43,5 +46,6 @@ export var FieldControl = function (_a) {
|
|
|
43
46
|
maybeEncodedName,
|
|
44
47
|
placeholder,
|
|
45
48
|
]);
|
|
46
|
-
return (
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Field_1.Field, tslib_1.__assign({ name: maybeEncodedName, t: t, error: error }, props, { children: [FormFieldContent, hint && (0, jsx_runtime_1.jsx)(FieldHint_1.FieldHint, { children: hint })] })), encode && register && (0, jsx_runtime_1.jsx)(styles_1.InputHoneypot, tslib_1.__assign({}, register(name)))] }));
|
|
47
50
|
};
|
|
51
|
+
exports.FieldControl = FieldControl;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useFormState } from "react-hook-form";
|
|
5
|
+
import decode from "@koine/utils/decode";
|
|
6
|
+
import { Field } from "./Field";
|
|
7
|
+
import { FieldHint } from "./FieldHint";
|
|
8
|
+
import { InputHoneypot } from "../styles";
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* - it expects the `field` object from our `useForm` wrapper around react-hook-form
|
|
12
|
+
* - automatically get translated strings from the given `t` function` for the
|
|
13
|
+
* field `label`, `placeholder` and `errors`. The .json expected by the `t` function
|
|
14
|
+
* look like this:
|
|
15
|
+
*
|
|
16
|
+
* ```json
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export var FieldControl = function (_a) {
|
|
20
|
+
var control = _a.control, register = _a.register, setValue = _a.setValue, maybeEncodedName = _a.name, label = _a.label, placeholder = _a.placeholder, hint = _a.hint, t = _a.t, _b = _a.showError, showError = _b === void 0 ? true : _b, children = _a.children, encode = _a.encode, props = __rest(_a, ["control", "register", "setValue", "name", "label", "placeholder", "hint", "t", "showError", "children", "encode"]);
|
|
21
|
+
var name = encode ? decode(maybeEncodedName) : maybeEncodedName;
|
|
22
|
+
var errors = useFormState({ name: name, control: control }).errors;
|
|
23
|
+
var error = showError && errors[name] ? errors[name] : null;
|
|
24
|
+
var FormFieldContent = useMemo(function () {
|
|
25
|
+
return children({
|
|
26
|
+
control: control,
|
|
27
|
+
register: register,
|
|
28
|
+
setValue: setValue,
|
|
29
|
+
name: maybeEncodedName,
|
|
30
|
+
// @see https://github.com/vinissimus/next-translate/pull/461
|
|
31
|
+
// @see https://github.com/vinissimus/next-translate/issues/429
|
|
32
|
+
label: label || t("labels.".concat(name), undefined, { default: "" }),
|
|
33
|
+
placeholder: placeholder || t("placeholders.".concat(name), undefined, { fallback: "" }),
|
|
34
|
+
});
|
|
35
|
+
}, [
|
|
36
|
+
children,
|
|
37
|
+
control,
|
|
38
|
+
register,
|
|
39
|
+
setValue,
|
|
40
|
+
name,
|
|
41
|
+
label,
|
|
42
|
+
t,
|
|
43
|
+
maybeEncodedName,
|
|
44
|
+
placeholder,
|
|
45
|
+
]);
|
|
46
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Field, __assign({ name: maybeEncodedName, t: t, error: error }, props, { children: [FormFieldContent, hint && _jsx(FieldHint, { children: hint })] })), encode && register && _jsx(InputHoneypot, __assign({}, register(name)))] }));
|
|
47
|
+
};
|
package/Forms/Field/FieldHint.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldHint = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
+
exports.FieldHint = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n padding-top: 0.6em;\n opacity: 0.7;\n font-size: 75%;\n"], ["\n padding-top: 0.6em;\n opacity: 0.7;\n font-size: 75%;\n"])));
|
|
4
7
|
var templateObject_1;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
export var FieldHint = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-top: 0.6em;\n opacity: 0.7;\n font-size: 75%;\n"], ["\n padding-top: 0.6em;\n opacity: 0.7;\n font-size: 75%;\n"])));
|
|
4
|
+
var templateObject_1;
|