ergo-ui 0.1.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,49 @@
1
+ # ERGO-UI
2
+
3
+ A modern/futuristic componet library built using React, Typescript and Tailwindcss
4
+
5
+ ## Sharp Components
6
+
7
+ Create sharp components by passing in the _sharp_ prop.
8
+
9
+ ```typescript
10
+ <Button variant='primary' sharp />
11
+ ```
12
+
13
+ <img alt='custom-card' src='./src/assets/images/SharpButton.png' width='200px' />
14
+
15
+ ### Mix and match between sharp and curved
16
+
17
+ Perhaps you want a curved parent component which features a sharp child. Simply pass the sharp prop to whatever component. It's entirely up to you!
18
+
19
+ ```typescript
20
+ <Card variant="primary" title="Notifications">
21
+ <div className="flex flex-col gap-3">
22
+ <div className="flex items-center justify-between">
23
+ <span>Email notifications</span>
24
+ <Toggle sharp />
25
+ </div>
26
+ <div className="flex items-center justify-between">
27
+ <span>Push notifications</span>
28
+ <Toggle sharp />
29
+ </div>
30
+ <div className="flex items-center justify-between">
31
+ <span>SMS alerts</span>
32
+ <Toggle sharp />
33
+ </div>
34
+ </div>
35
+ ```
36
+
37
+ <img alt='custom-card' src='./src/assets/images/CurveSharp.png' width='400px' height='200px' />
38
+
39
+ ### Want to use your own colour? No problem
40
+
41
+ Simply pass in your custom colour and let the component handle the rest
42
+
43
+ ```typescript
44
+ <Button customColour='#e60076' sharp>
45
+ Custom Button
46
+ </Button>
47
+ ```
48
+
49
+ <img alt='custom-button' src='./src/assets/images/CustomButton.png' width='250px' height='250px' />
@@ -0,0 +1,27 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react");function K(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,s.get?s:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const x=K(m);function H(t){var r,e,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(r=0;r<l;r++)t[r]&&(e=H(t[r]))&&(s&&(s+=" "),s+=e)}else for(e in t)t[e]&&(s&&(s+=" "),s+=e);return s}function Y(){for(var t,r,e=0,s="",l=arguments.length;e<l;e++)(t=arguments[e])&&(r=H(t))&&(s&&(s+=" "),s+=r);return s}const V=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,P=Y,u=(t,r)=>e=>{var s;if((r==null?void 0:r.variants)==null)return P(t,e==null?void 0:e.class,e==null?void 0:e.className);const{variants:l,defaultVariants:n}=r,o=Object.keys(l).map(i=>{const b=e==null?void 0:e[i],d=n==null?void 0:n[i];if(b===null)return null;const p=V(b)||V(d);return l[i][p]}),f=e&&Object.entries(e).reduce((i,b)=>{let[d,p]=b;return p===void 0||(i[d]=p),i},{}),c=r==null||(s=r.compoundVariants)===null||s===void 0?void 0:s.reduce((i,b)=>{let{class:d,className:p,...g}=b;return Object.entries(g).every(h=>{let[y,v]=h;return Array.isArray(v)?v.includes({...n,...f}[y]):{...n,...f}[y]===v})?[...i,d,p]:i},[]);return P(t,o,c,e==null?void 0:e.class,e==null?void 0:e.className)};function J({title:t,titleId:r,...e},s){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},e),t?x.createElement("title",{id:r},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const L=x.forwardRef(J);function Q({title:t,titleId:r,...e},s){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},e),t?x.createElement("title",{id:r},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const Z=x.forwardRef(Q),ee=u("w-full bg-gray-500 text-white overflow-hidden",{variants:{variant:{primary:"bg-emerald-500",secondary:"bg-violet-700",tertiary:"bg-blue-500"},sharp:{true:"rounded-none",false:"rounded-lg border"}},compoundVariants:[{sharp:!1,variant:"primary",className:"border-emerald-500"},{sharp:!1,variant:"secondary",className:"border-violet-700"},{sharp:!1,variant:"tertiary",className:"border-blue-500"}],defaultVariants:{sharp:!1,variant:"primary"}}),ae=u("w-full flex list-none cursor-pointer select-none items-center justify-between px-4 py-3 font-semibold [&::-webkit-details-marker]:hidden",{variants:{variant:{primary:"bg-emerald-500",secondary:"bg-violet-700",tertiary:"bg-blue-500"}},defaultVariants:{variant:"primary"}}),re=u("border-l-4 px-4 pb-4 pt-3 text-gray-300 bg-gray-500",{variants:{variant:{primary:"border-l-emerald-500",secondary:"border-l-violet-700",tertiary:"border-l-blue-500"}},defaultVariants:{variant:"primary"}}),te=u("block p-px",{variants:{variant:{primary:"bg-emerald-500",secondary:"bg-violet-700",tertiary:"bg-blue-500"}},defaultVariants:{variant:"primary"}}),A="polygon(22px 0%, 100% 0%, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0% 100%, 0% 22px)",$=m.forwardRef(({className:t,sharp:r,variant:e,title:s,children:l,defaultOpen:n,customColour:o,...f},c)=>{const i=a.jsxs("details",{ref:c,open:n,className:`group ${ee({sharp:r,variant:e,className:t})}`,style:r?{clipPath:A}:{borderColor:o},...f,children:[a.jsxs("summary",{className:ae({variant:e}),style:{backgroundColor:o},children:[a.jsx("span",{children:s}),a.jsx(L,{"aria-hidden":"true",className:"h-5 w-5 flex-shrink-0 transition-transform duration-200 group-open:rotate-180"})]}),a.jsx("div",{className:re({variant:e}),style:{borderLeftColor:o},children:l})]});return r?a.jsx("div",{className:te({variant:e}),style:{backgroundColor:o,clipPath:A},children:i}):i});$.displayName="Accordion";const se=u("flex justify-center items-center p-3",{variants:{variant:{complete:"bg-emerald-500",info:"bg-blue-500",secondary:"bg-violet-700",danger:"bg-red-500"},sharp:{true:"",false:"rounded-l-2xl"}},defaultVariants:{variant:"complete",sharp:!1}}),ne=u("px-4 py-2",{variants:{variant:{complete:"bg-emerald-500",info:"bg-blue-500",secondary:"bg-violet-700",danger:"bg-red-500"},sharp:{true:"",false:"rounded-tr-2xl"}},defaultVariants:{variant:"complete",sharp:!1}}),le=u("bg-gray-500 flex-1",{variants:{sharp:{true:"",false:"rounded-r-2xl"}},defaultVariants:{sharp:!1}}),ie="polygon(20px 0%, 100% 0%, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0% 100%, 0% 20px)";function oe({variant:t,sharp:r,alertIcon:e,headingText:s,bodyText:l,customColour:n}){const o=n?{backgroundColor:n}:void 0;return a.jsxs("div",{role:"alert",className:"flex max-w-[600px]",style:r?{clipPath:ie}:void 0,children:[a.jsx("div",{className:se({variant:t,sharp:r}),style:o,children:a.jsx("span",{"aria-hidden":"true",children:e})}),a.jsxs("div",{className:le({sharp:r}),children:[a.jsx("div",{className:ne({variant:t,sharp:r}),style:o,children:a.jsx("span",{className:"text-white text-lg font-semibold",children:s})}),a.jsx("div",{className:"p-4",children:a.jsx("p",{className:"text-slate-200",children:l})})]})]})}const de=u("relative inline-block shrink-0",{variants:{sharp:{true:"rounded-none",false:"rounded-full"}},defaultVariants:{sharp:!1}}),ce=u("w-full h-full object-cover",{variants:{sharp:{true:"rounded-none",false:"rounded-full"}},defaultVariants:{sharp:!1}}),ue=u("absolute block border border-gray-900",{variants:{status:{online:"bg-emerald-500",away:"bg-amber-400",offline:"bg-red-500"},sharp:{true:"rounded-none top-[-5px] right-[-5px]",false:"rounded-full top-0 right-0"}},defaultVariants:{sharp:!1}}),E=m.forwardRef(({sharp:t,status:r,size:e=48,src:s,alt:l,className:n,customColour:o,...f},c)=>{const i=Math.max(8,Math.round(e*.22));return a.jsxs("div",{className:de({sharp:t,className:n}),style:{width:e,height:e},children:[a.jsx("img",{ref:c,src:s,alt:l??"avatar",className:ce({sharp:t}),style:{width:e,height:e},...f}),r&&a.jsx("span",{role:"img","aria-label":r,className:ue({status:r,sharp:t}),style:{width:i,height:i,...o?{backgroundColor:o}:{}}})]})});E.displayName="Avatar";const fe=u("inline-flex items-center justify-center font-semibold",{variants:{variant:{primary:"bg-emerald-500 text-white",secondary:"bg-violet-700 text-white",tertiary:"bg-blue-500 text-white",danger:"bg-red-500 text-white"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},sharp:{true:"rounded-none",false:"rounded-full"}},defaultVariants:{variant:"primary",size:"md",sharp:!1}}),pe="polygon(6px 0%, 100% 0%, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0% 100%, 0% 6px)",M=m.forwardRef(({className:t,variant:r,size:e,sharp:s,children:l,style:n,customColour:o,...f},c)=>{const i=o?{backgroundColor:o}:void 0;return a.jsx("span",{ref:c,className:fe({variant:r,size:e,sharp:s,className:t}),style:s?{clipPath:pe,...i,...n}:{...i,...n},...f,children:l})});M.displayName="Badge";const be=u(`font-semibold transition-colors focus:outline-none focus-visible:outline-none
2
+ focus:ring-2 focus:ring-gray-900 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center gap-2`,{variants:{variant:{primary:"",secondary:"",tertiary:"",ghost:"bg-transparent text-slate-200 hover:bg-gray-600",danger:""},size:{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg"},sharp:{true:"rounded-none active:opacity-75",false:"rounded-lg"},outline:{true:"border",false:"border-transparent"}},compoundVariants:[{outline:!0,sharp:!1,className:"bg-transparent"},{outline:!0,sharp:!0,className:"bg-gray-950 border-transparent hover:bg-gray-800"},{outline:!0,variant:"primary",className:"text-emerald-500 border-emerald-500 hover:border-emerald-500/75"},{outline:!0,variant:"secondary",className:"text-violet-700 border-violet-700 hover:border-violet-700/75"},{outline:!0,variant:"tertiary",className:"text-blue-500 border-blue-500 hover:border-blue-500/75"},{outline:!0,variant:"danger",className:"text-red-500 border-red-500 hover:border-red-500/75"},{outline:!1,variant:"primary",className:"bg-emerald-500 text-white hover:bg-emerald-600"},{outline:!1,variant:"secondary",className:"bg-violet-700 text-white hover:bg-violet-800"},{outline:!1,variant:"tertiary",className:"bg-blue-500 text-white hover:bg-blue-600"},{outline:!1,variant:"danger",className:"bg-red-500 text-white hover:bg-red-600"}],defaultVariants:{variant:"primary",size:"md",sharp:!1,outline:!1}}),me=u("inline-block p-px",{variants:{variant:{primary:"bg-emerald-500",secondary:"bg-violet-700",tertiary:"bg-blue-500",ghost:"bg-slate-400",danger:"bg-red-500"}},defaultVariants:{variant:"primary"}}),R="polygon(10px 0%, 100% 0%, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0% 100%, 0% 10px)",O=m.forwardRef(({className:t,variant:r,size:e,sharp:s,outline:l,icon:n,iconPosition:o="left",children:f,style:c,customColor:i,...b},d)=>{const p=i?{backgroundColor:i}:void 0,g=i?{borderColor:i,color:i}:void 0,h=a.jsxs("button",{ref:d,className:be({variant:r,size:e,sharp:s,outline:l,className:t}),style:s?{clipPath:R,...l?g:p,...c}:{...l?g:p,...c},...b,children:[n&&o==="left"&&a.jsx("span",{className:"inline-flex","aria-hidden":"true",children:n}),f,n&&o==="right"&&a.jsx("span",{className:"inline-flex","aria-hidden":"true",children:n})]});return s&&l?a.jsx("div",{className:me({variant:r}),style:{clipPath:R,...i?{backgroundColor:i}:{}},children:h}):h});O.displayName="Button";const ge=u(`w-full py-2 bg-white dark:bg-gray-900 border text-gray-800 dark:text-gray-400
3
+ transition-colors placeholder:text-gray-500
4
+ focus:outline-none disabled:cursor-not-allowed disabled:opacity-50`,{variants:{variant:{primary:"",secondary:"",tertiary:""},error:{true:"border-red-500",false:""},sharp:{true:"rounded-none",false:"rounded-lg"},iconLeft:{true:"pl-10 pr-4",false:"pr-10 pl-4"}},compoundVariants:[{variant:"primary",error:!1,className:"border-emerald-700 focus:ring-2 focus:ring-emerald-500"},{variant:"secondary",error:!1,className:"border-violet-700 focus:ring-2 focus:ring-violet-500"},{variant:"tertiary",error:!1,className:"border-blue-700 focus:ring-2 focus:ring-blue-500"}],defaultVariants:{variant:"primary",error:!1,sharp:!1,iconLeft:!1}}),_="polygon(0% 0%, 100% 0%, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0% 100%)",ye=u("inline-block p-px",{variants:{variant:{primary:"",secondary:"",tertiary:""},error:{true:"bg-red-500",false:""}},compoundVariants:[{variant:"primary",error:!1,className:"bg-emerald-700 focus-within:bg-emerald-500"},{variant:"secondary",error:!1,className:"bg-violet-700 focus-within:bg-violet-500"},{variant:"tertiary",error:!1,className:"bg-blue-700 focus-within:bg-blue-500"}],defaultVariants:{variant:"primary",error:!1}}),z=m.forwardRef(({className:t,variant:r,error:e,sharp:s,iconLeft:l,icon:n,placeholder:o,style:f,label:c,...i},b)=>{const d=n!=null,p=a.jsx("input",{ref:b,placeholder:o,"aria-invalid":e===!0?!0:void 0,className:ge({variant:r,error:e,sharp:s,iconLeft:d?l:void 0,className:t}),style:s?{clipPath:_,...f}:f,...i}),g=d&&a.jsx("span",{"aria-hidden":"true",className:`absolute top-1/2 -translate-y-1/2 text-gray-500 pointer-events-none ${l?"left-3":"right-3"}`,children:n}),h=d?a.jsxs("div",{className:"relative flex items-center",children:[p,g]}):p;return s?a.jsxs("label",{className:"flex flex-col gap-0",children:[a.jsx("span",{className:"text-gray-800 dark:text-gray-300",children:c}),a.jsx("div",{className:ye({variant:r,error:e}),style:{clipPath:_},children:h})]}):a.jsxs("label",{children:[a.jsx("span",{className:"text-gray-800 dark:text-gray-300",children:c}),h]})});z.displayName="Input";const C={primary:"#10b981",secondary:"#8b5cf6",tertiary:"#3b82f6"},he={sm:"h-1.5",md:"h-3",lg:"h-5"},xe={sm:64,md:96,lg:128},B=m.forwardRef(({className:t,variant:r="primary",size:e="md",sharp:s=!1,value:l,type:n="bar",showLabel:o=!1,customColour:f,style:c,...i},b)=>{const d=Math.max(0,Math.min(100,l)),p=f??C[r??"primary"]??C.primary;if(n==="circular"){const y=xe[e??"md"],v=Math.max(6,Math.round(y*.1)),w=(y-v)/2,k=2*Math.PI*w,G=k*(1-d/100),N=y/2;return a.jsxs("div",{ref:b,role:"progressbar","aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":100,className:`relative inline-flex items-center justify-center${t?` ${t}`:""}`,style:{width:y,height:y,...c},...i,children:[a.jsxs("svg",{width:y,height:y,style:{transform:"rotate(-90deg)"},children:[a.jsx("circle",{cx:N,cy:N,r:w,fill:"none",stroke:"#1f2937",strokeWidth:v}),a.jsx("circle",{cx:N,cy:N,r:w,fill:"none",stroke:p,strokeWidth:v,strokeDasharray:k,strokeDashoffset:G,strokeLinecap:s?"butt":"round",style:{transition:"stroke-dashoffset 0.5s ease"}})]}),o&&a.jsxs("span",{className:"absolute text-gray-800 dark:text-gray-300 font-semibold tabular-nums",style:{fontSize:Math.round(y*.2)},children:[d,"%"]})]})}const g=he[e??"md"],h=s?"rounded-none":"rounded-full";return a.jsxs("div",{ref:b,className:`flex items-center gap-2${t?` ${t}`:""}`,style:c,...i,children:[a.jsx("div",{role:"progressbar","aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":100,className:`flex-1 overflow-hidden bg-gray-700 ${g} ${h}`,children:a.jsx("div",{className:`h-full ${h} transition-all duration-500`,style:{width:`${d}%`,backgroundColor:p}})}),o&&a.jsxs("span",{className:"text-sm text-gray-800 dark:text-gray-300 tabular-nums min-w-[3ch] text-right",children:[d,"%"]})]})});B.displayName="Progress";const ve=u(`w-full pl-4 pr-10 py-2 text-base bg-white dark:bg-gray-900 border text-gray-800 dark:text-gray-400 appearance-none
5
+ transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50`,{variants:{error:{true:"border-red-500",false:"border-emerald-700 focus:ring-2 focus:ring-emerald-500"},sharp:{true:"rounded-none",false:"rounded-lg"}},defaultVariants:{error:!1,sharp:!1}}),Ne=u("inline-block p-px",{variants:{error:{true:"bg-red-500",false:"bg-emerald-700 focus-within:bg-emerald-500"}},defaultVariants:{error:!1}}),j="polygon(0% 0%, 100% 0%, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0% 100%)",D=m.forwardRef(({className:t,error:r,sharp:e,label:s,customColour:l,style:n,children:o,...f},c)=>{const i=a.jsxs("div",{className:"relative",children:[a.jsx("select",{ref:c,"aria-invalid":r===!0?!0:void 0,className:ve({error:r,sharp:e,className:t}),style:e?{clipPath:j,...n}:{borderColor:l,...n},...f,children:o}),a.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",children:a.jsx(L,{className:"w-4 h-4"})})]});return e?a.jsxs("label",{className:"flex flex-col gap-0",children:[a.jsx("span",{className:"text-gray-800 dark:text-gray-300",children:s}),a.jsx("div",{className:Ne({error:r}),style:l?{backgroundColor:l,clipPath:j}:{clipPath:j},children:i})]}):a.jsxs("label",{className:"flex flex-col gap-0",children:[a.jsx("span",{className:"text-gray-800 dark:text-gray-300",children:s}),i]})});D.displayName="Select";const T={primary:"#10b981",secondary:"#8b5cf6",tertiary:"#3b82f6"},we=u(`w-full h-2 appearance-none cursor-pointer
6
+ bg-gray-700
7
+ [&::-webkit-slider-thumb]:appearance-none
8
+ [&::-webkit-slider-thumb]:h-4
9
+ [&::-webkit-slider-thumb]:w-4
10
+ [&::-webkit-slider-thumb]:cursor-pointer
11
+ [&::-webkit-slider-thumb]:bg-[var(--slider-color)]
12
+ [&::-webkit-slider-thumb]:transition-transform
13
+ [&::-webkit-slider-thumb]:hover:scale-110
14
+ [&::-moz-range-thumb]:border-none
15
+ [&::-moz-range-thumb]:h-4
16
+ [&::-moz-range-thumb]:w-4
17
+ [&::-moz-range-thumb]:cursor-pointer
18
+ [&::-moz-range-thumb]:bg-[var(--slider-color)]
19
+ [&::-moz-range-progress]:bg-[var(--slider-color)]
20
+ [&::-moz-range-progress]:h-2
21
+ disabled:opacity-50 disabled:cursor-not-allowed`,{variants:{variant:{primary:"",secondary:"",tertiary:""},sharp:{true:"rounded-none [&::-webkit-slider-thumb]:rounded-none [&::-moz-range-thumb]:rounded-none",false:"rounded-full [&::-webkit-slider-thumb]:rounded-full [&::-moz-range-thumb]:rounded-full"}},defaultVariants:{variant:"primary",sharp:!1}}),W=m.forwardRef(({className:t,variant:r="primary",sharp:e,label:s,customColour:l,style:n,...o},f)=>{const c=l??T[r??"primary"]??T.primary;return a.jsxs("label",{className:"flex flex-col gap-2",children:[a.jsx("span",{className:"text-sm text-gray-800 dark:text-gray-300",children:s}),a.jsx("input",{...o,type:"range",ref:f,className:we({variant:r,sharp:e,className:t}),style:{"--slider-color":c,accentColor:c,...n}})]})});W.displayName="Slider";const je=u(`w-full px-4 py-2 bg-white dark:bg-gray-900 border text-gray-800 dark:text-gray-400 resize-none
22
+ transition-colors placeholder:text-gray-500
23
+ focus:outline-none disabled:cursor-not-allowed disabled:opacity-50`,{variants:{variant:{primary:"",secondary:"",tertiary:""},error:{true:"border-red-500",false:""},sharp:{true:"rounded-none",false:"rounded-lg"}},compoundVariants:[{variant:"primary",error:!1,className:"border-emerald-700 focus:ring-2 focus:ring-emerald-500"},{variant:"secondary",error:!1,className:"border-violet-700 focus:ring-2 focus:ring-violet-500"},{variant:"tertiary",error:!1,className:"border-blue-700 focus:ring-2 focus:ring-blue-500"}],defaultVariants:{variant:"primary",error:!1,sharp:!1}}),ke=u("block p-px",{variants:{variant:{primary:"",secondary:"",tertiary:""},error:{true:"bg-red-500",false:""}},compoundVariants:[{variant:"primary",error:!1,className:"bg-emerald-700 focus-within:bg-emerald-500"},{variant:"secondary",error:!1,className:"bg-violet-700 focus-within:bg-violet-500"},{variant:"tertiary",error:!1,className:"bg-blue-700 focus-within:bg-blue-500"}],defaultVariants:{variant:"primary",error:!1}}),S="polygon(0% 0%, 100% 0%, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0% 100%)",X=m.forwardRef(({className:t,variant:r,error:e,sharp:s,label:l,style:n,...o},f)=>{const c=a.jsx("textarea",{ref:f,rows:4,"aria-invalid":e===!0?!0:void 0,className:je({variant:r,error:e,sharp:s,className:t}),style:s?{clipPath:S,...n}:n,...o});return s?a.jsxs("label",{className:"flex flex-col gap-0",children:[a.jsx("span",{className:"text-gray-800 dark:text-gray-300",children:l}),a.jsx("div",{className:ke({variant:r,error:e}),style:{clipPath:S},children:c})]}):a.jsxs("label",{className:"flex flex-col gap-0",children:[a.jsx("span",{className:"text-gray-800 dark:text-gray-300",children:l}),c]})});X.displayName="TextArea";const Ve=u("group relative inline-flex w-11 shrink-0 bg-gray-500 p-0.5 shadow-inner outline-offset-2 transition-colors duration-200 ease-in-out has-[:focus-visible]:outline-2",{variants:{variant:{primary:"has-[:checked]:bg-emerald-500 outline-emerald-500",secondary:"has-[:checked]:bg-violet-700 outline-violet-700",tertiary:"has-[:checked]:bg-blue-500 outline-blue-500"},sharp:{true:"rounded-none",false:"rounded-full"}},defaultVariants:{variant:"primary",sharp:!1}}),Pe=u("size-5 rounded-full bg-white shadow-sm ring-1 ring-gray-900/5 transition-transform duration-200 ease-in-out group-has-[:checked]:translate-x-5",{variants:{sharp:{true:"rounded-none",false:"rounded-full"}},defaultVariants:{sharp:!1}}),U=m.forwardRef(({variant:t,sharp:r,customColour:e,"aria-label":s,...l},n)=>a.jsxs("div",{className:`${Ve({variant:t,sharp:r})}${e?" has-[:checked]:[background-color:var(--toggle-color)]":""}`,style:e?{"--toggle-color":e}:void 0,children:[a.jsx("span",{"aria-hidden":"true",className:Pe({sharp:r})}),a.jsx("input",{ref:n,name:"track",type:"checkbox","aria-label":s??"Toggle",className:"absolute inset-0 size-full appearance-none focus:outline-hidden",...l})]}));U.displayName="Toggle";const Ae=u("w-full text-white overflow-hidden",{variants:{variant:{primary:"bg-emerald-500",secondary:"bg-violet-700",tertiary:"bg-blue-500"},sharp:{true:"rounded-none",false:"rounded-lg border"}},compoundVariants:[{sharp:!1,variant:"primary",className:"border-emerald-500"},{sharp:!1,variant:"secondary",className:"border-violet-700"},{sharp:!1,variant:"tertiary",className:"border-blue-500"}],defaultVariants:{sharp:!1,variant:"primary"}}),Re=u("w-full px-4 py-3 font-semibold text-white",{variants:{variant:{primary:"bg-emerald-500",secondary:"bg-violet-700",tertiary:"bg-blue-500"}}}),_e=u("border-l-4 px-4 py-4 text-slate-200 bg-gray-500",{variants:{variant:{primary:"border-l-emerald-500",secondary:"border-l-violet-700",tertiary:"border-l-blue-500"}},defaultVariants:{variant:"primary"}}),Ce=u("block p-px",{variants:{variant:{primary:"bg-emerald-500",secondary:"bg-violet-700",tertiary:"bg-blue-500"}},defaultVariants:{variant:"primary"}}),I="polygon(22px 0%, 100% 0%, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0% 100%, 0% 22px)",q=m.forwardRef(({className:t,sharp:r,variant:e,title:s,children:l,customColour:n,...o},f)=>{const c=a.jsxs("div",{ref:f,className:Ae({sharp:r,variant:e,className:t}),style:r?{clipPath:I}:{borderColor:n},...o,children:[a.jsx("div",{className:Re({variant:e}),style:{backgroundColor:n},children:a.jsx("span",{className:"text-lg",children:s})}),a.jsx("div",{className:_e({variant:e}),style:{borderLeftColor:n},children:l})]});return r?a.jsx("div",{className:Ce({variant:e}),style:{backgroundColor:n,clipPath:I},children:c}):c});q.displayName="Card";const Te=u("flex items-center justify-between px-6 py-4 flex-shrink-0",{variants:{variant:{primary:"bg-emerald-500",secondary:"bg-violet-700",tertiary:"bg-blue-500"}},defaultVariants:{variant:"primary"}}),Se=u(`open:flex open:flex-col p-0 border-none outline-none
24
+ bg-gray-500
25
+ w-full max-w-lg
26
+ shadow-2xl
27
+ backdrop:bg-black/60`,{variants:{sharp:{true:"rounded-none",false:"rounded-xl overflow-hidden"}},defaultVariants:{sharp:!1}}),Ie="polygon(20px 0%, 100% 0%, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0% 100%, 0% 20px)",F=({open:t,onClose:r,title:e,children:s,variant:l,sharp:n,customColour:o})=>{const f=m.useRef(null),c=m.useId();m.useEffect(()=>{const d=f.current;d&&(t&&!d.open?d.showModal():!t&&d.open&&d.close())},[t]);const i=d=>{var g;const p=(g=f.current)==null?void 0:g.getBoundingClientRect();p&&(d.clientX<p.left||d.clientX>p.right||d.clientY<p.top||d.clientY>p.bottom)&&r()},b=o?{backgroundColor:o}:void 0;return a.jsx("dialog",{ref:f,"aria-labelledby":c,onClick:i,onCancel:d=>{d.preventDefault(),r()},className:Se({sharp:n}),style:n?{clipPath:Ie}:void 0,children:a.jsxs("div",{onClick:d=>d.stopPropagation(),className:"flex flex-col",children:[a.jsxs("header",{className:Te({variant:l}),style:b,children:[a.jsx("h2",{id:c,className:"text-white font-semibold",children:e}),a.jsx("button",{onClick:r,className:"text-white/70 hover:text-white transition-colors ml-4 flex-shrink-0","aria-label":"Close modal",children:a.jsx(Z,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"px-6 py-5 text-gray-300",children:s})]})})};F.displayName="Modal";exports.Accordion=$;exports.Alert=oe;exports.Avatar=E;exports.Badge=M;exports.Button=O;exports.Card=q;exports.Input=z;exports.Modal=F;exports.Progress=B;exports.Select=D;exports.Slider=W;exports.TextArea=X;exports.Toggle=U;