@shipfox/react-ui 0.5.0 → 0.6.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/.storybook/preview.tsx +11 -0
- package/.turbo/turbo-build.log +16 -3
- package/.turbo/turbo-check.log +2 -2
- package/.turbo/turbo-type.log +1 -1
- package/CHANGELOG.md +8 -0
- package/README.md +16 -0
- package/dist/build-css-entry.js +5 -0
- package/dist/build-css-entry.js.map +1 -0
- package/dist/components/code-block/code-block-footer.d.ts.map +1 -1
- package/dist/components/code-block/code-block-footer.js +29 -15
- package/dist/components/code-block/code-block-footer.js.map +1 -1
- package/dist/components/dynamic-item/dynamic-item.stories.js +1 -1
- package/dist/components/dynamic-item/dynamic-item.stories.js.map +1 -1
- package/dist/components/icon/icon.d.ts +1 -0
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +3 -2
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/modal/index.d.ts +3 -0
- package/dist/components/modal/index.d.ts.map +1 -0
- package/dist/components/modal/index.js +3 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/modal/modal.d.ts +37 -0
- package/dist/components/modal/modal.d.ts.map +1 -0
- package/dist/components/modal/modal.js +262 -0
- package/dist/components/modal/modal.js.map +1 -0
- package/dist/components/modal/modal.stories.js +497 -0
- package/dist/components/modal/modal.stories.js.map +1 -0
- package/dist/components/moving-border/index.d.ts +2 -0
- package/dist/components/moving-border/index.d.ts.map +1 -0
- package/dist/components/moving-border/index.js +3 -0
- package/dist/components/moving-border/index.js.map +1 -0
- package/dist/components/typography/text.d.ts.map +1 -1
- package/dist/components/typography/text.js +1 -1
- package/dist/components/typography/text.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useMediaQuery.d.ts +2 -0
- package/dist/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/hooks/useMediaQuery.js +74 -0
- package/dist/hooks/useMediaQuery.js.map +1 -0
- package/dist/styles.css +1 -0
- package/index.css +1 -1
- package/package.json +11 -7
- package/src/build-css-entry.ts +3 -0
- package/src/components/code-block/code-block-footer.tsx +37 -30
- package/src/components/dynamic-item/dynamic-item.stories.tsx +1 -1
- package/src/components/icon/icon.tsx +2 -0
- package/src/components/index.ts +1 -0
- package/src/components/modal/index.ts +23 -0
- package/src/components/modal/modal.stories.tsx +384 -0
- package/src/components/modal/modal.tsx +309 -0
- package/src/components/moving-border/index.ts +1 -0
- package/src/components/typography/text.tsx +9 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useMediaQuery.ts +87 -0
- package/tsconfig.build.json +7 -1
- package/vite.css.config.ts +30 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { argosScreenshot } from '@argos-ci/storybook/vitest';
|
|
3
|
+
import { screen, within } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { Button, ButtonLink } from '../../components/button/index.js';
|
|
6
|
+
import { CodeBlock, CodeBlockBody, CodeBlockContent, CodeBlockCopyButton, CodeBlockFilename, CodeBlockFiles, CodeBlockFooter, CodeBlockHeader, CodeBlockItem } from '../../components/code-block/index.js';
|
|
7
|
+
import { DynamicItem } from '../../components/dynamic-item/index.js';
|
|
8
|
+
import { Icon } from '../../components/icon/index.js';
|
|
9
|
+
import { Input } from '../../components/input/index.js';
|
|
10
|
+
import { ItemTitle } from '../../components/item/index.js';
|
|
11
|
+
import { Label } from '../../components/label/index.js';
|
|
12
|
+
import { MovingBorder } from '../../components/moving-border/index.js';
|
|
13
|
+
import { Text } from '../../components/typography/index.js';
|
|
14
|
+
import { useState } from 'react';
|
|
15
|
+
import { cn } from '../../utils/cn.js';
|
|
16
|
+
import illustration2 from '../../assets/illustration-2.svg';
|
|
17
|
+
import illustrationBg from '../../assets/illustration-gradient.svg';
|
|
18
|
+
import { Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalTitle, ModalTrigger } from './modal.js';
|
|
19
|
+
const OPEN_MODAL_REGEX = /open modal/i;
|
|
20
|
+
const IMPORT_JOBS_REGEX = /import past jobs from github/i;
|
|
21
|
+
const GITHUB_ACTIONS_REGEX = /run github actions on shipfox/i;
|
|
22
|
+
const meta = {
|
|
23
|
+
title: 'Components/Modal',
|
|
24
|
+
component: Modal,
|
|
25
|
+
tags: [
|
|
26
|
+
'autodocs'
|
|
27
|
+
],
|
|
28
|
+
parameters: {
|
|
29
|
+
layout: 'centered'
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
export const Default = {
|
|
34
|
+
play: async (ctx)=>{
|
|
35
|
+
const { canvasElement, step } = ctx;
|
|
36
|
+
const canvas = within(canvasElement);
|
|
37
|
+
const user = userEvent.setup();
|
|
38
|
+
await step('Open the modal', async ()=>{
|
|
39
|
+
const triggerButton = canvas.getByRole('button', {
|
|
40
|
+
name: OPEN_MODAL_REGEX
|
|
41
|
+
});
|
|
42
|
+
await user.click(triggerButton);
|
|
43
|
+
});
|
|
44
|
+
await step('Wait for dialog to appear and render', async ()=>{
|
|
45
|
+
await screen.findByRole('dialog');
|
|
46
|
+
await new Promise((resolve)=>setTimeout(resolve, 100));
|
|
47
|
+
});
|
|
48
|
+
await argosScreenshot(ctx, 'Default Modal Open');
|
|
49
|
+
},
|
|
50
|
+
render: ()=>{
|
|
51
|
+
const [open, setOpen] = useState(false);
|
|
52
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
53
|
+
className: "flex h-[calc(100vh/2)] w-[calc(100vw/2)] items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip",
|
|
54
|
+
children: /*#__PURE__*/ _jsxs(Modal, {
|
|
55
|
+
open: open,
|
|
56
|
+
onOpenChange: setOpen,
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ _jsx(ModalTrigger, {
|
|
59
|
+
asChild: true,
|
|
60
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
61
|
+
children: "Open Modal"
|
|
62
|
+
})
|
|
63
|
+
}),
|
|
64
|
+
/*#__PURE__*/ _jsxs(ModalContent, {
|
|
65
|
+
"aria-describedby": undefined,
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ _jsx(ModalTitle, {
|
|
68
|
+
className: "sr-only",
|
|
69
|
+
children: "Modal Title"
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ _jsx(ModalHeader, {
|
|
72
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
73
|
+
size: "lg",
|
|
74
|
+
className: "flex-1 overflow-ellipsis overflow-hidden whitespace-nowrap",
|
|
75
|
+
children: "Modal Title"
|
|
76
|
+
})
|
|
77
|
+
}),
|
|
78
|
+
/*#__PURE__*/ _jsx(ModalBody, {
|
|
79
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
80
|
+
size: "sm",
|
|
81
|
+
className: "text-foreground-neutral-subtle w-full",
|
|
82
|
+
children: "This modal automatically adapts between dialog (desktop) and drawer (mobile) based on screen size. Try resizing your browser window!"
|
|
83
|
+
})
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsxs(ModalFooter, {
|
|
86
|
+
children: [
|
|
87
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
88
|
+
variant: "transparent",
|
|
89
|
+
onClick: ()=>setOpen(false),
|
|
90
|
+
children: "Cancel"
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
93
|
+
variant: "primary",
|
|
94
|
+
onClick: ()=>setOpen(false),
|
|
95
|
+
children: "Confirm"
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
export const ImportForm = {
|
|
107
|
+
play: async (ctx)=>{
|
|
108
|
+
const { canvasElement, step } = ctx;
|
|
109
|
+
const canvas = within(canvasElement);
|
|
110
|
+
const user = userEvent.setup();
|
|
111
|
+
await step('Open the modal', async ()=>{
|
|
112
|
+
const triggerButton = canvas.getByRole('button', {
|
|
113
|
+
name: IMPORT_JOBS_REGEX
|
|
114
|
+
});
|
|
115
|
+
await user.click(triggerButton);
|
|
116
|
+
});
|
|
117
|
+
await step('Wait for dialog to appear and render', async ()=>{
|
|
118
|
+
await screen.findByRole('dialog');
|
|
119
|
+
await new Promise((resolve)=>setTimeout(resolve, 100));
|
|
120
|
+
});
|
|
121
|
+
await argosScreenshot(ctx, 'Import Form Modal Open');
|
|
122
|
+
},
|
|
123
|
+
render: ()=>{
|
|
124
|
+
const [open, setOpen] = useState(false);
|
|
125
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
126
|
+
className: "flex h-[calc(100vh/2)] w-[calc(100vw/2)] items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip",
|
|
127
|
+
children: /*#__PURE__*/ _jsxs(Modal, {
|
|
128
|
+
open: open,
|
|
129
|
+
onOpenChange: setOpen,
|
|
130
|
+
children: [
|
|
131
|
+
/*#__PURE__*/ _jsx(ModalTrigger, {
|
|
132
|
+
asChild: true,
|
|
133
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
134
|
+
children: "Import past jobs from Github"
|
|
135
|
+
})
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ _jsxs(ModalContent, {
|
|
138
|
+
"aria-describedby": undefined,
|
|
139
|
+
children: [
|
|
140
|
+
/*#__PURE__*/ _jsx(ModalTitle, {
|
|
141
|
+
className: "sr-only",
|
|
142
|
+
children: "Import past jobs from Github"
|
|
143
|
+
}),
|
|
144
|
+
/*#__PURE__*/ _jsx(ModalHeader, {
|
|
145
|
+
title: "Import past jobs from Github"
|
|
146
|
+
}),
|
|
147
|
+
/*#__PURE__*/ _jsxs(ModalBody, {
|
|
148
|
+
className: "gap-20",
|
|
149
|
+
children: [
|
|
150
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
151
|
+
size: "sm",
|
|
152
|
+
className: "text-foreground-neutral-subtle w-full",
|
|
153
|
+
children: "Backfill your CI history by importing past runs from your Github repo. We'll handle the rest by creating a background task to import the data for you."
|
|
154
|
+
}),
|
|
155
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
156
|
+
className: "flex flex-col gap-20 w-full",
|
|
157
|
+
children: [
|
|
158
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
159
|
+
className: "flex flex-col gap-8 w-full",
|
|
160
|
+
children: [
|
|
161
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
162
|
+
children: "Repository owner"
|
|
163
|
+
}),
|
|
164
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
165
|
+
placeholder: "apache"
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
}),
|
|
169
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
170
|
+
className: "flex flex-col gap-8 w-full",
|
|
171
|
+
children: [
|
|
172
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
173
|
+
children: "Repository name"
|
|
174
|
+
}),
|
|
175
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
176
|
+
placeholder: "kafka"
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
}),
|
|
180
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
181
|
+
className: "flex flex-col gap-8 w-full",
|
|
182
|
+
children: [
|
|
183
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
184
|
+
children: "Start date"
|
|
185
|
+
}),
|
|
186
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
187
|
+
placeholder: "September 5th, 2025"
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
}),
|
|
195
|
+
/*#__PURE__*/ _jsxs(ModalFooter, {
|
|
196
|
+
children: [
|
|
197
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
198
|
+
variant: "transparent",
|
|
199
|
+
onClick: ()=>setOpen(false),
|
|
200
|
+
children: "Cancel"
|
|
201
|
+
}),
|
|
202
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
203
|
+
variant: "primary",
|
|
204
|
+
onClick: ()=>setOpen(false),
|
|
205
|
+
children: "Import"
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
})
|
|
211
|
+
]
|
|
212
|
+
})
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const diffCode = `jobs:
|
|
217
|
+
build:
|
|
218
|
+
- runs-on: ubuntu-latest
|
|
219
|
+
+ runs-on: shipfox-2vcpu-ubuntu-2404`;
|
|
220
|
+
export const GithubActions = {
|
|
221
|
+
parameters: {
|
|
222
|
+
viewport: {
|
|
223
|
+
defaultViewport: 'large'
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
play: async (ctx)=>{
|
|
227
|
+
const { canvasElement, step } = ctx;
|
|
228
|
+
const canvas = within(canvasElement);
|
|
229
|
+
const user = userEvent.setup();
|
|
230
|
+
await step('Open the modal', async ()=>{
|
|
231
|
+
const triggerButton = canvas.getByRole('button', {
|
|
232
|
+
name: GITHUB_ACTIONS_REGEX
|
|
233
|
+
});
|
|
234
|
+
await user.click(triggerButton);
|
|
235
|
+
});
|
|
236
|
+
await step('Wait for dialog to appear and render', async ()=>{
|
|
237
|
+
await screen.findByRole('dialog');
|
|
238
|
+
await new Promise((resolve)=>setTimeout(resolve, 100));
|
|
239
|
+
});
|
|
240
|
+
await argosScreenshot(ctx, 'Github Actions Modal Open');
|
|
241
|
+
},
|
|
242
|
+
render: ()=>{
|
|
243
|
+
const [open, setOpen] = useState(false);
|
|
244
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
245
|
+
className: "flex h-[50vh] w-[calc(100vw/2)] items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip",
|
|
246
|
+
children: /*#__PURE__*/ _jsxs(Modal, {
|
|
247
|
+
open: open,
|
|
248
|
+
onOpenChange: setOpen,
|
|
249
|
+
children: [
|
|
250
|
+
/*#__PURE__*/ _jsx(ModalTrigger, {
|
|
251
|
+
asChild: true,
|
|
252
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
253
|
+
children: "Run GitHub Actions on Shipfox"
|
|
254
|
+
})
|
|
255
|
+
}),
|
|
256
|
+
/*#__PURE__*/ _jsxs(ModalContent, {
|
|
257
|
+
"aria-describedby": undefined,
|
|
258
|
+
children: [
|
|
259
|
+
/*#__PURE__*/ _jsx(ModalTitle, {
|
|
260
|
+
className: "sr-only",
|
|
261
|
+
children: "Run GitHub Actions on Shipfox"
|
|
262
|
+
}),
|
|
263
|
+
/*#__PURE__*/ _jsx(ModalHeader, {
|
|
264
|
+
title: "Run GitHub Actions on Shipfox"
|
|
265
|
+
}),
|
|
266
|
+
/*#__PURE__*/ _jsxs(ModalBody, {
|
|
267
|
+
className: "gap-32",
|
|
268
|
+
children: [
|
|
269
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
270
|
+
className: "flex flex-col gap-20 w-full",
|
|
271
|
+
children: [
|
|
272
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
273
|
+
size: "sm",
|
|
274
|
+
className: "text-foreground-neutral-subtle w-full",
|
|
275
|
+
children: "This will run your jobs on Shipfox's optimized infrastructure. Giving you faster builds, and dedicated resources."
|
|
276
|
+
}),
|
|
277
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
278
|
+
className: "relative",
|
|
279
|
+
children: [
|
|
280
|
+
/*#__PURE__*/ _jsx("img", {
|
|
281
|
+
src: illustration2,
|
|
282
|
+
alt: "illustration-2",
|
|
283
|
+
className: "hidden sm:block absolute overflow-clip right-2 top-1/2 -translate-y-1/2 translate-x-8 w-fit object-contain z-50"
|
|
284
|
+
}),
|
|
285
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
286
|
+
className: cn('relative overflow-hidden bg-transparent p-1 rounded-8'),
|
|
287
|
+
children: [
|
|
288
|
+
/*#__PURE__*/ _jsx("div", {
|
|
289
|
+
className: "absolute inset-0",
|
|
290
|
+
style: {
|
|
291
|
+
borderRadius: 'calc(0.5rem * 0.96)'
|
|
292
|
+
},
|
|
293
|
+
children: /*#__PURE__*/ _jsx(MovingBorder, {
|
|
294
|
+
duration: 6000,
|
|
295
|
+
rx: "30%",
|
|
296
|
+
ry: "30%",
|
|
297
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
298
|
+
className: "h-100 w-200 bg-[radial-gradient(#ff9e7a_40%,transparent_60%)]"
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
}),
|
|
302
|
+
/*#__PURE__*/ _jsx("div", {
|
|
303
|
+
className: "relative",
|
|
304
|
+
style: {
|
|
305
|
+
borderRadius: 'calc(0.5rem * 0.96)'
|
|
306
|
+
},
|
|
307
|
+
children: /*#__PURE__*/ _jsx(DynamicItem, {
|
|
308
|
+
variant: "default",
|
|
309
|
+
title: /*#__PURE__*/ _jsxs("div", {
|
|
310
|
+
className: "flex items-center gap-6",
|
|
311
|
+
children: [
|
|
312
|
+
/*#__PURE__*/ _jsx("span", {
|
|
313
|
+
className: "flex shrink-0 items-center justify-center text-tag-success-icon w-16 h-16",
|
|
314
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
315
|
+
name: "money",
|
|
316
|
+
size: "sm",
|
|
317
|
+
color: "var(--foreground-neutral-subtle, #a1a1aa)"
|
|
318
|
+
})
|
|
319
|
+
}),
|
|
320
|
+
/*#__PURE__*/ _jsx(ItemTitle, {
|
|
321
|
+
children: "6000 free credits/month to run your jobs"
|
|
322
|
+
})
|
|
323
|
+
]
|
|
324
|
+
}),
|
|
325
|
+
description: "~500 builds/month. No payment required.",
|
|
326
|
+
rightElement: /*#__PURE__*/ _jsx("img", {
|
|
327
|
+
src: illustrationBg,
|
|
328
|
+
alt: "illustration-bg",
|
|
329
|
+
className: "hidden sm:block absolute overflow-clip right-4 w-fit object-contain scale-105"
|
|
330
|
+
})
|
|
331
|
+
})
|
|
332
|
+
})
|
|
333
|
+
]
|
|
334
|
+
})
|
|
335
|
+
]
|
|
336
|
+
})
|
|
337
|
+
]
|
|
338
|
+
}),
|
|
339
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
340
|
+
className: "flex flex-col gap-20 w-full",
|
|
341
|
+
children: [
|
|
342
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
343
|
+
className: "flex flex-col gap-6",
|
|
344
|
+
children: [
|
|
345
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
346
|
+
className: "flex items-center justify-center w-full",
|
|
347
|
+
children: [
|
|
348
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
349
|
+
className: "flex-1 font-semibold text-foreground-neutral-base overflow-ellipsis overflow-hidden whitespace-nowrap",
|
|
350
|
+
children: "Update your GitHub Actions workflow"
|
|
351
|
+
}),
|
|
352
|
+
/*#__PURE__*/ _jsx(ButtonLink, {
|
|
353
|
+
variant: "base",
|
|
354
|
+
size: "sm",
|
|
355
|
+
href: "#",
|
|
356
|
+
iconRight: "bookOpen",
|
|
357
|
+
children: "See docs"
|
|
358
|
+
})
|
|
359
|
+
]
|
|
360
|
+
}),
|
|
361
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
362
|
+
size: "sm",
|
|
363
|
+
className: "text-foreground-neutral-subtle w-full",
|
|
364
|
+
children: "Replace the runs-on line in your workflow file to use Shipfox runners."
|
|
365
|
+
})
|
|
366
|
+
]
|
|
367
|
+
}),
|
|
368
|
+
/*#__PURE__*/ _jsxs(CodeBlock, {
|
|
369
|
+
data: [
|
|
370
|
+
{
|
|
371
|
+
language: 'yaml',
|
|
372
|
+
filename: '.github/workflows/<workflow-name>.yml',
|
|
373
|
+
code: diffCode
|
|
374
|
+
}
|
|
375
|
+
],
|
|
376
|
+
defaultValue: "yaml",
|
|
377
|
+
children: [
|
|
378
|
+
/*#__PURE__*/ _jsxs(CodeBlockHeader, {
|
|
379
|
+
children: [
|
|
380
|
+
/*#__PURE__*/ _jsx(CodeBlockFiles, {
|
|
381
|
+
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockFilename, {
|
|
382
|
+
value: item.language,
|
|
383
|
+
children: item.filename
|
|
384
|
+
})
|
|
385
|
+
}),
|
|
386
|
+
/*#__PURE__*/ _jsx(CodeBlockCopyButton, {})
|
|
387
|
+
]
|
|
388
|
+
}),
|
|
389
|
+
/*#__PURE__*/ _jsx(CodeBlockBody, {
|
|
390
|
+
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockItem, {
|
|
391
|
+
value: item.language,
|
|
392
|
+
children: /*#__PURE__*/ _jsx(CodeBlockContent, {
|
|
393
|
+
language: item.language,
|
|
394
|
+
children: item.code
|
|
395
|
+
})
|
|
396
|
+
})
|
|
397
|
+
}),
|
|
398
|
+
/*#__PURE__*/ _jsx(CodeBlockFooter, {
|
|
399
|
+
state: "running",
|
|
400
|
+
message: "Waiting for Shipfox runner event…",
|
|
401
|
+
description: "This usually takes 30-60 seconds after you commit the workflow file."
|
|
402
|
+
})
|
|
403
|
+
]
|
|
404
|
+
})
|
|
405
|
+
]
|
|
406
|
+
})
|
|
407
|
+
]
|
|
408
|
+
}),
|
|
409
|
+
/*#__PURE__*/ _jsx(ModalFooter, {
|
|
410
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
411
|
+
variant: "primary",
|
|
412
|
+
onClick: ()=>setOpen(false),
|
|
413
|
+
children: "Got it"
|
|
414
|
+
})
|
|
415
|
+
})
|
|
416
|
+
]
|
|
417
|
+
})
|
|
418
|
+
]
|
|
419
|
+
})
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
export const OpenedModal = {
|
|
424
|
+
play: async (ctx)=>{
|
|
425
|
+
const { canvasElement, step } = ctx;
|
|
426
|
+
const canvas = within(canvasElement);
|
|
427
|
+
const user = userEvent.setup();
|
|
428
|
+
await step('Open the modal', async ()=>{
|
|
429
|
+
const triggerButton = canvas.getByRole('button', {
|
|
430
|
+
name: OPEN_MODAL_REGEX
|
|
431
|
+
});
|
|
432
|
+
await user.click(triggerButton);
|
|
433
|
+
});
|
|
434
|
+
await step('Wait for dialog to appear and render', async ()=>{
|
|
435
|
+
await screen.findByRole('dialog');
|
|
436
|
+
await new Promise((resolve)=>setTimeout(resolve, 100));
|
|
437
|
+
});
|
|
438
|
+
await argosScreenshot(ctx, 'Opened Modal State');
|
|
439
|
+
},
|
|
440
|
+
render: ()=>{
|
|
441
|
+
const [open, setOpen] = useState(false);
|
|
442
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
443
|
+
className: "flex h-[calc(100vh/2)] w-[calc(100vw/2)] items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip",
|
|
444
|
+
children: /*#__PURE__*/ _jsxs(Modal, {
|
|
445
|
+
open: open,
|
|
446
|
+
onOpenChange: setOpen,
|
|
447
|
+
children: [
|
|
448
|
+
/*#__PURE__*/ _jsx(ModalTrigger, {
|
|
449
|
+
asChild: true,
|
|
450
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
451
|
+
children: "Open Modal"
|
|
452
|
+
})
|
|
453
|
+
}),
|
|
454
|
+
/*#__PURE__*/ _jsxs(ModalContent, {
|
|
455
|
+
"aria-describedby": undefined,
|
|
456
|
+
children: [
|
|
457
|
+
/*#__PURE__*/ _jsx(ModalTitle, {
|
|
458
|
+
className: "sr-only",
|
|
459
|
+
children: "Modal Title"
|
|
460
|
+
}),
|
|
461
|
+
/*#__PURE__*/ _jsx(ModalHeader, {
|
|
462
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
463
|
+
size: "lg",
|
|
464
|
+
className: "flex-1 overflow-ellipsis overflow-hidden whitespace-nowrap",
|
|
465
|
+
children: "Modal Title"
|
|
466
|
+
})
|
|
467
|
+
}),
|
|
468
|
+
/*#__PURE__*/ _jsx(ModalBody, {
|
|
469
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
470
|
+
size: "sm",
|
|
471
|
+
className: "text-foreground-neutral-subtle w-full",
|
|
472
|
+
children: "This modal automatically adapts between dialog (desktop) and drawer (mobile) based on screen size. Try resizing your browser window!"
|
|
473
|
+
})
|
|
474
|
+
}),
|
|
475
|
+
/*#__PURE__*/ _jsxs(ModalFooter, {
|
|
476
|
+
children: [
|
|
477
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
478
|
+
variant: "transparent",
|
|
479
|
+
onClick: ()=>setOpen(false),
|
|
480
|
+
children: "Cancel"
|
|
481
|
+
}),
|
|
482
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
483
|
+
variant: "primary",
|
|
484
|
+
onClick: ()=>setOpen(false),
|
|
485
|
+
children: "Confirm"
|
|
486
|
+
})
|
|
487
|
+
]
|
|
488
|
+
})
|
|
489
|
+
]
|
|
490
|
+
})
|
|
491
|
+
]
|
|
492
|
+
})
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
//# sourceMappingURL=modal.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/modal/modal.stories.tsx"],"sourcesContent":["import {argosScreenshot} from '@argos-ci/storybook/vitest';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {screen, within} from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport {Button, ButtonLink} from 'components/button';\nimport {\n CodeBlock,\n CodeBlockBody,\n CodeBlockContent,\n CodeBlockCopyButton,\n CodeBlockFilename,\n CodeBlockFiles,\n CodeBlockFooter,\n CodeBlockHeader,\n CodeBlockItem,\n} from 'components/code-block';\nimport {DynamicItem} from 'components/dynamic-item';\nimport {Icon} from 'components/icon';\nimport {Input} from 'components/input';\nimport {ItemTitle} from 'components/item';\nimport {Label} from 'components/label';\nimport {MovingBorder} from 'components/moving-border';\nimport {Text} from 'components/typography';\nimport {useState} from 'react';\nimport {cn} from 'utils/cn';\nimport illustration2 from '../../assets/illustration-2.svg';\nimport illustrationBg from '../../assets/illustration-gradient.svg';\nimport {\n Modal,\n ModalBody,\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalTitle,\n ModalTrigger,\n} from './modal';\n\nconst OPEN_MODAL_REGEX = /open modal/i;\nconst IMPORT_JOBS_REGEX = /import past jobs from github/i;\nconst GITHUB_ACTIONS_REGEX = /run github actions on shipfox/i;\n\nconst meta = {\n title: 'Components/Modal',\n component: Modal,\n tags: ['autodocs'],\n parameters: {\n layout: 'centered',\n },\n} satisfies Meta<typeof Modal>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n play: async (ctx) => {\n const {canvasElement, step} = ctx;\n const canvas = within(canvasElement);\n const user = userEvent.setup();\n\n await step('Open the modal', async () => {\n const triggerButton = canvas.getByRole('button', {name: OPEN_MODAL_REGEX});\n await user.click(triggerButton);\n });\n\n await step('Wait for dialog to appear and render', async () => {\n await screen.findByRole('dialog');\n await new Promise((resolve) => setTimeout(resolve, 100));\n });\n\n await argosScreenshot(ctx, 'Default Modal Open');\n },\n render: () => {\n const [open, setOpen] = useState(false);\n\n return (\n <div className=\"flex h-[calc(100vh/2)] w-[calc(100vw/2)] items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip\">\n <Modal open={open} onOpenChange={setOpen}>\n <ModalTrigger asChild>\n <Button>Open Modal</Button>\n </ModalTrigger>\n <ModalContent aria-describedby={undefined}>\n <ModalTitle className=\"sr-only\">Modal Title</ModalTitle>\n <ModalHeader>\n <Text\n size=\"lg\"\n className=\"flex-1 overflow-ellipsis overflow-hidden whitespace-nowrap\"\n >\n Modal Title\n </Text>\n </ModalHeader>\n <ModalBody>\n <Text size=\"sm\" className=\"text-foreground-neutral-subtle w-full\">\n This modal automatically adapts between dialog (desktop) and drawer (mobile) based\n on screen size. Try resizing your browser window!\n </Text>\n </ModalBody>\n <ModalFooter>\n <Button variant=\"transparent\" onClick={() => setOpen(false)}>\n Cancel\n </Button>\n <Button variant=\"primary\" onClick={() => setOpen(false)}>\n Confirm\n </Button>\n </ModalFooter>\n </ModalContent>\n </Modal>\n </div>\n );\n },\n};\n\nexport const ImportForm: Story = {\n play: async (ctx) => {\n const {canvasElement, step} = ctx;\n const canvas = within(canvasElement);\n const user = userEvent.setup();\n\n await step('Open the modal', async () => {\n const triggerButton = canvas.getByRole('button', {name: IMPORT_JOBS_REGEX});\n await user.click(triggerButton);\n });\n\n await step('Wait for dialog to appear and render', async () => {\n await screen.findByRole('dialog');\n await new Promise((resolve) => setTimeout(resolve, 100));\n });\n\n await argosScreenshot(ctx, 'Import Form Modal Open');\n },\n render: () => {\n const [open, setOpen] = useState(false);\n\n return (\n <div className=\"flex h-[calc(100vh/2)] w-[calc(100vw/2)] items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip\">\n <Modal open={open} onOpenChange={setOpen}>\n <ModalTrigger asChild>\n <Button>Import past jobs from Github</Button>\n </ModalTrigger>\n <ModalContent aria-describedby={undefined}>\n <ModalTitle className=\"sr-only\">Import past jobs from Github</ModalTitle>\n <ModalHeader title=\"Import past jobs from Github\" />\n <ModalBody className=\"gap-20\">\n <Text size=\"sm\" className=\"text-foreground-neutral-subtle w-full\">\n Backfill your CI history by importing past runs from your Github repo. We'll\n handle the rest by creating a background task to import the data for you.\n </Text>\n <div className=\"flex flex-col gap-20 w-full\">\n <div className=\"flex flex-col gap-8 w-full\">\n <Label>Repository owner</Label>\n <Input placeholder=\"apache\" />\n </div>\n <div className=\"flex flex-col gap-8 w-full\">\n <Label>Repository name</Label>\n <Input placeholder=\"kafka\" />\n </div>\n <div className=\"flex flex-col gap-8 w-full\">\n <Label>Start date</Label>\n <Input placeholder=\"September 5th, 2025\" />\n </div>\n </div>\n </ModalBody>\n <ModalFooter>\n <Button variant=\"transparent\" onClick={() => setOpen(false)}>\n Cancel\n </Button>\n <Button variant=\"primary\" onClick={() => setOpen(false)}>\n Import\n </Button>\n </ModalFooter>\n </ModalContent>\n </Modal>\n </div>\n );\n },\n};\n\nconst diffCode = `jobs:\n build:\n- runs-on: ubuntu-latest\n+ runs-on: shipfox-2vcpu-ubuntu-2404`;\n\nexport const GithubActions: Story = {\n parameters: {\n viewport: {\n defaultViewport: 'large',\n },\n },\n play: async (ctx) => {\n const {canvasElement, step} = ctx;\n const canvas = within(canvasElement);\n const user = userEvent.setup();\n\n await step('Open the modal', async () => {\n const triggerButton = canvas.getByRole('button', {name: GITHUB_ACTIONS_REGEX});\n await user.click(triggerButton);\n });\n\n await step('Wait for dialog to appear and render', async () => {\n await screen.findByRole('dialog');\n await new Promise((resolve) => setTimeout(resolve, 100));\n });\n\n await argosScreenshot(ctx, 'Github Actions Modal Open');\n },\n render: () => {\n const [open, setOpen] = useState(false);\n\n return (\n <div className=\"flex h-[50vh] w-[calc(100vw/2)] items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip\">\n <Modal open={open} onOpenChange={setOpen}>\n <ModalTrigger asChild>\n <Button>Run GitHub Actions on Shipfox</Button>\n </ModalTrigger>\n <ModalContent aria-describedby={undefined}>\n <ModalTitle className=\"sr-only\">Run GitHub Actions on Shipfox</ModalTitle>\n <ModalHeader title=\"Run GitHub Actions on Shipfox\" />\n <ModalBody className=\"gap-32\">\n <div className=\"flex flex-col gap-20 w-full\">\n <Text size=\"sm\" className=\"text-foreground-neutral-subtle w-full\">\n This will run your jobs on Shipfox's optimized infrastructure. Giving you\n faster builds, and dedicated resources.\n </Text>\n <div className=\"relative\">\n <img\n src={illustration2}\n alt=\"illustration-2\"\n className=\"hidden sm:block absolute overflow-clip right-2 top-1/2 -translate-y-1/2 translate-x-8 w-fit object-contain z-50\"\n />\n <div className={cn('relative overflow-hidden bg-transparent p-1 rounded-8')}>\n <div className=\"absolute inset-0\" style={{borderRadius: 'calc(0.5rem * 0.96)'}}>\n <MovingBorder duration={6000} rx=\"30%\" ry=\"30%\">\n <div className=\"h-100 w-200 bg-[radial-gradient(#ff9e7a_40%,transparent_60%)]\" />\n </MovingBorder>\n </div>\n <div\n className=\"relative\"\n style={{\n borderRadius: 'calc(0.5rem * 0.96)',\n }}\n >\n <DynamicItem\n variant=\"default\"\n title={\n <div className=\"flex items-center gap-6\">\n <span className=\"flex shrink-0 items-center justify-center text-tag-success-icon w-16 h-16\">\n <Icon\n name=\"money\"\n size=\"sm\"\n color=\"var(--foreground-neutral-subtle, #a1a1aa)\"\n />\n </span>\n <ItemTitle>6000 free credits/month to run your jobs</ItemTitle>\n </div>\n }\n description=\"~500 builds/month. No payment required.\"\n rightElement={\n <img\n src={illustrationBg}\n alt=\"illustration-bg\"\n className=\"hidden sm:block absolute overflow-clip right-4 w-fit object-contain scale-105\"\n />\n }\n />\n </div>\n </div>\n </div>\n </div>\n <div className=\"flex flex-col gap-20 w-full\">\n <div className=\"flex flex-col gap-6\">\n <div className=\"flex items-center justify-center w-full\">\n <Text className=\"flex-1 font-semibold text-foreground-neutral-base overflow-ellipsis overflow-hidden whitespace-nowrap\">\n Update your GitHub Actions workflow\n </Text>\n <ButtonLink variant=\"base\" size=\"sm\" href=\"#\" iconRight=\"bookOpen\">\n See docs\n </ButtonLink>\n </div>\n <Text size=\"sm\" className=\"text-foreground-neutral-subtle w-full\">\n Replace the runs-on line in your workflow file to use Shipfox runners.\n </Text>\n </div>\n\n <CodeBlock\n data={[\n {\n language: 'yaml',\n filename: '.github/workflows/<workflow-name>.yml',\n code: diffCode,\n },\n ]}\n defaultValue=\"yaml\"\n >\n <CodeBlockHeader>\n <CodeBlockFiles>\n {(item) => (\n <CodeBlockFilename value={item.language}>{item.filename}</CodeBlockFilename>\n )}\n </CodeBlockFiles>\n <CodeBlockCopyButton />\n </CodeBlockHeader>\n <CodeBlockBody>\n {(item) => (\n <CodeBlockItem value={item.language}>\n <CodeBlockContent language={item.language}>{item.code}</CodeBlockContent>\n </CodeBlockItem>\n )}\n </CodeBlockBody>\n <CodeBlockFooter\n state=\"running\"\n message=\"Waiting for Shipfox runner event…\"\n description=\"This usually takes 30-60 seconds after you commit the workflow file.\"\n />\n </CodeBlock>\n </div>\n </ModalBody>\n <ModalFooter>\n <Button variant=\"primary\" onClick={() => setOpen(false)}>\n Got it\n </Button>\n </ModalFooter>\n </ModalContent>\n </Modal>\n </div>\n );\n },\n};\n\nexport const OpenedModal: Story = {\n play: async (ctx) => {\n const {canvasElement, step} = ctx;\n const canvas = within(canvasElement);\n const user = userEvent.setup();\n\n await step('Open the modal', async () => {\n const triggerButton = canvas.getByRole('button', {name: OPEN_MODAL_REGEX});\n await user.click(triggerButton);\n });\n\n await step('Wait for dialog to appear and render', async () => {\n await screen.findByRole('dialog');\n await new Promise((resolve) => setTimeout(resolve, 100));\n });\n\n await argosScreenshot(ctx, 'Opened Modal State');\n },\n render: () => {\n const [open, setOpen] = useState(false);\n\n return (\n <div className=\"flex h-[calc(100vh/2)] w-[calc(100vw/2)] items-center justify-center rounded-16 bg-background-subtle-base shadow-tooltip\">\n <Modal open={open} onOpenChange={setOpen}>\n <ModalTrigger asChild>\n <Button>Open Modal</Button>\n </ModalTrigger>\n <ModalContent aria-describedby={undefined}>\n <ModalTitle className=\"sr-only\">Modal Title</ModalTitle>\n <ModalHeader>\n <Text\n size=\"lg\"\n className=\"flex-1 overflow-ellipsis overflow-hidden whitespace-nowrap\"\n >\n Modal Title\n </Text>\n </ModalHeader>\n <ModalBody>\n <Text size=\"sm\" className=\"text-foreground-neutral-subtle w-full\">\n This modal automatically adapts between dialog (desktop) and drawer (mobile) based\n on screen size. Try resizing your browser window!\n </Text>\n </ModalBody>\n <ModalFooter>\n <Button variant=\"transparent\" onClick={() => setOpen(false)}>\n Cancel\n </Button>\n <Button variant=\"primary\" onClick={() => setOpen(false)}>\n Confirm\n </Button>\n </ModalFooter>\n </ModalContent>\n </Modal>\n </div>\n );\n },\n};\n"],"names":["argosScreenshot","screen","within","userEvent","Button","ButtonLink","CodeBlock","CodeBlockBody","CodeBlockContent","CodeBlockCopyButton","CodeBlockFilename","CodeBlockFiles","CodeBlockFooter","CodeBlockHeader","CodeBlockItem","DynamicItem","Icon","Input","ItemTitle","Label","MovingBorder","Text","useState","cn","illustration2","illustrationBg","Modal","ModalBody","ModalContent","ModalFooter","ModalHeader","ModalTitle","ModalTrigger","OPEN_MODAL_REGEX","IMPORT_JOBS_REGEX","GITHUB_ACTIONS_REGEX","meta","title","component","tags","parameters","layout","Default","play","ctx","canvasElement","step","canvas","user","setup","triggerButton","getByRole","name","click","findByRole","Promise","resolve","setTimeout","render","open","setOpen","div","className","onOpenChange","asChild","aria-describedby","undefined","size","variant","onClick","ImportForm","placeholder","diffCode","GithubActions","viewport","defaultViewport","img","src","alt","style","borderRadius","duration","rx","ry","span","color","description","rightElement","href","iconRight","data","language","filename","code","defaultValue","item","value","state","message","OpenedModal"],"mappings":";AAAA,SAAQA,eAAe,QAAO,6BAA6B;AAE3D,SAAQC,MAAM,EAAEC,MAAM,QAAO,yBAAyB;AACtD,OAAOC,eAAe,8BAA8B;AACpD,SAAQC,MAAM,EAAEC,UAAU,QAAO,oBAAoB;AACrD,SACEC,SAAS,EACTC,aAAa,EACbC,gBAAgB,EAChBC,mBAAmB,EACnBC,iBAAiB,EACjBC,cAAc,EACdC,eAAe,EACfC,eAAe,EACfC,aAAa,QACR,wBAAwB;AAC/B,SAAQC,WAAW,QAAO,0BAA0B;AACpD,SAAQC,IAAI,QAAO,kBAAkB;AACrC,SAAQC,KAAK,QAAO,mBAAmB;AACvC,SAAQC,SAAS,QAAO,kBAAkB;AAC1C,SAAQC,KAAK,QAAO,mBAAmB;AACvC,SAAQC,YAAY,QAAO,2BAA2B;AACtD,SAAQC,IAAI,QAAO,wBAAwB;AAC3C,SAAQC,QAAQ,QAAO,QAAQ;AAC/B,SAAQC,EAAE,QAAO,WAAW;AAC5B,OAAOC,mBAAmB,kCAAkC;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MT,QAAQ;kDAAQ;;kDAG7D,KAACxD;wCAAOgE,SAAQ;wCAAUC,SAAS,IAAMT,QAAQ;kDAAQ;;;;;;;;;IAQrE;AACF,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/moving-border/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/moving-border/index.ts"],"sourcesContent":["export * from './moving-border';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/typography/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAC,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAG1E,eAAO,MAAM,YAAY;;8EAavB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,GAC7E,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG;IAClC,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEJ,wBAAgB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/typography/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAC,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAG1E,eAAO,MAAM,YAAY;;8EAavB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,GAC7E,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG;IAClC,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEJ,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,EAAE,EACF,OAAc,EACd,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,SAAS,2CAeX"}
|
|
@@ -15,7 +15,7 @@ export const textVariants = cva('', {
|
|
|
15
15
|
size: 'md'
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
export function Text({ children, className, size, as, compact, bold, ...props }) {
|
|
18
|
+
export function Text({ children, className, size, as, compact = true, bold = false, ...props }) {
|
|
19
19
|
const Component = as ?? 'p';
|
|
20
20
|
return /*#__PURE__*/ _jsx(Component, {
|
|
21
21
|
className: cn(textVariants({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/typography/text.tsx"],"sourcesContent":["import {cva, type VariantProps} from 'class-variance-authority';\nimport type {ElementType, HTMLAttributes, PropsWithChildren} from 'react';\nimport {cn} from 'utils';\n\nexport const textVariants = cva('', {\n variants: {\n size: {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nexport type TextProps = PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> &\n VariantProps<typeof textVariants> & {\n as?: ElementType;\n compact?: boolean;\n bold?: boolean;\n };\n\nexport function Text({children
|
|
1
|
+
{"version":3,"sources":["../../../src/components/typography/text.tsx"],"sourcesContent":["import {cva, type VariantProps} from 'class-variance-authority';\nimport type {ElementType, HTMLAttributes, PropsWithChildren} from 'react';\nimport {cn} from 'utils';\n\nexport const textVariants = cva('', {\n variants: {\n size: {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nexport type TextProps = PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> &\n VariantProps<typeof textVariants> & {\n as?: ElementType;\n compact?: boolean;\n bold?: boolean;\n };\n\nexport function Text({\n children,\n className,\n size,\n as,\n compact = true,\n bold = false,\n ...props\n}: TextProps) {\n const Component = as ?? 'p';\n return (\n <Component\n className={cn(\n textVariants({size}),\n 'font-display',\n {'leading-20': compact, 'font-medium': bold},\n className,\n )}\n {...props}\n >\n {children}\n </Component>\n );\n}\n"],"names":["cva","cn","textVariants","variants","size","xs","sm","md","lg","xl","defaultVariants","Text","children","className","as","compact","bold","props","Component"],"mappings":";AAAA,SAAQA,GAAG,QAA0B,2BAA2B;AAEhE,SAAQC,EAAE,QAAO,QAAQ;AAEzB,OAAO,MAAMC,eAAeF,IAAI,IAAI;IAClCG,UAAU;QACRC,MAAM;YACJC,IAAI;YACJC,IAAI;YACJC,IAAI;YACJC,IAAI;YACJC,IAAI;QACN;IACF;IACAC,iBAAiB;QACfN,MAAM;IACR;AACF,GAAG;AASH,OAAO,SAASO,KAAK,EACnBC,QAAQ,EACRC,SAAS,EACTT,IAAI,EACJU,EAAE,EACFC,UAAU,IAAI,EACdC,OAAO,KAAK,EACZ,GAAGC,OACO;IACV,MAAMC,YAAYJ,MAAM;IACxB,qBACE,KAACI;QACCL,WAAWZ,GACTC,aAAa;YAACE;QAAI,IAClB,gBACA;YAAC,cAAcW;YAAS,eAAeC;QAAI,GAC3CH;QAED,GAAGI,KAAK;kBAERL;;AAGP"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC"}
|
package/dist/hooks/index.js
CHANGED
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/index.ts"],"sourcesContent":["export * from './useCopyToClipboard';\nexport * from './useResolvedTheme';\nexport * from './useShikiHighlight';\nexport * from './useShikiStyleInjection';\nexport * from './useTheme';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,2BAA2B;AACzC,cAAc,aAAa"}
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/index.ts"],"sourcesContent":["export * from './useCopyToClipboard';\nexport * from './useMediaQuery';\nexport * from './useResolvedTheme';\nexport * from './useShikiHighlight';\nexport * from './useShikiStyleInjection';\nexport * from './useTheme';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,kBAAkB;AAChC,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,2BAA2B;AACzC,cAAc,aAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../src/hooks/useMediaQuery.ts"],"names":[],"mappings":"AAsEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAgBpD"}
|