@forgedevstack/bear 1.2.8 → 1.2.9
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/components/StatCard/StatCard.cjs +1 -1
- package/dist/components/StatCard/StatCard.const.cjs +1 -0
- package/dist/components/StatCard/StatCard.const.d.ts +11 -1
- package/dist/components/StatCard/StatCard.const.js +14 -0
- package/dist/components/StatCard/StatCard.d.ts +0 -4
- package/dist/components/StatCard/StatCard.js +44 -32
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.d.ts +23 -11
- package/dist/components/Stepper/Stepper.const.js +60 -48
- package/dist/components/Stepper/Stepper.js +126 -118
- package/dist/styles.css +28 -20
- package/package.json +1 -1
|
@@ -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"),D=require("../../utils/cn.cjs");require("react");const o=require("../../utils/generateBearId.utils.cjs"),R=require("../../utils/useBearId.cjs"),e=require("./StatCard.const.cjs"),L=({title:_,value:a,color:s=e.DEFAULT_STAT_CARD_COLOR,icon:T,onClick:t,className:S,id:d,testId:n,...i})=>{const u=R.useBearId("StatCard"),C=o.resolveBearId(d,u),c=`linear-gradient(135deg, ${s}${e.STAT_CARD_GRADIENT_START_ALPHA}, ${s}${e.STAT_CARD_GRADIENT_END_ALPHA})`;return A.jsxs("div",{id:C,"data-testid":n,role:t?"button":void 0,tabIndex:t?0:void 0,className:D.cn(e.STAT_CARD_ROOT_CLASS,e.STAT_CARD_BASE_CLASSES,S),style:{background:c},onClick:t,onKeyDown:r=>{t&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())},...i,children:[A.jsx("div",{className:e.STAT_CARD_DECORATION_CLASS,"aria-hidden":!0}),A.jsxs("div",{className:e.STAT_CARD_BODY_CLASS,children:[A.jsx("p",{className:e.STAT_CARD_TITLE_CLASS,children:_}),A.jsx("p",{className:e.STAT_CARD_VALUE_CLASS,children:a}),t&&A.jsxs("button",{type:"button",className:e.STAT_CARD_ACTION_CLASS,children:[T,e.DEFAULT_STAT_CARD_ACTION_LABEL]})]})]})};exports.StatCard=L;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-StatCard",A="bear-relative bear-overflow-hidden bear-rounded-2xl bear-p-6 bear-transition-transform hover:bear-scale-105 bear-cursor-pointer bear-border bear-border-[var(--bear-border-default)]",r="Bear-StatCard__decoration bear-absolute bear-top-0 bear-right-0 bear-w-32 bear-h-32 -bear-mr-8 -bear-mt-8 bear-rounded-full bear-opacity-20 bear-bg-white",_="Bear-StatCard__body bear-relative bear-z-10",a="Bear-StatCard__title bear-text-white/80 bear-text-sm bear-font-medium bear-mb-1",t="Bear-StatCard__value bear-text-white bear-text-3xl bear-font-bold bear-mb-4",T="Bear-StatCard__action bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-1.5 bear-bg-white/20 hover:bear-bg-white/30 bear-rounded-full bear-text-white bear-text-sm bear-font-medium bear-transition-colors bear-border-0",S="#6366f1",b="dd",C="99",o="View All";exports.DEFAULT_STAT_CARD_ACTION_LABEL=o;exports.DEFAULT_STAT_CARD_COLOR=S;exports.STAT_CARD_ACTION_CLASS=T;exports.STAT_CARD_BASE_CLASSES=A;exports.STAT_CARD_BODY_CLASS=_;exports.STAT_CARD_DECORATION_CLASS=r;exports.STAT_CARD_GRADIENT_END_ALPHA=C;exports.STAT_CARD_GRADIENT_START_ALPHA=b;exports.STAT_CARD_ROOT_CLASS=e;exports.STAT_CARD_TITLE_CLASS=a;exports.STAT_CARD_VALUE_CLASS=t;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const STAT_CARD_ROOT_CLASS = "Bear-StatCard";
|
|
2
|
+
export declare const STAT_CARD_BASE_CLASSES = "bear-relative bear-overflow-hidden bear-rounded-2xl bear-p-6 bear-transition-transform hover:bear-scale-105 bear-cursor-pointer bear-border bear-border-[var(--bear-border-default)]";
|
|
3
|
+
export declare const STAT_CARD_DECORATION_CLASS = "Bear-StatCard__decoration bear-absolute bear-top-0 bear-right-0 bear-w-32 bear-h-32 -bear-mr-8 -bear-mt-8 bear-rounded-full bear-opacity-20 bear-bg-white";
|
|
4
|
+
export declare const STAT_CARD_BODY_CLASS = "Bear-StatCard__body bear-relative bear-z-10";
|
|
5
|
+
export declare const STAT_CARD_TITLE_CLASS = "Bear-StatCard__title bear-text-white/80 bear-text-sm bear-font-medium bear-mb-1";
|
|
6
|
+
export declare const STAT_CARD_VALUE_CLASS = "Bear-StatCard__value bear-text-white bear-text-3xl bear-font-bold bear-mb-4";
|
|
7
|
+
export declare const STAT_CARD_ACTION_CLASS = "Bear-StatCard__action bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-1.5 bear-bg-white/20 hover:bear-bg-white/30 bear-rounded-full bear-text-white bear-text-sm bear-font-medium bear-transition-colors bear-border-0";
|
|
8
|
+
export declare const DEFAULT_STAT_CARD_COLOR = "#6366f1";
|
|
9
|
+
export declare const STAT_CARD_GRADIENT_START_ALPHA = "dd";
|
|
10
|
+
export declare const STAT_CARD_GRADIENT_END_ALPHA = "99";
|
|
11
|
+
export declare const DEFAULT_STAT_CARD_ACTION_LABEL = "View All";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const e = "Bear-StatCard", r = "bear-relative bear-overflow-hidden bear-rounded-2xl bear-p-6 bear-transition-transform hover:bear-scale-105 bear-cursor-pointer bear-border bear-border-[var(--bear-border-default)]", a = "Bear-StatCard__decoration bear-absolute bear-top-0 bear-right-0 bear-w-32 bear-h-32 -bear-mr-8 -bear-mt-8 bear-rounded-full bear-opacity-20 bear-bg-white", t = "Bear-StatCard__body bear-relative bear-z-10", b = "Bear-StatCard__title bear-text-white/80 bear-text-sm bear-font-medium bear-mb-1", _ = "Bear-StatCard__value bear-text-white bear-text-3xl bear-font-bold bear-mb-4", A = "Bear-StatCard__action bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-1.5 bear-bg-white/20 hover:bear-bg-white/30 bear-rounded-full bear-text-white bear-text-sm bear-font-medium bear-transition-colors bear-border-0", o = "#6366f1", S = "dd", T = "99", C = "View All";
|
|
2
|
+
export {
|
|
3
|
+
C as DEFAULT_STAT_CARD_ACTION_LABEL,
|
|
4
|
+
o as DEFAULT_STAT_CARD_COLOR,
|
|
5
|
+
A as STAT_CARD_ACTION_CLASS,
|
|
6
|
+
r as STAT_CARD_BASE_CLASSES,
|
|
7
|
+
t as STAT_CARD_BODY_CLASS,
|
|
8
|
+
a as STAT_CARD_DECORATION_CLASS,
|
|
9
|
+
T as STAT_CARD_GRADIENT_END_ALPHA,
|
|
10
|
+
S as STAT_CARD_GRADIENT_START_ALPHA,
|
|
11
|
+
e as STAT_CARD_ROOT_CLASS,
|
|
12
|
+
b as STAT_CARD_TITLE_CLASS,
|
|
13
|
+
_ as STAT_CARD_VALUE_CLASS
|
|
14
|
+
};
|
|
@@ -1,37 +1,49 @@
|
|
|
1
|
-
import { jsxs as e, jsx as
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { cn as n } from "../../utils/cn.js";
|
|
3
3
|
import "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
import { resolveBearId as R } from "../../utils/generateBearId.utils.js";
|
|
5
|
+
import { useBearId as L } from "../../utils/useBearId.js";
|
|
6
|
+
import { DEFAULT_STAT_CARD_COLOR as E, STAT_CARD_GRADIENT_START_ALPHA as N, STAT_CARD_GRADIENT_END_ALPHA as c, STAT_CARD_DECORATION_CLASS as p, STAT_CARD_BODY_CLASS as I, STAT_CARD_TITLE_CLASS as l, STAT_CARD_VALUE_CLASS as u, DEFAULT_STAT_CARD_ACTION_LABEL as O, STAT_CARD_ACTION_CLASS as f, STAT_CARD_BASE_CLASSES as h, STAT_CARD_ROOT_CLASS as b } from "./StatCard.const.js";
|
|
7
|
+
const U = ({
|
|
8
|
+
title: t,
|
|
9
|
+
value: S,
|
|
10
|
+
color: T = E,
|
|
11
|
+
icon: a,
|
|
12
|
+
onClick: A,
|
|
13
|
+
className: d,
|
|
14
|
+
id: s,
|
|
15
|
+
testId: o,
|
|
16
|
+
...D
|
|
17
|
+
}) => {
|
|
18
|
+
const i = L("StatCard"), C = R(s, i), m = `linear-gradient(135deg, ${T}${N}, ${T}${c})`;
|
|
19
|
+
return /* @__PURE__ */ e(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
id: C,
|
|
23
|
+
"data-testid": o,
|
|
24
|
+
role: A ? "button" : void 0,
|
|
25
|
+
tabIndex: A ? 0 : void 0,
|
|
26
|
+
className: n(b, h, d),
|
|
27
|
+
style: { background: m },
|
|
28
|
+
onClick: A,
|
|
29
|
+
onKeyDown: (_) => {
|
|
30
|
+
A && (_.key === "Enter" || _.key === " ") && (_.preventDefault(), A());
|
|
31
|
+
},
|
|
32
|
+
...D,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ r("div", { className: p, "aria-hidden": !0 }),
|
|
35
|
+
/* @__PURE__ */ e("div", { className: I, children: [
|
|
36
|
+
/* @__PURE__ */ r("p", { className: l, children: t }),
|
|
37
|
+
/* @__PURE__ */ r("p", { className: u, children: S }),
|
|
38
|
+
A && /* @__PURE__ */ e("button", { type: "button", className: f, children: [
|
|
39
|
+
a,
|
|
40
|
+
O
|
|
41
|
+
] })
|
|
30
42
|
] })
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
35
47
|
export {
|
|
36
|
-
|
|
48
|
+
U as StatCard
|
|
37
49
|
};
|
|
@@ -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"),T=require("react"),H=require("../../context/BearProvider.cjs"),ee=require("../../utils/maxVisible.utils.cjs"),E=require("../../utils/cn.cjs"),F=require("../Typography/Typography.cjs"),ne=require("../Dropdown/Dropdown.cjs"),re=require("../Icon/index.cjs"),e=require("./Stepper.const.cjs"),L=require("./Stepper.utils.cjs"),te=1200,se=16,oe=640,U=3,ie=()=>r.jsx("svg",{width:e.CHECK_ICON_SIZE,height:e.CHECK_ICON_SIZE,viewBox:e.CHECK_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:r.jsx("polyline",{points:e.CHECK_ICON_POINTS})}),Ee=()=>r.jsxs("svg",{width:e.ERROR_ICON_SIZE,height:e.ERROR_ICON_SIZE,viewBox:e.ERROR_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),V=T.forwardRef(({steps:o,activeStep:_,onStepClick:d,orientation:W=e.DEFAULT_ORIENTATION,size:u=e.DEFAULT_SIZE,showNumbers:M=e.DEFAULT_SHOW_NUMBERS,clickable:R=e.DEFAULT_CLICKABLE,showConnectors:q=e.DEFAULT_SHOW_CONNECTORS,connectorStyle:m=e.DEFAULT_CONNECTOR_STYLE,alternativeLabel:g=e.DEFAULT_ALTERNATIVE_LABEL,completedIcon:Z,errorIcon:z,labelTypographyProps:K,descriptionTypographyProps:X,maxVisibleSteps:N,testId:Y,className:$,...k},G)=>{const P=H.useBearThemeOptional(),{direction:f}=H.useBearDirectionOptional(),[A,J]=T.useState(()=>typeof window<"u"?window.innerWidth:te);T.useEffect(()=>{const n=()=>J(window.innerWidth);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]);const S=T.useMemo(()=>{if(N!=null)return ee.resolveMaxVisible(N,{width:A,theme:P});if(A<oe&&o.length>U)return U},[N,A,P,o.length]),a=W==="horizontal",v=e.STEP_INDICATOR_SIZES[u],j=e.STEP_LABEL_SIZES[u],C=a&&S!=null&&o.length>S,{visibleIndices:B,leftHidden:w,rightHidden:h}=T.useMemo(()=>{if(!C||S==null)return{visibleIndices:o.map((l,I)=>I),leftHidden:[],rightHidden:[]};const n=S,t=Math.floor(n/2),s=Math.max(0,Math.min(_-t,o.length-n)),i=Array.from({length:n},(l,I)=>s+I),c=[],p=[];for(let l=0;l<s;l++)c.push(l);for(let l=s+n;l<o.length;l++)p.push(l);return{visibleIndices:i,leftHidden:c,rightHidden:p}},[C,S,o,_]),b=(n,t,s)=>{const i=e.STEP_STATUS_CLASSES[s],c=L.resolveIndicatorContent(n,t,s,M,Z,z,r.jsx(ie,{}),r.jsx(Ee,{}));return r.jsx("div",{className:E.cn(e.STEP_INDICATOR_BASE,v,i.indicator,R&&!n.disabled&&e.STEP_CLICKABLE_CLASSES),onClick:()=>{R&&!n.disabled&&d&&d(t)},children:c})},O=(n,t)=>{if(!q||t)return null;const s=n<_;return a?r.jsx("div",{className:E.cn(e.CONNECTOR_HORIZONTAL_LAYOUT,s?e.CONNECTOR_STATUS.completed:e.CONNECTOR_STATUS.pending,m==="dashed"&&e.CONNECTOR_DASHED_CLASSES)}):r.jsx("div",{className:E.cn(e.CONNECTOR_BASE,e.CONNECTOR_VERTICAL,s?e.CONNECTOR_STATUS.completed:e.CONNECTOR_STATUS.pending,m==="dashed"&&e.CONNECTOR_DASHED_CLASSES)})},x=(n,t)=>{const s=e.STEP_STATUS_CLASSES[t],i={...K,...n.labelTypographyProps},c={...X,...n.descriptionTypographyProps};return r.jsxs(r.Fragment,{children:[r.jsx(F.Typography,{variant:"body2",...i,className:E.cn(e.STEP_LABEL_BASE,j.label,s.label,i==null?void 0:i.className),children:n.label}),n.description&&r.jsx(F.Typography,{variant:"caption",...c,className:E.cn(e.STEP_DESCRIPTION_CLASSES,j.description,c==null?void 0:c.className),children:n.description})]})},y=(n,t)=>{const s=L.resolveStepStatus(n,t,_);return r.jsxs("div",{className:E.cn(e.STEP_CONTENT_BASE,g?e.STEP_CONTENT_ALTERNATIVE:e.STEP_CONTENT_INLINE),children:[b(n,t,s),r.jsx("div",{className:E.cn(g?e.STEP_LABEL_ALTERNATIVE:e.STEP_LABEL_INLINE),children:x(n,s)})]})},Q=(n,t)=>{const s=L.resolveStepStatus(n,t,_);return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:e.STEP_VERTICAL_INDICATOR_WRAP,children:b(n,t,s)}),r.jsxs("div",{className:e.STEP_VERTICAL_BODY,children:[x(n,s),n.content&&s==="active"&&r.jsx("div",{className:e.STEP_VERTICAL_CONTENT,children:n.content})]})]})},D=(n,t)=>r.jsx("div",{className:e.STEP_OVERFLOW_ROOT,children:r.jsx(ne.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:r.jsx("button",{type:"button",className:E.cn(e.STEP_INDICATOR_BASE,v,e.STEP_STATUS_CLASSES.pending.indicator,"bear-cursor-pointer bear-border-0"),"aria-label":t==="left"?e.OVERFLOW_LEFT_LABEL:e.OVERFLOW_RIGHT_LABEL,children:r.jsx(re.BearIcons.MoreHorizIcon,{size:se})}),items:n.map(s=>({key:`step-${s}`,label:o[s].label,disabled:o[s].disabled,onClick:()=>{o[s].disabled||d==null||d(s)}}))})},`overflow-${t}`);return r.jsxs("div",{ref:G,dir:f,className:E.cn(e.STEPPER_BASE_CLASSES,a?e.STEPPER_HORIZONTAL_CLASSES:e.STEPPER_VERTICAL_CLASSES,f==="rtl"&&a&&"bear-flex-row-reverse",$),"data-testid":Y,...k,children:[a&&!C&&o.map((n,t)=>r.jsxs(T.Fragment,{children:[y(n,t),O(t,t===o.length-1)]},t)),a&&C&&r.jsxs(r.Fragment,{children:[w.length>0&&r.jsxs(r.Fragment,{children:[D(w,"left"),O(-1,!1)]}),B.map((n,t)=>{const s=o[n],i=t===B.length-1&&h.length===0;return r.jsxs(T.Fragment,{children:[y(s,n),O(n,i)]},n)}),h.length>0&&D(h,"right")]}),!a&&o.map((n,t)=>r.jsxs("div",{className:E.cn("Bear-Stepper__step",e.STEP_WRAPPER_VERTICAL),children:[Q(n,t),O(t,t===o.length-1)]},t))]})});V.displayName="Stepper";exports.Stepper=V;
|
|
@@ -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="horizontal",_="md",t=!0,T=!0,a="solid",S=!1,L=!1,A="Previous",b="Next",O="Complete",C=(e,E)=>`Step ${e} of ${E}`,o=0,n=1,s=1,N="Previous steps",R="More steps",I=16,c="0 0 24 24",P="20 6 9 17 4 12",l=16,i="0 0 24 24",B="Bear-Stepper",x="bear-flex bear-w-full bear-items-center",p="bear-flex bear-flex-col",F="bear-relative bear-flex bear-items-start bear-pb-8 last:bear-pb-0",d="Bear-Stepper__indicator bear-flex bear-items-center bear-justify-center bear-rounded-full bear-font-medium bear-transition-all",D={sm:"bear-w-6 bear-h-6 bear-text-xs",md:"bear-w-8 bear-h-8 bear-text-sm",lg:"bear-w-10 bear-h-10 bear-text-base"},U={pending:{indicator:"bear-bg-gray-200 dark:bear-bg-zinc-700 bear-text-gray-600 dark:bear-text-gray-400",label:"bear-text-gray-500 dark:bear-text-gray-400"},active:{indicator:"bear-bg-primary-500 dark:bear-bg-primary-500 bear-text-white bear-shadow-lg bear-shadow-primary-500/30",label:"bear-text-gray-900 dark:bear-text-white bear-font-medium"},completed:{indicator:"bear-bg-green-500 bear-text-white",label:"bear-text-gray-700 dark:bear-text-gray-300"},error:{indicator:"bear-bg-red-500 bear-text-white",label:"bear-text-red-500 dark:bear-text-red-400"}},g="Bear-Stepper__connector bear-absolute bear-transition-colors",m="bear-left-4 bear-top-8 bear-w-0.5 bear-h-full -bear-translate-x-1/2",V={pending:"bear-bg-gray-200 dark:bear-bg-zinc-700",completed:"bear-bg-green-500"},f="Bear-Stepper__label bear-transition-colors",h={sm:{label:"bear-text-xs",description:"bear-text-[10px]"},md:{label:"bear-text-sm",description:"bear-text-xs"},lg:{label:"bear-text-base",description:"bear-text-sm"}},H="bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5",W="bear-cursor-pointer hover:bear-scale-105",w="Bear-Stepper__connector bear-flex-1 bear-self-center bear-mx-1 bear-h-0.5 bear-min-w-[12px] bear-transition-colors",y="bear-border-t-2 bear-border-dashed bear-bg-transparent",u="Bear-Stepper__content bear-flex bear-shrink-0",Z="bear-flex-col bear-items-center",k="bear-items-center bear-gap-2",K="bear-text-center bear-mt-2 bear-whitespace-nowrap",M="bear-whitespace-nowrap",X="bear-flex-shrink-0 bear-mr-4",v="bear-flex-1 bear-pt-0.5",Y="bear-mt-4",z="Bear-Stepper__overflow bear-shrink-0";exports.CHECK_ICON_POINTS=P;exports.CHECK_ICON_SIZE=I;exports.CHECK_ICON_VIEWBOX=c;exports.CONNECTOR_BASE=g;exports.CONNECTOR_DASHED_CLASSES=y;exports.CONNECTOR_HORIZONTAL_LAYOUT=w;exports.CONNECTOR_STATUS=V;exports.CONNECTOR_VERTICAL=m;exports.DEFAULT_ALTERNATIVE_LABEL=L;exports.DEFAULT_CLICKABLE=S;exports.DEFAULT_COMPLETE_LABEL=O;exports.DEFAULT_CONNECTOR_STYLE=a;exports.DEFAULT_INDICATOR_FORMAT=C;exports.DEFAULT_NEXT_LABEL=b;exports.DEFAULT_ORIENTATION=r;exports.DEFAULT_PREV_LABEL=A;exports.DEFAULT_SHOW_CONNECTORS=T;exports.DEFAULT_SHOW_NUMBERS=t;exports.DEFAULT_SIZE=_;exports.ERROR_ICON_SIZE=l;exports.ERROR_ICON_VIEWBOX=i;exports.FIRST_STEP_INDEX=o;exports.LAST_STEP_OFFSET=s;exports.OVERFLOW_LEFT_LABEL=N;exports.OVERFLOW_RIGHT_LABEL=R;exports.STEPPER_BASE_CLASSES=B;exports.STEPPER_HORIZONTAL_CLASSES=x;exports.STEPPER_VERTICAL_CLASSES=p;exports.STEP_CLICKABLE_CLASSES=W;exports.STEP_CONTENT_ALTERNATIVE=Z;exports.STEP_CONTENT_BASE=u;exports.STEP_CONTENT_INLINE=k;exports.STEP_DESCRIPTION_CLASSES=H;exports.STEP_INDICATOR_BASE=d;exports.STEP_INDICATOR_SIZES=D;exports.STEP_LABEL_ALTERNATIVE=K;exports.STEP_LABEL_BASE=f;exports.STEP_LABEL_INLINE=M;exports.STEP_LABEL_SIZES=h;exports.STEP_NUMBER_OFFSET=n;exports.STEP_OVERFLOW_ROOT=z;exports.STEP_STATUS_CLASSES=U;exports.STEP_VERTICAL_BODY=v;exports.STEP_VERTICAL_CONTENT=Y;exports.STEP_VERTICAL_INDICATOR_WRAP=X;exports.STEP_WRAPPER_VERTICAL=F;
|
|
@@ -21,20 +21,20 @@ export declare const CHECK_ICON_POINTS = "20 6 9 17 4 12";
|
|
|
21
21
|
export declare const ERROR_ICON_SIZE = 16;
|
|
22
22
|
export declare const ERROR_ICON_VIEWBOX = "0 0 24 24";
|
|
23
23
|
export declare const STEPPER_BASE_CLASSES = "Bear-Stepper";
|
|
24
|
-
export declare const STEPPER_HORIZONTAL_CLASSES = "flex w-full items-center";
|
|
25
|
-
export declare const STEPPER_VERTICAL_CLASSES = "flex flex-col";
|
|
26
|
-
export declare const STEP_WRAPPER_HORIZONTAL = "relative shrink-0 flex-1 min-w-[80px]";
|
|
27
|
-
export declare const STEP_WRAPPER_HORIZONTAL_WINDOW = "relative min-w-[5rem] max-w-[9rem] shrink-0";
|
|
28
|
-
export declare const STEP_WRAPPER_VERTICAL = "relative flex items-start pb-8 last:pb-0";
|
|
29
|
-
export declare const STEP_INDICATOR_BASE = "Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all";
|
|
24
|
+
export declare const STEPPER_HORIZONTAL_CLASSES = "bear-flex bear-w-full bear-items-center";
|
|
25
|
+
export declare const STEPPER_VERTICAL_CLASSES = "bear-flex bear-flex-col";
|
|
26
|
+
export declare const STEP_WRAPPER_HORIZONTAL = "bear-relative bear-shrink-0 bear-flex-1 bear-min-w-[80px]";
|
|
27
|
+
export declare const STEP_WRAPPER_HORIZONTAL_WINDOW = "bear-relative bear-min-w-[5rem] bear-max-w-[9rem] bear-shrink-0";
|
|
28
|
+
export declare const STEP_WRAPPER_VERTICAL = "bear-relative bear-flex bear-items-start bear-pb-8 last:bear-pb-0";
|
|
29
|
+
export declare const STEP_INDICATOR_BASE = "Bear-Stepper__indicator bear-flex bear-items-center bear-justify-center bear-rounded-full bear-font-medium bear-transition-all";
|
|
30
30
|
export declare const STEP_INDICATOR_SIZES: Record<StepperSize, string>;
|
|
31
31
|
export declare const STEP_STATUS_CLASSES: Record<StepStatus, {
|
|
32
32
|
indicator: string;
|
|
33
33
|
label: string;
|
|
34
34
|
}>;
|
|
35
|
-
export declare const CONNECTOR_BASE = "Bear-Stepper__connector absolute transition-colors";
|
|
36
|
-
export declare const CONNECTOR_HORIZONTAL = "top-4 h-0.5 -translate-y-1/2";
|
|
37
|
-
export declare const CONNECTOR_VERTICAL = "left-4 top-8 w-0.5 h-full -translate-x-1/2";
|
|
35
|
+
export declare const CONNECTOR_BASE = "Bear-Stepper__connector bear-absolute bear-transition-colors";
|
|
36
|
+
export declare const CONNECTOR_HORIZONTAL = "bear-top-4 bear-h-0.5 -bear-translate-y-1/2";
|
|
37
|
+
export declare const CONNECTOR_VERTICAL = "bear-left-4 bear-top-8 bear-w-0.5 bear-h-full -bear-translate-x-1/2";
|
|
38
38
|
export declare const CONNECTOR_STYLES: {
|
|
39
39
|
solid: string;
|
|
40
40
|
dashed: string;
|
|
@@ -43,9 +43,21 @@ export declare const CONNECTOR_STATUS: {
|
|
|
43
43
|
pending: string;
|
|
44
44
|
completed: string;
|
|
45
45
|
};
|
|
46
|
-
export declare const STEP_LABEL_BASE = "Bear-Stepper__label transition-colors";
|
|
46
|
+
export declare const STEP_LABEL_BASE = "Bear-Stepper__label bear-transition-colors";
|
|
47
47
|
export declare const STEP_LABEL_SIZES: Record<StepperSize, {
|
|
48
48
|
label: string;
|
|
49
49
|
description: string;
|
|
50
50
|
}>;
|
|
51
|
-
export declare const STEP_DESCRIPTION_CLASSES = "text-gray-500 dark:text-gray-400 mt-0.5";
|
|
51
|
+
export declare const STEP_DESCRIPTION_CLASSES = "bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5";
|
|
52
|
+
export declare const STEP_CLICKABLE_CLASSES = "bear-cursor-pointer hover:bear-scale-105";
|
|
53
|
+
export declare const CONNECTOR_HORIZONTAL_LAYOUT = "Bear-Stepper__connector bear-flex-1 bear-self-center bear-mx-1 bear-h-0.5 bear-min-w-[12px] bear-transition-colors";
|
|
54
|
+
export declare const CONNECTOR_DASHED_CLASSES = "bear-border-t-2 bear-border-dashed bear-bg-transparent";
|
|
55
|
+
export declare const STEP_CONTENT_BASE = "Bear-Stepper__content bear-flex bear-shrink-0";
|
|
56
|
+
export declare const STEP_CONTENT_ALTERNATIVE = "bear-flex-col bear-items-center";
|
|
57
|
+
export declare const STEP_CONTENT_INLINE = "bear-items-center bear-gap-2";
|
|
58
|
+
export declare const STEP_LABEL_ALTERNATIVE = "bear-text-center bear-mt-2 bear-whitespace-nowrap";
|
|
59
|
+
export declare const STEP_LABEL_INLINE = "bear-whitespace-nowrap";
|
|
60
|
+
export declare const STEP_VERTICAL_INDICATOR_WRAP = "bear-flex-shrink-0 bear-mr-4";
|
|
61
|
+
export declare const STEP_VERTICAL_BODY = "bear-flex-1 bear-pt-0.5";
|
|
62
|
+
export declare const STEP_VERTICAL_CONTENT = "bear-mt-4";
|
|
63
|
+
export declare const STEP_OVERFLOW_ROOT = "Bear-Stepper__overflow bear-shrink-0";
|
|
@@ -1,65 +1,77 @@
|
|
|
1
|
-
const
|
|
2
|
-
sm: "w-6 h-6 text-xs",
|
|
3
|
-
md: "w-8 h-8 text-sm",
|
|
4
|
-
lg: "w-10 h-10 text-base"
|
|
5
|
-
},
|
|
1
|
+
const t = "horizontal", a = "md", b = !0, E = !0, o = "solid", _ = !1, n = !1, s = "Previous", T = "Next", c = "Complete", S = (e, r) => `Step ${e} of ${r}`, L = 0, A = 1, l = 1, i = "Previous steps", O = "More steps", C = 16, N = "0 0 24 24", R = "20 6 9 17 4 12", I = 16, x = "0 0 24 24", p = "Bear-Stepper", d = "bear-flex bear-w-full bear-items-center", P = "bear-flex bear-flex-col", g = "bear-relative bear-flex bear-items-start bear-pb-8 last:bear-pb-0", m = "Bear-Stepper__indicator bear-flex bear-items-center bear-justify-center bear-rounded-full bear-font-medium bear-transition-all", B = {
|
|
2
|
+
sm: "bear-w-6 bear-h-6 bear-text-xs",
|
|
3
|
+
md: "bear-w-8 bear-h-8 bear-text-sm",
|
|
4
|
+
lg: "bear-w-10 bear-h-10 bear-text-base"
|
|
5
|
+
}, f = {
|
|
6
6
|
pending: {
|
|
7
|
-
indicator: "bg-gray-200 dark:bg-zinc-700 text-gray-
|
|
8
|
-
label: "text-gray-500 dark:text-gray-400"
|
|
7
|
+
indicator: "bear-bg-gray-200 dark:bear-bg-zinc-700 bear-text-gray-600 dark:bear-text-gray-400",
|
|
8
|
+
label: "bear-text-gray-500 dark:bear-text-gray-400"
|
|
9
9
|
},
|
|
10
10
|
active: {
|
|
11
|
-
indicator: "bg-primary-500 text-white shadow-lg shadow-primary-500/30",
|
|
12
|
-
label: "text-gray-900 dark:text-white font-medium"
|
|
11
|
+
indicator: "bear-bg-primary-500 dark:bear-bg-primary-500 bear-text-white bear-shadow-lg bear-shadow-primary-500/30",
|
|
12
|
+
label: "bear-text-gray-900 dark:bear-text-white bear-font-medium"
|
|
13
13
|
},
|
|
14
14
|
completed: {
|
|
15
|
-
indicator: "bg-green-500 text-white",
|
|
16
|
-
label: "text-gray-700 dark:text-gray-300"
|
|
15
|
+
indicator: "bear-bg-green-500 bear-text-white",
|
|
16
|
+
label: "bear-text-gray-700 dark:bear-text-gray-300"
|
|
17
17
|
},
|
|
18
18
|
error: {
|
|
19
|
-
indicator: "bg-red-500 text-white",
|
|
20
|
-
label: "text-red-500 dark:text-red-400"
|
|
19
|
+
indicator: "bear-bg-red-500 bear-text-white",
|
|
20
|
+
label: "bear-text-red-500 dark:bear-text-red-400"
|
|
21
21
|
}
|
|
22
|
-
},
|
|
23
|
-
pending: "bg-gray-200 dark:bg-zinc-700",
|
|
24
|
-
completed: "bg-green-500"
|
|
25
|
-
},
|
|
26
|
-
sm: { label: "text-xs", description: "text-[10px]" },
|
|
27
|
-
md: { label: "text-sm", description: "text-xs" },
|
|
28
|
-
lg: { label: "text-base", description: "text-sm" }
|
|
29
|
-
},
|
|
22
|
+
}, F = "Bear-Stepper__connector bear-absolute bear-transition-colors", D = "bear-left-4 bear-top-8 bear-w-0.5 bear-h-full -bear-translate-x-1/2", h = {
|
|
23
|
+
pending: "bear-bg-gray-200 dark:bear-bg-zinc-700",
|
|
24
|
+
completed: "bear-bg-green-500"
|
|
25
|
+
}, w = "Bear-Stepper__label bear-transition-colors", U = {
|
|
26
|
+
sm: { label: "bear-text-xs", description: "bear-text-[10px]" },
|
|
27
|
+
md: { label: "bear-text-sm", description: "bear-text-xs" },
|
|
28
|
+
lg: { label: "bear-text-base", description: "bear-text-sm" }
|
|
29
|
+
}, y = "bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5", V = "bear-cursor-pointer hover:bear-scale-105", u = "Bear-Stepper__connector bear-flex-1 bear-self-center bear-mx-1 bear-h-0.5 bear-min-w-[12px] bear-transition-colors", k = "bear-border-t-2 bear-border-dashed bear-bg-transparent", H = "Bear-Stepper__content bear-flex bear-shrink-0", W = "bear-flex-col bear-items-center", Z = "bear-items-center bear-gap-2", v = "bear-text-center bear-mt-2 bear-whitespace-nowrap", K = "bear-whitespace-nowrap", M = "bear-flex-shrink-0 bear-mr-4", X = "bear-flex-1 bear-pt-0.5", z = "bear-mt-4", Y = "Bear-Stepper__overflow bear-shrink-0";
|
|
30
30
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
R as CHECK_ICON_POINTS,
|
|
32
|
+
C as CHECK_ICON_SIZE,
|
|
33
|
+
N as CHECK_ICON_VIEWBOX,
|
|
34
|
+
F as CONNECTOR_BASE,
|
|
35
|
+
k as CONNECTOR_DASHED_CLASSES,
|
|
36
|
+
u as CONNECTOR_HORIZONTAL_LAYOUT,
|
|
37
|
+
h as CONNECTOR_STATUS,
|
|
38
|
+
D as CONNECTOR_VERTICAL,
|
|
39
|
+
n as DEFAULT_ALTERNATIVE_LABEL,
|
|
40
|
+
_ as DEFAULT_CLICKABLE,
|
|
39
41
|
c as DEFAULT_COMPLETE_LABEL,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
o as DEFAULT_CONNECTOR_STYLE,
|
|
43
|
+
S as DEFAULT_INDICATOR_FORMAT,
|
|
42
44
|
T as DEFAULT_NEXT_LABEL,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
t as DEFAULT_ORIENTATION,
|
|
46
|
+
s as DEFAULT_PREV_LABEL,
|
|
47
|
+
E as DEFAULT_SHOW_CONNECTORS,
|
|
48
|
+
b as DEFAULT_SHOW_NUMBERS,
|
|
49
|
+
a as DEFAULT_SIZE,
|
|
48
50
|
I as ERROR_ICON_SIZE,
|
|
49
|
-
|
|
51
|
+
x as ERROR_ICON_VIEWBOX,
|
|
50
52
|
L as FIRST_STEP_INDEX,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
l as LAST_STEP_OFFSET,
|
|
54
|
+
i as OVERFLOW_LEFT_LABEL,
|
|
55
|
+
O as OVERFLOW_RIGHT_LABEL,
|
|
56
|
+
p as STEPPER_BASE_CLASSES,
|
|
57
|
+
d as STEPPER_HORIZONTAL_CLASSES,
|
|
56
58
|
P as STEPPER_VERTICAL_CLASSES,
|
|
57
|
-
|
|
59
|
+
V as STEP_CLICKABLE_CLASSES,
|
|
60
|
+
W as STEP_CONTENT_ALTERNATIVE,
|
|
61
|
+
H as STEP_CONTENT_BASE,
|
|
62
|
+
Z as STEP_CONTENT_INLINE,
|
|
63
|
+
y as STEP_DESCRIPTION_CLASSES,
|
|
58
64
|
m as STEP_INDICATOR_BASE,
|
|
59
65
|
B as STEP_INDICATOR_SIZES,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
v as STEP_LABEL_ALTERNATIVE,
|
|
67
|
+
w as STEP_LABEL_BASE,
|
|
68
|
+
K as STEP_LABEL_INLINE,
|
|
69
|
+
U as STEP_LABEL_SIZES,
|
|
70
|
+
A as STEP_NUMBER_OFFSET,
|
|
71
|
+
Y as STEP_OVERFLOW_ROOT,
|
|
72
|
+
f as STEP_STATUS_CLASSES,
|
|
73
|
+
X as STEP_VERTICAL_BODY,
|
|
74
|
+
z as STEP_VERTICAL_CONTENT,
|
|
75
|
+
M as STEP_VERTICAL_INDICATOR_WRAP,
|
|
76
|
+
g as STEP_WRAPPER_VERTICAL
|
|
65
77
|
};
|
|
@@ -1,117 +1,116 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as i, Fragment as O, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import F, { forwardRef as le, useState as Ee, useEffect as se, useMemo as U } from "react";
|
|
3
3
|
import { useBearThemeOptional as ae, useBearDirectionOptional as ce } from "../../context/BearProvider.js";
|
|
4
4
|
import { resolveMaxVisible as de } from "../../utils/maxVisible.utils.js";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as E } from "../../utils/cn.js";
|
|
6
6
|
import { Typography as M } from "../Typography/Typography.js";
|
|
7
|
-
import { Dropdown as
|
|
8
|
-
import { BearIcons as
|
|
9
|
-
import { STEP_WRAPPER_VERTICAL as
|
|
10
|
-
import { resolveStepStatus as
|
|
11
|
-
const
|
|
7
|
+
import { Dropdown as _e } from "../Dropdown/Dropdown.js";
|
|
8
|
+
import { BearIcons as Te } from "../Icon/index.js";
|
|
9
|
+
import { STEP_WRAPPER_VERTICAL as he, STEPPER_HORIZONTAL_CLASSES as Ne, STEPPER_VERTICAL_CLASSES as Oe, STEPPER_BASE_CLASSES as Se, DEFAULT_ORIENTATION as Ce, DEFAULT_SIZE as Ie, DEFAULT_SHOW_NUMBERS as Ae, DEFAULT_CLICKABLE as Le, DEFAULT_SHOW_CONNECTORS as me, DEFAULT_CONNECTOR_STYLE as Re, DEFAULT_ALTERNATIVE_LABEL as fe, STEP_LABEL_ALTERNATIVE as ue, STEP_LABEL_INLINE as ge, STEP_CONTENT_ALTERNATIVE as Pe, STEP_CONTENT_INLINE as ve, STEP_CONTENT_BASE as Be, CONNECTOR_DASHED_CLASSES as Z, CONNECTOR_STATUS as S, CONNECTOR_HORIZONTAL_LAYOUT as we, CONNECTOR_VERTICAL as be, CONNECTOR_BASE as pe, STEP_OVERFLOW_ROOT as He, OVERFLOW_LEFT_LABEL as We, OVERFLOW_RIGHT_LABEL as De, STEP_STATUS_CLASSES as m, STEP_INDICATOR_SIZES as Ve, STEP_INDICATOR_BASE as z, STEP_VERTICAL_INDICATOR_WRAP as ye, STEP_VERTICAL_BODY as Fe, STEP_VERTICAL_CONTENT as Ue, STEP_CLICKABLE_CLASSES as Me, STEP_LABEL_SIZES as Ze, STEP_LABEL_BASE as ze, STEP_DESCRIPTION_CLASSES as Ke, ERROR_ICON_VIEWBOX as Xe, ERROR_ICON_SIZE as K, CHECK_ICON_VIEWBOX as Ye, CHECK_ICON_SIZE as X, CHECK_ICON_POINTS as je } from "./Stepper.const.js";
|
|
10
|
+
import { resolveStepStatus as Y, resolveIndicatorContent as $e } from "./Stepper.utils.js";
|
|
11
|
+
const ke = 1200, Ge = 16, qe = 640, j = 3, Je = () => /* @__PURE__ */ t("svg", { width: X, height: X, viewBox: Ye, fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ t("polyline", { points: je }) }), Qe = () => /* @__PURE__ */ i("svg", { width: K, height: K, viewBox: Xe, fill: "none", stroke: "currentColor", strokeWidth: "3", children: [
|
|
12
12
|
/* @__PURE__ */ t("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
13
13
|
/* @__PURE__ */ t("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
14
|
-
] }),
|
|
14
|
+
] }), xe = le(
|
|
15
15
|
({
|
|
16
16
|
steps: o,
|
|
17
|
-
activeStep:
|
|
18
|
-
onStepClick:
|
|
19
|
-
orientation:
|
|
20
|
-
size:
|
|
21
|
-
showNumbers:
|
|
22
|
-
clickable:
|
|
23
|
-
showConnectors:
|
|
24
|
-
connectorStyle:
|
|
25
|
-
alternativeLabel:
|
|
26
|
-
completedIcon:
|
|
27
|
-
errorIcon:
|
|
28
|
-
labelTypographyProps:
|
|
29
|
-
descriptionTypographyProps:
|
|
30
|
-
maxVisibleSteps:
|
|
31
|
-
testId:
|
|
32
|
-
className:
|
|
33
|
-
...
|
|
34
|
-
},
|
|
35
|
-
const
|
|
17
|
+
activeStep: d,
|
|
18
|
+
onStepClick: _,
|
|
19
|
+
orientation: $ = Ce,
|
|
20
|
+
size: R = Ie,
|
|
21
|
+
showNumbers: k = Ae,
|
|
22
|
+
clickable: f = Le,
|
|
23
|
+
showConnectors: G = me,
|
|
24
|
+
connectorStyle: u = Re,
|
|
25
|
+
alternativeLabel: g = fe,
|
|
26
|
+
completedIcon: q,
|
|
27
|
+
errorIcon: J,
|
|
28
|
+
labelTypographyProps: Q,
|
|
29
|
+
descriptionTypographyProps: x,
|
|
30
|
+
maxVisibleSteps: C,
|
|
31
|
+
testId: ee,
|
|
32
|
+
className: re,
|
|
33
|
+
...ne
|
|
34
|
+
}, te) => {
|
|
35
|
+
const P = ae(), { direction: v } = ce(), [I, oe] = Ee(() => typeof window < "u" ? window.innerWidth : ke);
|
|
36
36
|
se(() => {
|
|
37
|
-
const e = () =>
|
|
37
|
+
const e = () => oe(window.innerWidth);
|
|
38
38
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
39
39
|
}, []);
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
return de(
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
45
|
-
}, [
|
|
46
|
-
if (!
|
|
40
|
+
const T = U(() => {
|
|
41
|
+
if (C != null)
|
|
42
|
+
return de(C, { width: I, theme: P });
|
|
43
|
+
if (I < qe && o.length > j)
|
|
44
|
+
return j;
|
|
45
|
+
}, [C, I, P, o.length]), c = $ === "horizontal", B = Ve[R], w = Ze[R], h = c && T != null && o.length > T, { visibleIndices: b, leftHidden: p, rightHidden: A } = U(() => {
|
|
46
|
+
if (!h || T == null)
|
|
47
47
|
return {
|
|
48
|
-
visibleIndices: o.map((
|
|
48
|
+
visibleIndices: o.map((a, L) => L),
|
|
49
49
|
leftHidden: [],
|
|
50
50
|
rightHidden: []
|
|
51
51
|
};
|
|
52
|
-
const e =
|
|
53
|
-
for (let
|
|
54
|
-
for (let
|
|
55
|
-
return { visibleIndices: l, leftHidden:
|
|
56
|
-
}, [
|
|
57
|
-
const l =
|
|
52
|
+
const e = T, r = Math.floor(e / 2), n = Math.max(0, Math.min(d - r, o.length - e)), l = Array.from({ length: e }, (a, L) => n + L), s = [], y = [];
|
|
53
|
+
for (let a = 0; a < n; a++) s.push(a);
|
|
54
|
+
for (let a = n + e; a < o.length; a++) y.push(a);
|
|
55
|
+
return { visibleIndices: l, leftHidden: s, rightHidden: y };
|
|
56
|
+
}, [h, T, o, d]), H = (e, r, n) => {
|
|
57
|
+
const l = m[n], s = $e(
|
|
58
58
|
e,
|
|
59
59
|
r,
|
|
60
60
|
n,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */ t(
|
|
65
|
-
/* @__PURE__ */ t(
|
|
61
|
+
k,
|
|
62
|
+
q,
|
|
63
|
+
J,
|
|
64
|
+
/* @__PURE__ */ t(Je, {}),
|
|
65
|
+
/* @__PURE__ */ t(Qe, {})
|
|
66
66
|
);
|
|
67
67
|
return /* @__PURE__ */ t(
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
70
|
-
className:
|
|
70
|
+
className: E(
|
|
71
71
|
z,
|
|
72
|
-
|
|
72
|
+
B,
|
|
73
73
|
l.indicator,
|
|
74
|
-
|
|
74
|
+
f && !e.disabled && Me
|
|
75
75
|
),
|
|
76
76
|
onClick: () => {
|
|
77
|
-
|
|
77
|
+
f && !e.disabled && _ && _(r);
|
|
78
78
|
},
|
|
79
|
-
children:
|
|
79
|
+
children: s
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
},
|
|
83
|
-
if (
|
|
84
|
-
const n = e <
|
|
85
|
-
return
|
|
82
|
+
}, N = (e, r) => {
|
|
83
|
+
if (!G || r) return null;
|
|
84
|
+
const n = e < d;
|
|
85
|
+
return c ? /* @__PURE__ */ t(
|
|
86
86
|
"div",
|
|
87
87
|
{
|
|
88
|
-
className:
|
|
89
|
-
|
|
90
|
-
"h-0.5 min-w-[12px] transition-colors",
|
|
88
|
+
className: E(
|
|
89
|
+
we,
|
|
91
90
|
n ? S.completed : S.pending,
|
|
92
|
-
|
|
91
|
+
u === "dashed" && Z
|
|
93
92
|
)
|
|
94
93
|
}
|
|
95
94
|
) : /* @__PURE__ */ t(
|
|
96
95
|
"div",
|
|
97
96
|
{
|
|
98
|
-
className:
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
className: E(
|
|
98
|
+
pe,
|
|
99
|
+
be,
|
|
101
100
|
n ? S.completed : S.pending,
|
|
102
|
-
|
|
101
|
+
u === "dashed" && Z
|
|
103
102
|
)
|
|
104
103
|
}
|
|
105
104
|
);
|
|
106
|
-
},
|
|
107
|
-
const n =
|
|
108
|
-
return /* @__PURE__ */ i(
|
|
105
|
+
}, W = (e, r) => {
|
|
106
|
+
const n = m[r], l = { ...Q, ...e.labelTypographyProps }, s = { ...x, ...e.descriptionTypographyProps };
|
|
107
|
+
return /* @__PURE__ */ i(O, { children: [
|
|
109
108
|
/* @__PURE__ */ t(
|
|
110
109
|
M,
|
|
111
110
|
{
|
|
112
111
|
variant: "body2",
|
|
113
112
|
...l,
|
|
114
|
-
className:
|
|
113
|
+
className: E(ze, w.label, n.label, l == null ? void 0 : l.className),
|
|
115
114
|
children: e.label
|
|
116
115
|
}
|
|
117
116
|
),
|
|
@@ -119,29 +118,38 @@ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", {
|
|
|
119
118
|
M,
|
|
120
119
|
{
|
|
121
120
|
variant: "caption",
|
|
122
|
-
...
|
|
123
|
-
className:
|
|
121
|
+
...s,
|
|
122
|
+
className: E(Ke, w.description, s == null ? void 0 : s.className),
|
|
124
123
|
children: e.description
|
|
125
124
|
}
|
|
126
125
|
)
|
|
127
126
|
] });
|
|
128
|
-
},
|
|
129
|
-
const n =
|
|
130
|
-
return /* @__PURE__ */ i(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
127
|
+
}, D = (e, r) => {
|
|
128
|
+
const n = Y(e, r, d);
|
|
129
|
+
return /* @__PURE__ */ i(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
className: E(
|
|
133
|
+
Be,
|
|
134
|
+
g ? Pe : ve
|
|
135
|
+
),
|
|
136
|
+
children: [
|
|
137
|
+
H(e, r, n),
|
|
138
|
+
/* @__PURE__ */ t("div", { className: E(g ? ue : ge), children: W(e, n) })
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}, ie = (e, r) => {
|
|
143
|
+
const n = Y(e, r, d);
|
|
144
|
+
return /* @__PURE__ */ i(O, { children: [
|
|
145
|
+
/* @__PURE__ */ t("div", { className: ye, children: H(e, r, n) }),
|
|
146
|
+
/* @__PURE__ */ i("div", { className: Fe, children: [
|
|
147
|
+
W(e, n),
|
|
148
|
+
e.content && n === "active" && /* @__PURE__ */ t("div", { className: Ue, children: e.content })
|
|
141
149
|
] })
|
|
142
150
|
] });
|
|
143
|
-
},
|
|
144
|
-
|
|
151
|
+
}, V = (e, r) => /* @__PURE__ */ t("div", { className: He, children: /* @__PURE__ */ t(
|
|
152
|
+
_e,
|
|
145
153
|
{
|
|
146
154
|
placement: "bottom-start",
|
|
147
155
|
closeOnSelect: !0,
|
|
@@ -149,14 +157,14 @@ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", {
|
|
|
149
157
|
"button",
|
|
150
158
|
{
|
|
151
159
|
type: "button",
|
|
152
|
-
className:
|
|
160
|
+
className: E(
|
|
153
161
|
z,
|
|
154
|
-
|
|
155
|
-
|
|
162
|
+
B,
|
|
163
|
+
m.pending.indicator,
|
|
156
164
|
"bear-cursor-pointer bear-border-0"
|
|
157
165
|
),
|
|
158
|
-
"aria-label": r === "left" ?
|
|
159
|
-
children: /* @__PURE__ */ t(
|
|
166
|
+
"aria-label": r === "left" ? We : De,
|
|
167
|
+
children: /* @__PURE__ */ t(Te.MoreHorizIcon, { size: Ge })
|
|
160
168
|
}
|
|
161
169
|
),
|
|
162
170
|
items: e.map((n) => ({
|
|
@@ -164,7 +172,7 @@ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", {
|
|
|
164
172
|
label: o[n].label,
|
|
165
173
|
disabled: o[n].disabled,
|
|
166
174
|
onClick: () => {
|
|
167
|
-
o[n].disabled ||
|
|
175
|
+
o[n].disabled || _ == null || _(n);
|
|
168
176
|
}
|
|
169
177
|
}))
|
|
170
178
|
}
|
|
@@ -172,45 +180,45 @@ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", {
|
|
|
172
180
|
return /* @__PURE__ */ i(
|
|
173
181
|
"div",
|
|
174
182
|
{
|
|
175
|
-
ref:
|
|
183
|
+
ref: te,
|
|
176
184
|
dir: v,
|
|
177
|
-
className:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
v === "rtl" &&
|
|
181
|
-
|
|
185
|
+
className: E(
|
|
186
|
+
Se,
|
|
187
|
+
c ? Ne : Oe,
|
|
188
|
+
v === "rtl" && c && "bear-flex-row-reverse",
|
|
189
|
+
re
|
|
182
190
|
),
|
|
183
|
-
"data-testid":
|
|
184
|
-
...
|
|
191
|
+
"data-testid": ee,
|
|
192
|
+
...ne,
|
|
185
193
|
children: [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
194
|
+
c && !h && o.map((e, r) => /* @__PURE__ */ i(F.Fragment, { children: [
|
|
195
|
+
D(e, r),
|
|
196
|
+
N(r, r === o.length - 1)
|
|
189
197
|
] }, r)),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
198
|
+
c && h && /* @__PURE__ */ i(O, { children: [
|
|
199
|
+
p.length > 0 && /* @__PURE__ */ i(O, { children: [
|
|
200
|
+
V(p, "left"),
|
|
201
|
+
N(-1, !1)
|
|
194
202
|
] }),
|
|
195
|
-
|
|
196
|
-
const n = o[e], l = r ===
|
|
197
|
-
return /* @__PURE__ */ i(
|
|
198
|
-
|
|
199
|
-
|
|
203
|
+
b.map((e, r) => {
|
|
204
|
+
const n = o[e], l = r === b.length - 1 && A.length === 0;
|
|
205
|
+
return /* @__PURE__ */ i(F.Fragment, { children: [
|
|
206
|
+
D(n, e),
|
|
207
|
+
N(e, l)
|
|
200
208
|
] }, e);
|
|
201
209
|
}),
|
|
202
|
-
|
|
210
|
+
A.length > 0 && V(A, "right")
|
|
203
211
|
] }),
|
|
204
|
-
!
|
|
205
|
-
|
|
206
|
-
|
|
212
|
+
!c && o.map((e, r) => /* @__PURE__ */ i("div", { className: E("Bear-Stepper__step", he), children: [
|
|
213
|
+
ie(e, r),
|
|
214
|
+
N(r, r === o.length - 1)
|
|
207
215
|
] }, r))
|
|
208
216
|
]
|
|
209
217
|
}
|
|
210
218
|
);
|
|
211
219
|
}
|
|
212
220
|
);
|
|
213
|
-
|
|
221
|
+
xe.displayName = "Stepper";
|
|
214
222
|
export {
|
|
215
|
-
|
|
223
|
+
xe as Stepper
|
|
216
224
|
};
|
package/dist/styles.css
CHANGED
|
@@ -169354,22 +169354,6 @@
|
|
|
169354
169354
|
font-size: 10px;
|
|
169355
169355
|
}
|
|
169356
169356
|
|
|
169357
|
-
.bear-min-w-\[12px\] {
|
|
169358
|
-
min-width: 12px;
|
|
169359
|
-
}
|
|
169360
|
-
|
|
169361
|
-
.bear-min-w-\[80px\] {
|
|
169362
|
-
min-width: 80px;
|
|
169363
|
-
}
|
|
169364
|
-
|
|
169365
|
-
.bear-min-w-\[5rem\] {
|
|
169366
|
-
min-width: 5rem;
|
|
169367
|
-
}
|
|
169368
|
-
|
|
169369
|
-
.bear-max-w-\[9rem\] {
|
|
169370
|
-
max-width: 9rem;
|
|
169371
|
-
}
|
|
169372
|
-
|
|
169373
169357
|
.bear-min-h-\[100px\] {
|
|
169374
169358
|
min-height: 100px;
|
|
169375
169359
|
}
|
|
@@ -169390,6 +169374,10 @@
|
|
|
169390
169374
|
z-index: 9999;
|
|
169391
169375
|
}
|
|
169392
169376
|
|
|
169377
|
+
.bear-min-w-\[80px\] {
|
|
169378
|
+
min-width: 80px;
|
|
169379
|
+
}
|
|
169380
|
+
|
|
169393
169381
|
.bear-min-w-\[140px\] {
|
|
169394
169382
|
min-width: 140px;
|
|
169395
169383
|
}
|
|
@@ -170242,6 +170230,22 @@
|
|
|
170242
170230
|
color: #111827;
|
|
170243
170231
|
}
|
|
170244
170232
|
|
|
170233
|
+
.last\:bear-pb-0:last-child {
|
|
170234
|
+
padding-bottom: 0px;
|
|
170235
|
+
}
|
|
170236
|
+
|
|
170237
|
+
.dark .dark\:bear-bg-primary-500, .bear-dark .dark\:bear-bg-primary-500 {
|
|
170238
|
+
background-color: var(--bear-primary-500);
|
|
170239
|
+
}
|
|
170240
|
+
|
|
170241
|
+
.hover\:bear-scale-105:hover {
|
|
170242
|
+
scale: 1.05;
|
|
170243
|
+
}
|
|
170244
|
+
|
|
170245
|
+
.hover\:bear-bg-white\/30:hover {
|
|
170246
|
+
background-color: rgba(255, 255, 255, 0.3);
|
|
170247
|
+
}
|
|
170248
|
+
|
|
170245
170249
|
.dark .dark\:bear-bg-yellow-800, .bear-dark .dark\:bear-bg-yellow-800 {
|
|
170246
170250
|
background-color: #854d0e;
|
|
170247
170251
|
}
|
|
@@ -170829,10 +170833,6 @@
|
|
|
170829
170833
|
color: #d4d4d8;
|
|
170830
170834
|
}
|
|
170831
170835
|
|
|
170832
|
-
.hover\:bear-scale-105:hover {
|
|
170833
|
-
scale: 1.05;
|
|
170834
|
-
}
|
|
170835
|
-
|
|
170836
170836
|
.dark .dark\:bear-border-white, .bear-dark .dark\:bear-border-white {
|
|
170837
170837
|
border-color: #ffffff;
|
|
170838
170838
|
}
|
|
@@ -171264,6 +171264,14 @@
|
|
|
171264
171264
|
color: transparent;
|
|
171265
171265
|
}
|
|
171266
171266
|
|
|
171267
|
+
.bear-text-white\/80 {
|
|
171268
|
+
color: rgba(255, 255, 255, 0.8);
|
|
171269
|
+
}
|
|
171270
|
+
|
|
171271
|
+
.bear-bg-white\/20 {
|
|
171272
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
171273
|
+
}
|
|
171274
|
+
|
|
171267
171275
|
.bear-bg-black\/50 {
|
|
171268
171276
|
background-color: rgba(0, 0, 0, 0.5);
|
|
171269
171277
|
}
|
package/package.json
CHANGED