aravint-ui-navigation 1.0.35 → 1.0.36
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/navigation.cjs.js +2 -2
- package/dist/navigation.es.js +18 -9
- package/package.json +1 -1
package/dist/navigation.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),z=({tabs:i,defaultValue:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),z=({tabs:i,defaultValue:d,value:s,onValueChange:a,className:o="",tabListClassName:n="",tabButtonClassName:b="",contentClassName:c="",showTabNumbers:r=!0,showContent:l=!0,animated:m=!0})=>{var S;const p=s!==void 0,[_,w]=v.useState(d||((S=i[0])==null?void 0:S.id)||""),f=p?s:_,y=t=>{p||w(t),a==null||a(t)},u=i.find(t=>t.id===f),j={display:"flex",alignItems:"flex-end",borderBottom:"1px solid #059669",position:"sticky",top:0,zIndex:100,flexShrink:0},F={display:"flex",alignItems:"center",fontFamily:"inherit",background:"transparent",cursor:"pointer",outline:"none",transition:"all .2s ease",position:"relative"},x={background:"#E8F7F1",color:"#059669",fontWeight:700,borderTop:"3px solid #059669",borderLeft:"1px solid #059669",borderRight:"1px solid #059669",borderBottom:"1px solid #E8F7F1",borderTopLeftRadius:8,borderTopRightRadius:8,marginBottom:-1,zIndex:2},g={background:"transparent",color:"#2D3748",borderTop:"3px solid transparent",borderLeft:"1px solid transparent",borderRight:"1px solid transparent",borderBottom:"1px solid transparent",borderTopLeftRadius:8,borderTopRightRadius:8},h={background:"#ECFDF5",color:"#059669",fontWeight:700,border:"1px solid #059669"},T={background:"#FFFFFF",color:"#1F2937",fontWeight:"500",border:"1px solid #1F2937"},B={background:"#FFFFFF",border:"1px solid #D9E1E7",borderTop:"none",borderBottomLeftRadius:12,borderBottomRightRadius:12,boxShadow:"0 2px 6px rgba(0,0,0,.05)",transition:m?"opacity .2s ease":void 0,opacity:1,flex:1,overflowY:"auto",minHeight:0};return e.jsxs("div",{className:o,style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",minHeight:0,overflow:"hidden"},children:[e.jsx("style",{children:`
|
|
2
2
|
.ctabs-list {
|
|
3
3
|
padding: 0 10px;
|
|
4
4
|
gap: 0px;
|
|
@@ -72,4 +72,4 @@
|
|
|
72
72
|
font-size: 10px;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
`}),e.jsx("div",{style:j,className:`ctabs-list ${n}`,children:i.map((t,R)=>{const N=f===t.id;return e.jsxs("button",{role:"tab","aria-selected":N,disabled:t.disabled,onClick:()=>!t.disabled&&y(t.id),style:{...F,...N?x:g,opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"},className:`ctabs-btn ${b}`,children:[r&&e.jsx("span",{className:"ctabs-badge",style:N?h:T,children:R+1}),t.icon,e.jsx("span",{className:"ctabs-label",children:t.label})]},t.id)})}),l&&u&&e.jsx("div",{style:B,className:
|
|
75
|
+
`}),e.jsx("div",{style:j,className:`ctabs-list ${n}`,children:i.map((t,R)=>{const N=f===t.id;return e.jsxs("button",{role:"tab","aria-selected":N,disabled:t.disabled,onClick:()=>!t.disabled&&y(t.id),style:{...F,...N?x:g,opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"},className:`ctabs-btn ${b}`,children:[r&&e.jsx("span",{className:"ctabs-badge",style:N?h:T,children:R+1}),t.icon,e.jsx("span",{className:"ctabs-label",children:t.label})]},t.id)})}),l&&u&&e.jsx("div",{style:B,className:c,children:u.content})]})},L=()=>e.jsx("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 6.2L4.6 8.8L10 3",stroke:"#ffffff",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),k=v.memo(({computed:i,showTime:d})=>{const{step:s,index:a,status:o}=i,n=["rs-stepper__circle",o==="completed"?"rs-stepper__circle--completed":"",o==="active"?"rs-stepper__circle--active":""].filter(Boolean).join(" "),b=["rs-stepper__title",o==="pending"?"rs-stepper__title--pending":"",o==="active"?"rs-stepper__title--active":""].filter(Boolean).join(" "),c=a!==0;return e.jsxs("div",{className:"rs-stepper__step",children:[e.jsxs("div",{className:"rs-stepper__circle-wrap",children:[e.jsx("div",{className:n,children:c?a:null}),o==="completed"&&e.jsx("span",{className:"rs-stepper__check","aria-hidden":"true",children:e.jsx(L,{})})]}),e.jsx("div",{className:b,children:s.title}),s.date&&e.jsx("div",{className:"rs-stepper__date",children:s.date}),d&&s.time&&e.jsx("div",{className:"rs-stepper__time",children:s.time})]})});k.displayName="StepCircle";const E=({steps:i,currentStep:d,completedColor:s="#059669",pendingColor:a="#9ca3af",activeColor:o="#059669",lineColor:n="#e5e7eb",showTime:b=!0,orientation:c="responsive"})=>{const r=i.length,l=d>r,m=Math.max(1,Math.min(d,r)),p=l?Math.max(0,r-1):Math.max(0,Math.min(r-1,m-1)),_=v.useMemo(()=>i.map((x,g)=>{let h="pending";return l||g<p?h="completed":g===p&&(h="active"),{step:x,index:g,status:h}}),[i,p,l]),w=r>0?100/r/2:0,f=r>1?l?100:p/(r-1)*100:0,y=l||m>1?s:n,u=l||m>r?s:n,j={"--rs-completed-color":s,"--rs-pending-color":a,"--rs-active-color":o,"--rs-line-color":n,"--rs-half-step":`${w}%`,"--rs-progress":`${f}%`,"--rs-left-side-color":y,"--rs-right-side-color":u};if(r===0)return null;const F=c==="vertical"?"rs-stepper--vertical":c==="horizontal"?"rs-stepper--horizontal":"rs-stepper--responsive";return e.jsxs("div",{className:"border border-[#E5E7EB] py-2 mx-2 rounded-lg bg-[#F9FAFB] shadow-[0px_2px_4px_-1px_#00000008,0px_4px_6px_-1px_#0000000D]",children:[e.jsx("div",{className:"pl-2 pt-2 pb-3 text-[14px] font-bold",children:"Workflow Progresss"}),e.jsx("div",{className:`rs-stepper ${F}`,style:j,children:e.jsx("div",{className:"rs-stepper__scroll",children:e.jsxs("div",{className:"rs-stepper__row",children:[e.jsx("div",{className:"rs-stepper__track",children:e.jsx("div",{className:"rs-stepper__progress"})}),_.map(x=>e.jsx(k,{computed:x,showTime:b},x.step.id))]})})})]})},I=v.memo(E);exports.CustomTabs=z;exports.Stepper=I;
|
package/dist/navigation.es.js
CHANGED
|
@@ -11,7 +11,7 @@ const W = ({
|
|
|
11
11
|
contentClassName: m = "",
|
|
12
12
|
showTabNumbers: r = !0,
|
|
13
13
|
showContent: l = !0,
|
|
14
|
-
animated:
|
|
14
|
+
animated: f = !0
|
|
15
15
|
}) => {
|
|
16
16
|
var S;
|
|
17
17
|
const p = s !== void 0, [_, w] = E(
|
|
@@ -48,7 +48,7 @@ const W = ({
|
|
|
48
48
|
borderTopRightRadius: 8,
|
|
49
49
|
marginBottom: -1,
|
|
50
50
|
zIndex: 2
|
|
51
|
-
},
|
|
51
|
+
}, g = {
|
|
52
52
|
background: "transparent",
|
|
53
53
|
color: "#2D3748",
|
|
54
54
|
borderTop: "3px solid transparent",
|
|
@@ -74,7 +74,7 @@ const W = ({
|
|
|
74
74
|
borderBottomLeftRadius: 12,
|
|
75
75
|
borderBottomRightRadius: 12,
|
|
76
76
|
boxShadow: "0 2px 6px rgba(0,0,0,.05)",
|
|
77
|
-
transition:
|
|
77
|
+
transition: f ? "opacity .2s ease" : void 0,
|
|
78
78
|
opacity: 1,
|
|
79
79
|
flex: 1,
|
|
80
80
|
overflowY: "auto",
|
|
@@ -184,7 +184,7 @@ const W = ({
|
|
|
184
184
|
onClick: () => !t.disabled && y(t.id),
|
|
185
185
|
style: {
|
|
186
186
|
...k,
|
|
187
|
-
...N ? c :
|
|
187
|
+
...N ? c : g,
|
|
188
188
|
opacity: t.disabled ? 0.5 : 1,
|
|
189
189
|
cursor: t.disabled ? "not-allowed" : "pointer"
|
|
190
190
|
},
|
|
@@ -211,7 +211,16 @@ const W = ({
|
|
|
211
211
|
]
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
|
-
}, C = "
|
|
214
|
+
}, C = () => /* @__PURE__ */ e("svg", { viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
|
215
|
+
"path",
|
|
216
|
+
{
|
|
217
|
+
d: "M2 6.2L4.6 8.8L10 3",
|
|
218
|
+
stroke: "#ffffff",
|
|
219
|
+
strokeWidth: "1.6",
|
|
220
|
+
strokeLinecap: "round",
|
|
221
|
+
strokeLinejoin: "round"
|
|
222
|
+
}
|
|
223
|
+
) }), B = T(({ computed: i, showTime: d }) => {
|
|
215
224
|
const { step: s, index: a, status: o } = i, n = [
|
|
216
225
|
"rs-stepper__circle",
|
|
217
226
|
o === "completed" ? "rs-stepper__circle--completed" : "",
|
|
@@ -242,13 +251,13 @@ const M = ({
|
|
|
242
251
|
showTime: b = !0,
|
|
243
252
|
orientation: m = "responsive"
|
|
244
253
|
}) => {
|
|
245
|
-
const r = i.length, l = d > r,
|
|
246
|
-
() => i.map((c,
|
|
254
|
+
const r = i.length, l = d > r, f = Math.max(1, Math.min(d, r)), p = l ? Math.max(0, r - 1) : Math.max(0, Math.min(r - 1, f - 1)), _ = I(
|
|
255
|
+
() => i.map((c, g) => {
|
|
247
256
|
let x = "pending";
|
|
248
|
-
return l ||
|
|
257
|
+
return l || g < p ? x = "completed" : g === p && (x = "active"), { step: c, index: g, status: x };
|
|
249
258
|
}),
|
|
250
259
|
[i, p, l]
|
|
251
|
-
), w = r > 0 ? 100 / r / 2 : 0, v = r > 1 ? l ? 100 : p / (r - 1) * 100 : 0, y = l ||
|
|
260
|
+
), w = r > 0 ? 100 / r / 2 : 0, v = r > 1 ? l ? 100 : p / (r - 1) * 100 : 0, y = l || f > 1 ? s : n, u = l || f > r ? s : n, F = {
|
|
252
261
|
"--rs-completed-color": s,
|
|
253
262
|
"--rs-pending-color": a,
|
|
254
263
|
"--rs-active-color": o,
|