@berdsk/ui 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Button.d.cts CHANGED
@@ -10,6 +10,6 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement | HTM
10
10
  fullWidth?: boolean;
11
11
  href?: string;
12
12
  }
13
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
13
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
14
14
 
15
15
  export { Button, type ButtonProps };
package/dist/Button.d.ts CHANGED
@@ -10,6 +10,6 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement | HTM
10
10
  fullWidth?: boolean;
11
11
  href?: string;
12
12
  }
13
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
13
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
14
14
 
15
15
  export { Button, type ButtonProps };
package/dist/Section.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkKXPGO6PS_cjs=require('./chunk-KXPGO6PS.cjs');require('./chunk-U7VSEXSW.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"Section",{enumerable:true,get:function(){return chunkKXPGO6PS_cjs.a}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkKXPGO6PS_cjs.b}});//# sourceMappingURL=Section.cjs.map
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkMTK6DOJZ_cjs=require('./chunk-MTK6DOJZ.cjs');require('./chunk-U7VSEXSW.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"Section",{enumerable:true,get:function(){return chunkMTK6DOJZ_cjs.a}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkMTK6DOJZ_cjs.b}});//# sourceMappingURL=Section.cjs.map
2
2
  //# sourceMappingURL=Section.cjs.map
@@ -19,7 +19,8 @@ interface SectionProps extends HTMLAttributes<HTMLElement> {
19
19
  containerClassName?: string;
20
20
  divisorTop?: DivisorOptions;
21
21
  divisorBottom?: DivisorOptions;
22
+ contentOutsideContainer?: ReactNode;
22
23
  }
23
- declare const Section: ({ children, as: Component, fullWidth, screenHeight, flex, centerX, centerY, className, containerClassName, divisorTop, divisorBottom, ...props }: SectionProps) => react_jsx_runtime.JSX.Element;
24
+ declare const Section: ({ children, as: Component, fullWidth, screenHeight, flex, centerX, centerY, className, containerClassName, divisorTop, divisorBottom, contentOutsideContainer, ...props }: SectionProps) => react_jsx_runtime.JSX.Element;
24
25
 
25
26
  export { Section, type SectionProps, Section as default };
package/dist/Section.d.ts CHANGED
@@ -19,7 +19,8 @@ interface SectionProps extends HTMLAttributes<HTMLElement> {
19
19
  containerClassName?: string;
20
20
  divisorTop?: DivisorOptions;
21
21
  divisorBottom?: DivisorOptions;
22
+ contentOutsideContainer?: ReactNode;
22
23
  }
23
- declare const Section: ({ children, as: Component, fullWidth, screenHeight, flex, centerX, centerY, className, containerClassName, divisorTop, divisorBottom, ...props }: SectionProps) => react_jsx_runtime.JSX.Element;
24
+ declare const Section: ({ children, as: Component, fullWidth, screenHeight, flex, centerX, centerY, className, containerClassName, divisorTop, divisorBottom, contentOutsideContainer, ...props }: SectionProps) => react_jsx_runtime.JSX.Element;
24
25
 
25
26
  export { Section, type SectionProps, Section as default };
package/dist/Section.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as Section,b as default}from'./chunk-ZOVZGLB5.js';import'./chunk-GUQJ6RZT.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=Section.js.map
1
+ export{a as Section,b as default}from'./chunk-X46VCQ33.js';import'./chunk-GUQJ6RZT.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=Section.js.map
2
2
  //# sourceMappingURL=Section.js.map
@@ -0,0 +1,3 @@
1
+ 'use strict';var chunkU7VSEXSW_cjs=require('./chunk-U7VSEXSW.cjs'),jsxRuntime=require('react/jsx-runtime');var d=({variant:i,color:t,className:a,height:r=100,position:p})=>{let s=!!t,o=s&&(t.includes("#")||t.includes("rgb")||t.includes("hsl")||t.includes("(")),f={height:r,...o?{color:t}:{}},g=chunkU7VSEXSW_cjs.a("absolute left-0 w-full z-50 pointer-events-none",p==="top"?"bottom-full":"top-full",s&&!o?t:"",a),n={wavy:"bottom","wavy-simple":"top",arched:"bottom"},l=p==="top"?"bottom":"top",c=n[i]!==l?{transform:"scaleY(-1)",transformOrigin:"center"}:{};return jsxRuntime.jsxs("div",{className:g,style:f,"aria-hidden":true,children:[i==="wavy"&&jsxRuntime.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:c,children:jsxRuntime.jsxs("g",{fill:"currentColor",children:[jsxRuntime.jsx("path",{d:"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z",fillOpacity:".3"}),jsxRuntime.jsx("path",{d:"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z",fillOpacity:".5"}),jsxRuntime.jsx("path",{d:"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z"})]})}),i==="wavy-simple"&&jsxRuntime.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:c,children:jsxRuntime.jsx("g",{fill:"currentColor",children:jsxRuntime.jsx("path",{d:"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z"})})}),i==="arched"&&jsxRuntime.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:c,children:jsxRuntime.jsxs("g",{fill:"currentColor",children:[jsxRuntime.jsx("path",{d:"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z",fillOpacity:".3"}),jsxRuntime.jsx("path",{d:"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z",fillOpacity:".5"}),jsxRuntime.jsx("path",{d:"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z"})]})})]})},C=({children:i,as:t="section",fullWidth:a=false,screenHeight:r=false,flex:p=false,centerX:s=false,centerY:o=false,className:f="",containerClassName:g="",divisorTop:n,divisorBottom:l,contentOutsideContainer:w,...c})=>{let m=!!r,u=chunkU7VSEXSW_cjs.a("relative w-full",r&&"min-h-screen",p&&"flex-1",r&&"flex flex-col",(s||o)&&"flex",s&&(a||m)&&"items-center",o&&(a||m)&&"justify-center",s&&a&&!m&&"justify-center",o&&a&&!m&&"items-center",f),x=chunkU7VSEXSW_cjs.a("mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full",{"flex-1":r,flex:s||o,"justify-center":s,"items-center":o},g);return jsxRuntime.jsxs(t,{className:u,...c,children:[n&&jsxRuntime.jsx(d,{position:"top",variant:n.variant,color:n.color,className:n.className,height:n.height}),w&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:w}),a?i:jsxRuntime.jsx("div",{className:x,children:i}),l&&jsxRuntime.jsx(d,{position:"bottom",variant:l.variant,color:l.color,className:l.className,height:l.height})]})},S=C;
2
+ exports.a=C;exports.b=S;//# sourceMappingURL=chunk-MTK6DOJZ.cjs.map
3
+ //# sourceMappingURL=chunk-MTK6DOJZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Section.tsx"],"names":["DivisorSVG","variant","color","className","height","position","hasColor","isCssColor","style","wrapperClasses","cn","naturalFlatSide","desiredTouchSide","svgCommonStyle","jsxs","jsx","Section","children","Component","fullWidth","screenHeight","flex","centerX","centerY","containerClassName","divisorTop","divisorBottom","contentOutsideContainer","props","isSectionColumn","sectionClasses","containerClasses","Fragment","Section_default"],"mappings":"+GA0BMA,CAAAA,CAAa,CAAC,CAClB,OAAA,CAAAC,CAAAA,CACA,MAAAC,CAAAA,CACA,SAAA,CAAAC,EACA,MAAA,CAAAC,CAAAA,CAAS,IACT,QAAA,CAAAC,CACF,IAAuD,CAErD,IAAMC,EAAW,CAAC,CAACJ,EAKbK,CAAAA,CACJD,CAAAA,GAAaJ,EAAM,QAAA,CAAS,GAAG,GAAKA,CAAAA,CAAM,QAAA,CAAS,KAAK,CAAA,EAAKA,CAAAA,CAAM,SAAS,KAAK,CAAA,EAAKA,EAAM,QAAA,CAAS,GAAG,GAEpGM,CAAAA,CAAuB,CAC3B,OAAAJ,CAAAA,CACA,GAAIG,EAAa,CAAE,KAAA,CAAAL,CAAM,CAAA,CAAI,EAC/B,CAAA,CAEMO,CAAAA,CAAiBC,oBACrB,iDAAA,CACAL,CAAAA,GAAa,MAAQ,aAAA,CAAgB,UAAA,CACrCC,GAAY,CAACC,CAAAA,CAAaL,EAAQ,EAAA,CAClCC,CACF,EAGMQ,CAAAA,CAA4D,CAChE,KAAM,QAAA,CACN,aAAA,CAAe,MACf,MAAA,CAAQ,QACV,EAMMC,CAAAA,CAAmBP,CAAAA,GAAa,MAAQ,QAAA,CAAW,KAAA,CAEnDQ,EADYF,CAAAA,CAAgBV,CAAO,CAAA,GAAMW,CAAAA,CACG,CAAE,SAAA,CAAW,aAAc,eAAA,CAAiB,QAAS,EAAI,EAAC,CAE5G,OACEE,eAAAA,CAAC,KAAA,CAAA,CAAI,UAAWL,CAAAA,CAAgB,KAAA,CAAOD,EAAO,aAAA,CAAW,IAAA,CACtD,UAAAP,CAAAA,GAAY,MAAA,EACXc,eAAC,KAAA,CAAA,CACC,K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,CACtB,OAAQA,CAAAA,CAAW,MAAA,CACrB,EAEDE,CAAAA,EAA2BZ,cAAAA,CAAAiB,oBAAA,CAAG,QAAA,CAAAL,EAAwB,CAAA,CACtDR,CAAAA,CAAYF,EAAWF,cAAAA,CAAC,KAAA,CAAA,CAAI,UAAWgB,CAAAA,CAAmB,QAAA,CAAAd,EAAS,CAAA,CACnES,CAAAA,EACCX,eAACf,CAAAA,CAAA,CACC,SAAS,QAAA,CACT,OAAA,CAAS0B,EAAc,OAAA,CACvB,KAAA,CAAOA,EAAc,KAAA,CACrB,SAAA,CAAWA,EAAc,SAAA,CACzB,MAAA,CAAQA,EAAc,MAAA,CACxB,CAAA,CAAA,CAEJ,CAEJ,CAAA,CAEOO,CAAAA,CAAQjB","file":"chunk-MTK6DOJZ.cjs","sourcesContent":["import { CSSProperties, HTMLAttributes, ReactNode } from 'react';\nimport cn from '../utils/cn';\n\ntype DivisorVariant = 'wavy' | 'wavy-simple' | 'arched';\n\ninterface DivisorOptions {\n variant: DivisorVariant;\n color?: string; // CSS color (hex, rgb, hsl ou token tailwind via className externa)\n className?: string; // Classes adicionais (ex: text-primary-500)\n height?: number; // altura em px (default 100)\n}\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n as?: 'section' | 'header' | 'footer' | 'nav' | 'article' | 'main';\n fullWidth?: boolean;\n screenHeight?: boolean;\n flex?: boolean;\n centerX?: boolean;\n centerY?: boolean;\n containerClassName?: string;\n divisorTop?: DivisorOptions;\n divisorBottom?: DivisorOptions;\n contentOutsideContainer?: ReactNode;\n}\n\nconst DivisorSVG = ({\n variant,\n color,\n className,\n height = 100,\n position,\n}: DivisorOptions & { position: 'top' | 'bottom' }) => {\n // Se não houver color nem className, usamos currentColor\n const hasColor = !!color;\n\n // Verifica se o color passado parece uma classe Tailwind (não contém #, rgb, hsl e não é uma cor nomeada simples se quisermos ser rigorosos,\n // mas geralmente se tem espaços ou começa com text-/bg-/fill- é tailwind)\n // Uma abordagem melhor: se não contém caracteres especiais de cores CSS, tratamos como classe.\n const isCssColor =\n hasColor && (color.includes('#') || color.includes('rgb') || color.includes('hsl') || color.includes('('));\n\n const style: CSSProperties = {\n height,\n ...(isCssColor ? { color } : {}),\n };\n\n const wrapperClasses = cn(\n 'absolute left-0 w-full z-50 pointer-events-none',\n position === 'top' ? 'bottom-full' : 'top-full',\n hasColor && !isCssColor ? color : '', // Se for classe Tailwind, joga no cn\n className,\n );\n\n // Lado \"reto\" natural de cada SVG\n const naturalFlatSide: Record<DivisorVariant, 'top' | 'bottom'> = {\n wavy: 'bottom',\n 'wavy-simple': 'top',\n arched: 'bottom',\n };\n\n // Se o divisor está no TOPO da section (lado de fora), a base reta do SVG deve estar no BOTTOM\n // (para encostar na borda superior da section).\n // Se o divisor está na BASE da section (lado de fora), a base reta do SVG deve estar no TOP\n // (para encostar na borda inferior da section).\n const desiredTouchSide = position === 'top' ? 'bottom' : 'top';\n const needsFlip = naturalFlatSide[variant] !== desiredTouchSide;\n const svgCommonStyle: CSSProperties = needsFlip ? { transform: 'scaleY(-1)', transformOrigin: 'center' } : {};\n\n return (\n <div className={wrapperClasses} style={style} aria-hidden>\n {variant === 'wavy' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path\n d=\"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z\"\n fillOpacity=\".3\"\n />\n <path\n d=\"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z\"\n fillOpacity=\".5\"\n />\n <path d=\"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z\" />\n </g>\n </svg>\n )}\n {variant === 'wavy-simple' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path d=\"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z\" />\n </g>\n </svg>\n )}\n {variant === 'arched' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path d=\"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z\" fillOpacity=\".3\" />\n <path d=\"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z\" fillOpacity=\".5\" />\n <path d=\"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z\" />\n </g>\n </svg>\n )}\n </div>\n );\n};\n\nexport const Section = ({\n children,\n as: Component = 'section',\n fullWidth = false,\n screenHeight = false,\n flex = false,\n centerX = false,\n centerY = false,\n className = '',\n containerClassName = '',\n divisorTop,\n divisorBottom,\n contentOutsideContainer,\n ...props\n}: SectionProps) => {\n const isSectionColumn = !!screenHeight;\n\n const sectionClasses = cn(\n 'relative w-full',\n screenHeight && 'min-h-screen',\n flex && 'flex-1',\n screenHeight && 'flex flex-col',\n (centerX || centerY) && 'flex',\n // Centralização quando é fullWidth ou screenHeight (flex-col)\n centerX && (fullWidth || isSectionColumn) && 'items-center',\n centerY && (fullWidth || isSectionColumn) && 'justify-center',\n // Centralização quando é fullWidth e NÃO é coluna (flex-row padrão)\n centerX && fullWidth && !isSectionColumn && 'justify-center',\n centerY && fullWidth && !isSectionColumn && 'items-center',\n className,\n );\n\n const containerClasses = cn(\n 'mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full',\n {\n 'flex-1': screenHeight,\n flex: centerX || centerY,\n 'justify-center': centerX,\n 'items-center': centerY,\n },\n containerClassName,\n );\n\n return (\n <Component className={sectionClasses} {...props}>\n {divisorTop && (\n <DivisorSVG\n position=\"top\"\n variant={divisorTop.variant}\n color={divisorTop.color}\n className={divisorTop.className}\n height={divisorTop.height}\n />\n )}\n {contentOutsideContainer && <>{contentOutsideContainer}</>}\n {fullWidth ? children : <div className={containerClasses}>{children}</div>}\n {divisorBottom && (\n <DivisorSVG\n position=\"bottom\"\n variant={divisorBottom.variant}\n color={divisorBottom.color}\n className={divisorBottom.className}\n height={divisorBottom.height}\n />\n )}\n </Component>\n );\n};\n\nexport default Section;\n"]}
@@ -0,0 +1,3 @@
1
+ import {a}from'./chunk-GUQJ6RZT.js';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var d=({variant:i,color:t,className:a$1,height:r=100,position:p})=>{let s=!!t,o=s&&(t.includes("#")||t.includes("rgb")||t.includes("hsl")||t.includes("(")),f={height:r,...o?{color:t}:{}},g=a("absolute left-0 w-full z-50 pointer-events-none",p==="top"?"bottom-full":"top-full",s&&!o?t:"",a$1),n={wavy:"bottom","wavy-simple":"top",arched:"bottom"},l=p==="top"?"bottom":"top",c=n[i]!==l?{transform:"scaleY(-1)",transformOrigin:"center"}:{};return jsxs("div",{className:g,style:f,"aria-hidden":true,children:[i==="wavy"&&jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:c,children:jsxs("g",{fill:"currentColor",children:[jsx("path",{d:"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z",fillOpacity:".3"}),jsx("path",{d:"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z",fillOpacity:".5"}),jsx("path",{d:"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z"})]})}),i==="wavy-simple"&&jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:c,children:jsx("g",{fill:"currentColor",children:jsx("path",{d:"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z"})})}),i==="arched"&&jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:c,children:jsxs("g",{fill:"currentColor",children:[jsx("path",{d:"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z",fillOpacity:".3"}),jsx("path",{d:"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z",fillOpacity:".5"}),jsx("path",{d:"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z"})]})})]})},C=({children:i,as:t="section",fullWidth:a$1=false,screenHeight:r=false,flex:p=false,centerX:s=false,centerY:o=false,className:f="",containerClassName:g="",divisorTop:n,divisorBottom:l,contentOutsideContainer:w,...c})=>{let m=!!r,u=a("relative w-full",r&&"min-h-screen",p&&"flex-1",r&&"flex flex-col",(s||o)&&"flex",s&&(a$1||m)&&"items-center",o&&(a$1||m)&&"justify-center",s&&a$1&&!m&&"justify-center",o&&a$1&&!m&&"items-center",f),x=a("mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full",{"flex-1":r,flex:s||o,"justify-center":s,"items-center":o},g);return jsxs(t,{className:u,...c,children:[n&&jsx(d,{position:"top",variant:n.variant,color:n.color,className:n.className,height:n.height}),w&&jsx(Fragment,{children:w}),a$1?i:jsx("div",{className:x,children:i}),l&&jsx(d,{position:"bottom",variant:l.variant,color:l.color,className:l.className,height:l.height})]})},S=C;
2
+ export{C as a,S as b};//# sourceMappingURL=chunk-X46VCQ33.js.map
3
+ //# sourceMappingURL=chunk-X46VCQ33.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Section.tsx"],"names":["DivisorSVG","variant","color","className","height","position","hasColor","isCssColor","style","wrapperClasses","cn","naturalFlatSide","desiredTouchSide","svgCommonStyle","jsxs","jsx","Section","children","Component","fullWidth","screenHeight","flex","centerX","centerY","containerClassName","divisorTop","divisorBottom","contentOutsideContainer","props","isSectionColumn","sectionClasses","containerClasses","Fragment","Section_default"],"mappings":"0FA0BMA,CAAAA,CAAa,CAAC,CAClB,OAAA,CAAAC,CAAAA,CACA,MAAAC,CAAAA,CACA,SAAA,CAAAC,IACA,MAAA,CAAAC,CAAAA,CAAS,IACT,QAAA,CAAAC,CACF,IAAuD,CAErD,IAAMC,EAAW,CAAC,CAACJ,EAKbK,CAAAA,CACJD,CAAAA,GAAaJ,EAAM,QAAA,CAAS,GAAG,GAAKA,CAAAA,CAAM,QAAA,CAAS,KAAK,CAAA,EAAKA,CAAAA,CAAM,SAAS,KAAK,CAAA,EAAKA,EAAM,QAAA,CAAS,GAAG,GAEpGM,CAAAA,CAAuB,CAC3B,OAAAJ,CAAAA,CACA,GAAIG,EAAa,CAAE,KAAA,CAAAL,CAAM,CAAA,CAAI,EAC/B,CAAA,CAEMO,CAAAA,CAAiBC,EACrB,iDAAA,CACAL,CAAAA,GAAa,MAAQ,aAAA,CAAgB,UAAA,CACrCC,GAAY,CAACC,CAAAA,CAAaL,EAAQ,EAAA,CAClCC,GACF,EAGMQ,CAAAA,CAA4D,CAChE,KAAM,QAAA,CACN,aAAA,CAAe,MACf,MAAA,CAAQ,QACV,EAMMC,CAAAA,CAAmBP,CAAAA,GAAa,MAAQ,QAAA,CAAW,KAAA,CAEnDQ,EADYF,CAAAA,CAAgBV,CAAO,CAAA,GAAMW,CAAAA,CACG,CAAE,SAAA,CAAW,aAAc,eAAA,CAAiB,QAAS,EAAI,EAAC,CAE5G,OACEE,IAAAA,CAAC,KAAA,CA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AA,CACC,QAAA,CAAS,KAAA,CACT,OAAA,CAASyB,CAAAA,CAAW,OAAA,CACpB,MAAOA,CAAAA,CAAW,KAAA,CAClB,UAAWA,CAAAA,CAAW,SAAA,CACtB,OAAQA,CAAAA,CAAW,MAAA,CACrB,EAEDE,CAAAA,EAA2BZ,GAAAA,CAAAiB,SAAA,CAAG,QAAA,CAAAL,EAAwB,CAAA,CACtDR,GAAAA,CAAYF,EAAWF,GAAAA,CAAC,KAAA,CAAA,CAAI,UAAWgB,CAAAA,CAAmB,QAAA,CAAAd,EAAS,CAAA,CACnES,CAAAA,EACCX,IAACf,CAAAA,CAAA,CACC,SAAS,QAAA,CACT,OAAA,CAAS0B,EAAc,OAAA,CACvB,KAAA,CAAOA,EAAc,KAAA,CACrB,SAAA,CAAWA,EAAc,SAAA,CACzB,MAAA,CAAQA,EAAc,MAAA,CACxB,CAAA,CAAA,CAEJ,CAEJ,CAAA,CAEOO,CAAAA,CAAQjB","file":"chunk-X46VCQ33.js","sourcesContent":["import { CSSProperties, HTMLAttributes, ReactNode } from 'react';\nimport cn from '../utils/cn';\n\ntype DivisorVariant = 'wavy' | 'wavy-simple' | 'arched';\n\ninterface DivisorOptions {\n variant: DivisorVariant;\n color?: string; // CSS color (hex, rgb, hsl ou token tailwind via className externa)\n className?: string; // Classes adicionais (ex: text-primary-500)\n height?: number; // altura em px (default 100)\n}\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n as?: 'section' | 'header' | 'footer' | 'nav' | 'article' | 'main';\n fullWidth?: boolean;\n screenHeight?: boolean;\n flex?: boolean;\n centerX?: boolean;\n centerY?: boolean;\n containerClassName?: string;\n divisorTop?: DivisorOptions;\n divisorBottom?: DivisorOptions;\n contentOutsideContainer?: ReactNode;\n}\n\nconst DivisorSVG = ({\n variant,\n color,\n className,\n height = 100,\n position,\n}: DivisorOptions & { position: 'top' | 'bottom' }) => {\n // Se não houver color nem className, usamos currentColor\n const hasColor = !!color;\n\n // Verifica se o color passado parece uma classe Tailwind (não contém #, rgb, hsl e não é uma cor nomeada simples se quisermos ser rigorosos,\n // mas geralmente se tem espaços ou começa com text-/bg-/fill- é tailwind)\n // Uma abordagem melhor: se não contém caracteres especiais de cores CSS, tratamos como classe.\n const isCssColor =\n hasColor && (color.includes('#') || color.includes('rgb') || color.includes('hsl') || color.includes('('));\n\n const style: CSSProperties = {\n height,\n ...(isCssColor ? { color } : {}),\n };\n\n const wrapperClasses = cn(\n 'absolute left-0 w-full z-50 pointer-events-none',\n position === 'top' ? 'bottom-full' : 'top-full',\n hasColor && !isCssColor ? color : '', // Se for classe Tailwind, joga no cn\n className,\n );\n\n // Lado \"reto\" natural de cada SVG\n const naturalFlatSide: Record<DivisorVariant, 'top' | 'bottom'> = {\n wavy: 'bottom',\n 'wavy-simple': 'top',\n arched: 'bottom',\n };\n\n // Se o divisor está no TOPO da section (lado de fora), a base reta do SVG deve estar no BOTTOM\n // (para encostar na borda superior da section).\n // Se o divisor está na BASE da section (lado de fora), a base reta do SVG deve estar no TOP\n // (para encostar na borda inferior da section).\n const desiredTouchSide = position === 'top' ? 'bottom' : 'top';\n const needsFlip = naturalFlatSide[variant] !== desiredTouchSide;\n const svgCommonStyle: CSSProperties = needsFlip ? { transform: 'scaleY(-1)', transformOrigin: 'center' } : {};\n\n return (\n <div className={wrapperClasses} style={style} aria-hidden>\n {variant === 'wavy' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path\n d=\"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z\"\n fillOpacity=\".3\"\n />\n <path\n d=\"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z\"\n fillOpacity=\".5\"\n />\n <path d=\"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z\" />\n </g>\n </svg>\n )}\n {variant === 'wavy-simple' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path d=\"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z\" />\n </g>\n </svg>\n )}\n {variant === 'arched' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path d=\"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z\" fillOpacity=\".3\" />\n <path d=\"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z\" fillOpacity=\".5\" />\n <path d=\"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z\" />\n </g>\n </svg>\n )}\n </div>\n );\n};\n\nexport const Section = ({\n children,\n as: Component = 'section',\n fullWidth = false,\n screenHeight = false,\n flex = false,\n centerX = false,\n centerY = false,\n className = '',\n containerClassName = '',\n divisorTop,\n divisorBottom,\n contentOutsideContainer,\n ...props\n}: SectionProps) => {\n const isSectionColumn = !!screenHeight;\n\n const sectionClasses = cn(\n 'relative w-full',\n screenHeight && 'min-h-screen',\n flex && 'flex-1',\n screenHeight && 'flex flex-col',\n (centerX || centerY) && 'flex',\n // Centralização quando é fullWidth ou screenHeight (flex-col)\n centerX && (fullWidth || isSectionColumn) && 'items-center',\n centerY && (fullWidth || isSectionColumn) && 'justify-center',\n // Centralização quando é fullWidth e NÃO é coluna (flex-row padrão)\n centerX && fullWidth && !isSectionColumn && 'justify-center',\n centerY && fullWidth && !isSectionColumn && 'items-center',\n className,\n );\n\n const containerClasses = cn(\n 'mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full',\n {\n 'flex-1': screenHeight,\n flex: centerX || centerY,\n 'justify-center': centerX,\n 'items-center': centerY,\n },\n containerClassName,\n );\n\n return (\n <Component className={sectionClasses} {...props}>\n {divisorTop && (\n <DivisorSVG\n position=\"top\"\n variant={divisorTop.variant}\n color={divisorTop.color}\n className={divisorTop.className}\n height={divisorTop.height}\n />\n )}\n {contentOutsideContainer && <>{contentOutsideContainer}</>}\n {fullWidth ? children : <div className={containerClasses}>{children}</div>}\n {divisorBottom && (\n <DivisorSVG\n position=\"bottom\"\n variant={divisorBottom.variant}\n color={divisorBottom.color}\n className={divisorBottom.className}\n height={divisorBottom.height}\n />\n )}\n </Component>\n );\n};\n\nexport default Section;\n"]}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkZ5XWNRFP_cjs=require('./chunk-Z5XWNRFP.cjs'),chunkKXPGO6PS_cjs=require('./chunk-KXPGO6PS.cjs'),chunkOI62N27S_cjs=require('./chunk-OI62N27S.cjs');require('./chunk-U7VSEXSW.cjs');var chunkENMFI5RT_cjs=require('./chunk-ENMFI5RT.cjs');require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"Button",{enumerable:true,get:function(){return chunkZ5XWNRFP_cjs.a}});Object.defineProperty(exports,"Section",{enumerable:true,get:function(){return chunkKXPGO6PS_cjs.a}});Object.defineProperty(exports,"Icon",{enumerable:true,get:function(){return chunkOI62N27S_cjs.a}});Object.defineProperty(exports,"ThemeProvider",{enumerable:true,get:function(){return chunkENMFI5RT_cjs.b}});Object.defineProperty(exports,"defaultTheme",{enumerable:true,get:function(){return chunkENMFI5RT_cjs.a}});Object.defineProperty(exports,"useTheme",{enumerable:true,get:function(){return chunkENMFI5RT_cjs.c}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkZ5XWNRFP_cjs=require('./chunk-Z5XWNRFP.cjs'),chunkMTK6DOJZ_cjs=require('./chunk-MTK6DOJZ.cjs'),chunkOI62N27S_cjs=require('./chunk-OI62N27S.cjs');require('./chunk-U7VSEXSW.cjs');var chunkENMFI5RT_cjs=require('./chunk-ENMFI5RT.cjs');require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"Button",{enumerable:true,get:function(){return chunkZ5XWNRFP_cjs.a}});Object.defineProperty(exports,"Section",{enumerable:true,get:function(){return chunkMTK6DOJZ_cjs.a}});Object.defineProperty(exports,"Icon",{enumerable:true,get:function(){return chunkOI62N27S_cjs.a}});Object.defineProperty(exports,"ThemeProvider",{enumerable:true,get:function(){return chunkENMFI5RT_cjs.b}});Object.defineProperty(exports,"defaultTheme",{enumerable:true,get:function(){return chunkENMFI5RT_cjs.a}});Object.defineProperty(exports,"useTheme",{enumerable:true,get:function(){return chunkENMFI5RT_cjs.c}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as Button}from'./chunk-3SA2QKC6.js';export{a as Section}from'./chunk-ZOVZGLB5.js';export{a as Icon}from'./chunk-MVVNEKMH.js';import'./chunk-GUQJ6RZT.js';export{b as ThemeProvider,a as defaultTheme,c as useTheme}from'./chunk-CK44QQW5.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
1
+ export{a as Button}from'./chunk-3SA2QKC6.js';export{a as Section}from'./chunk-X46VCQ33.js';export{a as Icon}from'./chunk-MVVNEKMH.js';import'./chunk-GUQJ6RZT.js';export{b as ThemeProvider,a as defaultTheme,c as useTheme}from'./chunk-CK44QQW5.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@berdsk/ui",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Biblioteca de componentes UI profissional da Berdsk",
5
5
  "author": "Berdsk",
