@telefonica/mistica 16.60.0 → 16.62.0-beta.1
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/css/mistica.css +1 -1
- package/dist/accordion.css-mistica.js +16 -16
- package/dist/align.css-mistica.js +2 -2
- package/dist/autocomplete.css-mistica.js +6 -6
- package/dist/avatar.css-mistica.js +3 -3
- package/dist/badge.css-mistica.js +7 -7
- package/dist/box.css-mistica.js +15 -15
- package/dist/boxed.css-mistica.js +31 -31
- package/dist/button-fixed-footer-layout.d.ts +2 -1
- package/dist/button-fixed-footer-layout.js +4 -3
- package/dist/button-group.css-mistica.js +10 -10
- package/dist/button-layout.css-mistica.js +21 -21
- package/dist/button.css-mistica.js +51 -51
- package/dist/callout.css-mistica.js +16 -16
- package/dist/card-internal.css-mistica.js +38 -38
- package/dist/carousel.css-mistica.js +18 -18
- package/dist/checkbox.css-mistica.js +21 -21
- package/dist/chip.css-mistica.js +30 -30
- package/dist/circle.css-mistica.js +2 -2
- package/dist/community/advanced-data-card.css-mistica.js +26 -26
- package/dist/community/blocks.css-mistica.js +3 -3
- package/dist/community/example-component.css-mistica.js +2 -2
- package/dist/counter.css-mistica.js +12 -12
- package/dist/cover-hero.css-mistica.js +16 -16
- package/dist/credit-card-number-field.css-mistica.js +6 -6
- package/dist/date-field.css-mistica.js +1 -1
- package/dist/date-time-picker.css-mistica.js +2 -2
- package/dist/dialog.css-mistica.js +15 -15
- package/dist/divider.css-mistica.js +5 -5
- package/dist/double-field.css-mistica.js +4 -4
- package/dist/drawer.css-mistica.js +15 -15
- package/dist/empty-state-card.css-mistica.js +4 -4
- package/dist/empty-state.css-mistica.js +14 -14
- package/dist/fade-in.css-mistica.js +1 -1
- package/dist/feedback.css-mistica.js +14 -14
- package/dist/file-upload.css-mistica.js +14 -14
- package/dist/fixed-footer-layout.css-mistica.js +12 -12
- package/dist/fixed-footer-layout.d.ts +6 -1
- package/dist/fixed-footer-layout.js +29 -28
- package/dist/form.css-mistica.js +2 -2
- package/dist/grid-layout.css-mistica.js +9 -9
- package/dist/grid.css-mistica.js +147 -147
- package/dist/header.css-mistica.js +5 -5
- package/dist/hero.css-mistica.js +11 -11
- package/dist/horizontal-scroll.css-mistica.js +3 -3
- package/dist/icon-button.css-mistica.js +66 -66
- package/dist/icons/icon-chevron.css-mistica.js +6 -6
- package/dist/icons/icon-error.css-mistica.js +3 -3
- package/dist/image.css-mistica.js +11 -11
- package/dist/image.js +8 -1
- package/dist/inline.css-mistica.js +16 -16
- package/dist/list.css-mistica.js +15 -15
- package/dist/loading-bar.css-mistica.js +5 -5
- package/dist/loading-screen.css-mistica.js +15 -15
- package/dist/logo.css-mistica.js +9 -9
- package/dist/menu.css-mistica.js +24 -24
- package/dist/mosaic.css-mistica.js +3 -3
- package/dist/navigation-bar.css-mistica.js +45 -45
- package/dist/navigation-breadcrumbs.css-mistica.js +5 -5
- package/dist/package-version.js +2 -2
- package/dist/pin-field.css-mistica.js +10 -10
- package/dist/popover.css-mistica.js +2 -2
- package/dist/progress-bar.css-mistica.js +12 -12
- package/dist/radio-button.css-mistica.js +33 -33
- package/dist/rating.css-mistica.js +12 -12
- package/dist/responsive-layout.css-mistica.js +20 -20
- package/dist/screen-reader-only.css-mistica.js +2 -2
- package/dist/select.css-mistica.js +29 -29
- package/dist/sheet-action-row.css-mistica.js +2 -2
- package/dist/sheet-common.css-mistica.js +16 -16
- package/dist/sheet-info.css-mistica.js +4 -4
- package/dist/skeletons.css-mistica.js +12 -12
- package/dist/skins/skin-contract.css-mistica.js +686 -686
- package/dist/skip-link.css-mistica.js +3 -3
- package/dist/slider.css-mistica.js +28 -28
- package/dist/snackbar.css-mistica.js +16 -16
- package/dist/spinner.css-mistica.js +5 -5
- package/dist/square.css-mistica.js +2 -2
- package/dist/stack.css-mistica.js +9 -9
- package/dist/stacking-group.css-mistica.js +2 -2
- package/dist/stepper.css-mistica.js +16 -16
- package/dist/switch-component.css-mistica.js +53 -53
- package/dist/table.css-mistica.js +24 -24
- package/dist/tabs.css-mistica.js +30 -30
- package/dist/tag.css-mistica.js +5 -5
- package/dist/text-field-base.css-mistica.js +30 -30
- package/dist/text-field-components.css-mistica.js +19 -19
- package/dist/text-link.css-mistica.js +10 -10
- package/dist/text.css-mistica.js +13 -13
- package/dist/theme-context.css-mistica.js +2 -2
- package/dist/timeline.css-mistica.js +18 -18
- package/dist/timer.css-mistica.js +13 -13
- package/dist/tooltip.css-mistica.js +12 -12
- package/dist/touchable.css-mistica.js +5 -5
- package/dist/utils/aspect-ratio-support.css-mistica.js +7 -7
- package/dist/video.css-mistica.js +2 -2
- package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +3 -3
- package/dist-es/accordion.css-mistica.js +7 -7
- package/dist-es/align.css-mistica.js +2 -2
- package/dist-es/autocomplete.css-mistica.js +2 -2
- package/dist-es/avatar.css-mistica.js +2 -2
- package/dist-es/badge.css-mistica.js +2 -2
- package/dist-es/box.css-mistica.js +15 -15
- package/dist-es/boxed.css-mistica.js +25 -25
- package/dist-es/button-fixed-footer-layout.js +12 -11
- package/dist-es/button-group.css-mistica.js +2 -2
- package/dist-es/button-layout.css-mistica.js +16 -16
- package/dist-es/button.css-mistica.js +38 -38
- package/dist-es/callout.css-mistica.js +12 -12
- package/dist-es/card-internal.css-mistica.js +20 -20
- package/dist-es/carousel.css-mistica.js +10 -10
- package/dist-es/checkbox.css-mistica.js +14 -14
- package/dist-es/chip.css-mistica.js +17 -17
- package/dist-es/circle.css-mistica.js +2 -2
- package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
- package/dist-es/community/blocks.css-mistica.js +2 -2
- package/dist-es/community/example-component.css-mistica.js +2 -2
- package/dist-es/counter.css-mistica.js +2 -2
- package/dist-es/cover-hero.css-mistica.js +4 -4
- package/dist-es/credit-card-number-field.css-mistica.js +4 -4
- package/dist-es/date-field.css-mistica.js +1 -1
- package/dist-es/date-time-picker.css-mistica.js +2 -2
- package/dist-es/dialog.css-mistica.js +5 -5
- package/dist-es/divider.css-mistica.js +5 -5
- package/dist-es/double-field.css-mistica.js +4 -4
- package/dist-es/drawer.css-mistica.js +2 -2
- package/dist-es/empty-state-card.css-mistica.js +2 -2
- package/dist-es/empty-state.css-mistica.js +7 -7
- package/dist-es/fade-in.css-mistica.js +1 -1
- package/dist-es/feedback.css-mistica.js +2 -2
- package/dist-es/file-upload.css-mistica.js +8 -8
- package/dist-es/fixed-footer-layout.css-mistica.js +4 -4
- package/dist-es/fixed-footer-layout.js +57 -56
- package/dist-es/form.css-mistica.js +2 -2
- package/dist-es/grid-layout.css-mistica.js +4 -4
- package/dist-es/grid.css-mistica.js +127 -127
- package/dist-es/header.css-mistica.js +2 -2
- package/dist-es/hero.css-mistica.js +4 -4
- package/dist-es/horizontal-scroll.css-mistica.js +2 -2
- package/dist-es/icon-button.css-mistica.js +56 -56
- package/dist-es/icons/icon-chevron.css-mistica.js +4 -4
- package/dist-es/icons/icon-error.css-mistica.js +2 -2
- package/dist-es/image.css-mistica.js +4 -4
- package/dist-es/image.js +8 -1
- package/dist-es/inline.css-mistica.js +10 -10
- package/dist-es/list.css-mistica.js +2 -2
- package/dist-es/loading-bar.css-mistica.js +2 -2
- package/dist-es/loading-screen.css-mistica.js +5 -5
- package/dist-es/logo.css-mistica.js +7 -7
- package/dist-es/menu.css-mistica.js +15 -15
- package/dist-es/mosaic.css-mistica.js +2 -2
- package/dist-es/navigation-bar.css-mistica.js +20 -20
- package/dist-es/navigation-breadcrumbs.css-mistica.js +2 -2
- package/dist-es/package-version.js +2 -2
- package/dist-es/pin-field.css-mistica.js +2 -2
- package/dist-es/popover.css-mistica.js +2 -2
- package/dist-es/progress-bar.css-mistica.js +8 -8
- package/dist-es/radio-button.css-mistica.js +25 -25
- package/dist-es/rating.css-mistica.js +4 -4
- package/dist-es/responsive-layout.css-mistica.js +7 -7
- package/dist-es/screen-reader-only.css-mistica.js +2 -2
- package/dist-es/select.css-mistica.js +20 -20
- package/dist-es/sheet-action-row.css-mistica.js +2 -2
- package/dist-es/sheet-common.css-mistica.js +2 -2
- package/dist-es/sheet-info.css-mistica.js +2 -2
- package/dist-es/skeletons.css-mistica.js +8 -8
- package/dist-es/skins/skin-contract.css-mistica.js +686 -686
- package/dist-es/skip-link.css-mistica.js +2 -2
- package/dist-es/slider.css-mistica.js +20 -20
- package/dist-es/snackbar.css-mistica.js +5 -5
- package/dist-es/spinner.css-mistica.js +2 -2
- package/dist-es/square.css-mistica.js +2 -2
- package/dist-es/stack.css-mistica.js +7 -7
- package/dist-es/stacking-group.css-mistica.js +2 -2
- package/dist-es/stepper.css-mistica.js +4 -4
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.css-mistica.js +41 -41
- package/dist-es/table.css-mistica.js +11 -11
- package/dist-es/tabs.css-mistica.js +21 -21
- package/dist-es/tag.css-mistica.js +2 -2
- package/dist-es/text-field-base.css-mistica.js +17 -17
- package/dist-es/text-field-components.css-mistica.js +4 -4
- package/dist-es/text-link.css-mistica.js +9 -9
- package/dist-es/text.css-mistica.js +8 -8
- package/dist-es/theme-context.css-mistica.js +2 -2
- package/dist-es/timeline.css-mistica.js +11 -11
- package/dist-es/timer.css-mistica.js +7 -7
- package/dist-es/tooltip.css-mistica.js +3 -3
- package/dist-es/touchable.css-mistica.js +2 -2
- package/dist-es/utils/aspect-ratio-support.css-mistica.js +4 -4
- package/dist-es/video.css-mistica.js +2 -2
- package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +2 -2
- package/doc/components.md +19 -0
- package/doc/figma-mcp.md +136 -0
- package/doc/layout.md +20 -1
- package/doc/llms.md +18 -0
- package/doc/patterns.md +6 -17
- package/package.json +13 -1
- package/src/accordion.css.ts +121 -0
- package/src/accordion.tsx +366 -0
- package/src/align.css.ts +7 -0
- package/src/align.tsx +32 -0
- package/src/autocomplete.css.ts +62 -0
- package/src/autocomplete.tsx +239 -0
- package/src/avatar.css.ts +14 -0
- package/src/avatar.tsx +120 -0
- package/src/badge.css.ts +51 -0
- package/src/badge.tsx +79 -0
- package/src/box.css.ts +51 -0
- package/src/box.tsx +114 -0
- package/src/boxed.css.ts +132 -0
- package/src/boxed.tsx +153 -0
- package/src/button-fixed-footer-layout.tsx +65 -0
- package/src/button-group.css.ts +75 -0
- package/src/button-group.tsx +91 -0
- package/src/button-layout.css.ts +162 -0
- package/src/button-layout.tsx +91 -0
- package/src/button.css.ts +758 -0
- package/src/button.tsx +632 -0
- package/src/callout.css.ts +50 -0
- package/src/callout.tsx +147 -0
- package/src/card-cover.tsx +242 -0
- package/src/card-data.tsx +152 -0
- package/src/card-internal.css.ts +271 -0
- package/src/card-internal.tsx +1724 -0
- package/src/card-media.tsx +157 -0
- package/src/card-naked.tsx +63 -0
- package/src/carousel.css.ts +522 -0
- package/src/carousel.tsx +1300 -0
- package/src/checkbox.css.ts +94 -0
- package/src/checkbox.tsx +192 -0
- package/src/chip.css.ts +204 -0
- package/src/chip.tsx +191 -0
- package/src/circle.css.ts +14 -0
- package/src/circle.tsx +52 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-button-and-link-footer-image-false-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-button-and-link-footer-image-true-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-button-footer-image-false-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-button-footer-image-true-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-link-footer-image-false-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-link-footer-image-true-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-none-footer-image-false-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-none-footer-image-true-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-extras-0-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-extras-1-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-extras-3-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-extras-3-no-divider-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-inside-carousel-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-without-stacking-group-with-top-actions-and-too-long-title-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-highlighted-value-block-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-information-block-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-progress-block-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-progress-block-2-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-row-block-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-simple-block-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-value-block-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/advanced-data-card-screenshot-test.tsx +84 -0
- package/src/community/__screenshot_tests__/blocks-screenshot-test.tsx +72 -0
- package/src/community/__stories__/advanced-data-card-carousel-story.tsx +66 -0
- package/src/community/__stories__/advanced-data-card-story.tsx +158 -0
- package/src/community/__stories__/blocks-story.tsx +272 -0
- package/src/community/__stories__/example-component-story.tsx +15 -0
- package/src/community/__stories__/index-story.tsx +154 -0
- package/src/community/__type_tests__/advanced-data-card-type-test.tsx +40 -0
- package/src/community/advanced-data-card.css.ts +271 -0
- package/src/community/advanced-data-card.tsx +431 -0
- package/src/community/blocks.css.ts +12 -0
- package/src/community/blocks.tsx +290 -0
- package/src/community/example-component.css.ts +7 -0
- package/src/community/example-component.tsx +17 -0
- package/src/community/index.tsx +10 -0
- package/src/counter.css.ts +150 -0
- package/src/counter.tsx +215 -0
- package/src/cover-hero-media.tsx +39 -0
- package/src/cover-hero.css.ts +133 -0
- package/src/cover-hero.tsx +262 -0
- package/src/credit-card-expiration-field.tsx +187 -0
- package/src/credit-card-fields.tsx +56 -0
- package/src/credit-card-number-field.css.ts +47 -0
- package/src/credit-card-number-field.tsx +245 -0
- package/src/cvv-field.tsx +169 -0
- package/src/date-field.css.ts +14 -0
- package/src/date-field.tsx +130 -0
- package/src/date-time-field.tsx +141 -0
- package/src/date-time-picker.css.ts +126 -0
- package/src/date-time-picker.tsx +188 -0
- package/src/decimal-field.tsx +160 -0
- package/src/desktop-container-type-context.tsx +15 -0
- package/src/dialog-context.tsx +81 -0
- package/src/dialog.css.ts +155 -0
- package/src/dialog.tsx +423 -0
- package/src/divider.css.ts +10 -0
- package/src/divider.tsx +11 -0
- package/src/double-field.css.ts +33 -0
- package/src/double-field.tsx +71 -0
- package/src/drawer.css.ts +123 -0
- package/src/drawer.tsx +304 -0
- package/src/email-field.tsx +76 -0
- package/src/empty-state-card.css.ts +40 -0
- package/src/empty-state-card.tsx +92 -0
- package/src/empty-state.css.ts +119 -0
- package/src/empty-state.tsx +141 -0
- package/src/fade-in.css.ts +12 -0
- package/src/fade-in.tsx +40 -0
- package/src/feedback.css.ts +119 -0
- package/src/feedback.tsx +432 -0
- package/src/file-upload.css.ts +156 -0
- package/src/file-upload.tsx +612 -0
- package/src/fixed-footer-layout.css.ts +96 -0
- package/src/fixed-footer-layout.tsx +227 -0
- package/src/fixed-to-top.tsx +21 -0
- package/src/focus-trap.tsx +17 -0
- package/src/form-context.tsx +198 -0
- package/src/form.css.ts +5 -0
- package/src/form.tsx +287 -0
- package/src/grid-layout.css.ts +68 -0
- package/src/grid-layout.tsx +201 -0
- package/src/grid.css.ts +203 -0
- package/src/grid.tsx +241 -0
- package/src/header.css.ts +30 -0
- package/src/header.tsx +319 -0
- package/src/hero.css.ts +71 -0
- package/src/hero.tsx +318 -0
- package/src/hooks.tsx +313 -0
- package/src/horizontal-scroll.css.ts +43 -0
- package/src/horizontal-scroll.tsx +18 -0
- package/src/iban-field.tsx +218 -0
- package/src/icon-button.css.ts +561 -0
- package/src/icon-button.tsx +221 -0
- package/src/icons/__stories__/mistica-icons-story.tsx +192 -0
- package/src/icons/icon-amex.tsx +40 -0
- package/src/icons/icon-chevron.css.ts +23 -0
- package/src/icons/icon-chevron.tsx +150 -0
- package/src/icons/icon-cvv-amex.tsx +31 -0
- package/src/icons/icon-cvv-visa-mc.tsx +31 -0
- package/src/icons/icon-error.css.ts +27 -0
- package/src/icons/icon-error.tsx +207 -0
- package/src/icons/icon-info.tsx +86 -0
- package/src/icons/icon-mastercard.tsx +36 -0
- package/src/icons/icon-success-vivo-new.tsx +51 -0
- package/src/icons/icon-success-vivo.tsx +36 -0
- package/src/icons/icon-success.tsx +211 -0
- package/src/icons/icon-visa.tsx +32 -0
- package/src/image.css.ts +48 -0
- package/src/image.tsx +352 -0
- package/src/index.tsx +2466 -0
- package/src/inline.css.ts +131 -0
- package/src/inline.tsx +135 -0
- package/src/integer-field.tsx +93 -0
- package/src/list.css.ts +281 -0
- package/src/list.tsx +963 -0
- package/src/loading-bar.css.ts +69 -0
- package/src/loading-bar.tsx +25 -0
- package/src/loading-screen.css.ts +114 -0
- package/src/loading-screen.tsx +376 -0
- package/src/logo-blau-shell.tsx +30 -0
- package/src/logo-blau.tsx +60 -0
- package/src/logo-common.tsx +29 -0
- package/src/logo-esimflag-shell.tsx +30 -0
- package/src/logo-esimflag.tsx +56 -0
- package/src/logo-movistar-new-shell.tsx +30 -0
- package/src/logo-movistar-new.tsx +85 -0
- package/src/logo-movistar-shell.tsx +30 -0
- package/src/logo-movistar.tsx +63 -0
- package/src/logo-o2-new-shell.tsx +26 -0
- package/src/logo-o2-new.tsx +27 -0
- package/src/logo-o2-shell.tsx +26 -0
- package/src/logo-o2.tsx +27 -0
- package/src/logo-telefonica-shell.tsx +30 -0
- package/src/logo-telefonica.tsx +95 -0
- package/src/logo-tu-shell.tsx +26 -0
- package/src/logo-tu.tsx +28 -0
- package/src/logo-vivo-shell.tsx +30 -0
- package/src/logo-vivo.tsx +53 -0
- package/src/logo.css.ts +33 -0
- package/src/logo.tsx +313 -0
- package/src/master-detail-layout.tsx +28 -0
- package/src/maybe-dismissable.css.ts +37 -0
- package/src/maybe-dismissable.tsx +58 -0
- package/src/media-queries.css.ts +67 -0
- package/src/menu.css.ts +132 -0
- package/src/menu.tsx +468 -0
- package/src/meter.tsx +516 -0
- package/src/modal-context-provider.tsx +45 -0
- package/src/month-field.tsx +124 -0
- package/src/mosaic.css.ts +73 -0
- package/src/mosaic.tsx +205 -0
- package/src/navigation-bar.css.ts +558 -0
- package/src/navigation-bar.tsx +1637 -0
- package/src/navigation-breadcrumbs.css.ts +22 -0
- package/src/navigation-breadcrumbs.tsx +69 -0
- package/src/negative-box.tsx +15 -0
- package/src/nestable-context.tsx +139 -0
- package/src/overlay.tsx +86 -0
- package/src/overscroll-color-context.tsx +141 -0
- package/src/package-version.tsx +2 -0
- package/src/password-field.tsx +126 -0
- package/src/phone-number-field-lite.tsx +265 -0
- package/src/phone-number-field.tsx +171 -0
- package/src/pin-field.css.ts +90 -0
- package/src/pin-field.tsx +346 -0
- package/src/placeholder.tsx +41 -0
- package/src/popover.css.ts +8 -0
- package/src/popover.tsx +85 -0
- package/src/portal.tsx +43 -0
- package/src/progress-bar.css.ts +61 -0
- package/src/progress-bar.tsx +174 -0
- package/src/radio-button.css.ts +174 -0
- package/src/radio-button.tsx +322 -0
- package/src/rating.css.ts +128 -0
- package/src/rating.tsx +351 -0
- package/src/responsive-layout.css.ts +162 -0
- package/src/responsive-layout.tsx +106 -0
- package/src/screen-reader-only.css.ts +27 -0
- package/src/screen-reader-only.tsx +33 -0
- package/src/screen-size-context-provider.tsx +96 -0
- package/src/screen-size-context.tsx +23 -0
- package/src/search-field.tsx +126 -0
- package/src/select.css.ts +226 -0
- package/src/select.tsx +513 -0
- package/src/sheet-action-row.css.ts +33 -0
- package/src/sheet-actions-list.tsx +113 -0
- package/src/sheet-actions.tsx +95 -0
- package/src/sheet-common.css.ts +254 -0
- package/src/sheet-common.tsx +402 -0
- package/src/sheet-info.css.ts +19 -0
- package/src/sheet-info.tsx +127 -0
- package/src/sheet-native.tsx +189 -0
- package/src/sheet-radio-list.tsx +118 -0
- package/src/sheet-root.tsx +127 -0
- package/src/sheet-types.tsx +94 -0
- package/src/sheet-web.tsx +140 -0
- package/src/skeleton-base.tsx +38 -0
- package/src/skeletons.css.ts +56 -0
- package/src/skeletons.tsx +133 -0
- package/src/skins/blau.tsx +724 -0
- package/src/skins/constants.tsx +10 -0
- package/src/skins/defaults.tsx +104 -0
- package/src/skins/esimflag.tsx +728 -0
- package/src/skins/movistar-new.tsx +735 -0
- package/src/skins/movistar.tsx +740 -0
- package/src/skins/o2-new.tsx +731 -0
- package/src/skins/o2.tsx +727 -0
- package/src/skins/skin-contract.css.ts +380 -0
- package/src/skins/telefonica.tsx +768 -0
- package/src/skins/tu.tsx +741 -0
- package/src/skins/types/colors.tsx +286 -0
- package/src/skins/types/index.tsx +153 -0
- package/src/skins/utils.tsx +66 -0
- package/src/skins/vivo-new.tsx +745 -0
- package/src/skins/vivo.tsx +720 -0
- package/src/skip-link.css.ts +34 -0
- package/src/skip-link.tsx +52 -0
- package/src/slider.css.ts +181 -0
- package/src/slider.tsx +384 -0
- package/src/snackbar-context.tsx +98 -0
- package/src/snackbar-native.ts +37 -0
- package/src/snackbar.css.ts +176 -0
- package/src/snackbar.tsx +258 -0
- package/src/spinner.css.ts +66 -0
- package/src/spinner.tsx +136 -0
- package/src/sprinkles.css.ts +83 -0
- package/src/square.css.ts +15 -0
- package/src/square.tsx +55 -0
- package/src/stack.css.ts +44 -0
- package/src/stack.tsx +79 -0
- package/src/stacking-group.css.ts +15 -0
- package/src/stacking-group.tsx +82 -0
- package/src/stepper.css.ts +233 -0
- package/src/stepper.tsx +156 -0
- package/src/switch-component.css.ts +181 -0
- package/src/switch-component.tsx +187 -0
- package/src/tab-focus.tsx +68 -0
- package/src/table-actions-header.tsx +21 -0
- package/src/table-cell-text.tsx +35 -0
- package/src/table.css.ts +297 -0
- package/src/table.tsx +398 -0
- package/src/tabs.css.ts +212 -0
- package/src/tabs.tsx +263 -0
- package/src/tag.css.ts +42 -0
- package/src/tag.tsx +161 -0
- package/src/test-utils/environment/setup-ssr.tsx +10 -0
- package/src/test-utils/fail-test-on-console-error.tsx +22 -0
- package/src/test-utils/index.tsx +341 -0
- package/src/test-utils/setup-ssr-test-env.tsx +13 -0
- package/src/test-utils/ssr.tsx +197 -0
- package/src/text-field-base.css.ts +416 -0
- package/src/text-field-base.tsx +628 -0
- package/src/text-field-components.css.ts +165 -0
- package/src/text-field-components.tsx +230 -0
- package/src/text-field.tsx +118 -0
- package/src/text-link.css.ts +83 -0
- package/src/text-link.tsx +85 -0
- package/src/text-tokens.tsx +708 -0
- package/src/text.css.ts +60 -0
- package/src/text.tsx +516 -0
- package/src/theme-context-provider.tsx +370 -0
- package/src/theme-context.css.ts +3 -0
- package/src/theme-context.tsx +8 -0
- package/src/theme-variant-context.tsx +51 -0
- package/src/theme.tsx +184 -0
- package/src/time-field.tsx +99 -0
- package/src/timeline.css.ts +135 -0
- package/src/timeline.tsx +250 -0
- package/src/timer.css.ts +99 -0
- package/src/timer.tsx +420 -0
- package/src/title.tsx +119 -0
- package/src/tooltip-context-provider.tsx +57 -0
- package/src/tooltip.css.ts +106 -0
- package/src/tooltip.tsx +649 -0
- package/src/touchable.css.ts +56 -0
- package/src/touchable.tsx +355 -0
- package/src/types/font-face.d.ts +47 -0
- package/src/types/libs.d.ts +3 -0
- package/src/utils/__tests__/analytics-test.tsx +35 -0
- package/src/utils/__tests__/browser-test.tsx +28 -0
- package/src/utils/__tests__/dom-test.tsx +23 -0
- package/src/utils/__tests__/helpers-test.tsx +166 -0
- package/src/utils/analytics.tsx +28 -0
- package/src/utils/animation.tsx +201 -0
- package/src/utils/aspect-ratio-support.css.ts +28 -0
- package/src/utils/aspect-ratio-support.tsx +141 -0
- package/src/utils/browser.tsx +9 -0
- package/src/utils/color.tsx +46 -0
- package/src/utils/common.tsx +27 -0
- package/src/utils/credit-card.tsx +46 -0
- package/src/utils/css.tsx +25 -0
- package/src/utils/document-visibility.tsx +52 -0
- package/src/utils/dom.tsx +155 -0
- package/src/utils/environment.tsx +6 -0
- package/src/utils/headings.tsx +18 -0
- package/src/utils/helpers.tsx +182 -0
- package/src/utils/keys.tsx +8 -0
- package/src/utils/locale.tsx +27 -0
- package/src/utils/platform.tsx +94 -0
- package/src/utils/region-code.tsx +1 -0
- package/src/utils/renders-element.tsx +6 -0
- package/src/utils/time.tsx +22 -0
- package/src/utils/types.tsx +19 -0
- package/src/utils/utility-types.tsx +8 -0
- package/src/video.css.ts +11 -0
- package/src/video.tsx +355 -0
- package/src/vivinho-loading-animation/in-lottie.json +402 -0
- package/src/vivinho-loading-animation/index.tsx +90 -0
- package/src/vivinho-loading-animation/out-lottie.json +575 -0
- package/src/vivinho-loading-animation/pulse-lottie.json +551 -0
- package/src/vivinho-loading-animation/vivinho-loading-animation.css.ts +15 -0
- package/src/vivinho-loading-animation/wave-lottie.json +2829 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import {createVar, style, styleVariants} from '@vanilla-extract/css';
|
|
2
|
+
import {sprinkles} from '../sprinkles.css';
|
|
3
|
+
import * as mq from '../media-queries.css';
|
|
4
|
+
import {vars as skinVars} from '../skins/skin-contract.css';
|
|
5
|
+
import {applyAlpha} from '../utils/color';
|
|
6
|
+
import {iconContainerSize} from '../icon-button.css';
|
|
7
|
+
|
|
8
|
+
const horizontalPadding = 24;
|
|
9
|
+
|
|
10
|
+
export const container = sprinkles({
|
|
11
|
+
position: 'relative',
|
|
12
|
+
height: '100%',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const paddingX = style([
|
|
16
|
+
sprinkles({
|
|
17
|
+
paddingX: 16,
|
|
18
|
+
}),
|
|
19
|
+
{
|
|
20
|
+
'@media': {
|
|
21
|
+
[mq.desktopOrBigger]: {
|
|
22
|
+
paddingLeft: horizontalPadding,
|
|
23
|
+
paddingRight: horizontalPadding,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
export const actions = style([
|
|
30
|
+
paddingX,
|
|
31
|
+
sprinkles({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
justifyContent: 'space-between',
|
|
34
|
+
paddingBottom: 24,
|
|
35
|
+
}),
|
|
36
|
+
{
|
|
37
|
+
flexWrap: 'wrap',
|
|
38
|
+
'@media': {
|
|
39
|
+
[mq.tabletOrBigger]: {
|
|
40
|
+
marginTop: 8,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
export const touchable = style({
|
|
47
|
+
display: 'flex',
|
|
48
|
+
flex: 1,
|
|
49
|
+
position: 'relative',
|
|
50
|
+
flexDirection: 'column',
|
|
51
|
+
width: '100%',
|
|
52
|
+
height: '100%',
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const touchableCardHoverOverlay = style({
|
|
56
|
+
height: '100%',
|
|
57
|
+
width: '100%',
|
|
58
|
+
pointerEvents: 'none',
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
backgroundColor: 'transparent',
|
|
61
|
+
transition: 'background-color 0.1s ease-in-out',
|
|
62
|
+
selectors: {
|
|
63
|
+
[`${touchable}:active &`]: {
|
|
64
|
+
backgroundColor: skinVars.colors.backgroundContainerPressed,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
'@media': {
|
|
68
|
+
[mq.supportsHover]: {
|
|
69
|
+
selectors: {
|
|
70
|
+
[`${touchable}:hover &`]: {
|
|
71
|
+
backgroundColor: skinVars.colors.backgroundContainerHover,
|
|
72
|
+
},
|
|
73
|
+
[`${touchable}:active &`]: {
|
|
74
|
+
backgroundColor: skinVars.colors.backgroundContainerPressed,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
[mq.touchableOnly]: {
|
|
79
|
+
transition: 'none',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const cardContentStyle = style([
|
|
85
|
+
paddingX,
|
|
86
|
+
sprinkles({
|
|
87
|
+
paddingTop: 8,
|
|
88
|
+
paddingBottom: 24,
|
|
89
|
+
}),
|
|
90
|
+
{
|
|
91
|
+
'@media': {
|
|
92
|
+
[mq.desktopOrBigger]: {
|
|
93
|
+
paddingTop: 32,
|
|
94
|
+
paddingBottom: 32,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
]);
|
|
99
|
+
|
|
100
|
+
export const extra = style([sprinkles({paddingTop: 16, paddingBottom: 24, width: '100%'}), {zIndex: -1}]);
|
|
101
|
+
|
|
102
|
+
export const MIN_HEIGHT = 216;
|
|
103
|
+
export const minHeight = style({minHeight: MIN_HEIGHT});
|
|
104
|
+
|
|
105
|
+
export const dataCard = style([
|
|
106
|
+
{
|
|
107
|
+
isolation: 'isolate', // This avoids problems with some screenshot tests in webapp
|
|
108
|
+
},
|
|
109
|
+
sprinkles({
|
|
110
|
+
position: 'relative',
|
|
111
|
+
display: 'flex',
|
|
112
|
+
flex: 1,
|
|
113
|
+
flexDirection: 'column',
|
|
114
|
+
}),
|
|
115
|
+
]);
|
|
116
|
+
|
|
117
|
+
const cardActionBase = sprinkles({
|
|
118
|
+
width: 32,
|
|
119
|
+
height: 32,
|
|
120
|
+
display: 'flex',
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
borderRadius: '50%',
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export const cardActionIconButton = sprinkles({
|
|
127
|
+
display: 'flex',
|
|
128
|
+
width: 48,
|
|
129
|
+
height: 48,
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
justifyContent: 'center',
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export const cardAction = style([
|
|
135
|
+
cardActionBase,
|
|
136
|
+
{
|
|
137
|
+
background: skinVars.colors.backgroundContainer,
|
|
138
|
+
transition: 'background-color 0.1s ease-in-out',
|
|
139
|
+
'@media': {
|
|
140
|
+
[mq.supportsHover]: {
|
|
141
|
+
':hover': {
|
|
142
|
+
background: skinVars.colors.backgroundAlternative,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
[mq.touchableOnly]: {
|
|
146
|
+
transition: 'none',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
]);
|
|
151
|
+
|
|
152
|
+
export const cardActionInverse = style([
|
|
153
|
+
cardActionBase,
|
|
154
|
+
{
|
|
155
|
+
background: applyAlpha(skinVars.rawColors.backgroundContainer, 0.7),
|
|
156
|
+
transition: 'background-color 0.1s ease-in-out',
|
|
157
|
+
'@media': {
|
|
158
|
+
[mq.supportsHover]: {
|
|
159
|
+
':hover': {
|
|
160
|
+
background: applyAlpha(skinVars.rawColors.backgroundContainer, 0.9),
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
[mq.touchableOnly]: {
|
|
164
|
+
transition: 'none',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
]);
|
|
169
|
+
|
|
170
|
+
export const divider = style({
|
|
171
|
+
marginLeft: -horizontalPadding,
|
|
172
|
+
marginRight: -horizontalPadding,
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
export const footerText = sprinkles({
|
|
176
|
+
display: 'flex',
|
|
177
|
+
flex: 1,
|
|
178
|
+
alignItems: 'center',
|
|
179
|
+
minHeight: 40,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
export const actionsVariants = styleVariants({
|
|
183
|
+
default: [
|
|
184
|
+
{
|
|
185
|
+
flexDirection: 'row',
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
mobile: [
|
|
190
|
+
{
|
|
191
|
+
'@media': {
|
|
192
|
+
[mq.mobile]: {
|
|
193
|
+
flexDirection: 'column',
|
|
194
|
+
alignItems: 'start',
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
export const marginRightAuto = style({
|
|
202
|
+
marginTop: 8,
|
|
203
|
+
'@media': {
|
|
204
|
+
[mq.mobile]: {
|
|
205
|
+
marginRight: 'auto',
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
export const withPaddingTop = sprinkles({
|
|
211
|
+
paddingTop: 16,
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
export const button = style({
|
|
215
|
+
display: 'flex',
|
|
216
|
+
marginTop: 8,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
export const buttonMobile = style([
|
|
220
|
+
button,
|
|
221
|
+
{
|
|
222
|
+
'@media': {
|
|
223
|
+
[mq.mobile]: {
|
|
224
|
+
marginTop: 16,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
]);
|
|
229
|
+
|
|
230
|
+
export const footerImage = sprinkles({alignItems: 'center', display: 'flex', paddingRight: 16});
|
|
231
|
+
|
|
232
|
+
export const footerDirection = style([
|
|
233
|
+
sprinkles({
|
|
234
|
+
display: 'flex',
|
|
235
|
+
flexDirection: 'row',
|
|
236
|
+
}),
|
|
237
|
+
{flexWrap: 'wrap'},
|
|
238
|
+
]);
|
|
239
|
+
|
|
240
|
+
export const adjustButtonLink = style({
|
|
241
|
+
position: 'relative',
|
|
242
|
+
marginLeft: -12,
|
|
243
|
+
marginRight: -12,
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
export const marginRightButton = style({
|
|
247
|
+
marginRight: 16,
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const topActionsCount = createVar();
|
|
251
|
+
|
|
252
|
+
export const vars = {topActionsCount};
|
|
253
|
+
|
|
254
|
+
export const topActionsWithoutIcon = style({
|
|
255
|
+
/** Move the div to match the card border, ignoring content's padding. We add one extra pixel because of border's width */
|
|
256
|
+
marginRight: -17,
|
|
257
|
+
marginTop: -1,
|
|
258
|
+
width: `calc((${iconContainerSize.small} + 16px) * ${topActionsCount})`,
|
|
259
|
+
|
|
260
|
+
'@media': {
|
|
261
|
+
[mq.desktopOrBigger]: {
|
|
262
|
+
marginRight: -25,
|
|
263
|
+
marginTop: -25,
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
export const flexColumn = style({
|
|
269
|
+
display: 'flex',
|
|
270
|
+
flexDirection: 'column',
|
|
271
|
+
});
|
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
// https://www.figma.com/file/35iS2dwoogulJZPgFGKmCX/Explora%C3%A7%C3%A3o-Data-Card-%2F-Slots?type=design&node-id=443-32508&mode=design&t=wwoi2TRLVsjwGYAb-0
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import {Boxed} from '../boxed';
|
|
6
|
+
import Stack from '../stack';
|
|
7
|
+
import * as styles from './advanced-data-card.css';
|
|
8
|
+
import * as mediaStyles from '../image.css';
|
|
9
|
+
import Divider from '../divider';
|
|
10
|
+
import {Text2, Text, useTextPresetSizes} from '../text';
|
|
11
|
+
import {vars} from '../skins/skin-contract.css';
|
|
12
|
+
import Box from '../box';
|
|
13
|
+
import Touchable from '../touchable';
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
import {useInnerText, useTheme} from '../hooks';
|
|
16
|
+
import {getPrefixedDataAttributes} from '../utils/dom';
|
|
17
|
+
import Inline from '../inline';
|
|
18
|
+
import {applyCssVars} from '../utils/css';
|
|
19
|
+
import Tag from '../tag';
|
|
20
|
+
import {isBiggerHeading} from '../utils/headings';
|
|
21
|
+
import {TopActions} from '../card-internal';
|
|
22
|
+
|
|
23
|
+
import type {CardAction} from '../card-internal';
|
|
24
|
+
import type {PressHandler} from '../touchable';
|
|
25
|
+
import type {ExclusifyUnion} from '../utils/utility-types';
|
|
26
|
+
import type StackingGroup from '../stacking-group';
|
|
27
|
+
import type Image from '../image';
|
|
28
|
+
import type {ButtonPrimary, ButtonLink} from '../button';
|
|
29
|
+
import type {DataAttributes, HeadingType, TrackingEvent} from '../utils/types';
|
|
30
|
+
import type {RendersNullableElement} from '../utils/renders-element';
|
|
31
|
+
import type {
|
|
32
|
+
HighlightedValueBlock,
|
|
33
|
+
InformationBlock,
|
|
34
|
+
ProgressBlock,
|
|
35
|
+
RowBlock,
|
|
36
|
+
SimpleBlock,
|
|
37
|
+
ValueBlock,
|
|
38
|
+
} from './blocks';
|
|
39
|
+
|
|
40
|
+
type TouchableProps = {
|
|
41
|
+
trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
|
|
42
|
+
role?: string;
|
|
43
|
+
} & ExclusifyUnion<
|
|
44
|
+
| {
|
|
45
|
+
href: string | undefined;
|
|
46
|
+
newTab?: boolean;
|
|
47
|
+
}
|
|
48
|
+
| {
|
|
49
|
+
to: string | undefined;
|
|
50
|
+
newTab?: boolean;
|
|
51
|
+
fullPageOnWebView?: boolean;
|
|
52
|
+
}
|
|
53
|
+
| {
|
|
54
|
+
onPress: PressHandler | undefined;
|
|
55
|
+
}
|
|
56
|
+
>;
|
|
57
|
+
type TouchableCard<T> = T & TouchableProps;
|
|
58
|
+
type MaybeTouchableCard<T> = ExclusifyUnion<TouchableCard<T> | T>;
|
|
59
|
+
|
|
60
|
+
type CardContentProps = {
|
|
61
|
+
headline?: string | RendersNullableElement<typeof Tag>;
|
|
62
|
+
headlineRef?: (instance: HTMLElement | null) => void;
|
|
63
|
+
pretitle?: string;
|
|
64
|
+
pretitleAs?: HeadingType;
|
|
65
|
+
pretitleLinesMax?: number;
|
|
66
|
+
title?: string;
|
|
67
|
+
titleAs: HeadingType;
|
|
68
|
+
titleLinesMax?: number;
|
|
69
|
+
subtitle?: string;
|
|
70
|
+
subtitleLinesMax?: number;
|
|
71
|
+
description?: string;
|
|
72
|
+
descriptionLinesMax?: number;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const CardContent = ({
|
|
76
|
+
headline,
|
|
77
|
+
headlineRef,
|
|
78
|
+
pretitle,
|
|
79
|
+
pretitleAs,
|
|
80
|
+
pretitleLinesMax,
|
|
81
|
+
title,
|
|
82
|
+
titleAs,
|
|
83
|
+
titleLinesMax,
|
|
84
|
+
subtitle,
|
|
85
|
+
subtitleLinesMax,
|
|
86
|
+
description,
|
|
87
|
+
descriptionLinesMax,
|
|
88
|
+
}: CardContentProps) => {
|
|
89
|
+
const {textPresets} = useTheme();
|
|
90
|
+
const text4Sizes = useTextPresetSizes('text4');
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
/** using flex instead of nested Stacks, this way we can rearrange texts so the DOM structure makes more sense for screen reader users */
|
|
94
|
+
<div className={styles.flexColumn}>
|
|
95
|
+
{isBiggerHeading(titleAs, pretitleAs) ? (
|
|
96
|
+
<>
|
|
97
|
+
{title && (
|
|
98
|
+
<div style={{paddingBottom: subtitle || description ? 4 : 0}}>
|
|
99
|
+
<Text
|
|
100
|
+
{...text4Sizes}
|
|
101
|
+
truncate={titleLinesMax}
|
|
102
|
+
weight={textPresets.cardTitle.weight}
|
|
103
|
+
as={titleAs}
|
|
104
|
+
hyphens="auto"
|
|
105
|
+
>
|
|
106
|
+
{title}
|
|
107
|
+
</Text>
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
{headline && (
|
|
111
|
+
<div
|
|
112
|
+
ref={headlineRef}
|
|
113
|
+
style={{
|
|
114
|
+
order: -2,
|
|
115
|
+
paddingBottom: pretitle || title || subtitle || description ? 4 : 0,
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{typeof headline === 'string' ? <Tag type="promo">{headline}</Tag> : headline}
|
|
119
|
+
</div>
|
|
120
|
+
)}
|
|
121
|
+
{pretitle && (
|
|
122
|
+
<div style={{order: -1, paddingBottom: title || subtitle || description ? 4 : 0}}>
|
|
123
|
+
<Text2 truncate={pretitleLinesMax} as={pretitleAs} regular hyphens="auto">
|
|
124
|
+
{pretitle}
|
|
125
|
+
</Text2>
|
|
126
|
+
</div>
|
|
127
|
+
)}
|
|
128
|
+
</>
|
|
129
|
+
) : (
|
|
130
|
+
<>
|
|
131
|
+
{pretitle && (
|
|
132
|
+
<div style={{paddingBottom: title || subtitle || description ? 4 : 0}}>
|
|
133
|
+
<Text2 truncate={pretitleLinesMax} as={pretitleAs} regular hyphens="auto">
|
|
134
|
+
{pretitle}
|
|
135
|
+
</Text2>
|
|
136
|
+
</div>
|
|
137
|
+
)}
|
|
138
|
+
{headline && (
|
|
139
|
+
<div
|
|
140
|
+
ref={headlineRef}
|
|
141
|
+
style={{
|
|
142
|
+
order: -1,
|
|
143
|
+
paddingBottom: pretitle || title || subtitle || description ? 4 : 0,
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
{typeof headline === 'string' ? <Tag type="promo">{headline}</Tag> : headline}
|
|
147
|
+
</div>
|
|
148
|
+
)}
|
|
149
|
+
{title && (
|
|
150
|
+
<div style={{paddingBottom: subtitle || description ? 4 : 0}}>
|
|
151
|
+
<Text
|
|
152
|
+
{...text4Sizes}
|
|
153
|
+
truncate={titleLinesMax}
|
|
154
|
+
weight={textPresets.cardTitle.weight}
|
|
155
|
+
as={titleAs}
|
|
156
|
+
hyphens="auto"
|
|
157
|
+
>
|
|
158
|
+
{title}
|
|
159
|
+
</Text>
|
|
160
|
+
</div>
|
|
161
|
+
)}
|
|
162
|
+
</>
|
|
163
|
+
)}
|
|
164
|
+
{subtitle && (
|
|
165
|
+
<div style={{paddingBottom: description ? 4 : 0}}>
|
|
166
|
+
<Text2 truncate={subtitleLinesMax} as="div" regular hyphens="auto">
|
|
167
|
+
{subtitle}
|
|
168
|
+
</Text2>
|
|
169
|
+
</div>
|
|
170
|
+
)}
|
|
171
|
+
{description && (
|
|
172
|
+
<Text2
|
|
173
|
+
truncate={descriptionLinesMax}
|
|
174
|
+
as="div"
|
|
175
|
+
regular
|
|
176
|
+
color={vars.colors.textSecondary}
|
|
177
|
+
hyphens="auto"
|
|
178
|
+
>
|
|
179
|
+
{description}
|
|
180
|
+
</Text2>
|
|
181
|
+
)}
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
type CardFooterProps = {
|
|
187
|
+
button?: RendersNullableElement<typeof ButtonPrimary>;
|
|
188
|
+
footerImage?: RendersNullableElement<typeof Image>;
|
|
189
|
+
footerText?: string;
|
|
190
|
+
footerTextLinesMax?: number;
|
|
191
|
+
buttonLink?: RendersNullableElement<typeof ButtonLink>;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const CardFooter = ({button, footerImage, footerText, footerTextLinesMax, buttonLink}: CardFooterProps) => {
|
|
195
|
+
const hasButton = !!button;
|
|
196
|
+
const hasFooterImage = !!footerImage;
|
|
197
|
+
const hasFooterText = !!footerText;
|
|
198
|
+
const hasButtonLink = !!buttonLink;
|
|
199
|
+
const hasAllItens = hasButton && (hasFooterImage || hasFooterText) && hasButtonLink;
|
|
200
|
+
|
|
201
|
+
const maxWidth = hasButtonLink && !hasAllItens ? '178px' : '';
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<>
|
|
205
|
+
<div className={styles.divider}>
|
|
206
|
+
<Divider />
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<div
|
|
210
|
+
className={classNames(
|
|
211
|
+
styles.actions,
|
|
212
|
+
styles.actionsVariants[hasAllItens ? 'mobile' : 'default']
|
|
213
|
+
)}
|
|
214
|
+
>
|
|
215
|
+
{hasButton && (
|
|
216
|
+
<div className={classNames(styles.marginRightButton, styles.buttonMobile)}>{button}</div>
|
|
217
|
+
)}
|
|
218
|
+
<div
|
|
219
|
+
className={classNames(
|
|
220
|
+
styles.footerDirection,
|
|
221
|
+
hasAllItens ? styles.marginRightAuto : styles.withPaddingTop
|
|
222
|
+
)}
|
|
223
|
+
>
|
|
224
|
+
{hasFooterImage && (
|
|
225
|
+
<div className={styles.footerImage}>
|
|
226
|
+
<div
|
|
227
|
+
style={applyCssVars({
|
|
228
|
+
[mediaStyles.vars.mediaBorderRadius]: vars.borderRadii.mediaSmall,
|
|
229
|
+
})}
|
|
230
|
+
>
|
|
231
|
+
{footerImage}
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
)}
|
|
235
|
+
|
|
236
|
+
{hasFooterText && (
|
|
237
|
+
<div style={{maxWidth}} className={styles.footerText}>
|
|
238
|
+
<Text2 truncate={footerTextLinesMax} regular>
|
|
239
|
+
{footerText}
|
|
240
|
+
</Text2>
|
|
241
|
+
</div>
|
|
242
|
+
)}
|
|
243
|
+
</div>
|
|
244
|
+
{hasButtonLink && (
|
|
245
|
+
<div
|
|
246
|
+
className={classNames(
|
|
247
|
+
styles.adjustButtonLink,
|
|
248
|
+
hasAllItens ? styles.button : styles.buttonMobile
|
|
249
|
+
)}
|
|
250
|
+
>
|
|
251
|
+
{buttonLink}
|
|
252
|
+
</div>
|
|
253
|
+
)}
|
|
254
|
+
</div>
|
|
255
|
+
</>
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
type AllowedExtra =
|
|
260
|
+
| typeof StackingGroup
|
|
261
|
+
| typeof HighlightedValueBlock
|
|
262
|
+
| typeof InformationBlock
|
|
263
|
+
| typeof ProgressBlock
|
|
264
|
+
| typeof RowBlock
|
|
265
|
+
| typeof SimpleBlock
|
|
266
|
+
| typeof ValueBlock;
|
|
267
|
+
|
|
268
|
+
type AdvancedDataCardProps = MaybeTouchableCard<{
|
|
269
|
+
stackingGroup?: RendersNullableElement<typeof StackingGroup>;
|
|
270
|
+
headline?: RendersNullableElement<typeof Tag>;
|
|
271
|
+
pretitle?: string;
|
|
272
|
+
pretitleLinesMax?: number;
|
|
273
|
+
pretitleAs?: HeadingType;
|
|
274
|
+
title?: string;
|
|
275
|
+
titleLinesMax?: number;
|
|
276
|
+
titleAs?: HeadingType;
|
|
277
|
+
subtitle?: string;
|
|
278
|
+
subtitleLinesMax?: number;
|
|
279
|
+
description?: string;
|
|
280
|
+
descriptionLinesMax?: number;
|
|
281
|
+
extra?: ReadonlyArray<RendersNullableElement<AllowedExtra>>;
|
|
282
|
+
extraDividerPadding?: 8 | 16 | 24;
|
|
283
|
+
noExtraDivider?: boolean;
|
|
284
|
+
button?: RendersNullableElement<typeof ButtonPrimary>;
|
|
285
|
+
footerImage?: RendersNullableElement<typeof Image>;
|
|
286
|
+
footerText?: string;
|
|
287
|
+
footerTextLinesMax?: number;
|
|
288
|
+
buttonLink?: RendersNullableElement<typeof ButtonLink>;
|
|
289
|
+
dataAttributes?: DataAttributes;
|
|
290
|
+
actions?: ReadonlyArray<CardAction | React.ReactElement>;
|
|
291
|
+
'aria-label'?: string;
|
|
292
|
+
onClose?: () => void;
|
|
293
|
+
}>;
|
|
294
|
+
|
|
295
|
+
export const AdvancedDataCard = React.forwardRef<HTMLDivElement, AdvancedDataCardProps>(
|
|
296
|
+
(
|
|
297
|
+
{
|
|
298
|
+
stackingGroup,
|
|
299
|
+
headline,
|
|
300
|
+
pretitle,
|
|
301
|
+
pretitleAs,
|
|
302
|
+
pretitleLinesMax,
|
|
303
|
+
title,
|
|
304
|
+
titleAs = 'h3',
|
|
305
|
+
titleLinesMax,
|
|
306
|
+
subtitle,
|
|
307
|
+
subtitleLinesMax,
|
|
308
|
+
description,
|
|
309
|
+
descriptionLinesMax,
|
|
310
|
+
|
|
311
|
+
extra,
|
|
312
|
+
extraDividerPadding = 24,
|
|
313
|
+
noExtraDivider = false,
|
|
314
|
+
|
|
315
|
+
button,
|
|
316
|
+
footerImage,
|
|
317
|
+
footerText,
|
|
318
|
+
footerTextLinesMax,
|
|
319
|
+
buttonLink,
|
|
320
|
+
|
|
321
|
+
dataAttributes,
|
|
322
|
+
actions,
|
|
323
|
+
'aria-label': ariaLabelProp,
|
|
324
|
+
onClose,
|
|
325
|
+
...touchableProps
|
|
326
|
+
},
|
|
327
|
+
ref
|
|
328
|
+
) => {
|
|
329
|
+
const isTouchable = !!touchableProps.href || !!touchableProps.onPress || !!touchableProps.to;
|
|
330
|
+
|
|
331
|
+
const footerProps = {button, footerImage, footerText, footerTextLinesMax, buttonLink};
|
|
332
|
+
|
|
333
|
+
const hasFooter = !!button || !!footerImage || !!footerText || !!buttonLink;
|
|
334
|
+
const hasExtras = !!extra?.length;
|
|
335
|
+
|
|
336
|
+
const topActionsCount = (actions?.length || 0) + (onClose ? 1 : 0);
|
|
337
|
+
|
|
338
|
+
const {text: headlineText, ref: headlineRef} = useInnerText();
|
|
339
|
+
const {text: extraText, ref: extraRef} = useInnerText();
|
|
340
|
+
|
|
341
|
+
const ariaLabel =
|
|
342
|
+
ariaLabelProp ||
|
|
343
|
+
(isBiggerHeading(titleAs, pretitleAs)
|
|
344
|
+
? [title, headlineText, pretitle, subtitle, description, extraText]
|
|
345
|
+
: [pretitle, headlineText, title, subtitle, description, extraText]
|
|
346
|
+
)
|
|
347
|
+
.filter(Boolean)
|
|
348
|
+
.join(' ');
|
|
349
|
+
|
|
350
|
+
return (
|
|
351
|
+
<section
|
|
352
|
+
className={styles.container}
|
|
353
|
+
{...getPrefixedDataAttributes(dataAttributes, 'AdvancedDataCard')}
|
|
354
|
+
ref={ref}
|
|
355
|
+
aria-label={isTouchable ? undefined : ariaLabel}
|
|
356
|
+
>
|
|
357
|
+
<Boxed className={styles.dataCard} width="100%" height="100%" minHeight={styles.MIN_HEIGHT}>
|
|
358
|
+
<Touchable
|
|
359
|
+
maybe
|
|
360
|
+
{...touchableProps}
|
|
361
|
+
aria-label={isTouchable ? ariaLabel : undefined}
|
|
362
|
+
className={styles.touchable}
|
|
363
|
+
>
|
|
364
|
+
{isTouchable && <div className={styles.touchableCardHoverOverlay} />}
|
|
365
|
+
|
|
366
|
+
<div
|
|
367
|
+
className={classNames(
|
|
368
|
+
styles.cardContentStyle,
|
|
369
|
+
!hasFooter && !hasExtras ? styles.minHeight : ''
|
|
370
|
+
)}
|
|
371
|
+
aria-hidden={isTouchable}
|
|
372
|
+
>
|
|
373
|
+
<Box paddingTop={8}>
|
|
374
|
+
<Inline space={0}>
|
|
375
|
+
<Stack space={8}>
|
|
376
|
+
{stackingGroup}
|
|
377
|
+
<CardContent
|
|
378
|
+
headline={headline}
|
|
379
|
+
headlineRef={headlineRef}
|
|
380
|
+
pretitle={pretitle}
|
|
381
|
+
pretitleAs={pretitleAs}
|
|
382
|
+
pretitleLinesMax={pretitleLinesMax}
|
|
383
|
+
title={title}
|
|
384
|
+
titleAs={titleAs}
|
|
385
|
+
titleLinesMax={titleLinesMax}
|
|
386
|
+
subtitle={subtitle}
|
|
387
|
+
subtitleLinesMax={subtitleLinesMax}
|
|
388
|
+
description={description}
|
|
389
|
+
descriptionLinesMax={descriptionLinesMax}
|
|
390
|
+
/>
|
|
391
|
+
</Stack>
|
|
392
|
+
{/** Hack to avoid content from rendering on top of the top action buttons */}
|
|
393
|
+
{!stackingGroup && (
|
|
394
|
+
<div
|
|
395
|
+
style={applyCssVars({
|
|
396
|
+
[styles.vars.topActionsCount]: String(topActionsCount),
|
|
397
|
+
})}
|
|
398
|
+
className={styles.topActionsWithoutIcon}
|
|
399
|
+
/>
|
|
400
|
+
)}
|
|
401
|
+
</Inline>
|
|
402
|
+
</Box>
|
|
403
|
+
</div>
|
|
404
|
+
<div style={{flexGrow: 1}} />
|
|
405
|
+
{hasExtras && (
|
|
406
|
+
<div className={styles.extra} ref={extraRef} aria-hidden={isTouchable}>
|
|
407
|
+
{extra.map((item, index) => {
|
|
408
|
+
return (
|
|
409
|
+
<div key={index}>
|
|
410
|
+
<div className={styles.paddingX}>{item}</div>
|
|
411
|
+
|
|
412
|
+
{index + 1 !== extra.length && (
|
|
413
|
+
<Box paddingY={extraDividerPadding}>
|
|
414
|
+
{!noExtraDivider && <Divider />}
|
|
415
|
+
</Box>
|
|
416
|
+
)}
|
|
417
|
+
</div>
|
|
418
|
+
);
|
|
419
|
+
})}
|
|
420
|
+
</div>
|
|
421
|
+
)}
|
|
422
|
+
</Touchable>
|
|
423
|
+
{hasFooter && <CardFooter {...footerProps} />}
|
|
424
|
+
</Boxed>
|
|
425
|
+
<TopActions actions={actions} onClose={onClose} />
|
|
426
|
+
</section>
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
export default AdvancedDataCard;
|