@koine/react 2.0.0-beta.10 → 2.0.0-beta.12

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.
Files changed (216) hide show
  1. package/package.json +11 -11
  2. package/Alert/Alert.js +0 -33
  3. package/Alert/Alert.stories.js +0 -39
  4. package/Alert/index.js +0 -6
  5. package/Animations/Reveal.js +0 -53
  6. package/Animations/Underline.js +0 -26
  7. package/Animations/index.js +0 -8
  8. package/Animations/useReveal.js +0 -83
  9. package/Autocomplete/AutocompleteDownshift.js +0 -167
  10. package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -362
  11. package/Autocomplete/AutocompleteMui.js +0 -183
  12. package/Autocomplete/AutocompleteReach.js +0 -121
  13. package/Autocomplete/components.js +0 -132
  14. package/Autocomplete/helpers.js +0 -34
  15. package/Autocomplete/index.js +0 -15
  16. package/Bg/BgColor.js +0 -64
  17. package/Bg/BgPhoto.js +0 -82
  18. package/Bg/BgSvg.js +0 -31
  19. package/Bg/index.js +0 -8
  20. package/Breadcrumbs/Breadcrumbs.js +0 -103
  21. package/Breadcrumbs/index.js +0 -6
  22. package/Buttons/Button.js +0 -106
  23. package/Buttons/ButtonComposite.js +0 -116
  24. package/Buttons/ButtonFab.js +0 -27
  25. package/Buttons/ButtonLink.js +0 -29
  26. package/Buttons/IconButton.js +0 -41
  27. package/Buttons/index.js +0 -10
  28. package/Calendar/CalendarDaygridCell.js +0 -105
  29. package/Calendar/CalendarDaygridNav.js +0 -63
  30. package/Calendar/CalendarDaygridTable.js +0 -126
  31. package/Calendar/CalendarLegend.js +0 -39
  32. package/Calendar/calendar-api-google.js +0 -110
  33. package/Calendar/index.js +0 -11
  34. package/Calendar/types.js +0 -4
  35. package/Calendar/useCalendar.js +0 -235
  36. package/Calendar/utils.js +0 -252
  37. package/Carousel/Carousel.js +0 -387
  38. package/Carousel/CarouselCss.js +0 -64
  39. package/Carousel/index.js +0 -6
  40. package/Collapsable/Collapsable.js +0 -11
  41. package/Collapsable/CollapsableReach.js +0 -251
  42. package/Collapsable/index.js +0 -7
  43. package/Debug/Debug.js +0 -34
  44. package/Debug/index.js +0 -6
  45. package/Details/Details.js +0 -117
  46. package/Details/Details.stories.js +0 -39
  47. package/Details/index.js +0 -6
  48. package/Dialog/DialogMui.js +0 -143
  49. package/Dialog/DialogMui.stories.js +0 -38
  50. package/Dialog/css/bare.js +0 -55
  51. package/Dialog/css/index.stories.js +0 -93
  52. package/Dialog/index.js +0 -11
  53. package/Dialog/m/bare.js +0 -125
  54. package/Dialog/m/basic.js +0 -50
  55. package/Dialog/m/index.js +0 -14
  56. package/Dialog/sc/bare.js +0 -83
  57. package/Dialog/sc/framer.js +0 -26
  58. package/Dialog/sc/framerMaterial.js +0 -26
  59. package/Dialog/sc/index.stories.js +0 -75
  60. package/Dialog/sc/material.js +0 -78
  61. package/Dialog/tw/bare.js +0 -55
  62. package/Dialog/tw/elegant.js +0 -54
  63. package/Dialog/tw/framer.js +0 -26
  64. package/Dialog/tw/framerMaterial.js +0 -26
  65. package/Dialog/tw/index.stories.js +0 -113
  66. package/Dialog/tw/material.js +0 -54
  67. package/Editor/Editor--tiptap.js +0 -72
  68. package/Editor/components.js +0 -59
  69. package/Editor/index.js +0 -6
  70. package/FaviconTags.js +0 -73
  71. package/Form/Form.js +0 -130
  72. package/Form/index.js +0 -6
  73. package/Form/sc/bare.js +0 -55
  74. package/Forms/Checkbox/Checkbox.js +0 -62
  75. package/Forms/Checkbox/index.js +0 -6
  76. package/Forms/Feedback/Feedback.js +0 -25
  77. package/Forms/Feedback/index.js +0 -6
  78. package/Forms/Field/Field.js +0 -75
  79. package/Forms/Field/FieldControl.js +0 -69
  80. package/Forms/Field/FieldHint.js +0 -17
  81. package/Forms/Field/index.js +0 -7
  82. package/Forms/Input/Input.js +0 -67
  83. package/Forms/Input/index.js +0 -6
  84. package/Forms/InputGroup/InputGroup.js +0 -85
  85. package/Forms/InputGroup/index.js +0 -6
  86. package/Forms/Label/Label.js +0 -46
  87. package/Forms/Label/index.js +0 -6
  88. package/Forms/Password/Password.js +0 -72
  89. package/Forms/Password/index.js +0 -6
  90. package/Forms/Radio/Radio.js +0 -68
  91. package/Forms/Radio/index.js +0 -6
  92. package/Forms/Switch/Switch.js +0 -80
  93. package/Forms/Switch/index.js +0 -6
  94. package/Forms/Textarea/Textarea.js +0 -45
  95. package/Forms/Textarea/TextareaRich.js +0 -58
  96. package/Forms/Textarea/index.js +0 -7
  97. package/Forms/Toggle/Toggle-tailwind.js +0 -99
  98. package/Forms/Toggle/Toggle.js +0 -175
  99. package/Forms/Toggle/index.js +0 -6
  100. package/Forms/Toggle/useToggle-tailwind.js +0 -202
  101. package/Forms/Toggle/useToggle.js +0 -145
  102. package/Forms/antispam.js +0 -59
  103. package/Forms/helpers.js +0 -72
  104. package/Forms/index.js +0 -19
  105. package/Forms/styles.js +0 -94
  106. package/Gauge/Gauge.js +0 -111
  107. package/Grid/Grid.js +0 -106
  108. package/Grid/index.js +0 -6
  109. package/Hamburger/Hamburger.js +0 -90
  110. package/Hamburger/index.js +0 -6
  111. package/Header/index.js +0 -6
  112. package/Header/useHeader.js +0 -54
  113. package/Hidden/Hidden.js +0 -21
  114. package/Hidden/index.js +0 -6
  115. package/Img/index.js +0 -6
  116. package/Img/sc/bare.js +0 -43
  117. package/Img/types.js +0 -6
  118. package/Link/Link.js +0 -13
  119. package/Link/LinkBlank.js +0 -52
  120. package/Link/index.js +0 -7
  121. package/Menu/Menu.js +0 -22
  122. package/Menu/MenuMui.js +0 -165
  123. package/Menu/index.js +0 -6
  124. package/MenuItem/MenuItem.js +0 -31
  125. package/MenuItem/MenuItemMui.js +0 -32
  126. package/MenuItem/index.js +0 -6
  127. package/MenuItem/useMenuItem.js +0 -96
  128. package/Meta/Meta.js +0 -26
  129. package/Meta/index.js +0 -12
  130. package/NoJs/NoJs.js +0 -28
  131. package/NoJs/index.js +0 -12
  132. package/Pagination/PaginationNav.js +0 -126
  133. package/Pagination/PaginationResults.js +0 -45
  134. package/Pagination/index.js +0 -7
  135. package/Pill/Pill.js +0 -62
  136. package/Pill/index.js +0 -6
  137. package/Progress/ProgressCircular.js +0 -62
  138. package/Progress/ProgressLinear.js +0 -53
  139. package/Progress/ProgressOverlay.js +0 -75
  140. package/Progress/index.js +0 -8
  141. package/Rating/Rating.js +0 -188
  142. package/Rating/index.js +0 -85
  143. package/Select/SelectDownshift.js +0 -47
  144. package/Select/components.js +0 -44
  145. package/Select/index.js +0 -13
  146. package/Sidebar/Sidebar.js +0 -74
  147. package/Sidebar/index.js +0 -6
  148. package/Spacing/Spacing.js +0 -55
  149. package/Spacing/index.js +0 -6
  150. package/Sticky/Sticky.js +0 -228
  151. package/Sticky/StickyCss.js +0 -20
  152. package/Sticky/index.js +0 -19
  153. package/Tabs/TabsMui.js +0 -91
  154. package/Tabs/TabsMui.stories.js +0 -38
  155. package/Tabs/index.js +0 -6
  156. package/Tabs/sc/bare.js +0 -86
  157. package/Tabs/sc/index.stories.js +0 -1
  158. package/Tabs/tw/bare.js +0 -45
  159. package/Tabs/tw/index.stories.js +0 -46
  160. package/Tabs/tw/material.js +0 -44
  161. package/Tabs/useTabs.js +0 -66
  162. package/Typography/CopyPasteVisible.js +0 -17
  163. package/Typography/Native.js +0 -90
  164. package/Typography/ReadMore.js +0 -125
  165. package/Typography/TextLoop.js +0 -108
  166. package/Typography/TypeStairs.js +0 -71
  167. package/Typography/index.js +0 -10
  168. package/css/index.js +0 -33
  169. package/helpers/classed.js +0 -66
  170. package/helpers/classed.stories.js +0 -140
  171. package/helpers/createUseMediaQueryWidth.js +0 -193
  172. package/helpers/extend-component.js +0 -32
  173. package/helpers/index.js +0 -9
  174. package/helpers/mergeRefs.js +0 -30
  175. package/hooks/index.js +0 -92
  176. package/hooks/types.js +0 -6
  177. package/hooks/useAsyncFn.js +0 -56
  178. package/hooks/useDateLocale.js +0 -51
  179. package/hooks/useFirstMountState.js +0 -28
  180. package/hooks/useFixedOffset.js +0 -67
  181. package/hooks/useFocus.js +0 -30
  182. package/hooks/useInterval.js +0 -44
  183. package/hooks/useIsomorphicLayoutEffect.js +0 -23
  184. package/hooks/useKeyUp.js +0 -40
  185. package/hooks/useMeasure.js +0 -189
  186. package/hooks/useMountedState.js +0 -31
  187. package/hooks/useNavigateAway.js +0 -69
  188. package/hooks/usePrevious.js +0 -33
  189. package/hooks/usePreviousRef.js +0 -27
  190. package/hooks/useScrollPosition.js +0 -83
  191. package/hooks/useScrollThreshold.js +0 -52
  192. package/hooks/useScrollTo.js +0 -39
  193. package/hooks/useSmoothScroll.js +0 -49
  194. package/hooks/useSpinDelay.js +0 -59
  195. package/hooks/useTraceUpdate.js +0 -39
  196. package/hooks/useUpdateEffect.js +0 -30
  197. package/hooks/useWindowSize.js +0 -43
  198. package/index.js +0 -10
  199. package/m/MotionProvider.js +0 -27
  200. package/m/index.js +0 -10
  201. package/m/lite.js +0 -12
  202. package/m/max.js +0 -12
  203. package/sc/index.js +0 -49
  204. package/scm/index.js +0 -40
  205. package/shared/index.js +0 -13
  206. package/styles/Body.js +0 -28
  207. package/styles/Global.js +0 -55
  208. package/styles/index.js +0 -142
  209. package/styles/media.js +0 -139
  210. package/styles/spacing.js +0 -70
  211. package/styles/styled.js +0 -58
  212. package/styles/theme--vanilla.js +0 -82
  213. package/styles/theme.js +0 -49
  214. package/tw/index.js +0 -33
  215. package/twm/index.js +0 -33
  216. package/types.js +0 -4
