lupine.components 1.1.55 → 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.
Files changed (136) hide show
  1. package/LICENSE +21 -21
  2. package/package.json +1 -1
  3. package/src/component-pool/aspect-ratio/aspect-ratio-demo.tsx +103 -103
  4. package/src/component-pool/avatar/avatar-demo.tsx +127 -127
  5. package/src/component-pool/badge/badge-demo.tsx +152 -152
  6. package/src/component-pool/breadcrumbs/breadcrumbs-demo.tsx +105 -105
  7. package/src/component-pool/card/card-demo.tsx +179 -179
  8. package/src/component-pool/carousel/carousel-demo.tsx +191 -191
  9. package/src/component-pool/cascader/cascader-demo.tsx +127 -127
  10. package/src/component-pool/charts/area-chart-demo.tsx +106 -106
  11. package/src/component-pool/charts/area-chart.tsx +254 -254
  12. package/src/component-pool/charts/bar-chart-demo.tsx +107 -107
  13. package/src/component-pool/charts/bar-chart.tsx +223 -223
  14. package/src/component-pool/charts/chart-utils.ts +182 -182
  15. package/src/component-pool/charts/column-chart-demo.tsx +111 -111
  16. package/src/component-pool/charts/column-chart.tsx +230 -230
  17. package/src/component-pool/charts/donut-chart-demo.tsx +112 -112
  18. package/src/component-pool/charts/donut-chart.tsx +6 -6
  19. package/src/component-pool/charts/gauge-chart-demo.tsx +101 -101
  20. package/src/component-pool/charts/gauge-chart.tsx +117 -117
  21. package/src/component-pool/charts/index.ts +19 -19
  22. package/src/component-pool/charts/line-chart-demo.tsx +109 -109
  23. package/src/component-pool/charts/line-chart.tsx +233 -233
  24. package/src/component-pool/charts/pie-chart-demo.tsx +133 -133
  25. package/src/component-pool/charts/pie-chart.tsx +142 -142
  26. package/src/component-pool/charts/radar-chart-demo.tsx +88 -88
  27. package/src/component-pool/charts/radar-chart.tsx +231 -231
  28. package/src/component-pool/charts/scatter-chart-demo.tsx +88 -88
  29. package/src/component-pool/charts/scatter-chart.tsx +237 -237
  30. package/src/component-pool/copy-button/copy-button-demo.tsx +71 -71
  31. package/src/component-pool/date-picker/date-picker-demo.tsx +84 -84
  32. package/src/component-pool/date-picker/date-picker.tsx +437 -437
  33. package/src/component-pool/date-picker/index.ts +2 -2
  34. package/src/component-pool/floating-icon-menu/floating-icon-menu-demo.tsx +94 -94
  35. package/src/component-pool/floating-icon-menu/floating-icon-menu.tsx +241 -241
  36. package/src/component-pool/floating-icon-menu/index.ts +2 -2
  37. package/src/component-pool/h-editor/h-editor-demo.tsx +112 -112
  38. package/src/component-pool/h-editor/h-editor.ts +862 -862
  39. package/src/component-pool/h-editor/index.ts +2 -2
  40. package/src/component-pool/i-editor/i-editor-demo.tsx +72 -72
  41. package/src/component-pool/i-editor/i-editor-frames.ts +42 -42
  42. package/src/component-pool/i-editor/i-editor-styles.ts +22 -22
  43. package/src/component-pool/i-editor/i-editor.ts +3869 -3869
  44. package/src/component-pool/i-editor/index.ts +2 -2
  45. package/src/component-pool/map-wrapper/map-wrapper-demo.tsx +55 -55
  46. package/src/component-pool/p-editor/index.ts +4 -4
  47. package/src/component-pool/p-editor/p-editor-demo.tsx +51 -51
  48. package/src/component-pool/p-editor/p-editor-styles.ts +44 -44
  49. package/src/component-pool/p-editor/p-editor-types.ts +4 -4
  50. package/src/component-pool/p-editor/p-editor-utils.ts +38 -38
  51. package/src/component-pool/p-editor/p-editor.ts +2477 -2477
  52. package/src/component-pool/pdf-viewer/index.ts +2 -2
  53. package/src/component-pool/pdf-viewer/pdf-viewer-demo.tsx +116 -116
  54. package/src/component-pool/pdf-viewer/pdf-viewer.tsx +56 -56
  55. package/src/component-pool/picker-helper.tsx +222 -222
  56. package/src/component-pool/pull-to-refresh/pull-to-refresh-demo.tsx +99 -99
  57. package/src/component-pool/qrcode/index.ts +3 -3
  58. package/src/component-pool/qrcode/qrcode-demo.tsx +102 -102
  59. package/src/component-pool/qrcode/qrcode.tsx +169 -169
  60. package/src/component-pool/radial-progress/index.ts +2 -2
  61. package/src/component-pool/radial-progress/radial-progress-demo.tsx +84 -84
  62. package/src/component-pool/radial-progress/radial-progress.tsx +118 -118
  63. package/src/component-pool/range/gauge-demo.tsx +113 -113
  64. package/src/component-pool/range/gauge.tsx +392 -392
  65. package/src/component-pool/range/range-demo.tsx +97 -97
  66. package/src/component-pool/search-input/index.ts +2 -2
  67. package/src/component-pool/search-input/search-input-demo.tsx +50 -50
  68. package/src/component-pool/search-input/search-input.tsx +125 -125
  69. package/src/component-pool/skeleton/skeleton-card.tsx +114 -114
  70. package/src/component-pool/skeleton/skeleton-demo.tsx +55 -55
  71. package/src/component-pool/svg-icons.ts +95 -95
  72. package/src/component-pool/svg-props.tsx +144 -144
  73. package/src/component-pool/tag-input/index.ts +2 -2
  74. package/src/component-pool/tag-input/tag-input-demo.tsx +47 -47
  75. package/src/component-pool/tag-input/tag-input.tsx +166 -166
  76. package/src/component-pool/time-picker/index.ts +2 -2
  77. package/src/component-pool/time-picker/time-picker-demo.tsx +80 -80
  78. package/src/component-pool/time-picker/time-picker.tsx +311 -311
  79. package/src/component-pool/timeline/timeline-demo.tsx +75 -75
  80. package/src/component-pool/tooltip/tooltip-demo.tsx +144 -144
  81. package/src/component-pool/tour/tour-demo.tsx +92 -92
  82. package/src/component-pool/youtube-player/index.ts +2 -2
  83. package/src/component-pool/youtube-player/youtube-player-demo.tsx +57 -57
  84. package/src/component-pool/youtube-player/youtube-player.tsx +116 -116
  85. package/src/components/action-sheet-color.tsx +269 -269
  86. package/src/components/action-sheet-date.tsx +299 -299
  87. package/src/components/action-sheet-demo.tsx +216 -216
  88. package/src/components/action-sheet-theme.tsx +150 -150
  89. package/src/components/action-sheet-time.tsx +157 -157
  90. package/src/components/input-number.tsx +206 -206
  91. package/src/components/input-with-title-demo.tsx +42 -42
  92. package/src/components/loading-spin.tsx +74 -74
  93. package/src/components/message-box-demo.tsx +107 -107
  94. package/src/components/mobile-components/mobile-side-menu-demo.tsx +47 -47
  95. package/src/components/modal-demo.tsx +56 -56
  96. package/src/components/notice-message-demo.tsx +57 -57
  97. package/src/components/paging-link-demo.tsx +430 -430
  98. package/src/components/popup-menu-demo.tsx +172 -172
  99. package/src/components/progress-demo.tsx +53 -53
  100. package/src/components/radio-label-demo.tsx +41 -41
  101. package/src/components/redirect-demo.tsx +36 -36
  102. package/src/components/resizable-splitter-demo.tsx +104 -104
  103. package/src/components/select-angle-demo.tsx +32 -32
  104. package/src/components/select-with-title-demo.tsx +53 -53
  105. package/src/components/slide-tab-component-demo.tsx +86 -86
  106. package/src/components/spinner-demo.tsx +52 -52
  107. package/src/components/stars-component-demo.tsx +36 -36
  108. package/src/components/switch-option-component.tsx +74 -74
  109. package/src/components/switch-option-demo.tsx +36 -36
  110. package/src/components/tabs-demo.tsx +42 -42
  111. package/src/components/text-glow-demo.tsx +46 -46
  112. package/src/components/text-scale-demo.tsx +41 -41
  113. package/src/components/text-wave-demo.tsx +48 -48
  114. package/src/components/toggle-button-demo.tsx +230 -230
  115. package/src/demo/demo-page.tsx +271 -271
  116. package/src/demo/demo-registry.ts +143 -143
  117. package/src/demo/demo-render-page.tsx +94 -94
  118. package/src/demo/demo-types.ts +22 -22
  119. package/src/demo/mock/demo-icons.ts +72 -72
  120. package/src/demo/mock/responsive-demo-mock-pages.tsx +197 -197
  121. package/src/demo/mock/side-menu-mock.tsx +113 -113
  122. package/src/demo/mock/user-settings-mock.tsx +310 -310
  123. package/src/frames/responsive-frame-demo.tsx +120 -120
  124. package/src/frames/slider-frame-demo.tsx +111 -111
  125. package/src/frames/slider-helper.tsx +194 -194
  126. package/src/lib/button-async-lock.tsx +43 -43
  127. package/src/lib/canvas/canvas-drawing.ts +503 -503
  128. package/src/lib/canvas/canvas-geometry.ts +255 -255
  129. package/src/lib/canvas/canvas-helper.tsx +176 -176
  130. package/src/lib/canvas/canvas-image.ts +110 -110
  131. package/src/lib/canvas/canvas-types.ts +93 -93
  132. package/src/lib/canvas/index.ts +5 -5
  133. package/src/lib/disable-console.ts +11 -11
  134. package/src/lib/disable-debug.ts +8 -8
  135. package/src/lib/support-safe-area.ts +25 -25
  136. package/tsconfig.json +113 -113
