lupine.components 1.1.54 → 1.1.56
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/LICENSE +21 -21
- package/package.json +1 -1
- package/src/component-pool/aspect-ratio/aspect-ratio-demo.tsx +103 -103
- package/src/component-pool/avatar/avatar-demo.tsx +127 -127
- package/src/component-pool/badge/badge-demo.tsx +152 -152
- package/src/component-pool/breadcrumbs/breadcrumbs-demo.tsx +105 -105
- package/src/component-pool/card/card-demo.tsx +179 -179
- package/src/component-pool/carousel/carousel-demo.tsx +191 -191
- package/src/component-pool/cascader/cascader-demo.tsx +127 -127
- package/src/component-pool/charts/area-chart-demo.tsx +106 -106
- package/src/component-pool/charts/area-chart.tsx +254 -254
- package/src/component-pool/charts/bar-chart-demo.tsx +107 -107
- package/src/component-pool/charts/bar-chart.tsx +223 -223
- package/src/component-pool/charts/chart-utils.ts +182 -182
- package/src/component-pool/charts/column-chart-demo.tsx +111 -111
- package/src/component-pool/charts/column-chart.tsx +230 -230
- package/src/component-pool/charts/donut-chart-demo.tsx +112 -112
- package/src/component-pool/charts/donut-chart.tsx +6 -6
- package/src/component-pool/charts/gauge-chart-demo.tsx +101 -101
- package/src/component-pool/charts/gauge-chart.tsx +117 -117
- package/src/component-pool/charts/index.ts +19 -19
- package/src/component-pool/charts/line-chart-demo.tsx +109 -109
- package/src/component-pool/charts/line-chart.tsx +233 -233
- package/src/component-pool/charts/pie-chart-demo.tsx +133 -133
- package/src/component-pool/charts/pie-chart.tsx +142 -142
- package/src/component-pool/charts/radar-chart-demo.tsx +88 -88
- package/src/component-pool/charts/radar-chart.tsx +231 -231
- package/src/component-pool/charts/scatter-chart-demo.tsx +88 -88
- package/src/component-pool/charts/scatter-chart.tsx +237 -237
- package/src/component-pool/copy-button/copy-button-demo.tsx +71 -71
- package/src/component-pool/date-picker/date-picker-demo.tsx +84 -84
- package/src/component-pool/date-picker/date-picker.tsx +437 -437
- package/src/component-pool/date-picker/index.ts +2 -2
- package/src/component-pool/floating-icon-menu/floating-icon-menu-demo.tsx +94 -94
- package/src/component-pool/floating-icon-menu/floating-icon-menu.tsx +241 -241
- package/src/component-pool/floating-icon-menu/index.ts +2 -2
- package/src/component-pool/h-editor/h-editor-demo.tsx +112 -112
- package/src/component-pool/h-editor/h-editor.ts +862 -862
- package/src/component-pool/h-editor/index.ts +2 -2
- package/src/component-pool/i-editor/i-editor-demo.tsx +72 -72
- package/src/component-pool/i-editor/i-editor-frames.ts +42 -42
- package/src/component-pool/i-editor/i-editor-styles.ts +22 -22
- package/src/component-pool/i-editor/i-editor.ts +3869 -3869
- package/src/component-pool/i-editor/index.ts +2 -2
- package/src/component-pool/map-wrapper/map-wrapper-demo.tsx +55 -55
- package/src/component-pool/p-editor/index.ts +4 -4
- package/src/component-pool/p-editor/p-editor-demo.tsx +51 -51
- package/src/component-pool/p-editor/p-editor-styles.ts +44 -44
- package/src/component-pool/p-editor/p-editor-types.ts +4 -4
- package/src/component-pool/p-editor/p-editor-utils.ts +38 -38
- package/src/component-pool/p-editor/p-editor.ts +2477 -2477
- package/src/component-pool/pdf-viewer/index.ts +2 -2
- package/src/component-pool/pdf-viewer/pdf-viewer-demo.tsx +116 -116
- package/src/component-pool/pdf-viewer/pdf-viewer.tsx +56 -56
- package/src/component-pool/picker-helper.tsx +222 -222
- package/src/component-pool/pull-to-refresh/pull-to-refresh-demo.tsx +99 -99
- package/src/component-pool/qrcode/index.ts +3 -3
- package/src/component-pool/qrcode/qrcode-demo.tsx +102 -102
- package/src/component-pool/qrcode/qrcode.tsx +169 -169
- package/src/component-pool/radial-progress/index.ts +2 -2
- package/src/component-pool/radial-progress/radial-progress-demo.tsx +84 -84
- package/src/component-pool/radial-progress/radial-progress.tsx +118 -118
- package/src/component-pool/range/gauge-demo.tsx +113 -113
- package/src/component-pool/range/gauge.tsx +392 -392
- package/src/component-pool/range/range-demo.tsx +97 -97
- package/src/component-pool/search-input/index.ts +2 -2
- package/src/component-pool/search-input/search-input-demo.tsx +50 -50
- package/src/component-pool/search-input/search-input.tsx +125 -123
- package/src/component-pool/skeleton/skeleton-card.tsx +114 -114
- package/src/component-pool/skeleton/skeleton-demo.tsx +55 -55
- package/src/component-pool/svg-icons.ts +95 -95
- package/src/component-pool/svg-props.tsx +144 -144
- package/src/component-pool/tag-input/index.ts +2 -2
- package/src/component-pool/tag-input/tag-input-demo.tsx +47 -47
- package/src/component-pool/tag-input/tag-input.tsx +166 -166
- package/src/component-pool/time-picker/index.ts +2 -2
- package/src/component-pool/time-picker/time-picker-demo.tsx +80 -80
- package/src/component-pool/time-picker/time-picker.tsx +311 -311
- package/src/component-pool/timeline/timeline-demo.tsx +75 -75
- package/src/component-pool/tooltip/tooltip-demo.tsx +144 -144
- package/src/component-pool/tour/tour-demo.tsx +92 -92
- package/src/component-pool/youtube-player/index.ts +2 -2
- package/src/component-pool/youtube-player/youtube-player-demo.tsx +57 -57
- package/src/component-pool/youtube-player/youtube-player.tsx +116 -116
- package/src/components/action-sheet-color.tsx +269 -269
- package/src/components/action-sheet-date.tsx +299 -299
- package/src/components/action-sheet-demo.tsx +216 -216
- package/src/components/action-sheet-theme.tsx +150 -150
- package/src/components/action-sheet-time.tsx +157 -157
- package/src/components/input-number.tsx +206 -206
- package/src/components/input-with-title-demo.tsx +42 -42
- package/src/components/loading-spin.tsx +74 -60
- package/src/components/message-box-demo.tsx +107 -107
- package/src/components/mobile-components/mobile-side-menu-demo.tsx +47 -47
- package/src/components/modal-demo.tsx +56 -56
- package/src/components/notice-message-demo.tsx +57 -57
- package/src/components/paging-link-demo.tsx +430 -430
- package/src/components/popup-menu-demo.tsx +172 -172
- package/src/components/progress-demo.tsx +53 -53
- package/src/components/radio-label-demo.tsx +41 -41
- package/src/components/redirect-demo.tsx +36 -36
- package/src/components/resizable-splitter-demo.tsx +104 -104
- package/src/components/select-angle-component.tsx +11 -6
- package/src/components/select-angle-demo.tsx +32 -32
- package/src/components/select-with-title-demo.tsx +53 -53
- package/src/components/slide-tab-component-demo.tsx +86 -86
- package/src/components/spinner-demo.tsx +52 -52
- package/src/components/stars-component-demo.tsx +36 -36
- package/src/components/switch-option-component.tsx +74 -74
- package/src/components/switch-option-demo.tsx +36 -36
- package/src/components/tabs-demo.tsx +42 -42
- package/src/components/text-glow-demo.tsx +46 -46
- package/src/components/text-scale-demo.tsx +41 -41
- package/src/components/text-wave-demo.tsx +48 -48
- package/src/components/toggle-button-demo.tsx +230 -230
- package/src/demo/demo-page.tsx +271 -271
- package/src/demo/demo-registry.ts +143 -143
- package/src/demo/demo-render-page.tsx +94 -94
- package/src/demo/demo-types.ts +22 -22
- package/src/demo/mock/demo-icons.ts +72 -72
- package/src/demo/mock/responsive-demo-mock-pages.tsx +197 -197
- package/src/demo/mock/side-menu-mock.tsx +113 -113
- package/src/demo/mock/user-settings-mock.tsx +310 -310
- package/src/frames/responsive-frame-demo.tsx +120 -120
- package/src/frames/slider-frame-demo.tsx +111 -111
- package/src/frames/slider-helper.tsx +194 -194
- package/src/lib/button-async-lock.tsx +43 -43
- package/src/lib/canvas/canvas-drawing.ts +503 -503
- package/src/lib/canvas/canvas-geometry.ts +255 -255
- package/src/lib/canvas/canvas-helper.tsx +176 -176
- package/src/lib/canvas/canvas-image.ts +110 -110
- package/src/lib/canvas/canvas-types.ts +93 -93
- package/src/lib/canvas/index.ts +5 -5
- package/src/lib/disable-console.ts +11 -11
- package/src/lib/disable-debug.ts +8 -8
- package/src/lib/support-safe-area.ts +25 -25
- package/tsconfig.json +113 -113
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 uuware
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 uuware
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
import { DemoStory } from '../../demo/demo-types';
|
|
2
|
-
import { AspectRatio, AspectRatioProps } from './aspect-ratio';
|
|
3
|
-
|
|
4
|
-
export const aspectRatioDemo: DemoStory<AspectRatioProps> = {
|
|
5
|
-
id: 'aspect-ratio',
|
|
6
|
-
text: 'AspectRatio',
|
|
7
|
-
args: {
|
|
8
|
-
ratio: 16 / 9,
|
|
9
|
-
children: <div />,
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
ratio: {
|
|
13
|
-
control: 'select',
|
|
14
|
-
options: [16 / 9, 4 / 3, 1, 9 / 16],
|
|
15
|
-
description: 'Aspect ratio (width / height)',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
render: (args) => {
|
|
19
|
-
return (
|
|
20
|
-
<div style={{ padding: '40px', display: 'flex', flexDirection: 'column', gap: '40px', maxWidth: '600px' }}>
|
|
21
|
-
<div>
|
|
22
|
-
<h3 style={{ marginBottom: '8px' }}>16 / 9 (Video)</h3>
|
|
23
|
-
<AspectRatio ratio={16 / 9}>
|
|
24
|
-
<div
|
|
25
|
-
style={{
|
|
26
|
-
width: '100%',
|
|
27
|
-
height: '100%',
|
|
28
|
-
backgroundColor: 'var(--secondary-bg-color, #e5e7eb)',
|
|
29
|
-
borderRadius: '8px',
|
|
30
|
-
display: 'flex',
|
|
31
|
-
alignItems: 'center',
|
|
32
|
-
justifyContent: 'center',
|
|
33
|
-
color: 'var(--secondary-color, #6b7280)',
|
|
34
|
-
fontSize: '14px',
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
16:9 Content
|
|
38
|
-
</div>
|
|
39
|
-
</AspectRatio>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
<div>
|
|
43
|
-
<h3 style={{ marginBottom: '8px' }}>4 / 3 (Classic Photo)</h3>
|
|
44
|
-
<AspectRatio ratio={4 / 3}>
|
|
45
|
-
<div
|
|
46
|
-
style={{
|
|
47
|
-
width: '100%',
|
|
48
|
-
height: '100%',
|
|
49
|
-
backgroundColor: 'var(--secondary-bg-color, #e5e7eb)',
|
|
50
|
-
borderRadius: '8px',
|
|
51
|
-
display: 'flex',
|
|
52
|
-
alignItems: 'center',
|
|
53
|
-
justifyContent: 'center',
|
|
54
|
-
color: 'var(--secondary-color, #6b7280)',
|
|
55
|
-
fontSize: '14px',
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
4:3 Content
|
|
59
|
-
</div>
|
|
60
|
-
</AspectRatio>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<div>
|
|
64
|
-
<h3 style={{ marginBottom: '8px' }}>1 / 1 (Square)</h3>
|
|
65
|
-
<AspectRatio ratio={1}>
|
|
66
|
-
<div
|
|
67
|
-
style={{
|
|
68
|
-
width: '100%',
|
|
69
|
-
height: '100%',
|
|
70
|
-
backgroundColor: 'var(--secondary-bg-color, #e5e7eb)',
|
|
71
|
-
borderRadius: '8px',
|
|
72
|
-
display: 'flex',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
justifyContent: 'center',
|
|
75
|
-
color: 'var(--secondary-color, #6b7280)',
|
|
76
|
-
fontSize: '14px',
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
1:1 Content
|
|
80
|
-
</div>
|
|
81
|
-
</AspectRatio>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
);
|
|
85
|
-
},
|
|
86
|
-
code: `import { AspectRatio } from 'lupine.components/component-pool';
|
|
87
|
-
|
|
88
|
-
// Video embed (16:9)
|
|
89
|
-
<AspectRatio ratio={16 / 9}>
|
|
90
|
-
<iframe src="..." style={{ width: '100%', height: '100%', border: 'none' }} />
|
|
91
|
-
</AspectRatio>
|
|
92
|
-
|
|
93
|
-
// Image (4:3)
|
|
94
|
-
<AspectRatio ratio={4 / 3}>
|
|
95
|
-
<img src="..." style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
|
|
96
|
-
</AspectRatio>
|
|
97
|
-
|
|
98
|
-
// Square
|
|
99
|
-
<AspectRatio ratio={1}>
|
|
100
|
-
<img src="..." style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
|
|
101
|
-
</AspectRatio>
|
|
102
|
-
`,
|
|
103
|
-
};
|
|
1
|
+
import { DemoStory } from '../../demo/demo-types';
|
|
2
|
+
import { AspectRatio, AspectRatioProps } from './aspect-ratio';
|
|
3
|
+
|
|
4
|
+
export const aspectRatioDemo: DemoStory<AspectRatioProps> = {
|
|
5
|
+
id: 'aspect-ratio',
|
|
6
|
+
text: 'AspectRatio',
|
|
7
|
+
args: {
|
|
8
|
+
ratio: 16 / 9,
|
|
9
|
+
children: <div />,
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
ratio: {
|
|
13
|
+
control: 'select',
|
|
14
|
+
options: [16 / 9, 4 / 3, 1, 9 / 16],
|
|
15
|
+
description: 'Aspect ratio (width / height)',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
render: (args) => {
|
|
19
|
+
return (
|
|
20
|
+
<div style={{ padding: '40px', display: 'flex', flexDirection: 'column', gap: '40px', maxWidth: '600px' }}>
|
|
21
|
+
<div>
|
|
22
|
+
<h3 style={{ marginBottom: '8px' }}>16 / 9 (Video)</h3>
|
|
23
|
+
<AspectRatio ratio={16 / 9}>
|
|
24
|
+
<div
|
|
25
|
+
style={{
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: '100%',
|
|
28
|
+
backgroundColor: 'var(--secondary-bg-color, #e5e7eb)',
|
|
29
|
+
borderRadius: '8px',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
color: 'var(--secondary-color, #6b7280)',
|
|
34
|
+
fontSize: '14px',
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
16:9 Content
|
|
38
|
+
</div>
|
|
39
|
+
</AspectRatio>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div>
|
|
43
|
+
<h3 style={{ marginBottom: '8px' }}>4 / 3 (Classic Photo)</h3>
|
|
44
|
+
<AspectRatio ratio={4 / 3}>
|
|
45
|
+
<div
|
|
46
|
+
style={{
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '100%',
|
|
49
|
+
backgroundColor: 'var(--secondary-bg-color, #e5e7eb)',
|
|
50
|
+
borderRadius: '8px',
|
|
51
|
+
display: 'flex',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
color: 'var(--secondary-color, #6b7280)',
|
|
55
|
+
fontSize: '14px',
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
4:3 Content
|
|
59
|
+
</div>
|
|
60
|
+
</AspectRatio>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div>
|
|
64
|
+
<h3 style={{ marginBottom: '8px' }}>1 / 1 (Square)</h3>
|
|
65
|
+
<AspectRatio ratio={1}>
|
|
66
|
+
<div
|
|
67
|
+
style={{
|
|
68
|
+
width: '100%',
|
|
69
|
+
height: '100%',
|
|
70
|
+
backgroundColor: 'var(--secondary-bg-color, #e5e7eb)',
|
|
71
|
+
borderRadius: '8px',
|
|
72
|
+
display: 'flex',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'center',
|
|
75
|
+
color: 'var(--secondary-color, #6b7280)',
|
|
76
|
+
fontSize: '14px',
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
1:1 Content
|
|
80
|
+
</div>
|
|
81
|
+
</AspectRatio>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
code: `import { AspectRatio } from 'lupine.components/component-pool';
|
|
87
|
+
|
|
88
|
+
// Video embed (16:9)
|
|
89
|
+
<AspectRatio ratio={16 / 9}>
|
|
90
|
+
<iframe src="..." style={{ width: '100%', height: '100%', border: 'none' }} />
|
|
91
|
+
</AspectRatio>
|
|
92
|
+
|
|
93
|
+
// Image (4:3)
|
|
94
|
+
<AspectRatio ratio={4 / 3}>
|
|
95
|
+
<img src="..." style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
|
|
96
|
+
</AspectRatio>
|
|
97
|
+
|
|
98
|
+
// Square
|
|
99
|
+
<AspectRatio ratio={1}>
|
|
100
|
+
<img src="..." style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
|
|
101
|
+
</AspectRatio>
|
|
102
|
+
`,
|
|
103
|
+
};
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
import { Avatar, AvatarGroup } from './avatar';
|
|
2
|
-
import { DemoStory } from '../../demo/demo-types';
|
|
3
|
-
|
|
4
|
-
export const avatarDemo: DemoStory<any> = {
|
|
5
|
-
id: 'avatarDemo',
|
|
6
|
-
text: 'Avatar',
|
|
7
|
-
args: {
|
|
8
|
-
maxCount: 3,
|
|
9
|
-
size: 'md',
|
|
10
|
-
shape: 'circle',
|
|
11
|
-
},
|
|
12
|
-
argTypes: {
|
|
13
|
-
maxCount: {
|
|
14
|
-
control: 'number',
|
|
15
|
-
description: 'Maximum visible avatars in a group',
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
control: 'select',
|
|
19
|
-
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
20
|
-
description: 'Size of the avatars',
|
|
21
|
-
},
|
|
22
|
-
shape: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: ['circle', 'rounded', 'square'],
|
|
25
|
-
description: 'Shape of the avatars',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
render: (args: any) => {
|
|
29
|
-
const css = {
|
|
30
|
-
display: 'flex',
|
|
31
|
-
flexDirection: 'column',
|
|
32
|
-
gap: '24px',
|
|
33
|
-
padding: '24px',
|
|
34
|
-
'.section-title': {
|
|
35
|
-
fontSize: '18px',
|
|
36
|
-
fontWeight: 'bold',
|
|
37
|
-
marginBottom: '12px',
|
|
38
|
-
color: 'var(--primary-color)',
|
|
39
|
-
},
|
|
40
|
-
'.demo-row': {
|
|
41
|
-
display: 'flex',
|
|
42
|
-
flexWrap: 'wrap',
|
|
43
|
-
gap: '16px',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div css={css}>
|
|
50
|
-
{/* Controllable Standalone */}
|
|
51
|
-
<section>
|
|
52
|
-
<div class='section-title'>
|
|
53
|
-
Controlled by Panel (Size: {args.size}, Shape: {args.shape})
|
|
54
|
-
</div>
|
|
55
|
-
<div class='demo-row'>
|
|
56
|
-
<Avatar size={args.size} shape={args.shape} src='https://i.pravatar.cc/150?u=99' online />
|
|
57
|
-
<Avatar size={args.size} shape={args.shape} initials='AD' />
|
|
58
|
-
</div>
|
|
59
|
-
</section>
|
|
60
|
-
|
|
61
|
-
{/* Sizes */}
|
|
62
|
-
<section>
|
|
63
|
-
<div class='section-title'>Sizes (Static)</div>
|
|
64
|
-
<div class='demo-row'>
|
|
65
|
-
<Avatar size='xs' initials='XS' />
|
|
66
|
-
<Avatar size='sm' initials='SM' />
|
|
67
|
-
<Avatar size='md' initials='MD' />
|
|
68
|
-
<Avatar size='lg' initials='LG' />
|
|
69
|
-
<Avatar size='xl' initials='XL' />
|
|
70
|
-
</div>
|
|
71
|
-
</section>
|
|
72
|
-
|
|
73
|
-
{/* Shapes */}
|
|
74
|
-
<section>
|
|
75
|
-
<div class='section-title'>Shapes (Static)</div>
|
|
76
|
-
<div class='demo-row'>
|
|
77
|
-
<Avatar shape='circle' initials='C' />
|
|
78
|
-
<Avatar shape='rounded' initials='R' />
|
|
79
|
-
<Avatar shape='square' initials='S' />
|
|
80
|
-
</div>
|
|
81
|
-
</section>
|
|
82
|
-
|
|
83
|
-
{/* Status */}
|
|
84
|
-
<section>
|
|
85
|
-
<div class='section-title'>Status Indicators</div>
|
|
86
|
-
<div class='demo-row'>
|
|
87
|
-
<Avatar size='md' src='https://i.pravatar.cc/150?u=3' status='online' />
|
|
88
|
-
<Avatar size='md' src='https://i.pravatar.cc/150?u=4' status='away' />
|
|
89
|
-
<Avatar size='md' src='https://i.pravatar.cc/150?u=5' status='busy' />
|
|
90
|
-
<Avatar size='md' src='https://i.pravatar.cc/150?u=6' status='offline' />
|
|
91
|
-
</div>
|
|
92
|
-
</section>
|
|
93
|
-
|
|
94
|
-
{/* Group */}
|
|
95
|
-
<section>
|
|
96
|
-
<div class='section-title'>
|
|
97
|
-
Avatar Group (maxCount: {args.maxCount}, size: {args.size})
|
|
98
|
-
</div>
|
|
99
|
-
<div class='demo-row'>
|
|
100
|
-
<AvatarGroup maxCount={args.maxCount} size={args.size}>
|
|
101
|
-
<Avatar src='https://i.pravatar.cc/150?u=7' />
|
|
102
|
-
<Avatar src='https://i.pravatar.cc/150?u=8' />
|
|
103
|
-
<Avatar src='https://i.pravatar.cc/150?u=9' />
|
|
104
|
-
<Avatar src='https://i.pravatar.cc/150?u=10' />
|
|
105
|
-
<Avatar src='https://i.pravatar.cc/150?u=11' />
|
|
106
|
-
<Avatar src='https://i.pravatar.cc/150?u=12' />
|
|
107
|
-
</AvatarGroup>
|
|
108
|
-
</div>
|
|
109
|
-
</section>
|
|
110
|
-
</div>
|
|
111
|
-
);
|
|
112
|
-
},
|
|
113
|
-
code: `import { Avatar, AvatarGroup } from 'lupine.components/component-pool';
|
|
114
|
-
|
|
115
|
-
// Standalone
|
|
116
|
-
<Avatar size="md" shape="circle" src="..." status="online" />
|
|
117
|
-
<Avatar size="lg" initials="AD" />
|
|
118
|
-
|
|
119
|
-
// Group
|
|
120
|
-
<AvatarGroup maxCount={3}>
|
|
121
|
-
<Avatar src="..." />
|
|
122
|
-
<Avatar src="..." />
|
|
123
|
-
<Avatar src="..." />
|
|
124
|
-
<Avatar src="..." />
|
|
125
|
-
</AvatarGroup>
|
|
126
|
-
`,
|
|
127
|
-
};
|
|
1
|
+
import { Avatar, AvatarGroup } from './avatar';
|
|
2
|
+
import { DemoStory } from '../../demo/demo-types';
|
|
3
|
+
|
|
4
|
+
export const avatarDemo: DemoStory<any> = {
|
|
5
|
+
id: 'avatarDemo',
|
|
6
|
+
text: 'Avatar',
|
|
7
|
+
args: {
|
|
8
|
+
maxCount: 3,
|
|
9
|
+
size: 'md',
|
|
10
|
+
shape: 'circle',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
maxCount: {
|
|
14
|
+
control: 'number',
|
|
15
|
+
description: 'Maximum visible avatars in a group',
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
20
|
+
description: 'Size of the avatars',
|
|
21
|
+
},
|
|
22
|
+
shape: {
|
|
23
|
+
control: 'select',
|
|
24
|
+
options: ['circle', 'rounded', 'square'],
|
|
25
|
+
description: 'Shape of the avatars',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
render: (args: any) => {
|
|
29
|
+
const css = {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
gap: '24px',
|
|
33
|
+
padding: '24px',
|
|
34
|
+
'.section-title': {
|
|
35
|
+
fontSize: '18px',
|
|
36
|
+
fontWeight: 'bold',
|
|
37
|
+
marginBottom: '12px',
|
|
38
|
+
color: 'var(--primary-color)',
|
|
39
|
+
},
|
|
40
|
+
'.demo-row': {
|
|
41
|
+
display: 'flex',
|
|
42
|
+
flexWrap: 'wrap',
|
|
43
|
+
gap: '16px',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div css={css}>
|
|
50
|
+
{/* Controllable Standalone */}
|
|
51
|
+
<section>
|
|
52
|
+
<div class='section-title'>
|
|
53
|
+
Controlled by Panel (Size: {args.size}, Shape: {args.shape})
|
|
54
|
+
</div>
|
|
55
|
+
<div class='demo-row'>
|
|
56
|
+
<Avatar size={args.size} shape={args.shape} src='https://i.pravatar.cc/150?u=99' online />
|
|
57
|
+
<Avatar size={args.size} shape={args.shape} initials='AD' />
|
|
58
|
+
</div>
|
|
59
|
+
</section>
|
|
60
|
+
|
|
61
|
+
{/* Sizes */}
|
|
62
|
+
<section>
|
|
63
|
+
<div class='section-title'>Sizes (Static)</div>
|
|
64
|
+
<div class='demo-row'>
|
|
65
|
+
<Avatar size='xs' initials='XS' />
|
|
66
|
+
<Avatar size='sm' initials='SM' />
|
|
67
|
+
<Avatar size='md' initials='MD' />
|
|
68
|
+
<Avatar size='lg' initials='LG' />
|
|
69
|
+
<Avatar size='xl' initials='XL' />
|
|
70
|
+
</div>
|
|
71
|
+
</section>
|
|
72
|
+
|
|
73
|
+
{/* Shapes */}
|
|
74
|
+
<section>
|
|
75
|
+
<div class='section-title'>Shapes (Static)</div>
|
|
76
|
+
<div class='demo-row'>
|
|
77
|
+
<Avatar shape='circle' initials='C' />
|
|
78
|
+
<Avatar shape='rounded' initials='R' />
|
|
79
|
+
<Avatar shape='square' initials='S' />
|
|
80
|
+
</div>
|
|
81
|
+
</section>
|
|
82
|
+
|
|
83
|
+
{/* Status */}
|
|
84
|
+
<section>
|
|
85
|
+
<div class='section-title'>Status Indicators</div>
|
|
86
|
+
<div class='demo-row'>
|
|
87
|
+
<Avatar size='md' src='https://i.pravatar.cc/150?u=3' status='online' />
|
|
88
|
+
<Avatar size='md' src='https://i.pravatar.cc/150?u=4' status='away' />
|
|
89
|
+
<Avatar size='md' src='https://i.pravatar.cc/150?u=5' status='busy' />
|
|
90
|
+
<Avatar size='md' src='https://i.pravatar.cc/150?u=6' status='offline' />
|
|
91
|
+
</div>
|
|
92
|
+
</section>
|
|
93
|
+
|
|
94
|
+
{/* Group */}
|
|
95
|
+
<section>
|
|
96
|
+
<div class='section-title'>
|
|
97
|
+
Avatar Group (maxCount: {args.maxCount}, size: {args.size})
|
|
98
|
+
</div>
|
|
99
|
+
<div class='demo-row'>
|
|
100
|
+
<AvatarGroup maxCount={args.maxCount} size={args.size}>
|
|
101
|
+
<Avatar src='https://i.pravatar.cc/150?u=7' />
|
|
102
|
+
<Avatar src='https://i.pravatar.cc/150?u=8' />
|
|
103
|
+
<Avatar src='https://i.pravatar.cc/150?u=9' />
|
|
104
|
+
<Avatar src='https://i.pravatar.cc/150?u=10' />
|
|
105
|
+
<Avatar src='https://i.pravatar.cc/150?u=11' />
|
|
106
|
+
<Avatar src='https://i.pravatar.cc/150?u=12' />
|
|
107
|
+
</AvatarGroup>
|
|
108
|
+
</div>
|
|
109
|
+
</section>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
code: `import { Avatar, AvatarGroup } from 'lupine.components/component-pool';
|
|
114
|
+
|
|
115
|
+
// Standalone
|
|
116
|
+
<Avatar size="md" shape="circle" src="..." status="online" />
|
|
117
|
+
<Avatar size="lg" initials="AD" />
|
|
118
|
+
|
|
119
|
+
// Group
|
|
120
|
+
<AvatarGroup maxCount={3}>
|
|
121
|
+
<Avatar src="..." />
|
|
122
|
+
<Avatar src="..." />
|
|
123
|
+
<Avatar src="..." />
|
|
124
|
+
<Avatar src="..." />
|
|
125
|
+
</AvatarGroup>
|
|
126
|
+
`,
|
|
127
|
+
};
|