@540deg/ds 0.0.0-stage → 0.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 +202 -0
- package/NOTICE +13 -0
- package/README.md +207 -2
- package/dist/assets/samples/captura.js +4 -0
- package/dist/assets/samples/charla-david.js +4 -0
- package/dist/assets/samples/charla-escultura.js +4 -0
- package/dist/assets/samples/charla-fachada.js +4 -0
- package/dist/assets/samples/charla-pintura.js +4 -0
- package/dist/assets/samples/charla-placa.js +4 -0
- package/dist/assets/samples/charla-teclado.js +4 -0
- package/dist/assets/samples/logo-540-claro.js +4 -0
- package/dist/assets/samples/logo-540-portada-claro.js +4 -0
- package/dist/assets/samples/logo-540-portada-oscuro.js +4 -0
- package/dist/assets/samples/logos/cliente-1.js +4 -0
- package/dist/assets/samples/logos/cliente-2.js +4 -0
- package/dist/assets/samples/logos/cliente-3.js +4 -0
- package/dist/assets/samples/logos/cliente-4.js +4 -0
- package/dist/assets/samples/logos/cliente-5.js +4 -0
- package/dist/assets/samples/logos/cliente-6.js +4 -0
- package/dist/assets/samples/logos/cliente-7.js +4 -0
- package/dist/assets/samples/logos/cliente-8.js +4 -0
- package/dist/assets/samples/logos/cliente-9.js +4 -0
- package/dist/assets/samples/retrato.js +4 -0
- package/dist/components/atoms/Bullets/Bullets.d.ts +6 -0
- package/dist/components/atoms/Bullets/Bullets.js +34 -0
- package/dist/components/atoms/Bullets/Bullets.module.js +13 -0
- package/dist/components/atoms/Bullets/index.d.ts +3 -0
- package/dist/components/atoms/Bullets/types.d.ts +23 -0
- package/dist/components/atoms/Bullets/types.js +9 -0
- package/dist/components/atoms/Button/Button.d.ts +6 -0
- package/dist/components/atoms/Button/Button.js +46 -0
- package/dist/components/atoms/Button/Button.module.js +24 -0
- package/dist/components/atoms/Button/index.d.ts +3 -0
- package/dist/components/atoms/Button/types.d.ts +38 -0
- package/dist/components/atoms/Button/types.js +14 -0
- package/dist/components/atoms/Count/Count.d.ts +6 -0
- package/dist/components/atoms/Count/Count.js +51 -0
- package/dist/components/atoms/Count/Count.module.js +9 -0
- package/dist/components/atoms/Count/index.d.ts +3 -0
- package/dist/components/atoms/Count/types.d.ts +17 -0
- package/dist/components/atoms/Count/types.js +8 -0
- package/dist/components/atoms/Image/Image.d.ts +6 -0
- package/dist/components/atoms/Image/Image.js +30 -0
- package/dist/components/atoms/Image/Image.module.js +11 -0
- package/dist/components/atoms/Image/index.d.ts +3 -0
- package/dist/components/atoms/Image/types.d.ts +16 -0
- package/dist/components/atoms/Image/types.js +13 -0
- package/dist/components/atoms/Logo/Logo.d.ts +6 -0
- package/dist/components/atoms/Logo/Logo.js +32 -0
- package/dist/components/atoms/Logo/Logo.module.js +10 -0
- package/dist/components/atoms/Logo/index.d.ts +3 -0
- package/dist/components/atoms/Logo/paths.d.ts +2 -0
- package/dist/components/atoms/Logo/paths.js +11 -0
- package/dist/components/atoms/Logo/types.d.ts +14 -0
- package/dist/components/atoms/Logo/types.js +12 -0
- package/dist/components/atoms/MenuItem/MenuItem.d.ts +6 -0
- package/dist/components/atoms/MenuItem/MenuItem.js +28 -0
- package/dist/components/atoms/MenuItem/MenuItem.module.js +19 -0
- package/dist/components/atoms/MenuItem/index.d.ts +3 -0
- package/dist/components/atoms/MenuItem/types.d.ts +18 -0
- package/dist/components/atoms/MenuItem/types.js +8 -0
- package/dist/components/atoms/SocialIcon/SocialIcon.d.ts +6 -0
- package/dist/components/atoms/SocialIcon/SocialIcon.js +26 -0
- package/dist/components/atoms/SocialIcon/SocialIcon.module.js +9 -0
- package/dist/components/atoms/SocialIcon/index.d.ts +3 -0
- package/dist/components/atoms/SocialIcon/paths.d.ts +7 -0
- package/dist/components/atoms/SocialIcon/paths.js +10 -0
- package/dist/components/atoms/SocialIcon/types.d.ts +15 -0
- package/dist/components/atoms/SocialIcon/types.js +11 -0
- package/dist/components/atoms/Text/Text.d.ts +6 -0
- package/dist/components/atoms/Text/Text.js +28 -0
- package/dist/components/atoms/Text/Text.module.js +32 -0
- package/dist/components/atoms/Text/index.d.ts +3 -0
- package/dist/components/atoms/Text/types.d.ts +39 -0
- package/dist/components/atoms/Text/types.js +54 -0
- package/dist/components/atoms/ThemeToggle/ThemeToggle.d.ts +6 -0
- package/dist/components/atoms/ThemeToggle/ThemeToggle.js +30 -0
- package/dist/components/atoms/ThemeToggle/ThemeToggle.module.js +17 -0
- package/dist/components/atoms/ThemeToggle/index.d.ts +3 -0
- package/dist/components/atoms/ThemeToggle/types.d.ts +13 -0
- package/dist/components/atoms/ThemeToggle/types.js +4 -0
- package/dist/components/molecules/Card/Card.d.ts +6 -0
- package/dist/components/molecules/Card/Card.js +82 -0
- package/dist/components/molecules/Card/Card.module.js +33 -0
- package/dist/components/molecules/Card/index.d.ts +3 -0
- package/dist/components/molecules/Card/types.d.ts +48 -0
- package/dist/components/molecules/Card/types.js +17 -0
- package/dist/components/molecules/Carousel/Carousel.d.ts +5 -0
- package/dist/components/molecules/Carousel/Carousel.js +148 -0
- package/dist/components/molecules/Carousel/Carousel.module.js +29 -0
- package/dist/components/molecules/Carousel/index.d.ts +3 -0
- package/dist/components/molecules/Carousel/types.d.ts +24 -0
- package/dist/components/molecules/Carousel/types.js +12 -0
- package/dist/components/molecules/CaseItem/CaseItem.d.ts +6 -0
- package/dist/components/molecules/CaseItem/CaseItem.js +54 -0
- package/dist/components/molecules/CaseItem/CaseItem.module.js +19 -0
- package/dist/components/molecules/CaseItem/index.d.ts +3 -0
- package/dist/components/molecules/CaseItem/types.d.ts +20 -0
- package/dist/components/molecules/CaseItem/types.js +7 -0
- package/dist/components/molecules/Dialog/Dialog.d.ts +6 -0
- package/dist/components/molecules/Dialog/Dialog.js +81 -0
- package/dist/components/molecules/Dialog/Dialog.module.js +19 -0
- package/dist/components/molecules/Dialog/index.d.ts +2 -0
- package/dist/components/molecules/Dialog/types.d.ts +22 -0
- package/dist/components/molecules/Field/Field.d.ts +6 -0
- package/dist/components/molecules/Field/Field.js +47 -0
- package/dist/components/molecules/Field/Field.module.js +15 -0
- package/dist/components/molecules/Field/index.d.ts +3 -0
- package/dist/components/molecules/Field/types.d.ts +24 -0
- package/dist/components/molecules/Field/types.js +5 -0
- package/dist/components/molecules/Footer/Footer.d.ts +6 -0
- package/dist/components/molecules/Footer/Footer.js +102 -0
- package/dist/components/molecules/Footer/Footer.module.js +33 -0
- package/dist/components/molecules/Footer/index.d.ts +3 -0
- package/dist/components/molecules/Footer/types.d.ts +46 -0
- package/dist/components/molecules/Footer/types.js +8 -0
- package/dist/components/molecules/Grid/Grid.d.ts +5 -0
- package/dist/components/molecules/Grid/Grid.js +32 -0
- package/dist/components/molecules/Grid/Grid.module.js +29 -0
- package/dist/components/molecules/Grid/index.d.ts +3 -0
- package/dist/components/molecules/Grid/types.d.ts +28 -0
- package/dist/components/molecules/Grid/types.js +14 -0
- package/dist/components/molecules/Lists/Lists.d.ts +7 -0
- package/dist/components/molecules/Lists/Lists.js +54 -0
- package/dist/components/molecules/Lists/Lists.module.js +15 -0
- package/dist/components/molecules/Lists/index.d.ts +2 -0
- package/dist/components/molecules/Lists/types.d.ts +22 -0
- package/dist/components/molecules/Menu/Menu.d.ts +6 -0
- package/dist/components/molecules/Menu/Menu.js +43 -0
- package/dist/components/molecules/Menu/Menu.module.js +13 -0
- package/dist/components/molecules/Menu/index.d.ts +3 -0
- package/dist/components/molecules/Menu/types.d.ts +27 -0
- package/dist/components/molecules/Menu/types.js +8 -0
- package/dist/components/molecules/Metric/Metric.d.ts +5 -0
- package/dist/components/molecules/Metric/Metric.js +40 -0
- package/dist/components/molecules/Metric/Metric.module.js +11 -0
- package/dist/components/molecules/Metric/index.d.ts +2 -0
- package/dist/components/molecules/Metric/types.d.ts +15 -0
- package/dist/components/molecules/NavMobile/NavMobile.d.ts +6 -0
- package/dist/components/molecules/NavMobile/NavMobile.js +95 -0
- package/dist/components/molecules/NavMobile/NavMobile.module.js +17 -0
- package/dist/components/molecules/NavMobile/index.d.ts +3 -0
- package/dist/components/molecules/NavMobile/types.d.ts +20 -0
- package/dist/components/molecules/NavMobile/types.js +8 -0
- package/dist/components/molecules/Question/Question.d.ts +3 -0
- package/dist/components/molecules/Question/Question.js +22 -0
- package/dist/components/molecules/Question/Question.module.js +5 -0
- package/dist/components/molecules/Question/index.d.ts +2 -0
- package/dist/components/molecules/Question/types.d.ts +8 -0
- package/dist/components/molecules/Screenshot/Screenshot.d.ts +3 -0
- package/dist/components/molecules/Screenshot/Screenshot.js +17 -0
- package/dist/components/molecules/Screenshot/Screenshot.module.js +5 -0
- package/dist/components/molecules/Screenshot/index.d.ts +2 -0
- package/dist/components/molecules/Screenshot/types.d.ts +12 -0
- package/dist/components/molecules/Section/Section.d.ts +6 -0
- package/dist/components/molecules/Section/Section.js +25 -0
- package/dist/components/molecules/Section/Section.module.js +11 -0
- package/dist/components/molecules/Section/index.d.ts +3 -0
- package/dist/components/molecules/Section/types.d.ts +13 -0
- package/dist/components/molecules/Section/types.js +5 -0
- package/dist/components/molecules/SectionHeader/SectionHeader.d.ts +6 -0
- package/dist/components/molecules/SectionHeader/SectionHeader.js +34 -0
- package/dist/components/molecules/SectionHeader/SectionHeader.module.js +9 -0
- package/dist/components/molecules/SectionHeader/index.d.ts +3 -0
- package/dist/components/molecules/SectionHeader/types.d.ts +22 -0
- package/dist/components/molecules/SectionHeader/types.js +14 -0
- package/dist/components/molecules/Stack/Stack.d.ts +6 -0
- package/dist/components/molecules/Stack/Stack.js +22 -0
- package/dist/components/molecules/Stack/Stack.module.js +12 -0
- package/dist/components/molecules/Stack/index.d.ts +3 -0
- package/dist/components/molecules/Stack/types.d.ts +18 -0
- package/dist/components/molecules/Stack/types.js +17 -0
- package/dist/components/molecules/TeamMember/TeamMember.d.ts +6 -0
- package/dist/components/molecules/TeamMember/TeamMember.js +55 -0
- package/dist/components/molecules/TeamMember/TeamMember.module.js +13 -0
- package/dist/components/molecules/TeamMember/index.d.ts +3 -0
- package/dist/components/molecules/TeamMember/types.d.ts +24 -0
- package/dist/components/molecules/TeamMember/types.js +8 -0
- package/dist/components/organisms/Bars/Bars.d.ts +6 -0
- package/dist/components/organisms/Bars/Bars.js +94 -0
- package/dist/components/organisms/Bars/Bars.module.js +26 -0
- package/dist/components/organisms/Bars/index.d.ts +3 -0
- package/dist/components/organisms/Bars/types.d.ts +43 -0
- package/dist/components/organisms/Bars/types.js +12 -0
- package/dist/components/organisms/Blobs/Blobs.d.ts +3 -0
- package/dist/components/organisms/Blobs/Blobs.js +14 -0
- package/dist/components/organisms/Blobs/Blobs.module.js +15 -0
- package/dist/components/organisms/Blobs/index.d.ts +2 -0
- package/dist/components/organisms/Blobs/types.d.ts +3 -0
- package/dist/components/organisms/BlockTitle/BlockTitle.d.ts +6 -0
- package/dist/components/organisms/BlockTitle/BlockTitle.js +46 -0
- package/dist/components/organisms/BlockTitle/BlockTitle.module.js +15 -0
- package/dist/components/organisms/BlockTitle/index.d.ts +2 -0
- package/dist/components/organisms/BlockTitle/types.d.ts +18 -0
- package/dist/components/organisms/CardList/CardList.d.ts +6 -0
- package/dist/components/organisms/CardList/CardList.js +15 -0
- package/dist/components/organisms/CardList/CardList.module.js +5 -0
- package/dist/components/organisms/CardList/index.d.ts +2 -0
- package/dist/components/organisms/CardList/types.d.ts +6 -0
- package/dist/components/organisms/Closing/Closing.d.ts +6 -0
- package/dist/components/organisms/Closing/Closing.js +42 -0
- package/dist/components/organisms/Closing/Closing.module.js +9 -0
- package/dist/components/organisms/Closing/index.d.ts +3 -0
- package/dist/components/organisms/Closing/types.d.ts +15 -0
- package/dist/components/organisms/Closing/types.js +4 -0
- package/dist/components/organisms/Cover/Cover.d.ts +6 -0
- package/dist/components/organisms/Cover/Cover.js +85 -0
- package/dist/components/organisms/Cover/Cover.module.js +21 -0
- package/dist/components/organisms/Cover/index.d.ts +3 -0
- package/dist/components/organisms/Cover/types.d.ts +33 -0
- package/dist/components/organisms/Cover/types.js +4 -0
- package/dist/components/organisms/Cycle/Cycle.d.ts +6 -0
- package/dist/components/organisms/Cycle/Cycle.js +79 -0
- package/dist/components/organisms/Cycle/Cycle.module.js +17 -0
- package/dist/components/organisms/Cycle/index.d.ts +3 -0
- package/dist/components/organisms/Cycle/types.d.ts +18 -0
- package/dist/components/organisms/Cycle/types.js +9 -0
- package/dist/components/organisms/Deck/Deck.d.ts +6 -0
- package/dist/components/organisms/Deck/Deck.js +159 -0
- package/dist/components/organisms/Deck/Deck.module.js +19 -0
- package/dist/components/organisms/Deck/index.d.ts +4 -0
- package/dist/components/organisms/Deck/types.d.ts +37 -0
- package/dist/components/organisms/Deck/types.js +13 -0
- package/dist/components/organisms/Deck/useDeckNavigation.d.ts +15 -0
- package/dist/components/organisms/Deck/useDeckNavigation.js +218 -0
- package/dist/components/organisms/DeckFooter/DeckFooter.d.ts +6 -0
- package/dist/components/organisms/DeckFooter/DeckFooter.js +75 -0
- package/dist/components/organisms/DeckFooter/DeckFooter.module.js +25 -0
- package/dist/components/organisms/DeckFooter/index.d.ts +3 -0
- package/dist/components/organisms/DeckFooter/types.d.ts +22 -0
- package/dist/components/organisms/DeckFooter/types.js +8 -0
- package/dist/components/organisms/Flow/Flow.d.ts +6 -0
- package/dist/components/organisms/Flow/Flow.js +26 -0
- package/dist/components/organisms/Flow/Flow.module.js +13 -0
- package/dist/components/organisms/Flow/index.d.ts +3 -0
- package/dist/components/organisms/Flow/types.d.ts +17 -0
- package/dist/components/organisms/Flow/types.js +4 -0
- package/dist/components/organisms/Form/Form.d.ts +6 -0
- package/dist/components/organisms/Form/Form.js +28 -0
- package/dist/components/organisms/Form/Form.module.js +13 -0
- package/dist/components/organisms/Form/index.d.ts +3 -0
- package/dist/components/organisms/Form/types.d.ts +16 -0
- package/dist/components/organisms/Form/types.js +8 -0
- package/dist/components/organisms/Heartbeat/Heartbeat.d.ts +3 -0
- package/dist/components/organisms/Heartbeat/Heartbeat.js +17 -0
- package/dist/components/organisms/Heartbeat/Heartbeat.module.js +13 -0
- package/dist/components/organisms/Heartbeat/index.d.ts +2 -0
- package/dist/components/organisms/Heartbeat/types.d.ts +3 -0
- package/dist/components/organisms/LogoCarousel/LogoCarousel.d.ts +6 -0
- package/dist/components/organisms/LogoCarousel/LogoCarousel.js +72 -0
- package/dist/components/organisms/LogoCarousel/LogoCarousel.module.js +13 -0
- package/dist/components/organisms/LogoCarousel/index.d.ts +3 -0
- package/dist/components/organisms/LogoCarousel/types.d.ts +18 -0
- package/dist/components/organisms/LogoCarousel/types.js +4 -0
- package/dist/components/organisms/Marquee/Marquee.d.ts +7 -0
- package/dist/components/organisms/Marquee/Marquee.js +57 -0
- package/dist/components/organisms/Marquee/Marquee.module.js +15 -0
- package/dist/components/organisms/Marquee/index.d.ts +3 -0
- package/dist/components/organisms/Marquee/types.d.ts +11 -0
- package/dist/components/organisms/Marquee/types.js +4 -0
- package/dist/components/organisms/ProgressBar/ProgressBar.d.ts +6 -0
- package/dist/components/organisms/ProgressBar/ProgressBar.js +56 -0
- package/dist/components/organisms/ProgressBar/ProgressBar.module.js +17 -0
- package/dist/components/organisms/ProgressBar/index.d.ts +3 -0
- package/dist/components/organisms/ProgressBar/types.d.ts +20 -0
- package/dist/components/organisms/ProgressBar/types.js +7 -0
- package/dist/components/organisms/Punchline/Punchline.d.ts +6 -0
- package/dist/components/organisms/Punchline/Punchline.js +41 -0
- package/dist/components/organisms/Punchline/Punchline.module.js +11 -0
- package/dist/components/organisms/Punchline/index.d.ts +3 -0
- package/dist/components/organisms/Punchline/types.d.ts +15 -0
- package/dist/components/organisms/Punchline/types.js +4 -0
- package/dist/components/organisms/Quote/Quote.d.ts +3 -0
- package/dist/components/organisms/Quote/Quote.js +33 -0
- package/dist/components/organisms/Quote/Quote.module.js +5 -0
- package/dist/components/organisms/Quote/index.d.ts +3 -0
- package/dist/components/organisms/Quote/types.d.ts +15 -0
- package/dist/components/organisms/Quote/types.js +4 -0
- package/dist/components/organisms/Schema/Schema.d.ts +54 -0
- package/dist/components/organisms/Schema/Schema.js +117 -0
- package/dist/components/organisms/Schema/Schema.module.js +87 -0
- package/dist/components/organisms/Schema/index.d.ts +2 -0
- package/dist/components/organisms/Schema/types.d.ts +32 -0
- package/dist/components/organisms/Share/Share.d.ts +6 -0
- package/dist/components/organisms/Share/Share.js +68 -0
- package/dist/components/organisms/Share/Share.module.js +22 -0
- package/dist/components/organisms/Share/index.d.ts +3 -0
- package/dist/components/organisms/Share/types.d.ts +24 -0
- package/dist/components/organisms/Share/types.js +4 -0
- package/dist/components/organisms/Sheet/Sheet.d.ts +2 -0
- package/dist/components/organisms/Sheet/Sheet.js +92 -0
- package/dist/components/organisms/Sheet/Sheet.module.js +15 -0
- package/dist/components/organisms/Sheet/index.d.ts +3 -0
- package/dist/components/organisms/Sheet/types.d.ts +15 -0
- package/dist/components/organisms/Sheet/types.js +4 -0
- package/dist/components/organisms/Slide/Slide.d.ts +6 -0
- package/dist/components/organisms/Slide/Slide.js +29 -0
- package/dist/components/organisms/Slide/Slide.module.js +13 -0
- package/dist/components/organisms/Slide/index.d.ts +3 -0
- package/dist/components/organisms/Slide/types.d.ts +18 -0
- package/dist/components/organisms/Slide/types.js +8 -0
- package/dist/components/organisms/Spotlight/Spotlight.d.ts +7 -0
- package/dist/components/organisms/Spotlight/Spotlight.js +39 -0
- package/dist/components/organisms/Spotlight/Spotlight.module.js +5 -0
- package/dist/components/organisms/Spotlight/index.d.ts +2 -0
- package/dist/components/organisms/Spotlight/types.d.ts +6 -0
- package/dist/components/organisms/Statements/Statements.d.ts +7 -0
- package/dist/components/organisms/Statements/Statements.js +50 -0
- package/dist/components/organisms/Statements/Statements.module.js +11 -0
- package/dist/components/organisms/Statements/index.d.ts +3 -0
- package/dist/components/organisms/Statements/types.d.ts +14 -0
- package/dist/components/organisms/Statements/types.js +7 -0
- package/dist/components/organisms/Steps/Steps.d.ts +15 -0
- package/dist/components/organisms/Steps/Steps.js +117 -0
- package/dist/components/organisms/Steps/Steps.module.js +13 -0
- package/dist/components/organisms/Steps/StepsContext.d.ts +11 -0
- package/dist/components/organisms/Steps/StepsContext.js +18 -0
- package/dist/components/organisms/Steps/index.d.ts +3 -0
- package/dist/components/organisms/Steps/types.d.ts +22 -0
- package/dist/components/organisms/Story/Story.d.ts +6 -0
- package/dist/components/organisms/Story/Story.js +43 -0
- package/dist/components/organisms/Story/Story.module.js +5 -0
- package/dist/components/organisms/Story/index.d.ts +3 -0
- package/dist/components/organisms/Story/types.d.ts +20 -0
- package/dist/components/organisms/Story/types.js +7 -0
- package/dist/components/organisms/Timeline/Timeline.d.ts +7 -0
- package/dist/components/organisms/Timeline/Timeline.js +67 -0
- package/dist/components/organisms/Timeline/Timeline.module.js +19 -0
- package/dist/components/organisms/Timeline/index.d.ts +3 -0
- package/dist/components/organisms/Timeline/types.d.ts +25 -0
- package/dist/components/organisms/Timeline/types.js +4 -0
- package/dist/components/organisms/Tools/Tools.d.ts +6 -0
- package/dist/components/organisms/Tools/Tools.js +47 -0
- package/dist/components/organisms/Tools/Tools.module.js +17 -0
- package/dist/components/organisms/Tools/index.d.ts +3 -0
- package/dist/components/organisms/Tools/types.d.ts +23 -0
- package/dist/components/organisms/Tools/types.js +4 -0
- package/dist/fonts/OFL.txt +93 -0
- package/dist/fonts/dm-sans-latin-opsz-normal.woff2 +0 -0
- package/dist/hooks/useCenterState.d.ts +9 -0
- package/dist/hooks/useCenterState.js +40 -0
- package/dist/hooks/useReveal.d.ts +7 -0
- package/dist/hooks/useReveal.js +34 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +98 -0
- package/dist/styles.css +3441 -0
- package/dist/templates/TalkTemplate/TalkTemplate.d.ts +7 -0
- package/dist/templates/TalkTemplate/TalkTemplate.js +1392 -0
- package/dist/templates/TalkTemplate/index.d.ts +2 -0
- package/package.json +86 -4
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useStepOn, useSteps } from "../Steps/StepsContext.js";
|
|
2
|
+
import { Text } from "../../atoms/Text/Text.js";
|
|
3
|
+
import Sheet_module_default from "./Sheet.module.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
//#region src/components/organisms/Sheet/Sheet.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Sheet is a panel that rises from the bottom edge over the stop, with a veil behind.
|
|
9
|
+
* Inside a Step it opens with the step; it hides as soon as its stop (the step of a timeline,
|
|
10
|
+
* or the whole section) leaves the center of the window.
|
|
11
|
+
*/
|
|
12
|
+
/** The stop the Deck counts for el: its outermost [data-stop], or else its section. */
|
|
13
|
+
function stopOf(el) {
|
|
14
|
+
let stop = null;
|
|
15
|
+
for (let cur = el.parentElement?.closest("[data-stop]"); cur; cur = cur.parentElement?.closest("[data-stop]")) stop = cur;
|
|
16
|
+
return stop ?? el.closest("section");
|
|
17
|
+
}
|
|
18
|
+
function Sheet({ open, kicker, title, description, children, className }) {
|
|
19
|
+
const stepOn = useStepOn();
|
|
20
|
+
const { total, guided } = useSteps();
|
|
21
|
+
const wanted = open ?? (total > 0 && !guided ? false : stepOn);
|
|
22
|
+
const anchor = useRef(null);
|
|
23
|
+
const [onScreen, setOnScreen] = useState(true);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const check = () => {
|
|
26
|
+
const stop = anchor.current ? stopOf(anchor.current) : null;
|
|
27
|
+
if (!stop) return setOnScreen(true);
|
|
28
|
+
const r = stop.getBoundingClientRect();
|
|
29
|
+
const c = window.innerHeight / 2;
|
|
30
|
+
setOnScreen(r.top < c && r.bottom > c);
|
|
31
|
+
};
|
|
32
|
+
check();
|
|
33
|
+
window.addEventListener("scroll", check, {
|
|
34
|
+
passive: true,
|
|
35
|
+
capture: true
|
|
36
|
+
});
|
|
37
|
+
window.addEventListener("resize", check);
|
|
38
|
+
return () => {
|
|
39
|
+
window.removeEventListener("scroll", check, { capture: true });
|
|
40
|
+
window.removeEventListener("resize", check);
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
const isOpen = wanted && onScreen;
|
|
44
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx("span", {
|
|
46
|
+
ref: anchor,
|
|
47
|
+
hidden: true
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: Sheet_module_default.veil,
|
|
51
|
+
"data-open": isOpen ? "" : void 0,
|
|
52
|
+
"aria-hidden": "true"
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: [Sheet_module_default.sheet, className ?? ""].filter(Boolean).join(" "),
|
|
56
|
+
"data-open": isOpen ? "" : void 0,
|
|
57
|
+
"data-scale": "web",
|
|
58
|
+
"data-sheet": "",
|
|
59
|
+
"aria-hidden": isOpen ? void 0 : true,
|
|
60
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
61
|
+
className: Sheet_module_default.panel,
|
|
62
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
63
|
+
className: Sheet_module_default.header,
|
|
64
|
+
children: [
|
|
65
|
+
kicker ? /* @__PURE__ */ jsx(Text, {
|
|
66
|
+
variant: "body-s",
|
|
67
|
+
tone: "secondary",
|
|
68
|
+
children: kicker
|
|
69
|
+
}) : null,
|
|
70
|
+
/* @__PURE__ */ jsx(Text, {
|
|
71
|
+
as: "h3",
|
|
72
|
+
variant: "title-m",
|
|
73
|
+
wrap: "balance",
|
|
74
|
+
children: title
|
|
75
|
+
}),
|
|
76
|
+
description ? /* @__PURE__ */ jsx(Text, {
|
|
77
|
+
variant: "body-m",
|
|
78
|
+
tone: "secondary",
|
|
79
|
+
wrap: "pretty",
|
|
80
|
+
children: description
|
|
81
|
+
}) : null
|
|
82
|
+
]
|
|
83
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
84
|
+
className: Sheet_module_default.body,
|
|
85
|
+
children
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
] });
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { Sheet };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/components/organisms/Sheet/Sheet.module.css
|
|
2
|
+
var veil = "_veil_kx9ft_4";
|
|
3
|
+
var sheet = "_sheet_kx9ft_18";
|
|
4
|
+
var panel = "_panel_kx9ft_40";
|
|
5
|
+
var header = "_header_kx9ft_66";
|
|
6
|
+
var body = "_body_kx9ft_72";
|
|
7
|
+
var Sheet_module_default = {
|
|
8
|
+
veil,
|
|
9
|
+
sheet,
|
|
10
|
+
panel,
|
|
11
|
+
header,
|
|
12
|
+
body
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { body, Sheet_module_default as default, header, panel, sheet, veil };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type SheetProps = {
|
|
3
|
+
/** Open or closed. Inside a Step, leave it out: the sheet follows the step. */
|
|
4
|
+
open?: boolean;
|
|
5
|
+
/** The small line above the title ("Zoom · marzo"). */
|
|
6
|
+
kicker?: ReactNode;
|
|
7
|
+
/** The title. */
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
/** One sentence under the title. */
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/** The content: a diagram, cards, a list. */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const SHEET_DEFAULTS: {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SlideProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Slide is a stop of the talk: a section that fills the screen and centers its content on a
|
|
4
|
+
* 16:9 stage inside the column. Deck collects every Slide as a stop of the journey.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Slide({ id, tone, full, className, children, ...rest }: SlideProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Slide_module_default from "./Slide.module.js";
|
|
2
|
+
import { SLIDE_DEFAULTS } from "./types.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/organisms/Slide/Slide.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Slide is a stop of the talk: a section that fills the screen and centers its content on a
|
|
7
|
+
* 16:9 stage inside the column. Deck collects every Slide as a stop of the journey.
|
|
8
|
+
*/
|
|
9
|
+
function Slide({ id, tone = SLIDE_DEFAULTS.tone, full = SLIDE_DEFAULTS.full, className, children, ...rest }) {
|
|
10
|
+
const classes = [
|
|
11
|
+
Slide_module_default.slide,
|
|
12
|
+
Slide_module_default[`tone-${tone}`],
|
|
13
|
+
full ? Slide_module_default.full : "",
|
|
14
|
+
className ?? ""
|
|
15
|
+
].filter(Boolean).join(" ");
|
|
16
|
+
return /* @__PURE__ */ jsx("section", {
|
|
17
|
+
id,
|
|
18
|
+
className: classes,
|
|
19
|
+
"data-slide": "",
|
|
20
|
+
...rest,
|
|
21
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
22
|
+
className: Slide_module_default.stage,
|
|
23
|
+
"data-slide-stage": "",
|
|
24
|
+
children
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Slide };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/components/organisms/Slide/Slide.module.css
|
|
2
|
+
var slide = "_slide_yly5c_4";
|
|
3
|
+
var full = "_full_yly5c_12";
|
|
4
|
+
var stage = "_stage_yly5c_31";
|
|
5
|
+
var Slide_module_default = {
|
|
6
|
+
slide,
|
|
7
|
+
full,
|
|
8
|
+
"tone-default": "_tone-default_yly5c_16",
|
|
9
|
+
"tone-raised": "_tone-raised_yly5c_20",
|
|
10
|
+
stage
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Slide_module_default as default, full, slide, stage };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export declare const SLIDE_TONES: readonly ["default", "raised"];
|
|
3
|
+
export type SlideTone = (typeof SLIDE_TONES)[number];
|
|
4
|
+
export type SlideProps = {
|
|
5
|
+
/** The id: the stop's anchor (#portada, #cierre…). */
|
|
6
|
+
id: string;
|
|
7
|
+
/** default paints nothing; raised lifts the band one step (stories, objections, quotes). */
|
|
8
|
+
tone?: SlideTone;
|
|
9
|
+
/** Fill the screen (min-height 100svh) and center the content. Off for block titles that go with a photo. */
|
|
10
|
+
full?: boolean;
|
|
11
|
+
/** The content, centered on a 16:9 stage inside the column. */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
} & Omit<ComponentPropsWithoutRef<'section'>, 'id' | 'className' | 'children'>;
|
|
15
|
+
export declare const SLIDE_DEFAULTS: {
|
|
16
|
+
readonly tone: "default";
|
|
17
|
+
readonly full: true;
|
|
18
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SpotlightProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Spotlight lights the piece that holds the center of the window and dims the others to 14 %,
|
|
4
|
+
* like the sentences of the journey and the months of a timeline. Each one is a stop of the Deck
|
|
5
|
+
* (data-stop), so the arrow stops on every piece of a pile instead of paging over them.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Spotlight({ children, className }: SpotlightProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Spotlight_module_default from "./Spotlight.module.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
//#region src/components/organisms/Spotlight/Spotlight.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Spotlight lights the piece that holds the center of the window and dims the others to 14 %,
|
|
7
|
+
* like the sentences of the journey and the months of a timeline. Each one is a stop of the Deck
|
|
8
|
+
* (data-stop), so the arrow stops on every piece of a pile instead of paging over them.
|
|
9
|
+
*/
|
|
10
|
+
function Spotlight({ children, className }) {
|
|
11
|
+
const ref = useRef(null);
|
|
12
|
+
const [on, setOn] = useState(false);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
15
|
+
let raf = 0;
|
|
16
|
+
const tick = () => {
|
|
17
|
+
const el = ref.current;
|
|
18
|
+
if (el) {
|
|
19
|
+
const r = el.getBoundingClientRect();
|
|
20
|
+
const c = window.innerHeight / 2;
|
|
21
|
+
const inside = r.top < c && r.bottom > c;
|
|
22
|
+
const near = Math.abs((r.top + r.bottom) / 2 - c) < window.innerHeight * .3;
|
|
23
|
+
setOn(inside || near);
|
|
24
|
+
}
|
|
25
|
+
raf = requestAnimationFrame(tick);
|
|
26
|
+
};
|
|
27
|
+
raf = requestAnimationFrame(tick);
|
|
28
|
+
return () => cancelAnimationFrame(raf);
|
|
29
|
+
}, []);
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
ref,
|
|
32
|
+
className: [Spotlight_module_default.spotlight, className ?? ""].filter(Boolean).join(" "),
|
|
33
|
+
"data-stop": "",
|
|
34
|
+
"data-on": on ? "" : void 0,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { Spotlight };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StatementsProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Statements are the sentences of the journey, stacked: one stop each (Deck splits the slide
|
|
4
|
+
* with data-stop), in statement, three quarters wide, with an optional ordinal in front.
|
|
5
|
+
* The sentence holding the center is lit; the told ones dim to 14 % and the ones to come stay hidden.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Statements({ id, sentences, numbered, className }: StatementsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Text } from "../../atoms/Text/Text.js";
|
|
2
|
+
import { Slide } from "../Slide/Slide.js";
|
|
3
|
+
import { useCenterState } from "../../../hooks/useCenterState.js";
|
|
4
|
+
import Statements_module_default from "./Statements.module.js";
|
|
5
|
+
import { STATEMENTS_DEFAULTS } from "./types.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useRef } from "react";
|
|
8
|
+
//#region src/components/organisms/Statements/Statements.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Statements are the sentences of the journey, stacked: one stop each (Deck splits the slide
|
|
11
|
+
* with data-stop), in statement, three quarters wide, with an optional ordinal in front.
|
|
12
|
+
* The sentence holding the center is lit; the told ones dim to 14 % and the ones to come stay hidden.
|
|
13
|
+
*/
|
|
14
|
+
function Statements({ id = STATEMENTS_DEFAULTS.id, sentences, numbered = STATEMENTS_DEFAULTS.numbered, className }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(Slide, {
|
|
16
|
+
id,
|
|
17
|
+
full: false,
|
|
18
|
+
className: [Statements_module_default.section, className ?? ""].filter(Boolean).join(" "),
|
|
19
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: Statements_module_default.stack,
|
|
21
|
+
children: sentences.map((sentence, i) => /* @__PURE__ */ jsx(Sentence, {
|
|
22
|
+
ordinal: numbered ? String(i + 1).padStart(2, "0") : void 0,
|
|
23
|
+
children: sentence
|
|
24
|
+
}, i))
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function Sentence({ ordinal, children }) {
|
|
29
|
+
const ref = useRef(null);
|
|
30
|
+
const state = useCenterState(ref);
|
|
31
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
ref,
|
|
33
|
+
className: Statements_module_default.stop,
|
|
34
|
+
"data-stop": "",
|
|
35
|
+
"data-state": state,
|
|
36
|
+
children: /* @__PURE__ */ jsxs(Text, {
|
|
37
|
+
as: "p",
|
|
38
|
+
variant: "statement",
|
|
39
|
+
align: "center",
|
|
40
|
+
wrap: "balance",
|
|
41
|
+
measure: "wide",
|
|
42
|
+
children: [ordinal ? /* @__PURE__ */ jsxs("span", {
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: [ordinal, " "]
|
|
45
|
+
}) : null, children]
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Statements };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/components/organisms/Statements/Statements.module.css
|
|
2
|
+
var section = "_section_pa9rm_4";
|
|
3
|
+
var stack = "_stack_pa9rm_14";
|
|
4
|
+
var stop = "_stop_pa9rm_21";
|
|
5
|
+
var Statements_module_default = {
|
|
6
|
+
section,
|
|
7
|
+
stack,
|
|
8
|
+
stop
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Statements_module_default as default, section, stack, stop };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type StatementsProps = {
|
|
3
|
+
/** The stop's anchor. */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** The sentences, in order. Each one is a stop of the journey. */
|
|
6
|
+
sentences: ReactNode[];
|
|
7
|
+
/** Show the ordinal ("01 ") before each sentence. Decorative. */
|
|
8
|
+
numbered?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const STATEMENTS_DEFAULTS: {
|
|
12
|
+
readonly id: "tesis";
|
|
13
|
+
readonly numbered: true;
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StepProps, StepsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Steps is a block the keyboard walks through, step by step, while it is on screen: the same
|
|
5
|
+
* arrow that moves between stops first lights the next step; when the steps run out, it moves on.
|
|
6
|
+
* Ported from the talks' [data-pasos] mechanic.
|
|
7
|
+
*/
|
|
8
|
+
export declare function Steps({ total, children, onStep, className }: StepsProps): import("react").JSX.Element;
|
|
9
|
+
/** Step is a piece of a Steps block that shows from a step on (and, optionally, until another). */
|
|
10
|
+
export declare function Step({ from, to, collapse, children, className }: StepProps): import("react").JSX.Element;
|
|
11
|
+
/** PanelStack puts several Steps in the same cell: only the one of the step shows. */
|
|
12
|
+
export declare function PanelStack({ children, className }: {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { StepOnContext, StepsContext, useSteps } from "./StepsContext.js";
|
|
2
|
+
import Steps_module_default from "./Steps.module.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
//#region src/components/organisms/Steps/Steps.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Steps is a block the keyboard walks through, step by step, while it is on screen: the same
|
|
8
|
+
* arrow that moves between stops first lights the next step; when the steps run out, it moves on.
|
|
9
|
+
* Ported from the talks' [data-pasos] mechanic.
|
|
10
|
+
*/
|
|
11
|
+
function Steps({ total, children, onStep, className }) {
|
|
12
|
+
const ref = useRef(null);
|
|
13
|
+
const [current, setCurrent] = useState(-1);
|
|
14
|
+
const [guided, setGuided] = useState(false);
|
|
15
|
+
const go = useCallback((n) => {
|
|
16
|
+
setCurrent(n);
|
|
17
|
+
onStep?.(n);
|
|
18
|
+
}, [onStep]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const el = ref.current;
|
|
21
|
+
if (!el) return;
|
|
22
|
+
const io = new IntersectionObserver((entries) => {
|
|
23
|
+
if (entries.some((e) => e.isIntersecting) && !guided) {
|
|
24
|
+
setGuided(true);
|
|
25
|
+
go(0);
|
|
26
|
+
}
|
|
27
|
+
}, { rootMargin: "0px 0px -20% 0px" });
|
|
28
|
+
io.observe(el);
|
|
29
|
+
return () => io.disconnect();
|
|
30
|
+
}, [guided, go]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const inView = () => {
|
|
33
|
+
const el = ref.current;
|
|
34
|
+
if (!el) return false;
|
|
35
|
+
const r = el.getBoundingClientRect();
|
|
36
|
+
return r.top < window.innerHeight * .75 && r.bottom > window.innerHeight * .25;
|
|
37
|
+
};
|
|
38
|
+
const onKey = (e) => {
|
|
39
|
+
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
40
|
+
const t = e.target;
|
|
41
|
+
if (t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable)) return;
|
|
42
|
+
if (document.querySelector("dialog[open]")) return;
|
|
43
|
+
if (!inView()) return;
|
|
44
|
+
const k = e.key;
|
|
45
|
+
const space = k === " " || k === "Spacebar";
|
|
46
|
+
const fwd = k === "ArrowRight" || k === "ArrowDown" || k === "PageDown" || space && !e.shiftKey;
|
|
47
|
+
const back = k === "ArrowLeft" || k === "ArrowUp" || k === "PageUp" || space && e.shiftKey;
|
|
48
|
+
if (!fwd && !back) return;
|
|
49
|
+
const stop = () => {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
e.stopImmediatePropagation();
|
|
52
|
+
};
|
|
53
|
+
if (!guided) {
|
|
54
|
+
setGuided(true);
|
|
55
|
+
go(0);
|
|
56
|
+
stop();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (fwd && current < total) {
|
|
60
|
+
go(current + 1);
|
|
61
|
+
stop();
|
|
62
|
+
} else if (back && current > 0) {
|
|
63
|
+
go(current - 1);
|
|
64
|
+
stop();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
document.addEventListener("keydown", onKey, true);
|
|
68
|
+
return () => document.removeEventListener("keydown", onKey, true);
|
|
69
|
+
}, [
|
|
70
|
+
guided,
|
|
71
|
+
current,
|
|
72
|
+
total,
|
|
73
|
+
go
|
|
74
|
+
]);
|
|
75
|
+
return /* @__PURE__ */ jsx(StepsContext.Provider, {
|
|
76
|
+
value: {
|
|
77
|
+
current: guided ? current : Infinity,
|
|
78
|
+
total,
|
|
79
|
+
guided
|
|
80
|
+
},
|
|
81
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
82
|
+
ref,
|
|
83
|
+
className: [Steps_module_default.steps, className ?? ""].filter(Boolean).join(" "),
|
|
84
|
+
"data-steps": "",
|
|
85
|
+
"data-guided": guided ? "" : void 0,
|
|
86
|
+
"data-current": guided ? current : void 0,
|
|
87
|
+
children
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/** Step is a piece of a Steps block that shows from a step on (and, optionally, until another). */
|
|
92
|
+
function Step({ from = 0, to, collapse = false, children, className }) {
|
|
93
|
+
const { current } = useSteps();
|
|
94
|
+
const on = current >= from && (to === void 0 || current < to);
|
|
95
|
+
return /* @__PURE__ */ jsx(StepOnContext.Provider, {
|
|
96
|
+
value: on,
|
|
97
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
98
|
+
className: [
|
|
99
|
+
Steps_module_default.step,
|
|
100
|
+
collapse ? Steps_module_default.collapse : "",
|
|
101
|
+
className ?? ""
|
|
102
|
+
].filter(Boolean).join(" "),
|
|
103
|
+
"data-on": on ? "" : void 0,
|
|
104
|
+
"aria-hidden": on ? void 0 : true,
|
|
105
|
+
children
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/** PanelStack puts several Steps in the same cell: only the one of the step shows. */
|
|
110
|
+
function PanelStack({ children, className }) {
|
|
111
|
+
return /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: [Steps_module_default.stack, className ?? ""].filter(Boolean).join(" "),
|
|
113
|
+
children
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { PanelStack, Step, Steps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/components/organisms/Steps/Steps.module.css
|
|
2
|
+
var step = "_step_16316_4";
|
|
3
|
+
var steps = "_steps_16316_10";
|
|
4
|
+
var collapse = "_collapse_16316_16";
|
|
5
|
+
var stack = "_stack_16316_31";
|
|
6
|
+
var Steps_module_default = {
|
|
7
|
+
step,
|
|
8
|
+
steps,
|
|
9
|
+
collapse,
|
|
10
|
+
stack
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { collapse, Steps_module_default as default, stack, step, steps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type StepsState = {
|
|
2
|
+
current: number;
|
|
3
|
+
total: number;
|
|
4
|
+
guided: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const StepsContext: import("react").Context<StepsState>;
|
|
7
|
+
/** The current step of the surrounding Steps block (Infinity outside one: everything visible). */
|
|
8
|
+
export declare function useSteps(): StepsState;
|
|
9
|
+
export declare const StepOnContext: import("react").Context<boolean>;
|
|
10
|
+
/** Whether the surrounding Step is on (true outside any Step). */
|
|
11
|
+
export declare function useStepOn(): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
//#region src/components/organisms/Steps/StepsContext.ts
|
|
3
|
+
var StepsContext = createContext({
|
|
4
|
+
current: Infinity,
|
|
5
|
+
total: 0,
|
|
6
|
+
guided: false
|
|
7
|
+
});
|
|
8
|
+
/** The current step of the surrounding Steps block (Infinity outside one: everything visible). */
|
|
9
|
+
function useSteps() {
|
|
10
|
+
return useContext(StepsContext);
|
|
11
|
+
}
|
|
12
|
+
var StepOnContext = createContext(true);
|
|
13
|
+
/** Whether the surrounding Step is on (true outside any Step). */
|
|
14
|
+
function useStepOn() {
|
|
15
|
+
return useContext(StepOnContext);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { StepOnContext, StepsContext, useStepOn, useSteps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type StepsProps = {
|
|
3
|
+
/** How many steps the block has (the arrow advances up to this number). */
|
|
4
|
+
total: number;
|
|
5
|
+
/** The content, with Step children that appear at their step. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Called every time the current step changes. */
|
|
8
|
+
onStep?: (step: number) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export type StepProps = {
|
|
12
|
+
/** Visible from this step (inclusive). */
|
|
13
|
+
from?: number;
|
|
14
|
+
/** Hidden from this step on. Omit to stay visible. */
|
|
15
|
+
to?: number;
|
|
16
|
+
/** Take no room at all while hidden (for stacked versions of a block). */
|
|
17
|
+
collapse?: boolean;
|
|
18
|
+
/** What appears at this step. */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const STEPS_DEFAULTS: {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { StoryProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Story is a story or an objection: a title, paragraphs in body-l secondary and an optional
|
|
4
|
+
* bridge in primary, all at half the grid, on a raised band.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Story({ id, title, paragraphs, bridge, kind, tone, className }: StoryProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Text } from "../../atoms/Text/Text.js";
|
|
2
|
+
import { Slide } from "../Slide/Slide.js";
|
|
3
|
+
import Story_module_default from "./Story.module.js";
|
|
4
|
+
import { STORY_DEFAULTS } from "./types.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/organisms/Story/Story.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Story is a story or an objection: a title, paragraphs in body-l secondary and an optional
|
|
9
|
+
* bridge in primary, all at half the grid, on a raised band.
|
|
10
|
+
*/
|
|
11
|
+
function Story({ id, title, paragraphs, bridge, kind = STORY_DEFAULTS.kind, tone = STORY_DEFAULTS.tone, className }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Slide, {
|
|
13
|
+
id,
|
|
14
|
+
tone,
|
|
15
|
+
className,
|
|
16
|
+
"aria-labelledby": `${id}-title`,
|
|
17
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
className: Story_module_default.story,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx(Text, {
|
|
21
|
+
as: "h2",
|
|
22
|
+
variant: kind === "objection" ? "title-s" : "title-m",
|
|
23
|
+
wrap: "balance",
|
|
24
|
+
id: `${id}-title`,
|
|
25
|
+
children: title
|
|
26
|
+
}),
|
|
27
|
+
paragraphs.map((p, i) => /* @__PURE__ */ jsx(Text, {
|
|
28
|
+
variant: "body-l",
|
|
29
|
+
tone: "secondary",
|
|
30
|
+
wrap: "pretty",
|
|
31
|
+
children: p
|
|
32
|
+
}, i)),
|
|
33
|
+
bridge ? /* @__PURE__ */ jsx(Text, {
|
|
34
|
+
variant: "body-l",
|
|
35
|
+
wrap: "pretty",
|
|
36
|
+
children: bridge
|
|
37
|
+
}) : null
|
|
38
|
+
]
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Story };
|