@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
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "useToggle", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return useToggle;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
-
const _react = require("react");
|
|
13
|
-
const _reacthookform = require("react-hook-form");
|
|
14
|
-
const _styles = require("../styles");
|
|
15
|
-
function useToggle(props, ref) {
|
|
16
|
-
const { name, control, register, label, options, value: propValue, ...restProps } = props;
|
|
17
|
-
let { id, valueTrue, valueFalse, // defaultChecked,
|
|
18
|
-
// defaultValue,
|
|
19
|
-
// eslint-disable-next-line prefer-const
|
|
20
|
-
...remainingInputProps } = restProps;
|
|
21
|
-
// use options data convention to pass on the true/false values
|
|
22
|
-
if (options) {
|
|
23
|
-
valueTrue = options.filter((opt)=>opt.value === "true")[0].label.toString();
|
|
24
|
-
valueFalse = options.filter((opt)=>opt.value === "false")[0].label.toString();
|
|
25
|
-
}
|
|
26
|
-
id = `switch-${name}`;
|
|
27
|
-
const idTrue = `${id}-true`;
|
|
28
|
-
const idFalse = `${id}-false`;
|
|
29
|
-
const isRadio = !!(valueTrue && valueFalse);
|
|
30
|
-
// // manage default values for both toggle modes
|
|
31
|
-
// defaultChecked = isUndefined(defaultChecked) ? false : defaultChecked;
|
|
32
|
-
// // TODO: maybe throw an error if the defaultValue that arrives here is not
|
|
33
|
-
// // a valid value
|
|
34
|
-
// defaultValue =
|
|
35
|
-
// defaultValue === valueTrue || defaultValue === valueFalse
|
|
36
|
-
// ? defaultValue
|
|
37
|
-
// : valueFalse;
|
|
38
|
-
// get the value either from the uncontrolled watched input or from the given
|
|
39
|
-
// prop to control the component
|
|
40
|
-
let value = (0, _reacthookform.useWatch)({
|
|
41
|
-
name,
|
|
42
|
-
control
|
|
43
|
-
});
|
|
44
|
-
if (propValue) {
|
|
45
|
-
value = propValue;
|
|
46
|
-
}
|
|
47
|
-
// get the input props needed by react-hook-form, first check if we have
|
|
48
|
-
// a `register` function, then check if we have a `control` object or just
|
|
49
|
-
// rely on the `name` prop and `ref`, they probably would be passed alongside
|
|
50
|
-
// an `onChange` prop that is spreaded on the inputs
|
|
51
|
-
const inputProps = (0, _react.useMemo)(()=>{
|
|
52
|
-
return register ? register(name) : control ? control.register(name) : {
|
|
53
|
-
name,
|
|
54
|
-
ref
|
|
55
|
-
};
|
|
56
|
-
}, [
|
|
57
|
-
register,
|
|
58
|
-
control,
|
|
59
|
-
name,
|
|
60
|
-
ref
|
|
61
|
-
]);
|
|
62
|
-
/**
|
|
63
|
-
* Accessibility.
|
|
64
|
-
*
|
|
65
|
-
* Fake the spacebar keyboard behaviour on the radio mode of the checkbox.
|
|
66
|
-
* Without this *only* the arrow keys would change the checkbox state
|
|
67
|
-
*/ const handleKeyDown = (0, _react.useCallback)((event)=>{
|
|
68
|
-
if (event.key === " ") {
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
event.stopPropagation();
|
|
71
|
-
const firstInput = event.target;
|
|
72
|
-
const next = firstInput.nextElementSibling;
|
|
73
|
-
const prev = firstInput.previousElementSibling;
|
|
74
|
-
const secondInput = next?.tagName === "INPUT" ? next : prev;
|
|
75
|
-
let target = firstInput;
|
|
76
|
-
if (firstInput.checked) {
|
|
77
|
-
target = secondInput;
|
|
78
|
-
} else {
|
|
79
|
-
if (!secondInput.checked) {
|
|
80
|
-
target = firstInput.value === valueTrue ? firstInput : secondInput;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (target) target.click();
|
|
84
|
-
}
|
|
85
|
-
}, [
|
|
86
|
-
valueTrue
|
|
87
|
-
]);
|
|
88
|
-
// collect all the return values that are dependent on the current value
|
|
89
|
-
// of the input
|
|
90
|
-
const valueDependentProps = (0, _react.useMemo)(()=>({
|
|
91
|
-
rootProps: {
|
|
92
|
-
htmlFor: isRadio ? !value || value === valueFalse ? idTrue : idFalse : id
|
|
93
|
-
},
|
|
94
|
-
label: label ? label : value,
|
|
95
|
-
value
|
|
96
|
-
}), [
|
|
97
|
-
value,
|
|
98
|
-
valueFalse,
|
|
99
|
-
isRadio,
|
|
100
|
-
id,
|
|
101
|
-
idTrue,
|
|
102
|
-
idFalse,
|
|
103
|
-
label
|
|
104
|
-
]);
|
|
105
|
-
const Inputs = (0, _react.useMemo)(()=>isRadio ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
106
|
-
children: [
|
|
107
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_styles.InputInvisible, {
|
|
108
|
-
id: idFalse,
|
|
109
|
-
...inputProps,
|
|
110
|
-
...remainingInputProps,
|
|
111
|
-
onKeyDown: handleKeyDown,
|
|
112
|
-
type: "radio",
|
|
113
|
-
value: valueFalse
|
|
114
|
-
}),
|
|
115
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_styles.InputInvisible, {
|
|
116
|
-
id: idTrue,
|
|
117
|
-
...inputProps,
|
|
118
|
-
...remainingInputProps,
|
|
119
|
-
onKeyDown: handleKeyDown,
|
|
120
|
-
type: "radio",
|
|
121
|
-
value: valueTrue
|
|
122
|
-
})
|
|
123
|
-
]
|
|
124
|
-
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_styles.InputInvisible, {
|
|
125
|
-
id: id,
|
|
126
|
-
type: "checkbox",
|
|
127
|
-
...inputProps,
|
|
128
|
-
...remainingInputProps
|
|
129
|
-
}), [
|
|
130
|
-
inputProps,
|
|
131
|
-
remainingInputProps,
|
|
132
|
-
handleKeyDown,
|
|
133
|
-
isRadio,
|
|
134
|
-
idFalse,
|
|
135
|
-
idTrue,
|
|
136
|
-
valueFalse,
|
|
137
|
-
valueTrue,
|
|
138
|
-
id
|
|
139
|
-
]);
|
|
140
|
-
// console.log("useToggle: render", value);
|
|
141
|
-
return {
|
|
142
|
-
...valueDependentProps,
|
|
143
|
-
Inputs
|
|
144
|
-
};
|
|
145
|
-
}
|
package/Forms/antispam.js
DELETED
|
@@ -1,59 +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
|
-
encodeForm: function() {
|
|
13
|
-
return encodeForm;
|
|
14
|
-
},
|
|
15
|
-
decodeForm: function() {
|
|
16
|
-
return decodeForm;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _yup = require("@kuus/yup");
|
|
21
|
-
const _decode = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/decode"));
|
|
22
|
-
const _encode = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/encode"));
|
|
23
|
-
const _isUndefined = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/isUndefined"));
|
|
24
|
-
function encodeForm(validationRules) {
|
|
25
|
-
const encoded = {};
|
|
26
|
-
const encodedNames = {};
|
|
27
|
-
for(const name in validationRules){
|
|
28
|
-
if (!name.startsWith("_")) {
|
|
29
|
-
const encodedName = (0, _encode.default)(name);
|
|
30
|
-
encoded[encodedName] = validationRules[name];
|
|
31
|
-
encodedNames[name] = encodedName;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
// we need `.required()` to correctly infer the type @see
|
|
35
|
-
// https://github.com/jquense/yup/issues/946
|
|
36
|
-
const encodedSchema = (0, _yup.object)(encoded).required();
|
|
37
|
-
return {
|
|
38
|
-
encodedSchema,
|
|
39
|
-
encodedNames
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function decodeForm(formData) {
|
|
43
|
-
const json = {};
|
|
44
|
-
for(const encodedName in formData){
|
|
45
|
-
const decodedName = (0, _decode.default)(encodedName);
|
|
46
|
-
// always add underscore prefixed names as they are treated as internal
|
|
47
|
-
// private inputs outside of the honeypot system, normalise them here removing
|
|
48
|
-
// the underscore prefix
|
|
49
|
-
if (encodedName.startsWith("_")) {
|
|
50
|
-
// @ts-expect-error nevermind
|
|
51
|
-
json[encodedName.substring(1)] = formData[encodedName];
|
|
52
|
-
} else if (!(0, _isUndefined.default)(formData[encodedName]) && formData[decodedName] === "") {
|
|
53
|
-
// @ts-expect-error nevermind
|
|
54
|
-
json[decodedName] = formData[encodedName];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
// console.log(formData, decoded, json);
|
|
58
|
-
return json;
|
|
59
|
-
}
|
package/Forms/helpers.js
DELETED
|
@@ -1,72 +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
|
-
normaliseOptions: function() {
|
|
13
|
-
return normaliseOptions;
|
|
14
|
-
},
|
|
15
|
-
defaultOptionsFilterFn: function() {
|
|
16
|
-
return defaultOptionsFilterFn;
|
|
17
|
-
},
|
|
18
|
-
triggerOnChange: function() {
|
|
19
|
-
return triggerOnChange;
|
|
20
|
-
},
|
|
21
|
-
triggerChange: function() {
|
|
22
|
-
return triggerChange;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
26
|
-
const _isString = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/isString"));
|
|
27
|
-
const _matchSorter = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/matchSorter"));
|
|
28
|
-
const normaliseOptions = (options = [])=>{
|
|
29
|
-
return options.map((option)=>{
|
|
30
|
-
return (0, _isString.default)(option) ? {
|
|
31
|
-
label: option,
|
|
32
|
-
value: option
|
|
33
|
-
} : option;
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
function defaultOptionsFilterFn(options, inputValue) {
|
|
37
|
-
if (!inputValue) {
|
|
38
|
-
return options;
|
|
39
|
-
}
|
|
40
|
-
return (0, _matchSorter.default)(options, inputValue, {
|
|
41
|
-
keys: [
|
|
42
|
-
"value",
|
|
43
|
-
"label"
|
|
44
|
-
]
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function triggerOnChange(onChange, name, value) {
|
|
48
|
-
// @ts-expect-error nevermind
|
|
49
|
-
if (onChange) onChange({
|
|
50
|
-
target: {
|
|
51
|
-
name,
|
|
52
|
-
value
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function triggerChange(input, value) {
|
|
57
|
-
const obj = window.Object;
|
|
58
|
-
if (!obj) {
|
|
59
|
-
if (process.env["NODE_ENV"] !== "production") {
|
|
60
|
-
console.warn("[@koine/react:Forms:triggerChange] window.Object does not exists, bailing.");
|
|
61
|
-
}
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
// @ts-expect-error nevermind
|
|
65
|
-
const nativeInputValueSetter = obj.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
|
|
66
|
-
// @ts-expect-error nevermind
|
|
67
|
-
nativeInputValueSetter.call(input, value);
|
|
68
|
-
const inputEvent = new Event("input", {
|
|
69
|
-
bubbles: true
|
|
70
|
-
});
|
|
71
|
-
input.dispatchEvent(inputEvent);
|
|
72
|
-
}
|
package/Forms/index.js
DELETED
|
@@ -1,19 +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("./antispam"), exports);
|
|
7
|
-
_export_star._(require("./Checkbox"), exports);
|
|
8
|
-
_export_star._(require("./Input"), exports);
|
|
9
|
-
_export_star._(require("./InputGroup"), exports);
|
|
10
|
-
_export_star._(require("./Feedback"), exports);
|
|
11
|
-
_export_star._(require("./Field"), exports);
|
|
12
|
-
_export_star._(require("./Label"), exports);
|
|
13
|
-
_export_star._(require("./Password"), exports);
|
|
14
|
-
_export_star._(require("./Radio"), exports);
|
|
15
|
-
_export_star._(require("./Switch"), exports);
|
|
16
|
-
_export_star._(require("./Textarea"), exports);
|
|
17
|
-
_export_star._(require("./Toggle"), exports);
|
|
18
|
-
_export_star._(require("./helpers"), exports);
|
|
19
|
-
_export_star._(require("./styles"), exports);
|
package/Forms/styles.js
DELETED
|
@@ -1,94 +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
|
-
InputInvisible: function() {
|
|
13
|
-
return InputInvisible;
|
|
14
|
-
},
|
|
15
|
-
InputHoneypot: function() {
|
|
16
|
-
return InputHoneypot;
|
|
17
|
-
},
|
|
18
|
-
InputProgress: function() {
|
|
19
|
-
return InputProgress;
|
|
20
|
-
},
|
|
21
|
-
inputResetAutofill: function() {
|
|
22
|
-
return inputResetAutofill;
|
|
23
|
-
},
|
|
24
|
-
inputBorder: function() {
|
|
25
|
-
return inputBorder;
|
|
26
|
-
},
|
|
27
|
-
inputPadding: function() {
|
|
28
|
-
return inputPadding;
|
|
29
|
-
},
|
|
30
|
-
inputReset: function() {
|
|
31
|
-
return inputReset;
|
|
32
|
-
},
|
|
33
|
-
inputBase: function() {
|
|
34
|
-
return inputBase;
|
|
35
|
-
},
|
|
36
|
-
inputFocus: function() {
|
|
37
|
-
return inputFocus;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
41
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
42
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
43
|
-
const _ProgressLinear = require("../Progress/ProgressLinear");
|
|
44
|
-
const _styled = require("../styles/styled");
|
|
45
|
-
const InputInvisible = _styledcomponents.default.input`
|
|
46
|
-
${_styled.invisible}
|
|
47
|
-
`;
|
|
48
|
-
const InputHoneypot = (0, _styledcomponents.default)(InputInvisible).attrs({
|
|
49
|
-
type: "text",
|
|
50
|
-
autoComplete: "new-password",
|
|
51
|
-
tabIndex: -1
|
|
52
|
-
})``;
|
|
53
|
-
const InputProgress = (0, _styledcomponents.default)((p)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_ProgressLinear.ProgressLinear, {
|
|
54
|
-
fg: "var(--accent300)",
|
|
55
|
-
bg: "var(--accent400)",
|
|
56
|
-
...p
|
|
57
|
-
}))`
|
|
58
|
-
position: absolute;
|
|
59
|
-
bottom: 0;
|
|
60
|
-
left: 0;
|
|
61
|
-
width: 100%;
|
|
62
|
-
`;
|
|
63
|
-
const inputResetAutofill = `
|
|
64
|
-
&:-webkit-autofill,
|
|
65
|
-
&:-webkit-autofill:hover,
|
|
66
|
-
&:-webkit-autofill:focus,
|
|
67
|
-
&:-webkit-autofill:active {
|
|
68
|
-
-webkit-background-clip: text;
|
|
69
|
-
}
|
|
70
|
-
`;
|
|
71
|
-
const inputBorder = `
|
|
72
|
-
border: 1px solid var(--forms-border-color);
|
|
73
|
-
`;
|
|
74
|
-
const inputPadding = `
|
|
75
|
-
padding: var(--forms-gutter-y) var(--forms-gutter-x);
|
|
76
|
-
`;
|
|
77
|
-
const inputReset = `
|
|
78
|
-
width: 100%;
|
|
79
|
-
min-height: 44px;
|
|
80
|
-
${inputBorder}
|
|
81
|
-
${inputPadding}
|
|
82
|
-
`;
|
|
83
|
-
const inputBase = `
|
|
84
|
-
${inputReset}
|
|
85
|
-
${inputResetAutofill}
|
|
86
|
-
background: transparent;
|
|
87
|
-
`;
|
|
88
|
-
const inputFocus = `
|
|
89
|
-
&:focus {
|
|
90
|
-
outline: 0px;
|
|
91
|
-
appearance: none;
|
|
92
|
-
${_styled.stateFocus}
|
|
93
|
-
}
|
|
94
|
-
`;
|
package/Gauge/Gauge.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// import styled, { keyframes } from "styled-components";
|
|
2
|
-
// import { m } from "framer-motion";
|
|
3
|
-
"use strict";
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "Gauge", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function() {
|
|
10
|
-
return Gauge;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
const Gauge = (_props)=>null; // export type GaugeProps = {
|
|
14
|
-
// /** In percentage */
|
|
15
|
-
// value: number;
|
|
16
|
-
// };
|
|
17
|
-
// export const Gauge = ({
|
|
18
|
-
// value,
|
|
19
|
-
// counter = true,
|
|
20
|
-
// stroke,
|
|
21
|
-
// // emptyStroke = "#e2e2e2",
|
|
22
|
-
// emptyStroke = stroke,
|
|
23
|
-
// emptyStrokeOpacity = 0.25,
|
|
24
|
-
// // emptyStrokeOpacity = 1,
|
|
25
|
-
// duration = 3,
|
|
26
|
-
// delay = 0.5,
|
|
27
|
-
// size = 100,
|
|
28
|
-
// strokeWidth = 6,
|
|
29
|
-
// }) => {
|
|
30
|
-
// const radius = 45;
|
|
31
|
-
// const circumference = Math.ceil(2 * Math.PI * radius);
|
|
32
|
-
// const fillPercents = Math.abs(
|
|
33
|
-
// Math.ceil((circumference / 100) * (value - 100))
|
|
34
|
-
// );
|
|
35
|
-
// const transition = {
|
|
36
|
-
// duration: duration,
|
|
37
|
-
// delay: delay,
|
|
38
|
-
// ease: "easeIn",
|
|
39
|
-
// };
|
|
40
|
-
// const variants = {
|
|
41
|
-
// hidden: {
|
|
42
|
-
// strokeDashoffset: circumference,
|
|
43
|
-
// transition,
|
|
44
|
-
// },
|
|
45
|
-
// show: {
|
|
46
|
-
// strokeDashoffset: fillPercents,
|
|
47
|
-
// transition,
|
|
48
|
-
// },
|
|
49
|
-
// };
|
|
50
|
-
// return (
|
|
51
|
-
// <>
|
|
52
|
-
// <Flex justifyContent="center" alignItems="center">
|
|
53
|
-
// {counter && (
|
|
54
|
-
// <Box
|
|
55
|
-
// position="absolute"
|
|
56
|
-
// fontSize={size >= 100 ? 6 : 3}
|
|
57
|
-
// fontWeight={2}
|
|
58
|
-
// color="text500"
|
|
59
|
-
// >
|
|
60
|
-
// <Counter valueTo={value} totalDuration={duration + delay} />%
|
|
61
|
-
// </Box>
|
|
62
|
-
// )}
|
|
63
|
-
// <Box height={size}>
|
|
64
|
-
// <svg
|
|
65
|
-
// viewBox="0 0 100 100"
|
|
66
|
-
// version="1.1"
|
|
67
|
-
// xmlns="http://www.w3.org/2000/svg"
|
|
68
|
-
// width={size}
|
|
69
|
-
// height={size}
|
|
70
|
-
// >
|
|
71
|
-
// <circle
|
|
72
|
-
// cx="50"
|
|
73
|
-
// cy="50"
|
|
74
|
-
// r={radius}
|
|
75
|
-
// className="circle"
|
|
76
|
-
// strokeWidth={strokeWidth}
|
|
77
|
-
// stroke={emptyStroke}
|
|
78
|
-
// strokeOpacity={emptyStrokeOpacity}
|
|
79
|
-
// fill="transparent"
|
|
80
|
-
// />
|
|
81
|
-
// </svg>
|
|
82
|
-
// <svg
|
|
83
|
-
// viewBox="0 0 100 100"
|
|
84
|
-
// width={size}
|
|
85
|
-
// height={size}
|
|
86
|
-
// style={{
|
|
87
|
-
// position: "absolute",
|
|
88
|
-
// transform: "rotate(-90deg)",
|
|
89
|
-
// overflow: "visible",
|
|
90
|
-
// marginLeft: -size,
|
|
91
|
-
// }}
|
|
92
|
-
// >
|
|
93
|
-
// <m.circle
|
|
94
|
-
// cx="50"
|
|
95
|
-
// cy="50"
|
|
96
|
-
// r={radius}
|
|
97
|
-
// strokeWidth={strokeWidth}
|
|
98
|
-
// stroke={stroke}
|
|
99
|
-
// fill="transparent"
|
|
100
|
-
// strokeDashoffset={fillPercents}
|
|
101
|
-
// strokeDasharray={circumference}
|
|
102
|
-
// variants={variants}
|
|
103
|
-
// initial="hidden"
|
|
104
|
-
// animate={"show"}
|
|
105
|
-
// />
|
|
106
|
-
// </svg>
|
|
107
|
-
// </Box>
|
|
108
|
-
// </Flex>
|
|
109
|
-
// </>
|
|
110
|
-
// );
|
|
111
|
-
// };
|
package/Grid/Grid.js
DELETED
|
@@ -1,106 +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
|
-
GRID_COLUMNS: function() {
|
|
13
|
-
return GRID_COLUMNS;
|
|
14
|
-
},
|
|
15
|
-
GRID_GUTTER_DEFAULT: function() {
|
|
16
|
-
return GRID_GUTTER_DEFAULT;
|
|
17
|
-
},
|
|
18
|
-
Container: function() {
|
|
19
|
-
return Container;
|
|
20
|
-
},
|
|
21
|
-
ContainerFluid: function() {
|
|
22
|
-
return ContainerFluid;
|
|
23
|
-
},
|
|
24
|
-
Row: function() {
|
|
25
|
-
return Row;
|
|
26
|
-
},
|
|
27
|
-
Col: function() {
|
|
28
|
-
return Col;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
32
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
33
|
-
const GRID_COLUMNS = 12;
|
|
34
|
-
const GRID_GUTTER_DEFAULT = "half";
|
|
35
|
-
const Container = _styledcomponents.default.div`
|
|
36
|
-
max-width: ${(p)=>p.theme.breakpoints[p.size]}px;
|
|
37
|
-
margin: 0 auto;
|
|
38
|
-
padding: 0 ${(p)=>p.theme.gutter[p.$gutter || GRID_GUTTER_DEFAULT]}px;
|
|
39
|
-
${(p)=>p.clamp ? "overflow: hidden;" : ""}
|
|
40
|
-
`;
|
|
41
|
-
const ContainerFluid = _styledcomponents.default.div`
|
|
42
|
-
padding: 0 ${(p)=>p.theme.gutter[p.$gutter || GRID_GUTTER_DEFAULT]}px;
|
|
43
|
-
`;
|
|
44
|
-
const Row = _styledcomponents.default.div`
|
|
45
|
-
margin: 0 -${(p)=>p.theme.gutter[p.$gutter || GRID_GUTTER_DEFAULT]}px;
|
|
46
|
-
display: flex;
|
|
47
|
-
${(p)=>p.$noWrap ? "overflow: auto;" : "flex-wrap: wrap;"}
|
|
48
|
-
${(p)=>p.$valign ? `align-items: ${p.$valign}` : ""};
|
|
49
|
-
${(p)=>p.$reverse && `@media (${p.$reverse.split(":")[0]}-width: ${p.$reverse.split(":")[1]}px) {
|
|
50
|
-
flex-direction: row-reverse;
|
|
51
|
-
}`}
|
|
52
|
-
`;
|
|
53
|
-
const Col = _styledcomponents.default.div`
|
|
54
|
-
padding: 0 ${(p)=>p.theme.gutter[p.$gutter || GRID_GUTTER_DEFAULT]}px;
|
|
55
|
-
display: ${(p)=>p.$flex ? "flex" : "block"};
|
|
56
|
-
${(p)=>p.$valign ? "align-items: " + p.$valign : ""};
|
|
57
|
-
${(p)=>getColCss(p)};
|
|
58
|
-
`;
|
|
59
|
-
function getColWidth(breakpoints, breakpoint, value) {
|
|
60
|
-
const breakpointValue = breakpoints[breakpoint] + "px";
|
|
61
|
-
const width = value * 100 / GRID_COLUMNS;
|
|
62
|
-
const cssValue = `
|
|
63
|
-
min-width: ${width}%;
|
|
64
|
-
flex: 0 0 ${width}%;
|
|
65
|
-
`;
|
|
66
|
-
if (breakpoint === Object.keys(breakpoints)[0]) {
|
|
67
|
-
return cssValue;
|
|
68
|
-
}
|
|
69
|
-
return `
|
|
70
|
-
@media (min-width: ${breakpointValue}){
|
|
71
|
-
${cssValue}
|
|
72
|
-
}`;
|
|
73
|
-
}
|
|
74
|
-
function getColCss(props) {
|
|
75
|
-
const { $auto, $offset, $width } = props;
|
|
76
|
-
const { breakpoints } = props.theme;
|
|
77
|
-
let css = "";
|
|
78
|
-
if ($offset) {
|
|
79
|
-
const offsets = $offset.split(",");
|
|
80
|
-
for(let i = 0; i <= offsets.length; i++){
|
|
81
|
-
if (offsets[i]) {
|
|
82
|
-
const [offsetBreakpoint, offsetSize] = offsets[i].split(":");
|
|
83
|
-
css += `
|
|
84
|
-
@media(min-width: ${breakpoints[offsetBreakpoint]}px){
|
|
85
|
-
margin-left: ${100 * offsetSize / GRID_COLUMNS}%;
|
|
86
|
-
}
|
|
87
|
-
`;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if ($width) {
|
|
92
|
-
// do nothing, width is set explicitly
|
|
93
|
-
} else if ($auto) {
|
|
94
|
-
css += `flex: 0 0 auto; width: auto; max-width: none;`;
|
|
95
|
-
} else {
|
|
96
|
-
for(const breakpoint in breakpoints){
|
|
97
|
-
const value = props[breakpoint];
|
|
98
|
-
if (typeof value !== "undefined") {
|
|
99
|
-
css += getColWidth(breakpoints, breakpoint, value);
|
|
100
|
-
} else if (breakpoint === "xs") {
|
|
101
|
-
css += getColWidth(breakpoints, breakpoint, 12);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return css;
|
|
106
|
-
}
|