@zentauri-ui/zentauri-components 2.2.1 → 2.2.2
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 +8 -7
- package/cli/props.json +297 -0
- package/cli/registry.json +6 -0
- package/dist/{chunk-NW5BSLR2.js → chunk-5I4GAURE.js} +6 -6
- package/dist/{chunk-NW5BSLR2.js.map → chunk-5I4GAURE.js.map} +1 -1
- package/dist/chunk-ATE5SCTR.mjs +39 -0
- package/dist/chunk-ATE5SCTR.mjs.map +1 -0
- package/dist/chunk-DIAA5VH4.mjs +64 -0
- package/dist/chunk-DIAA5VH4.mjs.map +1 -0
- package/dist/{chunk-5HLEHSPM.mjs → chunk-GFE6ZX5Y.mjs} +13 -3
- package/dist/chunk-GFE6ZX5Y.mjs.map +1 -0
- package/dist/chunk-H3BJOK22.js +74 -0
- package/dist/chunk-H3BJOK22.js.map +1 -0
- package/dist/chunk-ILPPXWR3.js +19 -0
- package/dist/{chunk-YBKNXDZU.js.map → chunk-ILPPXWR3.js.map} +1 -1
- package/dist/{chunk-DUH2YLH2.js → chunk-IY72Z65Z.js} +12 -12
- package/dist/{chunk-DUH2YLH2.js.map → chunk-IY72Z65Z.js.map} +1 -1
- package/dist/{chunk-YSQW56JX.mjs → chunk-N2G7IWHS.mjs} +4 -4
- package/dist/{chunk-YSQW56JX.mjs.map → chunk-N2G7IWHS.mjs.map} +1 -1
- package/dist/{chunk-Z4Y5IPR3.mjs → chunk-NUV2I337.mjs} +3 -3
- package/dist/{chunk-Z4Y5IPR3.mjs.map → chunk-NUV2I337.mjs.map} +1 -1
- package/dist/chunk-PQ2XTY3M.js +44 -0
- package/dist/chunk-PQ2XTY3M.js.map +1 -0
- package/dist/{chunk-UJZ7JQBQ.js → chunk-UZ6Y5CSV.js} +13 -3
- package/dist/chunk-UZ6Y5CSV.js.map +1 -0
- package/dist/{chunk-45ZHGDT2.mjs → chunk-W5MTZJPE.mjs} +3 -3
- package/dist/{chunk-45ZHGDT2.mjs.map → chunk-W5MTZJPE.mjs.map} +1 -1
- package/dist/design-system/facade.js +4 -3
- package/dist/design-system/facade.js.map +1 -1
- package/dist/design-system/facade.mjs +3 -2
- package/dist/design-system/facade.mjs.map +1 -1
- package/dist/design-system/index.d.ts +1 -0
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/design-system/secret-reveal.d.ts +57 -0
- package/dist/design-system/secret-reveal.d.ts.map +1 -0
- package/dist/ui/buttons/animated.js +6 -5
- package/dist/ui/buttons/animated.js.map +1 -1
- package/dist/ui/buttons/animated.mjs +4 -3
- package/dist/ui/buttons/animated.mjs.map +1 -1
- package/dist/ui/buttons.js +7 -6
- package/dist/ui/buttons.mjs +5 -4
- package/dist/ui/data-table.js +16 -15
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/data-table.mjs +6 -5
- package/dist/ui/data-table.mjs.map +1 -1
- package/dist/ui/dynamic-stepper.js +16 -15
- package/dist/ui/dynamic-stepper.js.map +1 -1
- package/dist/ui/dynamic-stepper.mjs +5 -4
- package/dist/ui/dynamic-stepper.mjs.map +1 -1
- package/dist/ui/pagination.js +8 -7
- package/dist/ui/pagination.mjs +5 -4
- package/dist/ui/secret-reveal/animated/animations.d.ts +8 -0
- package/dist/ui/secret-reveal/animated/animations.d.ts.map +1 -0
- package/dist/ui/secret-reveal/animated/index.d.ts +4 -0
- package/dist/ui/secret-reveal/animated/index.d.ts.map +1 -0
- package/dist/ui/secret-reveal/animated/secret-reveal-animated.d.ts +6 -0
- package/dist/ui/secret-reveal/animated/secret-reveal-animated.d.ts.map +1 -0
- package/dist/ui/secret-reveal/animated/types.d.ts +9 -0
- package/dist/ui/secret-reveal/animated/types.d.ts.map +1 -0
- package/dist/ui/secret-reveal/animated.js +194 -0
- package/dist/ui/secret-reveal/animated.js.map +1 -0
- package/dist/ui/secret-reveal/animated.mjs +191 -0
- package/dist/ui/secret-reveal/animated.mjs.map +1 -0
- package/dist/ui/secret-reveal/index.d.ts +4 -0
- package/dist/ui/secret-reveal/index.d.ts.map +1 -0
- package/dist/ui/secret-reveal/secret-reveal-base.d.ts +6 -0
- package/dist/ui/secret-reveal/secret-reveal-base.d.ts.map +1 -0
- package/dist/ui/secret-reveal/secret-reveal.d.ts +2 -0
- package/dist/ui/secret-reveal/secret-reveal.d.ts.map +1 -0
- package/dist/ui/secret-reveal/types.d.ts +15 -0
- package/dist/ui/secret-reveal/types.d.ts.map +1 -0
- package/dist/ui/secret-reveal/variants.d.ts +15 -0
- package/dist/ui/secret-reveal/variants.d.ts.map +1 -0
- package/dist/ui/secret-reveal.js +136 -0
- package/dist/ui/secret-reveal.js.map +1 -0
- package/dist/ui/secret-reveal.mjs +119 -0
- package/dist/ui/secret-reveal.mjs.map +1 -0
- package/dist/ui/split-button.js +18 -17
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/split-button.mjs +5 -4
- package/dist/ui/split-button.mjs.map +1 -1
- package/package.json +1 -1
- package/src/design-system/index.ts +1 -0
- package/src/design-system/secret-reveal.ts +75 -0
- package/src/ui/secret-reveal/animated/animations.ts +74 -0
- package/src/ui/secret-reveal/animated/index.ts +5 -0
- package/src/ui/secret-reveal/animated/secret-reveal-animated.tsx +132 -0
- package/src/ui/secret-reveal/animated/types.ts +11 -0
- package/src/ui/secret-reveal/index.ts +14 -0
- package/src/ui/secret-reveal/secret-reveal-base.tsx +116 -0
- package/src/ui/secret-reveal/secret-reveal.test.tsx +75 -0
- package/src/ui/secret-reveal/secret-reveal.tsx +2 -0
- package/src/ui/secret-reveal/types.ts +21 -0
- package/src/ui/secret-reveal/variants.ts +49 -0
- package/dist/chunk-5HLEHSPM.mjs.map +0 -1
- package/dist/chunk-UJZ7JQBQ.js.map +0 -1
- package/dist/chunk-YBKNXDZU.js +0 -19
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkPQ2XTY3M_js = require('../../chunk-PQ2XTY3M.js');
|
|
5
|
+
require('../../chunk-H3BJOK22.js');
|
|
6
|
+
var chunkZS5756ZC_js = require('../../chunk-ZS5756ZC.js');
|
|
7
|
+
require('../../chunk-PZ5AY32C.js');
|
|
8
|
+
var framerMotion = require('framer-motion');
|
|
9
|
+
var react = require('react');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
|
|
12
|
+
// src/ui/secret-reveal/animated/animations.ts
|
|
13
|
+
var secretRevealAnimationPresets = {
|
|
14
|
+
none: {
|
|
15
|
+
transition: { duration: 0 },
|
|
16
|
+
variants: {
|
|
17
|
+
initial: { opacity: 1 },
|
|
18
|
+
animate: { opacity: 1 },
|
|
19
|
+
exit: { opacity: 1 }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
fade: {
|
|
23
|
+
transition: { duration: 0.25, ease: "easeInOut" },
|
|
24
|
+
variants: {
|
|
25
|
+
initial: { opacity: 0 },
|
|
26
|
+
animate: { opacity: 1 },
|
|
27
|
+
exit: { opacity: 0 }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"slide-up": {
|
|
31
|
+
transition: {
|
|
32
|
+
type: "spring",
|
|
33
|
+
stiffness: 300,
|
|
34
|
+
damping: 25,
|
|
35
|
+
mass: 0.5
|
|
36
|
+
},
|
|
37
|
+
variants: {
|
|
38
|
+
initial: { opacity: 0, y: 8 },
|
|
39
|
+
animate: { opacity: 1, y: 0 },
|
|
40
|
+
exit: { opacity: 0, y: -8 }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
scale: {
|
|
44
|
+
transition: {
|
|
45
|
+
type: "spring",
|
|
46
|
+
stiffness: 400,
|
|
47
|
+
damping: 20,
|
|
48
|
+
mass: 0.4
|
|
49
|
+
},
|
|
50
|
+
variants: {
|
|
51
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
52
|
+
animate: { opacity: 1, scale: 1 },
|
|
53
|
+
exit: { opacity: 0, scale: 0.9 }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
flip: {
|
|
57
|
+
transition: {
|
|
58
|
+
type: "spring",
|
|
59
|
+
stiffness: 200,
|
|
60
|
+
damping: 18,
|
|
61
|
+
mass: 0.6
|
|
62
|
+
},
|
|
63
|
+
variants: {
|
|
64
|
+
initial: { opacity: 0, rotateX: 90 },
|
|
65
|
+
animate: { opacity: 1, rotateX: 0 },
|
|
66
|
+
exit: { opacity: 0, rotateX: -90 }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function SecretRevealAnimated({
|
|
71
|
+
appearance,
|
|
72
|
+
size,
|
|
73
|
+
value,
|
|
74
|
+
children,
|
|
75
|
+
label,
|
|
76
|
+
labelPosition = "top",
|
|
77
|
+
initiallyRevealed = false,
|
|
78
|
+
onVisibilityChange,
|
|
79
|
+
animation = "fade",
|
|
80
|
+
muteChar = "\u2022",
|
|
81
|
+
className,
|
|
82
|
+
ref,
|
|
83
|
+
...rest
|
|
84
|
+
}) {
|
|
85
|
+
const [revealed, setRevealed] = react.useState(initiallyRevealed);
|
|
86
|
+
const toggle = react.useCallback(() => {
|
|
87
|
+
const next = !revealed;
|
|
88
|
+
setRevealed(next);
|
|
89
|
+
onVisibilityChange?.(next);
|
|
90
|
+
}, [onVisibilityChange, revealed]);
|
|
91
|
+
const preset = secretRevealAnimationPresets[animation];
|
|
92
|
+
const displayText = value ?? (typeof children === "string" ? children : "");
|
|
93
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
ref,
|
|
97
|
+
"data-slot": "secret-reveal",
|
|
98
|
+
className: chunkZS5756ZC_js.cn(chunkPQ2XTY3M_js.secretRevealVariants({ appearance, size }), className),
|
|
99
|
+
...rest,
|
|
100
|
+
children: [
|
|
101
|
+
label && labelPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "secret-reveal-label",
|
|
105
|
+
className: chunkPQ2XTY3M_js.secretRevealLabelVariants({ size }),
|
|
106
|
+
children: label
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
110
|
+
label && labelPosition === "side" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
111
|
+
"span",
|
|
112
|
+
{
|
|
113
|
+
"data-slot": "secret-reveal-label",
|
|
114
|
+
className: chunkPQ2XTY3M_js.secretRevealLabelVariants({ size }),
|
|
115
|
+
children: label
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
+
"span",
|
|
120
|
+
{
|
|
121
|
+
"data-slot": "secret-reveal-value",
|
|
122
|
+
className: chunkZS5756ZC_js.cn(chunkPQ2XTY3M_js.secretRevealValueVariants({ size }), "flex-1 truncate"),
|
|
123
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
124
|
+
framerMotion.motion.span,
|
|
125
|
+
{
|
|
126
|
+
initial: "initial",
|
|
127
|
+
animate: "animate",
|
|
128
|
+
exit: "exit",
|
|
129
|
+
variants: preset.variants,
|
|
130
|
+
transition: preset.transition,
|
|
131
|
+
className: "inline-block",
|
|
132
|
+
children: revealed ? value ?? children : muteChar.repeat(displayText.length || 8)
|
|
133
|
+
},
|
|
134
|
+
revealed ? "revealed" : "hidden"
|
|
135
|
+
) })
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
139
|
+
"button",
|
|
140
|
+
{
|
|
141
|
+
type: "button",
|
|
142
|
+
"data-slot": "secret-reveal-toggle",
|
|
143
|
+
className: chunkPQ2XTY3M_js.secretRevealToggleVariants({ size, appearance }),
|
|
144
|
+
onClick: toggle,
|
|
145
|
+
"aria-label": revealed ? "Hide secret" : "Reveal secret",
|
|
146
|
+
children: revealed ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
147
|
+
"svg",
|
|
148
|
+
{
|
|
149
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
150
|
+
width: "16",
|
|
151
|
+
height: "16",
|
|
152
|
+
viewBox: "0 0 24 24",
|
|
153
|
+
fill: "none",
|
|
154
|
+
stroke: "currentColor",
|
|
155
|
+
strokeWidth: "2",
|
|
156
|
+
strokeLinecap: "round",
|
|
157
|
+
strokeLinejoin: "round",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" }),
|
|
160
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" }),
|
|
161
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
165
|
+
"svg",
|
|
166
|
+
{
|
|
167
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
168
|
+
width: "16",
|
|
169
|
+
height: "16",
|
|
170
|
+
viewBox: "0 0 24 24",
|
|
171
|
+
fill: "none",
|
|
172
|
+
stroke: "currentColor",
|
|
173
|
+
strokeWidth: "2",
|
|
174
|
+
strokeLinecap: "round",
|
|
175
|
+
strokeLinejoin: "round",
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
178
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
SecretRevealAnimated.displayName = "SecretRevealAnimated";
|
|
190
|
+
|
|
191
|
+
exports.SecretRevealAnimated = SecretRevealAnimated;
|
|
192
|
+
exports.secretRevealAnimationPresets = secretRevealAnimationPresets;
|
|
193
|
+
//# sourceMappingURL=animated.js.map
|
|
194
|
+
//# sourceMappingURL=animated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/secret-reveal/animated/animations.ts","../../../src/ui/secret-reveal/animated/secret-reveal-animated.tsx"],"names":["useState","useCallback","jsxs","cn","secretRevealVariants","jsx","secretRevealLabelVariants","secretRevealValueVariants","AnimatePresence","motion","secretRevealToggleVariants"],"mappings":";;;;;;;;;;;AAiBO,IAAM,4BAAA,GAA6D;AAAA,EACxE,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,QAAA,EAAU,CAAA,EAAE;AAAA,IAC1B,QAAA,EAAU;AAAA,MACR,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,IAAA,EAAM,EAAE,OAAA,EAAS,CAAA;AAAE;AACrB,GACF;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,QAAA,EAAU,IAAA,EAAM,MAAM,WAAA,EAAY;AAAA,IAChD,QAAA,EAAU;AAAA,MACR,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,IAAA,EAAM,EAAE,OAAA,EAAS,CAAA;AAAE;AACrB,GACF;AAAA,EACA,UAAA,EAAY;AAAA,IACV,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,QAAA;AAAA,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":"animated.js","sourcesContent":["import type { Transition, Variants } from \"framer-motion\";\n\nexport type SecretRevealAnimation =\n | \"none\"\n | \"fade\"\n | \"slide-up\"\n | \"scale\"\n | \"flip\";\n\nexport type SecretRevealAnimationPresets = Record<\n SecretRevealAnimation,\n {\n transition: Transition;\n variants: Variants;\n }\n>;\n\nexport const secretRevealAnimationPresets: SecretRevealAnimationPresets = {\n none: {\n transition: { duration: 0 },\n variants: {\n initial: { opacity: 1 },\n animate: { opacity: 1 },\n exit: { opacity: 1 },\n },\n },\n fade: {\n transition: { duration: 0.25, ease: \"easeInOut\" },\n variants: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n },\n },\n \"slide-up\": {\n transition: {\n type: \"spring\",\n stiffness: 300,\n damping: 25,\n mass: 0.5,\n },\n variants: {\n initial: { opacity: 0, y: 8 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -8 },\n },\n },\n scale: {\n transition: {\n type: \"spring\",\n stiffness: 400,\n damping: 20,\n mass: 0.4,\n },\n variants: {\n initial: { opacity: 0, scale: 0.9 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.9 },\n },\n },\n flip: {\n transition: {\n type: \"spring\",\n stiffness: 200,\n damping: 18,\n mass: 0.6,\n },\n variants: {\n initial: { opacity: 0, rotateX: 90 },\n animate: { opacity: 1, rotateX: 0 },\n exit: { opacity: 0, rotateX: -90 },\n },\n },\n};\n","\"use client\";\n\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { useCallback, useState } from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nimport { secretRevealAnimationPresets } from \"./animations\";\nimport type { SecretRevealAnimatedProps } from \"./types\";\nimport {\n secretRevealLabelVariants,\n secretRevealToggleVariants,\n secretRevealValueVariants,\n secretRevealVariants,\n} from \"../variants\";\n\nexport function SecretRevealAnimated({\n appearance,\n size,\n value,\n children,\n label,\n labelPosition = \"top\",\n initiallyRevealed = false,\n onVisibilityChange,\n animation = \"fade\",\n muteChar = \"•\",\n className,\n ref,\n ...rest\n}: SecretRevealAnimatedProps) {\n const [revealed, setRevealed] = useState(initiallyRevealed);\n\n const toggle = useCallback(() => {\n const next = !revealed;\n setRevealed(next);\n onVisibilityChange?.(next);\n }, [onVisibilityChange, revealed]);\n\n const preset = secretRevealAnimationPresets[animation];\n const displayText = value ?? (typeof children === \"string\" ? children : \"\");\n\n return (\n <div\n ref={ref}\n data-slot=\"secret-reveal\"\n className={cn(secretRevealVariants({ appearance, size }), className)}\n {...rest}\n >\n {label && labelPosition === \"top\" && (\n <span\n data-slot=\"secret-reveal-label\"\n className={secretRevealLabelVariants({ size })}\n >\n {label}\n </span>\n )}\n <span className=\"flex items-center gap-2 flex-1 min-w-0\">\n {label && labelPosition === \"side\" && (\n <span\n data-slot=\"secret-reveal-label\"\n className={secretRevealLabelVariants({ size })}\n >\n {label}\n </span>\n )}\n <span\n data-slot=\"secret-reveal-value\"\n className={cn(secretRevealValueVariants({ size }), \"flex-1 truncate\")}\n >\n <AnimatePresence mode=\"wait\">\n <motion.span\n key={revealed ? \"revealed\" : \"hidden\"}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n variants={preset.variants}\n transition={preset.transition}\n className=\"inline-block\"\n >\n {revealed\n ? (value ?? children)\n : muteChar.repeat(displayText.length || 8)}\n </motion.span>\n </AnimatePresence>\n </span>\n <button\n type=\"button\"\n data-slot=\"secret-reveal-toggle\"\n className={secretRevealToggleVariants({ size, appearance })}\n onClick={toggle}\n aria-label={revealed ? \"Hide secret\" : \"Reveal secret\"}\n >\n {revealed ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94\" />\n <path d=\"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" />\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n )}\n </button>\n </span>\n </div>\n );\n}\n\nSecretRevealAnimated.displayName = \"SecretRevealAnimated\";\n"]}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { secretRevealLabelVariants, secretRevealValueVariants, secretRevealToggleVariants, secretRevealVariants } from '../../chunk-ATE5SCTR.mjs';
|
|
3
|
+
import '../../chunk-DIAA5VH4.mjs';
|
|
4
|
+
import { cn } from '../../chunk-4D54YOL6.mjs';
|
|
5
|
+
import '../../chunk-J5LGTIGS.mjs';
|
|
6
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
7
|
+
import { useState, useCallback } from 'react';
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
// src/ui/secret-reveal/animated/animations.ts
|
|
11
|
+
var secretRevealAnimationPresets = {
|
|
12
|
+
none: {
|
|
13
|
+
transition: { duration: 0 },
|
|
14
|
+
variants: {
|
|
15
|
+
initial: { opacity: 1 },
|
|
16
|
+
animate: { opacity: 1 },
|
|
17
|
+
exit: { opacity: 1 }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
fade: {
|
|
21
|
+
transition: { duration: 0.25, ease: "easeInOut" },
|
|
22
|
+
variants: {
|
|
23
|
+
initial: { opacity: 0 },
|
|
24
|
+
animate: { opacity: 1 },
|
|
25
|
+
exit: { opacity: 0 }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"slide-up": {
|
|
29
|
+
transition: {
|
|
30
|
+
type: "spring",
|
|
31
|
+
stiffness: 300,
|
|
32
|
+
damping: 25,
|
|
33
|
+
mass: 0.5
|
|
34
|
+
},
|
|
35
|
+
variants: {
|
|
36
|
+
initial: { opacity: 0, y: 8 },
|
|
37
|
+
animate: { opacity: 1, y: 0 },
|
|
38
|
+
exit: { opacity: 0, y: -8 }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
scale: {
|
|
42
|
+
transition: {
|
|
43
|
+
type: "spring",
|
|
44
|
+
stiffness: 400,
|
|
45
|
+
damping: 20,
|
|
46
|
+
mass: 0.4
|
|
47
|
+
},
|
|
48
|
+
variants: {
|
|
49
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
50
|
+
animate: { opacity: 1, scale: 1 },
|
|
51
|
+
exit: { opacity: 0, scale: 0.9 }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
flip: {
|
|
55
|
+
transition: {
|
|
56
|
+
type: "spring",
|
|
57
|
+
stiffness: 200,
|
|
58
|
+
damping: 18,
|
|
59
|
+
mass: 0.6
|
|
60
|
+
},
|
|
61
|
+
variants: {
|
|
62
|
+
initial: { opacity: 0, rotateX: 90 },
|
|
63
|
+
animate: { opacity: 1, rotateX: 0 },
|
|
64
|
+
exit: { opacity: 0, rotateX: -90 }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function SecretRevealAnimated({
|
|
69
|
+
appearance,
|
|
70
|
+
size,
|
|
71
|
+
value,
|
|
72
|
+
children,
|
|
73
|
+
label,
|
|
74
|
+
labelPosition = "top",
|
|
75
|
+
initiallyRevealed = false,
|
|
76
|
+
onVisibilityChange,
|
|
77
|
+
animation = "fade",
|
|
78
|
+
muteChar = "\u2022",
|
|
79
|
+
className,
|
|
80
|
+
ref,
|
|
81
|
+
...rest
|
|
82
|
+
}) {
|
|
83
|
+
const [revealed, setRevealed] = useState(initiallyRevealed);
|
|
84
|
+
const toggle = useCallback(() => {
|
|
85
|
+
const next = !revealed;
|
|
86
|
+
setRevealed(next);
|
|
87
|
+
onVisibilityChange?.(next);
|
|
88
|
+
}, [onVisibilityChange, revealed]);
|
|
89
|
+
const preset = secretRevealAnimationPresets[animation];
|
|
90
|
+
const displayText = value ?? (typeof children === "string" ? children : "");
|
|
91
|
+
return /* @__PURE__ */ jsxs(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
ref,
|
|
95
|
+
"data-slot": "secret-reveal",
|
|
96
|
+
className: cn(secretRevealVariants({ appearance, size }), className),
|
|
97
|
+
...rest,
|
|
98
|
+
children: [
|
|
99
|
+
label && labelPosition === "top" && /* @__PURE__ */ jsx(
|
|
100
|
+
"span",
|
|
101
|
+
{
|
|
102
|
+
"data-slot": "secret-reveal-label",
|
|
103
|
+
className: secretRevealLabelVariants({ size }),
|
|
104
|
+
children: label
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
108
|
+
label && labelPosition === "side" && /* @__PURE__ */ jsx(
|
|
109
|
+
"span",
|
|
110
|
+
{
|
|
111
|
+
"data-slot": "secret-reveal-label",
|
|
112
|
+
className: secretRevealLabelVariants({ size }),
|
|
113
|
+
children: label
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
"span",
|
|
118
|
+
{
|
|
119
|
+
"data-slot": "secret-reveal-value",
|
|
120
|
+
className: cn(secretRevealValueVariants({ size }), "flex-1 truncate"),
|
|
121
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(
|
|
122
|
+
motion.span,
|
|
123
|
+
{
|
|
124
|
+
initial: "initial",
|
|
125
|
+
animate: "animate",
|
|
126
|
+
exit: "exit",
|
|
127
|
+
variants: preset.variants,
|
|
128
|
+
transition: preset.transition,
|
|
129
|
+
className: "inline-block",
|
|
130
|
+
children: revealed ? value ?? children : muteChar.repeat(displayText.length || 8)
|
|
131
|
+
},
|
|
132
|
+
revealed ? "revealed" : "hidden"
|
|
133
|
+
) })
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ jsx(
|
|
137
|
+
"button",
|
|
138
|
+
{
|
|
139
|
+
type: "button",
|
|
140
|
+
"data-slot": "secret-reveal-toggle",
|
|
141
|
+
className: secretRevealToggleVariants({ size, appearance }),
|
|
142
|
+
onClick: toggle,
|
|
143
|
+
"aria-label": revealed ? "Hide secret" : "Reveal secret",
|
|
144
|
+
children: revealed ? /* @__PURE__ */ jsxs(
|
|
145
|
+
"svg",
|
|
146
|
+
{
|
|
147
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
148
|
+
width: "16",
|
|
149
|
+
height: "16",
|
|
150
|
+
viewBox: "0 0 24 24",
|
|
151
|
+
fill: "none",
|
|
152
|
+
stroke: "currentColor",
|
|
153
|
+
strokeWidth: "2",
|
|
154
|
+
strokeLinecap: "round",
|
|
155
|
+
strokeLinejoin: "round",
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" }),
|
|
158
|
+
/* @__PURE__ */ jsx("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" }),
|
|
159
|
+
/* @__PURE__ */ jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
) : /* @__PURE__ */ jsxs(
|
|
163
|
+
"svg",
|
|
164
|
+
{
|
|
165
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
166
|
+
width: "16",
|
|
167
|
+
height: "16",
|
|
168
|
+
viewBox: "0 0 24 24",
|
|
169
|
+
fill: "none",
|
|
170
|
+
stroke: "currentColor",
|
|
171
|
+
strokeWidth: "2",
|
|
172
|
+
strokeLinecap: "round",
|
|
173
|
+
strokeLinejoin: "round",
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
176
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
] })
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
SecretRevealAnimated.displayName = "SecretRevealAnimated";
|
|
188
|
+
|
|
189
|
+
export { SecretRevealAnimated, secretRevealAnimationPresets };
|
|
190
|
+
//# sourceMappingURL=animated.mjs.map
|
|
191
|
+
//# sourceMappingURL=animated.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/secret-reveal/animated/animations.ts","../../../src/ui/secret-reveal/animated/secret-reveal-animated.tsx"],"names":[],"mappings":";;;;;;;;;AAiBO,IAAM,4BAAA,GAA6D;AAAA,EACxE,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,QAAA,EAAU,CAAA,EAAE;AAAA,IAC1B,QAAA,EAAU;AAAA,MACR,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACtB,IAAA,EAAM,EAAE,OAAA,EAAS,CAAA;AAAE;AACrB,GACF;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,EAAE,QAAA,EAAU,IAAA,EAAM,MAAM,WAAA,EAAY;AAAA,IAChD,QAAA,EAAU;AAAA,MACR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AA,wCACtD,QAAA,EAAA,EAAO,EAAA,EAAG,MAAK,EAAA,EAAG,IAAA,EAAK,GAAE,GAAA,EAAI;AAAA;AAAA;AAAA;AAChC;AAAA;AAEJ,SAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;AAEA,oBAAA,CAAqB,WAAA,GAAc,sBAAA","file":"animated.mjs","sourcesContent":["import type { Transition, Variants } from \"framer-motion\";\n\nexport type SecretRevealAnimation =\n | \"none\"\n | \"fade\"\n | \"slide-up\"\n | \"scale\"\n | \"flip\";\n\nexport type SecretRevealAnimationPresets = Record<\n SecretRevealAnimation,\n {\n transition: Transition;\n variants: Variants;\n }\n>;\n\nexport const secretRevealAnimationPresets: SecretRevealAnimationPresets = {\n none: {\n transition: { duration: 0 },\n variants: {\n initial: { opacity: 1 },\n animate: { opacity: 1 },\n exit: { opacity: 1 },\n },\n },\n fade: {\n transition: { duration: 0.25, ease: \"easeInOut\" },\n variants: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n },\n },\n \"slide-up\": {\n transition: {\n type: \"spring\",\n stiffness: 300,\n damping: 25,\n mass: 0.5,\n },\n variants: {\n initial: { opacity: 0, y: 8 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -8 },\n },\n },\n scale: {\n transition: {\n type: \"spring\",\n stiffness: 400,\n damping: 20,\n mass: 0.4,\n },\n variants: {\n initial: { opacity: 0, scale: 0.9 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.9 },\n },\n },\n flip: {\n transition: {\n type: \"spring\",\n stiffness: 200,\n damping: 18,\n mass: 0.6,\n },\n variants: {\n initial: { opacity: 0, rotateX: 90 },\n animate: { opacity: 1, rotateX: 0 },\n exit: { opacity: 0, rotateX: -90 },\n },\n },\n};\n","\"use client\";\n\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { useCallback, useState } from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nimport { secretRevealAnimationPresets } from \"./animations\";\nimport type { SecretRevealAnimatedProps } from \"./types\";\nimport {\n secretRevealLabelVariants,\n secretRevealToggleVariants,\n secretRevealValueVariants,\n secretRevealVariants,\n} from \"../variants\";\n\nexport function SecretRevealAnimated({\n appearance,\n size,\n value,\n children,\n label,\n labelPosition = \"top\",\n initiallyRevealed = false,\n onVisibilityChange,\n animation = \"fade\",\n muteChar = \"•\",\n className,\n ref,\n ...rest\n}: SecretRevealAnimatedProps) {\n const [revealed, setRevealed] = useState(initiallyRevealed);\n\n const toggle = useCallback(() => {\n const next = !revealed;\n setRevealed(next);\n onVisibilityChange?.(next);\n }, [onVisibilityChange, revealed]);\n\n const preset = secretRevealAnimationPresets[animation];\n const displayText = value ?? (typeof children === \"string\" ? children : \"\");\n\n return (\n <div\n ref={ref}\n data-slot=\"secret-reveal\"\n className={cn(secretRevealVariants({ appearance, size }), className)}\n {...rest}\n >\n {label && labelPosition === \"top\" && (\n <span\n data-slot=\"secret-reveal-label\"\n className={secretRevealLabelVariants({ size })}\n >\n {label}\n </span>\n )}\n <span className=\"flex items-center gap-2 flex-1 min-w-0\">\n {label && labelPosition === \"side\" && (\n <span\n data-slot=\"secret-reveal-label\"\n className={secretRevealLabelVariants({ size })}\n >\n {label}\n </span>\n )}\n <span\n data-slot=\"secret-reveal-value\"\n className={cn(secretRevealValueVariants({ size }), \"flex-1 truncate\")}\n >\n <AnimatePresence mode=\"wait\">\n <motion.span\n key={revealed ? \"revealed\" : \"hidden\"}\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n variants={preset.variants}\n transition={preset.transition}\n className=\"inline-block\"\n >\n {revealed\n ? (value ?? children)\n : muteChar.repeat(displayText.length || 8)}\n </motion.span>\n </AnimatePresence>\n </span>\n <button\n type=\"button\"\n data-slot=\"secret-reveal-toggle\"\n className={secretRevealToggleVariants({ size, appearance })}\n onClick={toggle}\n aria-label={revealed ? \"Hide secret\" : \"Reveal secret\"}\n >\n {revealed ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94\" />\n <path d=\"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" />\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n )}\n </button>\n </span>\n </div>\n );\n}\n\nSecretRevealAnimated.displayName = \"SecretRevealAnimated\";\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SecretReveal } from "./secret-reveal";
|
|
2
|
+
export type { SecretRevealBaseProps, SecretRevealProps, SecretRevealVariantProps, } from "./types";
|
|
3
|
+
export { secretRevealLabelVariants, secretRevealToggleVariants, secretRevealValueVariants, secretRevealVariants, } from "./variants";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/secret-reveal/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SecretRevealBaseProps } from "./types";
|
|
2
|
+
export declare function SecretRevealBase({ appearance, size, value, children, label, labelPosition, initiallyRevealed, onVisibilityChange, muteChar, className, ref, ...rest }: SecretRevealBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace SecretRevealBase {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=secret-reveal-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-reveal-base.d.ts","sourceRoot":"","sources":["../../../src/ui/secret-reveal/secret-reveal-base.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAQrD,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,aAAqB,EACrB,iBAAyB,EACzB,kBAAkB,EAClB,QAAc,EACd,SAAS,EACT,GAAG,EACH,GAAG,IAAI,EACR,EAAE,qBAAqB,2CAsFvB;yBAnGe,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-reveal.d.ts","sourceRoot":"","sources":["../../../src/ui/secret-reveal/secret-reveal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
3
|
+
import type { secretRevealVariants } from "./variants";
|
|
4
|
+
export type SecretRevealVariantProps = VariantProps<typeof secretRevealVariants>;
|
|
5
|
+
export type SecretRevealBaseProps = SecretRevealVariantProps & ComponentPropsWithRef<"div"> & {
|
|
6
|
+
value?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
label?: ReactNode;
|
|
9
|
+
labelPosition?: "top" | "side";
|
|
10
|
+
initiallyRevealed?: boolean;
|
|
11
|
+
onVisibilityChange?: (revealed: boolean) => void;
|
|
12
|
+
muteChar?: string;
|
|
13
|
+
};
|
|
14
|
+
export type SecretRevealProps = SecretRevealBaseProps;
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ui/secret-reveal/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,MAAM,wBAAwB,GAAG,YAAY,CACjD,OAAO,oBAAoB,CAC5B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,GAC1D,qBAAqB,CAAC,KAAK,CAAC,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEJ,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const secretRevealVariants: (props?: ({
|
|
2
|
+
appearance?: "default" | "muted" | "sky" | "emerald" | "rose" | "slate" | "gray" | "indigo" | "cyan" | "blue" | "green" | "lime" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | "zinc" | "subtle" | "primary" | null | undefined;
|
|
3
|
+
size?: "md" | "sm" | "lg" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const secretRevealLabelVariants: (props?: ({
|
|
6
|
+
size?: "md" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export declare const secretRevealValueVariants: (props?: ({
|
|
9
|
+
size?: "md" | "sm" | "lg" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
export declare const secretRevealToggleVariants: (props?: ({
|
|
12
|
+
size?: "md" | "sm" | "lg" | null | undefined;
|
|
13
|
+
appearance?: "default" | "muted" | "sky" | "emerald" | "rose" | "slate" | "gray" | "indigo" | "cyan" | "blue" | "green" | "lime" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | "zinc" | "subtle" | "primary" | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
//# sourceMappingURL=variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../src/ui/secret-reveal/variants.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,oBAAoB;;;8EAS/B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;8EAKpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;8EAKpC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;8EASrC,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkPQ2XTY3M_js = require('../chunk-PQ2XTY3M.js');
|
|
5
|
+
require('../chunk-H3BJOK22.js');
|
|
6
|
+
var chunkZS5756ZC_js = require('../chunk-ZS5756ZC.js');
|
|
7
|
+
require('../chunk-PZ5AY32C.js');
|
|
8
|
+
var react = require('react');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
|
|
11
|
+
function SecretRevealBase({
|
|
12
|
+
appearance,
|
|
13
|
+
size,
|
|
14
|
+
value,
|
|
15
|
+
children,
|
|
16
|
+
label,
|
|
17
|
+
labelPosition = "top",
|
|
18
|
+
initiallyRevealed = false,
|
|
19
|
+
onVisibilityChange,
|
|
20
|
+
muteChar = "\u2022",
|
|
21
|
+
className,
|
|
22
|
+
ref,
|
|
23
|
+
...rest
|
|
24
|
+
}) {
|
|
25
|
+
const [revealed, setRevealed] = react.useState(initiallyRevealed);
|
|
26
|
+
const toggle = react.useCallback(() => {
|
|
27
|
+
const next = !revealed;
|
|
28
|
+
setRevealed(next);
|
|
29
|
+
onVisibilityChange?.(next);
|
|
30
|
+
}, [onVisibilityChange, revealed]);
|
|
31
|
+
const displayText = value ?? (typeof children === "string" ? children : "");
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
ref,
|
|
36
|
+
"data-slot": "secret-reveal",
|
|
37
|
+
className: chunkZS5756ZC_js.cn(chunkPQ2XTY3M_js.secretRevealVariants({ appearance, size }), className),
|
|
38
|
+
...rest,
|
|
39
|
+
children: [
|
|
40
|
+
label && labelPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "secret-reveal-label",
|
|
44
|
+
className: chunkPQ2XTY3M_js.secretRevealLabelVariants({ size }),
|
|
45
|
+
children: label
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
49
|
+
label && labelPosition === "side" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
50
|
+
"span",
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "secret-reveal-label",
|
|
53
|
+
className: chunkPQ2XTY3M_js.secretRevealLabelVariants({ size }),
|
|
54
|
+
children: label
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
"span",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "secret-reveal-value",
|
|
61
|
+
className: chunkZS5756ZC_js.cn(chunkPQ2XTY3M_js.secretRevealValueVariants({ size }), "flex-1 truncate"),
|
|
62
|
+
children: revealed ? value ?? children : muteChar.repeat(displayText.length || 8)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
type: "button",
|
|
69
|
+
"data-slot": "secret-reveal-toggle",
|
|
70
|
+
className: chunkPQ2XTY3M_js.secretRevealToggleVariants({ size, appearance }),
|
|
71
|
+
onClick: toggle,
|
|
72
|
+
"aria-label": revealed ? "Hide secret" : "Reveal secret",
|
|
73
|
+
children: revealed ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
74
|
+
"svg",
|
|
75
|
+
{
|
|
76
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
77
|
+
width: "16",
|
|
78
|
+
height: "16",
|
|
79
|
+
viewBox: "0 0 24 24",
|
|
80
|
+
fill: "none",
|
|
81
|
+
stroke: "currentColor",
|
|
82
|
+
strokeWidth: "2",
|
|
83
|
+
strokeLinecap: "round",
|
|
84
|
+
strokeLinejoin: "round",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" }),
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" }),
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
92
|
+
"svg",
|
|
93
|
+
{
|
|
94
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
95
|
+
width: "16",
|
|
96
|
+
height: "16",
|
|
97
|
+
viewBox: "0 0 24 24",
|
|
98
|
+
fill: "none",
|
|
99
|
+
stroke: "currentColor",
|
|
100
|
+
strokeWidth: "2",
|
|
101
|
+
strokeLinecap: "round",
|
|
102
|
+
strokeLinejoin: "round",
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
105
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
SecretRevealBase.displayName = "SecretReveal";
|
|
117
|
+
|
|
118
|
+
Object.defineProperty(exports, "secretRevealLabelVariants", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () { return chunkPQ2XTY3M_js.secretRevealLabelVariants; }
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, "secretRevealToggleVariants", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function () { return chunkPQ2XTY3M_js.secretRevealToggleVariants; }
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "secretRevealValueVariants", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () { return chunkPQ2XTY3M_js.secretRevealValueVariants; }
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "secretRevealVariants", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () { return chunkPQ2XTY3M_js.secretRevealVariants; }
|
|
133
|
+
});
|
|
134
|
+
exports.SecretReveal = SecretRevealBase;
|
|
135
|
+
//# sourceMappingURL=secret-reveal.js.map
|
|
136
|
+
//# sourceMappingURL=secret-reveal.js.map
|