@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.
- 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/styles/index.js
DELETED
|
@@ -1,142 +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
|
-
BodyMain: function() {
|
|
13
|
-
return _Body.BodyMain;
|
|
14
|
-
},
|
|
15
|
-
BodyRoot: function() {
|
|
16
|
-
return _Body.BodyRoot;
|
|
17
|
-
},
|
|
18
|
-
StylesGlobal: function() {
|
|
19
|
-
return _Global.StylesGlobal;
|
|
20
|
-
},
|
|
21
|
-
stylesGlobal: function() {
|
|
22
|
-
return _Global.stylesGlobal;
|
|
23
|
-
},
|
|
24
|
-
MediaDirection: function() {
|
|
25
|
-
return _media.MediaDirection;
|
|
26
|
-
},
|
|
27
|
-
MediaQuery: function() {
|
|
28
|
-
return _media.MediaQuery;
|
|
29
|
-
},
|
|
30
|
-
MediaQueryFunction: function() {
|
|
31
|
-
return _media.MediaQueryFunction;
|
|
32
|
-
},
|
|
33
|
-
between: function() {
|
|
34
|
-
return _media.between;
|
|
35
|
-
},
|
|
36
|
-
down: function() {
|
|
37
|
-
return _media.down;
|
|
38
|
-
},
|
|
39
|
-
generateMediaQueries: function() {
|
|
40
|
-
return _media.generateMediaQueries;
|
|
41
|
-
},
|
|
42
|
-
max: function() {
|
|
43
|
-
return _media.max;
|
|
44
|
-
},
|
|
45
|
-
min: function() {
|
|
46
|
-
return _media.min;
|
|
47
|
-
},
|
|
48
|
-
only: function() {
|
|
49
|
-
return _media.only;
|
|
50
|
-
},
|
|
51
|
-
up: function() {
|
|
52
|
-
return _media.up;
|
|
53
|
-
},
|
|
54
|
-
useMedia: function() {
|
|
55
|
-
return _media.useMedia;
|
|
56
|
-
},
|
|
57
|
-
SpacingArgs: function() {
|
|
58
|
-
return _spacing.SpacingArgs;
|
|
59
|
-
},
|
|
60
|
-
SpacingDevices: function() {
|
|
61
|
-
return _spacing.SpacingDevices;
|
|
62
|
-
},
|
|
63
|
-
SpacingDirection: function() {
|
|
64
|
-
return _spacing.SpacingDirection;
|
|
65
|
-
},
|
|
66
|
-
SpacingDirectionAxis: function() {
|
|
67
|
-
return _spacing.SpacingDirectionAxis;
|
|
68
|
-
},
|
|
69
|
-
SpacingFactor: function() {
|
|
70
|
-
return _spacing.SpacingFactor;
|
|
71
|
-
},
|
|
72
|
-
SpacingProperty: function() {
|
|
73
|
-
return _spacing.SpacingProperty;
|
|
74
|
-
},
|
|
75
|
-
SpacingSize: function() {
|
|
76
|
-
return _spacing.SpacingSize;
|
|
77
|
-
},
|
|
78
|
-
spacing: function() {
|
|
79
|
-
return _spacing.spacing;
|
|
80
|
-
},
|
|
81
|
-
spacingBottom: function() {
|
|
82
|
-
return _spacing.spacingBottom;
|
|
83
|
-
},
|
|
84
|
-
spacingTop: function() {
|
|
85
|
-
return _spacing.spacingTop;
|
|
86
|
-
},
|
|
87
|
-
spacingVertical: function() {
|
|
88
|
-
return _spacing.spacingVertical;
|
|
89
|
-
},
|
|
90
|
-
colStretch: function() {
|
|
91
|
-
return _styled.colStretch;
|
|
92
|
-
},
|
|
93
|
-
centered: function() {
|
|
94
|
-
return _styled.centered;
|
|
95
|
-
},
|
|
96
|
-
ellipsis: function() {
|
|
97
|
-
return _styled.ellipsis;
|
|
98
|
-
},
|
|
99
|
-
inset0: function() {
|
|
100
|
-
return _styled.inset0;
|
|
101
|
-
},
|
|
102
|
-
invisible: function() {
|
|
103
|
-
return _styled.invisible;
|
|
104
|
-
},
|
|
105
|
-
overlay: function() {
|
|
106
|
-
return _styled.overlay;
|
|
107
|
-
},
|
|
108
|
-
stateFocus: function() {
|
|
109
|
-
return _styled.stateFocus;
|
|
110
|
-
},
|
|
111
|
-
breakpoints: function() {
|
|
112
|
-
return _theme.breakpoints;
|
|
113
|
-
},
|
|
114
|
-
createTheme: function() {
|
|
115
|
-
return _theme.createTheme;
|
|
116
|
-
},
|
|
117
|
-
useTheme: function() {
|
|
118
|
-
return _theme.useTheme;
|
|
119
|
-
},
|
|
120
|
-
THEME_DEFAULT: function() {
|
|
121
|
-
return _themevanilla.THEME_DEFAULT;
|
|
122
|
-
},
|
|
123
|
-
THEME_KEY: function() {
|
|
124
|
-
return _themevanilla.THEME_KEY;
|
|
125
|
-
},
|
|
126
|
-
ThemeVanillaContext: function() {
|
|
127
|
-
return _themevanilla.ThemeVanillaContext;
|
|
128
|
-
},
|
|
129
|
-
ThemeVanillaProvider: function() {
|
|
130
|
-
return _themevanilla.ThemeVanillaProvider;
|
|
131
|
-
},
|
|
132
|
-
getInitialThemeFromClient: function() {
|
|
133
|
-
return _themevanilla.getInitialThemeFromClient;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
const _Body = require("./Body");
|
|
137
|
-
const _Global = require("./Global");
|
|
138
|
-
const _media = require("./media");
|
|
139
|
-
const _spacing = require("./spacing");
|
|
140
|
-
const _styled = require("./styled");
|
|
141
|
-
const _theme = require("./theme");
|
|
142
|
-
const _themevanilla = require("./theme--vanilla");
|
package/styles/media.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/// TODO:FIXME: this should use code from `useMqWidthCreator`
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
min: function() {
|
|
14
|
-
return min;
|
|
15
|
-
},
|
|
16
|
-
max: function() {
|
|
17
|
-
return max;
|
|
18
|
-
},
|
|
19
|
-
up: function() {
|
|
20
|
-
return up;
|
|
21
|
-
},
|
|
22
|
-
down: function() {
|
|
23
|
-
return down;
|
|
24
|
-
},
|
|
25
|
-
between: function() {
|
|
26
|
-
return between;
|
|
27
|
-
},
|
|
28
|
-
only: function() {
|
|
29
|
-
return only;
|
|
30
|
-
},
|
|
31
|
-
useMedia: function() {
|
|
32
|
-
return useMedia;
|
|
33
|
-
},
|
|
34
|
-
generateMediaQueries: function() {
|
|
35
|
-
return generateMediaQueries;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const _react = require("react");
|
|
39
|
-
const _theme = require("./theme");
|
|
40
|
-
const { min, max, up, down, between, only } = generateMediaQueries(_theme.breakpoints);
|
|
41
|
-
function useMedia(media) {
|
|
42
|
-
const { breakpoints } = (0, _theme.useTheme)();
|
|
43
|
-
const [matches, setMatches] = (0, _react.useState)(false);
|
|
44
|
-
const [direction = "min", breakpoint] = media.split(":");
|
|
45
|
-
let px = breakpoints[breakpoint];
|
|
46
|
-
if (direction === "max") {
|
|
47
|
-
px = px - 0.02;
|
|
48
|
-
}
|
|
49
|
-
const query = `(${direction}-width: ${px}px)`;
|
|
50
|
-
(0, _react.useEffect)(()=>{
|
|
51
|
-
const mq = window.matchMedia(query);
|
|
52
|
-
const handleChange = (event)=>{
|
|
53
|
-
setMatches(event.matches);
|
|
54
|
-
};
|
|
55
|
-
setMatches(mq.matches);
|
|
56
|
-
// Safari < 14 can't use addEventListener on a MediaQueryList
|
|
57
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#Browser_compatibility
|
|
58
|
-
if (!mq.addEventListener) {
|
|
59
|
-
// Update the state whenever the media query match state changes
|
|
60
|
-
mq.addListener(handleChange);
|
|
61
|
-
// Clean up on unmount and if the query changes
|
|
62
|
-
return ()=>{
|
|
63
|
-
mq.removeListener(handleChange);
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
mq.addEventListener("change", handleChange);
|
|
67
|
-
return ()=>{
|
|
68
|
-
mq.removeEventListener("change", handleChange);
|
|
69
|
-
};
|
|
70
|
-
}, [
|
|
71
|
-
query
|
|
72
|
-
]);
|
|
73
|
-
return matches;
|
|
74
|
-
}
|
|
75
|
-
function generateMediaQueries(breakpoints) {
|
|
76
|
-
const temp = Object.keys(breakpoints).map((key)=>{
|
|
77
|
-
const br = key;
|
|
78
|
-
return [
|
|
79
|
-
br,
|
|
80
|
-
breakpoints[br]
|
|
81
|
-
];
|
|
82
|
-
});
|
|
83
|
-
const sortedKeys = temp.sort((a, b)=>a[1] - b[1]).map((item)=>item[0]);
|
|
84
|
-
const getNext = (breakpoint)=>{
|
|
85
|
-
const index = sortedKeys.indexOf(breakpoint);
|
|
86
|
-
return sortedKeys[index + 1];
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* It behaves the same as `@media (min-width: ${value}px)`
|
|
90
|
-
* where value is the given breakpoint value.
|
|
91
|
-
* For ease of use this can be used both as a function `min("md")` and as an
|
|
92
|
-
* object literal `min.md`.
|
|
93
|
-
*/ // @ts-expect-error FIXME: at some point
|
|
94
|
-
const min = (br)=>`@media (min-width: ${breakpoints[br]}px)`;
|
|
95
|
-
/**
|
|
96
|
-
* It behaves the same as `@media (max-width: ${value}px)`
|
|
97
|
-
* where value is the given breakpoint value.
|
|
98
|
-
* For ease of use this can be used both as a function `max("md")` and as an
|
|
99
|
-
* object literal `max.md`.
|
|
100
|
-
*/ // @ts-expect-error FIXME: at some point
|
|
101
|
-
const max = (br)=>`@media (max-width: ${breakpoints[br] - 0.02}px)`;
|
|
102
|
-
for(const br in breakpoints){
|
|
103
|
-
const _br = br;
|
|
104
|
-
min[_br] = `@media (min-width: ${breakpoints[_br]}px)`;
|
|
105
|
-
max[_br] = `@media (max-width: ${breakpoints[_br] - 0.02}px)`;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* It behaves the same as `min`
|
|
109
|
-
* @inheritdoc {max}
|
|
110
|
-
*/ const up = min;
|
|
111
|
-
/**
|
|
112
|
-
* It behaves similarly to `max` but you will use the "next" breakpoint,
|
|
113
|
-
* specifying CSS that will apply from the given breakpoint and down.
|
|
114
|
-
*/ const down = (br)=>{
|
|
115
|
-
const brNext = getNext(br);
|
|
116
|
-
// TODO: if br does not exists otherwise throw Error
|
|
117
|
-
return brNext && `@media (max-width: ${breakpoints[brNext] - 0.02}px)`;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Media query between the two given breakpoints
|
|
121
|
-
*/ const between = (br1, br2)=>{
|
|
122
|
-
return `@media (min-width: ${breakpoints[br1]}px) and (max-width: ${breakpoints[br2] - 0.02}px)`;
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* Media query to apply from the given breakpoint until the next, just for its
|
|
126
|
-
* full range
|
|
127
|
-
*/ const only = (br)=>{
|
|
128
|
-
const brNext = getNext(br);
|
|
129
|
-
return brNext ? between(br, brNext) : min(br);
|
|
130
|
-
};
|
|
131
|
-
return {
|
|
132
|
-
min,
|
|
133
|
-
max,
|
|
134
|
-
up,
|
|
135
|
-
down,
|
|
136
|
-
between,
|
|
137
|
-
only
|
|
138
|
-
};
|
|
139
|
-
}
|
package/styles/spacing.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// import type { DefaultTheme } from "styled-components";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
spacing: function() {
|
|
14
|
-
return spacing;
|
|
15
|
-
},
|
|
16
|
-
spacingTop: function() {
|
|
17
|
-
return spacingTop;
|
|
18
|
-
},
|
|
19
|
-
spacingBottom: function() {
|
|
20
|
-
return spacingBottom;
|
|
21
|
-
},
|
|
22
|
-
spacingVertical: function() {
|
|
23
|
-
return spacingVertical;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
function _spacing(theme, size = "md", factor = 1, property = "padding", direction = "top", devices = [
|
|
27
|
-
"mobile",
|
|
28
|
-
"tablet",
|
|
29
|
-
"desktop"
|
|
30
|
-
]) {
|
|
31
|
-
const { breakpoints, devices: DEVICES, spaces: SPACES } = theme;
|
|
32
|
-
let css = "";
|
|
33
|
-
const prop = `${property}-${direction}`;
|
|
34
|
-
if (!devices.length || devices[0] === "mobile") {
|
|
35
|
-
css += `@media(max-width: ${breakpoints[DEVICES.mobile]}px){
|
|
36
|
-
${prop}: ${SPACES["mobile"][size] * factor}px;
|
|
37
|
-
}`;
|
|
38
|
-
} else {
|
|
39
|
-
for(let index = 0; index < devices.length; index++){
|
|
40
|
-
const device = devices[index];
|
|
41
|
-
if (device === "mobile") {
|
|
42
|
-
css += `${prop}: ${SPACES[device][size] * factor}px;`;
|
|
43
|
-
} else if (device === "tablet") {
|
|
44
|
-
css += `@media(min-width: ${breakpoints[DEVICES.tablet]}px){
|
|
45
|
-
${prop}: ${SPACES["tablet"][size] * factor}px;
|
|
46
|
-
}`;
|
|
47
|
-
} else if (device === "desktop") {
|
|
48
|
-
css += `@media(min-width: ${breakpoints[DEVICES.desktop]}px){
|
|
49
|
-
${prop}: ${SPACES["desktop"][size] * factor}px;
|
|
50
|
-
}`;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return css;
|
|
55
|
-
}
|
|
56
|
-
function spacing(size, factor, property, direction, devices) {
|
|
57
|
-
if (direction === "vertical") {
|
|
58
|
-
return _spacing(this, size, factor, property, "top", devices) + _spacing(this, size, factor, property, "bottom", devices);
|
|
59
|
-
}
|
|
60
|
-
return _spacing(this, size, factor, property, direction, devices);
|
|
61
|
-
}
|
|
62
|
-
function spacingTop(size, factor, property, devices) {
|
|
63
|
-
return _spacing(this, size, factor, property, "top", devices);
|
|
64
|
-
}
|
|
65
|
-
function spacingBottom(size, factor, property, devices) {
|
|
66
|
-
return _spacing(this, size, factor, property, "bottom", devices);
|
|
67
|
-
}
|
|
68
|
-
function spacingVertical(size, factor, property, devices) {
|
|
69
|
-
return _spacing(this, size, factor, property, "top", devices) + _spacing(this, size, factor, property, "bottom", devices);
|
|
70
|
-
}
|
package/styles/styled.js
DELETED
|
@@ -1,58 +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
|
-
colStretch: function() {
|
|
13
|
-
return colStretch;
|
|
14
|
-
},
|
|
15
|
-
inset0: function() {
|
|
16
|
-
return inset0;
|
|
17
|
-
},
|
|
18
|
-
overlay: function() {
|
|
19
|
-
return overlay;
|
|
20
|
-
},
|
|
21
|
-
centered: function() {
|
|
22
|
-
return centered;
|
|
23
|
-
},
|
|
24
|
-
ellipsis: function() {
|
|
25
|
-
return ellipsis;
|
|
26
|
-
},
|
|
27
|
-
invisible: function() {
|
|
28
|
-
return invisible;
|
|
29
|
-
},
|
|
30
|
-
stateFocus: function() {
|
|
31
|
-
return stateFocus;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
35
|
-
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
36
|
-
const colStretch = (direction, bg)=>{
|
|
37
|
-
return `
|
|
38
|
-
background: ${bg};
|
|
39
|
-
position: relative;
|
|
40
|
-
|
|
41
|
-
&:before{
|
|
42
|
-
z-index: -1;
|
|
43
|
-
content: '';
|
|
44
|
-
position: absolute;
|
|
45
|
-
right: ${direction === "left" ? "100%" : "-100vw"};
|
|
46
|
-
left: ${direction === "right" ? "100%" : "-100vw"};
|
|
47
|
-
top: 0;
|
|
48
|
-
bottom: 0;
|
|
49
|
-
background: ${bg};
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
};
|
|
53
|
-
const inset0 = `top:0;left:0;right:0;bottom:0;`;
|
|
54
|
-
const overlay = `position: absolute;${inset0}`;
|
|
55
|
-
const centered = `display: flex;align-items: center;justify-content: center;`;
|
|
56
|
-
const ellipsis = `overflow: hidden;text-overflow: ellipsis;white-space: nowrap;`;
|
|
57
|
-
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;`;
|
|
58
|
-
const stateFocus = `outline: 0px;box-shadow: 0 0 0 0.2rem rgba(200, 200, 200, 0.25);`;
|
package/styles/theme--vanilla.js
DELETED
|
@@ -1,82 +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
|
-
THEME_KEY: function() {
|
|
13
|
-
return THEME_KEY;
|
|
14
|
-
},
|
|
15
|
-
THEME_DEFAULT: function() {
|
|
16
|
-
return THEME_DEFAULT;
|
|
17
|
-
},
|
|
18
|
-
getInitialThemeFromClient: function() {
|
|
19
|
-
return getInitialThemeFromClient;
|
|
20
|
-
},
|
|
21
|
-
ThemeVanillaContext: function() {
|
|
22
|
-
return ThemeVanillaContext;
|
|
23
|
-
},
|
|
24
|
-
ThemeVanillaProvider: function() {
|
|
25
|
-
return ThemeVanillaProvider;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
29
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
30
|
-
const _react = require("react");
|
|
31
|
-
const _isBrowser = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/isBrowser"));
|
|
32
|
-
const _useUpdateEffect = /*#__PURE__*/ _interop_require_default._(require("../hooks/useUpdateEffect"));
|
|
33
|
-
const THEME_KEY = "theme";
|
|
34
|
-
const THEME_DEFAULT = "light";
|
|
35
|
-
const getInitialThemeFromClient = ()=>{
|
|
36
|
-
if (typeof window !== "undefined" && window.localStorage) {
|
|
37
|
-
const storedPrefs = window.localStorage.getItem(THEME_KEY);
|
|
38
|
-
if (typeof storedPrefs === "string") {
|
|
39
|
-
return storedPrefs;
|
|
40
|
-
}
|
|
41
|
-
const userMedia = window.matchMedia("(prefers-color-scheme: dark)");
|
|
42
|
-
if (userMedia.matches) {
|
|
43
|
-
return "dark";
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return THEME_DEFAULT;
|
|
47
|
-
};
|
|
48
|
-
const ThemeVanillaContext = /*#__PURE__*/ (0, _react.createContext)({
|
|
49
|
-
theme: "light",
|
|
50
|
-
setTheme: undefined
|
|
51
|
-
});
|
|
52
|
-
const ThemeVanillaProvider = ({ initialTheme, children })=>{
|
|
53
|
-
const [theme, setTheme] = (0, _react.useState)(initialTheme);
|
|
54
|
-
const rawSetTheme = (rawTheme)=>{
|
|
55
|
-
if (!rawTheme || !_isBrowser.default) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const root = window.document.documentElement;
|
|
59
|
-
const isDark = rawTheme === "dark";
|
|
60
|
-
root.classList.remove(isDark ? "light" : "dark");
|
|
61
|
-
root.classList.add(rawTheme);
|
|
62
|
-
localStorage.setItem(THEME_KEY, rawTheme);
|
|
63
|
-
// setCookie(THEME_KEY, rawTheme);
|
|
64
|
-
};
|
|
65
|
-
(0, _react.useEffect)(()=>{
|
|
66
|
-
const theme = getInitialThemeFromClient();
|
|
67
|
-
setTheme(theme);
|
|
68
|
-
rawSetTheme(theme);
|
|
69
|
-
}, []);
|
|
70
|
-
(0, _useUpdateEffect.default)(()=>{
|
|
71
|
-
rawSetTheme(theme);
|
|
72
|
-
}, [
|
|
73
|
-
theme
|
|
74
|
-
]);
|
|
75
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(ThemeVanillaContext.Provider, {
|
|
76
|
-
value: {
|
|
77
|
-
theme,
|
|
78
|
-
setTheme
|
|
79
|
-
},
|
|
80
|
-
children: children
|
|
81
|
-
});
|
|
82
|
-
};
|
package/styles/theme.js
DELETED
|
@@ -1,49 +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
|
-
breakpoints: function() {
|
|
13
|
-
return breakpoints;
|
|
14
|
-
},
|
|
15
|
-
createTheme: function() {
|
|
16
|
-
return createTheme;
|
|
17
|
-
},
|
|
18
|
-
useTheme: function() {
|
|
19
|
-
return useTheme;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const _styledcomponents = require("styled-components");
|
|
23
|
-
const DEFAULT_BREAKPOINTS = {
|
|
24
|
-
xs: 0,
|
|
25
|
-
sm: 440,
|
|
26
|
-
md: 768,
|
|
27
|
-
lg: 1024,
|
|
28
|
-
xl: 1368,
|
|
29
|
-
xxl: 1690
|
|
30
|
-
};
|
|
31
|
-
const breakpoints = process.env["BREAKPOINTS"] ? process.env["BREAKPOINTS"].split(",").reduce((map, pair)=>{
|
|
32
|
-
const [key, value] = pair.split(":");
|
|
33
|
-
map[key] = parseFloat(value);
|
|
34
|
-
return map;
|
|
35
|
-
}, {}) : DEFAULT_BREAKPOINTS;
|
|
36
|
-
const themeDefault = {
|
|
37
|
-
maxWidth: breakpoints.xxl,
|
|
38
|
-
breakpoints,
|
|
39
|
-
devices: {
|
|
40
|
-
mobile: "sm",
|
|
41
|
-
tablet: "md",
|
|
42
|
-
desktop: "lg"
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const createTheme = (options)=>({
|
|
46
|
-
...themeDefault,
|
|
47
|
-
...options
|
|
48
|
-
});
|
|
49
|
-
const useTheme = _styledcomponents.useTheme;
|
package/tw/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/tw/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";
|
package/twm/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 _framer.KoineDialog;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _export_star = require("@swc/helpers/_/_export_star");
|
|
12
|
-
_export_star._(require("../shared"), exports);
|
|
13
|
-
const _framer = require("../Dialog/tw/framer");
|
|
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";
|
package/types.js
DELETED