@koine/react 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Forms/Toggle/useToggle.d.ts +1 -1
- package/Forms/Toggle/useToggle.js +1 -1
- package/package.json +6 -7
- package/node/Alert/Alert.js +0 -14
- package/node/Alert/index.js +0 -4
- package/node/Animations/Reveal.js +0 -21
- package/node/Animations/Underline.js +0 -8
- package/node/Animations/index.js +0 -6
- package/node/Animations/useReveal.js +0 -75
- package/node/Autocomplete/AutocompleteDownshift.js +0 -161
- package/node/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -356
- package/node/Autocomplete/AutocompleteMui.js +0 -180
- package/node/Autocomplete/AutocompleteReach.js +0 -115
- package/node/Autocomplete/components.js +0 -37
- package/node/Autocomplete/helpers.js +0 -32
- package/node/Autocomplete/index.js +0 -7
- package/node/Bg/BgColor.js +0 -25
- package/node/Bg/BgPhoto.js +0 -20
- package/node/Bg/BgSvg.js +0 -16
- package/node/Bg/index.js +0 -6
- package/node/Breadcrumbs/Breadcrumbs.js +0 -31
- package/node/Breadcrumbs/index.js +0 -4
- package/node/Buttons/Button.js +0 -17
- package/node/Buttons/ButtonComposite.js +0 -32
- package/node/Buttons/ButtonFab.js +0 -9
- package/node/Buttons/ButtonLink.js +0 -15
- package/node/Buttons/IconButton.js +0 -10
- package/node/Buttons/index.js +0 -8
- package/node/Calendar/CalendarDaygridCell.js +0 -61
- package/node/Calendar/CalendarDaygridNav.js +0 -28
- package/node/Calendar/CalendarDaygridTable.js +0 -61
- package/node/Calendar/CalendarLegend.js +0 -20
- package/node/Calendar/calendar-api-google.js +0 -131
- package/node/Calendar/index.js +0 -9
- package/node/Calendar/types.js +0 -2
- package/node/Calendar/useCalendar.js +0 -187
- package/node/Calendar/utils.js +0 -215
- package/node/Carousel/Carousel.js +0 -381
- package/node/Carousel/CarouselCss.js +0 -27
- package/node/Carousel/index.js +0 -4
- package/node/Collapsable/Collapsable.js +0 -4
- package/node/Collapsable/CollapsableReach.js +0 -253
- package/node/Collapsable/index.js +0 -5
- package/node/Debug/Debug.js +0 -13
- package/node/Debug/index.js +0 -4
- package/node/Details/Details.js +0 -67
- package/node/Details/index.js +0 -4
- package/node/Dialog/DialogMui.js +0 -83
- package/node/Dialog/css/bare.js +0 -24
- package/node/Dialog/index.js +0 -5
- package/node/Dialog/m/bare.js +0 -55
- package/node/Dialog/m/basic.js +0 -35
- package/node/Dialog/m/index.js +0 -8
- package/node/Dialog/sc/bare.js +0 -46
- package/node/Dialog/sc/framer.js +0 -19
- package/node/Dialog/sc/framerMaterial.js +0 -19
- package/node/Dialog/sc/material.js +0 -24
- package/node/Dialog/tw/bare.js +0 -45
- package/node/Dialog/tw/elegant.js +0 -23
- package/node/Dialog/tw/framer.js +0 -19
- package/node/Dialog/tw/framerMaterial.js +0 -19
- package/node/Dialog/tw/material.js +0 -23
- package/node/Editor/Editor--tiptap.js +0 -31
- package/node/Editor/components.js +0 -15
- package/node/Editor/index.js +0 -4
- package/node/Favicon/FaviconTags.js +0 -19
- package/node/Favicon/index.js +0 -4
- package/node/Form/Form.js +0 -65
- package/node/Form/index.js +0 -4
- package/node/Form/sc/bare.js +0 -23
- package/node/Forms/Checkbox/Checkbox.js +0 -21
- package/node/Forms/Checkbox/index.js +0 -4
- package/node/Forms/Feedback/Feedback.js +0 -13
- package/node/Forms/Feedback/index.js +0 -4
- package/node/Forms/Field/Field.js +0 -52
- package/node/Forms/Field/FieldControl.js +0 -51
- package/node/Forms/Field/FieldHint.js +0 -7
- package/node/Forms/Field/index.js +0 -5
- package/node/Forms/Input/Input.js +0 -20
- package/node/Forms/Input/index.js +0 -4
- package/node/Forms/InputGroup/InputGroup.js +0 -19
- package/node/Forms/InputGroup/index.js +0 -4
- package/node/Forms/Label/Label.js +0 -9
- package/node/Forms/Label/index.js +0 -4
- package/node/Forms/Password/Password.js +0 -20
- package/node/Forms/Password/index.js +0 -4
- package/node/Forms/Radio/Radio.js +0 -28
- package/node/Forms/Radio/index.js +0 -4
- package/node/Forms/Switch/Switch.js +0 -23
- package/node/Forms/Switch/index.js +0 -4
- package/node/Forms/Textarea/Textarea.js +0 -15
- package/node/Forms/Textarea/TextareaRich.js +0 -31
- package/node/Forms/Textarea/index.js +0 -5
- package/node/Forms/Toggle/Toggle.js +0 -37
- package/node/Forms/Toggle/index.js +0 -4
- package/node/Forms/Toggle/useToggle.js +0 -149
- package/node/Forms/antispam.js +0 -61
- package/node/Forms/helpers.js +0 -52
- package/node/Forms/index.js +0 -19
- package/node/Forms/styles.js +0 -32
- package/node/Gauge/Gauge.js +0 -106
- package/node/Grid/Grid.js +0 -56
- package/node/Grid/index.js +0 -4
- package/node/Hamburger/Hamburger.js +0 -56
- package/node/Hamburger/index.js +0 -4
- package/node/Header/index.js +0 -4
- package/node/Header/useHeader.js +0 -34
- package/node/Hidden/Hidden.js +0 -13
- package/node/Hidden/index.js +0 -4
- package/node/Img/index.js +0 -4
- package/node/Img/sc/bare.js +0 -42
- package/node/Img/types.js +0 -2
- package/node/Link/Link.js +0 -7
- package/node/Link/LinkBlank.js +0 -21
- package/node/Link/index.js +0 -5
- package/node/Menu/Menu.js +0 -7
- package/node/Menu/index.js +0 -4
- package/node/MenuItem/MenuItem.js +0 -7
- package/node/MenuItem/index.js +0 -4
- package/node/Meta/Meta.js +0 -9
- package/node/Meta/index.js +0 -4
- package/node/NoJs/NoJs.js +0 -10
- package/node/NoJs/index.js +0 -4
- package/node/Pagination/PaginationNav.js +0 -65
- package/node/Pagination/PaginationResults.js +0 -15
- package/node/Pagination/index.js +0 -5
- package/node/Pill/Pill.js +0 -10
- package/node/Pill/index.js +0 -4
- package/node/Progress/ProgressCircular.js +0 -19
- package/node/Progress/ProgressLinear.js +0 -28
- package/node/Progress/ProgressOverlay.js +0 -28
- package/node/Progress/index.js +0 -6
- package/node/Rating/Rating.js +0 -76
- package/node/Rating/index.js +0 -57
- package/node/Select/SelectDownshift.js +0 -41
- package/node/Select/components.js +0 -15
- package/node/Select/index.js +0 -7
- package/node/Sidebar/Sidebar.js +0 -27
- package/node/Sidebar/index.js +0 -4
- package/node/Spacing/Spacing.js +0 -49
- package/node/Spacing/index.js +0 -4
- package/node/Sticky/Sticky.js +0 -222
- package/node/Sticky/StickyCss.js +0 -10
- package/node/Sticky/index.js +0 -4
- package/node/Tabs/TabsMui.js +0 -49
- package/node/Tabs/index.js +0 -4
- package/node/Tabs/sc/bare.js +0 -87
- package/node/Tabs/tw/bare.js +0 -20
- package/node/Tabs/tw/material.js +0 -21
- package/node/Tabs/useTabs.js +0 -48
- package/node/Typography/CopyPasteVisible.js +0 -7
- package/node/Typography/Native.js +0 -17
- package/node/Typography/ReadMore.js +0 -47
- package/node/Typography/TextLoop.js +0 -51
- package/node/Typography/TypeStairs.js +0 -53
- package/node/Typography/index.js +0 -8
- package/node/css/index.js +0 -36
- package/node/helpers/classed.js +0 -72
- package/node/helpers/extend-component.js +0 -16
- package/node/helpers/index.js +0 -5
- package/node/hooks/index.js +0 -18
- package/node/hooks/types.js +0 -2
- package/node/hooks/useAsyncFn.js +0 -40
- package/node/hooks/useDateLocale.js +0 -42
- package/node/hooks/useEffectOnce.js +0 -12
- package/node/hooks/useFirstMountState.js +0 -16
- package/node/hooks/useFocus.js +0 -15
- package/node/hooks/useId.js +0 -12
- package/node/hooks/useIsomorphicLayoutEffect.js +0 -11
- package/node/hooks/useMount.js +0 -13
- package/node/hooks/useMountedState.js +0 -19
- package/node/hooks/usePrevious.js +0 -12
- package/node/hooks/useScrollPosition.js +0 -84
- package/node/hooks/useScrollTo.js +0 -25
- package/node/hooks/useTraceUpdate.js +0 -25
- package/node/hooks/useUpdateEffect.js +0 -18
- package/node/hooks/useWindowSize.js +0 -17
- package/node/index.js +0 -8
- package/node/m/MotionProvider.js +0 -43
- package/node/m/index.js +0 -9
- package/node/m/lite.js +0 -4
- package/node/m/max.js +0 -4
- package/node/sc/index.js +0 -37
- package/node/scm/index.js +0 -36
- package/node/shared/index.js +0 -11
- package/node/styles/Body.js +0 -16
- package/node/styles/Global.js +0 -21
- package/node/styles/index.js +0 -10
- package/node/styles/media.js +0 -160
- package/node/styles/spacing.js +0 -52
- package/node/styles/styled.js +0 -17
- package/node/styles/theme--vanilla.js +0 -61
- package/node/styles/theme.js +0 -45
- package/node/tw/index.js +0 -36
- package/node/twm/index.js +0 -36
- package/node/types.js +0 -2
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useToggle = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var react_1 = require("react");
|
|
7
|
-
var react_hook_form_1 = require("react-hook-form");
|
|
8
|
-
var styles_1 = require("../styles");
|
|
9
|
-
/**
|
|
10
|
-
* This hook is meant to powere Checkboxes, Switches and checkbox-like Radios
|
|
11
|
-
* components, it works in fact in two modes:
|
|
12
|
-
*
|
|
13
|
-
* 1: behaviour as standard checkbox
|
|
14
|
-
* yup validation would simply look like:
|
|
15
|
-
*
|
|
16
|
-
* ```ts
|
|
17
|
-
* privacy: boolean().required(),
|
|
18
|
-
* // add `.nullable()` if you do not provide a boolean `defaultValue`
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* 2: beahviour as two radio for checkbox with custom true/false values as
|
|
22
|
-
* strings yup validation would look like:
|
|
23
|
-
*
|
|
24
|
-
* ```ts
|
|
25
|
-
* newsletter: string().oneOf(["yes", "no"]).required(),
|
|
26
|
-
* // add `.nullable()` if you do not provide a string `defaultValue`
|
|
27
|
-
*
|
|
28
|
-
* // to do not make it required and avoid triggering an error when the input is
|
|
29
|
-
* // untouched you need to set the default value of the input in the form
|
|
30
|
-
* // initialization's `defaultValues` as such:
|
|
31
|
-
*
|
|
32
|
-
* useForm({ defaultValues: { newsletter: "no" }})
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* To enable this mode either pass the props `valueTrue` and `valueFalse` or
|
|
36
|
-
* an array of options with the shape of `Option`
|
|
37
|
-
*/
|
|
38
|
-
function useToggle(props, ref) {
|
|
39
|
-
var name = props.name, control = props.control, register = props.register, label = props.label, options = props.options, propValue = props.value, restProps = tslib_1.__rest(props, ["name", "control", "register", "label", "options", "value"]);
|
|
40
|
-
var id = restProps.id, valueTrue = restProps.valueTrue, valueFalse = restProps.valueFalse,
|
|
41
|
-
// defaultChecked,
|
|
42
|
-
// defaultValue,
|
|
43
|
-
// eslint-disable-next-line prefer-const
|
|
44
|
-
remainingInputProps = tslib_1.__rest(restProps, ["id", "valueTrue", "valueFalse"]);
|
|
45
|
-
// use options data convention to pass on the true/false values
|
|
46
|
-
if (options) {
|
|
47
|
-
valueTrue = options
|
|
48
|
-
.filter(function (opt) { return opt.value === "true"; })[0]
|
|
49
|
-
.label.toString();
|
|
50
|
-
valueFalse = options
|
|
51
|
-
.filter(function (opt) { return opt.value === "false"; })[0]
|
|
52
|
-
.label.toString();
|
|
53
|
-
}
|
|
54
|
-
id = "switch-".concat(name);
|
|
55
|
-
var idTrue = "".concat(id, "-true");
|
|
56
|
-
var idFalse = "".concat(id, "-false");
|
|
57
|
-
var isRadio = !!(valueTrue && valueFalse);
|
|
58
|
-
// // manage default values for both toggle modes
|
|
59
|
-
// defaultChecked = isUndefined(defaultChecked) ? false : defaultChecked;
|
|
60
|
-
// // TODO: maybe throw an error if the defaultValue that arrives here is not
|
|
61
|
-
// // a valid value
|
|
62
|
-
// defaultValue =
|
|
63
|
-
// defaultValue === valueTrue || defaultValue === valueFalse
|
|
64
|
-
// ? defaultValue
|
|
65
|
-
// : valueFalse;
|
|
66
|
-
// get the value either from the uncontrolled watched input or from the given
|
|
67
|
-
// prop to control the component
|
|
68
|
-
var value = (0, react_hook_form_1.useWatch)({
|
|
69
|
-
name: name,
|
|
70
|
-
control: control,
|
|
71
|
-
// defaultValue: isRadio ? defaultValue : defaultChecked,
|
|
72
|
-
});
|
|
73
|
-
if (propValue) {
|
|
74
|
-
value = propValue;
|
|
75
|
-
}
|
|
76
|
-
// get the input props needed by react-hook-form, first check if we have
|
|
77
|
-
// a `register` function, then check if we have a `control` object or just
|
|
78
|
-
// rely on the `name` prop and `ref`, they probably would be passed alongside
|
|
79
|
-
// an `onChange` prop that is spreaded on the inputs
|
|
80
|
-
var inputProps = (0, react_1.useMemo)(function () {
|
|
81
|
-
return register
|
|
82
|
-
? register(name)
|
|
83
|
-
: control
|
|
84
|
-
? control.register(name)
|
|
85
|
-
: {
|
|
86
|
-
name: name,
|
|
87
|
-
ref: ref,
|
|
88
|
-
};
|
|
89
|
-
}, [register, control, name, ref]);
|
|
90
|
-
/**
|
|
91
|
-
* Accessibility.
|
|
92
|
-
*
|
|
93
|
-
* Fake the spacebar keyboard behaviour on the radio mode of the checkbox.
|
|
94
|
-
* Without this *only* the arrow keys would change the checkbox state
|
|
95
|
-
*/
|
|
96
|
-
var handleKeyDown = (0, react_1.useCallback)(function (event) {
|
|
97
|
-
if (event.key === " ") {
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
event.stopPropagation();
|
|
100
|
-
var firstInput = event.target;
|
|
101
|
-
var next = firstInput.nextElementSibling;
|
|
102
|
-
var prev = firstInput.previousElementSibling;
|
|
103
|
-
var secondInput = (next === null || next === void 0 ? void 0 : next.tagName) === "INPUT" ? next : prev;
|
|
104
|
-
var target = firstInput;
|
|
105
|
-
if (firstInput.checked) {
|
|
106
|
-
target = secondInput;
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
if (!secondInput.checked) {
|
|
110
|
-
target =
|
|
111
|
-
firstInput.value === valueTrue ? firstInput : secondInput;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (target)
|
|
115
|
-
target.click();
|
|
116
|
-
}
|
|
117
|
-
}, [valueTrue]);
|
|
118
|
-
// collect all the return values that are dependent on the current value
|
|
119
|
-
// of the input
|
|
120
|
-
var valueDependentProps = (0, react_1.useMemo)(function () { return ({
|
|
121
|
-
rootProps: {
|
|
122
|
-
htmlFor: isRadio
|
|
123
|
-
? !value || value === valueFalse
|
|
124
|
-
? idTrue
|
|
125
|
-
: idFalse
|
|
126
|
-
: id,
|
|
127
|
-
},
|
|
128
|
-
label: label ? label : value,
|
|
129
|
-
value: value,
|
|
130
|
-
}); }, [value, valueFalse, isRadio, id, idTrue, idFalse, label]);
|
|
131
|
-
var Inputs = (0, react_1.useMemo)(function () {
|
|
132
|
-
return isRadio ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: idFalse }, inputProps, remainingInputProps, { onKeyDown: handleKeyDown, type: "radio", value: valueFalse })), (0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: idTrue }, inputProps, remainingInputProps, { onKeyDown: handleKeyDown, type: "radio", value: valueTrue }))] })) : ((0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: id, type: "checkbox" }, inputProps, remainingInputProps)));
|
|
133
|
-
}, [
|
|
134
|
-
inputProps,
|
|
135
|
-
remainingInputProps,
|
|
136
|
-
handleKeyDown,
|
|
137
|
-
isRadio,
|
|
138
|
-
idFalse,
|
|
139
|
-
idTrue,
|
|
140
|
-
valueFalse,
|
|
141
|
-
valueTrue,
|
|
142
|
-
id,
|
|
143
|
-
// defaultChecked,
|
|
144
|
-
// defaultValue,
|
|
145
|
-
]);
|
|
146
|
-
// console.log("useToggle: render", value);
|
|
147
|
-
return tslib_1.__assign(tslib_1.__assign({}, valueDependentProps), { Inputs: Inputs });
|
|
148
|
-
}
|
|
149
|
-
exports.useToggle = useToggle;
|
package/node/Forms/antispam.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decodeForm = exports.encodeForm = void 0;
|
|
4
|
-
var yup_1 = require("yup");
|
|
5
|
-
var utils_1 = require("@koine/utils");
|
|
6
|
-
/**
|
|
7
|
-
* Encode form
|
|
8
|
-
*
|
|
9
|
-
* Takes a record of yup validations and outputs a `yup` schema with encoded
|
|
10
|
-
* names (antispam technique) and a record of the encoded/decoded input `name`s.
|
|
11
|
-
*
|
|
12
|
-
* We skip the names prefixed wth an underscore which are considered programmatic
|
|
13
|
-
* form data not created by user input.
|
|
14
|
-
*/
|
|
15
|
-
function encodeForm(validationRules) {
|
|
16
|
-
var encoded = {};
|
|
17
|
-
var encodedNames = {};
|
|
18
|
-
for (var name_1 in validationRules) {
|
|
19
|
-
if (!name_1.startsWith("_")) {
|
|
20
|
-
var encodedName = (0, utils_1.encode)(name_1);
|
|
21
|
-
encoded[encodedName] = validationRules[name_1];
|
|
22
|
-
encodedNames[name_1] = encodedName;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
// we need `.required()` to correctly infer the type @see
|
|
26
|
-
// https://github.com/jquense/yup/issues/946
|
|
27
|
-
var encodedSchema = (0, yup_1.object)(encoded).required();
|
|
28
|
-
return { encodedSchema: encodedSchema, encodedNames: encodedNames };
|
|
29
|
-
}
|
|
30
|
-
exports.encodeForm = encodeForm;
|
|
31
|
-
/**
|
|
32
|
-
* Decode form data
|
|
33
|
-
*
|
|
34
|
-
* This function is meant to be used inside an api endpoint to gather an encoded
|
|
35
|
-
* form submit data and transform it to the decoded desired json data.
|
|
36
|
-
*
|
|
37
|
-
* Here too we skip encoding/decoding process for names prefixed wth an underscore
|
|
38
|
-
* which are considered programmatic form data not created by user input.
|
|
39
|
-
*/
|
|
40
|
-
function decodeForm(formData) {
|
|
41
|
-
var json = {};
|
|
42
|
-
for (var encodedName in formData) {
|
|
43
|
-
var decodedName = (0, utils_1.decode)(encodedName);
|
|
44
|
-
// always add underscore prefixed names as they are treated as internal
|
|
45
|
-
// private inputs outside of the honeypot system, normalise them here removing
|
|
46
|
-
// the underscore prefix
|
|
47
|
-
if (encodedName.startsWith("_")) {
|
|
48
|
-
// @ts-expect-error nevermind
|
|
49
|
-
json[encodedName.substring(1)] = formData[encodedName];
|
|
50
|
-
}
|
|
51
|
-
// if the decoded `name` is empty and the encoded `name` is defined honeypot passed
|
|
52
|
-
else if (!(0, utils_1.isUndefined)(formData[encodedName]) &&
|
|
53
|
-
formData[decodedName] === "") {
|
|
54
|
-
// @ts-expect-error nevermind
|
|
55
|
-
json[decodedName] = formData[encodedName];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
// console.log(formData, decoded, json);
|
|
59
|
-
return json;
|
|
60
|
-
}
|
|
61
|
-
exports.decodeForm = decodeForm;
|
package/node/Forms/helpers.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.triggerChange = exports.triggerOnChange = exports.defaultOptionsFilterFn = exports.normaliseOptions = void 0;
|
|
4
|
-
var utils_1 = require("@koine/utils");
|
|
5
|
-
var normaliseOptions = function (options) {
|
|
6
|
-
if (options === void 0) { options = []; }
|
|
7
|
-
return options.map(function (option) {
|
|
8
|
-
return (0, utils_1.isString)(option)
|
|
9
|
-
? {
|
|
10
|
-
label: option,
|
|
11
|
-
value: option,
|
|
12
|
-
}
|
|
13
|
-
: option;
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
exports.normaliseOptions = normaliseOptions;
|
|
17
|
-
function defaultOptionsFilterFn(options, inputValue) {
|
|
18
|
-
if (!inputValue) {
|
|
19
|
-
return options;
|
|
20
|
-
}
|
|
21
|
-
return (0, utils_1.matchSorter)(options, inputValue, { keys: ["value", "label"] });
|
|
22
|
-
}
|
|
23
|
-
exports.defaultOptionsFilterFn = defaultOptionsFilterFn;
|
|
24
|
-
/**
|
|
25
|
-
* We are faking the native input `onChange` event
|
|
26
|
-
*/
|
|
27
|
-
function triggerOnChange(onChange, name, value) {
|
|
28
|
-
// @ts-expect-error nevermind
|
|
29
|
-
if (onChange)
|
|
30
|
-
onChange({ target: { name: name, value: value } });
|
|
31
|
-
}
|
|
32
|
-
exports.triggerOnChange = triggerOnChange;
|
|
33
|
-
/**
|
|
34
|
-
* @see https://hustle.bizongo.in/simulate-react-on-change-on-controlled-components-baa336920e04
|
|
35
|
-
* @deprecated
|
|
36
|
-
*/
|
|
37
|
-
function triggerChange(input, value) {
|
|
38
|
-
var obj = window.Object;
|
|
39
|
-
if (!obj) {
|
|
40
|
-
// if (process.env["NODE_ENV"] !== "production") {
|
|
41
|
-
// console.warn("triggerChange: window.Object does not exists, bailing.");
|
|
42
|
-
// }
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
// @ts-expect-error nevermind
|
|
46
|
-
var nativeInputValueSetter = obj.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
|
|
47
|
-
// @ts-expect-error nevermind
|
|
48
|
-
nativeInputValueSetter.call(input, value);
|
|
49
|
-
var inputEvent = new Event("input", { bubbles: true });
|
|
50
|
-
input.dispatchEvent(inputEvent);
|
|
51
|
-
}
|
|
52
|
-
exports.triggerChange = triggerChange;
|
package/node/Forms/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./antispam"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./Checkbox"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./Input"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./InputGroup"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./Feedback"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./Field"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./InputGroup"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./Label"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./Password"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./Radio"), exports);
|
|
14
|
-
// export * from "./Select";
|
|
15
|
-
tslib_1.__exportStar(require("./Switch"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./Textarea"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./Toggle"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./helpers"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./styles"), exports);
|
package/node/Forms/styles.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inputFocus = exports.inputBase = exports.inputReset = exports.inputPadding = exports.inputBorder = exports.inputResetAutofill = exports.InputProgress = exports.InputHoneypot = exports.InputInvisible = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
7
|
-
var styled_1 = require("../styles/styled");
|
|
8
|
-
var ProgressLinear_1 = require("../Progress/ProgressLinear");
|
|
9
|
-
var styled_2 = require("../styles/styled");
|
|
10
|
-
exports.InputInvisible = styled_components_1.default.input(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styled_2.invisible);
|
|
11
|
-
exports.InputHoneypot = (0, styled_components_1.default)(exports.InputInvisible).attrs({
|
|
12
|
-
type: "text",
|
|
13
|
-
autoComplete: "new-password",
|
|
14
|
-
tabIndex: -1,
|
|
15
|
-
})(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject([""], [""])));
|
|
16
|
-
exports.InputProgress = (0, styled_components_1.default)(function (p) { return ((0, jsx_runtime_1.jsx)(ProgressLinear_1.ProgressLinear, tslib_1.__assign({ fg: "var(--accent300)", bg: "var(--accent400)" }, p))); })(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n"], ["\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n"])));
|
|
17
|
-
/**
|
|
18
|
-
* Remove the default light blue background on autofilled inputs. To be used as
|
|
19
|
-
* a function that outputs a CSS string.
|
|
20
|
-
*
|
|
21
|
-
* @see https://stackoverflow.com/a/62624824/1938970
|
|
22
|
-
*/
|
|
23
|
-
exports.inputResetAutofill = "\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-background-clip: text;\n }\n";
|
|
24
|
-
/* FIXME: find a nice way to override this styling from implementation */
|
|
25
|
-
// border-bottom: 1px solid var(--forms-border-color);
|
|
26
|
-
// border: 0;
|
|
27
|
-
exports.inputBorder = "\n border: 1px solid var(--forms-border-color);\n";
|
|
28
|
-
exports.inputPadding = "\n padding: var(--forms-gutter-y) var(--forms-gutter-x);\n";
|
|
29
|
-
exports.inputReset = "\n width: 100%;\n min-height: 44px;\n ".concat(exports.inputBorder, "\n ").concat(exports.inputPadding, "\n");
|
|
30
|
-
exports.inputBase = "\n ".concat(exports.inputReset, "\n ").concat(exports.inputResetAutofill, "\n background: transparent;\n");
|
|
31
|
-
exports.inputFocus = "\n &:focus {\n outline: 0px;\n appearance: none;\n ".concat(styled_1.stateFocus, "\n }\n");
|
|
32
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
package/node/Gauge/Gauge.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import styled, { keyframes } from "styled-components";
|
|
3
|
-
// import { m } from "framer-motion";
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.Gauge = void 0;
|
|
6
|
-
var Gauge = function (_props) { return null; };
|
|
7
|
-
exports.Gauge = Gauge;
|
|
8
|
-
// export type GaugeProps = {
|
|
9
|
-
// /** In percentage */
|
|
10
|
-
// value: number;
|
|
11
|
-
// };
|
|
12
|
-
// export const Gauge = ({
|
|
13
|
-
// value,
|
|
14
|
-
// counter = true,
|
|
15
|
-
// stroke,
|
|
16
|
-
// // emptyStroke = "#e2e2e2",
|
|
17
|
-
// emptyStroke = stroke,
|
|
18
|
-
// emptyStrokeOpacity = 0.25,
|
|
19
|
-
// // emptyStrokeOpacity = 1,
|
|
20
|
-
// duration = 3,
|
|
21
|
-
// delay = 0.5,
|
|
22
|
-
// size = 100,
|
|
23
|
-
// strokeWidth = 6,
|
|
24
|
-
// }) => {
|
|
25
|
-
// const radius = 45;
|
|
26
|
-
// const circumference = Math.ceil(2 * Math.PI * radius);
|
|
27
|
-
// const fillPercents = Math.abs(
|
|
28
|
-
// Math.ceil((circumference / 100) * (value - 100))
|
|
29
|
-
// );
|
|
30
|
-
// const transition = {
|
|
31
|
-
// duration: duration,
|
|
32
|
-
// delay: delay,
|
|
33
|
-
// ease: "easeIn",
|
|
34
|
-
// };
|
|
35
|
-
// const variants = {
|
|
36
|
-
// hidden: {
|
|
37
|
-
// strokeDashoffset: circumference,
|
|
38
|
-
// transition,
|
|
39
|
-
// },
|
|
40
|
-
// show: {
|
|
41
|
-
// strokeDashoffset: fillPercents,
|
|
42
|
-
// transition,
|
|
43
|
-
// },
|
|
44
|
-
// };
|
|
45
|
-
// return (
|
|
46
|
-
// <>
|
|
47
|
-
// <Flex justifyContent="center" alignItems="center">
|
|
48
|
-
// {counter && (
|
|
49
|
-
// <Box
|
|
50
|
-
// position="absolute"
|
|
51
|
-
// fontSize={size >= 100 ? 6 : 3}
|
|
52
|
-
// fontWeight={2}
|
|
53
|
-
// color="text500"
|
|
54
|
-
// >
|
|
55
|
-
// <Counter valueTo={value} totalDuration={duration + delay} />%
|
|
56
|
-
// </Box>
|
|
57
|
-
// )}
|
|
58
|
-
// <Box height={size}>
|
|
59
|
-
// <svg
|
|
60
|
-
// viewBox="0 0 100 100"
|
|
61
|
-
// version="1.1"
|
|
62
|
-
// xmlns="http://www.w3.org/2000/svg"
|
|
63
|
-
// width={size}
|
|
64
|
-
// height={size}
|
|
65
|
-
// >
|
|
66
|
-
// <circle
|
|
67
|
-
// cx="50"
|
|
68
|
-
// cy="50"
|
|
69
|
-
// r={radius}
|
|
70
|
-
// className="circle"
|
|
71
|
-
// strokeWidth={strokeWidth}
|
|
72
|
-
// stroke={emptyStroke}
|
|
73
|
-
// strokeOpacity={emptyStrokeOpacity}
|
|
74
|
-
// fill="transparent"
|
|
75
|
-
// />
|
|
76
|
-
// </svg>
|
|
77
|
-
// <svg
|
|
78
|
-
// viewBox="0 0 100 100"
|
|
79
|
-
// width={size}
|
|
80
|
-
// height={size}
|
|
81
|
-
// style={{
|
|
82
|
-
// position: "absolute",
|
|
83
|
-
// transform: "rotate(-90deg)",
|
|
84
|
-
// overflow: "visible",
|
|
85
|
-
// marginLeft: -size,
|
|
86
|
-
// }}
|
|
87
|
-
// >
|
|
88
|
-
// <m.circle
|
|
89
|
-
// cx="50"
|
|
90
|
-
// cy="50"
|
|
91
|
-
// r={radius}
|
|
92
|
-
// strokeWidth={strokeWidth}
|
|
93
|
-
// stroke={stroke}
|
|
94
|
-
// fill="transparent"
|
|
95
|
-
// strokeDashoffset={fillPercents}
|
|
96
|
-
// strokeDasharray={circumference}
|
|
97
|
-
// variants={variants}
|
|
98
|
-
// initial="hidden"
|
|
99
|
-
// animate={"show"}
|
|
100
|
-
// />
|
|
101
|
-
// </svg>
|
|
102
|
-
// </Box>
|
|
103
|
-
// </Flex>
|
|
104
|
-
// </>
|
|
105
|
-
// );
|
|
106
|
-
// };
|
package/node/Grid/Grid.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Col = exports.Row = exports.ContainerFluid = exports.Container = exports.GRID_GUTTER_DEFAULT = exports.GRID_COLUMNS = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
exports.GRID_COLUMNS = 12;
|
|
7
|
-
exports.GRID_GUTTER_DEFAULT = "half";
|
|
8
|
-
exports.Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n max-width: ", "px;\n margin: 0 auto;\n padding: 0 ", "px;\n ", "\n"], ["\n max-width: ", "px;\n margin: 0 auto;\n padding: 0 ", "px;\n ", "\n"])), function (p) { return p.theme.breakpoints[p.size]; }, function (p) { return p.theme.gutter[p.$gutter || exports.GRID_GUTTER_DEFAULT]; }, function (p) { return (p.clamp ? "overflow: hidden;" : ""); });
|
|
9
|
-
exports.ContainerFluid = styled_components_1.default.div(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n padding: 0 ", "px;\n"], ["\n padding: 0 ", "px;\n"])), function (p) { return p.theme.gutter[p.$gutter || exports.GRID_GUTTER_DEFAULT]; });
|
|
10
|
-
exports.Row = styled_components_1.default.div(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n margin: 0 -", "px;\n display: flex;\n ", "\n ", ";\n ", "\n"], ["\n margin: 0 -", "px;\n display: flex;\n ", "\n ", ";\n ", "\n"])), function (p) { return p.theme.gutter[p.$gutter || exports.GRID_GUTTER_DEFAULT]; }, function (p) { return (p.$noWrap ? "overflow: auto;" : "flex-wrap: wrap;"); }, function (p) { return (p.$valign ? "align-items: ".concat(p.$valign) : ""); }, function (p) {
|
|
11
|
-
return p.$reverse &&
|
|
12
|
-
"@media (".concat(p.$reverse.split(":")[0], "-width: ").concat(p.$reverse.split(":")[1], "px) {\n flex-direction: row-reverse;\n }");
|
|
13
|
-
});
|
|
14
|
-
exports.Col = styled_components_1.default.div(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n padding: 0 ", "px;\n display: ", ";\n ", ";\n ", ";\n"], ["\n padding: 0 ", "px;\n display: ", ";\n ", ";\n ", ";\n"])), function (p) { return p.theme.gutter[p.$gutter || exports.GRID_GUTTER_DEFAULT]; }, function (p) { return (p.$flex ? "flex" : "block"); }, function (p) { return (p.$valign ? "align-items: " + p.$valign : ""); }, function (p) { return getColCss(p); });
|
|
15
|
-
function getColWidth(breakpoints, breakpoint, value) {
|
|
16
|
-
var breakpointValue = breakpoints[breakpoint] + "px";
|
|
17
|
-
var width = (value * 100) / exports.GRID_COLUMNS;
|
|
18
|
-
var cssValue = "\n min-width: ".concat(width, "%;\n flex: 0 0 ").concat(width, "%;\n");
|
|
19
|
-
if (breakpoint === Object.keys(breakpoints)[0]) {
|
|
20
|
-
return cssValue;
|
|
21
|
-
}
|
|
22
|
-
return "\n @media (min-width: ".concat(breakpointValue, "){\n ").concat(cssValue, "\n }");
|
|
23
|
-
}
|
|
24
|
-
function getColCss(props) {
|
|
25
|
-
var $auto = props.$auto, $offset = props.$offset, $width = props.$width;
|
|
26
|
-
var breakpoints = props.theme.breakpoints;
|
|
27
|
-
var css = "";
|
|
28
|
-
if ($offset) {
|
|
29
|
-
var offsets = $offset.split(",");
|
|
30
|
-
for (var i = 0; i <= offsets.length; i++) {
|
|
31
|
-
if (offsets[i]) {
|
|
32
|
-
var _a = offsets[i].split(":"), offsetBreakpoint = _a[0], offsetSize = _a[1];
|
|
33
|
-
css += " \n @media(min-width: ".concat(breakpoints[offsetBreakpoint], "px){\n margin-left: ").concat((100 * offsetSize) / exports.GRID_COLUMNS, "%;\n }\n ");
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if ($width) {
|
|
38
|
-
// do nothing, width is set explicitly
|
|
39
|
-
}
|
|
40
|
-
else if ($auto) {
|
|
41
|
-
css += "flex: 0 0 auto; width: auto; max-width: none;";
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
for (var breakpoint in breakpoints) {
|
|
45
|
-
var value = props[breakpoint];
|
|
46
|
-
if (typeof value !== "undefined") {
|
|
47
|
-
css += getColWidth(breakpoints, breakpoint, value);
|
|
48
|
-
}
|
|
49
|
-
else if (breakpoint === "xs") {
|
|
50
|
-
css += getColWidth(breakpoints, breakpoint, 12);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return css;
|
|
55
|
-
}
|
|
56
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
package/node/Grid/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hamburger = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
/**
|
|
7
|
-
* @file
|
|
8
|
-
*
|
|
9
|
-
* Simplified from https://github.com/luukdv/hamburger-react
|
|
10
|
-
*/
|
|
11
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
12
|
-
var HamburgerLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n position: absolute;\n top: 30px;\n font-size: ", ";\n text-transform: uppercase;\n left: 7px;\n letter-spacing: 3px;\n"], ["\n position: absolute;\n top: 30px;\n font-size: ", ";\n text-transform: uppercase;\n left: 7px;\n letter-spacing: 3px;\n"])), function (_a) {
|
|
13
|
-
var $toggled = _a.$toggled;
|
|
14
|
-
return ($toggled ? "0" : "9px");
|
|
15
|
-
});
|
|
16
|
-
var area = 48;
|
|
17
|
-
var lines = 3;
|
|
18
|
-
var width = 32;
|
|
19
|
-
var room = Math.round((area - width) / 2);
|
|
20
|
-
var barHeightRaw = width / 12;
|
|
21
|
-
var barHeight = Math.round(barHeightRaw);
|
|
22
|
-
var space = 0.5;
|
|
23
|
-
var marginRaw = width / (lines * (space + (lines === 3 ? 1 : 1.25)));
|
|
24
|
-
var margin = Math.round(marginRaw);
|
|
25
|
-
var height = barHeight * lines + margin * (lines - 1);
|
|
26
|
-
var topOffset = Math.round((area - height) / 2);
|
|
27
|
-
var translate = 4.6325;
|
|
28
|
-
var deviation = (barHeightRaw - barHeight + (marginRaw - margin)) / (lines === 3 ? 1 : 2);
|
|
29
|
-
var move = parseFloat((width / translate - deviation / (4 / 3)).toFixed(2));
|
|
30
|
-
var time = 0.4;
|
|
31
|
-
var easing = "cubic-bezier(0, 0, 0, 1)";
|
|
32
|
-
var transition = "".concat(time, "s ").concat(easing);
|
|
33
|
-
var burgerStyles = {
|
|
34
|
-
marginRight: "-8px",
|
|
35
|
-
position: "relative",
|
|
36
|
-
width: "".concat(area, "px"),
|
|
37
|
-
height: "".concat(area, "px"),
|
|
38
|
-
userSelect: "none",
|
|
39
|
-
outline: "0px",
|
|
40
|
-
cursor: "pointer",
|
|
41
|
-
transition: transition,
|
|
42
|
-
};
|
|
43
|
-
var barStyles = {
|
|
44
|
-
position: "absolute",
|
|
45
|
-
width: "".concat(width, "px"),
|
|
46
|
-
height: "".concat(barHeight, "px"),
|
|
47
|
-
left: "".concat(room, "px"),
|
|
48
|
-
background: "currentColor",
|
|
49
|
-
transition: transition,
|
|
50
|
-
};
|
|
51
|
-
var Hamburger = function (_a) {
|
|
52
|
-
var toggled = _a.toggled, props = tslib_1.__rest(_a, ["toggled"]);
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ style: tslib_1.__assign(tslib_1.__assign({}, burgerStyles), { transform: "".concat(toggled ? "rotate(90deg)" : "none") }), tabIndex: 0 }, props, { children: [(0, jsx_runtime_1.jsx)("div", { style: tslib_1.__assign(tslib_1.__assign({}, barStyles), { top: "".concat(topOffset, "px"), transform: "".concat(toggled ? "rotate(-45deg) translate(0px, ".concat(move, "px)") : "none") }) }), (0, jsx_runtime_1.jsx)("div", { style: tslib_1.__assign(tslib_1.__assign({}, barStyles), { top: "".concat(topOffset + barHeight + margin, "px"), transform: "".concat(toggled ? "rotate(45deg) translate(0, -".concat(move, "px)") : "none") }) }), (0, jsx_runtime_1.jsx)(HamburgerLabel, tslib_1.__assign({ "$toggled": toggled }, { children: "Menu" }))] })));
|
|
54
|
-
};
|
|
55
|
-
exports.Hamburger = Hamburger;
|
|
56
|
-
var templateObject_1;
|
package/node/Hamburger/index.js
DELETED
package/node/Header/index.js
DELETED
package/node/Header/useHeader.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useHeader = void 0;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var useScrollPosition_1 = require("../hooks/useScrollPosition");
|
|
6
|
-
var theme_1 = require("../styles/theme");
|
|
7
|
-
var media_1 = require("../styles/media");
|
|
8
|
-
var useHeader = function () {
|
|
9
|
-
var _a = (0, react_1.useState)(false), isSticky = _a[0], setIsSticky = _a[1];
|
|
10
|
-
var themed = (0, theme_1.useTheme)().header;
|
|
11
|
-
var isDesktopLayout = (0, media_1.useMedia)("min:".concat(themed.breakpoint));
|
|
12
|
-
var valueIdx = isDesktopLayout ? 1 : 0;
|
|
13
|
-
var _b = (0, react_1.useState)(themed.height[valueIdx]), headerHeight = _b[0], setHeaderHeight = _b[1];
|
|
14
|
-
var _c = (0, react_1.useState)(themed.height[valueIdx]), placeholderHeight = _c[0], setPlaceholderHeight = _c[1];
|
|
15
|
-
var _d = (0, react_1.useState)(themed.logoWidth[valueIdx]), logoWidth = _d[0], setLogoWidth = _d[1];
|
|
16
|
-
(0, useScrollPosition_1.useScrollPosition)(function (currentPosition) {
|
|
17
|
-
var isPastThreshold = currentPosition.y * -1 > 40;
|
|
18
|
-
if (isSticky !== isPastThreshold)
|
|
19
|
-
setIsSticky(isPastThreshold);
|
|
20
|
-
}, [isSticky]);
|
|
21
|
-
(0, react_1.useEffect)(function () {
|
|
22
|
-
var valueIdx = isDesktopLayout ? 1 : 0;
|
|
23
|
-
setPlaceholderHeight(themed.height[valueIdx]);
|
|
24
|
-
setHeaderHeight(isSticky ? themed.heightSticky[valueIdx] : themed.height[valueIdx]);
|
|
25
|
-
setLogoWidth(isSticky ? themed.logoWidthSticky[valueIdx] : themed.logoWidth[valueIdx]);
|
|
26
|
-
}, [themed, isSticky, isDesktopLayout]);
|
|
27
|
-
return [
|
|
28
|
-
isSticky,
|
|
29
|
-
placeholderHeight,
|
|
30
|
-
headerHeight,
|
|
31
|
-
logoWidth,
|
|
32
|
-
];
|
|
33
|
-
};
|
|
34
|
-
exports.useHeader = useHeader;
|
package/node/Hidden/Hidden.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hidden = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
exports.Hidden = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
7
|
-
return "".concat(p.$min
|
|
8
|
-
? "\n @media (min-width: ".concat(p.theme.breakpoints[p.$min], "px) {\n display: none;\n }")
|
|
9
|
-
: "", " ").concat(p.$max
|
|
10
|
-
? "\n @media (max-width: ".concat(p.theme.breakpoints[p.$max], "px) {\n display: none;\n }")
|
|
11
|
-
: "");
|
|
12
|
-
});
|
|
13
|
-
var templateObject_1;
|
package/node/Hidden/index.js
DELETED
package/node/Img/index.js
DELETED
package/node/Img/sc/bare.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KoineImg = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
|
|
6
|
-
// export type KoineImgProps = {
|
|
7
|
-
// /** @default "cover" */
|
|
8
|
-
// $fit?: "cover" | "contain";
|
|
9
|
-
// };
|
|
10
|
-
exports.KoineImg = styled_components_1.default.img(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
|
|
11
|
-
var templateObject_1;
|
|
12
|
-
// export const KoineImg = styled.img<KoineImgProps>`
|
|
13
|
-
// object-fit: ${(p) => p.$fit || "cover"};
|
|
14
|
-
// `;
|
|
15
|
-
// /**
|
|
16
|
-
// * Replacement core component for native `<img />`
|
|
17
|
-
// *
|
|
18
|
-
// * Features:
|
|
19
|
-
// * - lazy load
|
|
20
|
-
// * - proportion cage
|
|
21
|
-
// */
|
|
22
|
-
// export const Img = ({
|
|
23
|
-
// className,
|
|
24
|
-
// style = {},
|
|
25
|
-
// lazyProps,
|
|
26
|
-
// ...props
|
|
27
|
-
// }: ImgProps) => {
|
|
28
|
-
// let { width, height, src } = props;
|
|
29
|
-
// width = width ? `${width}px` : "100%";
|
|
30
|
-
// height = height ? `${height}px` : "100%";
|
|
31
|
-
// const imgProps = { width, height, src };
|
|
32
|
-
// return (
|
|
33
|
-
// <ImgRoot style={{ width, height, ...style }} className={className}>
|
|
34
|
-
// <LazyLoad {...lazyProps}>
|
|
35
|
-
// <ImgNative {...imgProps} />
|
|
36
|
-
// </LazyLoad>
|
|
37
|
-
// <noscript>
|
|
38
|
-
// <img {...imgProps} />
|
|
39
|
-
// </noscript>
|
|
40
|
-
// </ImgRoot>
|
|
41
|
-
// );
|
|
42
|
-
// };
|