@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,62 +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
|
-
CheckboxRoot: function() {
|
|
13
|
-
return CheckboxRoot;
|
|
14
|
-
},
|
|
15
|
-
CheckboxToggle: function() {
|
|
16
|
-
return CheckboxToggle;
|
|
17
|
-
},
|
|
18
|
-
CheckboxIndicator: function() {
|
|
19
|
-
return CheckboxIndicator;
|
|
20
|
-
},
|
|
21
|
-
CheckboxLabel: function() {
|
|
22
|
-
return CheckboxLabel;
|
|
23
|
-
},
|
|
24
|
-
Checkbox: function() {
|
|
25
|
-
return Checkbox;
|
|
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 _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
32
|
-
const _Toggle = require("../Toggle");
|
|
33
|
-
const _useToggle = require("../Toggle/useToggle");
|
|
34
|
-
const CheckboxRoot = _styledcomponents.default.label`
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
`;
|
|
39
|
-
const CheckboxToggle = (0, _styledcomponents.default)(_Toggle.Toggle)`
|
|
40
|
-
pointer-events: none;
|
|
41
|
-
`;
|
|
42
|
-
const CheckboxIndicator = (0, _styledcomponents.default)(_Toggle.ToggleIndicatorSquared)``;
|
|
43
|
-
const CheckboxLabel = (0, _styledcomponents.default)(_Toggle.ToggleLabel)`
|
|
44
|
-
font-size: 0.8em;
|
|
45
|
-
`;
|
|
46
|
-
const Checkbox = /*#__PURE__*/ (0, _react.forwardRef)(function Checkbox(props, ref) {
|
|
47
|
-
const { rootProps, Inputs, label } = (0, _useToggle.useToggle)(props, ref);
|
|
48
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(CheckboxRoot, {
|
|
49
|
-
...rootProps,
|
|
50
|
-
children: [
|
|
51
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(CheckboxToggle, {
|
|
52
|
-
children: [
|
|
53
|
-
Inputs,
|
|
54
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(CheckboxIndicator, {})
|
|
55
|
-
]
|
|
56
|
-
}),
|
|
57
|
-
label && /*#__PURE__*/ (0, _jsxruntime.jsx)(CheckboxLabel, {
|
|
58
|
-
children: label
|
|
59
|
-
})
|
|
60
|
-
]
|
|
61
|
-
});
|
|
62
|
-
});
|
package/Forms/Checkbox/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "Feedback", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return Feedback;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
13
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
14
|
-
const Root = _styledcomponents.default.div`
|
|
15
|
-
margin-top: 0.2em;
|
|
16
|
-
font-size: 12px;
|
|
17
|
-
${(p)=>p.$danger ? `color: var(--danger);` : ""}
|
|
18
|
-
`;
|
|
19
|
-
const Feedback = ({ $danger, children })=>{
|
|
20
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Root, {
|
|
21
|
-
role: "alert",
|
|
22
|
-
$danger: $danger,
|
|
23
|
-
children: children
|
|
24
|
-
});
|
|
25
|
-
};
|
package/Forms/Feedback/index.js
DELETED
package/Forms/Field/Field.js
DELETED
|
@@ -1,75 +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
|
-
field: function() {
|
|
13
|
-
return field;
|
|
14
|
-
},
|
|
15
|
-
FieldBase: function() {
|
|
16
|
-
return FieldBase;
|
|
17
|
-
},
|
|
18
|
-
FieldRoot: function() {
|
|
19
|
-
return FieldRoot;
|
|
20
|
-
},
|
|
21
|
-
Field: function() {
|
|
22
|
-
return Field;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
26
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
27
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard._(require("styled-components"));
|
|
28
|
-
const _Feedback = require("../Feedback");
|
|
29
|
-
const field = (0, _styledcomponents.css)`
|
|
30
|
-
padding-bottom: 20px;
|
|
31
|
-
`;
|
|
32
|
-
const FieldBase = _styledcomponents.default.div`
|
|
33
|
-
${field}
|
|
34
|
-
`;
|
|
35
|
-
const FieldRoot = (0, _styledcomponents.default)(FieldBase)`
|
|
36
|
-
${(p)=>{
|
|
37
|
-
return p.$danger && `
|
|
38
|
-
color: var(--danger);
|
|
39
|
-
|
|
40
|
-
textarea,
|
|
41
|
-
input,
|
|
42
|
-
select {
|
|
43
|
-
color: var(--danger);
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
}}
|
|
47
|
-
`;
|
|
48
|
-
const Field = ({ name, t, error, errors, children, ...props })=>{
|
|
49
|
-
const err = errors && name ? errors[name] : error;
|
|
50
|
-
let msg = "";
|
|
51
|
-
if (err) {
|
|
52
|
-
if (name && t && err.type !== "plain") {
|
|
53
|
-
msg = t(`errors.${name}.${err.type || err.message}`);
|
|
54
|
-
} else {
|
|
55
|
-
msg = err.message;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
// dynamic i18n namespace loading does not seem to work yet
|
|
59
|
-
// const t = useT("core.Forms");
|
|
60
|
-
// const { locale } = useRouter();
|
|
61
|
-
// useEffect(() => {
|
|
62
|
-
// i18n.addResourceBundle(locale, "core.Forms", null);
|
|
63
|
-
// }, []);
|
|
64
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(FieldRoot, {
|
|
65
|
-
$danger: !!err,
|
|
66
|
-
...props,
|
|
67
|
-
children: [
|
|
68
|
-
children,
|
|
69
|
-
msg && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Feedback.Feedback, {
|
|
70
|
-
$danger: true,
|
|
71
|
-
children: msg
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
});
|
|
75
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "FieldControl", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return FieldControl;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
13
|
-
const _react = require("react");
|
|
14
|
-
const _reacthookform = require("react-hook-form");
|
|
15
|
-
const _decode = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/decode"));
|
|
16
|
-
const _styles = require("../styles");
|
|
17
|
-
const _Field = require("./Field");
|
|
18
|
-
const _FieldHint = require("./FieldHint");
|
|
19
|
-
const FieldControl = ({ control, register, setValue, name: maybeEncodedName, label, placeholder, hint, t, showError = true, children, encode, ...props })=>{
|
|
20
|
-
const name = encode ? (0, _decode.default)(maybeEncodedName) : maybeEncodedName;
|
|
21
|
-
const { errors } = (0, _reacthookform.useFormState)({
|
|
22
|
-
name,
|
|
23
|
-
control
|
|
24
|
-
});
|
|
25
|
-
const error = showError && errors[name] ? errors[name] : null;
|
|
26
|
-
const FormFieldContent = (0, _react.useMemo)(()=>children({
|
|
27
|
-
control,
|
|
28
|
-
register,
|
|
29
|
-
setValue,
|
|
30
|
-
name: maybeEncodedName,
|
|
31
|
-
// @see https://github.com/vinissimus/next-translate/pull/461
|
|
32
|
-
// @see https://github.com/vinissimus/next-translate/issues/429
|
|
33
|
-
label: label || t(`labels.${name}`, undefined, {
|
|
34
|
-
default: ""
|
|
35
|
-
}),
|
|
36
|
-
placeholder: placeholder || t(`placeholders.${name}`, undefined, {
|
|
37
|
-
fallback: ""
|
|
38
|
-
})
|
|
39
|
-
}), [
|
|
40
|
-
children,
|
|
41
|
-
control,
|
|
42
|
-
register,
|
|
43
|
-
setValue,
|
|
44
|
-
name,
|
|
45
|
-
label,
|
|
46
|
-
t,
|
|
47
|
-
maybeEncodedName,
|
|
48
|
-
placeholder
|
|
49
|
-
]);
|
|
50
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
51
|
-
children: [
|
|
52
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_Field.Field, {
|
|
53
|
-
name: maybeEncodedName,
|
|
54
|
-
t: t,
|
|
55
|
-
error: error,
|
|
56
|
-
...props,
|
|
57
|
-
children: [
|
|
58
|
-
FormFieldContent,
|
|
59
|
-
hint && /*#__PURE__*/ (0, _jsxruntime.jsx)(_FieldHint.FieldHint, {
|
|
60
|
-
children: hint
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
}),
|
|
64
|
-
encode && register && /*#__PURE__*/ (0, _jsxruntime.jsx)(_styles.InputHoneypot, {
|
|
65
|
-
...register(name)
|
|
66
|
-
})
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
};
|
package/Forms/Field/FieldHint.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "FieldHint", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return FieldHint;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
13
|
-
const FieldHint = _styledcomponents.default.div`
|
|
14
|
-
padding-top: 0.6em;
|
|
15
|
-
opacity: 0.7;
|
|
16
|
-
font-size: 75%;
|
|
17
|
-
`;
|
package/Forms/Field/index.js
DELETED
package/Forms/Input/Input.js
DELETED
|
@@ -1,67 +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
|
-
InputWrap: function() {
|
|
13
|
-
return InputWrap;
|
|
14
|
-
},
|
|
15
|
-
InputMain: function() {
|
|
16
|
-
return InputMain;
|
|
17
|
-
},
|
|
18
|
-
InputPre: function() {
|
|
19
|
-
return InputPre;
|
|
20
|
-
},
|
|
21
|
-
InputPost: function() {
|
|
22
|
-
return InputPost;
|
|
23
|
-
},
|
|
24
|
-
InputNative: function() {
|
|
25
|
-
return InputNative;
|
|
26
|
-
},
|
|
27
|
-
Input: function() {
|
|
28
|
-
return Input;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
32
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
33
|
-
const _react = require("react");
|
|
34
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
35
|
-
const _Label = require("../Label/Label");
|
|
36
|
-
const _styles = require("../styles");
|
|
37
|
-
const InputWrap = _styledcomponents.default.div`
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: space-between;
|
|
41
|
-
`;
|
|
42
|
-
const InputMain = _styledcomponents.default.div`
|
|
43
|
-
flex: 1;
|
|
44
|
-
`;
|
|
45
|
-
const InputPre = _styledcomponents.default.div``;
|
|
46
|
-
const InputPost = _styledcomponents.default.div``;
|
|
47
|
-
const InputNative = _styledcomponents.default.input`
|
|
48
|
-
${_styles.inputBase}
|
|
49
|
-
${_styles.inputFocus}
|
|
50
|
-
`;
|
|
51
|
-
const Input = /*#__PURE__*/ (0, _react.forwardRef)(function Input({ register, name, label, ...props }, ref) {
|
|
52
|
-
// console.log("Input: render");
|
|
53
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
54
|
-
children: [
|
|
55
|
-
label && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.Label, {
|
|
56
|
-
children: label
|
|
57
|
-
}),
|
|
58
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(InputNative, {
|
|
59
|
-
...register ? register(name) : {
|
|
60
|
-
name,
|
|
61
|
-
ref
|
|
62
|
-
},
|
|
63
|
-
...props
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
});
|
package/Forms/Input/index.js
DELETED
|
@@ -1,85 +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
|
-
InputGroupRoot: function() {
|
|
13
|
-
return InputGroupRoot;
|
|
14
|
-
},
|
|
15
|
-
InputGroupMain: function() {
|
|
16
|
-
return InputGroupMain;
|
|
17
|
-
},
|
|
18
|
-
InputGroupButtonPre: function() {
|
|
19
|
-
return InputGroupButtonPre;
|
|
20
|
-
},
|
|
21
|
-
InputGroupButtonPost: function() {
|
|
22
|
-
return InputGroupButtonPost;
|
|
23
|
-
},
|
|
24
|
-
InputGroup: function() {
|
|
25
|
-
return InputGroup;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
29
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
30
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
31
|
-
const _Buttons = require("../../Buttons");
|
|
32
|
-
const _media = require("../../styles/media");
|
|
33
|
-
const _Field = require("../Field");
|
|
34
|
-
const InputGroupRoot = _styledcomponents.default.div`
|
|
35
|
-
${_Field.field}
|
|
36
|
-
display: flex;
|
|
37
|
-
${_media.max.sm} {
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
const InputGroupMain = _styledcomponents.default.div`
|
|
42
|
-
flex: 1;
|
|
43
|
-
`;
|
|
44
|
-
const InputGroupButtonPre = (0, _styledcomponents.default)(_Buttons.KoineButton)`
|
|
45
|
-
${_media.max.sm} {
|
|
46
|
-
border-bottom: 0;
|
|
47
|
-
border-bottom-left-radius: 0;
|
|
48
|
-
border-bottom-right-radius: 0;
|
|
49
|
-
}
|
|
50
|
-
${_media.min.sm} {
|
|
51
|
-
border-right: 0;
|
|
52
|
-
border-top-right-radius: 0;
|
|
53
|
-
border-bottom-right-radius: 0;
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
const InputGroupButtonPost = (0, _styledcomponents.default)(_Buttons.KoineButton)`
|
|
57
|
-
${_media.max.sm} {
|
|
58
|
-
border-top: 0;
|
|
59
|
-
border-top-left-radius: 0;
|
|
60
|
-
border-top-right-radius: 0;
|
|
61
|
-
}
|
|
62
|
-
${_media.min.sm} {
|
|
63
|
-
border-left: 0;
|
|
64
|
-
border-top-left-radius: 0;
|
|
65
|
-
border-bottom-left-radius: 0;
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
68
|
-
const InputGroup = ({ pre, post, Button = _Buttons.KoineButton, btnProps = {}, children, ...props })=>{
|
|
69
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(InputGroupRoot, {
|
|
70
|
-
...props,
|
|
71
|
-
children: [
|
|
72
|
-
pre && /*#__PURE__*/ (0, _jsxruntime.jsx)(InputGroupButtonPre, {
|
|
73
|
-
as: Button,
|
|
74
|
-
...btnProps
|
|
75
|
-
}),
|
|
76
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(InputGroupMain, {
|
|
77
|
-
children: children
|
|
78
|
-
}),
|
|
79
|
-
post && /*#__PURE__*/ (0, _jsxruntime.jsx)(InputGroupButtonPost, {
|
|
80
|
-
as: Button,
|
|
81
|
-
...btnProps
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
});
|
|
85
|
-
};
|
package/Forms/Label/Label.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
label: function() {
|
|
13
|
-
return label;
|
|
14
|
-
},
|
|
15
|
-
labelMaterial: function() {
|
|
16
|
-
return labelMaterial;
|
|
17
|
-
},
|
|
18
|
-
Label: function() {
|
|
19
|
-
return Label;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
23
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
24
|
-
const label = `
|
|
25
|
-
display: flex;
|
|
26
|
-
font-size: 13px;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
`;
|
|
29
|
-
const labelMaterial = `
|
|
30
|
-
z-index: 2;
|
|
31
|
-
position: relative;
|
|
32
|
-
display: inline-block;
|
|
33
|
-
padding: 0 5px;
|
|
34
|
-
font-weight: 100;
|
|
35
|
-
font-size: 10px;
|
|
36
|
-
background: var(--bodyBg);
|
|
37
|
-
transform: translateY(-0.3em) translateX(1em);
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
|
|
40
|
-
+ * {
|
|
41
|
-
margin-top: -1em;
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
const Label = _styledcomponents.default.label`
|
|
45
|
-
${labelMaterial}
|
|
46
|
-
`;
|
package/Forms/Label/index.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
|
-
PasswordInputNative: function() {
|
|
13
|
-
return PasswordInputNative;
|
|
14
|
-
},
|
|
15
|
-
Password: function() {
|
|
16
|
-
return Password;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
21
|
-
const _react = require("react");
|
|
22
|
-
const _im = require("react-icons/im");
|
|
23
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
24
|
-
const _Input = require("../Input/Input");
|
|
25
|
-
const _Label = require("../Label/Label");
|
|
26
|
-
const ICON_WIDTH = "2em";
|
|
27
|
-
const PasswordInputWrap = _styledcomponents.default.div`
|
|
28
|
-
position: relative;
|
|
29
|
-
`;
|
|
30
|
-
const PasswordInputNative = (0, _styledcomponents.default)(_Input.InputNative)`
|
|
31
|
-
position: relative;
|
|
32
|
-
padding-right: ${ICON_WIDTH};
|
|
33
|
-
`;
|
|
34
|
-
const PasswordIcon = _styledcomponents.default.span`
|
|
35
|
-
position: absolute;
|
|
36
|
-
top: 0;
|
|
37
|
-
right: 0;
|
|
38
|
-
bottom: 0;
|
|
39
|
-
width: ${ICON_WIDTH};
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
opacity: 0.5;
|
|
45
|
-
`;
|
|
46
|
-
const Password = /*#__PURE__*/ (0, _react.forwardRef)(function Password({ register, name, label, ...props }, ref) {
|
|
47
|
-
const [visible, setVisible] = (0, _react.useState)(false);
|
|
48
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
49
|
-
children: [
|
|
50
|
-
label && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.Label, {
|
|
51
|
-
children: label
|
|
52
|
-
}),
|
|
53
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(PasswordInputWrap, {
|
|
54
|
-
children: [
|
|
55
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(PasswordInputNative, {
|
|
56
|
-
type: visible ? "text" : "password",
|
|
57
|
-
autoComplete: "new-password",
|
|
58
|
-
...register ? register(name) : {
|
|
59
|
-
name,
|
|
60
|
-
ref
|
|
61
|
-
},
|
|
62
|
-
...props
|
|
63
|
-
}),
|
|
64
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(PasswordIcon, {
|
|
65
|
-
onClick: ()=>setVisible((prev)=>!prev),
|
|
66
|
-
children: visible ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_im.ImEyeBlocked, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_im.ImEye, {})
|
|
67
|
-
})
|
|
68
|
-
]
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
});
|
package/Forms/Password/index.js
DELETED
package/Forms/Radio/Radio.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "Radio", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return Radio;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
13
|
-
const _react = require("react");
|
|
14
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
15
|
-
const _Label = require("../Label/Label");
|
|
16
|
-
const _Toggle = require("../Toggle");
|
|
17
|
-
const _styles = require("../styles");
|
|
18
|
-
const RadioRoot = _styledcomponents.default.div``;
|
|
19
|
-
const RadioLabel = _styledcomponents.default.div`
|
|
20
|
-
${_Label.label}
|
|
21
|
-
`;
|
|
22
|
-
const RadioOptionRoot = _styledcomponents.default.label`
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
padding: 0.05em;
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
`;
|
|
28
|
-
const RadioToggle = (0, _styledcomponents.default)(_Toggle.Toggle)``;
|
|
29
|
-
const RadioIndicator = (0, _styledcomponents.default)(_Toggle.ToggleIndicatorSquared)``;
|
|
30
|
-
const RadioOptionLabel = (0, _styledcomponents.default)(_Toggle.ToggleLabel)``;
|
|
31
|
-
const RadioOption = /*#__PURE__*/ (0, _react.forwardRef)(function RadioOption({ register, name, label, $ref, ...props }, ref) {
|
|
32
|
-
const inputProps = register ? register(name) : {
|
|
33
|
-
name,
|
|
34
|
-
ref: $ref || ref
|
|
35
|
-
};
|
|
36
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(RadioOptionRoot, {
|
|
37
|
-
children: [
|
|
38
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(RadioToggle, {
|
|
39
|
-
children: [
|
|
40
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_styles.InputInvisible, {
|
|
41
|
-
type: "radio",
|
|
42
|
-
...inputProps,
|
|
43
|
-
...props
|
|
44
|
-
}),
|
|
45
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(RadioIndicator, {})
|
|
46
|
-
]
|
|
47
|
-
}),
|
|
48
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(RadioOptionLabel, {
|
|
49
|
-
children: label
|
|
50
|
-
})
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
const Radio = /*#__PURE__*/ (0, _react.forwardRef)(function Radio({ label, options, ...props }, ref) {
|
|
55
|
-
if (!options) return null;
|
|
56
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(RadioRoot, {
|
|
57
|
-
children: [
|
|
58
|
-
label && /*#__PURE__*/ (0, _jsxruntime.jsx)(RadioLabel, {
|
|
59
|
-
children: label
|
|
60
|
-
}),
|
|
61
|
-
options.map((option, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(RadioOption, {
|
|
62
|
-
...option,
|
|
63
|
-
...props,
|
|
64
|
-
$ref: ref
|
|
65
|
-
}, idx))
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
});
|