@shipfox/react-ui 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/dot-grid/dot-grid.js +8 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +3 -0
- package/dist/components/slider/slider.d.ts +10 -0
- package/dist/components/slider/slider.js +38 -0
- package/dist/components/table/data-table.js +7 -6
- package/dist/components/table/table.stories.data.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +17 -5
- package/dist/colors.stories.js +0 -61
- package/dist/components/alert/alert.stories.js +0 -227
- package/dist/components/avatar/avatar.stories.js +0 -267
- package/dist/components/badge/badge.stories.js +0 -802
- package/dist/components/button/button-link.stories.js +0 -127
- package/dist/components/button/button.stories.js +0 -187
- package/dist/components/button/icon-button.stories.js +0 -344
- package/dist/components/button-group/button-group.stories.js +0 -644
- package/dist/components/card/card.stories.js +0 -216
- package/dist/components/checkbox/checkbox.stories.js +0 -566
- package/dist/components/code-block/code-block.stories.js +0 -341
- package/dist/components/combobox/combobox.stories.js +0 -191
- package/dist/components/command/command.stories.js +0 -228
- package/dist/components/confetti/confetti.stories.js +0 -41
- package/dist/components/count-up/count-up.stories.js +0 -568
- package/dist/components/dashboard/components/charts/bar-chart.stories.js +0 -287
- package/dist/components/dashboard/components/charts/line-chart.stories.js +0 -257
- package/dist/components/dashboard/dashboard.stories.js +0 -23
- package/dist/components/date-picker/date-picker.stories.js +0 -349
- package/dist/components/dropdown-input/dropdown-input.stories.js +0 -240
- package/dist/components/dropdown-menu/dropdown-menu.stories.js +0 -462
- package/dist/components/dynamic-item/dynamic-item.stories.js +0 -385
- package/dist/components/empty-state/empty-state.stories.js +0 -74
- package/dist/components/form/form.stories.js +0 -587
- package/dist/components/icon/icon.stories.js +0 -38
- package/dist/components/inline-tips/inline-tips.stories.js +0 -219
- package/dist/components/input/input.stories.js +0 -265
- package/dist/components/interval-selector/interval-selector.stories.js +0 -232
- package/dist/components/item/item.stories.js +0 -239
- package/dist/components/kbd/kbd.stories.js +0 -119
- package/dist/components/label/label.stories.js +0 -105
- package/dist/components/modal/modal.stories.js +0 -566
- package/dist/components/search/search.stories.js +0 -630
- package/dist/components/select/select.stories.js +0 -393
- package/dist/components/sheet/sheet.stories.js +0 -368
- package/dist/components/skeleton/skeleton.stories.js +0 -345
- package/dist/components/table/table.stories.js +0 -302
- package/dist/components/tabs/tabs.stories.js +0 -179
- package/dist/components/textarea/textarea.stories.js +0 -339
- package/dist/components/toast/toast.stories.js +0 -326
- package/dist/components/tooltip/tooltip.stories.js +0 -560
- package/dist/components/typography/code.stories.js +0 -54
- package/dist/components/typography/header.stories.js +0 -34
- package/dist/components/typography/text.stories.js +0 -105
- package/dist/onboarding/sign-in.stories.js +0 -101
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CodeBlock, CodeBlockBody, CodeBlockContent, CodeBlockCopyButton, CodeBlockFilename, CodeBlockFiles, CodeBlockFooter, CodeBlockHeader, CodeBlockItem } from '../../components/code-block/index.js';
|
|
3
|
-
import { CodeTabs } from '../../components/code-block/code-tabs.js';
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/CodeBlock',
|
|
6
|
-
component: CodeBlock,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'padded'
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
const exampleCode = `jobs:
|
|
13
|
-
build:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v3
|
|
17
|
-
- name: Build
|
|
18
|
-
run: npm run build`;
|
|
19
|
-
const diffCode = `jobs:
|
|
20
|
-
build:
|
|
21
|
-
- runs-on: ubuntu-latest
|
|
22
|
-
+ runs-on: shipfox-2vcpu-ubuntu-2404`;
|
|
23
|
-
export const Default = {
|
|
24
|
-
args: {
|
|
25
|
-
data: [
|
|
26
|
-
{
|
|
27
|
-
language: 'yaml',
|
|
28
|
-
filename: '.github/workflows/<workflow-name>.yml',
|
|
29
|
-
code: exampleCode
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
defaultValue: 'yaml'
|
|
33
|
-
},
|
|
34
|
-
render: (args)=>/*#__PURE__*/ _jsxs(CodeBlock, {
|
|
35
|
-
...args,
|
|
36
|
-
children: [
|
|
37
|
-
/*#__PURE__*/ _jsxs(CodeBlockHeader, {
|
|
38
|
-
children: [
|
|
39
|
-
/*#__PURE__*/ _jsx(CodeBlockFiles, {
|
|
40
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockFilename, {
|
|
41
|
-
value: item.language,
|
|
42
|
-
children: item.filename
|
|
43
|
-
})
|
|
44
|
-
}),
|
|
45
|
-
/*#__PURE__*/ _jsx(CodeBlockCopyButton, {})
|
|
46
|
-
]
|
|
47
|
-
}),
|
|
48
|
-
/*#__PURE__*/ _jsx(CodeBlockBody, {
|
|
49
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockItem, {
|
|
50
|
-
value: item.language,
|
|
51
|
-
children: /*#__PURE__*/ _jsx(CodeBlockContent, {
|
|
52
|
-
language: item.language,
|
|
53
|
-
children: item.code
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
]
|
|
58
|
-
})
|
|
59
|
-
};
|
|
60
|
-
export const WithDiff = {
|
|
61
|
-
args: {
|
|
62
|
-
data: [
|
|
63
|
-
{
|
|
64
|
-
language: 'yaml',
|
|
65
|
-
filename: '.github/workflows/<workflow-name>.yml',
|
|
66
|
-
code: diffCode
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
defaultValue: 'yaml'
|
|
70
|
-
},
|
|
71
|
-
render: (args)=>/*#__PURE__*/ _jsxs(CodeBlock, {
|
|
72
|
-
...args,
|
|
73
|
-
children: [
|
|
74
|
-
/*#__PURE__*/ _jsxs(CodeBlockHeader, {
|
|
75
|
-
children: [
|
|
76
|
-
/*#__PURE__*/ _jsx(CodeBlockFiles, {
|
|
77
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockFilename, {
|
|
78
|
-
value: item.language,
|
|
79
|
-
children: item.filename
|
|
80
|
-
})
|
|
81
|
-
}),
|
|
82
|
-
/*#__PURE__*/ _jsx(CodeBlockCopyButton, {})
|
|
83
|
-
]
|
|
84
|
-
}),
|
|
85
|
-
/*#__PURE__*/ _jsx(CodeBlockBody, {
|
|
86
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockItem, {
|
|
87
|
-
value: item.language,
|
|
88
|
-
children: /*#__PURE__*/ _jsx(CodeBlockContent, {
|
|
89
|
-
language: item.language,
|
|
90
|
-
children: item.code
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
})
|
|
96
|
-
};
|
|
97
|
-
export const WithFooterRunning = {
|
|
98
|
-
args: {
|
|
99
|
-
data: [
|
|
100
|
-
{
|
|
101
|
-
language: 'yaml',
|
|
102
|
-
filename: '.github/workflows/<workflow-name>.yml',
|
|
103
|
-
code: diffCode
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
defaultValue: 'yaml'
|
|
107
|
-
},
|
|
108
|
-
render: (args)=>/*#__PURE__*/ _jsxs(CodeBlock, {
|
|
109
|
-
...args,
|
|
110
|
-
children: [
|
|
111
|
-
/*#__PURE__*/ _jsxs(CodeBlockHeader, {
|
|
112
|
-
children: [
|
|
113
|
-
/*#__PURE__*/ _jsx(CodeBlockFiles, {
|
|
114
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockFilename, {
|
|
115
|
-
value: item.language,
|
|
116
|
-
children: item.filename
|
|
117
|
-
})
|
|
118
|
-
}),
|
|
119
|
-
/*#__PURE__*/ _jsx(CodeBlockCopyButton, {})
|
|
120
|
-
]
|
|
121
|
-
}),
|
|
122
|
-
/*#__PURE__*/ _jsx(CodeBlockBody, {
|
|
123
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockItem, {
|
|
124
|
-
value: item.language,
|
|
125
|
-
children: /*#__PURE__*/ _jsx(CodeBlockContent, {
|
|
126
|
-
language: item.language,
|
|
127
|
-
children: item.code
|
|
128
|
-
})
|
|
129
|
-
})
|
|
130
|
-
}),
|
|
131
|
-
/*#__PURE__*/ _jsx(CodeBlockFooter, {
|
|
132
|
-
state: "running",
|
|
133
|
-
message: "Waiting for Shipfox runner event…",
|
|
134
|
-
description: "This usually takes 30-60 seconds after you commit the workflow file."
|
|
135
|
-
})
|
|
136
|
-
]
|
|
137
|
-
})
|
|
138
|
-
};
|
|
139
|
-
export const WithFooterDone = {
|
|
140
|
-
args: {
|
|
141
|
-
data: [
|
|
142
|
-
{
|
|
143
|
-
language: 'yaml',
|
|
144
|
-
filename: '.github/workflows/<workflow-name>.yml',
|
|
145
|
-
code: diffCode
|
|
146
|
-
}
|
|
147
|
-
],
|
|
148
|
-
defaultValue: 'yaml'
|
|
149
|
-
},
|
|
150
|
-
render: (args)=>/*#__PURE__*/ _jsxs(CodeBlock, {
|
|
151
|
-
...args,
|
|
152
|
-
children: [
|
|
153
|
-
/*#__PURE__*/ _jsxs(CodeBlockHeader, {
|
|
154
|
-
children: [
|
|
155
|
-
/*#__PURE__*/ _jsx(CodeBlockFiles, {
|
|
156
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockFilename, {
|
|
157
|
-
value: item.language,
|
|
158
|
-
children: item.filename
|
|
159
|
-
})
|
|
160
|
-
}),
|
|
161
|
-
/*#__PURE__*/ _jsx(CodeBlockCopyButton, {})
|
|
162
|
-
]
|
|
163
|
-
}),
|
|
164
|
-
/*#__PURE__*/ _jsx(CodeBlockBody, {
|
|
165
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockItem, {
|
|
166
|
-
value: item.language,
|
|
167
|
-
children: /*#__PURE__*/ _jsx(CodeBlockContent, {
|
|
168
|
-
language: item.language,
|
|
169
|
-
children: item.code
|
|
170
|
-
})
|
|
171
|
-
})
|
|
172
|
-
}),
|
|
173
|
-
/*#__PURE__*/ _jsx(CodeBlockFooter, {
|
|
174
|
-
state: "done",
|
|
175
|
-
message: "Runner connected!"
|
|
176
|
-
})
|
|
177
|
-
]
|
|
178
|
-
})
|
|
179
|
-
};
|
|
180
|
-
const multipleFilesCode = {
|
|
181
|
-
'src/utils/format.ts': `export function formatDate(date: Date): string {
|
|
182
|
-
return new Intl.DateTimeFormat('en-US', {
|
|
183
|
-
year: 'numeric',
|
|
184
|
-
month: 'long',
|
|
185
|
-
day: 'numeric',
|
|
186
|
-
}).format(date);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export function formatCurrency(amount: number): string {
|
|
190
|
-
return new Intl.NumberFormat('en-US', {
|
|
191
|
-
style: 'currency',
|
|
192
|
-
currency: 'USD',
|
|
193
|
-
}).format(amount);
|
|
194
|
-
}`,
|
|
195
|
-
'src/api/client.ts': `import type {User} from './types';
|
|
196
|
-
|
|
197
|
-
export class ApiClient {
|
|
198
|
-
private baseUrl: string;
|
|
199
|
-
|
|
200
|
-
constructor(baseUrl: string) {
|
|
201
|
-
this.baseUrl = baseUrl;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
async getUser(id: string): Promise<User> {
|
|
205
|
-
const response = await fetch(\`\${this.baseUrl}/users/\${id}\`);
|
|
206
|
-
if (!response.ok) {
|
|
207
|
-
throw new Error('Failed to fetch user');
|
|
208
|
-
}
|
|
209
|
-
return response.json();
|
|
210
|
-
}
|
|
211
|
-
}`,
|
|
212
|
-
'src/components/Button.tsx': `import type {ComponentProps} from 'react';
|
|
213
|
-
|
|
214
|
-
export function Button({
|
|
215
|
-
children,
|
|
216
|
-
variant = 'primary',
|
|
217
|
-
...props
|
|
218
|
-
}: ComponentProps<'button'> & {
|
|
219
|
-
variant?: 'primary' | 'secondary';
|
|
220
|
-
}) {
|
|
221
|
-
return (
|
|
222
|
-
<button
|
|
223
|
-
className={\`btn btn-\${variant}\`}
|
|
224
|
-
{...props}
|
|
225
|
-
>
|
|
226
|
-
{children}
|
|
227
|
-
</button>
|
|
228
|
-
);
|
|
229
|
-
}`
|
|
230
|
-
};
|
|
231
|
-
export const MultipleFiles = {
|
|
232
|
-
args: {
|
|
233
|
-
data: [],
|
|
234
|
-
defaultValue: ''
|
|
235
|
-
},
|
|
236
|
-
render: ()=>/*#__PURE__*/ _jsx(CodeTabs, {
|
|
237
|
-
codes: multipleFilesCode,
|
|
238
|
-
defaultValue: "src/api/client.ts",
|
|
239
|
-
syntaxHighlighting: true,
|
|
240
|
-
lang: "typescript",
|
|
241
|
-
lineNumbers: true
|
|
242
|
-
})
|
|
243
|
-
};
|
|
244
|
-
export const WithoutLineNumbers = {
|
|
245
|
-
args: {
|
|
246
|
-
data: [
|
|
247
|
-
{
|
|
248
|
-
language: 'yaml',
|
|
249
|
-
filename: '.github/workflows/<workflow-name>.yml',
|
|
250
|
-
code: exampleCode
|
|
251
|
-
}
|
|
252
|
-
],
|
|
253
|
-
defaultValue: 'yaml'
|
|
254
|
-
},
|
|
255
|
-
render: (args)=>/*#__PURE__*/ _jsxs(CodeBlock, {
|
|
256
|
-
...args,
|
|
257
|
-
children: [
|
|
258
|
-
/*#__PURE__*/ _jsxs(CodeBlockHeader, {
|
|
259
|
-
children: [
|
|
260
|
-
/*#__PURE__*/ _jsx(CodeBlockFiles, {
|
|
261
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockFilename, {
|
|
262
|
-
value: item.language,
|
|
263
|
-
children: item.filename
|
|
264
|
-
})
|
|
265
|
-
}),
|
|
266
|
-
/*#__PURE__*/ _jsx(CodeBlockCopyButton, {})
|
|
267
|
-
]
|
|
268
|
-
}),
|
|
269
|
-
/*#__PURE__*/ _jsx(CodeBlockBody, {
|
|
270
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockItem, {
|
|
271
|
-
value: item.language,
|
|
272
|
-
lineNumbers: false,
|
|
273
|
-
children: /*#__PURE__*/ _jsx(CodeBlockContent, {
|
|
274
|
-
language: item.language,
|
|
275
|
-
children: item.code
|
|
276
|
-
})
|
|
277
|
-
})
|
|
278
|
-
})
|
|
279
|
-
]
|
|
280
|
-
})
|
|
281
|
-
};
|
|
282
|
-
const npmCode = `npm install @shipfox/tooling`;
|
|
283
|
-
const yarnCode = `yarn add @shipfox/tooling`;
|
|
284
|
-
const pnpmCode = `pnpm add @shipfox/tooling`;
|
|
285
|
-
export const Snippet = {
|
|
286
|
-
args: {
|
|
287
|
-
data: [],
|
|
288
|
-
defaultValue: ''
|
|
289
|
-
},
|
|
290
|
-
render: ()=>/*#__PURE__*/ _jsx(CodeTabs, {
|
|
291
|
-
codes: {
|
|
292
|
-
npm: npmCode,
|
|
293
|
-
yarn: yarnCode,
|
|
294
|
-
pnpm: pnpmCode
|
|
295
|
-
},
|
|
296
|
-
defaultValue: "npm"
|
|
297
|
-
})
|
|
298
|
-
};
|
|
299
|
-
const syntaxHighlightingCode = {
|
|
300
|
-
'index.ts': `export function hello(name: string = 'World'): void {
|
|
301
|
-
// Say hello to the provided name
|
|
302
|
-
console.log(\`Hello, \${name}!\`);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export function greetEveryone(names: string[]): void {
|
|
306
|
-
for (const name of names) {
|
|
307
|
-
hello(name);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
export type Greeting = {
|
|
312
|
-
language: string;
|
|
313
|
-
message: string;
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
export const greetings: Greeting[] = [
|
|
317
|
-
{ language: 'en', message: 'Hello' },
|
|
318
|
-
{ language: 'fr', message: 'Bonjour' },
|
|
319
|
-
{ language: 'es', message: 'Hola' },
|
|
320
|
-
{ language: 'de', message: 'Hallo' },
|
|
321
|
-
];
|
|
322
|
-
|
|
323
|
-
export function printGreetings(): void {
|
|
324
|
-
for (const { language, message } of greetings) {
|
|
325
|
-
console.log(\`\${message}, \${language}!\`);
|
|
326
|
-
}
|
|
327
|
-
}`
|
|
328
|
-
};
|
|
329
|
-
export const SyntaxHighlighting = {
|
|
330
|
-
args: {
|
|
331
|
-
codes: syntaxHighlightingCode,
|
|
332
|
-
defaultValue: 'index.ts',
|
|
333
|
-
syntaxHighlighting: true,
|
|
334
|
-
lang: 'typescript'
|
|
335
|
-
},
|
|
336
|
-
render: (args)=>/*#__PURE__*/ _jsx(CodeTabs, {
|
|
337
|
-
...args
|
|
338
|
-
})
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
//# sourceMappingURL=code-block.stories.js.map
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Label } from '../../components/label/index.js';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { Combobox } from './combobox.js';
|
|
5
|
-
const sampleItems = [
|
|
6
|
-
{
|
|
7
|
-
value: 'apache',
|
|
8
|
-
label: 'apache'
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
value: 'apache-superset',
|
|
12
|
-
label: 'apache-superset'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
value: 'apaleo',
|
|
16
|
-
label: 'apaleo'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
value: 'apollo',
|
|
20
|
-
label: 'apollo'
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
value: 'apple',
|
|
24
|
-
label: 'apple'
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
value: 'apache-kafka',
|
|
28
|
-
label: 'apache-kafka'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
value: 'apex',
|
|
32
|
-
label: 'apex'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
value: 'appsmith',
|
|
36
|
-
label: 'appsmith'
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
value: 'applitools',
|
|
40
|
-
label: 'applitools'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: 'approzium',
|
|
44
|
-
label: 'approzium'
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
value: 'apify',
|
|
48
|
-
label: 'apify'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
value: 'apicurio',
|
|
52
|
-
label: 'apicurio'
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
value: 'apitable',
|
|
56
|
-
label: 'apitable'
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
value: 'apollographql',
|
|
60
|
-
label: 'apollographql'
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
value: 'aptos',
|
|
64
|
-
label: 'aptos'
|
|
65
|
-
}
|
|
66
|
-
];
|
|
67
|
-
const meta = {
|
|
68
|
-
title: 'Components/Combobox',
|
|
69
|
-
component: Combobox,
|
|
70
|
-
tags: [
|
|
71
|
-
'autodocs'
|
|
72
|
-
],
|
|
73
|
-
parameters: {
|
|
74
|
-
layout: 'centered'
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
export default meta;
|
|
78
|
-
export const Default = {
|
|
79
|
-
args: {},
|
|
80
|
-
render: ()=>{
|
|
81
|
-
const [value, setValue] = useState('');
|
|
82
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
83
|
-
className: "w-[80vw] md:w-500",
|
|
84
|
-
children: [
|
|
85
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
86
|
-
htmlFor: "combobox-default",
|
|
87
|
-
children: "Search repositories"
|
|
88
|
-
}),
|
|
89
|
-
/*#__PURE__*/ _jsx(Combobox, {
|
|
90
|
-
id: "combobox-default",
|
|
91
|
-
options: sampleItems,
|
|
92
|
-
value: value,
|
|
93
|
-
onValueChange: setValue,
|
|
94
|
-
placeholder: "Type to search...",
|
|
95
|
-
searchPlaceholder: "Search repositories...",
|
|
96
|
-
emptyState: "No repository found."
|
|
97
|
-
})
|
|
98
|
-
]
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
export const EmptyState = {
|
|
103
|
-
args: {},
|
|
104
|
-
render: ()=>{
|
|
105
|
-
const [value, setValue] = useState('abcxyz');
|
|
106
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
107
|
-
className: "w-[80vw] md:w-500",
|
|
108
|
-
children: [
|
|
109
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
110
|
-
htmlFor: "combobox-empty",
|
|
111
|
-
children: "No results"
|
|
112
|
-
}),
|
|
113
|
-
/*#__PURE__*/ _jsx(Combobox, {
|
|
114
|
-
id: "combobox-empty",
|
|
115
|
-
options: [],
|
|
116
|
-
value: value,
|
|
117
|
-
onValueChange: setValue,
|
|
118
|
-
placeholder: "Type to search...",
|
|
119
|
-
searchPlaceholder: "Search repositories...",
|
|
120
|
-
emptyState: /*#__PURE__*/ _jsxs("p", {
|
|
121
|
-
className: "px-4 whitespace-pre-wrap",
|
|
122
|
-
children: [
|
|
123
|
-
"Repository list is limited to 100.",
|
|
124
|
-
' ',
|
|
125
|
-
/*#__PURE__*/ _jsx("a", {
|
|
126
|
-
href: "https://support.example.com",
|
|
127
|
-
target: "_blank",
|
|
128
|
-
rel: "noopener noreferrer",
|
|
129
|
-
className: "underline text-foreground-neutral-base",
|
|
130
|
-
children: "Contact us"
|
|
131
|
-
}),
|
|
132
|
-
' ',
|
|
133
|
-
"for support."
|
|
134
|
-
]
|
|
135
|
-
})
|
|
136
|
-
})
|
|
137
|
-
]
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
export const LoadingState = {
|
|
142
|
-
args: {},
|
|
143
|
-
render: ()=>{
|
|
144
|
-
const [value, setValue] = useState('');
|
|
145
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
146
|
-
className: "w-[80vw] md:w-500",
|
|
147
|
-
children: [
|
|
148
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
149
|
-
htmlFor: "combobox-loading",
|
|
150
|
-
children: "Loading"
|
|
151
|
-
}),
|
|
152
|
-
/*#__PURE__*/ _jsx(Combobox, {
|
|
153
|
-
id: "combobox-loading",
|
|
154
|
-
options: sampleItems,
|
|
155
|
-
value: value,
|
|
156
|
-
onValueChange: setValue,
|
|
157
|
-
placeholder: "Type to search...",
|
|
158
|
-
searchPlaceholder: "Search repositories...",
|
|
159
|
-
isLoading: true
|
|
160
|
-
})
|
|
161
|
-
]
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
export const DisabledState = {
|
|
166
|
-
args: {},
|
|
167
|
-
render: ()=>{
|
|
168
|
-
const [value, setValue] = useState('apache');
|
|
169
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
170
|
-
className: "w-[80vw] md:w-500",
|
|
171
|
-
children: [
|
|
172
|
-
/*#__PURE__*/ _jsx(Label, {
|
|
173
|
-
htmlFor: "combobox-disabled",
|
|
174
|
-
children: "Disabled"
|
|
175
|
-
}),
|
|
176
|
-
/*#__PURE__*/ _jsx(Combobox, {
|
|
177
|
-
id: "combobox-disabled",
|
|
178
|
-
options: sampleItems,
|
|
179
|
-
value: value,
|
|
180
|
-
onValueChange: setValue,
|
|
181
|
-
disabled: true,
|
|
182
|
-
placeholder: "Disabled input",
|
|
183
|
-
searchPlaceholder: "Search repositories...",
|
|
184
|
-
emptyState: "No results found"
|
|
185
|
-
})
|
|
186
|
-
]
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
//# sourceMappingURL=combobox.stories.js.map
|