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
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
4
4
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [0.22.0] - 2023-07-03
|
|
7
|
+
### Breaking
|
|
8
|
+
- `Button` no longer accepts `variant`, it has direct `inline` and `outline` props now
|
|
9
|
+
- `Modal` no longer accepts `variant`, it has direct `full` & `position` props (position still supports `bottom` only)
|
|
10
|
+
- `Modal.NegateMargin` replaced with improved `Modal.RemovePadding`
|
|
11
|
+
### Fixed
|
|
12
|
+
- some Button, Select & PopOption styles when using new css reset
|
|
13
|
+
### Dev
|
|
14
|
+
- `Button` converted to stitches
|
|
15
|
+
- `Select` converted to stitches
|
|
16
|
+
- `Modal` & `ModalButtons` converted to stitches
|
|
17
|
+
|
|
6
18
|
## [0.21.0] - 2022-06-13
|
|
7
19
|
### Breaking
|
|
8
20
|
- `Section` no longer accepts `variant`, it has direct `horizontal` and `vertical` props now
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/form/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/form/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,27 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.Select = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const Select_module_scss_1 = __importDefault(require("./Select.module.scss"));
|
|
21
|
-
const Select = (_a) => {
|
|
22
|
-
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
23
|
-
const wrapperCls = (0, classnames_1.default)(Select_module_scss_1.default.select, className);
|
|
24
|
-
return (react_1.default.createElement("select", Object.assign({ className: wrapperCls }, props), children));
|
|
25
|
-
};
|
|
26
|
-
exports.Select = Select;
|
|
4
|
+
var Select_styled_js_1 = require("./Select.styled.js");
|
|
5
|
+
Object.defineProperty(exports, "Select", { enumerable: true, get: function () { return Select_styled_js_1.Select; } });
|
|
27
6
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/form/Select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/form/Select.tsx"],"names":[],"mappings":";;;AAAA,uDAA4C;AAAnC,0GAAA,MAAM,OAAA"}
|
|
@@ -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,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Primary = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Select_js_1 = require("./Select.js");
|
|
9
|
+
const meta = {
|
|
10
|
+
title: "Components/Form/Select",
|
|
11
|
+
component: Select_js_1.Select,
|
|
12
|
+
tags: ["autodocs", "form"],
|
|
13
|
+
};
|
|
14
|
+
const Primary = {
|
|
15
|
+
args: {
|
|
16
|
+
children: [
|
|
17
|
+
react_1.default.createElement("option", { key: "1", value: "1" }, "First"),
|
|
18
|
+
react_1.default.createElement("option", { key: "2", value: "2" }, "Second"),
|
|
19
|
+
react_1.default.createElement("option", { key: "3", value: "3" }, "Third"),
|
|
20
|
+
],
|
|
21
|
+
disabled: false,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
exports.Primary = Primary;
|
|
25
|
+
exports.default = meta;
|
|
26
|
+
//# 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,kDAA0B;AAI1B,2CAAqC;AAErC,MAAM,IAAI,GAAS;IACf,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,kBAAM;IACjB,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAIF,MAAM,OAAO,GAAU;IACnB,IAAI,EAAE;QACF,QAAQ,EAAE;YACN,0CAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,YAAgB;YAC5C,0CAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,aAAiB;YAC7C,0CAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,YAAgB;SAC/C;QACD,QAAQ,EAAE,KAAK;KAClB;CACJ,CAAC;AAGE,0BAAO;AAGX,kBAAe,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,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Select = void 0;
|
|
4
|
+
const theme_js_1 = require("../../theme.js");
|
|
5
|
+
const Select = (0, theme_js_1.styled)("select", {
|
|
6
|
+
"boxSizing": "border-box",
|
|
7
|
+
"height": (0, theme_js_1.dimensionsPxToRem)(103),
|
|
8
|
+
"color": "$text",
|
|
9
|
+
"display": "flex",
|
|
10
|
+
"alignItems": "center",
|
|
11
|
+
"width": "100%",
|
|
12
|
+
"background": "white",
|
|
13
|
+
"fontFamily": "inherit",
|
|
14
|
+
"borderRadius": (0, theme_js_1.pxToRem)(2),
|
|
15
|
+
"padding": `0 ${(0, theme_js_1.dimensionsPxToRem)(36)}`,
|
|
16
|
+
"border": `${(0, theme_js_1.borderPxToRem)(1)} solid $border`,
|
|
17
|
+
"appearance": "auto",
|
|
18
|
+
"&:disabled": {
|
|
19
|
+
background: "$inputDisabledBg",
|
|
20
|
+
color: "$inputDisabledText",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
exports.Select = Select;
|
|
24
|
+
//# 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,6CAAmF;AAEnF,MAAM,MAAM,GAAG,IAAA,iBAAM,EAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,YAAY;IACzB,QAAQ,EAAE,IAAA,4BAAiB,EAAC,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,IAAA,kBAAO,EAAC,CAAC,CAAC;IAC1B,SAAS,EAAE,KAAK,IAAA,4BAAiB,EAAC,EAAE,CAAC,EAAE;IACvC,QAAQ,EAAE,GAAG,IAAA,wBAAa,EAAC,CAAC,CAAC,gBAAgB;IAC7C,YAAY,EAAE,MAAM;IAEpB,YAAY,EAAE;QACV,UAAU,EAAE,kBAAkB;QAC9B,KAAK,EAAE,oBAAoB;KAC9B;CACJ,CAAC,CAAC;AAGC,wBAAM"}
|
|
@@ -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,32 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.Button = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const index_js_1 = require("../../../utils/index.js");
|
|
21
|
-
const Button_module_scss_1 = __importDefault(require("./Button.module.scss"));
|
|
22
|
-
const Button = (_a) => {
|
|
23
|
-
var { className, children, variant } = _a, props = __rest(_a, ["className", "children", "variant"]);
|
|
24
|
-
const variants = (0, index_js_1.makeVariants)(variant);
|
|
25
|
-
const cls = (0, classnames_1.default)(Button_module_scss_1.default.btn, {
|
|
26
|
-
[Button_module_scss_1.default["btn--inline"]]: variants.includes("inline"),
|
|
27
|
-
[Button_module_scss_1.default["btn--outline"]]: variants.includes("outline"),
|
|
28
|
-
}, className);
|
|
29
|
-
return (react_1.default.createElement("button", Object.assign({}, props, { className: cls, disabled: props.disabled }), children));
|
|
30
|
-
};
|
|
31
|
-
exports.Button = Button;
|
|
4
|
+
var Button_styled_js_1 = require("./Button.styled.js");
|
|
5
|
+
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_styled_js_1.Button; } });
|
|
32
6
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/ui/button/Button.tsx"],"names":[],"mappings":";;;AAAA,uDAA4C;AAAnC,0GAAA,MAAM,OAAA"}
|
|
@@ -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,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.MultipleAtOnce = exports.Primary = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const theme_js_1 = require("../../../theme.js");
|
|
29
|
+
const Button_js_1 = require("./Button.js");
|
|
30
|
+
const meta = {
|
|
31
|
+
title: "Components/UI/Button",
|
|
32
|
+
component: Button_js_1.Button,
|
|
33
|
+
tags: ["autodocs", "ui"],
|
|
34
|
+
};
|
|
35
|
+
const Primary = {
|
|
36
|
+
args: {
|
|
37
|
+
children: "Click me",
|
|
38
|
+
onClick: () => { alert("Clicked"); },
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
exports.Primary = Primary;
|
|
42
|
+
const Container = (0, theme_js_1.styled)("div", {
|
|
43
|
+
display: "flex",
|
|
44
|
+
flexDirection: "column",
|
|
45
|
+
alignItems: "flex-start",
|
|
46
|
+
gap: "1rem",
|
|
47
|
+
});
|
|
48
|
+
const MultipleAtOnce = {
|
|
49
|
+
render: () => {
|
|
50
|
+
const handleClick = (0, react_1.useCallback)(() => {
|
|
51
|
+
alert("Clicked");
|
|
52
|
+
}, []);
|
|
53
|
+
return (react_1.default.createElement(Container, null,
|
|
54
|
+
react_1.default.createElement(Button_js_1.Button, { onClick: handleClick }, "Basic button"),
|
|
55
|
+
react_1.default.createElement(Button_js_1.Button, { disabled: true, onClick: handleClick }, "Disabled button"),
|
|
56
|
+
react_1.default.createElement(Button_js_1.Button, { inline: true, onClick: handleClick }, "Inline button"),
|
|
57
|
+
react_1.default.createElement(Button_js_1.Button, { outline: true, onClick: handleClick }, "Outline button")));
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
exports.MultipleAtOnce = MultipleAtOnce;
|
|
61
|
+
exports.default = meta;
|
|
62
|
+
//# 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,+CAA2C;AAI3C,gDAA2C;AAE3C,2CAAqC;AAIrC,MAAM,IAAI,GAAS;IACf,KAAK,EAAE,sBAAsB;IAC7B,SAAS,EAAE,kBAAM;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;AA2BE,0BAAO;AAzBX,MAAM,SAAS,GAAG,IAAA,iBAAM,EAAC,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,IAAA,mBAAW,EAAC,GAAG,EAAE;YACjC,KAAK,CAAC,SAAS,CAAC,CAAC;QACrB,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,OAAO,CACH,8BAAC,SAAS;YACN,8BAAC,kBAAM,IAAC,OAAO,EAAE,WAAW,mBAAuB;YACnD,8BAAC,kBAAM,IAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,sBAA0B;YACtE,8BAAC,kBAAM,IAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,oBAAwB;YAClE,8BAAC,kBAAM,IAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,qBAAyB,CAC5D,CACf,CAAC;IACN,CAAC;CACJ,CAAC;AAIE,wCAAc;AAGlB,kBAAe,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,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
4
|
+
const theme_js_1 = require("../../../theme.js");
|
|
5
|
+
const Button = (0, theme_js_1.styled)("button", {
|
|
6
|
+
"height": (0, theme_js_1.dimensionsPxToRem)(118),
|
|
7
|
+
"background": "$green1",
|
|
8
|
+
"border": `${(0, theme_js_1.borderPxToRem)(1)} solid $green1Darker`,
|
|
9
|
+
"color": "white",
|
|
10
|
+
"borderRadius": "1000px",
|
|
11
|
+
"display": "flex",
|
|
12
|
+
"alignItems": "center",
|
|
13
|
+
"justifyContent": "center",
|
|
14
|
+
"width": "100%",
|
|
15
|
+
"fontSize": (0, theme_js_1.fontPxToRem)(26),
|
|
16
|
+
"padding": "0 1em",
|
|
17
|
+
"gap": (0, theme_js_1.pxToRem)(10),
|
|
18
|
+
"&:disabled": {
|
|
19
|
+
opacity: 0.5,
|
|
20
|
+
},
|
|
21
|
+
"variants": {
|
|
22
|
+
inline: {
|
|
23
|
+
true: {
|
|
24
|
+
width: "auto",
|
|
25
|
+
display: "inline-flex",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
outline: {
|
|
29
|
+
true: {
|
|
30
|
+
background: "white",
|
|
31
|
+
borderColor: "$buttonBorder",
|
|
32
|
+
color: "$grey1",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
exports.Button = Button;
|
|
38
|
+
//# 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,gDAAmG;AAKnG,MAAM,MAAM,GAAG,IAAA,iBAAM,EAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,IAAA,4BAAiB,EAAC,GAAG,CAAC;IAChC,YAAY,EAAE,SAAS;IACvB,QAAQ,EAAE,GAAG,IAAA,wBAAa,EAAC,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,IAAA,sBAAW,EAAC,EAAE,CAAC;IAC3B,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,IAAA,kBAAO,EAAC,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;AAGC,wBAAM"}
|
|
@@ -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"}
|
|
@@ -22,23 +22,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.Modal = void 0;
|
|
30
27
|
const react_1 = __importStar(require("react"));
|
|
31
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
32
28
|
const react_dom_1 = require("react-dom");
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const Modal_module_scss_1 = __importDefault(require("./Modal.module.scss"));
|
|
36
|
-
const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "close", closeOnEsc = true, portal = true, variant, }) => {
|
|
29
|
+
const Modal_styled_1 = require("./Modal.styled");
|
|
30
|
+
const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "close", closeOnEsc = true, portal = true, position, full, }) => {
|
|
37
31
|
const [isClosing, setIsClosing] = (0, react_1.useState)(false);
|
|
38
32
|
const [isRendered, setIsRendered] = (0, react_1.useState)(false);
|
|
39
33
|
const overlayRef = (0, react_1.useRef)(null);
|
|
40
34
|
const containerRef = (0, react_1.useRef)(null);
|
|
41
|
-
const v = (0, index_js_1.makeVariants)(variant);
|
|
42
35
|
(0, react_1.useEffect)(() => {
|
|
43
36
|
if (!isOpen || !closeOnEsc) {
|
|
44
37
|
return;
|
|
@@ -74,7 +67,7 @@ const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "
|
|
|
74
67
|
overlayRef.current.style.removeProperty("animation");
|
|
75
68
|
containerRef.current.style.removeProperty("animation");
|
|
76
69
|
}, [isClosing]);
|
|
77
|
-
const titleElem = title
|
|
70
|
+
const titleElem = title ? react_1.default.createElement(Modal_styled_1.TitleStyled, null, title) : null;
|
|
78
71
|
const handleOverlayClick = (0, react_1.useCallback)((e) => {
|
|
79
72
|
if (e.target !== e.currentTarget) {
|
|
80
73
|
return;
|
|
@@ -95,18 +88,34 @@ const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "
|
|
|
95
88
|
if (!isRendered) {
|
|
96
89
|
return null;
|
|
97
90
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
91
|
+
const overlayVariants = {};
|
|
92
|
+
isClosing && (overlayVariants.isClosing = true);
|
|
93
|
+
position != null && (overlayVariants.position = position);
|
|
94
|
+
const containerVariants = {};
|
|
95
|
+
isClosing && (containerVariants.isClosing = true);
|
|
96
|
+
full != null && (containerVariants.full = full);
|
|
97
|
+
const childrenCount = react_1.default.Children.count(children);
|
|
98
|
+
const chld = react_1.default.Children.map(children, (child, index) => {
|
|
99
|
+
var _a;
|
|
100
|
+
if (react_1.default.isValidElement(child)) {
|
|
101
|
+
if (child.type === Modal_styled_1.RemovePadding) {
|
|
102
|
+
const css = (_a = child.props.css) !== null && _a !== void 0 ? _a : {};
|
|
103
|
+
if (index === 0 && titleElem == null) {
|
|
104
|
+
css.marginTop = Modal_styled_1.NEGATIVE_PADDING;
|
|
105
|
+
}
|
|
106
|
+
if (index === childrenCount - 1) {
|
|
107
|
+
css.marginBottom = Modal_styled_1.NEGATIVE_PADDING;
|
|
108
|
+
}
|
|
109
|
+
return react_1.default.cloneElement(child, { css });
|
|
110
|
+
}
|
|
111
|
+
return child;
|
|
112
|
+
}
|
|
113
|
+
return child;
|
|
105
114
|
});
|
|
106
|
-
const tree = (react_1.default.createElement(
|
|
107
|
-
react_1.default.createElement(
|
|
115
|
+
const tree = (react_1.default.createElement(Modal_styled_1.OverlayStyled, Object.assign({}, overlayVariants, { onClick: handleOverlayClick, ref: overlayRef, onAnimationEnd: handleAnimationEnd }),
|
|
116
|
+
react_1.default.createElement(Modal_styled_1.ContainerStyled, Object.assign({ className: className }, containerVariants, { ref: containerRef }),
|
|
108
117
|
titleElem,
|
|
109
|
-
|
|
118
|
+
chld)));
|
|
110
119
|
if (portal) {
|
|
111
120
|
const root = typeof portal === "boolean" ? document.body : portal;
|
|
112
121
|
return (0, react_dom_1.createPortal)(tree, root);
|
|
@@ -114,5 +123,5 @@ const Modal = ({ children, onClose, isOpen, title, className, onOverlayClick = "
|
|
|
114
123
|
return tree;
|
|
115
124
|
};
|
|
116
125
|
exports.Modal = Modal;
|
|
117
|
-
Modal.
|
|
126
|
+
Modal.RemovePadding = Modal_styled_1.RemovePadding;
|
|
118
127
|
//# sourceMappingURL=Modal.js.map
|