@adam-milo/ui 1.0.68 → 1.0.69
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/index31.cjs +1 -1
- package/dist/index31.js +8 -8
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -1
- package/dist/src/components/navigation/stepper/Stepper.component.d.ts.map +1 -1
- package/dist/src/components/navigation/stepper/Stepper.styles.d.ts +5 -2
- package/dist/src/components/navigation/stepper/Stepper.styles.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index31.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),s=require("./index52.cjs"),a=require("./index73.cjs"),l=t.forwardRef(({isCompleted:t=!1,size:l="large","data-cy":
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),s=require("./index52.cjs"),a=require("./index73.cjs"),l=t.forwardRef(({isCompleted:t=!1,size:l="large","data-cy":n,"data-testid":r},i)=>{const c=n||"stepper-connector",o=r||"stepper-connector";return e.jsx("div",{ref:i,className:s.cn(a.connectorContainerBaseStyles,"small"===l?a.connectorContainerSmallStyles:a.connectorContainerLargeStyles),"data-cy":`${c}-container`,"data-testid":`${o}-container`,children:e.jsx("div",{className:s.cn(a.connectorLineStyles,t?a.connectorActiveStyles:a.connectorInactiveStyles),"data-cy":c,"data-testid":o})})});l.displayName="StepConnector";const n=t.forwardRef(({stepNumber:l,label:n,isActive:r,isCompleted:i,isDisabled:c,isClickable:o,onClick:d,size:p="large","data-cy":y,"data-testid":m},S)=>{const[C,u]=t.useState(!1),b=y||`stepper-step-${l}`,f=m||`stepper-step-${l}`,v=(e=>"small"===e?a.stepCircleSmallStyles:a.stepCircleLargeStyles)(p);return e.jsxs("div",{ref:S,className:s.cn(a.stepItemContainerBaseStyles,"small"===p?a.stepItemContainerSmallStyles:a.stepItemContainerLargeStyles,o&&!c&&"cursor-pointer"),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onClick:()=>{o&&!c&&d&&d()},onKeyDown:e=>{!o||c||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d?.())},role:o?"button":void 0,tabIndex:o&&!c?0:-1,"aria-current":r?"step":void 0,"aria-disabled":c,"data-cy":b,"data-testid":f,children:[e.jsx("div",{className:c?s.cn(a.stepCircleBaseStyles,v,a.stepCircleDisabledStyles):r?C?s.cn(a.stepCircleBaseStyles,v,a.stepCircleSelectedHoverStyles):s.cn(a.stepCircleBaseStyles,v,a.stepCircleSelectedStyles):C&&o?s.cn(a.stepCircleBaseStyles,v,a.stepCircleHoverStyles):i?s.cn(a.stepCircleBaseStyles,v,a.stepCircleCompletedStyles):s.cn(a.stepCircleBaseStyles,v,a.stepCircleRestStyles),"data-cy":`${b}-circle`,"data-testid":`${f}-circle`,children:l}),e.jsx("p",{className:c?s.cn(a.stepLabelBaseStyles,a.stepLabelDisabledStyles):r?s.cn(a.stepLabelBaseStyles,a.stepLabelSelectedStyles):C&&o?s.cn(a.stepLabelBaseStyles,a.stepLabelHoverStyles):i?s.cn(a.stepLabelBaseStyles,a.stepLabelCompletedStyles):s.cn(a.stepLabelBaseStyles,a.stepLabelRestStyles),"data-cy":`${b}-label`,"data-testid":`${f}-label`,children:n})]})});n.displayName="StepItem";const r="(min-width: 1024px)";const i=t.forwardRef(({steps:i,currentStep:c,onChange:o,allowStepNavigation:d=!0,showConnector:p=!0,size:y,className:m,"data-cy":S,"data-testid":C,...u},b)=>{const f=S||"stepper",v=C||"stepper",h=function(){const[e,s]=t.useState(()=>"undefined"==typeof window||"function"!=typeof window.matchMedia||window.matchMedia(r).matches?"large":"small");return t.useEffect(()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const e=window.matchMedia(r),t=e=>s(e.matches?"large":"small");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),e}(),g=y??h,x=Math.max(0,c-1),w="large"===g?"3.25rem":"2.5rem",L=i.flatMap((e,t)=>t<i.length-1?[w,"minmax(2rem, 1fr)"]:[w]).join(" "),{style:$,...j}=u;return e.jsx("div",{ref:b,className:s.cn(a.containerStyles,m),style:{...$,gridTemplateColumns:L},role:"navigation","aria-label":"Progress indicator","data-cy":f,"data-testid":v,...j,children:i.map((s,a)=>{const r=a===x,c=a<x,y=s.disabled??!1,m=d&&!y&&a!==x;return e.jsxs(t.Fragment,{children:[e.jsx(n,{stepNumber:a+1,label:s.label,isActive:r,isCompleted:c,isDisabled:y,isClickable:m,onClick:()=>((e,t)=>{d&&!t&&e!==x&&o?.(e+1)})(a,y),size:g,"data-cy":`${f}-step-${a+1}`,"data-testid":`${v}-step-${a+1}`}),a<i.length-1&&(p?e.jsx(l,{isCompleted:c,size:g,"data-cy":`${f}-connector-${a+1}`,"data-testid":`${v}-connector-${a+1}`}):e.jsx("div",{className:"flex-1","aria-hidden":"true"}))]},s.id)})})});i.displayName="Stepper",exports.Stepper=i;
|
package/dist/index31.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{forwardRef as a,Fragment as
|
|
2
|
-
return e("div",{ref:
|
|
3
|
-
return t("div",{ref:
|
|
4
|
-
/* @__PURE__ */e("div",{className:r(
|
|
5
|
-
/* @__PURE__ */e("p",{className:r(
|
|
6
|
-
return e("div",{ref:
|
|
7
|
-
return t(
|
|
8
|
-
/* @__PURE__ */e(
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{forwardRef as a,Fragment as i,useState as s,useEffect as n}from"react";import{cn as r}from"./index52.js";import{stepItemContainerSmallStyles as d,stepItemContainerLargeStyles as o,stepItemContainerBaseStyles as c,connectorActiveStyles as l,connectorInactiveStyles as m,connectorLineStyles as p,connectorContainerSmallStyles as u,connectorContainerLargeStyles as y,connectorContainerBaseStyles as f,stepCircleDisabledStyles as h,stepCircleBaseStyles as v,stepCircleSelectedHoverStyles as b,stepCircleSelectedStyles as w,stepCircleHoverStyles as $,stepCircleCompletedStyles as g,stepCircleRestStyles as N,stepLabelDisabledStyles as C,stepLabelBaseStyles as x,stepLabelSelectedStyles as M,stepLabelHoverStyles as k,stepLabelCompletedStyles as z,stepLabelRestStyles as S,stepCircleSmallStyles as j,stepCircleLargeStyles as D,containerStyles as E}from"./index73.js";const L=a(({isCompleted:t=!1,size:a="large","data-cy":i,"data-testid":s},n)=>{const d=i||"stepper-connector",o=s||"stepper-connector";/* @__PURE__ */
|
|
2
|
+
return e("div",{ref:n,className:r(f,"small"===a?u:y),"data-cy":`${d}-container`,"data-testid":`${o}-container`,children:/* @__PURE__ */e("div",{className:r(p,t?l:m),"data-cy":d,"data-testid":o})})});L.displayName="StepConnector";const A=a(({stepNumber:a,label:i,isActive:n,isCompleted:l,isDisabled:m,isClickable:p,onClick:u,size:y="large","data-cy":f,"data-testid":E},L)=>{const[A,I]=s(!1),K=f||`stepper-step-${a}`,P=E||`stepper-step-${a}`,T=(e=>"small"===e?j:D)(y);/* @__PURE__ */
|
|
3
|
+
return t("div",{ref:L,className:r(c,"small"===y?d:o,p&&!m&&"cursor-pointer"),onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),onClick:()=>{p&&!m&&u&&u()},onKeyDown:e=>{!p||m||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u?.())},role:p?"button":void 0,tabIndex:p&&!m?0:-1,"aria-current":n?"step":void 0,"aria-disabled":m,"data-cy":K,"data-testid":P,children:[
|
|
4
|
+
/* @__PURE__ */e("div",{className:r(v,T,m?h:n?A?b:w:A&&p?$:l?g:N),"data-cy":`${K}-circle`,"data-testid":`${P}-circle`,children:a}),
|
|
5
|
+
/* @__PURE__ */e("p",{className:r(x,m?C:n?M:A&&p?k:l?z:S),"data-cy":`${K}-label`,"data-testid":`${P}-label`,children:i})]})});A.displayName="StepItem";const I="(min-width: 1024px)";const K=a(({steps:a,currentStep:d,onChange:o,allowStepNavigation:c=!0,showConnector:l=!0,size:m,className:p,"data-cy":u,"data-testid":y,...f},h)=>{const v=u||"stepper",b=y||"stepper",w=function(){const[e,t]=s(()=>"undefined"==typeof window||"function"!=typeof window.matchMedia||window.matchMedia(I).matches?"large":"small");return n(()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const e=window.matchMedia(I),a=e=>t(e.matches?"large":"small");return e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[]),e}(),$=m??w,g=Math.max(0,d-1),N="large"===$?"3.25rem":"2.5rem",C=a.flatMap((e,t)=>t<a.length-1?[N,"minmax(2rem, 1fr)"]:[N]).join(" "),{style:x,...M}=f;/* @__PURE__ */
|
|
6
|
+
return e("div",{ref:h,className:r(E,p),style:{...x,gridTemplateColumns:C},role:"navigation","aria-label":"Progress indicator","data-cy":v,"data-testid":b,...M,children:a.map((s,n)=>{const r=n===g,d=n<g,m=s.disabled??!1,p=c&&!m&&n!==g;/* @__PURE__ */
|
|
7
|
+
return t(i,{children:[
|
|
8
|
+
/* @__PURE__ */e(A,{stepNumber:n+1,label:s.label,isActive:r,isCompleted:d,isDisabled:m,isClickable:p,onClick:()=>((e,t)=>{c&&!t&&e!==g&&o?.(e+1)})(n,m),size:$,"data-cy":`${v}-step-${n+1}`,"data-testid":`${b}-step-${n+1}`}),n<a.length-1&&(l?/* @__PURE__ */e(L,{isCompleted:d,size:$,"data-cy":`${v}-connector-${n+1}`,"data-testid":`${b}-connector-${n+1}`}):/* @__PURE__ */e("div",{className:"flex-1","aria-hidden":"true"}))]},s.id)})})});K.displayName="Stepper";export{K as Stepper};
|
package/dist/index73.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["grid items-start justify-items-start","w-full","gap-0"].join(" "),t=["flex flex-col items-center justify-center","gap-[var(--spacing-4)]","min-w-0"].join(" "),o=["flex items-center justify-center","rounded-[2.5rem]","transition-all duration-200 ease-in-out","font-[var(--font-family-default)]","text-[length:var(--font-size-4)]","leading-normal","select-none","cursor-default"].join(" "),r=["bg-[var(--color-card)]","text-[var(--color-system-text)]","border-none"].join(" "),s=["bg-[var(--color-card)]","text-[var(--color-popup)]","border border-solid border-[var(--color-popup)]","cursor-pointer"].join(" "),l=["bg-[var(--color-popup)]","text-[var(--color-card)]","border-none"].join(" "),n=["bg-[var(--color-popup)]","text-[var(--color-card)]","border-none","shadow-[inset_0_0_0_100px_var(--color-overlay-black-10)]"].join(" "),a=["bg-[var(--color-card)]","text-[var(--color-system-text)]","opacity-75","cursor-not-allowed"].join(" "),p=["bg-[var(--color-popup)]","text-[var(--color-card)]","border-none"].join(" "),i=["text-[0.875rem] lg:text-[1.125rem]","leading-normal","text-center","select-none","whitespace-nowrap","overflow-hidden","text-ellipsis","transition-colors duration-200 ease-in-out","font-[var(--font-family-default)]"].join(" "),c=["text-[var(--color-system-text)]","font-normal"].join(" "),x=["text-[var(--color-popup)]","font-normal"].join(" "),m=["text-[var(--color-popup)]","font-bold"].join(" "),d=["text-[var(--color-system-text)]","font-normal"].join(" "),y=["text-[var(--color-popup)]","font-normal"].join(" "),v=["w-full flex items-center min-w-0","px-[0.5rem] lg:px-[1.5rem]"].join(" "),S=["w-full h-px","rounded-[2.677rem]","transition-colors duration-200 ease-in-out"].join(" "),u=["bg-[var(--color-system-text)]"].join(" "),b=["bg-[var(--color-popup)]"].join(" ");exports.connectorActiveStyles=b,exports.connectorContainerBaseStyles=v,exports.connectorContainerLargeStyles="h-[3.25rem]",exports.connectorContainerSmallStyles="h-[2.5rem]",exports.connectorInactiveStyles=u,exports.connectorLineStyles=S,exports.containerStyles=e,exports.stepCircleBaseStyles=o,exports.stepCircleCompletedStyles=p,exports.stepCircleDisabledStyles=a,exports.stepCircleHoverStyles=s,exports.stepCircleLargeStyles="w-[3.25rem] h-[3.25rem]",exports.stepCircleRestStyles=r,exports.stepCircleSelectedHoverStyles=n,exports.stepCircleSelectedStyles=l,exports.stepCircleSmallStyles="w-[2.5rem] h-[2.5rem] p-[0.889rem]",exports.stepItemContainerBaseStyles=t,exports.stepItemContainerLargeStyles="min-w-[3.25rem] max-w-[3.25rem]",exports.stepItemContainerSmallStyles="min-w-[2.5rem] max-w-[2.5rem]",exports.stepLabelBaseStyles=i,exports.stepLabelCompletedStyles=y,exports.stepLabelDisabledStyles=d,exports.stepLabelHoverStyles=x,exports.stepLabelRestStyles=c,exports.stepLabelSelectedStyles=m;
|
package/dist/index73.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o=["
|
|
1
|
+
const o=["grid items-start justify-items-start","w-full","gap-0"].join(" "),r=["flex flex-col items-center justify-center","gap-[var(--spacing-4)]","min-w-0"].join(" "),e="min-w-[3.25rem] max-w-[3.25rem]",t="min-w-[2.5rem] max-w-[2.5rem]",n=["flex items-center justify-center","rounded-[2.5rem]","transition-all duration-200 ease-in-out","font-[var(--font-family-default)]","text-[length:var(--font-size-4)]","leading-normal","select-none","cursor-default"].join(" "),a="w-[3.25rem] h-[3.25rem]",l="w-[2.5rem] h-[2.5rem] p-[0.889rem]",i=["bg-[var(--color-card)]","text-[var(--color-system-text)]","border-none"].join(" "),c=["bg-[var(--color-card)]","text-[var(--color-popup)]","border border-solid border-[var(--color-popup)]","cursor-pointer"].join(" "),s=["bg-[var(--color-popup)]","text-[var(--color-card)]","border-none"].join(" "),m=["bg-[var(--color-popup)]","text-[var(--color-card)]","border-none","shadow-[inset_0_0_0_100px_var(--color-overlay-black-10)]"].join(" "),p=["bg-[var(--color-card)]","text-[var(--color-system-text)]","opacity-75","cursor-not-allowed"].join(" "),d=["bg-[var(--color-popup)]","text-[var(--color-card)]","border-none"].join(" "),x=["text-[0.875rem] lg:text-[1.125rem]","leading-normal","text-center","select-none","whitespace-nowrap","overflow-hidden","text-ellipsis","transition-colors duration-200 ease-in-out","font-[var(--font-family-default)]"].join(" "),u=["text-[var(--color-system-text)]","font-normal"].join(" "),v=["text-[var(--color-popup)]","font-normal"].join(" "),f=["text-[var(--color-popup)]","font-bold"].join(" "),j=["text-[var(--color-system-text)]","font-normal"].join(" "),b=["text-[var(--color-popup)]","font-normal"].join(" "),g=["w-full flex items-center min-w-0","px-[0.5rem] lg:px-[1.5rem]"].join(" "),w="h-[3.25rem]",y="h-[2.5rem]",h=["w-full h-px","rounded-[2.677rem]","transition-colors duration-200 ease-in-out"].join(" "),_=["bg-[var(--color-system-text)]"].join(" "),k=["bg-[var(--color-popup)]"].join(" ");export{k as connectorActiveStyles,g as connectorContainerBaseStyles,w as connectorContainerLargeStyles,y as connectorContainerSmallStyles,_ as connectorInactiveStyles,h as connectorLineStyles,o as containerStyles,n as stepCircleBaseStyles,d as stepCircleCompletedStyles,p as stepCircleDisabledStyles,c as stepCircleHoverStyles,a as stepCircleLargeStyles,i as stepCircleRestStyles,m as stepCircleSelectedHoverStyles,s as stepCircleSelectedStyles,l as stepCircleSmallStyles,r as stepItemContainerBaseStyles,e as stepItemContainerLargeStyles,t as stepItemContainerSmallStyles,x as stepLabelBaseStyles,b as stepLabelCompletedStyles,j as stepLabelDisabledStyles,v as stepLabelHoverStyles,u as stepLabelRestStyles,f as stepLabelSelectedStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/stepper/Stepper.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Stepper.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/stepper/Stepper.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,iBAAiB,CAAC;AA4LvF,eAAO,MAAM,OAAO,yGAsFnB,CAAC;AAIF,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/** Grid: step columns (fixed) and connector columns (1fr) so gap from circle to line is fixed. */
|
|
1
2
|
export declare const containerStyles: string;
|
|
2
3
|
export declare const stepItemContainerBaseStyles: string;
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
4
|
+
/** Step column width: circle size so space to connector starts from circle. */
|
|
5
|
+
export declare const stepItemContainerLargeStyles = "min-w-[3.25rem] max-w-[3.25rem]";
|
|
6
|
+
export declare const stepItemContainerSmallStyles = "min-w-[2.5rem] max-w-[2.5rem]";
|
|
5
7
|
export declare const stepCircleBaseStyles: string;
|
|
6
8
|
/** Large: 52px (3.25rem) circle. */
|
|
7
9
|
export declare const stepCircleLargeStyles = "w-[3.25rem] h-[3.25rem]";
|
|
@@ -19,6 +21,7 @@ export declare const stepLabelHoverStyles: string;
|
|
|
19
21
|
export declare const stepLabelSelectedStyles: string;
|
|
20
22
|
export declare const stepLabelDisabledStyles: string;
|
|
21
23
|
export declare const stepLabelCompletedStyles: string;
|
|
24
|
+
/** Fill grid cell so the line is visible; gap from circle to line: 8px mobile/tablet, 24px desktop. */
|
|
22
25
|
export declare const connectorContainerBaseStyles: string;
|
|
23
26
|
export declare const connectorContainerLargeStyles = "h-[3.25rem]";
|
|
24
27
|
export declare const connectorContainerSmallStyles = "h-[2.5rem]";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/stepper/Stepper.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,QAE3B,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAI7B,CAAC;AAEZ,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"Stepper.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/stepper/Stepper.styles.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,eAAO,MAAM,eAAe,QAE3B,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAI7B,CAAC;AAEZ,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,oCAAoC,CAAC;AAC9E,eAAO,MAAM,4BAA4B,kCAAkC,CAAC;AAE5E,eAAO,MAAM,oBAAoB,QAStB,CAAC;AAEZ,oCAAoC;AACpC,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAE/D,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,uCAAuC,CAAC;AAE1E,eAAO,MAAM,oBAAoB,QAItB,CAAC;AAEZ,eAAO,MAAM,qBAAqB,QAKvB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,QAI1B,CAAC;AAEZ,eAAO,MAAM,6BAA6B,QAK/B,CAAC;AAEZ,eAAO,MAAM,wBAAwB,QAK1B,CAAC;AAEZ,eAAO,MAAM,yBAAyB,QAI3B,CAAC;AAEZ,eAAO,MAAM,mBAAmB,QAUrB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,QAA+D,CAAC;AAEhG,eAAO,MAAM,oBAAoB,QAAyD,CAAC;AAE3F,eAAO,MAAM,uBAAuB,QAAuD,CAAC;AAE5F,eAAO,MAAM,uBAAuB,QAA+D,CAAC;AAEpG,eAAO,MAAM,wBAAwB,QAAyD,CAAC;AAE/F,uGAAuG;AACvG,eAAO,MAAM,4BAA4B,QAG9B,CAAC;AAEZ,eAAO,MAAM,6BAA6B,gBAAgB,CAAC;AAC3D,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAE1D,eAAO,MAAM,mBAAmB,QAIrB,CAAC;AAEZ,eAAO,MAAM,uBAAuB,QAA8C,CAAC;AAEnF,eAAO,MAAM,qBAAqB,QAAwC,CAAC"}
|