@shipfox/react-ui 0.1.0 → 0.3.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/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-check.log +3 -3
- package/.turbo/turbo-type.log +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/components/alert/alert.d.ts +18 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/alert.js +123 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/alert.stories.js +112 -0
- package/dist/components/alert/alert.stories.js.map +1 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js +3 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/avatar/avatar-group.d.ts +18 -0
- package/dist/components/avatar/avatar-group.d.ts.map +1 -0
- package/dist/components/avatar/avatar-group.js +132 -0
- package/dist/components/avatar/avatar-group.js.map +1 -0
- package/dist/components/avatar/avatar.d.ts +21 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.js +166 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/avatar.stories.js +255 -0
- package/dist/components/avatar/avatar.stories.js.map +1 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +4 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/icon/custom/index.d.ts +1 -0
- package/dist/components/icon/custom/index.d.ts.map +1 -1
- package/dist/components/icon/custom/index.js +1 -0
- package/dist/components/icon/custom/index.js.map +1 -1
- package/dist/components/icon/custom/shipfox-logo.d.ts +8 -0
- package/dist/components/icon/custom/shipfox-logo.d.ts.map +1 -0
- package/dist/components/icon/custom/shipfox-logo.js +22 -0
- package/dist/components/icon/custom/shipfox-logo.js.map +1 -0
- package/dist/components/icon/icon.d.ts +4 -1
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +6 -3
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/inline-tips/index.d.ts +2 -0
- package/dist/components/inline-tips/index.d.ts.map +1 -0
- package/dist/components/inline-tips/index.js +3 -0
- package/dist/components/inline-tips/index.js.map +1 -0
- package/dist/components/inline-tips/inline-tips.d.ts +19 -0
- package/dist/components/inline-tips/inline-tips.d.ts.map +1 -0
- package/dist/components/inline-tips/inline-tips.js +98 -0
- package/dist/components/inline-tips/inline-tips.js.map +1 -0
- package/dist/components/inline-tips/inline-tips.stories.js +214 -0
- package/dist/components/inline-tips/inline-tips.stories.js.map +1 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/textarea/index.js +3 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +10 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -0
- package/dist/components/textarea/textarea.js +31 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/textarea/textarea.stories.js +333 -0
- package/dist/components/textarea/textarea.stories.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +7 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.js +38 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/utils/avatar.d.ts +3 -0
- package/dist/utils/avatar.d.ts.map +1 -0
- package/dist/utils/avatar.js +32 -0
- package/dist/utils/avatar.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/index.css +32 -1
- package/package.json +5 -5
- package/src/components/alert/alert.stories.tsx +77 -0
- package/src/components/alert/alert.tsx +144 -0
- package/src/components/alert/index.ts +1 -0
- package/src/components/avatar/avatar-group.tsx +186 -0
- package/src/components/avatar/avatar.stories.tsx +172 -0
- package/src/components/avatar/avatar.tsx +215 -0
- package/src/components/avatar/index.ts +2 -0
- package/src/components/icon/custom/index.ts +1 -0
- package/src/components/icon/custom/shipfox-logo.tsx +20 -0
- package/src/components/icon/icon.tsx +11 -1
- package/src/components/index.ts +4 -0
- package/src/components/inline-tips/index.ts +1 -0
- package/src/components/inline-tips/inline-tips.stories.tsx +126 -0
- package/src/components/inline-tips/inline-tips.tsx +132 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.stories.tsx +190 -0
- package/src/components/textarea/textarea.tsx +42 -0
- package/src/components/tooltip/tooltip.tsx +52 -0
- package/src/utils/avatar.ts +27 -0
- package/src/utils/index.ts +1 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Code, Header } from '../../components/typography/index.js';
|
|
3
|
+
import { Textarea } from './textarea.js';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/Textarea',
|
|
6
|
+
component: Textarea,
|
|
7
|
+
tags: [
|
|
8
|
+
'autodocs'
|
|
9
|
+
],
|
|
10
|
+
argTypes: {
|
|
11
|
+
placeholder: {
|
|
12
|
+
control: 'text'
|
|
13
|
+
},
|
|
14
|
+
disabled: {
|
|
15
|
+
control: 'boolean'
|
|
16
|
+
},
|
|
17
|
+
'aria-invalid': {
|
|
18
|
+
control: 'boolean'
|
|
19
|
+
},
|
|
20
|
+
rows: {
|
|
21
|
+
control: 'number'
|
|
22
|
+
},
|
|
23
|
+
cols: {
|
|
24
|
+
control: 'number'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
placeholder: 'Type something…',
|
|
29
|
+
disabled: false,
|
|
30
|
+
'aria-invalid': false,
|
|
31
|
+
rows: 4
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export default meta;
|
|
35
|
+
export const Default = {};
|
|
36
|
+
const variants = [
|
|
37
|
+
'base',
|
|
38
|
+
'component'
|
|
39
|
+
];
|
|
40
|
+
const sizes = [
|
|
41
|
+
'base',
|
|
42
|
+
'small'
|
|
43
|
+
];
|
|
44
|
+
export const States = {
|
|
45
|
+
render: (args)=>/*#__PURE__*/ _jsx("div", {
|
|
46
|
+
className: "flex flex-col gap-32",
|
|
47
|
+
children: variants.map((variant)=>sizes.map((size)=>/*#__PURE__*/ _jsxs("div", {
|
|
48
|
+
className: "flex flex-col gap-16",
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ _jsxs(Header, {
|
|
51
|
+
variant: "h3",
|
|
52
|
+
children: [
|
|
53
|
+
variant,
|
|
54
|
+
" ",
|
|
55
|
+
size
|
|
56
|
+
]
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
59
|
+
className: "flex flex-col gap-8",
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
62
|
+
variant: "label",
|
|
63
|
+
className: "text-foreground-neutral-subtle",
|
|
64
|
+
children: "Default"
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
67
|
+
...args,
|
|
68
|
+
variant: variant,
|
|
69
|
+
size: size
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
74
|
+
className: "flex flex-col gap-8",
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
77
|
+
variant: "label",
|
|
78
|
+
className: "text-foreground-neutral-subtle",
|
|
79
|
+
children: "Hover"
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
82
|
+
...args,
|
|
83
|
+
className: "hover",
|
|
84
|
+
variant: variant,
|
|
85
|
+
size: size
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
90
|
+
className: "flex flex-col gap-8",
|
|
91
|
+
children: [
|
|
92
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
93
|
+
variant: "label",
|
|
94
|
+
className: "text-foreground-neutral-subtle",
|
|
95
|
+
children: "Active"
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
98
|
+
...args,
|
|
99
|
+
className: "active",
|
|
100
|
+
defaultValue: "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.",
|
|
101
|
+
variant: variant,
|
|
102
|
+
size: size
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
}),
|
|
106
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
107
|
+
className: "flex flex-col gap-8",
|
|
108
|
+
children: [
|
|
109
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
110
|
+
variant: "label",
|
|
111
|
+
className: "text-foreground-neutral-subtle",
|
|
112
|
+
children: "Focus"
|
|
113
|
+
}),
|
|
114
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
115
|
+
...args,
|
|
116
|
+
className: "focus",
|
|
117
|
+
variant: variant,
|
|
118
|
+
size: size
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
}),
|
|
122
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
123
|
+
className: "flex flex-col gap-8",
|
|
124
|
+
children: [
|
|
125
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
126
|
+
variant: "label",
|
|
127
|
+
className: "text-foreground-neutral-subtle",
|
|
128
|
+
children: "Disabled"
|
|
129
|
+
}),
|
|
130
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
131
|
+
...args,
|
|
132
|
+
disabled: true,
|
|
133
|
+
variant: variant,
|
|
134
|
+
size: size
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
138
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
139
|
+
className: "flex flex-col gap-8",
|
|
140
|
+
children: [
|
|
141
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
142
|
+
variant: "label",
|
|
143
|
+
className: "text-foreground-neutral-subtle",
|
|
144
|
+
children: "Invalid"
|
|
145
|
+
}),
|
|
146
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
147
|
+
...args,
|
|
148
|
+
"aria-invalid": true,
|
|
149
|
+
variant: variant,
|
|
150
|
+
size: size
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
}, variant + size)))
|
|
156
|
+
})
|
|
157
|
+
};
|
|
158
|
+
States.parameters = {
|
|
159
|
+
pseudo: {
|
|
160
|
+
hover: '.hover',
|
|
161
|
+
active: '.active',
|
|
162
|
+
focusVisible: '.focus'
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
export const Sizes = {
|
|
166
|
+
render: (args)=>/*#__PURE__*/ _jsxs("div", {
|
|
167
|
+
className: "flex flex-col gap-32",
|
|
168
|
+
children: [
|
|
169
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
170
|
+
className: "flex flex-col gap-8",
|
|
171
|
+
children: [
|
|
172
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
173
|
+
variant: "label",
|
|
174
|
+
className: "text-foreground-neutral-subtle",
|
|
175
|
+
children: "Rows: 2"
|
|
176
|
+
}),
|
|
177
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
178
|
+
...args,
|
|
179
|
+
rows: 2
|
|
180
|
+
})
|
|
181
|
+
]
|
|
182
|
+
}),
|
|
183
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
184
|
+
className: "flex flex-col gap-8",
|
|
185
|
+
children: [
|
|
186
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
187
|
+
variant: "label",
|
|
188
|
+
className: "text-foreground-neutral-subtle",
|
|
189
|
+
children: "Rows: 4 (default)"
|
|
190
|
+
}),
|
|
191
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
192
|
+
...args,
|
|
193
|
+
rows: 4
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
198
|
+
className: "flex flex-col gap-8",
|
|
199
|
+
children: [
|
|
200
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
201
|
+
variant: "label",
|
|
202
|
+
className: "text-foreground-neutral-subtle",
|
|
203
|
+
children: "Rows: 6"
|
|
204
|
+
}),
|
|
205
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
206
|
+
...args,
|
|
207
|
+
rows: 6
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
}),
|
|
211
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
212
|
+
className: "flex flex-col gap-8",
|
|
213
|
+
children: [
|
|
214
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
215
|
+
variant: "label",
|
|
216
|
+
className: "text-foreground-neutral-subtle",
|
|
217
|
+
children: "Rows: 10"
|
|
218
|
+
}),
|
|
219
|
+
/*#__PURE__*/ _jsx(Textarea, {
|
|
220
|
+
...args,
|
|
221
|
+
rows: 10
|
|
222
|
+
})
|
|
223
|
+
]
|
|
224
|
+
})
|
|
225
|
+
]
|
|
226
|
+
})
|
|
227
|
+
};
|
|
228
|
+
export const DesignMock = {
|
|
229
|
+
render: ()=>{
|
|
230
|
+
const variants = [
|
|
231
|
+
{
|
|
232
|
+
key: 'base',
|
|
233
|
+
label: 'Primary'
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
key: 'component',
|
|
237
|
+
label: 'Secondary'
|
|
238
|
+
}
|
|
239
|
+
];
|
|
240
|
+
const states = [
|
|
241
|
+
{
|
|
242
|
+
name: 'Default',
|
|
243
|
+
props: {}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: 'Hover',
|
|
247
|
+
props: {
|
|
248
|
+
className: 'hover'
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: 'Focus',
|
|
253
|
+
props: {
|
|
254
|
+
className: 'focus'
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: 'Filled',
|
|
259
|
+
props: {
|
|
260
|
+
defaultValue: 'Placeholder'
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: 'Filled Hover',
|
|
265
|
+
props: {
|
|
266
|
+
defaultValue: 'Placeholder',
|
|
267
|
+
className: 'hover'
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
name: 'Disabled',
|
|
272
|
+
props: {
|
|
273
|
+
disabled: true
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: 'Error',
|
|
278
|
+
props: {
|
|
279
|
+
'aria-invalid': true
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
];
|
|
283
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
284
|
+
className: "flex flex-col gap-32 pb-64 pt-32 px-32",
|
|
285
|
+
children: [
|
|
286
|
+
/*#__PURE__*/ _jsx(Header, {
|
|
287
|
+
variant: "h3",
|
|
288
|
+
className: "text-foreground-neutral-subtle",
|
|
289
|
+
children: "TEXT AREA"
|
|
290
|
+
}),
|
|
291
|
+
/*#__PURE__*/ _jsx("div", {
|
|
292
|
+
className: "flex flex-row gap-32",
|
|
293
|
+
children: variants.map((variant)=>/*#__PURE__*/ _jsx("div", {
|
|
294
|
+
className: "flex flex-col gap-32",
|
|
295
|
+
children: states.map((state)=>/*#__PURE__*/ _jsxs("div", {
|
|
296
|
+
className: "flex flex-col gap-8",
|
|
297
|
+
children: [
|
|
298
|
+
/*#__PURE__*/ _jsxs(Code, {
|
|
299
|
+
variant: "label",
|
|
300
|
+
className: "text-foreground-neutral-subtle",
|
|
301
|
+
children: [
|
|
302
|
+
"Size=Base (32), State=",
|
|
303
|
+
state.name,
|
|
304
|
+
", Color=",
|
|
305
|
+
variant.label
|
|
306
|
+
]
|
|
307
|
+
}),
|
|
308
|
+
/*#__PURE__*/ _jsx("div", {
|
|
309
|
+
className: "w-[280px]",
|
|
310
|
+
children: /*#__PURE__*/ _jsx(Textarea, {
|
|
311
|
+
placeholder: "Placeholder",
|
|
312
|
+
variant: variant.key,
|
|
313
|
+
size: "base",
|
|
314
|
+
rows: 2,
|
|
315
|
+
...state.props
|
|
316
|
+
})
|
|
317
|
+
})
|
|
318
|
+
]
|
|
319
|
+
}, state.name))
|
|
320
|
+
}, variant.key))
|
|
321
|
+
})
|
|
322
|
+
]
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
DesignMock.parameters = {
|
|
327
|
+
pseudo: {
|
|
328
|
+
hover: '.hover',
|
|
329
|
+
focusVisible: '.focus'
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
//# sourceMappingURL=textarea.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/textarea/textarea.stories.tsx"],"sourcesContent":["import type {Meta, StoryObj} from '@storybook/react';\nimport {Code, Header} from 'components/typography';\nimport {Textarea} from './textarea';\n\nconst meta = {\n title: 'Components/Textarea',\n component: Textarea,\n tags: ['autodocs'],\n argTypes: {\n placeholder: {control: 'text'},\n disabled: {control: 'boolean'},\n 'aria-invalid': {control: 'boolean'},\n rows: {control: 'number'},\n cols: {control: 'number'},\n },\n args: {\n placeholder: 'Type something…',\n disabled: false,\n 'aria-invalid': false,\n rows: 4,\n },\n} satisfies Meta<typeof Textarea>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {};\n\nconst variants = ['base', 'component'] as const;\nconst sizes = ['base', 'small'] as const;\n\nexport const States: Story = {\n render: (args) => (\n <div className=\"flex flex-col gap-32\">\n {variants.map((variant) =>\n sizes.map((size) => (\n <div key={variant + size} className=\"flex flex-col gap-16\">\n <Header variant=\"h3\">\n {variant} {size}\n </Header>\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Default\n </Code>\n\n <Textarea {...args} variant={variant} size={size} />\n </div>\n\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Hover\n </Code>\n\n <Textarea {...args} className=\"hover\" variant={variant} size={size} />\n </div>\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Active\n </Code>\n\n <Textarea\n {...args}\n className=\"active\"\n defaultValue=\"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.\"\n variant={variant}\n size={size}\n />\n </div>\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Focus\n </Code>\n\n <Textarea {...args} className=\"focus\" variant={variant} size={size} />\n </div>\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Disabled\n </Code>\n\n <Textarea {...args} disabled variant={variant} size={size} />\n </div>\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Invalid\n </Code>\n\n <Textarea {...args} aria-invalid variant={variant} size={size} />\n </div>\n </div>\n )),\n )}\n </div>\n ),\n};\n\nStates.parameters = {\n pseudo: {\n hover: '.hover',\n active: '.active',\n focusVisible: '.focus',\n },\n};\n\nexport const Sizes: Story = {\n render: (args) => (\n <div className=\"flex flex-col gap-32\">\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Rows: 2\n </Code>\n <Textarea {...args} rows={2} />\n </div>\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Rows: 4 (default)\n </Code>\n <Textarea {...args} rows={4} />\n </div>\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Rows: 6\n </Code>\n <Textarea {...args} rows={6} />\n </div>\n <div className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Rows: 10\n </Code>\n <Textarea {...args} rows={10} />\n </div>\n </div>\n ),\n};\n\nexport const DesignMock: Story = {\n render: () => {\n const variants = [\n {key: 'base', label: 'Primary'},\n {key: 'component', label: 'Secondary'},\n ] as const;\n const states = [\n {name: 'Default', props: {}},\n {name: 'Hover', props: {className: 'hover'}},\n {name: 'Focus', props: {className: 'focus'}},\n {name: 'Filled', props: {defaultValue: 'Placeholder'}},\n {name: 'Filled Hover', props: {defaultValue: 'Placeholder', className: 'hover'}},\n {name: 'Disabled', props: {disabled: true}},\n {name: 'Error', props: {'aria-invalid': true}},\n ] as const;\n\n return (\n <div className=\"flex flex-col gap-32 pb-64 pt-32 px-32\">\n <Header variant=\"h3\" className=\"text-foreground-neutral-subtle\">\n TEXT AREA\n </Header>\n <div className=\"flex flex-row gap-32\">\n {variants.map((variant) => (\n <div key={variant.key} className=\"flex flex-col gap-32\">\n {states.map((state) => (\n <div key={state.name} className=\"flex flex-col gap-8\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Size=Base (32), State={state.name}, Color={variant.label}\n </Code>\n <div className=\"w-[280px]\">\n <Textarea\n placeholder=\"Placeholder\"\n variant={variant.key}\n size=\"base\"\n rows={2}\n {...state.props}\n />\n </div>\n </div>\n ))}\n </div>\n ))}\n </div>\n </div>\n );\n },\n};\n\nDesignMock.parameters = {\n pseudo: {\n hover: '.hover',\n focusVisible: '.focus',\n },\n};\n"],"names":["Code","Header","Textarea","meta","title","component","tags","argTypes","placeholder","control","disabled","rows","cols","args","Default","variants","sizes","States","render","div","className","map","variant","size","defaultValue","aria-invalid","parameters","pseudo","hover","active","focusVisible","Sizes","DesignMock","key","label","states","name","props","state"],"mappings":";AACA,SAAQA,IAAI,EAAEC,MAAM,QAAO,wBAAwB;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ACtBC,QAAQ;QACNC,OAAO;QACPE,cAAc;IAChB;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
2
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
7
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAG5D,iBAAS,eAAe,CAAC,EACvB,aAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,2CAQxD;AAED,iBAAS,OAAO,CAAC,EAAC,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAM9E;AAED,iBAAS,cAAc,CAAC,EAAC,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAExF;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,UAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAgBvD;AAED,OAAO,EAAC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
|
+
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
5
|
+
return /*#__PURE__*/ _jsx(TooltipPrimitive.Provider, {
|
|
6
|
+
"data-slot": "tooltip-provider",
|
|
7
|
+
delayDuration: delayDuration,
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function Tooltip({ ...props }) {
|
|
12
|
+
return /*#__PURE__*/ _jsx(TooltipProvider, {
|
|
13
|
+
children: /*#__PURE__*/ _jsx(TooltipPrimitive.Root, {
|
|
14
|
+
"data-slot": "tooltip",
|
|
15
|
+
...props
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function TooltipTrigger({ ...props }) {
|
|
20
|
+
return /*#__PURE__*/ _jsx(TooltipPrimitive.Trigger, {
|
|
21
|
+
"data-slot": "tooltip-trigger",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
26
|
+
return /*#__PURE__*/ _jsx(TooltipPrimitive.Portal, {
|
|
27
|
+
children: /*#__PURE__*/ _jsx(TooltipPrimitive.Content, {
|
|
28
|
+
"data-slot": "tooltip-content",
|
|
29
|
+
sideOffset: sideOffset,
|
|
30
|
+
className: cn('rounded-8 bg-background-components-base text-foreground-neutral-base px-8 py-4 text-xs font-medium leading-20 shadow-button-neutral animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md text-balance', className),
|
|
31
|
+
...props,
|
|
32
|
+
children: children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport {cn} from 'utils/cn';\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({...props}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({...props}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'rounded-8 bg-background-components-base text-foreground-neutral-base px-8 py-4 text-xs font-medium leading-20 shadow-button-neutral animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md text-balance',\n className,\n )}\n {...props}\n >\n {children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport {Tooltip, TooltipTrigger, TooltipContent, TooltipProvider};\n"],"names":["TooltipPrimitive","cn","TooltipProvider","delayDuration","props","Provider","data-slot","Tooltip","Root","TooltipTrigger","Trigger","TooltipContent","className","sideOffset","children","Portal","Content"],"mappings":";AAAA,YAAYA,sBAAsB,0BAA0B;AAC5D,SAAQC,EAAE,QAAO,WAAW;AAE5B,SAASC,gBAAgB,EACvBC,gBAAgB,CAAC,EACjB,GAAGC,OACoD;IACvD,qBACE,KAACJ,iBAAiBK,QAAQ;QACxBC,aAAU;QACVH,eAAeA;QACd,GAAGC,KAAK;;AAGf;AAEA,SAASG,QAAQ,EAAC,GAAGH,OAA0D;IAC7E,qBACE,KAACF;kBACC,cAAA,KAACF,iBAAiBQ,IAAI;YAACF,aAAU;YAAW,GAAGF,KAAK;;;AAG1D;AAEA,SAASK,eAAe,EAAC,GAAGL,OAA6D;IACvF,qBAAO,KAACJ,iBAAiBU,OAAO;QAACJ,aAAU;QAAmB,GAAGF,KAAK;;AACxE;AAEA,SAASO,eAAe,EACtBC,SAAS,EACTC,aAAa,CAAC,EACdC,QAAQ,EACR,GAAGV,OACmD;IACtD,qBACE,KAACJ,iBAAiBe,MAAM;kBACtB,cAAA,KAACf,iBAAiBgB,OAAO;YACvBV,aAAU;YACVO,YAAYA;YACZD,WAAWX,GACT,ufACAW;YAED,GAAGR,KAAK;sBAERU;;;AAIT;AAEA,SAAQP,OAAO,EAAEE,cAAc,EAAEE,cAAc,EAAET,eAAe,GAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/utils/avatar.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,KAAG,MAStD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAK1C,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const hashString = (str)=>{
|
|
2
|
+
let hash = 0;
|
|
3
|
+
for(let i = 0; i < str.length; i++){
|
|
4
|
+
const char = str.charCodeAt(i);
|
|
5
|
+
hash = (hash << 5) - hash + char;
|
|
6
|
+
hash = hash & hash;
|
|
7
|
+
}
|
|
8
|
+
return Math.abs(hash);
|
|
9
|
+
};
|
|
10
|
+
export const getPlaceholderImageUrl = (name)=>{
|
|
11
|
+
const backgroundColors = [
|
|
12
|
+
'BFDFFF',
|
|
13
|
+
'BFEAFF',
|
|
14
|
+
'CFBFFF',
|
|
15
|
+
'FFBFC3',
|
|
16
|
+
'FFEABF',
|
|
17
|
+
'E3E6EA',
|
|
18
|
+
'EAEAEA'
|
|
19
|
+
];
|
|
20
|
+
const seed = name?.trim() || 'avatar';
|
|
21
|
+
const colorIndex = hashString(seed) % backgroundColors.length;
|
|
22
|
+
const backgroundColor = backgroundColors[colorIndex];
|
|
23
|
+
return `https://api.dicebear.com/9.x/micah/svg?backgroundColor=${backgroundColor}&seed=${encodeURIComponent(seed)}`;
|
|
24
|
+
};
|
|
25
|
+
export const getInitial = (name)=>{
|
|
26
|
+
if (name) {
|
|
27
|
+
return name.trim()[0]?.toUpperCase() ?? 'L';
|
|
28
|
+
}
|
|
29
|
+
return 'L';
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/avatar.ts"],"sourcesContent":["const hashString = (str: string): number => {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return Math.abs(hash);\n};\n\nexport const getPlaceholderImageUrl = (name?: string): string => {\n const backgroundColors = ['BFDFFF', 'BFEAFF', 'CFBFFF', 'FFBFC3', 'FFEABF', 'E3E6EA', 'EAEAEA'];\n\n const seed = name?.trim() || 'avatar';\n\n const colorIndex = hashString(seed) % backgroundColors.length;\n const backgroundColor = backgroundColors[colorIndex];\n\n return `https://api.dicebear.com/9.x/micah/svg?backgroundColor=${backgroundColor}&seed=${encodeURIComponent(seed)}`;\n};\n\nexport const getInitial = (name?: string): string => {\n if (name) {\n return name.trim()[0]?.toUpperCase() ?? 'L';\n }\n return 'L';\n};\n"],"names":["hashString","str","hash","i","length","char","charCodeAt","Math","abs","getPlaceholderImageUrl","name","backgroundColors","seed","trim","colorIndex","backgroundColor","encodeURIComponent","getInitial","toUpperCase"],"mappings":"AAAA,MAAMA,aAAa,CAACC;IAClB,IAAIC,OAAO;IACX,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIG,MAAM,EAAED,IAAK;QACnC,MAAME,OAAOJ,IAAIK,UAAU,CAACH;QAC5BD,OAAO,AAACA,CAAAA,QAAQ,CAAA,IAAKA,OAAOG;QAC5BH,OAAOA,OAAOA;IAChB;IACA,OAAOK,KAAKC,GAAG,CAACN;AAClB;AAEA,OAAO,MAAMO,yBAAyB,CAACC;IACrC,MAAMC,mBAAmB;QAAC;QAAU;QAAU;QAAU;QAAU;QAAU;QAAU;KAAS;IAE/F,MAAMC,OAAOF,MAAMG,UAAU;IAE7B,MAAMC,aAAad,WAAWY,QAAQD,iBAAiBP,MAAM;IAC7D,MAAMW,kBAAkBJ,gBAAgB,CAACG,WAAW;IAEpD,OAAO,CAAC,uDAAuD,EAAEC,gBAAgB,MAAM,EAAEC,mBAAmBJ,OAAO;AACrH,EAAE;AAEF,OAAO,MAAMK,aAAa,CAACP;IACzB,IAAIA,MAAM;QACR,OAAOA,KAAKG,IAAI,EAAE,CAAC,EAAE,EAAEK,iBAAiB;IAC1C;IACA,OAAO;AACT,EAAE"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
package/dist/utils/index.js
CHANGED
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './clipboard';\nexport * from './cn';\nexport * from './date';\nexport * from './format';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc,WAAW"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './avatar';\nexport * from './clipboard';\nexport * from './cn';\nexport * from './date';\nexport * from './format';\n"],"names":[],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,cAAc;AAC5B,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc,WAAW"}
|
package/index.css
CHANGED
|
@@ -290,6 +290,37 @@
|
|
|
290
290
|
/* Alpha */
|
|
291
291
|
--alpha-250: var(--color-alpha-black-10);
|
|
292
292
|
--alpha-400: var(--color-alpha-black-24);
|
|
293
|
+
|
|
294
|
+
/* Shadow */
|
|
295
|
+
--shadow-border-base:
|
|
296
|
+
0 -1px 0 0 var(--color-alpha-white-6), 0 0 0 1px var(--color-alpha-white-6), 0 0 0 1px
|
|
297
|
+
var(--color-neutral-800), 0 0 1px 1.5px var(--color-alpha-black-24), 0 2px 2px 0
|
|
298
|
+
var(--color-alpha-black-24);
|
|
299
|
+
--shadow-border-interactive-with-active: 0 0 0 1px #ff8b16, 0 0 0 4px rgba(255, 49, 0, 0.25);
|
|
300
|
+
--shadow-border-error: 0 0 0 1px #ff1f5a, 0 0 0 3px rgba(246, 0, 67, 0.25);
|
|
301
|
+
--shadow-button-inverted:
|
|
302
|
+
0 -1px 0 0 var(--color-alpha-white-12), 0 0 0 1px var(--color-alpha-white-10), 0 0 0 1px
|
|
303
|
+
var(--color-neutral-600), 0 0 1px 1.5px var(--color-alpha-black-24), 0 2px 2px 0
|
|
304
|
+
var(--color-alpha-black-24);
|
|
305
|
+
--shadow-button-inverted-focus:
|
|
306
|
+
0 -1px 0 0 var(--color-alpha-white-12), 0 0 0 1px var(--color-alpha-white-12), 0 0 0 1px
|
|
307
|
+
var(--color-neutral-600), 0 0 0 2px var(--color-alpha-white-88), 0 0 0 4px
|
|
308
|
+
var(--color-primary-500);
|
|
309
|
+
--shadow-button-neutral:
|
|
310
|
+
0 -1px 0 0 var(--color-alpha-white-6), 0 0 0 1px var(--color-alpha-white-6), 0 0 0 1px
|
|
311
|
+
var(--color-neutral-800), 0 0 1px 1.5px var(--color-alpha-black-24), 0 2px 2px 0
|
|
312
|
+
var(--color-alpha-black-24);
|
|
313
|
+
--shadow-button-neutral-focus:
|
|
314
|
+
0 -1px 0 0 var(--color-alpha-white-6), 0 0 0 1px var(--color-alpha-white-6), 0 0 0 1px
|
|
315
|
+
var(--color-neutral-800), 0 0 0 2px var(--color-alpha-white-88), 0 0 0 4px
|
|
316
|
+
var(--color-primary-500);
|
|
317
|
+
--shadow-button-danger:
|
|
318
|
+
0 -1px 0 0 var(--color-alpha-white-16), 0 0 0 1px var(--color-alpha-white-12), 0 0 0 1px
|
|
319
|
+
var(--color-red-700), 0 0 1px 1.5px var(--color-alpha-black-24), 0 2px 2px 0
|
|
320
|
+
var(--color-alpha-black-24);
|
|
321
|
+
--shadow-button-danger-focus:
|
|
322
|
+
0 -1px 0 0 var(--color-alpha-white-16), 0 0 0 1px var(--color-alpha-white-12), 0 0 0 1px
|
|
323
|
+
var(--color-red-700), 0 0 0 2px var(--color-alpha-white-88), 0 0 0 4px var(--color-primary-500);
|
|
293
324
|
}
|
|
294
325
|
|
|
295
326
|
.dark {
|
|
@@ -307,7 +338,7 @@
|
|
|
307
338
|
--background-highlight-base: var(--color-primary-950);
|
|
308
339
|
--background-neutral-hover: var(--color-neutral-800);
|
|
309
340
|
--background-neutral-overlay: var(--color-neutral-800);
|
|
310
|
-
--background-components-base: var(--color-neutral-
|
|
341
|
+
--background-components-base: var(--color-neutral-800);
|
|
311
342
|
--background-field-component: var(--color-neutral-900);
|
|
312
343
|
--background-switch-off-hover: var(--color-neutral-600);
|
|
313
344
|
--background-field-component-hover: var(--color-neutral-800);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/react-ui",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
"storybook-addon-pseudo-states": "^9.1.8",
|
|
57
57
|
"tailwindcss": "^4.1.13",
|
|
58
58
|
"tw-animate-css": "^1.4.0",
|
|
59
|
-
"@shipfox/biome": "1.
|
|
59
|
+
"@shipfox/biome": "1.3.0",
|
|
60
60
|
"@shipfox/swc": "1.2.1",
|
|
61
61
|
"@shipfox/ts-config": "1.3.5",
|
|
62
62
|
"@shipfox/typescript": "1.1.2",
|
|
63
|
-
"@shipfox/vite": "1.2.
|
|
64
|
-
"@shipfox/vitest": "1.1.
|
|
63
|
+
"@shipfox/vite": "1.2.2",
|
|
64
|
+
"@shipfox/vitest": "1.1.3"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "swc",
|
|
68
|
-
"check": "biome",
|
|
68
|
+
"check": "biome-check",
|
|
69
69
|
"storybook": "storybook dev",
|
|
70
70
|
"storybook:build": "storybook build -o storybook-static",
|
|
71
71
|
"test": "vitest-run",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type {Meta, StoryObj} from '@storybook/react';
|
|
2
|
+
import {Header} from 'components/typography';
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
AlertAction,
|
|
6
|
+
AlertActions,
|
|
7
|
+
AlertClose,
|
|
8
|
+
AlertContent,
|
|
9
|
+
AlertDescription,
|
|
10
|
+
AlertTitle,
|
|
11
|
+
} from './alert';
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
14
|
+
title: 'Components/Alert',
|
|
15
|
+
component: Alert,
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
argTypes: {
|
|
18
|
+
variant: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: ['default', 'info', 'success', 'warning', 'destructive'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
variant: 'default',
|
|
25
|
+
},
|
|
26
|
+
} satisfies Meta<typeof Alert>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
const variants = ['default', 'info', 'success', 'warning', 'destructive'] as const;
|
|
33
|
+
|
|
34
|
+
export const Default: Story = {
|
|
35
|
+
render: (args) => {
|
|
36
|
+
return (
|
|
37
|
+
<Alert {...args}>
|
|
38
|
+
<AlertContent>
|
|
39
|
+
<AlertTitle>Title</AlertTitle>
|
|
40
|
+
<AlertDescription>Description</AlertDescription>
|
|
41
|
+
<AlertActions>
|
|
42
|
+
<AlertAction>Download</AlertAction>
|
|
43
|
+
<AlertAction>View</AlertAction>
|
|
44
|
+
</AlertActions>
|
|
45
|
+
</AlertContent>
|
|
46
|
+
<AlertClose variant={args.variant} />
|
|
47
|
+
</Alert>
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const DesignMock: Story = {
|
|
53
|
+
render: () => {
|
|
54
|
+
return (
|
|
55
|
+
<div className="flex flex-col gap-32 pb-64 pt-32 px-32 bg-background-neutral-base">
|
|
56
|
+
<Header variant="h3" className="text-foreground-neutral-subtle">
|
|
57
|
+
ALERTS
|
|
58
|
+
</Header>
|
|
59
|
+
<div className="flex flex-col gap-16">
|
|
60
|
+
{variants.map((variant) => (
|
|
61
|
+
<Alert key={variant} variant={variant}>
|
|
62
|
+
<AlertContent>
|
|
63
|
+
<AlertTitle>Title</AlertTitle>
|
|
64
|
+
<AlertDescription>Description</AlertDescription>
|
|
65
|
+
<AlertActions>
|
|
66
|
+
<AlertAction>Download</AlertAction>
|
|
67
|
+
<AlertAction>View</AlertAction>
|
|
68
|
+
</AlertActions>
|
|
69
|
+
</AlertContent>
|
|
70
|
+
<AlertClose variant={variant} />
|
|
71
|
+
</Alert>
|
|
72
|
+
))}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
};
|