@@ -1,152 +1,152 @@
1
- import { DemoStory } from '../../demo/demo-types';
2
- import { Badge, BadgeProps } from './badge';
3
- import { SvgSvg, SvgPath } from '../svg-props';
4
-
5
- const BellIcon = () => (
6
- <SvgSvg
7
- width='24'
8
- height='24'
9
- viewBox='0 0 24 24'
10
- fill='none'
11
- stroke='currentColor'
12
- stroke-width='2'
13
- stroke-linecap='round'
14
- stroke-linejoin='round'
15
- >
16
- <SvgPath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9' />
17
- <SvgPath d='M13.73 21a2 2 0 0 1-3.46 0' />
18
- </SvgSvg>
19
- );
20
-
21
- const CheckIcon = () => (
22
- <SvgSvg
23
- width='12'
24
- height='12'
25
- viewBox='0 0 24 24'
26
- fill='none'
27
- stroke='currentColor'
28
- stroke-width='3'
29
- stroke-linecap='round'
30
- stroke-linejoin='round'
31
- >
32
- <SvgPath d='M20 6L9 17l-5-5' />
33
- </SvgSvg>
34
- );
35
-
36
- export const badgeDemo: DemoStory<BadgeProps> = {
37
- id: 'badge',
38
- text: 'Badge',
39
- args: {
40
- content: 5,
41
- max: 99,
42
- dot: false,
43
- color: 'var(--primary-bg-color, #ffffff)',
44
- bgColor: 'var(--danger-bg-color, var(--primary-accent-color, #e74c3c))',
45
- },
46
- argTypes: {
47
- content: { control: 'number', description: 'Number or text to display' },
48
- max: { control: 'number', description: 'Max number before showing +' },
49
- dot: { control: 'boolean', description: 'Show as dot instead of value' },
50
- color: { control: 'color', description: 'Text color' },
51
- bgColor: { control: 'color', description: 'Background color' },
52
- },
53
- render: (args) => {
54
- return (
55
- <div style={{ display: 'flex', flexDirection: 'column', gap: '30px', padding: '20px' }}>
56
- <div style={{ display: 'flex', gap: '40px', alignItems: 'center', flexWrap: 'wrap' }}>
57
- <div style={{ textAlign: 'center' }}>
58
- <div style={{ marginBottom: '16px' }}>Interactive Config</div>
59
- <Badge
60
- content={args.content}
61
- max={args.max}
62
- dot={args.dot}
63
- color={args.color}
64
- bgColor={args.bgColor}
65
- onClick={() => alert(`Badge clicked: ${args.content}`)}
66
- >
67
- <div
68
- style={{
69
- padding: '8px 16px',
70
- backgroundColor: 'var(--secondary-bg-color, #f0f0f0)',
71
- borderRadius: '4px',
72
- }}
73
- >
74
- Messages
75
- </div>
76
- </Badge>
77
- </div>
78
-
79
- <div style={{ textAlign: 'center' }}>
80
- <div style={{ marginBottom: '16px' }}>Max Value (99+)</div>
81
- <Badge content={150} max={99}>
82
- <div
83
- style={{
84
- padding: '8px 16px',
85
- backgroundColor: 'var(--secondary-bg-color, #f0f0f0)',
86
- borderRadius: '4px',
87
- }}
88
- >
89
- Notifications
90
- </div>
91
- </Badge>
92
- </div>
93
-
94
- <div style={{ textAlign: 'center' }}>
95
- <div style={{ marginBottom: '16px' }}>Dot Mode</div>
96
- <Badge dot={true}>
97
- <BellIcon />
98
- </Badge>
99
- </div>
100
-
101
- <div style={{ textAlign: 'center' }}>
102
- <div style={{ marginBottom: '16px' }}>Custom Node Content</div>
103
- <Badge content={<CheckIcon />} bgColor='var(--success-color, #2ecc71)'>
104
- <div
105
- style={{
106
- width: '40px',
107
- height: '40px',
108
- backgroundColor: 'var(--secondary-bg-color, #eee)',
109
- borderRadius: '4px',
110
- }}
111
- />
112
- </Badge>
113
- </div>
114
-
115
- <div style={{ textAlign: 'center' }}>
116
- <div style={{ marginBottom: '16px' }}>Text Content</div>
117
- <Badge content='NEW' bgColor='var(--primary-accent-color, #0a74c9)'>
118
- <div
119
- style={{
120
- padding: '8px 16px',
121
- backgroundColor: 'var(--secondary-bg-color, #f0f0f0)',
122
- borderRadius: '4px',
123
- }}
124
- >
125
- Features
126
- </div>
127
- </Badge>
128
- </div>
129
-
130
- <div style={{ textAlign: 'center' }}>
131
- <div style={{ marginBottom: '16px' }}>Standalone Badge</div>
132
- <Badge content='Status: Online' bgColor='var(--success-color, #2ecc71)' />
133
- </div>
134
- </div>
135
- </div>
136
- );
137
- },
138
- code: `import { Badge } from 'lupine.components/component-pool';
139
-
140
- <Badge content={5} max={99} bgColor="red" color="white" onClick={...}>
141
- <div>Anchor Element</div>
142
- </Badge>
143
-
144
- <Badge dot={true}>
145
- <Icon />
146
- </Badge>
147
-
148
- <Badge content={<CheckIcon />} bgColor="green">
149
- <div>Task</div>
150
- </Badge>
151
- `,
152
- };
1
+ import { DemoStory } from '../../demo/demo-types';
2
+ import { Badge, BadgeProps } from './badge';
3
+ import { SvgSvg, SvgPath } from '../svg-props';
4
+
5
+ const BellIcon = () => (
6
+ <SvgSvg
7
+ width='24'
8
+ height='24'
9
+ viewBox='0 0 24 24'
10
+ fill='none'
11
+ stroke='currentColor'
12
+ stroke-width='2'
13
+ stroke-linecap='round'
14
+ stroke-linejoin='round'
15
+ >
16
+ <SvgPath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9' />
17
+ <SvgPath d='M13.73 21a2 2 0 0 1-3.46 0' />
18
+ </SvgSvg>
19
+ );
20
+
21
+ const CheckIcon = () => (
22
+ <SvgSvg
23
+ width='12'
24
+ height='12'
25
+ viewBox='0 0 24 24'
26
+ fill='none'
27
+ stroke='currentColor'
28
+ stroke-width='3'
29
+ stroke-linecap='round'
30
+ stroke-linejoin='round'
31
+ >
32
+ <SvgPath d='M20 6L9 17l-5-5' />
33
+ </SvgSvg>
34
+ );
35
+
36
+ export const badgeDemo: DemoStory<BadgeProps> = {
37
+ id: 'badge',
38
+ text: 'Badge',
39
+ args: {
40
+ content: 5,
41
+ max: 99,
42
+ dot: false,
43
+ color: 'var(--primary-bg-color, #ffffff)',
44
+ bgColor: 'var(--danger-bg-color, var(--primary-accent-color, #e74c3c))',
45
+ },
46
+ argTypes: {
47
+ content: { control: 'number', description: 'Number or text to display' },
48
+ max: { control: 'number', description: 'Max number before showing +' },
49
+ dot: { control: 'boolean', description: 'Show as dot instead of value' },
50
+ color: { control: 'color', description: 'Text color' },
51
+ bgColor: { control: 'color', description: 'Background color' },
52
+ },
53
+ render: (args) => {
54
+ return (
55
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '30px', padding: '20px' }}>
56
+ <div style={{ display: 'flex', gap: '40px', alignItems: 'center', flexWrap: 'wrap' }}>
57
+ <div style={{ textAlign: 'center' }}>
58
+ <div style={{ marginBottom: '16px' }}>Interactive Config</div>
59
+ <Badge
60
+ content={args.content}
61
+ max={args.max}
62
+ dot={args.dot}
63
+ color={args.color}
64
+ bgColor={args.bgColor}
65
+ onClick={() => alert(`Badge clicked: ${args.content}`)}
66
+ >
67
+ <div
68
+ style={{
69
+ padding: '8px 16px',
70
+ backgroundColor: 'var(--secondary-bg-color, #f0f0f0)',
71
+ borderRadius: '4px',
72
+ }}
73
+ >
74
+ Messages
75
+ </div>
76
+ </Badge>
77
+ </div>
78
+
79
+ <div style={{ textAlign: 'center' }}>
80
+ <div style={{ marginBottom: '16px' }}>Max Value (99+)</div>
81
+ <Badge content={150} max={99}>
82
+ <div
83
+ style={{
84
+ padding: '8px 16px',
85
+ backgroundColor: 'var(--secondary-bg-color, #f0f0f0)',
86
+ borderRadius: '4px',
87
+ }}
88
+ >
89
+ Notifications
90
+ </div>
91
+ </Badge>
92
+ </div>
93
+
94
+ <div style={{ textAlign: 'center' }}>
95
+ <div style={{ marginBottom: '16px' }}>Dot Mode</div>
96
+ <Badge dot={true}>
97
+ <BellIcon />
98
+ </Badge>
99
+ </div>
100
+
101
+ <div style={{ textAlign: 'center' }}>
102
+ <div style={{ marginBottom: '16px' }}>Custom Node Content</div>
103
+ <Badge content={<CheckIcon />} bgColor='var(--success-color, #2ecc71)'>
104
+ <div
105
+ style={{
106
+ width: '40px',
107
+ height: '40px',
108
+ backgroundColor: 'var(--secondary-bg-color, #eee)',
109
+ borderRadius: '4px',
110
+ }}
111
+ />
112
+ </Badge>
113
+ </div>
114
+
115
+ <div style={{ textAlign: 'center' }}>
116
+ <div style={{ marginBottom: '16px' }}>Text Content</div>
117
+ <Badge content='NEW' bgColor='var(--primary-accent-color, #0a74c9)'>
118
+ <div
119
+ style={{
120
+ padding: '8px 16px',
121
+ backgroundColor: 'var(--secondary-bg-color, #f0f0f0)',
122
+ borderRadius: '4px',
123
+ }}
124
+ >
125
+ Features
126
+ </div>
127
+ </Badge>
128
+ </div>
129
+
130
+ <div style={{ textAlign: 'center' }}>
131
+ <div style={{ marginBottom: '16px' }}>Standalone Badge</div>
132
+ <Badge content='Status: Online' bgColor='var(--success-color, #2ecc71)' />
133
+ </div>
134
+ </div>
135
+ </div>
136
+ );
137
+ },
138
+ code: `import { Badge } from 'lupine.components/component-pool';
139
+
140
+ <Badge content={5} max={99} bgColor="red" color="white" onClick={...}>
141
+ <div>Anchor Element</div>
142
+ </Badge>
143
+
144
+ <Badge dot={true}>
145
+ <Icon />
146
+ </Badge>
147
+
148
+ <Badge content={<CheckIcon />} bgColor="green">
149
+ <div>Task</div>
150
+ </Badge>
151
+ `,
152
+ };
@@ -1,105 +1,105 @@
1
- import { DemoStory } from '../../demo/demo-types';
2
- import { Breadcrumbs, BreadcrumbsProps } from './breadcrumbs';
3
- import { SvgSvg, SvgPath } from '../svg-props';
4
-
5
- const HomeIcon = () => (
6
- <SvgSvg
7
- width='14'
8
- height='14'
9
- viewBox='0 0 24 24'
10
- fill='none'
11
- stroke='currentColor'
12
- stroke-width='2'
13
- stroke-linecap='round'
14
- stroke-linejoin='round'
15
- >
16
- <SvgPath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z' />
17
- <SvgPath d='M9 22V12h6v10' />
18
- </SvgSvg>
19
- );
20
-
21
- const FolderIcon = () => (
22
- <SvgSvg
23
- width='14'
24
- height='14'
25
- viewBox='0 0 24 24'
26
- fill='none'
27
- stroke='currentColor'
28
- stroke-width='2'
29
- stroke-linecap='round'
30
- stroke-linejoin='round'
31
- >
32
- <SvgPath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z' />
33
- </SvgSvg>
34
- );
35
-
36
- export const breadcrumbsDemo: DemoStory<BreadcrumbsProps> = {
37
- id: 'breadcrumbs',
38
- text: 'Breadcrumbs',
39
- args: {
40
- autoCollapse: true,
41
- items: [],
42
- },
43
- argTypes: {
44
- autoCollapse: { control: 'boolean', description: 'Automatically collapse middle items on overflow' },
45
- },
46
- render: (args) => {
47
- const longItems = [
48
- { text: 'Home', url: '/', icon: <HomeIcon /> },
49
- { text: 'Settings', url: '/settings', icon: <FolderIcon /> },
50
- { text: 'Account Profile', url: '/account' },
51
- { text: 'Security Preferences', url: '/security' },
52
- { text: 'Two-Factor Auth', url: '/2fa' },
53
- { text: 'Active Sessions' },
54
- ];
55
-
56
- const shortItems = [{ text: 'Dashboard', url: '/dashboard' }, { text: 'Overview' }];
57
-
58
- return (
59
- <div style={{ padding: '40px', display: 'flex', flexDirection: 'column', gap: '40px' }}>
60
- <div>
61
- <h3 style={{ marginBottom: '20px' }}>Auto-Collapsing Long Breadcrumbs</h3>
62
- <p style={{ color: 'var(--secondary-color, #666)', fontSize: '13px', marginBottom: '10px' }}>
63
- Scale the window (or iframe) down to see the middle sections collapse into an ellipsis `...`
64
- </p>
65
- <div
66
- style={{
67
- padding: '16px',
68
- border: '1px solid var(--primary-border, #eee)',
69
- borderRadius: '8px',
70
- backgroundColor: 'var(--secondary-bg-color, #fafafa)',
71
- }}
72
- >
73
- <Breadcrumbs items={longItems} autoCollapse={args.autoCollapse} />
74
- </div>
75
- </div>
76
-
77
- <div>
78
- <h3 style={{ marginBottom: '20px' }}>Short Breadcrumbs</h3>
79
- <div
80
- style={{
81
- padding: '16px',
82
- border: '1px solid var(--primary-border, #eee)',
83
- borderRadius: '8px',
84
- backgroundColor: 'var(--secondary-bg-color, #fafafa)',
85
- }}
86
- >
87
- <Breadcrumbs items={shortItems} autoCollapse={args.autoCollapse} />
88
- </div>
89
- </div>
90
- </div>
91
- );
92
- },
93
- code: `import { Breadcrumbs } from 'lupine.components/component-pool';
94
-
95
- const items = [
96
- { text: 'Home', url: '/' },
97
- { text: 'Settings', url: '/settings' },
98
- { text: 'Account Profile', url: '/account' },
99
- { text: 'Active Sessions' }, // Last item is automatically rendered as current page
100
- ];
101
-
102
- // Automatically handles overflow and collapse logic naturally via container ResizeObserver
103
- <Breadcrumbs items={items} autoCollapse={true} />
104
- `,
105
- };
1
+ import { DemoStory } from '../../demo/demo-types';
2
+ import { Breadcrumbs, BreadcrumbsProps } from './breadcrumbs';
3
+ import { SvgSvg, SvgPath } from '../svg-props';
4
+
5
+ const HomeIcon = () => (
6
+ <SvgSvg
7
+ width='14'
8
+ height='14'
9
+ viewBox='0 0 24 24'
10
+ fill='none'
11
+ stroke='currentColor'
12
+ stroke-width='2'
13
+ stroke-linecap='round'
14
+ stroke-linejoin='round'
15
+ >
16
+ <SvgPath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z' />
17
+ <SvgPath d='M9 22V12h6v10' />
18
+ </SvgSvg>
19
+ );
20
+
21
+ const FolderIcon = () => (
22
+ <SvgSvg
23
+ width='14'
24
+ height='14'
25
+ viewBox='0 0 24 24'
26
+ fill='none'
27
+ stroke='currentColor'
28
+ stroke-width='2'
29
+ stroke-linecap='round'
30
+ stroke-linejoin='round'
31
+ >
32
+ <SvgPath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z' />
33
+ </SvgSvg>
34
+ );
35
+
36
+ export const breadcrumbsDemo: DemoStory<BreadcrumbsProps> = {
37
+ id: 'breadcrumbs',
38
+ text: 'Breadcrumbs',
39
+ args: {
40
+ autoCollapse: true,
41
+ items: [],
42
+ },
43
+ argTypes: {
44
+ autoCollapse: { control: 'boolean', description: 'Automatically collapse middle items on overflow' },
45
+ },
46
+ render: (args) => {
47
+ const longItems = [
48
+ { text: 'Home', url: '/', icon: <HomeIcon /> },
49
+ { text: 'Settings', url: '/settings', icon: <FolderIcon /> },
50
+ { text: 'Account Profile', url: '/account' },
51
+ { text: 'Security Preferences', url: '/security' },
52
+ { text: 'Two-Factor Auth', url: '/2fa' },
53
+ { text: 'Active Sessions' },
54
+ ];
55
+
56
+ const shortItems = [{ text: 'Dashboard', url: '/dashboard' }, { text: 'Overview' }];
57
+
58
+ return (
59
+ <div style={{ padding: '40px', display: 'flex', flexDirection: 'column', gap: '40px' }}>
60
+ <div>
61
+ <h3 style={{ marginBottom: '20px' }}>Auto-Collapsing Long Breadcrumbs</h3>
62
+ <p style={{ color: 'var(--secondary-color, #666)', fontSize: '13px', marginBottom: '10px' }}>
63
+ Scale the window (or iframe) down to see the middle sections collapse into an ellipsis `...`
64
+ </p>
65
+ <div
66
+ style={{
67
+ padding: '16px',
68
+ border: '1px solid var(--primary-border, #eee)',
69
+ borderRadius: '8px',
70
+ backgroundColor: 'var(--secondary-bg-color, #fafafa)',
71
+ }}
72
+ >
73
+ <Breadcrumbs items={longItems} autoCollapse={args.autoCollapse} />
74
+ </div>
75
+ </div>
76
+
77
+ <div>
78
+ <h3 style={{ marginBottom: '20px' }}>Short Breadcrumbs</h3>
79
+ <div
80
+ style={{
81
+ padding: '16px',
82
+ border: '1px solid var(--primary-border, #eee)',
83
+ borderRadius: '8px',
84
+ backgroundColor: 'var(--secondary-bg-color, #fafafa)',
85
+ }}
86
+ >
87
+ <Breadcrumbs items={shortItems} autoCollapse={args.autoCollapse} />
88
+ </div>
89
+ </div>
90
+ </div>
91
+ );
92
+ },
93
+ code: `import { Breadcrumbs } from 'lupine.components/component-pool';
94
+
95
+ const items = [
96
+ { text: 'Home', url: '/' },
97
+ { text: 'Settings', url: '/settings' },
98
+ { text: 'Account Profile', url: '/account' },
99
+ { text: 'Active Sessions' }, // Last item is automatically rendered as current page
100
+ ];
101
+
102
+ // Automatically handles overflow and collapse logic naturally via container ResizeObserver
103
+ <Breadcrumbs items={items} autoCollapse={true} />
104
+ `,
105
+ };