@shipfox/react-ui 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/modal/modal.d.ts +2 -1
- package/dist/components/modal/modal.js +3 -2
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +3 -0
- package/dist/components/slider/slider.d.ts +10 -0
- package/dist/components/slider/slider.js +38 -0
- package/dist/components/table/data-table.js +57 -22
- package/dist/components/table/table.js +2 -1
- package/dist/components/table/table.stories.data.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/colors.stories.js +0 -61
- package/dist/components/alert/alert.stories.js +0 -227
- package/dist/components/avatar/avatar.stories.js +0 -267
- package/dist/components/badge/badge.stories.js +0 -802
- package/dist/components/button/button-link.stories.js +0 -127
- package/dist/components/button/button.stories.js +0 -187
- package/dist/components/button/icon-button.stories.js +0 -344
- package/dist/components/button-group/button-group.stories.js +0 -644
- package/dist/components/card/card.stories.js +0 -216
- package/dist/components/checkbox/checkbox.stories.js +0 -566
- package/dist/components/code-block/code-block.stories.js +0 -341
- package/dist/components/combobox/combobox.stories.js +0 -191
- package/dist/components/command/command.stories.js +0 -228
- package/dist/components/confetti/confetti.stories.js +0 -41
- package/dist/components/count-up/count-up.stories.js +0 -568
- package/dist/components/dashboard/components/charts/bar-chart.stories.js +0 -287
- package/dist/components/dashboard/components/charts/line-chart.stories.js +0 -257
- package/dist/components/dashboard/dashboard.stories.js +0 -23
- package/dist/components/date-picker/date-picker.stories.js +0 -349
- package/dist/components/dropdown-input/dropdown-input.stories.js +0 -240
- package/dist/components/dropdown-menu/dropdown-menu.stories.js +0 -462
- package/dist/components/dynamic-item/dynamic-item.stories.js +0 -385
- package/dist/components/empty-state/empty-state.stories.js +0 -74
- package/dist/components/form/form.stories.js +0 -587
- package/dist/components/icon/icon.stories.js +0 -38
- package/dist/components/inline-tips/inline-tips.stories.js +0 -219
- package/dist/components/input/input.stories.js +0 -265
- package/dist/components/interval-selector/interval-selector.stories.js +0 -232
- package/dist/components/item/item.stories.js +0 -239
- package/dist/components/kbd/kbd.stories.js +0 -119
- package/dist/components/label/label.stories.js +0 -105
- package/dist/components/modal/modal.stories.js +0 -566
- package/dist/components/search/search.stories.js +0 -630
- package/dist/components/select/select.stories.js +0 -393
- package/dist/components/sheet/sheet.stories.js +0 -368
- package/dist/components/skeleton/skeleton.stories.js +0 -345
- package/dist/components/table/table.stories.js +0 -302
- package/dist/components/tabs/tabs.stories.js +0 -179
- package/dist/components/textarea/textarea.stories.js +0 -339
- package/dist/components/toast/toast.stories.js +0 -326
- package/dist/components/tooltip/tooltip.stories.js +0 -560
- package/dist/components/typography/code.stories.js +0 -54
- package/dist/components/typography/header.stories.js +0 -34
- package/dist/components/typography/text.stories.js +0 -105
- package/dist/onboarding/sign-in.stories.js +0 -101
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Code, Header } from '../../components/typography/index.js';
|
|
3
|
-
import { Skeleton } from './skeleton.js';
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/Skeleton',
|
|
6
|
-
component: Skeleton,
|
|
7
|
-
tags: [
|
|
8
|
-
'autodocs'
|
|
9
|
-
]
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
export const Default = {
|
|
13
|
-
render: ()=>/*#__PURE__*/ _jsx(Skeleton, {
|
|
14
|
-
className: "w-200 h-20"
|
|
15
|
-
})
|
|
16
|
-
};
|
|
17
|
-
export const Card = {
|
|
18
|
-
render: ()=>/*#__PURE__*/ _jsxs("div", {
|
|
19
|
-
className: "flex flex-col gap-12 p-16 rounded-10 border border-border-neutral-base bg-background-field-base max-w-400",
|
|
20
|
-
children: [
|
|
21
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
22
|
-
className: "h-200 w-full rounded-6"
|
|
23
|
-
}),
|
|
24
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
25
|
-
className: "space-y-8",
|
|
26
|
-
children: [
|
|
27
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
28
|
-
className: "h-20 w-3/4"
|
|
29
|
-
}),
|
|
30
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
31
|
-
className: "h-16 w-full"
|
|
32
|
-
}),
|
|
33
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
34
|
-
className: "h-16 w-5/6"
|
|
35
|
-
})
|
|
36
|
-
]
|
|
37
|
-
}),
|
|
38
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
39
|
-
className: "flex gap-8 pt-8",
|
|
40
|
-
children: [
|
|
41
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
42
|
-
className: "h-32 w-100 rounded-6"
|
|
43
|
-
}),
|
|
44
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
45
|
-
className: "h-32 w-100 rounded-6"
|
|
46
|
-
})
|
|
47
|
-
]
|
|
48
|
-
})
|
|
49
|
-
]
|
|
50
|
-
})
|
|
51
|
-
};
|
|
52
|
-
export const List = {
|
|
53
|
-
render: ()=>/*#__PURE__*/ _jsx("div", {
|
|
54
|
-
className: "flex flex-col gap-8 max-w-500",
|
|
55
|
-
children: Array.from({
|
|
56
|
-
length: 5
|
|
57
|
-
}, (_, i)=>i).map((id)=>/*#__PURE__*/ _jsxs("div", {
|
|
58
|
-
className: "flex items-center gap-12 p-12 rounded-6 border border-border-neutral-base bg-background-field-base",
|
|
59
|
-
children: [
|
|
60
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
61
|
-
className: "h-48 w-48 rounded-full shrink-0"
|
|
62
|
-
}),
|
|
63
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
64
|
-
className: "flex-1 space-y-8",
|
|
65
|
-
children: [
|
|
66
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
67
|
-
className: "h-16 w-3/4"
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
70
|
-
className: "h-14 w-1/2"
|
|
71
|
-
})
|
|
72
|
-
]
|
|
73
|
-
}),
|
|
74
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
75
|
-
className: "h-32 w-80 rounded-6"
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
}, `list-${id}`))
|
|
79
|
-
})
|
|
80
|
-
};
|
|
81
|
-
export const Showcase = {
|
|
82
|
-
render: ()=>/*#__PURE__*/ _jsxs("div", {
|
|
83
|
-
className: "flex flex-col gap-32",
|
|
84
|
-
children: [
|
|
85
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
86
|
-
className: "flex flex-col gap-16",
|
|
87
|
-
children: [
|
|
88
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
89
|
-
variant: "h3",
|
|
90
|
-
children: "Basic Shapes"
|
|
91
|
-
}),
|
|
92
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
93
|
-
className: "flex flex-col gap-12",
|
|
94
|
-
children: [
|
|
95
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
96
|
-
className: "flex flex-col gap-8",
|
|
97
|
-
children: [
|
|
98
|
-
/*#__PURE__*/ _jsx(Code, {
|
|
99
|
-
variant: "label",
|
|
100
|
-
className: "text-foreground-neutral-subtle",
|
|
101
|
-
children: "Rectangle"
|
|
102
|
-
}),
|
|
103
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
104
|
-
className: "h-20 w-200"
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
}),
|
|
108
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
109
|
-
className: "flex flex-col gap-8",
|
|
110
|
-
children: [
|
|
111
|
-
/*#__PURE__*/ _jsx(Code, {
|
|
112
|
-
variant: "label",
|
|
113
|
-
className: "text-foreground-neutral-subtle",
|
|
114
|
-
children: "Circle"
|
|
115
|
-
}),
|
|
116
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
117
|
-
className: "h-48 w-48 rounded-full"
|
|
118
|
-
})
|
|
119
|
-
]
|
|
120
|
-
}),
|
|
121
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
122
|
-
className: "flex flex-col gap-8",
|
|
123
|
-
children: [
|
|
124
|
-
/*#__PURE__*/ _jsx(Code, {
|
|
125
|
-
variant: "label",
|
|
126
|
-
className: "text-foreground-neutral-subtle",
|
|
127
|
-
children: "Square"
|
|
128
|
-
}),
|
|
129
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
130
|
-
className: "h-100 w-100"
|
|
131
|
-
})
|
|
132
|
-
]
|
|
133
|
-
})
|
|
134
|
-
]
|
|
135
|
-
})
|
|
136
|
-
]
|
|
137
|
-
}),
|
|
138
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
139
|
-
className: "flex flex-col gap-16",
|
|
140
|
-
children: [
|
|
141
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
142
|
-
variant: "h3",
|
|
143
|
-
children: "Card Loading"
|
|
144
|
-
}),
|
|
145
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
146
|
-
className: "flex flex-col gap-12 p-16 rounded-10 border border-border-neutral-base bg-background-field-base max-w-400",
|
|
147
|
-
children: [
|
|
148
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
149
|
-
className: "h-200 w-full rounded-6"
|
|
150
|
-
}),
|
|
151
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
152
|
-
className: "space-y-8",
|
|
153
|
-
children: [
|
|
154
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
155
|
-
className: "h-20 w-3/4"
|
|
156
|
-
}),
|
|
157
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
158
|
-
className: "h-16 w-full"
|
|
159
|
-
}),
|
|
160
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
161
|
-
className: "h-16 w-2/3"
|
|
162
|
-
})
|
|
163
|
-
]
|
|
164
|
-
}),
|
|
165
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
166
|
-
className: "flex gap-8 pt-8",
|
|
167
|
-
children: [
|
|
168
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
169
|
-
className: "h-32 w-100 rounded-6"
|
|
170
|
-
}),
|
|
171
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
172
|
-
className: "h-32 w-100 rounded-6"
|
|
173
|
-
})
|
|
174
|
-
]
|
|
175
|
-
})
|
|
176
|
-
]
|
|
177
|
-
})
|
|
178
|
-
]
|
|
179
|
-
}),
|
|
180
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
181
|
-
className: "flex flex-col gap-16",
|
|
182
|
-
children: [
|
|
183
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
184
|
-
variant: "h3",
|
|
185
|
-
children: "List Loading"
|
|
186
|
-
}),
|
|
187
|
-
/*#__PURE__*/ _jsx("div", {
|
|
188
|
-
className: "flex flex-col gap-8 max-w-500",
|
|
189
|
-
children: Array.from({
|
|
190
|
-
length: 4
|
|
191
|
-
}, (_, i)=>i).map((id)=>/*#__PURE__*/ _jsxs("div", {
|
|
192
|
-
className: "flex items-center gap-12 p-12 rounded-6 border border-border-neutral-base bg-background-field-base",
|
|
193
|
-
children: [
|
|
194
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
195
|
-
className: "h-48 w-48 rounded-full shrink-0"
|
|
196
|
-
}),
|
|
197
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
198
|
-
className: "flex-1 space-y-8",
|
|
199
|
-
children: [
|
|
200
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
201
|
-
className: "h-16 w-3/4"
|
|
202
|
-
}),
|
|
203
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
204
|
-
className: "h-14 w-1/2"
|
|
205
|
-
})
|
|
206
|
-
]
|
|
207
|
-
}),
|
|
208
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
209
|
-
className: "h-32 w-80 rounded-6"
|
|
210
|
-
})
|
|
211
|
-
]
|
|
212
|
-
}, `list-loading-${id}`))
|
|
213
|
-
})
|
|
214
|
-
]
|
|
215
|
-
}),
|
|
216
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
217
|
-
className: "flex flex-col gap-16",
|
|
218
|
-
children: [
|
|
219
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
220
|
-
variant: "h3",
|
|
221
|
-
children: "Table Loading"
|
|
222
|
-
}),
|
|
223
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
224
|
-
className: "rounded-10 border border-border-neutral-base bg-background-field-base overflow-hidden max-w-700",
|
|
225
|
-
children: [
|
|
226
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
227
|
-
className: "flex gap-16 p-12 border-b border-border-neutral-base bg-background-neutral-base",
|
|
228
|
-
children: [
|
|
229
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
230
|
-
className: "h-16 w-140"
|
|
231
|
-
}),
|
|
232
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
233
|
-
className: "h-16 w-220"
|
|
234
|
-
}),
|
|
235
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
236
|
-
className: "h-16 w-120"
|
|
237
|
-
}),
|
|
238
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
239
|
-
className: "h-16 w-100 ml-auto"
|
|
240
|
-
})
|
|
241
|
-
]
|
|
242
|
-
}),
|
|
243
|
-
Array.from({
|
|
244
|
-
length: 5
|
|
245
|
-
}, (_, i)=>i).map((id)=>/*#__PURE__*/ _jsxs("div", {
|
|
246
|
-
className: "flex gap-16 p-12 border-b border-border-neutral-base last:border-0",
|
|
247
|
-
children: [
|
|
248
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
249
|
-
className: "h-14 w-140"
|
|
250
|
-
}),
|
|
251
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
252
|
-
className: "h-14 w-220"
|
|
253
|
-
}),
|
|
254
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
255
|
-
className: "h-14 w-120"
|
|
256
|
-
}),
|
|
257
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
258
|
-
className: "h-14 w-100 ml-auto"
|
|
259
|
-
})
|
|
260
|
-
]
|
|
261
|
-
}, `table-row-${id}`))
|
|
262
|
-
]
|
|
263
|
-
})
|
|
264
|
-
]
|
|
265
|
-
}),
|
|
266
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
267
|
-
className: "flex flex-col gap-16",
|
|
268
|
-
children: [
|
|
269
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
270
|
-
variant: "h3",
|
|
271
|
-
children: "Form Loading"
|
|
272
|
-
}),
|
|
273
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
274
|
-
className: "max-w-400 space-y-16 p-16 rounded-10 border border-border-neutral-base bg-background-field-base",
|
|
275
|
-
children: [
|
|
276
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
277
|
-
className: "space-y-8",
|
|
278
|
-
children: [
|
|
279
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
280
|
-
className: "h-16 w-100"
|
|
281
|
-
}),
|
|
282
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
283
|
-
className: "h-32 w-full rounded-6"
|
|
284
|
-
})
|
|
285
|
-
]
|
|
286
|
-
}),
|
|
287
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
288
|
-
className: "space-y-8",
|
|
289
|
-
children: [
|
|
290
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
291
|
-
className: "h-16 w-120"
|
|
292
|
-
}),
|
|
293
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
294
|
-
className: "h-32 w-full rounded-6"
|
|
295
|
-
})
|
|
296
|
-
]
|
|
297
|
-
}),
|
|
298
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
299
|
-
className: "space-y-8",
|
|
300
|
-
children: [
|
|
301
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
302
|
-
className: "h-16 w-80"
|
|
303
|
-
}),
|
|
304
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
305
|
-
className: "h-96 w-full rounded-6"
|
|
306
|
-
})
|
|
307
|
-
]
|
|
308
|
-
}),
|
|
309
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
310
|
-
className: "flex gap-8 pt-8",
|
|
311
|
-
children: [
|
|
312
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
313
|
-
className: "h-32 w-100 rounded-6"
|
|
314
|
-
}),
|
|
315
|
-
/*#__PURE__*/ _jsx(Skeleton, {
|
|
316
|
-
className: "h-32 w-100 rounded-6"
|
|
317
|
-
})
|
|
318
|
-
]
|
|
319
|
-
})
|
|
320
|
-
]
|
|
321
|
-
})
|
|
322
|
-
]
|
|
323
|
-
}),
|
|
324
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
325
|
-
className: "flex flex-col gap-16",
|
|
326
|
-
children: [
|
|
327
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
328
|
-
variant: "h3",
|
|
329
|
-
children: "Avatar Group Loading"
|
|
330
|
-
}),
|
|
331
|
-
/*#__PURE__*/ _jsx("div", {
|
|
332
|
-
className: "flex -space-x-8",
|
|
333
|
-
children: Array.from({
|
|
334
|
-
length: 5
|
|
335
|
-
}, (_, i)=>i).map((id)=>/*#__PURE__*/ _jsx(Skeleton, {
|
|
336
|
-
className: "h-40 w-40 rounded-full border-2 border-background-field-base"
|
|
337
|
-
}, `avatar-${id}`))
|
|
338
|
-
})
|
|
339
|
-
]
|
|
340
|
-
})
|
|
341
|
-
]
|
|
342
|
-
})
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
//# sourceMappingURL=skeleton.stories.js.map
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Search, SearchContent, SearchTrigger } from '../../components/search/index.js';
|
|
3
|
-
import { Header, Text } from '../../components/typography/index.js';
|
|
4
|
-
import { useMemo, useState } from 'react';
|
|
5
|
-
import { Button } from '../button/index.js';
|
|
6
|
-
import { Icon } from '../icon/index.js';
|
|
7
|
-
import { SearchInline } from '../search/search-inline.js';
|
|
8
|
-
import { DataTable } from './data-table.js';
|
|
9
|
-
import { jobColumns, searchJobColumns, userColumns } from './table.stories.columns.js';
|
|
10
|
-
import { JobsEmptyState, SearchModalContent } from './table.stories.components.js';
|
|
11
|
-
import { jobsData, searchJobsData, users } from './table.stories.data.js';
|
|
12
|
-
const meta = {
|
|
13
|
-
title: 'Components/Table',
|
|
14
|
-
parameters: {
|
|
15
|
-
layout: 'padded'
|
|
16
|
-
},
|
|
17
|
-
tags: [
|
|
18
|
-
'autodocs'
|
|
19
|
-
]
|
|
20
|
-
};
|
|
21
|
-
export default meta;
|
|
22
|
-
export const Simple = {
|
|
23
|
-
parameters: {
|
|
24
|
-
viewport: {
|
|
25
|
-
defaultViewport: 'extraLarge'
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
render: ()=>/*#__PURE__*/ _jsx("div", {
|
|
29
|
-
className: "w-full min-h-screen bg-background-neutral-background p-24",
|
|
30
|
-
children: /*#__PURE__*/ _jsx(DataTable, {
|
|
31
|
-
columns: jobColumns.slice(0, 4),
|
|
32
|
-
data: jobsData.slice(0, 5),
|
|
33
|
-
pagination: false
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
};
|
|
37
|
-
export const WithPagination = {
|
|
38
|
-
parameters: {
|
|
39
|
-
viewport: {
|
|
40
|
-
defaultViewport: 'extraLarge'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
render: ()=>/*#__PURE__*/ _jsx("div", {
|
|
44
|
-
className: "w-full min-h-screen bg-background-neutral-background p-24",
|
|
45
|
-
children: /*#__PURE__*/ _jsx(DataTable, {
|
|
46
|
-
columns: jobColumns,
|
|
47
|
-
data: jobsData,
|
|
48
|
-
pagination: true,
|
|
49
|
-
pageSize: 10,
|
|
50
|
-
pageSizeOptions: [
|
|
51
|
-
5,
|
|
52
|
-
10,
|
|
53
|
-
20,
|
|
54
|
-
50
|
|
55
|
-
]
|
|
56
|
-
})
|
|
57
|
-
})
|
|
58
|
-
};
|
|
59
|
-
export const EmptyState = {
|
|
60
|
-
parameters: {
|
|
61
|
-
viewport: {
|
|
62
|
-
defaultViewport: 'extraLarge'
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
render: ()=>/*#__PURE__*/ _jsx("div", {
|
|
66
|
-
className: "w-full min-h-screen bg-background-neutral-background p-24",
|
|
67
|
-
children: /*#__PURE__*/ _jsx(DataTable, {
|
|
68
|
-
columns: jobColumns,
|
|
69
|
-
data: [],
|
|
70
|
-
pagination: true,
|
|
71
|
-
emptyState: /*#__PURE__*/ _jsx(JobsEmptyState, {})
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
};
|
|
75
|
-
export const UserTable = {
|
|
76
|
-
parameters: {
|
|
77
|
-
viewport: {
|
|
78
|
-
defaultViewport: 'extraLarge'
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
render: ()=>/*#__PURE__*/ _jsx("div", {
|
|
82
|
-
className: "w-full min-h-screen bg-background-neutral-background p-24",
|
|
83
|
-
children: /*#__PURE__*/ _jsx(DataTable, {
|
|
84
|
-
columns: userColumns,
|
|
85
|
-
data: users,
|
|
86
|
-
pagination: false
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
};
|
|
90
|
-
export const CompactTable = {
|
|
91
|
-
parameters: {
|
|
92
|
-
viewport: {
|
|
93
|
-
defaultViewport: 'extraLarge'
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
render: ()=>{
|
|
97
|
-
const compactColumns = [
|
|
98
|
-
jobColumns[0],
|
|
99
|
-
jobColumns[1],
|
|
100
|
-
jobColumns[6]
|
|
101
|
-
];
|
|
102
|
-
return /*#__PURE__*/ _jsx("div", {
|
|
103
|
-
className: "w-full min-h-screen bg-background-neutral-background p-24",
|
|
104
|
-
children: /*#__PURE__*/ _jsx(DataTable, {
|
|
105
|
-
columns: compactColumns,
|
|
106
|
-
data: jobsData.slice(0, 5),
|
|
107
|
-
pagination: false
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
export const JobsOverview = {
|
|
113
|
-
parameters: {
|
|
114
|
-
viewport: {
|
|
115
|
-
defaultViewport: 'extraLarge'
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
render: ()=>{
|
|
119
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
120
|
-
const filteredData = useMemo(()=>jobsData.filter((job)=>job.name.toLowerCase().includes(searchQuery.toLowerCase())), [
|
|
121
|
-
searchQuery
|
|
122
|
-
]);
|
|
123
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
124
|
-
className: "w-full min-h-screen bg-background-neutral-background p-24",
|
|
125
|
-
children: [
|
|
126
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
127
|
-
className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-12 sm:gap-0 p-12 border-t border-x border-border-neutral-base rounded-t-8 rounded-b-none bg-background-neutral-base",
|
|
128
|
-
children: [
|
|
129
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
130
|
-
variant: "h3",
|
|
131
|
-
className: "text-foreground-neutral-base",
|
|
132
|
-
children: "Jobs overview"
|
|
133
|
-
}),
|
|
134
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
135
|
-
className: "flex items-center gap-12 sm:gap-16 w-full sm:w-auto",
|
|
136
|
-
children: [
|
|
137
|
-
/*#__PURE__*/ _jsx(SearchInline, {
|
|
138
|
-
placeholder: "Search...",
|
|
139
|
-
value: searchQuery,
|
|
140
|
-
onChange: (e)=>setSearchQuery(e.target.value),
|
|
141
|
-
onClear: ()=>setSearchQuery(''),
|
|
142
|
-
className: "flex-1 sm:w-240"
|
|
143
|
-
}),
|
|
144
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
145
|
-
variant: "secondary",
|
|
146
|
-
"aria-label": "Insert column left",
|
|
147
|
-
className: "shrink-0",
|
|
148
|
-
children: /*#__PURE__*/ _jsx(Icon, {
|
|
149
|
-
name: "insertColumnLeft",
|
|
150
|
-
className: "size-16 text-foreground-neutral-subtle"
|
|
151
|
-
})
|
|
152
|
-
})
|
|
153
|
-
]
|
|
154
|
-
})
|
|
155
|
-
]
|
|
156
|
-
}),
|
|
157
|
-
/*#__PURE__*/ _jsx(DataTable, {
|
|
158
|
-
columns: jobColumns,
|
|
159
|
-
data: filteredData,
|
|
160
|
-
pagination: true,
|
|
161
|
-
pageSize: 10,
|
|
162
|
-
pageSizeOptions: [
|
|
163
|
-
10,
|
|
164
|
-
20,
|
|
165
|
-
50,
|
|
166
|
-
100
|
|
167
|
-
],
|
|
168
|
-
className: "rounded-t-none"
|
|
169
|
-
})
|
|
170
|
-
]
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
export const WithSearchModal = {
|
|
175
|
-
parameters: {
|
|
176
|
-
viewport: {
|
|
177
|
-
defaultViewport: 'extraLarge'
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
render: ()=>{
|
|
181
|
-
function SearchModalDemo() {
|
|
182
|
-
const [open, setOpen] = useState(false);
|
|
183
|
-
const [selectedJobId, setSelectedJobId] = useState(null);
|
|
184
|
-
const filteredData = useMemo(()=>selectedJobId ? searchJobsData.filter((job)=>job.id === selectedJobId) : searchJobsData, [
|
|
185
|
-
selectedJobId
|
|
186
|
-
]);
|
|
187
|
-
const selectedJob = useMemo(()=>selectedJobId ? searchJobsData.find((job)=>job.id === selectedJobId) : null, [
|
|
188
|
-
selectedJobId
|
|
189
|
-
]);
|
|
190
|
-
const handleSelectJob = (jobId)=>{
|
|
191
|
-
setSelectedJobId(jobId);
|
|
192
|
-
setOpen(false);
|
|
193
|
-
};
|
|
194
|
-
const handleClearSelection = ()=>{
|
|
195
|
-
setSelectedJobId(null);
|
|
196
|
-
};
|
|
197
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
198
|
-
className: "w-full min-h-screen bg-background-neutral-background p-24",
|
|
199
|
-
children: [
|
|
200
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
201
|
-
className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-12 sm:gap-0 p-12 border-t border-x border-border-neutral-base rounded-t-8 rounded-b-none bg-background-neutral-base",
|
|
202
|
-
children: [
|
|
203
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
204
|
-
variant: "h3",
|
|
205
|
-
className: "text-foreground-neutral-base",
|
|
206
|
-
children: "Jobs Breakdown"
|
|
207
|
-
}),
|
|
208
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
209
|
-
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-12 sm:gap-16 w-full sm:w-auto",
|
|
210
|
-
children: [
|
|
211
|
-
selectedJob && /*#__PURE__*/ _jsx(Button, {
|
|
212
|
-
variant: "transparentMuted",
|
|
213
|
-
size: "sm",
|
|
214
|
-
onClick: handleClearSelection,
|
|
215
|
-
className: "text-foreground-neutral-muted gap-4 w-full sm:w-auto justify-center sm:justify-start",
|
|
216
|
-
iconRight: "closeLine",
|
|
217
|
-
children: "Clear filter"
|
|
218
|
-
}),
|
|
219
|
-
/*#__PURE__*/ _jsxs(Search, {
|
|
220
|
-
open: open,
|
|
221
|
-
onOpenChange: setOpen,
|
|
222
|
-
shortcutKey: "meta+k",
|
|
223
|
-
shouldFilter: false,
|
|
224
|
-
children: [
|
|
225
|
-
/*#__PURE__*/ _jsx(SearchTrigger, {
|
|
226
|
-
placeholder: "Filter jobs...",
|
|
227
|
-
className: "w-full sm:w-280"
|
|
228
|
-
}),
|
|
229
|
-
/*#__PURE__*/ _jsx(SearchContent, {
|
|
230
|
-
"aria-describedby": undefined,
|
|
231
|
-
children: /*#__PURE__*/ _jsx(SearchModalContent, {
|
|
232
|
-
onSelectJob: handleSelectJob
|
|
233
|
-
})
|
|
234
|
-
})
|
|
235
|
-
]
|
|
236
|
-
})
|
|
237
|
-
]
|
|
238
|
-
})
|
|
239
|
-
]
|
|
240
|
-
}),
|
|
241
|
-
/*#__PURE__*/ _jsx(DataTable, {
|
|
242
|
-
columns: searchJobColumns,
|
|
243
|
-
data: filteredData,
|
|
244
|
-
pagination: true,
|
|
245
|
-
pageSize: 10,
|
|
246
|
-
pageSizeOptions: [
|
|
247
|
-
10,
|
|
248
|
-
25,
|
|
249
|
-
50
|
|
250
|
-
],
|
|
251
|
-
className: "rounded-t-none"
|
|
252
|
-
})
|
|
253
|
-
]
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
return /*#__PURE__*/ _jsx(SearchModalDemo, {});
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
export const WithRowSelection = {
|
|
260
|
-
parameters: {
|
|
261
|
-
viewport: {
|
|
262
|
-
defaultViewport: 'extraLarge'
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
render: ()=>/*#__PURE__*/ _jsx("div", {
|
|
266
|
-
className: "w-full min-h-screen bg-background-neutral-background p-24",
|
|
267
|
-
children: /*#__PURE__*/ _jsxs("div", {
|
|
268
|
-
className: "space-y-16",
|
|
269
|
-
children: [
|
|
270
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
271
|
-
children: [
|
|
272
|
-
/*#__PURE__*/ _jsx(Header, {
|
|
273
|
-
variant: "h3",
|
|
274
|
-
className: "text-foreground-neutral-base mb-8",
|
|
275
|
-
children: "Selectable Rows"
|
|
276
|
-
}),
|
|
277
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
278
|
-
size: "sm",
|
|
279
|
-
className: "text-foreground-neutral-muted",
|
|
280
|
-
children: "Use the checkboxes to select rows. The pagination footer shows the count of selected rows."
|
|
281
|
-
})
|
|
282
|
-
]
|
|
283
|
-
}),
|
|
284
|
-
/*#__PURE__*/ _jsx(DataTable, {
|
|
285
|
-
columns: jobColumns,
|
|
286
|
-
data: jobsData,
|
|
287
|
-
pagination: true,
|
|
288
|
-
pageSize: 10,
|
|
289
|
-
pageSizeOptions: [
|
|
290
|
-
5,
|
|
291
|
-
10,
|
|
292
|
-
20,
|
|
293
|
-
50
|
|
294
|
-
],
|
|
295
|
-
showSelectedCount: true
|
|
296
|
-
})
|
|
297
|
-
]
|
|
298
|
-
})
|
|
299
|
-
})
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
//# sourceMappingURL=table.stories.js.map
|