package/Tabs/useTabs.js DELETED
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- useTabs: function() {
13
- return useTabs;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
21
- const _useControlled = /*#__PURE__*/ _interop_require_default._(require("@mui/utils/useControlled"));
22
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
23
- const useTabs = (props)=>{
24
- const { value: valueProp, defaultValue, onChange, orientation, direction, selectionFollowsFocus } = props;
25
- const [value, setValue] = (0, _useControlled.default)({
26
- controlled: valueProp,
27
- default: defaultValue,
28
- name: "Tabs",
29
- state: "value"
30
- });
31
- const idPrefix = (0, _react.useId)();
32
- const onSelected = (0, _react.useCallback)((e, newValue)=>{
33
- setValue(newValue);
34
- if (onChange) {
35
- onChange(e, newValue);
36
- }
37
- }, [
38
- onChange,
39
- setValue
40
- ]);
41
- const getRootProps = ()=>{
42
- return {};
43
- };
44
- const tabsContextValue = (0, _react.useMemo)(()=>{
45
- return {
46
- idPrefix,
47
- value,
48
- onSelected,
49
- orientation,
50
- direction,
51
- selectionFollowsFocus
52
- };
53
- }, [
54
- idPrefix,
55
- value,
56
- onSelected,
57
- orientation,
58
- direction,
59
- selectionFollowsFocus
60
- ]);
61
- return {
62
- getRootProps,
63
- tabsContextValue
64
- };
65
- };
66
- const _default = useTabs;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "CopyPasteVisible", {
6
- enumerable: true,
7
- get: function() {
8
- return CopyPasteVisible;
9
- }
10
- });
11
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
- const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
13
- const CopyPasteVisible = _styledcomponents.default.span`
14
- color: transparent;
15
- opacity: 0;
16
- font-size: 0;
17
- `;
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- p: function() {
13
- return p;
14
- },
15
- h1: function() {
16
- return h1;
17
- },
18
- h2: function() {
19
- return h2;
20
- },
21
- h3: function() {
22
- return h3;
23
- },
24
- h4: function() {
25
- return h4;
26
- },
27
- P: function() {
28
- return P;
29
- },
30
- H1: function() {
31
- return H1;
32
- },
33
- H2: function() {
34
- return H2;
35
- },
36
- H3: function() {
37
- return H3;
38
- },
39
- H4: function() {
40
- return H4;
41
- }
42
- });
43
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
44
- const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
45
- const _media = require("../styles/media");
46
- const p = `
47
- margin: 0 0 1em 0;
48
- `;
49
- const h1 = `
50
- margin: 0 0 10px 0;
51
- font-size: 30px;
52
- font-weight: 800;
53
- line-height: var(--headingsLineHeight);
54
- ${_media.min.md} {
55
- font-size: 50px;
56
- }
57
- `;
58
- const h2 = `
59
- margin: 0 0 1em 0;
60
- font-size: 24px;
61
- font-weight: 800;
62
- line-height: var(--headingsLineHeight);
63
- `;
64
- const h3 = `
65
- margin: 0 0 1em 0;
66
- font-size: 20px;
67
- font-weight: 600;
68
- line-height: var(--headingsLineHeight);
69
- `;
70
- const h4 = `
71
- margin: 0 0 1em 0;
72
- font-size: 13px;
73
- font-weight: 600;
74
- line-height: var(--headingsLineHeight);
75
- `;
76
- const P = _styledcomponents.default.div`
77
- ${p}
78
- `;
79
- const H1 = _styledcomponents.default.div`
80
- ${h1}
81
- `;
82
- const H2 = _styledcomponents.default.div`
83
- ${h2}
84
- `;
85
- const H3 = _styledcomponents.default.div`
86
- ${h3}
87
- `;
88
- const H4 = _styledcomponents.default.div`
89
- ${h4}
90
- `;
@@ -1,125 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "ReadMore", {
6
- enumerable: true,
7
- get: function() {
8
- return ReadMore;
9
- }
10
- });
11
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
- const _jsxruntime = require("react/jsx-runtime");
14
- const _framermotion = require("framer-motion");
15
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
16
- const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
17
- const _hooks = require("../hooks");
18
- const Root = _styledcomponents.default.div``;
19
- const Content = _styledcomponents.default.div`
20
- & p:first-child {
21
- margin-top: 0;
22
- }
23
- `;
24
- const BtnWrap = _styledcomponents.default.span`
25
- display: flex;
26
- justify-content: flex-end;
27
- transition: transform 0.18s ease-in-out;
28
- text-align: right;
29
- transform: translateY(${(p)=>p.$expanded ? "0" : "-100%"});
30
- opacity: ${(p)=>p.$expanded ? 0 : 1};
31
- `;
32
- const BtnFader = _styledcomponents.default.div`
33
- width: 30%;
34
- transition: transform 0.18s ease-in-out;
35
- background: linear-gradient(45deg, transparent 50%, ${(p)=>p.$bg} 70%);
36
- `;
37
- const Btn = _styledcomponents.default.span`
38
- padding: 0 10px 0 10px;
39
- line-height: ${(p)=>p.$lineHeight ? p.$lineHeight : "inherit"};
40
- background: var(--bodyBg);
41
- color: var(--grey600);
42
- white-space: nowrap;
43
- font-size: ${(p)=>p.$fontSize}px;
44
- cursor: pointer;
45
- `;
46
- const BtnIcon = _styledcomponents.default.span`
47
- display: inline-block;
48
- margin: 0 0 0 4px;
49
- transition: transform 0.18s ease-in-out;
50
- ${(p)=>p.$expanded ? "transform: rotate(180deg);" : ""};
51
- font-size: ${(p)=>p.$fontSize}px;
52
- `;
53
- const ReadMore = ({ lines = 3, lineHeight = 1.6, fontSize = 14, bg = "var(--bodyBg)", expand = "Expand", collapse = "Collapse", ...props })=>{
54
- const defaultMaxHeight = lines * (lineHeight * fontSize);
55
- const [expanded, setExpanded] = (0, _react.useState)(false);
56
- const [maxHeight, setMaxHeight] = (0, _react.useState)(defaultMaxHeight);
57
- const [fullHeight, setFullHeight] = (0, _react.useState)(0);
58
- const [exceeds, setExceeds] = (0, _react.useState)(false);
59
- const content = (0, _react.useRef)(null);
60
- const height = (0, _framermotion.useSpring)(defaultMaxHeight);
61
- const styles = (0, _react.useMemo)(()=>exceeds ? {
62
- height,
63
- overflow: "hidden"
64
- } : {}, [
65
- exceeds,
66
- height
67
- ]);
68
- const handleExpandClick = ()=>{
69
- setExpanded((prevExpanded)=>!prevExpanded);
70
- };
71
- (0, _hooks.useIsomorphicLayoutEffect)(()=>{
72
- if (content.current) {
73
- const elementHeight = content.current.offsetHeight;
74
- const newExceeds = elementHeight > maxHeight;
75
- if (!newExceeds) {
76
- setMaxHeight(elementHeight);
77
- }
78
- setExceeds(newExceeds);
79
- setFullHeight(elementHeight);
80
- }
81
- }, [
82
- content,
83
- maxHeight
84
- ]);
85
- (0, _hooks.useIsomorphicLayoutEffect)(()=>{
86
- height.set(expanded ? fullHeight : maxHeight);
87
- }, [
88
- expanded,
89
- height,
90
- fullHeight,
91
- maxHeight
92
- ]);
93
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(Root, {
94
- children: [
95
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_framermotion.m.div, {
96
- style: styles,
97
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Content, {
98
- ref: content,
99
- ...props
100
- })
101
- }),
102
- exceeds && /*#__PURE__*/ (0, _jsxruntime.jsxs)(BtnWrap, {
103
- $expanded: expanded,
104
- children: [
105
- /*#__PURE__*/ (0, _jsxruntime.jsx)(BtnFader, {
106
- $bg: bg
107
- }),
108
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(Btn, {
109
- $fontSize: fontSize,
110
- $lineHeight: lineHeight,
111
- onClick: handleExpandClick,
112
- "aria-expanded": expanded,
113
- "aria-label": expanded ? collapse : expand,
114
- children: [
115
- expanded ? collapse : expand,
116
- /*#__PURE__*/ (0, _jsxruntime.jsx)(BtnIcon, {
117
- $expanded: expanded
118
- })
119
- ]
120
- })
121
- ]
122
- })
123
- ]
124
- });
125
- };
@@ -1,108 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- TextLoopPiece: function() {
13
- return TextLoopPiece;
14
- },
15
- TextLoop: function() {
16
- return TextLoop;
17
- }
18
- });
19
- const _jsxruntime = require("react/jsx-runtime");
20
- const _framermotion = require("framer-motion");
21
- const _react = require("react");
22
- const TextLoopPiece = ({ text = "", style = {}, className = "", direction = "up", inline = true, noOverflow = true, delay = 400 })=>{
23
- const placeholderRef = (0, _react.useRef)(null);
24
- const [content, setContent] = (0, _react.useState)({
25
- data: "",
26
- key: ""
27
- });
28
- const [width, setWidth] = (0, _react.useState)(inline ? 0 : "auto");
29
- (0, _react.useEffect)(()=>{
30
- const timeoutId = setTimeout(()=>{
31
- if (!placeholderRef.current) return;
32
- placeholderRef.current.innerHTML = text + "";
33
- if (inline) setWidth(placeholderRef.current.offsetWidth);
34
- setContent({
35
- data: text + "",
36
- key: new Date() + ""
37
- });
38
- }, delay);
39
- return ()=>clearTimeout(timeoutId);
40
- }, [
41
- text,
42
- delay,
43
- inline
44
- ]);
45
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
46
- className: className,
47
- style: {
48
- ...style,
49
- position: "relative",
50
- display: inline ? "inline-block" : "block",
51
- width,
52
- whiteSpace: inline ? "nowrap" : "normal"
53
- },
54
- children: [
55
- /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
56
- ref: placeholderRef,
57
- style: {
58
- visibility: "hidden"
59
- }
60
- }),
61
- /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
62
- style: {
63
- overflow: noOverflow ? "hidden" : "visible",
64
- display: "block",
65
- position: "absolute",
66
- top: 0,
67
- left: 0,
68
- height: "100%",
69
- width: "100%"
70
- },
71
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_framermotion.AnimatePresence, {
72
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_framermotion.m.div, {
73
- style: {
74
- position: "absolute"
75
- },
76
- initial: {
77
- opacity: 0,
78
- y: direction === "down" ? "-100%" : "100%"
79
- },
80
- animate: {
81
- opacity: 1,
82
- y: 0
83
- },
84
- exit: {
85
- opacity: 0,
86
- y: direction === "down" ? "100%" : "-100%"
87
- },
88
- children: content.data
89
- }, content.key)
90
- })
91
- })
92
- ]
93
- });
94
- };
95
- const TextLoop = ({ texts, interval = 3000, ...props })=>{
96
- const [index, setIndex] = (0, _react.useState)(0);
97
- (0, _react.useEffect)(()=>{
98
- const intervalId = setInterval(()=>setIndex((index)=>index + 1), interval // every 3 seconds
99
- );
100
- return ()=>clearTimeout(intervalId);
101
- }, [
102
- interval
103
- ]);
104
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(TextLoopPiece, {
105
- ...props,
106
- text: texts[index % texts.length]
107
- });
108
- };
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "TypeStairs", {
6
- enumerable: true,
7
- get: function() {
8
- return TypeStairs;
9
- }
10
- });
11
- const _jsxruntime = require("react/jsx-runtime");
12
- const _react = require("react");
13
- const TypeStairs = /*#__PURE__*/ (0, _react.forwardRef)(({ children, limit }, ref)=>{
14
- // split in rows or just use one row if there is no limit
15
- const rows = limit ? splitTextIntoRows(children, limit) : [
16
- children
17
- ];
18
- return rows.length > 1 ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
19
- children: rows.map((row, rowIndex)=>{
20
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)("span", {
21
- children: [
22
- renderRow(row, rowIndex, ref),
23
- rowIndex !== rows.length - 1 && /*#__PURE__*/ (0, _jsxruntime.jsx)("br", {})
24
- ]
25
- }, `row-${rowIndex}`);
26
- })
27
- }) : renderRow(rows[0], 0, ref);
28
- });
29
- /**
30
- * every number chars find a space and break, then restart the gradient weight
31
- * @see https://stackoverflow.com/a/25770787
32
- */ function splitTextIntoRows(input = "", limit = 18) {
33
- const rows = [];
34
- const arr = input.split(" ");
35
- let currow = arr[0];
36
- let rowlen = currow.length;
37
- for(let i = 1; i < arr.length; i++){
38
- const word = arr[i];
39
- rowlen += word.length + 1;
40
- if (rowlen <= limit) {
41
- currow += " " + word;
42
- } else {
43
- rows.push(currow);
44
- currow = word;
45
- rowlen = word.length;
46
- }
47
- }
48
- rows.push(currow);
49
- return rows;
50
- }
51
- function renderRow(row, rowIndex, ref) {
52
- const letters = row.split("");
53
- let fontWeightIdx = 1;
54
- // const fontWeight = Math.min(fontWeightIdx * 100, 800);
55
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
56
- children: letters.map((letter, letterIndex)=>{
57
- const fontWeight = Math.min(fontWeightIdx * 100, 800);
58
- // don't waste a fontWeight for a white space
59
- if (letter !== " ") {
60
- fontWeightIdx++;
61
- }
62
- return /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
63
- style: {
64
- fontWeight
65
- },
66
- ref: ref,
67
- children: letter
68
- }, `letter-${rowIndex}-${letterIndex}`);
69
- })
70
- });
71
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./CopyPasteVisible"), exports);
7
- _export_star._(require("./Native"), exports);
8
- _export_star._(require("./ReadMore"), exports);
9
- _export_star._(require("./TextLoop"), exports);
10
- _export_star._(require("./TypeStairs"), exports);
package/css/index.js DELETED
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "KoineDialog", {
6
- enumerable: true,
7
- get: function() {
8
- return _bare.KoineDialog;
9
- }
10
- });
11
- const _export_star = require("@swc/helpers/_/_export_star");
12
- _export_star._(require("../shared"), exports);
13
- const _bare = require("../Dialog/css/bare");
14
- // export * from "../Form";
15
- // export * from "../Forms";
16
- // export * from "../Grid";
17
- // export * from "../Hamburger";
18
- // export * from "../Header";
19
- // export * from "../Hidden";
20
- // export * from "../Img";
21
- // export * from "../Link";
22
- // export * from "../MenuItem";
23
- // export * from "../Pagination";
24
- // export * from "../Pill";
25
- // export * from "../Progress";
26
- // export * from "../Rating";
27
- // // export * from "../Select";
28
- // export * from "../Sidebar";
29
- // export * from "../Spacing";
30
- // export * from "../Sticky";
31
- // export * from "../styles";
32
- // export * from "../Tabs";
33
- // export * from "../Typography";
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- classed: function() {
13
- return classed;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
20
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
21
- function classed(component) {
22
- // @ts-expect-error nevermind for now...
23
- const type = component.type || component;
24
- return function(strings, ...args) {
25
- const WrappedComponent = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
26
- const argResolved = args.map((arg, index)=>{
27
- let result = "";
28
- if (typeof arg === "function") {
29
- result = arg(props);
30
- } else if (typeof arg !== "undefined") {
31
- result = arg.toString();
32
- }
33
- return strings[index] + result;
34
- }).join("");
35
- const isNativeHtmlElement = typeof type === "string";
36
- const propsToForward = isNativeHtmlElement ? {} : props;
37
- if (isNativeHtmlElement) {
38
- for(const key in props){
39
- // like styled-components `transient` props
40
- if (!key.startsWith("$")) {
41
- // FIXME: for react 18 we need: @ts-expect-error
42
- propsToForward[key] = props[key];
43
- }
44
- }
45
- }
46
- // get the tagged function string outcome
47
- let className = argResolved || strings[0];
48
- // check if we need to clean it or not from the optional structure `< class="..."`
49
- className = className.match(/class="([^"]*)/)?.[1] || className;
50
- // add the custom classes from props
51
- className += props?.className ? " " + props?.className : "";
52
- return /*#__PURE__*/ (0, _react.createElement)(type, {
53
- // ...props,
54
- ...propsToForward,
55
- // only add ot props if it is not an empty string
56
- className: className || undefined,
57
- // add ref to props
58
- ref
59
- });
60
- });
61
- // FIXME: not sure if this is needed
62
- // WrappedComponent.displayName = type.toString();
63
- return WrappedComponent; // as unknown as React.ReactElement<typeof props>;
64
- };
65
- }
66
- const _default = classed;