@shipfox/react-ui 0.25.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.
Files changed (53) hide show
  1. package/dist/components/index.d.ts +1 -0
  2. package/dist/components/index.js +1 -0
  3. package/dist/components/slider/index.d.ts +2 -0
  4. package/dist/components/slider/index.js +3 -0
  5. package/dist/components/slider/slider.d.ts +10 -0
  6. package/dist/components/slider/slider.js +38 -0
  7. package/dist/styles.css +1 -1
  8. package/package.json +4 -4
  9. package/dist/colors.stories.js +0 -61
  10. package/dist/components/alert/alert.stories.js +0 -227
  11. package/dist/components/avatar/avatar.stories.js +0 -267
  12. package/dist/components/badge/badge.stories.js +0 -802
  13. package/dist/components/button/button-link.stories.js +0 -127
  14. package/dist/components/button/button.stories.js +0 -187
  15. package/dist/components/button/icon-button.stories.js +0 -344
  16. package/dist/components/button-group/button-group.stories.js +0 -644
  17. package/dist/components/card/card.stories.js +0 -216
  18. package/dist/components/checkbox/checkbox.stories.js +0 -566
  19. package/dist/components/code-block/code-block.stories.js +0 -341
  20. package/dist/components/combobox/combobox.stories.js +0 -191
  21. package/dist/components/command/command.stories.js +0 -228
  22. package/dist/components/confetti/confetti.stories.js +0 -41
  23. package/dist/components/count-up/count-up.stories.js +0 -568
  24. package/dist/components/dashboard/components/charts/bar-chart.stories.js +0 -287
  25. package/dist/components/dashboard/components/charts/line-chart.stories.js +0 -257
  26. package/dist/components/dashboard/dashboard.stories.js +0 -23
  27. package/dist/components/date-picker/date-picker.stories.js +0 -349
  28. package/dist/components/dropdown-input/dropdown-input.stories.js +0 -240
  29. package/dist/components/dropdown-menu/dropdown-menu.stories.js +0 -462
  30. package/dist/components/dynamic-item/dynamic-item.stories.js +0 -385
  31. package/dist/components/empty-state/empty-state.stories.js +0 -74
  32. package/dist/components/form/form.stories.js +0 -587
  33. package/dist/components/icon/icon.stories.js +0 -38
  34. package/dist/components/inline-tips/inline-tips.stories.js +0 -219
  35. package/dist/components/input/input.stories.js +0 -265
  36. package/dist/components/interval-selector/interval-selector.stories.js +0 -232
  37. package/dist/components/item/item.stories.js +0 -239
  38. package/dist/components/kbd/kbd.stories.js +0 -119
  39. package/dist/components/label/label.stories.js +0 -105
  40. package/dist/components/modal/modal.stories.js +0 -566
  41. package/dist/components/search/search.stories.js +0 -630
  42. package/dist/components/select/select.stories.js +0 -393
  43. package/dist/components/sheet/sheet.stories.js +0 -368
  44. package/dist/components/skeleton/skeleton.stories.js +0 -345
  45. package/dist/components/table/table.stories.js +0 -302
  46. package/dist/components/tabs/tabs.stories.js +0 -179
  47. package/dist/components/textarea/textarea.stories.js +0 -339
  48. package/dist/components/toast/toast.stories.js +0 -326
  49. package/dist/components/tooltip/tooltip.stories.js +0 -560
  50. package/dist/components/typography/code.stories.js +0 -54
  51. package/dist/components/typography/header.stories.js +0 -34
  52. package/dist/components/typography/text.stories.js +0 -105
  53. package/dist/onboarding/sign-in.stories.js +0 -101
