@adam-milo/ui 1.0.31 → 1.0.32
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/index.cjs +1 -1
- package/dist/index.js +5 -3
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +28 -27
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +25 -35
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +53 -12
- package/dist/index22.cjs +1 -0
- package/dist/index22.js +14 -0
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +1 -1
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +14 -14
- package/dist/src/components/layout/divider/Divider.component.d.ts +39 -0
- package/dist/src/components/layout/divider/Divider.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/dist/index23.cjs +0 -1
- package/dist/index23.js +0 -22
- package/dist/index28.cjs +0 -1
- package/dist/index28.js +0 -1193
- package/dist/index44.cjs +0 -1
- package/dist/index44.js +0 -6
- package/dist/index45.cjs +0 -1
- package/dist/index45.js +0 -11
- package/dist/index46.cjs +0 -1
- package/dist/index46.js +0 -70
- package/dist/index47.cjs +0 -1
- package/dist/index47.js +0 -39
- package/dist/index48.cjs +0 -1
- package/dist/index48.js +0 -64
- package/dist/index49.cjs +0 -1
- package/dist/index49.js +0 -10
- package/dist/index50.cjs +0 -1
- package/dist/index50.js +0 -212
- package/dist/index51.cjs +0 -1
- package/dist/index51.js +0 -29
- package/dist/index52.cjs +0 -1
- package/dist/index52.js +0 -208
- package/dist/index53.cjs +0 -1
- package/dist/index53.js +0 -14
- package/dist/index54.cjs +0 -1
- package/dist/index54.js +0 -293
- package/dist/index55.cjs +0 -1
- package/dist/index55.js +0 -18
- package/dist/index56.cjs +0 -1
- package/dist/index56.js +0 -43
- package/dist/index57.cjs +0 -1
- package/dist/index57.js +0 -89
- package/dist/index58.cjs +0 -1
- package/dist/index58.js +0 -14
- package/dist/index59.cjs +0 -1
- package/dist/index59.js +0 -71
- package/dist/index60.cjs +0 -1
- package/dist/index60.js +0 -6
- package/dist/index61.cjs +0 -1
- package/dist/index61.js +0 -14
- package/dist/index62.cjs +0 -1
- package/dist/index62.js +0 -34
- package/dist/index63.cjs +0 -1
- package/dist/index63.js +0 -122
- package/dist/index64.cjs +0 -1
- package/dist/index64.js +0 -11
- package/dist/index65.cjs +0 -1
- package/dist/index65.js +0 -17
- package/dist/index66.cjs +0 -1
- package/dist/index66.js +0 -297
- package/dist/index67.cjs +0 -1
- package/dist/index67.js +0 -25
- package/dist/index68.cjs +0 -1
- package/dist/index68.js +0 -39
- package/dist/index69.cjs +0 -1
- package/dist/index69.js +0 -625
- package/dist/index70.cjs +0 -1
- package/dist/index70.js +0 -39
- package/dist/index71.cjs +0 -1
- package/dist/index71.js +0 -38
- package/dist/index72.cjs +0 -1
- package/dist/index72.js +0 -7
- package/dist/index73.cjs +0 -1
- package/dist/index73.js +0 -10
- package/dist/index74.cjs +0 -1
- package/dist/index74.js +0 -5
- package/dist/index75.cjs +0 -1
- package/dist/index75.js +0 -35
- package/dist/index76.cjs +0 -1
- package/dist/index76.js +0 -180
- package/dist/index77.cjs +0 -1
- package/dist/index77.js +0 -21
- package/dist/index78.cjs +0 -1
- package/dist/index78.js +0 -721
- package/dist/index79.cjs +0 -1
- package/dist/index79.js +0 -154
- package/dist/index80.cjs +0 -1
- package/dist/index80.js +0 -173
- package/dist/index81.cjs +0 -1
- package/dist/index81.js +0 -47
- package/dist/index82.cjs +0 -1
- package/dist/index82.js +0 -13
- package/dist/index83.cjs +0 -1
- package/dist/index83.js +0 -19
- package/dist/index84.cjs +0 -1
- package/dist/index84.js +0 -102
- package/dist/index85.cjs +0 -1
- package/dist/index85.js +0 -88
- package/dist/index86.cjs +0 -1
- package/dist/index86.js +0 -11
- package/dist/index87.cjs +0 -1
- package/dist/index87.js +0 -29
- package/dist/index88.cjs +0 -1
- package/dist/index88.js +0 -37
- package/dist/index89.cjs +0 -1
- package/dist/index89.js +0 -16
- package/dist/index90.cjs +0 -1
- package/dist/index90.js +0 -48
- package/dist/index91.cjs +0 -1
- package/dist/index91.js +0 -9
- /package/dist/{index36.cjs → index35.cjs} +0 -0
- /package/dist/{index36.js → index35.js} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs"),r=require("./index3.cjs"),t=require("./index4.cjs"),o=require("./index5.cjs"),i=require("./index6.cjs"),s=require("./index7.cjs"),a=require("./index8.cjs"),p=require("./index9.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs"),r=require("./index3.cjs"),t=require("./index4.cjs"),o=require("./index5.cjs"),i=require("./index6.cjs"),s=require("./index7.cjs"),a=require("./index8.cjs"),p=require("./index9.cjs"),x=require("./index10.cjs"),n=require("./index11.cjs"),l=require("./index12.cjs"),c=require("./index13.cjs"),d=require("./index14.cjs"),u=require("./index15.cjs"),g=require("./index16.cjs"),C=require("./index17.cjs"),D=require("./index18.cjs"),j=require("./index19.cjs"),T=require("./index20.cjs"),b=require("./index21.cjs"),q=require("./index22.cjs"),S=require("@adam-milo/icons");exports.Button=e.Button,exports.EmailInput=r.EmailInput,exports.PasswordInput=t.PasswordInput,exports.NumericInput=o.NumericInput,exports.AlphanumericInput=i.AlphanumericInput,exports.Checkbox=s.Checkbox,exports.Radio=a.Radio,exports.Select=p.Select,exports.SelectContent=p.SelectContent,exports.SelectGroup=p.SelectGroup,exports.SelectItem=p.SelectItem,exports.SelectLabel=p.SelectLabel,exports.SelectSeparator=p.SelectSeparator,exports.SelectTrigger=p.SelectTrigger,exports.SelectValue=p.SelectValue,exports.Tabs=x.Tabs,exports.TabsContent=x.TabsContent,exports.TabsList=x.TabsList,exports.TabsTrigger=x.TabsTrigger,exports.Alert=n.Alert,exports.Card=l.Card,exports.CardContent=l.CardContent,exports.CardDescription=l.CardDescription,exports.CardFooter=l.CardFooter,exports.CardHeader=l.CardHeader,exports.CardTitle=l.CardTitle,exports.DataTable=c.DataTable,exports.Chip=d.Chip,exports.ChipGroup=u.ChipGroup,exports.Dialog=g.Dialog,exports.DialogClose=g.DialogClose,exports.DialogContent=g.DialogContent,exports.DialogDescription=g.DialogDescription,exports.DialogFooter=g.DialogFooter,exports.DialogHeader=g.DialogHeader,exports.DialogOverlay=g.DialogOverlay,exports.DialogPortal=g.DialogPortal,exports.DialogTitle=g.DialogTitle,exports.DialogTrigger=g.DialogTrigger,exports.Stack=C.Stack,exports.Container=D.Container,exports.Divider=j.Divider,exports.Text=T.Text,exports.Grid=b.Grid,exports.cn=q.cn,exports.generateId=q.generateId,Object.defineProperty(exports,"Icon",{enumerable:!0,get:()=>S.Icon}),Object.defineProperty(exports,"availableIcons",{enumerable:!0,get:()=>S.availableIcons});
|
package/dist/index.js
CHANGED
|
@@ -15,9 +15,10 @@ import { ChipGroup } from "./index15.js";
|
|
|
15
15
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./index16.js";
|
|
16
16
|
import { Stack } from "./index17.js";
|
|
17
17
|
import { Container } from "./index18.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import { Divider } from "./index19.js";
|
|
19
|
+
import { Text } from "./index20.js";
|
|
20
|
+
import { Grid } from "./index21.js";
|
|
21
|
+
import { cn, generateId } from "./index22.js";
|
|
21
22
|
import { Icon, availableIcons } from "@adam-milo/icons";
|
|
22
23
|
export {
|
|
23
24
|
Alert,
|
|
@@ -44,6 +45,7 @@ export {
|
|
|
44
45
|
DialogPortal,
|
|
45
46
|
DialogTitle,
|
|
46
47
|
DialogTrigger,
|
|
48
|
+
Divider,
|
|
47
49
|
EmailInput,
|
|
48
50
|
Grid,
|
|
49
51
|
Icon,
|
package/dist/index10.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),a=require("@radix-ui/react-tabs"),s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),a=require("@radix-ui/react-tabs"),s=require("./index22.cjs");function r(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const a in t)if("default"!==a){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>t[a]})}return e.default=t,Object.freeze(e)};/* empty css */const i=r(a),n=i.Root,c=e.forwardRef(({className:e,"data-cy":a,"data-testid":r,...n},c)=>{const o=a||"tabs-list",d=r||"tabs-list";return t.jsx(i.List,{ref:c,className:s.cn("tabs-list",e),"data-cy":o,"data-testid":d,...n})});c.displayName=i.List.displayName;const o=e.forwardRef(({className:e,value:a,"data-cy":r,"data-testid":n,...c},o)=>{const d=r||(a?`tabs-trigger-${a}`:"tabs-trigger"),l=n||(a?`tabs-trigger-${a}`:"tabs-trigger");return t.jsx(i.Trigger,{ref:o,className:s.cn("tabs-trigger",e),value:a,"data-cy":d,"data-testid":l,...c})});o.displayName=i.Trigger.displayName;const d=e.forwardRef(({className:e,value:a,"data-cy":r,"data-testid":n,...c},o)=>{const d=r||(a?`tabs-content-${a}`:"tabs-content"),l=n||(a?`tabs-content-${a}`:"tabs-content");return t.jsx(i.Content,{ref:o,className:s.cn("tabs-content",e),value:a,"data-cy":d,"data-testid":l,...c})});d.displayName=i.Content.displayName,exports.Tabs=n,exports.TabsContent=d,exports.TabsList=c,exports.TabsTrigger=o;
|
package/dist/index10.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4
|
-
import { cn } from "./
|
|
4
|
+
import { cn } from "./index22.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
const Tabs = TabsPrimitive.Root;
|
|
7
7
|
const TabsList = forwardRef(
|
package/dist/index11.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),a=require("./index22.cjs");;/* empty css */const r=e.forwardRef(({variant:e="info",title:r,icon:s,className:i,children:c,"data-cy":d,"data-testid":l,...n},o)=>{const u=d||`alert-${e}`,$=l||`alert-${e}`;return t.jsxs("div",{ref:o,role:{info:"status",success:"status",warning:"alert",error:"alert"}[e],className:a.cn("alert",`alert--${e}`,i),"data-cy":u,"data-testid":$,...n,children:[s&&t.jsx("div",{className:"alert__icon","data-cy":`${u}-icon`,"data-testid":`${$}-icon`,children:s}),t.jsxs("div",{className:"alert__content","data-cy":`${u}-content`,"data-testid":`${$}-content`,children:[r&&t.jsx("div",{className:"alert__title","data-cy":`${u}-title`,"data-testid":`${$}-title`,children:r}),t.jsx("div",{"data-cy":`${u}-message`,"data-testid":`${$}-message`,children:c})]})]})});r.displayName="Alert",exports.Alert=r;
|
package/dist/index11.js
CHANGED
package/dist/index12.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),e=require("./index22.cjs");;/* empty css */const r=t.forwardRef(({variant:t="default",className:r,children:d,"data-cy":c,"data-testid":s,...i},o)=>{const n=c||`card-${t}`,l=s||`card-${t}`;return a.jsx("div",{ref:o,className:e.cn("card",`card--${t}`,r),"data-cy":n,"data-testid":l,...i,children:d})});r.displayName="Card";const d=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-header",o=d||"card-header";return a.jsx("div",{ref:s,className:e.cn("card-header",t),"data-cy":i,"data-testid":o,...c})});d.displayName="CardHeader";const c=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-title",o=d||"card-title";return a.jsx("h3",{ref:s,className:e.cn("card-title",t),"data-cy":i,"data-testid":o,...c})});c.displayName="CardTitle";const s=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-description",o=d||"card-description";return a.jsx("p",{ref:s,className:e.cn("card-description",t),"data-cy":i,"data-testid":o,...c})});s.displayName="CardDescription";const i=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-content",o=d||"card-content";return a.jsx("div",{ref:s,className:e.cn("card-content",t),"data-cy":i,"data-testid":o,...c})});i.displayName="CardContent";const o=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-footer",o=d||"card-footer";return a.jsx("div",{ref:s,className:e.cn("card-footer",t),"data-cy":i,"data-testid":o,...c})});o.displayName="CardFooter",exports.Card=r,exports.CardContent=i,exports.CardDescription=s,exports.CardFooter=o,exports.CardHeader=d,exports.CardTitle=c;
|
package/dist/index12.js
CHANGED
package/dist/index13.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("react"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("react"),t=require("./index22.cjs");;/* empty css */const d=e.forwardRef(({columns:e,data:d,striped:r=!1,hoverable:l=!1,className:s,"data-cy":c,"data-testid":i,...y},o)=>{const b=c||"datatable",n=i||"datatable";return a.jsx("div",{className:"datatable-wrapper","data-cy":`${b}-wrapper`,"data-testid":`${n}-wrapper`,children:a.jsxs("table",{ref:o,className:t.cn("datatable",s),"data-cy":b,"data-testid":n,...y,children:[a.jsx("thead",{className:"datatable__head","data-cy":`${b}-head`,"data-testid":`${n}-head`,children:a.jsx("tr",{children:e.map(e=>a.jsx("th",{className:"datatable__header-cell","data-cy":`${b}-header-${e.key}`,"data-testid":`${n}-header-${e.key}`,children:e.header},e.key))})}),a.jsx("tbody",{"data-cy":`${b}-body`,"data-testid":`${n}-body`,children:0===d.length?a.jsx("tr",{children:a.jsx("td",{colSpan:e.length,className:"datatable__empty","data-cy":`${b}-empty`,"data-testid":`${n}-empty`,children:"No data available"})}):d.map((d,s)=>a.jsx("tr",{className:t.cn("datatable__body-row",l&&"datatable__body-row--hoverable",r&&"datatable__body-row--striped"),"data-cy":`${b}-row-${s}`,"data-testid":`${n}-row-${s}`,children:e.map(e=>a.jsx("td",{className:"datatable__body-cell","data-cy":`${b}-cell-${s}-${e.key}`,"data-testid":`${n}-cell-${s}-${e.key}`,children:String(d[e.key]??"")},e.key))},s))})]})})});d.displayName="DataTable",exports.DataTable=d;
|
package/dist/index13.js
CHANGED
package/dist/index14.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),i=require("./index22.cjs");;/* empty css */const r=a.forwardRef(({variant:a="primary",selected:r=!1,disabled:s=!1,className:t,children:c,"data-testid":d,"data-cy":l,...n},p)=>{const h=i.cn("chip",`chip--${a}`,r&&"chip--selected",s&&"chip--disabled",t);return e.jsx("div",{ref:p,className:h,"data-testid":d||`chip-${a}`,"data-cy":l||`chip-${a}`,"aria-selected":r,"aria-disabled":s,"aria-label":"string"==typeof c?c:void 0,...n,children:e.jsx("span",{className:"chip__label",children:c})})});r.displayName="Chip",exports.Chip=r;
|
package/dist/index14.js
CHANGED
package/dist/index15.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./index22.cjs"),a=require("./index14.cjs");;/* empty css */const i=require("./index35.cjs"),n=require("@adam-milo/icons"),l=(e,r,a,i,n)=>{const[l,o]=t.useState(e.length),u=t.useCallback(()=>{if(void 0!==n)return void o(Math.min(n,e.length));const t=r.current;if(!t)return;const l=t.clientWidth,u=parseFloat(getComputedStyle(document.documentElement).fontSize)||16,s=window.getComputedStyle(t),c=((e,t,r)=>{if(!e)return.5*t;const a=e.match(/^([\d.]+)(px|rem|em)?/);if(!a)return.5*t;const i=parseFloat(a[1]);switch(a[2]||"px"){case"px":return i;case"rem":return i*t;case"em":return i*r;default:return.5*t}})(s.gap,u,parseFloat(s.fontSize)||16),d=3.75*u;for(let r=0;r<e.length;r++){const t=e[r],n=a.current[r];n&&i.current.set(t.value,n.offsetWidth)}const p=((e,t,r,a,i)=>{let n=0,l=0;for(let o=0;o<e.length;o++){const u=e[o],s=t.get(u.value)||0;if(0===s){l++;break}const c=n+(o>0?a:0)+s;if(o<e.length-1){if(c+a+i>r&&l>0)break}else if(c>r&&l>0)break;n=c,l++}return Math.max(1,l)})(e,i.current,l,c,d);o(p)},[e,n,r,a,i]),s=((e,r)=>{const a=t.useRef();return t.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),t.useCallback((...t)=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>e(...t),r)},[e,r])})(u,100);t.useEffect(()=>{a.current.length>e.length&&(a.current=a.current.slice(0,e.length));const t=new Set(e.map(e=>e.value));if(i.current.forEach((e,r)=>{t.has(r)||i.current.delete(r)}),void 0===n){e.some(e=>!i.current.has(e.value))?o(e.length):setTimeout(u,0)}},[e,n,u,a,i]),t.useEffect(()=>{const e=r.current;if(!e)return;const t=new ResizeObserver(()=>{s()});return t.observe(e),setTimeout(u,0),()=>{t.disconnect()}},[u,s,r]);const c=e.slice(0,l),d=e.slice(l);return{visibleCount:l,visibleItems:c,hiddenItems:d,hasOverflow:d.length>0}},o=t.forwardRef(({items:o,selectedValue:u,onSelectionChange:s,removable:c=!1,onRemove:d,variant:p="primary",disabled:h=!1,maxVisible:v,className:m,"data-testid":f,"data-cy":g,...b},y)=>{const w=(o&&Array.isArray(o)?o:[]).filter(e=>null!=e&&"object"==typeof e),x=t.useRef(null),k=t.useRef([]),_=t.useRef(new Map),C=t.useRef(null),[E,j]=t.useState(!1),[N,$]=t.useState(!1),D=t.useRef([]),{visibleItems:S,hiddenItems:R,hasOverflow:I}=l(w,x,k,_,v),q=t.useCallback((e,t,r)=>{if(!h&&!t&&s){s(u===e?null:e,r)}},[h,u,s]),A=t.useCallback((e,t)=>{e.stopPropagation(),h||d&&d(t,e)},[h,d]),M=t.useCallback((e,t,r)=>{h||r||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),q(t,r,e))},[h,q]),P=t.useCallback(e=>{e.stopPropagation(),$(e=>!e),j(!1)},[]),T=t.useCallback((e,t)=>{var r,a,i,n;switch(e.key){case"ArrowDown":e.preventDefault(),t<R.length-1&&(null==(r=D.current[t+1])||r.focus());break;case"ArrowUp":e.preventDefault(),t>0&&(null==(a=D.current[t-1])||a.focus());break;case"Home":e.preventDefault(),null==(i=D.current[0])||i.focus();break;case"End":e.preventDefault(),null==(n=D.current[R.length-1])||n.focus()}},[R.length]),z=t.useRef(),L=t.useRef();return t.useEffect(()=>{z.current=e=>{C.current&&!C.current.contains(e.target)&&$(!1)},L.current=e=>{"Escape"===e.key&&$(!1)}}),t.useEffect(()=>{if(!N)return;const e=e=>{var t;return null==(t=z.current)?void 0:t.call(z,e)},t=e=>{var t;return null==(t=L.current)?void 0:t.call(L,e)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[N]),t.useEffect(()=>{if("development"===process.env.NODE_ENV&&w.length>0){const e=w.map(e=>e.value),t=new Set(e);e.length!==t.size&&i.devWarn("[ChipGroup] Duplicate values detected in items array. Each item should have a unique value.")}},[w]),t.useEffect(()=>{D.current.length>R.length&&(D.current=D.current.slice(0,R.length))},[R]),o&&Array.isArray(o)?e.jsxs("div",{ref:y,className:r.cn("chip-group",h&&"chip-group--disabled",m),role:"group","aria-label":"Chip group","data-testid":f||"chip-group","data-cy":g||"chip-group",...b,children:[I&&e.jsxs("div",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":"chip-group-live-region","data-cy":"chip-group-live-region",children:[R.length," additional ",1===R.length?"chip":"chips"," hidden"]}),e.jsxs("div",{ref:x,className:"chip-group__container",children:[S.map(t=>{const r=u===t.value,i=t.variant||p,l=h||t.disabled||!1,o=w.findIndex(e=>e.value===t.value);return e.jsx("div",{ref:e=>{k.current[o]=e||null},className:"chip-group__item-wrapper","data-cy":`chip-group-item-wrapper-${t.value}`,"data-testid":`chip-group-item-wrapper-${t.value}`,children:e.jsxs("div",{className:"chip-group__item",onClick:e=>q(t.value,l,e),onKeyDown:e=>M(e,t.value,l),tabIndex:l?-1:0,role:"button","aria-pressed":r?"true":"false","aria-disabled":l?"true":"false","data-cy":`chip-group-item-${t.value}`,"data-testid":`chip-group-item-${t.value}`,children:[e.jsx(a.Chip,{variant:i,selected:r,disabled:l,"data-cy":`chip-${t.value}`,"data-testid":`chip-${t.value}`,children:t.label}),c&&!h&&!l&&e.jsx("button",{className:"chip-group__remove",onClick:e=>A(e,t.value),"aria-label":`Remove ${t.label}`,"data-cy":`chip-remove-${t.value}`,"data-testid":`chip-remove-${t.value}`,type:"button",children:e.jsx(n.Icon,{name:"Cross2Icon",size:"sm",decorative:!0})})]})},t.value)}),I&&e.jsxs("div",{ref:C,className:"chip-group__overflow",role:"button",tabIndex:0,"aria-expanded":N?"true":"false","aria-haspopup":"menu","aria-label":`Show ${R.length} more ${1===R.length?"chip":"chips"}`,onMouseEnter:()=>!N&&j(!0),onMouseLeave:()=>j(!1),onClick:P,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),$(!N),j(!1))},"data-cy":"chip-group-overflow","data-testid":"chip-group-overflow",children:[e.jsxs(a.Chip,{variant:p,"data-cy":"chip-overflow","data-testid":"chip-overflow",children:["+",R.length]}),E&&!N&&e.jsx("div",{className:"chip-group__tooltip chip-group__tooltip--hover",role:"tooltip","data-cy":"chip-group-tooltip","data-testid":"chip-group-tooltip",children:R.map(t=>e.jsx("div",{className:"chip-group__tooltip-item","data-cy":`chip-group-tooltip-item-${t.value}`,"data-testid":`chip-group-tooltip-item-${t.value}`,children:t.label},t.value))}),N&&e.jsx("div",{className:"chip-group__dropdown",role:"menu","data-cy":"chip-group-dropdown","data-testid":"chip-group-dropdown",children:R.map((t,a)=>e.jsx("div",{ref:e=>{D.current[a]=e||null},className:r.cn("chip-group__dropdown-item",t.disabled&&"chip-group__dropdown-item--disabled"),role:"menuitem",tabIndex:t.disabled?-1:0,"aria-disabled":t.disabled?"true":"false",onClick:e=>{e.stopPropagation(),t.disabled||(q(t.value,!1,e),$(!1))},onKeyDown:e=>{T(e,a),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t.disabled||(q(t.value,!1,e),$(!1)))},"data-cy":`chip-group-dropdown-item-${t.value}`,"data-testid":`chip-group-dropdown-item-${t.value}`,children:t.label},t.value))})]})]})]}):null});o.displayName="ChipGroup",exports.ChipGroup=o;
|
package/dist/index15.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useRef, useState, useCallback, useEffect } from "react";
|
|
3
|
-
import { cn } from "./
|
|
3
|
+
import { cn } from "./index22.js";
|
|
4
4
|
import { Chip } from "./index14.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { devWarn } from "./
|
|
6
|
+
import { devWarn } from "./index35.js";
|
|
7
7
|
import { Icon } from "@adam-milo/icons";
|
|
8
8
|
const parseGapValue = (gapString, rootFontSize, containerFontSize) => {
|
|
9
9
|
if (!gapString) return 0.5 * rootFontSize;
|
package/dist/index16.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("@radix-ui/react-dialog"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("@radix-ui/react-dialog"),o=require("./index22.cjs");function i(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return a.default=e,Object.freeze(a)};/* empty css */const r=i(t),s=r.Root,d=r.Trigger,l=r.Portal,c=r.Close,n=a.forwardRef(({className:a,"data-cy":t,"data-testid":i,...s},d)=>{const l=t||"dialog-overlay",c=i||"dialog-overlay";return e.jsx(r.Overlay,{ref:d,className:o.cn("dialog-overlay",a),"data-cy":l,"data-testid":c,...s})});n.displayName=r.Overlay.displayName;const g=a.forwardRef(({className:a,children:t,"data-cy":i,"data-testid":s,...d},c)=>{const g=i||"dialog-content",y=s||"dialog-content";return e.jsxs(l,{children:[e.jsx(n,{}),e.jsx(r.Content,{ref:c,className:o.cn("dialog-content",a),"data-cy":g,"data-testid":y,...d,children:t})]})});g.displayName=r.Content.displayName;const y=({className:a,"data-cy":t,"data-testid":i,...r})=>{const s=t||"dialog-header",d=i||"dialog-header";return e.jsx("div",{className:o.cn("dialog-header",a),"data-cy":s,"data-testid":d,...r})};y.displayName="DialogHeader";const p=({className:a,"data-cy":t,"data-testid":i,...r})=>{const s=t||"dialog-footer",d=i||"dialog-footer";return e.jsx("div",{className:o.cn("dialog-footer",a),"data-cy":s,"data-testid":d,...r})};p.displayName="DialogFooter";const m=a.forwardRef(({className:a,"data-cy":t,"data-testid":i,...s},d)=>{const l=t||"dialog-title",c=i||"dialog-title";return e.jsx(r.Title,{ref:d,className:o.cn("dialog-title",a),"data-cy":l,"data-testid":c,...s})});m.displayName=r.Title.displayName;const f=a.forwardRef(({className:a,"data-cy":t,"data-testid":i,...s},d)=>{const l=t||"dialog-description",c=i||"dialog-description";return e.jsx(r.Description,{ref:d,className:o.cn("dialog-description",a),"data-cy":l,"data-testid":c,...s})});f.displayName=r.Description.displayName,exports.Dialog=s,exports.DialogClose=c,exports.DialogContent=g,exports.DialogDescription=f,exports.DialogFooter=p,exports.DialogHeader=y,exports.DialogOverlay=n,exports.DialogPortal=l,exports.DialogTitle=m,exports.DialogTrigger=d;
|
package/dist/index16.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
-
import { cn } from "./
|
|
4
|
+
import { cn } from "./index22.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
const Dialog = DialogPrimitive.Root;
|
|
7
7
|
const DialogTrigger = DialogPrimitive.Trigger;
|
package/dist/index17.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),e=require("./index22.cjs");;/* empty css */const s=a.forwardRef(({direction:a="vertical",spacing:s="4",align:c="stretch",justify:r="start",wrap:i=!1,className:n,children:d,"data-cy":l,"data-testid":o,...u},k)=>{const p=l||`stack-${a}`,j=o||`stack-${a}`;return t.jsx("div",{ref:k,className:e.cn("stack",`stack--${a}`,`stack--spacing-${s}`,`stack--align-${c}`,`stack--justify-${r}`,i&&"stack--wrap",n),"data-cy":p,"data-testid":j,...u,children:d})});s.displayName="Stack",exports.Stack=s;
|
package/dist/index17.js
CHANGED
package/dist/index18.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./index22.cjs");;/* empty css */const a=t.forwardRef(({className:t,maxWidth:a="lg",padding:n="md","data-cy":i,"data-testid":d,children:c,...s},o)=>{const l=i||"container",u=d||"container";return e.jsx("div",{ref:o,className:r.cn("container",`container--max-width-${a}`,`container--padding-${n}`,t),"data-cy":l,"data-testid":u,...s,children:c})});a.displayName="Container",exports.Container=a;
|
package/dist/index18.js
CHANGED
package/dist/index19.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("@radix-ui/react-separator"),i=require("./index22.cjs");function a(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)};/* empty css */const o=a(t),d=r.forwardRef(({orientation:r="horizontal",decorative:t=!0,spacing:a="0",color:d,className:c,style:n,"data-cy":s,"data-testid":u,...l},f)=>{const v=s||`divider-${r}`,g=u||`divider-${r}`;return e.jsx(o.Root,{ref:f,decorative:t,orientation:r,className:i.cn("divider",`divider--${r}`,`divider--spacing-${a}`,c),style:{...d&&{backgroundColor:d},...n},"data-cy":v,"data-testid":g,...l})});d.displayName="Divider",exports.Divider=d;
|
package/dist/index19.js
CHANGED
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
+
import { cn } from "./index22.js";
|
|
3
5
|
/* empty css */
|
|
4
|
-
const
|
|
6
|
+
const Divider = forwardRef(
|
|
5
7
|
({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
color
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
className = "",
|
|
8
|
+
orientation = "horizontal",
|
|
9
|
+
decorative = true,
|
|
10
|
+
spacing = "0",
|
|
11
|
+
color,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
13
14
|
"data-cy": dataCy,
|
|
14
15
|
"data-testid": dataTestId,
|
|
15
|
-
children,
|
|
16
16
|
...props
|
|
17
17
|
}, ref) => {
|
|
18
|
-
const finalDataCy = dataCy || `
|
|
19
|
-
const
|
|
20
|
-
const classes = [
|
|
21
|
-
"text",
|
|
22
|
-
`text--size-${size}`,
|
|
23
|
-
`text--weight-${weight}`,
|
|
24
|
-
`text--color-${color}`,
|
|
25
|
-
`text--align-${align}`,
|
|
26
|
-
truncate && "text--truncate",
|
|
27
|
-
className
|
|
28
|
-
].filter(Boolean).join(" ");
|
|
18
|
+
const finalDataCy = dataCy || `divider-${orientation}`;
|
|
19
|
+
const finalTestId = dataTestId || `divider-${orientation}`;
|
|
29
20
|
return /* @__PURE__ */ jsx(
|
|
30
|
-
|
|
21
|
+
SeparatorPrimitive.Root,
|
|
31
22
|
{
|
|
32
23
|
ref,
|
|
33
|
-
|
|
24
|
+
decorative,
|
|
25
|
+
orientation,
|
|
26
|
+
className: cn(
|
|
27
|
+
"divider",
|
|
28
|
+
`divider--${orientation}`,
|
|
29
|
+
`divider--spacing-${spacing}`,
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
style: {
|
|
33
|
+
...color && { backgroundColor: color },
|
|
34
|
+
...style
|
|
35
|
+
},
|
|
34
36
|
"data-cy": finalDataCy,
|
|
35
|
-
"data-testid":
|
|
36
|
-
...props
|
|
37
|
-
children
|
|
37
|
+
"data-testid": finalTestId,
|
|
38
|
+
...props
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
41
|
}
|
|
41
42
|
);
|
|
42
|
-
|
|
43
|
+
Divider.displayName = "Divider";
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
Divider
|
|
45
46
|
};
|
package/dist/index2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),r=require("./index22.cjs");;/* empty css */const a=e.forwardRef(({variant:e="primary-workspace",fullWidth:a=!1,icon:n,className:s,children:i,disabled:c,"data-testid":d,"data-cy":o,...l},u)=>{const b=r.cn("btn",`btn--${e}`,a&&"btn--full-width",s);return t.jsxs("button",{ref:u,disabled:c,className:b,"data-testid":d||`button-${e}`,"data-cy":o||`button-${e}`,...l,children:[n&&t.jsx("span",{className:"btn__icon",children:n}),i]})});a.displayName="Button",exports.Button=a;
|
package/dist/index2.js
CHANGED
package/dist/index20.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react");;/* empty css */const r=e.forwardRef(({size:e="md",weight:r="regular",as:a="p",color:i="text",align:s="start",truncate:c=!1,className:o="","data-cy":n,"data-testid":x,children:l,...d},u)=>{const $=n||`text-${e}-${r}`,g=x||`text-${e}-${r}`,m=["text",`text--size-${e}`,`text--weight-${r}`,`text--color-${i}`,`text--align-${s}`,c&&"text--truncate",o].filter(Boolean).join(" ");return t.jsx(a,{ref:u,className:m,"data-cy":$,"data-testid":g,...d,children:l})});r.displayName="Text",exports.Text=r;
|
package/dist/index20.js
CHANGED
|
@@ -1,55 +1,45 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { cn } from "./index21.js";
|
|
4
3
|
/* empty css */
|
|
5
|
-
const
|
|
4
|
+
const Text = forwardRef(
|
|
6
5
|
({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
autoFitMinWidth = "15rem",
|
|
15
|
-
className,
|
|
16
|
-
children,
|
|
17
|
-
style,
|
|
6
|
+
size = "md",
|
|
7
|
+
weight = "regular",
|
|
8
|
+
as: Component = "p",
|
|
9
|
+
color = "text",
|
|
10
|
+
align = "start",
|
|
11
|
+
truncate = false,
|
|
12
|
+
className = "",
|
|
18
13
|
"data-cy": dataCy,
|
|
19
14
|
"data-testid": dataTestId,
|
|
15
|
+
children,
|
|
20
16
|
...props
|
|
21
17
|
}, ref) => {
|
|
22
|
-
const finalDataCy = dataCy || `
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const finalDataCy = dataCy || `text-${size}-${weight}`;
|
|
19
|
+
const finalDataTestId = dataTestId || `text-${size}-${weight}`;
|
|
20
|
+
const classes = [
|
|
21
|
+
"text",
|
|
22
|
+
`text--size-${size}`,
|
|
23
|
+
`text--weight-${weight}`,
|
|
24
|
+
`text--color-${color}`,
|
|
25
|
+
`text--align-${align}`,
|
|
26
|
+
truncate && "text--truncate",
|
|
27
|
+
className
|
|
28
|
+
].filter(Boolean).join(" ");
|
|
28
29
|
return /* @__PURE__ */ jsx(
|
|
29
|
-
|
|
30
|
+
Component,
|
|
30
31
|
{
|
|
31
32
|
ref,
|
|
32
|
-
className:
|
|
33
|
-
"grid",
|
|
34
|
-
`grid--columns-${columns}`,
|
|
35
|
-
rows && `grid--rows-${rows}`,
|
|
36
|
-
`grid--gap-${gap}`,
|
|
37
|
-
rowGap && `grid--row-gap-${rowGap}`,
|
|
38
|
-
columnGap && `grid--column-gap-${columnGap}`,
|
|
39
|
-
`grid--align-${align}`,
|
|
40
|
-
`grid--justify-${justify}`,
|
|
41
|
-
className
|
|
42
|
-
),
|
|
43
|
-
style: customStyle,
|
|
33
|
+
className: classes,
|
|
44
34
|
"data-cy": finalDataCy,
|
|
45
|
-
"data-testid":
|
|
35
|
+
"data-testid": finalDataTestId,
|
|
46
36
|
...props,
|
|
47
37
|
children
|
|
48
38
|
}
|
|
49
39
|
);
|
|
50
40
|
}
|
|
51
41
|
);
|
|
52
|
-
|
|
42
|
+
Text.displayName = "Text";
|
|
53
43
|
export {
|
|
54
|
-
|
|
44
|
+
Text
|
|
55
45
|
};
|
package/dist/index21.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),e=require("./index22.cjs");;/* empty css */const t=i.forwardRef(({columns:i=3,rows:t,gap:a="4",rowGap:d,columnGap:s,align:c="stretch",justify:o="stretch",autoFitMinWidth:n="15rem",className:g,children:l,style:u,"data-cy":m,"data-testid":p,...y},$)=>{const f=m||`grid-${i}col`,j=p||`grid-${i}col`,x={...u,..."auto"===i&&{"--grid-auto-fit-min":n}};return r.jsx("div",{ref:$,className:e.cn("grid",`grid--columns-${i}`,t&&`grid--rows-${t}`,`grid--gap-${a}`,d&&`grid--row-gap-${d}`,s&&`grid--column-gap-${s}`,`grid--align-${c}`,`grid--justify-${o}`,g),style:x,"data-cy":f,"data-testid":j,...y,children:l})});t.displayName="Grid",exports.Grid=t;
|
package/dist/index21.js
CHANGED
|
@@ -1,14 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "./index22.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const Grid = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
columns = 3,
|
|
8
|
+
rows,
|
|
9
|
+
gap = "4",
|
|
10
|
+
rowGap,
|
|
11
|
+
columnGap,
|
|
12
|
+
align = "stretch",
|
|
13
|
+
justify = "stretch",
|
|
14
|
+
autoFitMinWidth = "15rem",
|
|
15
|
+
className,
|
|
16
|
+
children,
|
|
17
|
+
style,
|
|
18
|
+
"data-cy": dataCy,
|
|
19
|
+
"data-testid": dataTestId,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => {
|
|
22
|
+
const finalDataCy = dataCy || `grid-${columns}col`;
|
|
23
|
+
const finalTestId = dataTestId || `grid-${columns}col`;
|
|
24
|
+
const customStyle = {
|
|
25
|
+
...style,
|
|
26
|
+
...columns === "auto" && { "--grid-auto-fit-min": autoFitMinWidth }
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
className: cn(
|
|
33
|
+
"grid",
|
|
34
|
+
`grid--columns-${columns}`,
|
|
35
|
+
rows && `grid--rows-${rows}`,
|
|
36
|
+
`grid--gap-${gap}`,
|
|
37
|
+
rowGap && `grid--row-gap-${rowGap}`,
|
|
38
|
+
columnGap && `grid--column-gap-${columnGap}`,
|
|
39
|
+
`grid--align-${align}`,
|
|
40
|
+
`grid--justify-${justify}`,
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
style: customStyle,
|
|
44
|
+
"data-cy": finalDataCy,
|
|
45
|
+
"data-testid": finalTestId,
|
|
46
|
+
...props,
|
|
47
|
+
children
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
Grid.displayName = "Grid";
|
|
11
53
|
export {
|
|
12
|
-
|
|
13
|
-
generateId
|
|
54
|
+
Grid
|
|
14
55
|
};
|
package/dist/index22.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("clsx"),r=require("tailwind-merge");let t=0;exports.cn=function(...t){return r.twMerge(e.clsx(t))},exports.generateId=function(e="id"){return t+=1,`${e}-${t}`};
|
package/dist/index22.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
function cn(...inputs) {
|
|
4
|
+
return twMerge(clsx(inputs));
|
|
5
|
+
}
|
|
6
|
+
let idCounter = 0;
|
|
7
|
+
function generateId(prefix = "id") {
|
|
8
|
+
idCounter += 1;
|
|
9
|
+
return `${prefix}-${idCounter}`;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
cn,
|
|
13
|
+
generateId
|
|
14
|
+
};
|
package/dist/index24.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs");;/* empty css */const a=require("./index25.cjs"),s=require("./index42.cjs"),n=r.forwardRef(({type:n="text",label:l,error:i,helperText:o,fullWidth:u=!1,showPasswordToggle:d=!0,showLastChar:c=!0,lastCharDelay:p=500,validate:h,onValidationChange:f,className:g,id:x,onChange:v,onBlur:w,required:j,value:m,"data-cy":y,"data-testid":k,...b},C)=>{const[$,N]=r.useState(!1),[_,q]=r.useState(),[M,S]=r.useState(!1),[L,R]=r.useState(!1),T=r.useRef(!1),[E,W]=r.useState(""),B=r.useRef(""),F=r.useRef(null),I=r.useRef(null),z=a.useMergedRef(C,I),D=r.useId(),O=x||D,P=`${O}-error`,V=`${O}-helper`,H=y||"input",A=k||"input",G="password"===n,J=G&&d,K=G&&c&&!$,Q=G&&($||K&&B.current.length>0)?"text":n,U=l&&j&&!l.includes("*")?`${l} *`:l,X=r.useMemo(()=>s.debounce(e=>{if(h&&T.current){const r=h(e);q(r),null==f||f(!r)}},300),[h,f]),Y=r.useRef(X);r.useEffect(()=>{Y.current=X},[X]),r.useEffect(()=>{process.env.NODE_ENV},[G,c,m]),r.useEffect(()=>()=>{F.current&&clearTimeout(F.current),Y.current.cancel()},[]);const Z=K&&void 0===m?E:$&&G&&void 0===m?B.current||"":m,ee=i||_,re=b.disabled?"disabled":ee?"error":M?"focus":L?"hover":"idle";return e.jsxs("div",{className:t.cn("input-wrapper",u&&"input-wrapper--full-width"),"data-cy":`${H}-wrapper`,"data-testid":`${A}-wrapper`,children:[l&&e.jsx("label",{htmlFor:O,className:"input__label","data-cy":`${H}-label`,"data-testid":`${A}-label`,children:U}),e.jsxs("div",{className:"input__field-container",children:[e.jsx("input",{ref:z,id:O,type:Q,value:Z,className:t.cn("input",ee&&"input--error",u&&"input--full-width",J&&"input--with-toggle",g),"aria-invalid":ee?"true":"false","aria-required":j?"true":void 0,"aria-describedby":ee?P:o?V:void 0,"data-cy":H,"data-testid":A,"data-state":re,onChange:e=>{null==v||v(e);let r=e.target.value;if(K){const t=e.target,a=t.value;B.current=a;const s=a?"•".repeat(a.length-1)+a.slice(-1):"";W(s),t.value=s,r=a,F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{W("•".repeat(a.length))},p)}T.current&&X(r)},onFocus:e=>{var r;S(!0),null==(r=b.onFocus)||r.call(b,e)},onBlur:e=>{if(S(!1),T.current=!0,h){const r=K?B.current:e.target.value,t=h(r);q(t),null==f||f(!t)}null==w||w(e)},onMouseEnter:()=>{R(!0)},onMouseLeave:()=>{R(!1)},required:j,...b}),J&&e.jsx("button",{type:"button",className:"input__toggle",onClick:()=>{N(e=>!e),setTimeout(()=>{var e;return null==(e=I.current)?void 0:e.focus()},0)},"aria-label":$?"Hide password":"Show password","data-cy":`${H}-toggle`,"data-testid":`${A}-toggle`,children:$?e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),e.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]}):e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),e.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M3 3l14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})]}),ee&&e.jsx("span",{id:P,className:"input__error",role:"alert","data-cy":`${H}-error`,"data-testid":`${A}-error`,children:ee}),o&&!ee&&e.jsx("span",{id:V,className:"input__helper","data-cy":`${H}-helper`,"data-testid":`${A}-helper`,children:o})]})});n.displayName="Input",exports.Input=n;
|
package/dist/index24.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState, useRef, useId, useMemo, useEffect } from "react";
|
|
3
|
-
import { cn } from "./
|
|
3
|
+
import { cn } from "./index22.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { useMergedRef } from "./index25.js";
|
|
6
6
|
import { debounce } from "./index42.js";
|
package/dist/index3.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("react"),t=require("email-validator"),i=require("./index24.cjs"),l=e.forwardRef(({validateEmail:l=!0,invalidEmailMessage:r="Not a valid email address",validate:d,"data-cy":s,"data-testid":u,...n},o)=>{const m=e.useCallback(a=>{if(a)return t.validate(a)?void 0:r},[r]),c=e.useCallback(a=>l?d?m(a)||d(a):m(a):null==d?void 0:d(a),[l,d,m]);return a.jsx(i.Input,{ref:o,type:"email",validate:c,"data-cy":s||"email-input","data-testid":u||"email-input",...n})});l.displayName="EmailInput",exports.EmailInput=l;
|
package/dist/index3.js
CHANGED
package/dist/index7.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index22.cjs");;/* empty css */const c=r.forwardRef(({label:c,error:t,helperText:d,indeterminate:i=!1,className:s,id:l,required:n,disabled:o,checked:u,"data-cy":b,"data-testid":h,...x},p)=>{const k=r.useId(),m=l||k,y=`${m}-error`,_=`${m}-helper`,$=b||"checkbox",f=h||"checkbox",j=r.useRef(null),N=r.useCallback(e=>{j.current=e,p&&("function"==typeof p?p(e):"current"in p&&(p.current=e))},[p]);r.useEffect(()=>{j.current&&(j.current.indeterminate=i)},[i]);const q=c&&n&&!c.includes("*")?`${c} *`:c;return e.jsxs("div",{className:a.cn("checkbox-wrapper",o&&"checkbox-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${f}-wrapper`,children:[e.jsxs("div",{className:"checkbox__container",children:[e.jsx("input",{ref:N,id:m,type:"checkbox",checked:u,className:a.cn("checkbox__input",t&&"checkbox__input--error",s),"aria-invalid":t?"true":"false","aria-required":n?"true":void 0,"aria-describedby":t?y:d?_:void 0,"data-cy":$,"data-testid":f,"data-indeterminate":i?"true":void 0,disabled:o,required:n,...x}),c&&e.jsx("label",{htmlFor:m,className:"checkbox__label","data-cy":`${$}-label`,"data-testid":`${f}-label`,children:q})]}),t&&e.jsx("span",{id:y,className:"checkbox__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${f}-error`,children:t}),d&&!t&&e.jsx("span",{id:_,className:"checkbox__helper","data-cy":`${$}-helper`,"data-testid":`${f}-helper`,children:d})]})});c.displayName="Checkbox",exports.Checkbox=c;
|
package/dist/index7.js
CHANGED