@flamingo-stack/openframe-frontend-core 0.0.730 → 0.0.732
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/dist/aicpa-soc2-logo-icon-MLDYZA5S.cjs +7 -0
- package/dist/build/export-map.json +1 -1
- package/dist/{chunk-SKDQ2SLJ.cjs → chunk-22ZK7BA3.cjs} +1345 -1127
- package/dist/{chunk-5RMCAY6Y.cjs → chunk-27TMRMOM.cjs} +6 -4
- package/dist/{chunk-P4YHBHP4.cjs → chunk-3BLBWZ6A.cjs} +7 -7
- package/dist/{chunk-2T2TH5DF.cjs → chunk-52HFGZCI.cjs} +14 -12
- package/dist/{chunk-L7Y7KDTM.cjs → chunk-5HMGK3N6.cjs} +20 -20
- package/dist/{chunk-66QTEDJL.cjs → chunk-5HSMTSHU.cjs} +28 -28
- package/dist/{chunk-WTURHKM2.cjs → chunk-6HHUU56Y.cjs} +16 -16
- package/dist/{chunk-AIW4KZQT.cjs → chunk-6KDGIOLP.cjs} +89 -89
- package/dist/{chunk-4XQXTQUK.cjs → chunk-6N5NQRQA.cjs} +8 -6
- package/dist/{chunk-5KLNEFZZ.cjs → chunk-7DUXR4HL.cjs} +3 -3
- package/dist/chunk-AEVGCB3Y.cjs +417 -0
- package/dist/{chunk-A7T3P5Q5.cjs → chunk-BDTX2OEE.cjs} +32 -32
- package/dist/{chunk-Q5GR7LKV.cjs → chunk-BS4EZZCN.cjs} +15 -15
- package/dist/{chunk-JNDR5N3T.cjs → chunk-C5NERNE6.cjs} +93 -93
- package/dist/{chunk-UHJG2BDI.cjs → chunk-CC3LINHF.cjs} +98 -50
- package/dist/{chunk-FRET5WH3.cjs → chunk-CKR42OBK.cjs} +4 -2
- package/dist/{chunk-GJPAS4RJ.cjs → chunk-CT342EJU.cjs} +6 -4
- package/dist/{chunk-PGFR4CDB.cjs → chunk-CUF3IYIB.cjs} +40 -40
- package/dist/{chunk-YHFXQ5OR.cjs → chunk-E3N24573.cjs} +9 -9
- package/dist/{chunk-24KWUFWA.cjs → chunk-G37LT2ID.cjs} +43 -39
- package/dist/{chunk-UG7Q3HQH.cjs → chunk-GID62YEN.cjs} +3 -3
- package/dist/{chunk-NDHQ7JLZ.cjs → chunk-GKHWXI25.cjs} +11 -15
- package/dist/chunk-HELVKMRG.cjs +28 -0
- package/dist/{chunk-KMMV562E.cjs → chunk-HH4BMYDX.cjs} +32 -379
- package/dist/{chunk-FGA6T2XT.cjs → chunk-I46MQ4R5.cjs} +82 -82
- package/dist/{chunk-YJXUJWHN.cjs → chunk-J7SZOZOS.cjs} +28 -26
- package/dist/{chunk-NXCV35RR.cjs → chunk-KLXHCNDC.cjs} +3 -3
- package/dist/{chunk-6KD2XUQZ.cjs → chunk-LRQITIEC.cjs} +28 -26
- package/dist/chunk-MANNIJ42.cjs +967 -0
- package/dist/{chunk-2V62Y67F.cjs → chunk-MEDDKM3A.cjs} +4 -4
- package/dist/{chunk-CLA3UGKT.cjs → chunk-MVZ6XFPK.cjs} +12 -12
- package/dist/{chunk-TI2IFCZG.cjs → chunk-N466AJGN.cjs} +17 -17
- package/dist/{chunk-TW2SES5W.cjs → chunk-NCGAP3U4.cjs} +4 -2
- package/dist/{chunk-DINGZJ37.cjs → chunk-NYY25425.cjs} +2 -2
- package/dist/{chunk-HVZBIXCZ.cjs → chunk-O2RPIGSG.cjs} +6 -4
- package/dist/{chunk-YRZB4BMZ.cjs → chunk-OI7VCXYU.cjs} +48 -50
- package/dist/{chunk-XA436AER.cjs → chunk-OJ3XU3YZ.cjs} +4 -4
- package/dist/{chunk-UYKL2AXE.cjs → chunk-OKW5OAFJ.cjs} +8 -6
- package/dist/{chunk-6NKLR5QN.cjs → chunk-PRWBVIWW.cjs} +59 -59
- package/dist/chunk-PX7FY655.cjs +114 -0
- package/dist/{chunk-CD5YBUJK.cjs → chunk-QMTC3BK3.cjs} +23 -21
- package/dist/{chunk-VQMWBQUJ.cjs → chunk-R4QMR6S4.cjs} +14 -12
- package/dist/{chunk-NB5BYOTM.cjs → chunk-RC32WBPL.cjs} +6 -4
- package/dist/{chunk-CDLDAQBA.cjs → chunk-RIXGLS5Y.cjs} +7 -7
- package/dist/{chunk-2I3XU2IB.cjs → chunk-SJRR745G.cjs} +63 -60
- package/dist/{chunk-XSPL7RXL.cjs → chunk-TLDCSTTQ.cjs} +12 -12
- package/dist/{chunk-3YHVQ34L.cjs → chunk-XOQ2UUVS.cjs} +93 -95
- package/dist/{chunk-YPM3ALIW.cjs → chunk-YGKVHSNQ.cjs} +42 -42
- package/dist/{chunk-4NFVFTD6.cjs → chunk-ZWMPAFGB.cjs} +238 -238
- package/dist/{chunk-GVTCHXW2.cjs → chunk-ZWUIRQNY.cjs} +28 -26
- package/dist/clickup-icon-3SETH2MM.cjs +7 -0
- package/dist/clickup-logo-icon-DJKBEFMR.cjs +7 -0
- package/dist/{cloud-tenants-VV6UQE7J.cjs → cloud-tenants-ILRE74JY.cjs} +36 -36
- package/dist/components/agent-identity.d.ts +8 -0
- package/dist/components/agent-identity.d.ts.map +1 -1
- package/dist/components/agent-identity.js +13 -1
- package/dist/components/case-studies/index.cjs +49 -49
- package/dist/components/chat/entity-cards/entity-portrait-card.js +1 -1
- package/dist/components/chat/index.cjs +30 -30
- package/dist/components/chat/types/entities/program-types.d.ts +1 -23
- package/dist/components/chat/types/entities/program-types.d.ts.map +1 -1
- package/dist/components/chat/types/entities/program-types.js +1 -9
- package/dist/components/chat/utils/icon-loading.d.ts +35 -2
- package/dist/components/chat/utils/icon-loading.d.ts.map +1 -1
- package/dist/components/chat/utils/icon-loading.js +31 -9
- package/dist/components/contact/index.cjs +37 -37
- package/dist/components/docs/index.cjs +40 -40
- package/dist/components/embeds/index.cjs +37 -37
- package/dist/components/faq/index.cjs +37 -37
- package/dist/components/features/index.cjs +38 -36
- package/dist/components/features/video-bites-shared.cjs +8 -0
- package/dist/components/features/video-bites-shared.d.ts +25 -0
- package/dist/components/features/video-bites-shared.d.ts.map +1 -1
- package/dist/components/features/video-bites-shared.js +8 -0
- package/dist/components/help-center-pages/index.cjs +152 -152
- package/dist/components/icons-v2-generated/brand-logos/clickup-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/clickup-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/clickup-icon.js +6 -4
- package/dist/components/icons-v2-generated/brand-logos/clickup-logo-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/clickup-logo-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/clickup-logo-icon.js +6 -4
- package/dist/components/icons-v2-generated/brand-logos/elestio-logo-grey-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/elestio-logo-grey-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/elestio-logo-grey-icon.js +4 -2
- package/dist/components/icons-v2-generated/brand-logos/elestio-logo-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/elestio-logo-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/elestio-logo-icon.js +14 -12
- package/dist/components/icons-v2-generated/brand-logos/gemini-logo-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/gemini-logo-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/gemini-logo-icon.js +28 -26
- package/dist/components/icons-v2-generated/brand-logos/google-gemini-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/google-gemini-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/google-gemini-icon.js +28 -26
- package/dist/components/icons-v2-generated/brand-logos/google-gemini-logo-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/google-gemini-logo-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/google-gemini-logo-icon.js +28 -26
- package/dist/components/icons-v2-generated/brand-logos/google-sheets-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/google-sheets-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/google-sheets-icon.js +4 -2
- package/dist/components/icons-v2-generated/brand-logos/meshcentral-logo-grey-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/meshcentral-logo-grey-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/meshcentral-logo-grey-icon.js +8 -6
- package/dist/components/icons-v2-generated/brand-logos/meshcentral-logo-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/meshcentral-logo-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/meshcentral-logo-icon.js +8 -6
- package/dist/components/icons-v2-generated/brand-logos/winget-logo-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/brand-logos/winget-logo-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/brand-logos/winget-logo-icon.js +14 -12
- package/dist/components/icons-v2-generated/compliance-logos/aicpa-soc2-logo-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/compliance-logos/aicpa-soc2-logo-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/compliance-logos/aicpa-soc2-logo-icon.js +6 -4
- package/dist/components/icons-v2-generated/compliance-logos/eu-logo-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/compliance-logos/eu-logo-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/compliance-logos/eu-logo-icon.js +11 -15
- package/dist/components/icons-v2-generated/icon-names.d.ts +5 -0
- package/dist/components/icons-v2-generated/icon-names.d.ts.map +1 -0
- package/dist/components/icons-v2-generated/icon-names.js +10 -0
- package/dist/components/icons-v2-generated/index.cjs +15 -15
- package/dist/components/icons-v2-generated/interface/empty-vendor-icon.d.ts +1 -1
- package/dist/components/icons-v2-generated/interface/empty-vendor-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/interface/empty-vendor-icon.js +6 -4
- package/dist/components/index.cjs +103 -96
- package/dist/components/meeting-scheduler/index.cjs +98 -98
- package/dist/components/navigation/index.cjs +39 -39
- package/dist/components/onboarding-guides/index.cjs +39 -39
- package/dist/components/product-demo/index.cjs +8 -8
- package/dist/components/product-demo/screens/remote-desktop-picture.d.ts.map +1 -1
- package/dist/components/product-demo/screens/remote-desktop-picture.js +2 -1
- package/dist/components/related-content/index.cjs +10 -10
- package/dist/components/shared/product-release/product-release-card.js +1 -1
- package/dist/components/tickets/index.cjs +40 -40
- package/dist/components/ui/device-wallpaper.d.ts +7 -0
- package/dist/components/ui/device-wallpaper.d.ts.map +1 -0
- package/dist/components/ui/device-wallpaper.js +5 -0
- package/dist/components/ui/feature-list.d.ts +9 -4
- package/dist/components/ui/feature-list.d.ts.map +1 -1
- package/dist/components/ui/feature-list.js +26 -35
- package/dist/components/ui/index.cjs +42 -36
- package/dist/components/ui/index.d.ts +3 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +3 -1
- package/dist/components/ui/notification-stack.d.ts +33 -0
- package/dist/components/ui/notification-stack.d.ts.map +1 -0
- package/dist/components/ui/notification-stack.js +78 -0
- package/dist/components/ui/numbered-step.d.ts +29 -0
- package/dist/components/ui/numbered-step.d.ts.map +1 -0
- package/dist/components/ui/numbered-step.js +57 -0
- package/dist/components/ui/phone-frame.d.ts +14 -9
- package/dist/components/ui/phone-frame.d.ts.map +1 -1
- package/dist/components/ui/phone-frame.js +50 -6
- package/dist/components/ui/phone-glyphs/lock-camera-glyph.d.ts +5 -0
- package/dist/components/ui/phone-glyphs/lock-camera-glyph.d.ts.map +1 -0
- package/dist/components/ui/phone-glyphs/lock-camera-glyph.js +14 -0
- package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.d.ts +5 -0
- package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.d.ts.map +1 -0
- package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.js +14 -0
- package/dist/components/ui/phone-glyphs/status-bar-glyphs.d.ts +5 -0
- package/dist/components/ui/phone-glyphs/status-bar-glyphs.d.ts.map +1 -0
- package/dist/components/ui/phone-glyphs/status-bar-glyphs.js +68 -0
- package/dist/components/ui/photo-wall.d.ts.map +1 -1
- package/dist/components/ui/photo-wall.js +4 -1
- package/dist/components/ui/snap-carousel.d.ts +5 -8
- package/dist/components/ui/snap-carousel.d.ts.map +1 -1
- package/dist/components/ui/snap-carousel.js +2 -27
- package/dist/components/ui/tab-navigation.d.ts +8 -1
- package/dist/components/ui/tab-navigation.d.ts.map +1 -1
- package/dist/components/ui/tab-navigation.js +30 -20
- package/dist/{devices-X72Z4QMT.cjs → devices-A6SFNGE4.cjs} +37 -37
- package/dist/elestio-logo-grey-icon-DV7P3JLT.cjs +7 -0
- package/dist/elestio-logo-icon-34ILAIDI.cjs +7 -0
- package/dist/{embeddable-chat-TETIRLQD.cjs → embeddable-chat-BKPYNOIM.cjs} +105 -105
- package/dist/empty-vendor-icon-XZYOZ4EP.cjs +7 -0
- package/dist/eu-logo-icon-EYOX3UC7.cjs +7 -0
- package/dist/gemini-logo-icon-DNACTHIK.cjs +7 -0
- package/dist/google-gemini-icon-TZHJZ4IQ.cjs +7 -0
- package/dist/google-gemini-logo-icon-4XQVV5NN.cjs +7 -0
- package/dist/google-sheets-icon-UAAEBTR7.cjs +7 -0
- package/dist/hooks/index.cjs +9 -9
- package/dist/hooks/ui/use-autoplay.d.ts +50 -13
- package/dist/hooks/ui/use-autoplay.d.ts.map +1 -1
- package/dist/hooks/ui/use-autoplay.js +76 -13
- package/dist/hooks/ui/use-in-view.d.ts +8 -0
- package/dist/hooks/ui/use-in-view.d.ts.map +1 -1
- package/dist/hooks/ui/use-in-view.js +21 -36
- package/dist/hooks/use-agent-identities.d.ts +6 -0
- package/dist/hooks/use-agent-identities.d.ts.map +1 -1
- package/dist/hooks/use-scenario-player.d.ts +26 -9
- package/dist/hooks/use-scenario-player.d.ts.map +1 -1
- package/dist/hooks/use-scenario-player.js +12 -9
- package/dist/{chunk-SI24RMI5.cjs → icon-loaders-OLGJZGRP.cjs} +16 -950
- package/dist/index.cjs +72 -65
- package/dist/{knowledge-HWBSPQ7M.cjs → knowledge-5ZCVKUYV.cjs} +37 -37
- package/dist/{logs-IZ4QTHPI.cjs → logs-CL4OJASB.cjs} +44 -44
- package/dist/meshcentral-logo-grey-icon-UCRYV3IC.cjs +7 -0
- package/dist/meshcentral-logo-icon-76NSLOXF.cjs +7 -0
- package/dist/{policies-VHQR7JR5.cjs → policies-7D44ZVS5.cjs} +40 -40
- package/dist/{remote-session-IR3YCXSR.cjs → remote-session-QB3CIZRM.cjs} +24 -23
- package/dist/schemas/contact-schema.cjs +31 -11
- package/dist/schemas/contact-schema.d.ts +1 -1
- package/dist/schemas/contact-schema.d.ts.map +1 -1
- package/dist/schemas/contact-schema.js +1 -1
- package/dist/schemas/meeting-booking-schema.cjs +34 -14
- package/dist/schemas/meeting-booking-schema.d.ts +1 -1
- package/dist/schemas/meeting-booking-schema.d.ts.map +1 -1
- package/dist/schemas/meeting-booking-schema.js +1 -1
- package/dist/{software-update-QLOVC6EX.cjs → software-update-AX6TZL26.cjs} +40 -40
- package/dist/{tickets-board-YONLQB6F.cjs → tickets-board-7FAV2YWF.cjs} +27 -27
- package/dist/utils/index.cjs +2004 -1959
- package/dist/winget-logo-icon-GBS342G4.cjs +7 -0
- package/package.json +1 -1
- package/src/components/agent-identity.tsx +20 -1
- package/src/components/chat/entity-cards/entity-portrait-card.tsx +1 -1
- package/src/components/chat/types/entities/program-types.ts +4 -30
- package/src/components/chat/utils/icon-loading.tsx +50 -9
- package/src/components/features/video-bites-shared.ts +30 -0
- package/src/components/icons-v2-generated/brand-logos/clickup-icon.tsx +7 -5
- package/src/components/icons-v2-generated/brand-logos/clickup-logo-icon.tsx +7 -5
- package/src/components/icons-v2-generated/brand-logos/elestio-logo-grey-icon.tsx +5 -3
- package/src/components/icons-v2-generated/brand-logos/elestio-logo-icon.tsx +15 -13
- package/src/components/icons-v2-generated/brand-logos/gemini-logo-icon.tsx +29 -27
- package/src/components/icons-v2-generated/brand-logos/google-gemini-icon.tsx +29 -27
- package/src/components/icons-v2-generated/brand-logos/google-gemini-logo-icon.tsx +29 -27
- package/src/components/icons-v2-generated/brand-logos/google-sheets-icon.tsx +5 -3
- package/src/components/icons-v2-generated/brand-logos/meshcentral-logo-grey-icon.tsx +9 -7
- package/src/components/icons-v2-generated/brand-logos/meshcentral-logo-icon.tsx +9 -7
- package/src/components/icons-v2-generated/brand-logos/winget-logo-icon.tsx +15 -13
- package/src/components/icons-v2-generated/compliance-logos/aicpa-soc2-logo-icon.tsx +92 -90
- package/src/components/icons-v2-generated/compliance-logos/eu-logo-icon.tsx +51 -52
- package/src/components/icons-v2-generated/icon-names.ts +11 -0
- package/src/components/icons-v2-generated/interface/empty-vendor-icon.tsx +7 -5
- package/src/components/product-demo/screens/remote-desktop-picture.tsx +2 -1
- package/src/components/shared/product-release/product-release-card.tsx +1 -1
- package/src/components/ui/device-wallpaper.ts +7 -0
- package/src/components/ui/feature-list.tsx +24 -30
- package/src/components/ui/index.ts +3 -1
- package/src/components/ui/notification-stack.tsx +133 -0
- package/src/components/ui/numbered-step.tsx +81 -0
- package/src/components/ui/phone-frame.tsx +83 -19
- package/src/components/ui/phone-glyphs/lock-camera-glyph.tsx +14 -0
- package/src/components/ui/phone-glyphs/lock-flashlight-glyph.tsx +14 -0
- package/src/components/ui/phone-glyphs/status-bar-glyphs.tsx +45 -0
- package/src/components/ui/photo-wall.tsx +6 -0
- package/src/components/ui/snap-carousel.tsx +6 -38
- package/src/components/ui/tab-navigation.tsx +49 -21
- package/src/hooks/ui/use-autoplay.ts +144 -27
- package/src/hooks/ui/use-in-view.ts +31 -38
- package/src/hooks/use-agent-identities.ts +6 -0
- package/src/hooks/use-scenario-player.ts +44 -20
- package/src/schemas/contact-schema.ts +1 -1
- package/src/schemas/meeting-booking-schema.ts +1 -1
- package/src/styles/fonts.css +26 -0
- package/src/styles/ods-design-tokens.css +4 -2
- package/dist/aicpa-soc2-logo-icon-CJ5JRV6J.cjs +0 -7
- package/dist/chunk-73MDSN5A.cjs +0 -99
- package/dist/chunk-BE2WAMG5.cjs +0 -54
- package/dist/chunk-LCTDHLDL.cjs +0 -43
- package/dist/clickup-icon-CBBUZUVQ.cjs +0 -7
- package/dist/clickup-logo-icon-CGDKKISS.cjs +0 -7
- package/dist/components/ui/playback-toggle.d.ts +0 -24
- package/dist/components/ui/playback-toggle.d.ts.map +0 -1
- package/dist/components/ui/playback-toggle.js +0 -32
- package/dist/elestio-logo-grey-icon-Y5OFW4OO.cjs +0 -7
- package/dist/elestio-logo-icon-X7TTQAYP.cjs +0 -7
- package/dist/empty-vendor-icon-3RKCZUUR.cjs +0 -7
- package/dist/eu-logo-icon-N7QVPGG3.cjs +0 -7
- package/dist/gemini-logo-icon-QOPGATSZ.cjs +0 -7
- package/dist/google-gemini-icon-7GWWF6O6.cjs +0 -7
- package/dist/google-gemini-logo-icon-Z3GHPMVN.cjs +0 -7
- package/dist/google-sheets-icon-7MJ3LV4P.cjs +0 -7
- package/dist/meshcentral-logo-grey-icon-3VFJQMV2.cjs +0 -7
- package/dist/meshcentral-logo-icon-MDVBWMP5.cjs +0 -7
- package/dist/winget-logo-icon-XVZJ4QDM.cjs +0 -7
- package/src/components/ui/playback-toggle.tsx +0 -53
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { AnimatePresence, motion, useReducedMotion } from 'framer-motion';
|
|
4
|
+
import { useEffect, useState, type ReactNode } from 'react';
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
|
+
|
|
7
|
+
export interface NotificationStackItem {
|
|
8
|
+
key: string;
|
|
9
|
+
node: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface NotificationStackProps {
|
|
13
|
+
/** What has arrived so far, OLDEST FIRST. The newest is drawn on top. */
|
|
14
|
+
items: readonly NotificationStackItem[];
|
|
15
|
+
/** How many are shown whole when a new one has just arrived. Default 3. */
|
|
16
|
+
maxExpanded?: number;
|
|
17
|
+
/** How long they all stay whole after an arrival before the oldest starts to fold. Default 1800. */
|
|
18
|
+
lingerMs?: number;
|
|
19
|
+
/** The pause between one fold and the next: they go one at a time, never together. Default 900. */
|
|
20
|
+
foldEveryMs?: number;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The most card edges drawn for the folded pile: past two a pile only reads as "more". */
|
|
25
|
+
const MAX_PILE_EDGES = 2;
|
|
26
|
+
|
|
27
|
+
// Gentle on purpose: a notification eases into place and the ones under it
|
|
28
|
+
// drift down with it. Soft springs with no overshoot; nothing snaps or bounces.
|
|
29
|
+
const ARRIVE = { type: 'spring', stiffness: 90, damping: 22, mass: 1 } as const;
|
|
30
|
+
const PUSH = { type: 'spring', stiffness: 60, damping: 20, mass: 1.1 } as const;
|
|
31
|
+
const FOLD = { type: 'spring', stiffness: 140, damping: 28, mass: 1 } as const;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Notifications as a phone keeps them: the most recent on top, the list
|
|
35
|
+
* starting where its host puts it (the lock screen: right under the clock). A
|
|
36
|
+
* new one DROPS IN FROM ABOVE into the top place and PUSHES the ones still
|
|
37
|
+
* whole DOWN. They stay
|
|
38
|
+
* whole for a moment (`lingerMs`, long enough to see that one more joined
|
|
39
|
+
* them), then fold away ONE AT A TIME, oldest first (`foldEveryMs` apart):
|
|
40
|
+
* each slips behind the ones above it and leaves its edge under the newest,
|
|
41
|
+
* until only the newest is whole on a pile of edges. Nothing that arrived is
|
|
42
|
+
* taken away, and the eye follows every one of them.
|
|
43
|
+
*
|
|
44
|
+
* The caller passes only what has arrived, oldest first; each `node` is the
|
|
45
|
+
* notification itself (`NotificationTile`). Under reduced motion the stack
|
|
46
|
+
* changes in place, with no travel.
|
|
47
|
+
*/
|
|
48
|
+
export function NotificationStack({
|
|
49
|
+
items,
|
|
50
|
+
maxExpanded = 3,
|
|
51
|
+
lingerMs = 1800,
|
|
52
|
+
foldEveryMs = 900,
|
|
53
|
+
className,
|
|
54
|
+
}: NotificationStackProps) {
|
|
55
|
+
const reducedMotion = useReducedMotion();
|
|
56
|
+
const count = items.length;
|
|
57
|
+
const opened = Math.min(maxExpanded, count);
|
|
58
|
+
|
|
59
|
+
// How many are whole now. A new arrival joins the ones still whole (the ones
|
|
60
|
+
// already folded stay folded); a list that restarts opens afresh. State
|
|
61
|
+
// derived from the prop during render, React's own pattern for it.
|
|
62
|
+
const [seenCount, setSeenCount] = useState(count);
|
|
63
|
+
const [whole, setWhole] = useState(opened);
|
|
64
|
+
const [justArrived, setJustArrived] = useState(false);
|
|
65
|
+
if (seenCount !== count) {
|
|
66
|
+
setSeenCount(count);
|
|
67
|
+
setWhole(count > seenCount ? Math.min(opened, whole + (count - seenCount)) : opened);
|
|
68
|
+
setJustArrived(true);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Fold the oldest whole one: the first after the linger, each next one a beat later.
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (whole <= 1) return undefined;
|
|
74
|
+
const timer = setTimeout(
|
|
75
|
+
() => {
|
|
76
|
+
setWhole(current => current - 1);
|
|
77
|
+
setJustArrived(false);
|
|
78
|
+
},
|
|
79
|
+
justArrived ? lingerMs : foldEveryMs,
|
|
80
|
+
);
|
|
81
|
+
return () => clearTimeout(timer);
|
|
82
|
+
}, [whole, justArrived, lingerMs, foldEveryMs]);
|
|
83
|
+
|
|
84
|
+
const shown = items.slice(-Math.max(1, Math.min(whole, count))).reverse();
|
|
85
|
+
const folded = Math.min(MAX_PILE_EDGES, Math.max(0, count - shown.length));
|
|
86
|
+
const still = { duration: 0 };
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div className={cn('flex w-full flex-col gap-1.5 pb-2.5', className)}>
|
|
90
|
+
<AnimatePresence initial={false} mode="popLayout">
|
|
91
|
+
{shown.map((item, index) => (
|
|
92
|
+
<motion.div
|
|
93
|
+
key={item.key}
|
|
94
|
+
layout={reducedMotion ? false : 'position'}
|
|
95
|
+
// It drops in from above, into the top place.
|
|
96
|
+
initial={{ opacity: 0, y: reducedMotion ? 0 : -20, scale: reducedMotion ? 1 : 0.98 }}
|
|
97
|
+
animate={{ opacity: 1, y: 0, scale: 1, transition: reducedMotion ? still : ARRIVE }}
|
|
98
|
+
// Folding: it slips up behind the one above it.
|
|
99
|
+
exit={{
|
|
100
|
+
opacity: 0,
|
|
101
|
+
y: reducedMotion ? 0 : -28,
|
|
102
|
+
scale: reducedMotion ? 1 : 0.94,
|
|
103
|
+
transition: reducedMotion ? still : FOLD,
|
|
104
|
+
}}
|
|
105
|
+
// The push: how the ones already there make room.
|
|
106
|
+
transition={reducedMotion ? still : PUSH}
|
|
107
|
+
// `isolate`: the pile's edges sit behind the notification, never behind the screen.
|
|
108
|
+
className="relative isolate min-w-0"
|
|
109
|
+
>
|
|
110
|
+
{/* The pile: one edge per folded notification, under the last whole one. */}
|
|
111
|
+
{index === shown.length - 1 && (
|
|
112
|
+
<AnimatePresence initial={false}>
|
|
113
|
+
{Array.from({ length: folded }, (_, edge) => (
|
|
114
|
+
<motion.span
|
|
115
|
+
key={edge}
|
|
116
|
+
aria-hidden
|
|
117
|
+
initial={{ opacity: 0, y: 0 }}
|
|
118
|
+
animate={{ opacity: 1 - (edge + 1) * 0.3, y: (edge + 1) * 6 }}
|
|
119
|
+
exit={{ opacity: 0, y: 0 }}
|
|
120
|
+
transition={reducedMotion ? still : FOLD}
|
|
121
|
+
className="absolute inset-0 rounded-2xl border border-ods-border bg-ods-card"
|
|
122
|
+
style={{ scaleX: 1 - (edge + 1) * 0.06, zIndex: -1 - edge }}
|
|
123
|
+
/>
|
|
124
|
+
))}
|
|
125
|
+
</AnimatePresence>
|
|
126
|
+
)}
|
|
127
|
+
{item.node}
|
|
128
|
+
</motion.div>
|
|
129
|
+
))}
|
|
130
|
+
</AnimatePresence>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { cn } from '../../utils/cn';
|
|
2
|
+
|
|
3
|
+
export interface StepNumberProps {
|
|
4
|
+
/** The step's number, as shown (1-based). */
|
|
5
|
+
number: number;
|
|
6
|
+
/** The step being shown now: its ring and number take the accent. */
|
|
7
|
+
current?: boolean;
|
|
8
|
+
/** The lit colour (a CSS colour, such as the hex an agent's identity stores). Omitted, it is the platform's accent. */
|
|
9
|
+
accent?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* THE number of a numbered step, wherever a page counts steps: a bold number
|
|
15
|
+
* in a ring. Grey at rest, the accent when it is the current one.
|
|
16
|
+
*/
|
|
17
|
+
export function StepNumber({ number, current = false, accent, className }: StepNumberProps) {
|
|
18
|
+
return (
|
|
19
|
+
<span
|
|
20
|
+
className={cn(
|
|
21
|
+
'grid h-6 w-6 shrink-0 place-items-center rounded-full border-2 font-bold transition-colors duration-200 text-h6 motion-reduce:transition-none',
|
|
22
|
+
current ? !accent && 'border-ods-accent text-ods-accent' : 'border-ods-text-secondary text-ods-text-secondary',
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
style={current && accent ? { borderColor: accent, color: accent } : undefined}
|
|
26
|
+
>
|
|
27
|
+
{number}
|
|
28
|
+
</span>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface NumberedStepProps extends StepNumberProps {
|
|
33
|
+
title: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
/** The title's element. Default `h3`. */
|
|
36
|
+
titleAs?: 'h3' | 'h4' | 'p';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* THE head of a numbered step: its number (`StepNumber`), its title and one
|
|
41
|
+
* line under it. One look everywhere steps are counted (a list of steps beside
|
|
42
|
+
* a demo, the head of a column of a flow). At rest the title reads at full
|
|
43
|
+
* strength and the description steps back; the current one's number and title
|
|
44
|
+
* take the accent and its description reads at full strength.
|
|
45
|
+
*/
|
|
46
|
+
export function NumberedStep({
|
|
47
|
+
number,
|
|
48
|
+
title,
|
|
49
|
+
description,
|
|
50
|
+
current = false,
|
|
51
|
+
accent,
|
|
52
|
+
titleAs: Title = 'h3',
|
|
53
|
+
className,
|
|
54
|
+
}: NumberedStepProps) {
|
|
55
|
+
return (
|
|
56
|
+
<div className={cn('flex items-start gap-[var(--spacing-system-xs)]', className)}>
|
|
57
|
+
<StepNumber number={number} current={current} accent={accent} />
|
|
58
|
+
<div className="flex min-w-0 flex-col gap-[var(--spacing-system-xxs)]">
|
|
59
|
+
<Title
|
|
60
|
+
className={cn(
|
|
61
|
+
'm-0 transition-colors duration-200 text-h3 motion-reduce:transition-none',
|
|
62
|
+
current ? !accent && 'text-ods-accent' : 'text-ods-text-primary',
|
|
63
|
+
)}
|
|
64
|
+
style={current && accent ? { color: accent } : undefined}
|
|
65
|
+
>
|
|
66
|
+
{title}
|
|
67
|
+
</Title>
|
|
68
|
+
{description && (
|
|
69
|
+
<p
|
|
70
|
+
className={cn(
|
|
71
|
+
'm-0 transition-colors duration-200 text-h4 motion-reduce:transition-none',
|
|
72
|
+
current ? 'text-ods-text-primary' : 'text-ods-text-secondary',
|
|
73
|
+
)}
|
|
74
|
+
>
|
|
75
|
+
{description}
|
|
76
|
+
</p>
|
|
77
|
+
)}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -1,39 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useSyncExternalStore, type ReactNode } from 'react';
|
|
2
4
|
import { cn } from '../../utils/cn';
|
|
5
|
+
import { DEVICE_WALLPAPER_CLASS } from './device-wallpaper';
|
|
6
|
+
import { LockCameraGlyph } from './phone-glyphs/lock-camera-glyph';
|
|
7
|
+
import { LockFlashlightGlyph } from './phone-glyphs/lock-flashlight-glyph';
|
|
8
|
+
import { StatusBarGlyphs } from './phone-glyphs/status-bar-glyphs';
|
|
3
9
|
|
|
4
10
|
export interface PhoneFrameProps {
|
|
5
|
-
/**
|
|
11
|
+
/** A fixed lock-screen date line ("Thursday, October 1"). Omitted, it is today's, in the visitor's own locale. */
|
|
6
12
|
dateLabel?: string;
|
|
7
|
-
/**
|
|
13
|
+
/** A fixed lock-screen clock ("5:09"). Omitted, it is the visitor's own time, kept current. */
|
|
8
14
|
timeLabel?: string;
|
|
9
|
-
/** The
|
|
15
|
+
/** The notifications, right under the clock, the newest first (`NotificationStack`). */
|
|
10
16
|
children?: ReactNode;
|
|
11
17
|
className?: string;
|
|
12
18
|
}
|
|
13
19
|
|
|
20
|
+
/** How often the clock is re-read. The label only changes with the minute, so most readings change nothing. */
|
|
21
|
+
const CLOCK_TICK_MS = 1000;
|
|
22
|
+
|
|
23
|
+
function subscribeToClock(onTick: () => void): () => void {
|
|
24
|
+
const timer = setInterval(onTick, CLOCK_TICK_MS);
|
|
25
|
+
return () => clearInterval(timer);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** "9:41": the hour and minute as a lock screen shows them, with no AM/PM. */
|
|
29
|
+
function readClock(): string {
|
|
30
|
+
const parts = new Intl.DateTimeFormat(undefined, { hour: 'numeric', minute: '2-digit' }).formatToParts(new Date());
|
|
31
|
+
const part = (type: string) => parts.find(p => p.type === type)?.value ?? '';
|
|
32
|
+
return `${part('hour')}:${part('minute')}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** "Monday, October 12". */
|
|
36
|
+
function readDate(): string {
|
|
37
|
+
return new Intl.DateTimeFormat(undefined, { weekday: 'long', month: 'long', day: 'numeric' }).format(new Date());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// The server cannot know the visitor's time: it (and the hydrating render) draw none, in the same box.
|
|
41
|
+
const noTime = () => '';
|
|
42
|
+
|
|
43
|
+
/** One of the lock screen's two round shortcuts. A drawing: it does nothing. */
|
|
44
|
+
function LockShortcut({ children }: { children: ReactNode }) {
|
|
45
|
+
return (
|
|
46
|
+
<span className="grid size-[34px] place-items-center rounded-full bg-ods-text-primary/35 text-ods-text-primary backdrop-blur-md">
|
|
47
|
+
{children}
|
|
48
|
+
</span>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
14
52
|
/**
|
|
15
|
-
* A phone lock screen: island, date
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
53
|
+
* A phone lock screen: the status bar and island, the date and clock on the
|
|
54
|
+
* device wallpaper (`DEVICE_WALLPAPER_CLASS`, the one every drawn device
|
|
55
|
+
* shares), the notifications stacked under the clock, then the two
|
|
56
|
+
* shortcuts and the home indicator. Decorative chrome for showing what lands
|
|
57
|
+
* on a phone.
|
|
58
|
+
*
|
|
59
|
+
* The clock is REAL: the visitor's own date and time, kept current, unless a
|
|
60
|
+
* caller fixes them. The server draws neither (it cannot know them); their
|
|
61
|
+
* lines keep their height, so nothing moves when they appear.
|
|
19
62
|
*
|
|
20
|
-
* It is sized by its class (default
|
|
63
|
+
* It is sized by its class (default 299 x 617), never scaled, so the text
|
|
21
64
|
* inside stays the size the page set.
|
|
22
65
|
*/
|
|
23
66
|
export function PhoneFrame({ dateLabel, timeLabel, children, className }: PhoneFrameProps) {
|
|
67
|
+
const liveTime = useSyncExternalStore(subscribeToClock, readClock, noTime);
|
|
68
|
+
const liveDate = useSyncExternalStore(subscribeToClock, readDate, noTime);
|
|
69
|
+
const time = timeLabel ?? liveTime;
|
|
70
|
+
const date = dateLabel ?? liveDate;
|
|
24
71
|
return (
|
|
25
72
|
<div
|
|
26
|
-
className={cn('h-[
|
|
73
|
+
className={cn('h-[617px] w-[299px] shrink-0 rounded-[48px] border border-ods-border bg-black p-2.5', className)}
|
|
27
74
|
>
|
|
28
|
-
<div className=
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
75
|
+
<div className={cn('relative flex h-full flex-col overflow-hidden rounded-[38px]', DEVICE_WALLPAPER_CLASS)}>
|
|
76
|
+
<div
|
|
77
|
+
className="grid shrink-0 grid-cols-[1fr_auto_1fr] items-center px-5 pt-2.5 text-ods-text-primary"
|
|
78
|
+
aria-hidden
|
|
79
|
+
>
|
|
80
|
+
<span className="font-semibold tabular-nums text-h6">{time}</span>
|
|
81
|
+
<span className="h-6 w-20 rounded-full bg-black" />
|
|
82
|
+
<StatusBarGlyphs className="h-2.5 w-[54px] justify-self-end" />
|
|
83
|
+
</div>
|
|
84
|
+
<div className="flex shrink-0 flex-col items-center pt-4 text-ods-text-primary">
|
|
85
|
+
<span className="min-h-[var(--font-line-space-h4-body)] text-h4">{date}</span>
|
|
86
|
+
<span className="h-[68px] text-[64px] font-bold tabular-nums leading-[68px] tracking-tight">{time}</span>
|
|
87
|
+
</div>
|
|
88
|
+
{/* Right under the clock, growing down; clipped at the foot, so a tall stack never runs over the shortcuts. */}
|
|
89
|
+
<div className="flex min-h-0 w-full flex-1 flex-col justify-start overflow-hidden px-2.5 pb-3 pt-4">
|
|
90
|
+
{children}
|
|
91
|
+
</div>
|
|
92
|
+
<div className="flex shrink-0 items-center justify-between px-8" aria-hidden>
|
|
93
|
+
<LockShortcut>
|
|
94
|
+
<LockFlashlightGlyph className="size-[34px]" />
|
|
95
|
+
</LockShortcut>
|
|
96
|
+
<LockShortcut>
|
|
97
|
+
<LockCameraGlyph className="size-[34px]" />
|
|
98
|
+
</LockShortcut>
|
|
99
|
+
</div>
|
|
100
|
+
<span className="mx-auto mb-2 mt-3 h-1 w-24 shrink-0 rounded-full bg-ods-text-primary" aria-hidden />
|
|
37
101
|
</div>
|
|
38
102
|
</div>
|
|
39
103
|
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The camera shortcut of the drawn phone's lock screen, as the design draws it. It belongs to `PhoneFrame` and
|
|
2
|
+
// nothing else, so it is not part of the icon set. It takes the text colour around it.
|
|
3
|
+
|
|
4
|
+
/** The camera shortcut's glyph, in its 34px round button's own box. */
|
|
5
|
+
export function LockCameraGlyph({ className }: { className?: string }) {
|
|
6
|
+
return (
|
|
7
|
+
<svg viewBox="0 0 34.0257 34.0257" fill="none" aria-hidden="true" className={className}>
|
|
8
|
+
<path
|
|
9
|
+
d="M10.4883 23.8176H23.5348C25.0193 23.8176 25.7758 23.0753 25.7758 21.6051V14.1326C25.7758 12.6624 25.0193 11.9273 23.5348 11.9273H21.4936C20.9297 11.9273 20.7585 11.8131 20.4373 11.4563L19.8663 10.8139C19.5095 10.4214 19.1455 10.2073 18.4104 10.2073H15.5627C14.8276 10.2073 14.4636 10.4214 14.1068 10.8139L13.5358 11.4563C13.2146 11.806 13.0362 11.9273 12.4795 11.9273H10.4883C8.99665 11.9273 8.24726 12.6624 8.24726 14.1326V21.6051C8.24726 23.0753 8.99665 23.8176 10.4883 23.8176ZM17.0115 21.7122C14.849 21.7122 13.1147 19.985 13.1147 17.8082C13.1147 15.6386 14.849 13.9114 17.0115 13.9114C19.174 13.9114 20.9012 15.6386 20.9012 17.8082C20.9012 19.985 19.1669 21.7122 17.0115 21.7122ZM21.3794 15.1818C21.3794 14.6965 21.8076 14.2682 22.3072 14.2682C22.7996 14.2682 23.2207 14.6965 23.2207 15.1818C23.2207 15.6885 22.7996 16.0953 22.3072 16.1025C21.8076 16.1025 21.3794 15.6956 21.3794 15.1818ZM17.0115 20.6273C18.5674 20.6273 19.8235 19.3784 19.8235 17.8082C19.8235 16.2452 18.5674 14.9891 17.0115 14.9891C15.4556 14.9891 14.1924 16.2452 14.1924 17.8082C14.1924 19.3784 15.4628 20.6273 17.0115 20.6273Z"
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The flashlight shortcut of the drawn phone's lock screen, as the design draws it. It belongs to `PhoneFrame` and
|
|
2
|
+
// nothing else, so it is not part of the icon set. It takes the text colour around it.
|
|
3
|
+
|
|
4
|
+
/** The flashlight shortcut's glyph, in its 34px round button's own box. */
|
|
5
|
+
export function LockFlashlightGlyph({ className }: { className?: string }) {
|
|
6
|
+
return (
|
|
7
|
+
<svg viewBox="0 0 34.0257 34.0257" fill="none" aria-hidden="true" className={className}>
|
|
8
|
+
<path
|
|
9
|
+
d="M13.8216 11.1597H20.8833V10.8248C20.8833 9.94557 20.4507 9.5269 19.6133 9.5269H15.0916C14.2543 9.5269 13.8216 9.94557 13.8216 10.8248V11.1597ZM16.5151 25.1505H18.1898C19.0272 25.1505 19.4528 24.7318 19.4528 23.8526V16.442C19.4528 15.7093 19.6273 15.179 19.8924 14.7743L20.346 14.1044C20.667 13.609 20.8833 13.1415 20.8833 12.5483V11.9762H13.8216V12.5483C13.8216 13.1415 14.038 13.609 14.3589 14.1044L14.8055 14.7743C15.0777 15.179 15.2451 15.7093 15.2451 16.442V23.8526C15.2451 24.7318 15.6778 25.1505 16.5151 25.1505ZM17.3525 19.7845C16.7803 19.7845 16.4105 19.3658 16.4105 18.7796V16.8677C16.4105 16.2746 16.7803 15.8768 17.3525 15.8908C17.9177 15.8978 18.2945 16.2955 18.2945 16.8677V18.7796C18.2945 19.3658 17.9177 19.7845 17.3525 19.7845ZM17.3525 19.289C17.6595 19.289 17.9247 19.0308 17.9247 18.7168C17.9247 18.4028 17.6595 18.1377 17.3525 18.1377C17.0385 18.1377 16.7733 18.4028 16.7733 18.7168C16.7733 19.0308 17.0385 19.289 17.3525 19.289Z"
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// The status bar's signal, Wi-Fi and battery of the drawn phone's lock screen, as the design draws it. It belongs to `PhoneFrame` and
|
|
2
|
+
// nothing else, so it is not part of the icon set. It takes the text colour around it.
|
|
3
|
+
|
|
4
|
+
/** The status bar's right side: signal, Wi-Fi and battery, as one drawing. */
|
|
5
|
+
export function StatusBarGlyphs({ className }: { className?: string }) {
|
|
6
|
+
return (
|
|
7
|
+
<svg viewBox="0 0 54.441 9.78982" fill="none" aria-hidden="true" className={className}>
|
|
8
|
+
<path
|
|
9
|
+
d="M6.89491 2.89491C6.89491 2.51412 7.20361 2.20542 7.5844 2.20542H8.27389C8.65469 2.20542 8.96338 2.51412 8.96338 2.89491V8.41084C8.96338 8.79164 8.65469 9.10033 8.27389 9.10033H7.5844C7.20361 9.10033 6.89491 8.79164 6.89491 8.41084V2.89491Z"
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
d="M10.3424 1.51593C10.3424 1.13513 10.6511 0.826438 11.0319 0.826438H11.7213C12.1021 0.826438 12.4108 1.13513 12.4108 1.51593V8.41084C12.4108 8.79164 12.1021 9.10033 11.7213 9.10033H11.0319C10.6511 9.10033 10.3424 8.79164 10.3424 8.41084V1.51593Z"
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M3.44746 5.30813C3.44746 4.92733 3.75615 4.61864 4.13695 4.61864H4.82644C5.20723 4.61864 5.51593 4.92733 5.51593 5.30813V8.41084C5.51593 8.79164 5.20723 9.10033 4.82644 9.10033H4.13695C3.75615 9.10033 3.44746 8.79164 3.44746 8.41084V5.30813Z"
|
|
18
|
+
fill="currentColor"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
d="M0 7.03186C0 6.65106 0.308696 6.34237 0.689491 6.34237H1.37898C1.75978 6.34237 2.06847 6.65106 2.06847 7.03186V8.41084C2.06847 8.79164 1.75978 9.10033 1.37898 9.10033H0.689491C0.308696 9.10033 0 8.79164 0 8.41084V7.03186Z"
|
|
22
|
+
fill="currentColor"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M22.1436 6.97595C23.1225 6.13113 24.5563 6.13095 25.5352 6.97595C25.5844 7.02139 25.6129 7.08596 25.6143 7.15368C25.6156 7.22145 25.5894 7.28687 25.542 7.33435L24.0088 8.91345C23.9639 8.95973 23.9027 8.98571 23.8389 8.98571C23.775 8.98566 23.7138 8.9598 23.669 8.91345L22.1358 7.33435C22.0884 7.28683 22.0621 7.22144 22.0635 7.15368C22.0649 7.08593 22.0943 7.02136 22.1436 6.97595ZM20.0703 5.0863C22.1795 3.08361 25.4465 3.08362 27.5557 5.0863C27.6033 5.13326 27.6302 5.19841 27.6309 5.26599C27.6314 5.33341 27.6052 5.39784 27.5586 5.44567L26.6729 6.35974C26.5815 6.45307 26.4335 6.45548 26.3399 6.36462C25.6473 5.72459 24.7467 5.36952 23.8125 5.3695C22.8788 5.3699 21.9783 5.72488 21.2861 6.36462C21.1925 6.45548 21.0445 6.45307 20.9531 6.35974L20.0674 5.44567C20.0209 5.39792 19.9946 5.33335 19.9951 5.26599C19.9958 5.19843 20.0227 5.13325 20.0703 5.0863ZM18.001 3.19958C21.236 0.0354236 26.3393 0.0353572 29.5742 3.19958C29.6211 3.2466 29.6481 3.31125 29.6485 3.37829C29.6488 3.44529 29.6224 3.50946 29.5762 3.557L28.6895 4.47107C28.5981 4.56485 28.4493 4.56633 28.3565 4.474C27.124 3.27797 25.4887 2.61088 23.7881 2.61071C22.0873 2.61071 20.4515 3.27787 19.2188 4.474C19.126 4.56648 18.9771 4.565 18.8858 4.47107L17.9981 3.557C17.952 3.50946 17.9264 3.44515 17.9268 3.37829C17.9272 3.31125 17.9541 3.24656 18.001 3.19958Z"
|
|
26
|
+
fill="currentColor"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
opacity="0.35"
|
|
30
|
+
d="M37.9222 0.363281H50.0277C51.3498 0.363404 52.4211 1.43566 52.4212 2.75781V6.20508C52.4212 7.5273 51.3499 8.59949 50.0277 8.59961H37.9222C36.6 8.59953 35.5277 7.52732 35.5277 6.20508V2.75781C35.5278 1.43564 36.6 0.363363 37.9222 0.363281Z"
|
|
31
|
+
stroke="currentColor"
|
|
32
|
+
strokeWidth="0.727473"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
opacity="0.4"
|
|
36
|
+
d="M53.4749 3.44746V6.35735C54.0603 6.1109 54.441 5.53758 54.441 4.9024C54.441 4.26722 54.0603 3.69391 53.4749 3.44746Z"
|
|
37
|
+
fill="currentColor"
|
|
38
|
+
/>
|
|
39
|
+
<path
|
|
40
|
+
d="M36.5434 2.75797C36.5434 1.99638 37.1608 1.37898 37.9224 1.37898H50.0274C50.789 1.37898 51.4064 1.99637 51.4064 2.75796V6.20542C51.4064 6.96701 50.789 7.5844 50.0274 7.5844H37.9224C37.1608 7.5844 36.5434 6.96701 36.5434 6.20542V2.75797Z"
|
|
41
|
+
fill="currentColor"
|
|
42
|
+
/>
|
|
43
|
+
</svg>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -41,6 +41,8 @@ const WIDE_MIN_RATIO = 1.2;
|
|
|
41
41
|
// A picture the browser has neither loaded nor refused by now is laid out as a landscape.
|
|
42
42
|
const MEASURE_TIMEOUT_MS = 4000;
|
|
43
43
|
const COLUMN_GAP_PX = 12;
|
|
44
|
+
/** How many of a column's first frames load at once (they are in view when the wall is drawn). */
|
|
45
|
+
const EAGER_PHOTOS_PER_COLUMN = 2;
|
|
44
46
|
// A column is repeated until it is this much taller than the wall.
|
|
45
47
|
const FILL_FACTOR = 1.25;
|
|
46
48
|
const MAX_REPEATS = 8;
|
|
@@ -280,6 +282,10 @@ export function PhotoWall({ images, columns = 2, speed = 24, fadeColor, classNam
|
|
|
280
282
|
// caller's url is drawn as it is (already sized by its own image service).
|
|
281
283
|
optimizedWidth={drawnWidth}
|
|
282
284
|
unoptimized
|
|
285
|
+
// A column's first frames are on screen when the wall appears (one of them is
|
|
286
|
+
// usually the page's largest paint), so they are not left to lazy loading.
|
|
287
|
+
loading={i < EAGER_PHOTOS_PER_COLUMN ? 'eager' : 'lazy'}
|
|
288
|
+
fetchPriority={index === 0 && i === 0 ? 'high' : undefined}
|
|
283
289
|
/>
|
|
284
290
|
</div>
|
|
285
291
|
))}
|
|
@@ -6,7 +6,6 @@ import { useInView } from '../../hooks/ui/use-in-view';
|
|
|
6
6
|
import { cn } from '../../utils/cn';
|
|
7
7
|
import { Chevron02LeftIcon } from '../icons-v2-generated/arrows/chevron-02-left-icon';
|
|
8
8
|
import { Chevron02RightIcon } from '../icons-v2-generated/arrows/chevron-02-right-icon';
|
|
9
|
-
import { PlaybackToggle } from './playback-toggle';
|
|
10
9
|
|
|
11
10
|
/** The row under the track: the dots, the counter, the pause and the two arrows (the arrows set its height). */
|
|
12
11
|
const SNAP_CAROUSEL_CONTROLS_CLASS = 'mt-3 flex items-center gap-2';
|
|
@@ -28,9 +27,6 @@ export interface SnapCarouselProps<T> {
|
|
|
28
27
|
label: string;
|
|
29
28
|
/** Move to the next slide after this long. `0` turns auto-advance off. Default 5000. */
|
|
30
29
|
autoAdvanceMs?: number;
|
|
31
|
-
/** Names of the stop/start control. */
|
|
32
|
-
playLabel?: string;
|
|
33
|
-
pauseLabel?: string;
|
|
34
30
|
/** Width of one slide. Default `basis-[300px]`. */
|
|
35
31
|
slideClassName?: string;
|
|
36
32
|
prevLabel?: string;
|
|
@@ -67,10 +63,10 @@ function DotFill({ durationMs }: { durationMs: number }) {
|
|
|
67
63
|
*
|
|
68
64
|
* WHEN IT ADVANCES is `useAutoplay`'s rule, the same one the looping demos
|
|
69
65
|
* use: mostly on screen, tab visible, not paused, motion allowed. A swipe or
|
|
70
|
-
* an arrow moves it and it carries on from there after a full interval
|
|
71
|
-
* waits
|
|
72
|
-
*
|
|
73
|
-
*
|
|
66
|
+
* an arrow moves it and it carries on from there after a full interval. It
|
|
67
|
+
* waits while the visitor holds it (`useAutoplay`'s hold: a finger or the
|
|
68
|
+
* mouse button down on it, the keyboard inside it); there is no pause button. While it is auto-playing the active dot fills over the
|
|
69
|
+
* interval, so the wait is visible.
|
|
74
70
|
*/
|
|
75
71
|
export function SnapCarousel<T>({
|
|
76
72
|
items,
|
|
@@ -78,8 +74,6 @@ export function SnapCarousel<T>({
|
|
|
78
74
|
getKey,
|
|
79
75
|
label,
|
|
80
76
|
autoAdvanceMs = 5000,
|
|
81
|
-
playLabel,
|
|
82
|
-
pauseLabel,
|
|
83
77
|
slideClassName = 'basis-[300px]',
|
|
84
78
|
prevLabel = 'Previous',
|
|
85
79
|
nextLabel = 'Next',
|
|
@@ -88,8 +82,6 @@ export function SnapCarousel<T>({
|
|
|
88
82
|
}: SnapCarouselProps<T>) {
|
|
89
83
|
const trackRef = useRef<HTMLDivElement | null>(null);
|
|
90
84
|
const [index, setIndex] = useState(0);
|
|
91
|
-
// Held only while a finger or the mouse button is down on it: the visitor is mid-swipe.
|
|
92
|
-
const [pressed, setPressed] = useState(false);
|
|
93
85
|
const { ref: viewRef, inView } = useInView<HTMLDivElement>({ threshold: 0.5 });
|
|
94
86
|
const auto = useAutoplay(inView);
|
|
95
87
|
const count = items.length;
|
|
@@ -127,24 +119,8 @@ export function SnapCarousel<T>({
|
|
|
127
119
|
setIndex(Math.min(count - 1, Math.round(track.scrollLeft / step)));
|
|
128
120
|
}, [count, slideStep]);
|
|
129
121
|
|
|
130
|
-
// The release is listened for on the WINDOW: a press that ends outside the
|
|
131
|
-
// carousel (a drag that leaves it, a scroll the browser takes over) must
|
|
132
|
-
// still end, or the carousel would wait forever.
|
|
133
|
-
useEffect(() => {
|
|
134
|
-
if (!pressed) return undefined;
|
|
135
|
-
const release = () => setPressed(false);
|
|
136
|
-
window.addEventListener('pointerup', release);
|
|
137
|
-
window.addEventListener('pointercancel', release);
|
|
138
|
-
window.addEventListener('blur', release);
|
|
139
|
-
return () => {
|
|
140
|
-
window.removeEventListener('pointerup', release);
|
|
141
|
-
window.removeEventListener('pointercancel', release);
|
|
142
|
-
window.removeEventListener('blur', release);
|
|
143
|
-
};
|
|
144
|
-
}, [pressed]);
|
|
145
|
-
|
|
146
122
|
const canAutoAdvance = autoAdvanceMs > 0 && count > 1;
|
|
147
|
-
const playing = auto.playing && canAutoAdvance
|
|
123
|
+
const playing = auto.playing && canAutoAdvance;
|
|
148
124
|
|
|
149
125
|
// Restarts on every slide change, so a swipe or an arrow is followed by a full interval.
|
|
150
126
|
useEffect(() => {
|
|
@@ -164,7 +140,7 @@ export function SnapCarousel<T>({
|
|
|
164
140
|
if (count === 0) return null;
|
|
165
141
|
|
|
166
142
|
return (
|
|
167
|
-
<div className={className}
|
|
143
|
+
<div className={className} {...auto.holdProps}>
|
|
168
144
|
<div
|
|
169
145
|
ref={setRefs}
|
|
170
146
|
onScroll={onScroll}
|
|
@@ -212,14 +188,6 @@ export function SnapCarousel<T>({
|
|
|
212
188
|
>
|
|
213
189
|
{index + 1} / {count}
|
|
214
190
|
</span>
|
|
215
|
-
{canAutoAdvance && !auto.reducedMotion && (
|
|
216
|
-
<PlaybackToggle
|
|
217
|
-
paused={auto.paused}
|
|
218
|
-
onChange={auto.setPaused}
|
|
219
|
-
playLabel={playLabel}
|
|
220
|
-
pauseLabel={pauseLabel}
|
|
221
|
-
/>
|
|
222
|
-
)}
|
|
223
191
|
<button
|
|
224
192
|
type="button"
|
|
225
193
|
aria-label={prevLabel}
|