react-miui 0.21.0 → 0.22.0
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/CHANGELOG.md +12 -0
- package/dist/components/form/Select.d.ts +1 -5
- package/dist/components/form/Select.d.ts.map +1 -1
- package/dist/components/form/Select.js +2 -23
- package/dist/components/form/Select.js.map +1 -1
- package/dist/components/form/Select.stories.d.ts +8 -0
- package/dist/components/form/Select.stories.d.ts.map +1 -0
- package/dist/components/form/Select.stories.js +26 -0
- package/dist/components/form/Select.stories.js.map +1 -0
- package/dist/components/form/Select.styled.d.ts +82 -0
- package/dist/components/form/Select.styled.d.ts.map +1 -0
- package/dist/components/form/Select.styled.js +24 -0
- package/dist/components/form/Select.styled.js.map +1 -0
- package/dist/components/ui/button/Button.d.ts +1 -7
- package/dist/components/ui/button/Button.d.ts.map +1 -1
- package/dist/components/ui/button/Button.js +2 -28
- package/dist/components/ui/button/Button.js.map +1 -1
- package/dist/components/ui/button/Button.stories.d.ts +9 -0
- package/dist/components/ui/button/Button.stories.d.ts.map +1 -0
- package/dist/components/ui/button/Button.stories.js +62 -0
- package/dist/components/ui/button/Button.stories.js.map +1 -0
- package/dist/components/ui/button/Button.styled.d.ts +85 -0
- package/dist/components/ui/button/Button.styled.d.ts.map +1 -0
- package/dist/components/ui/button/Button.styled.js +38 -0
- package/dist/components/ui/button/Button.styled.js.map +1 -0
- package/dist/components/ui/modal/Modal.d.ts +6 -4
- package/dist/components/ui/modal/Modal.d.ts.map +1 -1
- package/dist/components/ui/modal/Modal.js +30 -21
- package/dist/components/ui/modal/Modal.js.map +1 -1
- package/dist/components/ui/modal/Modal.stories.d.ts +10 -0
- package/dist/components/ui/modal/Modal.stories.d.ts.map +1 -0
- package/dist/components/ui/modal/Modal.stories.js +112 -0
- package/dist/components/ui/modal/Modal.stories.js.map +1 -0
- package/dist/components/ui/modal/Modal.styled.d.ts +329 -0
- package/dist/components/ui/modal/Modal.styled.d.ts.map +1 -0
- package/dist/components/ui/modal/Modal.styled.js +90 -0
- package/dist/components/ui/modal/Modal.styled.js.map +1 -0
- package/dist/components/ui/modal/ModalButtons.d.ts +1 -11
- package/dist/components/ui/modal/ModalButtons.d.ts.map +1 -1
- package/dist/components/ui/modal/ModalButtons.js +2 -12
- package/dist/components/ui/modal/ModalButtons.js.map +1 -1
- package/dist/components/ui/modal/ModalButtons.stories.d.ts +8 -0
- package/dist/components/ui/modal/ModalButtons.stories.d.ts.map +1 -0
- package/dist/components/ui/modal/ModalButtons.stories.js +25 -0
- package/dist/components/ui/modal/ModalButtons.stories.js.map +1 -0
- package/dist/components/ui/modal/ModalButtons.styled.d.ts +166 -0
- package/dist/components/ui/modal/ModalButtons.styled.d.ts.map +1 -0
- package/dist/components/ui/modal/ModalButtons.styled.js +42 -0
- package/dist/components/ui/modal/ModalButtons.styled.js.map +1 -0
- package/dist/components/ui/pop/Pop.module.scss +1 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/Drawer.html +14 -15
- package/docs/classes/Pop.html +14 -15
- package/docs/classes/ToasterProvider.html +10 -11
- package/docs/enums/ICON.html +14 -15
- package/docs/functions/Action.html +5 -6
- package/docs/functions/Button.html +43 -11
- package/docs/functions/Card.html +5 -6
- package/docs/functions/Checkbox.html +5 -6
- package/docs/functions/Choice.html +6 -7
- package/docs/functions/CoveringLoader.html +5 -6
- package/docs/functions/DirectionPad.html +5 -6
- package/docs/functions/EqualActions.html +5 -6
- package/docs/functions/FullLoader.html +5 -6
- package/docs/functions/HandleEsc.html +5 -6
- package/docs/functions/Header.html +5 -6
- package/docs/functions/HeaderIconAction.html +5 -6
- package/docs/functions/Icon-1.html +5 -6
- package/docs/functions/If.html +5 -6
- package/docs/functions/Input.html +6 -7
- package/docs/functions/KeyValue.html +5 -6
- package/docs/functions/Label.html +5 -6
- package/docs/functions/List-1.html +5 -6
- package/docs/functions/Loader.html +5 -6
- package/docs/functions/Loading.html +5 -6
- package/docs/functions/Message.html +5 -6
- package/docs/functions/Modal-1.html +5 -6
- package/docs/functions/ModalButtons.html +135 -0
- package/docs/functions/PopLoader.html +5 -6
- package/docs/functions/PopOption.html +5 -6
- package/docs/functions/SearchContainer.html +5 -6
- package/docs/functions/Section.html +5 -6
- package/docs/functions/Select.html +39 -11
- package/docs/functions/Selector.html +6 -7
- package/docs/functions/Spacer.html +5 -6
- package/docs/functions/Stats.html +5 -6
- package/docs/functions/StickyHeader-1.html +5 -6
- package/docs/functions/StickyHeader.Content.html +5 -6
- package/docs/functions/Table.html +5 -6
- package/docs/functions/TextArea.html +5 -6
- package/docs/functions/Toggle.html +5 -6
- package/docs/functions/getCssText.html +5 -6
- package/docs/functions/styled.html +5 -6
- package/docs/functions/useToaster.html +6 -7
- package/docs/index.html +5 -6
- package/docs/modules/List.html +7 -8
- package/docs/modules/Modal.html +8 -9
- package/docs/modules/StickyHeader.html +6 -7
- package/docs/modules.html +6 -8
- package/docs/pages/tutorials/Test.html +5 -6
- package/docs/types/ThemeCSS.html +6 -7
- package/docs/variables/List.Header.html +5 -6
- package/docs/variables/List.Item.html +5 -6
- package/docs/variables/{ModalButtons.Button.html → Modal.RemovePadding.html} +11 -12
- package/docs/variables/cssReset.html +6 -7
- package/docs/variables/miuiScrollbars.html +6 -7
- package/esm/components/form/Select.d.ts +1 -5
- package/esm/components/form/Select.d.ts.map +1 -1
- package/esm/components/form/Select.js +1 -8
- package/esm/components/form/Select.js.map +1 -1
- package/esm/components/form/Select.stories.d.ts +8 -0
- package/esm/components/form/Select.stories.d.ts.map +1 -0
- package/esm/components/form/Select.stories.js +20 -0
- package/esm/components/form/Select.stories.js.map +1 -0
- package/esm/components/form/Select.styled.d.ts +82 -0
- package/esm/components/form/Select.styled.d.ts.map +1 -0
- package/esm/components/form/Select.styled.js +21 -0
- package/esm/components/form/Select.styled.js.map +1 -0
- package/esm/components/ui/button/Button.d.ts +1 -7
- package/esm/components/ui/button/Button.d.ts.map +1 -1
- package/esm/components/ui/button/Button.js +1 -13
- package/esm/components/ui/button/Button.js.map +1 -1
- package/esm/components/ui/button/Button.stories.d.ts +9 -0
- package/esm/components/ui/button/Button.stories.d.ts.map +1 -0
- package/esm/components/ui/button/Button.stories.js +35 -0
- package/esm/components/ui/button/Button.stories.js.map +1 -0
- package/esm/components/ui/button/Button.styled.d.ts +85 -0
- package/esm/components/ui/button/Button.styled.d.ts.map +1 -0
- package/esm/components/ui/button/Button.styled.js +35 -0
- package/esm/components/ui/button/Button.styled.js.map +1 -0
- package/esm/components/ui/modal/Modal.d.ts +6 -4
- package/esm/components/ui/modal/Modal.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.js +30 -18
- package/esm/components/ui/modal/Modal.js.map +1 -1
- package/esm/components/ui/modal/Modal.stories.d.ts +10 -0
- package/esm/components/ui/modal/Modal.stories.d.ts.map +1 -0
- package/esm/components/ui/modal/Modal.stories.js +84 -0
- package/esm/components/ui/modal/Modal.stories.js.map +1 -0
- package/esm/components/ui/modal/Modal.styled.d.ts +329 -0
- package/esm/components/ui/modal/Modal.styled.d.ts.map +1 -0
- package/esm/components/ui/modal/Modal.styled.js +83 -0
- package/esm/components/ui/modal/Modal.styled.js.map +1 -0
- package/esm/components/ui/modal/ModalButtons.d.ts +1 -11
- package/esm/components/ui/modal/ModalButtons.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalButtons.js +1 -9
- package/esm/components/ui/modal/ModalButtons.js.map +1 -1
- package/esm/components/ui/modal/ModalButtons.stories.d.ts +8 -0
- package/esm/components/ui/modal/ModalButtons.stories.d.ts.map +1 -0
- package/esm/components/ui/modal/ModalButtons.stories.js +19 -0
- package/esm/components/ui/modal/ModalButtons.stories.js.map +1 -0
- package/esm/components/ui/modal/ModalButtons.styled.d.ts +166 -0
- package/esm/components/ui/modal/ModalButtons.styled.d.ts.map +1 -0
- package/esm/components/ui/modal/ModalButtons.styled.js +39 -0
- package/esm/components/ui/modal/ModalButtons.styled.js.map +1 -0
- package/esm/components/ui/pop/Pop.module.scss +1 -0
- package/package.json +2 -2
- package/src/components/form/Select.stories.tsx +30 -0
- package/src/components/form/Select.styled.ts +25 -0
- package/src/components/form/Select.tsx +1 -22
- package/src/components/ui/button/Button.stories.tsx +55 -0
- package/src/components/ui/button/Button.styled.ts +43 -0
- package/src/components/ui/button/Button.tsx +1 -35
- package/src/components/ui/modal/Modal.stories.tsx +143 -0
- package/src/components/ui/modal/Modal.styled.ts +100 -0
- package/src/components/ui/modal/Modal.tsx +49 -26
- package/src/components/ui/modal/ModalButtons.stories.tsx +40 -0
- package/src/components/ui/modal/ModalButtons.styled.ts +51 -0
- package/src/components/ui/modal/ModalButtons.tsx +1 -22
- package/src/components/ui/pop/Pop.module.scss +1 -0
- package/src/demo/componentsMap.ts +0 -25
- package/dist/components/form/Select.module.scss +0 -18
- package/dist/components/ui/button/Button.module.scss +0 -25
- package/dist/components/ui/modal/Modal.module.scss +0 -92
- package/dist/components/ui/modal/ModalButtons.module.scss +0 -32
- package/dist/components/ui/modal/ModalNoMargin.d.ts +0 -7
- package/dist/components/ui/modal/ModalNoMargin.d.ts.map +0 -1
- package/dist/components/ui/modal/ModalNoMargin.js +0 -22
- package/dist/components/ui/modal/ModalNoMargin.js.map +0 -1
- package/docs/functions/ModalButtons-1.html +0 -107
- package/docs/modules/ModalButtons.html +0 -59
- package/docs/variables/Modal.NegateMargin.html +0 -53
- package/esm/components/form/Select.module.scss +0 -18
- package/esm/components/ui/button/Button.module.scss +0 -25
- package/esm/components/ui/modal/Modal.module.scss +0 -92
- package/esm/components/ui/modal/ModalButtons.module.scss +0 -32
- package/esm/components/ui/modal/ModalNoMargin.d.ts +0 -7
- package/esm/components/ui/modal/ModalNoMargin.d.ts.map +0 -1
- package/esm/components/ui/modal/ModalNoMargin.js +0 -16
- package/esm/components/ui/modal/ModalNoMargin.js.map +0 -1
- package/src/components/form/Select.module.scss +0 -18
- package/src/components/ui/button/Button.module.scss +0 -25
- package/src/components/ui/modal/Modal.module.scss +0 -92
- package/src/components/ui/modal/ModalButtons.module.scss +0 -32
- package/src/components/ui/modal/ModalNoMargin.tsx +0 -25
- package/src/demo/components/form/Select.tsx +0 -26
- package/src/demo/components/ui/button/ButtonDemo.tsx +0 -23
- package/src/demo/components/ui/modal/Modal.tsx +0 -106
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import styles from "./Select.module.scss";
|
|
4
|
-
const Select = ({ className, children, ...props }) => {
|
|
5
|
-
const wrapperCls = classnames(styles.select, className);
|
|
6
|
-
return (React.createElement("select", { className: wrapperCls, ...props }, children));
|
|
7
|
-
};
|
|
8
|
-
export { Select, };
|
|
1
|
+
export { Select } from "./Select.styled.js";
|
|
9
2
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/form/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/form/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { Select } from "./Select.js";
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
type Story = StoryObj<typeof Select>;
|
|
5
|
+
declare const Primary: Story;
|
|
6
|
+
export { Primary, };
|
|
7
|
+
export default meta;
|
|
8
|
+
//# sourceMappingURL=Select.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/components/form/Select.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,QAAA,MAAM,OAAO,EAAE,KASd,CAAC;AAEF,OAAO,EACH,OAAO,GACV,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Select } from "./Select.js";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Components/Form/Select",
|
|
5
|
+
component: Select,
|
|
6
|
+
tags: ["autodocs", "form"],
|
|
7
|
+
};
|
|
8
|
+
const Primary = {
|
|
9
|
+
args: {
|
|
10
|
+
children: [
|
|
11
|
+
React.createElement("option", { key: "1", value: "1" }, "First"),
|
|
12
|
+
React.createElement("option", { key: "2", value: "2" }, "Second"),
|
|
13
|
+
React.createElement("option", { key: "3", value: "3" }, "Third"),
|
|
14
|
+
],
|
|
15
|
+
disabled: false,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export { Primary, };
|
|
19
|
+
export default meta;
|
|
20
|
+
//# sourceMappingURL=Select.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.stories.js","sourceRoot":"","sources":["../../../src/components/form/Select.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,IAAI,GAAS;IACf,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAIF,MAAM,OAAO,GAAU;IACnB,IAAI,EAAE;QACF,QAAQ,EAAE;YACN,gCAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,YAAgB;YAC5C,gCAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,aAAiB;YAC7C,gCAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,YAAgB;SAC/C;QACD,QAAQ,EAAE,KAAK;KAClB;CACJ,CAAC;AAEF,OAAO,EACH,OAAO,GACV,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
declare const Select: import("@stitches/react/types/styled-component.js").StyledComponent<"select", {}, {}, import("@stitches/react/types/css-util.js").CSS<{}, {
|
|
2
|
+
colors: {
|
|
3
|
+
background: string;
|
|
4
|
+
mainColor: string;
|
|
5
|
+
mainColorAlt: string;
|
|
6
|
+
activeBg: string;
|
|
7
|
+
inactiveBg: string;
|
|
8
|
+
inactiveDarkBg: string;
|
|
9
|
+
toggleHandleBg: string;
|
|
10
|
+
toggleHandleBorder: string;
|
|
11
|
+
toggleBgDisabled: string;
|
|
12
|
+
toggleHandleBorderDisabled: string;
|
|
13
|
+
toggleHandleBgDisabled: string;
|
|
14
|
+
icon: string;
|
|
15
|
+
border: string;
|
|
16
|
+
buttonBorder: string;
|
|
17
|
+
headerBorder: string;
|
|
18
|
+
headerBg: string;
|
|
19
|
+
headerText: string;
|
|
20
|
+
text: string;
|
|
21
|
+
sub: string;
|
|
22
|
+
popText: string;
|
|
23
|
+
toolbarBorder: string;
|
|
24
|
+
toolbarBg: string;
|
|
25
|
+
modalBg: string;
|
|
26
|
+
modalButtonBg: string;
|
|
27
|
+
modalButtonBorder: string;
|
|
28
|
+
inputDisabledBg: string;
|
|
29
|
+
inputDisabledText: string;
|
|
30
|
+
choiceBg: string;
|
|
31
|
+
choiceText: string;
|
|
32
|
+
choiceActiveBg: string;
|
|
33
|
+
choiceActiveText: string;
|
|
34
|
+
choiceBorder: string;
|
|
35
|
+
selectorText: string;
|
|
36
|
+
selectorActive: string;
|
|
37
|
+
blue1: string;
|
|
38
|
+
blue2: string;
|
|
39
|
+
blue3: string;
|
|
40
|
+
orange1: string;
|
|
41
|
+
orange1Darker: string;
|
|
42
|
+
purple1: string;
|
|
43
|
+
green1: string;
|
|
44
|
+
green1Darker: string;
|
|
45
|
+
pink1: string;
|
|
46
|
+
red1: string;
|
|
47
|
+
yellow1: string;
|
|
48
|
+
yellow2: string;
|
|
49
|
+
yellow3: string;
|
|
50
|
+
pinky1: string;
|
|
51
|
+
pinky2: string;
|
|
52
|
+
pinky3: string;
|
|
53
|
+
grey1: string;
|
|
54
|
+
focusColor: string;
|
|
55
|
+
scrollbarsThumb: string;
|
|
56
|
+
scrollbarsBg: string;
|
|
57
|
+
tableStripedBg: string;
|
|
58
|
+
};
|
|
59
|
+
}, import("@stitches/react/types/config.js").DefaultThemeMap, {
|
|
60
|
+
mx: (value: string | number) => {
|
|
61
|
+
marginLeft: string | number;
|
|
62
|
+
marginRight: string | number;
|
|
63
|
+
};
|
|
64
|
+
my: (value: string | number) => {
|
|
65
|
+
marginTop: string | number;
|
|
66
|
+
marginBottom: string | number;
|
|
67
|
+
};
|
|
68
|
+
px: (value: string | number) => {
|
|
69
|
+
paddingLeft: string | number;
|
|
70
|
+
paddingRight: string | number;
|
|
71
|
+
};
|
|
72
|
+
py: (value: string | number) => {
|
|
73
|
+
paddingTop: string | number;
|
|
74
|
+
paddingBottom: string | number;
|
|
75
|
+
};
|
|
76
|
+
size: (value: string | number) => {
|
|
77
|
+
width: string | number;
|
|
78
|
+
height: string | number;
|
|
79
|
+
};
|
|
80
|
+
}>>;
|
|
81
|
+
export { Select, };
|
|
82
|
+
//# sourceMappingURL=Select.styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.styled.d.ts","sourceRoot":"","sources":["../../../src/components/form/Select.styled.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkBV,CAAC;AAEH,OAAO,EACH,MAAM,GACT,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { borderPxToRem, dimensionsPxToRem, pxToRem, styled } from "../../theme.js";
|
|
2
|
+
const Select = styled("select", {
|
|
3
|
+
"boxSizing": "border-box",
|
|
4
|
+
"height": dimensionsPxToRem(103),
|
|
5
|
+
"color": "$text",
|
|
6
|
+
"display": "flex",
|
|
7
|
+
"alignItems": "center",
|
|
8
|
+
"width": "100%",
|
|
9
|
+
"background": "white",
|
|
10
|
+
"fontFamily": "inherit",
|
|
11
|
+
"borderRadius": pxToRem(2),
|
|
12
|
+
"padding": `0 ${dimensionsPxToRem(36)}`,
|
|
13
|
+
"border": `${borderPxToRem(1)} solid $border`,
|
|
14
|
+
"appearance": "auto",
|
|
15
|
+
"&:disabled": {
|
|
16
|
+
background: "$inputDisabledBg",
|
|
17
|
+
color: "$inputDisabledText",
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export { Select, };
|
|
21
|
+
//# sourceMappingURL=Select.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.styled.js","sourceRoot":"","sources":["../../../src/components/form/Select.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEnF,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,YAAY;IACzB,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC;IAChC,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,MAAM;IACjB,YAAY,EAAE,QAAQ;IACtB,OAAO,EAAE,MAAM;IACf,YAAY,EAAE,OAAO;IACrB,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1B,SAAS,EAAE,KAAK,iBAAiB,CAAC,EAAE,CAAC,EAAE;IACvC,QAAQ,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,gBAAgB;IAC7C,YAAY,EAAE,MAAM;IAEpB,YAAY,EAAE;QACV,UAAU,EAAE,kBAAkB;QAC9B,KAAK,EAAE,oBAAoB;KAC9B;CACJ,CAAC,CAAC;AAEH,OAAO,EACH,MAAM,GACT,CAAC"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type Variant = "inline" | "outline";
|
|
3
|
-
interface Props {
|
|
4
|
-
variant?: Variant | Variant[];
|
|
5
|
-
}
|
|
6
|
-
declare const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & Props>;
|
|
7
|
-
export { Button };
|
|
1
|
+
export { Button } from "./Button.styled.js";
|
|
8
2
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { makeVariants } from "../../../utils/index.js";
|
|
4
|
-
import styles from "./Button.module.scss";
|
|
5
|
-
const Button = ({ className, children, variant, ...props }) => {
|
|
6
|
-
const variants = makeVariants(variant);
|
|
7
|
-
const cls = classnames(styles.btn, {
|
|
8
|
-
[styles["btn--inline"]]: variants.includes("inline"),
|
|
9
|
-
[styles["btn--outline"]]: variants.includes("outline"),
|
|
10
|
-
}, className);
|
|
11
|
-
return (React.createElement("button", { ...props, className: cls, disabled: props.disabled }, children));
|
|
12
|
-
};
|
|
13
|
-
export { Button };
|
|
1
|
+
export { Button } from "./Button.styled.js";
|
|
14
2
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { Button } from "./Button.js";
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
type Story = StoryObj<typeof Button>;
|
|
5
|
+
declare const Primary: Story;
|
|
6
|
+
declare const MultipleAtOnce: Story;
|
|
7
|
+
export { Primary, MultipleAtOnce, };
|
|
8
|
+
export default meta;
|
|
9
|
+
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,QAAA,MAAM,OAAO,EAAE,KAKd,CAAC;AASF,QAAA,MAAM,cAAc,EAAE,KAerB,CAAC;AAEF,OAAO,EACH,OAAO,EACP,cAAc,GACjB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
import { styled } from "../../../theme.js";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/UI/Button",
|
|
6
|
+
component: Button,
|
|
7
|
+
tags: ["autodocs", "ui"],
|
|
8
|
+
};
|
|
9
|
+
const Primary = {
|
|
10
|
+
args: {
|
|
11
|
+
children: "Click me",
|
|
12
|
+
onClick: () => { alert("Clicked"); },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const Container = styled("div", {
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexDirection: "column",
|
|
18
|
+
alignItems: "flex-start",
|
|
19
|
+
gap: "1rem",
|
|
20
|
+
});
|
|
21
|
+
const MultipleAtOnce = {
|
|
22
|
+
render: () => {
|
|
23
|
+
const handleClick = useCallback(() => {
|
|
24
|
+
alert("Clicked");
|
|
25
|
+
}, []);
|
|
26
|
+
return (React.createElement(Container, null,
|
|
27
|
+
React.createElement(Button, { onClick: handleClick }, "Basic button"),
|
|
28
|
+
React.createElement(Button, { disabled: true, onClick: handleClick }, "Disabled button"),
|
|
29
|
+
React.createElement(Button, { inline: true, onClick: handleClick }, "Inline button"),
|
|
30
|
+
React.createElement(Button, { outline: true, onClick: handleClick }, "Outline button")));
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export { Primary, MultipleAtOnce, };
|
|
34
|
+
export default meta;
|
|
35
|
+
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,MAAM,IAAI,GAAS;IACf,KAAK,EAAE,sBAAsB;IAC7B,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC;CAC3B,CAAC;AAIF,MAAM,OAAO,GAAU;IACnB,IAAI,EAAE;QACF,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KACvC;CACJ,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE;IAC5B,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,YAAY;IACxB,GAAG,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,MAAM,cAAc,GAAU;IAC1B,MAAM,EAAE,GAAG,EAAE;QACT,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;YACjC,KAAK,CAAC,SAAS,CAAC,CAAC;QACrB,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,OAAO,CACH,oBAAC,SAAS;YACN,oBAAC,MAAM,IAAC,OAAO,EAAE,WAAW,mBAAuB;YACnD,oBAAC,MAAM,IAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,sBAA0B;YACtE,oBAAC,MAAM,IAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,oBAAwB;YAClE,oBAAC,MAAM,IAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,qBAAyB,CAC5D,CACf,CAAC;IACN,CAAC;CACJ,CAAC;AAEF,OAAO,EACH,OAAO,EACP,cAAc,GACjB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
declare const Button: import("@stitches/react/types/styled-component.js").StyledComponent<"button", {
|
|
2
|
+
inline?: boolean | "true";
|
|
3
|
+
outline?: boolean | "true";
|
|
4
|
+
}, {}, import("@stitches/react/types/css-util.js").CSS<{}, {
|
|
5
|
+
colors: {
|
|
6
|
+
background: string;
|
|
7
|
+
mainColor: string;
|
|
8
|
+
mainColorAlt: string;
|
|
9
|
+
activeBg: string;
|
|
10
|
+
inactiveBg: string;
|
|
11
|
+
inactiveDarkBg: string;
|
|
12
|
+
toggleHandleBg: string;
|
|
13
|
+
toggleHandleBorder: string;
|
|
14
|
+
toggleBgDisabled: string;
|
|
15
|
+
toggleHandleBorderDisabled: string;
|
|
16
|
+
toggleHandleBgDisabled: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
border: string;
|
|
19
|
+
buttonBorder: string;
|
|
20
|
+
headerBorder: string;
|
|
21
|
+
headerBg: string;
|
|
22
|
+
headerText: string;
|
|
23
|
+
text: string;
|
|
24
|
+
sub: string;
|
|
25
|
+
popText: string;
|
|
26
|
+
toolbarBorder: string;
|
|
27
|
+
toolbarBg: string;
|
|
28
|
+
modalBg: string;
|
|
29
|
+
modalButtonBg: string;
|
|
30
|
+
modalButtonBorder: string;
|
|
31
|
+
inputDisabledBg: string;
|
|
32
|
+
inputDisabledText: string;
|
|
33
|
+
choiceBg: string;
|
|
34
|
+
choiceText: string;
|
|
35
|
+
choiceActiveBg: string;
|
|
36
|
+
choiceActiveText: string;
|
|
37
|
+
choiceBorder: string;
|
|
38
|
+
selectorText: string;
|
|
39
|
+
selectorActive: string;
|
|
40
|
+
blue1: string;
|
|
41
|
+
blue2: string;
|
|
42
|
+
blue3: string;
|
|
43
|
+
orange1: string;
|
|
44
|
+
orange1Darker: string;
|
|
45
|
+
purple1: string;
|
|
46
|
+
green1: string;
|
|
47
|
+
green1Darker: string;
|
|
48
|
+
pink1: string;
|
|
49
|
+
red1: string;
|
|
50
|
+
yellow1: string;
|
|
51
|
+
yellow2: string;
|
|
52
|
+
yellow3: string;
|
|
53
|
+
pinky1: string;
|
|
54
|
+
pinky2: string;
|
|
55
|
+
pinky3: string;
|
|
56
|
+
grey1: string;
|
|
57
|
+
focusColor: string;
|
|
58
|
+
scrollbarsThumb: string;
|
|
59
|
+
scrollbarsBg: string;
|
|
60
|
+
tableStripedBg: string;
|
|
61
|
+
};
|
|
62
|
+
}, import("@stitches/react/types/config.js").DefaultThemeMap, {
|
|
63
|
+
mx: (value: string | number) => {
|
|
64
|
+
marginLeft: string | number;
|
|
65
|
+
marginRight: string | number;
|
|
66
|
+
};
|
|
67
|
+
my: (value: string | number) => {
|
|
68
|
+
marginTop: string | number;
|
|
69
|
+
marginBottom: string | number;
|
|
70
|
+
};
|
|
71
|
+
px: (value: string | number) => {
|
|
72
|
+
paddingLeft: string | number;
|
|
73
|
+
paddingRight: string | number;
|
|
74
|
+
};
|
|
75
|
+
py: (value: string | number) => {
|
|
76
|
+
paddingTop: string | number;
|
|
77
|
+
paddingBottom: string | number;
|
|
78
|
+
};
|
|
79
|
+
size: (value: string | number) => {
|
|
80
|
+
width: string | number;
|
|
81
|
+
height: string | number;
|
|
82
|
+
};
|
|
83
|
+
}>>;
|
|
84
|
+
export { Button, };
|
|
85
|
+
//# sourceMappingURL=Button.styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.styled.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.styled.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCV,CAAC;AAEH,OAAO,EACH,MAAM,GACT,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { borderPxToRem, dimensionsPxToRem, fontPxToRem, pxToRem, styled } from "../../../theme.js";
|
|
2
|
+
const Button = styled("button", {
|
|
3
|
+
"height": dimensionsPxToRem(118),
|
|
4
|
+
"background": "$green1",
|
|
5
|
+
"border": `${borderPxToRem(1)} solid $green1Darker`,
|
|
6
|
+
"color": "white",
|
|
7
|
+
"borderRadius": "1000px",
|
|
8
|
+
"display": "flex",
|
|
9
|
+
"alignItems": "center",
|
|
10
|
+
"justifyContent": "center",
|
|
11
|
+
"width": "100%",
|
|
12
|
+
"fontSize": fontPxToRem(26),
|
|
13
|
+
"padding": "0 1em",
|
|
14
|
+
"gap": pxToRem(10),
|
|
15
|
+
"&:disabled": {
|
|
16
|
+
opacity: 0.5,
|
|
17
|
+
},
|
|
18
|
+
"variants": {
|
|
19
|
+
inline: {
|
|
20
|
+
true: {
|
|
21
|
+
width: "auto",
|
|
22
|
+
display: "inline-flex",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
outline: {
|
|
26
|
+
true: {
|
|
27
|
+
background: "white",
|
|
28
|
+
borderColor: "$buttonBorder",
|
|
29
|
+
color: "$grey1",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export { Button, };
|
|
35
|
+
//# sourceMappingURL=Button.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.styled.js","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAKnG,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC;IAChC,YAAY,EAAE,SAAS;IACvB,QAAQ,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,sBAAsB;IACnD,OAAO,EAAE,OAAO;IAChB,cAAc,EAAE,QAAQ;IACxB,SAAS,EAAE,MAAM;IACjB,YAAY,EAAE,QAAQ;IACtB,gBAAgB,EAAE,QAAQ;IAC1B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC;IAC3B,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;IAElB,YAAY,EAAE;QACV,OAAO,EAAE,GAAG;KACf;IAED,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,IAAI,EAAE;gBACF,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,aAAa;aACzB;SACJ;QACD,OAAO,EAAE;YACL,IAAI,EAAE;gBACF,UAAU,EAAE,OAAO;gBACnB,WAAW,EAAE,eAAe;gBAC5B,KAAK,EAAE,QAAQ;aAClB;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,OAAO,EACH,MAAM,GACT,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
2
|
+
import { ContainerStyled, OverlayStyled, RemovePadding } from "./Modal.styled";
|
|
3
|
+
type OverlayProps = React.ComponentProps<typeof OverlayStyled>;
|
|
4
|
+
type ContainerProps = React.ComponentProps<typeof ContainerStyled>;
|
|
4
5
|
interface Props {
|
|
5
6
|
onOverlayClick?: (() => void) | "close" | null;
|
|
6
7
|
closeOnEsc?: boolean;
|
|
@@ -8,12 +9,13 @@ interface Props {
|
|
|
8
9
|
isOpen: boolean;
|
|
9
10
|
title?: React.ReactNode;
|
|
10
11
|
className?: string;
|
|
11
|
-
variant?: Variant | Variant[];
|
|
12
12
|
portal?: boolean | HTMLElement;
|
|
13
13
|
children: React.ReactNode;
|
|
14
|
+
position?: OverlayProps["position"];
|
|
15
|
+
full?: ContainerProps["full"];
|
|
14
16
|
}
|
|
15
17
|
interface SubComponents {
|
|
16
|
-
|
|
18
|
+
RemovePadding: typeof RemovePadding;
|
|
17
19
|
}
|
|
18
20
|
declare const Modal: React.FC<Props> & SubComponents;
|
|
19
21
|
export { Modal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAMxE,OAAO,EAAE,eAAe,EAAoB,aAAa,EAAE,aAAa,EAAe,MAAM,gBAAgB,CAAC;AAE9G,KAAK,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAC/D,KAAK,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC;AAEnE,UAAU,KAAK;IACX,cAAc,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;CACjC;AAED,UAAU,aAAa;IACnB,aAAa,EAAE,OAAO,aAAa,CAAC;CACvC;AAKD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,aAwI9B,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
2
|
import { createPortal } from "react-dom";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import styles from "./Modal.module.scss";
|
|
7
|
-
const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "close", closeOnEsc = true, portal = true, variant, }) => {
|
|
3
|
+
import { ContainerStyled, NEGATIVE_PADDING, OverlayStyled, RemovePadding, TitleStyled } from "./Modal.styled";
|
|
4
|
+
const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "close", closeOnEsc = true, portal = true, position, full, }) => {
|
|
8
5
|
const [isClosing, setIsClosing] = useState(false);
|
|
9
6
|
const [isRendered, setIsRendered] = useState(false);
|
|
10
7
|
const overlayRef = useRef(null);
|
|
11
8
|
const containerRef = useRef(null);
|
|
12
|
-
const v = makeVariants(variant);
|
|
13
9
|
useEffect(() => {
|
|
14
10
|
if (!isOpen || !closeOnEsc) {
|
|
15
11
|
return;
|
|
@@ -45,7 +41,7 @@ const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "
|
|
|
45
41
|
overlayRef.current.style.removeProperty("animation");
|
|
46
42
|
containerRef.current.style.removeProperty("animation");
|
|
47
43
|
}, [isClosing]);
|
|
48
|
-
const titleElem = title
|
|
44
|
+
const titleElem = title ? React.createElement(TitleStyled, null, title) : null;
|
|
49
45
|
const handleOverlayClick = useCallback((e) => {
|
|
50
46
|
if (e.target !== e.currentTarget) {
|
|
51
47
|
return;
|
|
@@ -66,24 +62,40 @@ const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "
|
|
|
66
62
|
if (!isRendered) {
|
|
67
63
|
return null;
|
|
68
64
|
}
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
const overlayVariants = {};
|
|
66
|
+
isClosing && (overlayVariants.isClosing = true);
|
|
67
|
+
position != null && (overlayVariants.position = position);
|
|
68
|
+
const containerVariants = {};
|
|
69
|
+
isClosing && (containerVariants.isClosing = true);
|
|
70
|
+
full != null && (containerVariants.full = full);
|
|
71
|
+
const childrenCount = React.Children.count(children);
|
|
72
|
+
const chld = React.Children.map(children, (child, index) => {
|
|
73
|
+
var _a;
|
|
74
|
+
if (React.isValidElement(child)) {
|
|
75
|
+
if (child.type === RemovePadding) {
|
|
76
|
+
const css = (_a = child.props.css) !== null && _a !== void 0 ? _a : {};
|
|
77
|
+
if (index === 0 && titleElem == null) {
|
|
78
|
+
css.marginTop = NEGATIVE_PADDING;
|
|
79
|
+
}
|
|
80
|
+
if (index === childrenCount - 1) {
|
|
81
|
+
css.marginBottom = NEGATIVE_PADDING;
|
|
82
|
+
}
|
|
83
|
+
return React.cloneElement(child, { css });
|
|
84
|
+
}
|
|
85
|
+
return child;
|
|
86
|
+
}
|
|
87
|
+
return child;
|
|
76
88
|
});
|
|
77
|
-
const tree = (React.createElement(
|
|
78
|
-
React.createElement(
|
|
89
|
+
const tree = (React.createElement(OverlayStyled, { ...overlayVariants, onClick: handleOverlayClick, ref: overlayRef, onAnimationEnd: handleAnimationEnd },
|
|
90
|
+
React.createElement(ContainerStyled, { className: className, ...containerVariants, ref: containerRef },
|
|
79
91
|
titleElem,
|
|
80
|
-
|
|
92
|
+
chld)));
|
|
81
93
|
if (portal) {
|
|
82
94
|
const root = typeof portal === "boolean" ? document.body : portal;
|
|
83
95
|
return createPortal(tree, root);
|
|
84
96
|
}
|
|
85
97
|
return tree;
|
|
86
98
|
};
|
|
87
|
-
Modal.
|
|
99
|
+
Modal.RemovePadding = RemovePadding;
|
|
88
100
|
export { Modal };
|
|
89
101
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/components/ui/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/components/ui/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA0B9G,MAAM,KAAK,GAAoC,CAAC,EAC5C,QAAQ,EACR,OAAO,EACP,MAA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nB,CAAC;IAEF,IAAI,MAAM,EAAE;QACR,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;QAClE,OAAO,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACnC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { Modal } from "./Modal.js";
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
type Story = StoryObj<typeof Modal>;
|
|
5
|
+
declare const Primary: Story;
|
|
6
|
+
declare const WithRemovedPaddingSections: Story;
|
|
7
|
+
declare const WithList: Story;
|
|
8
|
+
export { Primary, WithRemovedPaddingSections, WithList, };
|
|
9
|
+
export default meta;
|
|
10
|
+
//# sourceMappingURL=Modal.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/modal/Modal.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAInC,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAIpC,QAAA,MAAM,OAAO,EAAE,KAsCd,CAAC;AAEF,QAAA,MAAM,0BAA0B,EAAE,KAmCjC,CAAC;AAKF,QAAA,MAAM,QAAQ,EAAE,KA8Bf,CAAC;AAEF,OAAO,EACH,OAAO,EACP,0BAA0B,EAC1B,QAAQ,GACX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { Button } from "../button/Button.js";
|
|
3
|
+
import { Label } from "../../form/Label.js";
|
|
4
|
+
import { Input } from "../../form/input/Input.js";
|
|
5
|
+
import { Checkbox } from "../../form/Checkbox.js";
|
|
6
|
+
import { List } from "../../layout/list/List.js";
|
|
7
|
+
import { Modal } from "./Modal.js";
|
|
8
|
+
import { ModalButtons } from "./ModalButtons.js";
|
|
9
|
+
import { RemovePadding } from "./Modal.styled";
|
|
10
|
+
const meta = {
|
|
11
|
+
title: "Components/UI/Modal",
|
|
12
|
+
component: Modal,
|
|
13
|
+
tags: ["autodocs", "ui"],
|
|
14
|
+
};
|
|
15
|
+
const handleNoop = () => undefined;
|
|
16
|
+
const Primary = {
|
|
17
|
+
args: {},
|
|
18
|
+
render: () => {
|
|
19
|
+
const [open, setIsOpen] = useState(false);
|
|
20
|
+
const handleClose = useCallback(() => {
|
|
21
|
+
setIsOpen(false);
|
|
22
|
+
}, []);
|
|
23
|
+
const handleOpen = useCallback(() => {
|
|
24
|
+
setIsOpen(true);
|
|
25
|
+
}, []);
|
|
26
|
+
return (React.createElement("div", null,
|
|
27
|
+
React.createElement(Button, { onClick: handleOpen }, "Open modal"),
|
|
28
|
+
React.createElement(Modal, { onClose: handleClose, isOpen: open, title: "95.5 MHz", position: "bottom", full: true },
|
|
29
|
+
React.createElement(Label, null,
|
|
30
|
+
React.createElement(Input, { placeholder: "New station" })),
|
|
31
|
+
React.createElement(Label, null,
|
|
32
|
+
React.createElement(Checkbox, { name: "", onChange: handleNoop, checked: true }, "Remember me")),
|
|
33
|
+
React.createElement(ModalButtons, null,
|
|
34
|
+
React.createElement(ModalButtons.Button, { onClick: handleClose }, "Cancel"),
|
|
35
|
+
React.createElement(ModalButtons.Button, { variant: "main", onClick: handleClose }, "Ok")))));
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const WithRemovedPaddingSections = {
|
|
39
|
+
args: {},
|
|
40
|
+
render: () => {
|
|
41
|
+
const [open, setIsOpen] = useState(false);
|
|
42
|
+
const handleClose = useCallback(() => {
|
|
43
|
+
setIsOpen(false);
|
|
44
|
+
}, []);
|
|
45
|
+
const handleOpen = useCallback(() => {
|
|
46
|
+
setIsOpen(true);
|
|
47
|
+
}, []);
|
|
48
|
+
return (React.createElement("div", null,
|
|
49
|
+
React.createElement(Button, { onClick: handleOpen }, "Open modal"),
|
|
50
|
+
React.createElement(Modal, { onClose: handleClose, isOpen: open, position: "bottom", full: true },
|
|
51
|
+
React.createElement(RemovePadding, null,
|
|
52
|
+
React.createElement(Label, null,
|
|
53
|
+
React.createElement(Input, { placeholder: "New station" }))),
|
|
54
|
+
React.createElement(Label, null,
|
|
55
|
+
React.createElement(Input, { placeholder: "New station" })),
|
|
56
|
+
React.createElement(RemovePadding, null,
|
|
57
|
+
React.createElement(Label, null,
|
|
58
|
+
React.createElement(Input, { placeholder: "New station" }))))));
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
const WithList = {
|
|
62
|
+
args: {},
|
|
63
|
+
render: () => {
|
|
64
|
+
const [open, setIsOpen] = useState(false);
|
|
65
|
+
const handleClose = useCallback(() => {
|
|
66
|
+
setIsOpen(false);
|
|
67
|
+
}, []);
|
|
68
|
+
const handleOpen = useCallback(() => {
|
|
69
|
+
setIsOpen(true);
|
|
70
|
+
}, []);
|
|
71
|
+
return (React.createElement("div", null,
|
|
72
|
+
React.createElement(Button, { onClick: handleOpen }, "Open modal"),
|
|
73
|
+
React.createElement(Modal, { onClose: handleClose, isOpen: open, position: "bottom", full: true },
|
|
74
|
+
React.createElement(RemovePadding, null,
|
|
75
|
+
React.createElement(List, { inset: true },
|
|
76
|
+
React.createElement(List.Item, { selected: false, onClick: handleClose }, "First item"),
|
|
77
|
+
React.createElement(List.Item, { selected: true, onClick: handleClose }, "Second item"),
|
|
78
|
+
React.createElement(List.Item, { selected: false, onClick: handleClose }, "Third item"),
|
|
79
|
+
React.createElement(List.Item, { selected: false, onClick: handleClose }, "Last option"))))));
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
export { Primary, WithRemovedPaddingSections, WithList, };
|
|
83
|
+
export default meta;
|
|
84
|
+
//# sourceMappingURL=Modal.stories.js.map
|