maquinaweb-ui 1.3.0 → 2.0.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 CHANGED
@@ -174,6 +174,81 @@ npm login
174
174
  bunx semantic-release
175
175
  ```
176
176
 
177
+ ## 🎯 Client vs Server Components
178
+
179
+ Esta biblioteca suporta tanto **Client Components** quanto **Server Components** do Next.js.
180
+
181
+ ### Client Components (Atual)
182
+
183
+ Componentes atuais usam `'use client'` porque precisam de:
184
+ - ✅ React hooks (useState, useEffect, etc.)
185
+ - ✅ Event handlers (onClick, onChange, etc.)
186
+ - ✅ Animações com Motion
187
+ - ✅ Bibliotecas client-only
188
+
189
+ **Estrutura de um Client Component:**
190
+ ```tsx
191
+ // src/components/my-client-component/index.ts
192
+ 'use client'; // ← Diretiva necessária
193
+
194
+ export { MyClientComponent } from './my-client-component';
195
+ ```
196
+
197
+ ```tsx
198
+ // src/components/my-client-component/my-client-component.tsx
199
+ 'use client'; // ← Diretiva necessária
200
+
201
+ import { useState } from 'react';
202
+
203
+ export const MyClientComponent = () => {
204
+ const [count, setCount] = useState(0);
205
+ return <button onClick={() => setCount(count + 1)}>{count}</button>;
206
+ };
207
+ ```
208
+
209
+ ### Server Components (Futuro)
210
+
211
+ Para componentes que **não precisam** de interatividade:
212
+ - ✅ Componentes puramente visuais
213
+ - ✅ Layouts e containers estáticos
214
+ - ✅ Componentes que apenas exibem dados
215
+
216
+ **Estrutura de um Server Component:**
217
+ ```tsx
218
+ // src/components/my-server-component/index.ts
219
+ // SEM 'use client' ← Pode ser renderizado no servidor
220
+
221
+ export { MyServerComponent } from './my-server-component';
222
+ ```
223
+
224
+ ```tsx
225
+ // src/components/my-server-component/my-server-component.tsx
226
+ // SEM 'use client'
227
+
228
+ export const MyServerComponent = ({ title, children }) => {
229
+ return (
230
+ <div className="card">
231
+ <h3>{title}</h3>
232
+ {children}
233
+ </div>
234
+ );
235
+ };
236
+ ```
237
+
238
+ ### Decisão: Client ou Server?
239
+
240
+ | Recurso | Client | Server |
241
+ |---------|--------|--------|
242
+ | React Hooks (useState, useEffect) | ✅ | ❌ |
243
+ | Event Handlers (onClick, onChange) | ✅ | ❌ |
244
+ | Motion/Framer Motion | ✅ | ❌ |
245
+ | Browser APIs (window, document) | ✅ | ❌ |
246
+ | Apenas exibição de dados | ✅ | ✅ |
247
+ | SEO otimizado | ⚠️ | ✅ |
248
+ | Menor bundle size | ⚠️ | ✅ |
249
+
250
+ **📖 Para mais detalhes, veja [ARCHITECTURE.md](./ARCHITECTURE.md)**
251
+
177
252
  ## 📝 Adding New Components
178
253
 
179
254
  ### 🤖 Automático - Exports são Gerados Automaticamente!
@@ -274,31 +349,47 @@ TypeScript configuration:
274
349
 
275
350
  After installing your published package:
276
351
 
277
- ### Basic Import (All Components)
352
+ ### ⚠️ Important: Esta biblioteca usa **apenas imports individuais**
353
+
354
+ Não existe um export principal. Você **deve** importar de cada componente específico:
278
355
 
279
356
  ```tsx
280
- import { TextField, ContainerAnimation } from "maquinaweb-ui";
357
+ // Correto - Import individual de cada componente
358
+ import { TextField, InputText } from "maquinaweb-ui/text-field";
359
+ import { ContainerAnimation } from "maquinaweb-ui/container-animation";
360
+ import { SplitTextPoor } from "maquinaweb-ui/split-text-poor";
281
361
 
282
362
  function App() {
283
363
  return (
284
364
  <ContainerAnimation>
365
+ <SplitTextPoor>
366
+ <h1>Hello World</h1>
367
+ </SplitTextPoor>
285
368
  <TextField name="email" label="Email" />
286
369
  </ContainerAnimation>
287
370
  );
288
371
  }
