@vlrc-fe/components 1.0.6 → 1.0.8
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/Form/FormFileUpload/index.d.ts +1 -1
- package/dist/Form/FormFileUpload/index.d.ts.map +1 -1
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.d.ts.map +1 -1
- package/dist/MultiSelect/type.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +64 -40
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +46 -80
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +22 -60
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +1147 -43
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +30 -64
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +31 -147
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +93 -19
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +80 -25
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +9 -50
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +30 -156
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +350 -14
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +11 -0
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +55 -60
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +430 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +36 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +28 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +14 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +156 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +19 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +67 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +118 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +36 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +13 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +44 -121
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +31 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +37 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +123 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +44 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +43 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +14 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +64 -0
- package/dist/index127.cjs +1 -0
- package/dist/index127.js +23 -0
- package/dist/index128.cjs +1 -0
- package/dist/index128.js +34 -0
- package/dist/index129.cjs +1 -0
- package/dist/index129.js +27 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +30 -12
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +26 -0
- package/dist/index131.cjs +1 -0
- package/dist/index131.js +157 -0
- package/dist/index132.cjs +1 -0
- package/dist/index132.js +34 -0
- package/dist/index133.cjs +1 -0
- package/dist/index133.js +46 -0
- package/dist/index134.cjs +1 -0
- package/dist/index134.js +142 -0
- package/dist/index135.cjs +1 -0
- package/dist/index135.js +125 -0
- package/dist/index136.cjs +1 -0
- package/dist/index136.js +26 -0
- package/dist/index137.cjs +1 -0
- package/dist/index137.js +88 -0
- package/dist/index138.cjs +1 -0
- package/dist/index138.js +221 -0
- package/dist/index139.cjs +1 -0
- package/dist/index139.js +166 -0
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +8 -12
- package/dist/index140.cjs +1 -0
- package/dist/index140.js +126 -0
- package/dist/index141.cjs +1 -0
- package/dist/index141.js +15 -0
- package/dist/index142.cjs +1 -0
- package/dist/index142.js +9 -0
- package/dist/index143.cjs +1 -0
- package/dist/index143.js +17 -0
- package/dist/index144.cjs +1 -0
- package/dist/index144.js +22 -0
- package/dist/index145.cjs +1 -0
- package/dist/index145.js +18 -0
- package/dist/index146.cjs +1 -0
- package/dist/index146.js +6 -0
- package/dist/index147.cjs +1 -0
- package/dist/index147.js +7 -0
- package/dist/index148.cjs +1 -0
- package/dist/index148.js +8 -0
- package/dist/index149.cjs +1 -0
- package/dist/index149.js +7 -0
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +12 -112
- package/dist/index150.cjs +1 -0
- package/dist/index150.js +7 -0
- package/dist/index151.cjs +1 -0
- package/dist/index151.js +9 -0
- package/dist/index152.cjs +1 -0
- package/dist/index152.js +69 -0
- package/dist/index153.cjs +1 -0
- package/dist/index153.js +11 -0
- package/dist/index154.cjs +1 -0
- package/dist/index154.js +202 -0
- package/dist/index155.cjs +1 -0
- package/dist/index155.js +124 -0
- package/dist/index156.cjs +1 -0
- package/dist/index156.js +32 -0
- package/dist/index157.cjs +1 -0
- package/dist/index157.js +20 -0
- package/dist/index158.cjs +1 -0
- package/dist/index158.js +69 -0
- package/dist/index159.cjs +1 -0
- package/dist/index159.js +32 -0
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +4 -726
- package/dist/index160.cjs +1 -0
- package/dist/index160.js +11 -0
- package/dist/index161.cjs +1 -0
- package/dist/index161.js +280 -0
- package/dist/index162.cjs +1 -0
- package/dist/index162.js +157 -0
- package/dist/index163.cjs +1 -0
- package/dist/index163.js +20 -0
- package/dist/index164.cjs +1 -0
- package/dist/index164.js +10 -0
- package/dist/index165.cjs +1 -0
- package/dist/index165.js +14 -0
- package/dist/index166.cjs +1 -0
- package/dist/index166.js +8 -0
- package/dist/index167.cjs +1 -0
- package/dist/index167.js +8 -0
- package/dist/index168.cjs +1 -0
- package/dist/index168.js +11 -0
- package/dist/index169.cjs +1 -0
- package/dist/index169.js +10 -0
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +79 -339
- package/dist/index170.cjs +1 -0
- package/dist/index170.js +6 -0
- package/dist/index171.cjs +1 -0
- package/dist/index171.js +8 -0
- package/dist/index172.cjs +1 -0
- package/dist/index172.js +8 -0
- package/dist/index173.cjs +1 -0
- package/dist/index173.js +10 -0
- package/dist/index174.cjs +1 -0
- package/dist/index174.js +11 -0
- package/dist/index175.cjs +1 -0
- package/dist/index175.js +15 -0
- package/dist/index176.cjs +1 -0
- package/dist/index176.js +11 -0
- package/dist/index177.cjs +1 -0
- package/dist/index177.js +11 -0
- package/dist/index178.cjs +1 -0
- package/dist/index178.js +6 -0
- package/dist/index179.cjs +1 -0
- package/dist/index179.js +43 -0
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +19 -66
- package/dist/index180.cjs +1 -0
- package/dist/index180.js +382 -0
- package/dist/index181.cjs +1 -0
- package/dist/index181.js +40 -0
- package/dist/index182.cjs +1 -0
- package/dist/index182.js +23 -0
- package/dist/index183.cjs +1 -0
- package/dist/index183.js +59 -0
- package/dist/index184.cjs +1 -0
- package/dist/index184.js +55 -0
- package/dist/index185.cjs +1 -0
- package/dist/index185.js +54 -0
- package/dist/index186.cjs +1 -0
- package/dist/index186.js +57 -0
- package/dist/index187.cjs +1 -0
- package/dist/index187.js +57 -0
- package/dist/index188.cjs +1 -0
- package/dist/index188.js +88 -0
- package/dist/index189.cjs +1 -0
- package/dist/index189.js +66 -0
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +18 -8
- package/dist/index190.cjs +1 -0
- package/dist/index190.js +594 -0
- package/dist/index191.cjs +9 -0
- package/dist/index191.js +30 -0
- package/dist/index192.cjs +1 -0
- package/dist/index192.js +50 -0
- package/dist/index193.cjs +1 -0
- package/dist/index193.js +65 -0
- package/dist/index194.cjs +1 -0
- package/dist/index194.js +48 -0
- package/dist/index195.cjs +1 -0
- package/dist/index195.js +67 -0
- package/dist/index196.cjs +1 -0
- package/dist/index196.js +151 -0
- package/dist/index197.cjs +1 -0
- package/dist/index197.js +23 -0
- package/dist/index198.cjs +1 -0
- package/dist/index198.js +27 -0
- package/dist/index199.cjs +1 -0
- package/dist/index199.js +53 -0
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +51 -98
- package/dist/index200.cjs +1 -0
- package/dist/index200.js +161 -0
- package/dist/index201.cjs +1 -0
- package/dist/index201.js +16 -0
- package/dist/index202.cjs +1 -0
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +81 -28
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +64 -14
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +25 -22
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +1014 -33
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +22 -96
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +108 -25
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +15 -9
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +20 -66
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +81 -11
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +91 -29
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +14 -41
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +93 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +22 -62
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +84 -22
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +85 -33
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +407 -25
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +170 -25
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +28 -154
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +158 -33
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +104 -45
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +337 -140
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +96 -124
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +319 -23
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +205 -81
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +33 -220
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +161 -163
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +20 -125
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +24 -14
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +167 -7
- package/dist/index5.js +26 -14
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +44 -15
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +15 -18
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +3 -17
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +5 -5
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +19 -4
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +24 -6
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +66 -4
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +14 -5
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +4 -8
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +50 -67
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +85 -46
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +6 -10
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +25 -199
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +13 -122
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +9 -30
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +3 -20
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +24 -66
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +68 -30
- package/dist/index67.cjs +38 -1
- package/dist/index67.js +3 -11
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +12 -279
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +50 -155
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +29 -85
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +115 -19
- package/dist/index71.cjs +4 -1
- package/dist/index71.js +6 -9
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +12 -12
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +539 -6
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +197 -6
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +120 -9
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +912 -8
- package/dist/index77.cjs +3 -1
- package/dist/index77.js +76 -4
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +120 -6
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +12 -6
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +35 -62
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +14 -8
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +113 -9
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +725 -13
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +346 -9
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +74 -9
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +148 -4
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +31 -42
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +12 -380
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +345 -37
- package/dist/index89.cjs +20 -1
- package/dist/index89.js +40 -18
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +85 -17
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +113 -56
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +272 -51
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +129 -50
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +13 -54
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +28 -55
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +525 -80
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +75 -61
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +67 -583
- package/dist/index98.cjs +1 -9
- package/dist/index98.js +32 -27
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +17 -49
- package/dist/ui/alert-dialog.d.ts +15 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert.d.ts +10 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +4 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/avatar.d.ts +7 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/breadcrumb.d.ts +12 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/carousel.d.ts +20 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/context-menu.d.ts +26 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/drawer.d.ts +14 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/index.d.ts +23 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-otp.d.ts +12 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/menubar.d.ts +27 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/navigation-menu.d.ts +15 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/pagination.d.ts +14 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/resizable.d.ts +9 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/sheet.d.ts +14 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sidebar.d.ts +70 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/toggle-group.d.ts +8 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle.d.ts +10 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/package.json +23 -5
package/dist/index88.js
CHANGED
|
@@ -1,40 +1,348 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
//#region ../../node_modules/.pnpm/input-otp@1.4.2_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/input-otp/dist/index.mjs
|
|
3
|
+
var t = Object.defineProperty, n = Object.defineProperties, r = Object.getOwnPropertyDescriptors, i = Object.getOwnPropertySymbols, a = Object.prototype.hasOwnProperty, o = Object.prototype.propertyIsEnumerable, s = (e, n, r) => n in e ? t(e, n, {
|
|
4
|
+
enumerable: !0,
|
|
5
|
+
configurable: !0,
|
|
6
|
+
writable: !0,
|
|
7
|
+
value: r
|
|
8
|
+
}) : e[n] = r, c = (e, t) => {
|
|
9
|
+
for (var n in t ||= {}) a.call(t, n) && s(e, n, t[n]);
|
|
10
|
+
if (i) for (var n of i(t)) o.call(t, n) && s(e, n, t[n]);
|
|
11
|
+
return e;
|
|
12
|
+
}, l = (e, t) => n(e, r(t)), u = (e, t) => {
|
|
13
|
+
var n = {};
|
|
14
|
+
for (var r in e) a.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
15
|
+
if (e != null && i) for (var r of i(e)) t.indexOf(r) < 0 && o.call(e, r) && (n[r] = e[r]);
|
|
16
|
+
return n;
|
|
17
|
+
};
|
|
18
|
+
function d(e) {
|
|
19
|
+
return [
|
|
20
|
+
setTimeout(e, 0),
|
|
21
|
+
setTimeout(e, 10),
|
|
22
|
+
setTimeout(e, 50)
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
function f(t) {
|
|
26
|
+
let n = e.useRef();
|
|
27
|
+
return e.useEffect(() => {
|
|
28
|
+
n.current = t;
|
|
29
|
+
}), n.current;
|
|
30
|
+
}
|
|
31
|
+
var p = 18, m = 40, h = `${m}px`, g = [
|
|
32
|
+
"[data-lastpass-icon-root]",
|
|
33
|
+
"com-1password-button",
|
|
34
|
+
"[data-dashlanecreated]",
|
|
35
|
+
"[style$=\"2147483647 !important;\"]"
|
|
36
|
+
].join(",");
|
|
37
|
+
function _({ containerRef: t, inputRef: n, pushPasswordManagerStrategy: r, isFocused: i }) {
|
|
38
|
+
let [a, o] = e.useState(!1), [s, c] = e.useState(!1), [l, u] = e.useState(!1), d = e.useMemo(() => r === "none" ? !1 : (r === "increase-width" || r === "experimental-no-flickering") && a && s, [
|
|
39
|
+
a,
|
|
40
|
+
s,
|
|
41
|
+
r
|
|
42
|
+
]), f = e.useCallback(() => {
|
|
43
|
+
let e = t.current, i = n.current;
|
|
44
|
+
if (!e || !i || l || r === "none") return;
|
|
45
|
+
let a = e, s = a.getBoundingClientRect().left + a.offsetWidth, c = a.getBoundingClientRect().top + a.offsetHeight / 2, d = s - p, f = c;
|
|
46
|
+
document.querySelectorAll(g).length === 0 && document.elementFromPoint(d, f) === e || (o(!0), u(!0));
|
|
47
|
+
}, [
|
|
48
|
+
t,
|
|
49
|
+
n,
|
|
50
|
+
l,
|
|
51
|
+
r
|
|
52
|
+
]);
|
|
53
|
+
return e.useEffect(() => {
|
|
54
|
+
let e = t.current;
|
|
55
|
+
if (!e || r === "none") return;
|
|
56
|
+
function n() {
|
|
57
|
+
c(window.innerWidth - e.getBoundingClientRect().right >= m);
|
|
58
|
+
}
|
|
59
|
+
n();
|
|
60
|
+
let i = setInterval(n, 1e3);
|
|
61
|
+
return () => {
|
|
62
|
+
clearInterval(i);
|
|
63
|
+
};
|
|
64
|
+
}, [t, r]), e.useEffect(() => {
|
|
65
|
+
let e = i || document.activeElement === n.current;
|
|
66
|
+
if (r === "none" || !e) return;
|
|
67
|
+
let t = setTimeout(f, 0), a = setTimeout(f, 2e3), o = setTimeout(f, 5e3), s = setTimeout(() => {
|
|
68
|
+
u(!0);
|
|
69
|
+
}, 6e3);
|
|
70
|
+
return () => {
|
|
71
|
+
clearTimeout(t), clearTimeout(a), clearTimeout(o), clearTimeout(s);
|
|
72
|
+
};
|
|
73
|
+
}, [
|
|
74
|
+
n,
|
|
75
|
+
i,
|
|
76
|
+
r,
|
|
77
|
+
f
|
|
78
|
+
]), {
|
|
79
|
+
hasPWMBadge: a,
|
|
80
|
+
willPushPWMBadge: d,
|
|
81
|
+
PWM_BADGE_SPACE_WIDTH: h
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
var v = e.createContext({}), y = e.forwardRef((t, n) => {
|
|
85
|
+
var r = t, { value: i, onChange: a, maxLength: o, textAlign: s = "left", pattern: p, placeholder: m, inputMode: h = "numeric", onComplete: g, pushPasswordManagerStrategy: y = "increase-width", pasteTransformer: S, containerClassName: C, noScriptCSSFallback: w = x, render: T, children: E } = r, D = u(r, [
|
|
86
|
+
"value",
|
|
87
|
+
"onChange",
|
|
88
|
+
"maxLength",
|
|
89
|
+
"textAlign",
|
|
90
|
+
"pattern",
|
|
91
|
+
"placeholder",
|
|
92
|
+
"inputMode",
|
|
93
|
+
"onComplete",
|
|
94
|
+
"pushPasswordManagerStrategy",
|
|
95
|
+
"pasteTransformer",
|
|
96
|
+
"containerClassName",
|
|
97
|
+
"noScriptCSSFallback",
|
|
98
|
+
"render",
|
|
99
|
+
"children"
|
|
100
|
+
]), O;
|
|
101
|
+
let [ee, k] = e.useState(typeof D.defaultValue == "string" ? D.defaultValue : ""), A = i ?? ee, j = f(A), M = e.useCallback((e) => {
|
|
102
|
+
a?.(e), k(e);
|
|
103
|
+
}, [a]), N = e.useMemo(() => p ? typeof p == "string" ? new RegExp(p) : p : null, [p]), P = e.useRef(null), F = e.useRef(null), I = e.useRef({
|
|
104
|
+
value: A,
|
|
105
|
+
onChange: M,
|
|
106
|
+
isIOS: typeof window < "u" && ((O = window == null ? void 0 : window.CSS)?.supports)?.call(O, "-webkit-touch-callout", "none")
|
|
107
|
+
}), L = e.useRef({ prev: [
|
|
108
|
+
P.current?.selectionStart,
|
|
109
|
+
P.current?.selectionEnd,
|
|
110
|
+
P.current?.selectionDirection
|
|
111
|
+
] });
|
|
112
|
+
e.useImperativeHandle(n, () => P.current, []), e.useEffect(() => {
|
|
113
|
+
let e = P.current, t = F.current;
|
|
114
|
+
if (!e || !t) return;
|
|
115
|
+
I.current.value !== e.value && I.current.onChange(e.value), L.current.prev = [
|
|
116
|
+
e.selectionStart,
|
|
117
|
+
e.selectionEnd,
|
|
118
|
+
e.selectionDirection
|
|
119
|
+
];
|
|
120
|
+
function n() {
|
|
121
|
+
if (document.activeElement !== e) {
|
|
122
|
+
U(null), G(null);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
let t = e.selectionStart, n = e.selectionEnd, r = e.selectionDirection, i = e.maxLength, a = e.value, o = L.current.prev, s = -1, c = -1, l;
|
|
126
|
+
if (a.length !== 0 && t !== null && n !== null) {
|
|
127
|
+
let e = t === n, r = t === a.length && a.length < i;
|
|
128
|
+
if (e && !r) {
|
|
129
|
+
let e = t;
|
|
130
|
+
if (e === 0) s = 0, c = 1, l = "forward";
|
|
131
|
+
else if (e === i) s = e - 1, c = e, l = "backward";
|
|
132
|
+
else if (i > 1 && a.length > 1) {
|
|
133
|
+
let t = 0;
|
|
134
|
+
if (o[0] !== null && o[1] !== null) {
|
|
135
|
+
l = e < o[1] ? "backward" : "forward";
|
|
136
|
+
let n = o[0] === o[1] && o[0] < i;
|
|
137
|
+
l === "backward" && !n && (t = -1);
|
|
138
|
+
}
|
|
139
|
+
s = t + e, c = t + e + 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
s !== -1 && c !== -1 && s !== c && P.current.setSelectionRange(s, c, l);
|
|
143
|
+
}
|
|
144
|
+
let u = s === -1 ? t : s, d = c === -1 ? n : c, f = l ?? r;
|
|
145
|
+
U(u), G(d), L.current.prev = [
|
|
146
|
+
u,
|
|
147
|
+
d,
|
|
148
|
+
f
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
if (document.addEventListener("selectionchange", n, { capture: !0 }), n(), document.activeElement === e && V(!0), !document.getElementById("input-otp-style")) {
|
|
152
|
+
let e = document.createElement("style");
|
|
153
|
+
if (e.id = "input-otp-style", document.head.appendChild(e), e.sheet) {
|
|
154
|
+
let t = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
|
|
155
|
+
b(e.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), b(e.sheet, `[data-input-otp]:autofill { ${t} }`), b(e.sheet, `[data-input-otp]:-webkit-autofill { ${t} }`), b(e.sheet, "@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"), b(e.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
|
|
156
|
+
}
|
|
35
157
|
}
|
|
36
|
-
|
|
158
|
+
let r = () => {
|
|
159
|
+
t && t.style.setProperty("--root-height", `${e.clientHeight}px`);
|
|
160
|
+
};
|
|
161
|
+
r();
|
|
162
|
+
let i = new ResizeObserver(r);
|
|
163
|
+
return i.observe(e), () => {
|
|
164
|
+
document.removeEventListener("selectionchange", n, { capture: !0 }), i.disconnect();
|
|
165
|
+
};
|
|
166
|
+
}, []);
|
|
167
|
+
let [R, z] = e.useState(!1), [B, V] = e.useState(!1), [H, U] = e.useState(null), [W, G] = e.useState(null);
|
|
168
|
+
e.useEffect(() => {
|
|
169
|
+
d(() => {
|
|
170
|
+
var e;
|
|
171
|
+
(e = P.current) == null || e.dispatchEvent(new Event("input"));
|
|
172
|
+
let t = P.current?.selectionStart, n = P.current?.selectionEnd, r = P.current?.selectionDirection;
|
|
173
|
+
t !== null && n !== null && (U(t), G(n), L.current.prev = [
|
|
174
|
+
t,
|
|
175
|
+
n,
|
|
176
|
+
r
|
|
177
|
+
]);
|
|
178
|
+
});
|
|
179
|
+
}, [A, B]), e.useEffect(() => {
|
|
180
|
+
j !== void 0 && A !== j && j.length < o && A.length === o && g?.(A);
|
|
181
|
+
}, [
|
|
182
|
+
o,
|
|
183
|
+
g,
|
|
184
|
+
j,
|
|
185
|
+
A
|
|
186
|
+
]);
|
|
187
|
+
let K = _({
|
|
188
|
+
containerRef: F,
|
|
189
|
+
inputRef: P,
|
|
190
|
+
pushPasswordManagerStrategy: y,
|
|
191
|
+
isFocused: B
|
|
192
|
+
}), q = e.useCallback((e) => {
|
|
193
|
+
let t = e.currentTarget.value.slice(0, o);
|
|
194
|
+
if (t.length > 0 && N && !N.test(t)) {
|
|
195
|
+
e.preventDefault();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
typeof j == "string" && t.length < j.length && document.dispatchEvent(new Event("selectionchange")), M(t);
|
|
199
|
+
}, [
|
|
200
|
+
o,
|
|
201
|
+
M,
|
|
202
|
+
j,
|
|
203
|
+
N
|
|
204
|
+
]), J = e.useCallback(() => {
|
|
205
|
+
var e;
|
|
206
|
+
if (P.current) {
|
|
207
|
+
let t = Math.min(P.current.value.length, o - 1), n = P.current.value.length;
|
|
208
|
+
(e = P.current) == null || e.setSelectionRange(t, n), U(t), G(n);
|
|
209
|
+
}
|
|
210
|
+
V(!0);
|
|
211
|
+
}, [o]), Y = e.useCallback((e) => {
|
|
212
|
+
let t = P.current;
|
|
213
|
+
if (!S && (!I.current.isIOS || !e.clipboardData || !t)) return;
|
|
214
|
+
let n = e.clipboardData.getData("text/plain"), r = S ? S(n) : n;
|
|
215
|
+
e.preventDefault();
|
|
216
|
+
let i = P.current?.selectionStart, a = P.current?.selectionEnd, s = (i === a ? A.slice(0, i) + r + A.slice(i) : A.slice(0, i) + r + A.slice(a)).slice(0, o);
|
|
217
|
+
if (s.length > 0 && N && !N.test(s)) return;
|
|
218
|
+
t.value = s, M(s);
|
|
219
|
+
let c = Math.min(s.length, o - 1), l = s.length;
|
|
220
|
+
t.setSelectionRange(c, l), U(c), G(l);
|
|
221
|
+
}, [
|
|
222
|
+
o,
|
|
223
|
+
M,
|
|
224
|
+
N,
|
|
225
|
+
A
|
|
226
|
+
]), X = e.useMemo(() => ({
|
|
227
|
+
position: "relative",
|
|
228
|
+
cursor: D.disabled ? "default" : "text",
|
|
229
|
+
userSelect: "none",
|
|
230
|
+
WebkitUserSelect: "none",
|
|
231
|
+
pointerEvents: "none"
|
|
232
|
+
}), [D.disabled]), Z = e.useMemo(() => ({
|
|
233
|
+
position: "absolute",
|
|
234
|
+
inset: 0,
|
|
235
|
+
width: K.willPushPWMBadge ? `calc(100% + ${K.PWM_BADGE_SPACE_WIDTH})` : "100%",
|
|
236
|
+
clipPath: K.willPushPWMBadge ? `inset(0 ${K.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0,
|
|
237
|
+
height: "100%",
|
|
238
|
+
display: "flex",
|
|
239
|
+
textAlign: s,
|
|
240
|
+
opacity: "1",
|
|
241
|
+
color: "transparent",
|
|
242
|
+
pointerEvents: "all",
|
|
243
|
+
background: "transparent",
|
|
244
|
+
caretColor: "transparent",
|
|
245
|
+
border: "0 solid transparent",
|
|
246
|
+
outline: "0 solid transparent",
|
|
247
|
+
boxShadow: "none",
|
|
248
|
+
lineHeight: "1",
|
|
249
|
+
letterSpacing: "-.5em",
|
|
250
|
+
fontSize: "var(--root-height)",
|
|
251
|
+
fontFamily: "monospace",
|
|
252
|
+
fontVariantNumeric: "tabular-nums"
|
|
253
|
+
}), [
|
|
254
|
+
K.PWM_BADGE_SPACE_WIDTH,
|
|
255
|
+
K.willPushPWMBadge,
|
|
256
|
+
s
|
|
257
|
+
]), Q = e.useMemo(() => e.createElement("input", l(c({ autoComplete: D.autoComplete || "one-time-code" }, D), {
|
|
258
|
+
"data-input-otp": !0,
|
|
259
|
+
"data-input-otp-placeholder-shown": A.length === 0 || void 0,
|
|
260
|
+
"data-input-otp-mss": H,
|
|
261
|
+
"data-input-otp-mse": W,
|
|
262
|
+
inputMode: h,
|
|
263
|
+
pattern: N?.source,
|
|
264
|
+
"aria-placeholder": m,
|
|
265
|
+
style: Z,
|
|
266
|
+
maxLength: o,
|
|
267
|
+
value: A,
|
|
268
|
+
ref: P,
|
|
269
|
+
onPaste: (e) => {
|
|
270
|
+
var t;
|
|
271
|
+
Y(e), (t = D.onPaste) == null || t.call(D, e);
|
|
272
|
+
},
|
|
273
|
+
onChange: q,
|
|
274
|
+
onMouseOver: (e) => {
|
|
275
|
+
var t;
|
|
276
|
+
z(!0), (t = D.onMouseOver) == null || t.call(D, e);
|
|
277
|
+
},
|
|
278
|
+
onMouseLeave: (e) => {
|
|
279
|
+
var t;
|
|
280
|
+
z(!1), (t = D.onMouseLeave) == null || t.call(D, e);
|
|
281
|
+
},
|
|
282
|
+
onFocus: (e) => {
|
|
283
|
+
var t;
|
|
284
|
+
J(), (t = D.onFocus) == null || t.call(D, e);
|
|
285
|
+
},
|
|
286
|
+
onBlur: (e) => {
|
|
287
|
+
var t;
|
|
288
|
+
V(!1), (t = D.onBlur) == null || t.call(D, e);
|
|
289
|
+
}
|
|
290
|
+
})), [
|
|
291
|
+
q,
|
|
292
|
+
J,
|
|
293
|
+
Y,
|
|
294
|
+
h,
|
|
295
|
+
Z,
|
|
296
|
+
o,
|
|
297
|
+
W,
|
|
298
|
+
H,
|
|
299
|
+
D,
|
|
300
|
+
N?.source,
|
|
301
|
+
A
|
|
302
|
+
]), $ = e.useMemo(() => ({
|
|
303
|
+
slots: Array.from({ length: o }).map((e, t) => {
|
|
304
|
+
let n = B && H !== null && W !== null && (H === W && t === H || t >= H && t < W), r = A[t] === void 0 ? null : A[t];
|
|
305
|
+
return {
|
|
306
|
+
char: r,
|
|
307
|
+
placeholderChar: A[0] === void 0 ? m?.[t] ?? null : null,
|
|
308
|
+
isActive: n,
|
|
309
|
+
hasFakeCaret: n && r === null
|
|
310
|
+
};
|
|
311
|
+
}),
|
|
312
|
+
isFocused: B,
|
|
313
|
+
isHovering: !D.disabled && R
|
|
314
|
+
}), [
|
|
315
|
+
B,
|
|
316
|
+
R,
|
|
317
|
+
o,
|
|
318
|
+
W,
|
|
319
|
+
H,
|
|
320
|
+
D.disabled,
|
|
321
|
+
A
|
|
322
|
+
]), te = e.useMemo(() => T ? T($) : e.createElement(v.Provider, { value: $ }, E), [
|
|
323
|
+
E,
|
|
324
|
+
$,
|
|
325
|
+
T
|
|
326
|
+
]);
|
|
327
|
+
return e.createElement(e.Fragment, null, w !== null && e.createElement("noscript", null, e.createElement("style", null, w)), e.createElement("div", {
|
|
328
|
+
ref: F,
|
|
329
|
+
"data-input-otp-container": !0,
|
|
330
|
+
style: X,
|
|
331
|
+
className: C
|
|
332
|
+
}, te, e.createElement("div", { style: {
|
|
333
|
+
position: "absolute",
|
|
334
|
+
inset: 0,
|
|
335
|
+
pointerEvents: "none"
|
|
336
|
+
} }, Q)));
|
|
337
|
+
});
|
|
338
|
+
y.displayName = "Input";
|
|
339
|
+
function b(e, t) {
|
|
340
|
+
try {
|
|
341
|
+
e.insertRule(t);
|
|
342
|
+
} catch {
|
|
343
|
+
console.error("input-otp could not insert CSS rule:", t);
|
|
37
344
|
}
|
|
38
|
-
}
|
|
345
|
+
}
|
|
346
|
+
var x = "\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n@media (prefers-color-scheme: dark) {\n [data-input-otp] {\n --nojs-bg: black !important;\n --nojs-fg: white !important;\n }\n}";
|
|
39
347
|
//#endregion
|
|
40
|
-
export {
|
|
348
|
+
export { y as Lt, v as jt };
|
package/dist/index89.cjs
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require("./index2.cjs");let t=require("react");t=e.__toESM(t,1);var n=Object.defineProperty,r=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,c=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var n in t||={})o.call(t,n)&&c(e,n,t[n]);if(a)for(var n of a(t))s.call(t,n)&&c(e,n,t[n]);return e},u=(e,t)=>r(e,i(t)),d=(e,t)=>{var n={};for(var r in e)o.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&a)for(var r of a(e))t.indexOf(r)<0&&s.call(e,r)&&(n[r]=e[r]);return n};function f(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}function p(e){let n=t.useRef();return t.useEffect(()=>{n.current=e}),n.current}var m=18,h=40,g=`${h}px`,_=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function ee({containerRef:e,inputRef:n,pushPasswordManagerStrategy:r,isFocused:i}){let[a,o]=t.useState(!1),[s,c]=t.useState(!1),[l,u]=t.useState(!1),d=t.useMemo(()=>r===`none`?!1:(r===`increase-width`||r===`experimental-no-flickering`)&&a&&s,[a,s,r]),f=t.useCallback(()=>{let t=e.current,i=n.current;if(!t||!i||l||r===`none`)return;let a=t,s=a.getBoundingClientRect().left+a.offsetWidth,c=a.getBoundingClientRect().top+a.offsetHeight/2,d=s-m,f=c;document.querySelectorAll(_).length===0&&document.elementFromPoint(d,f)===t||(o(!0),u(!0))},[e,n,l,r]);return t.useEffect(()=>{let t=e.current;if(!t||r===`none`)return;function n(){c(window.innerWidth-t.getBoundingClientRect().right>=h)}n();let i=setInterval(n,1e3);return()=>{clearInterval(i)}},[e,r]),t.useEffect(()=>{let e=i||document.activeElement===n.current;if(r===`none`||!e)return;let t=setTimeout(f,0),a=setTimeout(f,2e3),o=setTimeout(f,5e3),s=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(t),clearTimeout(a),clearTimeout(o),clearTimeout(s)}},[n,i,r,f]),{hasPWMBadge:a,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:g}}var v=t.createContext({}),y=t.forwardRef((e,n)=>{var r=e,{value:i,onChange:a,maxLength:o,textAlign:s=`left`,pattern:c,placeholder:m,inputMode:h=`numeric`,onComplete:g,pushPasswordManagerStrategy:_=`increase-width`,pasteTransformer:y,containerClassName:S,noScriptCSSFallback:C=x,render:w,children:T}=r,E=d(r,[`value`,`onChange`,`maxLength`,`textAlign`,`pattern`,`placeholder`,`inputMode`,`onComplete`,`pushPasswordManagerStrategy`,`pasteTransformer`,`containerClassName`,`noScriptCSSFallback`,`render`,`children`]),D;let[O,k]=t.useState(typeof E.defaultValue==`string`?E.defaultValue:``),A=i??O,j=p(A),M=t.useCallback(e=>{a?.(e),k(e)},[a]),N=t.useMemo(()=>c?typeof c==`string`?new RegExp(c):c:null,[c]),P=t.useRef(null),F=t.useRef(null),I=t.useRef({value:A,onChange:M,isIOS:typeof window<`u`&&((D=window==null?void 0:window.CSS)?.supports)?.call(D,`-webkit-touch-callout`,`none`)}),L=t.useRef({prev:[P.current?.selectionStart,P.current?.selectionEnd,P.current?.selectionDirection]});t.useImperativeHandle(n,()=>P.current,[]),t.useEffect(()=>{let e=P.current,t=F.current;if(!e||!t)return;I.current.value!==e.value&&I.current.onChange(e.value),L.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection];function n(){if(document.activeElement!==e){U(null),G(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=L.current.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let e=t===n,r=t===a.length&&a.length<i;if(e&&!r){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&P.current.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;U(u),G(d),L.current.prev=[u,d,f]}if(document.addEventListener(`selectionchange`,n,{capture:!0}),n(),document.activeElement===e&&V(!0),!document.getElementById(`input-otp-style`)){let e=document.createElement(`style`);if(e.id=`input-otp-style`,document.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;b(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),b(e.sheet,`[data-input-otp]:autofill { ${t} }`),b(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),b(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),b(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let r=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};r();let i=new ResizeObserver(r);return i.observe(e),()=>{document.removeEventListener(`selectionchange`,n,{capture:!0}),i.disconnect()}},[]);let[R,z]=t.useState(!1),[B,V]=t.useState(!1),[H,U]=t.useState(null),[W,G]=t.useState(null);t.useEffect(()=>{f(()=>{var e;(e=P.current)==null||e.dispatchEvent(new Event(`input`));let t=P.current?.selectionStart,n=P.current?.selectionEnd,r=P.current?.selectionDirection;t!==null&&n!==null&&(U(t),G(n),L.current.prev=[t,n,r])})},[A,B]),t.useEffect(()=>{j!==void 0&&A!==j&&j.length<o&&A.length===o&&g?.(A)},[o,g,j,A]);let K=ee({containerRef:F,inputRef:P,pushPasswordManagerStrategy:_,isFocused:B}),q=t.useCallback(e=>{let t=e.currentTarget.value.slice(0,o);if(t.length>0&&N&&!N.test(t)){e.preventDefault();return}typeof j==`string`&&t.length<j.length&&document.dispatchEvent(new Event(`selectionchange`)),M(t)},[o,M,j,N]),J=t.useCallback(()=>{var e;if(P.current){let t=Math.min(P.current.value.length,o-1),n=P.current.value.length;(e=P.current)==null||e.setSelectionRange(t,n),U(t),G(n)}V(!0)},[o]),Y=t.useCallback(e=>{let t=P.current;if(!y&&(!I.current.isIOS||!e.clipboardData||!t))return;let n=e.clipboardData.getData(`text/plain`),r=y?y(n):n;e.preventDefault();let i=P.current?.selectionStart,a=P.current?.selectionEnd,s=(i===a?A.slice(0,i)+r+A.slice(i):A.slice(0,i)+r+A.slice(a)).slice(0,o);if(s.length>0&&N&&!N.test(s))return;t.value=s,M(s);let c=Math.min(s.length,o-1),l=s.length;t.setSelectionRange(c,l),U(c),G(l)},[o,M,N,A]),X=t.useMemo(()=>({position:`relative`,cursor:E.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`}),[E.disabled]),Z=t.useMemo(()=>({position:`absolute`,inset:0,width:K.willPushPWMBadge?`calc(100% + ${K.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:K.willPushPWMBadge?`inset(0 ${K.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:s,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`}),[K.PWM_BADGE_SPACE_WIDTH,K.willPushPWMBadge,s]),Q=t.useMemo(()=>t.createElement(`input`,u(l({autoComplete:E.autoComplete||`one-time-code`},E),{"data-input-otp":!0,"data-input-otp-placeholder-shown":A.length===0||void 0,"data-input-otp-mss":H,"data-input-otp-mse":W,inputMode:h,pattern:N?.source,"aria-placeholder":m,style:Z,maxLength:o,value:A,ref:P,onPaste:e=>{var t;Y(e),(t=E.onPaste)==null||t.call(E,e)},onChange:q,onMouseOver:e=>{var t;z(!0),(t=E.onMouseOver)==null||t.call(E,e)},onMouseLeave:e=>{var t;z(!1),(t=E.onMouseLeave)==null||t.call(E,e)},onFocus:e=>{var t;J(),(t=E.onFocus)==null||t.call(E,e)},onBlur:e=>{var t;V(!1),(t=E.onBlur)==null||t.call(E,e)}})),[q,J,Y,h,Z,o,W,H,E,N?.source,A]),$=t.useMemo(()=>({slots:Array.from({length:o}).map((e,t)=>{let n=B&&H!==null&&W!==null&&(H===W&&t===H||t>=H&&t<W),r=A[t]===void 0?null:A[t];return{char:r,placeholderChar:A[0]===void 0?m?.[t]??null:null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:B,isHovering:!E.disabled&&R}),[B,R,o,W,H,E.disabled,A]),te=t.useMemo(()=>w?w($):t.createElement(v.Provider,{value:$},T),[T,$,w]);return t.createElement(t.Fragment,null,C!==null&&t.createElement(`noscript`,null,t.createElement(`style`,null,C)),t.createElement(`div`,{ref:F,"data-input-otp-container":!0,style:X,className:S},te,t.createElement(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`}},Q)))});y.displayName=`Input`;function b(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}var x=`
|
|
2
|
+
[data-input-otp] {
|
|
3
|
+
--nojs-bg: white !important;
|
|
4
|
+
--nojs-fg: black !important;
|
|
5
|
+
|
|
6
|
+
background-color: var(--nojs-bg) !important;
|
|
7
|
+
color: var(--nojs-fg) !important;
|
|
8
|
+
caret-color: var(--nojs-fg) !important;
|
|
9
|
+
letter-spacing: .25em !important;
|
|
10
|
+
text-align: center !important;
|
|
11
|
+
border: 1px solid var(--nojs-fg) !important;
|
|
12
|
+
border-radius: 4px !important;
|
|
13
|
+
width: 100% !important;
|
|
14
|
+
}
|
|
15
|
+
@media (prefers-color-scheme: dark) {
|
|
16
|
+
[data-input-otp] {
|
|
17
|
+
--nojs-bg: black !important;
|
|
18
|
+
--nojs-fg: white !important;
|
|
19
|
+
}
|
|
20
|
+
}`;exports.Lt=y,exports.jt=v;
|
package/dist/index89.js
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function r
|
|
9
|
-
return
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "./index3.js";
|
|
3
|
+
import { Lt as t, jt as n } from "./index88.js";
|
|
4
|
+
import { MinusIcon as r } from "lucide-react";
|
|
5
|
+
import * as i from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/ui/input-otp.tsx
|
|
8
|
+
function s({ className: n, containerClassName: r, ...i }) {
|
|
9
|
+
return /* @__PURE__ */ a(t, {
|
|
10
|
+
"data-slot": "input-otp",
|
|
11
|
+
containerClassName: e("flex items-center gap-2 has-disabled:opacity-50", r),
|
|
12
|
+
className: e("disabled:cursor-not-allowed", n),
|
|
13
|
+
...i
|
|
14
|
+
});
|
|
10
15
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
16
|
+
function c({ className: t, ...n }) {
|
|
17
|
+
return /* @__PURE__ */ a("div", {
|
|
18
|
+
"data-slot": "input-otp-group",
|
|
19
|
+
className: e("flex items-center", t),
|
|
20
|
+
...n
|
|
21
|
+
});
|
|
13
22
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
|
|
23
|
+
function l({ index: t, className: r, ...s }) {
|
|
24
|
+
let { char: c, hasFakeCaret: l, isActive: u } = i.useContext(n)?.slots[t] ?? {};
|
|
25
|
+
return /* @__PURE__ */ o("div", {
|
|
26
|
+
"data-slot": "input-otp-slot",
|
|
27
|
+
"data-active": u,
|
|
28
|
+
className: e("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", r),
|
|
29
|
+
...s,
|
|
30
|
+
children: [c, l && /* @__PURE__ */ a("div", {
|
|
31
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
32
|
+
children: /* @__PURE__ */ a("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" })
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
17
35
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
function u({ ...e }) {
|
|
37
|
+
return /* @__PURE__ */ a("div", {
|
|
38
|
+
"data-slot": "input-otp-separator",
|
|
39
|
+
role: "separator",
|
|
40
|
+
...e,
|
|
41
|
+
children: /* @__PURE__ */ a(r, {})
|
|
42
|
+
});
|
|
21
43
|
}
|
|
22
44
|
//#endregion
|
|
23
|
-
export {
|
|
45
|
+
export { s as InputOTP, c as InputOTPGroup, u as InputOTPSeparator, l as InputOTPSlot };
|
package/dist/index9.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>e(t,`name`,{value:n,configurable:!0}),n=!!(typeof window<`u`&&window.document&&window.document.createElement);function r(e,n,{checkForDefaultPrevented:r=!0}={}){return t(function(t){if(e?.(t),r===!1||!t||!t.defaultPrevented)return n?.(t)},`handleEvent`)}t(r,`composeEventHandlers`);function i(e){if(!n)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}t(i,`getOwnerWindow`);function a(e){if(!n)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}t(a,`getOwnerDocument`);function o(e,t=!1){let{activeElement:n}=a(e);if(!n?.nodeName)return null;if(s(n)&&n.contentDocument)return o(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=a(n).getElementById(e);if(t)return t}}return n}t(o,`getActiveElement`);function s(e){return e.tagName===`IFRAME`}t(s,`isFrame`),exports.composeEventHandlers=r;
|
package/dist/index9.js
CHANGED
|
@@ -1,20 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
import * as r from "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContextScope as e } from "./index6.js";
|
|
3
|
+
import { useComposedRefs as t } from "./index7.js";
|
|
4
|
+
import { composeEventHandlers as n } from "./index8.js";
|
|
5
|
+
import * as r from "react";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
import * as a from "@radix-ui/react-dialog";
|
|
8
|
+
import { createDialogScope as o } from "@radix-ui/react-dialog";
|
|
9
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-alert-dialog@1.1.23_@types+react-dom@19.2.3_@types+react@19.2.17__@type_a115413e28d5eaa4b219b4b3475e6b12/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
|
|
10
|
+
var s = Object.defineProperty, c = (e, t) => s(e, "name", {
|
|
11
|
+
value: t,
|
|
12
|
+
configurable: !0
|
|
13
|
+
}), [l, u] = e("AlertDialog", [o]), d = o(), f = /* @__PURE__ */ c((e) => {
|
|
14
|
+
let { __scopeAlertDialog: t, ...n } = e, r = d(t);
|
|
15
|
+
return /* @__PURE__ */ i(a.Root, {
|
|
16
|
+
...r,
|
|
17
|
+
...n,
|
|
18
|
+
modal: !0
|
|
19
|
+
});
|
|
20
|
+
}, "AlertDialog"), p = r.forwardRef(/* @__PURE__ */ c(function(e, t) {
|
|
21
|
+
let { __scopeAlertDialog: n, ...r } = e, o = d(n);
|
|
22
|
+
return /* @__PURE__ */ i(a.Trigger, {
|
|
23
|
+
...o,
|
|
24
|
+
...r,
|
|
25
|
+
ref: t
|
|
26
|
+
});
|
|
27
|
+
}, "AlertDialogTrigger")), m = /* @__PURE__ */ c((e) => {
|
|
28
|
+
let { __scopeAlertDialog: t, ...n } = e, r = d(t);
|
|
29
|
+
return /* @__PURE__ */ i(a.Portal, {
|
|
30
|
+
...r,
|
|
31
|
+
...n
|
|
32
|
+
});
|
|
33
|
+
}, "AlertDialogPortal"), h = r.forwardRef(/* @__PURE__ */ c(function(e, t) {
|
|
34
|
+
let { __scopeAlertDialog: n, ...r } = e, o = d(n);
|
|
35
|
+
return /* @__PURE__ */ i(a.Overlay, {
|
|
36
|
+
...o,
|
|
37
|
+
...r,
|
|
38
|
+
ref: t
|
|
39
|
+
});
|
|
40
|
+
}, "AlertDialogOverlay")), [g, _] = l("AlertDialogContent"), v = r.forwardRef(/* @__PURE__ */ c(function(e, o) {
|
|
41
|
+
let { __scopeAlertDialog: s, children: c, ...l } = e, u = d(s), f = t(o, r.useRef(null)), p = r.useRef(null);
|
|
42
|
+
return /* @__PURE__ */ i(g, {
|
|
43
|
+
scope: s,
|
|
44
|
+
cancelRef: p,
|
|
45
|
+
children: /* @__PURE__ */ i(a.Content, {
|
|
46
|
+
role: "alertdialog",
|
|
47
|
+
...u,
|
|
48
|
+
...l,
|
|
49
|
+
ref: f,
|
|
50
|
+
onOpenAutoFocus: n(l.onOpenAutoFocus, (e) => {
|
|
51
|
+
e.preventDefault(), p.current?.focus({ preventScroll: !0 });
|
|
52
|
+
}),
|
|
53
|
+
onPointerDownOutside: (e) => e.preventDefault(),
|
|
54
|
+
onInteractOutside: (e) => e.preventDefault(),
|
|
55
|
+
children: c
|
|
16
56
|
})
|
|
17
57
|
});
|
|
18
|
-
}
|
|
58
|
+
}, "AlertDialogContent")), y = r.forwardRef(/* @__PURE__ */ c(function(e, t) {
|
|
59
|
+
let { __scopeAlertDialog: n, ...r } = e, o = d(n);
|
|
60
|
+
return /* @__PURE__ */ i(a.Title, {
|
|
61
|
+
...o,
|
|
62
|
+
...r,
|
|
63
|
+
ref: t
|
|
64
|
+
});
|
|
65
|
+
}, "AlertDialogTitle")), b = r.forwardRef(/* @__PURE__ */ c(function(e, t) {
|
|
66
|
+
let { __scopeAlertDialog: n, ...r } = e, o = d(n);
|
|
67
|
+
return /* @__PURE__ */ i(a.Description, {
|
|
68
|
+
...o,
|
|
69
|
+
...r,
|
|
70
|
+
ref: t
|
|
71
|
+
});
|
|
72
|
+
}, "AlertDialogDescription")), x = r.forwardRef(/* @__PURE__ */ c(function(e, t) {
|
|
73
|
+
let { __scopeAlertDialog: n, ...r } = e, o = d(n);
|
|
74
|
+
return /* @__PURE__ */ i(a.Close, {
|
|
75
|
+
...o,
|
|
76
|
+
...r,
|
|
77
|
+
ref: t
|
|
78
|
+
});
|
|
79
|
+
}, "AlertDialogAction")), S = "AlertDialogCancel", C = r.forwardRef(/* @__PURE__ */ c(function(e, n) {
|
|
80
|
+
let { __scopeAlertDialog: r, ...o } = e, { cancelRef: s } = _(S, r), c = d(r), l = t(n, s);
|
|
81
|
+
return /* @__PURE__ */ i(a.Close, {
|
|
82
|
+
...c,
|
|
83
|
+
...o,
|
|
84
|
+
ref: l
|
|
85
|
+
});
|
|
86
|
+
}, "AlertDialogCancel")), w = f, T = p, E = m, D = h, O = v, k = x, A = C, j = y, M = b;
|
|
19
87
|
//#endregion
|
|
20
|
-
export {
|
|
88
|
+
export { k as Action, A as Cancel, O as Content2, M as Description2, D as Overlay2, E as Portal2, w as Root2, j as Title2, T as Trigger2 };
|
package/dist/index90.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index89.cjs");let r=require("lucide-react"),i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");function o({className:e,containerClassName:r,...i}){return(0,a.jsx)(n.Lt,{"data-slot":`input-otp`,containerClassName:t.cn(`flex items-center gap-2 has-disabled:opacity-50`,r),className:t.cn(`disabled:cursor-not-allowed`,e),...i})}function s({className:e,...n}){return(0,a.jsx)(`div`,{"data-slot":`input-otp-group`,className:t.cn(`flex items-center`,e),...n})}function c({index:e,className:r,...o}){let{char:s,hasFakeCaret:c,isActive:l}=i.useContext(n.jt)?.slots[e]??{};return(0,a.jsxs)(`div`,{"data-slot":`input-otp-slot`,"data-active":l,className:t.cn(`data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]`,r),...o,children:[s,c&&(0,a.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,a.jsx)(`div`,{className:`animate-caret-blink bg-foreground h-4 w-px duration-1000`})})]})}function l({...e}){return(0,a.jsx)(`div`,{"data-slot":`input-otp-separator`,role:`separator`,...e,children:(0,a.jsx)(r.MinusIcon,{})})}exports.InputOTP=o,exports.InputOTPGroup=s,exports.InputOTPSeparator=l,exports.InputOTPSlot=c;
|