aravint-ui-navigation 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +261 -1
- package/dist/navigation.cjs.js +2 -2
- package/dist/navigation.css +1 -1
- package/dist/navigation.es.js +121 -83
- package/dist/types/components/EmptyState.d.ts +10 -0
- package/dist/types/components/SummaryDetailsCard.d.ts +5 -0
- package/dist/types/icons/icon.d.ts +1 -2
- package/dist/types/index.d.ts +4 -0
- package/dist/types/types/SummaryDetailsCard.d.ts +12 -0
- package/dist/types/types/stepper.d.ts +0 -19
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -99,4 +99,264 @@ To customize breakpoint values, edit the `@media` blocks inside the component's
|
|
|
99
99
|
|
|
100
100
|
- `marginBottom: -1` on the active tab intentionally overlaps the tab bar's bottom border so the active tab visually "merges" into its content panel. This depends on `alignItems: "flex-end"` on the tab list — don't remove that when customizing.
|
|
101
101
|
- The phone-only `flex-wrap: wrap` sets `overflow-x: visible` to explicitly undo the tablet breakpoint's `overflow-x: auto`, since media query rules don't reset each other automatically.
|
|
102
|
-
- If you have a large number of tabs, consider whether wrapping (phone behavior) or horizontal scroll suits your use case better, and adjust the `480px` block accordingly.
|
|
102
|
+
- If you have a large number of tabs, consider whether wrapping (phone behavior) or horizontal scroll suits your use case better, and adjust the `480px` block accordingly.
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
----------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# Stepper Component
|
|
110
|
+
|
|
111
|
+
A reusable workflow stepper component for displaying progress through a series of steps.
|
|
112
|
+
|
|
113
|
+
## Installation
|
|
114
|
+
|
|
115
|
+
Install the package:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm install @digitus-fci-oa/navigation
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Import Styles
|
|
122
|
+
|
|
123
|
+
Import the stylesheet once in your application's global CSS file (e.g. `index.css` or `App.css`).
|
|
124
|
+
|
|
125
|
+
```css
|
|
126
|
+
@import "@digitus-fci-oa/navigation/dist/navigation.css";
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Usage
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
import React from "react";
|
|
133
|
+
import { Stepper } from "@digitus-fci-oa/navigation";
|
|
134
|
+
|
|
135
|
+
const steps = [
|
|
136
|
+
{ id: "1", title: "Initiated", date: "21 May 2026", time: "09:40 AM" },
|
|
137
|
+
{ id: "2", title: "RoHS Approval", date: "21 May 2026", time: "09:40 AM" },
|
|
138
|
+
{ id: "3", title: "Planner Approval", date: "21 May 2026", time: "09:40 AM" },
|
|
139
|
+
{ id: "4", title: "Manufacturing Head Approval" },
|
|
140
|
+
{ id: "5", title: "Engineering Head Approval" },
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
export default function ApprovalTracker() {
|
|
144
|
+
return (
|
|
145
|
+
<Stepper
|
|
146
|
+
steps={steps}
|
|
147
|
+
currentStep={4}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Props
|
|
156
|
+
|
|
157
|
+
| Prop | Type | Default | Description |
|
|
158
|
+
|------|------|---------|-------------|
|
|
159
|
+
| `steps` | `StepItem[]` | **Required** | List of workflow steps. |
|
|
160
|
+
| `currentStep` | `number` | **Required** | Current active step (starts from `1`). |
|
|
161
|
+
| `completedColor` | `string` | `#059669` | Color of completed steps. |
|
|
162
|
+
| `activeColor` | `string` | `#059669` | Color of the active step. |
|
|
163
|
+
| `pendingColor` | `string` | `#9ca3af` | Color of pending steps. |
|
|
164
|
+
| `lineColor` | `string` | `#e5e7eb` | Color of the connector line. |
|
|
165
|
+
| `showTime` | `boolean` | `true` | Shows or hides the time below each step. |
|
|
166
|
+
| `orientation` | `"horizontal" \| "vertical" \| "responsive"` | `"responsive"` | Stepper layout. |
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## StepItem
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
interface StepItem {
|
|
174
|
+
id: string;
|
|
175
|
+
title: string;
|
|
176
|
+
date?: string;
|
|
177
|
+
time?: string;
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Example
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
const steps = [
|
|
187
|
+
{
|
|
188
|
+
id: "1",
|
|
189
|
+
title: "Initiated",
|
|
190
|
+
date: "21 May 2026",
|
|
191
|
+
time: "09:40 AM",
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "2",
|
|
195
|
+
title: "RoHS Approval",
|
|
196
|
+
date: "21 May 2026",
|
|
197
|
+
time: "09:40 AM",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: "3",
|
|
201
|
+
title: "Planner Approval",
|
|
202
|
+
date: "21 May 2026",
|
|
203
|
+
time: "09:40 AM",
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: "4",
|
|
207
|
+
title: "Manufacturing Head Approval",
|
|
208
|
+
},
|
|
209
|
+
];
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Notes
|
|
215
|
+
|
|
216
|
+
- `currentStep` is **1-based**.
|
|
217
|
+
- The first step is treated as the starting point.
|
|
218
|
+
- Completed steps display a check icon.
|
|
219
|
+
- `date` and `time` are optional for each step.
|
|
220
|
+
- When `showTime={false}`, only the date is displayed.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
-----------------------------------------------------------------
|
|
224
|
+
# SummaryDetailsCard
|
|
225
|
+
|
|
226
|
+
Reusable, responsive summary card — rows of label/value fields separated
|
|
227
|
+
by dividers (e.g. PNC/RDR detail header, ticket summary, order details).
|
|
228
|
+
|
|
229
|
+
## Usage
|
|
230
|
+
|
|
231
|
+
```tsx
|
|
232
|
+
import { DetailRow, SummaryDetailsCard } from "@digitus-fci-oa/navigation";
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
## Import Styles
|
|
237
|
+
|
|
238
|
+
Import the stylesheet once in your application's global CSS file (e.g. `index.css` or `App.css`).
|
|
239
|
+
|
|
240
|
+
```css
|
|
241
|
+
@import "@digitus-fci-oa/navigation/dist/navigation.css";
|
|
242
|
+
|
|
243
|
+
const rows: DetailRow[] = [
|
|
244
|
+
[
|
|
245
|
+
{ label: 'Title', value: 'Title will be show here' },
|
|
246
|
+
{ label: 'Remark', value: 'Remark will be show here...'},
|
|
247
|
+
],
|
|
248
|
+
[
|
|
249
|
+
{ label: 'PNC Number', value: 'PNC-2026-0001' },
|
|
250
|
+
{ label: 'PNC Date', value: '26-06-2026 11:00AM' },
|
|
251
|
+
{ label: 'Requester', value: 'Prakash Kumar' },
|
|
252
|
+
{ label: 'Flag Name', value: 'M/L, F' },
|
|
253
|
+
],
|
|
254
|
+
[
|
|
255
|
+
{ label: 'Pending With', value: 'RoHS Team' },
|
|
256
|
+
{ label: 'Created On', value: '26-06-2026 11:00AM' },
|
|
257
|
+
{ label: 'Last Updated', value: '27-06-2026 10:00 AM' },
|
|
258
|
+
],
|
|
259
|
+
];
|
|
260
|
+
|
|
261
|
+
<SummaryDetailsCard rows={rows} />
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Props
|
|
265
|
+
|
|
266
|
+
| Prop | Type | Default | Description |
|
|
267
|
+
| ----------- | ------------- | -------------- | ----------------------------------------------- |
|
|
268
|
+
| `rows` | `DetailRow[]` | — | Rows of fields, top to bottom, each row on its own divider-separated line |
|
|
269
|
+
| `className` | `string` | `'mt-2 mx-2'` | Extra classes on the outer card |
|
|
270
|
+
|
|
271
|
+
### Field (`DetailRow` = `DetailField[]`)
|
|
272
|
+
|
|
273
|
+
| Prop | Type | Default | Description |
|
|
274
|
+
| ------- | ------------------- | ----------- | ------------------------------------------------------------------------------------ |
|
|
275
|
+
| `label` | `string` | — | Small uppercase label |
|
|
276
|
+
| `value` | `ReactNode` | — | The value to display |
|
|
277
|
+
| `size` | `'default' \| 'lg'` | `'default'` | `'lg'` for hero fields like Title/Remark |
|
|
278
|
+
| `span` | `1 \| 2 \| 3 \| 4` | `1` | How many of the 4 grid columns this field occupies (desktop/tablet — mobile is always full width) |
|
|
279
|
+
|
|
280
|
+
## Layout
|
|
281
|
+
|
|
282
|
+
- Every row uses the same fixed 4-column grid, so fields stay aligned
|
|
283
|
+
across rows regardless of how many fields a row has.
|
|
284
|
+
- Below 640px, the grid collapses to a single column and every field
|
|
285
|
+
goes full width, regardless of its `span`.
|
|
286
|
+
- Styled with plain CSS (`SummaryDetailsCard.css`), not Tailwind
|
|
287
|
+
utilities, so it renders correctly no matter what the consuming app's
|
|
288
|
+
Tailwind (or non-Tailwind) setup looks like. Colors/spacing are
|
|
289
|
+
theme-able via CSS variables on `.summary-detail-card`.
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
------------------------------------------------------------------
|
|
294
|
+
# EmptyState
|
|
295
|
+
|
|
296
|
+
A reusable component for displaying an empty state message when no data or content is available.
|
|
297
|
+
|
|
298
|
+
## Features
|
|
299
|
+
|
|
300
|
+
- Reusable and customizable
|
|
301
|
+
- Optional icon support
|
|
302
|
+
- Custom title and description
|
|
303
|
+
- Supports additional CSS classes
|
|
304
|
+
- Responsive design using Tailwind CSS
|
|
305
|
+
|
|
306
|
+
## Props
|
|
307
|
+
|
|
308
|
+
| Prop | Type | Required | Description |
|
|
309
|
+
|------|------|----------|-------------|
|
|
310
|
+
| `title` | `string` | Yes | Title displayed in the empty state. |
|
|
311
|
+
| `description` | `string \| React.ReactNode` | Yes | Description displayed below the title. |
|
|
312
|
+
| `icon` | `React.ReactNode` | No | Optional icon or illustration. |
|
|
313
|
+
| `className` | `string` | No | Additional CSS classes for the container. |
|
|
314
|
+
|
|
315
|
+
## Usage
|
|
316
|
+
|
|
317
|
+
```tsx
|
|
318
|
+
import { EmptyState } from "@your-package/navigation";
|
|
319
|
+
|
|
320
|
+
<EmptyState
|
|
321
|
+
title="No Confirmation Received"
|
|
322
|
+
description="No confirmation has been received for this request yet. Once the respective team confirms the action, the details will be displayed here."
|
|
323
|
+
/>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### With an Icon
|
|
327
|
+
|
|
328
|
+
```tsx
|
|
329
|
+
import { EmptyState } from "@digitus-fci-oa/navigation";
|
|
330
|
+
import { InfoIcon } from "./InfoIcon";
|
|
331
|
+
|
|
332
|
+
<EmptyState
|
|
333
|
+
icon={<InfoIcon />}
|
|
334
|
+
title="No Data Found"
|
|
335
|
+
description="There are no records available."
|
|
336
|
+
/>
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## Example
|
|
340
|
+
|
|
341
|
+
```tsx
|
|
342
|
+
<EmptyState
|
|
343
|
+
title="No Confirmation Received"
|
|
344
|
+
description={
|
|
345
|
+
<>
|
|
346
|
+
No confirmation has been received for this request yet.
|
|
347
|
+
<br />
|
|
348
|
+
Once the respective team confirms the action, the details will be displayed here.
|
|
349
|
+
</>
|
|
350
|
+
}
|
|
351
|
+
/>
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## Output
|
|
355
|
+
|
|
356
|
+
Displays a centered empty state containing:
|
|
357
|
+
- Optional icon
|
|
358
|
+
- Title
|
|
359
|
+
- Description
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
-----------------------------------------------------------------
|
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"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react");function E(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(a,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return a.default=s,Object.freeze(a)}const k=E(f),D=({tabs:s,defaultValue:a,value:t,onValueChange:i,className:r="",tabListClassName:n="",tabButtonClassName:b="",contentClassName:p="",showTabNumbers:o=!0,showContent:c=!0,animated:h=!0})=>{var F;const d=t!==void 0,[_,y]=f.useState(a||((F=s[0])==null?void 0:F.id)||""),g=d?t:_,j=l=>{d||y(l),i==null||i(l)},v=s.find(l=>l.id===g),w={display:"flex",alignItems:"flex-end",borderBottom:"1px solid #059669",position:"sticky",top:0,zIndex:100,flexShrink:0},N={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},u={background:"transparent",color:"#2D3748",borderTop:"3px solid transparent",borderLeft:"1px solid transparent",borderRight:"1px solid transparent",borderBottom:"1px solid transparent",borderTopLeftRadius:8,borderTopRightRadius:8},m={background:"#ECFDF5",color:"#059669",fontWeight:700,border:"1px solid #059669"},R={background:"#FFFFFF",color:"#1F2937",fontWeight:"500",border:"1px solid #1F2937"},z={background:"#FFFFFF",border:"1px solid #D9E1E7",borderTop:"none",borderBottomLeftRadius:12,borderBottomRightRadius:12,boxShadow:"0 2px 6px rgba(0,0,0,.05)",transition:h?"opacity .2s ease":void 0,opacity:1,flex:1,overflowY:"auto",minHeight:0};return e.jsxs("div",{className:r,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:
|
|
75
|
+
`}),e.jsx("div",{style:w,className:`ctabs-list ${n}`,children:s.map((l,B)=>{const S=g===l.id;return e.jsxs("button",{role:"tab","aria-selected":S,disabled:l.disabled,onClick:()=>!l.disabled&&j(l.id),style:{...N,...S?x:u,opacity:l.disabled?.5:1,cursor:l.disabled?"not-allowed":"pointer"},className:`ctabs-btn ${b}`,children:[o&&e.jsx("span",{className:"ctabs-badge",style:S?m:R,children:B+1}),l.icon,e.jsx("span",{className:"ctabs-label",children:l.label})]},l.id)})}),c&&v&&e.jsx("div",{style:z,className:p,children:v.content})]})},L=s=>k.createElement("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},k.createElement("path",{d:"M2 6.2L4.6 8.8L10 3",stroke:"#ffffff",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"})),T=f.memo(({computed:s,showTime:a})=>{const{step:t,index:i,status:r}=s,n=["rs-stepper__circle",r==="completed"?"rs-stepper__circle--completed":"",r==="active"?"rs-stepper__circle--active":""].filter(Boolean).join(" "),b=["rs-stepper__title",r==="pending"?"rs-stepper__title--pending":"",r==="active"?"rs-stepper__title--active":""].filter(Boolean).join(" "),p=i!==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:p?i:null}),r==="completed"&&e.jsx("span",{className:"rs-stepper__check","aria-hidden":"true",children:e.jsx(L,{})})]}),e.jsx("div",{className:b,children:t.title}),t.date&&e.jsx("div",{className:"rs-stepper__date",children:t.date}),a&&t.time&&e.jsx("div",{className:"rs-stepper__time",children:t.time})]})});T.displayName="StepCircle";const C=({steps:s,currentStep:a,completedColor:t="#059669",pendingColor:i="#9ca3af",activeColor:r="#059669",lineColor:n="#e5e7eb",showTime:b=!0,orientation:p="responsive"})=>{const o=s.length,c=a>o,h=Math.max(1,Math.min(a,o)),d=c?Math.max(0,o-1):Math.max(0,Math.min(o-1,h-1)),_=f.useMemo(()=>s.map((x,u)=>{let m="pending";return c||u<d?m="completed":u===d&&(m="active"),{step:x,index:u,status:m}}),[s,d,c]),y=o>0?100/o/2:0,g=o>1?c?100:d/(o-1)*100:0,j=c||h>1?t:n,v=c||h>o?t:n,w={"--rs-completed-color":t,"--rs-pending-color":i,"--rs-active-color":r,"--rs-line-color":n,"--rs-half-step":`${y}%`,"--rs-progress":`${g}%`,"--rs-left-side-color":j,"--rs-right-side-color":v};if(o===0)return null;const N=p==="vertical"?"rs-stepper--vertical":p==="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 Progress"}),e.jsx("div",{className:`rs-stepper ${N}`,style:w,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(T,{computed:x,showTime:b},x.step.id))]})})})]})},M=f.memo(C),I=({rows:s,className:a="mt-2 mx-2"})=>e.jsx("div",{className:`summary-detail-card ${a}`.trim(),children:s.map((t,i)=>e.jsx("div",{className:"summary-detail-card__row",children:t.map((r,n)=>e.jsxs("div",{className:"summary-detail-card__field",style:{"--dc-span":r.span??1},children:[e.jsx("p",{className:"summary-detail-card__label",children:r.label}),e.jsx("p",{className:`summary-detail-card__value${r.size==="lg"?" summary-detail-card__value--lg":""}`,children:r.value})]},n))},i))}),$=({title:s,description:a,icon:t,className:i="",children:r})=>e.jsxs("div",{className:`flex flex-col items-center justify-center py-4 px-4 text-center ${i}`,children:[t&&e.jsx("div",{className:"mb-2",children:t}),e.jsx("div",{className:"text-[14px] font-semibold text-[#34343F]",children:s}),(a||r)&&e.jsx("p",{className:"mt-2 max-w-[650px] text-[12px] leading-relaxed text-[#A19D9D]",children:r??a})]});exports.CustomTabs=D;exports.EmptyState=$;exports.Stepper=M;exports.SummaryDetailsCard=I;
|
package/dist/navigation.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rs-stepper{--rs-completed-color: #059669;--rs-pending-color: #9ca3af;--rs-active-color: #059669;--rs-line-color: #e5e7eb;--rs-half-step: 0%;--rs-progress: 0%;--rs-left-side-color: var(--rs-line-color);--rs-right-side-color: var(--rs-line-color);position:relative;width:100%;box-sizing:border-box}.rs-stepper *{box-sizing:border-box}.rs-stepper__scroll{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.rs-stepper__row{position:relative;display:flex;align-items:flex-start;width:max-content;min-width:100%}.rs-stepper__track{position:absolute;top:26px;left:var(--rs-half-step);right:var(--rs-half-step);height:3px;background-color:transparent;transform:translateY(-1px);z-index:0}.rs-stepper__track:before{content:"";position:absolute;top:0;left:calc(-1 * (var(--rs-half-step)));right:calc(-1 * (var(--rs-half-step)));height:100%;background-image:linear-gradient(to right,var(--rs-left-side-color) 0,var(--rs-left-side-color) calc(var(--rs-half-step)),var(--rs-line-color) calc(var(--rs-half-step)),var(--rs-line-color) calc(100% - (var(--rs-half-step))),var(--rs-right-side-color) calc(100% - (var(--rs-half-step))),var(--rs-right-side-color) 100%);z-index:0}.rs-stepper__progress{position:absolute;top:0;left:0;width:var(--rs-progress);height:100%;background-color:var(--rs-completed-color);z-index:1;transition:width .3s ease,height .3s ease}.rs-stepper--vertical .rs-stepper__progress{position:relative;left:auto;width:100%}.rs-stepper__step{position:relative;z-index:1;flex:1 1 0;min-width:120px;display:flex;flex-direction:column;align-items:center;text-align:center;padding:4px 0}.rs-stepper__circle-wrap{position:relative;width:48px;height:48px;flex-shrink:0}.rs-stepper__circle{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;background-color:#fff;border:2px solid var(--rs-line-color);color:var(--rs-pending-color);transition:border-color .2s ease,background-color .2s ease,box-shadow .2s ease,color .2s ease}.rs-stepper__circle--completed{background-color:var(--rs-completed-color);border-color:var(--rs-completed-color);color:#fff}.rs-stepper__circle--active{background-color:#fff;border-color:var(--rs-active-color);color:var(--rs-active-color);box-shadow:0 0 0 4px #d4e3e0}.rs-stepper__check{position:absolute;top:-2px;right:-2px;width:20px;height:20px;border-radius:50%;background-color:var(--rs-completed-color);border:2px solid #ffffff;display:flex;align-items:center;justify-content:center}.rs-stepper__check svg{width:10px;height:10px;display:block}.rs-stepper__title{margin-top:12px;font-size:12px;font-weight:700;line-height:1.3;color:#1e293b;max-width:140px}.rs-stepper__title--pending{color:var(--rs-pending-color);font-weight:600}.rs-stepper__title--active{color:var(--rs-active-color)}.rs-stepper__date,.rs-stepper__time{margin-top:2px;font-size:10px;line-height:1.3;color:#6b7280}@media(max-width:640px){.rs-stepper__step{min-width:96px}.rs-stepper__circle-wrap,.rs-stepper__circle{width:44px;height:44px}.rs-stepper__track{top:22px}.rs-stepper__circle{font-size:15px}.rs-stepper__title{font-size:12.5px;max-width:110px}.rs-stepper__date,.rs-stepper__time{font-size:11px}}.rs-stepper--vertical .rs-stepper__scroll{overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.rs-stepper--vertical .rs-stepper__row{flex-direction:column;align-items:flex-start;padding-left:2px;min-width:0;width:fit-content}.rs-stepper--vertical .rs-stepper__track{top:var(--rs-half-step);bottom:var(--rs-half-step);left:28px;right:auto;width:2px;height:auto;transform:translate(-1px)}.rs-stepper--vertical .rs-stepper__track:before{content:"";position:absolute;left:0;top:calc(-1 * (var(--rs-half-step) / 2));bottom:calc(-1 * (var(--rs-half-step) / 2));width:100%;background-image:linear-gradient(to bottom,var(--rs-left-side-color) 0,var(--rs-left-side-color) calc(var(--rs-half-step) / 2),var(--rs-line-color) calc(var(--rs-half-step) / 2),var(--rs-line-color) calc(100% - (var(--rs-half-step) / 2)),var(--rs-right-side-color) calc(100% - (var(--rs-half-step) / 2)),var(--rs-right-side-color) 100%);z-index:0}.rs-stepper--vertical .rs-stepper__progress{width:100%;height:var(--rs-progress)}.rs-stepper--vertical .rs-stepper__step{flex-direction:row;align-items:flex-start;text-align:left;width:100%;min-width:0;padding:0 0 32px}.rs-stepper--vertical .rs-stepper__step:last-child{padding-bottom:0}.rs-stepper--vertical .rs-stepper__title,.rs-stepper--vertical .rs-stepper__date,.rs-stepper--vertical .rs-stepper__time{margin-top:0;text-align:left;max-width:none}.rs-stepper--vertical .rs-stepper__title{margin-left:16px;padding-top:6px}.rs-stepper--vertical .rs-stepper__date,.rs-stepper--vertical .rs-stepper__time{margin-left:16px}@media(max-width:640px){.rs-stepper--vertical .rs-stepper__track{left:22px}.rs-stepper--responsive .rs-stepper__scroll,.rs-stepper--vertical .rs-stepper__scroll{max-height:min(70dvh,24rem);overflow-y:auto;overflow-x:hidden;padding-right:.25rem}}@media(max-width:640px){.rs-stepper--responsive .rs-stepper__row{flex-direction:column;align-items:flex-start;min-width:0;width:fit-content;padding-left:2px}.rs-stepper--responsive .rs-stepper__track{top:var(--rs-half-step);bottom:var(--rs-half-step);left:24px;right:auto;width:2px;height:auto;transform:translate(-1px)}.rs-stepper--responsive .rs-stepper__track:before{content:"";position:absolute;left:0;top:calc(-1 * (var(--rs-half-step) / 2));bottom:calc(-1 * (var(--rs-half-step) / 2));width:100%;background-image:linear-gradient(to bottom,var(--rs-left-side-color) 0,var(--rs-left-side-color) calc(var(--rs-half-step) / 2),var(--rs-line-color) calc(var(--rs-half-step) / 2),var(--rs-line-color) calc(100% - (var(--rs-half-step) / 2)),var(--rs-right-side-color) calc(100% - (var(--rs-half-step) / 2)),var(--rs-right-side-color) 100%);z-index:0}.rs-stepper--responsive .rs-stepper__progress{position:relative;left:auto;width:100%;height:var(--rs-progress)}.rs-stepper--responsive .rs-stepper__step{flex-direction:row;align-items:flex-start;text-align:left;width:100%;min-width:0;padding:0 0 32px}.rs-stepper--responsive .rs-stepper__step:last-child{padding-bottom:0}.rs-stepper--responsive .rs-stepper__title,.rs-stepper--responsive .rs-stepper__date,.rs-stepper--responsive .rs-stepper__time{margin-top:0;text-align:left;max-width:none}.rs-stepper--responsive .rs-stepper__title{margin-left:16px;padding-top:4px}.rs-stepper--responsive .rs-stepper__date,.rs-stepper--responsive .rs-stepper__time{margin-left:16px}}
|
|
1
|
+
.rs-stepper{--rs-completed-color: #059669;--rs-pending-color: #9ca3af;--rs-active-color: #059669;--rs-line-color: #e5e7eb;--rs-half-step: 0%;--rs-progress: 0%;--rs-left-side-color: var(--rs-line-color);--rs-right-side-color: var(--rs-line-color);position:relative;width:100%;box-sizing:border-box}.rs-stepper *{box-sizing:border-box}.rs-stepper__scroll{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.rs-stepper__row{position:relative;display:flex;align-items:flex-start;width:max-content;min-width:100%}.rs-stepper__track{position:absolute;top:26px;left:var(--rs-half-step);right:var(--rs-half-step);height:3px;background-color:transparent;transform:translateY(-1px);z-index:0}.rs-stepper__track:before{content:"";position:absolute;top:0;left:calc(-1 * (var(--rs-half-step)));right:calc(-1 * (var(--rs-half-step)));height:100%;background-image:linear-gradient(to right,var(--rs-left-side-color) 0,var(--rs-left-side-color) calc(var(--rs-half-step)),var(--rs-line-color) calc(var(--rs-half-step)),var(--rs-line-color) calc(100% - (var(--rs-half-step))),var(--rs-right-side-color) calc(100% - (var(--rs-half-step))),var(--rs-right-side-color) 100%);z-index:0}.rs-stepper__progress{position:absolute;top:0;left:0;width:var(--rs-progress);height:100%;background-color:var(--rs-completed-color);z-index:1;transition:width .3s ease,height .3s ease}.rs-stepper--vertical .rs-stepper__progress{position:relative;left:auto;width:100%}.rs-stepper__step{position:relative;z-index:1;flex:1 1 0;min-width:120px;display:flex;flex-direction:column;align-items:center;text-align:center;padding:4px 0}.rs-stepper__circle-wrap{position:relative;width:48px;height:48px;flex-shrink:0}.rs-stepper__circle{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;background-color:#fff;border:2px solid var(--rs-line-color);color:var(--rs-pending-color);transition:border-color .2s ease,background-color .2s ease,box-shadow .2s ease,color .2s ease}.rs-stepper__circle--completed{background-color:var(--rs-completed-color);border-color:var(--rs-completed-color);color:#fff}.rs-stepper__circle--active{background-color:#fff;border-color:var(--rs-active-color);color:var(--rs-active-color);box-shadow:0 0 0 4px #d4e3e0}.rs-stepper__check{position:absolute;top:-2px;right:-2px;width:20px;height:20px;border-radius:50%;background-color:var(--rs-completed-color);border:2px solid #ffffff;display:flex;align-items:center;justify-content:center}.rs-stepper__check svg{width:10px;height:10px;display:block}.rs-stepper__title{margin-top:12px;font-size:12px;font-weight:700;line-height:1.3;color:#1e293b;max-width:140px}.rs-stepper__title--pending{color:var(--rs-pending-color);font-weight:600}.rs-stepper__title--active{color:var(--rs-active-color)}.rs-stepper__date,.rs-stepper__time{margin-top:2px;font-size:10px;line-height:1.3;color:#6b7280}@media(max-width:640px){.rs-stepper__step{min-width:96px}.rs-stepper__circle-wrap,.rs-stepper__circle{width:44px;height:44px}.rs-stepper__track{top:22px}.rs-stepper__circle{font-size:15px}.rs-stepper__title{font-size:12.5px;max-width:110px}.rs-stepper__date,.rs-stepper__time{font-size:11px}}.rs-stepper--vertical .rs-stepper__scroll{overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.rs-stepper--vertical .rs-stepper__row{flex-direction:column;align-items:flex-start;padding-left:2px;min-width:0;width:fit-content}.rs-stepper--vertical .rs-stepper__track{top:var(--rs-half-step);bottom:var(--rs-half-step);left:28px;right:auto;width:2px;height:auto;transform:translate(-1px)}.rs-stepper--vertical .rs-stepper__track:before{content:"";position:absolute;left:0;top:calc(-1 * (var(--rs-half-step) / 2));bottom:calc(-1 * (var(--rs-half-step) / 2));width:100%;background-image:linear-gradient(to bottom,var(--rs-left-side-color) 0,var(--rs-left-side-color) calc(var(--rs-half-step) / 2),var(--rs-line-color) calc(var(--rs-half-step) / 2),var(--rs-line-color) calc(100% - (var(--rs-half-step) / 2)),var(--rs-right-side-color) calc(100% - (var(--rs-half-step) / 2)),var(--rs-right-side-color) 100%);z-index:0}.rs-stepper--vertical .rs-stepper__progress{width:100%;height:var(--rs-progress)}.rs-stepper--vertical .rs-stepper__step{flex-direction:row;align-items:flex-start;text-align:left;width:100%;min-width:0;padding:0 0 32px}.rs-stepper--vertical .rs-stepper__step:last-child{padding-bottom:0}.rs-stepper--vertical .rs-stepper__title,.rs-stepper--vertical .rs-stepper__date,.rs-stepper--vertical .rs-stepper__time{margin-top:0;text-align:left;max-width:none}.rs-stepper--vertical .rs-stepper__title{margin-left:16px;padding-top:6px}.rs-stepper--vertical .rs-stepper__date,.rs-stepper--vertical .rs-stepper__time{margin-left:16px}@media(max-width:640px){.rs-stepper--vertical .rs-stepper__track{left:22px}.rs-stepper--responsive .rs-stepper__scroll,.rs-stepper--vertical .rs-stepper__scroll{max-height:min(70dvh,24rem);overflow-y:auto;overflow-x:hidden;padding-right:.25rem}}@media(max-width:640px){.rs-stepper--responsive .rs-stepper__row{flex-direction:column;align-items:flex-start;min-width:0;width:fit-content;padding-left:2px}.rs-stepper--responsive .rs-stepper__track{top:var(--rs-half-step);bottom:var(--rs-half-step);left:24px;right:auto;width:2px;height:auto;transform:translate(-1px)}.rs-stepper--responsive .rs-stepper__track:before{content:"";position:absolute;left:0;top:calc(-1 * (var(--rs-half-step) / 2));bottom:calc(-1 * (var(--rs-half-step) / 2));width:100%;background-image:linear-gradient(to bottom,var(--rs-left-side-color) 0,var(--rs-left-side-color) calc(var(--rs-half-step) / 2),var(--rs-line-color) calc(var(--rs-half-step) / 2),var(--rs-line-color) calc(100% - (var(--rs-half-step) / 2)),var(--rs-right-side-color) calc(100% - (var(--rs-half-step) / 2)),var(--rs-right-side-color) 100%);z-index:0}.rs-stepper--responsive .rs-stepper__progress{position:relative;left:auto;width:100%;height:var(--rs-progress)}.rs-stepper--responsive .rs-stepper__step{flex-direction:row;align-items:flex-start;text-align:left;width:100%;min-width:0;padding:0 0 32px}.rs-stepper--responsive .rs-stepper__step:last-child{padding-bottom:0}.rs-stepper--responsive .rs-stepper__title,.rs-stepper--responsive .rs-stepper__date,.rs-stepper--responsive .rs-stepper__time{margin-top:0;text-align:left;max-width:none}.rs-stepper--responsive .rs-stepper__title{margin-left:16px;padding-top:4px}.rs-stepper--responsive .rs-stepper__date,.rs-stepper--responsive .rs-stepper__time{margin-left:16px}}.summary-detail-card{--summary-detail-card-border: #E5E7EB;--summary-detail-card-bg: #F9FAFB;--summary-detail-card-label-color: #94a3b8;--summary-detail-card-value-color: #0f172a;--summary-detail-card-radius: .75rem;--summary-detail-card-row-padding-y: 1rem;--summary-detail-card-row-padding-x: 1rem;--summary-detail-card-gap-x: 1.5rem;--summary-detail-card-gap-y: 1rem;border-radius:var(--summary-detail-card-radius);border:1px solid var(--summary-detail-card-border);background:var(--summary-detail-card-bg);box-sizing:border-box}.summary-detail-card *,.summary-detail-card *:before,.summary-detail-card *:after{box-sizing:border-box}.summary-detail-card__row{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--summary-detail-card-gap-y) var(--summary-detail-card-gap-x);padding:var(--summary-detail-card-row-padding-y) var(--summary-detail-card-row-padding-x)}.summary-detail-card__row+.summary-detail-card__row{border-top:1px solid var(--summary-detail-card-border)}.summary-detail-card__field{grid-column:span var(--dc-span, 1);min-width:0}.summary-detail-card__label{margin:0;font-size:.6875rem;font-weight:500;text-transform:uppercase;letter-spacing:.05em;color:var(--summary-detail-card-label-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.summary-detail-card__value{margin:.25rem 0 0;font-size:.875rem;font-weight:700;color:var(--summary-detail-card-value-color);overflow-wrap:break-word}.summary-detail-card__value--lg{font-size:1rem}@media(min-width:640px){.summary-detail-card{--summary-detail-card-row-padding-y: .4rem;--summary-detail-card-row-padding-x: 1rem}.summary-detail-card__label{font-size:11px}.summary-detail-card__value{font-size:13px}.summary-detail-card__value--lg{font-size:.875rem}}@media(max-width:639px){.summary-detail-card__row{grid-template-columns:1fr}.summary-detail-card__field{grid-column:1 / -1}}
|
package/dist/navigation.es.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as T from "react";
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
5
|
-
tabs:
|
|
6
|
-
defaultValue:
|
|
7
|
-
value:
|
|
8
|
-
onValueChange:
|
|
9
|
-
className:
|
|
3
|
+
import { useState as C, memo as B, useMemo as D } from "react";
|
|
4
|
+
const W = ({
|
|
5
|
+
tabs: r,
|
|
6
|
+
defaultValue: o,
|
|
7
|
+
value: t,
|
|
8
|
+
onValueChange: i,
|
|
9
|
+
className: s = "",
|
|
10
10
|
tabListClassName: n = "",
|
|
11
|
-
tabButtonClassName:
|
|
12
|
-
contentClassName:
|
|
13
|
-
showTabNumbers:
|
|
14
|
-
showContent:
|
|
11
|
+
tabButtonClassName: h = "",
|
|
12
|
+
contentClassName: b = "",
|
|
13
|
+
showTabNumbers: l = !0,
|
|
14
|
+
showContent: d = !0,
|
|
15
15
|
animated: f = !0
|
|
16
16
|
}) => {
|
|
17
17
|
var k;
|
|
18
|
-
const p =
|
|
19
|
-
|
|
20
|
-
),
|
|
21
|
-
p ||
|
|
22
|
-
},
|
|
18
|
+
const p = t !== void 0, [_, y] = C(
|
|
19
|
+
o || ((k = r[0]) == null ? void 0 : k.id) || ""
|
|
20
|
+
), u = p ? t : _, w = (a) => {
|
|
21
|
+
p || y(a), i == null || i(a);
|
|
22
|
+
}, v = r.find((a) => a.id === u), N = {
|
|
23
23
|
display: "flex",
|
|
24
24
|
alignItems: "flex-end",
|
|
25
25
|
borderBottom: "1px solid #059669",
|
|
@@ -36,7 +36,7 @@ const $ = ({
|
|
|
36
36
|
outline: "none",
|
|
37
37
|
transition: "all .2s ease",
|
|
38
38
|
position: "relative"
|
|
39
|
-
},
|
|
39
|
+
}, m = {
|
|
40
40
|
background: "#E8F7F1",
|
|
41
41
|
color: "#059669",
|
|
42
42
|
fontWeight: 700,
|
|
@@ -63,7 +63,7 @@ const $ = ({
|
|
|
63
63
|
color: "#059669",
|
|
64
64
|
fontWeight: 700,
|
|
65
65
|
border: "1px solid #059669"
|
|
66
|
-
},
|
|
66
|
+
}, R = {
|
|
67
67
|
background: "#FFFFFF",
|
|
68
68
|
color: "#1F2937",
|
|
69
69
|
fontWeight: "500",
|
|
@@ -81,10 +81,10 @@ const $ = ({
|
|
|
81
81
|
overflowY: "auto",
|
|
82
82
|
minHeight: 0
|
|
83
83
|
};
|
|
84
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ c(
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
87
|
-
className:
|
|
87
|
+
className: s,
|
|
88
88
|
style: {
|
|
89
89
|
display: "flex",
|
|
90
90
|
flexDirection: "column",
|
|
@@ -172,109 +172,147 @@ const $ = ({
|
|
|
172
172
|
/* @__PURE__ */ e(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
|
-
style:
|
|
175
|
+
style: N,
|
|
176
176
|
className: `ctabs-list ${n}`,
|
|
177
|
-
children:
|
|
178
|
-
const
|
|
179
|
-
return /* @__PURE__ */
|
|
177
|
+
children: r.map((a, L) => {
|
|
178
|
+
const F = u === a.id;
|
|
179
|
+
return /* @__PURE__ */ c(
|
|
180
180
|
"button",
|
|
181
181
|
{
|
|
182
182
|
role: "tab",
|
|
183
|
-
"aria-selected":
|
|
184
|
-
disabled:
|
|
185
|
-
onClick: () => !
|
|
183
|
+
"aria-selected": F,
|
|
184
|
+
disabled: a.disabled,
|
|
185
|
+
onClick: () => !a.disabled && w(a.id),
|
|
186
186
|
style: {
|
|
187
187
|
...S,
|
|
188
|
-
...
|
|
189
|
-
opacity:
|
|
190
|
-
cursor:
|
|
188
|
+
...F ? m : g,
|
|
189
|
+
opacity: a.disabled ? 0.5 : 1,
|
|
190
|
+
cursor: a.disabled ? "not-allowed" : "pointer"
|
|
191
191
|
},
|
|
192
|
-
className: `ctabs-btn ${
|
|
192
|
+
className: `ctabs-btn ${h}`,
|
|
193
193
|
children: [
|
|
194
|
-
|
|
194
|
+
l && /* @__PURE__ */ e(
|
|
195
195
|
"span",
|
|
196
196
|
{
|
|
197
197
|
className: "ctabs-badge",
|
|
198
|
-
style:
|
|
198
|
+
style: F ? x : R,
|
|
199
199
|
children: L + 1
|
|
200
200
|
}
|
|
201
201
|
),
|
|
202
|
-
|
|
203
|
-
/* @__PURE__ */ e("span", { className: "ctabs-label", children:
|
|
202
|
+
a.icon,
|
|
203
|
+
/* @__PURE__ */ e("span", { className: "ctabs-label", children: a.label })
|
|
204
204
|
]
|
|
205
205
|
},
|
|
206
|
-
|
|
206
|
+
a.id
|
|
207
207
|
);
|
|
208
208
|
})
|
|
209
209
|
}
|
|
210
210
|
),
|
|
211
|
-
|
|
211
|
+
d && v && /* @__PURE__ */ e("div", { style: E, className: b, children: v.content })
|
|
212
212
|
]
|
|
213
213
|
}
|
|
214
214
|
);
|
|
215
|
-
},
|
|
216
|
-
const { step:
|
|
215
|
+
}, I = (r) => /* @__PURE__ */ T.createElement("svg", { viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ T.createElement("path", { d: "M2 6.2L4.6 8.8L10 3", stroke: "#ffffff", strokeWidth: 1.6, strokeLinecap: "round", strokeLinejoin: "round" })), z = B(({ computed: r, showTime: o }) => {
|
|
216
|
+
const { step: t, index: i, status: s } = r, n = [
|
|
217
217
|
"rs-stepper__circle",
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
].filter(Boolean).join(" "),
|
|
218
|
+
s === "completed" ? "rs-stepper__circle--completed" : "",
|
|
219
|
+
s === "active" ? "rs-stepper__circle--active" : ""
|
|
220
|
+
].filter(Boolean).join(" "), h = [
|
|
221
221
|
"rs-stepper__title",
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
s === "pending" ? "rs-stepper__title--pending" : "",
|
|
223
|
+
s === "active" ? "rs-stepper__title--active" : ""
|
|
224
224
|
].filter(Boolean).join(" ");
|
|
225
|
-
return /* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
/* @__PURE__ */ e("div", { className: n, children:
|
|
228
|
-
|
|
225
|
+
return /* @__PURE__ */ c("div", { className: "rs-stepper__step", children: [
|
|
226
|
+
/* @__PURE__ */ c("div", { className: "rs-stepper__circle-wrap", children: [
|
|
227
|
+
/* @__PURE__ */ e("div", { className: n, children: i !== 0 ? i : null }),
|
|
228
|
+
s === "completed" && /* @__PURE__ */ e("span", { className: "rs-stepper__check", "aria-hidden": "true", children: /* @__PURE__ */ e(I, {}) })
|
|
229
229
|
] }),
|
|
230
|
-
/* @__PURE__ */ e("div", { className:
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
/* @__PURE__ */ e("div", { className: h, children: t.title }),
|
|
231
|
+
t.date && /* @__PURE__ */ e("div", { className: "rs-stepper__date", children: t.date }),
|
|
232
|
+
o && t.time && /* @__PURE__ */ e("div", { className: "rs-stepper__time", children: t.time })
|
|
233
233
|
] });
|
|
234
234
|
});
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
steps:
|
|
238
|
-
currentStep:
|
|
239
|
-
completedColor:
|
|
240
|
-
pendingColor:
|
|
241
|
-
activeColor:
|
|
235
|
+
z.displayName = "StepCircle";
|
|
236
|
+
const $ = ({
|
|
237
|
+
steps: r,
|
|
238
|
+
currentStep: o,
|
|
239
|
+
completedColor: t = "#059669",
|
|
240
|
+
pendingColor: i = "#9ca3af",
|
|
241
|
+
activeColor: s = "#059669",
|
|
242
242
|
lineColor: n = "#e5e7eb",
|
|
243
|
-
showTime:
|
|
244
|
-
orientation:
|
|
243
|
+
showTime: h = !0,
|
|
244
|
+
orientation: b = "responsive"
|
|
245
245
|
}) => {
|
|
246
|
-
const
|
|
247
|
-
() =>
|
|
246
|
+
const l = r.length, d = o > l, f = Math.max(1, Math.min(o, l)), p = d ? Math.max(0, l - 1) : Math.max(0, Math.min(l - 1, f - 1)), _ = D(
|
|
247
|
+
() => r.map((m, g) => {
|
|
248
248
|
let x = "pending";
|
|
249
|
-
return
|
|
249
|
+
return d || g < p ? x = "completed" : g === p && (x = "active"), { step: m, index: g, status: x };
|
|
250
250
|
}),
|
|
251
|
-
[
|
|
252
|
-
),
|
|
253
|
-
"--rs-completed-color":
|
|
254
|
-
"--rs-pending-color":
|
|
255
|
-
"--rs-active-color":
|
|
251
|
+
[r, p, d]
|
|
252
|
+
), y = l > 0 ? 100 / l / 2 : 0, u = l > 1 ? d ? 100 : p / (l - 1) * 100 : 0, w = d || f > 1 ? t : n, v = d || f > l ? t : n, N = {
|
|
253
|
+
"--rs-completed-color": t,
|
|
254
|
+
"--rs-pending-color": i,
|
|
255
|
+
"--rs-active-color": s,
|
|
256
256
|
"--rs-line-color": n,
|
|
257
|
-
"--rs-half-step": `${
|
|
258
|
-
"--rs-progress": `${
|
|
259
|
-
"--rs-left-side-color":
|
|
260
|
-
"--rs-right-side-color":
|
|
257
|
+
"--rs-half-step": `${y}%`,
|
|
258
|
+
"--rs-progress": `${u}%`,
|
|
259
|
+
"--rs-left-side-color": w,
|
|
260
|
+
"--rs-right-side-color": v
|
|
261
261
|
};
|
|
262
|
-
return
|
|
262
|
+
return l === 0 ? null : /* @__PURE__ */ c("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: [
|
|
263
263
|
/* @__PURE__ */ e("div", { className: "pl-2 pt-2 pb-3 text-[14px] font-bold", children: "Workflow Progress" }),
|
|
264
|
-
/* @__PURE__ */ e("div", { className: `rs-stepper ${
|
|
264
|
+
/* @__PURE__ */ e("div", { className: `rs-stepper ${b === "vertical" ? "rs-stepper--vertical" : b === "horizontal" ? "rs-stepper--horizontal" : "rs-stepper--responsive"}`, style: N, children: /* @__PURE__ */ e("div", { className: "rs-stepper__scroll", children: /* @__PURE__ */ c("div", { className: "rs-stepper__row", children: [
|
|
265
265
|
/* @__PURE__ */ e("div", { className: "rs-stepper__track", children: /* @__PURE__ */ e("div", { className: "rs-stepper__progress" }) }),
|
|
266
|
-
_.map((
|
|
267
|
-
|
|
266
|
+
_.map((m) => /* @__PURE__ */ e(
|
|
267
|
+
z,
|
|
268
268
|
{
|
|
269
|
-
computed:
|
|
270
|
-
showTime:
|
|
269
|
+
computed: m,
|
|
270
|
+
showTime: h
|
|
271
271
|
},
|
|
272
|
-
|
|
272
|
+
m.step.id
|
|
273
273
|
))
|
|
274
274
|
] }) }) })
|
|
275
275
|
] });
|
|
276
|
-
}, P = B(
|
|
276
|
+
}, P = B($), A = ({
|
|
277
|
+
rows: r,
|
|
278
|
+
className: o = "mt-2 mx-2"
|
|
279
|
+
}) => /* @__PURE__ */ e("div", { className: `summary-detail-card ${o}`.trim(), children: r.map((t, i) => /* @__PURE__ */ e("div", { className: "summary-detail-card__row", children: t.map((s, n) => /* @__PURE__ */ c(
|
|
280
|
+
"div",
|
|
281
|
+
{
|
|
282
|
+
className: "summary-detail-card__field",
|
|
283
|
+
style: { "--dc-span": s.span ?? 1 },
|
|
284
|
+
children: [
|
|
285
|
+
/* @__PURE__ */ e("p", { className: "summary-detail-card__label", children: s.label }),
|
|
286
|
+
/* @__PURE__ */ e(
|
|
287
|
+
"p",
|
|
288
|
+
{
|
|
289
|
+
className: `summary-detail-card__value${s.size === "lg" ? " summary-detail-card__value--lg" : ""}`,
|
|
290
|
+
children: s.value
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
n
|
|
296
|
+
)) }, i)) }), H = ({
|
|
297
|
+
title: r,
|
|
298
|
+
description: o,
|
|
299
|
+
icon: t,
|
|
300
|
+
className: i = "",
|
|
301
|
+
children: s
|
|
302
|
+
}) => /* @__PURE__ */ c(
|
|
303
|
+
"div",
|
|
304
|
+
{
|
|
305
|
+
className: `flex flex-col items-center justify-center py-4 px-4 text-center ${i}`,
|
|
306
|
+
children: [
|
|
307
|
+
t && /* @__PURE__ */ e("div", { className: "mb-2", children: t }),
|
|
308
|
+
/* @__PURE__ */ e("div", { className: "text-[14px] font-semibold text-[#34343F]", children: r }),
|
|
309
|
+
(o || s) && /* @__PURE__ */ e("p", { className: "mt-2 max-w-[650px] text-[12px] leading-relaxed text-[#A19D9D]", children: s ?? o })
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
);
|
|
277
313
|
export {
|
|
278
|
-
|
|
279
|
-
|
|
314
|
+
W as CustomTabs,
|
|
315
|
+
H as EmptyState,
|
|
316
|
+
P as Stepper,
|
|
317
|
+
A as SummaryDetailsCard
|
|
280
318
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface EmptyStateProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string | React.ReactNode;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const EmptyState: React.FC<EmptyStateProps>;
|
|
10
|
+
export default EmptyState;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
import "./components/Stepper.css";
|
|
3
|
+
import "./components/SummaryDetailsCard.css";
|
|
3
4
|
export { default as CustomTabs } from "./components/CustomTabs";
|
|
4
5
|
export type { TabItem, CustomTabsProps, } from "./types/tabs";
|
|
5
6
|
export { default as Stepper } from "./components/Stepper";
|
|
6
7
|
export type { StepItem, StepperProps } from "./types/stepper";
|
|
8
|
+
export { default as SummaryDetailsCard } from "./components/SummaryDetailsCard";
|
|
9
|
+
export type { SummaryDetailField, DetailRow, SummaryDetailsCardProps } from "./types/SummaryDetailsCard";
|
|
10
|
+
export { default as EmptyState } from "./components/EmptyState";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface SummaryDetailField {
|
|
3
|
+
label: string;
|
|
4
|
+
value: ReactNode;
|
|
5
|
+
size?: 'default' | 'lg';
|
|
6
|
+
span?: 1 | 2 | 3 | 4;
|
|
7
|
+
}
|
|
8
|
+
export type DetailRow = SummaryDetailField[];
|
|
9
|
+
export interface SummaryDetailsCardProps {
|
|
10
|
+
rows: DetailRow[];
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
@@ -1,35 +1,16 @@
|
|
|
1
1
|
export interface StepItem {
|
|
2
|
-
/** Unique identifier for the step */
|
|
3
2
|
id: string;
|
|
4
|
-
/** Label shown under the circle */
|
|
5
3
|
title: string;
|
|
6
|
-
/** Optional date shown under the title (e.g. "21 May 2026") */
|
|
7
4
|
date?: string;
|
|
8
|
-
/** Optional time shown under the date (e.g. "09:40 AM") */
|
|
9
5
|
time?: string;
|
|
10
6
|
}
|
|
11
7
|
export interface StepperProps {
|
|
12
|
-
/** Ordered list of steps to render */
|
|
13
8
|
steps: StepItem[];
|
|
14
|
-
/**
|
|
15
|
-
* Index of the current (active) step, 1-based, matching the numbering
|
|
16
|
-
* shown inside the circles. Steps with index < currentStep are treated
|
|
17
|
-
* as completed, the step === currentStep is treated as active/current,
|
|
18
|
-
* and steps > currentStep are treated as upcoming.
|
|
19
|
-
*
|
|
20
|
-
* Example: currentStep={3} means step 1 and 2 are completed, step 3 is
|
|
21
|
-
* active, and the rest are upcoming.
|
|
22
|
-
*/
|
|
23
9
|
currentStep: number;
|
|
24
|
-
/** Fill color for completed step circles and their connecting lines. Default: #059669 */
|
|
25
10
|
completedColor?: string;
|
|
26
|
-
/** Color for upcoming step circles, numbers, titles and connecting lines. Default: #9CA3AF */
|
|
27
11
|
pendingColor?: string;
|
|
28
|
-
/** Border/number/title color for the current/active step. Default: #059669 */
|
|
29
12
|
activeColor?: string;
|
|
30
|
-
/** Base color for the connecting line track behind the circles. Default: #E5E7EB */
|
|
31
13
|
lineColor?: string;
|
|
32
|
-
/** Whether to render the optional `time` field under `date`. Default: true */
|
|
33
14
|
showTime?: boolean;
|
|
34
15
|
orientation?: string;
|
|
35
16
|
}
|