@byline/ui 6.7.2 → 6.9.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/README.md +43 -5
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/icons/passkey-icon.d.ts +6 -0
- package/dist/icons/passkey-icon.js +43 -0
- package/dist/uikit.d.ts +1 -0
- package/dist/uikit.js +1 -0
- package/package.json +12 -3
- package/src/components/accordion/accordion.stories.tsx +121 -0
- package/src/components/animation/fade-in-lift.stories.tsx +80 -0
- package/src/components/avatar/avatar.stories.tsx +39 -0
- package/src/components/badge/badge.stories.tsx +41 -0
- package/src/components/button/button-group.stories.tsx +44 -0
- package/src/components/button/button-intents.stories.tsx +97 -0
- package/src/components/button/button-overrides.stories.tsx +59 -0
- package/src/components/button/button-test.stories.tsx +59 -0
- package/src/components/button/button-variants.stories.tsx +57 -0
- package/src/components/button/combo-buttons.stories.tsx +82 -0
- package/src/components/button/control-buttons.stories.tsx +60 -0
- package/src/components/button/copy-button.stories.tsx +50 -0
- package/src/components/button/icon-button.stories.tsx +140 -0
- package/src/components/card/card.stories.tsx +60 -0
- package/src/components/chips/chip.stories.tsx +120 -0
- package/src/components/container/container.stories.tsx +35 -0
- package/src/components/dropdown/dropdown.stories.tsx +108 -0
- package/src/components/hamburger/hamburger.stories.tsx +33 -0
- package/src/components/inputs/autocomplete.stories.tsx +189 -0
- package/src/components/inputs/calendar.stories.tsx +141 -0
- package/src/components/inputs/checkbox-group.stories.tsx +43 -0
- package/src/components/inputs/checkbox.stories.tsx +284 -0
- package/src/components/inputs/input.stories.tsx +189 -0
- package/src/components/inputs/radio-group.stories.tsx +73 -0
- package/src/components/inputs/select.stories.tsx +70 -0
- package/src/components/inputs/text-area.stories.tsx +45 -0
- package/src/components/notifications/alert.stories.tsx +75 -0
- package/src/components/notifications/toast.stories.tsx +40 -0
- package/src/components/pager/pagination.stories.tsx +189 -0
- package/src/components/scroll-area/scroll-area.stories.tsx +33 -0
- package/src/components/shimmer/shimmer.stories.tsx +24 -0
- package/src/components/table/table.stories.tsx +94 -0
- package/src/components/tabs/tabs.stories.tsx +47 -0
- package/src/components/tooltip/tooltip.stories.tsx +56 -0
- package/src/icons/icons.stories.tsx +67 -0
- package/src/icons/index.stories.tsx +24 -0
- package/src/icons/index.ts +1 -0
- package/src/icons/passkey-icon.tsx +39 -0
- package/src/loaders/loaders.stories.tsx +188 -0
- package/src/styles/base/colors.stories.tsx +671 -0
- package/src/styles/theme/theme.stories.tsx +40 -0
- package/src/styles/typography/article.stories.tsx +39 -0
- package/src/styles/typography/code.stories.tsx +73 -0
- package/src/styles/typography/default.stories.tsx +49 -0
- package/src/styles/typography/lists.stories.tsx +48 -0
- package/src/styles/typography/quote.stories.tsx +38 -0
- package/src/uikit.ts +1 -0
- package/src/widgets/datepicker/datepicker.stories.tsx +42 -0
- package/src/widgets/drawer/drawer.stories.tsx +281 -0
- package/src/widgets/modal/modal.stories.tsx +63 -0
- package/src/widgets/search/search.stories.tsx +18 -0
- package/src/widgets/timeline/timeline.stories.tsx +50 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
import { type Intent, intent } from '../@types/shared.js'
|
|
6
|
+
import { Alert as AlertComponent } from './alert.js'
|
|
7
|
+
|
|
8
|
+
export const Alerts = (): React.JSX.Element => {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<div
|
|
12
|
+
style={{
|
|
13
|
+
maxWidth: '600px',
|
|
14
|
+
margin: '2rem auto',
|
|
15
|
+
borderRadius: '6px',
|
|
16
|
+
backgroundColor: 'var(--background)',
|
|
17
|
+
padding: '1rem',
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
{intent.map((intent: Intent) => {
|
|
21
|
+
if (intent !== 'noeffect') {
|
|
22
|
+
return (
|
|
23
|
+
<div style={{ marginBottom: '1rem' }} key={intent}>
|
|
24
|
+
<AlertComponent intent={intent}>
|
|
25
|
+
This is a {intent} alert - with some additional text here.
|
|
26
|
+
</AlertComponent>
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
return null
|
|
31
|
+
})}
|
|
32
|
+
<AlertComponent intent="info" title="This is a title">
|
|
33
|
+
This is an info alert with a title and with some additional text here.
|
|
34
|
+
</AlertComponent>
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
className="dark"
|
|
38
|
+
style={{
|
|
39
|
+
maxWidth: '600px',
|
|
40
|
+
margin: '2rem auto',
|
|
41
|
+
borderRadius: '6px',
|
|
42
|
+
backgroundColor: 'var(--theme-800)',
|
|
43
|
+
padding: '1rem',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
{intent.map((intent: Intent) => {
|
|
47
|
+
if (intent !== 'noeffect') {
|
|
48
|
+
return (
|
|
49
|
+
<div style={{ marginBottom: '1rem' }} key={intent}>
|
|
50
|
+
<AlertComponent intent={intent}>
|
|
51
|
+
This is a {intent} alert - with some additional text here.
|
|
52
|
+
</AlertComponent>
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
return null
|
|
57
|
+
})}
|
|
58
|
+
<AlertComponent intent="info" title="This is a title">
|
|
59
|
+
This is an info alert with a title and with some additional text here.
|
|
60
|
+
</AlertComponent>
|
|
61
|
+
</div>
|
|
62
|
+
</>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const meta: Meta = {
|
|
67
|
+
/* 👇 The title prop is optional.
|
|
68
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
69
|
+
* to learn how to generate automatic titles
|
|
70
|
+
*/
|
|
71
|
+
title: 'Components',
|
|
72
|
+
component: Alerts,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default meta
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
import { Button } from '../button/button.js'
|
|
6
|
+
import { useToastManager } from './toast.js'
|
|
7
|
+
|
|
8
|
+
function ToastDemo(): React.JSX.Element {
|
|
9
|
+
const toastManager = useToastManager()
|
|
10
|
+
|
|
11
|
+
const handleOpenToastClick = (): void => {
|
|
12
|
+
toastManager.add({
|
|
13
|
+
title: 'Note',
|
|
14
|
+
description:
|
|
15
|
+
'This is a test Toast notification that should appear when the button is clicked.',
|
|
16
|
+
data: {
|
|
17
|
+
intent: 'success',
|
|
18
|
+
iconType: 'success',
|
|
19
|
+
icon: true,
|
|
20
|
+
close: true,
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div style={{ maxWidth: '600px', margin: '2rem 0' }}>
|
|
27
|
+
<Button onClick={handleOpenToastClick}>Open Toast</Button>
|
|
28
|
+
</div>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const Toast: StoryObj = {
|
|
33
|
+
render: () => <ToastDemo />,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const meta: Meta = {
|
|
37
|
+
title: 'Components/Toast',
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default meta
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
import { EventPager } from './event-pager.js'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof EventPager> = {
|
|
8
|
+
/* 👇 The title prop is optional.
|
|
9
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
10
|
+
* to learn how to generate automatic titles
|
|
11
|
+
*/
|
|
12
|
+
title: 'Components/Pager',
|
|
13
|
+
component: EventPager,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
|
|
18
|
+
const DefaultPager = (): React.JSX.Element => {
|
|
19
|
+
const [page, setPage] = React.useState(1)
|
|
20
|
+
|
|
21
|
+
const handlePageChange = (_event: any, number: number): void => {
|
|
22
|
+
setPage(number)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<style>
|
|
28
|
+
{`
|
|
29
|
+
.event-pager {
|
|
30
|
+
margin-bottom: 1rem;
|
|
31
|
+
}
|
|
32
|
+
`}
|
|
33
|
+
</style>
|
|
34
|
+
<div style={{ margin: '2rem 0', maxWidth: '600px' }}>
|
|
35
|
+
<p style={{ marginBottom: '1rem' }}>Stateful Pagers: Current page: {page}</p>
|
|
36
|
+
<EventPager
|
|
37
|
+
page={page}
|
|
38
|
+
count={24}
|
|
39
|
+
className="event-pager"
|
|
40
|
+
onChange={handlePageChange}
|
|
41
|
+
showFirstButton
|
|
42
|
+
showLastButton
|
|
43
|
+
componentName="pager1"
|
|
44
|
+
aria-label="Pager 1"
|
|
45
|
+
/>
|
|
46
|
+
<EventPager
|
|
47
|
+
page={page}
|
|
48
|
+
count={24}
|
|
49
|
+
className="event-pager"
|
|
50
|
+
onChange={handlePageChange}
|
|
51
|
+
componentName="pager2"
|
|
52
|
+
aria-label="Pager 2"
|
|
53
|
+
/>
|
|
54
|
+
<EventPager
|
|
55
|
+
page={page}
|
|
56
|
+
count={24}
|
|
57
|
+
className="event-pager"
|
|
58
|
+
onChange={handlePageChange}
|
|
59
|
+
componentName="pager3"
|
|
60
|
+
hideNextButton
|
|
61
|
+
hidePrevButton
|
|
62
|
+
aria-label="Pager 3"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const ClassicPager = (): React.JSX.Element => {
|
|
70
|
+
const [page, setPage] = React.useState(1)
|
|
71
|
+
|
|
72
|
+
const handlePageChange = (_event: any, number: number): void => {
|
|
73
|
+
setPage(number)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<>
|
|
78
|
+
<style>
|
|
79
|
+
{`
|
|
80
|
+
.event-pager {
|
|
81
|
+
margin-bottom: 1rem;
|
|
82
|
+
}
|
|
83
|
+
`}
|
|
84
|
+
</style>
|
|
85
|
+
<div style={{ margin: '2rem 0', maxWidth: '600px' }}>
|
|
86
|
+
<p style={{ marginBottom: '1rem' }}>Stateful Pagers: Current page: {page}</p>
|
|
87
|
+
<EventPager
|
|
88
|
+
variant="classic"
|
|
89
|
+
className="event-pager"
|
|
90
|
+
page={page}
|
|
91
|
+
count={24}
|
|
92
|
+
onChange={handlePageChange}
|
|
93
|
+
showFirstButton
|
|
94
|
+
showLastButton
|
|
95
|
+
componentName="pager1"
|
|
96
|
+
aria-label="Pager 1"
|
|
97
|
+
/>
|
|
98
|
+
<EventPager
|
|
99
|
+
variant="classic"
|
|
100
|
+
className="event-pager"
|
|
101
|
+
page={page}
|
|
102
|
+
count={24}
|
|
103
|
+
onChange={handlePageChange}
|
|
104
|
+
componentName="pager2"
|
|
105
|
+
aria-label="Pager 2"
|
|
106
|
+
/>
|
|
107
|
+
<EventPager
|
|
108
|
+
variant="classic"
|
|
109
|
+
className="event-pager"
|
|
110
|
+
page={page}
|
|
111
|
+
count={24}
|
|
112
|
+
onChange={handlePageChange}
|
|
113
|
+
componentName="pager3"
|
|
114
|
+
hideNextButton
|
|
115
|
+
hidePrevButton
|
|
116
|
+
aria-label="Pager 3"
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
</>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const DashboardPager = (): React.JSX.Element => {
|
|
124
|
+
const [page, setPage] = React.useState(1)
|
|
125
|
+
|
|
126
|
+
const handlePageChange = (_event: any, number: number): void => {
|
|
127
|
+
setPage(number)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<>
|
|
132
|
+
<style>
|
|
133
|
+
{`
|
|
134
|
+
.event-pager {
|
|
135
|
+
margin-bottom: 1rem;
|
|
136
|
+
}
|
|
137
|
+
`}
|
|
138
|
+
</style>
|
|
139
|
+
<div style={{ margin: '2rem 0', maxWidth: '600px' }}>
|
|
140
|
+
<p style={{ marginBottom: '1rem' }}>Stateful Pagers: Current page: {page}</p>
|
|
141
|
+
<EventPager
|
|
142
|
+
variant="dashboard"
|
|
143
|
+
className="event-pager"
|
|
144
|
+
page={page}
|
|
145
|
+
count={24}
|
|
146
|
+
onChange={handlePageChange}
|
|
147
|
+
showFirstButton
|
|
148
|
+
showLastButton
|
|
149
|
+
componentName="pager1"
|
|
150
|
+
aria-label="Pager 1"
|
|
151
|
+
/>
|
|
152
|
+
<EventPager
|
|
153
|
+
variant="dashboard"
|
|
154
|
+
className="event-pager"
|
|
155
|
+
page={page}
|
|
156
|
+
count={24}
|
|
157
|
+
onChange={handlePageChange}
|
|
158
|
+
componentName="pager2"
|
|
159
|
+
aria-label="Pager 2"
|
|
160
|
+
/>
|
|
161
|
+
<EventPager
|
|
162
|
+
variant="dashboard"
|
|
163
|
+
className="event-pager"
|
|
164
|
+
page={page}
|
|
165
|
+
count={24}
|
|
166
|
+
onChange={handlePageChange}
|
|
167
|
+
componentName="pager3"
|
|
168
|
+
hideNextButton
|
|
169
|
+
hidePrevButton
|
|
170
|
+
aria-label="Pager 3"
|
|
171
|
+
/>
|
|
172
|
+
</div>
|
|
173
|
+
</>
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
type Story = StoryObj<typeof EventPager>
|
|
178
|
+
|
|
179
|
+
export const Default: Story = {
|
|
180
|
+
render: () => <DefaultPager />,
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const Classic: Story = {
|
|
184
|
+
render: () => <ClassicPager />,
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export const Dashboard: Story = {
|
|
188
|
+
render: () => <DashboardPager />,
|
|
189
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
import { ScrollArea as ScrollAreaComponent } from './scroll-area.js'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ScrollAreaComponent> = {
|
|
6
|
+
/* 👇 The title prop is optional.
|
|
7
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
8
|
+
* to learn how to generate automatic titles
|
|
9
|
+
*/
|
|
10
|
+
title: 'Components/ScrollArea',
|
|
11
|
+
component: ScrollAreaComponent,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default meta
|
|
15
|
+
|
|
16
|
+
const TAGS = Array.from({ length: 50 }).map((_, i, a) => `v1.2.0-beta.${a.length - i}`)
|
|
17
|
+
|
|
18
|
+
export const ScrollArea = (): React.JSX.Element => {
|
|
19
|
+
return (
|
|
20
|
+
<div style={{ height: '100vh', margin: '2rem 0' }}>
|
|
21
|
+
<ScrollAreaComponent
|
|
22
|
+
style={{ width: '200px', height: '300px', margin: '0 auto', border: '1px solid #ccc' }}
|
|
23
|
+
>
|
|
24
|
+
<div style={{ padding: '15px 20px' }}>
|
|
25
|
+
<div>Tags</div>
|
|
26
|
+
{TAGS.map((tag) => (
|
|
27
|
+
<div key={tag}>{tag}</div>
|
|
28
|
+
))}
|
|
29
|
+
</div>
|
|
30
|
+
</ScrollAreaComponent>
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
import { Shimmer as ShimmerComponent } from './shimmer.js'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ShimmerComponent> = {
|
|
6
|
+
/* 👇 The title prop is optional.
|
|
7
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
8
|
+
* to learn how to generate automatic titles
|
|
9
|
+
*/
|
|
10
|
+
title: 'Components/Shimmer',
|
|
11
|
+
component: ShimmerComponent,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default meta
|
|
15
|
+
|
|
16
|
+
export const Shimmer = (): React.JSX.Element => {
|
|
17
|
+
return (
|
|
18
|
+
<div style={{ height: '100vh' }}>
|
|
19
|
+
<ShimmerComponent variant="text" width="100%" borderRadius="4px" lineHeight="1rem" lines={5}>
|
|
20
|
+
<div style={{ width: '100%' }} />
|
|
21
|
+
</ShimmerComponent>
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
import { Table as TableComponent } from './table.js'
|
|
6
|
+
|
|
7
|
+
const meta: Meta = {
|
|
8
|
+
/* 👇 The title prop is optional.
|
|
9
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
10
|
+
* to learn how to generate automatic titles
|
|
11
|
+
*/
|
|
12
|
+
title: 'Components',
|
|
13
|
+
component: TableComponent,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
|
|
18
|
+
export const Table = (): React.JSX.Element => {
|
|
19
|
+
return (
|
|
20
|
+
<div style={{ maxWidth: '960px', margin: '2rem auto' }}>
|
|
21
|
+
<TableComponent.Container>
|
|
22
|
+
<TableComponent>
|
|
23
|
+
<TableComponent.Header>
|
|
24
|
+
<TableComponent.Row>
|
|
25
|
+
<TableComponent.HeadingCell scope="col">
|
|
26
|
+
<span>Check</span>
|
|
27
|
+
</TableComponent.HeadingCell>
|
|
28
|
+
<TableComponent.HeadingCell scope="col">
|
|
29
|
+
<p>Heading 1</p>
|
|
30
|
+
</TableComponent.HeadingCell>
|
|
31
|
+
<TableComponent.HeadingCell scope="col">
|
|
32
|
+
<p>Heading 2</p>
|
|
33
|
+
</TableComponent.HeadingCell>
|
|
34
|
+
<TableComponent.HeadingCell scope="col">
|
|
35
|
+
<p>Heading 3</p>
|
|
36
|
+
</TableComponent.HeadingCell>
|
|
37
|
+
</TableComponent.Row>
|
|
38
|
+
</TableComponent.Header>
|
|
39
|
+
|
|
40
|
+
<TableComponent.Body>
|
|
41
|
+
<TableComponent.Row>
|
|
42
|
+
<TableComponent.Cell>
|
|
43
|
+
<span>Check</span>
|
|
44
|
+
</TableComponent.Cell>
|
|
45
|
+
<TableComponent.Cell>1</TableComponent.Cell>
|
|
46
|
+
<TableComponent.Cell>2</TableComponent.Cell>
|
|
47
|
+
<TableComponent.Cell>3</TableComponent.Cell>
|
|
48
|
+
</TableComponent.Row>
|
|
49
|
+
<TableComponent.Row>
|
|
50
|
+
<TableComponent.Cell>
|
|
51
|
+
<span>Check</span>
|
|
52
|
+
</TableComponent.Cell>
|
|
53
|
+
<TableComponent.Cell>1</TableComponent.Cell>
|
|
54
|
+
<TableComponent.Cell>2</TableComponent.Cell>
|
|
55
|
+
<TableComponent.Cell>3</TableComponent.Cell>
|
|
56
|
+
</TableComponent.Row>
|
|
57
|
+
<TableComponent.Row>
|
|
58
|
+
<TableComponent.Cell>
|
|
59
|
+
<span>Check</span>
|
|
60
|
+
</TableComponent.Cell>
|
|
61
|
+
<TableComponent.Cell>1</TableComponent.Cell>
|
|
62
|
+
<TableComponent.Cell>2</TableComponent.Cell>
|
|
63
|
+
<TableComponent.Cell>3</TableComponent.Cell>
|
|
64
|
+
</TableComponent.Row>
|
|
65
|
+
<TableComponent.Row>
|
|
66
|
+
<TableComponent.Cell>
|
|
67
|
+
<span>Check</span>
|
|
68
|
+
</TableComponent.Cell>
|
|
69
|
+
<TableComponent.Cell>1</TableComponent.Cell>
|
|
70
|
+
<TableComponent.Cell>2</TableComponent.Cell>
|
|
71
|
+
<TableComponent.Cell>3</TableComponent.Cell>
|
|
72
|
+
</TableComponent.Row>
|
|
73
|
+
</TableComponent.Body>
|
|
74
|
+
<TableComponent.Footer>
|
|
75
|
+
<TableComponent.Row>
|
|
76
|
+
<TableComponent.HeadingCell scope="col">
|
|
77
|
+
<span>Check</span>
|
|
78
|
+
</TableComponent.HeadingCell>
|
|
79
|
+
<TableComponent.HeadingCell scope="col">
|
|
80
|
+
<p>Heading 1</p>
|
|
81
|
+
</TableComponent.HeadingCell>
|
|
82
|
+
<TableComponent.HeadingCell scope="col">
|
|
83
|
+
<p>Heading 2</p>
|
|
84
|
+
</TableComponent.HeadingCell>
|
|
85
|
+
<TableComponent.HeadingCell scope="col">
|
|
86
|
+
<p>Heading 3</p>
|
|
87
|
+
</TableComponent.HeadingCell>
|
|
88
|
+
</TableComponent.Row>
|
|
89
|
+
</TableComponent.Footer>
|
|
90
|
+
</TableComponent>
|
|
91
|
+
</TableComponent.Container>
|
|
92
|
+
</div>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
import { Button } from '../button/button.js'
|
|
6
|
+
import { Tabs as TabsComponent } from './tabs.js'
|
|
7
|
+
|
|
8
|
+
const meta: Meta = {
|
|
9
|
+
/* 👇 The title prop is optional.
|
|
10
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
11
|
+
* to learn how to generate automatic titles
|
|
12
|
+
*/
|
|
13
|
+
title: 'Components',
|
|
14
|
+
component: TabsComponent,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
|
|
19
|
+
export const Tabs = (): React.JSX.Element => (
|
|
20
|
+
<div
|
|
21
|
+
style={{
|
|
22
|
+
maxWidth: '700px',
|
|
23
|
+
margin: '2rem auto',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<TabsComponent style={{ width: '400px', minHeight: '235px' }} defaultValue="detailsTab">
|
|
29
|
+
<TabsComponent.List>
|
|
30
|
+
<TabsComponent.Trigger value="detailsTab" render={<Button size="sm" />}>
|
|
31
|
+
Details
|
|
32
|
+
</TabsComponent.Trigger>
|
|
33
|
+
<TabsComponent.Trigger value="rolesTab" render={<Button size="sm" />}>
|
|
34
|
+
Roles
|
|
35
|
+
</TabsComponent.Trigger>
|
|
36
|
+
</TabsComponent.List>
|
|
37
|
+
<TabsComponent.Content value="detailsTab" keepMounted={true}>
|
|
38
|
+
<p>Details tab content here. Some more text to make this tab content area a bit longer.</p>
|
|
39
|
+
<p>Details tab content here. Some more text to make this tab content area a bit longer.</p>
|
|
40
|
+
</TabsComponent.Content>
|
|
41
|
+
<TabsComponent.Content value="rolesTab">
|
|
42
|
+
<p>Roles tab content here. Some more text to make this tab content area a bit longer.</p>
|
|
43
|
+
<p>Roles tab content here. Some more text to make this tab content area a bit longer.</p>
|
|
44
|
+
</TabsComponent.Content>
|
|
45
|
+
</TabsComponent>
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
import { Button } from '../button/button.js'
|
|
6
|
+
import { Tooltip as TooltipComponent } from './tooltip.js'
|
|
7
|
+
|
|
8
|
+
export const Tooltip = (): React.JSX.Element => {
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
style={{
|
|
12
|
+
maxWidth: '100px',
|
|
13
|
+
marginLeft: '12rem',
|
|
14
|
+
marginTop: '3rem',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
gap: '46px',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
padding: '16px',
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<TooltipComponent text="I'm a tooltip" side="top" sideOffset={8}>
|
|
24
|
+
<Button fullWidth={true} size="sm">
|
|
25
|
+
Top
|
|
26
|
+
</Button>
|
|
27
|
+
</TooltipComponent>
|
|
28
|
+
<TooltipComponent text="I'm a tooltip" side="left" sideOffset={8}>
|
|
29
|
+
<Button fullWidth={true} size="sm">
|
|
30
|
+
Left
|
|
31
|
+
</Button>
|
|
32
|
+
</TooltipComponent>
|
|
33
|
+
<TooltipComponent text="I'm a tooltip" side="right" sideOffset={8}>
|
|
34
|
+
<Button fullWidth={true} size="sm">
|
|
35
|
+
Right
|
|
36
|
+
</Button>
|
|
37
|
+
</TooltipComponent>
|
|
38
|
+
<TooltipComponent text="I'm a tooltip" side="bottom" sideOffset={8}>
|
|
39
|
+
<Button fullWidth={true} size="sm">
|
|
40
|
+
Bottom
|
|
41
|
+
</Button>
|
|
42
|
+
</TooltipComponent>
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const meta: Meta<typeof TooltipComponent> = {
|
|
48
|
+
/* 👇 The title prop is optional.
|
|
49
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
50
|
+
* to learn how to generate automatic titles
|
|
51
|
+
*/
|
|
52
|
+
title: 'Components',
|
|
53
|
+
component: TooltipComponent,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default meta
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
|
|
3
|
+
import * as AllIcons from './index.js'
|
|
4
|
+
|
|
5
|
+
const IconsDemo = (): React.JSX.Element => (
|
|
6
|
+
<div
|
|
7
|
+
className="icon-demo"
|
|
8
|
+
style={{
|
|
9
|
+
margin: '16px 0',
|
|
10
|
+
display: 'grid',
|
|
11
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(80px, 1fr))',
|
|
12
|
+
gap: '12px',
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
{Object.entries(AllIcons)
|
|
16
|
+
.filter(([name, Icon]) => name !== 'IconElement' && typeof Icon === 'function')
|
|
17
|
+
.map(([name, Icon]) => {
|
|
18
|
+
// Cast to any to avoid complex typing for the import * object
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
const Component = Icon as React.ComponentType<any>
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
key={name}
|
|
24
|
+
style={{
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
<Component
|
|
32
|
+
style={{ marginBottom: '8px', width: '28px', height: '28px' }}
|
|
33
|
+
width="28px"
|
|
34
|
+
height="28px"
|
|
35
|
+
/>
|
|
36
|
+
<div
|
|
37
|
+
style={{
|
|
38
|
+
fontSize: '10px',
|
|
39
|
+
textOverflow: 'ellipsis',
|
|
40
|
+
overflow: 'hidden',
|
|
41
|
+
whiteSpace: 'nowrap',
|
|
42
|
+
}}
|
|
43
|
+
title={name}
|
|
44
|
+
>
|
|
45
|
+
{name}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
|
+
})}
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
title: 'Icons/All',
|
|
55
|
+
component: IconsDemo,
|
|
56
|
+
argTypes: {},
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const All = (): React.JSX.Element => {
|
|
60
|
+
return (
|
|
61
|
+
<div style={{ marginBottom: '1.5rem' }}>
|
|
62
|
+
<div style={{ maxWidth: '700px' }}>
|
|
63
|
+
<IconsDemo />
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
|
|
3
|
+
import { DangerIcon } from './danger-icon.js'
|
|
4
|
+
import { InfoIcon } from './info-icon.js'
|
|
5
|
+
import { SuccessIcon } from './success-icon.js'
|
|
6
|
+
import { WarningIcon } from './warning-icon.js'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Icons/Sprites',
|
|
10
|
+
argTypes: {},
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Sprites = (): React.JSX.Element => {
|
|
14
|
+
return (
|
|
15
|
+
<div style={{ marginBottom: '1.5rem' }}>
|
|
16
|
+
<div style={{ maxWidth: '800px', display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)' }}>
|
|
17
|
+
<InfoIcon />
|
|
18
|
+
<WarningIcon />
|
|
19
|
+
<SuccessIcon />
|
|
20
|
+
<DangerIcon />
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
package/src/icons/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from './light-icon.js'
|
|
|
36
36
|
export * from './location-pin-icon.js'
|
|
37
37
|
export * from './markdown-icon.js'
|
|
38
38
|
export * from './moon-icon.js'
|
|
39
|
+
export * from './passkey-icon.js'
|
|
39
40
|
export * from './plus-icon.js'
|
|
40
41
|
export * from './primary-icon.js'
|
|
41
42
|
export * from './refresh-icon.js'
|