@agilys-system/design-system 1.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 ADDED
@@ -0,0 +1,102 @@
1
+ # @agilys/design-system
2
+
3
+ Design system em React para os projetos web da Agilys. Componentes construídos com [Vite](https://vitejs.dev), [Tailwind CSS](https://tailwindcss.com) e [class-variance-authority](https://cva.style), com playground em [Storybook](https://storybook.js.org).
4
+
5
+ ## Instalação
6
+
7
+ ```bash
8
+ npm install @agilys/design-system
9
+ ```
10
+
11
+ Este pacote tem `react` e `react-dom` (>=18) como `peerDependencies` — instale-os no projeto consumidor caso ainda não existam.
12
+
13
+ ## Uso
14
+
15
+ Importe os componentes e o CSS do pacote no ponto de entrada da sua aplicação:
16
+
17
+ ```tsx
18
+ import { Button } from '@agilys/design-system';
19
+ import '@agilys/design-system/styles.css';
20
+
21
+ function App() {
22
+ return <Button variant="primary">Clique aqui</Button>;
23
+ }
24
+ ```
25
+
26
+ > O import do CSS (`@agilys/design-system/styles.css`) é necessário apenas uma vez na aplicação — ele contém as classes Tailwind geradas usadas pelos componentes.
27
+
28
+ ### Tailwind no projeto consumidor
29
+
30
+ Se o projeto consumidor também usa Tailwind, adicione o pacote ao `content` do `tailwind.config.js` para evitar purge de classes usadas dinamicamente:
31
+
32
+ ```js
33
+ export default {
34
+ content: [
35
+ './src/**/*.{ts,tsx}',
36
+ './node_modules/@agilys/design-system/dist/**/*.js',
37
+ ],
38
+ };
39
+ ```
40
+
41
+ ## Componentes disponíveis
42
+
43
+ | Componente | Documentação |
44
+ | --- | --- |
45
+ | `Button` | [docs/button.md](./docs/button.md) |
46
+
47
+ Consulte a pasta [`docs/`](./docs) para o manual de integração de cada componente.
48
+
49
+ ## Desenvolvimento
50
+
51
+ ```bash
52
+ npm install # instala dependências
53
+ npm run dev # sobe o Storybook em http://localhost:6006 (playground dos componentes)
54
+ npm run build # gera o build da lib em dist/ (JS + tipos + CSS)
55
+ npm run build:storybook # gera o build estático do Storybook
56
+ npm run lint # roda o ESLint
57
+ ```
58
+
59
+ ### Estrutura do projeto
60
+
61
+ ```
62
+ src/
63
+ components/
64
+ Button/
65
+ Button.tsx
66
+ Button.stories.tsx
67
+ index.ts
68
+ lib/
69
+ cn.ts # helper (clsx + tailwind-merge)
70
+ styles/
71
+ tailwind.css
72
+ index.ts # entry point público do pacote
73
+ docs/
74
+ button.md # manual de integração do Button
75
+ .storybook/ # configuração do Storybook (playground)
76
+ .github/workflows/
77
+ publish.yml # publica no npm a cada push na branch main
78
+ ```
79
+
80
+ ### Adicionando um novo componente
81
+
82
+ 1. Crie `src/components/MeuComponente/MeuComponente.tsx`.
83
+ 2. Exporte o componente em `src/components/MeuComponente/index.ts`.
84
+ 3. Reexporte em `src/index.ts`.
85
+ 4. Crie a story em `src/components/MeuComponente/MeuComponente.stories.tsx`.
86
+ 5. Documente o uso em `docs/meu-componente.md` e adicione uma linha na tabela acima.
87
+
88
+ ## Publicação (CI/CD)
89
+
90
+ O workflow [`.github/workflows/publish.yml`](./.github/workflows/publish.yml) roda a cada push na branch `main`:
91
+
92
+ 1. Instala dependências, faz lint e build do pacote.
93
+ 2. Compara a versão em `package.json` com a versão publicada no npm.
94
+ 3. Se a versão mudou, publica automaticamente em `https://registry.npmjs.org` (`npm publish`).
95
+
96
+ Para publicar uma nova versão, faça `npm version <patch|minor|major>` (ou edite `version` no `package.json`) e faça merge/push na `main`.
97
+
98
+ > **Secret necessário:** configure `NPM_TOKEN` (token de automação do npm com permissão de publish) em *Settings → Secrets and variables → Actions* no repositório GitHub.
99
+
100
+ ## Licença
101
+
102
+ MIT
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),I=require("react");function pe(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=pe(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function be(){for(var e,t,r=0,o="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=pe(e))&&(o&&(o+=" "),o+=t);return o}const ie=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,le=be,Q=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return le(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:n}=t,l=Object.keys(s).map(c=>{const p=r==null?void 0:r[c],m=n==null?void 0:n[c];if(p===null)return null;const h=ie(p)||ie(m);return s[c][h]}),a=r&&Object.entries(r).reduce((c,p)=>{let[m,h]=p;return h===void 0||(c[m]=h),c},{}),u=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,p)=>{let{class:m,className:h,...C}=p;return Object.entries(C).every(j=>{let[x,b]=j;return Array.isArray(b)?b.includes({...n,...a}[x]):{...n,...a}[x]===b})?[...c,m,h]:c},[]);return le(e,l,u,r==null?void 0:r.class,r==null?void 0:r.className)},te="-",Se=e=>{const t=Ae(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{const a=l.split(te);return a[0]===""&&a.length!==1&&a.shift(),fe(a,t)||_e(l)},getConflictingClassGroupIds:(l,a)=>{const u=r[l]||[];return a&&o[l]?[...u,...o[l]]:u}}},fe=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),s=o?fe(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;const n=e.join(te);return(l=t.validators.find(({validator:a})=>a(n)))==null?void 0:l.classGroupId},ce=/^\[(.+)\]$/,_e=e=>{if(ce.test(e)){const t=ce.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ae=e=>{const{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return Re(Object.entries(e.classGroups),r).forEach(([n,l])=>{D(l,o,n,t)}),o},D=(e,t,r,o)=>{e.forEach(s=>{if(typeof s=="string"){const n=s===""?t:de(t,s);n.classGroupId=r;return}if(typeof s=="function"){if(Me(s)){D(s(o),t,r,o);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([n,l])=>{D(l,de(t,n),r,o)})})},de=(e,t)=>{let r=e;return t.split(te).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Me=e=>e.isThemeGetter,Re=(e,t)=>t?e.map(([r,o])=>{const s=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,a])=>[t+l,a])):n);return[r,s]}):e,Te=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const s=(n,l)=>{r.set(n,l),t++,t>e&&(t=0,o=r,r=new Map)};return{get(n){let l=r.get(n);if(l!==void 0)return l;if((l=o.get(n))!==void 0)return s(n,l),l},set(n,l){r.has(n)?r.set(n,l):s(n,l)}}},ge="!",Ve=e=>{const{separator:t,experimentalParseClassName:r}=e,o=t.length===1,s=t[0],n=t.length,l=a=>{const u=[];let c=0,p=0,m;for(let b=0;b<a.length;b++){let w=a[b];if(c===0){if(w===s&&(o||a.slice(b,b+n)===t)){u.push(a.slice(p,b)),p=b+n;continue}if(w==="/"){m=b;continue}}w==="["?c++:w==="]"&&c--}const h=u.length===0?a:a.substring(p),C=h.startsWith(ge),j=C?h.substring(1):h,x=m&&m>p?m-p:void 0;return{modifiers:u,hasImportantModifier:C,baseClassName:j,maybePostfixModifierPosition:x}};return r?a=>r({className:a,parseClassName:l}):l},Ie=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},Ge=e=>({cache:Te(e.cacheSize),parseClassName:Ve(e),...Se(e)}),Ee=/\s+/,Le=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:s}=t,n=[],l=e.trim().split(Ee);let a="";for(let u=l.length-1;u>=0;u-=1){const c=l[u],{modifiers:p,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:C}=r(c);let j=!!C,x=o(j?h.substring(0,C):h);if(!x){if(!j){a=c+(a.length>0?" "+a:a);continue}if(x=o(h),!x){a=c+(a.length>0?" "+a:a);continue}j=!1}const b=Ie(p).join(":"),w=m?b+ge:b,k=w+x;if(n.includes(k))continue;n.push(k);const S=s(x,j);for(let _=0;_<S.length;++_){const E=S[_];n.push(w+E)}a=c+(a.length>0?" "+a:a)}return a};function We(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=me(t))&&(o&&(o+=" "),o+=r);return o}const me=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=me(e[o]))&&(r&&(r+=" "),r+=t);return r};function Be(e,...t){let r,o,s,n=l;function l(u){const c=t.reduce((p,m)=>m(p),e());return r=Ge(c),o=r.cache.get,s=r.cache.set,n=a,a(u)}function a(u){const c=o(u);if(c)return c;const p=Le(u,r);return s(u,p),p}return function(){return n(We.apply(null,arguments))}}const f=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},he=/^\[(?:([a-z-]+):)?(.+)\]$/i,Pe=/^\d+\/\d+$/,Oe=new Set(["px","full","screen"]),$e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ue=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Fe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,He=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,R=e=>L(e)||Oe.has(e)||Pe.test(e),T=e=>W(e,"length",et),L=e=>!!e&&!Number.isNaN(Number(e)),K=e=>W(e,"number",L),O=e=>!!e&&Number.isInteger(Number(e)),Je=e=>e.endsWith("%")&&L(e.slice(0,-1)),d=e=>he.test(e),V=e=>$e.test(e),Xe=new Set(["length","size","percentage"]),Ze=e=>W(e,Xe,xe),Qe=e=>W(e,"position",xe),Ye=new Set(["image","url"]),Ke=e=>W(e,Ye,rt),De=e=>W(e,"",tt),$=()=>!0,W=(e,t,r)=>{const o=he.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},et=e=>Ue.test(e)&&!qe.test(e),xe=()=>!1,tt=e=>Fe.test(e),rt=e=>He.test(e),ot=()=>{const e=f("colors"),t=f("spacing"),r=f("blur"),o=f("brightness"),s=f("borderColor"),n=f("borderRadius"),l=f("borderSpacing"),a=f("borderWidth"),u=f("contrast"),c=f("grayscale"),p=f("hueRotate"),m=f("invert"),h=f("gap"),C=f("gradientColorStops"),j=f("gradientColorStopPositions"),x=f("inset"),b=f("margin"),w=f("opacity"),k=f("padding"),S=f("saturate"),_=f("scale"),E=f("sepia"),q=f("skew"),y=f("space"),N=f("translate"),G=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",d,t],g=()=>[d,t],oe=()=>["",R,T],F=()=>["auto",L,d],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",d],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[L,d];return{cacheSize:500,separator:":",theme:{colors:[$],spacing:[R,T],blur:["none","",V,d],brightness:M(),borderColor:[e],borderRadius:["none","","full",V,d],borderSpacing:g(),borderWidth:oe(),contrast:M(),grayscale:P(),hueRotate:M(),invert:P(),gap:g(),gradientColorStops:[e],gradientColorStopPositions:[Je,T],inset:B(),margin:B(),opacity:M(),padding:g(),saturate:M(),scale:M(),sepia:P(),skew:M(),space:g(),translate:g()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[V]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ne(),d]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",O,d]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",d]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",O,d]}],"grid-cols":[{"grid-cols":[$]}],"col-start-end":[{col:["auto",{span:["full",O,d]},d]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[$]}],"row-start-end":[{row:["auto",{span:[O,d]},d]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",d]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",d]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[y]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[y]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",d,t]}],"min-w":[{"min-w":[d,t,"min","max","fit"]}],"max-w":[{"max-w":[d,t,"none","full","min","max","fit","prose",{screen:[V]},V]}],h:[{h:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",V,T]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",K]}],"font-family":[{font:[$]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",d]}],"line-clamp":[{"line-clamp":["none",L,K]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",R,d]}],"list-image":[{"list-image":["none",d]}],"list-style-type":[{list:["none","disc","decimal",d]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",R,T]}],"underline-offset":[{"underline-offset":["auto",R,d]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:g()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",d]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",d]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),Qe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ze]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ke]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:H()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[R,d]}],"outline-w":[{outline:[R,T]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[R,T]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",V,De]}],"shadow-color":[{shadow:[$]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",V,d]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",d]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[O,d]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[q]}],"skew-y":[{"skew-y":[q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",d]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",d]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":g()}],"scroll-mx":[{"scroll-mx":g()}],"scroll-my":[{"scroll-my":g()}],"scroll-ms":[{"scroll-ms":g()}],"scroll-me":[{"scroll-me":g()}],"scroll-mt":[{"scroll-mt":g()}],"scroll-mr":[{"scroll-mr":g()}],"scroll-mb":[{"scroll-mb":g()}],"scroll-ml":[{"scroll-ml":g()}],"scroll-p":[{"scroll-p":g()}],"scroll-px":[{"scroll-px":g()}],"scroll-py":[{"scroll-py":g()}],"scroll-ps":[{"scroll-ps":g()}],"scroll-pe":[{"scroll-pe":g()}],"scroll-pt":[{"scroll-pt":g()}],"scroll-pr":[{"scroll-pr":g()}],"scroll-pb":[{"scroll-pb":g()}],"scroll-pl":[{"scroll-pl":g()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[R,T,K]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},nt=Be(ot);function v(...e){return nt(be(e))}const ye=Q("inline-flex items-center justify-center gap-2 rounded-lg font-sans font-normal transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-agilys-primary disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{primary:"bg-agilys-primary text-white text-sm shadow-[0px_2px_6px_0px_rgba(71,71,245,0.16),inset_0px_0px_10px_0px_rgba(255,255,255,0.3)] hover:bg-agilys-primary/90",secondary:"bg-white text-neutral-secondary text-base shadow-[0px_0px_2px_0px_rgba(66,74,98,0.04),0px_3px_8px_0px_rgba(66,74,98,0.09)] hover:bg-gray-50",destructive:"bg-danger-60 text-white text-sm shadow-[0px_2px_6px_0px_rgba(243,22,22,0.16)] hover:bg-danger-60/90"},size:{sm:"h-9 px-3 text-sm",md:"h-11 px-4",lg:"h-12 px-6 text-base",icon:"size-11 p-0 shrink-0"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"primary",size:"md"}}),ve=I.forwardRef(({className:e,variant:t,size:r,fullWidth:o,isLoading:s=!1,leftIcon:n,disabled:l,children:a,...u},c)=>{const p=r==="icon";return i.jsxs("button",{ref:c,className:v(ye({variant:t,size:r,fullWidth:o}),e),disabled:l||s,"aria-busy":s,...u,children:[s&&i.jsxs("svg",{className:"size-[18px] animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),!s&&n&&i.jsx("span",{className:"size-6 shrink-0 [&>svg]:size-full","aria-hidden":"true",children:n}),p?i.jsx("span",{className:"size-5 shrink-0 [&>svg]:size-full",children:a}):a]})});ve.displayName="Button";const we=Q("inline-flex items-center justify-center h-6 font-sans text-sm font-normal leading-6 whitespace-nowrap",{variants:{variant:{filled:"rounded-lg px-3",dot:"rounded bg-white gap-1.5 px-2"},status:{default:"",success:"",alert:"",error:""}},compoundVariants:[{variant:"filled",status:"default",class:"bg-agilys-primary text-white"},{variant:"filled",status:"success",class:"bg-success-10 text-success-60"},{variant:"filled",status:"alert",class:"bg-warning-light text-warning-accent"},{variant:"filled",status:"error",class:"bg-danger-10 text-danger-60"},{variant:"dot",status:"default",class:"text-agilys-primary"},{variant:"dot",status:"success",class:"text-success-60"},{variant:"dot",status:"alert",class:"text-warning-dark"},{variant:"dot",status:"error",class:"text-danger-60"}],defaultVariants:{variant:"filled",status:"default"}}),st={default:"bg-agilys-primary",success:"bg-success-60",alert:"bg-warning-accent",error:"bg-danger-60"},ke=I.forwardRef(({className:e,variant:t="filled",status:r="default",children:o,...s},n)=>i.jsxs("span",{ref:n,className:v(we({variant:t,status:r}),e),...s,children:[t==="dot"&&i.jsx("span",{className:v("size-2 shrink-0 rounded-full",st[r??"default"]),"aria-hidden":"true"}),o]}));ke.displayName="Badge";const je=Q("font-sans text-gray-900",{variants:{variant:{h1:"text-3xl leading-tight font-bold",h2:"text-2xl leading-tight font-bold",h3:"text-xl leading-snug font-semibold",h4:"text-lg leading-snug font-semibold",h5:"text-base leading-snug font-medium",h6:"text-sm leading-snug font-medium",body:"text-sm leading-relaxed font-normal",bodySm:"text-xs leading-relaxed font-normal",caption:"text-[11px] leading-normal font-normal"},weight:{regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{variant:"body"}}),at={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"p",bodySm:"p",caption:"span"},z=I.forwardRef(({className:e,variant:t="body",weight:r,as:o,children:s,...n},l)=>{const a=o??at[t??"body"];return I.createElement(a,{ref:l,className:v(je({variant:t,weight:r}),e),...n},s)});z.displayName="Typography";function it(e,t){return t.split(".").reduce((r,o)=>r==null?void 0:r[o],e)}function lt(e,t){if(t.callback)return t.callback(e);if(!t.key)return null;const r=it(e,t.key);return r==null||r===""?null:i.jsx(z,{as:"span",variant:"body",className:"truncate text-neutral-text-primary",children:r})}const Ce={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},X=I.forwardRef(({className:e,...t},r)=>i.jsxs("span",{className:"relative inline-flex size-5 shrink-0 items-center justify-center",children:[i.jsx("input",{ref:r,type:"checkbox",className:v("peer size-5 shrink-0 cursor-pointer appearance-none rounded border-2 border-neutral-divider-primary bg-white shadow-[0px_0px_2px_0px_rgba(66,74,98,0.09)] checked:border-agilys-primary checked:bg-agilys-primary disabled:cursor-not-allowed disabled:opacity-50",e),...t}),i.jsx("svg",{className:"pointer-events-none absolute size-3 text-white opacity-0 peer-checked:opacity-100",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M5 13l4 4L19 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})]}));X.displayName="TableCheckbox";function ct({className:e}){return i.jsx("svg",{className:v("size-5 shrink-0",e),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M8 9l4-4 4 4M8 15l4 4 4-4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}const Z=I.forwardRef(({className:e,align:t="left",sortable:r,sorted:o,onSort:s,children:n,...l},a)=>i.jsx("th",{ref:a,className:v("border-b border-neutral-divider-secondary px-5 py-2",e),...l,children:i.jsxs("span",{className:v("flex items-center gap-1.5",Ce[t??"left"],r&&"cursor-pointer select-none"),onClick:r?s:void 0,children:[i.jsx(z,{as:"span",variant:"bodySm",weight:"medium",className:"flex-1 truncate text-neutral-text-secondary",children:n}),r&&i.jsx(ct,{className:v(o&&"text-agilys-primary")})]})}));Z.displayName="TableHeadCell";function ee({align:e="left",className:t,children:r,onClick:o}){return i.jsx("td",{onClick:o,className:v("border-b border-neutral-divider-secondary px-5 py-3",t),children:i.jsx("span",{className:v("flex items-center gap-2",Ce[e??"left"]),children:r})})}function dt(e,t,r){if(typeof r=="function")return r(e);const o=e;return r?o[r]??t:o.id??t}function ut({keys:e,data:t,rowKey:r,loading:o,loadingMessage:s="Carregando dados...",emptyMessage:n="Nenhum dado para ser exibido!",selectable:l,selectedRowKeys:a,onSelectionChange:u,sortKey:c,sortDirection:p,onSortChange:m,onRowClick:h,shadow:C=!1,border:j=!0,className:x,...b}){const w=e.length+(l?1:0),k=a??[],S=t.map((y,N)=>dt(y,N,r)),_=S.length>0&&S.every(y=>k.includes(y)),E=()=>{u&&u(_?[]:S)},q=y=>{u&&u(k.includes(y)?k.filter(N=>N!==y):[...k,y])};return i.jsx("div",{className:v("w-full overflow-x-auto rounded-lg",j&&"border border-neutral-divider-secondary",C&&"shadow-[0px_0px_2px_0px_rgba(66,74,98,0.04),0px_3px_8px_0px_rgba(66,74,98,0.09)]"),children:i.jsxs("table",{className:v("w-full border-collapse font-sans",x),...b,children:[i.jsx("thead",{children:i.jsxs("tr",{children:[l&&i.jsx(Z,{align:"center",className:"w-11",children:i.jsx(X,{checked:_,onChange:E,"aria-label":"Selecionar todas as linhas"})}),e.map((y,N)=>i.jsx(Z,{align:y.align,sortable:!!y.key&&!!m,sorted:y.key&&c===y.key?p:!1,onSort:()=>y.key&&(m==null?void 0:m(y.key)),children:y.label},y.key??`column-${N}`))]})}),i.jsx("tbody",{children:o?i.jsx("tr",{children:i.jsx("td",{colSpan:w,className:"border-b border-neutral-divider-secondary bg-neutral-surface-lightest px-5 py-6",children:i.jsx(z,{as:"p",variant:"body",className:"w-full text-center text-neutral-text-secondary",children:s})})}):t.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:w,className:"border-b border-neutral-divider-secondary bg-neutral-surface-lightest px-5 py-6",children:i.jsx(z,{as:"p",variant:"body",className:"w-full text-center text-neutral-text-secondary",children:n})})}):t.map((y,N)=>{const G=S[N];return i.jsxs("tr",{onClick:h?()=>h(y):void 0,className:v(N%2===0?"bg-neutral-surface-lightest":"bg-white",h&&"cursor-pointer"),children:[l&&i.jsx(ee,{align:"center",onClick:A=>A.stopPropagation(),children:i.jsx(X,{checked:k.includes(G),onChange:()=>q(G),"aria-label":"Selecionar linha"})}),e.map((A,B)=>i.jsx(ee,{align:A.align,className:A.className,children:lt(y,A)},A.key??`column-${B}`))]},G)})})]})})}const Ne=Q("relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-surface-lightest font-sans font-medium text-neutral-text-secondary",{variants:{size:{sm:"size-6 text-xs",md:"size-7 text-sm",lg:"size-10 text-base"}},defaultVariants:{size:"md"}});function pt(e){var o;const t=e.trim().split(/\s+/),r=t.length>1?`${t[0][0]}${t[t.length-1][0]}`:(o=t[0])==null?void 0:o.slice(0,2);return r==null?void 0:r.toUpperCase()}const bt={sm:"caption",md:"bodySm",lg:"body"},re=I.forwardRef(({className:e,size:t,src:r,alt:o="",name:s,...n},l)=>{const a=t??"md";return i.jsx("span",{ref:l,className:v(Ne({size:t}),e),...n,children:r?i.jsx("img",{src:r,alt:o,className:"size-full object-cover"}):s&&i.jsx(z,{as:"span",variant:bt[a],weight:"medium",className:"text-inherit leading-none",children:pt(s)})})});re.displayName="Avatar";function ft({src:e,name:t,description:r,size:o="md",className:s}){return i.jsxs("div",{className:v("flex min-w-0 items-center gap-2",s),children:[i.jsx(re,{src:e,name:t,size:o}),i.jsxs("div",{className:"flex min-w-0 flex-col",children:[i.jsx(z,{as:"span",variant:"body",className:"truncate",children:t}),r&&i.jsx(z,{as:"span",variant:"bodySm",className:"truncate text-neutral-text-secondary",children:r})]})]})}const U="ellipsis";function J(e,t){return Array.from({length:t-e+1},(r,o)=>e+o)}function gt(e,t,r){if(r*2+5>=t)return J(1,t);const s=Math.max(e-r,1),n=Math.min(e+r,t),l=s>2,a=n<t-1;return!l&&a?[...J(1,3+r*2),U,t]:l&&!a?[1,U,...J(t-(2+r*2),t)]:[1,U,...J(s,n),U,t]}function ue({direction:e,className:t}){return i.jsx("svg",{className:v("size-4",t),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:e==="left"?"M15 6l-6 6 6 6":"M9 6l6 6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const ze=I.forwardRef(({currentPage:e,totalPages:t,onPageChange:r,siblingCount:o=1,className:s,...n},l)=>{if(t<=1)return null;const a=gt(e,t,o),u=c=>{c<1||c>t||c===e||r(c)};return i.jsxs("nav",{ref:l,"aria-label":"Paginação",className:v("flex items-center gap-1 font-sans",s),...n,children:[i.jsx("button",{type:"button","aria-label":"Página anterior",disabled:e===1,onClick:()=>u(e-1),className:"inline-flex size-9 shrink-0 items-center justify-center rounded-lg text-neutral-text-secondary transition-colors hover:bg-neutral-surface-lightest disabled:pointer-events-none disabled:opacity-40",children:i.jsx(ue,{direction:"left"})}),a.map((c,p)=>c===U?i.jsx("span",{className:"inline-flex size-9 shrink-0 items-center justify-center text-neutral-text-secondary",children:i.jsx(z,{as:"span",variant:"bodySm",className:"text-inherit",children:"…"})},`ellipsis-${p}`):i.jsx("button",{type:"button","aria-current":c===e?"page":void 0,onClick:()=>u(c),className:v("inline-flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors",c===e?"bg-agilys-primary text-white":"text-neutral-text-secondary hover:bg-neutral-surface-lightest"),children:i.jsx(z,{as:"span",variant:"bodySm",weight:"medium",className:"text-inherit",children:c})},c)),i.jsx("button",{type:"button","aria-label":"Próxima página",disabled:e===t,onClick:()=>u(e+1),className:"inline-flex size-9 shrink-0 items-center justify-center rounded-lg text-neutral-text-secondary transition-colors hover:bg-neutral-surface-lightest disabled:pointer-events-none disabled:opacity-40",children:i.jsx(ue,{direction:"right"})})]})});ze.displayName="Pagination";exports.Avatar=re;exports.AvatarColumn=ft;exports.Badge=ke;exports.Button=ve;exports.Pagination=ze;exports.Table=ut;exports.TableCell=ee;exports.TableCheckbox=X;exports.TableHeadCell=Z;exports.Typography=z;exports.avatarVariants=Ne;exports.badgeVariants=we;exports.buttonVariants=ye;exports.cn=v;exports.typographyVariants=je;
2
+ //# sourceMappingURL=agilys-design-system.cjs.map