@@ -1,61 +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 { cn } from './utils/cn.js';
4
- import { primitiveColors } from './colors.stories.conts.js';
5
- const meta = {
6
- title: 'Assets/Colors'
7
- };
8
- export default meta;
9
- function ColorItem({ variant }) {
10
- const value = variant.split('-').pop();
11
- return /*#__PURE__*/ _jsxs("div", {
12
- className: "flex flex-col items-center gap-1",
13
- children: [
14
- /*#__PURE__*/ _jsx("div", {
15
- className: cn('h-24 w-full rounded-6 border border-border', variant)
16
- }),
17
- /*#__PURE__*/ _jsx(Code, {
18
- variant: "label",
19
- className: "text-foreground-neutral-subtle",
20
- children: value
21
- })
22
- ]
23
- });
24
- }
25
- function ColorPalette({ title, rootKey, variants }) {
26
- return /*#__PURE__*/ _jsxs("div", {
27
- className: "grid grid-cols-16 gap-8",
28
- children: [
29
- /*#__PURE__*/ _jsx(Code, {
30
- variant: "label",
31
- className: "text-foreground-neutral-subtle",
32
- children: title
33
- }),
34
- variants.map((variant)=>/*#__PURE__*/ _jsx(ColorItem, {
35
- variant: variant,
36
- color: rootKey
37
- }, variant))
38
- ]
39
- });
40
- }
41
- export const Palette = {
42
- render: ()=>/*#__PURE__*/ _jsx("div", {
43
- className: "flex flex-col gap-16",
44
- children: /*#__PURE__*/ _jsxs("section", {
45
- className: "flex flex-col gap-8",
46
- children: [
47
- /*#__PURE__*/ _jsx(Header, {
48
- variant: "h2",
49
- children: "Primitive Colors"
50
- }),
51
- Object.entries(primitiveColors).map(([color, variants])=>/*#__PURE__*/ _jsx(ColorPalette, {
52
- title: color.replace('-', ' '),
53
- rootKey: color,
54
- variants: variants.variants
55
- }, color))
56
- ]
57
- })
58
- })
59
- };
60
-
61
- //# sourceMappingURL=colors.stories.js.map
@@ -1,227 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { zodResolver } from '@hookform/resolvers/zod';
3
- import { Button } from '../../components/button/index.js';
4
- import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '../../components/form/index.js';
5
- import { Input } from '../../components/input/index.js';
6
- import { Header } from '../../components/typography/index.js';
7
- import { useState } from 'react';
8
- import { useForm } from 'react-hook-form';
9
- import { z } from 'zod';
10
- import { Alert, AlertAction, AlertActions, AlertClose, AlertContent, AlertDescription, AlertTitle } from './alert.js';
11
- const meta = {
12
- title: 'Components/Alert',
13
- component: Alert,
14
- tags: [
15
- 'autodocs'
16
- ],
17
- argTypes: {
18
- variant: {
19
- control: 'select',
20
- options: [
21
- 'default',
22
- 'info',
23
- 'success',
24
- 'warning',
25
- 'error'
26
- ]
27
- }
28
- },
29
- args: {
30
- variant: 'default'
31
- }
32
- };
33
- export default meta;
34
- const variants = [
35
- 'default',
36
- 'info',
37
- 'success',
38
- 'warning',
39
- 'error'
40
- ];
41
- export const Default = {
42
- render: (args)=>{
43
- return /*#__PURE__*/ _jsxs(Alert, {
44
- ...args,
45
- children: [
46
- /*#__PURE__*/ _jsxs(AlertContent, {
47
- children: [
48
- /*#__PURE__*/ _jsx(AlertTitle, {
49
- children: "Title"
50
- }),
51
- /*#__PURE__*/ _jsx(AlertDescription, {
52
- children: "Description"
53
- }),
54
- /*#__PURE__*/ _jsxs(AlertActions, {
55
- children: [
56
- /*#__PURE__*/ _jsx(AlertAction, {
57
- children: "Download"
58
- }),
59
- /*#__PURE__*/ _jsx(AlertAction, {
60
- children: "View"
61
- })
62
- ]
63
- })
64
- ]
65
- }),
66
- /*#__PURE__*/ _jsx(AlertClose, {})
67
- ]
68
- });
69
- }
70
- };
71
- const validationFormSchema = z.object({
72
- email: z.string().email('Please enter a valid email address'),
73
- password: z.string().min(8, 'Password must be at least 8 characters')
74
- });
75
- function ErrorValidationToasterExample() {
76
- const [showError, setShowError] = useState(false);
77
- const form = useForm({
78
- resolver: zodResolver(validationFormSchema),
79
- defaultValues: {
80
- email: '',
81
- password: ''
82
- }
83
- });
84
- function onSubmit(data) {
85
- // biome-ignore lint/suspicious/noConsole: <we need to log the data for the story>
86
- console.log('Form submitted:', data);
87
- setShowError(false);
88
- }
89
- function onError() {
90
- setShowError(true);
91
- }
92
- const errors = form.formState.errors;
93
- const errorCount = Object.keys(errors).length;
94
- const errorMessage = errorCount > 0 ? `Please fix ${errorCount} error${errorCount > 1 ? 's' : ''} before submitting.` : '';
95
- return /*#__PURE__*/ _jsxs("div", {
96
- className: "flex flex-col gap-16 w-full max-w-md",
97
- children: [
98
- errorCount > 0 && /*#__PURE__*/ _jsxs(Alert, {
99
- variant: "error",
100
- open: showError,
101
- autoClose: 5000,
102
- onOpenChange: setShowError,
103
- children: [
104
- /*#__PURE__*/ _jsxs(AlertContent, {
105
- children: [
106
- /*#__PURE__*/ _jsx(AlertTitle, {
107
- children: "Validation Error"
108
- }),
109
- /*#__PURE__*/ _jsx(AlertDescription, {
110
- children: errorMessage
111
- }),
112
- /*#__PURE__*/ _jsx(AlertActions, {
113
- children: /*#__PURE__*/ _jsx(AlertAction, {
114
- onClick: ()=>{
115
- form.clearErrors();
116
- setShowError(false);
117
- },
118
- children: "Dismiss"
119
- })
120
- })
121
- ]
122
- }),
123
- /*#__PURE__*/ _jsx(AlertClose, {})
124
- ]
125
- }),
126
- /*#__PURE__*/ _jsx(Form, {
127
- ...form,
128
- children: /*#__PURE__*/ _jsxs("form", {
129
- onSubmit: form.handleSubmit(onSubmit, onError),
130
- className: "space-y-8",
131
- children: [
132
- /*#__PURE__*/ _jsx(FormField, {
133
- control: form.control,
134
- name: "email",
135
- render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
136
- children: [
137
- /*#__PURE__*/ _jsx(FormLabel, {
138
- children: "Email"
139
- }),
140
- /*#__PURE__*/ _jsx(FormControl, {
141
- children: /*#__PURE__*/ _jsx(Input, {
142
- type: "email",
143
- placeholder: "email@example.com",
144
- ...field
145
- })
146
- }),
147
- /*#__PURE__*/ _jsx(FormMessage, {})
148
- ]
149
- })
150
- }),
151
- /*#__PURE__*/ _jsx(FormField, {
152
- control: form.control,
153
- name: "password",
154
- render: ({ field })=>/*#__PURE__*/ _jsxs(FormItem, {
155
- children: [
156
- /*#__PURE__*/ _jsx(FormLabel, {
157
- children: "Password"
158
- }),
159
- /*#__PURE__*/ _jsx(FormControl, {
160
- children: /*#__PURE__*/ _jsx(Input, {
161
- type: "password",
162
- placeholder: "Enter password",
163
- ...field
164
- })
165
- }),
166
- /*#__PURE__*/ _jsx(FormMessage, {})
167
- ]
168
- })
169
- }),
170
- /*#__PURE__*/ _jsx(Button, {
171
- type: "submit",
172
- children: "Submit"
173
- })
174
- ]
175
- })
176
- })
177
- ]
178
- });
179
- }
180
- export const WithFormValidation = {
181
- render: ()=>/*#__PURE__*/ _jsx(ErrorValidationToasterExample, {})
182
- };
183
- export const DesignMock = {
184
- render: ()=>{
185
- return /*#__PURE__*/ _jsxs("div", {
186
- className: "flex flex-col gap-32 pb-64 pt-32 px-32 bg-background-neutral-base",
187
- children: [
188
- /*#__PURE__*/ _jsx(Header, {
189
- variant: "h3",
190
- className: "text-foreground-neutral-subtle",
191
- children: "ALERTS"
192
- }),
193
- /*#__PURE__*/ _jsx("div", {
194
- className: "flex flex-col gap-16",
195
- children: variants.map((variant)=>/*#__PURE__*/ _jsxs(Alert, {
196
- variant: variant,
197
- children: [
198
- /*#__PURE__*/ _jsxs(AlertContent, {
199
- children: [
200
- /*#__PURE__*/ _jsx(AlertTitle, {
201
- children: "Title"
202
- }),
203
- /*#__PURE__*/ _jsx(AlertDescription, {
204
- children: "Description"
205
- }),
206
- /*#__PURE__*/ _jsxs(AlertActions, {
207
- children: [
208
- /*#__PURE__*/ _jsx(AlertAction, {
209
- children: "Download"
210
- }),
211
- /*#__PURE__*/ _jsx(AlertAction, {
212
- children: "View"
213
- })
214
- ]
215
- })
216
- ]
217
- }),
218
- /*#__PURE__*/ _jsx(AlertClose, {})
219
- ]
220
- }, variant))
221
- })
222
- ]
223
- });
224
- }
225
- };
226
-
227
- //# sourceMappingURL=alert.stories.js.map
@@ -1,267 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Code } from '../../components/typography/index.js';
3
- import { Avatar } from './avatar.js';
4
- import { AvatarGroup, AvatarGroupTooltip } from './avatar-group.js';
5
- const contentOptions = [
6
- 'letters',
7
- 'logo',
8
- 'logoPlaceholder',
9
- 'image',
10
- 'upload'
11
- ];
12
- const radiusOptions = [
13
- 'full',
14
- 'rounded'
15
- ];
16
- const sizeOptions = [
17
- '3xs',
18
- '2xs',
19
- 'xs',
20
- 'sm',
21
- 'md',
22
- 'lg',
23
- 'xl',
24
- '2xl',
25
- '3xl'
26
- ];
27
- const logoNameOptions = [
28
- 'shipfox',
29
- 'slack',
30
- 'stripe',
31
- 'github'
32
- ];
33
- const meta = {
34
- title: 'Components/Avatar',
35
- component: Avatar,
36
- tags: [
37
- 'autodocs'
38
- ],
39
- argTypes: {
40
- content: {
41
- control: 'select',
42
- options: contentOptions
43
- },
44
- radius: {
45
- control: 'select',
46
- options: radiusOptions
47
- },
48
- size: {
49
- control: 'select',
50
- options: sizeOptions
51
- },
52
- fallback: {
53
- control: 'text'
54
- },
55
- src: {
56
- control: 'text'
57
- },
58
- alt: {
59
- control: 'text'
60
- },
61
- logoName: {
62
- control: 'select',
63
- options: logoNameOptions,
64
- description: 'Logo icon name to display when content is "logo" or "logoPlaceholder"'
65
- }
66
- },
67
- args: {
68
- content: 'letters',
69
- radius: 'full',
70
- size: 'md',
71
- fallback: 'John Doe',
72
- logoName: 'shipfox'
73
- }
74
- };
75
- export default meta;
76
- export const Default = {
77
- args: {
78
- content: 'logo',
79
- fallback: 'Shipfox'
80
- },
81
- render: (args)=>/*#__PURE__*/ _jsx("div", {
82
- className: "flex flex-wrap items-end gap-16",
83
- children: sizeOptions.map((size)=>/*#__PURE__*/ _jsxs("div", {
84
- className: "flex flex-col items-center gap-8",
85
- children: [
86
- /*#__PURE__*/ _jsx(Avatar, {
87
- ...args,
88
- size: size
89
- }),
90
- /*#__PURE__*/ _jsx(Code, {
91
- variant: "label",
92
- className: "text-foreground-neutral-base",
93
- children: size
94
- })
95
- ]
96
- }, size))
97
- })
98
- };
99
- // AvatarGroup Stories
100
- const avatarGroupMeta = {
101
- title: 'Components/AvatarGroup',
102
- component: AvatarGroup,
103
- tags: [
104
- 'autodocs'
105
- ],
106
- argTypes: {
107
- size: {
108
- control: 'select',
109
- options: sizeOptions
110
- },
111
- maxVisible: {
112
- control: 'number'
113
- }
114
- },
115
- args: {
116
- size: 'md',
117
- children: []
118
- }
119
- };
120
- export const AvatarGroupDefault = {
121
- args: {
122
- children: []
123
- },
124
- render: ()=>{
125
- const avatars = [
126
- {
127
- name: 'John Doe',
128
- content: 'image'
129
- },
130
- {
131
- name: 'Jane Smith',
132
- content: 'image'
133
- },
134
- {
135
- name: 'Bob Johnson',
136
- content: 'image'
137
- },
138
- {
139
- name: 'Alice Brown',
140
- content: 'image'
141
- }
142
- ];
143
- return /*#__PURE__*/ _jsx("div", {
144
- className: "flex flex-col gap-16",
145
- children: /*#__PURE__*/ _jsxs("div", {
146
- className: "flex flex-col gap-8",
147
- children: [
148
- /*#__PURE__*/ _jsx(Code, {
149
- variant: "label",
150
- className: "text-foreground-neutral-base",
151
- children: "Default (without tooltips)"
152
- }),
153
- /*#__PURE__*/ _jsx(AvatarGroup, {
154
- size: "md",
155
- children: avatars.map((avatar)=>/*#__PURE__*/ _jsx(Avatar, {
156
- content: avatar.content,
157
- fallback: avatar.name
158
- }, avatar.name))
159
- })
160
- ]
161
- })
162
- });
163
- }
164
- };
165
- export const AvatarGroupWithTooltips = {
166
- args: {
167
- children: []
168
- },
169
- render: ()=>{
170
- const avatars = [
171
- {
172
- name: 'John Doe',
173
- content: 'image'
174
- },
175
- {
176
- name: 'Jane Smith',
177
- content: 'image'
178
- },
179
- {
180
- name: 'Bob Johnson',
181
- content: 'image'
182
- },
183
- {
184
- name: 'Alice Brown',
185
- content: 'image'
186
- },
187
- {
188
- name: 'Carlos Vega',
189
- content: 'image'
190
- },
191
- {
192
- name: 'Linda Tran',
193
- content: 'image'
194
- }
195
- ];
196
- return /*#__PURE__*/ _jsxs("div", {
197
- className: "flex flex-col gap-16",
198
- children: [
199
- /*#__PURE__*/ _jsxs("div", {
200
- className: "flex flex-col gap-8",
201
- children: [
202
- /*#__PURE__*/ _jsx(Code, {
203
- variant: "label",
204
- className: "text-foreground-neutral-base",
205
- children: "With Tooltips"
206
- }),
207
- /*#__PURE__*/ _jsx(AvatarGroup, {
208
- size: "md",
209
- children: avatars.map((avatar)=>/*#__PURE__*/ _jsx(Avatar, {
210
- content: avatar.content,
211
- fallback: avatar.name,
212
- children: /*#__PURE__*/ _jsx(AvatarGroupTooltip, {
213
- children: avatar.name
214
- })
215
- }, avatar.name))
216
- })
217
- ]
218
- }),
219
- /*#__PURE__*/ _jsxs("div", {
220
- className: "flex flex-col gap-8",
221
- children: [
222
- /*#__PURE__*/ _jsx(Code, {
223
- variant: "label",
224
- className: "text-foreground-neutral-base",
225
- children: "With Tooltips (maxVisible: 4)"
226
- }),
227
- /*#__PURE__*/ _jsx(AvatarGroup, {
228
- size: "md",
229
- maxVisible: 4,
230
- children: avatars.map((avatar)=>/*#__PURE__*/ _jsx(Avatar, {
231
- content: avatar.content,
232
- fallback: avatar.name,
233
- children: /*#__PURE__*/ _jsx(AvatarGroupTooltip, {
234
- children: avatar.name
235
- })
236
- }, avatar.name))
237
- })
238
- ]
239
- }),
240
- /*#__PURE__*/ _jsxs("div", {
241
- className: "flex flex-col gap-8",
242
- children: [
243
- /*#__PURE__*/ _jsx(Code, {
244
- variant: "label",
245
- className: "text-foreground-neutral-base",
246
- children: "With Tooltips and Hover Animation"
247
- }),
248
- /*#__PURE__*/ _jsx(AvatarGroup, {
249
- size: "md",
250
- maxVisible: 4,
251
- animateOnHover: true,
252
- children: avatars.map((avatar)=>/*#__PURE__*/ _jsx(Avatar, {
253
- content: avatar.content,
254
- fallback: avatar.name,
255
- children: /*#__PURE__*/ _jsx(AvatarGroupTooltip, {
256
- children: avatar.name
257
- })
258
- }, avatar.name))
259
- })
260
- ]
261
- })
262
- ]
263
- });
264
- }
265
- };
266
-
267
- //# sourceMappingURL=avatar.stories.js.map