@vervstack/chures 0.0.6 → 0.0.7
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/chures.js +407 -224
- package/dist/chures.umd.cjs +2 -2
- package/dist/components/Dropdown/Dropdown.d.ts +20 -0
- package/dist/components/Dropdown/Dropdown.hooks.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.types.d.ts +6 -0
- package/dist/components/Dropdown/DropdownCreateRow.d.ts +7 -0
- package/dist/components/Dropdown/DropdownOptionRow.d.ts +9 -0
- package/dist/components/Dropdown/DropdownSearchRow.d.ts +9 -0
- package/dist/components/Dropdown/DropdownSkeletonList.d.ts +5 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Loader/index.d.ts +2 -0
- package/dist/components/{LoadingWrapper.d.ts → LoadingWrapper/LoadingWrapper.d.ts} +1 -1
- package/dist/components/LoadingWrapper/index.d.ts +2 -0
- package/dist/components/{TelegramAuth.d.ts → TelegramAuth/TelegramAuth.d.ts} +1 -1
- package/dist/components/TelegramAuth/index.d.ts +2 -0
- package/dist/components/TelegramSignInButton/index.d.ts +2 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/notifications/index.d.ts +1 -0
- package/dist/index.d.ts +3 -1
- package/package.json +1 -1
- /package/dist/components/{Input.d.ts → Input/Input.d.ts} +0 -0
- /package/dist/components/{Loader.d.ts → Loader/Loader.d.ts} +0 -0
- /package/dist/components/{TelegramSignInButton.d.ts → TelegramSignInButton/TelegramSignInButton.d.ts} +0 -0
- /package/dist/components/{Toggle.d.ts → Toggle/Toggle.d.ts} +0 -0
package/dist/chures.js
CHANGED
|
@@ -1,167 +1,167 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--chures-accent: #229ED9;--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem;--chures-input-bg: #111111;--chures-input-height: 3rem;--chures-input-radius: .75rem;--chures-skeleton-shine: #1e1e1e;--chures-toggle-width: 2.75rem;--chures-toggle-height: 1.5rem;--chures-toggle-thumb: 1.125rem;--chures-toggle-bg-off: rgb(255 255 255 / 13%);--chures-toggle-bg-on: var(--chures-accent);--chures-toggle-thumb-color: #ffffff;--chures-toggle-label-skeleton-w: 5rem}@keyframes _spin_wa8op_1{to{transform:rotate(360deg)}}@keyframes _ripple_wa8op_1{0%{transform:scale(.08);opacity:.9}to{transform:scale(1);opacity:0}}@keyframes _dotPulse_wa8op_1{0%,to{transform:translate(-50%,-50%) scale(.55);opacity:.3}50%{transform:translate(-50%,calc(-50% - var(--sz) * .1)) scale(1);opacity:1}}@keyframes _waveBounce_wa8op_1{0%,55%,to{transform:translate(-50%,-50%) scale(.8);opacity:.4}27%{transform:translate(-50%,calc(-50% - var(--sz) * .28)) scale(1);opacity:1}}._LoaderContainer_wa8op_24{position:relative;flex-shrink:0}._sm_wa8op_31{width:1.5rem;height:1.5rem;--sz: 1.5rem;--arc-gap: .2rem;--arc-bw: .125rem}._md_wa8op_32{width:2.5rem;height:2.5rem;--sz: 2.5rem;--arc-gap: .35rem;--arc-bw: .1875rem}._lg_wa8op_33{width:4rem;height:4rem;--sz: 4rem;--arc-gap: .55rem;--arc-bw: .25rem}._Arc1_wa8op_37,._Arc2_wa8op_38,._Arc3_wa8op_39{position:absolute;border-radius:50%;border:var(--arc-bw) solid transparent}._Arc1_wa8op_37{inset:0;border-top-color:var(--chures-accent, #229ED9);border-left-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.2s linear infinite;filter:drop-shadow(0 0 .25rem var(--chures-accent, #229ED9))}._Arc2_wa8op_38{inset:var(--arc-gap);border-bottom-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.8s linear infinite reverse;opacity:.8}._Arc3_wa8op_39{inset:calc(var(--arc-gap) * 2);border-top-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 2.4s linear infinite;opacity:.6}._Ring1_wa8op_71,._Ring2_wa8op_72,._Ring3_wa8op_73{position:absolute;inset:0;border-radius:50%;border:var(--arc-bw) solid var(--chures-accent, #229ED9);animation:_ripple_wa8op_1 1.8s ease-out infinite both}._Ring2_wa8op_72{animation-delay:.6s}._Ring3_wa8op_73{animation-delay:1.2s}._Dot1_wa8op_86,._Dot2_wa8op_87,._Dot3_wa8op_88{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .2);height:calc(var(--sz) * .2);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .14) var(--chures-accent, #229ED9);animation:_dotPulse_wa8op_1 1.1s ease-in-out infinite both}._Dot1_wa8op_86{left:22%}._Dot2_wa8op_87{left:50%;animation-delay:.18s}._Dot3_wa8op_88{left:78%;animation-delay:.36s}._Wave1_wa8op_105,._Wave2_wa8op_106,._Wave3_wa8op_107,._Wave4_wa8op_108,._Wave5_wa8op_109{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .16);height:calc(var(--sz) * .16);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .1) var(--chures-accent, #229ED9);animation:_waveBounce_wa8op_1 1s ease-in-out infinite both}._Wave1_wa8op_105{left:10%}._Wave2_wa8op_106{left:28%;animation-delay:.12s}._Wave3_wa8op_107{left:46%;animation-delay:.24s}._Wave4_wa8op_108{left:64%;animation-delay:.36s}._Wave5_wa8op_109{left:82%;animation-delay:.48s}._LoadingWrapperContainer_1q0w7_1{display:flex;align-items:center;justify-content:center;width:100%;min-height:4rem}._SkeletonWrapper_1q0w7_9{width:100%}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}@keyframes _shimmer_1a08x_1{0%{background-position:-200% 0}to{background-position:200% 0}}._InputContainer_1a08x_6{position:relative;width:100%;height:var(--chures-input-height, 3rem)}._InputField_1a08x_12{width:100%;height:100%;background:var(--chures-input-bg, #111111);border:.0625rem solid rgb(255 255 255 / 13%);border-radius:var(--chures-input-radius, .75rem);color:var(--chures-fg, #ffffff);font-size:var(--chures-font-sm, .875rem);padding:0 .875rem;outline:none;transition:border-color .18s ease;box-sizing:border-box}._InputField_1a08x_12:focus{border-color:#ffffff59}._hasError_1a08x_30 ._InputField_1a08x_12,._hasError_1a08x_30 ._InputField_1a08x_12:focus{border-color:var(--chures-error, #ef4444)}._disabled_1a08x_35 ._InputField_1a08x_12{opacity:.45;cursor:not-allowed}._Label_1a08x_40{position:absolute;left:.875rem;top:50%;transform:translateY(-50%);transform-origin:left center;color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-sm, .875rem);pointer-events:none;transition:all .18s ease;padding:0 .25rem;border-radius:.1875rem}._Label_1a08x_40._lifted_1a08x_54{top:0;transform:translateY(-50%) scale(.82);background:var(--chures-input-bg, #111111);color:var(--chures-fg-muted, #9ca3af)}._hasError_1a08x_30 ._Label_1a08x_40._lifted_1a08x_54{color:var(--chures-error, #ef4444)}._ErrorText_1a08x_65{display:block;margin-top:.25rem;padding-left:.875rem;font-size:var(--chures-font-xs, .75rem);color:var(--chures-error, #ef4444)}._Skeleton_1a08x_73{width:100%;height:var(--chures-input-height, 3rem);border-radius:var(--chures-input-radius, .75rem);background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1a08x_1 1.5s ease-in-out infinite}@keyframes _shimmer_im4lz_1{0%{background-position:-200% 0}to{background-position:200% 0}}._ToggleContainer_im4lz_6{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}._disabled_im4lz_13{opacity:.45;cursor:not-allowed}._Track_im4lz_18{position:relative;width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:var(--chures-toggle-bg-off, rgb(255 255 255 / 13%));border:none;padding:0;cursor:pointer;transition:background .2s ease;flex-shrink:0}._Track_im4lz_18._on_im4lz_31{background:var(--chures-toggle-bg-on, var(--chures-accent, #229ED9))}._disabled_im4lz_13 ._Track_im4lz_18{cursor:not-allowed}._Thumb_im4lz_39{position:absolute;top:50%;left:.1875rem;transform:translateY(-50%);width:var(--chures-toggle-thumb, 1.125rem);height:var(--chures-toggle-thumb, 1.125rem);border-radius:50%;background:var(--chures-toggle-thumb-color, #ffffff);transition:left .2s ease;pointer-events:none}._Track_im4lz_18._on_im4lz_31 ._Thumb_im4lz_39{left:calc(var(--chures-toggle-width, 2.75rem) - var(--chures-toggle-thumb, 1.125rem) - .1875rem)}._Label_im4lz_56{font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff);-webkit-user-select:none;user-select:none}._LabelSkeleton_im4lz_62{display:inline-block;width:var(--chures-toggle-label-skeleton-w, 5rem);height:var(--chures-font-sm, .875rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}._Skeleton_im4lz_77{width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { AnimatePresence as
|
|
5
|
-
import { create as
|
|
6
|
-
function
|
|
7
|
-
return
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("@keyframes _spin_wa8op_1{to{transform:rotate(360deg)}}@keyframes _ripple_wa8op_1{0%{transform:scale(.08);opacity:.9}to{transform:scale(1);opacity:0}}@keyframes _dotPulse_wa8op_1{0%,to{transform:translate(-50%,-50%) scale(.55);opacity:.3}50%{transform:translate(-50%,calc(-50% - var(--sz) * .1)) scale(1);opacity:1}}@keyframes _waveBounce_wa8op_1{0%,55%,to{transform:translate(-50%,-50%) scale(.8);opacity:.4}27%{transform:translate(-50%,calc(-50% - var(--sz) * .28)) scale(1);opacity:1}}._LoaderContainer_wa8op_24{position:relative;flex-shrink:0}._sm_wa8op_31{width:1.5rem;height:1.5rem;--sz: 1.5rem;--arc-gap: .2rem;--arc-bw: .125rem}._md_wa8op_32{width:2.5rem;height:2.5rem;--sz: 2.5rem;--arc-gap: .35rem;--arc-bw: .1875rem}._lg_wa8op_33{width:4rem;height:4rem;--sz: 4rem;--arc-gap: .55rem;--arc-bw: .25rem}._Arc1_wa8op_37,._Arc2_wa8op_38,._Arc3_wa8op_39{position:absolute;border-radius:50%;border:var(--arc-bw) solid transparent}._Arc1_wa8op_37{inset:0;border-top-color:var(--chures-accent, #229ED9);border-left-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.2s linear infinite;filter:drop-shadow(0 0 .25rem var(--chures-accent, #229ED9))}._Arc2_wa8op_38{inset:var(--arc-gap);border-bottom-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.8s linear infinite reverse;opacity:.8}._Arc3_wa8op_39{inset:calc(var(--arc-gap) * 2);border-top-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 2.4s linear infinite;opacity:.6}._Ring1_wa8op_71,._Ring2_wa8op_72,._Ring3_wa8op_73{position:absolute;inset:0;border-radius:50%;border:var(--arc-bw) solid var(--chures-accent, #229ED9);animation:_ripple_wa8op_1 1.8s ease-out infinite both}._Ring2_wa8op_72{animation-delay:.6s}._Ring3_wa8op_73{animation-delay:1.2s}._Dot1_wa8op_86,._Dot2_wa8op_87,._Dot3_wa8op_88{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .2);height:calc(var(--sz) * .2);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .14) var(--chures-accent, #229ED9);animation:_dotPulse_wa8op_1 1.1s ease-in-out infinite both}._Dot1_wa8op_86{left:22%}._Dot2_wa8op_87{left:50%;animation-delay:.18s}._Dot3_wa8op_88{left:78%;animation-delay:.36s}._Wave1_wa8op_105,._Wave2_wa8op_106,._Wave3_wa8op_107,._Wave4_wa8op_108,._Wave5_wa8op_109{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .16);height:calc(var(--sz) * .16);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .1) var(--chures-accent, #229ED9);animation:_waveBounce_wa8op_1 1s ease-in-out infinite both}._Wave1_wa8op_105{left:10%}._Wave2_wa8op_106{left:28%;animation-delay:.12s}._Wave3_wa8op_107{left:46%;animation-delay:.24s}._Wave4_wa8op_108{left:64%;animation-delay:.36s}._Wave5_wa8op_109{left:82%;animation-delay:.48s}._LoadingWrapperContainer_1q0w7_1{display:flex;align-items:center;justify-content:center;width:100%;min-height:4rem}._SkeletonWrapper_1q0w7_9{width:100%}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}@keyframes _shimmer_1a08x_1{0%{background-position:-200% 0}to{background-position:200% 0}}._InputContainer_1a08x_6{position:relative;width:100%;height:var(--chures-input-height, 3rem)}._InputField_1a08x_12{width:100%;height:100%;background:var(--chures-input-bg, #111111);border:.0625rem solid rgb(255 255 255 / 13%);border-radius:var(--chures-input-radius, .75rem);color:var(--chures-fg, #ffffff);font-size:var(--chures-font-sm, .875rem);padding:0 .875rem;outline:none;transition:border-color .18s ease;box-sizing:border-box}._InputField_1a08x_12:focus{border-color:#ffffff59}._hasError_1a08x_30 ._InputField_1a08x_12,._hasError_1a08x_30 ._InputField_1a08x_12:focus{border-color:var(--chures-error, #ef4444)}._disabled_1a08x_35 ._InputField_1a08x_12{opacity:.45;cursor:not-allowed}._Label_1a08x_40{position:absolute;left:.875rem;top:50%;transform:translateY(-50%);transform-origin:left center;color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-sm, .875rem);pointer-events:none;transition:all .18s ease;padding:0 .25rem;border-radius:.1875rem}._Label_1a08x_40._lifted_1a08x_54{top:0;transform:translateY(-50%) scale(.82);background:var(--chures-input-bg, #111111);color:var(--chures-fg-muted, #9ca3af)}._hasError_1a08x_30 ._Label_1a08x_40._lifted_1a08x_54{color:var(--chures-error, #ef4444)}._ErrorText_1a08x_65{display:block;margin-top:.25rem;padding-left:.875rem;font-size:var(--chures-font-xs, .75rem);color:var(--chures-error, #ef4444)}._Skeleton_1a08x_73{width:100%;height:var(--chures-input-height, 3rem);border-radius:var(--chures-input-radius, .75rem);background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1a08x_1 1.5s ease-in-out infinite}@keyframes _shimmer_1jetc_1{0%{background-position:-200% 0}to{background-position:200% 0}}._ToggleContainer_1jetc_6{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}._disabled_1jetc_13{opacity:.45;cursor:not-allowed}._Track_1jetc_18{position:relative;width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:var(--chures-toggle-bg-off, rgb(255 255 255 / 13%));border:none;padding:0;cursor:pointer;transition:background .2s ease;flex-shrink:0}._Track_1jetc_18._on_1jetc_31{background:var(--chures-toggle-bg-on, var(--chures-accent, #229ED9))}._disabled_1jetc_13 ._Track_1jetc_18{cursor:not-allowed}._Thumb_1jetc_39{position:absolute;top:0;bottom:0;margin:auto 0;left:.1875rem;width:var(--chures-toggle-thumb, 1.125rem);height:var(--chures-toggle-thumb, 1.125rem);border-radius:50%;background:var(--chures-toggle-thumb-color, #ffffff);transition:left .2s ease;pointer-events:none}._Track_1jetc_18._on_1jetc_31 ._Thumb_1jetc_39{left:calc(var(--chures-toggle-width, 2.75rem) - var(--chures-toggle-thumb, 1.125rem) - .1875rem)}._Label_1jetc_57{font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff);-webkit-user-select:none;user-select:none}._LabelSkeleton_1jetc_63{display:inline-block;width:var(--chures-toggle-label-skeleton-w, 5rem);height:var(--chures-font-sm, .875rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1jetc_1 1.5s ease-in-out infinite}._Skeleton_1jetc_78{width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1jetc_1 1.5s ease-in-out infinite}:root{--chures-accent: #229ED9;--chures-accent-muted: rgb(34 158 217 / 50%);--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-bg: #000000;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem;--chures-input-bg: #111111;--chures-input-height: 3rem;--chures-input-radius: .75rem;--chures-skeleton-shine: #1e1e1e;--chures-toggle-width: 2.75rem;--chures-toggle-height: 1.5rem;--chures-toggle-thumb: 1.125rem;--chures-toggle-bg-off: rgb(255 255 255 / 13%);--chures-toggle-bg-on: var(--chures-accent);--chures-toggle-thumb-color: #ffffff;--chures-toggle-label-skeleton-w: 5rem;--chures-dropdown-bg: var(--chures-bg);--chures-dropdown-radius: .75rem;--chures-dropdown-row-radius: .375rem;--chures-dropdown-border: var(--chures-accent);--chures-dropdown-border-subtle: var(--chures-accent-muted);--chures-dropdown-hover: rgb(255 255 255 / 8%);--chures-dropdown-create-bg: rgb(34 158 217 / 12%);--chures-dropdown-create-bg-hover: rgb(34 158 217 / 20%)}@keyframes _panelIn_v5jkm_1{0%{opacity:0;transform:scale(.96) translateY(6px)}to{opacity:1;transform:none}}@keyframes _shimmer_v5jkm_1{0%{background-position:-200% center}to{background-position:200% center}}._DropdownContainer_v5jkm_13{position:absolute;top:100%;left:0;width:100%;background:var(--chures-dropdown-bg);border:1px solid var(--chures-dropdown-border);border-radius:var(--chures-dropdown-radius);overflow:hidden;box-shadow:0 1rem 3rem #000c;animation:_panelIn_v5jkm_1 .14s ease;z-index:100}._SearchRow_v5jkm_27{padding:.5rem;border-bottom:1px solid var(--chures-dropdown-border-subtle)}._SearchBox_v5jkm_32{display:flex;align-items:center;gap:.5rem;background:var(--chures-input-bg);border:1px solid var(--chures-dropdown-border-subtle);border-radius:var(--chures-dropdown-row-radius);padding:.4rem .625rem}._SearchIcon_v5jkm_42{display:flex;align-items:center;color:var(--chures-fg-muted);flex-shrink:0}._SearchInput_v5jkm_49{flex:1;background:transparent;border:none;outline:none;font-size:var(--chures-font-sm);color:var(--chures-fg);font-family:inherit}._SearchInput_v5jkm_49::placeholder{color:var(--chures-fg-muted)}._ResultsList_v5jkm_63{max-height:13rem;overflow-y:auto}._OptionRow_v5jkm_68{padding:.5625rem .875rem;font-size:var(--chures-font-sm);color:var(--chures-fg-muted);cursor:pointer;transition:background .1s ease,color .1s ease;display:flex;align-items:center;gap:.5rem}._OptionRow_v5jkm_68:hover{background:var(--chures-dropdown-hover);color:var(--chures-fg)}._OptionRow_v5jkm_68._Selected_v5jkm_83{color:var(--chures-fg)}._Checkmark_v5jkm_88{color:var(--chures-accent);font-size:var(--chures-font-xs);flex-shrink:0}._CreateRow_v5jkm_94{display:flex;align-items:center;gap:.625rem;padding:.5625rem .875rem;cursor:pointer;background:var(--chures-dropdown-create-bg);transition:background .1s ease}._CreateRow_v5jkm_94:hover{background:var(--chures-dropdown-create-bg-hover)}._CreateRow_v5jkm_94._WithBorder_v5jkm_107{border-top:1px solid var(--chures-dropdown-border-subtle)}._CreateIcon_v5jkm_112{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;border-radius:50%;background:var(--chures-accent);color:#fff;flex-shrink:0}._CreateLabel_v5jkm_124{font-size:var(--chures-font-sm);font-weight:600;color:var(--chures-fg)}._EmptyHint_v5jkm_130{padding:.75rem .875rem;font-size:var(--chures-font-sm);color:var(--chures-fg-muted);font-style:italic}._SkeletonRow_v5jkm_137{height:2rem;margin:.375rem .875rem;border-radius:var(--chures-dropdown-row-radius);background:linear-gradient(90deg,var(--chures-dropdown-bg) 25%,var(--chures-skeleton-shine) 50%,var(--chures-dropdown-bg) 75%);background-size:200% 100%;animation:_shimmer_v5jkm_1 1.4s infinite linear}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
import { jsx as t, jsxs as u, Fragment as k } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as D, useState as S, useEffect as R } from "react";
|
|
4
|
+
import { AnimatePresence as X, motion as Y } from "framer-motion";
|
|
5
|
+
import { create as Z } from "zustand";
|
|
6
|
+
function ee(e) {
|
|
7
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
return
|
|
9
|
+
var j = { exports: {} };
|
|
10
|
+
var $;
|
|
11
|
+
function ne() {
|
|
12
|
+
return $ || ($ = 1, (function(e) {
|
|
13
13
|
(function() {
|
|
14
14
|
var n = {}.hasOwnProperty;
|
|
15
15
|
function r() {
|
|
16
|
-
for (var
|
|
17
|
-
var c = arguments[
|
|
18
|
-
c && (
|
|
16
|
+
for (var o = "", i = 0; i < arguments.length; i++) {
|
|
17
|
+
var c = arguments[i];
|
|
18
|
+
c && (o = a(o, s(c)));
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return o;
|
|
21
21
|
}
|
|
22
|
-
function s(
|
|
23
|
-
if (typeof
|
|
24
|
-
return
|
|
25
|
-
if (typeof
|
|
22
|
+
function s(o) {
|
|
23
|
+
if (typeof o == "string" || typeof o == "number")
|
|
24
|
+
return o;
|
|
25
|
+
if (typeof o != "object")
|
|
26
26
|
return "";
|
|
27
|
-
if (Array.isArray(
|
|
28
|
-
return r.apply(null,
|
|
29
|
-
if (
|
|
30
|
-
return
|
|
31
|
-
var
|
|
32
|
-
for (var c in
|
|
33
|
-
n.call(
|
|
34
|
-
return
|
|
27
|
+
if (Array.isArray(o))
|
|
28
|
+
return r.apply(null, o);
|
|
29
|
+
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
|
|
30
|
+
return o.toString();
|
|
31
|
+
var i = "";
|
|
32
|
+
for (var c in o)
|
|
33
|
+
n.call(o, c) && o[c] && (i = a(i, c));
|
|
34
|
+
return i;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
36
|
+
function a(o, i) {
|
|
37
|
+
return i ? o ? o + " " + i : o + i : o;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
|
|
40
40
|
})();
|
|
41
|
-
})(
|
|
41
|
+
})(j)), j.exports;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
44
|
-
const
|
|
45
|
-
LoaderContainer:
|
|
46
|
-
sm:
|
|
47
|
-
md:
|
|
48
|
-
lg:
|
|
49
|
-
Arc1:
|
|
50
|
-
Arc2:
|
|
51
|
-
Arc3:
|
|
52
|
-
spin:
|
|
53
|
-
Ring1:
|
|
54
|
-
Ring2:
|
|
55
|
-
Ring3:
|
|
56
|
-
ripple:
|
|
57
|
-
Dot1:
|
|
58
|
-
Dot2:
|
|
59
|
-
Dot3:
|
|
60
|
-
dotPulse:
|
|
61
|
-
Wave1:
|
|
62
|
-
Wave2:
|
|
63
|
-
Wave3:
|
|
64
|
-
Wave4:
|
|
65
|
-
Wave5:
|
|
66
|
-
waveBounce:
|
|
43
|
+
var te = ne();
|
|
44
|
+
const m = /* @__PURE__ */ ee(te), oe = "_LoaderContainer_wa8op_24", re = "_sm_wa8op_31", se = "_md_wa8op_32", ae = "_lg_wa8op_33", ie = "_Arc1_wa8op_37", ce = "_Arc2_wa8op_38", le = "_Arc3_wa8op_39", ue = "_spin_wa8op_1", de = "_Ring1_wa8op_71", _e = "_Ring2_wa8op_72", me = "_Ring3_wa8op_73", fe = "_ripple_wa8op_1", pe = "_Dot1_wa8op_86", he = "_Dot2_wa8op_87", ve = "_Dot3_wa8op_88", we = "_dotPulse_wa8op_1", ge = "_Wave1_wa8op_105", Ce = "_Wave2_wa8op_106", ke = "_Wave3_wa8op_107", Se = "_Wave4_wa8op_108", ye = "_Wave5_wa8op_109", Le = "_waveBounce_wa8op_1", T = {
|
|
45
|
+
LoaderContainer: oe,
|
|
46
|
+
sm: re,
|
|
47
|
+
md: se,
|
|
48
|
+
lg: ae,
|
|
49
|
+
Arc1: ie,
|
|
50
|
+
Arc2: ce,
|
|
51
|
+
Arc3: le,
|
|
52
|
+
spin: ue,
|
|
53
|
+
Ring1: de,
|
|
54
|
+
Ring2: _e,
|
|
55
|
+
Ring3: me,
|
|
56
|
+
ripple: fe,
|
|
57
|
+
Dot1: pe,
|
|
58
|
+
Dot2: he,
|
|
59
|
+
Dot3: ve,
|
|
60
|
+
dotPulse: we,
|
|
61
|
+
Wave1: ge,
|
|
62
|
+
Wave2: Ce,
|
|
63
|
+
Wave3: ke,
|
|
64
|
+
Wave4: Se,
|
|
65
|
+
Wave5: ye,
|
|
66
|
+
waveBounce: Le
|
|
67
67
|
};
|
|
68
|
-
function
|
|
69
|
-
switch (
|
|
68
|
+
function Re(e, n) {
|
|
69
|
+
switch (e) {
|
|
70
70
|
case "ripple":
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ u(k, { children: [
|
|
72
|
+
/* @__PURE__ */ t("div", { className: n.Ring1 }),
|
|
73
|
+
/* @__PURE__ */ t("div", { className: n.Ring2 }),
|
|
74
|
+
/* @__PURE__ */ t("div", { className: n.Ring3 })
|
|
75
75
|
] });
|
|
76
76
|
case "dots":
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ u(k, { children: [
|
|
78
|
+
/* @__PURE__ */ t("div", { className: n.Dot1 }),
|
|
79
|
+
/* @__PURE__ */ t("div", { className: n.Dot2 }),
|
|
80
|
+
/* @__PURE__ */ t("div", { className: n.Dot3 })
|
|
81
81
|
] });
|
|
82
82
|
case "wave":
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ u(k, { children: [
|
|
84
|
+
/* @__PURE__ */ t("div", { className: n.Wave1 }),
|
|
85
|
+
/* @__PURE__ */ t("div", { className: n.Wave2 }),
|
|
86
|
+
/* @__PURE__ */ t("div", { className: n.Wave3 }),
|
|
87
|
+
/* @__PURE__ */ t("div", { className: n.Wave4 }),
|
|
88
|
+
/* @__PURE__ */ t("div", { className: n.Wave5 })
|
|
89
89
|
] });
|
|
90
90
|
default:
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ u(k, { children: [
|
|
92
|
+
/* @__PURE__ */ t("div", { className: n.Arc1 }),
|
|
93
|
+
/* @__PURE__ */ t("div", { className: n.Arc2 }),
|
|
94
|
+
/* @__PURE__ */ t("div", { className: n.Arc3 })
|
|
95
95
|
] });
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
return /* @__PURE__ */
|
|
98
|
+
function Ne({ variant: e = "arcs", size: n = "md", color: r, className: s }) {
|
|
99
|
+
return /* @__PURE__ */ t(
|
|
100
100
|
"div",
|
|
101
101
|
{
|
|
102
|
-
className:
|
|
102
|
+
className: m(T.LoaderContainer, T[n], T[e], s),
|
|
103
103
|
role: "status",
|
|
104
104
|
"aria-label": "Loading",
|
|
105
105
|
style: r ? { "--chures-accent": r } : void 0,
|
|
106
|
-
children:
|
|
106
|
+
children: Re(e, T)
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
LoadingWrapperContainer:
|
|
112
|
-
SkeletonWrapper:
|
|
110
|
+
const Ie = "_LoadingWrapperContainer_1q0w7_1", Te = "_SkeletonWrapper_1q0w7_9", q = {
|
|
111
|
+
LoadingWrapperContainer: Ie,
|
|
112
|
+
SkeletonWrapper: Te
|
|
113
113
|
};
|
|
114
|
-
function
|
|
115
|
-
return
|
|
114
|
+
function An({ isLoading: e, children: n, skeleton: r, loaderProps: s, className: a }) {
|
|
115
|
+
return e ? r ? /* @__PURE__ */ t("div", { className: m(q.SkeletonWrapper, a), children: r }) : /* @__PURE__ */ t("div", { className: m(q.LoadingWrapperContainer, a), children: /* @__PURE__ */ t(Ne, { ...s }) }) : /* @__PURE__ */ t(k, { children: n });
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
function
|
|
119
|
-
const { botId: n, redirectUri: r, requestAccess: s = "write" } =
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
117
|
+
const De = "https://oauth.telegram.org/js/telegram-login.js?3";
|
|
118
|
+
function xe(e) {
|
|
119
|
+
const { botId: n, redirectUri: r, requestAccess: s = "write" } = e, a = D(e.onSuccess);
|
|
120
|
+
a.current = e.onSuccess;
|
|
121
|
+
const o = D(!1), [i, c] = S(!1), [f, l] = S(!1);
|
|
122
|
+
R(function() {
|
|
123
123
|
if (!n) return;
|
|
124
|
-
const
|
|
124
|
+
const g = r ?? window.location.origin;
|
|
125
125
|
l(!0), c(!1);
|
|
126
|
-
const
|
|
127
|
-
return
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
{ client_id: n, redirect_uri:
|
|
131
|
-
function(
|
|
132
|
-
|
|
126
|
+
const p = document.createElement("script");
|
|
127
|
+
return p.src = De, p.async = !0, p.onload = function() {
|
|
128
|
+
const y = window.Telegram;
|
|
129
|
+
y && (y.Login.init(
|
|
130
|
+
{ client_id: n, redirect_uri: g },
|
|
131
|
+
function(N) {
|
|
132
|
+
o.current || (o.current = !0, a.current(N));
|
|
133
133
|
}
|
|
134
134
|
), c(!0)), l(!1);
|
|
135
|
-
},
|
|
135
|
+
}, p.onerror = function() {
|
|
136
136
|
l(!1);
|
|
137
|
-
}, document.head.appendChild(
|
|
138
|
-
document.head.contains(
|
|
137
|
+
}, document.head.appendChild(p), function() {
|
|
138
|
+
document.head.contains(p) && document.head.removeChild(p), c(!1), l(!1);
|
|
139
139
|
};
|
|
140
140
|
}, [n, r]);
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
if (!
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
{ client_id: n, redirect_uri:
|
|
148
|
-
function(
|
|
149
|
-
|
|
141
|
+
function h() {
|
|
142
|
+
const g = window.Telegram;
|
|
143
|
+
if (!i || !g) return;
|
|
144
|
+
o.current = !1;
|
|
145
|
+
const p = r ?? window.location.origin;
|
|
146
|
+
g.Login.auth(
|
|
147
|
+
{ client_id: n, redirect_uri: p, request_access: s },
|
|
148
|
+
function(y) {
|
|
149
|
+
o.current || (o.current = !0, a.current(y));
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
return { login:
|
|
153
|
+
return { login: h, isReady: i, isLoading: f };
|
|
154
154
|
}
|
|
155
|
-
const
|
|
156
|
-
TelegramSignInButtonContainer:
|
|
157
|
-
FullSize:
|
|
158
|
-
Icon:
|
|
159
|
-
},
|
|
155
|
+
const be = "_TelegramSignInButtonContainer_10wun_1", We = "_FullSize_10wun_46", je = "_Icon_10wun_50", E = {
|
|
156
|
+
TelegramSignInButtonContainer: be,
|
|
157
|
+
FullSize: We,
|
|
158
|
+
Icon: je
|
|
159
|
+
}, Be = {
|
|
160
160
|
en: "Continue with Telegram",
|
|
161
161
|
ru: "Войти через Telegram"
|
|
162
162
|
};
|
|
163
|
-
function
|
|
164
|
-
return /* @__PURE__ */
|
|
163
|
+
function Ee() {
|
|
164
|
+
return /* @__PURE__ */ t(
|
|
165
165
|
"svg",
|
|
166
166
|
{
|
|
167
167
|
viewBox: "0 0 24 24",
|
|
@@ -169,47 +169,47 @@ function fe() {
|
|
|
169
169
|
height: "20",
|
|
170
170
|
fill: "currentColor",
|
|
171
171
|
"aria-hidden": "true",
|
|
172
|
-
className:
|
|
173
|
-
children: /* @__PURE__ */
|
|
172
|
+
className: E.Icon,
|
|
173
|
+
children: /* @__PURE__ */ t("path", { d: "M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z" })
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
onClick:
|
|
177
|
+
function Ae({
|
|
178
|
+
onClick: e,
|
|
179
179
|
disabled: n,
|
|
180
180
|
lang: r = "en",
|
|
181
181
|
title: s,
|
|
182
|
-
label:
|
|
183
|
-
fullSize:
|
|
184
|
-
className:
|
|
182
|
+
label: a,
|
|
183
|
+
fullSize: o,
|
|
184
|
+
className: i
|
|
185
185
|
}) {
|
|
186
|
-
|
|
186
|
+
R(function() {
|
|
187
187
|
const l = "comfortaa-font";
|
|
188
188
|
if (document.getElementById(l)) return;
|
|
189
|
-
const
|
|
190
|
-
|
|
189
|
+
const h = document.createElement("link");
|
|
190
|
+
h.id = l, h.rel = "stylesheet", h.href = "https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap", document.head.appendChild(h);
|
|
191
191
|
}, []);
|
|
192
|
-
const c =
|
|
193
|
-
return /* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
192
|
+
const c = a ?? s ?? Be[r], f = [E.TelegramSignInButtonContainer, o && E.FullSize, i].filter(Boolean).join(" ");
|
|
193
|
+
return /* @__PURE__ */ u("button", { type: "button", className: f, onClick: e, disabled: n, children: [
|
|
194
|
+
/* @__PURE__ */ t(Ee, {}),
|
|
195
195
|
c
|
|
196
196
|
] });
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
botId:
|
|
198
|
+
function On({
|
|
199
|
+
botId: e,
|
|
200
200
|
onSuccess: n,
|
|
201
201
|
lang: r,
|
|
202
202
|
title: s,
|
|
203
|
-
redirectUri:
|
|
204
|
-
requestAccess:
|
|
205
|
-
children:
|
|
203
|
+
redirectUri: a,
|
|
204
|
+
requestAccess: o,
|
|
205
|
+
children: i,
|
|
206
206
|
className: c
|
|
207
207
|
}) {
|
|
208
|
-
const { login:
|
|
209
|
-
return
|
|
210
|
-
|
|
208
|
+
const { login: f, isReady: l } = xe({ botId: e, onSuccess: n, redirectUri: a, requestAccess: o });
|
|
209
|
+
return i ? /* @__PURE__ */ t(k, { children: i({ login: f, isReady: l }) }) : /* @__PURE__ */ t(
|
|
210
|
+
Ae,
|
|
211
211
|
{
|
|
212
|
-
onClick:
|
|
212
|
+
onClick: f,
|
|
213
213
|
disabled: !l,
|
|
214
214
|
lang: r,
|
|
215
215
|
title: s,
|
|
@@ -217,138 +217,321 @@ function Ke({
|
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
let
|
|
221
|
-
const
|
|
220
|
+
let Oe = 0;
|
|
221
|
+
const P = Z((e, n) => ({
|
|
222
222
|
toasts: [],
|
|
223
223
|
bake: (r) => {
|
|
224
|
-
const s =
|
|
225
|
-
|
|
224
|
+
const s = Oe++;
|
|
225
|
+
e((a) => ({ toasts: [...a.toasts, { ...r, id: s }] })), setTimeout(() => {
|
|
226
226
|
n().dismiss(s);
|
|
227
227
|
}, 5e3);
|
|
228
228
|
},
|
|
229
229
|
dismiss: (r) => {
|
|
230
|
-
|
|
231
|
-
toasts: s.toasts.filter((
|
|
230
|
+
e((s) => ({
|
|
231
|
+
toasts: s.toasts.filter((a) => a.id !== r)
|
|
232
232
|
}));
|
|
233
233
|
}
|
|
234
|
-
})),
|
|
235
|
-
ToastContainer:
|
|
236
|
-
Toast:
|
|
237
|
-
error:
|
|
238
|
-
warn:
|
|
239
|
-
info:
|
|
240
|
-
Description:
|
|
241
|
-
DismissButton:
|
|
242
|
-
slideIn:
|
|
243
|
-
slideOut:
|
|
234
|
+
})), Fe = "_ToastContainer_1tme2_1", Me = "_Toast_1tme2_1", $e = "_error_1tme2_33", qe = "_warn_1tme2_41", Pe = "_info_1tme2_49", ze = "_Description_1tme2_53", He = "_DismissButton_1tme2_59", Ke = "_slideIn_1tme2_79", Qe = "_slideOut_1tme2_83", w = {
|
|
235
|
+
ToastContainer: Fe,
|
|
236
|
+
Toast: Me,
|
|
237
|
+
error: $e,
|
|
238
|
+
warn: qe,
|
|
239
|
+
info: Pe,
|
|
240
|
+
Description: ze,
|
|
241
|
+
DismissButton: He,
|
|
242
|
+
slideIn: Ke,
|
|
243
|
+
slideOut: Qe
|
|
244
244
|
};
|
|
245
|
-
function
|
|
246
|
-
const { toasts:
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
|
|
245
|
+
function Fn() {
|
|
246
|
+
const { toasts: e } = P();
|
|
247
|
+
return /* @__PURE__ */ t("div", { className: w.ToastContainer, children: /* @__PURE__ */ t(X, { children: e.map((n) => /* @__PURE__ */ t(
|
|
248
|
+
Y.div,
|
|
249
249
|
{
|
|
250
250
|
layout: !0,
|
|
251
251
|
initial: { opacity: 0, x: 100, y: 50 },
|
|
252
252
|
animate: { opacity: 1, x: 0, y: 0 },
|
|
253
253
|
exit: { opacity: 0, y: -50 },
|
|
254
254
|
transition: { type: "spring", stiffness: 300, damping: 20 },
|
|
255
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ t(Ue, { ...n })
|
|
256
256
|
},
|
|
257
257
|
n.id
|
|
258
258
|
)) }) });
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
const [
|
|
262
|
-
return
|
|
263
|
-
|
|
264
|
-
}, []), /* @__PURE__ */
|
|
260
|
+
function Ue({ id: e, title: n, description: r, level: s, isDismissable: a }) {
|
|
261
|
+
const [o, i] = S(!1), c = P();
|
|
262
|
+
return R(() => () => {
|
|
263
|
+
i(!0);
|
|
264
|
+
}, []), /* @__PURE__ */ u(
|
|
265
265
|
"div",
|
|
266
266
|
{
|
|
267
|
-
className:
|
|
268
|
-
[
|
|
269
|
-
[
|
|
270
|
-
[
|
|
271
|
-
[
|
|
272
|
-
[
|
|
267
|
+
className: m(w.Toast, {
|
|
268
|
+
[w.error]: s === "Error",
|
|
269
|
+
[w.warn]: s === "Warn",
|
|
270
|
+
[w.info]: s == null || s === "Info",
|
|
271
|
+
[w.slideIn]: !o,
|
|
272
|
+
[w.slideOut]: o
|
|
273
273
|
}),
|
|
274
274
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
|
|
275
|
+
/* @__PURE__ */ t("div", { children: n }),
|
|
276
|
+
/* @__PURE__ */ t("div", { className: w.Description, children: r }),
|
|
277
|
+
a && e !== void 0 && /* @__PURE__ */ t("div", { className: w.DismissButton, onClick: () => c.dismiss(e), children: "×" })
|
|
278
278
|
]
|
|
279
279
|
}
|
|
280
280
|
);
|
|
281
281
|
}
|
|
282
|
-
const
|
|
283
|
-
InputContainer:
|
|
284
|
-
InputField:
|
|
285
|
-
hasError:
|
|
286
|
-
disabled:
|
|
287
|
-
Label:
|
|
288
|
-
lifted:
|
|
289
|
-
ErrorText:
|
|
290
|
-
Skeleton:
|
|
282
|
+
const Ge = "_InputContainer_1a08x_6", Ve = "_InputField_1a08x_12", Je = "_hasError_1a08x_30", Xe = "_disabled_1a08x_35", Ye = "_Label_1a08x_40", Ze = "_lifted_1a08x_54", en = "_ErrorText_1a08x_65", nn = "_Skeleton_1a08x_73", C = {
|
|
283
|
+
InputContainer: Ge,
|
|
284
|
+
InputField: Ve,
|
|
285
|
+
hasError: Je,
|
|
286
|
+
disabled: Xe,
|
|
287
|
+
Label: Ye,
|
|
288
|
+
lifted: Ze,
|
|
289
|
+
ErrorText: en,
|
|
290
|
+
Skeleton: nn
|
|
291
291
|
};
|
|
292
|
-
function
|
|
293
|
-
const [
|
|
294
|
-
return s ? /* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
292
|
+
function Mn({ value: e, setValue: n, label: r, isLoader: s, type: a = "text", disabled: o, error: i, className: c }) {
|
|
293
|
+
const [f, l] = S(!1), h = f || e.length > 0;
|
|
294
|
+
return s ? /* @__PURE__ */ t("div", { className: m(C.Skeleton, c), "aria-hidden": "true" }) : /* @__PURE__ */ u("div", { className: m(C.InputContainer, { [C.hasError]: !!i, [C.disabled]: o }, c), children: [
|
|
295
|
+
/* @__PURE__ */ t(
|
|
296
296
|
"input",
|
|
297
297
|
{
|
|
298
|
-
className:
|
|
299
|
-
type:
|
|
300
|
-
value:
|
|
301
|
-
onChange: (
|
|
298
|
+
className: C.InputField,
|
|
299
|
+
type: a,
|
|
300
|
+
value: e,
|
|
301
|
+
onChange: (g) => n(g.target.value),
|
|
302
302
|
onFocus: () => l(!0),
|
|
303
303
|
onBlur: () => l(!1),
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: o
|
|
305
305
|
}
|
|
306
306
|
),
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
|
|
307
|
+
/* @__PURE__ */ t("label", { className: m(C.Label, { [C.lifted]: h }), children: r }),
|
|
308
|
+
i && /* @__PURE__ */ t("span", { className: C.ErrorText, children: i })
|
|
309
309
|
] });
|
|
310
310
|
}
|
|
311
|
-
const
|
|
312
|
-
ToggleContainer:
|
|
313
|
-
disabled:
|
|
314
|
-
Track:
|
|
315
|
-
on:
|
|
316
|
-
Thumb:
|
|
317
|
-
Label:
|
|
318
|
-
LabelSkeleton:
|
|
319
|
-
Skeleton:
|
|
311
|
+
const tn = "_ToggleContainer_1jetc_6", on = "_disabled_1jetc_13", rn = "_Track_1jetc_18", sn = "_on_1jetc_31", an = "_Thumb_1jetc_39", cn = "_Label_1jetc_57", ln = "_LabelSkeleton_1jetc_63", un = "_Skeleton_1jetc_78", v = {
|
|
312
|
+
ToggleContainer: tn,
|
|
313
|
+
disabled: on,
|
|
314
|
+
Track: rn,
|
|
315
|
+
on: sn,
|
|
316
|
+
Thumb: an,
|
|
317
|
+
Label: cn,
|
|
318
|
+
LabelSkeleton: ln,
|
|
319
|
+
Skeleton: un
|
|
320
320
|
};
|
|
321
|
-
function
|
|
322
|
-
const
|
|
323
|
-
return
|
|
321
|
+
function $n({ checked: e, onChange: n, label: r, labelPosition: s = "right", disabled: a, isLoader: o, isLoadingLabel: i, className: c }) {
|
|
322
|
+
const f = !!r || i, l = i ? /* @__PURE__ */ t("span", { className: v.LabelSkeleton, "aria-hidden": "true" }) : r ? /* @__PURE__ */ t("span", { className: v.Label, children: r }) : null;
|
|
323
|
+
return o ? f ? /* @__PURE__ */ u("div", { className: m(v.ToggleContainer, c), children: [
|
|
324
324
|
s === "left" && l,
|
|
325
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ t("div", { className: v.Skeleton, "aria-hidden": "true" }),
|
|
326
326
|
s === "right" && l
|
|
327
|
-
] }) : /* @__PURE__ */
|
|
327
|
+
] }) : /* @__PURE__ */ t("div", { className: m(v.Skeleton, c), "aria-hidden": "true" }) : /* @__PURE__ */ u("label", { className: m(v.ToggleContainer, { [v.disabled]: a }, c), children: [
|
|
328
328
|
s === "left" && l,
|
|
329
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ t(
|
|
330
330
|
"button",
|
|
331
331
|
{
|
|
332
332
|
role: "switch",
|
|
333
|
-
"aria-checked":
|
|
334
|
-
className:
|
|
335
|
-
onClick: () => !
|
|
336
|
-
disabled:
|
|
333
|
+
"aria-checked": e,
|
|
334
|
+
className: m(v.Track, { [v.on]: e }),
|
|
335
|
+
onClick: () => !a && n(!e),
|
|
336
|
+
disabled: a,
|
|
337
337
|
type: "button",
|
|
338
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ t("span", { className: v.Thumb })
|
|
339
339
|
}
|
|
340
340
|
),
|
|
341
341
|
s === "right" && l
|
|
342
342
|
] });
|
|
343
343
|
}
|
|
344
|
+
function dn(e, n, r) {
|
|
345
|
+
R(() => {
|
|
346
|
+
function s(o) {
|
|
347
|
+
const i = o.target;
|
|
348
|
+
e.current?.contains(i) || r?.current?.contains(i) || n();
|
|
349
|
+
}
|
|
350
|
+
function a(o) {
|
|
351
|
+
o.key === "Escape" && n();
|
|
352
|
+
}
|
|
353
|
+
return document.addEventListener("mousedown", s, !0), document.addEventListener("keydown", a), () => {
|
|
354
|
+
document.removeEventListener("mousedown", s, !0), document.removeEventListener("keydown", a);
|
|
355
|
+
};
|
|
356
|
+
}, [n, e, r]);
|
|
357
|
+
}
|
|
358
|
+
function _n(e, n) {
|
|
359
|
+
const [r, s] = S([]);
|
|
360
|
+
return R(() => {
|
|
361
|
+
if (!n) return;
|
|
362
|
+
let a = !1;
|
|
363
|
+
return n(e).then((o) => {
|
|
364
|
+
a || s(o);
|
|
365
|
+
}), () => {
|
|
366
|
+
a = !0;
|
|
367
|
+
};
|
|
368
|
+
}, [e, n]), r;
|
|
369
|
+
}
|
|
370
|
+
function B(e) {
|
|
371
|
+
return typeof e == "string" ? e : e.id;
|
|
372
|
+
}
|
|
373
|
+
function z(e) {
|
|
374
|
+
return typeof e == "string" ? e : e.name;
|
|
375
|
+
}
|
|
376
|
+
const mn = "_DropdownContainer_v5jkm_13", fn = "_SearchRow_v5jkm_27", pn = "_SearchBox_v5jkm_32", hn = "_SearchIcon_v5jkm_42", vn = "_SearchInput_v5jkm_49", wn = "_ResultsList_v5jkm_63", gn = "_OptionRow_v5jkm_68", Cn = "_Selected_v5jkm_83", kn = "_Checkmark_v5jkm_88", Sn = "_CreateRow_v5jkm_94", yn = "_WithBorder_v5jkm_107", Ln = "_CreateIcon_v5jkm_112", Rn = "_CreateLabel_v5jkm_124", Nn = "_EmptyHint_v5jkm_130", In = "_SkeletonRow_v5jkm_137", d = {
|
|
377
|
+
DropdownContainer: mn,
|
|
378
|
+
SearchRow: fn,
|
|
379
|
+
SearchBox: pn,
|
|
380
|
+
SearchIcon: hn,
|
|
381
|
+
SearchInput: vn,
|
|
382
|
+
ResultsList: wn,
|
|
383
|
+
OptionRow: gn,
|
|
384
|
+
Selected: Cn,
|
|
385
|
+
Checkmark: kn,
|
|
386
|
+
CreateRow: Sn,
|
|
387
|
+
WithBorder: yn,
|
|
388
|
+
CreateIcon: Ln,
|
|
389
|
+
CreateLabel: Rn,
|
|
390
|
+
EmptyHint: Nn,
|
|
391
|
+
SkeletonRow: In
|
|
392
|
+
};
|
|
393
|
+
function Tn({ query: e, withBorder: n, onCreate: r }) {
|
|
394
|
+
function s(a) {
|
|
395
|
+
a.preventDefault(), r();
|
|
396
|
+
}
|
|
397
|
+
return /* @__PURE__ */ u(
|
|
398
|
+
"div",
|
|
399
|
+
{
|
|
400
|
+
className: m(d.CreateRow, n && d.WithBorder),
|
|
401
|
+
onMouseDown: s,
|
|
402
|
+
children: [
|
|
403
|
+
/* @__PURE__ */ t("span", { className: d.CreateIcon, children: /* @__PURE__ */ u("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", children: [
|
|
404
|
+
/* @__PURE__ */ t("line", { x1: "5", y1: "1", x2: "5", y2: "9" }),
|
|
405
|
+
/* @__PURE__ */ t("line", { x1: "1", y1: "5", x2: "9", y2: "5" })
|
|
406
|
+
] }) }),
|
|
407
|
+
/* @__PURE__ */ u("span", { className: d.CreateLabel, children: [
|
|
408
|
+
"create “",
|
|
409
|
+
e,
|
|
410
|
+
"”"
|
|
411
|
+
] })
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
function Dn({ opt: e, isSelected: n, multiSelect: r, onPick: s }) {
|
|
417
|
+
function a(o) {
|
|
418
|
+
o.preventDefault(), s(e);
|
|
419
|
+
}
|
|
420
|
+
return /* @__PURE__ */ u(
|
|
421
|
+
"div",
|
|
422
|
+
{
|
|
423
|
+
className: m(d.OptionRow, n && d.Selected),
|
|
424
|
+
onMouseDown: a,
|
|
425
|
+
children: [
|
|
426
|
+
r && n && /* @__PURE__ */ t("span", { className: d.Checkmark, children: "✓" }),
|
|
427
|
+
z(e)
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
function xn({ inputRef: e, query: n, onChange: r, onKeyDown: s, placeholder: a }) {
|
|
433
|
+
return /* @__PURE__ */ t("div", { className: d.SearchRow, children: /* @__PURE__ */ u("div", { className: d.SearchBox, children: [
|
|
434
|
+
/* @__PURE__ */ t("span", { className: d.SearchIcon, children: /* @__PURE__ */ u("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", children: [
|
|
435
|
+
/* @__PURE__ */ t("circle", { cx: "5", cy: "5", r: "3.5" }),
|
|
436
|
+
/* @__PURE__ */ t("line", { x1: "8", y1: "8", x2: "11", y2: "11" })
|
|
437
|
+
] }) }),
|
|
438
|
+
/* @__PURE__ */ t(
|
|
439
|
+
"input",
|
|
440
|
+
{
|
|
441
|
+
ref: e,
|
|
442
|
+
className: d.SearchInput,
|
|
443
|
+
value: n,
|
|
444
|
+
onChange: r,
|
|
445
|
+
onKeyDown: s,
|
|
446
|
+
placeholder: a
|
|
447
|
+
}
|
|
448
|
+
)
|
|
449
|
+
] }) });
|
|
450
|
+
}
|
|
451
|
+
function bn({ count: e }) {
|
|
452
|
+
return /* @__PURE__ */ t(k, { children: Array.from({ length: e }).map((n, r) => /* @__PURE__ */ t("div", { className: d.SkeletonRow }, r)) });
|
|
453
|
+
}
|
|
454
|
+
function qn({
|
|
455
|
+
onSearch: e,
|
|
456
|
+
onCreate: n,
|
|
457
|
+
onPick: r,
|
|
458
|
+
onClose: s,
|
|
459
|
+
anchorRef: a,
|
|
460
|
+
placeholder: o,
|
|
461
|
+
options: i = [],
|
|
462
|
+
excluded: c = [],
|
|
463
|
+
selected: f = [],
|
|
464
|
+
multiSelect: l = !1,
|
|
465
|
+
isLoading: h = !1,
|
|
466
|
+
emptyHint: g = "no results found",
|
|
467
|
+
skeletonRowCount: p = 4,
|
|
468
|
+
onError: y = console.error
|
|
469
|
+
}) {
|
|
470
|
+
const [N, H] = S(""), [K, A] = S(!1), O = D(null), F = D(null), x = !!e, Q = _n(N, e);
|
|
471
|
+
dn(F, s, a), R(() => {
|
|
472
|
+
x && O.current?.focus();
|
|
473
|
+
}, [x]);
|
|
474
|
+
const L = (e ? Q : i).filter(
|
|
475
|
+
(_) => !c.includes(B(_))
|
|
476
|
+
), I = N.trim(), U = L.some(
|
|
477
|
+
(_) => z(_).toLowerCase() === I.toLowerCase()
|
|
478
|
+
), b = !!n && I.length > 0 && !U;
|
|
479
|
+
async function M() {
|
|
480
|
+
!I || K || !n || (A(!0), n(I).then(W).catch(y).finally(() => A(!1)));
|
|
481
|
+
}
|
|
482
|
+
function W(_) {
|
|
483
|
+
r(_), l || s();
|
|
484
|
+
}
|
|
485
|
+
function G(_) {
|
|
486
|
+
H(_.target.value);
|
|
487
|
+
}
|
|
488
|
+
function V(_) {
|
|
489
|
+
_.key === "Enter" && (_.preventDefault(), L.length > 0 ? W(L[0]) : b && M());
|
|
490
|
+
}
|
|
491
|
+
const J = o ?? (n ? "search or add new…" : "search…");
|
|
492
|
+
return /* @__PURE__ */ u("div", { ref: F, className: d.DropdownContainer, children: [
|
|
493
|
+
x && /* @__PURE__ */ t(
|
|
494
|
+
xn,
|
|
495
|
+
{
|
|
496
|
+
inputRef: O,
|
|
497
|
+
query: N,
|
|
498
|
+
onChange: G,
|
|
499
|
+
onKeyDown: V,
|
|
500
|
+
placeholder: J
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ t("div", { className: d.ResultsList, children: h ? /* @__PURE__ */ t(bn, { count: p }) : /* @__PURE__ */ u(k, { children: [
|
|
504
|
+
L.map((_) => /* @__PURE__ */ t(
|
|
505
|
+
Dn,
|
|
506
|
+
{
|
|
507
|
+
opt: _,
|
|
508
|
+
isSelected: f.includes(B(_)),
|
|
509
|
+
multiSelect: l,
|
|
510
|
+
onPick: W
|
|
511
|
+
},
|
|
512
|
+
B(_)
|
|
513
|
+
)),
|
|
514
|
+
b && /* @__PURE__ */ t(
|
|
515
|
+
Tn,
|
|
516
|
+
{
|
|
517
|
+
query: I,
|
|
518
|
+
withBorder: L.length > 0,
|
|
519
|
+
onCreate: M
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
L.length === 0 && !b && /* @__PURE__ */ t("div", { className: d.EmptyHint, children: g })
|
|
523
|
+
] }) })
|
|
524
|
+
] });
|
|
525
|
+
}
|
|
344
526
|
export {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
527
|
+
qn as Dropdown,
|
|
528
|
+
Mn as Input,
|
|
529
|
+
Ne as Loader,
|
|
530
|
+
An as LoadingWrapper,
|
|
531
|
+
On as TelegramAuth,
|
|
532
|
+
Ae as TelegramSignInButton,
|
|
533
|
+
Fn as Toaster,
|
|
534
|
+
$n as Toggle,
|
|
535
|
+
xe as useTelegramLogin,
|
|
536
|
+
P as useToaster
|
|
354
537
|
};
|
package/dist/chures.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--chures-accent: #229ED9;--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem;--chures-input-bg: #111111;--chures-input-height: 3rem;--chures-input-radius: .75rem;--chures-skeleton-shine: #1e1e1e;--chures-toggle-width: 2.75rem;--chures-toggle-height: 1.5rem;--chures-toggle-thumb: 1.125rem;--chures-toggle-bg-off: rgb(255 255 255 / 13%);--chures-toggle-bg-on: var(--chures-accent);--chures-toggle-thumb-color: #ffffff;--chures-toggle-label-skeleton-w: 5rem}@keyframes _spin_wa8op_1{to{transform:rotate(360deg)}}@keyframes _ripple_wa8op_1{0%{transform:scale(.08);opacity:.9}to{transform:scale(1);opacity:0}}@keyframes _dotPulse_wa8op_1{0%,to{transform:translate(-50%,-50%) scale(.55);opacity:.3}50%{transform:translate(-50%,calc(-50% - var(--sz) * .1)) scale(1);opacity:1}}@keyframes _waveBounce_wa8op_1{0%,55%,to{transform:translate(-50%,-50%) scale(.8);opacity:.4}27%{transform:translate(-50%,calc(-50% - var(--sz) * .28)) scale(1);opacity:1}}._LoaderContainer_wa8op_24{position:relative;flex-shrink:0}._sm_wa8op_31{width:1.5rem;height:1.5rem;--sz: 1.5rem;--arc-gap: .2rem;--arc-bw: .125rem}._md_wa8op_32{width:2.5rem;height:2.5rem;--sz: 2.5rem;--arc-gap: .35rem;--arc-bw: .1875rem}._lg_wa8op_33{width:4rem;height:4rem;--sz: 4rem;--arc-gap: .55rem;--arc-bw: .25rem}._Arc1_wa8op_37,._Arc2_wa8op_38,._Arc3_wa8op_39{position:absolute;border-radius:50%;border:var(--arc-bw) solid transparent}._Arc1_wa8op_37{inset:0;border-top-color:var(--chures-accent, #229ED9);border-left-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.2s linear infinite;filter:drop-shadow(0 0 .25rem var(--chures-accent, #229ED9))}._Arc2_wa8op_38{inset:var(--arc-gap);border-bottom-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.8s linear infinite reverse;opacity:.8}._Arc3_wa8op_39{inset:calc(var(--arc-gap) * 2);border-top-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 2.4s linear infinite;opacity:.6}._Ring1_wa8op_71,._Ring2_wa8op_72,._Ring3_wa8op_73{position:absolute;inset:0;border-radius:50%;border:var(--arc-bw) solid var(--chures-accent, #229ED9);animation:_ripple_wa8op_1 1.8s ease-out infinite both}._Ring2_wa8op_72{animation-delay:.6s}._Ring3_wa8op_73{animation-delay:1.2s}._Dot1_wa8op_86,._Dot2_wa8op_87,._Dot3_wa8op_88{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .2);height:calc(var(--sz) * .2);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .14) var(--chures-accent, #229ED9);animation:_dotPulse_wa8op_1 1.1s ease-in-out infinite both}._Dot1_wa8op_86{left:22%}._Dot2_wa8op_87{left:50%;animation-delay:.18s}._Dot3_wa8op_88{left:78%;animation-delay:.36s}._Wave1_wa8op_105,._Wave2_wa8op_106,._Wave3_wa8op_107,._Wave4_wa8op_108,._Wave5_wa8op_109{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .16);height:calc(var(--sz) * .16);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .1) var(--chures-accent, #229ED9);animation:_waveBounce_wa8op_1 1s ease-in-out infinite both}._Wave1_wa8op_105{left:10%}._Wave2_wa8op_106{left:28%;animation-delay:.12s}._Wave3_wa8op_107{left:46%;animation-delay:.24s}._Wave4_wa8op_108{left:64%;animation-delay:.36s}._Wave5_wa8op_109{left:82%;animation-delay:.48s}._LoadingWrapperContainer_1q0w7_1{display:flex;align-items:center;justify-content:center;width:100%;min-height:4rem}._SkeletonWrapper_1q0w7_9{width:100%}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}@keyframes _shimmer_1a08x_1{0%{background-position:-200% 0}to{background-position:200% 0}}._InputContainer_1a08x_6{position:relative;width:100%;height:var(--chures-input-height, 3rem)}._InputField_1a08x_12{width:100%;height:100%;background:var(--chures-input-bg, #111111);border:.0625rem solid rgb(255 255 255 / 13%);border-radius:var(--chures-input-radius, .75rem);color:var(--chures-fg, #ffffff);font-size:var(--chures-font-sm, .875rem);padding:0 .875rem;outline:none;transition:border-color .18s ease;box-sizing:border-box}._InputField_1a08x_12:focus{border-color:#ffffff59}._hasError_1a08x_30 ._InputField_1a08x_12,._hasError_1a08x_30 ._InputField_1a08x_12:focus{border-color:var(--chures-error, #ef4444)}._disabled_1a08x_35 ._InputField_1a08x_12{opacity:.45;cursor:not-allowed}._Label_1a08x_40{position:absolute;left:.875rem;top:50%;transform:translateY(-50%);transform-origin:left center;color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-sm, .875rem);pointer-events:none;transition:all .18s ease;padding:0 .25rem;border-radius:.1875rem}._Label_1a08x_40._lifted_1a08x_54{top:0;transform:translateY(-50%) scale(.82);background:var(--chures-input-bg, #111111);color:var(--chures-fg-muted, #9ca3af)}._hasError_1a08x_30 ._Label_1a08x_40._lifted_1a08x_54{color:var(--chures-error, #ef4444)}._ErrorText_1a08x_65{display:block;margin-top:.25rem;padding-left:.875rem;font-size:var(--chures-font-xs, .75rem);color:var(--chures-error, #ef4444)}._Skeleton_1a08x_73{width:100%;height:var(--chures-input-height, 3rem);border-radius:var(--chures-input-radius, .75rem);background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1a08x_1 1.5s ease-in-out infinite}@keyframes _shimmer_im4lz_1{0%{background-position:-200% 0}to{background-position:200% 0}}._ToggleContainer_im4lz_6{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}._disabled_im4lz_13{opacity:.45;cursor:not-allowed}._Track_im4lz_18{position:relative;width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:var(--chures-toggle-bg-off, rgb(255 255 255 / 13%));border:none;padding:0;cursor:pointer;transition:background .2s ease;flex-shrink:0}._Track_im4lz_18._on_im4lz_31{background:var(--chures-toggle-bg-on, var(--chures-accent, #229ED9))}._disabled_im4lz_13 ._Track_im4lz_18{cursor:not-allowed}._Thumb_im4lz_39{position:absolute;top:50%;left:.1875rem;transform:translateY(-50%);width:var(--chures-toggle-thumb, 1.125rem);height:var(--chures-toggle-thumb, 1.125rem);border-radius:50%;background:var(--chures-toggle-thumb-color, #ffffff);transition:left .2s ease;pointer-events:none}._Track_im4lz_18._on_im4lz_31 ._Thumb_im4lz_39{left:calc(var(--chures-toggle-width, 2.75rem) - var(--chures-toggle-thumb, 1.125rem) - .1875rem)}._Label_im4lz_56{font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff);-webkit-user-select:none;user-select:none}._LabelSkeleton_im4lz_62{display:inline-block;width:var(--chures-toggle-label-skeleton-w, 5rem);height:var(--chures-font-sm, .875rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}._Skeleton_im4lz_77{width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
(function(l,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("framer-motion"),require("zustand")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","framer-motion","zustand"],e):(l=typeof globalThis<"u"?globalThis:l||self,e(l.Chures={},l.ReactJSXRuntime,l.React,l.FramerMotion,l.Zustand))})(this,(function(l,e,f,W,A){"use strict";function E(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var C={exports:{}};var b;function B(){return b||(b=1,(function(o){(function(){var n={}.hasOwnProperty;function r(){for(var t="",s=0;s<arguments.length;s++){var c=arguments[s];c&&(t=i(t,a(c)))}return t}function a(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return r.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var s="";for(var c in t)n.call(t,c)&&t[c]&&(s=i(s,c));return s}function i(t,s){return s?t?t+" "+s:t+s:t}o.exports?(r.default=r,o.exports=r):window.classNames=r})()})(C)),C.exports}var F=B();const _=E(F),w={LoaderContainer:"_LoaderContainer_wa8op_24",sm:"_sm_wa8op_31",md:"_md_wa8op_32",lg:"_lg_wa8op_33",Arc1:"_Arc1_wa8op_37",Arc2:"_Arc2_wa8op_38",Arc3:"_Arc3_wa8op_39",spin:"_spin_wa8op_1",Ring1:"_Ring1_wa8op_71",Ring2:"_Ring2_wa8op_72",Ring3:"_Ring3_wa8op_73",ripple:"_ripple_wa8op_1",Dot1:"_Dot1_wa8op_86",Dot2:"_Dot2_wa8op_87",Dot3:"_Dot3_wa8op_88",dotPulse:"_dotPulse_wa8op_1",Wave1:"_Wave1_wa8op_105",Wave2:"_Wave2_wa8op_106",Wave3:"_Wave3_wa8op_107",Wave4:"_Wave4_wa8op_108",Wave5:"_Wave5_wa8op_109",waveBounce:"_waveBounce_wa8op_1"};function z(o,n){switch(o){case"ripple":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Ring1}),e.jsx("div",{className:n.Ring2}),e.jsx("div",{className:n.Ring3})]});case"dots":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Dot1}),e.jsx("div",{className:n.Dot2}),e.jsx("div",{className:n.Dot3})]});case"wave":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Wave1}),e.jsx("div",{className:n.Wave2}),e.jsx("div",{className:n.Wave3}),e.jsx("div",{className:n.Wave4}),e.jsx("div",{className:n.Wave5})]});default:return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Arc1}),e.jsx("div",{className:n.Arc2}),e.jsx("div",{className:n.Arc3})]})}}function y({variant:o="arcs",size:n="md",color:r,className:a}){return e.jsx("div",{className:_(w.LoaderContainer,w[n],w[o],a),role:"status","aria-label":"Loading",style:r?{"--chures-accent":r}:void 0,children:z(o,w)})}const N={LoadingWrapperContainer:"_LoadingWrapperContainer_1q0w7_1",SkeletonWrapper:"_SkeletonWrapper_1q0w7_9"};function x({isLoading:o,children:n,skeleton:r,loaderProps:a,className:i}){return o?r?e.jsx("div",{className:_(N.SkeletonWrapper,i),children:r}):e.jsx("div",{className:_(N.LoadingWrapperContainer,i),children:e.jsx(y,{...a})}):e.jsx(e.Fragment,{children:n})}const O="https://oauth.telegram.org/js/telegram-login.js?3";function k(o){const{botId:n,redirectUri:r,requestAccess:a="write"}=o,i=f.useRef(o.onSuccess);i.current=o.onSuccess;const t=f.useRef(!1),[s,c]=f.useState(!1),[p,d]=f.useState(!1);f.useEffect(function(){if(!n)return;const T=r??window.location.origin;d(!0),c(!1);const m=document.createElement("script");return m.src=O,m.async=!0,m.onload=function(){const S=window.Telegram;S&&(S.Login.init({client_id:n,redirect_uri:T},function(V){t.current||(t.current=!0,i.current(V))}),c(!0)),d(!1)},m.onerror=function(){d(!1)},document.head.appendChild(m),function(){document.head.contains(m)&&document.head.removeChild(m),c(!1),d(!1)}},[n,r]);function v(){const T=window.Telegram;if(!s||!T)return;t.current=!1;const m=r??window.location.origin;T.Login.auth({client_id:n,redirect_uri:m,request_access:a},function(S){t.current||(t.current=!0,i.current(S))})}return{login:v,isReady:s,isLoading:p}}const L={TelegramSignInButtonContainer:"_TelegramSignInButtonContainer_10wun_1",FullSize:"_FullSize_10wun_46",Icon:"_Icon_10wun_50"},$={en:"Continue with Telegram",ru:"Войти через Telegram"};function q(){return e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",className:L.Icon,children:e.jsx("path",{d:"M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z"})})}function D({onClick:o,disabled:n,lang:r="en",title:a,label:i,fullSize:t,className:s}){f.useEffect(function(){const d="comfortaa-font";if(document.getElementById(d))return;const v=document.createElement("link");v.id=d,v.rel="stylesheet",v.href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap",document.head.appendChild(v)},[]);const c=i??a??$[r],p=[L.TelegramSignInButtonContainer,t&&L.FullSize,s].filter(Boolean).join(" ");return e.jsxs("button",{type:"button",className:p,onClick:o,disabled:n,children:[e.jsx(q,{}),c]})}function j({botId:o,onSuccess:n,lang:r,title:a,redirectUri:i,requestAccess:t,children:s,className:c}){const{login:p,isReady:d}=k({botId:o,onSuccess:n,redirectUri:i,requestAccess:t});return s?e.jsx(e.Fragment,{children:s({login:p,isReady:d})}):e.jsx(D,{onClick:p,disabled:!d,lang:r,title:a,className:c})}let P=0;const I=A.create((o,n)=>({toasts:[],bake:r=>{const a=P++;o(i=>({toasts:[...i.toasts,{...r,id:a}]})),setTimeout(()=>{n().dismiss(a)},5e3)},dismiss:r=>{o(a=>({toasts:a.toasts.filter(i=>i.id!==r)}))}})),g={ToastContainer:"_ToastContainer_1tme2_1",Toast:"_Toast_1tme2_1",error:"_error_1tme2_33",warn:"_warn_1tme2_41",info:"_info_1tme2_49",Description:"_Description_1tme2_53",DismissButton:"_DismissButton_1tme2_59",slideIn:"_slideIn_1tme2_79",slideOut:"_slideOut_1tme2_83"};function M(){const{toasts:o}=I();return e.jsx("div",{className:g.ToastContainer,children:e.jsx(W.AnimatePresence,{children:o.map(n=>e.jsx(W.motion.div,{layout:!0,initial:{opacity:0,x:100,y:50},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:-50},transition:{type:"spring",stiffness:300,damping:20},children:e.jsx(U,{...n})},n.id))})})}function U({id:o,title:n,description:r,level:a,isDismissable:i}){const[t,s]=f.useState(!1),c=I();return f.useEffect(()=>()=>{s(!0)},[]),e.jsxs("div",{className:_(g.Toast,{[g.error]:a==="Error",[g.warn]:a==="Warn",[g.info]:a==null||a==="Info",[g.slideIn]:!t,[g.slideOut]:t}),children:[e.jsx("div",{children:n}),e.jsx("div",{className:g.Description,children:r}),i&&o!==void 0&&e.jsx("div",{className:g.DismissButton,onClick:()=>c.dismiss(o),children:"×"})]})}const h={InputContainer:"_InputContainer_1a08x_6",InputField:"_InputField_1a08x_12",hasError:"_hasError_1a08x_30",disabled:"_disabled_1a08x_35",Label:"_Label_1a08x_40",lifted:"_lifted_1a08x_54",ErrorText:"_ErrorText_1a08x_65",Skeleton:"_Skeleton_1a08x_73"};function G({value:o,setValue:n,label:r,isLoader:a,type:i="text",disabled:t,error:s,className:c}){const[p,d]=f.useState(!1),v=p||o.length>0;return a?e.jsx("div",{className:_(h.Skeleton,c),"aria-hidden":"true"}):e.jsxs("div",{className:_(h.InputContainer,{[h.hasError]:!!s,[h.disabled]:t},c),children:[e.jsx("input",{className:h.InputField,type:i,value:o,onChange:T=>n(T.target.value),onFocus:()=>d(!0),onBlur:()=>d(!1),disabled:t}),e.jsx("label",{className:_(h.Label,{[h.lifted]:v}),children:r}),s&&e.jsx("span",{className:h.ErrorText,children:s})]})}const u={ToggleContainer:"_ToggleContainer_im4lz_6",disabled:"_disabled_im4lz_13",Track:"_Track_im4lz_18",on:"_on_im4lz_31",Thumb:"_Thumb_im4lz_39",Label:"_Label_im4lz_56",LabelSkeleton:"_LabelSkeleton_im4lz_62",Skeleton:"_Skeleton_im4lz_77"};function J({checked:o,onChange:n,label:r,labelPosition:a="right",disabled:i,isLoader:t,isLoadingLabel:s,className:c}){const p=!!r||s,d=s?e.jsx("span",{className:u.LabelSkeleton,"aria-hidden":"true"}):r?e.jsx("span",{className:u.Label,children:r}):null;return t?p?e.jsxs("div",{className:_(u.ToggleContainer,c),children:[a==="left"&&d,e.jsx("div",{className:u.Skeleton,"aria-hidden":"true"}),a==="right"&&d]}):e.jsx("div",{className:_(u.Skeleton,c),"aria-hidden":"true"}):e.jsxs("label",{className:_(u.ToggleContainer,{[u.disabled]:i},c),children:[a==="left"&&d,e.jsx("button",{role:"switch","aria-checked":o,className:_(u.Track,{[u.on]:o}),onClick:()=>!i&&n(!o),disabled:i,type:"button",children:e.jsx("span",{className:u.Thumb})}),a==="right"&&d]})}l.Input=G,l.Loader=y,l.LoadingWrapper=x,l.TelegramAuth=j,l.TelegramSignInButton=D,l.Toaster=M,l.Toggle=J,l.useTelegramLogin=k,l.useToaster=I,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("@keyframes _spin_wa8op_1{to{transform:rotate(360deg)}}@keyframes _ripple_wa8op_1{0%{transform:scale(.08);opacity:.9}to{transform:scale(1);opacity:0}}@keyframes _dotPulse_wa8op_1{0%,to{transform:translate(-50%,-50%) scale(.55);opacity:.3}50%{transform:translate(-50%,calc(-50% - var(--sz) * .1)) scale(1);opacity:1}}@keyframes _waveBounce_wa8op_1{0%,55%,to{transform:translate(-50%,-50%) scale(.8);opacity:.4}27%{transform:translate(-50%,calc(-50% - var(--sz) * .28)) scale(1);opacity:1}}._LoaderContainer_wa8op_24{position:relative;flex-shrink:0}._sm_wa8op_31{width:1.5rem;height:1.5rem;--sz: 1.5rem;--arc-gap: .2rem;--arc-bw: .125rem}._md_wa8op_32{width:2.5rem;height:2.5rem;--sz: 2.5rem;--arc-gap: .35rem;--arc-bw: .1875rem}._lg_wa8op_33{width:4rem;height:4rem;--sz: 4rem;--arc-gap: .55rem;--arc-bw: .25rem}._Arc1_wa8op_37,._Arc2_wa8op_38,._Arc3_wa8op_39{position:absolute;border-radius:50%;border:var(--arc-bw) solid transparent}._Arc1_wa8op_37{inset:0;border-top-color:var(--chures-accent, #229ED9);border-left-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.2s linear infinite;filter:drop-shadow(0 0 .25rem var(--chures-accent, #229ED9))}._Arc2_wa8op_38{inset:var(--arc-gap);border-bottom-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.8s linear infinite reverse;opacity:.8}._Arc3_wa8op_39{inset:calc(var(--arc-gap) * 2);border-top-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 2.4s linear infinite;opacity:.6}._Ring1_wa8op_71,._Ring2_wa8op_72,._Ring3_wa8op_73{position:absolute;inset:0;border-radius:50%;border:var(--arc-bw) solid var(--chures-accent, #229ED9);animation:_ripple_wa8op_1 1.8s ease-out infinite both}._Ring2_wa8op_72{animation-delay:.6s}._Ring3_wa8op_73{animation-delay:1.2s}._Dot1_wa8op_86,._Dot2_wa8op_87,._Dot3_wa8op_88{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .2);height:calc(var(--sz) * .2);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .14) var(--chures-accent, #229ED9);animation:_dotPulse_wa8op_1 1.1s ease-in-out infinite both}._Dot1_wa8op_86{left:22%}._Dot2_wa8op_87{left:50%;animation-delay:.18s}._Dot3_wa8op_88{left:78%;animation-delay:.36s}._Wave1_wa8op_105,._Wave2_wa8op_106,._Wave3_wa8op_107,._Wave4_wa8op_108,._Wave5_wa8op_109{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .16);height:calc(var(--sz) * .16);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .1) var(--chures-accent, #229ED9);animation:_waveBounce_wa8op_1 1s ease-in-out infinite both}._Wave1_wa8op_105{left:10%}._Wave2_wa8op_106{left:28%;animation-delay:.12s}._Wave3_wa8op_107{left:46%;animation-delay:.24s}._Wave4_wa8op_108{left:64%;animation-delay:.36s}._Wave5_wa8op_109{left:82%;animation-delay:.48s}._LoadingWrapperContainer_1q0w7_1{display:flex;align-items:center;justify-content:center;width:100%;min-height:4rem}._SkeletonWrapper_1q0w7_9{width:100%}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}@keyframes _shimmer_1a08x_1{0%{background-position:-200% 0}to{background-position:200% 0}}._InputContainer_1a08x_6{position:relative;width:100%;height:var(--chures-input-height, 3rem)}._InputField_1a08x_12{width:100%;height:100%;background:var(--chures-input-bg, #111111);border:.0625rem solid rgb(255 255 255 / 13%);border-radius:var(--chures-input-radius, .75rem);color:var(--chures-fg, #ffffff);font-size:var(--chures-font-sm, .875rem);padding:0 .875rem;outline:none;transition:border-color .18s ease;box-sizing:border-box}._InputField_1a08x_12:focus{border-color:#ffffff59}._hasError_1a08x_30 ._InputField_1a08x_12,._hasError_1a08x_30 ._InputField_1a08x_12:focus{border-color:var(--chures-error, #ef4444)}._disabled_1a08x_35 ._InputField_1a08x_12{opacity:.45;cursor:not-allowed}._Label_1a08x_40{position:absolute;left:.875rem;top:50%;transform:translateY(-50%);transform-origin:left center;color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-sm, .875rem);pointer-events:none;transition:all .18s ease;padding:0 .25rem;border-radius:.1875rem}._Label_1a08x_40._lifted_1a08x_54{top:0;transform:translateY(-50%) scale(.82);background:var(--chures-input-bg, #111111);color:var(--chures-fg-muted, #9ca3af)}._hasError_1a08x_30 ._Label_1a08x_40._lifted_1a08x_54{color:var(--chures-error, #ef4444)}._ErrorText_1a08x_65{display:block;margin-top:.25rem;padding-left:.875rem;font-size:var(--chures-font-xs, .75rem);color:var(--chures-error, #ef4444)}._Skeleton_1a08x_73{width:100%;height:var(--chures-input-height, 3rem);border-radius:var(--chures-input-radius, .75rem);background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1a08x_1 1.5s ease-in-out infinite}@keyframes _shimmer_1jetc_1{0%{background-position:-200% 0}to{background-position:200% 0}}._ToggleContainer_1jetc_6{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}._disabled_1jetc_13{opacity:.45;cursor:not-allowed}._Track_1jetc_18{position:relative;width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:var(--chures-toggle-bg-off, rgb(255 255 255 / 13%));border:none;padding:0;cursor:pointer;transition:background .2s ease;flex-shrink:0}._Track_1jetc_18._on_1jetc_31{background:var(--chures-toggle-bg-on, var(--chures-accent, #229ED9))}._disabled_1jetc_13 ._Track_1jetc_18{cursor:not-allowed}._Thumb_1jetc_39{position:absolute;top:0;bottom:0;margin:auto 0;left:.1875rem;width:var(--chures-toggle-thumb, 1.125rem);height:var(--chures-toggle-thumb, 1.125rem);border-radius:50%;background:var(--chures-toggle-thumb-color, #ffffff);transition:left .2s ease;pointer-events:none}._Track_1jetc_18._on_1jetc_31 ._Thumb_1jetc_39{left:calc(var(--chures-toggle-width, 2.75rem) - var(--chures-toggle-thumb, 1.125rem) - .1875rem)}._Label_1jetc_57{font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff);-webkit-user-select:none;user-select:none}._LabelSkeleton_1jetc_63{display:inline-block;width:var(--chures-toggle-label-skeleton-w, 5rem);height:var(--chures-font-sm, .875rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1jetc_1 1.5s ease-in-out infinite}._Skeleton_1jetc_78{width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1jetc_1 1.5s ease-in-out infinite}:root{--chures-accent: #229ED9;--chures-accent-muted: rgb(34 158 217 / 50%);--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-bg: #000000;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem;--chures-input-bg: #111111;--chures-input-height: 3rem;--chures-input-radius: .75rem;--chures-skeleton-shine: #1e1e1e;--chures-toggle-width: 2.75rem;--chures-toggle-height: 1.5rem;--chures-toggle-thumb: 1.125rem;--chures-toggle-bg-off: rgb(255 255 255 / 13%);--chures-toggle-bg-on: var(--chures-accent);--chures-toggle-thumb-color: #ffffff;--chures-toggle-label-skeleton-w: 5rem;--chures-dropdown-bg: var(--chures-bg);--chures-dropdown-radius: .75rem;--chures-dropdown-row-radius: .375rem;--chures-dropdown-border: var(--chures-accent);--chures-dropdown-border-subtle: var(--chures-accent-muted);--chures-dropdown-hover: rgb(255 255 255 / 8%);--chures-dropdown-create-bg: rgb(34 158 217 / 12%);--chures-dropdown-create-bg-hover: rgb(34 158 217 / 20%)}@keyframes _panelIn_v5jkm_1{0%{opacity:0;transform:scale(.96) translateY(6px)}to{opacity:1;transform:none}}@keyframes _shimmer_v5jkm_1{0%{background-position:-200% center}to{background-position:200% center}}._DropdownContainer_v5jkm_13{position:absolute;top:100%;left:0;width:100%;background:var(--chures-dropdown-bg);border:1px solid var(--chures-dropdown-border);border-radius:var(--chures-dropdown-radius);overflow:hidden;box-shadow:0 1rem 3rem #000c;animation:_panelIn_v5jkm_1 .14s ease;z-index:100}._SearchRow_v5jkm_27{padding:.5rem;border-bottom:1px solid var(--chures-dropdown-border-subtle)}._SearchBox_v5jkm_32{display:flex;align-items:center;gap:.5rem;background:var(--chures-input-bg);border:1px solid var(--chures-dropdown-border-subtle);border-radius:var(--chures-dropdown-row-radius);padding:.4rem .625rem}._SearchIcon_v5jkm_42{display:flex;align-items:center;color:var(--chures-fg-muted);flex-shrink:0}._SearchInput_v5jkm_49{flex:1;background:transparent;border:none;outline:none;font-size:var(--chures-font-sm);color:var(--chures-fg);font-family:inherit}._SearchInput_v5jkm_49::placeholder{color:var(--chures-fg-muted)}._ResultsList_v5jkm_63{max-height:13rem;overflow-y:auto}._OptionRow_v5jkm_68{padding:.5625rem .875rem;font-size:var(--chures-font-sm);color:var(--chures-fg-muted);cursor:pointer;transition:background .1s ease,color .1s ease;display:flex;align-items:center;gap:.5rem}._OptionRow_v5jkm_68:hover{background:var(--chures-dropdown-hover);color:var(--chures-fg)}._OptionRow_v5jkm_68._Selected_v5jkm_83{color:var(--chures-fg)}._Checkmark_v5jkm_88{color:var(--chures-accent);font-size:var(--chures-font-xs);flex-shrink:0}._CreateRow_v5jkm_94{display:flex;align-items:center;gap:.625rem;padding:.5625rem .875rem;cursor:pointer;background:var(--chures-dropdown-create-bg);transition:background .1s ease}._CreateRow_v5jkm_94:hover{background:var(--chures-dropdown-create-bg-hover)}._CreateRow_v5jkm_94._WithBorder_v5jkm_107{border-top:1px solid var(--chures-dropdown-border-subtle)}._CreateIcon_v5jkm_112{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;border-radius:50%;background:var(--chures-accent);color:#fff;flex-shrink:0}._CreateLabel_v5jkm_124{font-size:var(--chures-font-sm);font-weight:600;color:var(--chures-fg)}._EmptyHint_v5jkm_130{padding:.75rem .875rem;font-size:var(--chures-font-sm);color:var(--chures-fg-muted);font-style:italic}._SkeletonRow_v5jkm_137{height:2rem;margin:.375rem .875rem;border-radius:var(--chures-dropdown-row-radius);background:linear-gradient(90deg,var(--chures-dropdown-bg) 25%,var(--chures-skeleton-shine) 50%,var(--chures-dropdown-bg) 75%);background-size:200% 100%;animation:_shimmer_v5jkm_1 1.4s infinite linear}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("framer-motion"),require("zustand")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","framer-motion","zustand"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.Chures={},d.ReactJSXRuntime,d.React,d.FramerMotion,d.Zustand))})(this,(function(d,e,u,x,Q){"use strict";function U(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var D={exports:{}};var A;function G(){return A||(A=1,(function(n){(function(){var t={}.hasOwnProperty;function r(){for(var o="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(o=a(o,s(i)))}return o}function s(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var c="";for(var i in o)t.call(o,i)&&o[i]&&(c=a(c,i));return c}function a(o,c){return c?o?o+" "+c:o+c:o}n.exports?(r.default=r,n.exports=r):window.classNames=r})()})(D)),D.exports}var J=G();const p=U(J),I={LoaderContainer:"_LoaderContainer_wa8op_24",sm:"_sm_wa8op_31",md:"_md_wa8op_32",lg:"_lg_wa8op_33",Arc1:"_Arc1_wa8op_37",Arc2:"_Arc2_wa8op_38",Arc3:"_Arc3_wa8op_39",spin:"_spin_wa8op_1",Ring1:"_Ring1_wa8op_71",Ring2:"_Ring2_wa8op_72",Ring3:"_Ring3_wa8op_73",ripple:"_ripple_wa8op_1",Dot1:"_Dot1_wa8op_86",Dot2:"_Dot2_wa8op_87",Dot3:"_Dot3_wa8op_88",dotPulse:"_dotPulse_wa8op_1",Wave1:"_Wave1_wa8op_105",Wave2:"_Wave2_wa8op_106",Wave3:"_Wave3_wa8op_107",Wave4:"_Wave4_wa8op_108",Wave5:"_Wave5_wa8op_109",waveBounce:"_waveBounce_wa8op_1"};function V(n,t){switch(n){case"ripple":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:t.Ring1}),e.jsx("div",{className:t.Ring2}),e.jsx("div",{className:t.Ring3})]});case"dots":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:t.Dot1}),e.jsx("div",{className:t.Dot2}),e.jsx("div",{className:t.Dot3})]});case"wave":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:t.Wave1}),e.jsx("div",{className:t.Wave2}),e.jsx("div",{className:t.Wave3}),e.jsx("div",{className:t.Wave4}),e.jsx("div",{className:t.Wave5})]});default:return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:t.Arc1}),e.jsx("div",{className:t.Arc2}),e.jsx("div",{className:t.Arc3})]})}}function F({variant:n="arcs",size:t="md",color:r,className:s}){return e.jsx("div",{className:p(I.LoaderContainer,I[t],I[n],s),role:"status","aria-label":"Loading",style:r?{"--chures-accent":r}:void 0,children:V(n,I)})}const O={LoadingWrapperContainer:"_LoadingWrapperContainer_1q0w7_1",SkeletonWrapper:"_SkeletonWrapper_1q0w7_9"};function X({isLoading:n,children:t,skeleton:r,loaderProps:s,className:a}){return n?r?e.jsx("div",{className:p(O.SkeletonWrapper,a),children:r}):e.jsx("div",{className:p(O.LoadingWrapperContainer,a),children:e.jsx(F,{...s})}):e.jsx(e.Fragment,{children:t})}const Z="https://oauth.telegram.org/js/telegram-login.js?3";function $(n){const{botId:t,redirectUri:r,requestAccess:s="write"}=n,a=u.useRef(n.onSuccess);a.current=n.onSuccess;const o=u.useRef(!1),[c,i]=u.useState(!1),[h,l]=u.useState(!1);u.useEffect(function(){if(!t)return;const C=r??window.location.origin;l(!0),i(!1);const g=document.createElement("script");return g.src=Z,g.async=!0,g.onload=function(){const k=window.Telegram;k&&(k.Login.init({client_id:t,redirect_uri:C},function(L){o.current||(o.current=!0,a.current(L))}),i(!0)),l(!1)},g.onerror=function(){l(!1)},document.head.appendChild(g),function(){document.head.contains(g)&&document.head.removeChild(g),i(!1),l(!1)}},[t,r]);function w(){const C=window.Telegram;if(!c||!C)return;o.current=!1;const g=r??window.location.origin;C.Login.auth({client_id:t,redirect_uri:g,request_access:s},function(k){o.current||(o.current=!0,a.current(k))})}return{login:w,isReady:c,isLoading:h}}const N={TelegramSignInButtonContainer:"_TelegramSignInButtonContainer_10wun_1",FullSize:"_FullSize_10wun_46",Icon:"_Icon_10wun_50"},Y={en:"Continue with Telegram",ru:"Войти через Telegram"};function R(){return e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",className:N.Icon,children:e.jsx("path",{d:"M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z"})})}function q({onClick:n,disabled:t,lang:r="en",title:s,label:a,fullSize:o,className:c}){u.useEffect(function(){const l="comfortaa-font";if(document.getElementById(l))return;const w=document.createElement("link");w.id=l,w.rel="stylesheet",w.href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap",document.head.appendChild(w)},[]);const i=a??s??Y[r],h=[N.TelegramSignInButtonContainer,o&&N.FullSize,c].filter(Boolean).join(" ");return e.jsxs("button",{type:"button",className:h,onClick:n,disabled:t,children:[e.jsx(R,{}),i]})}function ee({botId:n,onSuccess:t,lang:r,title:s,redirectUri:a,requestAccess:o,children:c,className:i}){const{login:h,isReady:l}=$({botId:n,onSuccess:t,redirectUri:a,requestAccess:o});return c?e.jsx(e.Fragment,{children:c({login:h,isReady:l})}):e.jsx(q,{onClick:h,disabled:!l,lang:r,title:s,className:i})}let ne=0;const W=Q.create((n,t)=>({toasts:[],bake:r=>{const s=ne++;n(a=>({toasts:[...a.toasts,{...r,id:s}]})),setTimeout(()=>{t().dismiss(s)},5e3)},dismiss:r=>{n(s=>({toasts:s.toasts.filter(a=>a.id!==r)}))}})),m={ToastContainer:"_ToastContainer_1tme2_1",Toast:"_Toast_1tme2_1",error:"_error_1tme2_33",warn:"_warn_1tme2_41",info:"_info_1tme2_49",Description:"_Description_1tme2_53",DismissButton:"_DismissButton_1tme2_59",slideIn:"_slideIn_1tme2_79",slideOut:"_slideOut_1tme2_83"};function te(){const{toasts:n}=W();return e.jsx("div",{className:m.ToastContainer,children:e.jsx(x.AnimatePresence,{children:n.map(t=>e.jsx(x.motion.div,{layout:!0,initial:{opacity:0,x:100,y:50},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:-50},transition:{type:"spring",stiffness:300,damping:20},children:e.jsx(oe,{...t})},t.id))})})}function oe({id:n,title:t,description:r,level:s,isDismissable:a}){const[o,c]=u.useState(!1),i=W();return u.useEffect(()=>()=>{c(!0)},[]),e.jsxs("div",{className:p(m.Toast,{[m.error]:s==="Error",[m.warn]:s==="Warn",[m.info]:s==null||s==="Info",[m.slideIn]:!o,[m.slideOut]:o}),children:[e.jsx("div",{children:t}),e.jsx("div",{className:m.Description,children:r}),a&&n!==void 0&&e.jsx("div",{className:m.DismissButton,onClick:()=>i.dismiss(n),children:"×"})]})}const S={InputContainer:"_InputContainer_1a08x_6",InputField:"_InputField_1a08x_12",hasError:"_hasError_1a08x_30",disabled:"_disabled_1a08x_35",Label:"_Label_1a08x_40",lifted:"_lifted_1a08x_54",ErrorText:"_ErrorText_1a08x_65",Skeleton:"_Skeleton_1a08x_73"};function re({value:n,setValue:t,label:r,isLoader:s,type:a="text",disabled:o,error:c,className:i}){const[h,l]=u.useState(!1),w=h||n.length>0;return s?e.jsx("div",{className:p(S.Skeleton,i),"aria-hidden":"true"}):e.jsxs("div",{className:p(S.InputContainer,{[S.hasError]:!!c,[S.disabled]:o},i),children:[e.jsx("input",{className:S.InputField,type:a,value:n,onChange:C=>t(C.target.value),onFocus:()=>l(!0),onBlur:()=>l(!1),disabled:o}),e.jsx("label",{className:p(S.Label,{[S.lifted]:w}),children:r}),c&&e.jsx("span",{className:S.ErrorText,children:c})]})}const v={ToggleContainer:"_ToggleContainer_1jetc_6",disabled:"_disabled_1jetc_13",Track:"_Track_1jetc_18",on:"_on_1jetc_31",Thumb:"_Thumb_1jetc_39",Label:"_Label_1jetc_57",LabelSkeleton:"_LabelSkeleton_1jetc_63",Skeleton:"_Skeleton_1jetc_78"};function se({checked:n,onChange:t,label:r,labelPosition:s="right",disabled:a,isLoader:o,isLoadingLabel:c,className:i}){const h=!!r||c,l=c?e.jsx("span",{className:v.LabelSkeleton,"aria-hidden":"true"}):r?e.jsx("span",{className:v.Label,children:r}):null;return o?h?e.jsxs("div",{className:p(v.ToggleContainer,i),children:[s==="left"&&l,e.jsx("div",{className:v.Skeleton,"aria-hidden":"true"}),s==="right"&&l]}):e.jsx("div",{className:p(v.Skeleton,i),"aria-hidden":"true"}):e.jsxs("label",{className:p(v.ToggleContainer,{[v.disabled]:a},i),children:[s==="left"&&l,e.jsx("button",{role:"switch","aria-checked":n,className:p(v.Track,{[v.on]:n}),onClick:()=>!a&&t(!n),disabled:a,type:"button",children:e.jsx("span",{className:v.Thumb})}),s==="right"&&l]})}function ae(n,t,r){u.useEffect(()=>{function s(o){const c=o.target;n.current?.contains(c)||r?.current?.contains(c)||t()}function a(o){o.key==="Escape"&&t()}return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",a)}},[t,n,r])}function ce(n,t){const[r,s]=u.useState([]);return u.useEffect(()=>{if(!t)return;let a=!1;return t(n).then(o=>{a||s(o)}),()=>{a=!0}},[n,t]),r}function b(n){return typeof n=="string"?n:n.id}function M(n){return typeof n=="string"?n:n.name}const _={DropdownContainer:"_DropdownContainer_v5jkm_13",SearchRow:"_SearchRow_v5jkm_27",SearchBox:"_SearchBox_v5jkm_32",SearchIcon:"_SearchIcon_v5jkm_42",SearchInput:"_SearchInput_v5jkm_49",ResultsList:"_ResultsList_v5jkm_63",OptionRow:"_OptionRow_v5jkm_68",Selected:"_Selected_v5jkm_83",Checkmark:"_Checkmark_v5jkm_88",CreateRow:"_CreateRow_v5jkm_94",WithBorder:"_WithBorder_v5jkm_107",CreateIcon:"_CreateIcon_v5jkm_112",CreateLabel:"_CreateLabel_v5jkm_124",EmptyHint:"_EmptyHint_v5jkm_130",SkeletonRow:"_SkeletonRow_v5jkm_137"};function ie({query:n,withBorder:t,onCreate:r}){function s(a){a.preventDefault(),r()}return e.jsxs("div",{className:p(_.CreateRow,t&&_.WithBorder),onMouseDown:s,children:[e.jsx("span",{className:_.CreateIcon,children:e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[e.jsx("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),e.jsx("line",{x1:"1",y1:"5",x2:"9",y2:"5"})]})}),e.jsxs("span",{className:_.CreateLabel,children:["create “",n,"”"]})]})}function le({opt:n,isSelected:t,multiSelect:r,onPick:s}){function a(o){o.preventDefault(),s(n)}return e.jsxs("div",{className:p(_.OptionRow,t&&_.Selected),onMouseDown:a,children:[r&&t&&e.jsx("span",{className:_.Checkmark,children:"✓"}),M(n)]})}function de({inputRef:n,query:t,onChange:r,onKeyDown:s,placeholder:a}){return e.jsx("div",{className:_.SearchRow,children:e.jsxs("div",{className:_.SearchBox,children:[e.jsx("span",{className:_.SearchIcon,children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[e.jsx("circle",{cx:"5",cy:"5",r:"3.5"}),e.jsx("line",{x1:"8",y1:"8",x2:"11",y2:"11"})]})}),e.jsx("input",{ref:n,className:_.SearchInput,value:t,onChange:r,onKeyDown:s,placeholder:a})]})})}function ue({count:n}){return e.jsx(e.Fragment,{children:Array.from({length:n}).map((t,r)=>e.jsx("div",{className:_.SkeletonRow},r))})}function _e({onSearch:n,onCreate:t,onPick:r,onClose:s,anchorRef:a,placeholder:o,options:c=[],excluded:i=[],selected:h=[],multiSelect:l=!1,isLoading:w=!1,emptyHint:C="no results found",skeletonRowCount:g=4,onError:k=console.error}){const[L,fe]=u.useState(""),[pe,P]=u.useState(!1),z=u.useRef(null),H=u.useRef(null),B=!!n,he=ce(L,n);ae(H,s,a),u.useEffect(()=>{B&&z.current?.focus()},[B]);const y=(n?he:c).filter(f=>!i.includes(b(f))),T=L.trim(),ge=y.some(f=>M(f).toLowerCase()===T.toLowerCase()),E=!!t&&T.length>0&&!ge;async function K(){!T||pe||!t||(P(!0),t(T).then(j).catch(k).finally(()=>P(!1)))}function j(f){r(f),l||s()}function ve(f){fe(f.target.value)}function we(f){f.key==="Enter"&&(f.preventDefault(),y.length>0?j(y[0]):E&&K())}const me=o??(t?"search or add new…":"search…");return e.jsxs("div",{ref:H,className:_.DropdownContainer,children:[B&&e.jsx(de,{inputRef:z,query:L,onChange:ve,onKeyDown:we,placeholder:me}),e.jsx("div",{className:_.ResultsList,children:w?e.jsx(ue,{count:g}):e.jsxs(e.Fragment,{children:[y.map(f=>e.jsx(le,{opt:f,isSelected:h.includes(b(f)),multiSelect:l,onPick:j},b(f))),E&&e.jsx(ie,{query:T,withBorder:y.length>0,onCreate:K}),y.length===0&&!E&&e.jsx("div",{className:_.EmptyHint,children:C})]})})]})}d.Dropdown=_e,d.Input=re,d.Loader=F,d.LoadingWrapper=X,d.TelegramAuth=ee,d.TelegramSignInButton=q,d.Toaster=te,d.Toggle=se,d.useTelegramLogin=$,d.useToaster=W,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DropdownOption } from './Dropdown.types';
|
|
2
|
+
export type { DropdownOption };
|
|
3
|
+
interface Props {
|
|
4
|
+
options?: DropdownOption[];
|
|
5
|
+
onSearch?: (query: string) => Promise<DropdownOption[]>;
|
|
6
|
+
onCreate?: (name: string) => Promise<DropdownOption>;
|
|
7
|
+
onPick: (option: DropdownOption) => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
anchorRef?: React.RefObject<HTMLElement | null>;
|
|
10
|
+
excluded?: string[];
|
|
11
|
+
multiSelect?: boolean;
|
|
12
|
+
selected?: string[];
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
emptyHint?: string;
|
|
15
|
+
isLoading?: boolean;
|
|
16
|
+
skeletonRowCount?: number;
|
|
17
|
+
onError?: (err: unknown) => void;
|
|
18
|
+
}
|
|
19
|
+
export type DropdownProps = Props;
|
|
20
|
+
export declare function Dropdown({ onSearch, onCreate, onPick, onClose, anchorRef, placeholder, options, excluded, selected, multiSelect, isLoading, emptyHint, skeletonRowCount, onError, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DropdownOption } from './Dropdown.types';
|
|
2
|
+
export declare function useDropdownClose(panelRef: React.RefObject<HTMLDivElement | null>, onClose: () => void, anchorRef?: React.RefObject<HTMLElement | null>): void;
|
|
3
|
+
export declare function useSearchResults(query: string, onSearch?: (q: string) => Promise<DropdownOption[]>): DropdownOption[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DropdownOption } from './Dropdown.types';
|
|
2
|
+
interface Props {
|
|
3
|
+
opt: DropdownOption;
|
|
4
|
+
isSelected: boolean;
|
|
5
|
+
multiSelect: boolean;
|
|
6
|
+
onPick: (opt: DropdownOption) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function DropdownOptionRow({ opt, isSelected, multiSelect, onPick }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
3
|
+
query: string;
|
|
4
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
+
onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function DropdownSearchRow({ inputRef, query, onChange, onKeyDown, placeholder }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Toaster } from './Toaster';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { LoaderProps } from './components/Loader';
|
|
|
3
3
|
export { LoadingWrapper } from './components/LoadingWrapper';
|
|
4
4
|
export type { LoadingWrapperProps } from './components/LoadingWrapper';
|
|
5
5
|
export { TelegramAuth } from './components/TelegramAuth';
|
|
6
|
-
export {
|
|
6
|
+
export { Toaster } from './components/notifications';
|
|
7
7
|
export { useToaster } from './hooks/toaster/useToaster';
|
|
8
8
|
export type { Toast, ToasterStore } from './hooks/toaster/useToaster';
|
|
9
9
|
export { Input } from './components/Input';
|
|
@@ -16,3 +16,5 @@ export type { TelegramAuthProps } from './components/TelegramAuth';
|
|
|
16
16
|
export type { TelegramSignInButtonProps } from './components/TelegramSignInButton';
|
|
17
17
|
export type { UseTelegramLoginOptions, UseTelegramLoginReturn } from './hooks/useTelegramLogin';
|
|
18
18
|
export type { TelegramAuthData, TelegramLoginWindow } from './types';
|
|
19
|
+
export { Dropdown } from './components/Dropdown';
|
|
20
|
+
export type { DropdownProps, DropdownOption } from './components/Dropdown';
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|