@red-hat-developer-hub/backstage-plugin-bui-test 0.5.0 → 0.5.2
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/CHANGELOG.md +17 -0
- package/dist/alpha.d.ts +2 -2
- package/dist/components/BUITestPage.esm.js +16 -2
- package/dist/components/BUITestPage.esm.js.map +1 -1
- package/dist/components/FormComponents.esm.js +4 -4
- package/dist/components/FormComponents.esm.js.map +1 -1
- package/dist/components/OtherExample.esm.js +840 -0
- package/dist/components/OtherExample.esm.js.map +1 -0
- package/dist/components/ThemeTokensInspector.esm.js +70 -0
- package/dist/components/ThemeTokensInspector.esm.js.map +1 -0
- package/dist/package.json.esm.js +9 -9
- package/package.json +9 -9
|
@@ -0,0 +1,840 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Flex, AccordionGroup, Accordion, AccordionTrigger, AccordionPanel, Text, Alert, Avatar, Badge, Box, ButtonIcon, ButtonLink, Card, CardHeader, CardBody, CardFooter, Button, CheckboxGroup, Checkbox, Combobox, DatePicker, DateRangePicker, DialogTrigger, Dialog, DialogHeader, DialogBody, DialogFooter, Grid, Link, List, ListRow, MenuTrigger, Menu, MenuItem, MenuSection, MenuSeparator, SubmenuTrigger, NumberField, PasswordField, Popover, RadioGroup, Radio, SearchAutocomplete, SearchAutocompleteItem, SearchField, Select, Skeleton, Slider, Switch, Tabs, TabList, Tab, TabPanel, TagGroup, Tag, TextField, ToggleButton, ToggleButtonGroup, TooltipTrigger, Tooltip, VisuallyHidden } from '@backstage/ui';
|
|
4
|
+
import CloudIcon from '@mui/icons-material/Cloud';
|
|
5
|
+
import StarIcon from '@mui/icons-material/Star';
|
|
6
|
+
import FavoriteIcon from '@mui/icons-material/Favorite';
|
|
7
|
+
import BugReportIcon from '@mui/icons-material/BugReport';
|
|
8
|
+
import AccountCircleIcon from '@mui/icons-material/AccountCircle';
|
|
9
|
+
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
10
|
+
import LockIcon from '@mui/icons-material/Lock';
|
|
11
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
12
|
+
import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile';
|
|
13
|
+
import FolderIcon from '@mui/icons-material/Folder';
|
|
14
|
+
import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
|
15
|
+
|
|
16
|
+
const Section = ({
|
|
17
|
+
title,
|
|
18
|
+
children
|
|
19
|
+
}) => /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "4", children: [
|
|
20
|
+
/* @__PURE__ */ jsx(Text, { as: "h2", variant: "title-medium", weight: "bold", children: title }),
|
|
21
|
+
/* @__PURE__ */ jsx(Box, { bg: "neutral", p: "4", children })
|
|
22
|
+
] });
|
|
23
|
+
const AccordionExample = () => /* @__PURE__ */ jsx(Section, { title: "Accordion", children: /* @__PURE__ */ jsxs(AccordionGroup, { allowsMultiple: true, children: [
|
|
24
|
+
/* @__PURE__ */ jsxs(Accordion, { defaultExpanded: true, children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
AccordionTrigger,
|
|
27
|
+
{
|
|
28
|
+
title: "First Panel",
|
|
29
|
+
subtitle: "This panel is open by default"
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ jsx(AccordionPanel, { children: /* @__PURE__ */ jsx(Text, { children: "Content of the first panel." }) })
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsxs(Accordion, { children: [
|
|
35
|
+
/* @__PURE__ */ jsx(AccordionTrigger, { title: "Second Panel" }),
|
|
36
|
+
/* @__PURE__ */ jsx(AccordionPanel, { children: /* @__PURE__ */ jsx(Text, { children: "Content of the second panel." }) })
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ jsxs(Accordion, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(AccordionTrigger, { title: "Third Panel" }),
|
|
40
|
+
/* @__PURE__ */ jsx(AccordionPanel, { children: /* @__PURE__ */ jsx(Text, { children: "Content of the third panel." }) })
|
|
41
|
+
] })
|
|
42
|
+
] }) });
|
|
43
|
+
const AlertExample = () => /* @__PURE__ */ jsx(Section, { title: "Alert", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "4", children: [
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
Alert,
|
|
46
|
+
{
|
|
47
|
+
status: "info",
|
|
48
|
+
icon: true,
|
|
49
|
+
title: "This is an informational alert.",
|
|
50
|
+
description: "Additional details about this alert."
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
Alert,
|
|
55
|
+
{
|
|
56
|
+
status: "success",
|
|
57
|
+
icon: true,
|
|
58
|
+
title: "Your changes have been saved successfully."
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
Alert,
|
|
63
|
+
{
|
|
64
|
+
status: "warning",
|
|
65
|
+
icon: true,
|
|
66
|
+
title: "This action may have unintended consequences."
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
Alert,
|
|
71
|
+
{
|
|
72
|
+
status: "danger",
|
|
73
|
+
icon: true,
|
|
74
|
+
title: "An error occurred while processing your request."
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx(Alert, { status: "info", icon: true, isPending: true, title: "Processing your request..." })
|
|
78
|
+
] }) });
|
|
79
|
+
const AvatarExample = () => /* @__PURE__ */ jsx(Section, { title: "Avatar", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", align: "center", children: [
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
Avatar,
|
|
82
|
+
{
|
|
83
|
+
size: "x-small",
|
|
84
|
+
src: "https://api.dicebear.com/6.x/open-peeps/svg?seed=Alice",
|
|
85
|
+
name: "Alice Johnson"
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
Avatar,
|
|
90
|
+
{
|
|
91
|
+
size: "small",
|
|
92
|
+
src: "https://api.dicebear.com/6.x/open-peeps/svg?seed=Bob",
|
|
93
|
+
name: "Bob Smith"
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
Avatar,
|
|
98
|
+
{
|
|
99
|
+
size: "medium",
|
|
100
|
+
src: "https://api.dicebear.com/6.x/open-peeps/svg?seed=Carol",
|
|
101
|
+
name: "Carol Williams"
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
Avatar,
|
|
106
|
+
{
|
|
107
|
+
size: "large",
|
|
108
|
+
src: "https://api.dicebear.com/6.x/open-peeps/svg?seed=Dave",
|
|
109
|
+
name: "Dave Brown"
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
Avatar,
|
|
114
|
+
{
|
|
115
|
+
size: "x-large",
|
|
116
|
+
src: "https://api.dicebear.com/6.x/open-peeps/svg?seed=Eve",
|
|
117
|
+
name: "Eve Martinez"
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsx(Avatar, { size: "medium", src: "", name: "Fallback Initials" })
|
|
121
|
+
] }) });
|
|
122
|
+
const BadgeExample = () => /* @__PURE__ */ jsx(Section, { title: "Badge", children: /* @__PURE__ */ jsxs(Flex, { gap: "2", align: "center", children: [
|
|
123
|
+
/* @__PURE__ */ jsx(Badge, { size: "small", children: "Small" }),
|
|
124
|
+
/* @__PURE__ */ jsx(Badge, { size: "medium", children: "Medium" }),
|
|
125
|
+
/* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BugReportIcon, { fontSize: "small" }), children: "With Icon" })
|
|
126
|
+
] }) });
|
|
127
|
+
const BoxExample = () => /* @__PURE__ */ jsx(Section, { title: "Box", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "4", children: [
|
|
128
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "neutral", children: /* @__PURE__ */ jsx(Text, { children: "bg=neutral" }) }),
|
|
129
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "danger", children: /* @__PURE__ */ jsx(Text, { children: "bg=danger" }) }),
|
|
130
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "warning", children: /* @__PURE__ */ jsx(Text, { children: "bg=warning" }) }),
|
|
131
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "success", children: /* @__PURE__ */ jsx(Text, { children: "bg=success" }) })
|
|
132
|
+
] }) });
|
|
133
|
+
const ButtonIconExample = () => /* @__PURE__ */ jsx(Section, { title: "ButtonIcon", children: /* @__PURE__ */ jsxs(Flex, { gap: "2", align: "center", children: [
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
ButtonIcon,
|
|
136
|
+
{
|
|
137
|
+
icon: /* @__PURE__ */ jsx(CloudIcon, { fontSize: "small" }),
|
|
138
|
+
variant: "primary",
|
|
139
|
+
"aria-label": "Cloud primary"
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
ButtonIcon,
|
|
144
|
+
{
|
|
145
|
+
icon: /* @__PURE__ */ jsx(CloudIcon, { fontSize: "small" }),
|
|
146
|
+
variant: "secondary",
|
|
147
|
+
"aria-label": "Cloud secondary"
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
ButtonIcon,
|
|
152
|
+
{
|
|
153
|
+
icon: /* @__PURE__ */ jsx(CloudIcon, { fontSize: "small" }),
|
|
154
|
+
variant: "tertiary",
|
|
155
|
+
"aria-label": "Cloud tertiary"
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ jsx(
|
|
159
|
+
ButtonIcon,
|
|
160
|
+
{
|
|
161
|
+
icon: /* @__PURE__ */ jsx(CloudIcon, { fontSize: "small" }),
|
|
162
|
+
variant: "primary",
|
|
163
|
+
size: "medium",
|
|
164
|
+
"aria-label": "Cloud medium"
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
ButtonIcon,
|
|
169
|
+
{
|
|
170
|
+
icon: /* @__PURE__ */ jsx(CloudIcon, { fontSize: "small" }),
|
|
171
|
+
variant: "primary",
|
|
172
|
+
isDisabled: true,
|
|
173
|
+
"aria-label": "Cloud disabled"
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
ButtonIcon,
|
|
178
|
+
{
|
|
179
|
+
icon: /* @__PURE__ */ jsx(CloudIcon, { fontSize: "small" }),
|
|
180
|
+
variant: "primary",
|
|
181
|
+
isPending: true,
|
|
182
|
+
"aria-label": "Cloud pending"
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] }) });
|
|
186
|
+
const ButtonLinkExample = () => /* @__PURE__ */ jsx(Section, { title: "ButtonLink", children: /* @__PURE__ */ jsxs(Flex, { gap: "2", align: "center", children: [
|
|
187
|
+
/* @__PURE__ */ jsx(ButtonLink, { href: "https://backstage.io", target: "_blank", children: "Visit Backstage" }),
|
|
188
|
+
/* @__PURE__ */ jsx(
|
|
189
|
+
ButtonLink,
|
|
190
|
+
{
|
|
191
|
+
href: "https://backstage.io",
|
|
192
|
+
target: "_blank",
|
|
193
|
+
variant: "secondary",
|
|
194
|
+
children: "Secondary Link"
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
] }) });
|
|
198
|
+
const CardExample = () => /* @__PURE__ */ jsx(Section, { title: "Card", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
199
|
+
/* @__PURE__ */ jsxs(Card, { style: { width: "250px" }, children: [
|
|
200
|
+
/* @__PURE__ */ jsx(CardHeader, { children: "Static Card" }),
|
|
201
|
+
/* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Text, { children: "Card body content goes here." }) }),
|
|
202
|
+
/* @__PURE__ */ jsx(CardFooter, { children: /* @__PURE__ */ jsx(Text, { variant: "body-small", color: "secondary", children: "Footer" }) })
|
|
203
|
+
] }),
|
|
204
|
+
/* @__PURE__ */ jsxs(
|
|
205
|
+
Card,
|
|
206
|
+
{
|
|
207
|
+
style: { width: "250px" },
|
|
208
|
+
onPress: () => {
|
|
209
|
+
},
|
|
210
|
+
label: "Interactive card",
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ jsx(CardHeader, { children: "Clickable Card" }),
|
|
213
|
+
/* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Text, { children: "Click anywhere on this card." }) }),
|
|
214
|
+
/* @__PURE__ */ jsx(CardFooter, { children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", onPress: () => {
|
|
215
|
+
}, children: "Action" }) })
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ jsxs(
|
|
220
|
+
Card,
|
|
221
|
+
{
|
|
222
|
+
style: { width: "250px" },
|
|
223
|
+
href: "https://backstage.io",
|
|
224
|
+
label: "Link card",
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ jsx(CardHeader, { children: "Link Card" }),
|
|
227
|
+
/* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Text, { children: "This card navigates to a URL." }) })
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
] }) });
|
|
232
|
+
const CheckboxGroupExample = () => /* @__PURE__ */ jsx(Section, { title: "CheckboxGroup", children: /* @__PURE__ */ jsxs(Flex, { gap: "6", children: [
|
|
233
|
+
/* @__PURE__ */ jsxs(CheckboxGroup, { label: "Notifications", defaultValue: ["github"], children: [
|
|
234
|
+
/* @__PURE__ */ jsx(Checkbox, { value: "github", children: "GitHub" }),
|
|
235
|
+
/* @__PURE__ */ jsx(Checkbox, { value: "slack", children: "Slack" }),
|
|
236
|
+
/* @__PURE__ */ jsx(Checkbox, { value: "email", children: "Email" })
|
|
237
|
+
] }),
|
|
238
|
+
/* @__PURE__ */ jsxs(
|
|
239
|
+
CheckboxGroup,
|
|
240
|
+
{
|
|
241
|
+
label: "Horizontal",
|
|
242
|
+
orientation: "horizontal",
|
|
243
|
+
defaultValue: ["a"],
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ jsx(Checkbox, { value: "a", children: "Option A" }),
|
|
246
|
+
/* @__PURE__ */ jsx(Checkbox, { value: "b", children: "Option B" }),
|
|
247
|
+
/* @__PURE__ */ jsx(Checkbox, { value: "c", children: "Option C" })
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ jsxs(CheckboxGroup, { label: "Disabled", isDisabled: true, defaultValue: ["a"], children: [
|
|
252
|
+
/* @__PURE__ */ jsx(Checkbox, { value: "a", children: "Option A" }),
|
|
253
|
+
/* @__PURE__ */ jsx(Checkbox, { value: "b", children: "Option B" })
|
|
254
|
+
] })
|
|
255
|
+
] }) });
|
|
256
|
+
const ComboboxExample = () => /* @__PURE__ */ jsx(Section, { title: "Combobox", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
257
|
+
/* @__PURE__ */ jsx(
|
|
258
|
+
Combobox,
|
|
259
|
+
{
|
|
260
|
+
name: "font",
|
|
261
|
+
label: "Font Family",
|
|
262
|
+
description: "Choose a font family",
|
|
263
|
+
options: [
|
|
264
|
+
{ id: "sans", label: "Sans-serif" },
|
|
265
|
+
{ id: "serif", label: "Serif" },
|
|
266
|
+
{ id: "mono", label: "Monospace" },
|
|
267
|
+
{ id: "cursive", label: "Cursive" }
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
/* @__PURE__ */ jsx(
|
|
272
|
+
Combobox,
|
|
273
|
+
{
|
|
274
|
+
name: "font-disabled",
|
|
275
|
+
label: "Disabled",
|
|
276
|
+
isDisabled: true,
|
|
277
|
+
options: [{ id: "sans", label: "Sans-serif" }]
|
|
278
|
+
}
|
|
279
|
+
),
|
|
280
|
+
/* @__PURE__ */ jsx(
|
|
281
|
+
Combobox,
|
|
282
|
+
{
|
|
283
|
+
name: "font-sections",
|
|
284
|
+
label: "With Sections",
|
|
285
|
+
options: [
|
|
286
|
+
{
|
|
287
|
+
title: "Serif Fonts",
|
|
288
|
+
options: [
|
|
289
|
+
{ id: "times", label: "Times New Roman" },
|
|
290
|
+
{ id: "georgia", label: "Georgia" }
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
title: "Sans-Serif Fonts",
|
|
295
|
+
options: [
|
|
296
|
+
{ id: "arial", label: "Arial" },
|
|
297
|
+
{ id: "helvetica", label: "Helvetica" }
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
] }) });
|
|
304
|
+
const DatePickerExample = () => /* @__PURE__ */ jsx(Section, { title: "DatePicker & DateRangePicker", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", direction: "column", children: [
|
|
305
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
306
|
+
/* @__PURE__ */ jsx(DatePicker, { label: "Small date", size: "small" }),
|
|
307
|
+
/* @__PURE__ */ jsx(DatePicker, { label: "Medium date", size: "medium" }),
|
|
308
|
+
/* @__PURE__ */ jsx(DatePicker, { label: "Disabled", isDisabled: true })
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
311
|
+
/* @__PURE__ */ jsx(DateRangePicker, { label: "Small range", size: "small" }),
|
|
312
|
+
/* @__PURE__ */ jsx(DateRangePicker, { label: "Medium range", size: "medium" }),
|
|
313
|
+
/* @__PURE__ */ jsx(DateRangePicker, { label: "Disabled", isDisabled: true })
|
|
314
|
+
] })
|
|
315
|
+
] }) });
|
|
316
|
+
const DialogExample = () => /* @__PURE__ */ jsx(Section, { title: "Dialog", children: /* @__PURE__ */ jsxs(DialogTrigger, { children: [
|
|
317
|
+
/* @__PURE__ */ jsx(Button, { children: "Open Dialog" }),
|
|
318
|
+
/* @__PURE__ */ jsxs(Dialog, { children: [
|
|
319
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: "Example Dialog" }),
|
|
320
|
+
/* @__PURE__ */ jsx(DialogBody, { children: /* @__PURE__ */ jsx(Text, { children: "This is the dialog body content." }) }),
|
|
321
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
322
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", slot: "close", children: "Cancel" }),
|
|
323
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", slot: "close", children: "Confirm" })
|
|
324
|
+
] })
|
|
325
|
+
] })
|
|
326
|
+
] }) });
|
|
327
|
+
const GridExample = () => /* @__PURE__ */ jsx(Section, { title: "Grid", children: /* @__PURE__ */ jsxs(Grid.Root, { columns: "4", gap: "4", children: [
|
|
328
|
+
/* @__PURE__ */ jsx(Grid.Item, { colSpan: "2", children: /* @__PURE__ */ jsx(Box, { p: "4", bg: "neutral", children: /* @__PURE__ */ jsx(Text, { children: "Spans 2 columns" }) }) }),
|
|
329
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "neutral", children: /* @__PURE__ */ jsx(Text, { children: "1 col" }) }),
|
|
330
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "neutral", children: /* @__PURE__ */ jsx(Text, { children: "1 col" }) }),
|
|
331
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "neutral", children: /* @__PURE__ */ jsx(Text, { children: "1 col" }) }),
|
|
332
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "neutral", children: /* @__PURE__ */ jsx(Text, { children: "1 col" }) }),
|
|
333
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "neutral", children: /* @__PURE__ */ jsx(Text, { children: "1 col" }) }),
|
|
334
|
+
/* @__PURE__ */ jsx(Box, { p: "4", bg: "neutral", children: /* @__PURE__ */ jsx(Text, { children: "1 col" }) })
|
|
335
|
+
] }) });
|
|
336
|
+
const LinkExample = () => /* @__PURE__ */ jsx(Section, { title: "Link", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", align: "center", children: [
|
|
337
|
+
/* @__PURE__ */ jsx(Link, { href: "#", children: "Default link" }),
|
|
338
|
+
/* @__PURE__ */ jsx(Link, { href: "#", weight: "bold", children: "Bold link" }),
|
|
339
|
+
/* @__PURE__ */ jsx(Link, { href: "#", standalone: true, children: "Standalone link" }),
|
|
340
|
+
/* @__PURE__ */ jsx(Link, { href: "#", color: "secondary", children: "Secondary" }),
|
|
341
|
+
/* @__PURE__ */ jsx(Link, { href: "#", color: "danger", children: "Danger" }),
|
|
342
|
+
/* @__PURE__ */ jsx(Link, { href: "#", color: "success", children: "Success" })
|
|
343
|
+
] }) });
|
|
344
|
+
const ListExample = () => {
|
|
345
|
+
const items = [
|
|
346
|
+
{
|
|
347
|
+
id: "react",
|
|
348
|
+
label: "React",
|
|
349
|
+
description: "A JavaScript library for building user interfaces",
|
|
350
|
+
icon: /* @__PURE__ */ jsx(StarIcon, { fontSize: "small" })
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
id: "typescript",
|
|
354
|
+
label: "TypeScript",
|
|
355
|
+
description: "Typed superset of JavaScript",
|
|
356
|
+
icon: /* @__PURE__ */ jsx(CloudIcon, { fontSize: "small" })
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: "backstage",
|
|
360
|
+
label: "Backstage",
|
|
361
|
+
description: "An open platform for building developer portals",
|
|
362
|
+
icon: /* @__PURE__ */ jsx(FavoriteIcon, { fontSize: "small" })
|
|
363
|
+
}
|
|
364
|
+
];
|
|
365
|
+
return /* @__PURE__ */ jsx(Section, { title: "List", children: /* @__PURE__ */ jsx(List, { "aria-label": "Technologies", items, children: (item) => /* @__PURE__ */ jsx(ListRow, { id: item.id, icon: item.icon, description: item.description, children: item.label }) }) });
|
|
366
|
+
};
|
|
367
|
+
const MenuExample = () => /* @__PURE__ */ jsx(Section, { title: "Menu", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
368
|
+
/* @__PURE__ */ jsxs(MenuTrigger, { children: [
|
|
369
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Simple Menu" }),
|
|
370
|
+
/* @__PURE__ */ jsxs(Menu, { children: [
|
|
371
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "New File" }),
|
|
372
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Open" }),
|
|
373
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Save" })
|
|
374
|
+
] })
|
|
375
|
+
] }),
|
|
376
|
+
/* @__PURE__ */ jsxs(MenuTrigger, { children: [
|
|
377
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", children: "With Sections" }),
|
|
378
|
+
/* @__PURE__ */ jsxs(Menu, { children: [
|
|
379
|
+
/* @__PURE__ */ jsxs(MenuSection, { title: "File", children: [
|
|
380
|
+
/* @__PURE__ */ jsx(MenuItem, { iconStart: /* @__PURE__ */ jsx(InsertDriveFileIcon, { fontSize: "small" }), children: "New" }),
|
|
381
|
+
/* @__PURE__ */ jsx(MenuItem, { iconStart: /* @__PURE__ */ jsx(FolderIcon, { fontSize: "small" }), children: "Open" })
|
|
382
|
+
] }),
|
|
383
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
384
|
+
/* @__PURE__ */ jsxs(MenuSection, { title: "Edit", children: [
|
|
385
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Cut" }),
|
|
386
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Copy" }),
|
|
387
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Paste" })
|
|
388
|
+
] })
|
|
389
|
+
] })
|
|
390
|
+
] }),
|
|
391
|
+
/* @__PURE__ */ jsxs(MenuTrigger, { children: [
|
|
392
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", children: "With Submenu" }),
|
|
393
|
+
/* @__PURE__ */ jsxs(Menu, { children: [
|
|
394
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "New File" }),
|
|
395
|
+
/* @__PURE__ */ jsxs(SubmenuTrigger, { children: [
|
|
396
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Open Recent" }),
|
|
397
|
+
/* @__PURE__ */ jsxs(Menu, { placement: "right top", children: [
|
|
398
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "File 1.txt" }),
|
|
399
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "File 2.txt" }),
|
|
400
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "File 3.txt" })
|
|
401
|
+
] })
|
|
402
|
+
] }),
|
|
403
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Save" })
|
|
404
|
+
] })
|
|
405
|
+
] }),
|
|
406
|
+
/* @__PURE__ */ jsxs(MenuTrigger, { children: [
|
|
407
|
+
/* @__PURE__ */ jsx(
|
|
408
|
+
ButtonIcon,
|
|
409
|
+
{
|
|
410
|
+
icon: /* @__PURE__ */ jsx(MoreVertIcon, { fontSize: "small" }),
|
|
411
|
+
variant: "tertiary",
|
|
412
|
+
"aria-label": "More actions"
|
|
413
|
+
}
|
|
414
|
+
),
|
|
415
|
+
/* @__PURE__ */ jsxs(Menu, { children: [
|
|
416
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Settings" }),
|
|
417
|
+
/* @__PURE__ */ jsx(MenuItem, { color: "danger", children: "Delete" })
|
|
418
|
+
] })
|
|
419
|
+
] })
|
|
420
|
+
] }) });
|
|
421
|
+
const NumberFieldExample = () => /* @__PURE__ */ jsxs(Section, { title: "NumberField", children: [
|
|
422
|
+
/* @__PURE__ */ jsx(
|
|
423
|
+
NumberField,
|
|
424
|
+
{
|
|
425
|
+
label: "Quantity",
|
|
426
|
+
size: "small",
|
|
427
|
+
placeholder: "Enter a number",
|
|
428
|
+
minValue: 0,
|
|
429
|
+
maxValue: 100,
|
|
430
|
+
step: 1
|
|
431
|
+
}
|
|
432
|
+
),
|
|
433
|
+
/* @__PURE__ */ jsx(
|
|
434
|
+
NumberField,
|
|
435
|
+
{
|
|
436
|
+
label: "With Icon",
|
|
437
|
+
size: "medium",
|
|
438
|
+
icon: /* @__PURE__ */ jsx(AccessTimeIcon, { fontSize: "small" }),
|
|
439
|
+
placeholder: "Minutes",
|
|
440
|
+
minValue: 0,
|
|
441
|
+
maxValue: 59
|
|
442
|
+
}
|
|
443
|
+
),
|
|
444
|
+
/* @__PURE__ */ jsx(NumberField, { label: "Disabled", isDisabled: true, defaultValue: 5 })
|
|
445
|
+
] });
|
|
446
|
+
const PasswordFieldExample = () => /* @__PURE__ */ jsx(Section, { title: "PasswordField", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
447
|
+
/* @__PURE__ */ jsx(PasswordField, { label: "Password", size: "small", name: "password-small" }),
|
|
448
|
+
/* @__PURE__ */ jsx(
|
|
449
|
+
PasswordField,
|
|
450
|
+
{
|
|
451
|
+
label: "With Icon",
|
|
452
|
+
size: "medium",
|
|
453
|
+
name: "password-medium",
|
|
454
|
+
icon: /* @__PURE__ */ jsx(LockIcon, { fontSize: "small" }),
|
|
455
|
+
description: "Must be at least 8 characters"
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ jsx(PasswordField, { label: "Disabled", name: "password-disabled", isDisabled: true })
|
|
459
|
+
] }) });
|
|
460
|
+
const PopoverExample = () => /* @__PURE__ */ jsx(Section, { title: "Popover", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
461
|
+
/* @__PURE__ */ jsxs(DialogTrigger, { children: [
|
|
462
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", children: "Toggle popover" }),
|
|
463
|
+
/* @__PURE__ */ jsx(Popover, { placement: "top", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "3", children: [
|
|
464
|
+
/* @__PURE__ */ jsx(Flex, { justify: "between", align: "center", gap: "4", children: /* @__PURE__ */ jsx(Text, { weight: "bold", children: "Popover header" }) }),
|
|
465
|
+
/* @__PURE__ */ jsx(Text, { children: "Popovers are triggered by click rather than hover." }),
|
|
466
|
+
/* @__PURE__ */ jsx(Text, { children: "Popover footer" })
|
|
467
|
+
] }) })
|
|
468
|
+
] }),
|
|
469
|
+
/* @__PURE__ */ jsxs(DialogTrigger, { children: [
|
|
470
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", children: "Bottom Placement" }),
|
|
471
|
+
/* @__PURE__ */ jsx(Popover, { placement: "bottom", children: /* @__PURE__ */ jsx(Text, { children: "Bottom popover." }) })
|
|
472
|
+
] })
|
|
473
|
+
] }) });
|
|
474
|
+
const RadioGroupExample = () => /* @__PURE__ */ jsx(Section, { title: "RadioGroup", children: /* @__PURE__ */ jsxs(Flex, { gap: "6", children: [
|
|
475
|
+
/* @__PURE__ */ jsxs(RadioGroup, { label: "Favorite pokemon", children: [
|
|
476
|
+
/* @__PURE__ */ jsx(Radio, { value: "bulbasaur", children: "Bulbasaur" }),
|
|
477
|
+
/* @__PURE__ */ jsx(Radio, { value: "charmander", children: "Charmander" }),
|
|
478
|
+
/* @__PURE__ */ jsx(Radio, { value: "squirtle", children: "Squirtle" })
|
|
479
|
+
] }),
|
|
480
|
+
/* @__PURE__ */ jsxs(
|
|
481
|
+
RadioGroup,
|
|
482
|
+
{
|
|
483
|
+
label: "Horizontal layout",
|
|
484
|
+
orientation: "horizontal",
|
|
485
|
+
defaultValue: "react",
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ jsx(Radio, { value: "react", children: "React" }),
|
|
488
|
+
/* @__PURE__ */ jsx(Radio, { value: "vue", children: "Vue" }),
|
|
489
|
+
/* @__PURE__ */ jsx(Radio, { value: "angular", children: "Angular" })
|
|
490
|
+
]
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
/* @__PURE__ */ jsxs(RadioGroup, { label: "Disabled", isDisabled: true, defaultValue: "a", children: [
|
|
494
|
+
/* @__PURE__ */ jsx(Radio, { value: "a", children: "Option A" }),
|
|
495
|
+
/* @__PURE__ */ jsx(Radio, { value: "b", children: "Option B" })
|
|
496
|
+
] })
|
|
497
|
+
] }) });
|
|
498
|
+
const SearchAutocompleteExample = () => {
|
|
499
|
+
const [inputValue, setInputValue] = useState("");
|
|
500
|
+
const fruits = [
|
|
501
|
+
{ id: "apple", name: "Apple", description: "A round fruit" },
|
|
502
|
+
{ id: "banana", name: "Banana", description: "A yellow curved fruit" },
|
|
503
|
+
{ id: "cherry", name: "Cherry", description: "A small red stone fruit" },
|
|
504
|
+
{ id: "grape", name: "Grape", description: "A small round fruit" },
|
|
505
|
+
{ id: "orange", name: "Orange", description: "A citrus fruit" }
|
|
506
|
+
];
|
|
507
|
+
const filtered = fruits.filter(
|
|
508
|
+
(f) => f.name.toLowerCase().includes(inputValue.toLowerCase())
|
|
509
|
+
);
|
|
510
|
+
return /* @__PURE__ */ jsx(Section, { title: "SearchAutocomplete", children: /* @__PURE__ */ jsx(
|
|
511
|
+
SearchAutocomplete,
|
|
512
|
+
{
|
|
513
|
+
placeholder: "Search fruits...",
|
|
514
|
+
inputValue,
|
|
515
|
+
onInputChange: setInputValue,
|
|
516
|
+
"aria-label": "Search fruits",
|
|
517
|
+
children: filtered.map((fruit) => /* @__PURE__ */ jsx(
|
|
518
|
+
SearchAutocompleteItem,
|
|
519
|
+
{
|
|
520
|
+
id: fruit.id,
|
|
521
|
+
textValue: fruit.name,
|
|
522
|
+
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
523
|
+
/* @__PURE__ */ jsx(Text, { weight: "bold", children: fruit.name }),
|
|
524
|
+
/* @__PURE__ */ jsx(Text, { variant: "body-small", color: "secondary", children: fruit.description })
|
|
525
|
+
] })
|
|
526
|
+
},
|
|
527
|
+
fruit.id
|
|
528
|
+
))
|
|
529
|
+
}
|
|
530
|
+
) });
|
|
531
|
+
};
|
|
532
|
+
const SearchFieldExample = () => /* @__PURE__ */ jsx(Section, { title: "SearchField", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", align: "end", children: [
|
|
533
|
+
/* @__PURE__ */ jsx(SearchField, { "aria-label": "Search", size: "small" }),
|
|
534
|
+
/* @__PURE__ */ jsx(SearchField, { "aria-label": "Search", size: "medium" }),
|
|
535
|
+
/* @__PURE__ */ jsx(SearchField, { label: "With Label", description: "Enter a search term" }),
|
|
536
|
+
/* @__PURE__ */ jsx(SearchField, { "aria-label": "Collapsible", size: "small", startCollapsed: true }),
|
|
537
|
+
/* @__PURE__ */ jsx(SearchField, { "aria-label": "Disabled", isDisabled: true })
|
|
538
|
+
] }) });
|
|
539
|
+
const SelectExample = () => /* @__PURE__ */ jsx(Section, { title: "Select", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
540
|
+
/* @__PURE__ */ jsx(
|
|
541
|
+
Select,
|
|
542
|
+
{
|
|
543
|
+
name: "language",
|
|
544
|
+
label: "Language",
|
|
545
|
+
options: [
|
|
546
|
+
{ id: "en", label: "English" },
|
|
547
|
+
{ id: "fr", label: "French" },
|
|
548
|
+
{ id: "de", label: "German" },
|
|
549
|
+
{ id: "es", label: "Spanish" }
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
),
|
|
553
|
+
/* @__PURE__ */ jsx(
|
|
554
|
+
Select,
|
|
555
|
+
{
|
|
556
|
+
name: "skills",
|
|
557
|
+
label: "Multi-select",
|
|
558
|
+
selectionMode: "multiple",
|
|
559
|
+
options: [
|
|
560
|
+
{ id: "react", label: "React" },
|
|
561
|
+
{ id: "typescript", label: "TypeScript" },
|
|
562
|
+
{ id: "python", label: "Python" },
|
|
563
|
+
{ id: "go", label: "Go" }
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
),
|
|
567
|
+
/* @__PURE__ */ jsx(
|
|
568
|
+
Select,
|
|
569
|
+
{
|
|
570
|
+
name: "disabled",
|
|
571
|
+
label: "Disabled",
|
|
572
|
+
isDisabled: true,
|
|
573
|
+
options: [{ id: "a", label: "Option A" }]
|
|
574
|
+
}
|
|
575
|
+
),
|
|
576
|
+
/* @__PURE__ */ jsx(
|
|
577
|
+
Select,
|
|
578
|
+
{
|
|
579
|
+
name: "grouped",
|
|
580
|
+
label: "With Sections",
|
|
581
|
+
options: [
|
|
582
|
+
{
|
|
583
|
+
title: "Frontend",
|
|
584
|
+
options: [
|
|
585
|
+
{ id: "react", label: "React" },
|
|
586
|
+
{ id: "vue", label: "Vue" }
|
|
587
|
+
]
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
title: "Backend",
|
|
591
|
+
options: [
|
|
592
|
+
{ id: "node", label: "Node.js" },
|
|
593
|
+
{ id: "python", label: "Python" }
|
|
594
|
+
]
|
|
595
|
+
}
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
)
|
|
599
|
+
] }) });
|
|
600
|
+
const SkeletonExample = () => /* @__PURE__ */ jsx(Section, { title: "Skeleton", children: /* @__PURE__ */ jsx(Box, { bg: "neutral", p: "4", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", align: "center", children: [
|
|
601
|
+
/* @__PURE__ */ jsx(Skeleton, { rounded: true, width: 48, height: 48 }),
|
|
602
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "2", children: [
|
|
603
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 200, height: 8 }),
|
|
604
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 160, height: 8 }),
|
|
605
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 120, height: 8 })
|
|
606
|
+
] })
|
|
607
|
+
] }) }) });
|
|
608
|
+
const SliderExample = () => /* @__PURE__ */ jsx(Section, { title: "Slider", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "4", children: [
|
|
609
|
+
/* @__PURE__ */ jsx(Slider, { label: "Volume", defaultValue: 50 }),
|
|
610
|
+
/* @__PURE__ */ jsx(
|
|
611
|
+
Slider,
|
|
612
|
+
{
|
|
613
|
+
label: "Price Range",
|
|
614
|
+
minValue: 0,
|
|
615
|
+
maxValue: 1e3,
|
|
616
|
+
defaultValue: [200, 800],
|
|
617
|
+
formatOptions: { style: "currency", currency: "USD" }
|
|
618
|
+
}
|
|
619
|
+
),
|
|
620
|
+
/* @__PURE__ */ jsx(
|
|
621
|
+
Slider,
|
|
622
|
+
{
|
|
623
|
+
label: "Temperature (\xB0C)",
|
|
624
|
+
minValue: -10,
|
|
625
|
+
maxValue: 40,
|
|
626
|
+
step: 5,
|
|
627
|
+
defaultValue: 20
|
|
628
|
+
}
|
|
629
|
+
),
|
|
630
|
+
/* @__PURE__ */ jsx(Slider, { label: "Disabled", isDisabled: true, defaultValue: 30 })
|
|
631
|
+
] }) });
|
|
632
|
+
const SwitchExample = () => /* @__PURE__ */ jsx(Section, { title: "Switch", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", align: "center", children: [
|
|
633
|
+
/* @__PURE__ */ jsx(Switch, { label: "Default" }),
|
|
634
|
+
/* @__PURE__ */ jsx(Switch, { label: "Selected", defaultSelected: true }),
|
|
635
|
+
/* @__PURE__ */ jsx(Switch, { label: "Disabled", isDisabled: true }),
|
|
636
|
+
/* @__PURE__ */ jsx(Switch, { label: "Disabled Selected", isDisabled: true, isSelected: true }),
|
|
637
|
+
/* @__PURE__ */ jsx(Switch, { label: "Read Only", isSelected: true, isReadOnly: true })
|
|
638
|
+
] }) });
|
|
639
|
+
const TabsExample = () => /* @__PURE__ */ jsx(Section, { title: "Tabs", children: /* @__PURE__ */ jsx(Flex, { direction: "column", gap: "6", children: /* @__PURE__ */ jsxs(Tabs, { defaultSelectedKey: "overview", children: [
|
|
640
|
+
/* @__PURE__ */ jsxs(TabList, { children: [
|
|
641
|
+
/* @__PURE__ */ jsx(Tab, { id: "overview", children: "Overview" }),
|
|
642
|
+
/* @__PURE__ */ jsx(Tab, { id: "details", children: "Details" }),
|
|
643
|
+
/* @__PURE__ */ jsx(Tab, { id: "activity", children: "Activity" }),
|
|
644
|
+
/* @__PURE__ */ jsx(Tab, { id: "disabled", isDisabled: true, children: "Disabled" })
|
|
645
|
+
] }),
|
|
646
|
+
/* @__PURE__ */ jsx(TabPanel, { id: "overview", children: /* @__PURE__ */ jsx(Text, { children: "Overview content goes here." }) }),
|
|
647
|
+
/* @__PURE__ */ jsx(TabPanel, { id: "details", children: /* @__PURE__ */ jsx(Text, { children: "Details content goes here." }) }),
|
|
648
|
+
/* @__PURE__ */ jsx(TabPanel, { id: "activity", children: /* @__PURE__ */ jsx(Text, { children: "Activity content goes here." }) }),
|
|
649
|
+
/* @__PURE__ */ jsx(TabPanel, { id: "disabled", children: /* @__PURE__ */ jsx(Text, { children: "Disabled content." }) })
|
|
650
|
+
] }) }) });
|
|
651
|
+
const TagGroupExample = () => /* @__PURE__ */ jsx(Section, { title: "TagGroup", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "4", children: [
|
|
652
|
+
/* @__PURE__ */ jsxs(TagGroup, { children: [
|
|
653
|
+
/* @__PURE__ */ jsx(Tag, { children: "Banana" }),
|
|
654
|
+
/* @__PURE__ */ jsx(Tag, { children: "Apple" }),
|
|
655
|
+
/* @__PURE__ */ jsx(Tag, { children: "Orange" })
|
|
656
|
+
] }),
|
|
657
|
+
/* @__PURE__ */ jsxs(TagGroup, { children: [
|
|
658
|
+
/* @__PURE__ */ jsx(Tag, { href: "#", size: "small", children: "Small Link" }),
|
|
659
|
+
/* @__PURE__ */ jsx(Tag, { href: "#", size: "medium", children: "Medium Link" })
|
|
660
|
+
] }),
|
|
661
|
+
/* @__PURE__ */ jsxs(TagGroup, { children: [
|
|
662
|
+
/* @__PURE__ */ jsx(Tag, { icon: /* @__PURE__ */ jsx(BugReportIcon, { fontSize: "small" }), children: "Bug" }),
|
|
663
|
+
/* @__PURE__ */ jsx(Tag, { icon: /* @__PURE__ */ jsx(AccountCircleIcon, { fontSize: "small" }), children: "User" }),
|
|
664
|
+
/* @__PURE__ */ jsx(Tag, { icon: /* @__PURE__ */ jsx(VisibilityIcon, { fontSize: "small" }), children: "Visible" }),
|
|
665
|
+
/* @__PURE__ */ jsx(Tag, { icon: /* @__PURE__ */ jsx(FavoriteIcon, { fontSize: "small" }), children: "Favorite" })
|
|
666
|
+
] }),
|
|
667
|
+
/* @__PURE__ */ jsxs(TagGroup, { children: [
|
|
668
|
+
/* @__PURE__ */ jsx(Tag, { isDisabled: true, children: "Disabled" }),
|
|
669
|
+
/* @__PURE__ */ jsx(Tag, { isDisabled: true, children: "Also Disabled" })
|
|
670
|
+
] })
|
|
671
|
+
] }) });
|
|
672
|
+
const TextExample = () => /* @__PURE__ */ jsx(Section, { title: "Text", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "2", children: [
|
|
673
|
+
/* @__PURE__ */ jsx(Text, { variant: "title-large", children: "Title Large" }),
|
|
674
|
+
/* @__PURE__ */ jsx(Text, { variant: "title-medium", children: "Title Medium" }),
|
|
675
|
+
/* @__PURE__ */ jsx(Text, { variant: "title-small", children: "Title Small" }),
|
|
676
|
+
/* @__PURE__ */ jsx(Text, { variant: "title-x-small", children: "Title X-Small" }),
|
|
677
|
+
/* @__PURE__ */ jsx(Text, { variant: "body-large", children: "Body Large" }),
|
|
678
|
+
/* @__PURE__ */ jsx(Text, { variant: "body-medium", children: "Body Medium (default)" }),
|
|
679
|
+
/* @__PURE__ */ jsx(Text, { variant: "body-small", children: "Body Small" }),
|
|
680
|
+
/* @__PURE__ */ jsx(Text, { variant: "body-x-small", children: "Body X-Small" }),
|
|
681
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
682
|
+
/* @__PURE__ */ jsx(Text, { color: "primary", children: "Primary" }),
|
|
683
|
+
/* @__PURE__ */ jsx(Text, { color: "secondary", children: "Secondary" }),
|
|
684
|
+
/* @__PURE__ */ jsx(Text, { color: "danger", children: "Danger" }),
|
|
685
|
+
/* @__PURE__ */ jsx(Text, { color: "warning", children: "Warning" }),
|
|
686
|
+
/* @__PURE__ */ jsx(Text, { color: "success", children: "Success" })
|
|
687
|
+
] }),
|
|
688
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
689
|
+
/* @__PURE__ */ jsx(Text, { weight: "regular", children: "Regular" }),
|
|
690
|
+
/* @__PURE__ */ jsx(Text, { weight: "bold", children: "Bold" })
|
|
691
|
+
] })
|
|
692
|
+
] }) });
|
|
693
|
+
const TextFieldExample = () => /* @__PURE__ */ jsx(Section, { title: "TextField", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
694
|
+
/* @__PURE__ */ jsx(
|
|
695
|
+
TextField,
|
|
696
|
+
{
|
|
697
|
+
label: "Small",
|
|
698
|
+
size: "small",
|
|
699
|
+
placeholder: "Enter text",
|
|
700
|
+
name: "text-small"
|
|
701
|
+
}
|
|
702
|
+
),
|
|
703
|
+
/* @__PURE__ */ jsx(
|
|
704
|
+
TextField,
|
|
705
|
+
{
|
|
706
|
+
label: "Medium",
|
|
707
|
+
size: "medium",
|
|
708
|
+
placeholder: "Enter text",
|
|
709
|
+
name: "text-medium"
|
|
710
|
+
}
|
|
711
|
+
),
|
|
712
|
+
/* @__PURE__ */ jsx(
|
|
713
|
+
TextField,
|
|
714
|
+
{
|
|
715
|
+
label: "With Description",
|
|
716
|
+
description: "A helpful description",
|
|
717
|
+
name: "text-desc"
|
|
718
|
+
}
|
|
719
|
+
),
|
|
720
|
+
/* @__PURE__ */ jsx(TextField, { label: "Disabled", name: "text-disabled", isDisabled: true }),
|
|
721
|
+
/* @__PURE__ */ jsx(
|
|
722
|
+
TextField,
|
|
723
|
+
{
|
|
724
|
+
label: "Read Only",
|
|
725
|
+
name: "text-readonly",
|
|
726
|
+
isReadOnly: true,
|
|
727
|
+
defaultValue: "Read only value"
|
|
728
|
+
}
|
|
729
|
+
)
|
|
730
|
+
] }) });
|
|
731
|
+
const ToggleButtonExample = () => {
|
|
732
|
+
const [isSelected, setIsSelected] = useState(false);
|
|
733
|
+
return /* @__PURE__ */ jsx(Section, { title: "ToggleButton & ToggleButtonGroup", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "4", children: [
|
|
734
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "2", align: "center", children: [
|
|
735
|
+
/* @__PURE__ */ jsx(ToggleButton, { isSelected, onChange: setIsSelected, children: isSelected ? "On" : "Off" }),
|
|
736
|
+
/* @__PURE__ */ jsx(
|
|
737
|
+
ToggleButton,
|
|
738
|
+
{
|
|
739
|
+
isSelected,
|
|
740
|
+
onChange: setIsSelected,
|
|
741
|
+
iconStart: /* @__PURE__ */ jsx(StarIcon, { fontSize: "small" }),
|
|
742
|
+
children: "With Icon"
|
|
743
|
+
}
|
|
744
|
+
)
|
|
745
|
+
] }),
|
|
746
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
747
|
+
/* @__PURE__ */ jsxs(
|
|
748
|
+
ToggleButtonGroup,
|
|
749
|
+
{
|
|
750
|
+
selectionMode: "single",
|
|
751
|
+
defaultSelectedKeys: ["dogs"],
|
|
752
|
+
children: [
|
|
753
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "dogs", children: "Dogs" }),
|
|
754
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "cats", children: "Cats" }),
|
|
755
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "birds", children: "Birds" })
|
|
756
|
+
]
|
|
757
|
+
}
|
|
758
|
+
),
|
|
759
|
+
/* @__PURE__ */ jsxs(
|
|
760
|
+
ToggleButtonGroup,
|
|
761
|
+
{
|
|
762
|
+
selectionMode: "multiple",
|
|
763
|
+
defaultSelectedKeys: ["frontend"],
|
|
764
|
+
children: [
|
|
765
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "frontend", children: "Frontend" }),
|
|
766
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "backend", children: "Backend" }),
|
|
767
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "platform", children: "Platform" })
|
|
768
|
+
]
|
|
769
|
+
}
|
|
770
|
+
),
|
|
771
|
+
/* @__PURE__ */ jsxs(ToggleButtonGroup, { selectionMode: "single", isDisabled: true, children: [
|
|
772
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "a", children: "Disabled A" }),
|
|
773
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "b", children: "Disabled B" })
|
|
774
|
+
] })
|
|
775
|
+
] })
|
|
776
|
+
] }) });
|
|
777
|
+
};
|
|
778
|
+
const TooltipExample = () => /* @__PURE__ */ jsx(Section, { title: "Tooltip", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", children: [
|
|
779
|
+
/* @__PURE__ */ jsxs(TooltipTrigger, { children: [
|
|
780
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Top (default)" }),
|
|
781
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "top", children: "Example tooltip text for top placement" })
|
|
782
|
+
] }),
|
|
783
|
+
/* @__PURE__ */ jsxs(TooltipTrigger, { children: [
|
|
784
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Right" }),
|
|
785
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "right", children: "Example tooltip text for right placement" })
|
|
786
|
+
] }),
|
|
787
|
+
/* @__PURE__ */ jsxs(TooltipTrigger, { children: [
|
|
788
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Bottom" }),
|
|
789
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "bottom", children: "Example tooltip text for bottom placement" })
|
|
790
|
+
] }),
|
|
791
|
+
/* @__PURE__ */ jsxs(TooltipTrigger, { children: [
|
|
792
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Left" }),
|
|
793
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "left", children: "Example tooltip text for left placement" })
|
|
794
|
+
] })
|
|
795
|
+
] }) });
|
|
796
|
+
const VisuallyHiddenExample = () => /* @__PURE__ */ jsx(Section, { title: "VisuallyHidden", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "2", children: [
|
|
797
|
+
/* @__PURE__ */ jsx(Text, { children: "The heading below is visually hidden but accessible to screen readers:" }),
|
|
798
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(Text, { as: "h2", children: "Hidden Section Heading" }) }),
|
|
799
|
+
/* @__PURE__ */ jsx(Text, { color: "secondary", children: "(Inspect the DOM or use a screen reader to find the hidden heading above)" })
|
|
800
|
+
] }) });
|
|
801
|
+
const OtherExample = () => {
|
|
802
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", py: "4", children: [
|
|
803
|
+
/* @__PURE__ */ jsx(AccordionExample, {}),
|
|
804
|
+
/* @__PURE__ */ jsx(AlertExample, {}),
|
|
805
|
+
/* @__PURE__ */ jsx(AvatarExample, {}),
|
|
806
|
+
/* @__PURE__ */ jsx(BadgeExample, {}),
|
|
807
|
+
/* @__PURE__ */ jsx(BoxExample, {}),
|
|
808
|
+
/* @__PURE__ */ jsx(ButtonIconExample, {}),
|
|
809
|
+
/* @__PURE__ */ jsx(ButtonLinkExample, {}),
|
|
810
|
+
/* @__PURE__ */ jsx(CardExample, {}),
|
|
811
|
+
/* @__PURE__ */ jsx(CheckboxGroupExample, {}),
|
|
812
|
+
/* @__PURE__ */ jsx(ComboboxExample, {}),
|
|
813
|
+
/* @__PURE__ */ jsx(DatePickerExample, {}),
|
|
814
|
+
/* @__PURE__ */ jsx(DialogExample, {}),
|
|
815
|
+
/* @__PURE__ */ jsx(GridExample, {}),
|
|
816
|
+
/* @__PURE__ */ jsx(LinkExample, {}),
|
|
817
|
+
/* @__PURE__ */ jsx(ListExample, {}),
|
|
818
|
+
/* @__PURE__ */ jsx(MenuExample, {}),
|
|
819
|
+
/* @__PURE__ */ jsx(NumberFieldExample, {}),
|
|
820
|
+
/* @__PURE__ */ jsx(PasswordFieldExample, {}),
|
|
821
|
+
/* @__PURE__ */ jsx(PopoverExample, {}),
|
|
822
|
+
/* @__PURE__ */ jsx(RadioGroupExample, {}),
|
|
823
|
+
/* @__PURE__ */ jsx(SearchAutocompleteExample, {}),
|
|
824
|
+
/* @__PURE__ */ jsx(SearchFieldExample, {}),
|
|
825
|
+
/* @__PURE__ */ jsx(SelectExample, {}),
|
|
826
|
+
/* @__PURE__ */ jsx(SkeletonExample, {}),
|
|
827
|
+
/* @__PURE__ */ jsx(SliderExample, {}),
|
|
828
|
+
/* @__PURE__ */ jsx(SwitchExample, {}),
|
|
829
|
+
/* @__PURE__ */ jsx(TabsExample, {}),
|
|
830
|
+
/* @__PURE__ */ jsx(TagGroupExample, {}),
|
|
831
|
+
/* @__PURE__ */ jsx(TextExample, {}),
|
|
832
|
+
/* @__PURE__ */ jsx(TextFieldExample, {}),
|
|
833
|
+
/* @__PURE__ */ jsx(ToggleButtonExample, {}),
|
|
834
|
+
/* @__PURE__ */ jsx(TooltipExample, {}),
|
|
835
|
+
/* @__PURE__ */ jsx(VisuallyHiddenExample, {})
|
|
836
|
+
] });
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
export { OtherExample };
|
|
840
|
+
//# sourceMappingURL=OtherExample.esm.js.map
|