@koine/react 2.0.0-beta.10 → 2.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -11
- package/Alert/Alert.js +0 -33
- package/Alert/Alert.stories.js +0 -39
- package/Alert/index.js +0 -6
- package/Animations/Reveal.js +0 -53
- package/Animations/Underline.js +0 -26
- package/Animations/index.js +0 -8
- package/Animations/useReveal.js +0 -83
- package/Autocomplete/AutocompleteDownshift.js +0 -167
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -362
- package/Autocomplete/AutocompleteMui.js +0 -183
- package/Autocomplete/AutocompleteReach.js +0 -121
- package/Autocomplete/components.js +0 -132
- package/Autocomplete/helpers.js +0 -34
- package/Autocomplete/index.js +0 -15
- package/Bg/BgColor.js +0 -64
- package/Bg/BgPhoto.js +0 -82
- package/Bg/BgSvg.js +0 -31
- package/Bg/index.js +0 -8
- package/Breadcrumbs/Breadcrumbs.js +0 -103
- package/Breadcrumbs/index.js +0 -6
- package/Buttons/Button.js +0 -106
- package/Buttons/ButtonComposite.js +0 -116
- package/Buttons/ButtonFab.js +0 -27
- package/Buttons/ButtonLink.js +0 -29
- package/Buttons/IconButton.js +0 -41
- package/Buttons/index.js +0 -10
- package/Calendar/CalendarDaygridCell.js +0 -105
- package/Calendar/CalendarDaygridNav.js +0 -63
- package/Calendar/CalendarDaygridTable.js +0 -126
- package/Calendar/CalendarLegend.js +0 -39
- package/Calendar/calendar-api-google.js +0 -110
- package/Calendar/index.js +0 -11
- package/Calendar/types.js +0 -4
- package/Calendar/useCalendar.js +0 -235
- package/Calendar/utils.js +0 -252
- package/Carousel/Carousel.js +0 -387
- package/Carousel/CarouselCss.js +0 -64
- package/Carousel/index.js +0 -6
- package/Collapsable/Collapsable.js +0 -11
- package/Collapsable/CollapsableReach.js +0 -251
- package/Collapsable/index.js +0 -7
- package/Debug/Debug.js +0 -34
- package/Debug/index.js +0 -6
- package/Details/Details.js +0 -117
- package/Details/Details.stories.js +0 -39
- package/Details/index.js +0 -6
- package/Dialog/DialogMui.js +0 -143
- package/Dialog/DialogMui.stories.js +0 -38
- package/Dialog/css/bare.js +0 -55
- package/Dialog/css/index.stories.js +0 -93
- package/Dialog/index.js +0 -11
- package/Dialog/m/bare.js +0 -125
- package/Dialog/m/basic.js +0 -50
- package/Dialog/m/index.js +0 -14
- package/Dialog/sc/bare.js +0 -83
- package/Dialog/sc/framer.js +0 -26
- package/Dialog/sc/framerMaterial.js +0 -26
- package/Dialog/sc/index.stories.js +0 -75
- package/Dialog/sc/material.js +0 -78
- package/Dialog/tw/bare.js +0 -55
- package/Dialog/tw/elegant.js +0 -54
- package/Dialog/tw/framer.js +0 -26
- package/Dialog/tw/framerMaterial.js +0 -26
- package/Dialog/tw/index.stories.js +0 -113
- package/Dialog/tw/material.js +0 -54
- package/Editor/Editor--tiptap.js +0 -72
- package/Editor/components.js +0 -59
- package/Editor/index.js +0 -6
- package/FaviconTags.js +0 -73
- package/Form/Form.js +0 -130
- package/Form/index.js +0 -6
- package/Form/sc/bare.js +0 -55
- package/Forms/Checkbox/Checkbox.js +0 -62
- package/Forms/Checkbox/index.js +0 -6
- package/Forms/Feedback/Feedback.js +0 -25
- package/Forms/Feedback/index.js +0 -6
- package/Forms/Field/Field.js +0 -75
- package/Forms/Field/FieldControl.js +0 -69
- package/Forms/Field/FieldHint.js +0 -17
- package/Forms/Field/index.js +0 -7
- package/Forms/Input/Input.js +0 -67
- package/Forms/Input/index.js +0 -6
- package/Forms/InputGroup/InputGroup.js +0 -85
- package/Forms/InputGroup/index.js +0 -6
- package/Forms/Label/Label.js +0 -46
- package/Forms/Label/index.js +0 -6
- package/Forms/Password/Password.js +0 -72
- package/Forms/Password/index.js +0 -6
- package/Forms/Radio/Radio.js +0 -68
- package/Forms/Radio/index.js +0 -6
- package/Forms/Switch/Switch.js +0 -80
- package/Forms/Switch/index.js +0 -6
- package/Forms/Textarea/Textarea.js +0 -45
- package/Forms/Textarea/TextareaRich.js +0 -58
- package/Forms/Textarea/index.js +0 -7
- package/Forms/Toggle/Toggle-tailwind.js +0 -99
- package/Forms/Toggle/Toggle.js +0 -175
- package/Forms/Toggle/index.js +0 -6
- package/Forms/Toggle/useToggle-tailwind.js +0 -202
- package/Forms/Toggle/useToggle.js +0 -145
- package/Forms/antispam.js +0 -59
- package/Forms/helpers.js +0 -72
- package/Forms/index.js +0 -19
- package/Forms/styles.js +0 -94
- package/Gauge/Gauge.js +0 -111
- package/Grid/Grid.js +0 -106
- package/Grid/index.js +0 -6
- package/Hamburger/Hamburger.js +0 -90
- package/Hamburger/index.js +0 -6
- package/Header/index.js +0 -6
- package/Header/useHeader.js +0 -54
- package/Hidden/Hidden.js +0 -21
- package/Hidden/index.js +0 -6
- package/Img/index.js +0 -6
- package/Img/sc/bare.js +0 -43
- package/Img/types.js +0 -6
- package/Link/Link.js +0 -13
- package/Link/LinkBlank.js +0 -52
- package/Link/index.js +0 -7
- package/Menu/Menu.js +0 -22
- package/Menu/MenuMui.js +0 -165
- package/Menu/index.js +0 -6
- package/MenuItem/MenuItem.js +0 -31
- package/MenuItem/MenuItemMui.js +0 -32
- package/MenuItem/index.js +0 -6
- package/MenuItem/useMenuItem.js +0 -96
- package/Meta/Meta.js +0 -26
- package/Meta/index.js +0 -12
- package/NoJs/NoJs.js +0 -28
- package/NoJs/index.js +0 -12
- package/Pagination/PaginationNav.js +0 -126
- package/Pagination/PaginationResults.js +0 -45
- package/Pagination/index.js +0 -7
- package/Pill/Pill.js +0 -62
- package/Pill/index.js +0 -6
- package/Progress/ProgressCircular.js +0 -62
- package/Progress/ProgressLinear.js +0 -53
- package/Progress/ProgressOverlay.js +0 -75
- package/Progress/index.js +0 -8
- package/Rating/Rating.js +0 -188
- package/Rating/index.js +0 -85
- package/Select/SelectDownshift.js +0 -47
- package/Select/components.js +0 -44
- package/Select/index.js +0 -13
- package/Sidebar/Sidebar.js +0 -74
- package/Sidebar/index.js +0 -6
- package/Spacing/Spacing.js +0 -55
- package/Spacing/index.js +0 -6
- package/Sticky/Sticky.js +0 -228
- package/Sticky/StickyCss.js +0 -20
- package/Sticky/index.js +0 -19
- package/Tabs/TabsMui.js +0 -91
- package/Tabs/TabsMui.stories.js +0 -38
- package/Tabs/index.js +0 -6
- package/Tabs/sc/bare.js +0 -86
- package/Tabs/sc/index.stories.js +0 -1
- package/Tabs/tw/bare.js +0 -45
- package/Tabs/tw/index.stories.js +0 -46
- package/Tabs/tw/material.js +0 -44
- package/Tabs/useTabs.js +0 -66
- package/Typography/CopyPasteVisible.js +0 -17
- package/Typography/Native.js +0 -90
- package/Typography/ReadMore.js +0 -125
- package/Typography/TextLoop.js +0 -108
- package/Typography/TypeStairs.js +0 -71
- package/Typography/index.js +0 -10
- package/css/index.js +0 -33
- package/helpers/classed.js +0 -66
- package/helpers/classed.stories.js +0 -140
- package/helpers/createUseMediaQueryWidth.js +0 -193
- package/helpers/extend-component.js +0 -32
- package/helpers/index.js +0 -9
- package/helpers/mergeRefs.js +0 -30
- package/hooks/index.js +0 -92
- package/hooks/types.js +0 -6
- package/hooks/useAsyncFn.js +0 -56
- package/hooks/useDateLocale.js +0 -51
- package/hooks/useFirstMountState.js +0 -28
- package/hooks/useFixedOffset.js +0 -67
- package/hooks/useFocus.js +0 -30
- package/hooks/useInterval.js +0 -44
- package/hooks/useIsomorphicLayoutEffect.js +0 -23
- package/hooks/useKeyUp.js +0 -40
- package/hooks/useMeasure.js +0 -189
- package/hooks/useMountedState.js +0 -31
- package/hooks/useNavigateAway.js +0 -69
- package/hooks/usePrevious.js +0 -33
- package/hooks/usePreviousRef.js +0 -27
- package/hooks/useScrollPosition.js +0 -83
- package/hooks/useScrollThreshold.js +0 -52
- package/hooks/useScrollTo.js +0 -39
- package/hooks/useSmoothScroll.js +0 -49
- package/hooks/useSpinDelay.js +0 -59
- package/hooks/useTraceUpdate.js +0 -39
- package/hooks/useUpdateEffect.js +0 -30
- package/hooks/useWindowSize.js +0 -43
- package/index.js +0 -10
- package/m/MotionProvider.js +0 -27
- package/m/index.js +0 -10
- package/m/lite.js +0 -12
- package/m/max.js +0 -12
- package/sc/index.js +0 -49
- package/scm/index.js +0 -40
- package/shared/index.js +0 -13
- package/styles/Body.js +0 -28
- package/styles/Global.js +0 -55
- package/styles/index.js +0 -142
- package/styles/media.js +0 -139
- package/styles/spacing.js +0 -70
- package/styles/styled.js +0 -58
- package/styles/theme--vanilla.js +0 -82
- package/styles/theme.js +0 -49
- package/tw/index.js +0 -33
- package/twm/index.js +0 -33
- package/types.js +0 -4
package/Sticky/Sticky.js
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "Sticky", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return Sticky;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const Sticky = null; // import {
|
|
12
|
-
// Ref,
|
|
13
|
-
// CSSProperties,
|
|
14
|
-
// useState,
|
|
15
|
-
// useCallback,
|
|
16
|
-
// useEffect,
|
|
17
|
-
// useRef,
|
|
18
|
-
// } from "react";
|
|
19
|
-
// /**
|
|
20
|
-
// * Get current coordinates `left` and `top` of specific element.
|
|
21
|
-
// */
|
|
22
|
-
// const offsetRelative = (element: HTMLElement) => {
|
|
23
|
-
// var result = { l: 0, t: 0 };
|
|
24
|
-
// do {
|
|
25
|
-
// let offsetTop = element.offsetTop;
|
|
26
|
-
// let offsetLeft = element.offsetLeft;
|
|
27
|
-
// if (!isNaN(offsetTop)) result.t += offsetTop;
|
|
28
|
-
// if (!isNaN(offsetLeft)) result.l += offsetLeft;
|
|
29
|
-
// // @ts-expect-error just rething everyhting in this file
|
|
30
|
-
// element =
|
|
31
|
-
// "BODY" === element.tagName ? element.parentElement : element.offsetParent;
|
|
32
|
-
// } while (element);
|
|
33
|
-
// return result;
|
|
34
|
-
// };
|
|
35
|
-
// export type StickyElementProps = {
|
|
36
|
-
// ref: Ref<HTMLDivElement>;
|
|
37
|
-
// sticky?: boolean;
|
|
38
|
-
// style: CSSProperties;
|
|
39
|
-
// };
|
|
40
|
-
// /**
|
|
41
|
-
// * - `0`: "STATIC": Static position as nothing happened
|
|
42
|
-
// * - `1`: "VIEWPORT-TOP": Sticked to the top screen edge
|
|
43
|
-
// * - `2`: "VIEWPORT-BOTTOM": Sticked to the bottom screen edge
|
|
44
|
-
// * - `4`: "VIEWPORT-UNBOTTOM": ? Scrolling in the middle of the element, neither sticked nor static
|
|
45
|
-
// * - `3`: "CONTAINER-BOTTOM": ?
|
|
46
|
-
// */
|
|
47
|
-
// export type StickyStatus = 0 | 1 | 2 | 3;
|
|
48
|
-
// type DimensionsBasic = [
|
|
49
|
-
// /** containerTop */
|
|
50
|
-
// number,
|
|
51
|
-
// /** containerHeight */
|
|
52
|
-
// number,
|
|
53
|
-
// /** containerBottom */
|
|
54
|
-
// number,
|
|
55
|
-
// /** elementHeight */
|
|
56
|
-
// number,
|
|
57
|
-
// /** elementWidth */
|
|
58
|
-
// number,
|
|
59
|
-
// /** viewportHeight */
|
|
60
|
-
// number,
|
|
61
|
-
// /** maxTranslateY */
|
|
62
|
-
// number
|
|
63
|
-
// ];
|
|
64
|
-
// type DimensionsOnScroll = [
|
|
65
|
-
// /** elementLeft */
|
|
66
|
-
// number,
|
|
67
|
-
// /** viewportTop */
|
|
68
|
-
// number,
|
|
69
|
-
// /** viewportBottom */
|
|
70
|
-
// number,
|
|
71
|
-
// /** viewportLeft */
|
|
72
|
-
// number,
|
|
73
|
-
// /** topSpacing */
|
|
74
|
-
// number,
|
|
75
|
-
// /** bottomSpacing */
|
|
76
|
-
// number
|
|
77
|
-
// /** translateY */
|
|
78
|
-
// // number,
|
|
79
|
-
// /** lastTopSpacing */
|
|
80
|
-
// // number,
|
|
81
|
-
// /** lastBottomSpacing */
|
|
82
|
-
// // number,
|
|
83
|
-
// /** lastViewportTop */
|
|
84
|
-
// // number,
|
|
85
|
-
// ];
|
|
86
|
-
// type Dimensions = DimensionsBasic & DimensionsOnScroll;
|
|
87
|
-
// const getDimensionsBasic = (container: HTMLElement, inner: HTMLElement) => {
|
|
88
|
-
// const containerTop = offsetRelative(container).t;
|
|
89
|
-
// const containerHeight = container.clientHeight;
|
|
90
|
-
// const containerBottom = containerTop + containerHeight;
|
|
91
|
-
// const elementHeight = inner.offsetHeight;
|
|
92
|
-
// const elementWidth = inner.offsetWidth;
|
|
93
|
-
// const viewportHeight = window.innerHeight;
|
|
94
|
-
// const maxTranslateY = containerHeight - elementHeight;
|
|
95
|
-
// return [
|
|
96
|
-
// containerTop,
|
|
97
|
-
// containerHeight,
|
|
98
|
-
// containerBottom,
|
|
99
|
-
// elementHeight,
|
|
100
|
-
// elementWidth,
|
|
101
|
-
// viewportHeight,
|
|
102
|
-
// maxTranslateY,
|
|
103
|
-
// ] as DimensionsBasic;
|
|
104
|
-
// };
|
|
105
|
-
// const getDimensionsOnScroll = (
|
|
106
|
-
// wrapper: HTMLElement,
|
|
107
|
-
// container: HTMLElement,
|
|
108
|
-
// inner: HTMLElement
|
|
109
|
-
// ) => {
|
|
110
|
-
// const elementLeft = offsetRelative(wrapper).l;
|
|
111
|
-
// const viewportTop =
|
|
112
|
-
// document.documentElement.scrollTop || document.body.scrollTop;
|
|
113
|
-
// const viewportBottom = viewportTop + window.innerHeight;
|
|
114
|
-
// const viewportLeft =
|
|
115
|
-
// document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
116
|
-
// const topSpacing = 0; // TODO: make it a prop?
|
|
117
|
-
// const bottomSpacing = 0; // TODO: make it a prop?
|
|
118
|
-
// // const lastTopSpacing = topSpacing;
|
|
119
|
-
// // const lastBottomSpacing = bottomSpacing;
|
|
120
|
-
// return [
|
|
121
|
-
// elementLeft,
|
|
122
|
-
// viewportTop,
|
|
123
|
-
// viewportBottom,
|
|
124
|
-
// viewportLeft,
|
|
125
|
-
// topSpacing,
|
|
126
|
-
// bottomSpacing,
|
|
127
|
-
// ] as DimensionsOnScroll;
|
|
128
|
-
// };
|
|
129
|
-
// // const getTranslateYonScroll = (dimensions: DimensionsOnScroll, status: StickyStatus) => {
|
|
130
|
-
// // if (status === 1) {
|
|
131
|
-
// // // Adjust translate Y in the case decrease top spacing value.
|
|
132
|
-
// // if (dimensions[5] < dims.lastTopSpacing) {
|
|
133
|
-
// // dims.translateY += dims.lastTopSpacing - dims.topSpacing;
|
|
134
|
-
// // this._reStyle = true;
|
|
135
|
-
// // }
|
|
136
|
-
// // } else if (status === 2) {
|
|
137
|
-
// // // Adjust translate Y in the case decrease bottom spacing value.
|
|
138
|
-
// // if (dims.bottomSpacing < dims.lastBottomSpacing) {
|
|
139
|
-
// // dims.translateY += dims.lastBottomSpacing - dims.bottomSpacing;
|
|
140
|
-
// // this._reStyle = true;
|
|
141
|
-
// // }
|
|
142
|
-
// // }
|
|
143
|
-
// // }
|
|
144
|
-
// export type StickyProps = {
|
|
145
|
-
// /** @default "div" */
|
|
146
|
-
// Wrapper?: FC<StickyElementProps>;
|
|
147
|
-
// /** @default "div" */
|
|
148
|
-
// Inner?: FC<StickyElementProps>;
|
|
149
|
-
// top: number;
|
|
150
|
-
// };
|
|
151
|
-
// export const Sticky: FC<StickyProps> = ({
|
|
152
|
-
// Wrapper = "div",
|
|
153
|
-
// Inner = "div",
|
|
154
|
-
// children,
|
|
155
|
-
// top,
|
|
156
|
-
// ...props
|
|
157
|
-
// }) => {
|
|
158
|
-
// const [sticky, setSticky] = useState(false);
|
|
159
|
-
// const [shouldRestyle, setShouldRestyle] = useState<boolean>();
|
|
160
|
-
// const stickyStatus = useRef<StickyStatus>(0);
|
|
161
|
-
// const [dimensionsBasic, setDimensionsBasic] = useState<DimensionsBasic>();
|
|
162
|
-
// const [dimensionsOnScroll, setDimensionsOnScroll] =
|
|
163
|
-
// useState<DimensionsOnScroll>();
|
|
164
|
-
// const [translateY, setTranslateY] = useState<number>(0);
|
|
165
|
-
// const [styleWrapper, setStyleWrapper] = useState({});
|
|
166
|
-
// const [styleInner, setStyleInner] = useState({});
|
|
167
|
-
// const [innerWidth, setInnerWidth] = useState<string>();
|
|
168
|
-
// const wrapperRef = useRef<HTMLDivElement>(null);
|
|
169
|
-
// const innerRef = useRef<HTMLDivElement>(null);
|
|
170
|
-
// const handleScroll = useCallback(() => {
|
|
171
|
-
// const wrapper = wrapperRef?.current;
|
|
172
|
-
// const container = wrapper?.parentElement || null;
|
|
173
|
-
// const inner = innerRef?.current;
|
|
174
|
-
// if (wrapper && inner && container) {
|
|
175
|
-
// const dimensions = getDimensionsOnScroll(wrapper, container, inner);
|
|
176
|
-
// setDimensionsOnScroll(dimensions);
|
|
177
|
-
// }
|
|
178
|
-
// }, []);
|
|
179
|
-
// const handleResize = useCallback(() => {
|
|
180
|
-
// const container = wrapperRef?.current?.parentElement || null;
|
|
181
|
-
// const inner = innerRef?.current;
|
|
182
|
-
// if (inner && container) {
|
|
183
|
-
// setDimensionsBasic(getDimensionsBasic(container, inner));
|
|
184
|
-
// // if (innerRef?.current) {
|
|
185
|
-
// // setInnerWidth(window.getComputedStyle(innerRef.current).width);
|
|
186
|
-
// // }
|
|
187
|
-
// // setSticky(wrapperRef.current.getBoundingClientRect().top <= top);
|
|
188
|
-
// }
|
|
189
|
-
// }, []);
|
|
190
|
-
// useEffect(() => {
|
|
191
|
-
// const container = wrapperRef?.current?.parentElement || null;
|
|
192
|
-
// const inner = innerRef?.current;
|
|
193
|
-
// if (inner && container) {
|
|
194
|
-
// setDimensionsBasic(getDimensionsBasic(container, inner));
|
|
195
|
-
// }
|
|
196
|
-
// window.addEventListener("scroll", handleScroll, { passive: true });
|
|
197
|
-
// window.addEventListener("resize", handleResize, { passive: true });
|
|
198
|
-
// return () => {
|
|
199
|
-
// window.removeEventListener("scroll", () => handleScroll);
|
|
200
|
-
// window.removeEventListener("resize", () => handleResize);
|
|
201
|
-
// };
|
|
202
|
-
// }, [wrapperRef, innerRef, handleScroll, handleResize]);
|
|
203
|
-
// // useEffect(() => {
|
|
204
|
-
// // if (sticky) {
|
|
205
|
-
// // setStyleInner({
|
|
206
|
-
// // position: "fixed",
|
|
207
|
-
// // zIndex: 1,
|
|
208
|
-
// // top,
|
|
209
|
-
// // width: innerWidth,
|
|
210
|
-
// // });
|
|
211
|
-
// // } else {
|
|
212
|
-
// // setStyleInner({});
|
|
213
|
-
// // }
|
|
214
|
-
// // }, [sticky, top, innerWidth]);
|
|
215
|
-
// return (
|
|
216
|
-
// <Wrapper
|
|
217
|
-
// ref={wrapperRef}
|
|
218
|
-
// sticky={Wrapper === "div" ? undefined : sticky}
|
|
219
|
-
// style={{
|
|
220
|
-
// position: "relative",
|
|
221
|
-
// }}
|
|
222
|
-
// >
|
|
223
|
-
// <Inner ref={innerRef} style={styleInner}>
|
|
224
|
-
// {children}
|
|
225
|
-
// </Inner>
|
|
226
|
-
// </Wrapper>
|
|
227
|
-
// );
|
|
228
|
-
// };
|
package/Sticky/StickyCss.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "StickyCss", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return StickyCss;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
-
const StickyCss = ({ top, ...props })=>{
|
|
13
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
14
|
-
style: {
|
|
15
|
-
position: "sticky",
|
|
16
|
-
top: 100
|
|
17
|
-
},
|
|
18
|
-
...props
|
|
19
|
-
});
|
|
20
|
-
};
|
package/Sticky/index.js
DELETED
|
@@ -1,19 +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
|
-
StickyCss: function() {
|
|
13
|
-
return _StickyCss.StickyCss;
|
|
14
|
-
},
|
|
15
|
-
StickyCssProps: function() {
|
|
16
|
-
return _StickyCss.StickyCssProps;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _StickyCss = require("./StickyCss");
|
package/Tabs/TabsMui.js
DELETED
|
@@ -1,91 +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
|
-
Root: function() {
|
|
13
|
-
return Root;
|
|
14
|
-
},
|
|
15
|
-
List: function() {
|
|
16
|
-
return List;
|
|
17
|
-
},
|
|
18
|
-
Indicator: function() {
|
|
19
|
-
return Indicator;
|
|
20
|
-
},
|
|
21
|
-
Panel: function() {
|
|
22
|
-
return Panel;
|
|
23
|
-
},
|
|
24
|
-
Tab: function() {
|
|
25
|
-
return Tab;
|
|
26
|
-
},
|
|
27
|
-
KoineTabs: function() {
|
|
28
|
-
return KoineTabs;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
32
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
33
|
-
const _Tab = /*#__PURE__*/ _interop_require_default._(require("@mui/base/Tab"));
|
|
34
|
-
const _TabPanel = /*#__PURE__*/ _interop_require_default._(require("@mui/base/TabPanel"));
|
|
35
|
-
const _Tabs = /*#__PURE__*/ _interop_require_default._(require("@mui/base/Tabs"));
|
|
36
|
-
const _TabsList = /*#__PURE__*/ _interop_require_default._(require("@mui/base/TabsList"));
|
|
37
|
-
const _useTab = /*#__PURE__*/ _interop_require_default._(require("@mui/base/useTab"));
|
|
38
|
-
const _react = require("react");
|
|
39
|
-
const _helpers = require("../helpers");
|
|
40
|
-
const Root = _Tabs.default;
|
|
41
|
-
const List = _TabsList.default;
|
|
42
|
-
const Indicator = "span";
|
|
43
|
-
const Panel = _TabPanel.default;
|
|
44
|
-
const Tab = /*#__PURE__*/ (0, _react.forwardRef)(function Tab({ children, // component,
|
|
45
|
-
slot, slotProps, slots, Indicator, ...props }, ref) {
|
|
46
|
-
const { active, /* disabled, */ selected } = (0, _useTab.default)({
|
|
47
|
-
...props,
|
|
48
|
-
rootRef: ref
|
|
49
|
-
});
|
|
50
|
-
const indicatorProps = {
|
|
51
|
-
active,
|
|
52
|
-
/* disabled, */ selected
|
|
53
|
-
};
|
|
54
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Tab.default, {
|
|
55
|
-
...props,
|
|
56
|
-
children: [
|
|
57
|
-
children,
|
|
58
|
-
Indicator && /*#__PURE__*/ (0, _jsxruntime.jsx)(Indicator, {
|
|
59
|
-
...indicatorProps
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
* Main differences from [Mui Tabs](https://mui.com/material-ui/react-dialog):
|
|
67
|
-
*
|
|
68
|
-
* @resources
|
|
69
|
-
* - [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/#tabpanel)
|
|
70
|
-
* - [WAI-ARIA example](https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html)
|
|
71
|
-
* - [[Proposal] New tags tabsection, tablist, tab, tabpanel](https://github.com/whatwg/html/issues/1809)
|
|
72
|
-
* - [Native <tab> elements](https://github.com/w3c/html/issues/1704)
|
|
73
|
-
* - [Let's talk about Native HTML Tabs](https://daverupert.com/2021/10/native-html-tabs/)
|
|
74
|
-
*
|
|
75
|
-
* @similar
|
|
76
|
-
* - [Zertz/react-headless-tabs](https://github.com/Zertz/react-headless-tabs)
|
|
77
|
-
*
|
|
78
|
-
* FIXME: it actually works even without forwardRef, check if we do need it
|
|
79
|
-
*/ const TabsWithRef = /*#__PURE__*/ (0, _react.forwardRef)(function Tabs({ Root: _Root, List: _List, Tab: _Tab, Indicator: _Indicator, Panel: _Panel, ...props }, ref) {
|
|
80
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Root, {
|
|
81
|
-
...props,
|
|
82
|
-
ref: ref
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
const KoineTabs = (0, _helpers.extendComponent)(TabsWithRef, {
|
|
86
|
-
Root,
|
|
87
|
-
List,
|
|
88
|
-
Tab,
|
|
89
|
-
Indicator,
|
|
90
|
-
Panel
|
|
91
|
-
}); // export default Tabs;
|
package/Tabs/TabsMui.stories.js
DELETED
|
@@ -1,38 +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
|
-
default: function() {
|
|
13
|
-
return _default;
|
|
14
|
-
},
|
|
15
|
-
Bare: function() {
|
|
16
|
-
return Bare;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
const _stories = require("@koine/stories");
|
|
21
|
-
const _TabsMui = require("./TabsMui");
|
|
22
|
-
const _default = {
|
|
23
|
-
component: _TabsMui.KoineTabs,
|
|
24
|
-
title: "Base/Tabs",
|
|
25
|
-
..._stories.storyTabsMeta
|
|
26
|
-
};
|
|
27
|
-
const BareTemplate = (args)=>{
|
|
28
|
-
// return <StoryTabs {...args} Tabs={KoineTabs} />;
|
|
29
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_stories.StoryTabs, {
|
|
30
|
-
...args,
|
|
31
|
-
Tabs: _TabsMui.KoineTabs
|
|
32
|
-
});
|
|
33
|
-
// return <div><Tabs {...args} /></div>;
|
|
34
|
-
};
|
|
35
|
-
const Bare = BareTemplate.bind({});
|
|
36
|
-
Bare.args = {
|
|
37
|
-
..._stories.storyTabsArgs
|
|
38
|
-
};
|
package/Tabs/index.js
DELETED
package/Tabs/sc/bare.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
// <reference types="@reach/utils/dist/declarations/src/polymorphic" />
|
|
2
|
-
/**
|
|
3
|
-
* @file
|
|
4
|
-
*
|
|
5
|
-
* Here we manage only "vertical" oriented tabs for now
|
|
6
|
-
*/ // import styled from "styled-components";
|
|
7
|
-
// import {
|
|
8
|
-
// Tabs as _Tabs,
|
|
9
|
-
// TabList as _TabList,
|
|
10
|
-
// Tab as _Tab,
|
|
11
|
-
// TabPanels as _TabPanels,
|
|
12
|
-
// TabPanel as _TabPanel,
|
|
13
|
-
// TabProps as _TabProps,
|
|
14
|
-
// TabsProps as _TabsProps,
|
|
15
|
-
// useTabsContext,
|
|
16
|
-
// } from "@reach/tabs";
|
|
17
|
-
// import { min } from "../../styles/media";
|
|
18
|
-
// import { UnderlineSkewed } from "../../Animations/Underline";
|
|
19
|
-
// import { btnStyleReset } from "../../Buttons/Button";
|
|
20
|
-
// export const Tabs = styled(_Tabs)<TabsProps>`
|
|
21
|
-
// ${min.sm} {
|
|
22
|
-
// display: flex;
|
|
23
|
-
// ${(p) => p.$vertical && "flex-direction: column;"}
|
|
24
|
-
// }
|
|
25
|
-
// `;
|
|
26
|
-
// export type TabsProps = React.PropsWithChildren<_TabsProps> & {
|
|
27
|
-
// $vertical?: boolean;
|
|
28
|
-
// };
|
|
29
|
-
// export const TabList = styled(_TabList)`
|
|
30
|
-
// display: flex;
|
|
31
|
-
// flex-direction: column;
|
|
32
|
-
// ${min.sm} {
|
|
33
|
-
// border-right: 1px solid var(--grey800);
|
|
34
|
-
// }
|
|
35
|
-
// `;
|
|
36
|
-
// export const TabWrap = styled(_Tab)<TabProps & TabStyledProps>`
|
|
37
|
-
// ${btnStyleReset}
|
|
38
|
-
// position: relative;
|
|
39
|
-
// justify-content: flex-end;
|
|
40
|
-
// padding: 0.7em;
|
|
41
|
-
// margin-bottom: 1em;
|
|
42
|
-
// font-weight: bold;
|
|
43
|
-
// color: ${(p) => (p.$active ? "var(--accent200)" : "var(--grey300)")};
|
|
44
|
-
// ${min.sm} {
|
|
45
|
-
// padding-right: var(--gutter-half);
|
|
46
|
-
// }
|
|
47
|
-
// &:hover {
|
|
48
|
-
// color: ${(p) => (p.$active ? "var(--accent200)" : "var(--accent300)")};
|
|
49
|
-
// }
|
|
50
|
-
// `;
|
|
51
|
-
// export const TabText = styled.span<TabStyledProps>`
|
|
52
|
-
// position: relative;
|
|
53
|
-
// z-index: 1;
|
|
54
|
-
// `;
|
|
55
|
-
// export const TabUnderline = styled(UnderlineSkewed)<TabStyledProps>``;
|
|
56
|
-
// export type TabStyledProps = {
|
|
57
|
-
// $active: boolean;
|
|
58
|
-
// $focused: boolean;
|
|
59
|
-
// };
|
|
60
|
-
// export type TabProps = _TabProps & {
|
|
61
|
-
// idx: number;
|
|
62
|
-
// };
|
|
63
|
-
// export const Tab = ({ children, ...props }: TabProps) => {
|
|
64
|
-
// const { selectedIndex, focusedIndex } = useTabsContext();
|
|
65
|
-
// const styledProps = {
|
|
66
|
-
// $active: props.idx === selectedIndex,
|
|
67
|
-
// $focused: props.idx === focusedIndex,
|
|
68
|
-
// };
|
|
69
|
-
// return (
|
|
70
|
-
// <TabWrap {...props} {...styledProps}>
|
|
71
|
-
// {styledProps.$active && (
|
|
72
|
-
// <TabUnderline {...styledProps} layoutId="Tab-underline" />
|
|
73
|
-
// )}
|
|
74
|
-
// <TabText {...styledProps}>{children}</TabText>
|
|
75
|
-
// </TabWrap>
|
|
76
|
-
// );
|
|
77
|
-
// };
|
|
78
|
-
// export const TabPanels = styled(_TabPanels)`
|
|
79
|
-
// flex: 1;
|
|
80
|
-
// `;
|
|
81
|
-
// export const TabPanel = styled(_TabPanel)`
|
|
82
|
-
// ${min.sm} {
|
|
83
|
-
// padding-left: var(--gutter-half);
|
|
84
|
-
// }
|
|
85
|
-
// `;
|
|
86
|
-
"use strict";
|
package/Tabs/sc/index.stories.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/Tabs/tw/bare.js
DELETED
|
@@ -1,45 +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
|
-
Root: function() {
|
|
13
|
-
return Root;
|
|
14
|
-
},
|
|
15
|
-
List: function() {
|
|
16
|
-
return List;
|
|
17
|
-
},
|
|
18
|
-
Tab: function() {
|
|
19
|
-
return Tab;
|
|
20
|
-
},
|
|
21
|
-
Indicator: function() {
|
|
22
|
-
return Indicator;
|
|
23
|
-
},
|
|
24
|
-
Panel: function() {
|
|
25
|
-
return Panel;
|
|
26
|
-
},
|
|
27
|
-
KoineTabs: function() {
|
|
28
|
-
return KoineTabs;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
32
|
-
const _helpers = require("../../helpers");
|
|
33
|
-
const _TabsMui = /*#__PURE__*/ _interop_require_wildcard._(require("../TabsMui"));
|
|
34
|
-
const Root = (0, _helpers.classed)(_TabsMui.Root)`< class="tabs`;
|
|
35
|
-
const List = (0, _helpers.classed)(_TabsMui.List)`< class="tabsList flex`;
|
|
36
|
-
const Tab = (0, _helpers.classed)(_TabsMui.Tab)`< class="tabsTab inline-flex items-center justify-center [-webkit-tap-highlight-color:transparent] appearance-none select-none`;
|
|
37
|
-
const Indicator = (0, _helpers.classed)(_TabsMui.Indicator)`< class="tabsIndicator`;
|
|
38
|
-
const Panel = (0, _helpers.classed)(_TabsMui.Panel)`< class="tabsPanel`;
|
|
39
|
-
const KoineTabs = (0, _helpers.extendComponent)(_TabsMui.KoineTabs, {
|
|
40
|
-
Root,
|
|
41
|
-
List,
|
|
42
|
-
Tab,
|
|
43
|
-
Indicator,
|
|
44
|
-
Panel
|
|
45
|
-
});
|
package/Tabs/tw/index.stories.js
DELETED
|
@@ -1,46 +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
|
-
// import { classed } from "../../helpers";
|
|
13
|
-
default: function() {
|
|
14
|
-
return _default;
|
|
15
|
-
},
|
|
16
|
-
bare: function() {
|
|
17
|
-
return bare;
|
|
18
|
-
},
|
|
19
|
-
material: function() {
|
|
20
|
-
return material;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _stories = require("@koine/stories");
|
|
25
|
-
const _bare = require("./bare");
|
|
26
|
-
const _material = require("./material");
|
|
27
|
-
const _default = {
|
|
28
|
-
title: "Base/Tabs/Tailwind",
|
|
29
|
-
..._stories.storyTabsMeta
|
|
30
|
-
};
|
|
31
|
-
const bareTemplate = (args)=>{
|
|
32
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_stories.StoryTabs, {
|
|
33
|
-
...args,
|
|
34
|
-
Tabs: _bare.KoineTabs
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
const bare = bareTemplate.bind({});
|
|
38
|
-
bare.args = _stories.storyTabsArgs;
|
|
39
|
-
const materialTemplate = (args)=>{
|
|
40
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_stories.StoryTabs, {
|
|
41
|
-
...args,
|
|
42
|
-
Tabs: _material.KoineTabs
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
const material = materialTemplate.bind({});
|
|
46
|
-
material.args = _stories.storyTabsArgs;
|
package/Tabs/tw/material.js
DELETED
|
@@ -1,44 +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
|
-
Root: function() {
|
|
13
|
-
return Root;
|
|
14
|
-
},
|
|
15
|
-
List: function() {
|
|
16
|
-
return List;
|
|
17
|
-
},
|
|
18
|
-
Tab: function() {
|
|
19
|
-
return Tab;
|
|
20
|
-
},
|
|
21
|
-
Indicator: function() {
|
|
22
|
-
return Indicator;
|
|
23
|
-
},
|
|
24
|
-
Panel: function() {
|
|
25
|
-
return Panel;
|
|
26
|
-
},
|
|
27
|
-
KoineTabs: function() {
|
|
28
|
-
return KoineTabs;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _helpers = require("../../helpers");
|
|
32
|
-
const _bare = require("./bare");
|
|
33
|
-
const Root = (0, _helpers.classed)(_bare.KoineTabs.Root)`< class="`;
|
|
34
|
-
const List = (0, _helpers.classed)(_bare.KoineTabs.List)`< class="border-b-gray-200 border-b border-solid`;
|
|
35
|
-
const Tab = (0, _helpers.classed)(_bare.KoineTabs.Tab)`< class="flex-col relative py-3 px-4 uppercase`; // ${p => p.selected ? "text-cyan-600" : ""}
|
|
36
|
-
const Indicator = (0, _helpers.classed)(_bare.KoineTabs.Indicator)`< class="absolute bottom-0 w-full h-[2px] ${(p)=>p.selected ? "bg-current" : ""}`;
|
|
37
|
-
const Panel = (0, _helpers.classed)(_bare.KoineTabs.Panel)`< class="tabsPanel`;
|
|
38
|
-
const KoineTabs = (0, _helpers.extendComponent)(_bare.KoineTabs, {
|
|
39
|
-
Root,
|
|
40
|
-
List,
|
|
41
|
-
Tab,
|
|
42
|
-
Indicator,
|
|
43
|
-
Panel
|
|
44
|
-
});
|