shekel-fe-shared-lib 1.0.0 → 1.0.1
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 +300 -18
- package/dist/index.cjs +48 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1290 -188
- package/dist/index.mjs.map +1 -1
- package/dist/shekel-fe-shared-lib.css +1 -1
- package/dist/types/components/Badge.d.ts +12 -0
- package/dist/types/components/Button.d.ts +8 -4
- package/dist/types/components/Card.d.ts +10 -0
- package/dist/types/components/Checkbox.d.ts +16 -0
- package/dist/types/components/Dropdown.d.ts +20 -0
- package/dist/types/components/Modal.d.ts +15 -0
- package/dist/types/components/Progress.d.ts +13 -0
- package/dist/types/components/SearchInput.d.ts +10 -0
- package/dist/types/components/Select.d.ts +22 -0
- package/dist/types/components/SelectedItemsList.d.ts +16 -0
- package/dist/types/components/StatCard.d.ts +10 -0
- package/dist/types/components/Steps.d.ts +17 -0
- package/dist/types/components/Table.d.ts +33 -0
- package/dist/types/components/TableTop.d.ts +12 -0
- package/dist/types/components/index.d.ts +27 -1
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Shekel FE Shared Lib
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A modern React component library built with **Tailwind CSS** and custom animations. Create beautiful, responsive UIs without the overhead of third-party component libraries.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -13,22 +13,23 @@ npm install shekel-fe-shared-lib
|
|
|
13
13
|
This package requires the following peer dependencies:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install react react-dom
|
|
16
|
+
npm install react react-dom
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
### Import Components
|
|
21
|
+
### Import Components and Styles
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
|
-
import { Button } from 'shekel-fe-shared-lib';
|
|
24
|
+
import { Button, StatCard, SearchInput, Card } from 'shekel-fe-shared-lib';
|
|
25
25
|
import 'shekel-fe-shared-lib/styles.css';
|
|
26
26
|
|
|
27
27
|
function App() {
|
|
28
28
|
return (
|
|
29
29
|
<div>
|
|
30
30
|
<Button variant="primary">Click me</Button>
|
|
31
|
-
<
|
|
31
|
+
<StatCard label="Total Shipments" value={42} />
|
|
32
|
+
<SearchInput icon={true} placeholder="Search..." />
|
|
32
33
|
</div>
|
|
33
34
|
);
|
|
34
35
|
}
|
|
@@ -36,7 +37,7 @@ function App() {
|
|
|
36
37
|
|
|
37
38
|
### Tailwind CSS Setup
|
|
38
39
|
|
|
39
|
-
If your project uses Tailwind CSS,
|
|
40
|
+
If your project uses Tailwind CSS, add this library to your `tailwind.config.js` content array:
|
|
40
41
|
|
|
41
42
|
```js
|
|
42
43
|
module.exports = {
|
|
@@ -52,32 +53,225 @@ module.exports = {
|
|
|
52
53
|
|
|
53
54
|
### Button
|
|
54
55
|
|
|
55
|
-
A customizable button component
|
|
56
|
+
A fully customizable button component with multiple variants, sizes, and built-in loading states.
|
|
56
57
|
|
|
57
58
|
#### Props
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
| Prop | Type | Default | Description |
|
|
61
|
+
|------|------|---------|-------------|
|
|
62
|
+
| `variant` | `'primary' \| 'outlined' \| 'ghost' \| 'text'` | `'primary'` | Button style variant |
|
|
63
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
|
|
64
|
+
| `fullWidth` | `boolean` | `false` | Whether button takes full width |
|
|
65
|
+
| `icon` | `React.ReactNode` | `undefined` | Icon to display with button |
|
|
66
|
+
| `iconPosition` | `'left' \| 'right'` | `'left'` | Position of the icon |
|
|
67
|
+
| `loading` | `boolean` | `false` | Shows loading spinner |
|
|
68
|
+
| All standard button HTML attributes | - | - | Extends `HTMLButtonElement` |
|
|
62
69
|
|
|
63
70
|
#### Examples
|
|
64
71
|
|
|
65
72
|
```tsx
|
|
66
73
|
// Primary button
|
|
67
|
-
<Button variant="primary">
|
|
74
|
+
<Button variant="primary">Start Tracking</Button>
|
|
68
75
|
|
|
69
|
-
//
|
|
70
|
-
<Button variant="
|
|
76
|
+
// Outlined button
|
|
77
|
+
<Button variant="outlined">Download Report</Button>
|
|
71
78
|
|
|
72
|
-
//
|
|
73
|
-
<Button
|
|
79
|
+
// Button with icon
|
|
80
|
+
<Button
|
|
81
|
+
variant="outlined"
|
|
82
|
+
icon={<MapIcon />}
|
|
83
|
+
iconPosition="left"
|
|
84
|
+
>
|
|
85
|
+
Map Intelligence
|
|
86
|
+
</Button>
|
|
87
|
+
|
|
88
|
+
// Loading state
|
|
89
|
+
<Button loading>Processing...</Button>
|
|
74
90
|
|
|
75
|
-
//
|
|
76
|
-
<Button variant="
|
|
77
|
-
|
|
91
|
+
// Full width button
|
|
92
|
+
<Button fullWidth variant="primary">
|
|
93
|
+
Submit
|
|
78
94
|
</Button>
|
|
95
|
+
|
|
96
|
+
// Different sizes
|
|
97
|
+
<Button size="sm">Small</Button>
|
|
98
|
+
<Button size="md">Medium</Button>
|
|
99
|
+
<Button size="lg">Large</Button>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### StatCard
|
|
105
|
+
|
|
106
|
+
An animated card component perfect for displaying statistics and metrics, like shipment counts.
|
|
107
|
+
|
|
108
|
+
#### Props
|
|
109
|
+
|
|
110
|
+
| Prop | Type | Default | Description |
|
|
111
|
+
|------|------|---------|-------------|
|
|
112
|
+
| `label` | `string` | **required** | The label text for the stat |
|
|
113
|
+
| `value` | `string \| number` | **required** | The value to display |
|
|
114
|
+
| `selected` | `boolean` | `false` | Whether the card is selected |
|
|
115
|
+
| `onClick` | `() => void` | `undefined` | Click handler |
|
|
116
|
+
| `className` | `string` | `''` | Additional CSS classes |
|
|
117
|
+
|
|
118
|
+
#### Examples
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
// Basic stat card
|
|
122
|
+
<StatCard label="All Shipment" value={0} />
|
|
123
|
+
|
|
124
|
+
// Selected state
|
|
125
|
+
<StatCard
|
|
126
|
+
label="All Shipment"
|
|
127
|
+
value={0}
|
|
128
|
+
selected={true}
|
|
129
|
+
/>
|
|
130
|
+
|
|
131
|
+
// With click handler
|
|
132
|
+
<StatCard
|
|
133
|
+
label="Queued"
|
|
134
|
+
value={5}
|
|
135
|
+
onClick={() => console.log('Clicked')}
|
|
136
|
+
/>
|
|
137
|
+
|
|
138
|
+
// Grid of stat cards
|
|
139
|
+
<div className="grid grid-cols-4 gap-4">
|
|
140
|
+
<StatCard label="All Shipment" value={0} selected />
|
|
141
|
+
<StatCard label="Queued" value={0} />
|
|
142
|
+
<StatCard label="Planned" value={0} />
|
|
143
|
+
<StatCard label="On ship" value={0} />
|
|
144
|
+
</div>
|
|
79
145
|
```
|
|
80
146
|
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### SearchInput
|
|
150
|
+
|
|
151
|
+
A customizable search input with icon support and built-in animations.
|
|
152
|
+
|
|
153
|
+
#### Props
|
|
154
|
+
|
|
155
|
+
| Prop | Type | Default | Description |
|
|
156
|
+
|------|------|---------|-------------|
|
|
157
|
+
| `icon` | `React.ReactNode \| true` | `undefined` | Icon to display (true for default search icon) |
|
|
158
|
+
| `iconPosition` | `'left' \| 'right'` | `'left'` | Position of the icon |
|
|
159
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Input size |
|
|
160
|
+
| `fullWidth` | `boolean` | `false` | Whether input takes full width |
|
|
161
|
+
| `onIconClick` | `() => void` | `undefined` | Click handler for icon |
|
|
162
|
+
| All standard input HTML attributes | - | - | Extends `HTMLInputElement` |
|
|
163
|
+
|
|
164
|
+
#### Examples
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
// Basic search input with default icon
|
|
168
|
+
<SearchInput
|
|
169
|
+
icon={true}
|
|
170
|
+
placeholder="Search a shipment"
|
|
171
|
+
/>
|
|
172
|
+
|
|
173
|
+
// Custom icon
|
|
174
|
+
<SearchInput
|
|
175
|
+
icon={<CustomIcon />}
|
|
176
|
+
placeholder="Search..."
|
|
177
|
+
/>
|
|
178
|
+
|
|
179
|
+
// Full width with icon on right
|
|
180
|
+
<SearchInput
|
|
181
|
+
icon={true}
|
|
182
|
+
iconPosition="right"
|
|
183
|
+
fullWidth
|
|
184
|
+
placeholder="Type to search..."
|
|
185
|
+
/>
|
|
186
|
+
|
|
187
|
+
// Different sizes
|
|
188
|
+
<SearchInput size="sm" icon={true} placeholder="Small" />
|
|
189
|
+
<SearchInput size="md" icon={true} placeholder="Medium" />
|
|
190
|
+
<SearchInput size="lg" icon={true} placeholder="Large" />
|
|
191
|
+
|
|
192
|
+
// With icon click handler
|
|
193
|
+
<SearchInput
|
|
194
|
+
icon={true}
|
|
195
|
+
onIconClick={() => console.log('Icon clicked')}
|
|
196
|
+
placeholder="Click icon to search"
|
|
197
|
+
/>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### Card
|
|
203
|
+
|
|
204
|
+
A versatile container component with customizable padding, shadows, and hover effects.
|
|
205
|
+
|
|
206
|
+
#### Props
|
|
207
|
+
|
|
208
|
+
| Prop | Type | Default | Description |
|
|
209
|
+
|------|------|---------|-------------|
|
|
210
|
+
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Internal padding |
|
|
211
|
+
| `shadow` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'sm'` | Shadow depth |
|
|
212
|
+
| `hover` | `boolean` | `false` | Enable hover elevation effect |
|
|
213
|
+
| `bordered` | `boolean` | `true` | Show border |
|
|
214
|
+
| `rounded` | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'lg'` | Border radius |
|
|
215
|
+
| `className` | `string` | `''` | Additional CSS classes |
|
|
216
|
+
| All standard div HTML attributes | - | - | Extends `HTMLDivElement` |
|
|
217
|
+
|
|
218
|
+
#### Examples
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
// Basic card
|
|
222
|
+
<Card>
|
|
223
|
+
<h3>Card Title</h3>
|
|
224
|
+
<p>Card content goes here</p>
|
|
225
|
+
</Card>
|
|
226
|
+
|
|
227
|
+
// Card with hover effect
|
|
228
|
+
<Card hover shadow="md">
|
|
229
|
+
<p>Hover over me!</p>
|
|
230
|
+
</Card>
|
|
231
|
+
|
|
232
|
+
// No padding card
|
|
233
|
+
<Card padding="none">
|
|
234
|
+
<img src="image.jpg" alt="Full width" />
|
|
235
|
+
</Card>
|
|
236
|
+
|
|
237
|
+
// Custom styling
|
|
238
|
+
<Card
|
|
239
|
+
padding="lg"
|
|
240
|
+
shadow="lg"
|
|
241
|
+
rounded="xl"
|
|
242
|
+
className="bg-gradient-to-r from-blue-500 to-purple-600"
|
|
243
|
+
>
|
|
244
|
+
<p className="text-white">Gradient card</p>
|
|
245
|
+
</Card>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Animations
|
|
251
|
+
|
|
252
|
+
All components include built-in CSS animations:
|
|
253
|
+
|
|
254
|
+
- **StatCard**: Fade-in-up animation with count-up effect on values
|
|
255
|
+
- **Card**: Smooth fade-in animation
|
|
256
|
+
- **Button**: Active scale and smooth transitions
|
|
257
|
+
- **SearchInput**: Smooth focus transitions
|
|
258
|
+
|
|
259
|
+
Additional animation classes available:
|
|
260
|
+
- `.shimmer` - Loading shimmer effect
|
|
261
|
+
- `.slide-in-right` - Slide in from right animation
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## TypeScript Support
|
|
266
|
+
|
|
267
|
+
This library is written in TypeScript and includes full type definitions. All component props are fully typed for the best development experience.
|
|
268
|
+
|
|
269
|
+
```tsx
|
|
270
|
+
import type { ButtonProps, StatCardProps, SearchInputProps, CardProps } from 'shekel-fe-shared-lib';
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
81
275
|
## Development
|
|
82
276
|
|
|
83
277
|
### Build
|
|
@@ -93,16 +287,104 @@ shekel-fe-shared-lib/
|
|
|
93
287
|
├── src/
|
|
94
288
|
│ ├── components/
|
|
95
289
|
│ │ ├── Button.tsx
|
|
290
|
+
│ │ ├── StatCard.tsx
|
|
291
|
+
│ │ ├── SearchInput.tsx
|
|
292
|
+
│ │ ├── Card.tsx
|
|
96
293
|
│ │ └── index.ts
|
|
97
294
|
│ ├── styles.css
|
|
98
295
|
│ └── index.ts
|
|
99
296
|
├── dist/ # Built files (generated)
|
|
297
|
+
│ ├── index.mjs # ES module
|
|
298
|
+
│ ├── index.cjs # CommonJS
|
|
299
|
+
│ ├── shekel-fe-shared-lib.css
|
|
300
|
+
│ └── types/ # TypeScript definitions
|
|
100
301
|
├── package.json
|
|
101
302
|
├── tsconfig.json
|
|
102
303
|
├── vite.config.ts
|
|
103
304
|
└── README.md
|
|
104
305
|
```
|
|
105
306
|
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Examples
|
|
310
|
+
|
|
311
|
+
### Complete Tracking Dashboard Layout
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import {
|
|
315
|
+
Button,
|
|
316
|
+
StatCard,
|
|
317
|
+
SearchInput,
|
|
318
|
+
Card
|
|
319
|
+
} from 'shekel-fe-shared-lib';
|
|
320
|
+
import 'shekel-fe-shared-lib/styles.css';
|
|
321
|
+
|
|
322
|
+
function TrackingDashboard() {
|
|
323
|
+
const [selectedStat, setSelectedStat] = useState('all');
|
|
324
|
+
|
|
325
|
+
return (
|
|
326
|
+
<div className="p-6">
|
|
327
|
+
{/* Header */}
|
|
328
|
+
<div className="flex justify-between items-center mb-6">
|
|
329
|
+
<h1 className="text-2xl font-bold">Tracking</h1>
|
|
330
|
+
<div className="flex gap-3">
|
|
331
|
+
<Button variant="outlined" icon={<MapIcon />}>
|
|
332
|
+
Map Intelligence
|
|
333
|
+
</Button>
|
|
334
|
+
<Button variant="primary">
|
|
335
|
+
Start Tracking
|
|
336
|
+
</Button>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
{/* Stat Cards */}
|
|
341
|
+
<div className="grid grid-cols-8 gap-3 mb-6">
|
|
342
|
+
<StatCard
|
|
343
|
+
label="All Shipment"
|
|
344
|
+
value={0}
|
|
345
|
+
selected={selectedStat === 'all'}
|
|
346
|
+
onClick={() => setSelectedStat('all')}
|
|
347
|
+
/>
|
|
348
|
+
<StatCard label="Queued" value={0} />
|
|
349
|
+
<StatCard label="Planned" value={0} />
|
|
350
|
+
<StatCard label="On ship" value={0} />
|
|
351
|
+
<StatCard label="Delayed" value={0} />
|
|
352
|
+
<StatCard label="Arrived" value={0} />
|
|
353
|
+
<StatCard label="Released" value={0} />
|
|
354
|
+
<StatCard label="Demurrage" value={0} />
|
|
355
|
+
</div>
|
|
356
|
+
|
|
357
|
+
{/* Actions and Search */}
|
|
358
|
+
<div className="flex justify-between items-center mb-6">
|
|
359
|
+
<h2 className="text-lg font-semibold">Recent Activity</h2>
|
|
360
|
+
<div className="flex gap-3">
|
|
361
|
+
<Button variant="outlined" icon={<DownloadIcon />}>
|
|
362
|
+
Download report
|
|
363
|
+
</Button>
|
|
364
|
+
<Button variant="outlined" icon={<FilterIcon />}>
|
|
365
|
+
Filter
|
|
366
|
+
</Button>
|
|
367
|
+
<SearchInput
|
|
368
|
+
icon={true}
|
|
369
|
+
placeholder="Search a shipment"
|
|
370
|
+
className="w-80"
|
|
371
|
+
/>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
|
|
375
|
+
{/* Content */}
|
|
376
|
+
<Card>
|
|
377
|
+
<p className="text-center text-gray-500 py-12">
|
|
378
|
+
Your gateway to seamless shipment tracking
|
|
379
|
+
</p>
|
|
380
|
+
</Card>
|
|
381
|
+
</div>
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
106
388
|
## License
|
|
107
389
|
|
|
108
390
|
ISC
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react");var F={exports:{}},M={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Q;function re(){if(Q)return M;Q=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function n(r,a,c){var u=null;if(c!==void 0&&(u=""+c),a.key!==void 0&&(u=""+a.key),"key"in a){c={};for(var x in a)x!=="key"&&(c[x]=a[x])}else c=a;return a=c.ref,{$$typeof:s,type:r,key:u,ref:a!==void 0?a:null,props:c}}return M.Fragment=l,M.jsx=n,M.jsxs=n,M}var A={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,10 +14,54 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Z;function se(){return Z||(Z=1,process.env.NODE_ENV!=="production"&&(function(){function s(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===W?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case i:return"Fragment";case v:return"Profiler";case k:return"StrictMode";case _:return"Suspense";case T:return"SuspenseList";case z:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case y:return"Portal";case R:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case S:var g=t.render;return t=t.displayName,t||(t=g.displayName||g.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return g=t.displayName||null,g!==null?g:s(t.type)||"Memo";case P:g=t._payload,t=t._init;try{return s(t(g))}catch{}}return null}function l(t){return""+t}function n(t){try{l(t);var g=!1}catch{g=!0}if(g){g=console;var w=g.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return w.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),l(t)}}function r(t){if(t===i)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===P)return"<...>";try{var g=s(t);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function a(){var t=B.A;return t===null?null:t.getOwner()}function c(){return Error("react-stack-top-frame")}function u(t){if(j.call(t,"key")){var g=Object.getOwnPropertyDescriptor(t,"key").get;if(g&&g.isReactWarning)return!1}return t.key!==void 0}function x(t,g){function w(){q||(q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}w.isReactWarning=!0,Object.defineProperty(t,"key",{get:w,configurable:!0})}function m(){var t=s(this.type);return J[t]||(J[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function h(t,g,w,C,I,V){var E=w.ref;return t={$$typeof:o,type:t,key:g,props:w,_owner:C},(E!==void 0?E:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:m}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function b(t,g,w,C,I,V){var E=g.children;if(E!==void 0)if(C)if(D(E)){for(C=0;C<E.length;C++)p(E[C]);Object.freeze&&Object.freeze(E)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(E);if(j.call(g,"key")){E=s(t);var O=Object.keys(g).filter(function(te){return te!=="key"});C=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",X[E+C]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,C,E,O,E),X[E+C]=!0)}if(E=null,w!==void 0&&(n(w),E=""+w),u(g)&&(n(g.key),E=""+g.key),"key"in g){w={};for(var U in g)U!=="key"&&(w[U]=g[U])}else w=g;return E&&x(w,typeof t=="function"?t.displayName||t.name||"Unknown":t),h(t,E,w,a(),I,V)}function p(t){d(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===P&&(t._payload.status==="fulfilled"?d(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function d(t){return typeof t=="object"&&t!==null&&t.$$typeof===o}var f=$,o=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),R=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),W=Symbol.for("react.client.reference"),B=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,D=Array.isArray,Y=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(t){return t()}};var q,J={},G=f.react_stack_bottom_frame.bind(f,c)(),H=Y(r(c)),X={};A.Fragment=i,A.jsx=function(t,g,w){var C=1e4>B.recentlyCreatedOwnerStacks++;return b(t,g,w,!1,C?Error("react-stack-top-frame"):G,C?Y(r(t)):H)},A.jsxs=function(t,g,w){var C=1e4>B.recentlyCreatedOwnerStacks++;return b(t,g,w,!0,C?Error("react-stack-top-frame"):G,C?Y(r(t)):H)}})()),A}var K;function ne(){return K||(K=1,process.env.NODE_ENV==="production"?F.exports=re():F.exports=se()),F.exports}var e=ne();const ae=({variant:s="primary",size:l="md",fullWidth:n=!1,icon:r,iconPosition:a="left",loading:c=!1,hoverColor:u,className:x="",children:m,disabled:h,...b})=>{const p="inline-flex items-center justify-center font-normal rounded-lg transition-all duration-300 ease-out focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-95",d={primary:"bg-[#EC615B] hover:bg-[#D4554F] text-white focus:ring-[#EC615B] shadow-sm hover:shadow-md",outlined:"border border-gray-300 bg-white hover:bg-gray-50 text-[#181918] focus:ring-gray-300",ghost:"bg-gray-100 hover:bg-gray-200 text-[#181918] focus:ring-gray-300",text:"text-[#181918] hover:bg-gray-100 focus:ring-gray-300"},f={sm:"px-3 py-1.5 text-sm gap-1.5",md:"px-4 py-2 text-base gap-2",lg:"px-6 py-3 text-lg gap-2.5"},o=n?"w-full":"",y=`${p} ${d[s]} ${f[l]} ${o} ${x}`,i=()=>c?e.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):r;return e.jsxs("button",{className:y,disabled:h||c,style:u?{"--hover-color":u}:void 0,onMouseEnter:k=>{u&&!h&&!c&&(k.currentTarget.style.backgroundColor=u)},onMouseLeave:k=>{u&&!h&&!c&&(k.currentTarget.style.backgroundColor="")},...b,children:[a==="left"&&i(),m,a==="right"&&i()]})},le=({label:s,value:l,selected:n=!1,onClick:r,className:a=""})=>{const x=`stat-card relative flex flex-col p-4 rounded-lg border transition-all duration-500 ease-in-out cursor-pointer overflow-hidden ${n?"border-[#181918] bg-[#F4F4F4] shadow-sm scale-[1.02]":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm"} ${a}`;return e.jsxs("div",{className:x,onClick:r,children:[n&&e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-[#EC615B]/5 to-transparent animate-slide-in pointer-events-none"}),e.jsxs("div",{className:"relative z-10 transition-transform duration-300 ease-out hover:scale-[0.98] active:scale-[0.96]",children:[e.jsx("span",{className:`text-sm font-normal mb-2 block transition-colors duration-500 ${n?"text-gray-700":"text-gray-600"}`,children:s}),e.jsx("span",{className:`text-3xl font-semibold stat-value block transition-all duration-500 ${n?"text-[#181918] scale-105":"text-[#181918]"}`,children:l})]})]})},oe=({icon:s,iconPosition:l="left",size:n="md",fullWidth:r=!1,className:a="",onIconClick:c,...u})=>{const x="relative inline-flex items-center",m="border border-gray-300 rounded-lg focus:outline-none focus:ring-1 focus:ring-[#EC615B] focus:border-[#EC615B] transition-all duration-200 ease-in-out placeholder:text-gray-400",h={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-5 py-3 text-lg"},b={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},p=l==="left"?n==="sm"?"pl-9":n==="md"?"pl-10":"pl-12":n==="sm"?"pr-9":n==="md"?"pr-10":"pr-12",d=r?"w-full":"",f=`${m} ${h[n]} ${s?p:""} ${d} ${a}`,o=l==="left"?"left-3":"right-3",y=e.jsx("svg",{className:b[n],xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})});return e.jsxs("div",{className:`${x} ${d}`,children:[s&&e.jsx("div",{className:`absolute ${o} text-gray-400 ${c?"cursor-pointer hover:text-gray-600":""}`,onClick:c,children:s===!0?y:s}),e.jsx("input",{type:"text",className:f,...u})]})},ie=({padding:s="md",shadow:l="sm",hover:n=!1,bordered:r=!0,rounded:a="lg",className:c="",children:u,...x})=>{const m="card bg-white transition-all duration-300 ease-out",h={none:"p-0",sm:"p-3",md:"p-4",lg:"p-6"},b={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg"},p={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},d=r?"border border-gray-200":"",f=n?"cursor-pointer":"",o=`${m} ${h[s]} ${b[l]} ${p[a]} ${d} ${f} ${c}`;return e.jsx("div",{className:o,...x,children:e.jsx("div",{className:n?"transition-transform duration-300 ease-out hover:scale-[0.98] active:scale-[0.96]":"",children:u})})},ce=({items:s,trigger:l="click",placement:n="bottomLeft",children:r,className:a="",overlayClassName:c="",disabled:u=!1})=>{const[x,m]=$.useState(!1),h=$.useRef(null);$.useEffect(()=>{const i=k=>{h.current&&!h.current.contains(k.target)&&m(!1)};return x&&document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[x]);const b=()=>{!u&&l==="click"&&m(!x)},p=()=>{!u&&l==="hover"&&m(!0)},d=()=>{!u&&l==="hover"&&m(!1)},f=i=>{!i.disabled&&i.onClick&&i.onClick(),m(!1)},o={bottomLeft:"top-full left-0 mt-1",bottomRight:"top-full right-0 mt-1",topLeft:"bottom-full left-0 mb-1",topRight:"bottom-full right-0 mb-1"},y=n.startsWith("bottom")?"dropdown-slide-down":"dropdown-slide-up";return e.jsxs("div",{ref:h,className:`relative inline-block ${a}`,onMouseEnter:p,onMouseLeave:d,children:[e.jsx("div",{onClick:b,className:`inline-flex ${u?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:r}),x&&!u&&e.jsx("div",{className:`absolute ${o[n]} ${y} z-50 min-w-[160px] ${c}`,children:e.jsx("div",{className:"dropdown-menu bg-white rounded-lg shadow-lg border border-gray-200 py-1 overflow-hidden",children:s.map(i=>e.jsxs("div",{onClick:()=>f(i),className:`
|
|
23
|
+
dropdown-menu-item
|
|
24
|
+
flex items-center gap-2 px-4 py-2 text-sm cursor-pointer transition-all duration-200 ease-out
|
|
25
|
+
${i.disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50"}
|
|
26
|
+
${i.danger?"text-red-600 hover:bg-red-50":"text-gray-700"}
|
|
27
|
+
`,children:[i.icon&&e.jsx("span",{className:"flex-shrink-0",children:i.icon}),e.jsx("span",{children:i.label})]},i.key))})})]})},ee=({options:s,value:l,defaultValue:n,placeholder:r="Select an option",onChange:a,disabled:c=!1,size:u="md",fullWidth:x=!1,className:m="",allowClear:h=!1,showSearch:b=!1,searchPlaceholder:p="Search..."})=>{const[d,f]=$.useState(!1),[o,y]=$.useState(n),[i,k]=$.useState(""),v=$.useRef(null),N=$.useRef(null),R=l!==void 0?l:o;$.useEffect(()=>{const j=D=>{v.current&&!v.current.contains(D.target)&&(f(!1),k(""))};return d&&(document.addEventListener("mousedown",j),b&&N.current&&N.current.focus()),()=>{document.removeEventListener("mousedown",j)}},[d,b]);const S=j=>{l===void 0&&y(j),a==null||a(j),f(!1),k("")},_=j=>{j.stopPropagation(),l===void 0&&y(void 0),a==null||a("")},T=s.find(j=>j.value===R),L=b?s.filter(j=>j.label.toLowerCase().includes(i.toLowerCase())):s,P={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-5 py-3 text-lg"},z=x?"w-full":"min-w-[200px]",W=e.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ease-out ${d?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),B=e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})});return e.jsxs("div",{ref:v,className:`relative ${z} ${m}`,children:[e.jsxs("div",{onClick:()=>!c&&f(!d),className:`
|
|
28
|
+
select-trigger
|
|
29
|
+
flex items-center justify-between gap-2
|
|
30
|
+
border border-gray-300 rounded-lg
|
|
31
|
+
bg-white
|
|
32
|
+
transition-all duration-200 ease-out
|
|
33
|
+
${P[u]}
|
|
34
|
+
${c?"opacity-50 cursor-not-allowed bg-gray-50":"cursor-pointer hover:border-gray-400"}
|
|
35
|
+
${d?"border-[#EC615B] ring-2 ring-[#EC615B] ring-opacity-20":""}
|
|
36
|
+
`,children:[e.jsx("span",{className:T?"text-gray-900":"text-gray-400",children:T?T.label:r}),e.jsxs("div",{className:"flex items-center gap-1",children:[h&&R&&!c&&e.jsx("span",{onClick:_,className:"text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",children:B}),e.jsx("span",{className:"text-gray-400",children:W})]})]}),d&&!c&&e.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 z-50 dropdown-slide-down",children:e.jsxs("div",{className:"select-dropdown bg-white rounded-lg shadow-lg border border-gray-200 py-1 max-h-[300px] overflow-auto",children:[b&&e.jsx("div",{className:"px-2 py-2 border-b border-gray-200",children:e.jsx("input",{ref:N,type:"text",value:i,onChange:j=>k(j.target.value),placeholder:p,className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-[#EC615B] focus:border-[#EC615B] transition-all duration-200 ease-out",onClick:j=>j.stopPropagation()})}),L.length===0?e.jsx("div",{className:"px-4 py-3 text-sm text-gray-500 text-center",children:"No results found"}):L.map(j=>e.jsx("div",{onClick:()=>!j.disabled&&S(j.value),className:`
|
|
37
|
+
select-option
|
|
38
|
+
px-4 py-2 text-sm cursor-pointer transition-all duration-200 ease-out
|
|
39
|
+
${j.disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50"}
|
|
40
|
+
${j.value===R?"bg-[#FCEAE9] text-[#EC615B] font-medium":"text-[#181918]"}
|
|
41
|
+
`,children:j.label},j.value))]})})]})},de=({columns:s,dataSource:l,rowKey:n="id",pagination:r,loading:a=!1,onRow:c,className:u="",bordered:x=!1,striped:m=!1})=>{const[h,b]=$.useState(r&&typeof r=="object"&&r.current||1),[p,d]=$.useState(r&&typeof r=="object"&&r.pageSize||10),f=(v,N)=>typeof n=="function"?n(v):v[n]||String(N),o=(v,N)=>N?N.split(".").reduce((R,S)=>R==null?void 0:R[S],v):v,y=r===!1?l:l.slice((h-1)*p,h*p),i=v=>{b(v),r&&typeof r=="object"&&r.onChange&&r.onChange(v,p)},k=v=>{d(v),b(1),r&&typeof r=="object"&&r.onChange&&r.onChange(1,v)};return e.jsxs("div",{className:"w-full",children:[e.jsx("div",{className:"overflow-x-auto rounded-2xl border border-[#EEEEEE]",children:e.jsxs("table",{className:`w-full ${x?"border-collapse":""} ${u}`,children:[e.jsx("thead",{className:"bg-[#F5F6F7]",children:e.jsx("tr",{children:s.map((v,N)=>e.jsx("th",{className:`px-4 py-3 text-left text-xs font-medium text-[#333333] uppercase tracking-wider ${x&&N!==s.length-1?"border-r border-[#EEEEEE]":""} ${v.align==="center"?"text-center":v.align==="right"?"text-right":""}`,style:{width:v.width},children:v.title},v.key))})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:a?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:"px-4 py-8 text-center text-[#333333]",children:e.jsxs("div",{className:"flex justify-center items-center",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]})})}):y.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:"px-4 py-8 text-center text-[#333333]",children:"No data"})}):y.map((v,N)=>{const R=c?c(v,N):{};return e.jsx("tr",{className:`${m&&N%2===1?"bg-[#F5F6F7]":""} hover:bg-gray-50 transition-colors duration-200 ease-out`,...R,children:s.map((S,_)=>{const T=o(v,S.dataIndex),L=S.render?S.render(T,v,N):T;return e.jsx("td",{className:`px-4 py-4 text-sm text-gray-900 ${x&&_!==s.length-1?"border-r border-[#EEEEEE]":""} ${S.align==="center"?"text-center":S.align==="right"?"text-right":""}`,children:L},S.key)})},f(v,N))})})]})}),r!==!1&&e.jsx(ue,{current:h,pageSize:p,total:l.length,onChange:i,onPageSizeChange:k,showSizeChanger:r&&typeof r=="object"?r.showSizeChanger:!0,pageSizeOptions:r&&typeof r=="object"?r.pageSizeOptions:[10,20,50,100],showTotal:r&&typeof r=="object"?r.showTotal:!0,size:r&&typeof r=="object"?r.size:"md"})]})},ue=({current:s,pageSize:l,total:n,onChange:r,onPageSizeChange:a,showSizeChanger:c=!0,pageSizeOptions:u=[10,20,50,100],showTotal:x=!0,size:m="md"})=>{const h=Math.ceil(n/l),b=(s-1)*l+1,p=Math.min(s*l,n),d={sm:{button:"px-2.5 py-1 text-xs",icon:"h-3.5 w-3.5",nav:"px-1.5 py-1.5"},md:{button:"px-4 py-2 text-sm",icon:"h-5 w-5",nav:"px-2 py-2"},lg:{button:"px-5 py-2.5 text-base",icon:"h-6 w-6",nav:"px-3 py-3"}},f=()=>{const o=[];if(h<=7)for(let i=1;i<=h;i++)o.push(i);else if(s<=3){for(let i=1;i<=5;i++)o.push(i);o.push("..."),o.push(h)}else if(s>=h-2){o.push(1),o.push("...");for(let i=h-4;i<=h;i++)o.push(i)}else{o.push(1),o.push("...");for(let i=s-1;i<=s+1;i++)o.push(i);o.push("..."),o.push(h)}return o};return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[#EEEEEE] sm:px-6 mt-4",children:[x&&e.jsxs("div",{className:"text-sm text-[#181918]",children:[b,"-",p," of ",n," items"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c&&e.jsx(ee,{value:l.toString(),onChange:o=>a(Number(o)),options:u.map(o=>({value:o.toString(),label:`${o} / page`})),size:"sm",className:"w-32"}),e.jsxs("nav",{className:"inline-flex gap-1 items-center","aria-label":"Pagination",children:[e.jsx("button",{onClick:()=>r(s-1),disabled:s===1,className:`relative inline-flex items-center justify-center rounded-md ${d[m].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,children:e.jsx("svg",{className:d[m].icon,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),f().map((o,y)=>o==="..."?e.jsx("span",{className:`relative inline-flex items-center justify-center ${d[m].button} font-normal text-[#181918]`,children:"..."},`ellipsis-${y}`):e.jsx("button",{onClick:()=>r(o),className:`relative inline-flex items-center justify-center rounded-md ${d[m].button} font-medium transition-all duration-300 ease-out focus:z-20 hover:scale-105 active:scale-95 ${s===o?"bg-[#EC615B] text-white shadow-sm":"text-[#181918] hover:bg-gray-100"}`,children:o},o)),e.jsx("button",{onClick:()=>r(s+1),disabled:s===h,className:`relative inline-flex items-center justify-center rounded-md ${d[m].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,children:e.jsx("svg",{className:d[m].icon,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})]})]})},fe=({title:s,description:l,searchPlaceholder:n="Search...",onSearch:r,actions:a,filters:c,className:u=""})=>{const x=m=>{r==null||r(m.target.value)};return e.jsxs("div",{className:`space-y-4 mb-4 ${u}`,children:[(s||l)&&e.jsxs("div",{children:[s&&e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:s}),l&&e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:l})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r&&e.jsx("div",{className:"flex-1 max-w-md",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx("svg",{className:"h-5 w-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),e.jsx("input",{type:"text",placeholder:n,onChange:x,className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm"})]})}),a&&e.jsx("div",{className:"flex items-center gap-2",children:a})]}),c&&e.jsx("div",{className:"flex items-center gap-3",children:c})]})},xe=({open:s,onClose:l,title:n,children:r,footer:a,width:c="520px",closable:u=!0,maskClosable:x=!0,centered:m=!0,className:h=""})=>{const[b,p]=$.useState(!1),[d,f]=$.useState(!1);if($.useEffect(()=>{if(s)p(!0),setTimeout(()=>f(!0),10),document.body.style.overflow="hidden";else{f(!1);const i=setTimeout(()=>{p(!1)},200);return document.body.style.overflow="unset",()=>clearTimeout(i)}},[s]),$.useEffect(()=>{const i=k=>{k.key==="Escape"&&u&&s&&l()};return s&&document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[s,l,u]),!b)return null;const o=()=>{x&&l()},y=i=>{i.stopPropagation()};return e.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",onClick:o,children:[e.jsx("div",{className:`fixed inset-0 bg-black transition-opacity duration-200 ease-out ${d?"opacity-50":"opacity-0"}`}),e.jsx("div",{className:`flex min-h-full items-center justify-center p-4 ${m?"items-center":"items-start pt-20"}`,children:e.jsxs("div",{className:`relative bg-white rounded-lg shadow-xl transition-all duration-200 ease-out ${d?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-4"} ${h}`,style:{width:c,maxWidth:"90vw"},onClick:y,children:[(n||u)&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[n&&e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:n}),u&&e.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"px-6 py-4 max-h-[70vh] overflow-y-auto",children:r}),a&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 flex justify-end gap-2",children:a})]})})]})},me=({children:s,variant:l="default",size:n="md",dot:r=!1,icon:a,iconPosition:c="left",className:u=""})=>{const x={default:"bg-gray-100 text-[#181918]",primary:"bg-[#FCEAE9] text-[#EC615B]",success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",danger:"bg-red-100 text-red-800",info:"bg-cyan-100 text-cyan-800"},m={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},h={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},b={default:"bg-gray-600",primary:"bg-[#EC615B]",success:"bg-green-600",warning:"bg-yellow-600",danger:"bg-red-600",info:"bg-cyan-600"},p={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"};return e.jsxs("span",{className:`inline-flex items-center gap-1.5 font-medium rounded-full transition-all duration-200 ${x[l]} ${m[n]} ${u}`,children:[r&&e.jsx("span",{className:`rounded-full ${h[n]} ${b[l]}`}),a&&c==="left"&&e.jsx("span",{className:`inline-flex items-center ${p[n]}`,children:a}),s,a&&c==="right"&&e.jsx("span",{className:`inline-flex items-center ${p[n]}`,children:a})]})},he=({items:s,current:l=0,direction:n="vertical",size:r="md",variant:a="default",className:c=""})=>{const u=(d,f)=>f.status?f.status:d<l?"finish":d===l?"process":"wait",x={sm:"w-6 h-6",md:"w-8 h-8",lg:"w-10 h-10"},m={sm:"text-sm",md:"text-base",lg:"text-lg"},h={sm:"text-xs",md:"text-sm",lg:"text-base"},b=(d,f)=>f||(d==="finish"?e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):d==="error"?e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}):null),p=d=>{const f=a==="outline";switch(d){case"finish":return{icon:f?"bg-white text-green-500 border-green-500":"bg-green-500 text-white border-green-500",title:"text-[#181918]",description:"text-gray-600",line:"bg-green-500"};case"process":return{icon:f?"bg-white text-[#EC615B] border-[#EC615B]":"bg-[#EC615B] text-white border-[#EC615B]",title:"text-[#181918] font-semibold",description:"text-gray-700",line:"bg-gray-300"};case"error":return{icon:f?"bg-white text-red-500 border-red-500":"bg-red-500 text-white border-red-500",title:"text-red-600",description:"text-red-500",line:"bg-gray-300"};default:return{icon:"bg-white text-gray-400 border-gray-300",title:"text-gray-500",description:"text-gray-400",line:"bg-gray-300"}}};return n==="horizontal"?e.jsx("div",{className:`flex items-start ${c}`,children:s.map((d,f)=>{const o=u(f,d),y=p(o),i=f===s.length-1;return e.jsxs("div",{className:"flex flex-1 items-start",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`flex items-center justify-center ${x[r]} rounded-full border transition-all duration-300 ${y.icon}`,children:b(o,d.icon)}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("div",{className:`${m[r]} ${y.title} transition-colors duration-300`,children:d.title}),d.description&&e.jsx("div",{className:`${h[r]} ${y.description} mt-1 transition-colors duration-300`,children:d.description})]})]}),!i&&e.jsx("div",{className:`flex-1 h-0.5 mt-4 mx-2 ${y.line} transition-colors duration-300`})]},f)})}):e.jsx("div",{className:`flex flex-col ${c}`,children:s.map((d,f)=>{const o=u(f,d),y=p(o),i=f===s.length-1;return e.jsxs("div",{className:"flex",children:[e.jsxs("div",{className:"flex flex-col items-center mr-4",children:[e.jsx("div",{className:`flex items-center justify-center ${x[r]} rounded-full border transition-all duration-300 ${y.icon}`,children:b(o,d.icon)}),!i&&e.jsx("div",{className:`w-0.5 flex-1 my-1 ${y.line} transition-colors duration-300`,style:{minHeight:"20px"}})]}),e.jsxs("div",{className:"flex-1 pb-6",children:[e.jsx("div",{className:`${m[r]} ${y.title} transition-colors duration-300`,children:d.title}),d.description&&e.jsx("div",{className:`${h[r]} ${y.description} mt-1 transition-colors duration-300`,children:d.description})]})]},f)})})},ge=({percent:s=0,status:l="normal",showInfo:n=!0,strokeColor:r,strokeWidth:a,size:c="md",className:u="",format:x})=>{const m=Math.min(100,Math.max(0,s)),h={sm:"h-1.5",md:"h-2",lg:"h-3"},b={sm:"text-xs",md:"text-sm",lg:"text-base"},p=()=>{if(r)return r;switch(l){case"success":return"bg-green-500";case"exception":return"bg-red-500";case"active":return"bg-[#EC615B]";default:return m===100?"bg-green-500":"bg-[#EC615B]"}},d=()=>l==="success"||m===100?e.jsx("svg",{className:"w-4 h-4 text-green-500",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):l==="exception"?e.jsx("svg",{className:"w-4 h-4 text-red-500",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}):null,f=()=>x?x(m):`${Math.round(m)}%`,o=a?`${a}px`:void 0;return e.jsxs("div",{className:`flex items-center gap-2 ${u}`,children:[e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:`w-full bg-gray-200 rounded-full overflow-hidden ${h[c]}`,style:{height:o},children:e.jsx("div",{className:`${p()} ${h[c]} rounded-full transition-all duration-300 ease-out ${l==="active"?"progress-active":""}`,style:{width:`${m}%`,height:o}})})}),n&&e.jsx("div",{className:`flex items-center gap-1 ${b[c]} text-gray-600 font-normal`,children:d()||f()})]})},pe=({checked:s,defaultChecked:l=!1,onChange:n,disabled:r=!1,indeterminate:a=!1,size:c="md",variant:u="filled",className:x="",id:m,name:h,value:b})=>{const[p,d]=$.useState(l),f=s!==void 0,o=f?s:p,y=S=>{if(r)return;const _=S.target.checked;f||d(_),n==null||n(_)},i={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},k={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},v=u==="filled",N=()=>r?"cursor-not-allowed opacity-50 border-gray-300 bg-gray-100":v?!o&&!a?"border-gray-300 bg-white hover:border-gray-400":"border-[#EC615B] bg-[#EC615B] hover:bg-[#D4554F] hover:border-[#D4554F]":!o&&!a?"border-gray-300 bg-white hover:border-gray-400":"border-[#EC615B] bg-white hover:border-[#D4554F]",R=()=>v?"text-white":"text-[#EC615B]";return e.jsxs("div",{className:"inline-flex items-center",children:[e.jsx("input",{type:"checkbox",id:m,name:h,value:b,checked:o,onChange:y,disabled:r,className:"sr-only"}),e.jsxs("label",{htmlFor:m,className:`
|
|
42
|
+
relative flex items-center justify-center
|
|
43
|
+
${i[c]}
|
|
44
|
+
${u==="outline"?"border":"border-2"}
|
|
45
|
+
rounded
|
|
46
|
+
transition-all duration-200 ease-out
|
|
47
|
+
cursor-pointer
|
|
48
|
+
${N()}
|
|
49
|
+
${x}
|
|
50
|
+
`,children:[o&&!a&&e.jsx("svg",{className:`${k[c]} ${R()}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),a&&e.jsx("svg",{className:`${k[c]} ${R()}`,fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("rect",{x:"4",y:"11",width:"16",height:"2",rx:"1"})})]})]})},be=({items:s,onRemove:l,emptyMessage:n="No items selected",className:r="",itemClassName:a="",maxHeight:c="300px"})=>s.length===0?e.jsx("div",{className:`text-center py-8 text-gray-500 text-sm ${r}`,children:n}):e.jsx("div",{className:`space-y-2 overflow-y-auto ${r}`,style:{maxHeight:c},children:s.map((u,x)=>e.jsxs("div",{className:`
|
|
51
|
+
group flex items-center justify-between
|
|
52
|
+
bg-[#F4F4F4] rounded-lg px-4 py-3
|
|
53
|
+
transition-all duration-300 ease-out
|
|
54
|
+
hover:bg-[#EBEBEB] hover:shadow-sm
|
|
55
|
+
animate-slide-in-item
|
|
56
|
+
${a}
|
|
57
|
+
`,style:{animationDelay:`${x*50}ms`},children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[u.sublabel&&e.jsx("div",{className:"text-xs text-gray-500 font-normal mb-0.5",children:u.sublabel}),e.jsx("div",{className:"text-sm font-medium text-[#181918] truncate",children:u.label})]}),e.jsx("button",{onClick:()=>l(u.id),className:`
|
|
58
|
+
ml-3 flex-shrink-0
|
|
59
|
+
w-6 h-6 rounded-full
|
|
60
|
+
flex items-center justify-center
|
|
61
|
+
text-gray-400
|
|
62
|
+
transition-all duration-200 ease-out
|
|
63
|
+
hover:bg-white hover:text-[#EC615B] hover:scale-110
|
|
64
|
+
active:scale-95
|
|
65
|
+
focus:outline-none focus:ring-2 focus:ring-[#EC615B] focus:ring-opacity-50
|
|
66
|
+
`,"aria-label":`Remove ${u.label}`,children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},u.id))});exports.Badge=me;exports.Button=ae;exports.Card=ie;exports.Checkbox=pe;exports.Dropdown=ce;exports.Modal=xe;exports.Progress=ge;exports.SearchInput=oe;exports.Select=ee;exports.SelectedItemsList=be;exports.StatCard=le;exports.Steps=he;exports.Table=de;exports.TableTop=fe;
|
|
23
67
|
//# sourceMappingURL=index.cjs.map
|