@zentauri-ui/zentauri-components 1.2.0 → 1.3.0
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/README.md +66 -38
- package/dist/accordion-base-qVomr7f_.d.mts +66 -0
- package/dist/accordion-base-qVomr7f_.d.ts +66 -0
- package/dist/avatar-base-s4dYg-24.d.mts +49 -0
- package/dist/avatar-base-s4dYg-24.d.ts +49 -0
- package/dist/card-base-CIGac8D_.d.mts +70 -0
- package/dist/card-base-CIGac8D_.d.ts +70 -0
- package/dist/chunk-2P3UU2J3.mjs +510 -0
- package/dist/chunk-2P3UU2J3.mjs.map +1 -0
- package/dist/chunk-2PQEXQVR.js +223 -0
- package/dist/chunk-2PQEXQVR.js.map +1 -0
- package/dist/chunk-3OR47XMY.js +273 -0
- package/dist/chunk-3OR47XMY.js.map +1 -0
- package/dist/chunk-4B7KGBQB.js +206 -0
- package/dist/chunk-4B7KGBQB.js.map +1 -0
- package/dist/chunk-5QB2KNZQ.js +148 -0
- package/dist/chunk-5QB2KNZQ.js.map +1 -0
- package/dist/chunk-6I7X5BF2.js +520 -0
- package/dist/chunk-6I7X5BF2.js.map +1 -0
- package/dist/chunk-7HL3A4YF.mjs +214 -0
- package/dist/chunk-7HL3A4YF.mjs.map +1 -0
- package/dist/chunk-AOEI4V3W.mjs +286 -0
- package/dist/chunk-AOEI4V3W.mjs.map +1 -0
- package/dist/chunk-BVXTOEBI.mjs +259 -0
- package/dist/chunk-BVXTOEBI.mjs.map +1 -0
- package/dist/chunk-C2FCPQTO.js +279 -0
- package/dist/chunk-C2FCPQTO.js.map +1 -0
- package/dist/chunk-E3DZNJAD.js +128 -0
- package/dist/chunk-E3DZNJAD.js.map +1 -0
- package/dist/chunk-FLILFCQE.mjs +197 -0
- package/dist/chunk-FLILFCQE.mjs.map +1 -0
- package/dist/chunk-IXDJ3IPG.mjs +315 -0
- package/dist/chunk-IXDJ3IPG.mjs.map +1 -0
- package/dist/chunk-JQ5TIJ4F.mjs +68 -0
- package/dist/chunk-JQ5TIJ4F.mjs.map +1 -0
- package/dist/chunk-LVUPECBT.mjs +217 -0
- package/dist/chunk-LVUPECBT.mjs.map +1 -0
- package/dist/chunk-N4NO3SYL.js +328 -0
- package/dist/chunk-N4NO3SYL.js.map +1 -0
- package/dist/chunk-OJ67PZ6N.js +175 -0
- package/dist/chunk-OJ67PZ6N.js.map +1 -0
- package/dist/chunk-P5HUBXUX.js +231 -0
- package/dist/chunk-P5HUBXUX.js.map +1 -0
- package/dist/chunk-PCK6LX3K.js +253 -0
- package/dist/chunk-PCK6LX3K.js.map +1 -0
- package/dist/chunk-PGH27VTL.mjs +316 -0
- package/dist/chunk-PGH27VTL.mjs.map +1 -0
- package/dist/chunk-QZKMFSH5.js +288 -0
- package/dist/chunk-QZKMFSH5.js.map +1 -0
- package/dist/chunk-RDSPHBHK.mjs +221 -0
- package/dist/chunk-RDSPHBHK.mjs.map +1 -0
- package/dist/chunk-U4YQCAXW.js +204 -0
- package/dist/chunk-U4YQCAXW.js.map +1 -0
- package/dist/chunk-UBFKTC2P.mjs +268 -0
- package/dist/chunk-UBFKTC2P.mjs.map +1 -0
- package/dist/chunk-UOFTZKMM.js +229 -0
- package/dist/chunk-UOFTZKMM.js.map +1 -0
- package/dist/chunk-UXGHUBNJ.mjs +240 -0
- package/dist/chunk-UXGHUBNJ.mjs.map +1 -0
- package/dist/chunk-W6PRMYUC.mjs +169 -0
- package/dist/chunk-W6PRMYUC.mjs.map +1 -0
- package/dist/chunk-WDCIZHXY.mjs +139 -0
- package/dist/chunk-WDCIZHXY.mjs.map +1 -0
- package/dist/chunk-WZKGRU3U.js +182 -0
- package/dist/chunk-WZKGRU3U.js.map +1 -0
- package/dist/chunk-X22LLJL6.js +71 -0
- package/dist/chunk-X22LLJL6.js.map +1 -0
- package/dist/chunk-XIXF7UVM.mjs +194 -0
- package/dist/chunk-XIXF7UVM.mjs.map +1 -0
- package/dist/chunk-XLAFQ24R.js +328 -0
- package/dist/chunk-XLAFQ24R.js.map +1 -0
- package/dist/chunk-XWM2S6VV.mjs +124 -0
- package/dist/chunk-XWM2S6VV.mjs.map +1 -0
- package/dist/chunk-YNCD6TKE.mjs +175 -0
- package/dist/chunk-YNCD6TKE.mjs.map +1 -0
- package/dist/progress-base-Cm1JODYA.d.mts +66 -0
- package/dist/progress-base-Cm1JODYA.d.ts +66 -0
- package/dist/types-C7N9UvRm.d.mts +38 -0
- package/dist/types-C7N9UvRm.d.ts +38 -0
- package/dist/types-CFpwSbpK.d.mts +27 -0
- package/dist/types-CFpwSbpK.d.ts +27 -0
- package/dist/types-CK_vNRIb.d.mts +63 -0
- package/dist/types-CK_vNRIb.d.ts +63 -0
- package/dist/types-Ca3t5aC_.d.mts +31 -0
- package/dist/types-Ca3t5aC_.d.ts +31 -0
- package/dist/types-Cn7IcgkH.d.mts +32 -0
- package/dist/types-Cn7IcgkH.d.ts +32 -0
- package/dist/types-CtFK7mFE.d.mts +34 -0
- package/dist/types-CtFK7mFE.d.ts +34 -0
- package/dist/types-DMkTQsWg.d.mts +46 -0
- package/dist/types-DMkTQsWg.d.ts +46 -0
- package/dist/types-DN400jNg.d.mts +28 -0
- package/dist/types-DN400jNg.d.ts +28 -0
- package/dist/types-vcZcRc6w.d.mts +24 -0
- package/dist/types-vcZcRc6w.d.ts +24 -0
- package/dist/types-zHcMUtKK.d.mts +42 -0
- package/dist/types-zHcMUtKK.d.ts +42 -0
- package/dist/ui/accordion/animated.d.mts +24 -0
- package/dist/ui/accordion/animated.d.ts +24 -0
- package/dist/ui/accordion/animated.js +67 -0
- package/dist/ui/accordion/animated.js.map +1 -0
- package/dist/ui/accordion/animated.mjs +56 -0
- package/dist/ui/accordion/animated.mjs.map +1 -0
- package/dist/ui/accordion.d.mts +9 -65
- package/dist/ui/accordion.d.ts +9 -65
- package/dist/ui/accordion.js +32 -288
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/accordion.mjs +6 -281
- package/dist/ui/accordion.mjs.map +1 -1
- package/dist/ui/alert/animated.d.mts +18 -0
- package/dist/ui/alert/animated.d.ts +18 -0
- package/dist/ui/alert/animated.js +47 -0
- package/dist/ui/alert/animated.js.map +1 -0
- package/dist/ui/alert/animated.mjs +44 -0
- package/dist/ui/alert/animated.mjs.map +1 -0
- package/dist/ui/alert.d.mts +10 -40
- package/dist/ui/alert.d.ts +10 -40
- package/dist/ui/alert.js +36 -218
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/alert.mjs +7 -211
- package/dist/ui/alert.mjs.map +1 -1
- package/dist/ui/avatar/animated.d.mts +22 -0
- package/dist/ui/avatar/animated.d.ts +22 -0
- package/dist/ui/avatar/animated.js +51 -0
- package/dist/ui/avatar/animated.js.map +1 -0
- package/dist/ui/avatar/animated.mjs +37 -0
- package/dist/ui/avatar/animated.mjs.map +1 -0
- package/dist/ui/avatar.d.mts +7 -53
- package/dist/ui/avatar.d.ts +7 -53
- package/dist/ui/avatar.js +32 -210
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/avatar.mjs +7 -204
- package/dist/ui/avatar.mjs.map +1 -1
- package/dist/ui/badge/animated.d.mts +22 -0
- package/dist/ui/badge/animated.d.ts +22 -0
- package/dist/ui/badge/animated.js +50 -0
- package/dist/ui/badge/animated.js.map +1 -0
- package/dist/ui/badge/animated.mjs +47 -0
- package/dist/ui/badge/animated.mjs.map +1 -0
- package/dist/ui/badge.d.mts +6 -30
- package/dist/ui/badge.d.ts +6 -30
- package/dist/ui/badge.js +11 -142
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/badge.mjs +6 -141
- package/dist/ui/badge.mjs.map +1 -1
- package/dist/ui/buttons/animated.d.mts +27 -0
- package/dist/ui/buttons/animated.d.ts +27 -0
- package/dist/ui/buttons/animated.js +101 -0
- package/dist/ui/buttons/animated.js.map +1 -0
- package/dist/ui/buttons/animated.mjs +98 -0
- package/dist/ui/buttons/animated.mjs.map +1 -0
- package/dist/ui/buttons.d.mts +5 -13
- package/dist/ui/buttons.d.ts +5 -13
- package/dist/ui/buttons.js +7 -45
- package/dist/ui/buttons.js.map +1 -1
- package/dist/ui/buttons.mjs +8 -45
- package/dist/ui/buttons.mjs.map +1 -1
- package/dist/ui/card/animated.d.mts +23 -0
- package/dist/ui/card/animated.d.ts +23 -0
- package/dist/ui/card/animated.js +72 -0
- package/dist/ui/card/animated.js.map +1 -0
- package/dist/ui/card/animated.mjs +50 -0
- package/dist/ui/card/animated.mjs.map +1 -0
- package/dist/ui/card.d.mts +6 -70
- package/dist/ui/card.d.ts +6 -70
- package/dist/ui/card.js +43 -245
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/card.mjs +5 -235
- package/dist/ui/card.mjs.map +1 -1
- package/dist/ui/divider/animated.d.mts +19 -0
- package/dist/ui/divider/animated.d.ts +19 -0
- package/dist/ui/divider/animated.js +41 -0
- package/dist/ui/divider/animated.js.map +1 -0
- package/dist/ui/divider/animated.mjs +39 -0
- package/dist/ui/divider/animated.mjs.map +1 -0
- package/dist/ui/divider.d.mts +6 -32
- package/dist/ui/divider.d.ts +6 -32
- package/dist/ui/divider.js +19 -186
- package/dist/ui/divider.js.map +1 -1
- package/dist/ui/divider.mjs +6 -183
- package/dist/ui/divider.mjs.map +1 -1
- package/dist/ui/drawer/animated.d.mts +23 -0
- package/dist/ui/drawer/animated.d.ts +23 -0
- package/dist/ui/drawer/animated.js +143 -0
- package/dist/ui/drawer/animated.js.map +1 -0
- package/dist/ui/drawer/animated.mjs +113 -0
- package/dist/ui/drawer/animated.mjs.map +1 -0
- package/dist/ui/drawer.d.mts +10 -11
- package/dist/ui/drawer.d.ts +10 -11
- package/dist/ui/drawer.js +44 -357
- package/dist/ui/drawer.js.map +1 -1
- package/dist/ui/drawer.mjs +3 -349
- package/dist/ui/drawer.mjs.map +1 -1
- package/dist/ui/empty-state/animated.d.mts +24 -0
- package/dist/ui/empty-state/animated.d.ts +24 -0
- package/dist/ui/empty-state/animated.js +45 -0
- package/dist/ui/empty-state/animated.js.map +1 -0
- package/dist/ui/empty-state/animated.mjs +42 -0
- package/dist/ui/empty-state/animated.mjs.map +1 -0
- package/dist/ui/empty-state.d.mts +11 -32
- package/dist/ui/empty-state.d.ts +11 -32
- package/dist/ui/empty-state.js +35 -160
- package/dist/ui/empty-state.js.map +1 -1
- package/dist/ui/empty-state.mjs +5 -153
- package/dist/ui/empty-state.mjs.map +1 -1
- package/dist/ui/inputs/animated.d.mts +27 -0
- package/dist/ui/inputs/animated.d.ts +27 -0
- package/dist/ui/inputs/animated.js +141 -0
- package/dist/ui/inputs/animated.js.map +1 -0
- package/dist/ui/inputs/animated.mjs +138 -0
- package/dist/ui/inputs/animated.mjs.map +1 -0
- package/dist/ui/inputs.d.mts +7 -21
- package/dist/ui/inputs.d.ts +7 -21
- package/dist/ui/inputs.js +16 -331
- package/dist/ui/inputs.js.map +1 -1
- package/dist/ui/inputs.mjs +13 -329
- package/dist/ui/inputs.mjs.map +1 -1
- package/dist/ui/modal/animated.d.mts +21 -0
- package/dist/ui/modal/animated.d.ts +21 -0
- package/dist/ui/modal/animated.js +120 -0
- package/dist/ui/modal/animated.js.map +1 -0
- package/dist/ui/modal/animated.mjs +117 -0
- package/dist/ui/modal/animated.mjs.map +1 -0
- package/dist/ui/modal.d.mts +10 -48
- package/dist/ui/modal.d.ts +10 -48
- package/dist/ui/modal.js +47 -361
- package/dist/ui/modal.js.map +1 -1
- package/dist/ui/modal.mjs +9 -351
- package/dist/ui/modal.mjs.map +1 -1
- package/dist/ui/progress/animated.d.mts +41 -0
- package/dist/ui/progress/animated.d.ts +41 -0
- package/dist/ui/progress/animated.js +123 -0
- package/dist/ui/progress/animated.js.map +1 -0
- package/dist/ui/progress/animated.mjs +112 -0
- package/dist/ui/progress/animated.mjs.map +1 -0
- package/dist/ui/progress.d.mts +10 -58
- package/dist/ui/progress.d.ts +10 -58
- package/dist/ui/progress.js +35 -227
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/progress.mjs +10 -222
- package/dist/ui/progress.mjs.map +1 -1
- package/dist/ui/skeleton/animated.d.mts +56 -0
- package/dist/ui/skeleton/animated.d.ts +56 -0
- package/dist/ui/skeleton/animated.js +126 -0
- package/dist/ui/skeleton/animated.js.map +1 -0
- package/dist/ui/skeleton/animated.mjs +119 -0
- package/dist/ui/skeleton/animated.mjs.map +1 -0
- package/dist/ui/skeleton.d.mts +16 -77
- package/dist/ui/skeleton.d.ts +16 -77
- package/dist/ui/skeleton.js +35 -526
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/skeleton.mjs +2 -520
- package/dist/ui/skeleton.mjs.map +1 -1
- package/dist/ui/{spinner.d.mts → spinner/animated.d.mts} +1 -6
- package/dist/ui/{spinner.d.ts → spinner/animated.d.ts} +1 -6
- package/dist/ui/{spinner.js → spinner/animated.js} +3 -9
- package/dist/ui/spinner/animated.js.map +1 -0
- package/dist/ui/{spinner.mjs → spinner/animated.mjs} +4 -9
- package/dist/ui/spinner/animated.mjs.map +1 -0
- package/dist/ui/table/animated.d.mts +21 -0
- package/dist/ui/table/animated.d.ts +21 -0
- package/dist/ui/table/animated.js +50 -0
- package/dist/ui/table/animated.js.map +1 -0
- package/dist/ui/table/animated.mjs +24 -0
- package/dist/ui/table/animated.mjs.map +1 -0
- package/dist/ui/table.d.mts +17 -11
- package/dist/ui/table.d.ts +17 -11
- package/dist/ui/table.js +55 -278
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/table.mjs +2 -269
- package/dist/ui/table.mjs.map +1 -1
- package/dist/ui/tabs/animated.d.mts +25 -0
- package/dist/ui/tabs/animated.d.ts +25 -0
- package/dist/ui/tabs/animated.js +83 -0
- package/dist/ui/tabs/animated.js.map +1 -0
- package/dist/ui/tabs/animated.mjs +79 -0
- package/dist/ui/tabs/animated.mjs.map +1 -0
- package/dist/ui/tabs.d.mts +7 -41
- package/dist/ui/tabs.d.ts +7 -41
- package/dist/ui/tabs.js +35 -261
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/tabs.mjs +2 -256
- package/dist/ui/tabs.mjs.map +1 -1
- package/dist/ui/toast/animated.d.mts +23 -0
- package/dist/ui/toast/animated.d.ts +23 -0
- package/dist/ui/toast/animated.js +103 -0
- package/dist/ui/toast/animated.js.map +1 -0
- package/dist/ui/toast/animated.mjs +99 -0
- package/dist/ui/toast/animated.mjs.map +1 -0
- package/dist/ui/toast.d.mts +7 -52
- package/dist/ui/toast.d.ts +7 -52
- package/dist/ui/toast.js +47 -268
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toast.mjs +2 -259
- package/dist/ui/toast.mjs.map +1 -1
- package/dist/ui/toggle/animated.d.mts +22 -0
- package/dist/ui/toggle/animated.d.ts +22 -0
- package/dist/ui/toggle/animated.js +88 -0
- package/dist/ui/toggle/animated.js.map +1 -0
- package/dist/ui/toggle/animated.mjs +85 -0
- package/dist/ui/toggle/animated.mjs.map +1 -0
- package/dist/ui/toggle.d.mts +6 -30
- package/dist/ui/toggle.d.ts +6 -30
- package/dist/ui/toggle.js +19 -83
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/toggle.mjs +12 -80
- package/dist/ui/toggle.mjs.map +1 -1
- package/dist/ui/tooltip/animated.d.mts +17 -0
- package/dist/ui/tooltip/animated.d.ts +17 -0
- package/dist/ui/tooltip/animated.js +59 -0
- package/dist/ui/tooltip/animated.js.map +1 -0
- package/dist/ui/tooltip/animated.mjs +56 -0
- package/dist/ui/tooltip/animated.mjs.map +1 -0
- package/dist/ui/tooltip.d.mts +6 -33
- package/dist/ui/tooltip.d.ts +6 -33
- package/dist/ui/tooltip.js +26 -193
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/tooltip.mjs +2 -192
- package/dist/ui/tooltip.mjs.map +1 -1
- package/dist/variants-CYODHI8b.d.mts +10 -0
- package/dist/variants-CYODHI8b.d.ts +10 -0
- package/package.json +7 -4
- package/dist/ui/spinner.js.map +0 -1
- package/dist/ui/spinner.mjs.map +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkQZKMFSH5_js = require('../../chunk-QZKMFSH5.js');
|
|
5
|
+
var chunkUOZYPWDZ_js = require('../../chunk-UOZYPWDZ.js');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var framerMotion = require('framer-motion');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
|
|
10
|
+
// src/ui/inputs/animated/animations.ts
|
|
11
|
+
var inputAnimationPresets = {
|
|
12
|
+
none: {},
|
|
13
|
+
lift: {
|
|
14
|
+
whileHover: { y: -1 },
|
|
15
|
+
whileFocus: { y: -1 },
|
|
16
|
+
transition: { type: "spring", stiffness: 480, damping: 32 }
|
|
17
|
+
},
|
|
18
|
+
press: {
|
|
19
|
+
whileTap: { scale: 0.99 },
|
|
20
|
+
transition: { type: "spring", stiffness: 520, damping: 30 }
|
|
21
|
+
},
|
|
22
|
+
glow: {
|
|
23
|
+
whileFocus: {
|
|
24
|
+
boxShadow: "0 0 0 1px rgba(255,255,255,0.2), 0 12px 28px rgba(15,23,42,0.35)"
|
|
25
|
+
},
|
|
26
|
+
whileHover: {
|
|
27
|
+
boxShadow: "0 0 0 1px rgba(255,255,255,0.12), 0 8px 20px rgba(15,23,42,0.25)"
|
|
28
|
+
},
|
|
29
|
+
transition: { duration: 0.2, ease: "easeOut" }
|
|
30
|
+
},
|
|
31
|
+
tilt: {
|
|
32
|
+
whileHover: { scale: 1.005 },
|
|
33
|
+
whileFocus: { scale: 1.008 },
|
|
34
|
+
whileTap: { scale: 0.995 },
|
|
35
|
+
transition: { type: "spring", stiffness: 380, damping: 24 }
|
|
36
|
+
},
|
|
37
|
+
bounce: {
|
|
38
|
+
whileFocus: { y: -2, scale: 1.01 },
|
|
39
|
+
whileHover: { y: -1, scale: 1.005 },
|
|
40
|
+
transition: { type: "spring", bounce: 0.35, duration: 0.4 }
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var InputAnimated = (props) => {
|
|
44
|
+
const generatedId = react.useId();
|
|
45
|
+
if (props.as === "textarea") {
|
|
46
|
+
const {
|
|
47
|
+
className: className2,
|
|
48
|
+
appearance: appearance2,
|
|
49
|
+
size: size2,
|
|
50
|
+
animation: animation2 = "none",
|
|
51
|
+
ring: ring2 = true,
|
|
52
|
+
ref: ref2,
|
|
53
|
+
"aria-invalid": ariaInvalidProp2,
|
|
54
|
+
errorMessage: errorMessage2,
|
|
55
|
+
id: id2,
|
|
56
|
+
as: as2,
|
|
57
|
+
...rest2
|
|
58
|
+
} = props;
|
|
59
|
+
const controlId2 = id2 ?? generatedId;
|
|
60
|
+
const errorId2 = `${controlId2}-error`;
|
|
61
|
+
const motionProps2 = inputAnimationPresets[animation2];
|
|
62
|
+
const ariaInvalid2 = ariaInvalidProp2 !== void 0 ? ariaInvalidProp2 : appearance2 === "error" ? true : void 0;
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
framerMotion.motion.textarea,
|
|
66
|
+
{
|
|
67
|
+
ref: ref2,
|
|
68
|
+
id: controlId2,
|
|
69
|
+
"data-slot": "input",
|
|
70
|
+
className: chunkUOZYPWDZ_js.cn(
|
|
71
|
+
chunkQZKMFSH5_js.inputVariants({ appearance: appearance2, size: size2, ring: ring2, as: as2 }),
|
|
72
|
+
className2
|
|
73
|
+
),
|
|
74
|
+
initial: false,
|
|
75
|
+
"aria-invalid": ariaInvalid2,
|
|
76
|
+
"aria-describedby": errorMessage2 && appearance2 === "error" ? errorId2 : void 0,
|
|
77
|
+
...motionProps2,
|
|
78
|
+
...rest2
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
errorMessage2 && appearance2 === "error" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
+
"p",
|
|
83
|
+
{
|
|
84
|
+
id: errorId2,
|
|
85
|
+
className: "mt-2 pl-4 text-sm text-rose-500 wrap-break-word",
|
|
86
|
+
children: errorMessage2
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
] });
|
|
90
|
+
}
|
|
91
|
+
const {
|
|
92
|
+
className,
|
|
93
|
+
appearance,
|
|
94
|
+
size,
|
|
95
|
+
animation = "none",
|
|
96
|
+
ring = true,
|
|
97
|
+
ref,
|
|
98
|
+
"aria-invalid": ariaInvalidProp,
|
|
99
|
+
errorMessage,
|
|
100
|
+
id,
|
|
101
|
+
as,
|
|
102
|
+
...rest
|
|
103
|
+
} = props;
|
|
104
|
+
const controlId = id ?? generatedId;
|
|
105
|
+
const errorId = `${controlId}-error`;
|
|
106
|
+
const motionProps = inputAnimationPresets[animation];
|
|
107
|
+
const ariaInvalid = ariaInvalidProp !== void 0 ? ariaInvalidProp : appearance === "error" ? true : void 0;
|
|
108
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
109
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
110
|
+
framerMotion.motion.input,
|
|
111
|
+
{
|
|
112
|
+
ref,
|
|
113
|
+
id: controlId,
|
|
114
|
+
"data-slot": "input",
|
|
115
|
+
className: chunkUOZYPWDZ_js.cn(
|
|
116
|
+
chunkQZKMFSH5_js.inputVariants({ appearance, size, ring, as: as ?? "input" }),
|
|
117
|
+
className
|
|
118
|
+
),
|
|
119
|
+
initial: false,
|
|
120
|
+
"aria-invalid": ariaInvalid,
|
|
121
|
+
"aria-describedby": errorMessage && appearance === "error" ? errorId : void 0,
|
|
122
|
+
...motionProps,
|
|
123
|
+
...rest
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
errorMessage && appearance === "error" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
127
|
+
"p",
|
|
128
|
+
{
|
|
129
|
+
id: errorId,
|
|
130
|
+
className: "mt-2 pl-4 text-sm text-rose-500 wrap-break-word",
|
|
131
|
+
children: errorMessage
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] });
|
|
135
|
+
};
|
|
136
|
+
InputAnimated.displayName = "Input";
|
|
137
|
+
|
|
138
|
+
exports.InputAnimated = InputAnimated;
|
|
139
|
+
exports.inputAnimationPresets = inputAnimationPresets;
|
|
140
|
+
//# sourceMappingURL=animated.js.map
|
|
141
|
+
//# sourceMappingURL=animated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/inputs/animated/animations.ts","../../../src/ui/inputs/animated/input-animated.tsx"],"names":["useId","className","appearance","size","animation","ring","ref","ariaInvalidProp","errorMessage","id","as","rest","controlId","errorId","motionProps","ariaInvalid","jsxs","Fragment","jsx","motion","cn","inputVariants"],"mappings":";;;;;;;;;AAEO,IAAM,qBAAA,GAA+C;AAAA,EAC1D,MAAM,EAAC;AAAA,EACP,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,CAAA,EAAG,EAAA,EAAG;AAAA,IACpB,UAAA,EAAY,EAAE,CAAA,EAAG,EAAA,EAAG;AAAA,IACpB,YAAY,EAAE,IAAA,EAAM,UAAU,SAAA,EAAW,GAAA,EAAK,SAAS,EAAA;AAAG,GAC5D;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,EAAE,KAAA,EAAO,IAAA,EAAK;AAAA,IACxB,YAAY,EAAE,IAAA,EAAM,UAAU,SAAA,EAAW,GAAA,EAAK,SAAS,EAAA;AAAG,GAC5D;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY;AAAA,MACV,SAAA,EACE;AAAA,KACJ;AAAA,IACA,UAAA,EAAY;AAAA,MACV,SAAA,EACE;AAAA,KACJ;AAAA,IACA,UAAA,EAAY,EAAE,QAAA,EAAU,GAAA,EAAK,MAAM,SAAA;AAAU,GAC/C;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,KAAA,EAAO,KAAA,EAAM;AAAA,IAC3B,UAAA,EAAY,EAAE,KAAA,EAAO,KAAA,EAAM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AA;AACnD,EAAA,MAAM,cACJ,eAAA,KAAoB,MAAA,GAChB,eAAA,GACA,UAAA,KAAe,UACb,IAAA,GACA,MAAA;AAER,EAAA,uBACEQ,eAAA,CAAAC,mBAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAAC,cAAA;AAAA,MAACC,mBAAA,CAAO,KAAA;AAAA,MAAP;AAAA,QACC,GAAA;AAAA,QACA,EAAA,EAAI,SAAA;AAAA,QACJ,WAAA,EAAU,OAAA;AAAA,QACV,SAAA,EAAWC,mBAAA;AAAA,UACTC,8BAAA,CAAc,EAAE,UAAA,EAAY,IAAA,EAAM,MAAM,EAAA,EAAI,EAAA,IAAM,SAAS,CAAA;AAAA,UAC3D;AAAA,SACF;AAAA,QACA,OAAA,EAAS,KAAA;AAAA,QACT,cAAA,EAAc,WAAA;AAAA,QACd,kBAAA,EACE,YAAA,IAAgB,UAAA,KAAe,OAAA,GAAU,OAAA,GAAU,MAAA;AAAA,QAEpD,GAAG,WAAA;AAAA,QACH,GAAG;AAAA;AAAA,KACN;AAAA,IACC,YAAA,IAAgB,eAAe,OAAA,oBAC9BH,cAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,OAAA;AAAA,QACJ,SAAA,EAAU,iDAAA;AAAA,QAET,QAAA,EAAA;AAAA;AAAA;AACH,GAAA,EAEJ,CAAA;AAEJ;AAEA,aAAA,CAAc,WAAA,GAAc,OAAA","file":"animated.js","sourcesContent":["import type { InputAnimationPresets } from \"./types\";\n\nexport const inputAnimationPresets: InputAnimationPresets = {\n none: {},\n lift: {\n whileHover: { y: -1 },\n whileFocus: { y: -1 },\n transition: { type: \"spring\", stiffness: 480, damping: 32 },\n },\n press: {\n whileTap: { scale: 0.99 },\n transition: { type: \"spring\", stiffness: 520, damping: 30 },\n },\n glow: {\n whileFocus: {\n boxShadow:\n \"0 0 0 1px rgba(255,255,255,0.2), 0 12px 28px rgba(15,23,42,0.35)\",\n },\n whileHover: {\n boxShadow:\n \"0 0 0 1px rgba(255,255,255,0.12), 0 8px 20px rgba(15,23,42,0.25)\",\n },\n transition: { duration: 0.2, ease: \"easeOut\" },\n },\n tilt: {\n whileHover: { scale: 1.005 },\n whileFocus: { scale: 1.008 },\n whileTap: { scale: 0.995 },\n transition: { type: \"spring\", stiffness: 380, damping: 24 },\n },\n bounce: {\n whileFocus: { y: -2, scale: 1.01 },\n whileHover: { y: -1, scale: 1.005 },\n transition: { type: \"spring\", bounce: 0.35, duration: 0.4 },\n },\n};\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { motion } from \"framer-motion\";\n\nimport { cn } from \"../../../lib/utils\";\n\nimport { inputAnimationPresets } from \"./animations\";\nimport type { InputAnimatedProps } from \"./types\";\nimport { inputVariants } from \"../variants\";\n\nexport const InputAnimated = (props: InputAnimatedProps) => {\n const generatedId = useId();\n\n if (props.as === \"textarea\") {\n const {\n className,\n appearance,\n size,\n animation = \"none\",\n ring = true,\n ref,\n \"aria-invalid\": ariaInvalidProp,\n errorMessage,\n id,\n as,\n ...rest\n } = props;\n\n const controlId = id ?? generatedId;\n const errorId = `${controlId}-error`;\n const motionProps = inputAnimationPresets[animation];\n const ariaInvalid =\n ariaInvalidProp !== undefined\n ? ariaInvalidProp\n : appearance === \"error\"\n ? true\n : undefined;\n\n return (\n <>\n <motion.textarea\n ref={ref}\n id={controlId}\n data-slot=\"input\"\n className={cn(\n inputVariants({ appearance, size, ring, as }),\n className,\n )}\n initial={false}\n aria-invalid={ariaInvalid}\n aria-describedby={\n errorMessage && appearance === \"error\" ? errorId : undefined\n }\n {...motionProps}\n {...rest}\n />\n {errorMessage && appearance === \"error\" && (\n <p\n id={errorId}\n className=\"mt-2 pl-4 text-sm text-rose-500 wrap-break-word\"\n >\n {errorMessage}\n </p>\n )}\n </>\n );\n }\n\n const {\n className,\n appearance,\n size,\n animation = \"none\",\n ring = true,\n ref,\n \"aria-invalid\": ariaInvalidProp,\n errorMessage,\n id,\n as,\n ...rest\n } = props;\n\n const controlId = id ?? generatedId;\n const errorId = `${controlId}-error`;\n const motionProps = inputAnimationPresets[animation];\n const ariaInvalid =\n ariaInvalidProp !== undefined\n ? ariaInvalidProp\n : appearance === \"error\"\n ? true\n : undefined;\n\n return (\n <>\n <motion.input\n ref={ref}\n id={controlId}\n data-slot=\"input\"\n className={cn(\n inputVariants({ appearance, size, ring, as: as ?? \"input\" }),\n className,\n )}\n initial={false}\n aria-invalid={ariaInvalid}\n aria-describedby={\n errorMessage && appearance === \"error\" ? errorId : undefined\n }\n {...motionProps}\n {...rest}\n />\n {errorMessage && appearance === \"error\" && (\n <p\n id={errorId}\n className=\"mt-2 pl-4 text-sm text-rose-500 wrap-break-word\"\n >\n {errorMessage}\n </p>\n )}\n </>\n );\n};\n\nInputAnimated.displayName = \"Input\";\n"]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { inputVariants } from '../../chunk-AOEI4V3W.mjs';
|
|
3
|
+
import { cn } from '../../chunk-DFEZH7TC.mjs';
|
|
4
|
+
import { useId } from 'react';
|
|
5
|
+
import { motion } from 'framer-motion';
|
|
6
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
// src/ui/inputs/animated/animations.ts
|
|
9
|
+
var inputAnimationPresets = {
|
|
10
|
+
none: {},
|
|
11
|
+
lift: {
|
|
12
|
+
whileHover: { y: -1 },
|
|
13
|
+
whileFocus: { y: -1 },
|
|
14
|
+
transition: { type: "spring", stiffness: 480, damping: 32 }
|
|
15
|
+
},
|
|
16
|
+
press: {
|
|
17
|
+
whileTap: { scale: 0.99 },
|
|
18
|
+
transition: { type: "spring", stiffness: 520, damping: 30 }
|
|
19
|
+
},
|
|
20
|
+
glow: {
|
|
21
|
+
whileFocus: {
|
|
22
|
+
boxShadow: "0 0 0 1px rgba(255,255,255,0.2), 0 12px 28px rgba(15,23,42,0.35)"
|
|
23
|
+
},
|
|
24
|
+
whileHover: {
|
|
25
|
+
boxShadow: "0 0 0 1px rgba(255,255,255,0.12), 0 8px 20px rgba(15,23,42,0.25)"
|
|
26
|
+
},
|
|
27
|
+
transition: { duration: 0.2, ease: "easeOut" }
|
|
28
|
+
},
|
|
29
|
+
tilt: {
|
|
30
|
+
whileHover: { scale: 1.005 },
|
|
31
|
+
whileFocus: { scale: 1.008 },
|
|
32
|
+
whileTap: { scale: 0.995 },
|
|
33
|
+
transition: { type: "spring", stiffness: 380, damping: 24 }
|
|
34
|
+
},
|
|
35
|
+
bounce: {
|
|
36
|
+
whileFocus: { y: -2, scale: 1.01 },
|
|
37
|
+
whileHover: { y: -1, scale: 1.005 },
|
|
38
|
+
transition: { type: "spring", bounce: 0.35, duration: 0.4 }
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var InputAnimated = (props) => {
|
|
42
|
+
const generatedId = useId();
|
|
43
|
+
if (props.as === "textarea") {
|
|
44
|
+
const {
|
|
45
|
+
className: className2,
|
|
46
|
+
appearance: appearance2,
|
|
47
|
+
size: size2,
|
|
48
|
+
animation: animation2 = "none",
|
|
49
|
+
ring: ring2 = true,
|
|
50
|
+
ref: ref2,
|
|
51
|
+
"aria-invalid": ariaInvalidProp2,
|
|
52
|
+
errorMessage: errorMessage2,
|
|
53
|
+
id: id2,
|
|
54
|
+
as: as2,
|
|
55
|
+
...rest2
|
|
56
|
+
} = props;
|
|
57
|
+
const controlId2 = id2 ?? generatedId;
|
|
58
|
+
const errorId2 = `${controlId2}-error`;
|
|
59
|
+
const motionProps2 = inputAnimationPresets[animation2];
|
|
60
|
+
const ariaInvalid2 = ariaInvalidProp2 !== void 0 ? ariaInvalidProp2 : appearance2 === "error" ? true : void 0;
|
|
61
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
motion.textarea,
|
|
64
|
+
{
|
|
65
|
+
ref: ref2,
|
|
66
|
+
id: controlId2,
|
|
67
|
+
"data-slot": "input",
|
|
68
|
+
className: cn(
|
|
69
|
+
inputVariants({ appearance: appearance2, size: size2, ring: ring2, as: as2 }),
|
|
70
|
+
className2
|
|
71
|
+
),
|
|
72
|
+
initial: false,
|
|
73
|
+
"aria-invalid": ariaInvalid2,
|
|
74
|
+
"aria-describedby": errorMessage2 && appearance2 === "error" ? errorId2 : void 0,
|
|
75
|
+
...motionProps2,
|
|
76
|
+
...rest2
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
errorMessage2 && appearance2 === "error" && /* @__PURE__ */ jsx(
|
|
80
|
+
"p",
|
|
81
|
+
{
|
|
82
|
+
id: errorId2,
|
|
83
|
+
className: "mt-2 pl-4 text-sm text-rose-500 wrap-break-word",
|
|
84
|
+
children: errorMessage2
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
const {
|
|
90
|
+
className,
|
|
91
|
+
appearance,
|
|
92
|
+
size,
|
|
93
|
+
animation = "none",
|
|
94
|
+
ring = true,
|
|
95
|
+
ref,
|
|
96
|
+
"aria-invalid": ariaInvalidProp,
|
|
97
|
+
errorMessage,
|
|
98
|
+
id,
|
|
99
|
+
as,
|
|
100
|
+
...rest
|
|
101
|
+
} = props;
|
|
102
|
+
const controlId = id ?? generatedId;
|
|
103
|
+
const errorId = `${controlId}-error`;
|
|
104
|
+
const motionProps = inputAnimationPresets[animation];
|
|
105
|
+
const ariaInvalid = ariaInvalidProp !== void 0 ? ariaInvalidProp : appearance === "error" ? true : void 0;
|
|
106
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
motion.input,
|
|
109
|
+
{
|
|
110
|
+
ref,
|
|
111
|
+
id: controlId,
|
|
112
|
+
"data-slot": "input",
|
|
113
|
+
className: cn(
|
|
114
|
+
inputVariants({ appearance, size, ring, as: as ?? "input" }),
|
|
115
|
+
className
|
|
116
|
+
),
|
|
117
|
+
initial: false,
|
|
118
|
+
"aria-invalid": ariaInvalid,
|
|
119
|
+
"aria-describedby": errorMessage && appearance === "error" ? errorId : void 0,
|
|
120
|
+
...motionProps,
|
|
121
|
+
...rest
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
errorMessage && appearance === "error" && /* @__PURE__ */ jsx(
|
|
125
|
+
"p",
|
|
126
|
+
{
|
|
127
|
+
id: errorId,
|
|
128
|
+
className: "mt-2 pl-4 text-sm text-rose-500 wrap-break-word",
|
|
129
|
+
children: errorMessage
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] });
|
|
133
|
+
};
|
|
134
|
+
InputAnimated.displayName = "Input";
|
|
135
|
+
|
|
136
|
+
export { InputAnimated, inputAnimationPresets };
|
|
137
|
+
//# sourceMappingURL=animated.mjs.map
|
|
138
|
+
//# sourceMappingURL=animated.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/inputs/animated/animations.ts","../../../src/ui/inputs/animated/input-animated.tsx"],"names":["className","appearance","size","animation","ring","ref","ariaInvalidProp","errorMessage","id","as","rest","controlId","errorId","motionProps","ariaInvalid"],"mappings":";;;;;;;AAEO,IAAM,qBAAA,GAA+C;AAAA,EAC1D,MAAM,EAAC;AAAA,EACP,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,CAAA,EAAG,EAAA,EAAG;AAAA,IACpB,UAAA,EAAY,EAAE,CAAA,EAAG,EAAA,EAAG;AAAA,IACpB,YAAY,EAAE,IAAA,EAAM,UAAU,SAAA,EAAW,GAAA,EAAK,SAAS,EAAA;AAAG,GAC5D;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,EAAE,KAAA,EAAO,IAAA,EAAK;AAAA,IACxB,YAAY,EAAE,IAAA,EAAM,UAAU,SAAA,EAAW,GAAA,EAAK,SAAS,EAAA;AAAG,GAC5D;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY;AAAA,MACV,SAAA,EACE;AAAA,KACJ;A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AAA;AAAA,IAChB,YAAA;AAAA,IACA,EAAA;AAAA,IACA,EAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,YAAY,EAAA,IAAM,WAAA;AACxB,EAAA,MAAM,OAAA,GAAU,GAAG,SAAS,CAAA,MAAA,CAAA;AAC5B,EAAA,MAAM,WAAA,GAAc,sBAAsB,SAAS,CAAA;AACnD,EAAA,MAAM,cACJ,eAAA,KAAoB,MAAA,GAChB,eAAA,GACA,UAAA,KAAe,UACb,IAAA,GACA,MAAA;AAER,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,MAAA,CAAO,KAAA;AAAA,MAAP;AAAA,QACC,GAAA;AAAA,QACA,EAAA,EAAI,SAAA;AAAA,QACJ,WAAA,EAAU,OAAA;AAAA,QACV,SAAA,EAAW,EAAA;AAAA,UACT,aAAA,CAAc,EAAE,UAAA,EAAY,IAAA,EAAM,MAAM,EAAA,EAAI,EAAA,IAAM,SAAS,CAAA;AAAA,UAC3D;AAAA,SACF;AAAA,QACA,OAAA,EAAS,KAAA;AAAA,QACT,cAAA,EAAc,WAAA;AAAA,QACd,kBAAA,EACE,YAAA,IAAgB,UAAA,KAAe,OAAA,GAAU,OAAA,GAAU,MAAA;AAAA,QAEpD,GAAG,WAAA;AAAA,QACH,GAAG;AAAA;AAAA,KACN;AAAA,IACC,YAAA,IAAgB,eAAe,OAAA,oBAC9B,GAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,OAAA;AAAA,QACJ,SAAA,EAAU,iDAAA;AAAA,QAET,QAAA,EAAA;AAAA;AAAA;AACH,GAAA,EAEJ,CAAA;AAEJ;AAEA,aAAA,CAAc,WAAA,GAAc,OAAA","file":"animated.mjs","sourcesContent":["import type { InputAnimationPresets } from \"./types\";\n\nexport const inputAnimationPresets: InputAnimationPresets = {\n none: {},\n lift: {\n whileHover: { y: -1 },\n whileFocus: { y: -1 },\n transition: { type: \"spring\", stiffness: 480, damping: 32 },\n },\n press: {\n whileTap: { scale: 0.99 },\n transition: { type: \"spring\", stiffness: 520, damping: 30 },\n },\n glow: {\n whileFocus: {\n boxShadow:\n \"0 0 0 1px rgba(255,255,255,0.2), 0 12px 28px rgba(15,23,42,0.35)\",\n },\n whileHover: {\n boxShadow:\n \"0 0 0 1px rgba(255,255,255,0.12), 0 8px 20px rgba(15,23,42,0.25)\",\n },\n transition: { duration: 0.2, ease: \"easeOut\" },\n },\n tilt: {\n whileHover: { scale: 1.005 },\n whileFocus: { scale: 1.008 },\n whileTap: { scale: 0.995 },\n transition: { type: \"spring\", stiffness: 380, damping: 24 },\n },\n bounce: {\n whileFocus: { y: -2, scale: 1.01 },\n whileHover: { y: -1, scale: 1.005 },\n transition: { type: \"spring\", bounce: 0.35, duration: 0.4 },\n },\n};\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { motion } from \"framer-motion\";\n\nimport { cn } from \"../../../lib/utils\";\n\nimport { inputAnimationPresets } from \"./animations\";\nimport type { InputAnimatedProps } from \"./types\";\nimport { inputVariants } from \"../variants\";\n\nexport const InputAnimated = (props: InputAnimatedProps) => {\n const generatedId = useId();\n\n if (props.as === \"textarea\") {\n const {\n className,\n appearance,\n size,\n animation = \"none\",\n ring = true,\n ref,\n \"aria-invalid\": ariaInvalidProp,\n errorMessage,\n id,\n as,\n ...rest\n } = props;\n\n const controlId = id ?? generatedId;\n const errorId = `${controlId}-error`;\n const motionProps = inputAnimationPresets[animation];\n const ariaInvalid =\n ariaInvalidProp !== undefined\n ? ariaInvalidProp\n : appearance === \"error\"\n ? true\n : undefined;\n\n return (\n <>\n <motion.textarea\n ref={ref}\n id={controlId}\n data-slot=\"input\"\n className={cn(\n inputVariants({ appearance, size, ring, as }),\n className,\n )}\n initial={false}\n aria-invalid={ariaInvalid}\n aria-describedby={\n errorMessage && appearance === \"error\" ? errorId : undefined\n }\n {...motionProps}\n {...rest}\n />\n {errorMessage && appearance === \"error\" && (\n <p\n id={errorId}\n className=\"mt-2 pl-4 text-sm text-rose-500 wrap-break-word\"\n >\n {errorMessage}\n </p>\n )}\n </>\n );\n }\n\n const {\n className,\n appearance,\n size,\n animation = \"none\",\n ring = true,\n ref,\n \"aria-invalid\": ariaInvalidProp,\n errorMessage,\n id,\n as,\n ...rest\n } = props;\n\n const controlId = id ?? generatedId;\n const errorId = `${controlId}-error`;\n const motionProps = inputAnimationPresets[animation];\n const ariaInvalid =\n ariaInvalidProp !== undefined\n ? ariaInvalidProp\n : appearance === \"error\"\n ? true\n : undefined;\n\n return (\n <>\n <motion.input\n ref={ref}\n id={controlId}\n data-slot=\"input\"\n className={cn(\n inputVariants({ appearance, size, ring, as: as ?? \"input\" }),\n className,\n )}\n initial={false}\n aria-invalid={ariaInvalid}\n aria-describedby={\n errorMessage && appearance === \"error\" ? errorId : undefined\n }\n {...motionProps}\n {...rest}\n />\n {errorMessage && appearance === \"error\" && (\n <p\n id={errorId}\n className=\"mt-2 pl-4 text-sm text-rose-500 wrap-break-word\"\n >\n {errorMessage}\n </p>\n )}\n </>\n );\n};\n\nInputAnimated.displayName = \"Input\";\n"]}
|
package/dist/ui/inputs.d.mts
CHANGED
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { ComponentPropsWithRef } from 'react';
|
|
4
|
+
import { i as inputVariants } from '../variants-CYODHI8b.mjs';
|
|
5
|
+
import 'class-variance-authority/types';
|
|
5
6
|
|
|
6
|
-
declare const inputVariants: (props?: ({
|
|
7
|
-
as?: "input" | "textarea" | "file" | "checkbox" | "radio" | null | undefined;
|
|
8
|
-
appearance?: "default" | "warning" | "error" | "success" | "info" | "violet" | "amber" | "pink" | "indigo" | "orange" | null | undefined;
|
|
9
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
-
ring?: boolean | null | undefined;
|
|
11
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
-
|
|
13
|
-
type InputAnimation = "none" | "lift" | "press" | "glow" | "tilt" | "bounce";
|
|
14
7
|
type InputSharedProps = Omit<VariantProps<typeof inputVariants>, "as"> & {
|
|
15
|
-
animation?: InputAnimation;
|
|
16
8
|
errorMessage?: string;
|
|
17
9
|
};
|
|
18
|
-
|
|
19
|
-
type InputPresetMotionProps = Pick<HTMLMotionProps<"input">, "style" | "transition" | "whileHover" | "whileTap" | "whileFocus">;
|
|
20
|
-
/** Omit native `size` (character width) so the design-system `size` variant can use the same name. */
|
|
21
|
-
type InputProps = (InputSharedProps & Omit<HTMLMotionProps<"input">, "size" | "as"> & {
|
|
10
|
+
type InputProps = (InputSharedProps & Omit<ComponentPropsWithRef<"input">, "size" | "as"> & {
|
|
22
11
|
as?: "input" | "file" | "checkbox" | "radio";
|
|
23
|
-
}) | (InputSharedProps & Omit<
|
|
12
|
+
}) | (InputSharedProps & Omit<ComponentPropsWithRef<"textarea">, "size" | "as"> & {
|
|
24
13
|
as: "textarea";
|
|
25
14
|
});
|
|
26
|
-
type InputAnimationPresets = Record<InputAnimation, InputPresetMotionProps>;
|
|
27
|
-
|
|
28
|
-
declare const inputAnimationPresets: InputAnimationPresets;
|
|
29
15
|
|
|
30
16
|
declare const Input: {
|
|
31
17
|
(props: InputProps): react_jsx_runtime.JSX.Element;
|
|
32
18
|
displayName: string;
|
|
33
19
|
};
|
|
34
20
|
|
|
35
|
-
export { Input, type
|
|
21
|
+
export { Input, type InputProps, type InputSharedProps, inputVariants };
|
package/dist/ui/inputs.d.ts
CHANGED
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { ComponentPropsWithRef } from 'react';
|
|
4
|
+
import { i as inputVariants } from '../variants-CYODHI8b.js';
|
|
5
|
+
import 'class-variance-authority/types';
|
|
5
6
|
|
|
6
|
-
declare const inputVariants: (props?: ({
|
|
7
|
-
as?: "input" | "textarea" | "file" | "checkbox" | "radio" | null | undefined;
|
|
8
|
-
appearance?: "default" | "warning" | "error" | "success" | "info" | "violet" | "amber" | "pink" | "indigo" | "orange" | null | undefined;
|
|
9
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
-
ring?: boolean | null | undefined;
|
|
11
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
-
|
|
13
|
-
type InputAnimation = "none" | "lift" | "press" | "glow" | "tilt" | "bounce";
|
|
14
7
|
type InputSharedProps = Omit<VariantProps<typeof inputVariants>, "as"> & {
|
|
15
|
-
animation?: InputAnimation;
|
|
16
8
|
errorMessage?: string;
|
|
17
9
|
};
|
|
18
|
-
|
|
19
|
-
type InputPresetMotionProps = Pick<HTMLMotionProps<"input">, "style" | "transition" | "whileHover" | "whileTap" | "whileFocus">;
|
|
20
|
-
/** Omit native `size` (character width) so the design-system `size` variant can use the same name. */
|
|
21
|
-
type InputProps = (InputSharedProps & Omit<HTMLMotionProps<"input">, "size" | "as"> & {
|
|
10
|
+
type InputProps = (InputSharedProps & Omit<ComponentPropsWithRef<"input">, "size" | "as"> & {
|
|
22
11
|
as?: "input" | "file" | "checkbox" | "radio";
|
|
23
|
-
}) | (InputSharedProps & Omit<
|
|
12
|
+
}) | (InputSharedProps & Omit<ComponentPropsWithRef<"textarea">, "size" | "as"> & {
|
|
24
13
|
as: "textarea";
|
|
25
14
|
});
|
|
26
|
-
type InputAnimationPresets = Record<InputAnimation, InputPresetMotionProps>;
|
|
27
|
-
|
|
28
|
-
declare const inputAnimationPresets: InputAnimationPresets;
|
|
29
15
|
|
|
30
16
|
declare const Input: {
|
|
31
17
|
(props: InputProps): react_jsx_runtime.JSX.Element;
|
|
32
18
|
displayName: string;
|
|
33
19
|
};
|
|
34
20
|
|
|
35
|
-
export { Input, type
|
|
21
|
+
export { Input, type InputProps, type InputSharedProps, inputVariants };
|