@primer/react-brand 0.76.0-rc.73295f51 → 0.76.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/docs/index.md +2 -2
- package/esm/Accordion/Accordion.d.ts.map +1 -1
- package/esm/Accordion/Accordion.js +1 -3
- package/esm/Accordion/Accordion.js.map +1 -1
- package/esm/Accordion/{Accordion.module-COckontb.css → Accordion.module-B-iFuyHy.css} +1 -1
- package/esm/Accordion/Accordion.module.js +1 -1
- package/esm/Accordion/Accordion.module.js.map +1 -1
- package/esm/Testimonial/Testimonial.d.ts.map +1 -1
- package/esm/Testimonial/Testimonial.js +72 -66
- package/esm/Testimonial/Testimonial.js.map +1 -1
- package/esm/Testimonial/{Testimonial.module-BEV0y2jl.css → Testimonial.module-_jTJvM-4.css} +1 -1
- package/esm/Testimonial/Testimonial.module.js +1 -1
- package/esm/Testimonial/Testimonial.module.js.map +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.d.ts +2 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.d.ts.map +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.js +39 -36
- package/esm/TextCursorAnimation/TextCursorAnimation.js.map +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.module-Dfn6Ar6C.css +1 -0
- package/esm/TextCursorAnimation/TextCursorAnimation.module.js +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.module.js.map +1 -1
- package/esm/hooks/useCursorAnimation.d.ts +4 -1
- package/esm/hooks/useCursorAnimation.d.ts.map +1 -1
- package/esm/hooks/useCursorAnimation.js +44 -28
- package/esm/hooks/useCursorAnimation.js.map +1 -1
- package/lib/TextCursorAnimation/TextCursorAnimation.d.ts +2 -1
- package/lib/css/main.css +75 -86
- package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/base/colors/light.css +1 -1
- package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
- package/lib/design-tokens/css/tokens/functional/animation/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/bento/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/blinking-cursor/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/comparison-table.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/eyebrow-banner.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/faq.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/grid.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/ide/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/ide/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/image/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-code/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-code/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/pricing-options.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/river.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/section/section.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/statistic/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/viewport.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
- package/lib/design-tokens/js/module/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/footer/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-code/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/footer/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-code/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/scss/tokens/base/colors/light.scss +1 -1
- package/lib/design-tokens/scss/tokens/base/size/size.scss +1 -1
- package/lib/design-tokens/scss/tokens/base/typography/typography.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/animation/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/colors/global.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/bento/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/card/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/card/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/comparison-table/comparison-table.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/eyebrow-banner/eyebrow-banner.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/faq.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/footer/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/footer/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/frosted-glass-vfx/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/grid/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/grid/grid.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/hero/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/icon/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/ide/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/image/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-code/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-link/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-link/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/label/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/link/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/logosuite/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/logosuite/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/media-playlist/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/pricing-options/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/pricing-options/pricing-options.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/prose/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/river/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/river/river.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/section/section.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/statistic/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/sub-nav/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tabs/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tabs/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/timeline/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/timeline/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/token/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tooltip/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/video-player/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/border.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/breakpoints.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size-coarse.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size-fine.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/viewport.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/typography/typography-responsive.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/typography/typography.scss +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/light.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/animation/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/bento/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/faq.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/ide/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-code/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-code/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/prose/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/river.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/section/section.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/statistic/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
- package/lib/hooks/useCursorAnimation.d.ts +4 -1
- package/lib/index.js +1 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.module-BS4hPR8H.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Testimonial.module.js","names":[],"sources":["../../src/Testimonial/Testimonial.module.css"],"sourcesContent":[".Testimonial {\n color: var(--brand-color-text-default);\n font-family: var(--brand-fontStack-sansSerif);\n}\n\n.Testimonial--variant-subtle,\n.Testimonial--variant-default {\n position: relative;\n border-radius: var(--brand-borderRadius-xlarge);\n padding: var(--base-size-48) var(--base-size-32);\n}\n\n@media screen and (min-width: 48rem) {\n .Testimonial--variant-subtle,\n .Testimonial--variant-default {\n padding: var(--base-size-48);\n }\n}\n\n@media screen and (min-width: 63.25rem) {\n .Testimonial--variant-subtle.Testimonial--size-large,\n .Testimonial--variant-default.Testimonial--size-large {\n padding: var(--base-size-96) var(--base-size-128);\n }\n}\n\n.Testimonial--variant-subtle {\n background-color: var(--brand-color-canvas-subtle);\n}\n\n.Testimonial--variant-default {\n background-color: var(--brand-color-canvas-default);\n}\n\n.Testimonial--variant-subtle::before,\n.Testimonial--variant-default::before {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n content: '';\n border-radius: inherit;\n}\n\n.Testimonial--variant-subtle.Testimonial--border::before {\n mask-image: var(--brand-Testimonial-borderMask-subtle);\n border: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);\n}\n\n.Testimonial--variant-default.Testimonial--border::before {\n mask-image: var(--brand-Testimonial-borderMask-default);\n border: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);\n}\n\n.Testimonial__quoteMark {\n --brand-Testimonial-quoteMarkColor-gradient: radial-gradient(\n circle at top left,\n var(--brand-Testimonial-quoteMarkColor-start),\n var(--brand-Testimonial-quoteMarkColor-end)\n );\n --brand-Testimonial-quoteMarkColor-background: var(\n --brand-Testimonial-quoteMarkColor-gradient,\n var(--brand-Testimonial-quoteMarkColor, currentColor)\n );\n color: var(--brand-Testimonial-quoteMarkColor-start, var(--brand-Testimonial-quoteMarkColor, currentColor));\n font-size: var(--base-size-48);\n line-height: var(--base-size-48);\n font-weight: var(--base-text-weight-extrabold);\n position: relative;\n}\n\n.Testimonial__quoteMark::before {\n content: '';\n position: absolute;\n inset: 0;\n background: var(--brand-Testimonial-quoteMarkColor-background);\n -webkit-mask: linear-gradient(var(--brand-color-canvas-default), var(--brand-color-canvas-default)) content-box,\n linear-gradient(var(--brand-color-canvas-default), var(--brand-color-canvas-default));\n mask: linear-gradient(var(--brand-color-canvas-default), var(--brand-color-canvas-default)) content-box,\n linear-gradient(var(--brand-color-canvas-default), var(--brand-color-canvas-default));\n -webkit-mask-composite: xor;\n mask-composite: exclude;\n}\n\n.Testimonial__quoteMark--hasBackground {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: calc(var(--base-size-48) + var(--base-size-8));\n height: calc(var(--base-size-48) + var(--base-size-8));\n border-radius: var(--base-size-12);\n background-color: var(--brand-Testimonial-quoteMarkBackground, var(--base-color-scale-gray-0));\n font-size: var(--base-size-64);\n line-height: 1;\n}\n\n.Testimonial--size-large .Testimonial__quoteMark:not(.Testimonial__quoteMark--hasBackground) {\n font-size: 7.5rem; /* 120px */\n line-height: 1;\n}\n\n.Testimonial__quoteMarkGlyph {\n display: block;\n}\n\n.Testimonial-quote {\n font-family: var(--brand-fontStack-sansSerif);\n font-size: var(--brand-Testimonial-quote-fontSize-default);\n font-weight: var(--brand-Testimonial-quote-fontWeight-default);\n letter-spacing: var(--brand-Testimonial-quote-letterSpacing-default);\n line-height: 1.2; /* requires custom line-height */\n display: block;\n}\n\n.Testimonial--size-large .Testimonial-quote {\n font-size: var(--brand-Testimonial-quote-fontSize-large);\n font-weight: var(--brand-Testimonial-quote-fontWeight-large);\n letter-spacing: var(--brand-Testimonial-quote-letterSpacing-large);\n}\n\n.Testimonial-quote em,\n.Testimonial-quote b {\n color: var(--brand-Testimonial-quote-color-emphasis);\n font-style: normal;\n font-weight: inherit;\n}\n\n.Testimonial__media {\n display: flex;\n gap: var(--base-size-16);\n align-items: center;\n margin-top: var(--base-size-24);\n}\n\n.Testimonial-logo-image {\n display: block;\n}\n\n.Testimonial--size-large .Testimonial__media {\n margin-top: var(--base-size-64);\n}\n\n.Testimonial-caption {\n display: flex;\n flex-direction: column;\n}\n\n.Testimonial-avatar {\n flex: none;\n}\n\n.Testimonial-from {\n font-weight: var(--base-text-weight-normal);\n text-transform: uppercase;\n}\n\n/* Expressive variant */\n.Testimonial--variant-expressive {\n display: flex;\n flex-direction: column;\n gap: var(--base-size-36);\n width: 100%;\n max-width: 1176px;\n padding-inline: var(--base-size-20);\n padding-block: var(--base-size-40);\n}\n\n.Testimonial--variant-expressive .Testimonial__quoteWrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--base-size-36);\n min-width: 0;\n}\n\n.Testimonial--variant-expressive .Testimonial__media {\n flex-direction: column;\n align-items: flex-start;\n gap: var(--base-size-28);\n margin-block-start: 0;\n width: 100%;\n}\n\n.Testimonial--variant-expressive .Testimonial-avatar {\n width: var(--base-size-40);\n height: var(--base-size-40);\n}\n\n.Testimonial--variant-expressive .Testimonial-caption {\n border-block-start: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);\n padding-block-start: var(--base-size-20);\n width: 100%;\n gap: var(--base-size-6);\n}\n\n@media screen and (min-width: 48rem) {\n .Testimonial--variant-expressive .Testimonial__quoteWrapper {\n gap: var(--base-size-40);\n }\n\n .Testimonial--variant-expressive .Testimonial__media {\n width: 356px;\n }\n}\n\n.Testimonial--variant-expressive .Testimonial-from {\n display: flex;\n align-items: center;\n gap: calc(var(--base-size-8) + var(--base-size-2));\n font-family: var(--brand-fontStack-monospace);\n font-size: var(--brand-text-size-100);\n font-weight: var(--brand-heading-weight-500);\n line-height: var(--brand-text-lineHeight-100);\n text-transform: uppercase;\n letter-spacing: 0.0107em;\n}\n\n.Testimonial--variant-expressive .Testimonial-from::before {\n content: '';\n display: inline-block;\n width: 0.5625rem;\n height: 0.875rem;\n background-color: var(--brand-color-text-emphasized);\n flex-shrink: 0;\n}\n\n.Testimonial--variant-expressive .Testimonial-position {\n font-size: var(--brand-text-size-200);\n font-weight: var(--base-text-weight-normal);\n line-height: 1.6;\n letter-spacing: 0.01em;\n}\n\n.Testimonial--variant-expressive .Testimonial__quoteMark {\n font-family: var(--brand-fontStack-monospace);\n font-weight: var(--brand-fontWeight-300);\n}\n\n.Testimonial--variant-expressive .Testimonial__quoteMarkGlyph {\n transform: translateY(var(--base-size-12));\n}\n\n.Testimonial--variant-expressive .Testimonial__quoteMark:not(.Testimonial__quoteMark--hasBackground) {\n margin-left: -0.18em;\n}\n\n.Testimonial--variant-expressive .Testimonial-quote {\n font-family: var(--brand-fontStack-monospace);\n font-size: 1.5rem;\n font-weight: 425;\n letter-spacing: -0.01em;\n line-height: var(--brand-text-lineHeight-100);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n@media screen and (min-width: 48rem) {\n .Testimonial--variant-expressive {\n max-width: 618px;\n margin-inline: auto;\n padding-inline: var(--base-size-36);\n padding-block: var(--base-size-44);\n }\n .Testimonial--variant-expressive .Testimonial-quote {\n font-size: 1.625rem;\n letter-spacing: -0.02em;\n }\n}\n\n@media screen and (min-width: 63.25rem) {\n .Testimonial--variant-expressive {\n display: grid;\n grid-template-columns: minmax(0, 744px) 312px;\n column-gap: calc(var(--base-size-96) + var(--base-size-24));\n align-items: end;\n max-width: 1176px;\n margin-inline: auto;\n padding-inline: var(--base-size-48);\n padding-block: var(--base-size-88);\n }\n\n .Testimonial--variant-expressive.Testimonial--hasLink {\n row-gap: var(--base-size-48);\n }\n\n .Testimonial--variant-expressive .Testimonial__quoteWrapper {\n grid-column: 1;\n grid-row: 1;\n gap: var(--base-size-48);\n }\n\n .Testimonial--variant-expressive .Testimonial__media {\n grid-column: 2;\n grid-row: 1;\n width: 312px;\n gap: var(--base-size-32);\n }\n\n .Testimonial--variant-expressive.Testimonial--hasLink .Testimonial__media {\n grid-row: 1 / span 2;\n }\n\n .Testimonial--variant-expressive .Testimonial-caption {\n padding-block-start: var(--base-size-24);\n }\n\n .Testimonial--variant-expressive .Testimonial-quote {\n font-size: var(--base-size-32);\n }\n\n .Testimonial--variant-expressive .Testimonial-link {\n grid-column: 1;\n grid-row: 2;\n }\n}\n\n@media screen and (min-width: 80rem) {\n .Testimonial--variant-expressive {\n padding-inline: 0;\n }\n\n .Testimonial--variant-expressive .Testimonial-avatar {\n width: var(--base-size-48);\n height: var(--base-size-48);\n }\n}\n\n.Testimonial-link {\n margin-top: var(--base-size-8);\n}\n\n.Testimonial--variant-expressive .Testimonial-link {\n align-self: flex-start;\n width: fit-content;\n margin-top: 0;\n}\n\n.Testimonial__quoteMark--default {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-default);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-default);\n}\n\n.Testimonial__quoteMark--blue {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-blue);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-blue);\n}\n\n.Testimonial__quoteMark--blue-purple {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-blue-purple-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-blue-purple-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-blue-purple);\n}\n\n.Testimonial__quoteMark--coral {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-coral);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-coral);\n}\n\n.Testimonial__quoteMark--green {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-green);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-green);\n}\n\n.Testimonial__quoteMark--green-blue {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-green-blue-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-green-blue-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-green-blue);\n}\n\n.Testimonial__quoteMark--gray {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-gray);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-gray);\n}\n\n.Testimonial__quoteMark--indigo {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-indigo);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-indigo);\n}\n\n.Testimonial__quoteMark--lemon {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-lemon);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-lemon);\n}\n\n.Testimonial__quoteMark--lime {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-lime);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-lime);\n}\n\n.Testimonial__quoteMark--orange {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-orange);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-orange);\n}\n\n.Testimonial__quoteMark--pink {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-pink);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-pink);\n}\n\n.Testimonial__quoteMark--pink-blue {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-pink-blue-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-pink-blue-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-pink-blue);\n}\n\n.Testimonial__quoteMark--purple {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-purple);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-purple);\n}\n\n.Testimonial__quoteMark--purple-red {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-purple-red-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-purple-red-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-purple-red);\n}\n\n.Testimonial__quoteMark--red {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-red);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-red);\n}\n\n.Testimonial__quoteMark--red-orange {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-red-orange-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-red-orange-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-red-orange);\n}\n\n.Testimonial__quoteMark--teal {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-teal);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-teal);\n}\n\n.Testimonial__quoteMark--yellow {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-yellow);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-yellow);\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Testimonial.module.js","names":[],"sources":["../../src/Testimonial/Testimonial.module.css"],"sourcesContent":[".Testimonial {\n color: var(--brand-color-text-default);\n font-family: var(--brand-fontStack-sansSerif);\n}\n\n.Testimonial--variant-subtle,\n.Testimonial--variant-default {\n position: relative;\n border-radius: var(--brand-borderRadius-xlarge);\n padding: var(--base-size-48) var(--base-size-32);\n}\n\n@media screen and (min-width: 48rem) {\n .Testimonial--variant-subtle,\n .Testimonial--variant-default {\n padding: var(--base-size-48);\n }\n}\n\n@media screen and (min-width: 63.25rem) {\n .Testimonial--variant-subtle.Testimonial--size-large,\n .Testimonial--variant-default.Testimonial--size-large {\n padding: var(--base-size-96) var(--base-size-128);\n }\n}\n\n.Testimonial--variant-subtle {\n background-color: var(--brand-color-canvas-subtle);\n}\n\n.Testimonial--variant-default {\n background-color: var(--brand-color-canvas-default);\n}\n\n.Testimonial--variant-subtle::before,\n.Testimonial--variant-default::before {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n content: '';\n border-radius: inherit;\n}\n\n.Testimonial--variant-subtle.Testimonial--border::before {\n mask-image: var(--brand-Testimonial-borderMask-subtle);\n border: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);\n}\n\n.Testimonial--variant-default.Testimonial--border::before {\n mask-image: var(--brand-Testimonial-borderMask-default);\n border: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);\n}\n\n.Testimonial__quoteMark {\n --brand-Testimonial-quoteMarkColor-gradient: radial-gradient(\n circle at top left,\n var(--brand-Testimonial-quoteMarkColor-start),\n var(--brand-Testimonial-quoteMarkColor-end)\n );\n --brand-Testimonial-quoteMarkColor-background: var(\n --brand-Testimonial-quoteMarkColor-gradient,\n var(--brand-Testimonial-quoteMarkColor, currentColor)\n );\n color: var(--brand-Testimonial-quoteMarkColor-start, var(--brand-Testimonial-quoteMarkColor, currentColor));\n font-size: var(--base-size-48);\n line-height: var(--base-size-48);\n font-weight: var(--base-text-weight-extrabold);\n position: relative;\n}\n\n.Testimonial__quoteMark::before {\n content: '';\n position: absolute;\n inset: 0;\n background: var(--brand-Testimonial-quoteMarkColor-background);\n -webkit-mask: linear-gradient(var(--brand-color-canvas-default), var(--brand-color-canvas-default)) content-box,\n linear-gradient(var(--brand-color-canvas-default), var(--brand-color-canvas-default));\n mask: linear-gradient(var(--brand-color-canvas-default), var(--brand-color-canvas-default)) content-box,\n linear-gradient(var(--brand-color-canvas-default), var(--brand-color-canvas-default));\n -webkit-mask-composite: xor;\n mask-composite: exclude;\n}\n\n.Testimonial__quoteMark--hasBackground {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: calc(var(--base-size-48) + var(--base-size-8));\n height: calc(var(--base-size-48) + var(--base-size-8));\n border-radius: var(--base-size-12);\n background-color: var(--brand-Testimonial-quoteMarkBackground, var(--base-color-scale-gray-0));\n font-size: var(--base-size-64);\n line-height: 1;\n}\n\n.Testimonial--size-large .Testimonial__quoteMark:not(.Testimonial__quoteMark--hasBackground) {\n font-size: 7.5rem; /* 120px */\n line-height: 1;\n}\n\n.Testimonial__quoteMarkGlyph {\n display: block;\n}\n\n.Testimonial-quote {\n font-family: var(--brand-fontStack-sansSerif);\n font-size: var(--brand-Testimonial-quote-fontSize-default);\n font-weight: var(--brand-Testimonial-quote-fontWeight-default);\n letter-spacing: var(--brand-Testimonial-quote-letterSpacing-default);\n line-height: 1.2; /* requires custom line-height */\n display: block;\n}\n\n.Testimonial--size-large .Testimonial-quote {\n font-size: var(--brand-Testimonial-quote-fontSize-large);\n font-weight: var(--brand-Testimonial-quote-fontWeight-large);\n letter-spacing: var(--brand-Testimonial-quote-letterSpacing-large);\n}\n\n.Testimonial-quote em,\n.Testimonial-quote b {\n color: var(--brand-Testimonial-quote-color-emphasis);\n font-style: normal;\n font-weight: inherit;\n}\n\n.Testimonial__media {\n display: flex;\n gap: var(--base-size-16);\n align-items: center;\n margin-top: var(--base-size-24);\n}\n\n.Testimonial-logo-image {\n display: block;\n}\n\n.Testimonial--size-large .Testimonial__media {\n margin-top: var(--base-size-64);\n}\n\n.Testimonial-caption {\n display: flex;\n flex-direction: column;\n}\n\n.Testimonial-avatar {\n flex: none;\n}\n\n.Testimonial-from {\n font-weight: var(--base-text-weight-normal);\n text-transform: uppercase;\n}\n\n/* Expressive variant */\n.Testimonial--variant-expressive {\n display: flex;\n flex-direction: column;\n gap: var(--base-size-36);\n width: 100%;\n max-width: 1176px;\n padding-inline: var(--base-size-20);\n padding-block: var(--base-size-40);\n}\n\n.Testimonial--variant-expressive .Testimonial__quoteWrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--base-size-36);\n min-width: 0;\n}\n\n.Testimonial--variant-expressive .Testimonial__media {\n flex-direction: column;\n align-items: flex-start;\n gap: var(--base-size-28);\n margin-block-start: 0;\n width: 100%;\n}\n\n.Testimonial--variant-expressive .Testimonial-avatar {\n width: var(--base-size-40);\n height: var(--base-size-40);\n}\n\n.Testimonial--variant-expressive .Testimonial-caption {\n border-block-start: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);\n padding-block-start: var(--base-size-20);\n width: 100%;\n gap: var(--base-size-6);\n}\n\n@media screen and (min-width: 48rem) {\n .Testimonial--variant-expressive .Testimonial__quoteWrapper {\n gap: var(--base-size-40);\n }\n\n .Testimonial--variant-expressive .Testimonial__media {\n width: 356px;\n }\n}\n\n.Testimonial--variant-expressive .Testimonial-from {\n display: flex;\n align-items: center;\n font-family: var(--brand-fontStack-monospace);\n font-size: var(--brand-text-size-100);\n font-weight: var(--brand-heading-weight-500);\n line-height: var(--brand-text-lineHeight-100);\n text-transform: uppercase;\n letter-spacing: 0.0107em;\n}\n\n.Testimonial--variant-expressive .Testimonial-position {\n font-size: var(--brand-text-size-200);\n font-weight: var(--base-text-weight-normal);\n line-height: 1.6;\n letter-spacing: 0.01em;\n}\n\n.Testimonial--variant-expressive .Testimonial__quoteMark {\n font-family: var(--brand-fontStack-monospace);\n font-weight: var(--brand-fontWeight-300);\n}\n\n.Testimonial--variant-expressive .Testimonial__quoteMarkGlyph {\n transform: translateY(var(--base-size-12));\n}\n\n.Testimonial--variant-expressive .Testimonial__quoteMark:not(.Testimonial__quoteMark--hasBackground) {\n margin-left: -0.18em;\n}\n\n.Testimonial--variant-expressive .Testimonial-quote {\n font-family: var(--brand-fontStack-monospace);\n font-size: 1.5rem;\n font-weight: 425;\n letter-spacing: -0.01em;\n line-height: var(--brand-text-lineHeight-100);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n@media screen and (min-width: 48rem) {\n .Testimonial--variant-expressive {\n max-width: 618px;\n margin-inline: auto;\n padding-inline: var(--base-size-36);\n padding-block: var(--base-size-44);\n }\n .Testimonial--variant-expressive .Testimonial-quote {\n font-size: 1.625rem;\n letter-spacing: -0.02em;\n }\n}\n\n@media screen and (min-width: 63.25rem) {\n .Testimonial--variant-expressive {\n display: grid;\n grid-template-columns: minmax(0, 744px) 312px;\n column-gap: calc(var(--base-size-96) + var(--base-size-24));\n align-items: end;\n max-width: 1176px;\n margin-inline: auto;\n padding-inline: var(--base-size-48);\n padding-block: var(--base-size-88);\n }\n\n .Testimonial--variant-expressive.Testimonial--hasLink {\n row-gap: var(--base-size-48);\n }\n\n .Testimonial--variant-expressive .Testimonial__quoteWrapper {\n grid-column: 1;\n grid-row: 1;\n gap: var(--base-size-48);\n }\n\n .Testimonial--variant-expressive .Testimonial__media {\n grid-column: 2;\n grid-row: 1;\n width: 312px;\n gap: var(--base-size-32);\n }\n\n .Testimonial--variant-expressive.Testimonial--hasLink .Testimonial__media {\n grid-row: 1 / span 2;\n }\n\n .Testimonial--variant-expressive .Testimonial-caption {\n padding-block-start: var(--base-size-24);\n }\n\n .Testimonial--variant-expressive .Testimonial-quote {\n font-size: var(--base-size-32);\n }\n\n .Testimonial--variant-expressive .Testimonial-link {\n grid-column: 1;\n grid-row: 2;\n }\n}\n\n@media screen and (min-width: 80rem) {\n .Testimonial--variant-expressive {\n padding-inline: 0;\n }\n\n .Testimonial--variant-expressive .Testimonial-avatar {\n width: var(--base-size-48);\n height: var(--base-size-48);\n }\n}\n\n.Testimonial-link {\n margin-top: var(--base-size-8);\n}\n\n.Testimonial--variant-expressive .Testimonial-link {\n align-self: flex-start;\n width: fit-content;\n margin-top: 0;\n}\n\n.Testimonial__quoteMark--default {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-default);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-default);\n}\n\n.Testimonial__quoteMark--blue {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-blue);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-blue);\n}\n\n.Testimonial__quoteMark--blue-purple {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-blue-purple-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-blue-purple-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-blue-purple);\n}\n\n.Testimonial__quoteMark--coral {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-coral);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-coral);\n}\n\n.Testimonial__quoteMark--green {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-green);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-green);\n}\n\n.Testimonial__quoteMark--green-blue {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-green-blue-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-green-blue-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-green-blue);\n}\n\n.Testimonial__quoteMark--gray {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-gray);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-gray);\n}\n\n.Testimonial__quoteMark--indigo {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-indigo);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-indigo);\n}\n\n.Testimonial__quoteMark--lemon {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-lemon);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-lemon);\n}\n\n.Testimonial__quoteMark--lime {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-lime);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-lime);\n}\n\n.Testimonial__quoteMark--orange {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-orange);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-orange);\n}\n\n.Testimonial__quoteMark--pink {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-pink);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-pink);\n}\n\n.Testimonial__quoteMark--pink-blue {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-pink-blue-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-pink-blue-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-pink-blue);\n}\n\n.Testimonial__quoteMark--purple {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-purple);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-purple);\n}\n\n.Testimonial__quoteMark--purple-red {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-purple-red-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-purple-red-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-purple-red);\n}\n\n.Testimonial__quoteMark--red {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-red);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-red);\n}\n\n.Testimonial__quoteMark--red-orange {\n --brand-Testimonial-quoteMarkColor-start: var(--brand-Testimonial-quoteMarkColor-red-orange-start);\n --brand-Testimonial-quoteMarkColor-end: var(--brand-Testimonial-quoteMarkColor-red-orange-end);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-red-orange);\n}\n\n.Testimonial__quoteMark--teal {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-teal);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-teal);\n}\n\n.Testimonial__quoteMark--yellow {\n --brand-Testimonial-quoteMarkColor: var(--brand-Testimonial-quoteMarkColor-yellow);\n --brand-Testimonial-quoteMarkBackground: var(--brand-Testimonial-quoteMarkBackground-yellow);\n}\n"],"mappings":""}
|
|
@@ -19,6 +19,7 @@ export type TextCursorAnimationProps = {
|
|
|
19
19
|
['data-testid']?: string;
|
|
20
20
|
delay?: number;
|
|
21
21
|
waitForPageLoad?: boolean;
|
|
22
|
+
animationTrigger?: 'immediate' | 'on-visible';
|
|
22
23
|
} & React.HTMLAttributes<HTMLSpanElement> & Omit<TextProps, 'animate' | 'as'>;
|
|
23
|
-
export declare function TextCursorAnimation({ children, className, animate, initialText, 'data-testid': testId, delay, waitForPageLoad, variant, }: PropsWithChildren<TextCursorAnimationProps>): React.JSX.Element;
|
|
24
|
+
export declare function TextCursorAnimation({ children, className, animate, initialText, 'data-testid': testId, delay, waitForPageLoad, animationTrigger, variant, }: PropsWithChildren<TextCursorAnimationProps>): React.JSX.Element;
|
|
24
25
|
//# sourceMappingURL=TextCursorAnimation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextCursorAnimation.d.ts","sourceRoot":"","sources":["../../src/TextCursorAnimation/TextCursorAnimation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TextCursorAnimation.d.ts","sourceRoot":"","sources":["../../src/TextCursorAnimation/TextCursorAnimation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,iBAAiB,EAAS,MAAM,OAAO,CAAA;AAItD,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAA;AAEtC,OAAO,4GAA4G,CAAA;AACnH,OAAO,yHAAyH,CAAA;AAIhI,eAAO,MAAM,OAAO;;;;CAQnB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,gBAAgB,CAAC,EAAE,WAAW,GAAG,YAAY,CAAA;CAC9C,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GACvC,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC,CAAA;AAEnC,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAW,EACX,aAAa,EAAE,MAAM,EACrB,KAAK,EACL,eAAsB,EACtB,gBAA8B,EAC9B,OAAiB,GAClB,EAAE,iBAAiB,CAAC,wBAAwB,CAAC,qBAoF7C"}
|
|
@@ -4,10 +4,10 @@ import { EyebrowText as n } from "../EyebrowText/EyebrowText.js";
|
|
|
4
4
|
import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes-BucKYl1n.css';import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base-DKbXhPKv.css';/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
import r from "./TextCursorAnimation.module.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import { jsx as
|
|
7
|
+
import { useRef as i } from "react";
|
|
8
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
9
9
|
//#region src/TextCursorAnimation/TextCursorAnimation.tsx
|
|
10
|
-
var
|
|
10
|
+
var s = {
|
|
11
11
|
root: "TextCursorAnimation",
|
|
12
12
|
get text() {
|
|
13
13
|
return `${this.root}-text`;
|
|
@@ -16,63 +16,66 @@ var o = {
|
|
|
16
16
|
return `${this.root}-cursor`;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
text:
|
|
22
|
-
initialText:
|
|
23
|
-
animate:
|
|
24
|
-
delay:
|
|
25
|
-
waitForPageLoad:
|
|
26
|
-
|
|
19
|
+
function c({ children: c, className: l, animate: u, initialText: d, "data-testid": f, delay: p, waitForPageLoad: m = !0, animationTrigger: h = "immediate", variant: g = "muted" }) {
|
|
20
|
+
let _ = i(null), v = typeof c == "string" ? c : "", { showCursor: y, visibleText: b, cursorPhase: x } = t({
|
|
21
|
+
text: v,
|
|
22
|
+
initialText: d,
|
|
23
|
+
animate: u,
|
|
24
|
+
delay: p,
|
|
25
|
+
waitForPageLoad: m,
|
|
26
|
+
startOnIntersection: h === "on-visible",
|
|
27
|
+
intersectionRef: _
|
|
28
|
+
}), S = u === !0 && v.length > 0, C = v || c, w = {
|
|
27
29
|
initial: r["TextCursorAnimation__cursor--initial"],
|
|
28
30
|
correction: r["TextCursorAnimation__cursor--correction"],
|
|
29
31
|
final: r["TextCursorAnimation__cursor--final"],
|
|
30
32
|
complete: r["TextCursorAnimation__cursor--complete"]
|
|
31
|
-
}[
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"data-testid":
|
|
35
|
-
|
|
33
|
+
}[S ? x : "complete"], T = y ? /* @__PURE__ */ a("span", {
|
|
34
|
+
className: e(r.TextCursorAnimation__cursor, S && r["TextCursorAnimation__cursor--animated"], w),
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
"data-testid": s.cursor
|
|
37
|
+
}) : null;
|
|
38
|
+
return /* @__PURE__ */ a("span", {
|
|
39
|
+
ref: _,
|
|
40
|
+
className: e(r.TextCursorAnimation, l),
|
|
41
|
+
"data-testid": f || s.root,
|
|
42
|
+
children: /* @__PURE__ */ o("span", {
|
|
36
43
|
className: r.TextCursorAnimation__inner,
|
|
37
|
-
children: [
|
|
44
|
+
children: [S && /* @__PURE__ */ o("span", {
|
|
38
45
|
className: r.TextCursorAnimation__sizingContainer,
|
|
39
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ a(n, {
|
|
40
47
|
size: "100",
|
|
41
|
-
variant:
|
|
48
|
+
variant: g,
|
|
42
49
|
font: "monospace",
|
|
43
50
|
weight: "medium",
|
|
44
51
|
className: e(r.TextCursorAnimation__text, r.TextCursorAnimation__sizingText),
|
|
45
|
-
children:
|
|
46
|
-
}),
|
|
52
|
+
children: v
|
|
53
|
+
}), d && d !== v && /* @__PURE__ */ a(n, {
|
|
47
54
|
size: "100",
|
|
48
|
-
variant:
|
|
55
|
+
variant: g,
|
|
49
56
|
font: "monospace",
|
|
50
57
|
weight: "medium",
|
|
51
58
|
className: e(r.TextCursorAnimation__text, r.TextCursorAnimation__sizingText),
|
|
52
59
|
"aria-hidden": "true",
|
|
53
|
-
children:
|
|
60
|
+
children: d
|
|
54
61
|
})]
|
|
55
|
-
}), /* @__PURE__ */
|
|
56
|
-
className: e(r.TextCursorAnimation__content,
|
|
57
|
-
"aria-hidden":
|
|
58
|
-
children: [/* @__PURE__ */
|
|
62
|
+
}), /* @__PURE__ */ o("span", {
|
|
63
|
+
className: e(r.TextCursorAnimation__content, S && r["TextCursorAnimation__content--animated"]),
|
|
64
|
+
"aria-hidden": S ? "true" : void 0,
|
|
65
|
+
children: [/* @__PURE__ */ a(n, {
|
|
59
66
|
size: "100",
|
|
60
|
-
variant:
|
|
67
|
+
variant: g,
|
|
61
68
|
font: "monospace",
|
|
62
69
|
weight: "medium",
|
|
63
70
|
className: r.TextCursorAnimation__text,
|
|
64
|
-
"data-testid":
|
|
65
|
-
children:
|
|
66
|
-
}),
|
|
67
|
-
className: e(r.TextCursorAnimation__cursor, y && r["TextCursorAnimation__cursor--animated"], x),
|
|
68
|
-
"aria-hidden": "true",
|
|
69
|
-
"data-testid": o.cursor
|
|
70
|
-
})]
|
|
71
|
+
"data-testid": s.text,
|
|
72
|
+
children: S ? b : C
|
|
73
|
+
}), T]
|
|
71
74
|
})]
|
|
72
75
|
})
|
|
73
76
|
});
|
|
74
77
|
}
|
|
75
78
|
//#endregion
|
|
76
|
-
export {
|
|
79
|
+
export { c as TextCursorAnimation, s as testIds };
|
|
77
80
|
|
|
78
81
|
//# sourceMappingURL=TextCursorAnimation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextCursorAnimation.js","names":[],"sources":["../../src/TextCursorAnimation/TextCursorAnimation.tsx"],"sourcesContent":["import React, {PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {useCursorAnimation} from '../hooks/useCursorAnimation'\nimport {EyebrowText} from '../EyebrowText'\nimport {TextProps} from '../Text/Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css'\n\nimport styles from './TextCursorAnimation.module.css'\n\nexport const testIds = {\n root: 'TextCursorAnimation',\n get text() {\n return `${this.root}-text`\n },\n get cursor() {\n return `${this.root}-cursor`\n },\n}\n\nexport type TextCursorAnimationProps = {\n /**\n * Whether to animate the text with a typing effect.\n */\n animate?: boolean\n /**\n * Optional text to type before transitioning to the final text\n */\n initialText?: string\n ['data-testid']?: string\n delay?: number\n waitForPageLoad?: boolean\n} & React.HTMLAttributes<HTMLSpanElement> &\n Omit<TextProps, 'animate' | 'as'>\n\nexport function TextCursorAnimation({\n children,\n className,\n animate,\n initialText,\n 'data-testid': testId,\n delay,\n waitForPageLoad = true,\n variant = 'muted',\n}: PropsWithChildren<TextCursorAnimationProps>) {\n const text = typeof children === 'string' ? children : ''\n const {showCursor, visibleText, cursorPhase} = useCursorAnimation({\n text,\n initialText,\n animate,\n delay,\n waitForPageLoad,\n })\n\n const hasAnimation = animate === true && text.length > 0\n const content = text || children\n const cursorPhaseClassName = {\n initial: styles['TextCursorAnimation__cursor--initial'],\n correction: styles['TextCursorAnimation__cursor--correction'],\n final: styles['TextCursorAnimation__cursor--final'],\n complete: styles['TextCursorAnimation__cursor--complete'],\n }[hasAnimation ? cursorPhase : 'complete']\n\n return (\n <span className={clsx(styles.TextCursorAnimation, className)} data-testid={testId || testIds.root}>\n <span className={styles.TextCursorAnimation__inner}>\n {hasAnimation && (\n <span className={styles.TextCursorAnimation__sizingContainer}>\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={clsx(styles.TextCursorAnimation__text, styles.TextCursorAnimation__sizingText)}\n >\n {text}\n </EyebrowText>\n {initialText && initialText !== text && (\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={clsx(styles.TextCursorAnimation__text, styles.TextCursorAnimation__sizingText)}\n aria-hidden=\"true\"\n >\n {initialText}\n </EyebrowText>\n )}\n </span>\n )}\n <span\n className={clsx(\n styles.TextCursorAnimation__content,\n hasAnimation && styles['TextCursorAnimation__content--animated'],\n )}\n aria-hidden={hasAnimation ? 'true' : undefined}\n >\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={styles.TextCursorAnimation__text}\n data-testid={testIds.text}\n >\n {hasAnimation ? visibleText : content}\n </EyebrowText>\n {
|
|
1
|
+
{"version":3,"file":"TextCursorAnimation.js","names":[],"sources":["../../src/TextCursorAnimation/TextCursorAnimation.tsx"],"sourcesContent":["import React, {PropsWithChildren, useRef} from 'react'\nimport {clsx} from 'clsx'\nimport {useCursorAnimation} from '../hooks/useCursorAnimation'\nimport {EyebrowText} from '../EyebrowText'\nimport {TextProps} from '../Text/Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css'\n\nimport styles from './TextCursorAnimation.module.css'\n\nexport const testIds = {\n root: 'TextCursorAnimation',\n get text() {\n return `${this.root}-text`\n },\n get cursor() {\n return `${this.root}-cursor`\n },\n}\n\nexport type TextCursorAnimationProps = {\n /**\n * Whether to animate the text with a typing effect.\n */\n animate?: boolean\n /**\n * Optional text to type before transitioning to the final text\n */\n initialText?: string\n ['data-testid']?: string\n delay?: number\n waitForPageLoad?: boolean\n animationTrigger?: 'immediate' | 'on-visible'\n} & React.HTMLAttributes<HTMLSpanElement> &\n Omit<TextProps, 'animate' | 'as'>\n\nexport function TextCursorAnimation({\n children,\n className,\n animate,\n initialText,\n 'data-testid': testId,\n delay,\n waitForPageLoad = true,\n animationTrigger = 'immediate',\n variant = 'muted',\n}: PropsWithChildren<TextCursorAnimationProps>) {\n const rootRef = useRef<HTMLSpanElement>(null)\n const text = typeof children === 'string' ? children : ''\n const {showCursor, visibleText, cursorPhase} = useCursorAnimation({\n text,\n initialText,\n animate,\n delay,\n waitForPageLoad,\n startOnIntersection: animationTrigger === 'on-visible',\n intersectionRef: rootRef,\n })\n\n const hasAnimation = animate === true && text.length > 0\n const content = text || children\n const cursorPhaseClassName = {\n initial: styles['TextCursorAnimation__cursor--initial'],\n correction: styles['TextCursorAnimation__cursor--correction'],\n final: styles['TextCursorAnimation__cursor--final'],\n complete: styles['TextCursorAnimation__cursor--complete'],\n }[hasAnimation ? cursorPhase : 'complete']\n\n const cursor = showCursor ? (\n <span\n className={clsx(\n styles.TextCursorAnimation__cursor,\n hasAnimation && styles['TextCursorAnimation__cursor--animated'],\n cursorPhaseClassName,\n )}\n aria-hidden=\"true\"\n data-testid={testIds.cursor}\n />\n ) : null\n\n return (\n <span ref={rootRef} className={clsx(styles.TextCursorAnimation, className)} data-testid={testId || testIds.root}>\n <span className={styles.TextCursorAnimation__inner}>\n {hasAnimation && (\n <span className={styles.TextCursorAnimation__sizingContainer}>\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={clsx(styles.TextCursorAnimation__text, styles.TextCursorAnimation__sizingText)}\n >\n {text}\n </EyebrowText>\n {initialText && initialText !== text && (\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={clsx(styles.TextCursorAnimation__text, styles.TextCursorAnimation__sizingText)}\n aria-hidden=\"true\"\n >\n {initialText}\n </EyebrowText>\n )}\n </span>\n )}\n <span\n className={clsx(\n styles.TextCursorAnimation__content,\n hasAnimation && styles['TextCursorAnimation__content--animated'],\n )}\n aria-hidden={hasAnimation ? 'true' : undefined}\n >\n <EyebrowText\n size=\"100\"\n variant={variant}\n font=\"monospace\"\n weight=\"medium\"\n className={styles.TextCursorAnimation__text}\n data-testid={testIds.text}\n >\n {hasAnimation ? visibleText : content}\n </EyebrowText>\n {cursor}\n </span>\n </span>\n </span>\n )\n}\n"],"mappings":";;;;;;;;;AAWA,IAAa,IAAU;CACrB,MAAM;CACN,IAAI,OAAO;EACT,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,SAAS;EACX,OAAO,GAAG,KAAK,KAAK;CACtB;AACF;AAkBA,SAAgB,EAAoB,EAClC,aACA,cACA,YACA,gBACA,eAAe,GACf,UACA,qBAAkB,IAClB,sBAAmB,aACnB,aAAU,WACoC;CAC9C,IAAM,IAAU,EAAwB,IAAI,GACtC,IAA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CursorAnimation___fMZNu{align-items:center;display:inline-flex}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__inner____uwkl{align-items:center;display:inline-flex;position:relative}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__text___t1rcc{font-weight:var(--brand-text-weight-500);white-space:pre}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__sizingContainer___7_wcg{clip-path:inset(50%);display:inline-grid}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__sizingText___Mhr64{grid-area:1/1}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__content___M_K3E{align-items:center;gap:var(--base-size-6);display:inline-flex}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__content--animated___Zmg8H{position:absolute;inset-block-start:0;inset-inline-start:0}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor___suzWD{width:calc(var(--base-size-8) + var(--base-size-2) / 2);height:calc(var(--base-size-12) + var(--base-size-2));flex:0 0 calc(var(--base-size-8) + var(--base-size-2) / 2);position:relative;top:-.5px}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--initial___Ozy64{background-color:var(--brand-TextCursorAnimation-cursor-color)}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--animated___EfpR4{animation:Primer_Brand__TextCursorAnimation-module__TextCursorAnimation-cursor-blink___cTxPh var(--brand-TextCursorAnimation-cursor-animationDuration) steps(1, end) .25s 3 forwards}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--correction___y1c10{background-color:var(--brand-TextCursorAnimation-cursor-deleteColor)}.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--final___fBBsR,.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor--complete___gufWv{background-color:var(--brand-TextCursorAnimation-cursor-finalColor)}@keyframes Primer_Brand__TextCursorAnimation-module__TextCursorAnimation-cursor-blink___cTxPh{0%,79%{opacity:1}80%,99%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion:reduce){.Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor___suzWD{animation:none}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './TextCursorAnimation.module-
|
|
1
|
+
import './TextCursorAnimation.module-Dfn6Ar6C.css';//#region src/TextCursorAnimation/TextCursorAnimation.module.css
|
|
2
2
|
var e = "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation___fMZNu", t = "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__inner____uwkl", n = "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__text___t1rcc", r = "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__sizingContainer___7_wcg", i = "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__sizingText___Mhr64", a = "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__content___M_K3E", o = "Primer_Brand__TextCursorAnimation-module__TextCursorAnimation__cursor___suzWD", s = {
|
|
3
3
|
TextCursorAnimation: e,
|
|
4
4
|
TextCursorAnimation__inner: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextCursorAnimation.module.js","names":[],"sources":["../../src/TextCursorAnimation/TextCursorAnimation.module.css"],"sourcesContent":[".TextCursorAnimation {\n display: inline-flex;\n align-items: center;\n}\n\n.TextCursorAnimation__inner {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.TextCursorAnimation__text {\n font-weight: var(--brand-text-weight-500);\n white-space: pre;\n}\n\n.TextCursorAnimation__sizingContainer {\n display: inline-grid;\n clip-path: inset(50%);\n}\n\n.TextCursorAnimation__sizingText {\n grid-area: 1 / 1;\n}\n\n.TextCursorAnimation__content {\n display: inline-flex;\n align-items: center;\n gap:
|
|
1
|
+
{"version":3,"file":"TextCursorAnimation.module.js","names":[],"sources":["../../src/TextCursorAnimation/TextCursorAnimation.module.css"],"sourcesContent":[".TextCursorAnimation {\n display: inline-flex;\n align-items: center;\n}\n\n.TextCursorAnimation__inner {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.TextCursorAnimation__text {\n font-weight: var(--brand-text-weight-500);\n white-space: pre;\n}\n\n.TextCursorAnimation__sizingContainer {\n display: inline-grid;\n clip-path: inset(50%);\n}\n\n.TextCursorAnimation__sizingText {\n grid-area: 1 / 1;\n}\n\n.TextCursorAnimation__content {\n display: inline-flex;\n align-items: center;\n gap: var(--base-size-6);\n}\n\n.TextCursorAnimation__content--animated {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n}\n\n.TextCursorAnimation__cursor {\n width: calc(var(--base-size-8) + var(--base-size-2) / 2);\n height: calc(var(--base-size-12) + var(--base-size-2));\n flex: 0 0 calc(var(--base-size-8) + var(--base-size-2) / 2);\n position: relative;\n top: -0.5px; /* optical adjustment*/\n}\n\n.TextCursorAnimation__cursor--initial {\n background-color: var(--brand-TextCursorAnimation-cursor-color);\n}\n\n.TextCursorAnimation__cursor--animated {\n animation: TextCursorAnimation-cursor-blink var(--brand-TextCursorAnimation-cursor-animationDuration) steps(1, end)\n 250ms 3 forwards;\n}\n\n.TextCursorAnimation__cursor--correction {\n background-color: var(--brand-TextCursorAnimation-cursor-deleteColor);\n}\n\n.TextCursorAnimation__cursor--final,\n.TextCursorAnimation__cursor--complete {\n background-color: var(--brand-TextCursorAnimation-cursor-finalColor);\n}\n\n@keyframes TextCursorAnimation-cursor-blink {\n 0%,\n 79% {\n opacity: 1;\n }\n\n 80%,\n 99% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .TextCursorAnimation__cursor {\n animation: none;\n }\n}\n"],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
1
2
|
export type CursorAnimationPhase = 'initial' | 'correction' | 'final' | 'complete';
|
|
2
3
|
export type UseCursorAnimationResult = {
|
|
3
4
|
visibleText: string;
|
|
@@ -10,6 +11,8 @@ export type UseCursorAnimationOptions = {
|
|
|
10
11
|
animate?: boolean;
|
|
11
12
|
delay?: number;
|
|
12
13
|
waitForPageLoad?: boolean;
|
|
14
|
+
startOnIntersection?: boolean;
|
|
15
|
+
intersectionRef?: RefObject<HTMLElement | null>;
|
|
13
16
|
};
|
|
14
|
-
export declare function useCursorAnimation({ text, initialText, animate, delay, waitForPageLoad, }: UseCursorAnimationOptions): UseCursorAnimationResult;
|
|
17
|
+
export declare function useCursorAnimation({ text, initialText, animate, delay, waitForPageLoad, startOnIntersection, intersectionRef, }: UseCursorAnimationOptions): UseCursorAnimationResult;
|
|
15
18
|
//# sourceMappingURL=useCursorAnimation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCursorAnimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useCursorAnimation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCursorAnimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useCursorAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAA;AAIzD,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,CAAA;AAElF,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,oBAAoB,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,eAAe,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAChD,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,WAAW,EACX,OAAO,EACP,KAAW,EACX,eAAsB,EACtB,mBAA2B,EAC3B,eAAe,GAChB,EAAE,yBAAyB,GAAG,wBAAwB,CA6LtD"}
|
|
@@ -2,20 +2,35 @@ import e from "./useIsomorphicLayoutEffect.js";
|
|
|
2
2
|
import { useReducedMotion as t } from "./useReducedMotion.js";
|
|
3
3
|
import { useEffect as n, useState as r } from "react";
|
|
4
4
|
//#region src/hooks/useCursorAnimation.ts
|
|
5
|
-
function i({ text: i, initialText: a, animate: o, delay: s = 500, waitForPageLoad: c = !0 }) {
|
|
6
|
-
let
|
|
7
|
-
visibleText:
|
|
8
|
-
|
|
9
|
-
cursorPhase: d ? "initial" : "complete"
|
|
5
|
+
function i({ text: i, initialText: a, animate: o, delay: s = 500, waitForPageLoad: c = !0, startOnIntersection: l = !1, intersectionRef: u }) {
|
|
6
|
+
let d = t(), [f, p] = r(!1), m = o === !0 && i.length > 0, h = m && !d, g = h && (!l || f), [_, v] = r({
|
|
7
|
+
visibleText: m ? "" : i,
|
|
8
|
+
cursorPhase: m ? "initial" : "complete"
|
|
10
9
|
});
|
|
11
|
-
return
|
|
12
|
-
|
|
10
|
+
return n(() => {
|
|
11
|
+
if (!l || !h || f) return;
|
|
12
|
+
if (typeof IntersectionObserver > "u") {
|
|
13
|
+
p(!0);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
let e = u?.current;
|
|
17
|
+
if (!e) return;
|
|
18
|
+
let t = new IntersectionObserver(([e]) => {
|
|
19
|
+
e.isIntersecting && (p(!0), t.disconnect());
|
|
20
|
+
});
|
|
21
|
+
return t.observe(e), () => t.disconnect();
|
|
22
|
+
}, [
|
|
23
|
+
f,
|
|
24
|
+
u,
|
|
25
|
+
h,
|
|
26
|
+
l
|
|
27
|
+
]), e(() => {
|
|
28
|
+
h || v({
|
|
13
29
|
visibleText: i,
|
|
14
|
-
showCursor: !0,
|
|
15
30
|
cursorPhase: "complete"
|
|
16
31
|
});
|
|
17
|
-
}, [
|
|
18
|
-
if (!
|
|
32
|
+
}, [h, i]), n(() => {
|
|
33
|
+
if (!g) return;
|
|
19
34
|
let e = 1e3 / 60, t = 85 / 75 * 24, n = [
|
|
20
35
|
">",
|
|
21
36
|
"*",
|
|
@@ -27,14 +42,13 @@ function i({ text: i, initialText: a, animate: o, delay: s = 500, waitForPageLoa
|
|
|
27
42
|
"^",
|
|
28
43
|
"_"
|
|
29
44
|
];
|
|
30
|
-
|
|
45
|
+
v({
|
|
31
46
|
visibleText: "",
|
|
32
|
-
showCursor: !1,
|
|
33
47
|
cursorPhase: "initial"
|
|
34
48
|
});
|
|
35
49
|
let r = typeof a == "string" && a.length > 0 && a !== i ? a : void 0, o = 0;
|
|
36
50
|
if (r) for (; o < r.length && o < i.length && r[o] === i[o];) o += 1;
|
|
37
|
-
let l = r !== void 0 && o < r.length,
|
|
51
|
+
let l = r !== void 0 && o < r.length, u = l ? r : i, d = l ? u.length - o : 0, f = u.length / 34 * 1e3, p = f + (l ? 308.8235294117647 : 0), m = p + d / t * 1e3, h = m + (l ? i.length - o : 0) / 34 * 1e3, _ = p - e, y = h - 6 * e, b = (e, t) => {
|
|
38
52
|
let r = "", i = 0;
|
|
39
53
|
for (let a = 0; a < t; a += 1) {
|
|
40
54
|
let o = e[a];
|
|
@@ -47,31 +61,29 @@ function i({ text: i, initialText: a, animate: o, delay: s = 500, waitForPageLoa
|
|
|
47
61
|
return r;
|
|
48
62
|
}, x = (e) => {
|
|
49
63
|
let n = "";
|
|
50
|
-
if (e > 0 && e <
|
|
64
|
+
if (e > 0 && e < f) {
|
|
51
65
|
let t = Math.floor(e / 1e3 * 34);
|
|
52
|
-
n = b(
|
|
53
|
-
} else if (l && e >=
|
|
54
|
-
else if (l && e >=
|
|
55
|
-
let r = e -
|
|
56
|
-
n =
|
|
57
|
-
} else if (l && e >=
|
|
58
|
-
let t = e -
|
|
66
|
+
n = b(u, t);
|
|
67
|
+
} else if (l && e >= f && e < p) n = u;
|
|
68
|
+
else if (l && e >= p && e < m) {
|
|
69
|
+
let r = e - p, i = Math.floor(r / 1e3 * t);
|
|
70
|
+
n = u.slice(0, u.length - i);
|
|
71
|
+
} else if (l && e >= m && e < h) {
|
|
72
|
+
let t = e - m, r = Math.min(i.length, o + Math.floor(t / 1e3 * 34));
|
|
59
73
|
n = i.slice(0, r);
|
|
60
|
-
} else e >=
|
|
74
|
+
} else e >= h && (n = i);
|
|
61
75
|
let r = "initial";
|
|
62
|
-
return l && e >=
|
|
76
|
+
return l && e >= _ && (r = "correction"), e >= y && (r = "final"), e >= h && (r = "complete"), {
|
|
63
77
|
visibleText: n,
|
|
64
|
-
showCursor: n.length > 0,
|
|
65
78
|
cursorPhase: r
|
|
66
79
|
};
|
|
67
80
|
}, S, C, w = () => {
|
|
68
81
|
let e = performance.now(), t = {
|
|
69
82
|
visibleText: "",
|
|
70
|
-
showCursor: !1,
|
|
71
83
|
cursorPhase: "initial"
|
|
72
84
|
}, n = (r) => {
|
|
73
85
|
let i = r - e, a = x(i);
|
|
74
|
-
(t.visibleText !== a.visibleText || t.
|
|
86
|
+
(t.visibleText !== a.visibleText || t.cursorPhase !== a.cursorPhase) && (t = a, v(a)), i < h && (S = window.requestAnimationFrame(n));
|
|
75
87
|
};
|
|
76
88
|
S = window.requestAnimationFrame(n);
|
|
77
89
|
}, T = () => {
|
|
@@ -91,10 +103,14 @@ function i({ text: i, initialText: a, animate: o, delay: s = 500, waitForPageLoa
|
|
|
91
103
|
}, [
|
|
92
104
|
s,
|
|
93
105
|
a,
|
|
94
|
-
|
|
106
|
+
g,
|
|
95
107
|
i,
|
|
96
108
|
c
|
|
97
|
-
]),
|
|
109
|
+
]), {
|
|
110
|
+
visibleText: _.visibleText,
|
|
111
|
+
showCursor: !m || _.visibleText.length > 0,
|
|
112
|
+
cursorPhase: _.cursorPhase
|
|
113
|
+
};
|
|
98
114
|
}
|
|
99
115
|
//#endregion
|
|
100
116
|
export { i as useCursorAnimation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCursorAnimation.js","names":[],"sources":["../../src/hooks/useCursorAnimation.ts"],"sourcesContent":["import {useEffect, useState} from 'react'\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect'\nimport {useReducedMotion} from './useReducedMotion'\n\nexport type CursorAnimationPhase = 'initial' | 'correction' | 'final' | 'complete'\n\nexport type UseCursorAnimationResult = {\n visibleText: string\n showCursor: boolean\n cursorPhase: CursorAnimationPhase\n}\n\nexport type UseCursorAnimationOptions = {\n text: string\n initialText?: string\n animate?: boolean\n delay?: number\n waitForPageLoad?: boolean\n}\n\nexport function useCursorAnimation({\n text,\n initialText,\n animate,\n delay = 500,\n waitForPageLoad = true,\n}: UseCursorAnimationOptions): UseCursorAnimationResult {\n const prefersReducedMotion = useReducedMotion()\n\n const shouldAnimate = animate === true && !prefersReducedMotion && text.length > 0\n const shouldStartHidden = animate === true && text.length > 0\n\n const [frame, setFrame] = useState<UseCursorAnimationResult>({\n visibleText: shouldStartHidden ? '' : text,\n showCursor: !shouldStartHidden,\n cursorPhase: shouldStartHidden ? 'initial' : 'complete',\n })\n\n useIsomorphicLayoutEffect(() => {\n if (!shouldAnimate) {\n setFrame({visibleText: text, showCursor: true, cursorPhase: 'complete'})\n }\n }, [shouldAnimate, text])\n\n useEffect(() => {\n if (!shouldAnimate) return\n\n const frameDuration = 1000 / 60\n const charactersPerSecond = 30 * (85 / 75)\n const deleteCharactersPerSecond = 24 * (85 / 75)\n const correctionPauseDuration = 350 / (85 / 75)\n const scrambleSymbols = ['>', '*', '=', '&', '+', '-', '%', '^', '_']\n\n setFrame({visibleText: '', showCursor: false, cursorPhase: 'initial'})\n\n const candidateInitialText =\n typeof initialText === 'string' && initialText.length > 0 && initialText !== text ? initialText : undefined\n let sharedPrefixLength = 0\n\n if (candidateInitialText) {\n while (\n sharedPrefixLength < candidateInitialText.length &&\n sharedPrefixLength < text.length &&\n candidateInitialText[sharedPrefixLength] === text[sharedPrefixLength]\n ) {\n sharedPrefixLength += 1\n }\n }\n\n const hasCorrection = candidateInitialText !== undefined && sharedPrefixLength < candidateInitialText.length\n const firstText = hasCorrection ? candidateInitialText : text\n const deletedCharacterCount = hasCorrection ? firstText.length - sharedPrefixLength : 0\n const firstTypeDuration = (firstText.length / charactersPerSecond) * 1000\n const correctionStart = firstTypeDuration + (hasCorrection ? correctionPauseDuration : 0)\n const deleteDuration = (deletedCharacterCount / deleteCharactersPerSecond) * 1000\n const secondTypeStart = correctionStart + deleteDuration\n const secondTypeCharacterCount = hasCorrection ? text.length - sharedPrefixLength : 0\n const secondTypeDuration = (secondTypeCharacterCount / charactersPerSecond) * 1000\n const typingComplete = secondTypeStart + secondTypeDuration\n const correctionCursorStart = correctionStart - frameDuration\n const finalCursorStart = typingComplete - 6 * frameDuration\n\n const getScrambledText = (sourceText: string, characterCount: number) => {\n let result = ''\n let visibleCharacterIndex = 0\n\n for (let index = 0; index < characterCount; index += 1) {\n const character = sourceText[index]\n\n if (/\\s/.test(character)) {\n result = `${result}${character}`\n continue\n }\n\n visibleCharacterIndex += 1\n result = `${result}${character}`\n\n if (index === characterCount - 1) {\n result = `${result}${scrambleSymbols[(visibleCharacterIndex - 1) % scrambleSymbols.length]}`\n }\n }\n\n return result\n }\n\n const getFrame = (elapsed: number): UseCursorAnimationResult => {\n let nextText = ''\n\n if (elapsed > 0 && elapsed < firstTypeDuration) {\n const typedCharacterCount = Math.floor((elapsed / 1000) * charactersPerSecond)\n nextText = getScrambledText(firstText, typedCharacterCount)\n } else if (hasCorrection && elapsed >= firstTypeDuration && elapsed < correctionStart) {\n nextText = firstText\n } else if (hasCorrection && elapsed >= correctionStart && elapsed < secondTypeStart) {\n const deleteElapsed = elapsed - correctionStart\n const currentDeletedCharacterCount = Math.floor((deleteElapsed / 1000) * deleteCharactersPerSecond)\n nextText = firstText.slice(0, firstText.length - currentDeletedCharacterCount)\n } else if (hasCorrection && elapsed >= secondTypeStart && elapsed < typingComplete) {\n const secondTypeElapsed = elapsed - secondTypeStart\n const typedCharacterCount = Math.min(\n text.length,\n sharedPrefixLength + Math.floor((secondTypeElapsed / 1000) * charactersPerSecond),\n )\n nextText = text.slice(0, typedCharacterCount)\n } else if (elapsed >= typingComplete) {\n nextText = text\n }\n\n let nextCursorPhase: CursorAnimationPhase = 'initial'\n if (hasCorrection && elapsed >= correctionCursorStart) nextCursorPhase = 'correction'\n if (elapsed >= finalCursorStart) nextCursorPhase = 'final'\n if (elapsed >= typingComplete) nextCursorPhase = 'complete'\n\n return {\n visibleText: nextText,\n showCursor: nextText.length > 0,\n cursorPhase: nextCursorPhase,\n }\n }\n\n let animationFrame: number | undefined\n let delayTimer: ReturnType<typeof setTimeout> | undefined\n\n const startAnimation = () => {\n const startTime = performance.now()\n let previousFrame: UseCursorAnimationResult = {\n visibleText: '',\n showCursor: false,\n cursorPhase: 'initial',\n }\n\n const tick = (currentTime: number) => {\n const elapsed = currentTime - startTime\n const nextFrame = getFrame(elapsed)\n\n if (\n previousFrame.visibleText !== nextFrame.visibleText ||\n previousFrame.showCursor !== nextFrame.showCursor ||\n previousFrame.cursorPhase !== nextFrame.cursorPhase\n ) {\n previousFrame = nextFrame\n setFrame(nextFrame)\n }\n\n if (elapsed < typingComplete) {\n animationFrame = window.requestAnimationFrame(tick)\n }\n }\n\n animationFrame = window.requestAnimationFrame(tick)\n }\n\n const startDelayTimer = () => {\n delayTimer = setTimeout(startAnimation, delay)\n }\n\n if (waitForPageLoad && typeof window !== 'undefined') {\n if (document.readyState === 'complete') {\n startDelayTimer()\n } else {\n const handleLoad = () => startDelayTimer()\n window.addEventListener('load', handleLoad)\n return () => {\n window.removeEventListener('load', handleLoad)\n if (delayTimer !== undefined) clearTimeout(delayTimer)\n if (animationFrame !== undefined) window.cancelAnimationFrame(animationFrame)\n }\n }\n } else {\n startDelayTimer()\n }\n\n return () => {\n if (delayTimer !== undefined) clearTimeout(delayTimer)\n if (animationFrame !== undefined) window.cancelAnimationFrame(animationFrame)\n }\n }, [delay, initialText, shouldAnimate, text, waitForP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AY;IACZ,aAAa;GACf,GAEM,KAAQ,MAAwB;IACpC,IAAM,IAAU,IAAc,GACxB,IAAY,EAAS,CAAO;IAWlC,CARE,EAAc,gBAAgB,EAAU,eACxC,EAAc,eAAe,EAAU,cACvC,EAAc,gBAAgB,EAAU,iBAExC,IAAgB,GAChB,EAAS,CAAS,IAGhB,IAAU,MACZ,IAAiB,OAAO,sBAAsB,CAAI;GAEtD;GAEA,IAAiB,OAAO,sBAAsB,CAAI;EACpD,GAEM,UAAwB;GAC5B,IAAa,WAAW,GAAgB,CAAK;EAC/C;EAEA,IAAI,KAAmB,OAAO,SAAW,KACvC,IAAI,SAAS,eAAe,YAC1B,EAAgB;OACX;GACL,IAAM,UAAmB,EAAgB;GAEzC,OADA,OAAO,iBAAiB,QAAQ,CAAU,SAC7B;IAGX,AAFA,OAAO,oBAAoB,QAAQ,CAAU,GACzC,MAAe,KAAA,KAAW,aAAa,CAAU,GACjD,MAAmB,KAAA,KAAW,OAAO,qBAAqB,CAAc;GAC9E;EACF;OAEA,EAAgB;EAGlB,aAAa;GAEX,AADI,MAAe,KAAA,KAAW,aAAa,CAAU,GACjD,MAAmB,KAAA,KAAW,OAAO,qBAAqB,CAAc;EAC9E;CACF,GAAG;EAAC;EAAO;EAAa;EAAe;EAAM;CAAe,CAAC,GAEtD;AACT"}
|
|
1
|
+
{"version":3,"file":"useCursorAnimation.js","names":[],"sources":["../../src/hooks/useCursorAnimation.ts"],"sourcesContent":["import {useEffect, useState, type RefObject} from 'react'\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect'\nimport {useReducedMotion} from './useReducedMotion'\n\nexport type CursorAnimationPhase = 'initial' | 'correction' | 'final' | 'complete'\n\nexport type UseCursorAnimationResult = {\n visibleText: string\n showCursor: boolean\n cursorPhase: CursorAnimationPhase\n}\n\nexport type UseCursorAnimationOptions = {\n text: string\n initialText?: string\n animate?: boolean\n delay?: number\n waitForPageLoad?: boolean\n startOnIntersection?: boolean\n intersectionRef?: RefObject<HTMLElement | null>\n}\n\nexport function useCursorAnimation({\n text,\n initialText,\n animate,\n delay = 500,\n waitForPageLoad = true,\n startOnIntersection = false,\n intersectionRef,\n}: UseCursorAnimationOptions): UseCursorAnimationResult {\n const prefersReducedMotion = useReducedMotion()\n const [hasIntersected, setHasIntersected] = useState(false)\n const shouldStartHidden = animate === true && text.length > 0\n const motionEnabled = shouldStartHidden && !prefersReducedMotion\n const shouldAnimate = motionEnabled && (!startOnIntersection || hasIntersected)\n const [frame, setFrame] = useState<{visibleText: string; cursorPhase: CursorAnimationPhase}>({\n visibleText: shouldStartHidden ? '' : text,\n cursorPhase: shouldStartHidden ? 'initial' : 'complete',\n })\n\n useEffect(() => {\n if (!startOnIntersection || !motionEnabled || hasIntersected) return\n\n if (typeof IntersectionObserver === 'undefined') {\n setHasIntersected(true)\n return\n }\n\n const observedElement = intersectionRef?.current\n if (!observedElement) return\n\n const observer = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) {\n setHasIntersected(true)\n observer.disconnect()\n }\n })\n\n observer.observe(observedElement)\n return () => observer.disconnect()\n }, [hasIntersected, intersectionRef, motionEnabled, startOnIntersection])\n\n useIsomorphicLayoutEffect(() => {\n if (!motionEnabled) {\n setFrame({visibleText: text, cursorPhase: 'complete'})\n }\n }, [motionEnabled, text])\n\n useEffect(() => {\n if (!shouldAnimate) return\n\n const frameDuration = 1000 / 60\n const charactersPerSecond = 30 * (85 / 75)\n const deleteCharactersPerSecond = 24 * (85 / 75)\n const correctionPauseDuration = 350 / (85 / 75)\n const scrambleSymbols = ['>', '*', '=', '&', '+', '-', '%', '^', '_']\n\n setFrame({visibleText: '', cursorPhase: 'initial'})\n\n const candidateInitialText =\n typeof initialText === 'string' && initialText.length > 0 && initialText !== text ? initialText : undefined\n let sharedPrefixLength = 0\n\n if (candidateInitialText) {\n while (\n sharedPrefixLength < candidateInitialText.length &&\n sharedPrefixLength < text.length &&\n candidateInitialText[sharedPrefixLength] === text[sharedPrefixLength]\n ) {\n sharedPrefixLength += 1\n }\n }\n\n const hasCorrection = candidateInitialText !== undefined && sharedPrefixLength < candidateInitialText.length\n const firstText = hasCorrection ? candidateInitialText : text\n const deletedCharacterCount = hasCorrection ? firstText.length - sharedPrefixLength : 0\n const firstTypeDuration = (firstText.length / charactersPerSecond) * 1000\n const correctionStart = firstTypeDuration + (hasCorrection ? correctionPauseDuration : 0)\n const deleteDuration = (deletedCharacterCount / deleteCharactersPerSecond) * 1000\n const secondTypeStart = correctionStart + deleteDuration\n const secondTypeCharacterCount = hasCorrection ? text.length - sharedPrefixLength : 0\n const secondTypeDuration = (secondTypeCharacterCount / charactersPerSecond) * 1000\n const typingComplete = secondTypeStart + secondTypeDuration\n const correctionCursorStart = correctionStart - frameDuration\n const finalCursorStart = typingComplete - 6 * frameDuration\n\n const getScrambledText = (sourceText: string, characterCount: number) => {\n let result = ''\n let visibleCharacterIndex = 0\n\n for (let index = 0; index < characterCount; index += 1) {\n const character = sourceText[index]\n\n if (/\\s/.test(character)) {\n result = `${result}${character}`\n continue\n }\n\n visibleCharacterIndex += 1\n result = `${result}${character}`\n\n if (index === characterCount - 1) {\n result = `${result}${scrambleSymbols[(visibleCharacterIndex - 1) % scrambleSymbols.length]}`\n }\n }\n\n return result\n }\n\n const getFrame = (elapsed: number) => {\n let nextText = ''\n\n if (elapsed > 0 && elapsed < firstTypeDuration) {\n const typedCharacterCount = Math.floor((elapsed / 1000) * charactersPerSecond)\n nextText = getScrambledText(firstText, typedCharacterCount)\n } else if (hasCorrection && elapsed >= firstTypeDuration && elapsed < correctionStart) {\n nextText = firstText\n } else if (hasCorrection && elapsed >= correctionStart && elapsed < secondTypeStart) {\n const deleteElapsed = elapsed - correctionStart\n const currentDeletedCharacterCount = Math.floor((deleteElapsed / 1000) * deleteCharactersPerSecond)\n nextText = firstText.slice(0, firstText.length - currentDeletedCharacterCount)\n } else if (hasCorrection && elapsed >= secondTypeStart && elapsed < typingComplete) {\n const secondTypeElapsed = elapsed - secondTypeStart\n const typedCharacterCount = Math.min(\n text.length,\n sharedPrefixLength + Math.floor((secondTypeElapsed / 1000) * charactersPerSecond),\n )\n nextText = text.slice(0, typedCharacterCount)\n } else if (elapsed >= typingComplete) {\n nextText = text\n }\n\n let nextCursorPhase: CursorAnimationPhase = 'initial'\n if (hasCorrection && elapsed >= correctionCursorStart) nextCursorPhase = 'correction'\n if (elapsed >= finalCursorStart) nextCursorPhase = 'final'\n if (elapsed >= typingComplete) nextCursorPhase = 'complete'\n\n return {visibleText: nextText, cursorPhase: nextCursorPhase}\n }\n\n let animationFrame: number | undefined\n let delayTimer: ReturnType<typeof setTimeout> | undefined\n\n const startAnimation = () => {\n const startTime = performance.now()\n let previousFrame = {visibleText: '', cursorPhase: 'initial' as CursorAnimationPhase}\n\n const tick = (currentTime: number) => {\n const elapsed = currentTime - startTime\n const nextFrame = getFrame(elapsed)\n\n if (\n previousFrame.visibleText !== nextFrame.visibleText ||\n previousFrame.cursorPhase !== nextFrame.cursorPhase\n ) {\n previousFrame = nextFrame\n setFrame(nextFrame)\n }\n\n if (elapsed < typingComplete) {\n animationFrame = window.requestAnimationFrame(tick)\n }\n }\n\n animationFrame = window.requestAnimationFrame(tick)\n }\n\n const startDelayTimer = () => {\n delayTimer = setTimeout(startAnimation, delay)\n }\n\n if (waitForPageLoad && typeof window !== 'undefined') {\n if (document.readyState === 'complete') {\n startDelayTimer()\n } else {\n const handleLoad = () => startDelayTimer()\n window.addEventListener('load', handleLoad)\n return () => {\n window.removeEventListener('load', handleLoad)\n if (delayTimer !== undefined) clearTimeout(delayTimer)\n if (animationFrame !== undefined) window.cancelAnimationFrame(animationFrame)\n }\n }\n } else {\n startDelayTimer()\n }\n\n return () => {\n if (delayTimer !== undefined) clearTimeout(delayTimer)\n if (animationFrame !== undefined) window.cancelAnimationFrame(animationFrame)\n }\n }, [delay, initialText, shouldAnimate, text, waitForPageLoad])\n\n return {\n visibleText: frame.visibleText,\n showCursor: shouldStartHidden ? frame.visibleText.length > 0 : true,\n cursorP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;EAC3D,aAAa,EAAM;CACrB;AACF"}
|
|
@@ -19,5 +19,6 @@ export type TextCursorAnimationProps = {
|
|
|
19
19
|
['data-testid']?: string;
|
|
20
20
|
delay?: number;
|
|
21
21
|
waitForPageLoad?: boolean;
|
|
22
|
+
animationTrigger?: 'immediate' | 'on-visible';
|
|
22
23
|
} & React.HTMLAttributes<HTMLSpanElement> & Omit<TextProps, 'animate' | 'as'>;
|
|
23
|
-
export declare function TextCursorAnimation({ children, className, animate, initialText, 'data-testid': testId, delay, waitForPageLoad, variant, }: PropsWithChildren<TextCursorAnimationProps>): React.JSX.Element;
|
|
24
|
+
export declare function TextCursorAnimation({ children, className, animate, initialText, 'data-testid': testId, delay, waitForPageLoad, animationTrigger, variant, }: PropsWithChildren<TextCursorAnimationProps>): React.JSX.Element;
|