@koine/react 2.0.0-beta.5 → 2.0.0-beta.7
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/Alert/Alert.js +7 -3
- package/Alert/Alert.mjs +7 -3
- package/Alert/Alert.stories.js +4 -1
- package/Alert/Alert.stories.mjs +4 -1
- package/Animations/Reveal.js +5 -3
- package/Animations/Reveal.mjs +5 -3
- package/Animations/Underline.d.ts +1 -1
- package/Autocomplete/AutocompleteMui.js +57 -28
- package/Autocomplete/AutocompleteMui.mjs +57 -28
- package/Autocomplete/components.d.ts +12 -16
- package/Bg/BgColor.d.ts +2 -7
- package/Bg/BgColor.js +15 -10
- package/Bg/BgColor.mjs +15 -10
- package/Bg/BgPhoto.js +8 -6
- package/Bg/BgPhoto.mjs +8 -6
- package/Bg/BgSvg.js +8 -6
- package/Bg/BgSvg.mjs +8 -6
- package/Breadcrumbs/Breadcrumbs.js +30 -17
- package/Breadcrumbs/Breadcrumbs.mjs +30 -17
- package/Buttons/Button.d.ts +1 -1
- package/Buttons/ButtonComposite.js +52 -19
- package/Buttons/ButtonComposite.mjs +52 -19
- package/Buttons/ButtonFab.d.ts +1 -3
- package/Buttons/ButtonLink.js +3 -2
- package/Buttons/ButtonLink.mjs +3 -2
- package/Buttons/IconButton.d.ts +1 -3
- package/Calendar/CalendarDaygridCell.js +75 -52
- package/Calendar/CalendarDaygridCell.mjs +75 -52
- package/Calendar/CalendarDaygridNav.js +31 -17
- package/Calendar/CalendarDaygridNav.mjs +31 -17
- package/Calendar/CalendarDaygridTable.js +40 -15
- package/Calendar/CalendarDaygridTable.mjs +40 -15
- package/Calendar/CalendarLegend.js +20 -7
- package/Calendar/CalendarLegend.mjs +20 -7
- package/Carousel/CarouselCss.d.ts +2 -19
- package/Carousel/CarouselCss.js +10 -8
- package/Carousel/CarouselCss.mjs +10 -8
- package/Debug/Debug.js +4 -1
- package/Debug/Debug.mjs +4 -1
- package/Details/Details.js +27 -19
- package/Details/Details.mjs +27 -19
- package/Details/Details.stories.js +2 -1
- package/Details/Details.stories.mjs +2 -1
- package/Dialog/DialogMui.d.ts +9 -326
- package/Dialog/DialogMui.js +24 -11
- package/Dialog/DialogMui.mjs +24 -11
- package/Dialog/DialogMui.stories.js +2 -1
- package/Dialog/DialogMui.stories.mjs +2 -1
- package/Dialog/css/bare.d.ts +9 -327
- package/Dialog/css/index.stories.js +11 -3
- package/Dialog/css/index.stories.mjs +11 -3
- package/Dialog/m/bare.d.ts +2 -398
- package/Dialog/m/bare.js +114 -69
- package/Dialog/m/bare.mjs +114 -69
- package/Dialog/sc/bare.d.ts +27 -405
- package/Dialog/sc/framer.d.ts +15 -422
- package/Dialog/sc/framerMaterial.d.ts +15 -422
- package/Dialog/sc/index.stories.js +5 -4
- package/Dialog/sc/index.stories.mjs +5 -4
- package/Dialog/sc/material.d.ts +27 -405
- package/Dialog/tw/bare.d.ts +9 -327
- package/Dialog/tw/elegant.d.ts +9 -327
- package/Dialog/tw/framer.d.ts +3 -354
- package/Dialog/tw/framerMaterial.d.ts +3 -354
- package/Dialog/tw/index.stories.js +6 -5
- package/Dialog/tw/index.stories.mjs +6 -5
- package/Dialog/tw/material.d.ts +9 -327
- package/Editor/Editor--tiptap.js +29 -14
- package/Editor/Editor--tiptap.mjs +29 -14
- package/Editor/components.d.ts +3 -5
- package/FaviconTags.js +52 -38
- package/FaviconTags.mjs +52 -38
- package/Form/Form.js +33 -16
- package/Form/Form.mjs +33 -16
- package/Form/sc/bare.d.ts +11 -11
- package/Forms/Checkbox/Checkbox.d.ts +4 -4
- package/Forms/Checkbox/Checkbox.js +15 -1
- package/Forms/Checkbox/Checkbox.mjs +15 -1
- package/Forms/Feedback/Feedback.js +5 -3
- package/Forms/Feedback/Feedback.mjs +5 -3
- package/Forms/Field/Field.d.ts +2 -4
- package/Forms/Field/Field.js +11 -5
- package/Forms/Field/Field.mjs +11 -5
- package/Forms/Field/FieldControl.js +20 -6
- package/Forms/Field/FieldControl.mjs +20 -6
- package/Forms/Field/FieldHint.d.ts +1 -1
- package/Forms/Input/Input.d.ts +5 -5
- package/Forms/Input/Input.js +15 -7
- package/Forms/Input/Input.mjs +15 -7
- package/Forms/InputGroup/InputGroup.d.ts +4 -4
- package/Forms/InputGroup/InputGroup.js +17 -7
- package/Forms/InputGroup/InputGroup.mjs +17 -7
- package/Forms/Label/Label.d.ts +1 -1
- package/Forms/Password/Password.d.ts +1 -1
- package/Forms/Password/Password.js +25 -11
- package/Forms/Password/Password.mjs +25 -11
- package/Forms/Radio/Radio.js +30 -11
- package/Forms/Radio/Radio.mjs +30 -11
- package/Forms/Switch/Switch.d.ts +2 -2
- package/Forms/Switch/Switch.js +13 -1
- package/Forms/Switch/Switch.mjs +13 -1
- package/Forms/Textarea/Textarea.d.ts +1 -1
- package/Forms/Textarea/Textarea.js +15 -7
- package/Forms/Textarea/Textarea.mjs +15 -7
- package/Forms/Textarea/TextareaRich.js +20 -12
- package/Forms/Textarea/TextareaRich.mjs +20 -12
- package/Forms/Toggle/Toggle.d.ts +7 -7
- package/Forms/Toggle/Toggle.js +48 -29
- package/Forms/Toggle/Toggle.mjs +49 -30
- package/Forms/Toggle/useToggle.js +21 -15
- package/Forms/Toggle/useToggle.mjs +21 -15
- package/Forms/styles.d.ts +3 -7
- package/Forms/styles.js +2 -1
- package/Forms/styles.mjs +2 -1
- package/Grid/Grid.d.ts +4 -28
- package/Hamburger/Hamburger.js +24 -17
- package/Hamburger/Hamburger.mjs +25 -18
- package/Hidden/Hidden.d.ts +1 -1
- package/Img/sc/bare.d.ts +1 -1
- package/Link/Link.d.ts +1 -3
- package/Link/LinkBlank.d.ts +2 -5
- package/Link/LinkBlank.js +8 -1
- package/Link/LinkBlank.mjs +8 -1
- package/Menu/Menu.d.ts +1 -1
- package/MenuItem/MenuItem.d.ts +1 -4
- package/Meta/Meta.js +2 -1
- package/Meta/Meta.mjs +2 -1
- package/NoJs/NoJs.js +2 -1
- package/NoJs/NoJs.mjs +2 -1
- package/Pagination/PaginationNav.js +42 -23
- package/Pagination/PaginationNav.mjs +42 -23
- package/Pagination/PaginationResults.js +25 -20
- package/Pagination/PaginationResults.mjs +25 -20
- package/Pill/Pill.d.ts +4 -4
- package/Progress/ProgressCircular.js +14 -12
- package/Progress/ProgressCircular.mjs +14 -12
- package/Progress/ProgressLinear.js +21 -19
- package/Progress/ProgressLinear.mjs +21 -19
- package/Progress/ProgressOverlay.js +20 -14
- package/Progress/ProgressOverlay.mjs +20 -14
- package/Rating/Rating.d.ts +5 -5
- package/Rating/Rating.js +61 -35
- package/Rating/Rating.mjs +61 -35
- package/Select/components.d.ts +1 -1
- package/Select/components.js +5 -3
- package/Select/components.mjs +5 -3
- package/Sidebar/Sidebar.js +17 -8
- package/Sidebar/Sidebar.mjs +17 -8
- package/Spacing/Spacing.js +5 -2
- package/Spacing/Spacing.mjs +5 -2
- package/Sticky/StickyCss.js +2 -1
- package/Sticky/StickyCss.mjs +2 -1
- package/Tabs/TabsMui.d.ts +7 -296
- package/Tabs/TabsMui.js +11 -2
- package/Tabs/TabsMui.mjs +11 -2
- package/Tabs/TabsMui.stories.js +2 -1
- package/Tabs/TabsMui.stories.mjs +2 -1
- package/Tabs/tw/bare.d.ts +7 -296
- package/Tabs/tw/index.stories.js +3 -2
- package/Tabs/tw/index.stories.mjs +3 -2
- package/Tabs/tw/material.d.ts +7 -332
- package/Typography/CopyPasteVisible.d.ts +1 -1
- package/Typography/Native.d.ts +5 -5
- package/Typography/ReadMore.js +33 -18
- package/Typography/ReadMore.mjs +33 -18
- package/Typography/TextLoop.js +43 -35
- package/Typography/TextLoop.mjs +43 -35
- package/Typography/TypeStairs.js +27 -19
- package/Typography/TypeStairs.mjs +27 -19
- package/helpers/classed.stories.js +40 -22
- package/helpers/classed.stories.mjs +40 -22
- package/m/MotionProvider.js +5 -3
- package/m/MotionProvider.mjs +5 -3
- package/package.json +5 -25
- package/styles/Body.d.ts +2 -2
- package/styles/theme--vanilla.js +5 -3
- package/styles/theme--vanilla.mjs +5 -3
|
@@ -26,6 +26,7 @@ _export(exports, {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
29
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
29
30
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
30
31
|
const _Buttons = require("../../Buttons");
|
|
31
32
|
const _media = require("../../styles/media");
|
|
@@ -65,11 +66,20 @@ const InputGroupButtonPost = (0, _styledcomponents.default)(_Buttons.KoineButton
|
|
|
65
66
|
}
|
|
66
67
|
`;
|
|
67
68
|
const InputGroup = ({ pre, post, Button = _Buttons.KoineButton, btnProps = {}, children, ...props })=>{
|
|
68
|
-
return /*#__PURE__*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
+
});
|
|
75
85
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import styled from "styled-components";
|
|
2
3
|
import { KoineButton } from "../../Buttons";
|
|
3
4
|
import { max, min } from "../../styles/media";
|
|
@@ -37,11 +38,20 @@ export const InputGroupButtonPost = styled(KoineButton)`
|
|
|
37
38
|
}
|
|
38
39
|
`;
|
|
39
40
|
export const InputGroup = ({ pre, post, Button = KoineButton, btnProps = {}, children, ...props })=>{
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
return /*#__PURE__*/ _jsxs(InputGroupRoot, {
|
|
42
|
+
...props,
|
|
43
|
+
children: [
|
|
44
|
+
pre && /*#__PURE__*/ _jsx(InputGroupButtonPre, {
|
|
45
|
+
as: Button,
|
|
46
|
+
...btnProps
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ _jsx(InputGroupMain, {
|
|
49
|
+
children: children
|
|
50
|
+
}),
|
|
51
|
+
post && /*#__PURE__*/ _jsx(InputGroupButtonPost, {
|
|
52
|
+
as: Button,
|
|
53
|
+
...btnProps
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
47
57
|
};
|
package/Forms/Label/Label.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const label = "\n display: flex;\n font-size: 13px;\n cursor: pointer;\n";
|
|
2
2
|
export declare const labelMaterial = "\n z-index: 2;\n position: relative;\n display: inline-block;\n padding: 0 5px;\n font-weight: 100;\n font-size: 10px;\n background: var(--bodyBg);\n transform: translateY(-0.3em) translateX(1em);\n cursor: pointer;\n\n + * {\n margin-top: -1em;\n }\n";
|
|
3
|
-
export declare const Label:
|
|
3
|
+
export declare const Label: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FormControl } from "../helpers";
|
|
3
|
-
export declare const PasswordInputNative:
|
|
3
|
+
export declare const PasswordInputNative: any;
|
|
4
4
|
export type PasswordProps = FormControl;
|
|
5
5
|
export declare const Password: import("react").ForwardRefExoticComponent<Omit<PasswordProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -17,6 +17,7 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
20
21
|
const _react = require("react");
|
|
21
22
|
const _im = require("react-icons/im");
|
|
22
23
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
@@ -44,15 +45,28 @@ const PasswordIcon = _styledcomponents.default.span`
|
|
|
44
45
|
`;
|
|
45
46
|
const Password = /*#__PURE__*/ (0, _react.forwardRef)(function Password({ register, name, label, ...props }, ref) {
|
|
46
47
|
const [visible, setVisible] = (0, _react.useState)(false);
|
|
47
|
-
return /*#__PURE__*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
+
});
|
|
58
72
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { forwardRef, useState } from "react";
|
|
2
3
|
import { ImEyeBlocked as IconInvisible, ImEye as IconVisible } from "react-icons/im";
|
|
3
4
|
import styled from "styled-components";
|
|
@@ -25,15 +26,28 @@ const PasswordIcon = styled.span`
|
|
|
25
26
|
`;
|
|
26
27
|
export const Password = /*#__PURE__*/ forwardRef(function Password({ register, name, label, ...props }, ref) {
|
|
27
28
|
const [visible, setVisible] = useState(false);
|
|
28
|
-
return /*#__PURE__*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
30
|
+
children: [
|
|
31
|
+
label && /*#__PURE__*/ _jsx(Label, {
|
|
32
|
+
children: label
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ _jsxs(PasswordInputWrap, {
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ _jsx(PasswordInputNative, {
|
|
37
|
+
type: visible ? "text" : "password",
|
|
38
|
+
autoComplete: "new-password",
|
|
39
|
+
...register ? register(name) : {
|
|
40
|
+
name,
|
|
41
|
+
ref
|
|
42
|
+
},
|
|
43
|
+
...props
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ _jsx(PasswordIcon, {
|
|
46
|
+
onClick: ()=>setVisible((prev)=>!prev),
|
|
47
|
+
children: visible ? /*#__PURE__*/ _jsx(IconInvisible, {}) : /*#__PURE__*/ _jsx(IconVisible, {})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
39
53
|
});
|
package/Forms/Radio/Radio.js
CHANGED
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "Radio", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
13
|
const _react = require("react");
|
|
13
14
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
14
15
|
const _Label = require("../Label/Label");
|
|
@@ -32,18 +33,36 @@ const RadioOption = /*#__PURE__*/ (0, _react.forwardRef)(function RadioOption({
|
|
|
32
33
|
name,
|
|
33
34
|
ref: $ref || ref
|
|
34
35
|
};
|
|
35
|
-
return /*#__PURE__*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
+
});
|
|
40
53
|
});
|
|
41
54
|
const Radio = /*#__PURE__*/ (0, _react.forwardRef)(function Radio({ label, options, ...props }, ref) {
|
|
42
55
|
if (!options) return null;
|
|
43
|
-
return /*#__PURE__*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
});
|
|
49
68
|
});
|
package/Forms/Radio/Radio.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { forwardRef } from "react";
|
|
2
3
|
import styled from "styled-components";
|
|
3
4
|
import { label } from "../Label/Label";
|
|
@@ -21,18 +22,36 @@ const RadioOption = /*#__PURE__*/ forwardRef(function RadioOption({ register, na
|
|
|
21
22
|
name,
|
|
22
23
|
ref: $ref || ref
|
|
23
24
|
};
|
|
24
|
-
return /*#__PURE__*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
return /*#__PURE__*/ _jsxs(RadioOptionRoot, {
|
|
26
|
+
children: [
|
|
27
|
+
/*#__PURE__*/ _jsxs(RadioToggle, {
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ _jsx(InputInvisible, {
|
|
30
|
+
type: "radio",
|
|
31
|
+
...inputProps,
|
|
32
|
+
...props
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ _jsx(RadioIndicator, {})
|
|
35
|
+
]
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ _jsx(RadioOptionLabel, {
|
|
38
|
+
children: label
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
});
|
|
29
42
|
});
|
|
30
43
|
export const Radio = /*#__PURE__*/ forwardRef(function Radio({ label, options, ...props }, ref) {
|
|
31
44
|
if (!options) return null;
|
|
32
|
-
return /*#__PURE__*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
45
|
+
return /*#__PURE__*/ _jsxs(RadioRoot, {
|
|
46
|
+
children: [
|
|
47
|
+
label && /*#__PURE__*/ _jsx(RadioLabel, {
|
|
48
|
+
children: label
|
|
49
|
+
}),
|
|
50
|
+
options.map((option, idx)=>/*#__PURE__*/ _jsx(RadioOption, {
|
|
51
|
+
...option,
|
|
52
|
+
...props,
|
|
53
|
+
$ref: ref
|
|
54
|
+
}, idx))
|
|
55
|
+
]
|
|
56
|
+
});
|
|
38
57
|
});
|
package/Forms/Switch/Switch.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { UseToggleProps } from "../Toggle/useToggle";
|
|
3
|
-
export declare const SwitchTrack:
|
|
4
|
-
export declare const SwitchHandle:
|
|
3
|
+
export declare const SwitchTrack: any;
|
|
4
|
+
export declare const SwitchHandle: any;
|
|
5
5
|
export type SwitchProps = UseToggleProps;
|
|
6
6
|
/**
|
|
7
7
|
* All logic and invisible Inputs come from the `useToggle` hook
|
package/Forms/Switch/Switch.js
CHANGED
|
@@ -20,6 +20,7 @@ _export(exports, {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
23
24
|
const _react = require("react");
|
|
24
25
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
25
26
|
const _styled = require("../../styles/styled");
|
|
@@ -64,5 +65,16 @@ const SwitchHandle = _styledcomponents.default.span`
|
|
|
64
65
|
`;
|
|
65
66
|
const Switch = /*#__PURE__*/ (0, _react.forwardRef)(function Switch(props, ref) {
|
|
66
67
|
const { rootProps, Inputs, label } = (0, _useToggle.useToggle)(props, ref);
|
|
67
|
-
return /*#__PURE__*/
|
|
68
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Checkbox.CheckboxRoot, {
|
|
69
|
+
...rootProps,
|
|
70
|
+
children: [
|
|
71
|
+
Inputs,
|
|
72
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(SwitchTrack, {
|
|
73
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(SwitchHandle, {})
|
|
74
|
+
}),
|
|
75
|
+
label && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Checkbox.CheckboxLabel, {
|
|
76
|
+
children: label
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
68
80
|
});
|
package/Forms/Switch/Switch.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { forwardRef } from "react";
|
|
2
3
|
import styled from "styled-components";
|
|
3
4
|
import { stateFocus } from "../../styles/styled";
|
|
@@ -44,5 +45,16 @@ export const SwitchHandle = styled.span`
|
|
|
44
45
|
* All logic and invisible Inputs come from the `useToggle` hook
|
|
45
46
|
*/ export const Switch = /*#__PURE__*/ forwardRef(function Switch(props, ref) {
|
|
46
47
|
const { rootProps, Inputs, label } = useToggle(props, ref);
|
|
47
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/ _jsxs(CheckboxRoot, {
|
|
49
|
+
...rootProps,
|
|
50
|
+
children: [
|
|
51
|
+
Inputs,
|
|
52
|
+
/*#__PURE__*/ _jsx(SwitchTrack, {
|
|
53
|
+
children: /*#__PURE__*/ _jsx(SwitchHandle, {})
|
|
54
|
+
}),
|
|
55
|
+
label && /*#__PURE__*/ _jsx(CheckboxLabel, {
|
|
56
|
+
children: label
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
48
60
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormControl } from "../helpers";
|
|
3
|
-
export declare const TextareaNative:
|
|
3
|
+
export declare const TextareaNative: any;
|
|
4
4
|
export type TextareaProps = FormControl<"textarea">;
|
|
5
5
|
export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -17,6 +17,7 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
20
21
|
const _react = require("react");
|
|
21
22
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
22
23
|
const _Label = require("../Label/Label");
|
|
@@ -27,11 +28,18 @@ const TextareaNative = _styledcomponents.default.textarea`
|
|
|
27
28
|
resize: vertical;
|
|
28
29
|
`;
|
|
29
30
|
const Textarea = /*#__PURE__*/ (0, _react.forwardRef)(function Textarea({ register, name, label, ...props }, ref) {
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
32
|
+
children: [
|
|
33
|
+
label && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.Label, {
|
|
34
|
+
children: label
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(TextareaNative, {
|
|
37
|
+
...register ? register(name) : {
|
|
38
|
+
name,
|
|
39
|
+
ref
|
|
40
|
+
},
|
|
41
|
+
...props
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
37
45
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { forwardRef } from "react";
|
|
2
3
|
import styled from "styled-components";
|
|
3
4
|
import { Label } from "../Label/Label";
|
|
@@ -8,11 +9,18 @@ export const TextareaNative = styled.textarea`
|
|
|
8
9
|
resize: vertical;
|
|
9
10
|
`;
|
|
10
11
|
export const Textarea = /*#__PURE__*/ forwardRef(function Textarea({ register, name, label, ...props }, ref) {
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
13
|
+
children: [
|
|
14
|
+
label && /*#__PURE__*/ _jsx(Label, {
|
|
15
|
+
children: label
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ _jsx(TextareaNative, {
|
|
18
|
+
...register ? register(name) : {
|
|
19
|
+
name,
|
|
20
|
+
ref
|
|
21
|
+
},
|
|
22
|
+
...props
|
|
23
|
+
})
|
|
24
|
+
]
|
|
25
|
+
});
|
|
18
26
|
});
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "TextareaRich", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
13
|
const _react = require("react");
|
|
13
14
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
14
15
|
const _Editor = require("../../Editor");
|
|
@@ -35,16 +36,23 @@ const Root = _styledcomponents.default.div`
|
|
|
35
36
|
`;
|
|
36
37
|
const TextareaRich = /*#__PURE__*/ (0, _react.forwardRef)(function TextareaRich({ register, setValue, name, label, defaultValue = "", onChange, ...props }, ref) {
|
|
37
38
|
if (register) register(name);
|
|
38
|
-
return /*#__PURE__*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(Root, {
|
|
40
|
+
children: [
|
|
41
|
+
label && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.Label, {
|
|
42
|
+
children: label
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Editor.Editor, {
|
|
45
|
+
options: {
|
|
46
|
+
// element: <TextareaAutosize />,
|
|
47
|
+
content: defaultValue,
|
|
48
|
+
onUpdate: (onChange || setValue) && name ? ({ editor })=>{
|
|
49
|
+
const value = editor.getHTML();
|
|
50
|
+
if (setValue) setValue(name, value);
|
|
51
|
+
(0, _helpers.triggerOnChange)(onChange, name, value);
|
|
52
|
+
} : undefined
|
|
53
|
+
},
|
|
54
|
+
...props
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
50
58
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { forwardRef } from "react";
|
|
2
3
|
import styled from "styled-components";
|
|
3
4
|
import { Editor } from "../../Editor";
|
|
@@ -25,16 +26,23 @@ const Root = styled.div`
|
|
|
25
26
|
`;
|
|
26
27
|
export const TextareaRich = /*#__PURE__*/ forwardRef(function TextareaRich({ register, setValue, name, label, defaultValue = "", onChange, ...props }, ref) {
|
|
27
28
|
if (register) register(name);
|
|
28
|
-
return /*#__PURE__*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
return /*#__PURE__*/ _jsxs(Root, {
|
|
30
|
+
children: [
|
|
31
|
+
label && /*#__PURE__*/ _jsx(Label, {
|
|
32
|
+
children: label
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ _jsx(Editor, {
|
|
35
|
+
options: {
|
|
36
|
+
// element: <TextareaAutosize />,
|
|
37
|
+
content: defaultValue,
|
|
38
|
+
onUpdate: (onChange || setValue) && name ? ({ editor })=>{
|
|
39
|
+
const value = editor.getHTML();
|
|
40
|
+
if (setValue) setValue(name, value);
|
|
41
|
+
triggerOnChange(onChange, name, value);
|
|
42
|
+
} : undefined
|
|
43
|
+
},
|
|
44
|
+
...props
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
40
48
|
});
|
package/Forms/Toggle/Toggle.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ export declare const toggleBase = "\n border: 1px solid var(--forms-border-colo
|
|
|
2
2
|
export declare const toggleIndicatorBg = "\n display: inline-block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n";
|
|
3
3
|
export declare const toggleIndicatorBgShape: string;
|
|
4
4
|
export declare const toggleIndicatorFg = "\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n fill: currentcolor;\n";
|
|
5
|
-
export declare const Toggle:
|
|
6
|
-
export declare const ToggleLabel:
|
|
7
|
-
export declare const ToggleLabelSub:
|
|
8
|
-
export declare const ToggleIndicatorHolder:
|
|
9
|
-
export declare const ToggleIndicatorBgSquare:
|
|
10
|
-
export declare const ToggleIndicatorBgCircle:
|
|
11
|
-
export declare const ToggleIndicatorFg:
|
|
5
|
+
export declare const Toggle: any;
|
|
6
|
+
export declare const ToggleLabel: any;
|
|
7
|
+
export declare const ToggleLabelSub: any;
|
|
8
|
+
export declare const ToggleIndicatorHolder: any;
|
|
9
|
+
export declare const ToggleIndicatorBgSquare: any;
|
|
10
|
+
export declare const ToggleIndicatorBgCircle: any;
|
|
11
|
+
export declare const ToggleIndicatorFg: any;
|
|
12
12
|
export type ToggleIndicatorProps = unknown;
|
|
13
13
|
export type ToggleIndicatorSquaredProps = ToggleIndicatorProps;
|
|
14
14
|
export declare const ToggleIndicatorSquared: (props: ToggleIndicatorSquaredProps) => import("react/jsx-runtime").JSX.Element;
|
package/Forms/Toggle/Toggle.js
CHANGED
|
@@ -55,6 +55,7 @@ _export(exports, {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
58
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
58
59
|
const _react = require("react");
|
|
59
60
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
60
61
|
const _styled = require("../../styles/styled");
|
|
@@ -121,36 +122,54 @@ const ToggleIndicatorFg = _styledcomponents.default.svg`
|
|
|
121
122
|
}
|
|
122
123
|
`;
|
|
123
124
|
const ToggleIndicatorSquared = (props)=>{
|
|
124
|
-
return /*#__PURE__*/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
125
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(ToggleIndicatorHolder, {
|
|
126
|
+
children: [
|
|
127
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(ToggleIndicatorBgSquare, {
|
|
128
|
+
viewBox: "0 0 24 24",
|
|
129
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("rect", {
|
|
130
|
+
width: "24",
|
|
131
|
+
height: "24"
|
|
132
|
+
})
|
|
133
|
+
}),
|
|
134
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(ToggleIndicatorFg, {
|
|
135
|
+
viewBox: "0 0 24 24",
|
|
136
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("path", {
|
|
137
|
+
d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
});
|
|
134
142
|
};
|
|
135
143
|
const ToggleIndicatorRounded = ({ r = 6 })=>{
|
|
136
144
|
const id = (0, _react.useId)();
|
|
137
|
-
return /*#__PURE__*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
145
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(ToggleIndicatorHolder, {
|
|
146
|
+
children: [
|
|
147
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(ToggleIndicatorBgCircle, {
|
|
148
|
+
viewBox: "0 0 24 24",
|
|
149
|
+
children: [
|
|
150
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("circle", {
|
|
151
|
+
cy: "12",
|
|
152
|
+
cx: "12",
|
|
153
|
+
r: "12",
|
|
154
|
+
id: `r_${id}`,
|
|
155
|
+
clipPath: `url(#c_${id})`
|
|
156
|
+
}),
|
|
157
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("clipPath", {
|
|
158
|
+
id: `c_${id}`,
|
|
159
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("use", {
|
|
160
|
+
xlinkHref: `#r_${id}`
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
}),
|
|
165
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(ToggleIndicatorFg, {
|
|
166
|
+
viewBox: "0 0 24 24",
|
|
167
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("circle", {
|
|
168
|
+
r: r,
|
|
169
|
+
cx: "12",
|
|
170
|
+
cy: "12"
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
});
|
|
156
175
|
};
|