@orangesk/orange-design-system 2.0.0-alpha.0 → 2.0.0-alpha.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/build/404.html +1 -1
- package/build/_next/static/CRhIjUFtohDOfdDfzvfXM/_buildManifest.js +1 -0
- package/build/_next/static/chunks/925.75d0c8afa7ab7cfa.js +1 -0
- package/build/_next/static/chunks/998-a45c3cf6f575e126.js +1 -0
- package/build/_next/static/chunks/app/components/alert/page-d591b03a7394f81e.js +1 -0
- package/build/_next/static/chunks/app/components/button/page-b922a8f5114b0a69.js +1 -0
- package/build/_next/static/chunks/app/components/buttons/page-0a5bf7e5ac7991fb.js +1 -0
- package/build/_next/static/chunks/app/components/icon/page-dac6ba29b85d924d.js +1 -0
- package/build/_next/static/chunks/app/components/modal/page-4a249b6d271eea91.js +1 -0
- package/build/_next/static/chunks/app/components/tabs/page-7d82e8eafd25b86e.js +1 -0
- package/build/_next/static/chunks/app/layout-f74d44a2772d8d63.js +1 -0
- package/build/_next/static/chunks/app/page-9efa16a51ef59461.js +1 -0
- package/build/_next/static/chunks/webpack-623f6e616651e1c0.js +1 -0
- package/build/_next/static/css/14f3a3e0186fb7a8.css +3 -0
- package/build/_next/static/css/168dd2b7e791cf72.css +1 -0
- package/build/_next/static/css/28a41a1d7dcdbfd9.css +1 -0
- package/build/_next/static/css/291602d64f1f3570.css +1 -0
- package/build/_next/static/css/4c4366b3963177f0.css +1 -0
- package/build/_next/static/css/5481aeac9adca710.css +1 -0
- package/build/_next/static/css/73b136688c14b891.css +1 -0
- package/build/_next/static/css/91c8cf755bf9ff19.css +1 -0
- package/build/_next/static/css/c1b0424033f305ff.css +1 -0
- package/build/_next/static/css/eea9fd9ccdd56c76.css +1 -0
- package/build/_next/static/media/671791babd225be4-s.p.woff2 +0 -0
- package/build/_next/static/media/c62d990acddde5f0-s.p.woff2 +0 -0
- package/build/_next/static/media/dfdbb1c4973e0bd7-s.p.woff2 +0 -0
- package/build/components/Accordion/index.js +1170 -0
- package/build/components/Accordion/index.js.map +1 -0
- package/build/components/Accordion/style.css +2 -0
- package/build/components/Accordion/style.css.map +1 -0
- package/build/components/Alert/index.js +1920 -0
- package/build/components/Alert/index.js.map +1 -0
- package/build/components/Alert/style.css +2 -0
- package/build/components/Alert/style.css.map +1 -0
- package/build/components/Badge/index.js +6 -3
- package/build/components/Badge/index.js.map +1 -1
- package/build/components/Badge/style.css +1 -1
- package/build/components/Badge/style.css.map +1 -1
- package/build/components/Breadcrumbs/index.js +687 -0
- package/build/components/Breadcrumbs/index.js.map +1 -0
- package/build/components/Breadcrumbs/style.css +2 -0
- package/build/components/Breadcrumbs/style.css.map +1 -0
- package/build/components/Button/index.js +734 -0
- package/build/components/Button/index.js.map +1 -0
- package/build/components/Button/style.css +2 -0
- package/build/components/Button/style.css.map +1 -0
- package/build/components/Buttons/index.js +614 -0
- package/build/components/Buttons/index.js.map +1 -0
- package/build/components/Buttons/style.css +2 -0
- package/build/components/Buttons/style.css.map +1 -0
- package/build/components/Container/index.js +611 -0
- package/build/components/Container/index.js.map +1 -0
- package/build/components/Container/style.css +2 -0
- package/build/components/Container/style.css.map +1 -0
- package/build/components/Grid/index.js +1082 -0
- package/build/components/Grid/index.js.map +1 -0
- package/build/components/Grid/style.css +2 -0
- package/build/components/Grid/style.css.map +1 -0
- package/build/components/Icon/index.js +628 -0
- package/build/components/Icon/index.js.map +1 -0
- package/build/components/Icon/style.css +2 -0
- package/build/components/Icon/style.css.map +1 -0
- package/build/components/Image/index.js +659 -0
- package/build/components/Image/index.js.map +1 -0
- package/build/components/Image/style.css +2 -0
- package/build/components/Image/style.css.map +1 -0
- package/build/components/Link/index.js +173 -0
- package/build/components/Link/index.js.map +1 -0
- package/build/components/Link/style.css +2 -0
- package/build/components/Link/style.css.map +1 -0
- package/build/components/Modal/index.js +3170 -0
- package/build/components/Modal/index.js.map +1 -0
- package/build/components/Modal/style.css +2 -0
- package/build/components/Modal/style.css.map +1 -0
- package/build/components/Section/index.js +632 -0
- package/build/components/Section/index.js.map +1 -0
- package/build/components/Section/style.css +2 -0
- package/build/components/Section/style.css.map +1 -0
- package/build/components/Tabs/index.js +1056 -0
- package/build/components/Tabs/index.js.map +1 -0
- package/build/components/Tabs/style.css +2 -0
- package/build/components/Tabs/style.css.map +1 -0
- package/build/components/alert.html +2 -0
- package/build/components/alert.txt +30 -0
- package/build/components/badge.html +4 -1
- package/build/components/badge.txt +23 -18
- package/build/components/button.html +2 -0
- package/build/components/button.txt +27 -0
- package/build/components/buttons.html +1 -0
- package/build/components/buttons.txt +27 -0
- package/build/components/icon.html +1 -0
- package/build/components/icon.txt +23 -0
- package/build/components/index.css +1 -1
- package/build/components/index.css.map +1 -1
- package/build/components/index.js +3079 -17
- package/build/components/index.js.map +1 -1
- package/build/components/modal.html +1 -0
- package/build/components/modal.txt +29 -0
- package/build/components/static.js +1261 -17
- package/build/components/static.js.map +1 -1
- package/build/components/tabs.html +1 -0
- package/build/components/tabs.txt +27 -0
- package/build/components/types/components/Alert/Alert.d.ts +25 -0
- package/build/components/types/components/Alert/data.d.ts +7 -0
- package/build/components/types/components/Alert/index.d.ts +2 -0
- package/build/components/types/{Badge → components/Badge}/Badge.d.ts +2 -2
- package/build/components/types/components/Badge/index.d.ts +2 -0
- package/build/components/types/components/Button/Button.d.ts +25 -0
- package/build/components/types/components/Button/IconButton.d.ts +18 -0
- package/build/components/types/components/Button/index.d.ts +17 -0
- package/build/components/types/components/Buttons/Buttons.d.ts +8 -0
- package/build/components/types/components/Buttons/index.d.ts +2 -0
- package/build/components/types/components/Container/Container.d.ts +6 -0
- package/build/components/types/components/Container/index.d.ts +3 -0
- package/build/components/types/components/Icon/Icon.d.ts +18 -0
- package/build/components/types/components/Icon/SpritePathContext.d.ts +8 -0
- package/build/components/types/components/Icon/index.d.ts +3 -0
- package/build/components/types/components/Modal/Modal.d.ts +33 -0
- package/build/components/types/components/Modal/Modal.static.d.ts +33 -0
- package/build/components/types/components/Modal/ModalBody.d.ts +10 -0
- package/build/components/types/components/Modal/ModalCloseButton.d.ts +8 -0
- package/build/components/types/components/Modal/ModalTitle.d.ts +9 -0
- package/build/components/types/components/Modal/index.d.ts +5 -0
- package/build/components/types/components/Section/Section.d.ts +23 -0
- package/build/components/types/components/Section/index.d.ts +2 -0
- package/build/components/types/components/Tabs/Tab.d.ts +13 -0
- package/build/components/types/components/Tabs/TabPanel.d.ts +14 -0
- package/build/components/types/components/Tabs/Tabs.d.ts +33 -0
- package/build/components/types/components/Tabs/Tabs.static.d.ts +28 -0
- package/build/components/types/components/Tabs/index.d.ts +4 -0
- package/build/components/types/components/index.d.ts +11 -0
- package/build/components/types/utils/ConditionalWrapper.d.ts +13 -0
- package/build/components/types/utils/constants.d.ts +18 -0
- package/build/components/types/utils/generateId.d.ts +6 -0
- package/build/components/types/utils/hooks.d.ts +29 -0
- package/build/components/types/utils/keyboard.d.ts +14 -0
- package/build/fonts/HelveticaNeue-Bold.woff2 +0 -0
- package/build/fonts/HelveticaNeue-Light.woff2 +0 -0
- package/build/fonts/HelveticaNeue-Roman.woff2 +0 -0
- package/build/index.html +11 -46
- package/build/index.txt +22 -17
- package/build/lib/after-components.css +1 -1
- package/build/lib/after-components.css.map +1 -1
- package/build/lib/before-components.css +1 -1
- package/build/lib/before-components.css.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/fonts.css +1 -1
- package/build/lib/fonts.css.map +1 -1
- package/build/lib/scripts.js +1261 -17
- package/build/lib/scripts.js.map +1 -1
- package/build/lib/style.css +1 -1
- package/build/lib/style.css.map +1 -1
- package/build/sprite.svg +1 -0
- package/package.json +8 -4
- package/public/fonts/HelveticaNeue-Bold.woff2 +0 -0
- package/public/fonts/HelveticaNeue-Light.woff2 +0 -0
- package/public/fonts/HelveticaNeue-Roman.woff2 +0 -0
- package/src/assets/icons/4g.svg +1 -0
- package/src/assets/icons/5g.svg +1 -0
- package/src/assets/icons/accessibility-mobility.svg +1 -0
- package/src/assets/icons/accessibility-motor.svg +1 -0
- package/src/assets/icons/accessibility-vision.svg +1 -0
- package/src/assets/icons/accessibility.svg +1 -0
- package/src/assets/icons/add.svg +1 -0
- package/src/assets/icons/advertising.svg +1 -0
- package/src/assets/icons/aeroplane.svg +1 -0
- package/src/assets/icons/age-rating-3.svg +1 -0
- package/src/assets/icons/airbox-auto.svg +1 -0
- package/src/assets/icons/alias-numbers.svg +1 -0
- package/src/assets/icons/android-manage.svg +1 -0
- package/src/assets/icons/antenna.svg +1 -0
- package/src/assets/icons/apartment-building.svg +1 -0
- package/src/assets/icons/apps.svg +1 -0
- package/src/assets/icons/assistance.svg +1 -0
- package/src/assets/icons/assistent.svg +1 -0
- package/src/assets/icons/at.svg +1 -0
- package/src/assets/icons/avatar.svg +1 -0
- package/src/assets/icons/backup-internet.svg +1 -0
- package/src/assets/icons/bank.svg +1 -0
- package/src/assets/icons/battery-charging.svg +1 -0
- package/src/assets/icons/battery-full.svg +1 -0
- package/src/assets/icons/battery-status-1-3.svg +1 -0
- package/src/assets/icons/battery-status-charging.svg +1 -0
- package/src/assets/icons/battery-status-full.svg +1 -0
- package/src/assets/icons/bed.svg +1 -0
- package/src/assets/icons/birth.svg +1 -0
- package/src/assets/icons/birthday.svg +1 -0
- package/src/assets/icons/bluetooth.svg +1 -0
- package/src/assets/icons/boarding-pass.svg +1 -0
- package/src/assets/icons/book-award.svg +1 -0
- package/src/assets/icons/book.svg +1 -0
- package/src/assets/icons/boxes.svg +1 -0
- package/src/assets/icons/briefcase.svg +1 -0
- package/src/assets/icons/browser-plug-in.svg +1 -0
- package/src/assets/icons/business-advisor.svg +1 -0
- package/src/assets/icons/business-consultant.svg +1 -0
- package/src/assets/icons/business-lounge.svg +1 -0
- package/src/assets/icons/buy.svg +1 -0
- package/src/assets/icons/calendar-30.svg +1 -0
- package/src/assets/icons/calendar-alarm.svg +1 -0
- package/src/assets/icons/calendar-day.svg +1 -0
- package/src/assets/icons/calendar-month.svg +1 -0
- package/src/assets/icons/call-in.svg +1 -0
- package/src/assets/icons/call-out.svg +1 -0
- package/src/assets/icons/call.svg +1 -0
- package/src/assets/icons/camera.svg +1 -0
- package/src/assets/icons/car-park.svg +1 -0
- package/src/assets/icons/car.svg +1 -0
- package/src/assets/icons/card-reader.svg +1 -0
- package/src/assets/icons/casting.svg +1 -0
- package/src/assets/icons/cest-ici.svg +1 -0
- package/src/assets/icons/charger.svg +1 -0
- package/src/assets/icons/chatbot.svg +1 -0
- package/src/assets/icons/check-your-balance.svg +1 -0
- package/src/assets/icons/checked.svg +1 -0
- package/src/assets/icons/chevron-down.svg +1 -0
- package/src/assets/icons/chevron-end.svg +1 -0
- package/src/assets/icons/chevron-left.svg +1 -0
- package/src/assets/icons/chevron-right.svg +1 -0
- package/src/assets/icons/chevron-start.svg +1 -0
- package/src/assets/icons/chevron-up.svg +1 -0
- package/src/assets/icons/child.svg +1 -0
- package/src/assets/icons/children-channel.svg +1 -0
- package/src/assets/icons/childrens-content.svg +1 -0
- package/src/assets/icons/christmas-tree.svg +1 -0
- package/src/assets/icons/cinema-ticket-2-for-1.svg +1 -0
- package/src/assets/icons/cle-pc.svg +1 -0
- package/src/assets/icons/clock.svg +1 -0
- package/src/assets/icons/close.svg +5 -0
- package/src/assets/icons/closed-captions.svg +1 -0
- package/src/assets/icons/cloud-backup.svg +1 -0
- package/src/assets/icons/cloud-security.svg +1 -0
- package/src/assets/icons/collective-class-training.svg +1 -0
- package/src/assets/icons/community-sms.svg +1 -0
- package/src/assets/icons/company-structure.svg +1 -0
- package/src/assets/icons/connections.svg +1 -0
- package/src/assets/icons/control-centre.svg +1 -0
- package/src/assets/icons/control-my-data.svg +3 -0
- package/src/assets/icons/cpu.svg +1 -0
- package/src/assets/icons/currency-euro.svg +1 -0
- package/src/assets/icons/cyber-shield.svg +1 -0
- package/src/assets/icons/dashboard-display.svg +1 -0
- package/src/assets/icons/data-analytics.svg +1 -0
- package/src/assets/icons/data-centre.svg +1 -0
- package/src/assets/icons/data-services.svg +1 -0
- package/src/assets/icons/data-traffic.svg +1 -0
- package/src/assets/icons/data.svg +1 -0
- package/src/assets/icons/delete.svg +1 -0
- package/src/assets/icons/desk-phone.svg +1 -0
- package/src/assets/icons/desktop-pc.svg +1 -0
- package/src/assets/icons/device-fixed-line-phone.svg +1 -0
- package/src/assets/icons/device-laptop-computer-connected.svg +1 -0
- package/src/assets/icons/device-laptop-computer.svg +1 -0
- package/src/assets/icons/device-smart-phone.svg +1 -0
- package/src/assets/icons/device-tablet.svg +1 -0
- package/src/assets/icons/device-tv.svg +1 -0
- package/src/assets/icons/diagnostic.svg +1 -0
- package/src/assets/icons/digital-frame.svg +1 -0
- package/src/assets/icons/discussion-more.svg +1 -0
- package/src/assets/icons/doctor.svg +1 -0
- package/src/assets/icons/documentary.svg +1 -0
- package/src/assets/icons/donation.svg +1 -0
- package/src/assets/icons/download-file.svg +1 -0
- package/src/assets/icons/download.svg +1 -0
- package/src/assets/icons/e-reader.svg +1 -0
- package/src/assets/icons/e-shop.svg +1 -0
- package/src/assets/icons/easy-internet.svg +1 -0
- package/src/assets/icons/eco-mode.svg +1 -0
- package/src/assets/icons/edit.svg +1 -0
- package/src/assets/icons/electrcar.svg +1 -0
- package/src/assets/icons/email.svg +1 -0
- package/src/assets/icons/employees.svg +1 -0
- package/src/assets/icons/empty-trash.svg +1 -0
- package/src/assets/icons/entertainment.svg +1 -0
- package/src/assets/icons/epg.svg +1 -0
- package/src/assets/icons/error-severe.svg +1 -0
- package/src/assets/icons/ethernet.svg +1 -0
- package/src/assets/icons/euro.svg +1 -0
- package/src/assets/icons/exit.svg +1 -0
- package/src/assets/icons/facebook-2.svg +1 -0
- package/src/assets/icons/facebook.svg +1 -0
- package/src/assets/icons/factory.svg +1 -0
- package/src/assets/icons/family-place.svg +1 -0
- package/src/assets/icons/fashion.svg +1 -0
- package/src/assets/icons/fast-delivery.svg +1 -0
- package/src/assets/icons/file-compressed.svg +1 -0
- package/src/assets/icons/file-copy.svg +1 -0
- package/src/assets/icons/file-document-compose.svg +1 -0
- package/src/assets/icons/file-download.svg +1 -0
- package/src/assets/icons/file-draft-edit.svg +1 -0
- package/src/assets/icons/file-pdf.svg +1 -0
- package/src/assets/icons/file-terms-and-conditions.svg +1 -0
- package/src/assets/icons/files.svg +1 -0
- package/src/assets/icons/film.svg +1 -0
- package/src/assets/icons/filter.svg +1 -0
- package/src/assets/icons/finance.svg +1 -0
- package/src/assets/icons/firewall.svg +1 -0
- package/src/assets/icons/flag.svg +1 -0
- package/src/assets/icons/flashlight.svg +1 -0
- package/src/assets/icons/flexible-storage.svg +1 -0
- package/src/assets/icons/folder.svg +1 -0
- package/src/assets/icons/football-match.svg +1 -0
- package/src/assets/icons/football-quiz.svg +1 -0
- package/src/assets/icons/football.svg +1 -0
- package/src/assets/icons/form-tick.svg +1 -0
- package/src/assets/icons/front-end-dashboard.svg +1 -0
- package/src/assets/icons/funny.svg +1 -0
- package/src/assets/icons/futher-education.svg +1 -0
- package/src/assets/icons/games.svg +1 -0
- package/src/assets/icons/garage-closed.svg +1 -0
- package/src/assets/icons/gauge-rate.svg +1 -0
- package/src/assets/icons/gears.svg +1 -0
- package/src/assets/icons/geolocation.svg +1 -0
- package/src/assets/icons/guide-info.svg +1 -0
- package/src/assets/icons/hammer.svg +1 -0
- package/src/assets/icons/hand-shake.svg +1 -0
- package/src/assets/icons/hard-drive.svg +1 -0
- package/src/assets/icons/hdmi-key.svg +1 -0
- package/src/assets/icons/headphones.svg +1 -0
- package/src/assets/icons/health-app.svg +1 -0
- package/src/assets/icons/health-monitor.svg +1 -0
- package/src/assets/icons/health-patient.svg +1 -0
- package/src/assets/icons/heart.svg +1 -0
- package/src/assets/icons/home-appliance.svg +1 -0
- package/src/assets/icons/home.svg +1 -0
- package/src/assets/icons/homelive.svg +1 -0
- package/src/assets/icons/hourglass.svg +1 -0
- package/src/assets/icons/house.svg +1 -0
- package/src/assets/icons/id-card.svg +1 -0
- package/src/assets/icons/image.svg +1 -0
- package/src/assets/icons/important.svg +1 -0
- package/src/assets/icons/improvement.svg +1 -0
- package/src/assets/icons/inbox.svg +1 -0
- package/src/assets/icons/info.svg +1 -0
- package/src/assets/icons/information-data.svg +1 -0
- package/src/assets/icons/instagram.svg +1 -0
- package/src/assets/icons/international-globe.svg +1 -0
- package/src/assets/icons/internet-browser.svg +1 -0
- package/src/assets/icons/internet-security-desktop.svg +1 -0
- package/src/assets/icons/internet-security-mobile.svg +1 -0
- package/src/assets/icons/internet-security-password.svg +1 -0
- package/src/assets/icons/internet-usage.svg +1 -0
- package/src/assets/icons/internet.svg +1 -0
- package/src/assets/icons/invoice-euro.svg +1 -0
- package/src/assets/icons/invoices-euro.svg +1 -0
- package/src/assets/icons/iso.svg +1 -0
- package/src/assets/icons/it-infrastructure.svg +1 -0
- package/src/assets/icons/keyboard.svg +1 -0
- package/src/assets/icons/la-cle-tv.svg +1 -0
- package/src/assets/icons/laptop-connected.svg +1 -0
- package/src/assets/icons/laptop.svg +1 -0
- package/src/assets/icons/le-vote.svg +1 -0
- package/src/assets/icons/link.svg +1 -0
- package/src/assets/icons/linkedin-2.svg +1 -0
- package/src/assets/icons/linkedin.svg +1 -0
- package/src/assets/icons/location-on-map.svg +1 -0
- package/src/assets/icons/location-pin.svg +1 -0
- package/src/assets/icons/lock-open.svg +1 -0
- package/src/assets/icons/lock.svg +1 -0
- package/src/assets/icons/logistics.svg +1 -0
- package/src/assets/icons/love-logo.svg +1 -0
- package/src/assets/icons/mahali.svg +1 -0
- package/src/assets/icons/maintenance-man.svg +1 -0
- package/src/assets/icons/map-pin.svg +1 -0
- package/src/assets/icons/map.svg +1 -0
- package/src/assets/icons/medal.svg +1 -0
- package/src/assets/icons/medical-app.svg +1 -0
- package/src/assets/icons/medical-chart.svg +1 -0
- package/src/assets/icons/medicine.svg +1 -0
- package/src/assets/icons/menu-arrow.svg +1 -0
- package/src/assets/icons/menu-grid.svg +1 -0
- package/src/assets/icons/menu.svg +1 -0
- package/src/assets/icons/message-alert.svg +1 -0
- package/src/assets/icons/messages.svg +1 -0
- package/src/assets/icons/micro-sd-card.svg +1 -0
- package/src/assets/icons/microphone-mute.svg +1 -0
- package/src/assets/icons/microphone.svg +1 -0
- package/src/assets/icons/mini-games.svg +1 -0
- package/src/assets/icons/mobile-applications.svg +1 -0
- package/src/assets/icons/mobile-data-toggle.svg +1 -0
- package/src/assets/icons/mobile-insurance.svg +1 -0
- package/src/assets/icons/mobile-network-coverage.svg +1 -0
- package/src/assets/icons/mobile-payment.svg +1 -0
- package/src/assets/icons/mobile-security.svg +1 -0
- package/src/assets/icons/mobile-setup.svg +1 -0
- package/src/assets/icons/modem.svg +1 -0
- package/src/assets/icons/modifier-delete.svg +1 -0
- package/src/assets/icons/modifier-done.svg +1 -0
- package/src/assets/icons/modifier-download.svg +1 -0
- package/src/assets/icons/modifier-upload.svg +1 -0
- package/src/assets/icons/money-box.svg +1 -0
- package/src/assets/icons/more-dots.svg +1 -0
- package/src/assets/icons/multi-sim.svg +1 -0
- package/src/assets/icons/music.svg +1 -0
- package/src/assets/icons/my-account.svg +1 -0
- package/src/assets/icons/my-orange.svg +1 -0
- package/src/assets/icons/my-skills.svg +1 -0
- package/src/assets/icons/my-vacation.svg +1 -0
- package/src/assets/icons/network-dslam.svg +1 -0
- package/src/assets/icons/network-gatekeeper.svg +1 -0
- package/src/assets/icons/network-gateway.svg +1 -0
- package/src/assets/icons/network-optical-amplifier.svg +1 -0
- package/src/assets/icons/network-optical-transport.svg +1 -0
- package/src/assets/icons/network-wan-optimisation-engine.svg +1 -0
- package/src/assets/icons/networks.svg +1 -0
- package/src/assets/icons/newspaper.svg +1 -0
- package/src/assets/icons/not-checked.svg +1 -0
- package/src/assets/icons/notification-alert.svg +1 -0
- package/src/assets/icons/office.svg +1 -0
- package/src/assets/icons/online-help.svg +1 -0
- package/src/assets/icons/orange-assistant.svg +1 -0
- package/src/assets/icons/orange-cash.svg +1 -0
- package/src/assets/icons/orange-detente.svg +1 -0
- package/src/assets/icons/orange-dialler.svg +1 -0
- package/src/assets/icons/orange-events.svg +1 -0
- package/src/assets/icons/orange-experts-expert.svg +1 -0
- package/src/assets/icons/orange-experts-insurance.svg +1 -0
- package/src/assets/icons/orange-experts-orange-business-consultant.svg +1 -0
- package/src/assets/icons/orange-experts-recycle.svg +1 -0
- package/src/assets/icons/orange-experts-repair.svg +1 -0
- package/src/assets/icons/orange-football-club.svg +1 -0
- package/src/assets/icons/orange-games.svg +1 -0
- package/src/assets/icons/orange-messenger.svg +1 -0
- package/src/assets/icons/orange-money-nfc.svg +1 -0
- package/src/assets/icons/orange-reflect.svg +1 -0
- package/src/assets/icons/orange-rewards.svg +1 -0
- package/src/assets/icons/orange-tv.svg +1 -0
- package/src/assets/icons/orange-vr-experience.svg +1 -0
- package/src/assets/icons/outbox.svg +1 -0
- package/src/assets/icons/package-content.svg +1 -0
- package/src/assets/icons/package-services.svg +1 -0
- package/src/assets/icons/package.svg +1 -0
- package/src/assets/icons/packaging-icon-hd.svg +1 -0
- package/src/assets/icons/parabole-tv.svg +1 -0
- package/src/assets/icons/parental-control.svg +1 -0
- package/src/assets/icons/pause.svg +1 -0
- package/src/assets/icons/payment-card.svg +1 -0
- package/src/assets/icons/payment-euro.svg +1 -0
- package/src/assets/icons/pda.svg +1 -0
- package/src/assets/icons/pdf-file.svg +1 -0
- package/src/assets/icons/pencil.svg +1 -0
- package/src/assets/icons/personal-hotspot.svg +1 -0
- package/src/assets/icons/personal-smartphone-trainer.svg +1 -0
- package/src/assets/icons/phone-advisor.svg +1 -0
- package/src/assets/icons/play-and-win.svg +1 -0
- package/src/assets/icons/play.svg +1 -0
- package/src/assets/icons/plug-socket.svg +1 -0
- package/src/assets/icons/power.svg +1 -0
- package/src/assets/icons/powerstation.svg +1 -0
- package/src/assets/icons/presentation.svg +1 -0
- package/src/assets/icons/print.svg +1 -0
- package/src/assets/icons/printer.svg +1 -0
- package/src/assets/icons/real-time.svg +1 -0
- package/src/assets/icons/recycle-device.svg +1 -0
- package/src/assets/icons/recycle.svg +1 -0
- package/src/assets/icons/reduction.svg +1 -0
- package/src/assets/icons/reload.svg +1 -0
- package/src/assets/icons/reminders.svg +1 -0
- package/src/assets/icons/remote-desktop-protocol.svg +1 -0
- package/src/assets/icons/remove.svg +1 -0
- package/src/assets/icons/repair.svg +1 -0
- package/src/assets/icons/reseau.svg +1 -0
- package/src/assets/icons/restaurant.svg +1 -0
- package/src/assets/icons/rewards.svg +1 -0
- package/src/assets/icons/running.svg +1 -0
- package/src/assets/icons/safety.svg +1 -0
- package/src/assets/icons/satallite.svg +1 -0
- package/src/assets/icons/save.svg +1 -0
- package/src/assets/icons/school.svg +1 -0
- package/src/assets/icons/science.svg +1 -0
- package/src/assets/icons/sd-card.svg +1 -0
- package/src/assets/icons/search.svg +1 -0
- package/src/assets/icons/security-status-good.svg +1 -0
- package/src/assets/icons/send.svg +1 -0
- package/src/assets/icons/senior-person.svg +1 -0
- package/src/assets/icons/server-storage-array.svg +1 -0
- package/src/assets/icons/server-tower.svg +1 -0
- package/src/assets/icons/session-enter.svg +1 -0
- package/src/assets/icons/session-leave.svg +1 -0
- package/src/assets/icons/settings.svg +1 -0
- package/src/assets/icons/share.svg +1 -0
- package/src/assets/icons/shop-pin.svg +1 -0
- package/src/assets/icons/shop.svg +1 -0
- package/src/assets/icons/showroom-mobile-pro.svg +1 -0
- package/src/assets/icons/signal-5-5.svg +1 -0
- package/src/assets/icons/silence.svg +1 -0
- package/src/assets/icons/sim-e.svg +1 -0
- package/src/assets/icons/sim.svg +1 -0
- package/src/assets/icons/simple-mode.svg +1 -0
- package/src/assets/icons/simplicity.svg +1 -0
- package/src/assets/icons/siren.svg +1 -0
- package/src/assets/icons/skiing.svg +1 -0
- package/src/assets/icons/skip-to-end.svg +1 -0
- package/src/assets/icons/skip-to-start.svg +1 -0
- package/src/assets/icons/sleep.svg +1 -0
- package/src/assets/icons/smart-care.svg +1 -0
- package/src/assets/icons/smart-home.svg +1 -0
- package/src/assets/icons/smart-tap.svg +1 -0
- package/src/assets/icons/smart-watch.svg +1 -0
- package/src/assets/icons/sms-alert.svg +1 -0
- package/src/assets/icons/sms-message-compose.svg +1 -0
- package/src/assets/icons/sms-message.svg +1 -0
- package/src/assets/icons/social-network.svg +1 -0
- package/src/assets/icons/sofa.svg +1 -0
- package/src/assets/icons/sort.svg +1 -0
- package/src/assets/icons/stadium.svg +1 -0
- package/src/assets/icons/star-empty.svg +1 -0
- package/src/assets/icons/star-favourite-half.svg +1 -0
- package/src/assets/icons/star-favourite.svg +1 -0
- package/src/assets/icons/startover.svg +1 -0
- package/src/assets/icons/statistics.svg +1 -0
- package/src/assets/icons/stop-secret.svg +1 -0
- package/src/assets/icons/storage-cloud.svg +1 -0
- package/src/assets/icons/store-locator.svg +1 -0
- package/src/assets/icons/street.svg +1 -0
- package/src/assets/icons/subscription-package.svg +1 -0
- package/src/assets/icons/suitcase.svg +1 -0
- package/src/assets/icons/support.svg +1 -0
- package/src/assets/icons/surveillance-camera.svg +1 -0
- package/src/assets/icons/syncronise.svg +1 -0
- package/src/assets/icons/tag-advertising.svg +1 -0
- package/src/assets/icons/tag.svg +1 -0
- package/src/assets/icons/target-location.svg +1 -0
- package/src/assets/icons/tarif.svg +1 -0
- package/src/assets/icons/task-list.svg +1 -0
- package/src/assets/icons/team-connect.svg +1 -0
- package/src/assets/icons/thumb-up.svg +1 -0
- package/src/assets/icons/tick.svg +1 -0
- package/src/assets/icons/ticket.svg +1 -0
- package/src/assets/icons/top-up-card-euro.svg +1 -0
- package/src/assets/icons/top-up-euro.svg +1 -0
- package/src/assets/icons/top-up-time.svg +1 -0
- package/src/assets/icons/town.svg +1 -0
- package/src/assets/icons/townhall.svg +1 -0
- package/src/assets/icons/train.svg +1 -0
- package/src/assets/icons/training-session.svg +1 -0
- package/src/assets/icons/tranquility.svg +1 -0
- package/src/assets/icons/transfer-data.svg +1 -0
- package/src/assets/icons/transfers.svg +1 -0
- package/src/assets/icons/trash.svg +1 -0
- package/src/assets/icons/tv-channel-list.svg +1 -0
- package/src/assets/icons/tv-commande.svg +1 -0
- package/src/assets/icons/unlimited-calls.svg +1 -0
- package/src/assets/icons/upload.svg +1 -0
- package/src/assets/icons/usb-hard-drive.svg +1 -0
- package/src/assets/icons/usb-key.svg +1 -0
- package/src/assets/icons/user-manual.svg +1 -0
- package/src/assets/icons/user.svg +1 -0
- package/src/assets/icons/video-call.svg +1 -0
- package/src/assets/icons/video-live.svg +1 -0
- package/src/assets/icons/video-phone.svg +1 -0
- package/src/assets/icons/video-record.svg +1 -0
- package/src/assets/icons/video.svg +1 -0
- package/src/assets/icons/vip-contact.svg +1 -0
- package/src/assets/icons/virtual-gamepad.svg +1 -0
- package/src/assets/icons/vod-portrait.svg +1 -0
- package/src/assets/icons/volte.svg +1 -0
- package/src/assets/icons/volume-status-4-4.svg +1 -0
- package/src/assets/icons/vowifi.svg +1 -0
- package/src/assets/icons/wallet.svg +1 -0
- package/src/assets/icons/warning-important.svg +1 -0
- package/src/assets/icons/washroom.svg +1 -0
- package/src/assets/icons/watch.svg +1 -0
- package/src/assets/icons/water.svg +1 -0
- package/src/assets/icons/weather.svg +1 -0
- package/src/assets/icons/web-browser.svg +1 -0
- package/src/assets/icons/web-camera.svg +1 -0
- package/src/assets/icons/weighing-scales.svg +1 -0
- package/src/assets/icons/widget.svg +1 -0
- package/src/assets/icons/wifi-home.svg +1 -0
- package/src/assets/icons/wifi.svg +1 -0
- package/src/assets/icons/x.svg +1 -0
- package/src/assets/icons/your-balance.svg +1 -0
- package/src/assets/icons/youtube.svg +1 -0
- package/src/assets/icons/zoom-in.svg +1 -0
- package/src/assets/icons/zoom-out.svg +1 -0
- package/src/assets/images/developers/hands-with-phones.svg +90 -0
- package/src/assets/images/developers/iphone-size-2x.png +0 -0
- package/src/assets/images/developers/iphone-xr-white-select.png +0 -0
- package/src/assets/images/developers/phones.png +0 -0
- package/src/assets/images/developers/router.png +0 -0
- package/src/assets/images/developers/rule-component-block.png +0 -0
- package/src/assets/images/developers/rule-component-inline.png +0 -0
- package/src/assets/images/developers/rule-container.png +0 -0
- package/src/assets/images/developers/rule-content.png +0 -0
- package/src/assets/images/developers/two-phones.png +0 -0
- package/src/assets/logo/logo.svg +1 -0
- package/src/components/Accordion/Accordion.mdx +222 -0
- package/src/components/Accordion/Accordion.static.ts +104 -0
- package/src/components/Accordion/Accordion.tsx +70 -0
- package/src/components/Accordion/AccordionHeader.tsx +59 -0
- package/src/components/Accordion/AccordionItem.tsx +76 -0
- package/src/components/Accordion/HeadingContext.tsx +5 -0
- package/src/components/Accordion/index.ts +4 -0
- package/src/components/Accordion/styles/config.scss +8 -0
- package/src/components/Accordion/styles/mixins.scss +91 -0
- package/src/components/Accordion/styles/style.scss +47 -0
- package/src/components/Accordion/tests/Accordion.static.test.js +207 -0
- package/src/components/Accordion/tests/Accordion.unit.test.js +822 -0
- package/src/components/Accordion/tests/data.js +18 -0
- package/src/components/Alert/Alert.mdx +141 -0
- package/src/components/Alert/Alert.tsx +119 -0
- package/src/components/Alert/CHANGELOG.md +33 -0
- package/src/components/Alert/data.ts +8 -0
- package/src/components/Alert/index.ts +3 -0
- package/src/components/Alert/styles/config.scss +58 -0
- package/src/components/Alert/styles/mixins.scss +54 -0
- package/src/components/Alert/styles/style.scss +44 -0
- package/src/components/Alert/tests/Alert.conformance.test.js +30 -0
- package/src/components/Alert/tests/Alert.test.js +87 -0
- package/src/components/Badge/Badge.tsx +5 -3
- package/src/components/Badge/index.ts +1 -1
- package/src/components/Badge/styles/config.scss +53 -17
- package/src/components/Badge/styles/mixins.scss +8 -2
- package/src/components/Badge/styles/style.scss +7 -3
- package/src/components/Badge/tests/Badge.conformance.test.js +8 -8
- package/src/components/Badge/tests/Badge.unit.test.js +3 -3
- package/src/components/Breadcrumbs/BreadcrumbItem.tsx +54 -0
- package/src/components/Breadcrumbs/Breadcrumbs.mdx +84 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +60 -0
- package/src/components/Breadcrumbs/index.ts +5 -0
- package/src/components/Breadcrumbs/styles/config.scss +2 -0
- package/src/components/Breadcrumbs/styles/mixins.scss +105 -0
- package/src/components/Breadcrumbs/styles/style.scss +37 -0
- package/src/components/Breadcrumbs/tests/BreadcrumbItem.unit.test.js +295 -0
- package/src/components/Breadcrumbs/tests/Breadcrumbs.conformance.test.js +53 -0
- package/src/components/Breadcrumbs/tests/Breadcrumbs.integration.test.js +309 -0
- package/src/components/Breadcrumbs/tests/Breadcrumbs.unit.test.js +280 -0
- package/src/components/Button/Button.mdx +273 -0
- package/src/components/Button/Button.tsx +105 -0
- package/src/components/Button/IconButton.tsx +67 -0
- package/src/components/Button/index.tsx +23 -0
- package/src/components/Button/styles/config.scss +229 -0
- package/src/components/Button/styles/mixins.scss +164 -0
- package/src/components/Button/styles/style.scss +66 -0
- package/src/components/Button/tests/Button.conformance.test.js +37 -0
- package/src/components/Button/tests/Button.test.js +114 -0
- package/src/components/Button/tests/IconButton.unit.test.js +107 -0
- package/src/components/Buttons/Buttons.mdx +39 -0
- package/src/components/Buttons/Buttons.tsx +34 -0
- package/src/components/Buttons/index.ts +3 -0
- package/src/components/Buttons/styles/config.scss +3 -0
- package/src/components/Buttons/styles/mixins.scss +39 -0
- package/src/components/Buttons/styles/style.scss +10 -0
- package/src/components/Buttons/tests/Buttons.conformance.test.js +22 -0
- package/src/components/Buttons/tests/Buttons.unit.test.js +26 -0
- package/src/components/Container/Container.mdx +73 -0
- package/src/components/Container/Container.tsx +15 -0
- package/src/components/Container/index.ts +5 -0
- package/src/components/Container/styles/config.scss +11 -0
- package/src/components/Container/styles/mixins.scss +22 -0
- package/src/components/Container/styles/style.scss +5 -0
- package/src/components/Container/tests/Container.conformance.test.js +209 -0
- package/src/components/Container/tests/Container.unit.test.js +320 -0
- package/src/components/Grid/Grid.mdx +319 -0
- package/src/components/Grid/Grid.tsx +51 -0
- package/src/components/Grid/GridCol.tsx +33 -0
- package/src/components/Grid/index.ts +6 -0
- package/src/components/Grid/styles/config.scss +10 -0
- package/src/components/Grid/styles/mixins.scss +126 -0
- package/src/components/Grid/styles/style.scss +41 -0
- package/src/components/Grid/tests/Grid.unit.test.tsx +533 -0
- package/src/components/Grid/tests/GridCol.unit.test.tsx +199 -0
- package/src/components/Icon/Icon.mdx +172 -0
- package/src/components/Icon/Icon.tsx +73 -0
- package/src/components/Icon/IconSearch.jsx +247 -0
- package/src/components/Icon/SpritePathContext.tsx +22 -0
- package/src/components/Icon/iconSearchTags.ts +437 -0
- package/src/components/Icon/index.ts +5 -0
- package/src/components/Icon/styles/config.scss +27 -0
- package/src/components/Icon/styles/export/color.scss +8 -0
- package/src/components/Icon/styles/export/size.scss +13 -0
- package/src/components/Icon/styles/mixins.scss +31 -0
- package/src/components/Icon/styles/style.scss +13 -0
- package/src/components/Icon/tests/Icon.conformance.test.js +22 -0
- package/src/components/Icon/tests/Icon.unit.test.js +112 -0
- package/src/components/Image/Image.mdx +166 -0
- package/src/components/Image/Image.tsx +65 -0
- package/src/components/Image/index.ts +7 -0
- package/src/components/Image/styles/mixins.scss +12 -0
- package/src/components/Image/styles/style.scss +9 -0
- package/src/components/Image/tests/Image.conformance.test.js +264 -0
- package/src/components/Image/tests/Image.unit.test.js +338 -0
- package/src/components/Link/Link.mdx +224 -0
- package/src/components/Link/Link.tsx +52 -0
- package/src/components/Link/index.ts +3 -0
- package/src/components/Link/styles/config.scss +85 -0
- package/src/components/Link/styles/mixins.scss +42 -0
- package/src/components/Link/styles/style.scss +59 -0
- package/src/components/Link/tests/Link.conformance.test.js +302 -0
- package/src/components/Link/tests/Link.integration.test.js +393 -0
- package/src/components/Link/tests/Link.unit.test.js +308 -0
- package/src/components/Modal/Modal.mdx +449 -0
- package/src/components/Modal/Modal.static.ts +223 -0
- package/src/components/Modal/Modal.tsx +145 -0
- package/src/components/Modal/ModalBody.tsx +46 -0
- package/src/components/Modal/ModalCloseButton.tsx +26 -0
- package/src/components/Modal/ModalTitle.tsx +32 -0
- package/src/components/Modal/TODO.md +2 -0
- package/src/components/Modal/index.ts +6 -0
- package/src/components/Modal/styles/config.scss +42 -0
- package/src/components/Modal/styles/mixins.scss +200 -0
- package/src/components/Modal/styles/style.scss +97 -0
- package/src/components/Modal/tests/Modal.conformance.test.js +41 -0
- package/src/components/Modal/tests/Modal.unit.test.js +56 -0
- package/src/components/Modal/tests/ModalBody.unit.test.js +39 -0
- package/src/components/Modal/tests/ModalCloseButton.unit.test.js +84 -0
- package/src/components/Modal/tests/ModalTitle.unit.test.js +25 -0
- package/src/components/Section/Section.mdx +397 -0
- package/src/components/Section/Section.tsx +54 -0
- package/src/components/Section/index.ts +3 -0
- package/src/components/Section/styles/config.scss +38 -0
- package/src/components/Section/styles/mixins.scss +30 -0
- package/src/components/Section/styles/style.scss +35 -0
- package/src/components/Section/tests/Section.conformance.test.js +502 -0
- package/src/components/Section/tests/Section.unit.test.js +642 -0
- package/src/components/Tabs/TODO.md +2 -0
- package/src/components/Tabs/Tab.tsx +55 -0
- package/src/components/Tabs/TabPanel.tsx +42 -0
- package/src/components/Tabs/Tabs.mdx +373 -0
- package/src/components/Tabs/Tabs.static.ts +185 -0
- package/src/components/Tabs/Tabs.tsx +130 -0
- package/src/components/Tabs/index.ts +5 -0
- package/src/components/Tabs/styles/config.scss +78 -0
- package/src/components/Tabs/styles/mixins.scss +107 -0
- package/src/components/Tabs/styles/style.scss +64 -0
- package/src/components/Tabs/tests/Tab.unit.test.js +85 -0
- package/src/components/Tabs/tests/TabPanel.unit.test.js +53 -0
- package/src/components/Tabs/tests/Tabs.unit.test.js +260 -0
- package/src/components/index.ts +33 -2
- package/src/styles/base/globals.scss +18 -13
- package/src/styles/base/styleguide.scss +1 -1
- package/src/styles/before-components.scss +1 -1
- package/src/styles/export/breakpoint.ts +12 -0
- package/src/styles/export/color.scss +1 -1
- package/src/styles/tokens/base.scss +6 -4
- package/src/styles/tokens/color.scss +127 -25
- package/src/styles/tools/convert.scss +1 -1
- package/src/styles/typography/config.scss +187 -0
- package/src/{components/Typography/styles → styles/typography}/mixins.scss +31 -24
- package/src/{components/Typography/styles → styles/typography}/style.scss +9 -3
- package/src/styles/utilities/text.scss +2 -2
- package/build/.htaccess +0 -7
- package/build/_next/static/chunks/app/layout-69efc42b1696abf9.js +0 -1
- package/build/_next/static/chunks/app/page-687dfdffc8d1b6e5.js +0 -1
- package/build/_next/static/chunks/webpack-778f3ec87f8d2826.js +0 -1
- package/build/_next/static/css/08a2fcd6f5aac3e0.css +0 -1
- package/build/_next/static/css/d2fc2f581fe4b371.css +0 -1
- package/build/_next/static/rsiMOOYAxBtOjvpzBN4vJ/_buildManifest.js +0 -1
- package/build/_redirects +0 -1
- package/build/components/types/Badge/index.d.ts +0 -2
- package/build/components/types/index.d.ts +0 -4
- package/build/fonts/HelvNeue55_W1G.eot +0 -0
- package/build/fonts/HelvNeue55_W1G.svg +0 -653
- package/build/fonts/HelvNeue55_W1G.ttf +0 -0
- package/build/fonts/HelvNeue55_W1G.woff +0 -0
- package/build/fonts/HelvNeue55_W1G.woff2 +0 -0
- package/build/fonts/HelvNeue75_W1G.eot +0 -0
- package/build/fonts/HelvNeue75_W1G.svg +0 -653
- package/build/fonts/HelvNeue75_W1G.ttf +0 -0
- package/build/fonts/HelvNeue75_W1G.woff +0 -0
- package/build/fonts/HelvNeue75_W1G.woff2 +0 -0
- package/build/manifest.json +0 -15
- package/build/sprite-sg.svg +0 -1
- package/public/fonts/HelvNeue55_W1G.eot +0 -0
- package/public/fonts/HelvNeue55_W1G.svg +0 -653
- package/public/fonts/HelvNeue55_W1G.ttf +0 -0
- package/public/fonts/HelvNeue55_W1G.woff +0 -0
- package/public/fonts/HelvNeue55_W1G.woff2 +0 -0
- package/public/fonts/HelvNeue75_W1G.eot +0 -0
- package/public/fonts/HelvNeue75_W1G.svg +0 -653
- package/public/fonts/HelvNeue75_W1G.ttf +0 -0
- package/public/fonts/HelvNeue75_W1G.woff +0 -0
- package/public/fonts/HelvNeue75_W1G.woff2 +0 -0
- package/src/components/Badge/Badge.test.js +0 -45
- package/src/components/Typography/styles/config.scss +0 -181
- /package/build/_next/static/{rsiMOOYAxBtOjvpzBN4vJ → CRhIjUFtohDOfdDfzvfXM}/_ssgManifest.js +0 -0
- /package/build/_next/static/chunks/{4bd1b696-67ee12fb04071d3b.js → 4bd1b696-40a218329c8ae32b.js} +0 -0
- /package/build/_next/static/chunks/{684-2d117c50cbadadca.js → 684-c72f8f73e7f2d568.js} +0 -0
- /package/build/_next/static/chunks/app/_not-found/{page-f08302ee705a96b1.js → page-c799b4c91b89a5c2.js} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
2
|
+
|
|
3
|
+
import { ModalBody } from "../ModalBody";
|
|
4
|
+
|
|
5
|
+
describe("rendering ModalBody", () => {
|
|
6
|
+
describe("initial state", () => {
|
|
7
|
+
it("renders div with class modal__body", () => {
|
|
8
|
+
const { getByTestId } = render(<ModalBody data-testid="test-id" />);
|
|
9
|
+
expect(getByTestId("test-id").tagName).toBe("DIV");
|
|
10
|
+
expect(getByTestId("test-id")).toHaveClass("modal__body");
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
describe("passed props", () => {
|
|
14
|
+
it("renders children", () => {
|
|
15
|
+
const { getByText } = render(<ModalBody>test</ModalBody>);
|
|
16
|
+
expect(getByText("test")).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
[
|
|
19
|
+
"white",
|
|
20
|
+
"gray",
|
|
21
|
+
"orange",
|
|
22
|
+
"orange-dark",
|
|
23
|
+
"black",
|
|
24
|
+
"blue",
|
|
25
|
+
"green",
|
|
26
|
+
"pink",
|
|
27
|
+
"violet",
|
|
28
|
+
"yellow",
|
|
29
|
+
].map((color) => {
|
|
30
|
+
it(`has classes bg-${color} and modal__body--colorful when color is set to ${color}`, () => {
|
|
31
|
+
const { getByTestId } = render(
|
|
32
|
+
<ModalBody color={color} data-testid="test-id" />,
|
|
33
|
+
);
|
|
34
|
+
expect(getByTestId("test-id")).toHaveClass(`bg-${color}`);
|
|
35
|
+
expect(getByTestId("test-id")).toHaveClass("modal__body--colorful");
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
2
|
+
|
|
3
|
+
import { ModalCloseButton } from "../ModalCloseButton";
|
|
4
|
+
|
|
5
|
+
describe("rendering ModalCloseButton", () => {
|
|
6
|
+
describe("initial state", () => {
|
|
7
|
+
it("renders button with class btn", () => {
|
|
8
|
+
const { getByTestId } = render(
|
|
9
|
+
<ModalCloseButton data-testid="test-id" />,
|
|
10
|
+
);
|
|
11
|
+
expect(getByTestId("test-id").tagName).toBe("BUTTON");
|
|
12
|
+
expect(getByTestId("test-id")).toHaveClass("btn");
|
|
13
|
+
});
|
|
14
|
+
it("renders icon with class icon--small", () => {
|
|
15
|
+
const { container } = render(<ModalCloseButton />);
|
|
16
|
+
expect(container.querySelector("svg")).toBeInTheDocument();
|
|
17
|
+
expect(container.querySelector("svg")).toHaveClass("icon--small");
|
|
18
|
+
});
|
|
19
|
+
it("renders span with class visually-hidden", () => {
|
|
20
|
+
const { container } = render(<ModalCloseButton>test</ModalCloseButton>);
|
|
21
|
+
expect(container.querySelector("span")).toBeInTheDocument();
|
|
22
|
+
expect(container.querySelector("span")).toHaveClass("visually-hidden");
|
|
23
|
+
});
|
|
24
|
+
it("icon has class modal__close", () => {
|
|
25
|
+
const { getByTestId } = render(
|
|
26
|
+
<ModalCloseButton data-testid="test-id" />,
|
|
27
|
+
);
|
|
28
|
+
expect(getByTestId("test-id")).toHaveClass("modal__close");
|
|
29
|
+
});
|
|
30
|
+
it("use element inside svg has /sprite.svg#delete xlinkhref", () => {
|
|
31
|
+
const { container } = render(<ModalCloseButton />);
|
|
32
|
+
expect(container.querySelector("svg").children.length).toBe(1);
|
|
33
|
+
expect(container.querySelector("svg").children[0].tagName).toBe("use");
|
|
34
|
+
expect(
|
|
35
|
+
container.querySelector("svg").children[0].getAttribute("xlink:href"),
|
|
36
|
+
).toBe("/sprite.svg#delete");
|
|
37
|
+
});
|
|
38
|
+
it("icon has class icon--small", () => {
|
|
39
|
+
const { container } = render(<ModalCloseButton />);
|
|
40
|
+
expect(container.querySelector("svg")).toBeInTheDocument();
|
|
41
|
+
expect(container.querySelector("svg")).toHaveClass("icon--small");
|
|
42
|
+
});
|
|
43
|
+
it("button has class btn--small", () => {
|
|
44
|
+
const { container } = render(<ModalCloseButton />);
|
|
45
|
+
expect(container.querySelector("button")).toBeInTheDocument();
|
|
46
|
+
expect(container.querySelector("button")).toHaveClass("btn--small");
|
|
47
|
+
});
|
|
48
|
+
it("button has class btn--square", () => {
|
|
49
|
+
const { container } = render(<ModalCloseButton />);
|
|
50
|
+
expect(container.querySelector("button")).toBeInTheDocument();
|
|
51
|
+
expect(container.querySelector("button")).toHaveClass("btn--square");
|
|
52
|
+
});
|
|
53
|
+
it("button has class btn--ghost", () => {
|
|
54
|
+
const { container } = render(<ModalCloseButton />);
|
|
55
|
+
expect(container.querySelector("button")).toBeInTheDocument();
|
|
56
|
+
expect(container.querySelector("button")).toHaveClass("btn--ghost");
|
|
57
|
+
});
|
|
58
|
+
it("button has attribute data-a11y-dialog-hide set to true", () => {
|
|
59
|
+
const { container } = render(<ModalCloseButton />);
|
|
60
|
+
expect(container.querySelector("button")).toBeInTheDocument();
|
|
61
|
+
expect(
|
|
62
|
+
container.querySelector("button").getAttribute("data-a11y-dialog-hide"),
|
|
63
|
+
).toBe("true");
|
|
64
|
+
});
|
|
65
|
+
it("button has attribute aria-label set to Zatvoriť", () => {
|
|
66
|
+
const { container } = render(<ModalCloseButton />);
|
|
67
|
+
expect(container.querySelector("button")).toBeInTheDocument();
|
|
68
|
+
expect(container.querySelector("button").getAttribute("aria-label")).toBe(
|
|
69
|
+
"Zatvoriť",
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe("passed props", () => {
|
|
74
|
+
it("renders children", () => {
|
|
75
|
+
const { getByText } = render(<ModalCloseButton>test</ModalCloseButton>);
|
|
76
|
+
expect(getByText("test")).toBeInTheDocument();
|
|
77
|
+
});
|
|
78
|
+
it("children are rendered inside span element", () => {
|
|
79
|
+
const { container } = render(<ModalCloseButton>test</ModalCloseButton>);
|
|
80
|
+
expect(container.querySelector("span")).toBeInTheDocument();
|
|
81
|
+
expect(container.querySelector("span").textContent).toBe("test");
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@testing-library/react";
|
|
3
|
+
|
|
4
|
+
import { ModalTitle } from "../ModalTitle";
|
|
5
|
+
|
|
6
|
+
describe("rendering Title", () => {
|
|
7
|
+
describe("passed props", () => {
|
|
8
|
+
it("renders children", () => {
|
|
9
|
+
const { getByText } = render(<ModalTitle>test</ModalTitle>);
|
|
10
|
+
expect(getByText("test")).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
it("has class display-3 when size is set to large", () => {
|
|
13
|
+
const { getByTestId } = render(
|
|
14
|
+
<ModalTitle data-testid="test-id" size="large" />,
|
|
15
|
+
);
|
|
16
|
+
expect(getByTestId("test-id")).toHaveClass("display-3");
|
|
17
|
+
});
|
|
18
|
+
it("has class h3 when size is set to small", () => {
|
|
19
|
+
const { getByTestId } = render(
|
|
20
|
+
<ModalTitle data-testid="test-id" size="small" />,
|
|
21
|
+
);
|
|
22
|
+
expect(getByTestId("test-id")).toHaveClass("h2");
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { ComponentDocs } from "@lighting-beetle/lighter-styleguide";
|
|
2
|
+
import { loremIpsum as lipsum } from "lorem-ipsum";
|
|
3
|
+
import Preview, { PreviewSpacing } from "../../styleguide/Preview/";
|
|
4
|
+
import cx from "classnames";
|
|
5
|
+
import Grid, { GridCol } from "../Grid";
|
|
6
|
+
import ToggleButton from "../../docs/utils/ToggleButton";
|
|
7
|
+
import Button from "../Button";
|
|
8
|
+
import { Section } from "./";
|
|
9
|
+
|
|
10
|
+
# Section
|
|
11
|
+
|
|
12
|
+
Section is an element that helps to separate page segments with consistent spacing. The content is automatically wrapped in a Container component for consistent layout and spacing.
|
|
13
|
+
|
|
14
|
+
<Preview>
|
|
15
|
+
<Section children="This is a section. You can use it to space out certain parts of the page with standardized spaces. The content is wrapped in a Container component." />
|
|
16
|
+
</Preview>
|
|
17
|
+
|
|
18
|
+
## Structure
|
|
19
|
+
|
|
20
|
+
Section automatically wraps its content in a Container component, which provides consistent layout constraints and spacing. This ensures that content is properly contained and aligned within the section.
|
|
21
|
+
|
|
22
|
+
<Preview>
|
|
23
|
+
<Section>
|
|
24
|
+
<div style={{ border: "1px dashed #ccc", padding: "10px" }}>
|
|
25
|
+
This content is wrapped in a Container component
|
|
26
|
+
</div>
|
|
27
|
+
</Section>
|
|
28
|
+
</Preview>
|
|
29
|
+
|
|
30
|
+
## Colors
|
|
31
|
+
|
|
32
|
+
<Preview>
|
|
33
|
+
<Section children="Gray Section" color="gray" />
|
|
34
|
+
<Section children="White (default) Section" />
|
|
35
|
+
<Section children="Black Section" color="black" />
|
|
36
|
+
<Section children="Orange Section" color="orange" />
|
|
37
|
+
</Preview>
|
|
38
|
+
|
|
39
|
+
## HTML Tags
|
|
40
|
+
|
|
41
|
+
Section can render as different HTML elements using the `tag` prop. This is useful for semantic HTML structure.
|
|
42
|
+
|
|
43
|
+
<Preview>
|
|
44
|
+
<Section children="Default div tag" />
|
|
45
|
+
<Section children="Section tag" tag="section" />
|
|
46
|
+
<Section children="Article tag" tag="article" />
|
|
47
|
+
<Section children="Main tag" tag="main" />
|
|
48
|
+
<Section children="Aside tag" tag="aside" />
|
|
49
|
+
<Section children="Header tag" tag="header" />
|
|
50
|
+
<Section children="Footer tag" tag="footer" />
|
|
51
|
+
</Preview>
|
|
52
|
+
|
|
53
|
+
## Spacing variants and rules
|
|
54
|
+
|
|
55
|
+
### Default
|
|
56
|
+
|
|
57
|
+
<PreviewSpacing>
|
|
58
|
+
<Section children="Default section" />
|
|
59
|
+
</PreviewSpacing>
|
|
60
|
+
|
|
61
|
+
### Small
|
|
62
|
+
|
|
63
|
+
A small section has smaller spacing on its top side.
|
|
64
|
+
|
|
65
|
+
<PreviewSpacing>
|
|
66
|
+
<Section children="Small section" spacing="small" />
|
|
67
|
+
</PreviewSpacing>
|
|
68
|
+
|
|
69
|
+
### Extra small
|
|
70
|
+
|
|
71
|
+
This section has 10 px spacings from both top and bottom.
|
|
72
|
+
|
|
73
|
+
<PreviewSpacing>
|
|
74
|
+
<Section children="Extra small section" spacing="xsmall" />
|
|
75
|
+
</PreviewSpacing>
|
|
76
|
+
|
|
77
|
+
### Rules
|
|
78
|
+
|
|
79
|
+
First section appearing in a group of sections is always `default`. Following sections of the same color
|
|
80
|
+
are `small`. Following sections of a different color are always `default`.
|
|
81
|
+
|
|
82
|
+
Default, white, gray, black, and orange sections have these rules applied automatically without specifying the sections's size.
|
|
83
|
+
|
|
84
|
+
<PreviewSpacing>
|
|
85
|
+
<Section children="Gray" color="gray" />
|
|
86
|
+
<Section children="Another gray" color="gray" />
|
|
87
|
+
<Section children="Black" color="black" />
|
|
88
|
+
<Section children="White" />
|
|
89
|
+
<Section children="Another white" />
|
|
90
|
+
</PreviewSpacing>
|
|
91
|
+
|
|
92
|
+
#### Breaking the rules
|
|
93
|
+
|
|
94
|
+
Spacing rules can be broken using `section--default` and `section--small` classNames.
|
|
95
|
+
|
|
96
|
+
<PreviewSpacing>
|
|
97
|
+
<Section
|
|
98
|
+
children="Small spacing breaking the rules (first section should be default)"
|
|
99
|
+
spacing="small"
|
|
100
|
+
/>
|
|
101
|
+
<Section
|
|
102
|
+
children="Default spacing breaking the rules (adjacent section of the same color should be small)"
|
|
103
|
+
spacing="default"
|
|
104
|
+
/>
|
|
105
|
+
</PreviewSpacing>
|
|
106
|
+
|
|
107
|
+
## Accessibility
|
|
108
|
+
|
|
109
|
+
Section supports various accessibility features through ARIA attributes and semantic HTML tags. The Container wrapper maintains accessibility while providing consistent layout.
|
|
110
|
+
|
|
111
|
+
### Semantic HTML
|
|
112
|
+
|
|
113
|
+
Use appropriate HTML tags for better accessibility:
|
|
114
|
+
|
|
115
|
+
<Preview>
|
|
116
|
+
<Section tag="main" aria-label="Main content">
|
|
117
|
+
<h1>Main Content</h1>
|
|
118
|
+
<p>
|
|
119
|
+
This section uses the main tag for semantic meaning and wraps content in a
|
|
120
|
+
Container.
|
|
121
|
+
</p>
|
|
122
|
+
</Section>
|
|
123
|
+
</Preview>
|
|
124
|
+
|
|
125
|
+
### ARIA Attributes
|
|
126
|
+
|
|
127
|
+
<Preview>
|
|
128
|
+
<Section
|
|
129
|
+
tag="section"
|
|
130
|
+
aria-labelledby="section-title"
|
|
131
|
+
aria-describedby="section-description"
|
|
132
|
+
>
|
|
133
|
+
<h2 id="section-title">Section Title</h2>
|
|
134
|
+
<p id="section-description">
|
|
135
|
+
This section has proper ARIA labeling and Container wrapper.
|
|
136
|
+
</p>
|
|
137
|
+
</Section>
|
|
138
|
+
</Preview>
|
|
139
|
+
|
|
140
|
+
### Interactive Elements
|
|
141
|
+
|
|
142
|
+
<Preview>
|
|
143
|
+
<Section>
|
|
144
|
+
<button type="button" onClick={() => alert("Button clicked!")}>
|
|
145
|
+
Interactive Button
|
|
146
|
+
</button>
|
|
147
|
+
<input type="text" aria-label="Search input" placeholder="Search..." />
|
|
148
|
+
</Section>
|
|
149
|
+
</Preview>
|
|
150
|
+
|
|
151
|
+
## Spacing problems and solutions
|
|
152
|
+
|
|
153
|
+
### 1. Last element
|
|
154
|
+
|
|
155
|
+
#### Problem:
|
|
156
|
+
|
|
157
|
+
If there is **just one element at the end** of the section and this element has
|
|
158
|
+
its **own bottom spacing** defined, these spaces would add up and we would lose spacing
|
|
159
|
+
consistency.
|
|
160
|
+
|
|
161
|
+
<PreviewSpacing>
|
|
162
|
+
<Section color="gray">
|
|
163
|
+
<p>
|
|
164
|
+
Et irure sit ut deserunt irure quis enim amet mollit. Adipisicing ullamco
|
|
165
|
+
adipisicing.
|
|
166
|
+
</p>
|
|
167
|
+
<Button type="primary">Button</Button>
|
|
168
|
+
</Section>
|
|
169
|
+
</PreviewSpacing>
|
|
170
|
+
|
|
171
|
+
#### Solution:
|
|
172
|
+
|
|
173
|
+
1. remove last element spacing
|
|
174
|
+
|
|
175
|
+
<PreviewSpacing>
|
|
176
|
+
<Section color="gray">
|
|
177
|
+
<p>
|
|
178
|
+
Et irure sit ut deserunt irure quis enim amet mollit. Adipisicing ullamco
|
|
179
|
+
adipisicing.
|
|
180
|
+
</p>
|
|
181
|
+
<Button type="primary" className="mb-none">
|
|
182
|
+
Button
|
|
183
|
+
</Button>
|
|
184
|
+
</Section>
|
|
185
|
+
</PreviewSpacing>
|
|
186
|
+
|
|
187
|
+
### 2. Stacking elements
|
|
188
|
+
|
|
189
|
+
#### Problem:
|
|
190
|
+
|
|
191
|
+
There are **multiple elements** in row at the end of a section and **they define their own
|
|
192
|
+
bottom spacing** (`p` in this case, uses default `medium` margin), because
|
|
193
|
+
they need to stack on smaller devices. The space of the section and elements
|
|
194
|
+
would add up and we would lose spacing consistency.
|
|
195
|
+
|
|
196
|
+
export const cols1 = [5, 2, 3, 4].map((count) => lipsum({ count }));
|
|
197
|
+
|
|
198
|
+
<PreviewSpacing>
|
|
199
|
+
<Section color="gray">
|
|
200
|
+
<Grid>
|
|
201
|
+
{cols1.map((content, index, arr) => (
|
|
202
|
+
<GridCol key={index.toString()} size={{ md: 3 }}>
|
|
203
|
+
<p>{content}</p>
|
|
204
|
+
</GridCol>
|
|
205
|
+
))}
|
|
206
|
+
</Grid>
|
|
207
|
+
</Section>
|
|
208
|
+
</PreviewSpacing>
|
|
209
|
+
|
|
210
|
+
#### Solution:
|
|
211
|
+
|
|
212
|
+
Use [Grid row gap](/components/grid#row-gap-size)
|
|
213
|
+
|
|
214
|
+
<PreviewSpacing>
|
|
215
|
+
<Section color="gray">
|
|
216
|
+
<Grid rowGapSize="medium">
|
|
217
|
+
{cols1.map((content, index, arr) => (
|
|
218
|
+
<GridCol key={index.toString()} size={{ md: 3 }}>
|
|
219
|
+
<p>{content}</p>
|
|
220
|
+
</GridCol>
|
|
221
|
+
))}
|
|
222
|
+
</Grid>
|
|
223
|
+
</Section>
|
|
224
|
+
</PreviewSpacing>
|
|
225
|
+
|
|
226
|
+
### 3. Dynamic visibility of a last element
|
|
227
|
+
|
|
228
|
+
#### Problem
|
|
229
|
+
|
|
230
|
+
If there is a possibility of **last element** of a section (`<button>` in this case) to disappear,
|
|
231
|
+
spacing of elements above this element would collide with a section spacing and we would lose spacing consistency.
|
|
232
|
+
|
|
233
|
+
export const cols2 = [1, 2, 3, 4, 5, 6, 7, 8].map((count) => lipsum({ count }));
|
|
234
|
+
|
|
235
|
+
<PreviewSpacing>
|
|
236
|
+
<Section color="gray">
|
|
237
|
+
<Grid>
|
|
238
|
+
{cols2.map((content, index, arr) => (
|
|
239
|
+
<GridCol
|
|
240
|
+
key={index.toString()}
|
|
241
|
+
size={{ md: 3 }}
|
|
242
|
+
className={
|
|
243
|
+
index < arr.length / 2 ? "" : "hidden-problem-element hide"
|
|
244
|
+
}
|
|
245
|
+
>
|
|
246
|
+
<p>{content}</p>
|
|
247
|
+
</GridCol>
|
|
248
|
+
))}
|
|
249
|
+
</Grid>
|
|
250
|
+
<ToggleButton
|
|
251
|
+
className="mb-none"
|
|
252
|
+
type="primary"
|
|
253
|
+
data-toggle={JSON.stringify([
|
|
254
|
+
{
|
|
255
|
+
target: ".hidden-problem-element.hide",
|
|
256
|
+
attribute: "class",
|
|
257
|
+
value: "hide",
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
target: "self",
|
|
261
|
+
attribute: "class",
|
|
262
|
+
value: "hide",
|
|
263
|
+
},
|
|
264
|
+
])}
|
|
265
|
+
>
|
|
266
|
+
Show more
|
|
267
|
+
</ToggleButton>
|
|
268
|
+
</Section>
|
|
269
|
+
</PreviewSpacing>
|
|
270
|
+
|
|
271
|
+
#### Solution:
|
|
272
|
+
|
|
273
|
+
1. Use [Grid row gap](/components/grid#row-gap-size)
|
|
274
|
+
2. Add additional spacing between grid and button and remove this spacing after
|
|
275
|
+
showing hidden element
|
|
276
|
+
|
|
277
|
+
##### Example:
|
|
278
|
+
|
|
279
|
+
<PreviewSpacing>
|
|
280
|
+
<Section color="gray">
|
|
281
|
+
<Grid rowGapSize="medium" className="mb-medium">
|
|
282
|
+
{cols2.map((content, index, arr) => (
|
|
283
|
+
<GridCol
|
|
284
|
+
key={index.toString()}
|
|
285
|
+
size={{ md: 3 }}
|
|
286
|
+
className={cx({
|
|
287
|
+
"hidden-solution-element hide": index >= arr.length / 2,
|
|
288
|
+
})}
|
|
289
|
+
>
|
|
290
|
+
<p>{content}</p>
|
|
291
|
+
</GridCol>
|
|
292
|
+
))}
|
|
293
|
+
</Grid>
|
|
294
|
+
<ToggleButton
|
|
295
|
+
className="mb-none"
|
|
296
|
+
type="primary"
|
|
297
|
+
data-toggle={JSON.stringify([
|
|
298
|
+
{
|
|
299
|
+
target: ".hidden-solution-element.hide",
|
|
300
|
+
attribute: "class",
|
|
301
|
+
value: "hide",
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
target: "previous",
|
|
305
|
+
attribute: "class",
|
|
306
|
+
value: "mb-medium",
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
target: "self",
|
|
310
|
+
attribute: "class",
|
|
311
|
+
value: "hide",
|
|
312
|
+
},
|
|
313
|
+
])}
|
|
314
|
+
>
|
|
315
|
+
<span>Show more</span>
|
|
316
|
+
</ToggleButton>
|
|
317
|
+
</Section>
|
|
318
|
+
</PreviewSpacing>
|
|
319
|
+
|
|
320
|
+
## Advanced Usage
|
|
321
|
+
|
|
322
|
+
### Container Integration
|
|
323
|
+
|
|
324
|
+
The Container wrapper provides consistent layout constraints. You can see this in action with complex content structures:
|
|
325
|
+
|
|
326
|
+
<Preview>
|
|
327
|
+
<Section tag="article" color="gray" spacing="small">
|
|
328
|
+
<header>
|
|
329
|
+
<h1>Article Title</h1>
|
|
330
|
+
<time dateTime="2024-01-01">January 1, 2024</time>
|
|
331
|
+
</header>
|
|
332
|
+
<main>
|
|
333
|
+
<p>
|
|
334
|
+
Article content with <a href="#link">links</a> and{" "}
|
|
335
|
+
<strong>emphasis</strong>.
|
|
336
|
+
</p>
|
|
337
|
+
<blockquote>
|
|
338
|
+
<p>This is a quote within the section, properly contained.</p>
|
|
339
|
+
</blockquote>
|
|
340
|
+
</main>
|
|
341
|
+
<footer>
|
|
342
|
+
<p>Article footer with additional information.</p>
|
|
343
|
+
</footer>
|
|
344
|
+
</Section>
|
|
345
|
+
</Preview>
|
|
346
|
+
|
|
347
|
+
### Custom Data Attributes
|
|
348
|
+
|
|
349
|
+
<Preview>
|
|
350
|
+
<Section
|
|
351
|
+
data-testid="custom-section"
|
|
352
|
+
data-analytics="section-tracking"
|
|
353
|
+
data-section-type="content"
|
|
354
|
+
>
|
|
355
|
+
<p>This section has custom data attributes for testing and analytics.</p>
|
|
356
|
+
</Section>
|
|
357
|
+
</Preview>
|
|
358
|
+
|
|
359
|
+
### Event Handling
|
|
360
|
+
|
|
361
|
+
<Preview>
|
|
362
|
+
<Section
|
|
363
|
+
onClick={() => alert("Section clicked!")}
|
|
364
|
+
onFocus={() => console.log("Section focused")}
|
|
365
|
+
role="button"
|
|
366
|
+
tabIndex={0}
|
|
367
|
+
>
|
|
368
|
+
<p>This section is clickable and focusable.</p>
|
|
369
|
+
</Section>
|
|
370
|
+
</Preview>
|
|
371
|
+
|
|
372
|
+
### Complex Content Structure
|
|
373
|
+
|
|
374
|
+
<Preview>
|
|
375
|
+
<Section tag="article" color="gray" spacing="small">
|
|
376
|
+
<header>
|
|
377
|
+
<h1>Article Title</h1>
|
|
378
|
+
<time dateTime="2024-01-01">January 1, 2024</time>
|
|
379
|
+
</header>
|
|
380
|
+
<main>
|
|
381
|
+
<p>
|
|
382
|
+
Article content with <a href="#link">links</a> and{" "}
|
|
383
|
+
<strong>emphasis</strong>.
|
|
384
|
+
</p>
|
|
385
|
+
<blockquote>
|
|
386
|
+
<p>This is a quote within the section.</p>
|
|
387
|
+
</blockquote>
|
|
388
|
+
</main>
|
|
389
|
+
<footer>
|
|
390
|
+
<p>Article footer with additional information.</p>
|
|
391
|
+
</footer>
|
|
392
|
+
</Section>
|
|
393
|
+
</Preview>
|
|
394
|
+
|
|
395
|
+
## Props
|
|
396
|
+
|
|
397
|
+
<ComponentDocs title="<Section />" component={Section} />
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import Container from "../Container";
|
|
4
|
+
|
|
5
|
+
export type SectionColor = "white" | "gray" | "black" | "orange";
|
|
6
|
+
export type SectionSpacing = "default" | "small" | "xsmall";
|
|
7
|
+
|
|
8
|
+
export interface SectionProps {
|
|
9
|
+
/** Background color of section */
|
|
10
|
+
color?: SectionColor;
|
|
11
|
+
/**
|
|
12
|
+
* Spacing between sections
|
|
13
|
+
*
|
|
14
|
+
* if two sections with different color meet
|
|
15
|
+
* use default (larger) spacing, if two section have same color
|
|
16
|
+
* use small spacing on second one. Use xsmall for specific
|
|
17
|
+
* cases e.g. as part of Megamenu
|
|
18
|
+
*/
|
|
19
|
+
spacing?: SectionSpacing;
|
|
20
|
+
/** Rendered HTML element */
|
|
21
|
+
tag?: React.ElementType;
|
|
22
|
+
/** Additional CSS classes */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Section content */
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const CLASS_ROOT = "section";
|
|
29
|
+
|
|
30
|
+
export const Section: React.FC<SectionProps> = ({
|
|
31
|
+
className,
|
|
32
|
+
color = "white",
|
|
33
|
+
spacing,
|
|
34
|
+
tag: Tag = "div",
|
|
35
|
+
children,
|
|
36
|
+
...other
|
|
37
|
+
}) => {
|
|
38
|
+
const classes = cx(
|
|
39
|
+
CLASS_ROOT,
|
|
40
|
+
{
|
|
41
|
+
[`${CLASS_ROOT}--${spacing}`]: spacing,
|
|
42
|
+
[`bg-${color}`]: color !== "white",
|
|
43
|
+
},
|
|
44
|
+
className,
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Tag className={classes} {...other}>
|
|
49
|
+
<Container>{children}</Container>
|
|
50
|
+
</Tag>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
Section.displayName = "Section";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@use '../../../styles/tokens/space';
|
|
2
|
+
@use '../../../styles/tokens/color';
|
|
3
|
+
|
|
4
|
+
$spacing: (
|
|
5
|
+
default: (
|
|
6
|
+
default: (
|
|
7
|
+
padding-top: space.get('large'),
|
|
8
|
+
padding-bottom: space.get('large'),
|
|
9
|
+
),
|
|
10
|
+
md: (
|
|
11
|
+
padding-top: space.get('xlarge'),
|
|
12
|
+
padding-bottom: space.get('xlarge'),
|
|
13
|
+
)
|
|
14
|
+
),
|
|
15
|
+
small: (
|
|
16
|
+
default: (
|
|
17
|
+
padding-top: space.get(),
|
|
18
|
+
),
|
|
19
|
+
md: (
|
|
20
|
+
padding-top: space.get('large'),
|
|
21
|
+
)
|
|
22
|
+
),
|
|
23
|
+
xsmall: (
|
|
24
|
+
default: (
|
|
25
|
+
padding-top: space.get('small'),
|
|
26
|
+
padding-bottom: space.get('small'),
|
|
27
|
+
),
|
|
28
|
+
md: (
|
|
29
|
+
padding-top: space.get('small'),
|
|
30
|
+
padding-bottom: space.get('small'),
|
|
31
|
+
)
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
$stuck-image-spacing: (
|
|
36
|
+
default: #{space.get('large') * -1},
|
|
37
|
+
md: #{space.get('xlarge') * -1},
|
|
38
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@use 'sass:map' as sassmap;
|
|
2
|
+
@use '../../../styles/tokens/breakpoint';
|
|
3
|
+
@use '../../../styles/tools/generate';
|
|
4
|
+
@use '../../../styles/tools/map';
|
|
5
|
+
@use './config';
|
|
6
|
+
|
|
7
|
+
@mixin spacing($variant, $config: config.$spacing) {
|
|
8
|
+
@include generate.responsive-css-map(sassmap.get($config, $variant));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin spacing-rules($config: config.$spacing) {
|
|
12
|
+
&:not([class*='bg-']) + &:not([class*='bg-']),
|
|
13
|
+
&[class~='bg-black'] + &[class~='bg-black'],
|
|
14
|
+
&[class~='bg-white'] + &[class~='bg-white'],
|
|
15
|
+
&[class~='bg-orange'] + &[class~='bg-orange'],
|
|
16
|
+
&[class~='bg-gray'] + &[class~='bg-gray'] {
|
|
17
|
+
&:not(.section--default) {
|
|
18
|
+
@include spacing('small');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@mixin image-stuck-to-bottom($config: config.$stuck-image-spacing) {
|
|
25
|
+
@each $breakpoint, $value in $config {
|
|
26
|
+
@include breakpoint.get($breakpoint) {
|
|
27
|
+
margin-bottom: $value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|