@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
package/dist/ui/toggle.mjs
CHANGED
|
@@ -1,85 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { toggleThumbVariants, toggleTrackVariants } from '../chunk-JQ5TIJ4F.mjs';
|
|
3
|
+
export { toggleThumbVariants, toggleTrackVariants } from '../chunk-JQ5TIJ4F.mjs';
|
|
2
4
|
import { cn } from '../chunk-DFEZH7TC.mjs';
|
|
3
|
-
import { motion } from 'framer-motion';
|
|
4
5
|
import { useState, useCallback } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
var toggleThumbAnimationPresets = {
|
|
10
|
-
none: {},
|
|
11
|
-
spring: {
|
|
12
|
-
layout: true,
|
|
13
|
-
transition: { type: "spring", stiffness: 520, damping: 32 }
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var toggleTrackVariants = cva(
|
|
17
|
-
"relative inline-flex shrink-0 cursor-pointer rounded-full border border-white/10 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-300 focus-visible:ring-offset-2 focus-visible:ring-offset-slate-950 data-[state=checked]:border-cyan-500/40 disabled:cursor-not-allowed disabled:opacity-50",
|
|
18
|
-
{
|
|
19
|
-
variants: {
|
|
20
|
-
size: {
|
|
21
|
-
sm: "h-5 w-9",
|
|
22
|
-
md: "h-6 w-11",
|
|
23
|
-
lg: "h-7 w-[3.25rem]"
|
|
24
|
-
},
|
|
25
|
-
appearance: {
|
|
26
|
-
default: "data-[state=checked]:bg-cyan-600/80",
|
|
27
|
-
success: "data-[state=checked]:border-emerald-500/40 data-[state=checked]:bg-emerald-600/80",
|
|
28
|
-
destructive: "data-[state=checked]:border-rose-500/40 data-[state=checked]:bg-rose-600/80",
|
|
29
|
-
neutral: "data-[state=checked]:border-slate-400/40 data-[state=checked]:bg-slate-600/90",
|
|
30
|
-
indigo: "data-[state=checked]:border-indigo-500/40 data-[state=checked]:bg-indigo-600/80",
|
|
31
|
-
purple: "data-[state=checked]:border-purple-500/40 data-[state=checked]:bg-purple-600/80",
|
|
32
|
-
pink: "data-[state=checked]:border-pink-500/40 data-[state=checked]:bg-pink-600/80",
|
|
33
|
-
orange: "data-[state=checked]:border-orange-500/40 data-[state=checked]:bg-orange-600/80",
|
|
34
|
-
yellow: "data-[state=checked]:border-yellow-500/40 data-[state=checked]:bg-yellow-600/80",
|
|
35
|
-
green: "data-[state=checked]:border-green-500/40 data-[state=checked]:bg-green-600/80",
|
|
36
|
-
teal: "data-[state=checked]:border-teal-500/40 data-[state=checked]:bg-teal-600/80",
|
|
37
|
-
cyan: "data-[state=checked]:border-cyan-500/40 data-[state=checked]:bg-cyan-600/80",
|
|
38
|
-
lime: "data-[state=checked]:border-lime-500/40 data-[state=checked]:bg-lime-600/80",
|
|
39
|
-
emerald: "data-[state=checked]:border-emerald-500/40 data-[state=checked]:bg-emerald-600/80",
|
|
40
|
-
rose: "data-[state=checked]:border-rose-500/40 data-[state=checked]:bg-rose-600/80",
|
|
41
|
-
slate: "data-[state=checked]:border-slate-400/40 data-[state=checked]:bg-slate-600/90",
|
|
42
|
-
zinc: "data-[state=checked]:border-zinc-400/40 data-[state=checked]:bg-zinc-600/90",
|
|
43
|
-
gray: "data-[state=checked]:border-gray-400/40 data-[state=checked]:bg-gray-600/90",
|
|
44
|
-
stone: "data-[state=checked]:border-stone-400/40 data-[state=checked]:bg-stone-600/90",
|
|
45
|
-
"gradient-blue": "data-[state=checked]:bg-linear-to-r from-blue-600 to-purple-600",
|
|
46
|
-
"gradient-green": "data-[state=checked]:bg-linear-to-r from-green-600 to-lime-600",
|
|
47
|
-
"gradient-red": "data-[state=checked]:bg-linear-to-r from-red-600 to-pink-600",
|
|
48
|
-
"gradient-yellow": "data-[state=checked]:bg-linear-to-r from-yellow-600 to-orange-600",
|
|
49
|
-
"gradient-purple": "data-[state=checked]:bg-linear-to-r from-purple-600 to-pink-600",
|
|
50
|
-
"gradient-teal": "data-[state=checked]:bg-linear-to-r from-teal-600 to-cyan-600",
|
|
51
|
-
"gradient-indigo": "data-[state=checked]:bg-linear-to-r from-indigo-600 to-purple-600",
|
|
52
|
-
"gradient-pink": "data-[state=checked]:bg-linear-to-r from-pink-600 to-rose-600",
|
|
53
|
-
"gradient-orange": "data-[state=checked]:bg-linear-to-r from-orange-600 to-red-600"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
defaultVariants: {
|
|
57
|
-
size: "md",
|
|
58
|
-
appearance: "default"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
var toggleThumbVariants = cva(
|
|
63
|
-
"pointer-events-none block rounded-full bg-white shadow-[0_1px_2px_rgba(15,23,42,0.35)] ring-0",
|
|
64
|
-
{
|
|
65
|
-
variants: {
|
|
66
|
-
size: {
|
|
67
|
-
sm: "size-4",
|
|
68
|
-
md: "size-5",
|
|
69
|
-
lg: "size-6"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
defaultVariants: {
|
|
73
|
-
size: "md"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
function Toggle(props) {
|
|
8
|
+
function ToggleBase(props) {
|
|
78
9
|
const {
|
|
79
10
|
className,
|
|
80
11
|
size,
|
|
81
12
|
appearance,
|
|
82
|
-
animation = "spring",
|
|
83
13
|
checked,
|
|
84
14
|
defaultChecked = false,
|
|
85
15
|
onCheckedChange,
|
|
@@ -92,7 +22,6 @@ function Toggle(props) {
|
|
|
92
22
|
const isControlled = checked !== void 0;
|
|
93
23
|
const [uncontrolled, setUncontrolled] = useState(defaultChecked);
|
|
94
24
|
const resolved = isControlled ? Boolean(checked) : uncontrolled;
|
|
95
|
-
const thumbMotion = toggleThumbAnimationPresets[animation];
|
|
96
25
|
const setChecked = useCallback(
|
|
97
26
|
(next) => {
|
|
98
27
|
if (!isControlled) {
|
|
@@ -124,22 +53,25 @@ function Toggle(props) {
|
|
|
124
53
|
children: [
|
|
125
54
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children }),
|
|
126
55
|
/* @__PURE__ */ jsx(
|
|
127
|
-
|
|
56
|
+
"span",
|
|
128
57
|
{
|
|
129
58
|
className: cn(
|
|
130
59
|
toggleThumbVariants({ size }),
|
|
131
|
-
"absolute left-1 top-1/2 -translate-y-1/2"
|
|
60
|
+
"absolute left-1 top-1/2 -translate-y-1/2 transition-[transform] duration-200 ease-out"
|
|
132
61
|
),
|
|
133
|
-
|
|
134
|
-
transition: thumbMotion.transition
|
|
62
|
+
style: { transform: `translateX(${resolved ? thumbShiftPx : 0}px)` }
|
|
135
63
|
}
|
|
136
64
|
)
|
|
137
65
|
]
|
|
138
66
|
}
|
|
139
67
|
);
|
|
140
68
|
}
|
|
69
|
+
ToggleBase.displayName = "Toggle";
|
|
70
|
+
function Toggle(props) {
|
|
71
|
+
return /* @__PURE__ */ jsx(ToggleBase, { ...props });
|
|
72
|
+
}
|
|
141
73
|
Toggle.displayName = "Toggle";
|
|
142
74
|
|
|
143
|
-
export { Toggle
|
|
75
|
+
export { Toggle };
|
|
144
76
|
//# sourceMappingURL=toggle.mjs.map
|
|
145
77
|
//# sourceMappingURL=toggle.mjs.map
|
package/dist/ui/toggle.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/toggle/
|
|
1
|
+
{"version":3,"sources":["../../src/ui/toggle/toggle-base.tsx","../../src/ui/toggle/toggle.tsx"],"names":["jsx"],"mappings":";;;;;;AASO,SAAS,WAAW,KAAA,EAAoB;AAC7C,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA,GAAiB,KAAA;AAAA,IACjB,eAAA;AAAA,IACA,QAAA;AAAA,IACA,GAAA;AAAA,IACA,cAAc,SAAA,GAAY,QAAA;AAAA,IAC1B,QAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AACJ,EAAA,MAAM,eAAe,OAAA,KAAY,MAAA;AACjC,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,cAAc,CAAA;AAC/D,EAAA,MAAM,QAAA,GAAW,YAAA,GAAe,OAAA,CAAQ,OAAO,CAAA,GAAI,YAAA;AAEnD,EAAA,MAAM,UAAA,GAAa,WAAA;AAAA,IACjB,CAAC,IAAA,KAAkB;AACjB,MAAA,IAAI,CAAC,YAAA,EAAc;AACjB,QAAA,eAAA,CAAgB,IAAI,CAAA;AAAA,MACtB;AACA,MAAA,eAAA,GAAkB,IAAI,CAAA;AAAA,IACxB,CAAA;AAAA,IACA,CAAC,cAAc,eAAe;AAAA,GAChC;AAEA,EAAA,MAAM,eAAe,IAAA,KAAS,IAAA,GAAO,EAAA,GAAK,IAAA,KAAS,OAAO,EAAA,GAAK,EAAA;AAE/D,EAAA,uBACE,IAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,IAAA,EAAK,QAAA;AAAA,MACL,IAAA,EAAK,QAAA;AAAA,MACL,WAAA,EAAU,QAAA;AAAA,MACV,cAAA,EAAc,QAAA;AAAA,MACd,YAAA,EAAY,SAAA;AAAA,MACZ,YAAA,EAAY,WAAW,SAAA,GAAY,WAAA;AAAA,MACnC,QAAA;AAAA,MACA,SAAA,EAAW,GAAG,mBAAA,CAAoB,EAAE,MAAM,UAAA,EAAY,GAAG,SAAS,CAAA;AAAA,MAClE,SAAS,MAAM;AACb,QAAA,IAAI,CAAC,QAAA,EAAU;AACb,UAAA,UAAA,CAAW,CAAC,QAAQ,CAAA;AAAA,QACtB;AAAA,MACF,CAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,SAAA,EAAW,QAAA,EAAS,CAAA;AAAA,wBACpC,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAW,EAAA;AAAA,cACT,mBAAA,CAAoB,EAAE,IAAA,EAAM,CAAA;AAAA,cAC5B;AAAA,aACF;AAAA,YACA,OAAO,EAAE,SAAA,EAAW,cAAc,QAAA,GAAW,YAAA,GAAe,CAAC,CAAA,GAAA,CAAA;AAAM;AAAA;AACrE;AAAA;AAAA,GACF;AAEJ;AAEA,UAAA,CAAW,WAAA,GAAc,QAAA;ACjElB,SAAS,OAAO,KAAA,EAAoB;AACzC,EAAA,uBAAOA,GAAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EAAO,CAAA;AAChC;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"toggle.mjs","sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport type { ToggleProps } from \"./types\";\nimport { toggleThumbVariants, toggleTrackVariants } from \"./variants\";\n\nexport function ToggleBase(props: ToggleProps) {\n const {\n className,\n size,\n appearance,\n checked,\n defaultChecked = false,\n onCheckedChange,\n disabled,\n ref,\n \"aria-label\": ariaLabel = \"Toggle\",\n children,\n ...rest\n } = props;\n const isControlled = checked !== undefined;\n const [uncontrolled, setUncontrolled] = useState(defaultChecked);\n const resolved = isControlled ? Boolean(checked) : uncontrolled;\n\n const setChecked = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setUncontrolled(next);\n }\n onCheckedChange?.(next);\n },\n [isControlled, onCheckedChange],\n );\n\n const thumbShiftPx = size === \"sm\" ? 14 : size === \"lg\" ? 26 : 20;\n\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"switch\"\n data-slot=\"toggle\"\n aria-checked={resolved}\n aria-label={ariaLabel}\n data-state={resolved ? \"checked\" : \"unchecked\"}\n disabled={disabled}\n className={cn(toggleTrackVariants({ size, appearance }), className)}\n onClick={() => {\n if (!disabled) {\n setChecked(!resolved);\n }\n }}\n {...rest}\n >\n <span className=\"sr-only\">{children}</span>\n <span\n className={cn(\n toggleThumbVariants({ size }),\n \"absolute left-1 top-1/2 -translate-y-1/2 transition-[transform] duration-200 ease-out\",\n )}\n style={{ transform: `translateX(${resolved ? thumbShiftPx : 0}px)` }}\n />\n </button>\n );\n}\n\nToggleBase.displayName = \"Toggle\";\n","// toggle.tsx — default static entry (no framer-motion)\nimport { ToggleBase } from \"./toggle-base\";\nimport type { ToggleProps } from \"./types\";\n\nexport function Toggle(props: ToggleProps) {\n return <ToggleBase {...props} />;\n}\n\nToggle.displayName = \"Toggle\";\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
+
import { a as TooltipContentProps } from '../../types-Cn7IcgkH.mjs';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
type TooltipAnimation = "none" | "fade" | "scale";
|
|
7
|
+
type TooltipPresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "style" | "transition">;
|
|
8
|
+
type TooltipAnimationPresets = Record<TooltipAnimation, TooltipPresetMotionProps>;
|
|
9
|
+
type TooltipContentAnimatedProps = TooltipContentProps & {
|
|
10
|
+
animation?: TooltipAnimation;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare const TooltipContentAnimated: ({ children, className, variant, size, width, animation, }: TooltipContentAnimatedProps) => react_jsx_runtime.JSX.Element | null;
|
|
14
|
+
|
|
15
|
+
declare const tooltipAnimationPresets: TooltipAnimationPresets;
|
|
16
|
+
|
|
17
|
+
export { type TooltipAnimation, type TooltipAnimationPresets, TooltipContentAnimated, type TooltipContentAnimatedProps, type TooltipPresetMotionProps, tooltipAnimationPresets };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
+
import { a as TooltipContentProps } from '../../types-Cn7IcgkH.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
type TooltipAnimation = "none" | "fade" | "scale";
|
|
7
|
+
type TooltipPresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "style" | "transition">;
|
|
8
|
+
type TooltipAnimationPresets = Record<TooltipAnimation, TooltipPresetMotionProps>;
|
|
9
|
+
type TooltipContentAnimatedProps = TooltipContentProps & {
|
|
10
|
+
animation?: TooltipAnimation;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare const TooltipContentAnimated: ({ children, className, variant, size, width, animation, }: TooltipContentAnimatedProps) => react_jsx_runtime.JSX.Element | null;
|
|
14
|
+
|
|
15
|
+
declare const tooltipAnimationPresets: TooltipAnimationPresets;
|
|
16
|
+
|
|
17
|
+
export { type TooltipAnimation, type TooltipAnimationPresets, TooltipContentAnimated, type TooltipContentAnimatedProps, type TooltipPresetMotionProps, tooltipAnimationPresets };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkWZKGRU3U_js = require('../../chunk-WZKGRU3U.js');
|
|
5
|
+
var chunkUOZYPWDZ_js = require('../../chunk-UOZYPWDZ.js');
|
|
6
|
+
var framerMotion = require('framer-motion');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
// src/ui/tooltip/animated/animations.ts
|
|
10
|
+
var tooltipAnimationPresets = {
|
|
11
|
+
none: {},
|
|
12
|
+
fade: {
|
|
13
|
+
initial: { opacity: 0 },
|
|
14
|
+
animate: { opacity: 1 },
|
|
15
|
+
transition: { duration: 0.15, ease: "easeOut" }
|
|
16
|
+
},
|
|
17
|
+
scale: {
|
|
18
|
+
initial: { opacity: 0, scale: 0.96 },
|
|
19
|
+
animate: { opacity: 1, scale: 1 },
|
|
20
|
+
transition: { duration: 0.15, ease: "easeIn" }
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var TooltipContentAnimated = ({
|
|
24
|
+
children,
|
|
25
|
+
className,
|
|
26
|
+
variant,
|
|
27
|
+
size,
|
|
28
|
+
width,
|
|
29
|
+
animation = "none"
|
|
30
|
+
}) => {
|
|
31
|
+
const { open, position } = chunkWZKGRU3U_js.useTooltip();
|
|
32
|
+
if (!open) return null;
|
|
33
|
+
const positionStyles = {
|
|
34
|
+
top: "bottom-full mb-2",
|
|
35
|
+
bottom: "top-full mt-2",
|
|
36
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
37
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
38
|
+
};
|
|
39
|
+
const motionProps = tooltipAnimationPresets[animation];
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
framerMotion.motion.div,
|
|
42
|
+
{
|
|
43
|
+
"data-open": open,
|
|
44
|
+
role: "tooltip",
|
|
45
|
+
...motionProps,
|
|
46
|
+
className: chunkUOZYPWDZ_js.cn(
|
|
47
|
+
chunkWZKGRU3U_js.tooltipVariants({ variant, size, width }),
|
|
48
|
+
positionStyles[position],
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
children
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.TooltipContentAnimated = TooltipContentAnimated;
|
|
57
|
+
exports.tooltipAnimationPresets = tooltipAnimationPresets;
|
|
58
|
+
//# sourceMappingURL=animated.js.map
|
|
59
|
+
//# sourceMappingURL=animated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/tooltip/animated/animations.ts","../../../src/ui/tooltip/animated/tooltip-content-animated.tsx"],"names":["useTooltip","jsx","motion","cn","tooltipVariants"],"mappings":";;;;;;;;AAGO,IAAM,uBAAA,GAAmD;AAAA,EAC9D,MAAM,EAAC;AAAA,EACP,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,IACtB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,IACtB,UAAA,EAAY,EAAE,QAAA,EAAU,IAAA,EAAM,MAAM,SAAA;AAAU,GAChD;AAAA,EACA,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,OAAO,IAAA,EAAK;AAAA,IACnC,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,OAAO,CAAA,EAAE;AAAA,IAChC,UAAA,EAAY,EAAE,QAAA,EAAU,IAAA,EAAM,MAAM,QAAA;AAAS;AAEjD;ACJO,IAAM,yBAAyB,CAAC;AAAA,EACrC,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA,GAAY;AACd,CAAA,KAAmC;AACjC,EAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAS,GAAIA,2BAAA,EAAW;AAEtC,EAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAElB,EAAA,MAAM,cAAA,GAAiB;AAAA,IACrB,GAAA,EAAK,kBAAA;AAAA,IACL,MAAA,EAAQ,eAAA;AAAA,IACR,IAAA,EAAM,0CAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACT;AAEA,EAAA,MAAM,WAAA,GAAc,wBAAwB,SAAS,CAAA;AAErD,EAAA,uBACEC,cAAA;AAAA,IAACC,mBAAA,CAAO,GAAA;AAAA,IAAP;AAAA,MACC,WAAA,EAAW,IAAA;AAAA,MACX,IAAA,EAAK,SAAA;AAAA,MACJ,GAAG,WAAA;AAAA,MACJ,SAAA,EAAWC,mBAAA;AAAA,QACTC,gCAAA,CAAgB,EAAE,OAAA,EAAS,IAAA,EAAM,OAAO,CAAA;AAAA,QACxC,eAAe,QAAQ,CAAA;AAAA,QACvB;AAAA,OACF;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"animated.js","sourcesContent":["import type { TooltipAnimationPresets } from \"./types\";\n\n\nexport const tooltipAnimationPresets: TooltipAnimationPresets = {\n none: {},\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n transition: { duration: 0.15, ease: \"easeOut\" },\n },\n scale: {\n initial: { opacity: 0, scale: 0.96 },\n animate: { opacity: 1, scale: 1 },\n transition: { duration: 0.15, ease: \"easeIn\" },\n },\n};\n","\"use client\";\n\nimport { motion } from \"framer-motion\";\n\nimport { cn } from \"../../../lib/utils\";\n\nimport { tooltipAnimationPresets } from \"./animations\";\nimport type { TooltipContentAnimatedProps } from \"./types\";\nimport { tooltipVariants } from \"../variants\";\nimport { useTooltip } from \"../tooltip-base\";\n\nexport const TooltipContentAnimated = ({\n children,\n className,\n variant,\n size,\n width,\n animation = \"none\",\n}: TooltipContentAnimatedProps) => {\n const { open, position } = useTooltip();\n\n if (!open) return null;\n\n const positionStyles = {\n top: \"bottom-full mb-2\",\n bottom: \"top-full mt-2\",\n left: \"right-full top-1/2 -translate-y-1/2 mr-2\",\n right: \"left-full top-1/2 -translate-y-1/2 ml-2\",\n };\n\n const motionProps = tooltipAnimationPresets[animation];\n\n return (\n <motion.div\n data-open={open}\n role=\"tooltip\"\n {...motionProps}\n className={cn(\n tooltipVariants({ variant, size, width }),\n positionStyles[position],\n className,\n )}\n >\n {children}\n </motion.div>\n );\n};\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useTooltip, tooltipVariants } from '../../chunk-YNCD6TKE.mjs';
|
|
3
|
+
import { cn } from '../../chunk-DFEZH7TC.mjs';
|
|
4
|
+
import { motion } from 'framer-motion';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
// src/ui/tooltip/animated/animations.ts
|
|
8
|
+
var tooltipAnimationPresets = {
|
|
9
|
+
none: {},
|
|
10
|
+
fade: {
|
|
11
|
+
initial: { opacity: 0 },
|
|
12
|
+
animate: { opacity: 1 },
|
|
13
|
+
transition: { duration: 0.15, ease: "easeOut" }
|
|
14
|
+
},
|
|
15
|
+
scale: {
|
|
16
|
+
initial: { opacity: 0, scale: 0.96 },
|
|
17
|
+
animate: { opacity: 1, scale: 1 },
|
|
18
|
+
transition: { duration: 0.15, ease: "easeIn" }
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var TooltipContentAnimated = ({
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
variant,
|
|
25
|
+
size,
|
|
26
|
+
width,
|
|
27
|
+
animation = "none"
|
|
28
|
+
}) => {
|
|
29
|
+
const { open, position } = useTooltip();
|
|
30
|
+
if (!open) return null;
|
|
31
|
+
const positionStyles = {
|
|
32
|
+
top: "bottom-full mb-2",
|
|
33
|
+
bottom: "top-full mt-2",
|
|
34
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
35
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
36
|
+
};
|
|
37
|
+
const motionProps = tooltipAnimationPresets[animation];
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
motion.div,
|
|
40
|
+
{
|
|
41
|
+
"data-open": open,
|
|
42
|
+
role: "tooltip",
|
|
43
|
+
...motionProps,
|
|
44
|
+
className: cn(
|
|
45
|
+
tooltipVariants({ variant, size, width }),
|
|
46
|
+
positionStyles[position],
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
children
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { TooltipContentAnimated, tooltipAnimationPresets };
|
|
55
|
+
//# sourceMappingURL=animated.mjs.map
|
|
56
|
+
//# sourceMappingURL=animated.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/tooltip/animated/animations.ts","../../../src/ui/tooltip/animated/tooltip-content-animated.tsx"],"names":[],"mappings":";;;;;;AAGO,IAAM,uBAAA,GAAmD;AAAA,EAC9D,MAAM,EAAC;AAAA,EACP,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,IACtB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,IACtB,UAAA,EAAY,EAAE,QAAA,EAAU,IAAA,EAAM,MAAM,SAAA;AAAU,GAChD;AAAA,EACA,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,OAAO,IAAA,EAAK;AAAA,IACnC,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,OAAO,CAAA,EAAE;AAAA,IAChC,UAAA,EAAY,EAAE,QAAA,EAAU,IAAA,EAAM,MAAM,QAAA;AAAS;AAEjD;ACJO,IAAM,yBAAyB,CAAC;AAAA,EACrC,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA,GAAY;AACd,CAAA,KAAmC;AACjC,EAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAS,GAAI,UAAA,EAAW;AAEtC,EAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAElB,EAAA,MAAM,cAAA,GAAiB;AAAA,IACrB,GAAA,EAAK,kBAAA;AAAA,IACL,MAAA,EAAQ,eAAA;AAAA,IACR,IAAA,EAAM,0CAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACT;AAEA,EAAA,MAAM,WAAA,GAAc,wBAAwB,SAAS,CAAA;AAErD,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA,CAAO,GAAA;AAAA,IAAP;AAAA,MACC,WAAA,EAAW,IAAA;AAAA,MACX,IAAA,EAAK,SAAA;AAAA,MACJ,GAAG,WAAA;AAAA,MACJ,SAAA,EAAW,EAAA;AAAA,QACT,eAAA,CAAgB,EAAE,OAAA,EAAS,IAAA,EAAM,OAAO,CAAA;AAAA,QACxC,eAAe,QAAQ,CAAA;AAAA,QACvB;AAAA,OACF;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"animated.mjs","sourcesContent":["import type { TooltipAnimationPresets } from \"./types\";\n\n\nexport const tooltipAnimationPresets: TooltipAnimationPresets = {\n none: {},\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n transition: { duration: 0.15, ease: \"easeOut\" },\n },\n scale: {\n initial: { opacity: 0, scale: 0.96 },\n animate: { opacity: 1, scale: 1 },\n transition: { duration: 0.15, ease: \"easeIn\" },\n },\n};\n","\"use client\";\n\nimport { motion } from \"framer-motion\";\n\nimport { cn } from \"../../../lib/utils\";\n\nimport { tooltipAnimationPresets } from \"./animations\";\nimport type { TooltipContentAnimatedProps } from \"./types\";\nimport { tooltipVariants } from \"../variants\";\nimport { useTooltip } from \"../tooltip-base\";\n\nexport const TooltipContentAnimated = ({\n children,\n className,\n variant,\n size,\n width,\n animation = \"none\",\n}: TooltipContentAnimatedProps) => {\n const { open, position } = useTooltip();\n\n if (!open) return null;\n\n const positionStyles = {\n top: \"bottom-full mb-2\",\n bottom: \"top-full mt-2\",\n left: \"right-full top-1/2 -translate-y-1/2 mr-2\",\n right: \"left-full top-1/2 -translate-y-1/2 ml-2\",\n };\n\n const motionProps = tooltipAnimationPresets[animation];\n\n return (\n <motion.div\n data-open={open}\n role=\"tooltip\"\n {...motionProps}\n className={cn(\n tooltipVariants({ variant, size, width }),\n positionStyles[position],\n className,\n )}\n >\n {children}\n </motion.div>\n );\n};\n"]}
|
package/dist/ui/tooltip.d.mts
CHANGED
|
@@ -1,41 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { T as TooltipProps, a as TooltipContentProps, b as TooltipContextType, c as TooltipTriggerProps } from '../types-Cn7IcgkH.mjs';
|
|
4
|
+
export { d as TooltipPosition } from '../types-Cn7IcgkH.mjs';
|
|
3
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
type TooltipContextType = {
|
|
7
|
-
open: boolean;
|
|
8
|
-
setOpen: (value: boolean) => void;
|
|
9
|
-
position: TooltipPosition;
|
|
10
|
-
delay: number;
|
|
11
|
-
scheduleDelayedOpen: () => void;
|
|
12
|
-
cancelDelayedOpen: () => void;
|
|
13
|
-
};
|
|
14
|
-
type TooltipProps = {
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
defaultOpen?: boolean;
|
|
17
|
-
open?: boolean;
|
|
18
|
-
onOpenChange?: (open: boolean) => void;
|
|
19
|
-
position?: TooltipPosition;
|
|
20
|
-
delay?: number;
|
|
21
|
-
};
|
|
22
|
-
type TooltipTriggerProps = {
|
|
23
|
-
children: ReactNode;
|
|
24
|
-
className?: string;
|
|
25
|
-
};
|
|
26
|
-
type TooltipContentProps = {
|
|
27
|
-
children: ReactNode;
|
|
28
|
-
className?: string;
|
|
29
|
-
variant?: "default" | "outline" | "ghost" | "glass" | "emerald" | "indigo" | "purple" | "pink" | "rose" | "sky" | "teal" | "yellow" | "orange" | "green" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange";
|
|
30
|
-
size?: "sm" | "md" | "lg";
|
|
31
|
-
width?: "fit" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
32
|
-
animation?: "fade" | "scale" | "none";
|
|
33
|
-
};
|
|
34
|
-
|
|
7
|
+
declare const TooltipContext: react.Context<TooltipContextType | null>;
|
|
35
8
|
declare const useTooltip: () => TooltipContextType;
|
|
36
9
|
declare const Tooltip: ({ children, defaultOpen, open: controlledOpen, onOpenChange, position, delay, }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
37
10
|
declare const TooltipTrigger: ({ children, className, }: TooltipTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
38
|
-
declare const TooltipContent: ({ children, className, variant, size, width,
|
|
11
|
+
declare const TooltipContent: ({ children, className, variant, size, width, }: TooltipContentProps) => react_jsx_runtime.JSX.Element | null;
|
|
39
12
|
|
|
40
13
|
declare const tooltipVariants: (props?: ({
|
|
41
14
|
variant?: "default" | "outline" | "ghost" | "glass" | "emerald" | "indigo" | "purple" | "pink" | "rose" | "sky" | "teal" | "yellow" | "orange" | "green" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | null | undefined;
|
|
@@ -43,4 +16,4 @@ declare const tooltipVariants: (props?: ({
|
|
|
43
16
|
width?: "sm" | "md" | "lg" | "fit" | "xs" | "xl" | "2xl" | null | undefined;
|
|
44
17
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
45
18
|
|
|
46
|
-
export { Tooltip, TooltipContent,
|
|
19
|
+
export { Tooltip, TooltipContent, TooltipContentProps, TooltipContext, TooltipContextType, TooltipProps, TooltipTrigger, TooltipTriggerProps, tooltipVariants, useTooltip };
|
package/dist/ui/tooltip.d.ts
CHANGED
|
@@ -1,41 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { T as TooltipProps, a as TooltipContentProps, b as TooltipContextType, c as TooltipTriggerProps } from '../types-Cn7IcgkH.js';
|
|
4
|
+
export { d as TooltipPosition } from '../types-Cn7IcgkH.js';
|
|
3
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
type TooltipContextType = {
|
|
7
|
-
open: boolean;
|
|
8
|
-
setOpen: (value: boolean) => void;
|
|
9
|
-
position: TooltipPosition;
|
|
10
|
-
delay: number;
|
|
11
|
-
scheduleDelayedOpen: () => void;
|
|
12
|
-
cancelDelayedOpen: () => void;
|
|
13
|
-
};
|
|
14
|
-
type TooltipProps = {
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
defaultOpen?: boolean;
|
|
17
|
-
open?: boolean;
|
|
18
|
-
onOpenChange?: (open: boolean) => void;
|
|
19
|
-
position?: TooltipPosition;
|
|
20
|
-
delay?: number;
|
|
21
|
-
};
|
|
22
|
-
type TooltipTriggerProps = {
|
|
23
|
-
children: ReactNode;
|
|
24
|
-
className?: string;
|
|
25
|
-
};
|
|
26
|
-
type TooltipContentProps = {
|
|
27
|
-
children: ReactNode;
|
|
28
|
-
className?: string;
|
|
29
|
-
variant?: "default" | "outline" | "ghost" | "glass" | "emerald" | "indigo" | "purple" | "pink" | "rose" | "sky" | "teal" | "yellow" | "orange" | "green" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange";
|
|
30
|
-
size?: "sm" | "md" | "lg";
|
|
31
|
-
width?: "fit" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
32
|
-
animation?: "fade" | "scale" | "none";
|
|
33
|
-
};
|
|
34
|
-
|
|
7
|
+
declare const TooltipContext: react.Context<TooltipContextType | null>;
|
|
35
8
|
declare const useTooltip: () => TooltipContextType;
|
|
36
9
|
declare const Tooltip: ({ children, defaultOpen, open: controlledOpen, onOpenChange, position, delay, }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
37
10
|
declare const TooltipTrigger: ({ children, className, }: TooltipTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
38
|
-
declare const TooltipContent: ({ children, className, variant, size, width,
|
|
11
|
+
declare const TooltipContent: ({ children, className, variant, size, width, }: TooltipContentProps) => react_jsx_runtime.JSX.Element | null;
|
|
39
12
|
|
|
40
13
|
declare const tooltipVariants: (props?: ({
|
|
41
14
|
variant?: "default" | "outline" | "ghost" | "glass" | "emerald" | "indigo" | "purple" | "pink" | "rose" | "sky" | "teal" | "yellow" | "orange" | "green" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | null | undefined;
|
|
@@ -43,4 +16,4 @@ declare const tooltipVariants: (props?: ({
|
|
|
43
16
|
width?: "sm" | "md" | "lg" | "fit" | "xs" | "xl" | "2xl" | null | undefined;
|
|
44
17
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
45
18
|
|
|
46
|
-
export { Tooltip, TooltipContent,
|
|
19
|
+
export { Tooltip, TooltipContent, TooltipContentProps, TooltipContext, TooltipContextType, TooltipProps, TooltipTrigger, TooltipTriggerProps, tooltipVariants, useTooltip };
|