289
372
  ```
290
373
 
291
- ### Tree-shakable Imports (Optimized)
374
+ ```tsx
375
+ // ❌ Errado - Não há export principal
376
+ import { TextField } from "maquinaweb-ui"; // Isso NÃO vai funcionar
377
+ ```
292
378
 
293
- This library supports multiple entrypoints for better tree-shaking:
379
+ ### 🎯 Benefícios dos Imports Individuais
294
380
 
295
- ```tsx
296
- // Import only form components (~2.85 kB)
297
- import { TextField, InputText } from "maquinaweb-ui/text-field";
381
+ 1. **Tree-shaking perfeito** - Só importa o que você usa
382
+ 2. **Bundle size menor** - Cada componente é um bundle separado
383
+ 3. **Auto-imports corretos** - IDEs sugerem o import correto automaticamente
384
+ 4. **Tipos otimizados** - TypeScript carrega apenas os tipos necessários
298
385
 
299
- // Import only animation components (~1.54 kB)
300
- import { ContainerAnimation } from "maquinaweb-ui/animation";
301
- ```
386
+ ### 📦 Tamanhos dos Bundles
387
+
388
+ | Componente | Tamanho (gzipped) |
389
+ |------------|-------------------|
390
+ | `text-field` | ~2.85 kB |
391
+ | `container-animation` | ~1.54 kB |
392
+ | `split-text-poor` | ~0.87 kB |
302
393
 
303
394
  **📖 For detailed usage and bundle size comparison, see [ENTRYPOINTS.md](./ENTRYPOINTS.md)**
304
395
 
@@ -1,2 +1,29 @@
1
- import { ContainerAnimation, ContainerAnimationProps } from "./index-BC9dAmE_.js";
2
- export { ContainerAnimation, ContainerAnimationProps };
1
+ import * as react2 from "react";
2
+ import { ComponentProps, ElementType } from "react";
3
+
4
+ //#region src/components/container-animation/container-animation.d.ts
5
+ type ContainerAnimationProps<T extends ElementType = 'div'> = ComponentProps<'div'> & ComponentProps<T> & {
6
+ position?: 'top' | 'bottom' | 'left' | 'right';
7
+ delay?: number;
8
+ space?: number;
9
+ duration?: number;
10
+ distance?: [number, number];
11
+ hideNotInView?: boolean;
12
+ as?: T | string;
13
+ className?: string;
14
+ };
15
+ declare const ContainerAnimation: <T extends ElementType = "div">({
16
+ className,
17
+ children,
18
+ position,
19
+ delay,
20
+ space,
21
+ duration,
22
+ as: As,
23
+ distance,
24
+ hideNotInView,
25
+ ...props
26
+ }: ContainerAnimationProps<T>) => react2.JSX.Element;
27
+ //#endregion
28
+ export { ContainerAnimation, type ContainerAnimationProps };
29
+ //# sourceMappingURL=container-animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-animation.d.ts","names":[],"sources":["../src/components/container-animation/container-animation.tsx"],"sourcesContent":[],"mappings":";;;;KAiDY,kCAAkC,uBAC5C,wBACE,eAAe;;;EAFP,KAAA,CAAA,EAAA,MAAA;EAAuB,QAAA,CAAA,EAAA,MAAA;UAAW,CAAA,EAAA,CAAA,MAAA,EAAA,MAAA,CAAA;eAC5C,CAAA,EAAA,OAAA;KACiB,EAOR,CAPQ,GAAA,MAAA;WAAf,CAAA,EAAA,MAAA;;cAWE,kBAJM,EAAA,CAAA,UAI0B,WAJ1B,GAAA,KAAA,CAAA,CAAA;EAAA,SAAA;EAAA,QAAA;EAAA,QAAA;EAAA,KAAA;EAAA,KAAA;EAAA,QAAA;EAAA,EAAA,EAI+C,EAJ/C;EAAA,QAAA;EAAA,aAAA;EAAA,GAAA;AAAA,CAAA,EAeT,uBAfS,CAee,CAff,CAAA,EAAA,GAeiB,MAAA,CAAA,GAAA,CAAA,OAfjB"}
@@ -1,4 +1,123 @@
1
- import "./utils-C0f9Ma6r.js";
2
- import { ContainerAnimation } from "./container-animation-BbZk1MyR.js";
1
+ 'use client';
3
2
 
4
- export { ContainerAnimation };
3
+
4
+ import { cn } from "./utils-C0f9Ma6r.js";
5
+ import { useEffect, useRef, useState } from "react";
6
+ import * as motion from "motion/react-m";
7
+
8
+ //#region node_modules/motion-dom/dist/es/utils/resolve-elements.mjs
9
+ function resolveElements(elementOrSelector, scope, selectorCache) {
10
+ if (elementOrSelector instanceof EventTarget) return [elementOrSelector];
11
+ else if (typeof elementOrSelector === "string") {
12
+ let root = document;
13
+ if (scope) root = scope.current;
14
+ const elements = selectorCache?.[elementOrSelector] ?? root.querySelectorAll(elementOrSelector);
15
+ return elements ? Array.from(elements) : [];
16
+ }
17
+ return Array.from(elementOrSelector);
18
+ }
19
+
20
+ //#endregion
21
+ //#region node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs
22
+ const thresholds = {
23
+ some: 0,
24
+ all: 1
25
+ };
26
+ function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) {
27
+ const elements = resolveElements(elementOrSelector);
28
+ const activeIntersections = /* @__PURE__ */ new WeakMap();
29
+ const onIntersectionChange = (entries) => {
30
+ entries.forEach((entry) => {
31
+ const onEnd = activeIntersections.get(entry.target);
32
+ /**
33
+ * If there's no change to the intersection, we don't need to
34
+ * do anything here.
35
+ */
36
+ if (entry.isIntersecting === Boolean(onEnd)) return;
37
+ if (entry.isIntersecting) {
38
+ const newOnEnd = onStart(entry.target, entry);
39
+ if (typeof newOnEnd === "function") activeIntersections.set(entry.target, newOnEnd);
40
+ else observer.unobserve(entry.target);
41
+ } else if (typeof onEnd === "function") {
42
+ onEnd(entry);
43
+ activeIntersections.delete(entry.target);
44
+ }
45
+ });
46
+ };
47
+ const observer = new IntersectionObserver(onIntersectionChange, {
48
+ root,
49
+ rootMargin,
50
+ threshold: typeof amount === "number" ? amount : thresholds[amount]
51
+ });
52
+ elements.forEach((element) => observer.observe(element));
53
+ return () => observer.disconnect();
54
+ }
55
+
56
+ //#endregion
57
+ //#region node_modules/framer-motion/dist/es/utils/use-in-view.mjs
58
+ function useInView(ref, { root, margin, amount, once = false, initial = false } = {}) {
59
+ const [isInView, setInView] = useState(initial);
60
+ useEffect(() => {
61
+ if (!ref.current || once && isInView) return;
62
+ const onEnter = () => {
63
+ setInView(true);
64
+ return once ? void 0 : () => setInView(false);
65
+ };
66
+ const options = {
67
+ root: root && root.current || void 0,
68
+ margin,
69
+ amount
70
+ };
71
+ return inView(ref.current, onEnter, options);
72
+ }, [
73
+ root,
74
+ ref,
75
+ margin,
76
+ once,
77
+ amount
78
+ ]);
79
+ return isInView;
80
+ }
81
+
82
+ //#endregion
83
+ //#region src/components/container-animation/container-animation.tsx
84
+ const getVariants = (position, space, delay) => {
85
+ const directions = {
86
+ top: { transform: `translateY(${space}px)` },
87
+ bottom: { transform: `translateY(-${space}px)` },
88
+ left: { transform: `translateX(${space}px)` },
89
+ right: { transform: `translateX(-${space}px)` }
90
+ };
91
+ return {
92
+ hidden: {
93
+ opacity: 0,
94
+ filter: "blur(6px)",
95
+ ...directions[position] || directions.top
96
+ },
97
+ visible: {
98
+ opacity: 1,
99
+ filter: "blur(0px)",
100
+ transform: "translateY(0px) translateX(0px)",
101
+ transition: {
102
+ delay,
103
+ duration: .5,
104
+ staggerChildren: .1
105
+ }
106
+ }
107
+ };
108
+ };
109
+ const ContainerAnimation = ({ className, children, position = "top", delay = 0, space = 20, duration = .8, as: As = "div", distance = [95, 5], hideNotInView = false,...props }) => {
110
+ const ref = useRef(null);
111
+ const isInView = useInView(ref, {
112
+ once: true,
113
+ margin: `-${100 - (distance[0] || 0)}% 0% -${distance[1] || 0}% 0%`
114
+ });
115
+ const variants = getVariants(position, space, delay);
116
+ return <motion.div animate={isInView ? "visible" : "hidden"} className={cn("initial-opacity", className)} initial="hidden" transition={{ duration }} variants={variants} {...props} ref={ref}>
117
+ {(!hideNotInView || isInView) && children}
118
+ </motion.div>;
119
+ };
120
+
121
+ //#endregion
122
+ export { ContainerAnimation };
123
+ //# sourceMappingURL=container-animation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-animation.js","names":[],"sources":["../node_modules/motion-dom/dist/es/utils/resolve-elements.mjs","../node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs","../node_modules/framer-motion/dist/es/utils/use-in-view.mjs","../src/components/container-animation/container-animation.tsx"],"sourcesContent":["function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector);\n}\n\nexport { resolveElements };\n","import { resolveElements } from 'motion-dom';\n\nconst thresholds = {\n some: 0,\n all: 1,\n};\nfunction inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = \"some\" } = {}) {\n const elements = resolveElements(elementOrSelector);\n const activeIntersections = new WeakMap();\n const onIntersectionChange = (entries) => {\n entries.forEach((entry) => {\n const onEnd = activeIntersections.get(entry.target);\n /**\n * If there's no change to the intersection, we don't need to\n * do anything here.\n */\n if (entry.isIntersecting === Boolean(onEnd))\n return;\n if (entry.isIntersecting) {\n const newOnEnd = onStart(entry.target, entry);\n if (typeof newOnEnd === \"function\") {\n activeIntersections.set(entry.target, newOnEnd);\n }\n else {\n observer.unobserve(entry.target);\n }\n }\n else if (typeof onEnd === \"function\") {\n onEnd(entry);\n activeIntersections.delete(entry.target);\n }\n });\n };\n const observer = new IntersectionObserver(onIntersectionChange, {\n root,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n });\n elements.forEach((element) => observer.observe(element));\n return () => observer.disconnect();\n}\n\nexport { inView };\n","\"use client\";\nimport { useState, useEffect } from 'react';\nimport { inView } from '../render/dom/viewport/index.mjs';\n\nfunction useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) {\n const [isInView, setInView] = useState(initial);\n useEffect(() => {\n if (!ref.current || (once && isInView))\n return;\n const onEnter = () => {\n setInView(true);\n return once ? undefined : () => setInView(false);\n };\n const options = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n };\n return inView(ref.current, onEnter, options);\n }, [root, ref, margin, once, amount]);\n return isInView;\n}\n\nexport { useInView };\n","'use client';\n\nimport { type ComponentProps, type ElementType, useRef } from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { useInView } from 'motion/react';\nimport * as motion from 'motion/react-m';\n\nconst getVariants = (\n position: 'top' | 'bottom' | 'left' | 'right',\n space: number,\n delay: number\n) => {\n const directions = {\n top: {\n transform: `translateY(${space}px)`,\n },\n bottom: {\n transform: `translateY(-${space}px)`,\n },\n left: {\n transform: `translateX(${space}px)`,\n },\n right: {\n transform: `translateX(-${space}px)`,\n },\n };\n\n const dir = directions[position] || directions.top;\n\n return {\n hidden: {\n opacity: 0,\n filter: 'blur(6px)',\n ...dir,\n },\n visible: {\n opacity: 1,\n filter: 'blur(0px)',\n transform: 'translateY(0px) translateX(0px)',\n transition: {\n delay,\n duration: 0.5,\n staggerChildren: 0.1,\n },\n },\n };\n};\n\nexport type ContainerAnimationProps<T extends ElementType = 'div'> =\n ComponentProps<'div'> &\n ComponentProps<T> & {\n position?: 'top' | 'bottom' | 'left' | 'right';\n delay?: number;\n space?: number;\n duration?: number;\n distance?: [number, number];\n hideNotInView?: boolean;\n as?: T | string;\n className?: string;\n };\n\nconst ContainerAnimation = <T extends ElementType = 'div'>({\n className,\n children,\n position = 'top',\n delay = 0,\n space = 20,\n duration = 0.8,\n as: As = 'div',\n distance = [95, 5],\n hideNotInView = false,\n ...props\n}: ContainerAnimationProps<T>) => {\n const ref = useRef<HTMLElement>(null);\n const isInView = useInView(ref, {\n once: true,\n margin:\n `-${100 - (distance[0] || 0)}% 0% -${(distance[1] as number) || 0}% 0%` as any,\n });\n\n const variants = getVariants(position, space, delay);\n\n return (\n <motion.div\n animate={isInView ? 'visible' : 'hidden'}\n className={cn('initial-opacity', className)}\n initial=\"hidden\"\n transition={{ duration }}\n variants={variants}\n {...props}\n ref={ref}\n >\n {(!hideNotInView || isInView) && children}\n </motion.div>\n );\n};\n\nexport { ContainerAnimation };\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;AAAA,SAAS,gBAAgB,mBAAmB,OAAO,eAAe;AAC9D,KAAI,6BAA6B,YAC7B,QAAO,CAAC,kBAAkB;UAErB,OAAO,sBAAsB,UAAU;EAC5C,IAAI,OAAO;AACX,MAAI,MACA,QAAO,MAAM;EAEjB,MAAM,WAAW,gBAAgB,sBAC7B,KAAK,iBAAiB,kBAAkB;AAC5C,SAAO,WAAW,MAAM,KAAK,SAAS,GAAG,EAAE;;AAE/C,QAAO,MAAM,KAAK,kBAAkB;;;;;ACXxC,MAAM,aAAa;CACf,MAAM;CACN,KAAK;CACR;AACD,SAAS,OAAO,mBAAmB,SAAS,EAAE,MAAM,QAAQ,YAAY,SAAS,WAAW,EAAE,EAAE;CAC5F,MAAM,WAAW,gBAAgB,kBAAkB;C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;EACD,OAAO,EACL,WAAW,eAAe,MAAM,MACjC;EACF;AAID,QAAO;EACL,QAAQ;GACN,SAAS;GACT,QAAQ;GACR,GANQ,WAAW,aAAa,WAAW;GAO5C;EACD,SAAS;GACP,SAAS;GACT,QAAQ;GACR,WAAW;GACX,YAAY;IACV;IACA,UAAU;IACV,iBAAiB;IAClB;GACF;EACF;;AAgBH,MAAM,sBAAqD,EACzD,WACA,UACA,WAAW,OACX,QAAQ,GACR,QAAQ,IACR,WAAW,IACX,IAAI,KAAK,OACT,WAAW,CAAC,IAAI,EAAE,EAClB,gBAAgB,MAChB,GAAG,YAC6B;CAChC,MAAM,MAAM,OAAoB,KAAK;CACrC,MAAM,WAAW,UAAU,KAAK;EAC9B,MAAM;EACN,QACE,IAAI,OAAO,SAAS,MAAM,GAAG,QAAS,SAAS,MAAiB,EAAE;EACrE,CAAC;CAEF,MAAM,WAAW,YAAY,UAAU,OAAO,MAAM;AAEpD,QACE,CAAC,OAAO,IACN,SAAS,WAAW,YAAY,UAChC,WAAW,GAAG,mBAAmB,UAAU,EAC3C,iBACA,YAAY,EAAE,UAAU,EACxB,UAAU,cACN,OACJ,KAAK,KACN;QACG,CAAC,iBAAiB,aAAa,SAAS;IAC5C,EAAE,OAAO"}
@@ -0,0 +1,59 @@
1
+ //#region src/components/split-text-poor/split-text-poor.d.ts
2
+ declare const configs: {
3
+ sm: {
4
+ hidden: {
5
+ transform: string;
6
+ filter: string;
7
+ opacity: number;
8
+ };
9
+ visible: ({
10
+ index,
11
+ delay
12
+ }: {
13
+ index: number;
14
+ delay: number;
15
+ }) => {
16
+ transform: string;
17
+ filter: string;
18
+ opacity: number;
19
+ transition: {
20
+ duration: number;
21
+ delay: number;
22
+ };
23
+ };
24
+ };
25
+ default: {
26
+ hidden: {
27
+ transform: string;
28
+ opacity: number;
29
+ filter: string;
30
+ };
31
+ visible: ({
32
+ index,
33
+ delay
34
+ }: {
35
+ index: number;
36
+ delay: number;
37
+ }) => {
38
+ transform: string;
39
+ opacity: number;
40
+ filter: string;
41
+ transition: {
42
+ duration: number;
43
+ delay: number;
44
+ };
45
+ };
46
+ };
47
+ };
48
+ type SplitTextPoorProps = {
49
+ children: React.ReactNode;
50
+ className?: string;
51
+ config?: keyof typeof configs;
52
+ split?: string;
53
+ delay?: number;
54
+ as?: any;
55
+ };
56
+ declare const SplitTextPoor: React.FC<SplitTextPoorProps>;
57
+ //#endregion
58
+ export { SplitTextPoor, type SplitTextPoorProps };
59
+ //# sourceMappingURL=split-text-poor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-text-poor.d.ts","names":[],"sources":["../src/components/split-text-poor/split-text-poor.tsx"],"sourcesContent":[],"mappings":";cAwBM;EAAA,EAAA,EAAA;IAkBL,MAAA,EAAA;;;;;;;;IAGW;MADA,KAAA,EAAA,MAAkB;MAAA,KAAA,EAAA,MAAA;IAClB,CAAA,EAAA,GAAM;MAEM,SAAA,EAAA,MAAA;MAAO,MAAA,EAAA,MAAA;MAMzB,OAAA,EAuDL,MAAA;MAAA,UAAA,EAAA;QAvD6B,QAAA,EAAA,MAAA;QAAH,KAAA,EAAA,MAAA;MAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KATjB,kBAAA;YACA,KAAA,CAAM;;wBAEM;;;;;cAMlB,eAAe,KAAA,CAAM,GAAG"}
@@ -0,0 +1,71 @@
1
+ 'use client';
2
+
3
+
4
+ import { cn } from "./utils-C0f9Ma6r.js";
5
+ import { Children, cloneElement, isValidElement } from "react";
6
+ import * as motion from "motion/react-m";
7
+
8
+ //#region src/components/split-text-poor/split-text-poor.tsx
9
+ const defaultConfig = {
10
+ hidden: {
11
+ transform: "translateY(20px) skewY(6deg)",
12
+ opacity: 0,
13
+ filter: "blur(7px)"
14
+ },
15
+ visible: ({ index, delay }) => ({
16
+ transform: "translateY(0px) skewY(0deg)",
17
+ opacity: 1,
18
+ filter: "blur(0px)",
19
+ transition: {
20
+ duration: .4,
21
+ delay: index * .08 + delay
22
+ }
23
+ })
24
+ };
25
+ const configs = {
26
+ sm: {
27
+ hidden: {
28
+ transform: "translateY(10px)",
29
+ filter: "blur(7px)",
30
+ opacity: 0
31
+ },
32
+ visible: ({ index, delay }) => ({
33
+ transform: "translateY(0px)",
34
+ filter: "blur(0px)",
35
+ opacity: 1,
36
+ transition: {
37
+ duration: .4,
38
+ delay: index * .06 + delay
39
+ }
40
+ })
41
+ },
42
+ default: defaultConfig
43
+ };
44
+ const SplitTextPoor = ({ children, className, config = "default", as: As = "div", split = " ", delay = 0 }) => {
45
+ const selectedConfig = configs[config] || defaultConfig;
46
+ let wordIndex = 0;
47
+ const wrapWords = (node) => {
48
+ if (typeof node === "string") return node.split(split).map((word, index) => {
49
+ wordIndex++;
50
+ return <motion.span custom={{
51
+ index: wordIndex - 1,
52
+ delay
53
+ }} initial="hidden" key={index} style={{
54
+ display: "inline-block",
55
+ whiteSpace: "nowrap"
56
+ }} variants={selectedConfig} viewport={{ once: true }} whileInView="visible">
57
+ {word}
58
+ {index < node.split(split).length - 1 && "\xA0"}
59
+ </motion.span>;
60
+ });
61
+ if (isValidElement(node)) return cloneElement(node, { children: Children.map(node.props.children, wrapWords) });
62
+ return node;
63
+ };
64
+ return <As className={cn(className, "initial-opacity will-change-[transform,filter]")} style={{ display: "inline-block" }}>
65
+ {Children.map(children, wrapWords)}
66
+ </As>;
67
+ };
68
+
69
+ //#endregion
70
+ export { SplitTextPoor };
71
+ //# sourceMappingURL=split-text-poor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-text-poor.js","names":["SplitTextPoor: React.FC<SplitTextPoorProps>"],"sources":["../src/components/split-text-poor/split-text-poor.tsx"],"sourcesContent":["'use client';\n\nimport { Children, cloneElement, isValidElement } from 'react';\n\nimport { cn } from '@/lib/utils';\nimport * as motion from 'motion/react-m';\n\nconst defaultConfig = {\n hidden: {\n transform: 'translateY(20px) skewY(6deg)',\n opacity: 0,\n filter: 'blur(7px)',\n },\n visible: ({ index, delay }: { index: number; delay: number }) => ({\n transform: 'translateY(0px) skewY(0deg)',\n opacity: 1,\n filter: 'blur(0px)',\n transition: {\n duration: 0.4,\n delay: index * 0.08 + delay,\n },\n }),\n};\n\nconst configs = {\n sm: {\n hidden: {\n transform: 'translateY(10px)',\n filter: 'blur(7px)',\n opacity: 0,\n },\n visible: ({ index, delay }: { index: number; delay: number }) => ({\n transform: 'translateY(0px)',\n filter: 'blur(0px)',\n opacity: 1,\n transition: {\n duration: 0.4,\n delay: index * 0.06 + delay,\n },\n }),\n },\n default: defaultConfig,\n};\n\nexport type SplitTextPoorProps = {\n children: React.ReactNode;\n className?: string;\n config?: keyof typeof configs;\n split?: string;\n delay?: number;\n as?: any;\n};\n\nconst SplitTextPoor: React.FC<SplitTextPoorProps> = ({\n children,\n className,\n config = 'default',\n as: As = 'div',\n split = ' ',\n delay = 0,\n}) => {\n const selectedConfig = configs[config] || defaultConfig;\n let wordIndex = 0;\n\n const wrapWords = (node: React.ReactNode): React.ReactNode => {\n if (typeof node === 'string') {\n return node.split(split).map((word, index) => {\n wordIndex++;\n return (\n <motion.span\n custom={{\n index: wordIndex - 1,\n delay,\n }}\n initial=\"hidden\"\n key={index}\n style={{ display: 'inline-block', whiteSpace: 'nowrap' }}\n variants={selectedConfig}\n viewport={{ once: true }}\n whileInView=\"visible\"\n >\n {word}\n {index < node.split(split).length - 1 && '\\u00A0'}\n </motion.span>\n );\n });\n }\n\n if (isValidElement(node)) {\n return cloneElement(node, {\n children: Children.map((node.props as any).children, wrapWords),\n } as any);\n }\n\n return node;\n };\n\n return (\n <As\n className={cn(\n className,\n 'initial-opacity will-change-[transform,filter]'\n )}\n style={{ display: 'inline-block' }}\n >\n {Children.map(children, wrapWords)}\n </As>\n );\n};\n\nexport { SplitTextPoor };\n"],"mappings":";;;;;;;;AAOA,MAAM,gBAAgB;CACpB,QAAQ;EACN,WAAW;EACX,SAAS;EACT,QAAQ;EACT;CACD,UAAU,EAAE,OAAO,aAA+C;EAChE,WAAW;EACX,SAAS;EACT,QAAQ;EACR,YAAY;GACV,UAAU;GACV,OAAO,QAAQ,MAAO;GACvB;EACF;CACF;AAED,MAAM,UAAU;CACd,IAAI;EACF,QAAQ;GACN,WAAW;GACX,QAAQ;GACR,SAAS;GACV;EACD,UAAU,EAAE,OAAO,aAA+C;GAChE,WAAW;GACX,QAAQ;GACR,SAAS;GACT,YAAY;IACV,UAAU;IACV,OAAO,QAAQ,MAAO;IACvB;GACF;EACF;CACD,SAAS;CACV;AAWD,MAAMA,iBAA+C,EACnD,UACA,WACA,SAAS,WACT,IAAI,KAAK,OACT,QAAQ,KACR,QAAQ,QACJ;CACJ,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,IAAI,YAAY;CAEhB,MAAM,aAAa,SAA2C;AAC5D,MAAI,OAAO,SAAS,SAClB,QAAO,KAAK,MAAM,MAAM,CAAC,KAAK,MAAM,UAAU;AAC5C;AACA,UACE,CAAC,OAAO,KACN,QAAQ;IACN,OAAO,YAAY;IACnB;IACD,EACD,iBACA,KAAK,OACL,OAAO;IAAE,SAAS;IAAgB,YAAY;IAAU,EACxD,UAAU,gBACV,UAAU,EAAE,MAAM,MAAM,EACxB,sBACD;aACE,KAAK;aACL,QAAQ,KAAK,MAAM,MAAM,CAAC,SAAS,KAAK,OAAS;UACpD,EAAE,OAAO;IAEX;AAGJ,MAAI,eAAe,KAAK,CACtB,QAAO,aAAa,MAAM,EACxB,UAAU,SAAS,IAAK,KAAK,MAAc,UAAU,UAAU,EAChE,CAAQ;AAGX,SAAO;;AAGT,QACE,CAAC,GACC,WAAW,GACT,WACA,iDACD,EACD,OAAO,EAAE,SAAS,gBAAgB,EACnC;OACE,SAAS,IAAI,UAAU,UAAU,CAAC;IACrC,EAAE"}
@@ -1,2 +1,81 @@
1
- import { InputText, InputTextProps, QueryTextField, QueryTextFieldProps, TextField, TextFieldProps } from "./index-D9G_ksi_.js";
2
- export { InputText, InputTextProps, QueryTextField, QueryTextFieldProps, TextField, TextFieldProps };
1
+ import * as react0 from "react";
2
+ import { FieldPath, FieldPathValue, FieldValues, UseControllerProps } from "react-hook-form";
3
+ import { Options } from "use-mask-input";
4
+ import { Options as Options$1 } from "nuqs";
5
+
6
+ //#region src/components/text-field/TextField.d.ts
7
+ type Mask = 'datetime' | 'email' | 'numeric' | 'currency' | 'decimal' | 'integer' | 'percentage' | 'url' | 'ip' | 'mac' | 'ssn' | 'brl-currency' | 'cpf' | 'cnpj' | (string & {}) | (string[] & {}) | null;
8
+ interface InputTextProps extends React.InputHTMLAttributes<HTMLInputElement> {
9
+ ref?: React.ForwardedRef<HTMLInputElement>;
10
+ label?: string;
11
+ placeholder?: string;
12
+ description?: string;
13
+ className?: string;
14
+ disabled?: boolean;
15
+ type?: string;
16
+ required?: boolean;
17
+ maskRef?: React.ForwardedRef<any>;
18
+ children?: React.ReactNode;
19
+ mask?: Mask;
20
+ maskOptions?: Options;
21
+ error?: React.ReactNode;
22
+ id?: string;
23
+ detail?: string;
24
+ detailClassName?: string;
25
+ inputClassName?: string;
26
+ help?: string;
27
+ }
28
+ declare function InputText({
29
+ label,
30
+ description,
31
+ placeholder,
32
+ className,
33
+ children,
34
+ disabled,
35
+ type,
36
+ required,
37
+ maskRef,
38
+ mask,
39
+ maskOptions,
40
+ error,
41
+ id,
42
+ ref,
43
+ detail,
44
+ detailClassName,
45
+ inputClassName,
46
+ help,
47
+ name,
48
+ ...props
49
+ }: InputTextProps): react0.JSX.Element;
50
+ interface TextFieldProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends UseControllerProps<TFieldValues, TFieldName> {
51
+ disabled?: boolean;
52
+ required?: boolean;
53
+ children?: React.ReactNode;
54
+ defaultValue?: FieldPathValue<TFieldValues, TFieldName>;
55
+ onChange?: (value: string) => Promise<void> | void;
56
+ transform?: (value: string) => string;
57
+ }
58
+ declare function TextField<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
59
+ name,
60
+ className,
61
+ required,
62
+ defaultValue,
63
+ onChange,
64
+ transform,
65
+ ...props
66
+ }: TextFieldProps<TFieldValues, TFieldName> & Omit<InputTextProps, 'onChange'>): react0.JSX.Element;
67
+ interface QueryTextFieldProps extends Omit<InputTextProps, 'onChange'> {
68
+ name: string;
69
+ defaultValue?: string;
70
+ options?: Options$1;
71
+ onChange?: (value: string) => void;
72
+ }
73
+ declare function QueryTextField({
74
+ name,
75
+ defaultValue,
76
+ options,
77
+ ...props
78
+ }: QueryTextFieldProps): react0.JSX.Element;
79
+ //#endregion
80
+ export { InputText, type InputTextProps, QueryTextField, type QueryTextFieldProps, TextField, type TextFieldProps };
81
+ //# sourceMappingURL=text-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-field.d.ts","names":[],"sources":["../src/components/text-field/TextField.tsx"],"sourcesContent":[],"mappings":";;;;;;KAqBK,IAAA;UAmBY,cAAA,SACP,KAAA,CAAM,oBAAoB;QAC5B,KAAA,CAAM,aAAa;EArBtB,KAAA,CAAA,EAAI,MAAA;EAmBQ,WAAA,CAAA,EAAA,MACf;EAAA,WAAA,CAAA,EAAA,MAAA;WAAkC,CAAA,EAAA,MAAA;UACT,CAAA,EAAA,OAAA;MAAnB,CAAA,EAAA,MAAM;UAQF,CAAM,EAAA,OAAA;SACL,CAAA,EADD,KAAA,CAAM,YACC,CAAA,GAAA,CAAA;UACV,CAAA,EADI,KAAA,CAAM,SACV;MACO,CAAA,EADP,IACO;aACA,CAAA,EADA,OACA;OAbN,CAAA,EAaA,KAAA,CAAM,SAbA;EAAmB,EAAA,CAAA,EAAA,MAAA;EAqB1B,MAAA,CAAA,EAAA,MAAS;EAAA,eAAA,CAAA,EAAA,MAAA;gBAChB,CAAA,EAAA,MAAA;MACA,CAAA,EAAA,MAAA;;iBAFO,SAAA,CAIP;EAAA,KAAA;EAAA,WAAA;EAAA,WAAA;EAAA,SAAA;EAAA,QAAA;EAAA,QAAA;EAAA,IAAA;EAAA,Q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