6
6
  "publishConfig": {
@@ -32,7 +32,9 @@
32
32
  "clean": "rimraf dist",
33
33
  "prepublishOnly": "npm run build",
34
34
  "dev": "tsup --watch",
35
- "format": "prettier --write ."
35
+ "format": "prettier --write .",
36
+ "login-pre-publish": "npm login",
37
+ "publish": "npm publish --access public"
36
38
  },
37
39
  "peerDependencies": {
38
40
  "react": ">=18",
@@ -1,3 +0,0 @@
1
- 'use strict';var chunkU7VSEXSW_cjs=require('./chunk-U7VSEXSW.cjs'),jsxRuntime=require('react/jsx-runtime');var w=({variant:a,color:t,className:n,height:c=100,position:p})=>{let s=!!t,o=s&&(t.includes("#")||t.includes("rgb")||t.includes("hsl")||t.includes("(")),v={height:c,...o?{color:t}:{}},f=chunkU7VSEXSW_cjs.a("absolute left-0 w-full z-50 pointer-events-none",p==="top"?"bottom-full":"top-full",s&&!o?t:"",n),l={wavy:"bottom","wavy-simple":"top",arched:"bottom"},r=p==="top"?"bottom":"top",i=l[a]!==r?{transform:"scaleY(-1)",transformOrigin:"center"}:{};return jsxRuntime.jsxs("div",{className:f,style:v,"aria-hidden":true,children:[a==="wavy"&&jsxRuntime.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:i,children:jsxRuntime.jsxs("g",{fill:"currentColor",children:[jsxRuntime.jsx("path",{d:"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z",fillOpacity:".3"}),jsxRuntime.jsx("path",{d:"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z",fillOpacity:".5"}),jsxRuntime.jsx("path",{d:"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z"})]})}),a==="wavy-simple"&&jsxRuntime.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:i,children:jsxRuntime.jsx("g",{fill:"currentColor",children:jsxRuntime.jsx("path",{d:"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z"})})}),a==="arched"&&jsxRuntime.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:i,children:jsxRuntime.jsxs("g",{fill:"currentColor",children:[jsxRuntime.jsx("path",{d:"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z",fillOpacity:".3"}),jsxRuntime.jsx("path",{d:"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z",fillOpacity:".5"}),jsxRuntime.jsx("path",{d:"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z"})]})})]})},x=({children:a,as:t="section",fullWidth:n=false,screenHeight:c=false,flex:p=false,centerX:s=false,centerY:o=false,className:v="",containerClassName:f="",divisorTop:l,divisorBottom:r,...g})=>{let i=!!c,d=chunkU7VSEXSW_cjs.a("relative w-full",c&&"min-h-screen",p&&"flex-1",c&&"flex flex-col",(s||o)&&"flex",s&&(n||i)&&"items-center",o&&(n||i)&&"justify-center",s&&n&&!i&&"justify-center",o&&n&&!i&&"items-center",v),u=chunkU7VSEXSW_cjs.a("mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full",{"flex-1":c,flex:s||o,"justify-center":s,"items-center":o},f);return jsxRuntime.jsxs(t,{className:d,...g,children:[l&&jsxRuntime.jsx(w,{position:"top",variant:l.variant,color:l.color,className:l.className,height:l.height}),n?a:jsxRuntime.jsx("div",{className:u,children:a}),r&&jsxRuntime.jsx(w,{position:"bottom",variant:r.variant,color:r.color,className:r.className,height:r.height})]})},y=x;
2
- exports.a=x;exports.b=y;//# sourceMappingURL=chunk-KXPGO6PS.cjs.map
3
- //# sourceMappingURL=chunk-KXPGO6PS.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Section.tsx"],"names":["DivisorSVG","variant","color","className","height","position","hasColor","isCssColor","style","wrapperClasses","cn","naturalFlatSide","desiredTouchSide","svgCommonStyle","jsxs","jsx","Section","children","Component","fullWidth","screenHeight","flex","centerX","centerY","containerClassName","divisorTop","divisorBottom","props","isSectionColumn","sectionClasses","containerClasses","Section_default"],"mappings":"2GAyBA,IAAMA,EAAa,CAAC,CAClB,QAAAC,CAAAA,CACA,KAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,OAAAC,CAAAA,CAAS,GAAA,CACT,SAAAC,CACF,CAAA,GAAuD,CAErD,IAAMC,CAAAA,CAAW,CAAC,CAACJ,CAAAA,CAKbK,EACJD,CAAAA,GAAaJ,CAAAA,CAAM,SAAS,GAAG,CAAA,EAAKA,EAAM,QAAA,CAAS,KAAK,GAAKA,CAAAA,CAAM,QAAA,CAAS,KAAK,CAAA,EAAKA,CAAAA,CAAM,SAAS,GAAG,CAAA,CAAA,CAEpGM,CAAAA,CAAuB,CAC3B,OAAAJ,CAAAA,CACA,GAAIG,EAAa,CAAE,KAAA,CAAAL,CAAM,CAAA,CAAI,EAC/B,CAAA,CAEMO,CAAAA,CAAiBC,oBACrB,iDAAA,CACAL,CAAAA,GAAa,MAAQ,aAAA,CAAgB,UAAA,CACrCC,GAAY,CAACC,CAAAA,CAAaL,EAAQ,EAAA,CAClCC,CACF,EAGMQ,CAAAA,CAA4D,CAChE,KAAM,QAAA,CACN,aAAA,CAAe,MACf,MAAA,CAAQ,QACV,EAMMC,CAAAA,CAAmBP,CAAAA,GAAa,MAAQ,QAAA,CAAW,KAAA,CAEnDQ,EADYF,CAAAA,CAAgBV,CAAO,IAAMW,CAAAA,CACG,CAAE,SAAA,CAAW,YAAA,CAAc,gBAAiB,QAAS,CAAA,CA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vC,QAAA,CAAA,CAAAF,GACCV,cAAAA,CAACf,CAAAA,CAAA,CACC,QAAA,CAAS,KAAA,CACT,QAASyB,CAAAA,CAAW,OAAA,CACpB,MAAOA,CAAAA,CAAW,KAAA,CAClB,UAAWA,CAAAA,CAAW,SAAA,CACtB,OAAQA,CAAAA,CAAW,MAAA,CACrB,EAEDN,CAAAA,CAAYF,CAAAA,CAAWF,eAAC,KAAA,CAAA,CAAI,SAAA,CAAWe,EAAmB,QAAA,CAAAb,CAAAA,CAAS,EACnES,CAAAA,EACCX,cAAAA,CAACf,EAAA,CACC,QAAA,CAAS,SACT,OAAA,CAAS0B,CAAAA,CAAc,QACvB,KAAA,CAAOA,CAAAA,CAAc,MACrB,SAAA,CAAWA,CAAAA,CAAc,UACzB,MAAA,CAAQA,CAAAA,CAAc,OACxB,CAAA,CAAA,CAEJ,CAEJ,EAEOK,CAAAA,CAAQf","file":"chunk-KXPGO6PS.cjs","sourcesContent":["import { CSSProperties, HTMLAttributes, ReactNode } from 'react';\nimport cn from '../utils/cn';\n\ntype DivisorVariant = 'wavy' | 'wavy-simple' | 'arched';\n\ninterface DivisorOptions {\n variant: DivisorVariant;\n color?: string; // CSS color (hex, rgb, hsl ou token tailwind via className externa)\n className?: string; // Classes adicionais (ex: text-primary-500)\n height?: number; // altura em px (default 100)\n}\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n as?: 'section' | 'header' | 'footer' | 'nav' | 'article' | 'main';\n fullWidth?: boolean;\n screenHeight?: boolean;\n flex?: boolean;\n centerX?: boolean;\n centerY?: boolean;\n containerClassName?: string;\n divisorTop?: DivisorOptions;\n divisorBottom?: DivisorOptions;\n}\n\nconst DivisorSVG = ({\n variant,\n color,\n className,\n height = 100,\n position,\n}: DivisorOptions & { position: 'top' | 'bottom' }) => {\n // Se não houver color nem className, usamos currentColor\n const hasColor = !!color;\n\n // Verifica se o color passado parece uma classe Tailwind (não contém #, rgb, hsl e não é uma cor nomeada simples se quisermos ser rigorosos,\n // mas geralmente se tem espaços ou começa com text-/bg-/fill- é tailwind)\n // Uma abordagem melhor: se não contém caracteres especiais de cores CSS, tratamos como classe.\n const isCssColor =\n hasColor && (color.includes('#') || color.includes('rgb') || color.includes('hsl') || color.includes('('));\n\n const style: CSSProperties = {\n height,\n ...(isCssColor ? { color } : {}),\n };\n\n const wrapperClasses = cn(\n 'absolute left-0 w-full z-50 pointer-events-none',\n position === 'top' ? 'bottom-full' : 'top-full',\n hasColor && !isCssColor ? color : '', // Se for classe Tailwind, joga no cn\n className,\n );\n\n // Lado \"reto\" natural de cada SVG\n const naturalFlatSide: Record<DivisorVariant, 'top' | 'bottom'> = {\n wavy: 'bottom',\n 'wavy-simple': 'top',\n arched: 'bottom',\n };\n\n // Se o divisor está no TOPO da section (lado de fora), a base reta do SVG deve estar no BOTTOM\n // (para encostar na borda superior da section).\n // Se o divisor está na BASE da section (lado de fora), a base reta do SVG deve estar no TOP\n // (para encostar na borda inferior da section).\n const desiredTouchSide = position === 'top' ? 'bottom' : 'top';\n const needsFlip = naturalFlatSide[variant] !== desiredTouchSide;\n const svgCommonStyle: CSSProperties = needsFlip ? { transform: 'scaleY(-1)', transformOrigin: 'center' } : {};\n\n return (\n <div className={wrapperClasses} style={style} aria-hidden>\n {variant === 'wavy' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path\n d=\"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z\"\n fillOpacity=\".3\"\n />\n <path\n d=\"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z\"\n fillOpacity=\".5\"\n />\n <path d=\"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z\" />\n </g>\n </svg>\n )}\n {variant === 'wavy-simple' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path d=\"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z\" />\n </g>\n </svg>\n )}\n {variant === 'arched' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path d=\"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z\" fillOpacity=\".3\" />\n <path d=\"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z\" fillOpacity=\".5\" />\n <path d=\"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z\" />\n </g>\n </svg>\n )}\n </div>\n );\n};\n\nexport const Section = ({\n children,\n as: Component = 'section',\n fullWidth = false,\n screenHeight = false,\n flex = false,\n centerX = false,\n centerY = false,\n className = '',\n containerClassName = '',\n divisorTop,\n divisorBottom,\n ...props\n}: SectionProps) => {\n const isSectionColumn = !!screenHeight;\n\n const sectionClasses = cn(\n 'relative w-full',\n screenHeight && 'min-h-screen',\n flex && 'flex-1',\n screenHeight && 'flex flex-col',\n (centerX || centerY) && 'flex',\n // Centralização quando é fullWidth ou screenHeight (flex-col)\n centerX && (fullWidth || isSectionColumn) && 'items-center',\n centerY && (fullWidth || isSectionColumn) && 'justify-center',\n // Centralização quando é fullWidth e NÃO é coluna (flex-row padrão)\n centerX && fullWidth && !isSectionColumn && 'justify-center',\n centerY && fullWidth && !isSectionColumn && 'items-center',\n className,\n );\n\n const containerClasses = cn(\n 'mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full',\n {\n 'flex-1': screenHeight,\n flex: centerX || centerY,\n 'justify-center': centerX,\n 'items-center': centerY,\n },\n containerClassName,\n );\n\n return (\n <Component className={sectionClasses} {...props}>\n {divisorTop && (\n <DivisorSVG\n position=\"top\"\n variant={divisorTop.variant}\n color={divisorTop.color}\n className={divisorTop.className}\n height={divisorTop.height}\n />\n )}\n {fullWidth ? children : <div className={containerClasses}>{children}</div>}\n {divisorBottom && (\n <DivisorSVG\n position=\"bottom\"\n variant={divisorBottom.variant}\n color={divisorBottom.color}\n className={divisorBottom.className}\n height={divisorBottom.height}\n />\n )}\n </Component>\n );\n};\n\nexport default Section;\n"]}
@@ -1,3 +0,0 @@
1
- import {a}from'./chunk-GUQJ6RZT.js';import {jsxs,jsx}from'react/jsx-runtime';var w=({variant:a$1,color:t,className:n,height:c=100,position:p})=>{let s=!!t,o=s&&(t.includes("#")||t.includes("rgb")||t.includes("hsl")||t.includes("(")),v={height:c,...o?{color:t}:{}},f=a("absolute left-0 w-full z-50 pointer-events-none",p==="top"?"bottom-full":"top-full",s&&!o?t:"",n),l={wavy:"bottom","wavy-simple":"top",arched:"bottom"},r=p==="top"?"bottom":"top",i=l[a$1]!==r?{transform:"scaleY(-1)",transformOrigin:"center"}:{};return jsxs("div",{className:f,style:v,"aria-hidden":true,children:[a$1==="wavy"&&jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:i,children:jsxs("g",{fill:"currentColor",children:[jsx("path",{d:"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z",fillOpacity:".3"}),jsx("path",{d:"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z",fillOpacity:".5"}),jsx("path",{d:"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z"})]})}),a$1==="wavy-simple"&&jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:i,children:jsx("g",{fill:"currentColor",children:jsx("path",{d:"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z"})})}),a$1==="arched"&&jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1280 140",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",style:i,children:jsxs("g",{fill:"currentColor",children:[jsx("path",{d:"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z",fillOpacity:".3"}),jsx("path",{d:"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z",fillOpacity:".5"}),jsx("path",{d:"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z"})]})})]})},x=({children:a$1,as:t="section",fullWidth:n=false,screenHeight:c=false,flex:p=false,centerX:s=false,centerY:o=false,className:v="",containerClassName:f="",divisorTop:l,divisorBottom:r,...g})=>{let i=!!c,d=a("relative w-full",c&&"min-h-screen",p&&"flex-1",c&&"flex flex-col",(s||o)&&"flex",s&&(n||i)&&"items-center",o&&(n||i)&&"justify-center",s&&n&&!i&&"justify-center",o&&n&&!i&&"items-center",v),u=a("mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full",{"flex-1":c,flex:s||o,"justify-center":s,"items-center":o},f);return jsxs(t,{className:d,...g,children:[l&&jsx(w,{position:"top",variant:l.variant,color:l.color,className:l.className,height:l.height}),n?a$1:jsx("div",{className:u,children:a$1}),r&&jsx(w,{position:"bottom",variant:r.variant,color:r.color,className:r.className,height:r.height})]})},y=x;
2
- export{x as a,y as b};//# sourceMappingURL=chunk-ZOVZGLB5.js.map
3
- //# sourceMappingURL=chunk-ZOVZGLB5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Section.tsx"],"names":["DivisorSVG","variant","color","className","height","position","hasColor","isCssColor","style","wrapperClasses","cn","naturalFlatSide","desiredTouchSide","svgCommonStyle","jsxs","jsx","Section","children","Component","fullWidth","screenHeight","flex","centerX","centerY","containerClassName","divisorTop","divisorBottom","props","isSectionColumn","sectionClasses","containerClasses","Section_default"],"mappings":"6EAyBA,IAAMA,EAAa,CAAC,CAClB,QAAAC,GAAAA,CACA,KAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,OAAAC,CAAAA,CAAS,GAAA,CACT,SAAAC,CACF,CAAA,GAAuD,CAErD,IAAMC,CAAAA,CAAW,CAAC,CAACJ,CAAAA,CAKbK,EACJD,CAAAA,GAAaJ,CAAAA,CAAM,SAAS,GAAG,CAAA,EAAKA,EAAM,QAAA,CAAS,KAAK,GAAKA,CAAAA,CAAM,QAAA,CAAS,KAAK,CAAA,EAAKA,CAAAA,CAAM,SAAS,GAAG,CAAA,CAAA,CAEpGM,CAAAA,CAAuB,CAC3B,OAAAJ,CAAAA,CACA,GAAIG,EAAa,CAAE,KAAA,CAAAL,CAAM,CAAA,CAAI,EAC/B,CAAA,CAEMO,CAAAA,CAAiBC,EACrB,iDAAA,CACAL,CAAAA,GAAa,MAAQ,aAAA,CAAgB,UAAA,CACrCC,GAAY,CAACC,CAAAA,CAAaL,EAAQ,EAAA,CAClCC,CACF,EAGMQ,CAAAA,CAA4D,CAChE,KAAM,QAAA,CACN,aAAA,CAAe,MACf,MAAA,CAAQ,QACV,EAMMC,CAAAA,CAAmBP,CAAAA,GAAa,MAAQ,QAAA,CAAW,KAAA,CAEnDQ,EADYF,CAAAA,CAAgBV,GAAO,IAAMW,CAAAA,CACG,CAAE,SAAA,CAAW,YAAA,CAAc,gBAAiB,QAAS,CAAA,CAAI,EAAC,CAE5G,OACEE,KAAC,KAAA,CAAA,CAAI,SAAA,CAAWL,EAAgB,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KAAA,CACT,QAASyB,CAAAA,CAAW,OAAA,CACpB,MAAOA,CAAAA,CAAW,KAAA,CAClB,UAAWA,CAAAA,CAAW,SAAA,CACtB,OAAQA,CAAAA,CAAW,MAAA,CACrB,EAEDN,CAAAA,CAAYF,GAAAA,CAAWF,IAAC,KAAA,CAAA,CAAI,SAAA,CAAWe,EAAmB,QAAA,CAAAb,GAAAA,CAAS,EACnES,CAAAA,EACCX,GAAAA,CAACf,EAAA,CACC,QAAA,CAAS,SACT,OAAA,CAAS0B,CAAAA,CAAc,QACvB,KAAA,CAAOA,CAAAA,CAAc,MACrB,SAAA,CAAWA,CAAAA,CAAc,UACzB,MAAA,CAAQA,CAAAA,CAAc,OACxB,CAAA,CAAA,CAEJ,CAEJ,EAEOK,CAAAA,CAAQf","file":"chunk-ZOVZGLB5.js","sourcesContent":["import { CSSProperties, HTMLAttributes, ReactNode } from 'react';\nimport cn from '../utils/cn';\n\ntype DivisorVariant = 'wavy' | 'wavy-simple' | 'arched';\n\ninterface DivisorOptions {\n variant: DivisorVariant;\n color?: string; // CSS color (hex, rgb, hsl ou token tailwind via className externa)\n className?: string; // Classes adicionais (ex: text-primary-500)\n height?: number; // altura em px (default 100)\n}\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n as?: 'section' | 'header' | 'footer' | 'nav' | 'article' | 'main';\n fullWidth?: boolean;\n screenHeight?: boolean;\n flex?: boolean;\n centerX?: boolean;\n centerY?: boolean;\n containerClassName?: string;\n divisorTop?: DivisorOptions;\n divisorBottom?: DivisorOptions;\n}\n\nconst DivisorSVG = ({\n variant,\n color,\n className,\n height = 100,\n position,\n}: DivisorOptions & { position: 'top' | 'bottom' }) => {\n // Se não houver color nem className, usamos currentColor\n const hasColor = !!color;\n\n // Verifica se o color passado parece uma classe Tailwind (não contém #, rgb, hsl e não é uma cor nomeada simples se quisermos ser rigorosos,\n // mas geralmente se tem espaços ou começa com text-/bg-/fill- é tailwind)\n // Uma abordagem melhor: se não contém caracteres especiais de cores CSS, tratamos como classe.\n const isCssColor =\n hasColor && (color.includes('#') || color.includes('rgb') || color.includes('hsl') || color.includes('('));\n\n const style: CSSProperties = {\n height,\n ...(isCssColor ? { color } : {}),\n };\n\n const wrapperClasses = cn(\n 'absolute left-0 w-full z-50 pointer-events-none',\n position === 'top' ? 'bottom-full' : 'top-full',\n hasColor && !isCssColor ? color : '', // Se for classe Tailwind, joga no cn\n className,\n );\n\n // Lado \"reto\" natural de cada SVG\n const naturalFlatSide: Record<DivisorVariant, 'top' | 'bottom'> = {\n wavy: 'bottom',\n 'wavy-simple': 'top',\n arched: 'bottom',\n };\n\n // Se o divisor está no TOPO da section (lado de fora), a base reta do SVG deve estar no BOTTOM\n // (para encostar na borda superior da section).\n // Se o divisor está na BASE da section (lado de fora), a base reta do SVG deve estar no TOP\n // (para encostar na borda inferior da section).\n const desiredTouchSide = position === 'top' ? 'bottom' : 'top';\n const needsFlip = naturalFlatSide[variant] !== desiredTouchSide;\n const svgCommonStyle: CSSProperties = needsFlip ? { transform: 'scaleY(-1)', transformOrigin: 'center' } : {};\n\n return (\n <div className={wrapperClasses} style={style} aria-hidden>\n {variant === 'wavy' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path\n d=\"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z\"\n fillOpacity=\".3\"\n />\n <path\n d=\"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z\"\n fillOpacity=\".5\"\n />\n <path d=\"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z\" />\n </g>\n </svg>\n )}\n {variant === 'wavy-simple' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path d=\"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z\" />\n </g>\n </svg>\n )}\n {variant === 'arched' && (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 140\"\n preserveAspectRatio=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={svgCommonStyle}\n >\n <g fill=\"currentColor\">\n <path d=\"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z\" fillOpacity=\".3\" />\n <path d=\"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z\" fillOpacity=\".5\" />\n <path d=\"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z\" />\n </g>\n </svg>\n )}\n </div>\n );\n};\n\nexport const Section = ({\n children,\n as: Component = 'section',\n fullWidth = false,\n screenHeight = false,\n flex = false,\n centerX = false,\n centerY = false,\n className = '',\n containerClassName = '',\n divisorTop,\n divisorBottom,\n ...props\n}: SectionProps) => {\n const isSectionColumn = !!screenHeight;\n\n const sectionClasses = cn(\n 'relative w-full',\n screenHeight && 'min-h-screen',\n flex && 'flex-1',\n screenHeight && 'flex flex-col',\n (centerX || centerY) && 'flex',\n // Centralização quando é fullWidth ou screenHeight (flex-col)\n centerX && (fullWidth || isSectionColumn) && 'items-center',\n centerY && (fullWidth || isSectionColumn) && 'justify-center',\n // Centralização quando é fullWidth e NÃO é coluna (flex-row padrão)\n centerX && fullWidth && !isSectionColumn && 'justify-center',\n centerY && fullWidth && !isSectionColumn && 'items-center',\n className,\n );\n\n const containerClasses = cn(\n 'mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full',\n {\n 'flex-1': screenHeight,\n flex: centerX || centerY,\n 'justify-center': centerX,\n 'items-center': centerY,\n },\n containerClassName,\n );\n\n return (\n <Component className={sectionClasses} {...props}>\n {divisorTop && (\n <DivisorSVG\n position=\"top\"\n variant={divisorTop.variant}\n color={divisorTop.color}\n className={divisorTop.className}\n height={divisorTop.height}\n />\n )}\n {fullWidth ? children : <div className={containerClasses}>{children}</div>}\n {divisorBottom && (\n <DivisorSVG\n position=\"bottom\"\n variant={divisorBottom.variant}\n color={divisorBottom.color}\n className={divisorBottom.className}\n height={divisorBottom.height}\n />\n )}\n </Component>\n );\n};\n\nexport default Section;\n"]}