stone-kit 0.0.887 → 0.0.889
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/dist/App.js +10 -0
- package/dist/ButtonState.module-DtW3aevR.js +8 -0
- package/dist/FilterWithSave-Bp6rH8Pe.js +2230 -0
- package/dist/Menu-CgCfinVZ.js +513 -0
- package/dist/Option-BVIm7wOW.js +83 -0
- package/dist/PinTrans-D6OZq76b.js +10 -0
- package/dist/Router.js +103 -0
- package/dist/SmallFilter-C-VKnbkP.js +10 -0
- package/dist/components/Button/index.js +4 -0
- package/dist/components/Button/ui/Button.js +94 -0
- package/dist/components/Button/ui/Button.types.js +15 -0
- package/dist/components/CheckBox/CheckBox.js +84 -0
- package/dist/components/CheckBox/CheckBox.types.js +1 -0
- package/dist/components/CheckBox/index.js +4 -0
- package/dist/components/CheckBoxNew/CheckBox.types.js +6 -0
- package/dist/components/CheckBoxNew/CheckBoxNew.js +45 -0
- package/dist/components/CheckboxSelect/index.js +4 -0
- package/dist/components/CheckboxSelect/ui/CheckboxSelect.js +51 -0
- package/dist/components/DestinationTab/index.js +4 -0
- package/dist/components/DestinationTab/ui/DestinationTab.js +75 -0
- package/dist/components/DestinationTab/ui/DestinationTab.types.js +6 -0
- package/dist/components/FieldInput/index.js +4 -0
- package/dist/components/FieldInput/ui/FieldInput.js +22 -0
- package/dist/components/FieldInput/ui/FieldInput.types.js +1 -0
- package/dist/components/FilterWithSave/hooks/useFilterWithSave.js +28 -0
- package/dist/components/FilterWithSave/ui/FilterWithSave.js +9 -0
- package/dist/components/Flex/index.js +4 -0
- package/dist/components/Flex/ui/Flex.js +68 -0
- package/dist/components/Flex/ui/Flex.types.js +1 -0
- package/dist/components/FormModal/ui/ModalForm.js +30 -0
- package/dist/components/FormModal/utils/reg.js +6 -0
- package/dist/components/GroupedInput/index.js +4 -0
- package/dist/components/GroupedInput/ui/GroupedInputs.js +8 -0
- package/dist/components/GroupedInput/ui/GroupedInputs.types.js +1 -0
- package/dist/components/Input/index.js +4 -0
- package/dist/components/Input/ui/Input.js +3346 -0
- package/dist/components/Input/ui/Input.types.js +1 -0
- package/dist/components/Logo/index.js +4 -0
- package/dist/components/Logo/ui/Logo.js +63 -0
- package/dist/components/Logo/ui/Logo.types.js +13 -0
- package/dist/components/LotCard/hooks/useLotCard.js +31 -0
- package/dist/components/LotCard/index.js +4 -0
- package/dist/components/LotCard/ui/LotCard.js +11 -0
- package/dist/components/LotCard/ui/LotCard.types.d.ts +163 -70
- package/dist/components/LotCard/ui/LotCard.types.js +1 -0
- package/dist/components/LotCard/utils/checkBedroomsCount.js +20 -0
- package/dist/components/LotCard/utils/const.js +11 -0
- package/dist/components/LotCard/utils/formatPrice.js +11 -0
- package/dist/components/LotCard/utils/getTagsFeatures.js +13 -0
- package/dist/components/LotCard/utils/monthlyPayment.js +4 -0
- package/dist/components/LotCardSkeleton/index.js +4 -0
- package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.js +83 -0
- package/dist/components/MetroLabel/ui/MetroLabel.js +44 -0
- package/dist/components/MetroLabel/ui/MetroLabel.types.js +1 -0
- package/dist/components/MetroTag/index.js +4 -0
- package/dist/components/MetroTag/ui/MetroTag.js +142 -0
- package/dist/components/MetroTag/ui/MetroTag.types.js +1 -0
- package/dist/components/Modal/index.js +4 -0
- package/dist/components/Modal/ui/Modal.js +77 -0
- package/dist/components/Modal/ui/Modal.types.js +1 -0
- package/dist/components/ModalSuccess/ModalSuccess.js +61 -0
- package/dist/components/ModalSuccess/ModalSuccess.types.js +1 -0
- package/dist/components/NewIcon/icons/PinTrans.js +6 -0
- package/dist/components/NewIcon/icons/SmallFilter.js +6 -0
- package/dist/components/NewIcon/index.js +4 -0
- package/dist/components/NewIcon/ui/NewIcon.js +319 -0
- package/dist/components/NewIcon/ui/NewIcon.types.js +1 -0
- package/dist/components/NewIcon/ui/iconTypes.js +60 -0
- package/dist/components/ProjectCardSkeleton/index.js +4 -0
- package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.js +34 -0
- package/dist/components/RoundButton/index.js +4 -0
- package/dist/components/RoundButton/ui/RoundButton.js +73 -0
- package/dist/components/RoundButton/ui/RoundButton.types.js +16 -0
- package/dist/components/Select/index.js +4 -0
- package/dist/components/Select/model/selectMode.js +49 -0
- package/dist/components/Select/ui/Category.js +76 -0
- package/dist/components/Select/ui/Option.js +7 -0
- package/dist/components/Select/ui/Select.js +179 -0
- package/dist/components/Select/ui/Select.types.js +1 -0
- package/dist/components/SliderNavigation/index.js +4 -0
- package/dist/components/SliderNavigation/ui/SliderNavigation.js +65 -0
- package/dist/components/SliderNavigation/ui/SliderNavigation.types.js +1 -0
- package/dist/components/SortSelect/hooks/useSortSelect.js +6 -0
- package/dist/components/SortSelect/index.js +4 -0
- package/dist/components/SortSelect/ui/SortSelect.js +29 -0
- package/dist/components/SortSelect/ui/SortSelect.types.js +1 -0
- package/dist/components/SummarySelect/index.js +4 -0
- package/dist/components/SummarySelect/ui/SummarySelect.js +128 -0
- package/dist/components/Switcher/index.js +4 -0
- package/dist/components/Switcher/ui/Switcher.js +49 -0
- package/dist/components/Switcher/ui/Switcher.types.js +1 -0
- package/dist/components/TabSelect/index.js +4 -0
- package/dist/components/TabSelect/ui/TabSelect.js +49 -0
- package/dist/components/TabSelect/ui/TabSelect.types.js +1 -0
- package/dist/components/TabSwitcher/index.js +4 -0
- package/dist/components/TabSwitcher/ui/TabSwitcher.js +28 -0
- package/dist/components/TabSwitcher/ui/TabSwitcher.types.js +1 -0
- package/dist/components/Tag/index.js +4 -0
- package/dist/components/Tag/ui/Tag.js +79 -0
- package/dist/components/Tag/ui/Tag.types.js +20 -0
- package/dist/components/Text/index.js +4 -0
- package/dist/components/Text/ui/Text.js +22 -0
- package/dist/components/Text/ui/Text.types.js +1 -0
- package/dist/components/TextArea/TextArea.js +19 -0
- package/dist/components/TextArea/TextArea.types.js +1 -0
- package/dist/components/ZoomControls/index.js +4 -0
- package/dist/components/ZoomControls/ui/ZoomControls.js +31 -0
- package/dist/components/ZoomControls/ui/ZoomControls.types.js +1 -0
- package/dist/components/mobileButton/index.js +4 -0
- package/dist/components/mobileButton/ui/MobileButton.js +64 -0
- package/dist/components/mobileButton/ui/MobileButton.types.js +6 -0
- package/dist/index-DQgqDqGf.js +34046 -0
- package/dist/index-DmANy9jd.js +890 -0
- package/dist/index-rKuIKazb.js +45 -0
- package/dist/layout/Layout.js +11 -0
- package/dist/layout/components/Header/Header.js +164 -0
- package/dist/layout/components/Menu.js +28 -0
- package/dist/main.js +62 -7727
- package/dist/pages/ButtonsPage/ButtonState/ButtonState.js +121 -0
- package/dist/pages/ButtonsPage/Buttons.js +134 -0
- package/dist/pages/CheckboxPage/CheckboxPage.js +224 -0
- package/dist/pages/FormsPage/FormsPage.js +81 -0
- package/dist/pages/HomePage/HomePage.js +7 -0
- package/dist/pages/IconsPage/IconsPage.js +41 -0
- package/dist/pages/InputPage/InputPage.js +35 -0
- package/dist/pages/LogoPage/LogoPage.js +38 -0
- package/dist/pages/LotsPage/LotsPage.js +75 -0
- package/dist/pages/LotsPage/const.d.ts +4 -0
- package/dist/pages/LotsPage/const.js +210 -0
- package/dist/pages/ModalsPage/ModalPage.js +130 -0
- package/dist/pages/SelectPage/SelectPage.js +175 -0
- package/dist/pages/SelectPage/const.js +35 -0
- package/dist/pages/TabsPage/TabsPage.js +155 -0
- package/dist/pages/TagsPage/TagsPage.js +75 -0
- package/dist/shared/checkLargeOffice.js +12 -0
- package/dist/shared/deepEqual.js +16 -0
- package/dist/shared/useClientWidth.js +14 -0
- package/dist/stories/Button.js +23 -0
- package/dist/stories/Button.stories.js +50 -0
- package/dist/stories/Header.js +44 -0
- package/dist/stories/Header.stories.js +28 -0
- package/dist/stories/Page.js +58 -0
- package/dist/stories/Page.stories.js +22 -0
- package/dist/style.css +1 -1
- package/dist/useSortSelect-CjZXLFOG.js +80 -0
- package/package.json +1 -2
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as o } from "react";
|
|
3
|
+
import { S as i } from "../../FilterWithSave-Bp6rH8Pe.js";
|
|
4
|
+
import { FieldInput as l } from "../../components/FieldInput/ui/FieldInput.js";
|
|
5
|
+
import { TabSelect as d } from "../../components/TabSelect/ui/TabSelect.js";
|
|
6
|
+
const m = "_root_idppf_1", _ = "_tabsShort_idppf_7", w = "_tabSelectWrapper_idppf_11", v = "_destinationWrapper_idppf_15", g = "_whiteRow_apart_idppf_22", u = "_row_apart_idppf_26", n = {
|
|
7
|
+
root: m,
|
|
8
|
+
tabsShort: _,
|
|
9
|
+
tabSelectWrapper: w,
|
|
10
|
+
destinationWrapper: v,
|
|
11
|
+
whiteRow_apart: g,
|
|
12
|
+
row_apart: u
|
|
13
|
+
}, f = () => {
|
|
14
|
+
const [s, h] = o("C мебелью"), c = ["C мебелью", "C размерами", "План этажа", "Ген. план"], r = ["Студия", "1", "2", "3", "4+"];
|
|
15
|
+
return /* @__PURE__ */ p("div", { className: n.root, children: [
|
|
16
|
+
/* @__PURE__ */ a(i, { children: r.map((t, e) => /* @__PURE__ */ a(
|
|
17
|
+
i.Item,
|
|
18
|
+
{
|
|
19
|
+
itemsLength: r.length,
|
|
20
|
+
size_s: "medium",
|
|
21
|
+
size_l: "large",
|
|
22
|
+
index: e,
|
|
23
|
+
value: t,
|
|
24
|
+
disabled: e === 2 || e === 1,
|
|
25
|
+
children: t
|
|
26
|
+
},
|
|
27
|
+
e
|
|
28
|
+
)) }),
|
|
29
|
+
/* @__PURE__ */ a("div", { className: n.tabsShort, children: /* @__PURE__ */ a(l, { label: "Количество спален", children: /* @__PURE__ */ a(i, { children: r.map((t, e) => /* @__PURE__ */ a(
|
|
30
|
+
i.Item,
|
|
31
|
+
{
|
|
32
|
+
itemsLength: r.length,
|
|
33
|
+
index: e,
|
|
34
|
+
value: t,
|
|
35
|
+
addItemClassName: e === 0 ? n.gg : "",
|
|
36
|
+
children: t
|
|
37
|
+
}
|
|
38
|
+
)) }) }) }),
|
|
39
|
+
/* @__PURE__ */ a("div", { className: n.tabsShort, children: /* @__PURE__ */ a(l, { label: "Количество спален", children: /* @__PURE__ */ a(i, { variant: "whiteRowGrayLabel", children: r.map((t, e) => /* @__PURE__ */ a(
|
|
40
|
+
i.Item,
|
|
41
|
+
{
|
|
42
|
+
size_s: "tiny",
|
|
43
|
+
size_m: "tiny",
|
|
44
|
+
size_l: "tiny",
|
|
45
|
+
itemsLength: r.length,
|
|
46
|
+
index: e,
|
|
47
|
+
value: t,
|
|
48
|
+
addItemClassName: e === 0 ? n.gg : "",
|
|
49
|
+
children: t
|
|
50
|
+
},
|
|
51
|
+
e
|
|
52
|
+
)) }) }) }),
|
|
53
|
+
/* @__PURE__ */ a(l, { label: "Количество спален", children: /* @__PURE__ */ a(i, { variant: "whiteRowGrayLabel", children: r.map((t, e) => /* @__PURE__ */ a(
|
|
54
|
+
i.Item,
|
|
55
|
+
{
|
|
56
|
+
size_s: "tiny",
|
|
57
|
+
size_m: "tiny",
|
|
58
|
+
size_l: "tiny",
|
|
59
|
+
itemsLength: r.length,
|
|
60
|
+
index: e,
|
|
61
|
+
value: t,
|
|
62
|
+
addItemClassName: e === 0 ? n.gg : "",
|
|
63
|
+
children: t
|
|
64
|
+
},
|
|
65
|
+
e
|
|
66
|
+
)) }) }),
|
|
67
|
+
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(i, { col: !0, children: r.map((t, e) => /* @__PURE__ */ a(
|
|
68
|
+
i.Item,
|
|
69
|
+
{
|
|
70
|
+
itemsLength: r.length,
|
|
71
|
+
index: e,
|
|
72
|
+
value: t,
|
|
73
|
+
children: t
|
|
74
|
+
},
|
|
75
|
+
e
|
|
76
|
+
)) }) }),
|
|
77
|
+
/* @__PURE__ */ a("div", { className: n.tabsShort, children: /* @__PURE__ */ a(i, { col: !0, children: r.map((t, e) => /* @__PURE__ */ a(
|
|
78
|
+
i.Item,
|
|
79
|
+
{
|
|
80
|
+
itemsLength: r.length,
|
|
81
|
+
index: e,
|
|
82
|
+
value: t,
|
|
83
|
+
children: t
|
|
84
|
+
},
|
|
85
|
+
e
|
|
86
|
+
)) }) }),
|
|
87
|
+
/* @__PURE__ */ a("div", { className: n.whiteRow_apart, children: /* @__PURE__ */ a(
|
|
88
|
+
i,
|
|
89
|
+
{
|
|
90
|
+
variant: "whiteRow",
|
|
91
|
+
isApart: !0,
|
|
92
|
+
addClassName: n.row_apart,
|
|
93
|
+
children: r.map((t, e) => /* @__PURE__ */ a(
|
|
94
|
+
i.Item,
|
|
95
|
+
{
|
|
96
|
+
width: e === 0 ? "135px" : void 0,
|
|
97
|
+
width_m: e === 0 ? "96px" : void 0,
|
|
98
|
+
width_l: e === 0 ? "155px" : void 0,
|
|
99
|
+
itemsLength: r.length,
|
|
100
|
+
index: e,
|
|
101
|
+
children: t
|
|
102
|
+
},
|
|
103
|
+
e
|
|
104
|
+
))
|
|
105
|
+
}
|
|
106
|
+
) }),
|
|
107
|
+
/* @__PURE__ */ a("div", { className: n.whiteRow_apart, children: /* @__PURE__ */ a(
|
|
108
|
+
i,
|
|
109
|
+
{
|
|
110
|
+
variant: "grayRow",
|
|
111
|
+
isApart: !0,
|
|
112
|
+
addClassName: n.row_apart,
|
|
113
|
+
children: r.map((t, e) => /* @__PURE__ */ a(
|
|
114
|
+
i.Item,
|
|
115
|
+
{
|
|
116
|
+
width: e === 0 ? "135px" : void 0,
|
|
117
|
+
width_m: e === 0 ? "96px" : void 0,
|
|
118
|
+
width_l: e === 0 ? "155px" : void 0,
|
|
119
|
+
itemsLength: r.length,
|
|
120
|
+
index: e,
|
|
121
|
+
children: t
|
|
122
|
+
},
|
|
123
|
+
e
|
|
124
|
+
))
|
|
125
|
+
}
|
|
126
|
+
) }),
|
|
127
|
+
/* @__PURE__ */ a("div", { className: n.tabSelectWrapper, children: /* @__PURE__ */ a(d, { variant: "grayDesign", children: c.map((t, e) => /* @__PURE__ */ a(
|
|
128
|
+
d.Item,
|
|
129
|
+
{
|
|
130
|
+
name: "type",
|
|
131
|
+
checked: s === t,
|
|
132
|
+
onChange: () => h(t),
|
|
133
|
+
value: t,
|
|
134
|
+
children: t
|
|
135
|
+
},
|
|
136
|
+
e
|
|
137
|
+
)) }) }),
|
|
138
|
+
/* @__PURE__ */ a("div", { className: n.tabSelectWrapper, children: /* @__PURE__ */ a(d, { variant: "whiteStroke", children: ["для коммерции", "для жилых"].map((t, e) => /* @__PURE__ */ a(
|
|
139
|
+
d.Item,
|
|
140
|
+
{
|
|
141
|
+
name: "type",
|
|
142
|
+
width: "160px",
|
|
143
|
+
withPadding: !0,
|
|
144
|
+
checked: s === t,
|
|
145
|
+
onChange: () => h(t),
|
|
146
|
+
value: t,
|
|
147
|
+
children: t
|
|
148
|
+
},
|
|
149
|
+
e
|
|
150
|
+
)) }) })
|
|
151
|
+
] });
|
|
152
|
+
};
|
|
153
|
+
export {
|
|
154
|
+
f as default
|
|
155
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import "../../components/Button/ui/Button.js";
|
|
3
|
+
import "../../components/mobileButton/ui/MobileButton.js";
|
|
4
|
+
import "../../components/NewIcon/ui/NewIcon.js";
|
|
5
|
+
import "../../components/DestinationTab/ui/DestinationTab.js";
|
|
6
|
+
import "../../components/RoundButton/ui/RoundButton.js";
|
|
7
|
+
import { Tag as i } from "../../components/Tag/ui/Tag.js";
|
|
8
|
+
import "../../components/Switcher/ui/Switcher.js";
|
|
9
|
+
import "../../components/Text/ui/Text.js";
|
|
10
|
+
import "../../components/Flex/ui/Flex.js";
|
|
11
|
+
import "../../components/Input/ui/Input.js";
|
|
12
|
+
import "react";
|
|
13
|
+
import "react-dom";
|
|
14
|
+
import "../../FilterWithSave-Bp6rH8Pe.js";
|
|
15
|
+
import "../../components/GroupedInput/ui/GroupedInputs.js";
|
|
16
|
+
import "../../index-rKuIKazb.js";
|
|
17
|
+
import { MetroTag as t } from "../../components/MetroTag/ui/MetroTag.js";
|
|
18
|
+
import "../../components/Select/ui/Select.js";
|
|
19
|
+
import "../../components/SliderNavigation/ui/SliderNavigation.js";
|
|
20
|
+
import "../../components/LotCardSkeleton/ui/LotCardSkeleton.js";
|
|
21
|
+
import "../../components/TabSelect/ui/TabSelect.js";
|
|
22
|
+
import "../../components/CheckBox/CheckBox.js";
|
|
23
|
+
import "../../components/CheckBoxNew/CheckBoxNew.js";
|
|
24
|
+
import "../../components/CheckboxSelect/ui/CheckboxSelect.js";
|
|
25
|
+
const p = "_root_1tmts_1", s = {
|
|
26
|
+
root: p
|
|
27
|
+
}, W = () => {
|
|
28
|
+
const r = { name: "sokolnuyaki", color: "red", timeTo: 10, mode: "auto" }, m = [
|
|
29
|
+
{ name: "Сокольники", color: "red", timeTo: 10, mode: "auto" },
|
|
30
|
+
{ name: "Электрозаводская", color: "blue", timeTo: 10, mode: "auto" }
|
|
31
|
+
];
|
|
32
|
+
return /* @__PURE__ */ e("div", { className: s.root, children: [
|
|
33
|
+
/* @__PURE__ */ o(t, { metro: m }),
|
|
34
|
+
/* @__PURE__ */ o(t, { metro: r }),
|
|
35
|
+
/* @__PURE__ */ o(
|
|
36
|
+
t,
|
|
37
|
+
{
|
|
38
|
+
metro: r,
|
|
39
|
+
withBg: !0
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ o(
|
|
43
|
+
t,
|
|
44
|
+
{
|
|
45
|
+
metro: r,
|
|
46
|
+
withBg: !0,
|
|
47
|
+
isBetween: !0,
|
|
48
|
+
width: "full"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ o(
|
|
52
|
+
i,
|
|
53
|
+
{
|
|
54
|
+
variant: "shadeWhite",
|
|
55
|
+
size: "medium",
|
|
56
|
+
size_m: "tiny",
|
|
57
|
+
size_l: "tiny",
|
|
58
|
+
children: "От 285 000 ₽/м2"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ o(
|
|
62
|
+
i,
|
|
63
|
+
{
|
|
64
|
+
variant: "chineseBlack",
|
|
65
|
+
size: "small",
|
|
66
|
+
size_m: "tiny",
|
|
67
|
+
size_l: "small",
|
|
68
|
+
children: "От 285 000 ₽/м2"
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] });
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
W as TagsPage
|
|
75
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const r = (e) => {
|
|
2
|
+
if (e && (e == null ? void 0 : e.direction) === 1) {
|
|
3
|
+
if ((e == null ? void 0 : e.type) === 11 || (e == null ? void 0 : e.subType) === 8)
|
|
4
|
+
return !0;
|
|
5
|
+
if (typeof (e == null ? void 0 : e.beginFloor) == "number" && typeof (e == null ? void 0 : e.endFloor) == "number")
|
|
6
|
+
return (e == null ? void 0 : e.beginFloor) !== (e == null ? void 0 : e.endFloor);
|
|
7
|
+
}
|
|
8
|
+
return !1;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
r as checkLargeOffice
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const f = (e, t) => {
|
|
2
|
+
if (e === t)
|
|
3
|
+
return !0;
|
|
4
|
+
if (e == null || typeof e != "object" || t == null || typeof t != "object")
|
|
5
|
+
return !1;
|
|
6
|
+
const r = Object.keys(e), s = Object.keys(t);
|
|
7
|
+
if (r.length !== s.length)
|
|
8
|
+
return !1;
|
|
9
|
+
for (const n of r)
|
|
10
|
+
if (!s.includes(n) || !f(e[n], t[n]))
|
|
11
|
+
return !1;
|
|
12
|
+
return !0;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
f as deepEqual
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useState as u, useCallback as c, useEffect as i } from "react";
|
|
2
|
+
const a = () => {
|
|
3
|
+
const [e, n] = u(0), t = c(() => {
|
|
4
|
+
n(window.innerWidth);
|
|
5
|
+
}, [n]);
|
|
6
|
+
i(() => (window.addEventListener("resize", t), () => window.removeEventListener("resize", t)), []), i(() => {
|
|
7
|
+
t();
|
|
8
|
+
}, []);
|
|
9
|
+
const s = e < 1024, o = typeof window < "u" ? window.innerWidth < 768 : !1, r = e >= 768 && e < 1440, d = e > 1023 && e < 1440, l = e >= 1440;
|
|
10
|
+
return { currentClientWidth: e, isMobile: s, isTablet: d, isDesktop: l, isMobileBorder: o, isFullTablet: r };
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
a as useClientWidth
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
const y = ({
|
|
3
|
+
primary: o = !1,
|
|
4
|
+
size: t = "medium",
|
|
5
|
+
backgroundColor: n,
|
|
6
|
+
label: r,
|
|
7
|
+
...s
|
|
8
|
+
}) => {
|
|
9
|
+
const b = o ? "storybook-button--primary" : "storybook-button--secondary";
|
|
10
|
+
return /* @__PURE__ */ e(
|
|
11
|
+
"button",
|
|
12
|
+
{
|
|
13
|
+
type: "button",
|
|
14
|
+
className: ["storybook-button", `storybook-button--${t}`, b].join(" "),
|
|
15
|
+
style: { backgroundColor: n },
|
|
16
|
+
...s,
|
|
17
|
+
children: r
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
y as Button
|
|
23
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { l as t } from "../index-DQgqDqGf.js";
|
|
2
|
+
import { Button as a } from "./Button.js";
|
|
3
|
+
const e = {
|
|
4
|
+
title: "Example/Button",
|
|
5
|
+
component: a,
|
|
6
|
+
parameters: {
|
|
7
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
8
|
+
layout: "centered"
|
|
9
|
+
},
|
|
10
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
13
|
+
argTypes: {
|
|
14
|
+
backgroundColor: { control: "color" }
|
|
15
|
+
},
|
|
16
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
17
|
+
args: { onClick: t() }
|
|
18
|
+
}, l = {
|
|
19
|
+
args: {
|
|
20
|
+
primary: !0,
|
|
21
|
+
label: "Button"
|
|
22
|
+
}
|
|
23
|
+
}, s = {
|
|
24
|
+
args: {
|
|
25
|
+
label: "Button"
|
|
26
|
+
}
|
|
27
|
+
}, n = {
|
|
28
|
+
args: {
|
|
29
|
+
size: "large",
|
|
30
|
+
label: "Button"
|
|
31
|
+
}
|
|
32
|
+
}, c = {
|
|
33
|
+
args: {
|
|
34
|
+
size: "small",
|
|
35
|
+
label: "Button"
|
|
36
|
+
}
|
|
37
|
+
}, m = {
|
|
38
|
+
args: {
|
|
39
|
+
primary: !1,
|
|
40
|
+
label: "Button"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
n as Large,
|
|
45
|
+
l as Primary,
|
|
46
|
+
s as Secondary,
|
|
47
|
+
c as Small,
|
|
48
|
+
m as Test,
|
|
49
|
+
e as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as l, jsxs as e, Fragment as r } from "react/jsx-runtime";
|
|
2
|
+
import { Button as i } from "./Button.js";
|
|
3
|
+
const s = ({ user: n, onLogin: d, onLogout: a, onCreateAccount: h }) => /* @__PURE__ */ l("header", { children: /* @__PURE__ */ e("div", { className: "storybook-header", children: [
|
|
4
|
+
/* @__PURE__ */ e("div", { children: [
|
|
5
|
+
/* @__PURE__ */ l("svg", { width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("g", { fill: "none", fillRule: "evenodd", children: [
|
|
6
|
+
/* @__PURE__ */ l(
|
|
7
|
+
"path",
|
|
8
|
+
{
|
|
9
|
+
d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z",
|
|
10
|
+
fill: "#FFF"
|
|
11
|
+
}
|
|
12
|
+
),
|
|
13
|
+
/* @__PURE__ */ l(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z",
|
|
17
|
+
fill: "#555AB9"
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
/* @__PURE__ */ l(
|
|
21
|
+
"path",
|
|
22
|
+
{
|
|
23
|
+
d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z",
|
|
24
|
+
fill: "#91BAF8"
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
] }) }),
|
|
28
|
+
/* @__PURE__ */ l("h1", { children: "Acme" })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ l("div", { children: n ? /* @__PURE__ */ e(r, { children: [
|
|
31
|
+
/* @__PURE__ */ e("span", { className: "welcome", children: [
|
|
32
|
+
"Welcome, ",
|
|
33
|
+
/* @__PURE__ */ l("b", { children: n.name }),
|
|
34
|
+
"!"
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ l(i, { size: "small", onClick: a, label: "Log out" })
|
|
37
|
+
] }) : /* @__PURE__ */ e(r, { children: [
|
|
38
|
+
/* @__PURE__ */ l(i, { size: "small", onClick: d, label: "Log in" }),
|
|
39
|
+
/* @__PURE__ */ l(i, { primary: !0, size: "small", onClick: h, label: "Sign up" })
|
|
40
|
+
] }) })
|
|
41
|
+
] }) });
|
|
42
|
+
export {
|
|
43
|
+
s as Header
|
|
44
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { l as e } from "../index-DQgqDqGf.js";
|
|
2
|
+
import { Header as o } from "./Header.js";
|
|
3
|
+
const n = {
|
|
4
|
+
title: "Example/Header",
|
|
5
|
+
component: o,
|
|
6
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
10
|
+
layout: "fullscreen"
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
onLogin: e(),
|
|
14
|
+
onLogout: e(),
|
|
15
|
+
onCreateAccount: e()
|
|
16
|
+
}
|
|
17
|
+
}, r = {
|
|
18
|
+
args: {
|
|
19
|
+
user: {
|
|
20
|
+
name: "Jane Doe"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}, s = {};
|
|
24
|
+
export {
|
|
25
|
+
r as LoggedIn,
|
|
26
|
+
s as LoggedOut,
|
|
27
|
+
n as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import { Header as a } from "./Header.js";
|
|
4
|
+
const c = () => {
|
|
5
|
+
const [r, t] = n.useState();
|
|
6
|
+
return /* @__PURE__ */ o("article", { children: [
|
|
7
|
+
/* @__PURE__ */ e(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
user: r,
|
|
11
|
+
onLogin: () => t({ name: "Jane Doe" }),
|
|
12
|
+
onLogout: () => t(void 0),
|
|
13
|
+
onCreateAccount: () => t({ name: "Jane Doe" })
|
|
14
|
+
}
|
|
15
|
+
),
|
|
16
|
+
/* @__PURE__ */ o("section", { className: "storybook-page", children: [
|
|
17
|
+
/* @__PURE__ */ e("h2", { children: "Pages in Storybook" }),
|
|
18
|
+
/* @__PURE__ */ o("p", { children: [
|
|
19
|
+
"We recommend building UIs with a",
|
|
20
|
+
" ",
|
|
21
|
+
/* @__PURE__ */ e("a", { href: "https://componentdriven.org", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ e("strong", { children: "component-driven" }) }),
|
|
22
|
+
" ",
|
|
23
|
+
"process starting with atomic components and ending with pages."
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ e("p", { children: "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:" }),
|
|
26
|
+
/* @__PURE__ */ o("ul", { children: [
|
|
27
|
+
/* @__PURE__ */ e("li", { children: 'Use a higher-level connected component. Storybook helps you compose such data from the "args" of child component stories' }),
|
|
28
|
+
/* @__PURE__ */ e("li", { children: "Assemble data in the page component from your services. You can mock these services out using Storybook." })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ o("p", { children: [
|
|
31
|
+
"Get a guided tutorial on component-driven development at",
|
|
32
|
+
" ",
|
|
33
|
+
/* @__PURE__ */ e("a", { href: "https://storybook.js.org/tutorials/", target: "_blank", rel: "noopener noreferrer", children: "Storybook tutorials" }),
|
|
34
|
+
". Read more in the",
|
|
35
|
+
" ",
|
|
36
|
+
/* @__PURE__ */ e("a", { href: "https://storybook.js.org/docs", target: "_blank", rel: "noopener noreferrer", children: "docs" }),
|
|
37
|
+
"."
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ o("div", { className: "tip-wrapper", children: [
|
|
40
|
+
/* @__PURE__ */ e("span", { className: "tip", children: "Tip" }),
|
|
41
|
+
" Adjust the width of the canvas with the",
|
|
42
|
+
" ",
|
|
43
|
+
/* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("g", { fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ e(
|
|
44
|
+
"path",
|
|
45
|
+
{
|
|
46
|
+
d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z",
|
|
47
|
+
id: "a",
|
|
48
|
+
fill: "#999"
|
|
49
|
+
}
|
|
50
|
+
) }) }),
|
|
51
|
+
"Viewports addon in the toolbar"
|
|
52
|
+
] })
|
|
53
|
+
] })
|
|
54
|
+
] });
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
c as Page
|
|
58
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { K as c, n as o, J as s } from "../index-DQgqDqGf.js";
|
|
2
|
+
import { Page as m } from "./Page.js";
|
|
3
|
+
const i = {
|
|
4
|
+
title: "Example/Page",
|
|
5
|
+
component: m,
|
|
6
|
+
parameters: {
|
|
7
|
+
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
8
|
+
layout: "fullscreen"
|
|
9
|
+
}
|
|
10
|
+
}, l = {}, r = {
|
|
11
|
+
play: async ({ canvasElement: n }) => {
|
|
12
|
+
const e = c(n), t = e.getByRole("button", { name: /Log in/i });
|
|
13
|
+
await o(t).toBeInTheDocument(), await s.click(t), await o(t).not.toBeInTheDocument();
|
|
14
|
+
const a = e.getByRole("button", { name: /Log out/i });
|
|
15
|
+
await o(a).toBeInTheDocument();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
r as LoggedIn,
|
|
20
|
+
l as LoggedOut,
|
|
21
|
+
i as default
|
|
22
|
+
};
|