mimir-ui-kit 1.14.0 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/DatePickerModal-BM0BgzTb.js +204 -0
- package/dist/{NavigationButtons-B8tMfqrg.js → NavigationButtons-DuOoqaPo.js} +20 -20
- package/dist/assets/Accordion.css +1 -0
- package/dist/assets/AccordionItem.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/DatePickerModal.css +1 -0
- package/dist/assets/Drawer.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/ListPhotos.css +1 -0
- package/dist/assets/MergedButton.css +1 -1
- package/dist/assets/OtpInput.css +1 -1
- package/dist/assets/Pagination.css +1 -0
- package/dist/assets/RadioGroup.css +1 -1
- package/dist/assets/SelectSearch.css +1 -0
- package/dist/assets/Slider.css +1 -1
- package/dist/assets/Switch.css +1 -0
- package/dist/assets/TabTrail.css +1 -0
- package/dist/assets/Tag.css +1 -0
- package/dist/assets/Timer.css +1 -0
- package/dist/assets/Uploader.css +1 -0
- package/dist/assets/UploaderPhotos.css +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/bugs-CSBdWk0R.js +18 -0
- package/dist/components/Accordion/Accordion.d.ts +10 -0
- package/dist/components/Accordion/Accordion.js +176 -0
- package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +8 -0
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +16 -0
- package/dist/components/Accordion/AccordionItem/index.d.ts +1 -0
- package/dist/components/Accordion/AccordionItem/index.js +4 -0
- package/dist/components/Accordion/constants.d.ts +8 -0
- package/dist/components/Accordion/constants.js +14 -0
- package/dist/components/Accordion/index.d.ts +3 -0
- package/dist/components/Accordion/index.js +8 -0
- package/dist/components/Button/Button.d.ts +0 -1
- package/dist/components/Button/Button.js +26 -25
- package/dist/components/Button/constants.d.ts +2 -1
- package/dist/components/Button/constants.js +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +44 -0
- package/dist/components/DatePicker/DatePicker.js +69 -0
- package/dist/components/DatePicker/DatePickerModal.d.ts +8 -0
- package/dist/components/DatePicker/DatePickerModal.js +9 -0
- package/dist/components/DatePicker/constants.d.ts +6 -0
- package/dist/components/DatePicker/constants.js +11 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +4 -0
- package/dist/components/Drawer/Drawer.d.ts +38 -0
- package/dist/components/Drawer/Drawer.js +144 -0
- package/dist/components/Drawer/constants.d.ts +5 -0
- package/dist/components/Drawer/constants.js +9 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/index.js +6 -0
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/Input.js +17 -16
- package/dist/components/InputPassword/InputPassword.js +2 -2
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/ListPhotos/ListPhotos.d.ts +23 -0
- package/dist/components/ListPhotos/ListPhotos.js +33 -0
- package/dist/components/ListPhotos/constants.d.ts +3 -0
- package/dist/components/ListPhotos/constants.js +21 -0
- package/dist/components/ListPhotos/index.d.ts +2 -0
- package/dist/components/ListPhotos/index.js +4 -0
- package/dist/components/MergedButton/MergedButton.d.ts +1 -1
- package/dist/components/MergedButton/MergedButton.js +17 -19
- package/dist/components/OtpInput/OtpInput.js +6 -6
- package/dist/components/Pagination/Pagination.d.ts +42 -0
- package/dist/components/Pagination/Pagination.js +220 -0
- package/dist/components/Pagination/constants.d.ts +2 -0
- package/dist/components/Pagination/constants.js +6 -0
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/Pagination/index.js +4 -0
- package/dist/components/Pagination/types.d.ts +0 -0
- package/dist/components/Pagination/types.js +1 -0
- package/dist/components/Portal/Portal.d.ts +7 -0
- package/dist/components/Portal/Portal.js +10 -0
- package/dist/components/Portal/index.d.ts +1 -0
- package/dist/components/Portal/index.js +4 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +18 -2
- package/dist/components/RadioGroup/RadioGroup.js +130 -1061
- package/dist/components/RadioGroup/index.d.ts +1 -1
- package/dist/components/SelectSearch/SelectSearch.d.ts +15 -0
- package/dist/components/SelectSearch/SelectSearch.js +3876 -0
- package/dist/components/SelectSearch/constants.d.ts +4 -0
- package/dist/components/SelectSearch/constants.js +8 -0
- package/dist/components/SelectSearch/index.d.ts +2 -0
- package/dist/components/SelectSearch/index.js +6 -0
- package/dist/components/Slider/NavigationButtons/NavigationButtons.js +1 -1
- package/dist/components/Slider/NavigationButtons/index.js +1 -1
- package/dist/components/Slider/Slider.js +10 -10
- package/dist/components/Switch/Switch.d.ts +294 -0
- package/dist/components/Switch/Switch.js +59 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.js +4 -0
- package/dist/components/TabTrail/TabButtons/TabButtons.d.ts +8 -0
- package/dist/components/TabTrail/TabButtons/TabButtons.js +29 -0
- package/dist/components/TabTrail/TabButtons/constants.d.ts +8 -0
- package/dist/components/TabTrail/TabButtons/constants.js +14 -0
- package/dist/components/TabTrail/TabButtons/index.d.ts +1 -0
- package/dist/components/TabTrail/TabButtons/index.js +4 -0
- package/dist/components/TabTrail/TabTrail.d.ts +11 -0
- package/dist/components/TabTrail/TabTrail.js +282 -0
- package/dist/components/TabTrail/constants.d.ts +4 -0
- package/dist/components/TabTrail/constants.js +8 -0
- package/dist/components/TabTrail/index.d.ts +2 -0
- package/dist/components/TabTrail/index.js +6 -0
- package/dist/components/Tag/Tag.d.ts +20 -57
- package/dist/components/Tag/Tag.js +39 -84
- package/dist/components/Tag/constants.d.ts +5 -37
- package/dist/components/Tag/constants.js +13 -53
- package/dist/components/Tag/index.d.ts +2 -3
- package/dist/components/Tag/index.js +5 -6
- package/dist/components/Tag/types.d.ts +0 -6
- package/dist/components/Timer/Timer.d.ts +24 -0
- package/dist/components/Timer/Timer.js +29 -0
- package/dist/components/Timer/index.d.ts +1 -0
- package/dist/components/Timer/index.js +4 -0
- package/dist/components/Uploader/Uploader.d.ts +30 -0
- package/dist/components/Uploader/Uploader.js +90 -0
- package/dist/components/Uploader/constants.d.ts +5 -0
- package/dist/components/Uploader/constants.js +16 -0
- package/dist/components/Uploader/index.d.ts +2 -0
- package/dist/components/Uploader/index.js +4 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +29 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +46 -0
- package/dist/components/UploaderPhotos/index.d.ts +2 -0
- package/dist/components/UploaderPhotos/index.js +4 -0
- package/dist/components/index.d.ts +16 -1
- package/dist/components/index.js +31 -0
- package/dist/focus-management-1rQPII7Z.js +77 -0
- package/dist/hidden-BuVoeHNy.js +13 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +7 -1
- package/dist/hooks/useClickOutside/index.d.ts +1 -0
- package/dist/hooks/useClickOutside/index.js +4 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +7 -0
- package/dist/hooks/useClickOutside/useClickOutside.js +25 -0
- package/dist/hooks/useInterval/index.d.ts +1 -0
- package/dist/hooks/useInterval/index.js +4 -0
- package/dist/hooks/useInterval/useInterval.d.ts +1 -0
- package/dist/hooks/useInterval/useInterval.js +17 -0
- package/dist/hooks/useLockBodyScroll/index.d.ts +1 -0
- package/dist/hooks/useLockBodyScroll/index.js +4 -0
- package/dist/hooks/useLockBodyScroll/useLockBodyScroll.d.ts +6 -0
- package/dist/hooks/useLockBodyScroll/useLockBodyScroll.js +20 -0
- package/dist/hooks/useTimer/index.d.ts +18 -0
- package/dist/hooks/useTimer/index.js +83 -0
- package/dist/hooks/useTimer/useTimer.d.ts +18 -0
- package/dist/hooks/useTimer/useTimer.js +87 -0
- package/dist/hooks/useTimer/utils.d.ts +24 -0
- package/dist/hooks/useTimer/utils.js +88 -0
- package/dist/hooks/useWindowSize/index.d.ts +4 -0
- package/dist/hooks/useWindowSize/index.js +26 -0
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/12px/Close12px.d.ts +4 -0
- package/dist/icons/components/12px/Close12px.js +18 -0
- package/dist/icons/components/index.d.ts +1 -0
- package/dist/icons/components/index.js +560 -559
- package/dist/{index-_ACzPKPw.js → index-Cxiikb7g.js} +561 -558
- package/dist/index.d.ts +1 -0
- package/dist/index.js +40 -1
- package/dist/keyboard-B256ZoM-.js +745 -0
- package/dist/label-C_5Syaoj.js +159 -0
- package/dist/open-closed-CbXq00et.js +93 -0
- package/dist/use-active-press-B6yeSopF.js +31 -0
- package/dist/use-by-comparator-BUO78DGe.js +16 -0
- package/dist/use-resolve-button-type-B6LE6gU3.js +19 -0
- package/dist/utils/UUID4.d.ts +1 -0
- package/dist/utils/UUID4.js +9 -0
- package/dist/utils/formating/Date.d.ts +1 -0
- package/dist/utils/formating/Date.js +26 -0
- package/dist/utils/formating/Month.d.ts +8 -0
- package/dist/utils/formating/Month.js +80 -0
- package/dist/utils/formating/Numbers.d.ts +6 -0
- package/dist/utils/formating/Numbers.js +8 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.js +13 -0
- package/package.json +1 -1
@@ -0,0 +1,176 @@
|
|
1
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
2
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
|
+
import React__default, { createContext, useRef, Fragment, useReducer, useMemo, useId, useEffect, useContext, forwardRef } from "react";
|
4
|
+
import { AccordionItem } from "./AccordionItem/AccordionItem.js";
|
5
|
+
import { EAccordionSize, EAccordionIconSize } from "./constants.js";
|
6
|
+
import { Icon } from "../../icons/Icon.js";
|
7
|
+
import { M as M$1, W, y, T, o, a as u$1, H as H$1, I, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, b as $6179b936705e76d3$export$ae780daf29e6d456, D, u as u$3, c as o$1 } from "../../keyboard-B256ZoM-.js";
|
8
|
+
import { w } from "../../use-active-press-B6yeSopF.js";
|
9
|
+
import { T as T$1 } from "../../use-resolve-button-type-B6LE6gU3.js";
|
10
|
+
import { c, i, u as u$2, V as V$1, A, s as s$1 } from "../../open-closed-CbXq00et.js";
|
11
|
+
import { r } from "../../bugs-CSBdWk0R.js";
|
12
|
+
import '../../assets/Accordion.css';let e = createContext(() => {
|
13
|
+
});
|
14
|
+
function u({ value: o2, children: t2 }) {
|
15
|
+
return React__default.createElement(e.Provider, { value: o2 }, t2);
|
16
|
+
}
|
17
|
+
var t;
|
18
|
+
let a = (t = React__default.startTransition) != null ? t : function(i2) {
|
19
|
+
i2();
|
20
|
+
};
|
21
|
+
var de = ((r2) => (r2[r2.Open = 0] = "Open", r2[r2.Closed = 1] = "Closed", r2))(de || {}), fe = ((t2) => (t2[t2.ToggleDisclosure = 0] = "ToggleDisclosure", t2[t2.CloseDisclosure = 1] = "CloseDisclosure", t2[t2.SetButtonId = 2] = "SetButtonId", t2[t2.SetPanelId = 3] = "SetPanelId", t2[t2.LinkPanel = 4] = "LinkPanel", t2[t2.UnlinkPanel = 5] = "UnlinkPanel", t2))(fe || {});
|
22
|
+
let Te = { [0]: (e2) => ({ ...e2, disclosureState: u$1(e2.disclosureState, { [0]: 1, [1]: 0 }) }), [1]: (e2) => e2.disclosureState === 1 ? e2 : { ...e2, disclosureState: 1 }, [4](e2) {
|
23
|
+
return e2.linkedPanel === true ? e2 : { ...e2, linkedPanel: true };
|
24
|
+
}, [5](e2) {
|
25
|
+
return e2.linkedPanel === false ? e2 : { ...e2, linkedPanel: false };
|
26
|
+
}, [2](e2, n) {
|
27
|
+
return e2.buttonId === n.buttonId ? e2 : { ...e2, buttonId: n.buttonId };
|
28
|
+
}, [3](e2, n) {
|
29
|
+
return e2.panelId === n.panelId ? e2 : { ...e2, panelId: n.panelId };
|
30
|
+
} }, M = createContext(null);
|
31
|
+
M.displayName = "DisclosureContext";
|
32
|
+
function F(e2) {
|
33
|
+
let n = useContext(M);
|
34
|
+
if (n === null) {
|
35
|
+
let r2 = new Error(`<${e2} /> is missing a parent <Disclosure /> component.`);
|
36
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r2, F), r2;
|
37
|
+
}
|
38
|
+
return n;
|
39
|
+
}
|
40
|
+
let k = createContext(null);
|
41
|
+
k.displayName = "DisclosureAPIContext";
|
42
|
+
function V(e2) {
|
43
|
+
let n = useContext(k);
|
44
|
+
if (n === null) {
|
45
|
+
let r2 = new Error(`<${e2} /> is missing a parent <Disclosure /> component.`);
|
46
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r2, V), r2;
|
47
|
+
}
|
48
|
+
return n;
|
49
|
+
}
|
50
|
+
let H = createContext(null);
|
51
|
+
H.displayName = "DisclosurePanelContext";
|
52
|
+
function De() {
|
53
|
+
return useContext(H);
|
54
|
+
}
|
55
|
+
function Pe(e2, n) {
|
56
|
+
return u$1(n.type, Te, e2, n);
|
57
|
+
}
|
58
|
+
let ye = Fragment;
|
59
|
+
function me(e2, n) {
|
60
|
+
let { defaultOpen: r2 = false, ...c$1 } = e2, s2 = useRef(null), d = y(n, T((u2) => {
|
61
|
+
s2.current = u2;
|
62
|
+
}, e2.as === void 0 || e2.as === Fragment)), t2 = useRef(null), o$12 = useRef(null), l = useReducer(Pe, { disclosureState: r2 ? 0 : 1, linkedPanel: false, buttonRef: o$12, panelRef: t2, buttonId: null, panelId: null }), [{ disclosureState: f, buttonId: i$1 }, T$12] = l, p = o((u2) => {
|
63
|
+
T$12({ type: 1 });
|
64
|
+
let P = u$3(s2);
|
65
|
+
if (!P || !i$1) return;
|
66
|
+
let y2 = (() => u2 ? u2 instanceof HTMLElement ? u2 : u2.current instanceof HTMLElement ? u2.current : P.getElementById(i$1) : P.getElementById(i$1))();
|
67
|
+
y2 == null || y2.focus();
|
68
|
+
}), E = useMemo(() => ({ close: p }), [p]), D2 = useMemo(() => ({ open: f === 0, close: p }), [f, p]), g = { ref: d };
|
69
|
+
return React__default.createElement(M.Provider, { value: l }, React__default.createElement(k.Provider, { value: E }, React__default.createElement(u, { value: p }, React__default.createElement(c, { value: u$1(f, { [0]: i.Open, [1]: i.Closed }) }, H$1({ ourProps: g, theirProps: c$1, slot: D2, defaultTag: ye, name: "Disclosure" })))));
|
70
|
+
}
|
71
|
+
let Ee = "button";
|
72
|
+
function ge(e2, n) {
|
73
|
+
let r$1 = useId(), { id: c2 = `headlessui-disclosure-button-${r$1}`, disabled: s2 = false, autoFocus: d = false, ...t2 } = e2, [o$2, l] = F("Disclosure.Button"), f = De(), i2 = f === null ? false : f === o$2.panelId, T2 = useRef(null), p = y(T2, n, i2 ? null : o$2.buttonRef), E = I();
|
74
|
+
useEffect(() => {
|
75
|
+
if (!i2) return l({ type: 2, buttonId: c2 }), () => {
|
76
|
+
l({ type: 2, buttonId: null });
|
77
|
+
};
|
78
|
+
}, [c2, l, i2]);
|
79
|
+
let D$1 = o((a2) => {
|
80
|
+
var S;
|
81
|
+
if (i2) {
|
82
|
+
if (o$2.disclosureState === 1) return;
|
83
|
+
switch (a2.key) {
|
84
|
+
case o$1.Space:
|
85
|
+
case o$1.Enter:
|
86
|
+
a2.preventDefault(), a2.stopPropagation(), l({ type: 0 }), (S = o$2.buttonRef.current) == null || S.focus();
|
87
|
+
break;
|
88
|
+
}
|
89
|
+
} else switch (a2.key) {
|
90
|
+
case o$1.Space:
|
91
|
+
case o$1.Enter:
|
92
|
+
a2.preventDefault(), a2.stopPropagation(), l({ type: 0 });
|
93
|
+
break;
|
94
|
+
}
|
95
|
+
}), g = o((a2) => {
|
96
|
+
switch (a2.key) {
|
97
|
+
case o$1.Space:
|
98
|
+
a2.preventDefault();
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
}), u2 = o((a2) => {
|
102
|
+
var S;
|
103
|
+
r(a2.currentTarget) || s2 || (i2 ? (l({ type: 0 }), (S = o$2.buttonRef.current) == null || S.focus()) : l({ type: 0 }));
|
104
|
+
}), { isFocusVisible: P, focusProps: y$1 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: d }), { isHovered: U, hoverProps: h } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: s2 }), { pressed: N, pressProps: w$1 } = w({ disabled: s2 }), q = useMemo(() => ({ open: o$2.disclosureState === 0, hover: U, active: N, disabled: s2, focus: P, autofocus: d }), [o$2, U, N, P, s2, d]), G = T$1(e2, T2), z = i2 ? D({ ref: p, type: G, disabled: s2 || void 0, autoFocus: d, onKeyDown: D$1, onClick: u2 }, y$1, h, w$1) : D({ ref: p, id: c2, type: G, "aria-expanded": o$2.disclosureState === 0, "aria-controls": o$2.linkedPanel ? o$2.panelId : void 0, disabled: s2 || void 0, autoFocus: d, onKeyDown: D$1, onKeyUp: g, onClick: u2 }, y$1, h, w$1);
|
105
|
+
return H$1({ mergeRefs: E, ourProps: z, theirProps: t2, slot: q, defaultTag: Ee, name: "Disclosure.Button" });
|
106
|
+
}
|
107
|
+
let Se = "div", be = M$1.RenderStrategy | M$1.Static;
|
108
|
+
function Re(e2, n) {
|
109
|
+
let r2 = useId(), { id: c2 = `headlessui-disclosure-panel-${r2}`, transition: s2 = false, ...d } = e2, [t2, o2] = F("Disclosure.Panel"), { close: l } = V("Disclosure.Panel"), f = I(), i$1 = y(n, t2.panelRef, (u2) => {
|
110
|
+
a(() => o2({ type: u2 ? 4 : 5 }));
|
111
|
+
});
|
112
|
+
useEffect(() => (o2({ type: 3, panelId: c2 }), () => {
|
113
|
+
o2({ type: 3, panelId: null });
|
114
|
+
}), [c2, o2]);
|
115
|
+
let T2 = u$2(), [p, E] = V$1(s2, t2.panelRef, T2 !== null ? (T2 & i.Open) === i.Open : t2.disclosureState === 0), D2 = useMemo(() => ({ open: t2.disclosureState === 0, close: l }), [t2.disclosureState, l]), g = { ref: i$1, id: c2, ...A(E) };
|
116
|
+
return React__default.createElement(s$1, null, React__default.createElement(H.Provider, { value: t2.panelId }, H$1({ mergeRefs: f, ourProps: g, theirProps: d, slot: D2, defaultTag: Se, features: be, visible: p, name: "Disclosure.Panel" })));
|
117
|
+
}
|
118
|
+
let Ae = W(me), Ce = W(ge), Ie = W(Re), We = Object.assign(Ae, { Button: Ce, Panel: Ie });
|
119
|
+
const accordion = "_accordion_18wwx_2";
|
120
|
+
const header = "_header_18wwx_10";
|
121
|
+
const title = "_title_18wwx_23";
|
122
|
+
const icon = "_icon_18wwx_30";
|
123
|
+
const panel = "_panel_18wwx_44";
|
124
|
+
const open = "_open_18wwx_48";
|
125
|
+
const m = "_m_18wwx_55";
|
126
|
+
const s = "_s_18wwx_63";
|
127
|
+
const cls = {
|
128
|
+
accordion,
|
129
|
+
header,
|
130
|
+
title,
|
131
|
+
"title-uppercase": "_title-uppercase_18wwx_26",
|
132
|
+
icon,
|
133
|
+
"icon-container": "_icon-container_18wwx_33",
|
134
|
+
panel,
|
135
|
+
open,
|
136
|
+
m,
|
137
|
+
s
|
138
|
+
};
|
139
|
+
const Accordion = forwardRef(
|
140
|
+
({ title: title2, children, size = EAccordionSize.M, titleUppercase }, ref) => {
|
141
|
+
return /* @__PURE__ */ jsx("div", { className: classNames(cls.accordion, cls[size]), children: /* @__PURE__ */ jsx(We, { ref, children: ({ open: open2 }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
142
|
+
/* @__PURE__ */ jsxs(Ce, { className: cls.header, children: [
|
143
|
+
/* @__PURE__ */ jsx(
|
144
|
+
"span",
|
145
|
+
{
|
146
|
+
className: classNames(
|
147
|
+
cls.title,
|
148
|
+
titleUppercase && cls["title-uppercase"]
|
149
|
+
),
|
150
|
+
children: title2
|
151
|
+
}
|
152
|
+
),
|
153
|
+
/* @__PURE__ */ jsx(
|
154
|
+
"div",
|
155
|
+
{
|
156
|
+
className: classNames(
|
157
|
+
cls["icon-container"],
|
158
|
+
open2 && cls.open
|
159
|
+
),
|
160
|
+
children: /* @__PURE__ */ jsx(
|
161
|
+
Icon,
|
162
|
+
{
|
163
|
+
iconName: size === EAccordionSize.S ? EAccordionIconSize.S : EAccordionIconSize.M,
|
164
|
+
className: cls.icon
|
165
|
+
}
|
166
|
+
)
|
167
|
+
}
|
168
|
+
)
|
169
|
+
] }),
|
170
|
+
/* @__PURE__ */ jsx(Ie, { className: cls.panel, children: /* @__PURE__ */ jsx(AccordionItem, { size, children }) })
|
171
|
+
] }) }) });
|
172
|
+
}
|
173
|
+
);
|
174
|
+
export {
|
175
|
+
Accordion
|
176
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
2
|
+
import { c as classNames } from "../../../index-CweZ_OcN.js";
|
3
|
+
import '../../../assets/AccordionItem.css';const item = "_item_1k68o_2";
|
4
|
+
const m = "_m_1k68o_10";
|
5
|
+
const l = "_l_1k68o_15";
|
6
|
+
const cls = {
|
7
|
+
item,
|
8
|
+
m,
|
9
|
+
l
|
10
|
+
};
|
11
|
+
const AccordionItem = ({ children, size }) => {
|
12
|
+
return /* @__PURE__ */ jsx("div", { className: classNames(cls.item, cls[size]), children });
|
13
|
+
};
|
14
|
+
export {
|
15
|
+
AccordionItem
|
16
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { AccordionItem, type TAccordionItemProps } from './AccordionItem';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
var EAccordionSize = /* @__PURE__ */ ((EAccordionSize2) => {
|
2
|
+
EAccordionSize2["M"] = "m";
|
3
|
+
EAccordionSize2["S"] = "s";
|
4
|
+
return EAccordionSize2;
|
5
|
+
})(EAccordionSize || {});
|
6
|
+
var EAccordionIconSize = /* @__PURE__ */ ((EAccordionIconSize2) => {
|
7
|
+
EAccordionIconSize2["M"] = "ArrowDown24px";
|
8
|
+
EAccordionIconSize2["S"] = "ArrowDown16px";
|
9
|
+
return EAccordionIconSize2;
|
10
|
+
})(EAccordionIconSize || {});
|
11
|
+
export {
|
12
|
+
EAccordionIconSize,
|
13
|
+
EAccordionSize
|
14
|
+
};
|
@@ -26,7 +26,6 @@ export type TProps = TCommonButtonProps & ComponentProps<'button'> & {
|
|
26
26
|
};
|
27
27
|
/**
|
28
28
|
* Компонент кнопки, который можно настраивать с различными темами и размерами.
|
29
|
-
|
30
29
|
*/
|
31
30
|
export declare const Button: import('react').ForwardRefExoticComponent<(Omit<import('./types').TButtonDefaultFormProps & {
|
32
31
|
isIconButton: true;
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
-
import { forwardRef } from "react";
|
3
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
|
+
import { forwardRef } from "react";
|
4
4
|
import { EButtonVariantDefault, EButtonForm } from "./constants.js";
|
5
5
|
import { Icon } from "../../icons/Icon.js";
|
6
|
-
import '../../assets/Button.css';const button = "
|
7
|
-
const clear = "
|
8
|
-
const xs = "
|
9
|
-
const s = "
|
10
|
-
const m = "
|
11
|
-
const l = "
|
12
|
-
const xl = "
|
13
|
-
const xxl = "
|
14
|
-
const black = "
|
15
|
-
const gray = "
|
16
|
-
const white = "
|
17
|
-
const full = "
|
18
|
-
const disabled = "
|
6
|
+
import '../../assets/Button.css';const button = "_button_ycj38_2";
|
7
|
+
const clear = "_clear_ycj38_41";
|
8
|
+
const xs = "_xs_ycj38_53";
|
9
|
+
const s = "_s_ycj38_61";
|
10
|
+
const m = "_m_ycj38_69";
|
11
|
+
const l = "_l_ycj38_77";
|
12
|
+
const xl = "_xl_ycj38_85";
|
13
|
+
const xxl = "_xxl_ycj38_94";
|
14
|
+
const black = "_black_ycj38_176";
|
15
|
+
const gray = "_gray_ycj38_185";
|
16
|
+
const white = "_white_ycj38_194";
|
17
|
+
const full = "_full_ycj38_204";
|
18
|
+
const disabled = "_disabled_ycj38_210";
|
19
19
|
const cls = {
|
20
20
|
button,
|
21
21
|
clear,
|
@@ -25,20 +25,21 @@ const cls = {
|
|
25
25
|
l,
|
26
26
|
xl,
|
27
27
|
xxl,
|
28
|
-
"
|
29
|
-
"
|
30
|
-
"primary-
|
31
|
-
"
|
32
|
-
"secondary-
|
33
|
-
"secondary-
|
34
|
-
"secondary-
|
35
|
-
"
|
28
|
+
"m-s": "_m-s_ycj38_103",
|
29
|
+
"default-button": "_default-button_ycj38_111",
|
30
|
+
"primary-sapphire": "_primary-sapphire_ycj38_114",
|
31
|
+
"primary-citrine": "_primary-citrine_ycj38_123",
|
32
|
+
"secondary-asphalt": "_secondary-asphalt_ycj38_132",
|
33
|
+
"secondary-gray": "_secondary-gray_ycj38_141",
|
34
|
+
"secondary-white": "_secondary-white_ycj38_150",
|
35
|
+
"secondary-red": "_secondary-red_ycj38_159",
|
36
|
+
"round-button": "_round-button_ycj38_169",
|
36
37
|
black,
|
37
38
|
gray,
|
38
39
|
white,
|
39
40
|
full,
|
40
41
|
disabled,
|
41
|
-
"icon-button": "_icon-
|
42
|
+
"icon-button": "_icon-button_ycj38_221"
|
42
43
|
};
|
43
44
|
const Button = forwardRef(
|
44
45
|
(props, ref) => {
|
@@ -68,9 +69,9 @@ const Button = forwardRef(
|
|
68
69
|
};
|
69
70
|
const buttonClassNames = classNames(
|
70
71
|
cls.button,
|
72
|
+
className,
|
71
73
|
mods,
|
72
|
-
clear2 ? [] : [cls[form ?? ""], cls[size]]
|
73
|
-
className
|
74
|
+
clear2 ? [] : [cls[form ?? ""], cls[size]]
|
74
75
|
);
|
75
76
|
return /* @__PURE__ */ jsxs(
|
76
77
|
"button",
|
@@ -20,6 +20,7 @@ var EButtonSize = /* @__PURE__ */ ((EButtonSize2) => {
|
|
20
20
|
EButtonSize2["L"] = "l";
|
21
21
|
EButtonSize2["XL"] = "xl";
|
22
22
|
EButtonSize2["XXL"] = "xxl";
|
23
|
+
EButtonSize2["MS"] = "m-s";
|
23
24
|
return EButtonSize2;
|
24
25
|
})(EButtonSize || {});
|
25
26
|
var EButtonForm = /* @__PURE__ */ ((EButtonForm2) => {
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { TInputProps } from '../Input';
|
2
|
+
|
3
|
+
export type DatePicker = {
|
4
|
+
/**
|
5
|
+
* функция=callback, которая вызывается при изменении значения и передает имя и новое значение для обновления стейта (data),
|
6
|
+
*/
|
7
|
+
onChangeValue?: (e: TDatePickerValue) => void;
|
8
|
+
/**
|
9
|
+
* функция ограничения выбора даты
|
10
|
+
(до какой даты выбор не доступен)
|
11
|
+
*/
|
12
|
+
before?: Date | string;
|
13
|
+
/**
|
14
|
+
* значение из стейта (data)
|
15
|
+
*/
|
16
|
+
value?: string;
|
17
|
+
} & TInputProps;
|
18
|
+
export type TDatePickerValue = {
|
19
|
+
value?: Date;
|
20
|
+
name?: string;
|
21
|
+
};
|
22
|
+
export declare const DatePicker: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<{
|
23
|
+
/**
|
24
|
+
* функция=callback, которая вызывается при изменении значения и передает имя и новое значение для обновления стейта (data),
|
25
|
+
*/
|
26
|
+
onChangeValue?: (e: TDatePickerValue) => void;
|
27
|
+
/**
|
28
|
+
* функция ограничения выбора даты
|
29
|
+
(до какой даты выбор не доступен)
|
30
|
+
*/
|
31
|
+
before?: Date | string;
|
32
|
+
/**
|
33
|
+
* значение из стейта (data)
|
34
|
+
*/
|
35
|
+
value?: string;
|
36
|
+
} & import('../Input/types').TInputProps & {
|
37
|
+
size?: import('../Input').TSize;
|
38
|
+
variant?: import('../Input').TVariant;
|
39
|
+
className?: string;
|
40
|
+
wrapperClassName?: string;
|
41
|
+
label?: import('react').ReactNode;
|
42
|
+
autofocus?: boolean;
|
43
|
+
readonly?: boolean;
|
44
|
+
} & import('react').RefAttributes<HTMLInputElement>>>;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
|
+
import { memo, forwardRef, useState } from "react";
|
4
|
+
import { c as cls, D as DatePickerModal } from "../../DatePickerModal-BM0BgzTb.js";
|
5
|
+
import { useClickOutside } from "../../hooks/useClickOutside/useClickOutside.js";
|
6
|
+
import { formating } from "../../utils/index.js";
|
7
|
+
import { Button } from "../Button/Button.js";
|
8
|
+
import { Input } from "../Input/Input.js";
|
9
|
+
const DatePicker = memo(
|
10
|
+
forwardRef(
|
11
|
+
({ size, value, onChangeValue, name, before, ...props }, ref) => {
|
12
|
+
const [isActive, setActive] = useState(false);
|
13
|
+
const [date, setDate] = useState(
|
14
|
+
value ? new Date(value) : /* @__PURE__ */ new Date()
|
15
|
+
);
|
16
|
+
useClickOutside({
|
17
|
+
isActive,
|
18
|
+
setActive,
|
19
|
+
className: cls["calendar-block"]
|
20
|
+
});
|
21
|
+
const onOpen = () => {
|
22
|
+
setActive(true);
|
23
|
+
};
|
24
|
+
const onDate = (d) => {
|
25
|
+
setDate(d);
|
26
|
+
onChangeValue == null ? void 0 : onChangeValue({ value: d, name });
|
27
|
+
};
|
28
|
+
const wrapperClassNames = classNames(cls.wrapper, isActive && cls.active);
|
29
|
+
return /* @__PURE__ */ jsxs("div", { className: wrapperClassNames, children: [
|
30
|
+
/* @__PURE__ */ jsx("div", { className: cls["date-wrapper"], onClick: onOpen, children: /* @__PURE__ */ jsx(
|
31
|
+
Input,
|
32
|
+
{
|
33
|
+
ref,
|
34
|
+
className: cls.input,
|
35
|
+
wrapperClassName: cls["input-wrapper"],
|
36
|
+
size,
|
37
|
+
type: "text",
|
38
|
+
value: formating.Date(date, "dd.mm.yy"),
|
39
|
+
...props
|
40
|
+
}
|
41
|
+
) }),
|
42
|
+
/* @__PURE__ */ jsx("div", { className: cls["button-wrapper"], children: /* @__PURE__ */ jsx(
|
43
|
+
Button,
|
44
|
+
{
|
45
|
+
isIconButton: true,
|
46
|
+
clear: true,
|
47
|
+
type: "button",
|
48
|
+
className: cls.button,
|
49
|
+
onClick: onOpen,
|
50
|
+
iconName: isActive ? "DropdownArrowUp16px" : "DropdownArrowBottom16px"
|
51
|
+
}
|
52
|
+
) }),
|
53
|
+
isActive && /* @__PURE__ */ jsx(
|
54
|
+
DatePickerModal,
|
55
|
+
{
|
56
|
+
onChangeValue: onDate,
|
57
|
+
date,
|
58
|
+
setActive,
|
59
|
+
before: typeof before === "string" ? new Date(before) : before
|
60
|
+
}
|
61
|
+
)
|
62
|
+
] });
|
63
|
+
}
|
64
|
+
)
|
65
|
+
);
|
66
|
+
DatePicker.displayName = "DatePicker";
|
67
|
+
export {
|
68
|
+
DatePicker
|
69
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
type DatePickerModal = {
|
2
|
+
date: Date;
|
3
|
+
onChangeValue: (d: Date) => void;
|
4
|
+
setActive: (s: boolean) => void;
|
5
|
+
before?: Date;
|
6
|
+
};
|
7
|
+
export declare function DatePickerModal({ date, onChangeValue, setActive, before }: DatePickerModal): import("react/jsx-runtime").JSX.Element;
|
8
|
+
export {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
var EDatePickerBeforeDate = /* @__PURE__ */ ((EDatePickerBeforeDate2) => {
|
2
|
+
EDatePickerBeforeDate2["CurrentDate1"] = "2024-08-01";
|
3
|
+
EDatePickerBeforeDate2["CurrentDate2"] = "2024-07-01";
|
4
|
+
EDatePickerBeforeDate2["CurrentDate3"] = "2024-07-11";
|
5
|
+
return EDatePickerBeforeDate2;
|
6
|
+
})(EDatePickerBeforeDate || {});
|
7
|
+
const week = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"];
|
8
|
+
export {
|
9
|
+
EDatePickerBeforeDate,
|
10
|
+
week
|
11
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
2
|
+
import { EDrawerPosition } from './constants';
|
3
|
+
|
4
|
+
type TProps = {
|
5
|
+
/**
|
6
|
+
* Обязательный заголовок.
|
7
|
+
*/
|
8
|
+
title: string;
|
9
|
+
/**
|
10
|
+
* Флаг отвечачающий за показ/скрытие.
|
11
|
+
*/
|
12
|
+
isOpen?: boolean;
|
13
|
+
/**
|
14
|
+
* Настраиваемый паддинг для body, что бы избежать скачка контента при overflow: hidden
|
15
|
+
*/
|
16
|
+
paddingRight?: number;
|
17
|
+
/**
|
18
|
+
* Функция закрытия шторки
|
19
|
+
*/
|
20
|
+
onClose?: VoidFunction;
|
21
|
+
/**
|
22
|
+
* Дополнительный класс для родительской обертки.
|
23
|
+
*/
|
24
|
+
className?: string;
|
25
|
+
/**
|
26
|
+
* Позиция шторки.
|
27
|
+
*/
|
28
|
+
position?: `${EDrawerPosition}` | EDrawerPosition;
|
29
|
+
/**
|
30
|
+
* Кастомный footer. По дефолту в нем расположена кнопка для закрытия.
|
31
|
+
*/
|
32
|
+
footer?: ReactNode;
|
33
|
+
};
|
34
|
+
/**
|
35
|
+
* Компонент шторки, который может выезжать слева, справа или внизу.
|
36
|
+
*/
|
37
|
+
export declare const Drawer: ({ isOpen, onClose, title, className, position, paddingRight, footer, children }: PropsWithChildren<TProps>) => import("react/jsx-runtime").JSX.Element | null;
|
38
|
+
export {};
|