@koine/react 1.0.9 → 1.0.10
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/package.json +22 -9
- package/Alert/Alert.d.ts +0 -5
- package/Alert/Alert.js +0 -16
- package/Alert/index.d.ts +0 -1
- package/Alert/index.js +0 -1
- package/Alert/package.json +0 -6
- package/Animations/Reveal.d.ts +0 -4
- package/Animations/Reveal.js +0 -15
- package/Animations/Underline.d.ts +0 -1
- package/Animations/Underline.js +0 -15
- package/Animations/index.d.ts +0 -3
- package/Animations/index.js +0 -3
- package/Animations/package.json +0 -6
- package/Animations/useReveal.d.ts +0 -33
- package/Animations/useReveal.js +0 -70
- package/Autocomplete/AutocompleteDownshift.d.ts +0 -1
- package/Autocomplete/AutocompleteDownshift.js +0 -158
- package/Autocomplete/AutocompleteDownshiftMultiselect.d.ts +0 -1
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -353
- package/Autocomplete/AutocompleteMui.d.ts +0 -47
- package/Autocomplete/AutocompleteMui.js +0 -177
- package/Autocomplete/AutocompleteReach.d.ts +0 -1
- package/Autocomplete/AutocompleteReach.js +0 -112
- package/Autocomplete/components.d.ts +0 -21
- package/Autocomplete/components.js +0 -89
- package/Autocomplete/helpers.d.ts +0 -3
- package/Autocomplete/helpers.js +0 -28
- package/Autocomplete/index.d.ts +0 -2
- package/Autocomplete/index.js +0 -3
- package/Autocomplete/package.json +0 -6
- package/Bg/BgColor.d.ts +0 -36
- package/Bg/BgColor.js +0 -31
- package/Bg/BgPhoto.d.ts +0 -13
- package/Bg/BgPhoto.js +0 -59
- package/Bg/BgSvg.d.ts +0 -7
- package/Bg/BgSvg.js +0 -15
- package/Bg/index.d.ts +0 -3
- package/Bg/index.js +0 -3
- package/Bg/package.json +0 -6
- package/Breadcrumbs/Breadcrumbs.d.ts +0 -13
- package/Breadcrumbs/Breadcrumbs.js +0 -67
- package/Breadcrumbs/index.d.ts +0 -1
- package/Breadcrumbs/index.js +0 -1
- package/Breadcrumbs/package.json +0 -6
- package/Buttons/Button.d.ts +0 -18
- package/Buttons/Button.js +0 -79
- package/Buttons/ButtonComposite.d.ts +0 -23
- package/Buttons/ButtonComposite.js +0 -49
- package/Buttons/ButtonFab.d.ts +0 -7
- package/Buttons/ButtonFab.js +0 -8
- package/Buttons/ButtonLink.d.ts +0 -8
- package/Buttons/ButtonLink.js +0 -10
- package/Buttons/IconButton.d.ts +0 -11
- package/Buttons/IconButton.js +0 -19
- package/Buttons/index.d.ts +0 -5
- package/Buttons/index.js +0 -5
- package/Buttons/package.json +0 -6
- package/Calendar/CalendarDaygridCell.d.ts +0 -36
- package/Calendar/CalendarDaygridCell.js +0 -51
- package/Calendar/CalendarDaygridNav.d.ts +0 -27
- package/Calendar/CalendarDaygridNav.js +0 -22
- package/Calendar/CalendarDaygridTable.d.ts +0 -25
- package/Calendar/CalendarDaygridTable.js +0 -55
- package/Calendar/CalendarLegend.d.ts +0 -19
- package/Calendar/CalendarLegend.js +0 -11
- package/Calendar/calendar-api-google.d.ts +0 -18
- package/Calendar/calendar-api-google.js +0 -94
- package/Calendar/index.d.ts +0 -6
- package/Calendar/index.js +0 -6
- package/Calendar/package.json +0 -6
- package/Calendar/types.d.ts +0 -81
- package/Calendar/types.js +0 -1
- package/Calendar/useCalendar.d.ts +0 -49
- package/Calendar/useCalendar.js +0 -182
- package/Calendar/utils.d.ts +0 -11
- package/Calendar/utils.js +0 -203
- package/Carousel/Carousel.d.ts +0 -1
- package/Carousel/Carousel.js +0 -378
- package/Carousel/CarouselCss.d.ts +0 -47
- package/Carousel/CarouselCss.js +0 -36
- package/Carousel/index.d.ts +0 -1
- package/Carousel/index.js +0 -1
- package/Carousel/package.json +0 -6
- package/Collapsable/Collapsable.d.ts +0 -1
- package/Collapsable/Collapsable.js +0 -1
- package/Collapsable/CollapsableReach.d.ts +0 -66
- package/Collapsable/CollapsableReach.js +0 -135
- package/Collapsable/index.d.ts +0 -1
- package/Collapsable/index.js +0 -1
- package/Collapsable/package.json +0 -6
- package/Debug/Debug.d.ts +0 -4
- package/Debug/Debug.js +0 -21
- package/Debug/index.d.ts +0 -1
- package/Debug/index.js +0 -1
- package/Debug/package.json +0 -6
- package/Dialog/DialogMui.d.ts +0 -139
- package/Dialog/DialogMui.js +0 -78
- package/Dialog/css/bare.d.ts +0 -145
- package/Dialog/css/bare.js +0 -19
- package/Dialog/index.d.ts +0 -2
- package/Dialog/index.js +0 -1
- package/Dialog/m/bare.d.ts +0 -56
- package/Dialog/m/bare.js +0 -48
- package/Dialog/m/basic.d.ts +0 -4
- package/Dialog/m/basic.js +0 -31
- package/Dialog/m/index.d.ts +0 -2
- package/Dialog/m/index.js +0 -4
- package/Dialog/m/package.json +0 -6
- package/Dialog/package.json +0 -6
- package/Dialog/sc/bare.d.ts +0 -105
- package/Dialog/sc/bare.js +0 -61
- package/Dialog/sc/framer.d.ts +0 -80
- package/Dialog/sc/framer.js +0 -16
- package/Dialog/sc/framerMaterial.d.ts +0 -79
- package/Dialog/sc/framerMaterial.js +0 -16
- package/Dialog/sc/material.d.ts +0 -94
- package/Dialog/sc/material.js +0 -41
- package/Dialog/tw/bare.d.ts +0 -196
- package/Dialog/tw/bare.js +0 -36
- package/Dialog/tw/elegant.d.ts +0 -244
- package/Dialog/tw/elegant.js +0 -18
- package/Dialog/tw/framer.d.ts +0 -112
- package/Dialog/tw/framer.js +0 -16
- package/Dialog/tw/framerMaterial.d.ts +0 -167
- package/Dialog/tw/framerMaterial.js +0 -16
- package/Dialog/tw/material.d.ts +0 -244
- package/Dialog/tw/material.js +0 -18
- package/Editor/Editor--tiptap.d.ts +0 -9
- package/Editor/Editor--tiptap.js +0 -23
- package/Editor/components.d.ts +0 -7
- package/Editor/components.js +0 -28
- package/Editor/index.d.ts +0 -1
- package/Editor/index.js +0 -1
- package/Editor/package.json +0 -6
- package/Favicon/FaviconTags.d.ts +0 -18
- package/Favicon/FaviconTags.js +0 -14
- package/Favicon/index.d.ts +0 -1
- package/Favicon/index.js +0 -1
- package/Favicon/package.json +0 -6
- package/Forms/Checkbox/Checkbox.d.ts +0 -11
- package/Forms/Checkbox/Checkbox.js +0 -24
- package/Forms/Checkbox/index.d.ts +0 -1
- package/Forms/Checkbox/index.js +0 -1
- package/Forms/Checkbox/package.json +0 -6
- package/Forms/Feedback/Feedback.d.ts +0 -5
- package/Forms/Feedback/Feedback.js +0 -10
- package/Forms/Feedback/index.d.ts +0 -1
- package/Forms/Feedback/index.js +0 -1
- package/Forms/Feedback/package.json +0 -6
- package/Forms/Field/Field.d.ts +0 -15
- package/Forms/Field/Field.js +0 -59
- package/Forms/Field/FieldControl.d.ts +0 -26
- package/Forms/Field/FieldControl.js +0 -43
- package/Forms/Field/FieldHint.d.ts +0 -1
- package/Forms/Field/FieldHint.js +0 -6
- package/Forms/Field/index.d.ts +0 -2
- package/Forms/Field/index.js +0 -2
- package/Forms/Field/package.json +0 -6
- package/Forms/Form/Form.d.ts +0 -31
- package/Forms/Form/Form.js +0 -62
- package/Forms/Form/index.d.ts +0 -1
- package/Forms/Form/index.js +0 -1
- package/Forms/Form/package.json +0 -6
- package/Forms/Input/Input.d.ts +0 -9
- package/Forms/Input/Input.js +0 -23
- package/Forms/Input/index.d.ts +0 -1
- package/Forms/Input/index.js +0 -1
- package/Forms/Input/package.json +0 -6
- package/Forms/InputGroup/InputGroup.d.ts +0 -13
- package/Forms/InputGroup/InputGroup.js +0 -42
- package/Forms/InputGroup/index.d.ts +0 -1
- package/Forms/InputGroup/index.js +0 -1
- package/Forms/InputGroup/package.json +0 -6
- package/Forms/Label/Label.d.ts +0 -3
- package/Forms/Label/Label.js +0 -24
- package/Forms/Label/index.d.ts +0 -1
- package/Forms/Label/index.js +0 -1
- package/Forms/Label/package.json +0 -6
- package/Forms/Password/Password.d.ts +0 -5
- package/Forms/Password/Password.js +0 -30
- package/Forms/Password/index.d.ts +0 -1
- package/Forms/Password/index.js +0 -1
- package/Forms/Password/package.json +0 -6
- package/Forms/Radio/Radio.d.ts +0 -12
- package/Forms/Radio/Radio.js +0 -28
- package/Forms/Radio/index.d.ts +0 -1
- package/Forms/Radio/index.js +0 -1
- package/Forms/Radio/package.json +0 -6
- package/Forms/Switch/Switch.d.ts +0 -9
- package/Forms/Switch/Switch.js +0 -50
- package/Forms/Switch/index.d.ts +0 -1
- package/Forms/Switch/index.js +0 -1
- package/Forms/Switch/package.json +0 -6
- package/Forms/Textarea/Textarea.d.ts +0 -5
- package/Forms/Textarea/Textarea.js +0 -13
- package/Forms/Textarea/TextareaRich.d.ts +0 -6
- package/Forms/Textarea/TextareaRich.js +0 -42
- package/Forms/Textarea/index.d.ts +0 -2
- package/Forms/Textarea/index.js +0 -2
- package/Forms/Textarea/package.json +0 -6
- package/Forms/Toggle/Toggle.d.ts +0 -19
- package/Forms/Toggle/Toggle.js +0 -79
- package/Forms/Toggle/index.d.ts +0 -1
- package/Forms/Toggle/index.js +0 -1
- package/Forms/Toggle/package.json +0 -6
- package/Forms/Toggle/useToggle.d.ts +0 -46
- package/Forms/Toggle/useToggle.js +0 -145
- package/Forms/antispam.d.ts +0 -24
- package/Forms/antispam.js +0 -56
- package/Forms/helpers.d.ts +0 -26
- package/Forms/helpers.js +0 -44
- package/Forms/index.d.ts +0 -16
- package/Forms/index.js +0 -17
- package/Forms/package.json +0 -6
- package/Forms/styles.d.ts +0 -19
- package/Forms/styles.js +0 -60
- package/Gauge/Gauge.d.ts +0 -5
- package/Gauge/Gauge.js +0 -102
- package/Grid/Grid.d.ts +0 -64
- package/Grid/Grid.js +0 -79
- package/Grid/index.d.ts +0 -1
- package/Grid/index.js +0 -1
- package/Grid/package.json +0 -6
- package/Hamburger/Hamburger.d.ts +0 -6
- package/Hamburger/Hamburger.js +0 -64
- package/Hamburger/index.d.ts +0 -1
- package/Hamburger/index.js +0 -1
- package/Hamburger/package.json +0 -6
- package/Header/index.d.ts +0 -1
- package/Header/index.js +0 -1
- package/Header/package.json +0 -6
- package/Header/useHeader.d.ts +0 -24
- package/Header/useHeader.js +0 -30
- package/Hidden/Hidden.d.ts +0 -6
- package/Hidden/Hidden.js +0 -14
- package/Hidden/index.d.ts +0 -1
- package/Hidden/index.js +0 -1
- package/Hidden/package.json +0 -6
- package/Img/index.d.ts +0 -1
- package/Img/index.js +0 -1
- package/Img/package.json +0 -6
- package/Img/sc/bare.d.ts +0 -2
- package/Img/sc/bare.js +0 -37
- package/Img/types.d.ts +0 -9
- package/Img/types.js +0 -1
- package/Link/Link.d.ts +0 -5
- package/Link/Link.js +0 -2
- package/Link/LinkBlank.d.ts +0 -8
- package/Link/LinkBlank.js +0 -26
- package/Link/index.d.ts +0 -2
- package/Link/index.js +0 -2
- package/Link/package.json +0 -6
- package/Menu/Menu.d.ts +0 -1
- package/Menu/Menu.js +0 -11
- package/Menu/index.d.ts +0 -1
- package/Menu/index.js +0 -1
- package/Menu/package.json +0 -6
- package/MenuItem/MenuItem.d.ts +0 -4
- package/MenuItem/MenuItem.js +0 -20
- package/MenuItem/index.d.ts +0 -1
- package/MenuItem/index.js +0 -1
- package/MenuItem/package.json +0 -6
- package/Meta/Meta.d.ts +0 -14
- package/Meta/Meta.js +0 -4
- package/Meta/index.d.ts +0 -1
- package/Meta/index.js +0 -1
- package/Meta/package.json +0 -6
- package/NoJs/NoJs.d.ts +0 -2
- package/NoJs/NoJs.js +0 -6
- package/NoJs/index.d.ts +0 -1
- package/NoJs/index.js +0 -1
- package/NoJs/package.json +0 -6
- package/Pagination/PaginationNav.d.ts +0 -22
- package/Pagination/PaginationNav.js +0 -83
- package/Pagination/PaginationResults.d.ts +0 -3
- package/Pagination/PaginationResults.js +0 -10
- package/Pagination/index.d.ts +0 -2
- package/Pagination/index.js +0 -2
- package/Pagination/package.json +0 -6
- package/Pill/Pill.d.ts +0 -5
- package/Pill/Pill.js +0 -37
- package/Pill/index.d.ts +0 -1
- package/Pill/index.js +0 -1
- package/Pill/package.json +0 -6
- package/Progress/ProgressCircular.d.ts +0 -19
- package/Progress/ProgressCircular.js +0 -36
- package/Progress/ProgressLinear.d.ts +0 -22
- package/Progress/ProgressLinear.js +0 -32
- package/Progress/ProgressOverlay.d.ts +0 -4
- package/Progress/ProgressOverlay.js +0 -40
- package/Progress/index.d.ts +0 -3
- package/Progress/index.js +0 -3
- package/Progress/package.json +0 -6
- package/Rating/Rating.d.ts +0 -35
- package/Rating/Rating.js +0 -90
- package/Rating/index.d.ts +0 -11
- package/Rating/index.js +0 -45
- package/Rating/package.json +0 -6
- package/Select/SelectDownshift.d.ts +0 -5
- package/Select/SelectDownshift.js +0 -38
- package/Select/components.d.ts +0 -6
- package/Select/components.js +0 -18
- package/Select/index.d.ts +0 -2
- package/Select/index.js +0 -3
- package/Select/package.json +0 -6
- package/Sidebar/Sidebar.d.ts +0 -3
- package/Sidebar/Sidebar.js +0 -48
- package/Sidebar/index.d.ts +0 -1
- package/Sidebar/index.js +0 -1
- package/Sidebar/package.json +0 -6
- package/Spacing/Spacing.d.ts +0 -30
- package/Spacing/Spacing.js +0 -45
- package/Spacing/index.d.ts +0 -1
- package/Spacing/index.js +0 -1
- package/Spacing/package.json +0 -6
- package/Sticky/Sticky.d.ts +0 -2
- package/Sticky/Sticky.js +0 -219
- package/Sticky/StickyCss.d.ts +0 -5
- package/Sticky/StickyCss.js +0 -4
- package/Sticky/index.d.ts +0 -1
- package/Sticky/index.js +0 -1
- package/Sticky/package.json +0 -6
- package/Tabs/Tabs.d.ts +0 -27
- package/Tabs/Tabs.js +0 -62
- package/Tabs/index.d.ts +0 -1
- package/Tabs/index.js +0 -1
- package/Tabs/package.json +0 -6
- package/Typography/CopyPasteVisible.d.ts +0 -1
- package/Typography/CopyPasteVisible.js +0 -6
- package/Typography/Native.d.ts +0 -10
- package/Typography/Native.js +0 -47
- package/Typography/ReadMore.d.ts +0 -12
- package/Typography/ReadMore.js +0 -69
- package/Typography/TextLoop.d.ts +0 -16
- package/Typography/TextLoop.js +0 -49
- package/Typography/TypeStairs.d.ts +0 -6
- package/Typography/TypeStairs.js +0 -46
- package/Typography/index.d.ts +0 -5
- package/Typography/index.js +0 -5
- package/Typography/package.json +0 -6
- package/css/index.d.ts +0 -2
- package/css/index.js +0 -30
- package/css/package.json +0 -6
- package/helpers/classed.d.ts +0 -22
- package/helpers/classed.js +0 -64
- package/helpers/extend-component.d.ts +0 -28
- package/helpers/extend-component.js +0 -12
- package/helpers/index.d.ts +0 -3
- package/helpers/index.js +0 -2
- package/helpers/package.json +0 -6
- package/hooks/index.d.ts +0 -6
- package/hooks/index.js +0 -7
- package/hooks/package.json +0 -6
- package/hooks/useDateLocale.d.ts +0 -7
- package/hooks/useDateLocale.js +0 -29
- package/hooks/useFocus.d.ts +0 -4
- package/hooks/useFocus.js +0 -11
- package/hooks/usePrevious.d.ts +0 -1
- package/hooks/usePrevious.js +0 -8
- package/hooks/useScrollPosition.d.ts +0 -15
- package/hooks/useScrollPosition.js +0 -75
- package/hooks/useScrollTo.d.ts +0 -1
- package/hooks/useScrollTo.js +0 -19
- package/hooks/useTraceUpdate.d.ts +0 -4
- package/hooks/useTraceUpdate.js +0 -20
- package/hooks/useWindowSize.d.ts +0 -1
- package/hooks/useWindowSize.js +0 -13
- package/index.d.ts +0 -1
- package/index.js +0 -5
- package/m/MotionProvider.d.ts +0 -37
- package/m/MotionProvider.js +0 -37
- package/m/index.d.ts +0 -6
- package/m/index.js +0 -6
- 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/m/package.json +0 -6
- package/node/Alert/Alert.js +0 -21
- package/node/Alert/index.js +0 -4
- package/node/Animations/Reveal.js +0 -19
- package/node/Animations/Underline.js +0 -19
- package/node/Animations/index.js +0 -6
- package/node/Animations/useReveal.js +0 -74
- package/node/Autocomplete/AutocompleteDownshift.js +0 -161
- package/node/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -356
- package/node/Autocomplete/AutocompleteMui.js +0 -175
- package/node/Autocomplete/AutocompleteReach.js +0 -115
- package/node/Autocomplete/components.js +0 -93
- package/node/Autocomplete/helpers.js +0 -32
- package/node/Autocomplete/index.js +0 -7
- package/node/Bg/BgColor.js +0 -36
- package/node/Bg/BgPhoto.js +0 -64
- package/node/Bg/BgSvg.js +0 -20
- package/node/Bg/index.js +0 -6
- package/node/Breadcrumbs/Breadcrumbs.js +0 -72
- package/node/Breadcrumbs/index.js +0 -4
- package/node/Buttons/Button.js +0 -83
- package/node/Buttons/ButtonComposite.js +0 -54
- package/node/Buttons/ButtonFab.js +0 -12
- package/node/Buttons/ButtonLink.js +0 -15
- package/node/Buttons/IconButton.js +0 -23
- package/node/Buttons/index.js +0 -8
- package/node/Calendar/CalendarDaygridCell.js +0 -55
- package/node/Calendar/CalendarDaygridNav.js +0 -27
- package/node/Calendar/CalendarDaygridTable.js +0 -60
- package/node/Calendar/CalendarLegend.js +0 -15
- package/node/Calendar/calendar-api-google.js +0 -99
- package/node/Calendar/index.js +0 -9
- package/node/Calendar/types.js +0 -2
- package/node/Calendar/useCalendar.js +0 -186
- package/node/Calendar/utils.js +0 -217
- package/node/Carousel/Carousel.js +0 -381
- package/node/Carousel/CarouselCss.js +0 -41
- package/node/Carousel/index.js +0 -4
- package/node/Collapsable/Collapsable.js +0 -4
- package/node/Collapsable/CollapsableReach.js +0 -141
- package/node/Collapsable/index.js +0 -4
- package/node/Debug/Debug.js +0 -26
- package/node/Debug/index.js +0 -4
- package/node/Dialog/DialogMui.js +0 -82
- package/node/Dialog/css/bare.js +0 -23
- package/node/Dialog/index.js +0 -5
- package/node/Dialog/m/bare.js +0 -51
- package/node/Dialog/m/basic.js +0 -35
- package/node/Dialog/m/index.js +0 -8
- package/node/Dialog/sc/bare.js +0 -65
- package/node/Dialog/sc/framer.js +0 -19
- package/node/Dialog/sc/framerMaterial.js +0 -19
- package/node/Dialog/sc/material.js +0 -45
- package/node/Dialog/tw/bare.js +0 -40
- package/node/Dialog/tw/elegant.js +0 -21
- package/node/Dialog/tw/framer.js +0 -19
- package/node/Dialog/tw/framerMaterial.js +0 -19
- package/node/Dialog/tw/material.js +0 -21
- package/node/Editor/Editor--tiptap.js +0 -29
- package/node/Editor/components.js +0 -34
- package/node/Editor/index.js +0 -4
- package/node/Favicon/FaviconTags.js +0 -18
- package/node/Favicon/index.js +0 -4
- package/node/Forms/Checkbox/Checkbox.js +0 -28
- package/node/Forms/Checkbox/index.js +0 -4
- package/node/Forms/Feedback/Feedback.js +0 -15
- package/node/Forms/Feedback/index.js +0 -4
- package/node/Forms/Field/Field.js +0 -64
- package/node/Forms/Field/FieldControl.js +0 -47
- package/node/Forms/Field/FieldHint.js +0 -10
- package/node/Forms/Field/index.js +0 -5
- package/node/Forms/Form/Form.js +0 -67
- package/node/Forms/Form/index.js +0 -4
- package/node/Forms/Input/Input.js +0 -27
- package/node/Forms/Input/index.js +0 -4
- package/node/Forms/InputGroup/InputGroup.js +0 -47
- package/node/Forms/InputGroup/index.js +0 -4
- package/node/Forms/Label/Label.js +0 -28
- package/node/Forms/Label/index.js +0 -4
- package/node/Forms/Password/Password.js +0 -34
- package/node/Forms/Password/index.js +0 -4
- package/node/Forms/Radio/Radio.js +0 -32
- package/node/Forms/Radio/index.js +0 -4
- package/node/Forms/Switch/Switch.js +0 -54
- package/node/Forms/Switch/index.js +0 -4
- package/node/Forms/Textarea/Textarea.js +0 -17
- package/node/Forms/Textarea/TextareaRich.js +0 -46
- package/node/Forms/Textarea/index.js +0 -5
- package/node/Forms/Toggle/Toggle.js +0 -85
- package/node/Forms/Toggle/index.js +0 -4
- package/node/Forms/Toggle/useToggle.js +0 -149
- package/node/Forms/antispam.js +0 -61
- package/node/Forms/helpers.js +0 -51
- package/node/Forms/index.js +0 -20
- package/node/Forms/styles.js +0 -64
- package/node/Gauge/Gauge.js +0 -106
- package/node/Grid/Grid.js +0 -83
- package/node/Grid/index.js +0 -4
- package/node/Hamburger/Hamburger.js +0 -69
- 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 -18
- package/node/Hidden/index.js +0 -4
- package/node/Img/index.js +0 -4
- package/node/Img/sc/bare.js +0 -41
- package/node/Img/types.js +0 -2
- package/node/Link/Link.js +0 -6
- package/node/Link/LinkBlank.js +0 -31
- package/node/Link/index.js +0 -5
- package/node/Menu/Menu.js +0 -15
- package/node/Menu/index.js +0 -4
- package/node/MenuItem/MenuItem.js +0 -24
- package/node/MenuItem/index.js +0 -4
- package/node/Meta/Meta.js +0 -8
- package/node/Meta/index.js +0 -4
- package/node/NoJs/NoJs.js +0 -10
- package/node/NoJs/index.js +0 -4
- package/node/Pagination/PaginationNav.js +0 -88
- package/node/Pagination/PaginationResults.js +0 -15
- package/node/Pagination/index.js +0 -5
- package/node/Pill/Pill.js +0 -41
- package/node/Pill/index.js +0 -4
- package/node/Progress/ProgressCircular.js +0 -41
- package/node/Progress/ProgressLinear.js +0 -37
- package/node/Progress/ProgressOverlay.js +0 -45
- package/node/Progress/index.js +0 -6
- package/node/Rating/Rating.js +0 -96
- package/node/Rating/index.js +0 -53
- package/node/Select/SelectDownshift.js +0 -41
- package/node/Select/components.js +0 -22
- package/node/Select/index.js +0 -7
- package/node/Sidebar/Sidebar.js +0 -53
- package/node/Sidebar/index.js +0 -4
- package/node/Spacing/Spacing.js +0 -50
- package/node/Spacing/index.js +0 -4
- package/node/Sticky/Sticky.js +0 -222
- package/node/Sticky/StickyCss.js +0 -8
- package/node/Sticky/index.js +0 -4
- package/node/Tabs/Tabs.js +0 -67
- package/node/Tabs/index.js +0 -4
- package/node/Typography/CopyPasteVisible.js +0 -10
- package/node/Typography/Native.js +0 -51
- package/node/Typography/ReadMore.js +0 -74
- package/node/Typography/TextLoop.js +0 -54
- package/node/Typography/TypeStairs.js +0 -49
- package/node/Typography/index.js +0 -8
- package/node/css/index.js +0 -35
- package/node/helpers/classed.js +0 -68
- package/node/helpers/extend-component.js +0 -16
- package/node/helpers/index.js +0 -5
- package/node/hooks/index.js +0 -10
- package/node/hooks/useDateLocale.js +0 -56
- package/node/hooks/useFocus.js +0 -15
- package/node/hooks/usePrevious.js +0 -12
- package/node/hooks/useScrollPosition.js +0 -80
- package/node/hooks/useScrollTo.js +0 -23
- package/node/hooks/useTraceUpdate.js +0 -24
- package/node/hooks/useWindowSize.js +0 -17
- package/node/index.js +0 -8
- package/node/m/MotionProvider.js +0 -41
- 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 -35
- package/node/scm/index.js +0 -35
- package/node/shared/index.js +0 -11
- package/node/styles/Body.js +0 -21
- package/node/styles/Global.js +0 -53
- package/node/styles/index.js +0 -10
- package/node/styles/media.js +0 -156
- package/node/styles/spacing.js +0 -53
- package/node/styles/styled.js +0 -31
- package/node/styles/theme--vanilla.js +0 -59
- package/node/styles/theme.js +0 -45
- package/node/tw/index.js +0 -35
- package/node/twm/index.js +0 -35
- package/node/types.js +0 -2
- package/sc/index.d.ts +0 -29
- package/sc/index.js +0 -30
- package/sc/package.json +0 -6
- package/scm/index.d.ts +0 -29
- package/scm/index.js +0 -30
- package/scm/package.json +0 -6
- package/shared/index.d.ts +0 -8
- package/shared/index.js +0 -8
- package/shared/package.json +0 -6
- package/styles/Body.d.ts +0 -10
- package/styles/Body.js +0 -17
- package/styles/Global.d.ts +0 -15
- package/styles/Global.js +0 -50
- package/styles/index.d.ts +0 -7
- package/styles/index.js +0 -7
- package/styles/media.d.ts +0 -67
- package/styles/media.js +0 -150
- package/styles/package.json +0 -6
- package/styles/spacing.d.ts +0 -13
- package/styles/spacing.js +0 -46
- package/styles/styled.d.ts +0 -12
- package/styles/styled.js +0 -27
- package/styles/theme--vanilla.d.ts +0 -18
- package/styles/theme--vanilla.js +0 -53
- package/styles/theme.d.ts +0 -82
- package/styles/theme.js +0 -41
- package/tw/index.d.ts +0 -2
- package/tw/index.js +0 -30
- package/tw/package.json +0 -6
- package/twm/index.d.ts +0 -2
- package/twm/index.js +0 -30
- package/twm/package.json +0 -6
- package/types.d.ts +0 -10
- package/types.js +0 -1
package/Forms/Radio/Radio.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import styled from "styled-components";
|
|
4
|
-
import { label } from "../Label/Label";
|
|
5
|
-
import { Toggle, ToggleLabel, ToggleIndicatorSquared } from "../Toggle";
|
|
6
|
-
import { InputInvisible } from "../styles";
|
|
7
|
-
const RadioRoot = styled.div ``;
|
|
8
|
-
const RadioLabel = styled.div `
|
|
9
|
-
${label}
|
|
10
|
-
`;
|
|
11
|
-
const RadioOptionRoot = styled.label `
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
padding: 0.05em;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
`;
|
|
17
|
-
const RadioToggle = styled(Toggle) ``;
|
|
18
|
-
const RadioIndicator = styled(ToggleIndicatorSquared) ``;
|
|
19
|
-
const RadioOptionLabel = styled(ToggleLabel) ``;
|
|
20
|
-
const RadioOption = forwardRef(function RadioOption({ register, name, label, $ref, ...props }, ref) {
|
|
21
|
-
const inputProps = register ? register(name) : { name, ref: $ref || ref };
|
|
22
|
-
return (_jsxs(RadioOptionRoot, { children: [_jsxs(RadioToggle, { children: [_jsx(InputInvisible, { type: "radio", ...inputProps, ...props }), _jsx(RadioIndicator, {})] }), _jsx(RadioOptionLabel, { children: label })] }));
|
|
23
|
-
});
|
|
24
|
-
export const Radio = forwardRef(function Radio({ label, options, ...props }, ref) {
|
|
25
|
-
if (!options)
|
|
26
|
-
return null;
|
|
27
|
-
return (_jsxs(RadioRoot, { children: [label && _jsx(RadioLabel, { children: label }), options.map((option, idx) => (_jsx(RadioOption, { ...option, ...props, "$ref": ref }, idx)))] }));
|
|
28
|
-
});
|
package/Forms/Radio/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Radio";
|
package/Forms/Radio/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Radio";
|
package/Forms/Radio/package.json
DELETED
package/Forms/Switch/Switch.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { UseToggleProps } from "../Toggle/useToggle";
|
|
3
|
-
export declare const SwitchTrack: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
export declare const SwitchHandle: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
-
export declare type SwitchProps = UseToggleProps;
|
|
6
|
-
/**
|
|
7
|
-
* All logic and invisible Inputs come from the `useToggle` hook
|
|
8
|
-
*/
|
|
9
|
-
export declare const Switch: 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" | "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" | "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" | "size" | "options" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "min" | "crossOrigin" | "alt" | "src" | "autoComplete" | "accept" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | keyof import("..").FormControlProps<any> | "valueTrue" | "valueFalse"> & import("react").RefAttributes<HTMLInputElement>>;
|
package/Forms/Switch/Switch.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import styled from "styled-components";
|
|
4
|
-
import { CheckboxRoot, CheckboxLabel } from "../Checkbox";
|
|
5
|
-
import { toggleBase } from "../Toggle";
|
|
6
|
-
import { useToggle } from "../Toggle/useToggle";
|
|
7
|
-
import { stateFocus } from "../../styles/styled";
|
|
8
|
-
const SWITCH_GUTTER = 0.25;
|
|
9
|
-
const SWITCH_HANDLE_SIZE = 1;
|
|
10
|
-
export const SwitchTrack = styled.span `
|
|
11
|
-
position: relative;
|
|
12
|
-
width: ${SWITCH_HANDLE_SIZE * 3}em;
|
|
13
|
-
height: ${SWITCH_HANDLE_SIZE * 1.5}em;
|
|
14
|
-
padding: ${SWITCH_GUTTER}em;
|
|
15
|
-
border-radius: ${SWITCH_HANDLE_SIZE}em;
|
|
16
|
-
${toggleBase}
|
|
17
|
-
|
|
18
|
-
input:focus ~ & {
|
|
19
|
-
${stateFocus}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
input:disabled ~ & {
|
|
23
|
-
opacity: 0.5;
|
|
24
|
-
cursor: not-allowed;
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
export const SwitchHandle = styled.span `
|
|
28
|
-
position: absolute;
|
|
29
|
-
width: ${SWITCH_HANDLE_SIZE}em;
|
|
30
|
-
height: ${SWITCH_HANDLE_SIZE}em;
|
|
31
|
-
left: ${SWITCH_GUTTER}em;
|
|
32
|
-
margin-top: -1px;
|
|
33
|
-
/* border: 1px solid currentColor; */
|
|
34
|
-
background: currentColor;
|
|
35
|
-
opacity: 0.5;
|
|
36
|
-
border-radius: 100%;
|
|
37
|
-
transition: all 0.18s ease-in-out;
|
|
38
|
-
|
|
39
|
-
input:checked + ${SwitchTrack} & {
|
|
40
|
-
opacity: 1;
|
|
41
|
-
left: calc(100% - ${SWITCH_HANDLE_SIZE}em - ${SWITCH_GUTTER}em);
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
/**
|
|
45
|
-
* All logic and invisible Inputs come from the `useToggle` hook
|
|
46
|
-
*/
|
|
47
|
-
export const Switch = forwardRef(function Switch(props, ref) {
|
|
48
|
-
const { rootProps, Inputs, label } = useToggle(props, ref);
|
|
49
|
-
return (_jsxs(CheckboxRoot, { ...rootProps, children: [Inputs, _jsx(SwitchTrack, { children: _jsx(SwitchHandle, {}) }), label && _jsx(CheckboxLabel, { children: label })] }));
|
|
50
|
-
});
|
package/Forms/Switch/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Switch";
|
package/Forms/Switch/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Switch";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormControl } from "../helpers";
|
|
3
|
-
export declare const TextareaNative: import("styled-components").StyledComponent<"textarea", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
export declare type TextareaProps = FormControl<"textarea">;
|
|
5
|
-
export declare const Textarea: import("react").ForwardRefExoticComponent<Pick<TextareaProps, "key" | "value" | "id" | "title" | "color" | "form" | "slot" | "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "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" | "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" | "disabled" | "autoFocus" | "autoComplete" | "maxLength" | "minLength" | "readOnly" | "required" | "cols" | "dirName" | "rows" | "wrap" | keyof import("../helpers").FormControlProps<any>> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import styled from "styled-components";
|
|
4
|
-
import { Label } from "../Label/Label";
|
|
5
|
-
import { inputBase, inputFocus } from "../styles";
|
|
6
|
-
export const TextareaNative = styled.textarea `
|
|
7
|
-
${inputBase}
|
|
8
|
-
${inputFocus}
|
|
9
|
-
resize: vertical;
|
|
10
|
-
`;
|
|
11
|
-
export const Textarea = forwardRef(function Textarea({ register, name, label, ...props }, ref) {
|
|
12
|
-
return (_jsxs(_Fragment, { children: [label && _jsx(Label, { children: label }), _jsx(TextareaNative, { ...(register ? register(name) : { name, ref }), ...props })] }));
|
|
13
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormControl } from "../helpers";
|
|
3
|
-
export declare type TextareaRichProps = FormControl<"textarea"> & {
|
|
4
|
-
defaultValue?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const TextareaRich: import("react").ForwardRefExoticComponent<Pick<TextareaRichProps, "key" | "value" | "id" | "title" | "color" | "form" | "slot" | "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "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" | "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" | "disabled" | "autoFocus" | "autoComplete" | "maxLength" | "minLength" | "readOnly" | "required" | "cols" | "dirName" | "rows" | "wrap" | keyof import("../helpers").FormControlProps<any>> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import styled from "styled-components";
|
|
4
|
-
// import TextareaAutosize from "@mui/base/TextareaAutosize";
|
|
5
|
-
import { Label } from "../Label/Label";
|
|
6
|
-
import { Editor } from "../../Editor";
|
|
7
|
-
import { triggerOnChange } from "../helpers";
|
|
8
|
-
const Root = styled.div `
|
|
9
|
-
.ProseMirror {
|
|
10
|
-
max-height: 160px;
|
|
11
|
-
overflow: auto;
|
|
12
|
-
}
|
|
13
|
-
.EditorContent {
|
|
14
|
-
position: relative;
|
|
15
|
-
&:after {
|
|
16
|
-
position: absolute;
|
|
17
|
-
content: "";
|
|
18
|
-
bottom: 0;
|
|
19
|
-
left: 0;
|
|
20
|
-
right: 16px; /* scrollbar width? */
|
|
21
|
-
height: 3em;
|
|
22
|
-
background: linear-gradient(0deg, white, white 33%, transparent);
|
|
23
|
-
pointer-events: none;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
export const TextareaRich = forwardRef(function TextareaRich({ register, setValue, name, label, defaultValue = "", onChange, ...props }, ref) {
|
|
28
|
-
if (register)
|
|
29
|
-
register(name);
|
|
30
|
-
return (_jsxs(Root, { children: [label && _jsx(Label, { children: label }), _jsx(Editor, { options: {
|
|
31
|
-
// element: <TextareaAutosize />,
|
|
32
|
-
content: defaultValue,
|
|
33
|
-
onUpdate: (onChange || setValue) && name
|
|
34
|
-
? ({ editor }) => {
|
|
35
|
-
const value = editor.getHTML();
|
|
36
|
-
if (setValue)
|
|
37
|
-
setValue(name, value);
|
|
38
|
-
triggerOnChange(onChange, name, value);
|
|
39
|
-
}
|
|
40
|
-
: undefined,
|
|
41
|
-
}, ...props })] }));
|
|
42
|
-
});
|
package/Forms/Textarea/index.js
DELETED
package/Forms/Toggle/Toggle.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare const toggleBase = "\n border: 1px solid var(--forms-border-color);\n";
|
|
2
|
-
export declare const toggleIndicatorBg = "\n display: inline-block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n";
|
|
3
|
-
export declare const toggleIndicatorBgShape: string;
|
|
4
|
-
export declare const toggleIndicatorFg = "\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n fill: currentcolor;\n";
|
|
5
|
-
export declare const Toggle: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
-
export declare const ToggleLabel: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
-
export declare const ToggleLabelSub: import("styled-components").StyledComponent<"small", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
-
export declare const ToggleIndicatorHolder: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
-
export declare const ToggleIndicatorBgSquare: import("styled-components").StyledComponent<"svg", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
-
export declare const ToggleIndicatorBgCircle: import("styled-components").StyledComponent<"svg", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
-
export declare const ToggleIndicatorFg: import("styled-components").StyledComponent<"svg", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
-
export declare type ToggleIndicatorProps = unknown;
|
|
13
|
-
export declare type ToggleIndicatorSquaredProps = ToggleIndicatorProps;
|
|
14
|
-
export declare const ToggleIndicatorSquared: (props: ToggleIndicatorSquaredProps) => JSX.Element;
|
|
15
|
-
export declare type ToggleIndicatorRoundedProps = ToggleIndicatorProps & {
|
|
16
|
-
/** @default 6 */
|
|
17
|
-
r?: number;
|
|
18
|
-
};
|
|
19
|
-
export declare const ToggleIndicatorRounded: ({ r, }: ToggleIndicatorRoundedProps) => JSX.Element;
|
package/Forms/Toggle/Toggle.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* @file
|
|
4
|
-
*
|
|
5
|
-
* About accessibility:
|
|
6
|
-
* - minimum target size of 44px https://www.w3.org/TR/WCAG21/#target-size
|
|
7
|
-
*/
|
|
8
|
-
import { useId } from "react";
|
|
9
|
-
import styled from "styled-components";
|
|
10
|
-
import { stateFocus } from "../../styles/styled";
|
|
11
|
-
export const toggleBase = `
|
|
12
|
-
border: 1px solid var(--forms-border-color);
|
|
13
|
-
`;
|
|
14
|
-
export const toggleIndicatorBg = `
|
|
15
|
-
display: inline-block;
|
|
16
|
-
flex-shrink: 0;
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 100%;
|
|
19
|
-
`;
|
|
20
|
-
export const toggleIndicatorBgShape = `
|
|
21
|
-
${toggleIndicatorBg}
|
|
22
|
-
fill: none;
|
|
23
|
-
stroke-width: 2px;
|
|
24
|
-
stroke: var(--forms-border-color);
|
|
25
|
-
`;
|
|
26
|
-
export const toggleIndicatorFg = `
|
|
27
|
-
position: absolute;
|
|
28
|
-
left: 0;
|
|
29
|
-
width: 100%;
|
|
30
|
-
height: 100%;
|
|
31
|
-
fill: currentcolor;
|
|
32
|
-
`;
|
|
33
|
-
export const Toggle = styled.span `
|
|
34
|
-
position: relative;
|
|
35
|
-
display: inline-flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
width: 2em;
|
|
39
|
-
height: 2em;
|
|
40
|
-
margin: 0 -0.3em; /* rtl */
|
|
41
|
-
padding: 0.3em;
|
|
42
|
-
`;
|
|
43
|
-
export const ToggleLabel = styled.span `
|
|
44
|
-
margin-left: 0.6em; /* rtl */
|
|
45
|
-
`;
|
|
46
|
-
export const ToggleLabelSub = styled.small `
|
|
47
|
-
opacity: 0.7;
|
|
48
|
-
font-size: 0.7em; ;
|
|
49
|
-
`;
|
|
50
|
-
export const ToggleIndicatorHolder = styled.span `
|
|
51
|
-
position: relative;
|
|
52
|
-
display: flex;
|
|
53
|
-
|
|
54
|
-
input:focus ~ & {
|
|
55
|
-
${stateFocus}
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
58
|
-
export const ToggleIndicatorBgSquare = styled.svg `
|
|
59
|
-
${toggleIndicatorBgShape}
|
|
60
|
-
`;
|
|
61
|
-
export const ToggleIndicatorBgCircle = styled.svg `
|
|
62
|
-
${toggleIndicatorBgShape}
|
|
63
|
-
`;
|
|
64
|
-
export const ToggleIndicatorFg = styled.svg `
|
|
65
|
-
${toggleIndicatorFg}
|
|
66
|
-
transform: scale(0);
|
|
67
|
-
transition: transform 0.18s ease;
|
|
68
|
-
|
|
69
|
-
input:checked + ${ToggleIndicatorHolder} & {
|
|
70
|
-
transform: scale(1);
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
export const ToggleIndicatorSquared = (props) => {
|
|
74
|
-
return (_jsxs(ToggleIndicatorHolder, { children: [_jsx(ToggleIndicatorBgSquare, { viewBox: "0 0 24 24", children: _jsx("rect", { width: "24", height: "24" }) }), _jsx(ToggleIndicatorFg, { viewBox: "0 0 24 24", children: _jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) })] }));
|
|
75
|
-
};
|
|
76
|
-
export const ToggleIndicatorRounded = ({ r = 6, }) => {
|
|
77
|
-
const id = useId();
|
|
78
|
-
return (_jsxs(ToggleIndicatorHolder, { children: [_jsxs(ToggleIndicatorBgCircle, { viewBox: "0 0 24 24", children: [_jsx("circle", { cy: "12", cx: "12", r: "12", id: `r_${id}`, clipPath: `url(#c_${id})` }), _jsx("clipPath", { id: `c_${id}`, children: _jsx("use", { xlinkHref: `#r_${id}` }) })] }), _jsx(ToggleIndicatorFg, { viewBox: "0 0 24 24", children: _jsx("circle", { r: r, cx: "12", cy: "12" }) })] }));
|
|
79
|
-
};
|
package/Forms/Toggle/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Toggle";
|
package/Forms/Toggle/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Toggle";
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Option } from "../../types";
|
|
3
|
-
import { FormControl } from "../helpers";
|
|
4
|
-
export declare type UseToggleProps = Omit<FormControl, "value"> & {
|
|
5
|
-
value?: boolean;
|
|
6
|
-
valueTrue?: string;
|
|
7
|
-
valueFalse?: string;
|
|
8
|
-
options?: Option[];
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* This hook is meant to powere Checkboxes, Switches and checkbox-like Radios
|
|
12
|
-
* components, it works in fact in two modes:
|
|
13
|
-
*
|
|
14
|
-
* 1: behaviour as standard checkbox
|
|
15
|
-
* yup validation would simply look like:
|
|
16
|
-
*
|
|
17
|
-
* ```ts
|
|
18
|
-
* privacy: boolean().required(),
|
|
19
|
-
* // add `.nullable()` if you do not provide a boolean `defaultValue`
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* 2: beahviour as two radio for checkbox with custom true/false values as
|
|
23
|
-
* strings yup validation would look like:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* newsletter: string().oneOf(["yes", "no"]).required(),
|
|
27
|
-
* // add `.nullable()` if you do not provide a string `defaultValue`
|
|
28
|
-
*
|
|
29
|
-
* // to do not make it required and avoid triggering an error when the input is
|
|
30
|
-
* // untouched you need to set the default value of the input in the form
|
|
31
|
-
* // initialization's `defaultValues` as such:
|
|
32
|
-
*
|
|
33
|
-
* useForm({ defaultValues: { newsletter: "no" }})
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* To enable this mode either pass the props `valueTrue` and `valueFalse` or
|
|
37
|
-
* an array of options with the shape of `Option`
|
|
38
|
-
*/
|
|
39
|
-
export declare function useToggle(props: UseToggleProps, ref: React.ForwardedRef<HTMLInputElement>): {
|
|
40
|
-
Inputs: JSX.Element;
|
|
41
|
-
rootProps: {
|
|
42
|
-
htmlFor: string | undefined;
|
|
43
|
-
};
|
|
44
|
-
label: any;
|
|
45
|
-
value: any;
|
|
46
|
-
};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo } from "react";
|
|
3
|
-
import { useWatch } from "react-hook-form";
|
|
4
|
-
import { InputInvisible } from "../styles";
|
|
5
|
-
/**
|
|
6
|
-
* This hook is meant to powere Checkboxes, Switches and checkbox-like Radios
|
|
7
|
-
* components, it works in fact in two modes:
|
|
8
|
-
*
|
|
9
|
-
* 1: behaviour as standard checkbox
|
|
10
|
-
* yup validation would simply look like:
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* privacy: boolean().required(),
|
|
14
|
-
* // add `.nullable()` if you do not provide a boolean `defaultValue`
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* 2: beahviour as two radio for checkbox with custom true/false values as
|
|
18
|
-
* strings yup validation would look like:
|
|
19
|
-
*
|
|
20
|
-
* ```ts
|
|
21
|
-
* newsletter: string().oneOf(["yes", "no"]).required(),
|
|
22
|
-
* // add `.nullable()` if you do not provide a string `defaultValue`
|
|
23
|
-
*
|
|
24
|
-
* // to do not make it required and avoid triggering an error when the input is
|
|
25
|
-
* // untouched you need to set the default value of the input in the form
|
|
26
|
-
* // initialization's `defaultValues` as such:
|
|
27
|
-
*
|
|
28
|
-
* useForm({ defaultValues: { newsletter: "no" }})
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* To enable this mode either pass the props `valueTrue` and `valueFalse` or
|
|
32
|
-
* an array of options with the shape of `Option`
|
|
33
|
-
*/
|
|
34
|
-
export function useToggle(props, ref) {
|
|
35
|
-
const { name, control, register, label, options, value: propValue, ...restProps } = props;
|
|
36
|
-
let { id, valueTrue, valueFalse,
|
|
37
|
-
// defaultChecked,
|
|
38
|
-
// defaultValue,
|
|
39
|
-
// eslint-disable-next-line prefer-const
|
|
40
|
-
...remainingInputProps } = restProps;
|
|
41
|
-
// use options data convention to pass on the true/false values
|
|
42
|
-
if (options) {
|
|
43
|
-
valueTrue = options
|
|
44
|
-
.filter((opt) => opt.value === "true")[0]
|
|
45
|
-
.label.toString();
|
|
46
|
-
valueFalse = options
|
|
47
|
-
.filter((opt) => opt.value === "false")[0]
|
|
48
|
-
.label.toString();
|
|
49
|
-
}
|
|
50
|
-
id = `switch-${name}`;
|
|
51
|
-
const idTrue = `${id}-true`;
|
|
52
|
-
const idFalse = `${id}-false`;
|
|
53
|
-
const isRadio = !!(valueTrue && valueFalse);
|
|
54
|
-
// // manage default values for both toggle modes
|
|
55
|
-
// defaultChecked = isUndefined(defaultChecked) ? false : defaultChecked;
|
|
56
|
-
// // TODO: maybe throw an error if the defaultValue that arrives here is not
|
|
57
|
-
// // a valid value
|
|
58
|
-
// defaultValue =
|
|
59
|
-
// defaultValue === valueTrue || defaultValue === valueFalse
|
|
60
|
-
// ? defaultValue
|
|
61
|
-
// : valueFalse;
|
|
62
|
-
// get the value either from the uncontrolled watched input or from the given
|
|
63
|
-
// prop to control the component
|
|
64
|
-
let value = useWatch({
|
|
65
|
-
name,
|
|
66
|
-
control,
|
|
67
|
-
// defaultValue: isRadio ? defaultValue : defaultChecked,
|
|
68
|
-
});
|
|
69
|
-
if (propValue) {
|
|
70
|
-
value = propValue;
|
|
71
|
-
}
|
|
72
|
-
// get the input props needed by react-hook-form, first check if we have
|
|
73
|
-
// a `register` function, then check if we have a `control` object or just
|
|
74
|
-
// rely on the `name` prop and `ref`, they probably would be passed alongside
|
|
75
|
-
// an `onChange` prop that is spreaded on the inputs
|
|
76
|
-
const inputProps = useMemo(() => {
|
|
77
|
-
return register
|
|
78
|
-
? register(name)
|
|
79
|
-
: control
|
|
80
|
-
? control.register(name)
|
|
81
|
-
: {
|
|
82
|
-
name,
|
|
83
|
-
ref,
|
|
84
|
-
};
|
|
85
|
-
}, [register, control, name, ref]);
|
|
86
|
-
/**
|
|
87
|
-
* Accessibility.
|
|
88
|
-
*
|
|
89
|
-
* Fake the spacebar keyboard behaviour on the radio mode of the checkbox.
|
|
90
|
-
* Without this *only* the arrow keys would change the checkbox state
|
|
91
|
-
*/
|
|
92
|
-
const handleKeyDown = useCallback((event) => {
|
|
93
|
-
if (event.key === " ") {
|
|
94
|
-
event.preventDefault();
|
|
95
|
-
event.stopPropagation();
|
|
96
|
-
const firstInput = event.target;
|
|
97
|
-
const next = firstInput.nextElementSibling;
|
|
98
|
-
const prev = firstInput.previousElementSibling;
|
|
99
|
-
const secondInput = next?.tagName === "INPUT" ? next : prev;
|
|
100
|
-
let target = firstInput;
|
|
101
|
-
if (firstInput.checked) {
|
|
102
|
-
target = secondInput;
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
if (!secondInput.checked) {
|
|
106
|
-
target =
|
|
107
|
-
firstInput.value === valueTrue ? firstInput : secondInput;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (target)
|
|
111
|
-
target.click();
|
|
112
|
-
}
|
|
113
|
-
}, [valueTrue]);
|
|
114
|
-
// collect all the return values that are dependent on the current value
|
|
115
|
-
// of the input
|
|
116
|
-
const valueDependentProps = useMemo(() => ({
|
|
117
|
-
rootProps: {
|
|
118
|
-
htmlFor: isRadio
|
|
119
|
-
? !value || value === valueFalse
|
|
120
|
-
? idTrue
|
|
121
|
-
: idFalse
|
|
122
|
-
: id,
|
|
123
|
-
},
|
|
124
|
-
label: label ? label : value,
|
|
125
|
-
value,
|
|
126
|
-
}), [value, valueFalse, isRadio, id, idTrue, idFalse, label]);
|
|
127
|
-
const Inputs = useMemo(() => isRadio ? (_jsxs(_Fragment, { children: [_jsx(InputInvisible, { id: idFalse, ...inputProps, ...remainingInputProps, onKeyDown: handleKeyDown, type: "radio", value: valueFalse }), _jsx(InputInvisible, { id: idTrue, ...inputProps, ...remainingInputProps, onKeyDown: handleKeyDown, type: "radio", value: valueTrue })] })) : (_jsx(InputInvisible, { id: id, type: "checkbox", ...inputProps, ...remainingInputProps })), [
|
|
128
|
-
inputProps,
|
|
129
|
-
remainingInputProps,
|
|
130
|
-
handleKeyDown,
|
|
131
|
-
isRadio,
|
|
132
|
-
idFalse,
|
|
133
|
-
idTrue,
|
|
134
|
-
valueFalse,
|
|
135
|
-
valueTrue,
|
|
136
|
-
id,
|
|
137
|
-
// defaultChecked,
|
|
138
|
-
// defaultValue,
|
|
139
|
-
]);
|
|
140
|
-
// console.log("useToggle: render", value);
|
|
141
|
-
return {
|
|
142
|
-
...valueDependentProps,
|
|
143
|
-
Inputs,
|
|
144
|
-
};
|
|
145
|
-
}
|
package/Forms/antispam.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ObjectShape } from "yup/lib/object";
|
|
2
|
-
/**
|
|
3
|
-
* Encode form
|
|
4
|
-
*
|
|
5
|
-
* Takes a record of yup validations and outputs a `yup` schema with encoded
|
|
6
|
-
* names (antispam technique) and a record of the encoded/decoded input `name`s.
|
|
7
|
-
*
|
|
8
|
-
* We skip the names prefixed wth an underscore which are considered programmatic
|
|
9
|
-
* form data not created by user input.
|
|
10
|
-
*/
|
|
11
|
-
export declare function encodeForm<T extends ObjectShape = {}>(validationRules: T): {
|
|
12
|
-
encodedSchema: import("yup/lib/object").RequiredObjectSchema<Record<string, T[keyof T]>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Record<string, T[keyof T]>>>;
|
|
13
|
-
encodedNames: Record<keyof T, string>;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Decode form data
|
|
17
|
-
*
|
|
18
|
-
* This function is meant to be used inside an api endpoint to gather an encoded
|
|
19
|
-
* form submit data and transform it to the decoded desired json data.
|
|
20
|
-
*
|
|
21
|
-
* Here too we skip encoding/decoding process for names prefixed wth an underscore
|
|
22
|
-
* which are considered programmatic form data not created by user input.
|
|
23
|
-
*/
|
|
24
|
-
export declare function decodeForm<ReturnAs extends Record<string, unknown> = {}, FormData extends Record<string, unknown> = {}>(formData: FormData): ReturnAs;
|
package/Forms/antispam.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { object } from "yup";
|
|
2
|
-
import { encode, decode, isUndefined } from "@koine/utils";
|
|
3
|
-
/**
|
|
4
|
-
* Encode form
|
|
5
|
-
*
|
|
6
|
-
* Takes a record of yup validations and outputs a `yup` schema with encoded
|
|
7
|
-
* names (antispam technique) and a record of the encoded/decoded input `name`s.
|
|
8
|
-
*
|
|
9
|
-
* We skip the names prefixed wth an underscore which are considered programmatic
|
|
10
|
-
* form data not created by user input.
|
|
11
|
-
*/
|
|
12
|
-
export function encodeForm(validationRules) {
|
|
13
|
-
const encoded = {};
|
|
14
|
-
const encodedNames = {};
|
|
15
|
-
for (const name in validationRules) {
|
|
16
|
-
if (!name.startsWith("_")) {
|
|
17
|
-
const encodedName = encode(name);
|
|
18
|
-
encoded[encodedName] = validationRules[name];
|
|
19
|
-
encodedNames[name] = encodedName;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
// we need `.required()` to correctly infer the type @see
|
|
23
|
-
// https://github.com/jquense/yup/issues/946
|
|
24
|
-
const encodedSchema = object(encoded).required();
|
|
25
|
-
return { encodedSchema, encodedNames };
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Decode form data
|
|
29
|
-
*
|
|
30
|
-
* This function is meant to be used inside an api endpoint to gather an encoded
|
|
31
|
-
* form submit data and transform it to the decoded desired json data.
|
|
32
|
-
*
|
|
33
|
-
* Here too we skip encoding/decoding process for names prefixed wth an underscore
|
|
34
|
-
* which are considered programmatic form data not created by user input.
|
|
35
|
-
*/
|
|
36
|
-
export function decodeForm(formData) {
|
|
37
|
-
const json = {};
|
|
38
|
-
for (const encodedName in formData) {
|
|
39
|
-
const decodedName = decode(encodedName);
|
|
40
|
-
// always add underscore prefixed names as they are treated as internal
|
|
41
|
-
// private inputs outside of the honeypot system, normalise them here removing
|
|
42
|
-
// the underscore prefix
|
|
43
|
-
if (encodedName.startsWith("_")) {
|
|
44
|
-
// @ts-expect-error nevermind
|
|
45
|
-
json[encodedName.substring(1)] = formData[encodedName];
|
|
46
|
-
}
|
|
47
|
-
// if the decoded `name` is empty and the encoded `name` is defined honeypot passed
|
|
48
|
-
else if (!isUndefined(formData[encodedName]) &&
|
|
49
|
-
formData[decodedName] === "") {
|
|
50
|
-
// @ts-expect-error nevermind
|
|
51
|
-
json[decodedName] = formData[encodedName];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// console.log(formData, decoded, json);
|
|
55
|
-
return json;
|
|
56
|
-
}
|