mimir-ui-kit 1.43.14 → 1.43.17
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/ProgressBar-DA7-pT_u.js +68 -0
- package/dist/assets/Accordion.css +1 -1
- package/dist/assets/ProgressBar.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +3 -1
- package/dist/components/Accordion/Accordion.js +211 -201
- package/dist/components/Accordion/constants.d.ts +4 -0
- package/dist/components/Accordion/constants.js +6 -5
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/Accordion/index.js +12 -6
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.js +1 -1
- package/dist/components/Toasts/ToastList.js +1 -1
- package/dist/components/Toasts/ToastsProvider.js +13 -12
- package/dist/components/Toasts/constants.d.ts +2 -1
- package/dist/components/Toasts/constants.js +3 -3
- package/dist/components/Toasts/hooks.js +4 -2
- package/package.json +1 -1
- package/dist/ProgressBar-COdzy3fY.js +0 -67
@@ -0,0 +1,68 @@
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
2
|
+
import { c as u } from "./index-DIxK0V-G.js";
|
3
|
+
import { memo as x, useRef as e, useEffect as y } from "react";
|
4
|
+
import { DEFAULT_TOAST_DURATION as f, EToastVariant as g } from "./components/Toasts/constants.js";
|
5
|
+
import './assets/ProgressBar.css';const b = "_title_1xi9y_37", d = "_timer_1xi9y_41", A = "_seconds_1xi9y_51", T = "_message_1xi9y_61", h = "_progress_1xi9y_69", w = "_slot_1xi9y_95", D = "_success_1xi9y_104", F = "_alarm_1xi9y_109", R = "_error_1xi9y_114", E = "_purple_1xi9y_119", o = {
|
6
|
+
"toast-list": "_toast-list_1xi9y_2",
|
7
|
+
"toast-wrapper": "_toast-wrapper_1xi9y_24",
|
8
|
+
title: b,
|
9
|
+
timer: d,
|
10
|
+
"timer-title": "_timer-title_1xi9y_49",
|
11
|
+
seconds: A,
|
12
|
+
message: T,
|
13
|
+
progress: h,
|
14
|
+
"progress-bar": "_progress-bar_1xi9y_78",
|
15
|
+
"close-button": "_close-button_1xi9y_89",
|
16
|
+
slot: w,
|
17
|
+
default: "_default_1xi9y_99",
|
18
|
+
success: D,
|
19
|
+
alarm: F,
|
20
|
+
error: R,
|
21
|
+
purple: E,
|
22
|
+
"top-right": "_top-right_1xi9y_124",
|
23
|
+
"top-center": "_top-center_1xi9y_130",
|
24
|
+
"top-left": "_top-left_1xi9y_136",
|
25
|
+
"bottom-left": "_bottom-left_1xi9y_141",
|
26
|
+
"bottom-center": "_bottom-center_1xi9y_146",
|
27
|
+
"bottom-right": "_bottom-right_1xi9y_152",
|
28
|
+
"toast-in": "_toast-in_1xi9y_184",
|
29
|
+
"toast-out": "_toast-out_1xi9y_188"
|
30
|
+
}, L = x(
|
31
|
+
({
|
32
|
+
duration: _ = f,
|
33
|
+
variant: l = g.DEFAULT,
|
34
|
+
isPaused: i = !1
|
35
|
+
}) => {
|
36
|
+
const t = e(), r = e(null), n = e(Date.now()), s = e(0);
|
37
|
+
return y(() => {
|
38
|
+
if (i)
|
39
|
+
t.current && cancelAnimationFrame(t.current);
|
40
|
+
else {
|
41
|
+
n.current = Date.now() - s.current;
|
42
|
+
const c = () => {
|
43
|
+
const p = Date.now();
|
44
|
+
s.current = p - n.current;
|
45
|
+
const a = Math.min(
|
46
|
+
s.current / _ * 100,
|
47
|
+
100
|
48
|
+
);
|
49
|
+
r.current && (r.current.style.width = `${a}%`), a < 100 && (t.current = requestAnimationFrame(c));
|
50
|
+
};
|
51
|
+
t.current = requestAnimationFrame(c);
|
52
|
+
}
|
53
|
+
return () => {
|
54
|
+
t.current && cancelAnimationFrame(t.current);
|
55
|
+
};
|
56
|
+
}, [_, i]), /* @__PURE__ */ m("div", { className: o.progress, "data-testid": "progress-bar", children: /* @__PURE__ */ m(
|
57
|
+
"div",
|
58
|
+
{
|
59
|
+
ref: r,
|
60
|
+
className: u(o["progress-bar"], o[l])
|
61
|
+
}
|
62
|
+
) });
|
63
|
+
}
|
64
|
+
);
|
65
|
+
export {
|
66
|
+
L as P,
|
67
|
+
o as c
|
68
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
._icon_1x2lg_2{transition:transform .3s ease-in-out}._icon_1x2lg_2 path{fill:var(--white)}._icon-container_1x2lg_8{display:flex;align-items:center;justify-content:center;transition:background-color .3s ease-in-out}._open_1x2lg_15 ._icon_1x2lg_2{transform:rotate(-180deg)}._square_1x2lg_19 ._icon_1x2lg_2 path{fill:var(--black-100)}._circle_1x2lg_23._disabled_1x2lg_23 ._icon_1x2lg_2 path,._square_1x2lg_19._disabled_1x2lg_23 ._icon_1x2lg_2 path{fill:var(--white)}._open_1x2lg_15._square_1x2lg_19 ._icon_1x2lg_2 path{fill:var(--white)}._open_1x2lg_15._circle_1x2lg_23._disabled_1x2lg_23 ._icon_1x2lg_2 path,._open_1x2lg_15._square_1x2lg_19._disabled_1x2lg_23 ._icon_1x2lg_2 path{fill:var(--white)}._accordion_1x2lg_37{padding-bottom:var(--accordion-space);border-bottom:1px solid var(--black-20)}._accordion_1x2lg_37._is-link_1x2lg_41{border:none}._accordion_1x2lg_37._content-top_1x2lg_44{display:flex;flex-direction:column}._button_1x2lg_49._content-top_1x2lg_44{align-self:flex-end}._header_1x2lg_53{display:flex;gap:var(--mimir-space-m);align-items:flex-start;justify-content:space-between;width:100%;font-weight:var(--mimir-font-weight-text-medium);font-family:var(--mimir-font-montserrat);text-align:left;border:none;cursor:pointer}._header_1x2lg_53._disabled_1x2lg_23{cursor:not-allowed}._title_1x2lg_69{font-size:var(--accordion-text-size)}._title-uppercase_1x2lg_72{text-transform:uppercase}._circle_1x2lg_23{min-width:var(--accordion-icon-circle-width);min-height:var(--accordion-icon-circle-height);background-color:var(--black-80);border-radius:50%}._square_1x2lg_19{min-width:var(--mimir-accordion-icon-square-width);min-height:var(--mimir-accordion-icon-square-height);background-color:var(--white);border-radius:var(--mimir-control-radius)}._circle_1x2lg_23._disabled_1x2lg_23,._square_1x2lg_19._disabled_1x2lg_23{background-color:var(--disabled);cursor:not-allowed}._panel_1x2lg_96{margin-top:var(--accordion-panel-space)}._panel_1x2lg_96._is-link_1x2lg_41{margin-top:var(--mimir-space-xs)}._panel_1x2lg_96._content-top_1x2lg_44{margin-top:0;margin-bottom:var(--accordion-panel-space)}._panel_1x2lg_96._content-top_1x2lg_44._is-link_1x2lg_41{margin-bottom:var(--mimir-space-xs)}._panel_1x2lg_96._content-bottom_1x2lg_109{margin-top:var(--accordion-panel-space)}._panel_1x2lg_96._content-bottom_1x2lg_109._is-link_1x2lg_41{margin-top:var(--mimir-space-xs)}._open_1x2lg_15,._open_1x2lg_15._circle_1x2lg_23{background-color:var(--sapphire-100)}._open_1x2lg_15._square_1x2lg_19{background-color:var(--black-80)}._open_1x2lg_15._circle_1x2lg_23._disabled_1x2lg_23,._open_1x2lg_15._square_1x2lg_19._disabled_1x2lg_23{background-color:var(--disabled)}._link-open_1x2lg_129{transform:rotate(-180deg)}._m_1x2lg_133{--accordion-space: var(--mimir-space-xl);--accordion-text-size: var(--mimir-size-text-xl2);--accordion-icon-circle-width: var(--mimir-accordion-icon-circle-size-m);--accordion-icon-circle-height: var(--mimir-accordion-icon-circle-size-m);--mimir-accordion-icon-square-width: var( --mimir-accordion-icon-square-size-m );--mimir-accordion-icon-square-height: var( --mimir-accordion-icon-square-size-m );--accordion-panel-space: var(--mimir-space-xl)}._s_1x2lg_19{--accordion-space: var(--mimir-space-m);--accordion-text-size: var(--mimir-size-text-l);--accordion-icon-circle-width: var(--mimir-accordion-icon-circle-size-s);--accordion-icon-circle-height: var(--mimir-accordion-icon-circle-size-s);--mimir-accordion-icon-square-width: var( --mimir-accordion-icon-square-size-s );--mimir-accordion-icon-square-height: var( --mimir-accordion-icon-square-size-s );--accordion-panel-space: var(--mimir-space-m)}._wrapper-button_1x2lg_161{width:100%}
|
@@ -1 +1 @@
|
|
1
|
-
._toast-
|
1
|
+
._toast-list_1xi9y_2{position:fixed;z-index:15000;width:100vw;max-width:515px;max-height:100vh;padding:var(--mimir-space-m);overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._toast-list_1xi9y_2::-webkit-scrollbar{display:none}._toast-list_1xi9y_2::-webkit-scrollbar-track{background-color:transparent}._toast-list_1xi9y_2::-webkit-scrollbar-thumb{background-color:transparent}._toast-list_1xi9y_2::-webkit-scrollbar-thumb:window-inactive{background-color:transparent}._toast-wrapper_1xi9y_24{position:relative;display:flex;flex-direction:column;padding:var(--mimir-space-m);background-color:var(--toast-bg-color);border-radius:var(--mimir-control-radius);transition:all .3s ease}._toast-wrapper_1xi9y_24:not(:last-child){margin-bottom:var(--mimir-space-s)}._title_1xi9y_37:not(:last-child){margin-bottom:var(--mimir-space-xs)}._timer_1xi9y_41{display:flex;justify-content:space-between}._timer_1xi9y_41:not(:last-child){margin-bottom:var(--mimir-space-2xs)}._timer-title_1xi9y_49,._title_1xi9y_37,._seconds_1xi9y_51{color:var(--black-60);font-size:var(--mimir-size-text-m);line-height:var(--mimir-line-height-text-xxs)}._seconds_1xi9y_51{color:var(--black-100)}._message_1xi9y_61{font-size:var(--mimir-size-text-l);line-height:var(--mimir-line-height-text-s1)}._message_1xi9y_61:not(:last-child){margin-bottom:var(--mimir-space-xs)}._progress_1xi9y_69{position:relative;width:100%;height:8px;overflow:hidden;background-color:var(--black-5);border-radius:var(--mimir-control-radius-xs)}._progress-bar_1xi9y_78{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;background-color:var(--progress-bg-color);border-radius:var(--mimir-control-radius-xs)}._close-button_1xi9y_89{position:absolute;top:var(--mimir-space-s);right:var(--mimir-space-s)}._slot_1xi9y_95{margin-top:var(--mimir-space-xl)}._default_1xi9y_99{--toast-bg-color: var(--white);--progress-bg-color: var(--sapphire-100)}._success_1xi9y_104{--toast-bg-color: var(--success-bg-active);--progress-bg-color: var(--success-normal)}._alarm_1xi9y_109{--toast-bg-color: var(--alarm-bg-active);--progress-bg-color: var(--alarm-normal)}._error_1xi9y_114{--toast-bg-color: var(--error-bg-active);--progress-bg-color: var(--error-normal)}._purple_1xi9y_119{--toast-bg-color: var(--purple-bg-active);--progress-bg-color: var(--purple-normal)}._top-right_1xi9y_124{top:0;right:0;transition:all .3s ease}._top-center_1xi9y_130{top:0;right:50%;transform:translate(50%)}._top-left_1xi9y_136{top:0;left:0}._bottom-left_1xi9y_141{bottom:0;left:0}._bottom-center_1xi9y_146{right:50%;bottom:0;transform:translate(50%)}._bottom-right_1xi9y_152{right:0;bottom:0}@keyframes _toast-in_1xi9y_184{0%{transform:var(--elm-translate);opacity:.7}80%{transform:translate(0);opacity:.7}to{transform:scale(1);opacity:1}}@keyframes _toast-out_1xi9y_188{0%{opacity:1}20%{transform:translate(0);opacity:.7}to{transform:var(--elm-translate);opacity:.7}}._toast-in_1xi9y_184{animation:_toast-in_1xi9y_184 .3s both}._toast-out_1xi9y_188{animation:_toast-out_1xi9y_188 .8s both}
|
package/dist/assets/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@font-face{font-weight:400;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Regular.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Regular.woff) format("woff")}@font-face{font-weight:700;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Bold.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Bold.woff) format("woff")}@font-face{font-weight:300;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Light.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Light.woff) format("woff")}@font-face{font-weight:500;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Medium.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Medium.woff) format("woff")}@font-face{font-weight:600;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-SemiBold.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-SemiBold.woff) format("woff")}@font-face{font-weight:400;font-family:Inter;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/inter/Inter-Regular.woff2) format("woff2");font-variant-numeric:slashed-zero}@font-face{font-weight:700;font-family:Inter;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/inter/Inter-Bold.woff2) format("woff2");font-variant-numeric:slashed-zero}@font-face{font-weight:500;font-family:Inter;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/inter/Inter-Medium.woff2) format("woff2");font-variant-numeric:slashed-zero}@font-face{font-weight:600;font-family:Inter;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/inter/Inter-SemiBold.woff2) format("woff2");font-variant-numeric:slashed-zero}@supports (font-variation-settings: normal){:root{font-family:InterVariable,sans-serif}}:root{font-feature-settings:"zero"}*{margin:0;padding:0;border:0;outline:none}*,:after,:before{box-sizing:border-box}:active,:focus{outline:0}a,a:visited,a:hover{-webkit-text-decoration:none;text-decoration:none}a:active,a:focus{outline:0}button,input,textarea,select{font-family:inherit}input::-ms-clear{display:none}button{background-color:transparent;cursor:pointer}button::-moz-focus-inner{padding:0;border:0}ul li{list-style:none}img{vertical-align:top}h1,h2,h3,h4,h5,h6{font-weight:inherit;font-size:inherit}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-background-clip:text;background-clip:text;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}:root{--sapphire-100: #2355d7;--sapphire-90: #3564df;--sapphire-80: #4b75e2;--sapphire-70: #6186e6;--sapphire-60: #7797e9;--sapphire-50: #8da7ed;--sapphire-40: #9fb7f4;--sapphire-30: #b9caf4;--sapphire-20: #cfdaf7;--sapphire-10: #e5ebfb;--citrine-100: #ff7900;--citrine-90: #ff861a;--citrine-80: #ff9433;--citrine-70: #ffa14d;--citrine-60: #ffaf66;--citrine-50: #ffbc80;--citrine-40: #ffc999;--citrine-30: #ffd7b2;--citrine-20: #ffe4cc;--citrine-10: #fff2e5;--magenta-100: #bc2251;--magenta-90: #d8275d;--magenta-80: #dc3d6d;--magenta-70: #e15781;--magenta-60: #e46c91;--magenta-50: #e986a4;--magenta-40: #ed9cb4;--magenta-30: #f2b6c8;--magenta-20: #f6cbd8;--magenta-10: #fae5ec;--black-100: #000;--black-95: #0d0d0d;--black-90: #1a1a1a;--black-85: #262626;--black-80: #333;--black-75: #404040;--black-70: #4d4d4d;--black-65: #595959;--black-60: #666;--black-55: #737373;--black-50: #808080;--black-45: #8c8c8c;--black-40: #999;--black-35: #a6a6a6;--black-30: #b3b3b3;--black-25: #bfbfbf;--black-20: #ccc;--black-15: #d9d9d9;--black-10: #e6e6e6;--black-5: #f2f2f2;--white: #fff;--dark-blue: #0a38af;--blue-40: #a7bbef;--blue-20: #d3ddf7;--green: #1b770c;--red-tag: #f01406;--success-normal: #23b413;--success-bg-hover: #d5fbe2;--success-bg-active: #ebfdf1;--alarm-normal: #fdc023;--alarm-bg-hover: #fff0c7;--alarm-bg-active: #fff6de;--error-normal: #e64646;--error-bg-hover: #fadbdb;--error-bg-active: #fbe3e3;--disabled: #b3b3b3;--disabled-color: #b2b2b2;--light-text: var(--white);--dark-text: var(--black-100);--sapphire-normal: var(--sapphire-100);--sapphire-hover: #1b41a3;--sapphire-active: #122c70;--citrine-normal: var(--citrine-100);--citrine-hover: #e56d00;--citrine-active: #cc6100;--asphalt-border: var(--black-30);--asphalt-normal: var(--black-80);--asphalt-hover: var(--black-90);--asphalt-active: var(--black-100);--gray-normal: var(--black-5);--gray-hover: var(--black-10);--gray-active: var(--black-80);--white-normal: var(--white);--white-hover: var(--black-5);--white-transparent: rgba(255, 255, 255, .4);--white-active: var(--black-80);--red-normal: var(--error-normal);--red-hover: #e33030;--red-active: #dc1e1e;--green-normal: var(--green);--green-hover: #16610a;--green-active: #114a08;--counter-text: #ffa066;--gos-znak-traffic-background-color: #fede0c;--gos-znak-military-background-color: var(--black-80);--gos-znak-police-background-color: #4478ff;--gos-znak-diplomatic-background-color: #e64646;--gos-znak-diplomatic-country-color: #f5b7b7;--button-height-ms: 16px;--button-height-xs: 24px;--button-height-s: 32px;--button-height-m: 40px;--button-height-l: 48px;--button-height-xl: 56px;--button-height-xxl: 64px;--mimir-select-search-height-s: 40px;--mimir-select-search-height-l: 48px;--mimir-select-search-height-xxl: 64px;--mimir-select-search-options-height-desktop: 320px;--mimir-select-search-options-height-mobile: 264px;--mimir-control-default: var(--sapphire-20);--mimir-control-hover: var(--sapphire-40);--mimir-control-selected: var(--sapphire-100);--mimir-control-disabled: var(--black-10);--mimir-font-inter: "Inter", sans-serif;--mimir-font-montserrat: "Montserrat", sans-serif;--mimir-font-weight-text-regular: 400;--mimir-font-weight-text-medium: 500;--mimir-font-weight-text-semibold: 600;--mimir-font-weight-text-bold: 700;--mimir-font-weight-text-extrabold: 800;--mimir-font-weight-text-black: 900;--mimir-size-text-xs2: 8px;--mimir-size-text-xs: 10px;--mimir-size-text-s: 12px;--mimir-size-text-m: 14px;--mimir-size-text-l: 16px;--mimir-size-text-l2: 18px;--mimir-size-text-xl: 20px;--mimir-size-text-xl2: 24px;--mimir-size-text-3xl: 26px;--mimir-size-text-2xl: 28px;--mimir-size-text-xl3: 32px;--mimir-size-text-xl4: 48px;--mimir-size-text-4xl: 52px;--mimir-size-text-5xl: 56px;--mimir-size-text-xl5: 72px;--mimir-size-text-xl6: 96px;--mimir-line-height-text-2xs: 1em;--mimir-line-height-text-xxs: 1.125em;--mimir-line-height-text-xs: 1.1em;--mimir-line-height-text-xss: 1.12em;--mimir-line-height-text-xss1: 1.17em;--mimir-line-height-text-s: 1.2em;--mimir-line-height-text-s1: 1.25em;--mimir-line-height-text-m: 1.3em;--mimir-line-height-text-m1: 1.35em;--mimir-line-height-text-l: 1.4em;--mimir-line-height-text-l1: 1.45em;--mimir-line-height-text-xl: 1.5em;--mimir-line-height-text-xl1: 1.5em;--mimir-control-radius-xs2: 2px;--mimir-control-radius-xs: 4px;--mimir-control-radius-xs1: 5px;--mimir-control-radius: 6px;--mimir-control-radius-s: 8px;--mimir-control-radius-m-s: 16px;--mimir-control-radius-m: 20px;--mimir-control-radius-l: 24px;--mimir-control-radius-xl: 32px;--mimir-control-radius-xxl: 40px;--mimir-control-input-radius: 12px;--mimir-control-border-width: 1px;--mimir-control-space-xs: var(--mimir-space-s);--mimir-control-space-l: var(--mimir-space-xl);--mimir-control-space-xxl: var(--mimir-space-xl);--mimir-control-text-size-2xl: var(--mimir-size-text-xl);--mimir-control-text-size-xl: var(--mimir-size-text-xl3);--mimir-control-text-size-l: var(--mimir-size-text-l);--mimir-control-text-size-m: var(--mimir-size-text-m);--mimir-control-text-size-s: var(--mimir-size-text-s);--mimir-control-text-size-xs: var(--mimir-size-text-xs);--mimir-space-3xs: 2px;--mimir-space-2xs: 4px;--mimir-space-1xs: 6px;--mimir-space-xs: 8px;--mimir-space-xss: 10px;--mimir-space-s: 12px;--mimir-space-2s: 14px;--mimir-space-m: 16px;--mimir-space-2m: 18px;--mimir-space-l: 20px;--mimir-space-2l: 22px;--mimir-space-xl: 24px;--mimir-space-1xl: 28px;--mimir-space-2xl: 32px;--mimir-space-2xxl: 36px;--mimir-space-xxl: 40px;--mimir-space-3xl: 44px;--mimir-space-4xl: 48px;--mimir-space-5xl: 56px;--mimir-space-4xxl: 64px;--mimir-space-5xxl: 72px;--mimir-space-6xl: 96px;--mimir-box-shadow-active: 0 0 2px var(--sapphire-normal);--mimir-box-shadow-focus: 0px 0px 10px 2px #1389cc;--mimir-box-shadow-default: 0 0 4px 0 #1389cc;--mimir-box-shadow-select-search: 0 3px 15px 0 rgba(31, 32, 35, .15);--mimir-select-search-input-top-l: -15%;--mimir-select-search-input-top-xxl: -35%;--mimir-container-width-xs: 375px;--mimir-container-width-s: 767px;--mimir-container-width-m: 960px;--mimir-container-width-l: 1280px;--mimir-container-width-xl: 1440px;--mimir-container-width-xxl: 1920px;--mimir-zindex-dropdown: 1000;--mimir-zindex-sticky: 1020;--mimir-zindex-fixed: 1030;--mimir-zindex-modal-backdrop: 1040;--mimir-zindex-modal: 1050;--mimir-zindex-popover: 1060;--mimir-zindex-tooltip: 1070;--sidebar-width-collapsed: 64px;--sidebar-width-expanded: 256px;--sidebar-form-width-tablet: 369px;--sidebar-form-width-mobile: 309px;--header-height: 64px;--mimir-tab-trail-height-m: 58px;--mimir-tab-trail-height-s: 36px;--mimir-accordion-icon-circle-size-m: 48px;--mimir-accordion-icon-circle-size-s: 36px;--mimir-accordion-icon-square-size-m: 40px;--mimir-accordion-icon-square-size-s: 32px}@supports (font-variation-settings: normal){:root{font-family:Inter,sans-serif}}:root{font-feature-settings:"zero";font-variant-numeric:slashed-zero}body{font-family:Inter,sans-serif;font-feature-settings:"zero";font-variant-numeric:slashed-zero;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
1
|
+
@font-face{font-weight:400;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Regular.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Regular.woff) format("woff")}@font-face{font-weight:700;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Bold.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Bold.woff) format("woff")}@font-face{font-weight:300;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Light.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Light.woff) format("woff")}@font-face{font-weight:500;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Medium.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-Medium.woff) format("woff")}@font-face{font-weight:600;font-family:Montserrat;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-SemiBold.woff2) format("woff2"),url(https://cdn.autogpbl.ru/fonts/montserrat/Montserrat-SemiBold.woff) format("woff")}@font-face{font-weight:400;font-family:Inter;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/inter/Inter-Regular.woff2) format("woff2");font-variant-numeric:slashed-zero}@font-face{font-weight:700;font-family:Inter;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/inter/Inter-Bold.woff2) format("woff2");font-variant-numeric:slashed-zero}@font-face{font-weight:500;font-family:Inter;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/inter/Inter-Medium.woff2) format("woff2");font-variant-numeric:slashed-zero}@font-face{font-weight:600;font-family:Inter;font-style:normal;src:url(https://cdn.autogpbl.ru/fonts/inter/Inter-SemiBold.woff2) format("woff2");font-variant-numeric:slashed-zero}@supports (font-variation-settings: normal){:root{font-family:InterVariable,sans-serif}}:root{font-feature-settings:"zero"}*{margin:0;padding:0;border:0;outline:none}*,:after,:before{box-sizing:border-box}:active,:focus{outline:0}a,a:visited,a:hover{-webkit-text-decoration:none;text-decoration:none}a:active,a:focus{outline:0}button,input,textarea,select{font-family:inherit}input::-ms-clear{display:none}button{background-color:transparent;cursor:pointer}button::-moz-focus-inner{padding:0;border:0}ul li{list-style:none}img{vertical-align:top}h1,h2,h3,h4,h5,h6{font-weight:inherit;font-size:inherit}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-background-clip:text;background-clip:text;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}:root{--sapphire-100: #2355d7;--sapphire-90: #3564df;--sapphire-80: #4b75e2;--sapphire-70: #6186e6;--sapphire-60: #7797e9;--sapphire-50: #8da7ed;--sapphire-40: #9fb7f4;--sapphire-30: #b9caf4;--sapphire-20: #cfdaf7;--sapphire-10: #e5ebfb;--citrine-100: #ff7900;--citrine-90: #ff861a;--citrine-80: #ff9433;--citrine-70: #ffa14d;--citrine-60: #ffaf66;--citrine-50: #ffbc80;--citrine-40: #ffc999;--citrine-30: #ffd7b2;--citrine-20: #ffe4cc;--citrine-10: #fff2e5;--magenta-100: #bc2251;--magenta-90: #d8275d;--magenta-80: #dc3d6d;--magenta-70: #e15781;--magenta-60: #e46c91;--magenta-50: #e986a4;--magenta-40: #ed9cb4;--magenta-30: #f2b6c8;--magenta-20: #f6cbd8;--magenta-10: #fae5ec;--purple-normal: #8a2be2;--purple-bg-active: #fae1fa;--black-100: #000;--black-95: #0d0d0d;--black-90: #1a1a1a;--black-85: #262626;--black-80: #333;--black-75: #404040;--black-70: #4d4d4d;--black-65: #595959;--black-60: #666;--black-55: #737373;--black-50: #808080;--black-45: #8c8c8c;--black-40: #999;--black-35: #a6a6a6;--black-30: #b3b3b3;--black-25: #bfbfbf;--black-20: #ccc;--black-15: #d9d9d9;--black-10: #e6e6e6;--black-5: #f2f2f2;--white: #fff;--dark-blue: #0a38af;--blue-40: #a7bbef;--blue-20: #d3ddf7;--green: #1b770c;--red-tag: #f01406;--success-normal: #23b413;--success-bg-hover: #d5fbe2;--success-bg-active: #ebfdf1;--alarm-normal: #fdc023;--alarm-bg-hover: #fff0c7;--alarm-bg-active: #fff6de;--error-normal: #e64646;--error-bg-hover: #fadbdb;--error-bg-active: #fbe3e3;--disabled: #b3b3b3;--disabled-color: #b2b2b2;--light-text: var(--white);--dark-text: var(--black-100);--sapphire-normal: var(--sapphire-100);--sapphire-hover: #1b41a3;--sapphire-active: #122c70;--citrine-normal: var(--citrine-100);--citrine-hover: #e56d00;--citrine-active: #cc6100;--asphalt-border: var(--black-30);--asphalt-normal: var(--black-80);--asphalt-hover: var(--black-90);--asphalt-active: var(--black-100);--gray-normal: var(--black-5);--gray-hover: var(--black-10);--gray-active: var(--black-80);--white-normal: var(--white);--white-hover: var(--black-5);--white-transparent: rgba(255, 255, 255, .4);--white-active: var(--black-80);--red-normal: var(--error-normal);--red-hover: #e33030;--red-active: #dc1e1e;--green-normal: var(--green);--green-hover: #16610a;--green-active: #114a08;--counter-text: #ffa066;--gos-znak-traffic-background-color: #fede0c;--gos-znak-military-background-color: var(--black-80);--gos-znak-police-background-color: #4478ff;--gos-znak-diplomatic-background-color: #e64646;--gos-znak-diplomatic-country-color: #f5b7b7;--button-height-ms: 16px;--button-height-xs: 24px;--button-height-s: 32px;--button-height-m: 40px;--button-height-l: 48px;--button-height-xl: 56px;--button-height-xxl: 64px;--mimir-select-search-height-s: 40px;--mimir-select-search-height-l: 48px;--mimir-select-search-height-xxl: 64px;--mimir-select-search-options-height-desktop: 320px;--mimir-select-search-options-height-mobile: 264px;--mimir-control-default: var(--sapphire-20);--mimir-control-hover: var(--sapphire-40);--mimir-control-selected: var(--sapphire-100);--mimir-control-disabled: var(--black-10);--mimir-font-inter: "Inter", sans-serif;--mimir-font-montserrat: "Montserrat", sans-serif;--mimir-font-weight-text-regular: 400;--mimir-font-weight-text-medium: 500;--mimir-font-weight-text-semibold: 600;--mimir-font-weight-text-bold: 700;--mimir-font-weight-text-extrabold: 800;--mimir-font-weight-text-black: 900;--mimir-size-text-xs2: 8px;--mimir-size-text-xs: 10px;--mimir-size-text-s: 12px;--mimir-size-text-m: 14px;--mimir-size-text-l: 16px;--mimir-size-text-l2: 18px;--mimir-size-text-xl: 20px;--mimir-size-text-xl2: 24px;--mimir-size-text-3xl: 26px;--mimir-size-text-2xl: 28px;--mimir-size-text-xl3: 32px;--mimir-size-text-xl4: 48px;--mimir-size-text-4xl: 52px;--mimir-size-text-5xl: 56px;--mimir-size-text-xl5: 72px;--mimir-size-text-xl6: 96px;--mimir-line-height-text-2xs: 1em;--mimir-line-height-text-xxs: 1.125em;--mimir-line-height-text-xs: 1.1em;--mimir-line-height-text-xss: 1.12em;--mimir-line-height-text-xss1: 1.17em;--mimir-line-height-text-s: 1.2em;--mimir-line-height-text-s1: 1.25em;--mimir-line-height-text-m: 1.3em;--mimir-line-height-text-m1: 1.35em;--mimir-line-height-text-l: 1.4em;--mimir-line-height-text-l1: 1.45em;--mimir-line-height-text-xl: 1.5em;--mimir-line-height-text-xl1: 1.5em;--mimir-control-radius-xs2: 2px;--mimir-control-radius-xs: 4px;--mimir-control-radius-xs1: 5px;--mimir-control-radius: 6px;--mimir-control-radius-s: 8px;--mimir-control-radius-m-s: 16px;--mimir-control-radius-m: 20px;--mimir-control-radius-l: 24px;--mimir-control-radius-xl: 32px;--mimir-control-radius-xxl: 40px;--mimir-control-input-radius: 12px;--mimir-control-border-width: 1px;--mimir-control-space-xs: var(--mimir-space-s);--mimir-control-space-l: var(--mimir-space-xl);--mimir-control-space-xxl: var(--mimir-space-xl);--mimir-control-text-size-2xl: var(--mimir-size-text-xl);--mimir-control-text-size-xl: var(--mimir-size-text-xl3);--mimir-control-text-size-l: var(--mimir-size-text-l);--mimir-control-text-size-m: var(--mimir-size-text-m);--mimir-control-text-size-s: var(--mimir-size-text-s);--mimir-control-text-size-xs: var(--mimir-size-text-xs);--mimir-space-3xs: 2px;--mimir-space-2xs: 4px;--mimir-space-1xs: 6px;--mimir-space-xs: 8px;--mimir-space-xss: 10px;--mimir-space-s: 12px;--mimir-space-2s: 14px;--mimir-space-m: 16px;--mimir-space-2m: 18px;--mimir-space-l: 20px;--mimir-space-2l: 22px;--mimir-space-xl: 24px;--mimir-space-1xl: 28px;--mimir-space-2xl: 32px;--mimir-space-2xxl: 36px;--mimir-space-xxl: 40px;--mimir-space-3xl: 44px;--mimir-space-4xl: 48px;--mimir-space-5xl: 56px;--mimir-space-4xxl: 64px;--mimir-space-5xxl: 72px;--mimir-space-6xl: 96px;--mimir-box-shadow-active: 0 0 2px var(--sapphire-normal);--mimir-box-shadow-focus: 0px 0px 10px 2px #1389cc;--mimir-box-shadow-default: 0 0 4px 0 #1389cc;--mimir-box-shadow-select-search: 0 3px 15px 0 rgba(31, 32, 35, .15);--mimir-select-search-input-top-l: -15%;--mimir-select-search-input-top-xxl: -35%;--mimir-container-width-xs: 375px;--mimir-container-width-s: 767px;--mimir-container-width-m: 960px;--mimir-container-width-l: 1280px;--mimir-container-width-xl: 1440px;--mimir-container-width-xxl: 1920px;--mimir-zindex-dropdown: 1000;--mimir-zindex-sticky: 1020;--mimir-zindex-fixed: 1030;--mimir-zindex-modal-backdrop: 1040;--mimir-zindex-modal: 1050;--mimir-zindex-popover: 1060;--mimir-zindex-tooltip: 1070;--sidebar-width-collapsed: 64px;--sidebar-width-expanded: 256px;--sidebar-form-width-tablet: 369px;--sidebar-form-width-mobile: 309px;--header-height: 64px;--mimir-tab-trail-height-m: 58px;--mimir-tab-trail-height-s: 36px;--mimir-accordion-icon-circle-size-m: 48px;--mimir-accordion-icon-circle-size-s: 36px;--mimir-accordion-icon-square-size-m: 40px;--mimir-accordion-icon-square-size-s: 32px}@supports (font-variation-settings: normal){:root{font-family:Inter,sans-serif}}:root{font-feature-settings:"zero";font-variant-numeric:slashed-zero}body{font-family:Inter,sans-serif;font-feature-settings:"zero";font-variant-numeric:slashed-zero;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
-
import { EAccordionButtonStyle, EAccordionButtonType, EAccordionIconType, EAccordionSize } from './constants';
|
2
|
+
import { EAccordionButtonStyle, EAccordionButtonType, EAccordionContentPosition, EAccordionIconType, EAccordionSize } from './constants';
|
3
3
|
|
4
4
|
type TChildrenProps = {
|
5
5
|
open?: boolean;
|
@@ -46,6 +46,8 @@ export type TProps = {
|
|
46
46
|
defaultActiveKey?: boolean;
|
47
47
|
/** Обработчик изменения состояния открытия */
|
48
48
|
onChange?: (isOpen: boolean) => void;
|
49
|
+
/** Позиция контента аккордеона */
|
50
|
+
contentPosition?: EAccordionContentPosition | `${EAccordionContentPosition}`;
|
49
51
|
};
|
50
52
|
export declare const Accordion: import('react').ForwardRefExoticComponent<TProps & import('react').RefAttributes<HTMLElement>>;
|
51
53
|
export {};
|
@@ -1,24 +1,24 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import
|
4
|
-
import { AccordionItem as
|
5
|
-
import { EAccordionButtonType as
|
6
|
-
import { useMediaQuery as
|
7
|
-
import { EMediaQuery as
|
8
|
-
import { Icon as
|
9
|
-
import { Link as
|
10
|
-
import { M as
|
11
|
-
import { w as
|
12
|
-
import { e as
|
13
|
-
import { c as
|
14
|
-
import { C as
|
15
|
-
import { r as
|
16
|
-
import '../../assets/Accordion.css';var
|
17
|
-
let
|
1
|
+
import { jsxs as R, Fragment as j, jsx as x } from "react/jsx-runtime";
|
2
|
+
import { c as O } from "../../index-DIxK0V-G.js";
|
3
|
+
import P, { createContext as W, useRef as ie, Fragment as ue, useReducer as xe, useMemo as F, useId as de, useEffect as Q, useState as pe, useContext as V, forwardRef as Te } from "react";
|
4
|
+
import { AccordionItem as De } from "./AccordionItem/AccordionItem.js";
|
5
|
+
import { EAccordionButtonType as N, EAccordionContentPosition as A, EAccordionSize as L, EAccordionLinkIconSize as oe, EAccordionButtonStyle as $e, EAccordionIconType as re, EAccordionButtonIconSize as le } from "./constants.js";
|
6
|
+
import { useMediaQuery as Pe } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
7
|
+
import { EMediaQuery as ve } from "../../hooks/useMediaQuery/constants.js";
|
8
|
+
import { Icon as ye } from "../../icons/Icon.js";
|
9
|
+
import { Link as he } from "../AnchorLink/Link.js";
|
10
|
+
import { M as se, W as z, y as K, T as ke, o as B, a as X, H as G, I as me, $ as Oe, b as Be, D as ce, u as we, c as C } from "../../keyboard-wis2TUql.js";
|
11
|
+
import { w as Ne } from "../../use-active-press-CnDeVvQq.js";
|
12
|
+
import { e as Ae } from "../../use-resolve-button-type-DhFdPxnv.js";
|
13
|
+
import { c as Ce, i as H, u as Me, R as Re, H as Le, s as Fe } from "../../open-closed-CJijMeI2.js";
|
14
|
+
import { C as He } from "../../close-provider-CEutdhG8.js";
|
15
|
+
import { r as Ue } from "../../bugs-diTMAGNw.js";
|
16
|
+
import '../../assets/Accordion.css';var ae;
|
17
|
+
let qe = (ae = P.startTransition) != null ? ae : function(e) {
|
18
18
|
e();
|
19
19
|
};
|
20
|
-
var
|
21
|
-
let
|
20
|
+
var je = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(je || {}), We = ((e) => (e[e.ToggleDisclosure = 0] = "ToggleDisclosure", e[e.CloseDisclosure = 1] = "CloseDisclosure", e[e.SetButtonId = 2] = "SetButtonId", e[e.SetPanelId = 3] = "SetPanelId", e[e.SetButtonElement = 4] = "SetButtonElement", e[e.SetPanelElement = 5] = "SetPanelElement", e))(We || {});
|
21
|
+
let Qe = { 0: (e) => ({ ...e, disclosureState: X(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, t) {
|
22
22
|
return e.buttonId === t.buttonId ? e : { ...e, buttonId: t.buttonId };
|
23
23
|
}, 3(e, t) {
|
24
24
|
return e.panelId === t.panelId ? e : { ...e, panelId: t.panelId };
|
@@ -26,193 +26,200 @@ let Ue = { 0: (e) => ({ ...e, disclosureState: z(e.disclosureState, { 0: 1, 1: 0
|
|
26
26
|
return e.buttonElement === t.element ? e : { ...e, buttonElement: t.element };
|
27
27
|
}, 5(e, t) {
|
28
28
|
return e.panelElement === t.element ? e : { ...e, panelElement: t.element };
|
29
|
-
} },
|
30
|
-
|
31
|
-
function
|
32
|
-
let t =
|
29
|
+
} }, J = W(null);
|
30
|
+
J.displayName = "DisclosureContext";
|
31
|
+
function Y(e) {
|
32
|
+
let t = V(J);
|
33
33
|
if (t === null) {
|
34
|
-
let
|
35
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
34
|
+
let d = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
35
|
+
throw Error.captureStackTrace && Error.captureStackTrace(d, Y), d;
|
36
36
|
}
|
37
37
|
return t;
|
38
38
|
}
|
39
|
-
let
|
40
|
-
|
41
|
-
function
|
42
|
-
let t =
|
39
|
+
let Z = W(null);
|
40
|
+
Z.displayName = "DisclosureAPIContext";
|
41
|
+
function fe(e) {
|
42
|
+
let t = V(Z);
|
43
43
|
if (t === null) {
|
44
|
-
let
|
45
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
44
|
+
let d = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
45
|
+
throw Error.captureStackTrace && Error.captureStackTrace(d, fe), d;
|
46
46
|
}
|
47
47
|
return t;
|
48
48
|
}
|
49
|
-
let
|
50
|
-
|
51
|
-
function
|
52
|
-
return
|
49
|
+
let ee = W(null);
|
50
|
+
ee.displayName = "DisclosurePanelContext";
|
51
|
+
function Ve() {
|
52
|
+
return V(ee);
|
53
53
|
}
|
54
|
-
function
|
55
|
-
return
|
54
|
+
function ze(e, t) {
|
55
|
+
return X(t.type, Qe, e, t);
|
56
56
|
}
|
57
|
-
let
|
58
|
-
function
|
59
|
-
let { defaultOpen:
|
60
|
-
|
61
|
-
}, e.as === void 0 || e.as ===
|
62
|
-
|
63
|
-
let
|
64
|
-
if (!
|
65
|
-
let
|
66
|
-
|
67
|
-
}),
|
68
|
-
return
|
57
|
+
let Ke = ue;
|
58
|
+
function Xe(e, t) {
|
59
|
+
let { defaultOpen: d = !1, ...p } = e, c = ie(null), m = K(t, ke((i) => {
|
60
|
+
c.current = i;
|
61
|
+
}, e.as === void 0 || e.as === ue)), a = xe(ze, { disclosureState: d ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: n, buttonId: o }, S] = a, s = B((i) => {
|
62
|
+
S({ type: 1 });
|
63
|
+
let _ = we(c);
|
64
|
+
if (!_ || !o) return;
|
65
|
+
let g = i ? i instanceof HTMLElement ? i : i.current instanceof HTMLElement ? i.current : _.getElementById(o) : _.getElementById(o);
|
66
|
+
g == null || g.focus();
|
67
|
+
}), T = F(() => ({ close: s }), [s]), b = F(() => ({ open: n === 0, close: s }), [n, s]), I = { ref: m };
|
68
|
+
return P.createElement(J.Provider, { value: a }, P.createElement(Z.Provider, { value: T }, P.createElement(He, { value: s }, P.createElement(Ce, { value: X(n, { 0: H.Open, 1: H.Closed }) }, G({ ourProps: I, theirProps: p, slot: b, defaultTag: Ke, name: "Disclosure" })))));
|
69
69
|
}
|
70
|
-
let
|
71
|
-
function
|
72
|
-
let
|
73
|
-
if (!
|
74
|
-
})), I =
|
75
|
-
|
76
|
-
if (!
|
77
|
-
|
70
|
+
let Ge = "button";
|
71
|
+
function Je(e, t) {
|
72
|
+
let d = de(), { id: p = `headlessui-disclosure-button-${d}`, disabled: c = !1, autoFocus: m = !1, ...a } = e, [n, o] = Y("Disclosure.Button"), S = Ve(), s = S === null ? !1 : S === n.panelId, T = ie(null), b = K(T, t, B((u) => {
|
73
|
+
if (!s) return o({ type: 4, element: u });
|
74
|
+
})), I = me();
|
75
|
+
Q(() => {
|
76
|
+
if (!s) return o({ type: 2, buttonId: p }), () => {
|
77
|
+
o({ type: 2, buttonId: null });
|
78
78
|
};
|
79
|
-
}, [
|
80
|
-
let
|
81
|
-
var
|
82
|
-
if (
|
79
|
+
}, [p, o, s]);
|
80
|
+
let i = B((u) => {
|
81
|
+
var f;
|
82
|
+
if (s) {
|
83
83
|
if (n.disclosureState === 1) return;
|
84
|
-
switch (
|
85
|
-
case
|
86
|
-
case
|
87
|
-
|
84
|
+
switch (u.key) {
|
85
|
+
case C.Space:
|
86
|
+
case C.Enter:
|
87
|
+
u.preventDefault(), u.stopPropagation(), o({ type: 0 }), (f = n.buttonElement) == null || f.focus();
|
88
88
|
break;
|
89
89
|
}
|
90
|
-
} else switch (
|
91
|
-
case
|
92
|
-
case
|
93
|
-
|
90
|
+
} else switch (u.key) {
|
91
|
+
case C.Space:
|
92
|
+
case C.Enter:
|
93
|
+
u.preventDefault(), u.stopPropagation(), o({ type: 0 });
|
94
94
|
break;
|
95
95
|
}
|
96
|
-
}),
|
97
|
-
switch (
|
98
|
-
case
|
99
|
-
|
96
|
+
}), _ = B((u) => {
|
97
|
+
switch (u.key) {
|
98
|
+
case C.Space:
|
99
|
+
u.preventDefault();
|
100
100
|
break;
|
101
101
|
}
|
102
|
-
}),
|
103
|
-
var
|
104
|
-
|
105
|
-
}), { isFocusVisible:
|
106
|
-
return
|
102
|
+
}), g = B((u) => {
|
103
|
+
var f;
|
104
|
+
Ue(u.currentTarget) || c || (s ? (o({ type: 0 }), (f = n.buttonElement) == null || f.focus()) : o({ type: 0 }));
|
105
|
+
}), { isFocusVisible: E, focusProps: v } = Oe({ autoFocus: m }), { isHovered: y, hoverProps: D } = Be({ isDisabled: c }), { pressed: M, pressProps: $ } = Ne({ disabled: c }), U = F(() => ({ open: n.disclosureState === 0, hover: y, active: M, disabled: c, focus: E, autofocus: m }), [n, y, M, E, c, m]), w = Ae(e, n.buttonElement), h = s ? ce({ ref: b, type: w, disabled: c || void 0, autoFocus: m, onKeyDown: i, onClick: g }, v, D, $) : ce({ ref: b, id: p, type: w, "aria-expanded": n.disclosureState === 0, "aria-controls": n.panelElement ? n.panelId : void 0, disabled: c || void 0, autoFocus: m, onKeyDown: i, onKeyUp: _, onClick: g }, v, D, $);
|
106
|
+
return G({ mergeRefs: I, ourProps: h, theirProps: a, slot: U, defaultTag: Ge, name: "Disclosure.Button" });
|
107
107
|
}
|
108
|
-
let
|
109
|
-
function
|
110
|
-
let
|
111
|
-
|
112
|
-
}),
|
113
|
-
|
108
|
+
let Ye = "div", Ze = se.RenderStrategy | se.Static;
|
109
|
+
function et(e, t) {
|
110
|
+
let d = de(), { id: p = `headlessui-disclosure-panel-${d}`, transition: c = !1, ...m } = e, [a, n] = Y("Disclosure.Panel"), { close: o } = fe("Disclosure.Panel"), S = me(), [s, T] = pe(null), b = K(t, B((v) => {
|
111
|
+
qe(() => n({ type: 5, element: v }));
|
112
|
+
}), T);
|
113
|
+
Q(() => (n({ type: 3, panelId: p }), () => {
|
114
114
|
n({ type: 3, panelId: null });
|
115
|
-
}), [
|
116
|
-
let I =
|
117
|
-
return
|
115
|
+
}), [p, n]);
|
116
|
+
let I = Me(), [i, _] = Re(c, s, I !== null ? (I & H.Open) === H.Open : a.disclosureState === 0), g = F(() => ({ open: a.disclosureState === 0, close: o }), [a.disclosureState, o]), E = { ref: b, id: p, ...Le(_) };
|
117
|
+
return P.createElement(Fe, null, P.createElement(ee.Provider, { value: a.panelId }, G({ mergeRefs: S, ourProps: E, theirProps: m, slot: g, defaultTag: Ye, features: Ze, visible: i, name: "Disclosure.Panel" })));
|
118
118
|
}
|
119
|
-
let
|
120
|
-
const
|
121
|
-
icon:
|
122
|
-
"icon-container": "_icon-
|
123
|
-
open:
|
124
|
-
square:
|
125
|
-
circle:
|
126
|
-
disabled:
|
127
|
-
accordion:
|
128
|
-
"is-link": "_is-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
"
|
134
|
-
|
135
|
-
|
136
|
-
"
|
137
|
-
|
119
|
+
let tt = z(Xe), _e = z(Je), Ee = z(et), nt = Object.assign(tt, { Button: _e, Panel: Ee });
|
120
|
+
const ot = "_icon_1x2lg_2", rt = "_open_1x2lg_15", lt = "_square_1x2lg_19", st = "_circle_1x2lg_23", ct = "_disabled_1x2lg_23", at = "_accordion_1x2lg_37", it = "_button_1x2lg_49", ut = "_header_1x2lg_53", dt = "_title_1x2lg_69", pt = "_panel_1x2lg_96", mt = "_m_1x2lg_133", ft = "_s_1x2lg_19", l = {
|
121
|
+
icon: ot,
|
122
|
+
"icon-container": "_icon-container_1x2lg_8",
|
123
|
+
open: rt,
|
124
|
+
square: lt,
|
125
|
+
circle: st,
|
126
|
+
disabled: ct,
|
127
|
+
accordion: at,
|
128
|
+
"is-link": "_is-link_1x2lg_41",
|
129
|
+
"content-top": "_content-top_1x2lg_44",
|
130
|
+
button: it,
|
131
|
+
header: ut,
|
132
|
+
title: dt,
|
133
|
+
"title-uppercase": "_title-uppercase_1x2lg_72",
|
134
|
+
panel: pt,
|
135
|
+
"content-bottom": "_content-bottom_1x2lg_109",
|
136
|
+
"link-open": "_link-open_1x2lg_129",
|
137
|
+
m: mt,
|
138
|
+
s: ft,
|
139
|
+
"wrapper-button": "_wrapper-button_1x2lg_161"
|
140
|
+
}, Ot = Te(
|
138
141
|
({
|
139
142
|
title: e,
|
140
143
|
disabled: t,
|
141
|
-
buttonType:
|
142
|
-
children:
|
143
|
-
showTitleByDefault:
|
144
|
+
buttonType: d = N.BUTTON,
|
145
|
+
children: p,
|
146
|
+
showTitleByDefault: c = !0,
|
144
147
|
linkClassName: m,
|
145
|
-
size: a =
|
148
|
+
size: a = L.M,
|
146
149
|
titleUppercase: n,
|
147
|
-
buttonStyle:
|
148
|
-
iconType:
|
149
|
-
classNameTitle:
|
150
|
-
classNameContent:
|
151
|
-
classNameAccordion:
|
150
|
+
buttonStyle: o = $e.CIRCLE,
|
151
|
+
iconType: S = re.ARROW,
|
152
|
+
classNameTitle: s,
|
153
|
+
classNameContent: T,
|
154
|
+
classNameAccordion: b,
|
152
155
|
classNameIconButton: I,
|
153
|
-
subtitleNode:
|
154
|
-
onlyOpenSubtitleNode:
|
155
|
-
classNameSubtitleContainer:
|
156
|
-
activeKey:
|
157
|
-
defaultActiveKey:
|
158
|
-
onChange:
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
156
|
+
subtitleNode: i,
|
157
|
+
onlyOpenSubtitleNode: _,
|
158
|
+
classNameSubtitleContainer: g,
|
159
|
+
activeKey: E,
|
160
|
+
defaultActiveKey: v,
|
161
|
+
onChange: y,
|
162
|
+
contentPosition: D = A.BOTTOM
|
163
|
+
}, M) => {
|
164
|
+
const $ = E !== void 0, [U, w] = pe(
|
165
|
+
() => !!v
|
166
|
+
), h = $ ? !!E : U, u = Pe(ve.XS1), f = d === N.LINK, te = {
|
167
|
+
[l["is-link"]]: f
|
168
|
+
}, q = {
|
169
|
+
[l["content-top"]]: D === A.TOP,
|
170
|
+
[l["content-bottom"]]: D === A.BOTTOM
|
164
171
|
};
|
165
|
-
|
166
|
-
|
167
|
-
}, [
|
168
|
-
const
|
172
|
+
Q(() => {
|
173
|
+
$ && w(!!E);
|
174
|
+
}, [E, $]);
|
175
|
+
const ge = () => {
|
169
176
|
if (t)
|
170
177
|
return;
|
171
|
-
const
|
172
|
-
|
173
|
-
},
|
178
|
+
const r = !h;
|
179
|
+
y == null || y(r), $ || w(r);
|
180
|
+
}, Se = a === L.S ? oe.S : oe.M, be = (r) => ({
|
174
181
|
variant: "anchor",
|
175
|
-
size:
|
182
|
+
size: u ? "s" : "l",
|
176
183
|
rightIcon: {
|
177
|
-
iconName:
|
178
|
-
className:
|
179
|
-
[
|
184
|
+
iconName: Se,
|
185
|
+
className: O({
|
186
|
+
[l["link-open"]]: r
|
180
187
|
})
|
181
188
|
}
|
182
|
-
}),
|
183
|
-
const
|
184
|
-
switch (
|
185
|
-
case
|
189
|
+
}), Ie = (r) => {
|
190
|
+
const k = () => S === re.DROPDOWN ? a === L.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : a === L.S ? le.S : le.M;
|
191
|
+
switch (d) {
|
192
|
+
case N.LINK:
|
186
193
|
return e;
|
187
|
-
case
|
188
|
-
return /* @__PURE__ */
|
189
|
-
/* @__PURE__ */
|
194
|
+
case N.BUTTON:
|
195
|
+
return /* @__PURE__ */ R(j, { children: [
|
196
|
+
/* @__PURE__ */ x(
|
190
197
|
"span",
|
191
198
|
{
|
192
|
-
className:
|
193
|
-
|
194
|
-
|
195
|
-
n &&
|
199
|
+
className: O(
|
200
|
+
l.title,
|
201
|
+
s,
|
202
|
+
n && l["title-uppercase"]
|
196
203
|
),
|
197
204
|
children: e
|
198
205
|
}
|
199
206
|
),
|
200
|
-
/* @__PURE__ */
|
207
|
+
/* @__PURE__ */ x(
|
201
208
|
"div",
|
202
209
|
{
|
203
|
-
className:
|
204
|
-
|
205
|
-
|
206
|
-
t &&
|
207
|
-
|
210
|
+
className: O(
|
211
|
+
l["icon-container"],
|
212
|
+
r && l.open,
|
213
|
+
t && l.disabled,
|
214
|
+
l[o],
|
208
215
|
I
|
209
216
|
),
|
210
217
|
"data-testid": "accordion-icon-container",
|
211
|
-
children: /* @__PURE__ */
|
212
|
-
|
218
|
+
children: /* @__PURE__ */ x(
|
219
|
+
ye,
|
213
220
|
{
|
214
|
-
iconName:
|
215
|
-
className:
|
221
|
+
iconName: k(),
|
222
|
+
className: l.icon,
|
216
223
|
"data-testid": "accordion-icon"
|
217
224
|
}
|
218
225
|
)
|
@@ -222,66 +229,69 @@ const Ze = "_icon_1yk0x_2", et = "_open_1yk0x_15", tt = "_square_1yk0x_19", nt =
|
|
222
229
|
default:
|
223
230
|
return null;
|
224
231
|
}
|
225
|
-
}
|
226
|
-
|
227
|
-
|
232
|
+
}, ne = (r, k) => /* @__PURE__ */ x(
|
233
|
+
Ee,
|
234
|
+
{
|
235
|
+
"data-testid": "accordion-panel",
|
236
|
+
className: O(
|
237
|
+
l.panel,
|
238
|
+
T,
|
239
|
+
te,
|
240
|
+
q
|
241
|
+
),
|
242
|
+
children: /* @__PURE__ */ x(De, { size: a, children: typeof p == "function" ? p({
|
243
|
+
open: r,
|
244
|
+
close: k
|
245
|
+
}) : p })
|
246
|
+
}
|
247
|
+
);
|
248
|
+
return /* @__PURE__ */ R(j, { children: [
|
249
|
+
/* @__PURE__ */ x(
|
228
250
|
"div",
|
229
251
|
{
|
230
|
-
className:
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
252
|
+
className: O(
|
253
|
+
l.accordion,
|
254
|
+
l[a],
|
255
|
+
te,
|
256
|
+
b,
|
257
|
+
q
|
235
258
|
),
|
236
|
-
children: /* @__PURE__ */
|
237
|
-
|
259
|
+
children: /* @__PURE__ */ x(
|
260
|
+
nt,
|
238
261
|
{
|
239
|
-
ref:
|
240
|
-
defaultOpen:
|
241
|
-
children: ({ open:
|
242
|
-
|
243
|
-
|
262
|
+
ref: M,
|
263
|
+
defaultOpen: h,
|
264
|
+
children: ({ open: r, close: k }) => /* @__PURE__ */ R(j, { children: [
|
265
|
+
D === A.TOP && r && ne(r, k),
|
266
|
+
(!r || c) && /* @__PURE__ */ x(
|
267
|
+
_e,
|
244
268
|
{
|
245
269
|
disabled: t,
|
246
|
-
as:
|
247
|
-
onClick:
|
248
|
-
className:
|
249
|
-
[
|
250
|
-
[
|
251
|
-
[m ?? ""]:
|
270
|
+
as: f ? he : N.BUTTON,
|
271
|
+
onClick: ge,
|
272
|
+
className: O(l.button, q, {
|
273
|
+
[l.header]: !f,
|
274
|
+
[l.disabled]: t,
|
275
|
+
[m ?? ""]: f && m
|
252
276
|
}),
|
253
|
-
...
|
254
|
-
children: (!
|
277
|
+
...f ? be(r) : {},
|
278
|
+
children: (!r || c) && Ie(r)
|
255
279
|
}
|
256
280
|
),
|
257
|
-
|
258
|
-
pe,
|
259
|
-
{
|
260
|
-
"data-testid": "accordion-panel",
|
261
|
-
className: T(
|
262
|
-
u.panel,
|
263
|
-
x,
|
264
|
-
k
|
265
|
-
),
|
266
|
-
children: /* @__PURE__ */ b(Ie, { size: a, children: typeof d == "function" ? d({
|
267
|
-
open: p,
|
268
|
-
close: H
|
269
|
-
}) : d })
|
270
|
-
}
|
271
|
-
)
|
281
|
+
D === A.BOTTOM && r && ne(r, k)
|
272
282
|
] })
|
273
283
|
},
|
274
|
-
|
284
|
+
E ? String(h) : void 0
|
275
285
|
)
|
276
286
|
}
|
277
287
|
),
|
278
|
-
(
|
279
|
-
|
280
|
-
|
288
|
+
(i || _) && /* @__PURE__ */ R("div", { className: g, children: [
|
289
|
+
i,
|
290
|
+
h && _
|
281
291
|
] })
|
282
292
|
] });
|
283
293
|
}
|
284
294
|
);
|
285
295
|
export {
|
286
|
-
|
296
|
+
Ot as Accordion
|
287
297
|
};
|
@@ -1,9 +1,10 @@
|
|
1
|
-
var w = /* @__PURE__ */ ((r) => (r.M = "m", r.S = "s", r))(w || {}), a = /* @__PURE__ */ ((r) => (r.BUTTON = "button", r.LINK = "link", r))(a || {}),
|
1
|
+
var w = /* @__PURE__ */ ((r) => (r.M = "m", r.S = "s", r))(w || {}), a = /* @__PURE__ */ ((r) => (r.BUTTON = "button", r.LINK = "link", r))(a || {}), p = /* @__PURE__ */ ((r) => (r.M = "ArrowDown24px", r.S = "ArrowDown16px", r))(p || {}), v = /* @__PURE__ */ ((r) => (r.M = "DropdownArrowDown24px", r.S = "DropdownArrowBottom16px", r))(v || {}), D = /* @__PURE__ */ ((r) => (r.CIRCLE = "circle", r.SQUARE = "square", r))(D || {}), O = /* @__PURE__ */ ((r) => (r.ARROW = "arrow", r.DROPDOWN = "dropdown", r))(O || {}), u = /* @__PURE__ */ ((r) => (r.TOP = "top", r.BOTTOM = "bottom", r))(u || {});
|
2
2
|
export {
|
3
|
-
|
4
|
-
|
3
|
+
p as EAccordionButtonIconSize,
|
4
|
+
D as EAccordionButtonStyle,
|
5
5
|
a as EAccordionButtonType,
|
6
|
-
u as
|
7
|
-
|
6
|
+
u as EAccordionContentPosition,
|
7
|
+
O as EAccordionIconType,
|
8
|
+
v as EAccordionLinkIconSize,
|
8
9
|
w as EAccordionSize
|
9
10
|
};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
export { Accordion, type TProps as TAccordionProps } from './Accordion';
|
2
|
-
export { EAccordionSize } from './constants';
|
2
|
+
export { EAccordionSize, EAccordionButtonIconSize, EAccordionButtonType, EAccordionLinkIconSize, EAccordionButtonStyle, EAccordionContentPosition, EAccordionIconType } from './constants';
|
3
3
|
export { AccordionItem, type TAccordionItemProps } from './AccordionItem';
|
@@ -1,8 +1,14 @@
|
|
1
|
-
import { Accordion as
|
2
|
-
import { EAccordionSize as
|
3
|
-
import { AccordionItem as
|
1
|
+
import { Accordion as n } from "./Accordion.js";
|
2
|
+
import { EAccordionButtonIconSize as r, EAccordionButtonStyle as t, EAccordionButtonType as e, EAccordionContentPosition as d, EAccordionIconType as A, EAccordionLinkIconSize as E, EAccordionSize as p } from "./constants.js";
|
3
|
+
import { AccordionItem as I } from "./AccordionItem/AccordionItem.js";
|
4
4
|
export {
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
n as Accordion,
|
6
|
+
I as AccordionItem,
|
7
|
+
r as EAccordionButtonIconSize,
|
8
|
+
t as EAccordionButtonStyle,
|
9
|
+
e as EAccordionButtonType,
|
10
|
+
d as EAccordionContentPosition,
|
11
|
+
A as EAccordionIconType,
|
12
|
+
E as EAccordionLinkIconSize,
|
13
|
+
p as EAccordionSize
|
8
14
|
};
|
@@ -2,7 +2,7 @@ import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { c as P } from "../../index-DIxK0V-G.js";
|
3
3
|
import { memo as L, useRef as _, useState as B } from "react";
|
4
4
|
import { ANIMATION_VARIABLES_MAP as D, EToastPosition as S, EToastVariant as w, DEFAULT_TOAST_DURATION as O } from "./constants.js";
|
5
|
-
import { c as s, P as T } from "../../ProgressBar-
|
5
|
+
import { c as s, P as T } from "../../ProgressBar-DA7-pT_u.js";
|
6
6
|
import { useTimer as U } from "../../hooks/useTimer/index.js";
|
7
7
|
import { Button as j } from "../Button/Button.js";
|
8
8
|
const g = L(
|
@@ -2,7 +2,7 @@ import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { c as a } from "../../index-DIxK0V-G.js";
|
3
3
|
import { memo as e, useRef as f, useCallback as T, useEffect as u } from "react";
|
4
4
|
import { EToastPosition as i } from "./constants.js";
|
5
|
-
import { c as l } from "../../ProgressBar-
|
5
|
+
import { c as l } from "../../ProgressBar-DA7-pT_u.js";
|
6
6
|
import { Toast as d } from "./Toast.js";
|
7
7
|
const O = e(
|
8
8
|
({ toasts: r, position: s = i.TOP_RIGHT, onToastRemove: n }) => {
|
@@ -1,31 +1,32 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useReducer as u, useCallback as m, useMemo as
|
1
|
+
import { jsxs as p, jsx as T } from "react/jsx-runtime";
|
2
|
+
import { useReducer as u, useCallback as m, useMemo as E } from "react";
|
3
3
|
import { EToastVariant as o } from "./constants.js";
|
4
|
-
import { ToastContext as
|
5
|
-
import { reducer as
|
6
|
-
import { c as
|
4
|
+
import { ToastContext as l } from "./hooks.js";
|
5
|
+
import { reducer as L, initialState as A, actionCreators as c } from "./store.js";
|
6
|
+
import { c as C } from "../../ProgressBar-DA7-pT_u.js";
|
7
7
|
import { ToastList as S } from "./ToastList.js";
|
8
|
-
const
|
9
|
-
const [i, r] = u(
|
8
|
+
const F = ({ children: d }) => {
|
9
|
+
const [i, r] = u(L, A), a = m((t) => {
|
10
10
|
r(c.setToasts(t));
|
11
|
-
}, []),
|
11
|
+
}, []), R = E(
|
12
12
|
() => ({
|
13
13
|
[o.DEFAULT]: (t) => a({ variant: o.DEFAULT, ...t }),
|
14
14
|
[o.SUCCESS]: (t) => a({ variant: o.SUCCESS, ...t }),
|
15
15
|
[o.ALARM]: (t) => a({ variant: o.ALARM, ...t }),
|
16
|
-
[o.ERROR]: (t) => a({ variant: o.ERROR, ...t })
|
16
|
+
[o.ERROR]: (t) => a({ variant: o.ERROR, ...t }),
|
17
|
+
[o.PURPLE]: (t) => a({ variant: o.PURPLE, ...t })
|
17
18
|
}),
|
18
19
|
[a]
|
19
20
|
), v = m(
|
20
21
|
(t, s) => {
|
21
22
|
var n, e;
|
22
|
-
(n = s == null ? void 0 : s.current) == null || n.classList.add(
|
23
|
+
(n = s == null ? void 0 : s.current) == null || n.classList.add(C["toast-out"]), (e = s == null ? void 0 : s.current) == null || e.addEventListener("animationend", () => {
|
23
24
|
r(c.removeToast(t));
|
24
25
|
});
|
25
26
|
},
|
26
27
|
[]
|
27
28
|
);
|
28
|
-
return /* @__PURE__ */
|
29
|
+
return /* @__PURE__ */ p(l.Provider, { value: R, children: [
|
29
30
|
d,
|
30
31
|
/* @__PURE__ */ T(
|
31
32
|
S,
|
@@ -38,5 +39,5 @@ const O = ({ children: d }) => {
|
|
38
39
|
] });
|
39
40
|
};
|
40
41
|
export {
|
41
|
-
|
42
|
+
F as ToastProvider
|
42
43
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var e = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.ALARM = "alarm", t.SUCCESS = "success", t.ERROR = "error", t))(e || {}), r = /* @__PURE__ */ ((t) => (t.TOP_LEFT = "top-left", t.TOP_CENTER = "top-center", t.TOP_RIGHT = "top-right", t.BOTTOM_RIGHT = "bottom-right", t.BOTTOM_CENTER = "bottom-center", t.BOTTOM_LEFT = "bottom-left", t))(r || {});
|
1
|
+
var e = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.ALARM = "alarm", t.SUCCESS = "success", t.ERROR = "error", t.PURPLE = "purple", t))(e || {}), r = /* @__PURE__ */ ((t) => (t.TOP_LEFT = "top-left", t.TOP_CENTER = "top-center", t.TOP_RIGHT = "top-right", t.BOTTOM_RIGHT = "bottom-right", t.BOTTOM_CENTER = "bottom-center", t.BOTTOM_LEFT = "bottom-left", t))(r || {});
|
2
2
|
const p = {
|
3
3
|
"top-right": "translateX(1000px)",
|
4
4
|
"top-center": "translateY(-1300px)",
|
@@ -6,10 +6,10 @@ const p = {
|
|
6
6
|
"bottom-left": "translateX(-1000px)",
|
7
7
|
"bottom-center": "translateY(1300px)",
|
8
8
|
"bottom-right": "translateX(1000px)"
|
9
|
-
},
|
9
|
+
}, l = 3e3;
|
10
10
|
export {
|
11
11
|
p as ANIMATION_VARIABLES_MAP,
|
12
|
-
|
12
|
+
l as DEFAULT_TOAST_DURATION,
|
13
13
|
r as EToastPosition,
|
14
14
|
e as EToastVariant
|
15
15
|
};
|
package/package.json
CHANGED
@@ -1,67 +0,0 @@
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
2
|
-
import { c as u } from "./index-DIxK0V-G.js";
|
3
|
-
import { memo as p, useRef as r, useEffect as f } from "react";
|
4
|
-
import { DEFAULT_TOAST_DURATION as z, EToastVariant as g } from "./components/Toasts/constants.js";
|
5
|
-
import './assets/ProgressBar.css';const d = "_title_1z0br_37", A = "_timer_1z0br_41", T = "_seconds_1z0br_51", h = "_message_1z0br_61", w = "_progress_1z0br_69", D = "_slot_1z0br_95", F = "_success_1z0br_104", R = "_alarm_1z0br_109", E = "_error_1z0br_114", o = {
|
6
|
-
"toast-list": "_toast-list_1z0br_2",
|
7
|
-
"toast-wrapper": "_toast-wrapper_1z0br_24",
|
8
|
-
title: d,
|
9
|
-
timer: A,
|
10
|
-
"timer-title": "_timer-title_1z0br_49",
|
11
|
-
seconds: T,
|
12
|
-
message: h,
|
13
|
-
progress: w,
|
14
|
-
"progress-bar": "_progress-bar_1z0br_78",
|
15
|
-
"close-button": "_close-button_1z0br_89",
|
16
|
-
slot: D,
|
17
|
-
default: "_default_1z0br_99",
|
18
|
-
success: F,
|
19
|
-
alarm: R,
|
20
|
-
error: E,
|
21
|
-
"top-right": "_top-right_1z0br_119",
|
22
|
-
"top-center": "_top-center_1z0br_125",
|
23
|
-
"top-left": "_top-left_1z0br_131",
|
24
|
-
"bottom-left": "_bottom-left_1z0br_136",
|
25
|
-
"bottom-center": "_bottom-center_1z0br_141",
|
26
|
-
"bottom-right": "_bottom-right_1z0br_147",
|
27
|
-
"toast-in": "_toast-in_1z0br_179",
|
28
|
-
"toast-out": "_toast-out_1z0br_183"
|
29
|
-
}, x = p(
|
30
|
-
({
|
31
|
-
duration: _ = z,
|
32
|
-
variant: b = g.DEFAULT,
|
33
|
-
isPaused: n = !1
|
34
|
-
}) => {
|
35
|
-
const t = r(), e = r(null), c = r(Date.now()), s = r(0);
|
36
|
-
return f(() => {
|
37
|
-
if (n)
|
38
|
-
t.current && cancelAnimationFrame(t.current);
|
39
|
-
else {
|
40
|
-
c.current = Date.now() - s.current;
|
41
|
-
const a = () => {
|
42
|
-
const l = Date.now();
|
43
|
-
s.current = l - c.current;
|
44
|
-
const i = Math.min(
|
45
|
-
s.current / _ * 100,
|
46
|
-
100
|
47
|
-
);
|
48
|
-
e.current && (e.current.style.width = `${i}%`), i < 100 && (t.current = requestAnimationFrame(a));
|
49
|
-
};
|
50
|
-
t.current = requestAnimationFrame(a);
|
51
|
-
}
|
52
|
-
return () => {
|
53
|
-
t.current && cancelAnimationFrame(t.current);
|
54
|
-
};
|
55
|
-
}, [_, n]), /* @__PURE__ */ m("div", { className: o.progress, "data-testid": "progress-bar", children: /* @__PURE__ */ m(
|
56
|
-
"div",
|
57
|
-
{
|
58
|
-
ref: e,
|
59
|
-
className: u(o["progress-bar"], o[b])
|
60
|
-
}
|
61
|
-
) });
|
62
|
-
}
|
63
|
-
);
|
64
|
-
export {
|
65
|
-
x as P,
|
66
|
-
o as c
|
67
|
-
};
|