@koine/react 1.0.10 → 1.0.13
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.d.ts +5 -0
- package/Alert/Alert.js +10 -0
- package/Alert/index.d.ts +1 -0
- package/Alert/index.js +1 -0
- package/Alert/package.json +6 -0
- package/Animations/Reveal.d.ts +4 -0
- package/Animations/Reveal.js +17 -0
- package/Animations/Underline.d.ts +1 -0
- package/Animations/Underline.js +5 -0
- package/Animations/index.d.ts +3 -0
- package/Animations/index.js +3 -0
- package/Animations/package.json +6 -0
- package/Animations/useReveal.d.ts +33 -0
- package/Animations/useReveal.js +71 -0
- package/Autocomplete/AutocompleteDownshift.d.ts +1 -0
- package/Autocomplete/AutocompleteDownshift.js +158 -0
- package/Autocomplete/AutocompleteDownshiftMultiselect.d.ts +1 -0
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +353 -0
- package/Autocomplete/AutocompleteMui.d.ts +47 -0
- package/Autocomplete/AutocompleteMui.js +182 -0
- package/Autocomplete/AutocompleteReach.d.ts +1 -0
- package/Autocomplete/AutocompleteReach.js +112 -0
- package/Autocomplete/components.d.ts +21 -0
- package/Autocomplete/components.js +34 -0
- package/Autocomplete/helpers.d.ts +3 -0
- package/Autocomplete/helpers.js +28 -0
- package/Autocomplete/index.d.ts +2 -0
- package/Autocomplete/index.js +3 -0
- package/Autocomplete/package.json +6 -0
- package/Bg/BgColor.d.ts +36 -0
- package/Bg/BgColor.js +21 -0
- package/Bg/BgPhoto.d.ts +13 -0
- package/Bg/BgPhoto.js +16 -0
- package/Bg/BgSvg.d.ts +7 -0
- package/Bg/BgSvg.js +12 -0
- package/Bg/index.d.ts +3 -0
- package/Bg/index.js +3 -0
- package/Bg/package.json +6 -0
- package/Breadcrumbs/Breadcrumbs.d.ts +13 -0
- package/Breadcrumbs/Breadcrumbs.js +27 -0
- package/Breadcrumbs/index.d.ts +1 -0
- package/Breadcrumbs/index.js +1 -0
- package/Breadcrumbs/package.json +6 -0
- package/Buttons/Button.d.ts +18 -0
- package/Buttons/Button.js +14 -0
- package/Buttons/ButtonComposite.d.ts +23 -0
- package/Buttons/ButtonComposite.js +28 -0
- package/Buttons/ButtonFab.d.ts +7 -0
- package/Buttons/ButtonFab.js +6 -0
- package/Buttons/ButtonLink.d.ts +8 -0
- package/Buttons/ButtonLink.js +11 -0
- package/Buttons/IconButton.d.ts +11 -0
- package/Buttons/IconButton.js +7 -0
- package/Buttons/index.d.ts +5 -0
- package/Buttons/index.js +5 -0
- package/Buttons/package.json +6 -0
- package/Calendar/CalendarDaygridCell.d.ts +36 -0
- package/Calendar/CalendarDaygridCell.js +57 -0
- package/Calendar/CalendarDaygridNav.d.ts +27 -0
- package/Calendar/CalendarDaygridNav.js +23 -0
- package/Calendar/CalendarDaygridTable.d.ts +25 -0
- package/Calendar/CalendarDaygridTable.js +57 -0
- package/Calendar/CalendarLegend.d.ts +19 -0
- package/Calendar/CalendarLegend.js +16 -0
- package/Calendar/calendar-api-google.d.ts +18 -0
- package/Calendar/calendar-api-google.js +127 -0
- package/Calendar/index.d.ts +6 -0
- package/Calendar/index.js +6 -0
- package/Calendar/package.json +6 -0
- package/Calendar/types.d.ts +81 -0
- package/Calendar/types.js +1 -0
- package/Calendar/useCalendar.d.ts +49 -0
- package/Calendar/useCalendar.js +183 -0
- package/Calendar/utils.d.ts +11 -0
- package/Calendar/utils.js +202 -0
- package/Carousel/Carousel.d.ts +1 -0
- package/Carousel/Carousel.js +378 -0
- package/Carousel/CarouselCss.d.ts +47 -0
- package/Carousel/CarouselCss.js +23 -0
- package/Carousel/index.d.ts +1 -0
- package/Carousel/index.js +1 -0
- package/Carousel/package.json +6 -0
- package/Collapsable/Collapsable.d.ts +1 -0
- package/Collapsable/Collapsable.js +1 -0
- package/Collapsable/CollapsableReach.d.ts +6 -0
- package/Collapsable/CollapsableReach.js +253 -0
- package/Collapsable/index.d.ts +1 -0
- package/Collapsable/index.js +2 -0
- package/Collapsable/package.json +6 -0
- package/Debug/Debug.d.ts +4 -0
- package/Debug/Debug.js +9 -0
- package/Debug/index.d.ts +1 -0
- package/Debug/index.js +1 -0
- package/Debug/package.json +6 -0
- package/Details/Details.d.ts +114 -0
- package/Details/Details.js +65 -0
- package/Details/index.d.ts +1 -0
- package/Details/index.js +1 -0
- package/Details/package.json +6 -0
- package/Dialog/DialogMui.d.ts +139 -0
- package/Dialog/DialogMui.js +80 -0
- package/Dialog/css/bare.d.ts +145 -0
- package/Dialog/css/bare.js +21 -0
- package/Dialog/index.d.ts +2 -0
- package/Dialog/index.js +1 -0
- package/Dialog/m/bare.d.ts +56 -0
- package/Dialog/m/bare.js +52 -0
- package/Dialog/m/basic.d.ts +4 -0
- package/Dialog/m/basic.js +31 -0
- package/Dialog/m/index.d.ts +2 -0
- package/Dialog/m/index.js +4 -0
- package/Dialog/m/package.json +6 -0
- package/Dialog/package.json +6 -0
- package/Dialog/sc/bare.d.ts +105 -0
- package/Dialog/sc/bare.js +43 -0
- package/Dialog/sc/framer.d.ts +80 -0
- package/Dialog/sc/framer.js +16 -0
- package/Dialog/sc/framerMaterial.d.ts +79 -0
- package/Dialog/sc/framerMaterial.js +16 -0
- package/Dialog/sc/material.d.ts +94 -0
- package/Dialog/sc/material.js +21 -0
- package/Dialog/tw/bare.d.ts +196 -0
- package/Dialog/tw/bare.js +42 -0
- package/Dialog/tw/elegant.d.ts +244 -0
- package/Dialog/tw/elegant.js +20 -0
- package/Dialog/tw/framer.d.ts +112 -0
- package/Dialog/tw/framer.js +16 -0
- package/Dialog/tw/framerMaterial.d.ts +167 -0
- package/Dialog/tw/framerMaterial.js +16 -0
- package/Dialog/tw/material.d.ts +244 -0
- package/Dialog/tw/material.js +20 -0
- package/Editor/Editor--tiptap.d.ts +9 -0
- package/Editor/Editor--tiptap.js +26 -0
- package/Editor/components.d.ts +7 -0
- package/Editor/components.js +10 -0
- package/Editor/index.d.ts +1 -0
- package/Editor/index.js +1 -0
- package/Editor/package.json +6 -0
- package/Favicon/FaviconTags.d.ts +18 -0
- package/Favicon/FaviconTags.js +15 -0
- package/Favicon/index.d.ts +1 -0
- package/Favicon/index.js +1 -0
- package/Favicon/package.json +6 -0
- package/Form/Form.d.ts +111 -0
- package/Form/Form.js +61 -0
- package/Form/index.d.ts +1 -0
- package/Form/index.js +1 -0
- package/Form/package.json +6 -0
- package/Form/sc/bare.d.ts +33 -0
- package/Form/sc/bare.js +20 -0
- package/Forms/Checkbox/Checkbox.d.ts +11 -0
- package/Forms/Checkbox/Checkbox.js +18 -0
- package/Forms/Checkbox/index.d.ts +1 -0
- package/Forms/Checkbox/index.js +1 -0
- package/Forms/Checkbox/package.json +6 -0
- package/Forms/Feedback/Feedback.d.ts +5 -0
- package/Forms/Feedback/Feedback.js +9 -0
- package/Forms/Feedback/index.d.ts +1 -0
- package/Forms/Feedback/index.js +1 -0
- package/Forms/Feedback/package.json +6 -0
- package/Forms/Field/Field.d.ts +15 -0
- package/Forms/Field/Field.js +48 -0
- package/Forms/Field/FieldControl.d.ts +26 -0
- package/Forms/Field/FieldControl.js +47 -0
- package/Forms/Field/FieldHint.d.ts +1 -0
- package/Forms/Field/FieldHint.js +4 -0
- package/Forms/Field/index.d.ts +2 -0
- package/Forms/Field/index.js +2 -0
- package/Forms/Field/package.json +6 -0
- package/Forms/Input/Input.d.ts +9 -0
- package/Forms/Input/Input.js +17 -0
- package/Forms/Input/index.d.ts +1 -0
- package/Forms/Input/index.js +1 -0
- package/Forms/Input/package.json +6 -0
- package/Forms/InputGroup/InputGroup.d.ts +13 -0
- package/Forms/InputGroup/InputGroup.js +15 -0
- package/Forms/InputGroup/index.d.ts +1 -0
- package/Forms/InputGroup/index.js +1 -0
- package/Forms/InputGroup/package.json +6 -0
- package/Forms/Label/Label.d.ts +3 -0
- package/Forms/Label/Label.js +6 -0
- package/Forms/Label/index.d.ts +1 -0
- package/Forms/Label/index.js +1 -0
- package/Forms/Label/package.json +6 -0
- package/Forms/Password/Password.d.ts +5 -0
- package/Forms/Password/Password.js +17 -0
- package/Forms/Password/index.d.ts +1 -0
- package/Forms/Password/index.js +1 -0
- package/Forms/Password/package.json +6 -0
- package/Forms/Radio/Radio.d.ts +12 -0
- package/Forms/Radio/Radio.js +25 -0
- package/Forms/Radio/index.d.ts +1 -0
- package/Forms/Radio/index.js +1 -0
- package/Forms/Radio/package.json +6 -0
- package/Forms/Switch/Switch.d.ts +9 -0
- package/Forms/Switch/Switch.js +20 -0
- package/Forms/Switch/index.d.ts +1 -0
- package/Forms/Switch/index.js +1 -0
- package/Forms/Switch/package.json +6 -0
- package/Forms/Textarea/Textarea.d.ts +5 -0
- package/Forms/Textarea/Textarea.js +12 -0
- package/Forms/Textarea/TextareaRich.d.ts +6 -0
- package/Forms/Textarea/TextareaRich.js +28 -0
- package/Forms/Textarea/index.d.ts +2 -0
- package/Forms/Textarea/index.js +2 -0
- package/Forms/Textarea/package.json +6 -0
- package/Forms/Toggle/Toggle.d.ts +19 -0
- package/Forms/Toggle/Toggle.js +32 -0
- package/Forms/Toggle/index.d.ts +1 -0
- package/Forms/Toggle/index.js +1 -0
- package/Forms/Toggle/package.json +6 -0
- package/Forms/Toggle/useToggle.d.ts +46 -0
- package/Forms/Toggle/useToggle.js +145 -0
- package/Forms/antispam.d.ts +24 -0
- package/Forms/antispam.js +56 -0
- package/Forms/helpers.d.ts +26 -0
- package/Forms/helpers.js +45 -0
- package/Forms/index.d.ts +15 -0
- package/Forms/index.js +16 -0
- package/Forms/package.json +6 -0
- package/Forms/styles.d.ts +19 -0
- package/Forms/styles.js +29 -0
- package/Gauge/Gauge.d.ts +5 -0
- package/Gauge/Gauge.js +102 -0
- package/Grid/Grid.d.ts +64 -0
- package/Grid/Grid.js +53 -0
- package/Grid/index.d.ts +1 -0
- package/Grid/index.js +1 -0
- package/Grid/package.json +6 -0
- package/Hamburger/Hamburger.d.ts +6 -0
- package/Hamburger/Hamburger.js +52 -0
- package/Hamburger/index.d.ts +1 -0
- package/Hamburger/index.js +1 -0
- package/Hamburger/package.json +6 -0
- package/Header/index.d.ts +1 -0
- package/Header/index.js +1 -0
- package/Header/package.json +6 -0
- package/Header/useHeader.d.ts +24 -0
- package/Header/useHeader.js +30 -0
- package/Hidden/Hidden.d.ts +6 -0
- package/Hidden/Hidden.js +10 -0
- package/Hidden/index.d.ts +1 -0
- package/Hidden/index.js +1 -0
- package/Hidden/package.json +6 -0
- package/Img/index.d.ts +1 -0
- package/Img/index.js +1 -0
- package/Img/package.json +6 -0
- package/Img/sc/bare.d.ts +2 -0
- package/Img/sc/bare.js +39 -0
- package/Img/types.d.ts +9 -0
- package/Img/types.js +1 -0
- package/Link/Link.d.ts +5 -0
- package/Link/Link.js +4 -0
- package/Link/LinkBlank.d.ts +8 -0
- package/Link/LinkBlank.js +17 -0
- package/Link/index.d.ts +2 -0
- package/Link/index.js +2 -0
- package/Link/package.json +6 -0
- package/Menu/Menu.d.ts +1 -0
- package/Menu/Menu.js +4 -0
- package/Menu/index.d.ts +1 -0
- package/Menu/index.js +1 -0
- package/Menu/package.json +6 -0
- package/MenuItem/MenuItem.d.ts +4 -0
- package/MenuItem/MenuItem.js +4 -0
- package/MenuItem/index.d.ts +1 -0
- package/MenuItem/index.js +1 -0
- package/MenuItem/package.json +6 -0
- package/Meta/Meta.d.ts +14 -0
- package/Meta/Meta.js +5 -0
- package/Meta/index.d.ts +1 -0
- package/Meta/index.js +1 -0
- package/Meta/package.json +6 -0
- package/NoJs/NoJs.d.ts +2 -0
- package/NoJs/NoJs.js +6 -0
- package/NoJs/index.d.ts +1 -0
- package/NoJs/index.js +1 -0
- package/NoJs/package.json +6 -0
- package/Pagination/PaginationNav.d.ts +22 -0
- package/Pagination/PaginationNav.js +61 -0
- package/Pagination/PaginationResults.d.ts +3 -0
- package/Pagination/PaginationResults.js +11 -0
- package/Pagination/index.d.ts +2 -0
- package/Pagination/index.js +2 -0
- package/Pagination/package.json +6 -0
- package/Pill/Pill.d.ts +5 -0
- package/Pill/Pill.js +7 -0
- package/Pill/index.d.ts +1 -0
- package/Pill/index.js +1 -0
- package/Pill/package.json +6 -0
- package/Progress/ProgressCircular.d.ts +19 -0
- package/Progress/ProgressCircular.js +15 -0
- package/Progress/ProgressLinear.d.ts +22 -0
- package/Progress/ProgressLinear.js +24 -0
- package/Progress/ProgressOverlay.d.ts +4 -0
- package/Progress/ProgressOverlay.js +24 -0
- package/Progress/index.d.ts +3 -0
- package/Progress/index.js +3 -0
- package/Progress/package.json +6 -0
- package/Rating/Rating.d.ts +35 -0
- package/Rating/Rating.js +71 -0
- package/Rating/index.d.ts +11 -0
- package/Rating/index.js +49 -0
- package/Rating/package.json +6 -0
- package/Select/SelectDownshift.d.ts +5 -0
- package/Select/SelectDownshift.js +38 -0
- package/Select/components.d.ts +6 -0
- package/Select/components.js +12 -0
- package/Select/index.d.ts +2 -0
- package/Select/index.js +3 -0
- package/Select/package.json +6 -0
- package/Sidebar/Sidebar.d.ts +3 -0
- package/Sidebar/Sidebar.js +23 -0
- package/Sidebar/index.d.ts +1 -0
- package/Sidebar/index.js +1 -0
- package/Sidebar/package.json +6 -0
- package/Spacing/Spacing.d.ts +30 -0
- package/Spacing/Spacing.js +45 -0
- package/Spacing/index.d.ts +1 -0
- package/Spacing/index.js +1 -0
- package/Spacing/package.json +6 -0
- package/Sticky/Sticky.d.ts +2 -0
- package/Sticky/Sticky.js +219 -0
- package/Sticky/StickyCss.d.ts +5 -0
- package/Sticky/StickyCss.js +6 -0
- package/Sticky/index.d.ts +1 -0
- package/Sticky/index.js +1 -0
- package/Sticky/package.json +6 -0
- package/Tabs/TabsMui.d.ts +244 -0
- package/Tabs/TabsMui.js +46 -0
- package/Tabs/index.d.ts +1 -0
- package/Tabs/index.js +1 -0
- package/Tabs/package.json +6 -0
- package/Tabs/sc/bare.d.ts +5 -0
- package/Tabs/sc/bare.js +87 -0
- package/Tabs/tw/bare.d.ts +248 -0
- package/Tabs/tw/bare.js +17 -0
- package/Tabs/tw/material.d.ts +472 -0
- package/Tabs/tw/material.js +18 -0
- package/Tabs/useTabs.d.ts +43 -0
- package/Tabs/useTabs.js +44 -0
- package/Typography/CopyPasteVisible.d.ts +1 -0
- package/Typography/CopyPasteVisible.js +4 -0
- package/Typography/Native.d.ts +10 -0
- package/Typography/Native.js +14 -0
- package/Typography/ReadMore.d.ts +12 -0
- package/Typography/ReadMore.js +43 -0
- package/Typography/TextLoop.d.ts +16 -0
- package/Typography/TextLoop.js +46 -0
- package/Typography/TypeStairs.d.ts +6 -0
- package/Typography/TypeStairs.js +50 -0
- package/Typography/index.d.ts +5 -0
- package/Typography/index.js +5 -0
- package/Typography/package.json +6 -0
- package/css/index.d.ts +2 -0
- package/css/index.js +31 -0
- package/css/package.json +6 -0
- package/helpers/classed.d.ts +22 -0
- package/helpers/classed.js +68 -0
- package/helpers/extend-component.d.ts +28 -0
- package/helpers/extend-component.js +12 -0
- package/helpers/index.d.ts +3 -0
- package/helpers/index.js +2 -0
- package/helpers/package.json +6 -0
- package/hooks/index.d.ts +14 -0
- package/hooks/index.js +15 -0
- package/hooks/package.json +6 -0
- package/hooks/types.d.ts +8 -0
- package/hooks/types.js +1 -0
- package/hooks/useAsyncFn.d.ts +26 -0
- package/hooks/useAsyncFn.js +36 -0
- package/hooks/useDateLocale.d.ts +7 -0
- package/hooks/useDateLocale.js +38 -0
- package/hooks/useEffectOnce.d.ts +5 -0
- package/hooks/useEffectOnce.js +8 -0
- package/hooks/useFirstMountState.d.ts +4 -0
- package/hooks/useFirstMountState.js +12 -0
- package/hooks/useFocus.d.ts +4 -0
- package/hooks/useFocus.js +11 -0
- package/hooks/useId.d.ts +4 -0
- package/hooks/useId.js +8 -0
- package/hooks/useIsomorphicLayoutEffect.d.ts +5 -0
- package/hooks/useIsomorphicLayoutEffect.js +8 -0
- package/hooks/useMount.d.ts +4 -0
- package/hooks/useMount.js +9 -0
- package/hooks/useMountedState.d.ts +4 -0
- package/hooks/useMountedState.js +15 -0
- package/hooks/usePrevious.d.ts +1 -0
- package/hooks/usePrevious.js +8 -0
- package/hooks/useScrollPosition.d.ts +15 -0
- package/hooks/useScrollPosition.js +80 -0
- package/hooks/useScrollTo.d.ts +1 -0
- package/hooks/useScrollTo.js +21 -0
- package/hooks/useTraceUpdate.d.ts +4 -0
- package/hooks/useTraceUpdate.js +21 -0
- package/hooks/useUpdateEffect.d.ts +5 -0
- package/hooks/useUpdateEffect.js +14 -0
- package/hooks/useWindowSize.d.ts +1 -0
- package/hooks/useWindowSize.js +13 -0
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/m/MotionProvider.d.ts +37 -0
- package/m/MotionProvider.js +39 -0
- package/m/index.d.ts +6 -0
- package/m/index.js +6 -0
- package/m/lite.d.ts +2 -0
- package/m/lite.js +2 -0
- package/m/max.d.ts +2 -0
- package/m/max.js +2 -0
- package/m/package.json +6 -0
- package/package.json +6 -9
- package/sc/index.d.ts +30 -0
- package/sc/index.js +31 -0
- package/sc/package.json +6 -0
- package/scm/index.d.ts +29 -0
- package/scm/index.js +31 -0
- package/scm/package.json +6 -0
- package/shared/index.d.ts +8 -0
- package/shared/index.js +8 -0
- package/shared/package.json +6 -0
- package/styles/Body.d.ts +10 -0
- package/styles/Body.js +13 -0
- package/styles/Global.d.ts +15 -0
- package/styles/Global.js +18 -0
- package/styles/index.d.ts +7 -0
- package/styles/index.js +7 -0
- package/styles/media.d.ts +67 -0
- package/styles/media.js +155 -0
- package/styles/package.json +6 -0
- package/styles/spacing.d.ts +13 -0
- package/styles/spacing.js +45 -0
- package/styles/styled.d.ts +12 -0
- package/styles/styled.js +13 -0
- package/styles/theme--vanilla.d.ts +18 -0
- package/styles/theme--vanilla.js +55 -0
- package/styles/theme.d.ts +82 -0
- package/styles/theme.js +41 -0
- package/tw/index.d.ts +2 -0
- package/tw/index.js +31 -0
- package/tw/package.json +6 -0
- package/twm/index.d.ts +2 -0
- package/twm/index.js +31 -0
- package/twm/package.json +6 -0
- package/types.d.ts +10 -0
- package/types.js +1 -0
package/scm/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "../shared";
|
|
2
|
+
export * from "../Alert";
|
|
3
|
+
export * from "../Animations";
|
|
4
|
+
export * from "../Autocomplete";
|
|
5
|
+
export * from "../Bg";
|
|
6
|
+
export * from "../Breadcrumbs";
|
|
7
|
+
export * from "../Buttons";
|
|
8
|
+
export * from "../Carousel";
|
|
9
|
+
export * from "../Collapsable";
|
|
10
|
+
export * from "../Debug";
|
|
11
|
+
export { KoineDialog, type KoineDialogProps } from "../Dialog/sc/framer";
|
|
12
|
+
export * from "../Forms";
|
|
13
|
+
export * from "../Grid";
|
|
14
|
+
export * from "../Hamburger";
|
|
15
|
+
export * from "../Header";
|
|
16
|
+
export * from "../Hidden";
|
|
17
|
+
export * from "../Img";
|
|
18
|
+
export * from "../Link";
|
|
19
|
+
export * from "../MenuItem";
|
|
20
|
+
export * from "../Pagination";
|
|
21
|
+
export * from "../Pill";
|
|
22
|
+
export * from "../Progress";
|
|
23
|
+
export * from "../Rating";
|
|
24
|
+
export * from "../Sidebar";
|
|
25
|
+
export * from "../Spacing";
|
|
26
|
+
export * from "../Sticky";
|
|
27
|
+
export * from "../styles";
|
|
28
|
+
export * from "../Tabs";
|
|
29
|
+
export * from "../Typography";
|
package/scm/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from "../shared";
|
|
2
|
+
export * from "../Alert";
|
|
3
|
+
export * from "../Animations";
|
|
4
|
+
export * from "../Autocomplete";
|
|
5
|
+
export * from "../Bg";
|
|
6
|
+
export * from "../Breadcrumbs";
|
|
7
|
+
export * from "../Buttons";
|
|
8
|
+
export * from "../Carousel";
|
|
9
|
+
export * from "../Collapsable";
|
|
10
|
+
export * from "../Debug";
|
|
11
|
+
export { KoineDialog } from "../Dialog/sc/framer";
|
|
12
|
+
// export { KoineForm, type KoineFormProps} from "../Form/sc/framer";
|
|
13
|
+
export * from "../Forms";
|
|
14
|
+
export * from "../Grid";
|
|
15
|
+
export * from "../Hamburger";
|
|
16
|
+
export * from "../Header";
|
|
17
|
+
export * from "../Hidden";
|
|
18
|
+
export * from "../Img";
|
|
19
|
+
export * from "../Link";
|
|
20
|
+
export * from "../MenuItem";
|
|
21
|
+
export * from "../Pagination";
|
|
22
|
+
export * from "../Pill";
|
|
23
|
+
export * from "../Progress";
|
|
24
|
+
export * from "../Rating";
|
|
25
|
+
// export * from "../Select";
|
|
26
|
+
export * from "../Sidebar";
|
|
27
|
+
export * from "../Spacing";
|
|
28
|
+
export * from "../Sticky";
|
|
29
|
+
export * from "../styles";
|
|
30
|
+
export * from "../Tabs";
|
|
31
|
+
export * from "../Typography";
|
package/scm/package.json
ADDED
package/shared/index.js
ADDED
package/styles/Body.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const BodyRoot: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
/**
|
|
3
|
+
* If you have background graphics to overlap you might need to add:
|
|
4
|
+
*
|
|
5
|
+
* ```css
|
|
6
|
+
* z-index: 1;
|
|
7
|
+
* position: relative;
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export declare const BodyMain: import("styled-components").StyledComponent<"main", import("styled-components").DefaultTheme, {}, never>;
|
package/styles/Body.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
export var BodyRoot = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n"], ["\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n"])));
|
|
4
|
+
/**
|
|
5
|
+
* If you have background graphics to overlap you might need to add:
|
|
6
|
+
*
|
|
7
|
+
* ```css
|
|
8
|
+
* z-index: 1;
|
|
9
|
+
* position: relative;
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export var BodyMain = styled.main(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
|
|
13
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App global style
|
|
3
|
+
*
|
|
4
|
+
* For examples of what to do here take a look at [Bootstrap's reset](https://github.com/twbs/bootstrap/blob/main/scss/_reboot.scss)
|
|
5
|
+
* and similar.
|
|
6
|
+
*
|
|
7
|
+
* What we do here:
|
|
8
|
+
* - set the base font family on all possible elements including placeholders prevent Chrome showing a standard font when using the autofill feature
|
|
9
|
+
* - @see https://stackoverflow.com/a/60987373/1938970
|
|
10
|
+
* - set the base font size on all possible elements to prevent weird zooming on input fields on iPhone iOS devices.
|
|
11
|
+
* - @see https://www.warrenchandler.com/2019/04/02/stop-iphones-from-zooming-in-on-form-fields/
|
|
12
|
+
* - @see https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/
|
|
13
|
+
*/
|
|
14
|
+
export declare const stylesGlobal = "\n body {\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n\n body,\n button,\n input,\n textarea,\n select,\n select:-webkit-autofill::first-line,\n input:-webkit-autofill::first-line {\n font-family: var(--font), -apple-system, BlinkMacSystemFont, \"Segoe UI\",\n Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\",\n sans-serif;\n font-size: var(--fontSize);\n }\n\n html {\n box-sizing: border-box;\n @media (prefers-reduced-motion: no-preference) {\n scroll-behavior: smooth;\n }\n }\n\n *,\n *:before,\n *:after {\n box-sizing: inherit;\n -webkit-tap-highlight-color: transparent;\n }\n";
|
|
15
|
+
export declare const StylesGlobal: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
|
package/styles/Global.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import { createGlobalStyle } from "styled-components";
|
|
3
|
+
/**
|
|
4
|
+
* App global style
|
|
5
|
+
*
|
|
6
|
+
* For examples of what to do here take a look at [Bootstrap's reset](https://github.com/twbs/bootstrap/blob/main/scss/_reboot.scss)
|
|
7
|
+
* and similar.
|
|
8
|
+
*
|
|
9
|
+
* What we do here:
|
|
10
|
+
* - set the base font family on all possible elements including placeholders prevent Chrome showing a standard font when using the autofill feature
|
|
11
|
+
* - @see https://stackoverflow.com/a/60987373/1938970
|
|
12
|
+
* - set the base font size on all possible elements to prevent weird zooming on input fields on iPhone iOS devices.
|
|
13
|
+
* - @see https://www.warrenchandler.com/2019/04/02/stop-iphones-from-zooming-in-on-form-fields/
|
|
14
|
+
* - @see https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/
|
|
15
|
+
*/
|
|
16
|
+
export var stylesGlobal = "\n body {\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n\n body,\n button,\n input,\n textarea,\n select,\n select:-webkit-autofill::first-line,\n input:-webkit-autofill::first-line {\n font-family: var(--font), -apple-system, BlinkMacSystemFont, \"Segoe UI\",\n Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\",\n sans-serif;\n font-size: var(--fontSize);\n }\n\n html {\n box-sizing: border-box;\n @media (prefers-reduced-motion: no-preference) {\n scroll-behavior: smooth;\n }\n }\n\n *,\n *:before,\n *:after {\n box-sizing: inherit;\n -webkit-tap-highlight-color: transparent;\n }\n";
|
|
17
|
+
export var StylesGlobal = createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", ""], ["", ""])), stylesGlobal);
|
|
18
|
+
var templateObject_1;
|
package/styles/index.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Breakpoint, Breakpoints } from "./theme";
|
|
2
|
+
export declare const min: MediaQueryFunction, max: MediaQueryFunction, up: MediaQueryFunction, down: (br: Breakpoint) => string, between: (br1: Breakpoint, br2: Breakpoint) => string, only: (br: Breakpoint) => string;
|
|
3
|
+
export declare type MediaDirection = "min" | "max";
|
|
4
|
+
export declare type MediaQuery = `${MediaDirection}:${Breakpoint}`;
|
|
5
|
+
export declare type MediaQueryFunction = {
|
|
6
|
+
[Breakpoint in keyof Breakpoints]: string;
|
|
7
|
+
} & {
|
|
8
|
+
(breakpoint: Breakpoint): string;
|
|
9
|
+
};
|
|
10
|
+
export declare function useMedia(media: MediaQuery): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Generate media queries helpers
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* ```jsx
|
|
16
|
+
* import { generateMediaQueries } from "@koine/react";
|
|
17
|
+
*
|
|
18
|
+
* export const breakpoints = {
|
|
19
|
+
* xs: 0,
|
|
20
|
+
* sm: 440,
|
|
21
|
+
* md: 768,
|
|
22
|
+
* lg: 1024,
|
|
23
|
+
* xl: 1368,
|
|
24
|
+
* xxl: 1690,
|
|
25
|
+
* } as const;
|
|
26
|
+
*
|
|
27
|
+
* export const { min, max, up, down, between, only } = generateMediaQueries(breakpoints);
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Consider the following syntaxes, using normal CSS is just slightly
|
|
31
|
+
* longer but it aovid js imports, reduce the js overhead and improve CSS
|
|
32
|
+
* highlighting in the editor.
|
|
33
|
+
*
|
|
34
|
+
* Even if we would reduce the function signature to the bare minimum the advantage
|
|
35
|
+
* in terms of typing would not be much, also loosing in readability.
|
|
36
|
+
*
|
|
37
|
+
* ```css
|
|
38
|
+
* // but unfortunately this does not work
|
|
39
|
+
* @media (min-width: var(--b-sm)) {}
|
|
40
|
+
* @media (min-width: 480px) {}
|
|
41
|
+
*
|
|
42
|
+
* ${media("min", "sm")} {}
|
|
43
|
+
* ${mediaMin("sm")} {}
|
|
44
|
+
* ${min.sm} {}
|
|
45
|
+
* ${p => p.theme.min.sm}``
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* Related projects:
|
|
49
|
+
* @see https://github.com/mg901/styled-breakpoints
|
|
50
|
+
* @see https://github.com/morajabi/styled-media-query
|
|
51
|
+
*
|
|
52
|
+
* @see https://www.w3.org/TR/mediaqueries-5/#custom-mq The spec would allow for
|
|
53
|
+
* something like this syntax
|
|
54
|
+
*
|
|
55
|
+
* ```css
|
|
56
|
+
* @custom-media --narrow-window (max-width: 30em);
|
|
57
|
+
* @media (--narrow-window) {}
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function generateMediaQueries(breakpoints: Breakpoints): {
|
|
61
|
+
min: MediaQueryFunction;
|
|
62
|
+
max: MediaQueryFunction;
|
|
63
|
+
up: MediaQueryFunction;
|
|
64
|
+
down: (br: Breakpoint) => string;
|
|
65
|
+
between: (br1: Breakpoint, br2: Breakpoint) => string;
|
|
66
|
+
only: (br: Breakpoint) => string;
|
|
67
|
+
};
|
package/styles/media.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useTheme, breakpoints } from "./theme";
|
|
4
|
+
export var min = (_a = generateMediaQueries(breakpoints), _a.min), max = _a.max, up = _a.up, down = _a.down, between = _a.between, only = _a.only;
|
|
5
|
+
export function useMedia(media) {
|
|
6
|
+
var breakpoints = useTheme().breakpoints;
|
|
7
|
+
var _a = useState(false), matches = _a[0], setMatches = _a[1];
|
|
8
|
+
var _b = media.split(":"), _c = _b[0], direction = _c === void 0 ? "min" : _c, breakpoint = _b[1];
|
|
9
|
+
var px = breakpoints[breakpoint];
|
|
10
|
+
if (direction === "max") {
|
|
11
|
+
px = px - 0.02;
|
|
12
|
+
}
|
|
13
|
+
var query = "(".concat(direction, "-width: ").concat(px, "px)");
|
|
14
|
+
useEffect(function () {
|
|
15
|
+
var mq = window.matchMedia(query);
|
|
16
|
+
var handleChange = function (event) {
|
|
17
|
+
setMatches(event.matches);
|
|
18
|
+
};
|
|
19
|
+
setMatches(mq.matches);
|
|
20
|
+
// Safari < 14 can't use addEventListener on a MediaQueryList
|
|
21
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#Browser_compatibility
|
|
22
|
+
if (!mq.addEventListener) {
|
|
23
|
+
// Update the state whenever the media query match state changes
|
|
24
|
+
mq.addListener(handleChange);
|
|
25
|
+
// Clean up on unmount and if the query changes
|
|
26
|
+
return function () {
|
|
27
|
+
mq.removeListener(handleChange);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
mq.addEventListener("change", handleChange);
|
|
31
|
+
return function () {
|
|
32
|
+
mq.removeEventListener("change", handleChange);
|
|
33
|
+
};
|
|
34
|
+
}, [query]);
|
|
35
|
+
return matches;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Generate media queries helpers
|
|
39
|
+
*
|
|
40
|
+
* Usage:
|
|
41
|
+
* ```jsx
|
|
42
|
+
* import { generateMediaQueries } from "@koine/react";
|
|
43
|
+
*
|
|
44
|
+
* export const breakpoints = {
|
|
45
|
+
* xs: 0,
|
|
46
|
+
* sm: 440,
|
|
47
|
+
* md: 768,
|
|
48
|
+
* lg: 1024,
|
|
49
|
+
* xl: 1368,
|
|
50
|
+
* xxl: 1690,
|
|
51
|
+
* } as const;
|
|
52
|
+
*
|
|
53
|
+
* export const { min, max, up, down, between, only } = generateMediaQueries(breakpoints);
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* Consider the following syntaxes, using normal CSS is just slightly
|
|
57
|
+
* longer but it aovid js imports, reduce the js overhead and improve CSS
|
|
58
|
+
* highlighting in the editor.
|
|
59
|
+
*
|
|
60
|
+
* Even if we would reduce the function signature to the bare minimum the advantage
|
|
61
|
+
* in terms of typing would not be much, also loosing in readability.
|
|
62
|
+
*
|
|
63
|
+
* ```css
|
|
64
|
+
* // but unfortunately this does not work
|
|
65
|
+
* @media (min-width: var(--b-sm)) {}
|
|
66
|
+
* @media (min-width: 480px) {}
|
|
67
|
+
*
|
|
68
|
+
* ${media("min", "sm")} {}
|
|
69
|
+
* ${mediaMin("sm")} {}
|
|
70
|
+
* ${min.sm} {}
|
|
71
|
+
* ${p => p.theme.min.sm}``
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* Related projects:
|
|
75
|
+
* @see https://github.com/mg901/styled-breakpoints
|
|
76
|
+
* @see https://github.com/morajabi/styled-media-query
|
|
77
|
+
*
|
|
78
|
+
* @see https://www.w3.org/TR/mediaqueries-5/#custom-mq The spec would allow for
|
|
79
|
+
* something like this syntax
|
|
80
|
+
*
|
|
81
|
+
* ```css
|
|
82
|
+
* @custom-media --narrow-window (max-width: 30em);
|
|
83
|
+
* @media (--narrow-window) {}
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export function generateMediaQueries(breakpoints) {
|
|
87
|
+
var temp = Object.keys(breakpoints).map(function (key) {
|
|
88
|
+
var br = key;
|
|
89
|
+
return [br, breakpoints[br]];
|
|
90
|
+
});
|
|
91
|
+
var sortedKeys = temp.sort(function (a, b) { return a[1] - b[1]; }).map(function (item) { return item[0]; });
|
|
92
|
+
var getNext = function (breakpoint) {
|
|
93
|
+
var index = sortedKeys.indexOf(breakpoint);
|
|
94
|
+
return sortedKeys[index + 1];
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* It behaves the same as `@media (min-width: ${value}px)`
|
|
98
|
+
* where value is the given breakpoint value.
|
|
99
|
+
* For ease of use this can be used both as a function `min("md")` and as an
|
|
100
|
+
* object literal `min.md`.
|
|
101
|
+
*/ // @ts-expect-error FIXME: at some point
|
|
102
|
+
var min = function (br) {
|
|
103
|
+
return "@media (min-width: ".concat(breakpoints[br], "px)");
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* It behaves the same as `@media (max-width: ${value}px)`
|
|
107
|
+
* where value is the given breakpoint value.
|
|
108
|
+
* For ease of use this can be used both as a function `max("md")` and as an
|
|
109
|
+
* object literal `max.md`.
|
|
110
|
+
*/ // @ts-expect-error FIXME: at some point
|
|
111
|
+
var max = function (br) {
|
|
112
|
+
return "@media (max-width: ".concat(breakpoints[br] - 0.02, "px)");
|
|
113
|
+
};
|
|
114
|
+
for (var br in breakpoints) {
|
|
115
|
+
var _br = br;
|
|
116
|
+
min[_br] = "@media (min-width: ".concat(breakpoints[_br], "px)");
|
|
117
|
+
max[_br] = "@media (max-width: ".concat(breakpoints[_br] - 0.02, "px)");
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* It behaves the same as `min`
|
|
121
|
+
* @inheritdoc {max}
|
|
122
|
+
*/
|
|
123
|
+
var up = min;
|
|
124
|
+
/**
|
|
125
|
+
* It behaves similarly to `max` but you will use the "next" breakpoint,
|
|
126
|
+
* specifying CSS that will apply from the given breakpoint and down.
|
|
127
|
+
*/
|
|
128
|
+
var down = function (br) {
|
|
129
|
+
var brNext = getNext(br);
|
|
130
|
+
// TODO: if br does not exists otherwise throw Error
|
|
131
|
+
return brNext && "@media (max-width: ".concat(breakpoints[brNext] - 0.02, "px)");
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Media query between the two given breakpoints
|
|
135
|
+
*/
|
|
136
|
+
var between = function (br1, br2) {
|
|
137
|
+
return "@media (min-width: ".concat(breakpoints[br1], "px) and (max-width: ").concat(breakpoints[br2] - 0.02, "px)");
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Media query to apply from the given breakpoint until the next, just for its
|
|
141
|
+
* full range
|
|
142
|
+
*/
|
|
143
|
+
var only = function (br) {
|
|
144
|
+
var brNext = getNext(br);
|
|
145
|
+
return brNext ? between(br, brNext) : min(br);
|
|
146
|
+
};
|
|
147
|
+
return {
|
|
148
|
+
min: min,
|
|
149
|
+
max: max,
|
|
150
|
+
up: up,
|
|
151
|
+
down: down,
|
|
152
|
+
between: between,
|
|
153
|
+
only: only,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Theme } from "./theme";
|
|
2
|
+
export declare type SpacingSize = "sm" | "md" | "lg";
|
|
3
|
+
export declare type SpacingProperty = "padding" | "margin";
|
|
4
|
+
/** @default 1 */
|
|
5
|
+
export declare type SpacingFactor = number;
|
|
6
|
+
export declare type SpacingDirection = "top" | "bottom";
|
|
7
|
+
export declare type SpacingDirectionAxis = "vertical" | SpacingDirection;
|
|
8
|
+
export declare type SpacingDevices = keyof Theme["devices"];
|
|
9
|
+
export declare type SpacingArgs = Parameters<typeof spacing>;
|
|
10
|
+
export declare function spacing(this: Theme, size?: SpacingSize, factor?: SpacingFactor, property?: SpacingProperty, direction?: SpacingDirectionAxis, devices?: SpacingDevices[]): string;
|
|
11
|
+
export declare function spacingTop(this: Theme, size?: SpacingSize, factor?: SpacingFactor, property?: SpacingProperty, devices?: SpacingDevices[]): string;
|
|
12
|
+
export declare function spacingBottom(this: Theme, size?: SpacingSize, factor?: SpacingFactor, property?: SpacingProperty, devices?: SpacingDevices[]): string;
|
|
13
|
+
export declare function spacingVertical(this: Theme, size?: SpacingSize, factor?: SpacingFactor, property?: SpacingProperty, devices?: SpacingDevices[]): string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
function _spacing(theme, size, factor, property, direction, devices) {
|
|
2
|
+
if (size === void 0) { size = "md"; }
|
|
3
|
+
if (factor === void 0) { factor = 1; }
|
|
4
|
+
if (property === void 0) { property = "padding"; }
|
|
5
|
+
if (direction === void 0) { direction = "top"; }
|
|
6
|
+
if (devices === void 0) { devices = ["mobile", "tablet", "desktop"]; }
|
|
7
|
+
var breakpoints = theme.breakpoints, DEVICES = theme.devices, SPACES = theme.spaces;
|
|
8
|
+
var css = "";
|
|
9
|
+
var prop = "".concat(property, "-").concat(direction);
|
|
10
|
+
if (!devices.length || devices[0] === "mobile") {
|
|
11
|
+
css += "@media(max-width: ".concat(breakpoints[DEVICES.mobile], "px){\n ").concat(prop, ": ").concat(SPACES["mobile"][size] * factor, "px;\n }");
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
for (var index = 0; index < devices.length; index++) {
|
|
15
|
+
var device = devices[index];
|
|
16
|
+
if (device === "mobile") {
|
|
17
|
+
css += "".concat(prop, ": ").concat(SPACES[device][size] * factor, "px;");
|
|
18
|
+
}
|
|
19
|
+
else if (device === "tablet") {
|
|
20
|
+
css += "@media(min-width: ".concat(breakpoints[DEVICES.tablet], "px){\n ").concat(prop, ": ").concat(SPACES["tablet"][size] * factor, "px;\n }");
|
|
21
|
+
}
|
|
22
|
+
else if (device === "desktop") {
|
|
23
|
+
css += "@media(min-width: ".concat(breakpoints[DEVICES.desktop], "px){\n ").concat(prop, ": ").concat(SPACES["desktop"][size] * factor, "px;\n }");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return css;
|
|
28
|
+
}
|
|
29
|
+
export function spacing(size, factor, property, direction, devices) {
|
|
30
|
+
if (direction === "vertical") {
|
|
31
|
+
return (_spacing(this, size, factor, property, "top", devices) +
|
|
32
|
+
_spacing(this, size, factor, property, "bottom", devices));
|
|
33
|
+
}
|
|
34
|
+
return _spacing(this, size, factor, property, direction, devices);
|
|
35
|
+
}
|
|
36
|
+
export function spacingTop(size, factor, property, devices) {
|
|
37
|
+
return _spacing(this, size, factor, property, "top", devices);
|
|
38
|
+
}
|
|
39
|
+
export function spacingBottom(size, factor, property, devices) {
|
|
40
|
+
return _spacing(this, size, factor, property, "bottom", devices);
|
|
41
|
+
}
|
|
42
|
+
export function spacingVertical(size, factor, property, devices) {
|
|
43
|
+
return (_spacing(this, size, factor, property, "top", devices) +
|
|
44
|
+
_spacing(this, size, factor, property, "bottom", devices));
|
|
45
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function colStretch(direction: "left" | "right", bg: React.CSSProperties["background"]): string;
|
|
3
|
+
/** @see https://caniuse.com/?search=inset */
|
|
4
|
+
export declare const inset0 = "top:0;left:0;right:0;bottom:0;";
|
|
5
|
+
export declare const overlay: string;
|
|
6
|
+
export declare const centered = "display: flex;align-items: center;justify-content: center;";
|
|
7
|
+
export declare const ellipsis = "overflow: hidden;text-overflow: ellipsis;white-space: nowrap;";
|
|
8
|
+
/**
|
|
9
|
+
* @see import("@mui/utils").visuallyHidden https://github.com/mui-org/material-ui/blob/master/packages/mui-utils/src/visuallyHidden.ts
|
|
10
|
+
*/
|
|
11
|
+
export declare const invisible = "border: 0;clip: rect(0 0 0 0);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;white-space: nowrap;width: 1px;";
|
|
12
|
+
export declare const stateFocus = "outline: 0px;box-shadow: 0 0 0 0.2rem rgba(200, 200, 200, 0.25);";
|
package/styles/styled.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function colStretch(direction, bg) {
|
|
2
|
+
return "\n background: ".concat(bg, ";\n position: relative;\n\n &:before{\n z-index: -1;\n content: '';\n position: absolute;\n right: ").concat(direction === "left" ? "100%" : "-100vw", ";\n left: ").concat(direction === "right" ? "100%" : "-100vw", ";\n top: 0;\n bottom: 0;\n background: ").concat(bg, ";\n }\n ");
|
|
3
|
+
}
|
|
4
|
+
/** @see https://caniuse.com/?search=inset */
|
|
5
|
+
export var inset0 = "top:0;left:0;right:0;bottom:0;";
|
|
6
|
+
export var overlay = "position: absolute;".concat(inset0);
|
|
7
|
+
export var centered = "display: flex;align-items: center;justify-content: center;";
|
|
8
|
+
export var ellipsis = "overflow: hidden;text-overflow: ellipsis;white-space: nowrap;";
|
|
9
|
+
/**
|
|
10
|
+
* @see import("@mui/utils").visuallyHidden https://github.com/mui-org/material-ui/blob/master/packages/mui-utils/src/visuallyHidden.ts
|
|
11
|
+
*/
|
|
12
|
+
export var invisible = "border: 0;clip: rect(0 0 0 0);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;white-space: nowrap;width: 1px;";
|
|
13
|
+
export var stateFocus = "outline: 0px;box-shadow: 0 0 0 0.2rem rgba(200, 200, 200, 0.25);";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const THEME_KEY = "theme";
|
|
3
|
+
export declare const THEME_DEFAULT: ThemeVanillaValue;
|
|
4
|
+
export declare const getInitialThemeFromRequest: (cookie?: string | undefined) => ThemeVanillaValue;
|
|
5
|
+
export declare const getInitialThemeFromClient: () => ThemeVanillaValue;
|
|
6
|
+
export declare type ThemeCookie = {
|
|
7
|
+
[THEME_KEY]: ThemeVanillaValue;
|
|
8
|
+
};
|
|
9
|
+
export declare type ThemeVanillaValue = "light" | "dark";
|
|
10
|
+
export declare type ThemeVanillaContextType = {
|
|
11
|
+
theme: ThemeVanillaValue;
|
|
12
|
+
setTheme?: React.Dispatch<React.SetStateAction<ThemeVanillaValue>>;
|
|
13
|
+
};
|
|
14
|
+
export declare const ThemeVanillaContext: import("react").Context<ThemeVanillaContextType>;
|
|
15
|
+
export declare type ThemeVanillaProviderProps = React.PropsWithChildren<{
|
|
16
|
+
initialTheme: ThemeVanillaValue;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const ThemeVanillaProvider: ({ initialTheme, children, }: ThemeVanillaProviderProps) => JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useState } from "react";
|
|
4
|
+
import { isBrowser, setCookie, parseCookie } from "@koine/utils";
|
|
5
|
+
import { useMount, useUpdateEffect } from "../hooks";
|
|
6
|
+
export var THEME_KEY = "theme";
|
|
7
|
+
export var THEME_DEFAULT = "light";
|
|
8
|
+
export var getInitialThemeFromRequest = function (cookie) {
|
|
9
|
+
if (cookie) {
|
|
10
|
+
var parsed = parseCookie(cookie);
|
|
11
|
+
return parsed === null || parsed === void 0 ? void 0 : parsed.theme;
|
|
12
|
+
}
|
|
13
|
+
return THEME_DEFAULT;
|
|
14
|
+
};
|
|
15
|
+
export var getInitialThemeFromClient = function () {
|
|
16
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
17
|
+
var storedPrefs = window.localStorage.getItem(THEME_KEY);
|
|
18
|
+
if (typeof storedPrefs === "string") {
|
|
19
|
+
return storedPrefs;
|
|
20
|
+
}
|
|
21
|
+
var userMedia = window.matchMedia("(prefers-color-scheme: dark)");
|
|
22
|
+
if (userMedia.matches) {
|
|
23
|
+
return "dark";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return THEME_DEFAULT;
|
|
27
|
+
};
|
|
28
|
+
export var ThemeVanillaContext = createContext({
|
|
29
|
+
theme: "light",
|
|
30
|
+
setTheme: undefined,
|
|
31
|
+
});
|
|
32
|
+
export var ThemeVanillaProvider = function (_a) {
|
|
33
|
+
var initialTheme = _a.initialTheme, children = _a.children;
|
|
34
|
+
var _b = useState(initialTheme), theme = _b[0], setTheme = _b[1];
|
|
35
|
+
var rawSetTheme = function (rawTheme) {
|
|
36
|
+
if (!rawTheme || !isBrowser) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
var root = window.document.documentElement;
|
|
40
|
+
var isDark = rawTheme === "dark";
|
|
41
|
+
root.classList.remove(isDark ? "light" : "dark");
|
|
42
|
+
root.classList.add(rawTheme);
|
|
43
|
+
localStorage.setItem(THEME_KEY, rawTheme);
|
|
44
|
+
setCookie(THEME_KEY, rawTheme);
|
|
45
|
+
};
|
|
46
|
+
useMount(function () {
|
|
47
|
+
var theme = getInitialThemeFromClient();
|
|
48
|
+
setTheme(theme);
|
|
49
|
+
rawSetTheme(theme);
|
|
50
|
+
});
|
|
51
|
+
useUpdateEffect(function () {
|
|
52
|
+
rawSetTheme(theme);
|
|
53
|
+
}, [theme]);
|
|
54
|
+
return (_jsx(ThemeVanillaContext.Provider, __assign({ value: { theme: theme, setTheme: setTheme } }, { children: children })));
|
|
55
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
2
|
+
export declare type Breakpoints = Record<Breakpoint, number>;
|
|
3
|
+
/**
|
|
4
|
+
* You can override the default breakpoints through the .env variable
|
|
5
|
+
*
|
|
6
|
+
* FIXME: find a better way to configure it, the problem is that we use the media
|
|
7
|
+
* queries within this pre-compiled library and thrught it was better to avoid
|
|
8
|
+
* using theming props for a more ergonomic usage.
|
|
9
|
+
*
|
|
10
|
+
* ```.env
|
|
11
|
+
* BREAKPOINTS=xs:0,sm:440,md:768,lg:1024,xl:1368,xxl:1690
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const breakpoints: Breakpoints;
|
|
15
|
+
export declare const createTheme: (options: ThemeOptions) => Theme;
|
|
16
|
+
export declare const useTheme: () => Theme;
|
|
17
|
+
export declare type Theme = {
|
|
18
|
+
maxWidth: number;
|
|
19
|
+
gutter: {
|
|
20
|
+
quarter: number;
|
|
21
|
+
third: number;
|
|
22
|
+
half: number;
|
|
23
|
+
/** @default 60 */
|
|
24
|
+
normal: number;
|
|
25
|
+
double: number;
|
|
26
|
+
triple: number;
|
|
27
|
+
};
|
|
28
|
+
breakpoints: Breakpoints;
|
|
29
|
+
devices: {
|
|
30
|
+
/** @default "sm" */
|
|
31
|
+
mobile: keyof Breakpoints;
|
|
32
|
+
/** @default "md" */
|
|
33
|
+
tablet: keyof Breakpoints;
|
|
34
|
+
/** @default "lg" */
|
|
35
|
+
desktop: keyof Breakpoints;
|
|
36
|
+
};
|
|
37
|
+
spaces: {
|
|
38
|
+
mobile: {
|
|
39
|
+
/** @default 10 */
|
|
40
|
+
sm: number;
|
|
41
|
+
/** @default 20 */
|
|
42
|
+
md: number;
|
|
43
|
+
/** @default 40 */
|
|
44
|
+
lg: number;
|
|
45
|
+
};
|
|
46
|
+
tablet: {
|
|
47
|
+
/** @default 15 */
|
|
48
|
+
sm: number;
|
|
49
|
+
/** @default 30 */
|
|
50
|
+
md: number;
|
|
51
|
+
/** @default 60 */
|
|
52
|
+
lg: number;
|
|
53
|
+
};
|
|
54
|
+
desktop: {
|
|
55
|
+
/** @default 20 */
|
|
56
|
+
sm: number;
|
|
57
|
+
/** @default 40 */
|
|
58
|
+
md: number;
|
|
59
|
+
/** @default 80 */
|
|
60
|
+
lg: number;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
header: {
|
|
64
|
+
/** @default "lg" */
|
|
65
|
+
breakpoint: keyof Breakpoints;
|
|
66
|
+
/** @default [82, 134] */
|
|
67
|
+
height: [number, number];
|
|
68
|
+
/** @default [60, 90] */
|
|
69
|
+
heightSticky: [number, number];
|
|
70
|
+
/** @default [76, 76] */
|
|
71
|
+
logoWidth: [number, number];
|
|
72
|
+
/** @default [70, 70] */
|
|
73
|
+
logoWidthSticky: [number, number];
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare type ThemeOptions = {
|
|
77
|
+
maxWidth?: number;
|
|
78
|
+
gutter: NonNullable<Theme["gutter"]>;
|
|
79
|
+
devices?: Theme["devices"];
|
|
80
|
+
spaces: NonNullable<Theme["spaces"]>;
|
|
81
|
+
header: NonNullable<Theme["header"]>;
|
|
82
|
+
};
|