@yamatozhen/design_system 1.0.1 → 1.1.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/LICENSE +201 -201
- package/README.md +101 -101
- package/package.json +50 -50
- package/scripts/postinstall.js +91 -91
- package/template/app/ClientNav.tsx +258 -310
- package/template/app/globals.css +2 -167
- package/template/app/layout.tsx +94 -82
- package/template/app/themes/dark-mc 2.css +51 -0
- package/template/app/themes/dark-mc.css +51 -51
- package/template/app/themes/dark.css +51 -51
- package/template/app/themes/light 2.css +51 -0
- package/template/app/themes/light-mc 2.css +51 -0
- package/template/app/themes/light-mc.css +51 -51
- package/template/app/themes/light.css +51 -51
- package/template/app/themes/theme 2.css +272 -0
- package/template/app/themes/theme.css +272 -82
- package/template/components/{layout/button → (buttons)}/Button.module.css +351 -305
- package/template/components/{layout/button → (buttons)}/ButtonGroup.tsx +414 -503
- package/template/components/{layout/button → (buttons)}/FAB.tsx +119 -118
- package/template/components/(buttons)/button.tsx +164 -0
- package/template/components/(controls)/slider/Slider.module.css +250 -0
- package/template/components/(controls)/slider/Slider.tsx +386 -0
- package/template/components/(controls)/switch/Switch.module.css +108 -0
- package/template/components/(controls)/switch/Switch.tsx +69 -0
- package/template/components/(date & time)/calendar/Calendar.module.css +125 -0
- package/template/components/(date & time)/calendar/Calendar.tsx +206 -0
- package/template/components/(date & time)/dateField/DateField.module.css +25 -0
- package/template/components/(date & time)/dateField/DateField.tsx +193 -0
- package/template/components/(date & time)/datePicker/DatePicker.tsx +118 -0
- package/template/components/(date & time)/dateRangePicker/DateRangePicker.tsx +144 -0
- package/template/components/(date & time)/rangeCalendar/RangeCalendar.module.css +203 -0
- package/template/components/(date & time)/rangeCalendar/RangeCalendar.tsx +263 -0
- package/template/components/(date & time)/shared/dateUtils.ts +107 -0
- package/template/components/(date & time)/timeField/TimeField.module.css +39 -0
- package/template/components/(date & time)/timeField/TimeField.tsx +158 -0
- package/template/components/(feedback)/circularProgress/CircularProgress.tsx +646 -0
- package/template/components/(feedback)/linearProgress/LinearProgress.tsx +337 -0
- package/template/components/(feedback)/meter/Meter.tsx +111 -0
- package/template/components/(feedback)/skeleton/Skeleton.module.css +49 -0
- package/template/components/(feedback)/skeleton/Skeleton.tsx +32 -0
- package/template/components/(feedback)/spinner/Spinner.module.css +27 -0
- package/template/components/(feedback)/spinner/Spinner.tsx +60 -0
- package/template/components/(forms)/checkbox/Checkbox.tsx +121 -0
- package/template/components/(forms)/checkboxGroup/CheckboxGroup.tsx +83 -0
- package/template/components/(forms)/description/Description.tsx +34 -0
- package/template/components/(forms)/errorMessage/ErrorMessage.tsx +31 -0
- package/template/components/(forms)/fieldError/FieldError.tsx +39 -0
- package/template/components/(forms)/fieldset/Fieldset.tsx +51 -0
- package/template/components/(forms)/form/Form.tsx +54 -0
- package/template/components/(forms)/input/Input.tsx +50 -0
- package/template/components/(forms)/inputGroup/InputGroup.tsx +65 -0
- package/template/components/(forms)/inputOtp/InputOtp.tsx +139 -0
- package/template/components/(forms)/label/Label.tsx +46 -0
- package/template/components/(forms)/numberField/NumberField.tsx +292 -0
- package/template/components/(forms)/radioGroup/RadioGroup.tsx +175 -0
- package/template/components/(forms)/searchField/SearchField.tsx +139 -0
- package/template/components/(forms)/shared/field.module.css +75 -0
- package/template/components/(forms)/shared/fieldContext.ts +28 -0
- package/template/components/(forms)/textArea/TextArea.tsx +55 -0
- package/template/components/(forms)/textField/TextField.tsx +91 -0
- package/template/components/{layout → (layout)}/Lightbox/LightboxCard.tsx +100 -100
- package/template/components/{layout → (layout)}/Lightbox/LightboxGallery.module.css +249 -249
- package/template/components/{layout → (layout)}/Lightbox/LightboxGallery.tsx +72 -72
- package/template/components/{layout → (layout)}/Lightbox/LightboxGrid.tsx +185 -186
- package/template/components/{layout → (layout)}/Lightbox/LightboxModal.module.css +395 -395
- package/template/components/{layout → (layout)}/Lightbox/LightboxModal.tsx +498 -500
- package/template/components/{layout → (layout)}/Lightbox/demo.tsx +396 -412
- package/template/components/{layout → (layout)}/Lightbox/index.ts +30 -30
- package/template/components/{layout → (layout)}/Lightbox/types.ts +101 -113
- package/template/components/{layout → (layout)}/Lightbox/useLightboxFilters.ts +140 -140
- package/template/components/(layout)/accordion/Accordion.module.css +108 -0
- package/template/components/(layout)/accordion/Accordion.tsx +251 -0
- package/template/components/(layout)/card/Card.module.css +136 -0
- package/template/components/(layout)/card/Card.tsx +371 -0
- package/template/components/(layout)/list/List.module.css +83 -0
- package/template/components/(layout)/list/List.tsx +332 -0
- package/template/components/{layout → (layout)}/navigation/Wrap.tsx +41 -41
- package/template/components/(layout)/navigation/breadcrumbs/Breadcrumbs.tsx +145 -0
- package/template/components/{layout/navigation/nav/Nav.module.css → (layout)/navigation/nav/Nav.module.css.old} +474 -508
- package/template/components/{layout → (layout)}/navigation/nav/Nav.tsx +186 -167
- package/template/components/{layout → (layout)}/navigation/nav/NavBar.tsx +396 -419
- package/template/components/{layout → (layout)}/navigation/nav/NavContext.tsx +259 -259
- package/template/components/{layout → (layout)}/navigation/nav/NavItem.tsx +195 -173
- package/template/components/{layout → (layout)}/navigation/nav/NavNew.module.css +406 -373
- package/template/components/{layout → (layout)}/navigation/nav/NavRail.tsx +317 -315
- package/template/components/{layout → (layout)}/navigation/nav/NavSection.tsx +101 -102
- package/template/components/{layout → (layout)}/navigation/nav/NavTab.tsx +25 -25
- package/template/components/{layout → (layout)}/navigation/nav/navftb/NavFTB.module.css +253 -252
- package/template/components/{layout → (layout)}/navigation/nav/navftb/NavFTB.tsx +448 -399
- package/template/components/{layout → (layout)}/navigation/nav/navftb/useTabIndicator.ts +498 -484
- package/template/components/{layout → (layout)}/navigation/nav/navheader/NavHeader.module.css +59 -59
- package/template/components/{layout → (layout)}/navigation/nav/navheader/NavHeader.tsx +465 -473
- package/template/components/(layout)/navigation/pagination/Pagination.tsx +261 -0
- package/template/components/{layout → (layout)}/pages/loadingScreen.tsx +117 -102
- package/template/components/{layout → (layout)}/pages/maintenance/Maintenance.tsx +52 -52
- package/template/components/{layout → (layout)}/pages/maintenance/maintenance.module.css +162 -162
- package/template/components/(layout)/scrollShadow/ScrollShadow.module.css +81 -0
- package/template/components/(layout)/scrollShadow/ScrollShadow.tsx +161 -0
- package/template/components/(layout)/scrollShadow/useScrollShadow.ts +130 -0
- package/template/components/(layout)/separator/Separator.tsx +112 -0
- package/template/components/(overlays)/accessibilityModal/AccessibilityModal.tsx +307 -0
- package/template/components/(overlays)/drawer/Drawer.tsx +953 -0
- package/template/components/(overlays)/modal/Modal.tsx +654 -0
- package/template/components/(overlays)/popover/Popover.tsx +420 -0
- package/template/components/(overlays)/toast/Toast.tsx +692 -0
- package/template/components/(pickers)/autocomplete/Autocomplete.tsx +24 -0
- package/template/components/(pickers)/comboBox/ComboBox.tsx +21 -0
- package/template/components/(pickers)/select/Select.tsx +188 -0
- package/template/components/(pickers)/shared/FilterableField.tsx +223 -0
- package/template/components/(pickers)/shared/PickerItem.ts +13 -0
- package/template/components/tools/CustomScrollbar 2.tsx +107 -0
- package/template/components/tools/CustomScrollbar.tsx +107 -0
- package/template/components/tools/Divider 2.tsx +11 -0
- package/template/components/tools/Divider.tsx +11 -11
- package/template/components/tools/ReduceMotionContext 2.tsx +5 -0
- package/template/components/tools/ReduceMotionContext.tsx +5 -5
- package/template/components/tools/Sinewave 2.tsx +206 -0
- package/template/components/tools/Sinewave.tsx +396 -199
- package/template/components/tools/SinewaveProgress 2.tsx +140 -0
- package/template/components/tools/SinewaveProgress.tsx +140 -135
- package/template/components/tools/badge/Badge 2.tsx +28 -0
- package/template/components/tools/badge/Badge.tsx +28 -28
- package/template/components/tools/dropdown/drop.module.css +196 -0
- package/template/components/tools/dropdown/drop.tsx +568 -0
- package/template/components/tools/easing.ts +118 -0
- package/template/components/tools/flubber.d 2.ts +7 -0
- package/template/components/tools/flubber.d.ts +6 -6
- package/template/components/tools/footer/Footer.tsx +20 -0
- package/template/components/tools/input/Input 2.tsx +99 -0
- package/template/components/tools/input/Input.module 2.css +45 -0
- package/template/components/tools/input/Input.module.css +45 -0
- package/template/components/tools/input/Input.tsx +99 -0
- package/template/components/tools/label/Icon 2.tsx +39 -0
- package/template/components/tools/label/Icon.tsx +39 -0
- package/template/components/tools/label/Label 2.tsx +150 -0
- package/template/components/tools/label/Label.tsx +156 -0
- package/template/components/tools/mobileViewProvider 2.tsx +53 -0
- package/template/components/tools/mobileViewProvider.tsx +53 -58
- package/template/components/tools/ripple/ripple 2.css +38 -0
- package/template/components/tools/ripple/ripple 2.tsx +78 -0
- package/template/components/tools/ripple/ripple.css +38 -41
- package/template/components/tools/ripple/ripple.tsx +78 -53
- package/template/components/tools/shape/{ShapeMorph.tsx → Shape 2.tsx } +313 -190
- package/template/components/tools/shape/Shape.module 2.css +21 -0
- package/template/components/tools/shape/Shape.module.css +25 -0
- package/template/components/tools/shape/Shape.tsx +316 -0
- package/template/components/tools/shape/ShapeLoader 2.tsx +104 -0
- package/template/components/tools/shape/ShapeLoader.tsx +104 -101
- package/template/components/tools/shape/ShapePaths 2.ts +116 -0
- package/template/components/tools/shape/ShapePaths.ts +116 -116
- package/template/components/{layout/switch/Switch.tsx → tools/switch/Switch 2.tsx } +48 -48
- package/template/components/{layout/switch/Switch.module.css → tools/switch/Switch.module 2.css } +102 -102
- package/template/components/tools/switch/Switch.module.css +102 -102
- package/template/components/tools/switch/Switch.tsx +48 -48
- package/template/components/tools/useBodyScrollLock 2.tsx +27 -0
- package/template/components/tools/useBodyScrollLock.tsx +27 -27
- package/template/components/tools/useImageColor 2.ts +47 -0
- package/template/components/tools/useImageColor.ts +47 -47
- package/template/components/tools/useNavSheetDrag 2.tsx +196 -0
- package/template/components/tools/useNavSheetDrag.tsx +196 -196
- package/template/public/fonts/material-symbols/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght 2.woff2 +0 -0
- package/template/components/layout/accordion/Accordion.module.css +0 -149
- package/template/components/layout/accordion/Accordion.tsx +0 -114
- package/template/components/layout/button/button.tsx +0 -128
- package/template/components/layout/button/drop.module.css +0 -229
- package/template/components/layout/button/drop.tsx +0 -516
- package/template/components/layout/hero/v1/heroSlideshow.module.css +0 -107
- package/template/components/layout/hero/v1/heroSlideshow.tsx +0 -233
- package/template/components/layout/modals/accessibilityModal/AccessibilityModal.module.css +0 -126
- package/template/components/layout/modals/accessibilityModal/AccessibilityModal.tsx +0 -290
- package/template/components/layout/modals/alert/Alert.tsx +0 -188
- package/template/components/layout/navigation/MioCard.module.css +0 -88
- package/template/components/layout/navigation/MioCard.tsx +0 -266
- package/template/components/tools/ProgressiveBlur.tsx +0 -73
- package/template/components/tools/icon/icon.module.css +0 -0
- package/template/components/tools/icon/icon.tsx +0 -125
- package/template/components/tools/react-bits/ClickSpark.tsx +0 -177
- package/template/components/tools/react-bits/FadeContent.tsx +0 -90
- package/template/components/tools/react-bits/GlareHover.tsx +0 -73
- package/template/components/tools/react-bits/GradientText/GradientText.css +0 -70
- package/template/components/tools/react-bits/GradientText/GradientText.tsx +0 -44
- package/template/components/tools/react-bits/Magnet.tsx +0 -118
- package/template/components/tools/react-bits/Stepper/Stepper.css +0 -134
- package/template/components/tools/react-bits/Stepper/Stepper.tsx +0 -412
|
@@ -1,500 +1,498 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useCallback,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
useState,
|
|
8
|
-
type AnimationEvent as ReactAnimationEvent,
|
|
9
|
-
type MouseEvent as ReactMouseEvent,
|
|
10
|
-
} from "react";
|
|
11
|
-
import { createPortal } from "react-dom";
|
|
12
|
-
import Image from "next/image";
|
|
13
|
-
import type { LightboxItem } from "./types";
|
|
14
|
-
import styles from "./LightboxModal.module.css";
|
|
15
|
-
import Button from "
|
|
16
|
-
import Icon from "@/components/tools/
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const [
|
|
62
|
-
const [
|
|
63
|
-
const [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
setIsClosing(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
if (!
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
if (!st
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
e.preventDefault();
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
scrollEl.addEventListener("
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
if (
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
document.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
return
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
<
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
{internalItem.
|
|
434
|
-
<
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
circle
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
);
|
|
500
|
-
}
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useCallback,
|
|
5
|
+
useEffect,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
type AnimationEvent as ReactAnimationEvent,
|
|
9
|
+
type MouseEvent as ReactMouseEvent,
|
|
10
|
+
} from "react";
|
|
11
|
+
import { createPortal } from "react-dom";
|
|
12
|
+
import Image from "next/image";
|
|
13
|
+
import type { LightboxItem } from "./types";
|
|
14
|
+
import styles from "./LightboxModal.module.css";
|
|
15
|
+
import Button from "../../(buttons)/ButtonGroup";
|
|
16
|
+
import Icon from "@/components/tools/label/Icon";
|
|
17
|
+
import {
|
|
18
|
+
useBreakpoints,
|
|
19
|
+
useMediaQuery,
|
|
20
|
+
} from "@/components/tools/mobileViewProvider";
|
|
21
|
+
import Sinewave from "@/components/tools/Sinewave";
|
|
22
|
+
|
|
23
|
+
export interface LightboxModalProps {
|
|
24
|
+
/** The item to display. Pass `null` to close. */
|
|
25
|
+
item: LightboxItem | null;
|
|
26
|
+
/** Called when the user requests close (X, backdrop click, Esc). */
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
/** Called when the user toggles favorite on the open item. */
|
|
29
|
+
onToggleFavorite?: (item: LightboxItem) => void;
|
|
30
|
+
/** Called when the user clicks Share. Defaults to a console.log stub. */
|
|
31
|
+
onShare?: (item: LightboxItem, slideIndex: number) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Builds the URL written to clipboard by the Copy button.
|
|
34
|
+
* Defaults to `${origin}${pathname}?id=${id}&slide=${i}`.
|
|
35
|
+
*/
|
|
36
|
+
buildShareUrl?: (item: LightboxItem, slideIndex: number) => string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Modal that renders an artwork item as a vertical scroll of slides plus a
|
|
41
|
+
* sticky side panel. Mounts via a portal to `document.body`. Plays an open
|
|
42
|
+
* animation when `item` becomes non-null, a close animation when it returns
|
|
43
|
+
* to `null`, and unmounts after the close animation completes.
|
|
44
|
+
*
|
|
45
|
+
* Keyboard:
|
|
46
|
+
* Esc → close
|
|
47
|
+
* ArrowDown / ArrowRight → scroll to next slide
|
|
48
|
+
* ArrowUp / ArrowLeft → scroll to previous slide
|
|
49
|
+
*
|
|
50
|
+
* Theming exposed via CSS variables on the backdrop element — see the
|
|
51
|
+
* accompanying `.module.css` for the full list.
|
|
52
|
+
*/
|
|
53
|
+
export function LightboxModal({
|
|
54
|
+
item,
|
|
55
|
+
onClose,
|
|
56
|
+
onToggleFavorite,
|
|
57
|
+
onShare,
|
|
58
|
+
buildShareUrl,
|
|
59
|
+
}: LightboxModalProps) {
|
|
60
|
+
const [internalItem, setInternalItem] = useState<LightboxItem | null>(null);
|
|
61
|
+
const [isClosing, setIsClosing] = useState(false);
|
|
62
|
+
const [activeIdx, setActiveIdx] = useState(0);
|
|
63
|
+
const [, setCopied] = useState(false);
|
|
64
|
+
|
|
65
|
+
const backdropRef = useRef<HTMLDivElement>(null);
|
|
66
|
+
const modalRef = useRef<HTMLDivElement>(null);
|
|
67
|
+
const slideRefs = useRef<Array<HTMLDivElement | null>>([]);
|
|
68
|
+
|
|
69
|
+
// Sync prop → internal mount state, triggering close animation on prop null.
|
|
70
|
+
// internalItem intentionally lags one render behind `item` so the modal
|
|
71
|
+
// stays mounted through its exit animation — this can't be computed at
|
|
72
|
+
// render time since it depends on the previous render's own state.
|
|
73
|
+
/* eslint-disable react-hooks/set-state-in-effect */
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (item) {
|
|
76
|
+
setInternalItem(item);
|
|
77
|
+
setIsClosing(false);
|
|
78
|
+
setActiveIdx(0);
|
|
79
|
+
} else if (internalItem && !isClosing) {
|
|
80
|
+
setIsClosing(true);
|
|
81
|
+
}
|
|
82
|
+
}, [item, internalItem, isClosing]);
|
|
83
|
+
/* eslint-enable react-hooks/set-state-in-effect */
|
|
84
|
+
|
|
85
|
+
// Reset scroll position when a new item opens
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (internalItem && !isClosing && backdropRef.current) {
|
|
88
|
+
backdropRef.current.scrollTop = 0;
|
|
89
|
+
}
|
|
90
|
+
}, [internalItem, isClosing]);
|
|
91
|
+
|
|
92
|
+
// Lock body scroll while modal is mounted
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (!internalItem) return;
|
|
95
|
+
const prev = document.body.style.overflow;
|
|
96
|
+
document.body.style.overflow = "hidden";
|
|
97
|
+
return () => {
|
|
98
|
+
document.body.style.overflow = prev;
|
|
99
|
+
};
|
|
100
|
+
}, [internalItem]);
|
|
101
|
+
|
|
102
|
+
const { isMobile } = useBreakpoints();
|
|
103
|
+
// Matches the bottom-sheet layout's own breakpoint (900px in the module
|
|
104
|
+
// CSS) rather than the 767px `isMobile` flag, so the gesture handlers only
|
|
105
|
+
// arm exactly when the sheet layout is actually in effect.
|
|
106
|
+
const isBottomSheet = useMediaQuery("(max-width: 900px)");
|
|
107
|
+
|
|
108
|
+
// Guaranteed unmount after close animation. animationend is the fast path;
|
|
109
|
+
// this timeout fires if it never arrives (e.g. reduced-motion 1ms race).
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (!isClosing) return;
|
|
112
|
+
const backdrop = backdropRef.current;
|
|
113
|
+
let ms = 400;
|
|
114
|
+
if (backdrop) {
|
|
115
|
+
const raw = getComputedStyle(backdrop)
|
|
116
|
+
.getPropertyValue("--lb-modal-duration")
|
|
117
|
+
.trim();
|
|
118
|
+
const parsed = parseFloat(raw);
|
|
119
|
+
if (!isNaN(parsed) && parsed > 0)
|
|
120
|
+
ms = (raw.endsWith("ms") ? parsed : parsed * 1000) + 50;
|
|
121
|
+
}
|
|
122
|
+
const id = window.setTimeout(() => {
|
|
123
|
+
setInternalItem(null);
|
|
124
|
+
setIsClosing(false);
|
|
125
|
+
}, ms);
|
|
126
|
+
return () => window.clearTimeout(id);
|
|
127
|
+
}, [isClosing]);
|
|
128
|
+
|
|
129
|
+
const scrollToSlide = useCallback((idx: number) => {
|
|
130
|
+
const ref = slideRefs.current[idx];
|
|
131
|
+
if (ref) ref.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
132
|
+
}, []);
|
|
133
|
+
|
|
134
|
+
// Keyboard handling
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
if (!internalItem || isClosing) return;
|
|
137
|
+
const slidesLen = internalItem.slides?.length ?? 0;
|
|
138
|
+
|
|
139
|
+
const handleKey = (e: KeyboardEvent) => {
|
|
140
|
+
if (e.key === "Escape") {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
onClose();
|
|
143
|
+
} else if (e.key === "ArrowDown" || e.key === "ArrowRight") {
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
scrollToSlide(Math.min(activeIdx + 1, slidesLen - 1));
|
|
146
|
+
} else if (e.key === "ArrowUp" || e.key === "ArrowLeft") {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
scrollToSlide(Math.max(activeIdx - 1, 0));
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
window.addEventListener("keydown", handleKey);
|
|
152
|
+
return () => window.removeEventListener("keydown", handleKey);
|
|
153
|
+
}, [internalItem, isClosing, activeIdx, onClose, scrollToSlide]);
|
|
154
|
+
|
|
155
|
+
// Track which slide is most centered in the viewport
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
const scrollEl = backdropRef.current;
|
|
158
|
+
if (!scrollEl || !internalItem) return;
|
|
159
|
+
|
|
160
|
+
const update = () => {
|
|
161
|
+
const center = scrollEl.scrollTop + scrollEl.clientHeight / 2;
|
|
162
|
+
let bestIdx = 0;
|
|
163
|
+
let bestDist = Infinity;
|
|
164
|
+
slideRefs.current.forEach((ref, idx) => {
|
|
165
|
+
if (!ref) return;
|
|
166
|
+
const c = ref.offsetTop + ref.offsetHeight / 2;
|
|
167
|
+
const d = Math.abs(c - center);
|
|
168
|
+
if (d < bestDist) {
|
|
169
|
+
bestDist = d;
|
|
170
|
+
bestIdx = idx;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
setActiveIdx(bestIdx);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
scrollEl.addEventListener("scroll", update, { passive: true });
|
|
177
|
+
update();
|
|
178
|
+
return () => scrollEl.removeEventListener("scroll", update);
|
|
179
|
+
}, [internalItem]);
|
|
180
|
+
|
|
181
|
+
// ── Bottom-sheet gestures (mobile only) ───────────────────────────────────
|
|
182
|
+
// Pulling down past the top of the scroll closes the sheet; pulling up past
|
|
183
|
+
// the bottom stretches a filler panel over the reveal instead of letting
|
|
184
|
+
// the native rubber-band bounce show the backdrop underneath.
|
|
185
|
+
const stretchFillerRef = useRef<HTMLDivElement>(null);
|
|
186
|
+
const dragStateRef = useRef<{
|
|
187
|
+
startY: number;
|
|
188
|
+
atTop: boolean;
|
|
189
|
+
atBottom: boolean;
|
|
190
|
+
mode: "close" | "stretch" | null;
|
|
191
|
+
lastDeltaY: number;
|
|
192
|
+
} | null>(null);
|
|
193
|
+
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
if (!isBottomSheet || !internalItem || isClosing) return;
|
|
196
|
+
const scrollEl = backdropRef.current;
|
|
197
|
+
const modalEl = modalRef.current;
|
|
198
|
+
const fillerEl = stretchFillerRef.current;
|
|
199
|
+
if (!scrollEl || !modalEl) return;
|
|
200
|
+
|
|
201
|
+
const CLOSE_THRESHOLD = 90;
|
|
202
|
+
const CLOSE_DAMPING = 0.5;
|
|
203
|
+
const STRETCH_DAMPING = 0.4;
|
|
204
|
+
const STRETCH_MAX = 120;
|
|
205
|
+
|
|
206
|
+
const settle = (animate: boolean) => {
|
|
207
|
+
modalEl.style.transition = animate
|
|
208
|
+
? `transform var(--lb-modal-duration) var(--lb-modal-easing)`
|
|
209
|
+
: "none";
|
|
210
|
+
modalEl.style.transform = "";
|
|
211
|
+
if (fillerEl) {
|
|
212
|
+
fillerEl.style.transition = animate
|
|
213
|
+
? `height var(--lb-modal-duration) var(--lb-modal-easing)`
|
|
214
|
+
: "none";
|
|
215
|
+
fillerEl.style.height = "0px";
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const handleTouchStart = (e: TouchEvent) => {
|
|
220
|
+
dragStateRef.current = {
|
|
221
|
+
startY: e.touches[0].clientY,
|
|
222
|
+
atTop: scrollEl.scrollTop <= 0,
|
|
223
|
+
atBottom:
|
|
224
|
+
scrollEl.scrollTop + scrollEl.clientHeight >=
|
|
225
|
+
scrollEl.scrollHeight - 1,
|
|
226
|
+
mode: null,
|
|
227
|
+
lastDeltaY: 0,
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const handleTouchMove = (e: TouchEvent) => {
|
|
232
|
+
const st = dragStateRef.current;
|
|
233
|
+
if (!st) return;
|
|
234
|
+
const deltaY = e.touches[0].clientY - st.startY;
|
|
235
|
+
st.lastDeltaY = deltaY;
|
|
236
|
+
|
|
237
|
+
if (!st.mode) {
|
|
238
|
+
if (st.atTop && deltaY > 4) st.mode = "close";
|
|
239
|
+
else if (st.atBottom && deltaY < -4) st.mode = "stretch";
|
|
240
|
+
else return;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (st.mode === "close" && deltaY > 0) {
|
|
244
|
+
e.preventDefault();
|
|
245
|
+
modalEl.style.transition = "none";
|
|
246
|
+
modalEl.style.transform = `translateY(${deltaY * CLOSE_DAMPING}px)`;
|
|
247
|
+
} else if (st.mode === "stretch" && deltaY < 0 && fillerEl) {
|
|
248
|
+
e.preventDefault();
|
|
249
|
+
const h = Math.min(-deltaY * STRETCH_DAMPING, STRETCH_MAX);
|
|
250
|
+
fillerEl.style.transition = "none";
|
|
251
|
+
fillerEl.style.height = `${h}px`;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const handleTouchEnd = () => {
|
|
256
|
+
const st = dragStateRef.current;
|
|
257
|
+
dragStateRef.current = null;
|
|
258
|
+
if (!st) return;
|
|
259
|
+
|
|
260
|
+
if (
|
|
261
|
+
st.mode === "close" &&
|
|
262
|
+
st.lastDeltaY * CLOSE_DAMPING > CLOSE_THRESHOLD
|
|
263
|
+
) {
|
|
264
|
+
settle(false);
|
|
265
|
+
onClose();
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
settle(true);
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
scrollEl.addEventListener("touchstart", handleTouchStart, {
|
|
272
|
+
passive: true,
|
|
273
|
+
});
|
|
274
|
+
scrollEl.addEventListener("touchmove", handleTouchMove, {
|
|
275
|
+
passive: false,
|
|
276
|
+
});
|
|
277
|
+
scrollEl.addEventListener("touchend", handleTouchEnd);
|
|
278
|
+
scrollEl.addEventListener("touchcancel", handleTouchEnd);
|
|
279
|
+
return () => {
|
|
280
|
+
scrollEl.removeEventListener("touchstart", handleTouchStart);
|
|
281
|
+
scrollEl.removeEventListener("touchmove", handleTouchMove);
|
|
282
|
+
scrollEl.removeEventListener("touchend", handleTouchEnd);
|
|
283
|
+
scrollEl.removeEventListener("touchcancel", handleTouchEnd);
|
|
284
|
+
};
|
|
285
|
+
}, [isBottomSheet, internalItem, isClosing, onClose]);
|
|
286
|
+
|
|
287
|
+
const handleAnimationEnd = (e: ReactAnimationEvent<HTMLDivElement>) => {
|
|
288
|
+
// Only react to the modal's own animation, not anything bubbling up
|
|
289
|
+
if (e.target !== e.currentTarget) return;
|
|
290
|
+
if (isClosing) {
|
|
291
|
+
setInternalItem(null);
|
|
292
|
+
setIsClosing(false);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const handleBackdropClick = (e: ReactMouseEvent<HTMLDivElement>) => {
|
|
297
|
+
if (e.target === e.currentTarget) onClose();
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
const handleDownload = (src: string | undefined, e: ReactMouseEvent) => {
|
|
301
|
+
e.stopPropagation();
|
|
302
|
+
if (!src) return;
|
|
303
|
+
const a = document.createElement("a");
|
|
304
|
+
a.href = src;
|
|
305
|
+
a.download = "";
|
|
306
|
+
a.target = "_blank";
|
|
307
|
+
a.rel = "noopener noreferrer";
|
|
308
|
+
document.body.appendChild(a);
|
|
309
|
+
a.click();
|
|
310
|
+
document.body.removeChild(a);
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
const handleCopy = () => {
|
|
314
|
+
if (!internalItem) return;
|
|
315
|
+
const url = buildShareUrl
|
|
316
|
+
? buildShareUrl(internalItem, activeIdx)
|
|
317
|
+
: `${window.location.origin}${window.location.pathname}?id=${encodeURIComponent(
|
|
318
|
+
internalItem.id,
|
|
319
|
+
)}&slide=${activeIdx}`;
|
|
320
|
+
navigator.clipboard?.writeText(url).catch(() => {});
|
|
321
|
+
setCopied(true);
|
|
322
|
+
window.setTimeout(() => setCopied(false), 1500);
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
const handleShare = () => {
|
|
326
|
+
if (!internalItem) return;
|
|
327
|
+
if (onShare) onShare(internalItem, activeIdx);
|
|
328
|
+
else
|
|
329
|
+
console.log(
|
|
330
|
+
"[LightboxModal] Share:",
|
|
331
|
+
internalItem.id,
|
|
332
|
+
"slide",
|
|
333
|
+
activeIdx,
|
|
334
|
+
);
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
const handleFavorite = () => {
|
|
338
|
+
if (!internalItem || !onToggleFavorite) return;
|
|
339
|
+
onToggleFavorite(internalItem);
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
if (typeof document === "undefined") return null;
|
|
343
|
+
if (!internalItem) return null;
|
|
344
|
+
|
|
345
|
+
const slides = internalItem.slides ?? [];
|
|
346
|
+
const activeSlide = slides[activeIdx];
|
|
347
|
+
const stateClass = isClosing ? styles.isClosing : styles.isOpen;
|
|
348
|
+
|
|
349
|
+
return createPortal(
|
|
350
|
+
<>
|
|
351
|
+
<div
|
|
352
|
+
ref={backdropRef}
|
|
353
|
+
className={`${styles.backdrop} ${stateClass}`}
|
|
354
|
+
onClick={handleBackdropClick}
|
|
355
|
+
role="dialog"
|
|
356
|
+
aria-modal="true"
|
|
357
|
+
aria-label={internalItem.title ?? "Artwork"}
|
|
358
|
+
>
|
|
359
|
+
<div
|
|
360
|
+
ref={modalRef}
|
|
361
|
+
className={styles.modal}
|
|
362
|
+
onAnimationEnd={handleAnimationEnd}
|
|
363
|
+
>
|
|
364
|
+
{/* Images column */}
|
|
365
|
+
<div className={styles.imagesColumn}>
|
|
366
|
+
{slides.length === 0 ? (
|
|
367
|
+
<div className={styles.empty}>No images for this artwork.</div>
|
|
368
|
+
) : (
|
|
369
|
+
slides.map((slide, idx) => (
|
|
370
|
+
<div
|
|
371
|
+
key={idx}
|
|
372
|
+
ref={(el) => {
|
|
373
|
+
slideRefs.current[idx] = el;
|
|
374
|
+
}}
|
|
375
|
+
className={styles.slideEntry}
|
|
376
|
+
data-active={idx === activeIdx ? "true" : "false"}
|
|
377
|
+
>
|
|
378
|
+
<div className={styles.slideImageWrap}>
|
|
379
|
+
{slide.src ? (
|
|
380
|
+
<Image
|
|
381
|
+
className={styles.slideImage}
|
|
382
|
+
src={slide.src}
|
|
383
|
+
alt={slide.alt ?? slide.title ?? ""}
|
|
384
|
+
draggable={false}
|
|
385
|
+
fill
|
|
386
|
+
/>
|
|
387
|
+
) : (
|
|
388
|
+
<div
|
|
389
|
+
className={styles.slideImagePlaceholder}
|
|
390
|
+
aria-hidden
|
|
391
|
+
/>
|
|
392
|
+
)}
|
|
393
|
+
<div className={styles.slideDownloadBtn}>
|
|
394
|
+
<Button
|
|
395
|
+
type="button"
|
|
396
|
+
onClick={(e) => handleDownload(slide.src, e)}
|
|
397
|
+
aria-label="Download image"
|
|
398
|
+
text
|
|
399
|
+
>
|
|
400
|
+
<Icon systemName="download" />
|
|
401
|
+
</Button>
|
|
402
|
+
</div>
|
|
403
|
+
</div>
|
|
404
|
+
{(slide.title || slide.comment) && (
|
|
405
|
+
<div className={styles.slideMeta}>
|
|
406
|
+
{slide.title && (
|
|
407
|
+
<h3 className={styles.slideTitle}>{slide.title}</h3>
|
|
408
|
+
)}
|
|
409
|
+
{slide.comment && (
|
|
410
|
+
<p className={styles.slideComment}>{slide.comment}</p>
|
|
411
|
+
)}
|
|
412
|
+
</div>
|
|
413
|
+
)}
|
|
414
|
+
</div>
|
|
415
|
+
))
|
|
416
|
+
)}
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
{/* Sticky info panel */}
|
|
420
|
+
<aside className={styles.infoPanel}>
|
|
421
|
+
<div className={styles.closeBtn}>
|
|
422
|
+
<Button
|
|
423
|
+
type="button"
|
|
424
|
+
onClick={onClose}
|
|
425
|
+
aria-label="Close"
|
|
426
|
+
text={!isMobile}
|
|
427
|
+
secondary={!!isMobile}
|
|
428
|
+
>
|
|
429
|
+
<Icon systemName="close" />
|
|
430
|
+
</Button>
|
|
431
|
+
</div>
|
|
432
|
+
<div className={styles.infoHeader}>
|
|
433
|
+
{internalItem.author && (
|
|
434
|
+
<div className={styles.author}>{internalItem.author}</div>
|
|
435
|
+
)}
|
|
436
|
+
{internalItem.title && (
|
|
437
|
+
<h2 className={styles.itemTitle}>{internalItem.title}</h2>
|
|
438
|
+
)}
|
|
439
|
+
{internalItem.description && (
|
|
440
|
+
<p className={styles.itemDescription}>
|
|
441
|
+
{internalItem.description}
|
|
442
|
+
</p>
|
|
443
|
+
)}
|
|
444
|
+
</div>
|
|
445
|
+
<div className={styles.fl_actions}>
|
|
446
|
+
<Button.Group multiSelect primary width={"fullWidth"}>
|
|
447
|
+
<Button.Tab
|
|
448
|
+
systemName="ios_share"
|
|
449
|
+
label="Share"
|
|
450
|
+
circle
|
|
451
|
+
onClick={handleShare}
|
|
452
|
+
/>
|
|
453
|
+
<Button.Tab
|
|
454
|
+
systemName="link"
|
|
455
|
+
circle
|
|
456
|
+
label="Copy link"
|
|
457
|
+
toggle
|
|
458
|
+
onClick={handleCopy}
|
|
459
|
+
/>
|
|
460
|
+
<Button tertiary>
|
|
461
|
+
<Icon systemName="favorite" />
|
|
462
|
+
</Button>
|
|
463
|
+
</Button.Group>
|
|
464
|
+
</div>
|
|
465
|
+
{slides.length > 0 && (
|
|
466
|
+
<>
|
|
467
|
+
<Sinewave width={120} strokeWidth={4} />
|
|
468
|
+
<div className={styles.currentSlide}>
|
|
469
|
+
<div className={styles.currentSlideLabel}>
|
|
470
|
+
Slide {activeIdx + 1} of {slides.length}
|
|
471
|
+
</div>
|
|
472
|
+
{activeSlide?.title && (
|
|
473
|
+
<h3 className={styles.currentSlideTitle}>
|
|
474
|
+
{activeSlide.title}
|
|
475
|
+
</h3>
|
|
476
|
+
)}
|
|
477
|
+
{activeSlide?.comment && (
|
|
478
|
+
<p className={styles.currentSlideComment}>
|
|
479
|
+
{activeSlide.comment}
|
|
480
|
+
</p>
|
|
481
|
+
)}
|
|
482
|
+
</div>
|
|
483
|
+
</>
|
|
484
|
+
)}
|
|
485
|
+
</aside>
|
|
486
|
+
</div>
|
|
487
|
+
{isBottomSheet && (
|
|
488
|
+
<div
|
|
489
|
+
ref={stretchFillerRef}
|
|
490
|
+
className={styles.stretchFiller}
|
|
491
|
+
aria-hidden
|
|
492
|
+
/>
|
|
493
|
+
)}
|
|
494
|
+
</div>
|
|
495
|
+
</>,
|
|
496
|
+
document.body,
|
|
497
|
+
);
|
|
498
|
+
}
|