@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,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for the Container component
|
|
3
|
+
*
|
|
4
|
+
* Covered use cases:
|
|
5
|
+
* 1. Rendering:
|
|
6
|
+
* - Renders without crashing
|
|
7
|
+
* - Renders as a div element
|
|
8
|
+
* - Renders children (single, multiple, null, undefined, empty)
|
|
9
|
+
* 2. CSS Classes:
|
|
10
|
+
* - Applies default and custom className(s)
|
|
11
|
+
* - Handles multiple, empty, whitespace, special, long, and numeric class names
|
|
12
|
+
* 3. Props Forwarding:
|
|
13
|
+
* - Forwards standard HTML attributes (id, data-*, title, style, etc.)
|
|
14
|
+
* - Forwards event handlers (onClick, onMouseEnter, etc.)
|
|
15
|
+
* - Forwards ref to the underlying div
|
|
16
|
+
* - Forwards all standard HTML div props (tabIndex, role, aria-*)
|
|
17
|
+
* 4. Component Behavior:
|
|
18
|
+
* - Maintains displayName
|
|
19
|
+
* - Works with React.memo
|
|
20
|
+
* - Handles complex and conditional children structures
|
|
21
|
+
* 5. Edge Cases:
|
|
22
|
+
* - Handles very long className
|
|
23
|
+
* - Handles className with numbers
|
|
24
|
+
* - Handles array of children
|
|
25
|
+
* - Handles React elements as children
|
|
26
|
+
*/
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
29
|
+
import userEvent from '@testing-library/user-event';
|
|
30
|
+
|
|
31
|
+
import Container from '../';
|
|
32
|
+
|
|
33
|
+
describe('Container Component', () => {
|
|
34
|
+
describe('Rendering', () => {
|
|
35
|
+
it('should render without crashing', () => {
|
|
36
|
+
const { container } = render(<Container />);
|
|
37
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should render as a div element', () => {
|
|
41
|
+
const { container } = render(<Container />);
|
|
42
|
+
expect(container.firstChild.tagName).toBe('DIV');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should have the correct default class', () => {
|
|
46
|
+
const { container } = render(<Container />);
|
|
47
|
+
expect(container.firstChild).toHaveClass('container');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should render children correctly', () => {
|
|
51
|
+
const testContent = 'Test content';
|
|
52
|
+
render(<Container>{testContent}</Container>);
|
|
53
|
+
expect(screen.getByText(testContent)).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('should render multiple children', () => {
|
|
57
|
+
render(
|
|
58
|
+
<Container>
|
|
59
|
+
<div>First child</div>
|
|
60
|
+
<p>Second child</p>
|
|
61
|
+
<span>Third child</span>
|
|
62
|
+
</Container>
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect(screen.getByText('First child')).toBeInTheDocument();
|
|
66
|
+
expect(screen.getByText('Second child')).toBeInTheDocument();
|
|
67
|
+
expect(screen.getByText('Third child')).toBeInTheDocument();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should render empty children gracefully', () => {
|
|
71
|
+
const { container } = render(<Container>{}</Container>);
|
|
72
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
73
|
+
expect(container.firstChild).toHaveClass('container');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should render null children gracefully', () => {
|
|
77
|
+
const { container } = render(<Container>{null}</Container>);
|
|
78
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
79
|
+
expect(container.firstChild).toHaveClass('container');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should render undefined children gracefully', () => {
|
|
83
|
+
const { container } = render(<Container>{undefined}</Container>);
|
|
84
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
85
|
+
expect(container.firstChild).toHaveClass('container');
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('CSS Classes', () => {
|
|
90
|
+
it('should apply custom className in addition to default class', () => {
|
|
91
|
+
const { container } = render(<Container className="custom-class" />);
|
|
92
|
+
const element = container.firstChild;
|
|
93
|
+
|
|
94
|
+
expect(element).toHaveClass('container');
|
|
95
|
+
expect(element).toHaveClass('custom-class');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('should handle multiple custom classes', () => {
|
|
99
|
+
const { container } = render(
|
|
100
|
+
<Container className="class1 class2 class3" />
|
|
101
|
+
);
|
|
102
|
+
const element = container.firstChild;
|
|
103
|
+
|
|
104
|
+
expect(element).toHaveClass('container');
|
|
105
|
+
expect(element).toHaveClass('class1');
|
|
106
|
+
expect(element).toHaveClass('class2');
|
|
107
|
+
expect(element).toHaveClass('class3');
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('should handle empty className', () => {
|
|
111
|
+
const { container } = render(<Container className="" />);
|
|
112
|
+
const element = container.firstChild;
|
|
113
|
+
|
|
114
|
+
expect(element).toHaveClass('container');
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('should handle whitespace-only className', () => {
|
|
118
|
+
const { container } = render(<Container className=" " />);
|
|
119
|
+
const element = container.firstChild;
|
|
120
|
+
|
|
121
|
+
expect(element).toHaveClass('container');
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should handle className with special characters', () => {
|
|
125
|
+
const { container } = render(
|
|
126
|
+
<Container className="class-with-dash class_with_underscore" />
|
|
127
|
+
);
|
|
128
|
+
const element = container.firstChild;
|
|
129
|
+
|
|
130
|
+
expect(element).toHaveClass('container');
|
|
131
|
+
expect(element).toHaveClass('class-with-dash');
|
|
132
|
+
expect(element).toHaveClass('class_with_underscore');
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
describe('Props Forwarding', () => {
|
|
137
|
+
it('should forward HTML attributes', () => {
|
|
138
|
+
const { container } = render(
|
|
139
|
+
<Container
|
|
140
|
+
id="test-id"
|
|
141
|
+
data-testid="container"
|
|
142
|
+
title="Test container"
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
const element = container.firstChild;
|
|
146
|
+
|
|
147
|
+
expect(element).toHaveAttribute('id', 'test-id');
|
|
148
|
+
expect(element).toHaveAttribute('data-testid', 'container');
|
|
149
|
+
expect(element).toHaveAttribute('title', 'Test container');
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('should forward style prop', () => {
|
|
153
|
+
const customStyle = { backgroundColor: 'red', color: 'white' };
|
|
154
|
+
const { container } = render(<Container style={customStyle} />);
|
|
155
|
+
const element = container.firstChild;
|
|
156
|
+
|
|
157
|
+
expect(element).toHaveStyle('background-color: red');
|
|
158
|
+
expect(element).toHaveStyle('color: white');
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('should forward event handlers', async () => {
|
|
162
|
+
const user = userEvent.setup();
|
|
163
|
+
const handleClick = jest.fn();
|
|
164
|
+
const handleMouseEnter = jest.fn();
|
|
165
|
+
|
|
166
|
+
render(
|
|
167
|
+
<Container
|
|
168
|
+
onClick={handleClick}
|
|
169
|
+
onMouseEnter={handleMouseEnter}
|
|
170
|
+
data-testid="container"
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
const container = screen.getByTestId('container');
|
|
175
|
+
|
|
176
|
+
await user.click(container);
|
|
177
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
178
|
+
|
|
179
|
+
// Reset mock before testing mouseEnter
|
|
180
|
+
handleMouseEnter.mockClear();
|
|
181
|
+
fireEvent.mouseEnter(container);
|
|
182
|
+
expect(handleMouseEnter).toHaveBeenCalledTimes(1);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('should forward ref correctly', () => {
|
|
186
|
+
const ref = React.createRef();
|
|
187
|
+
render(<Container ref={ref} />);
|
|
188
|
+
|
|
189
|
+
expect(ref.current).toBeInstanceOf(HTMLDivElement);
|
|
190
|
+
expect(ref.current).toHaveClass('container');
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('should forward all standard HTML div props', () => {
|
|
194
|
+
const { container } = render(
|
|
195
|
+
<Container
|
|
196
|
+
id="test"
|
|
197
|
+
className="custom"
|
|
198
|
+
style={{ color: 'red' }}
|
|
199
|
+
onClick={() => {}}
|
|
200
|
+
onFocus={() => {}}
|
|
201
|
+
onBlur={() => {}}
|
|
202
|
+
tabIndex={0}
|
|
203
|
+
role="main"
|
|
204
|
+
aria-label="Main content"
|
|
205
|
+
/>
|
|
206
|
+
);
|
|
207
|
+
const element = container.firstChild;
|
|
208
|
+
|
|
209
|
+
expect(element).toHaveAttribute('id', 'test');
|
|
210
|
+
expect(element).toHaveAttribute('tabindex', '0');
|
|
211
|
+
expect(element).toHaveAttribute('role', 'main');
|
|
212
|
+
expect(element).toHaveAttribute('aria-label', 'Main content');
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
describe('Component Behavior', () => {
|
|
217
|
+
it('should maintain displayName', () => {
|
|
218
|
+
expect(Container.displayName).toBe('Container');
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
it('should work with React.memo if wrapped', () => {
|
|
222
|
+
const MemoizedContainer = React.memo(Container);
|
|
223
|
+
const { container } = render(<MemoizedContainer />);
|
|
224
|
+
|
|
225
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
226
|
+
expect(container.firstChild).toHaveClass('container');
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it('should handle complex nested structures', () => {
|
|
230
|
+
render(
|
|
231
|
+
<Container>
|
|
232
|
+
<header>
|
|
233
|
+
<h1>Title</h1>
|
|
234
|
+
<nav>
|
|
235
|
+
<ul>
|
|
236
|
+
<li><a href="#home">Home</a></li>
|
|
237
|
+
<li><a href="#about">About</a></li>
|
|
238
|
+
</ul>
|
|
239
|
+
</nav>
|
|
240
|
+
</header>
|
|
241
|
+
<main>
|
|
242
|
+
<section>
|
|
243
|
+
<h2>Section</h2>
|
|
244
|
+
<p>Content</p>
|
|
245
|
+
</section>
|
|
246
|
+
</main>
|
|
247
|
+
</Container>
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
expect(screen.getByText('Title')).toBeInTheDocument();
|
|
251
|
+
expect(screen.getByText('Home')).toBeInTheDocument();
|
|
252
|
+
expect(screen.getByText('About')).toBeInTheDocument();
|
|
253
|
+
expect(screen.getByText('Section')).toBeInTheDocument();
|
|
254
|
+
expect(screen.getByText('Content')).toBeInTheDocument();
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('should handle conditional rendering of children', () => {
|
|
258
|
+
const shouldRender = true;
|
|
259
|
+
const { rerender } = render(
|
|
260
|
+
<Container>
|
|
261
|
+
{shouldRender && <div>Conditional content</div>}
|
|
262
|
+
</Container>
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
expect(screen.getByText('Conditional content')).toBeInTheDocument();
|
|
266
|
+
|
|
267
|
+
rerender(
|
|
268
|
+
<Container>
|
|
269
|
+
{false && <div>Conditional content</div>}
|
|
270
|
+
</Container>
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
expect(screen.queryByText('Conditional content')).not.toBeInTheDocument();
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
describe('Edge Cases', () => {
|
|
278
|
+
it('should handle very long className', () => {
|
|
279
|
+
const longClassName = 'a'.repeat(1000);
|
|
280
|
+
const { container } = render(<Container className={longClassName} />);
|
|
281
|
+
const element = container.firstChild;
|
|
282
|
+
|
|
283
|
+
expect(element).toHaveClass('container');
|
|
284
|
+
expect(element).toHaveClass(longClassName);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it('should handle className with numbers', () => {
|
|
288
|
+
const { container } = render(<Container className="class123 456class" />);
|
|
289
|
+
const element = container.firstChild;
|
|
290
|
+
|
|
291
|
+
expect(element).toHaveClass('container');
|
|
292
|
+
expect(element).toHaveClass('class123');
|
|
293
|
+
expect(element).toHaveClass('456class');
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it('should handle array as children', () => {
|
|
297
|
+
const childrenArray = [
|
|
298
|
+
<div key="1">Array child 1</div>,
|
|
299
|
+
<div key="2">Array child 2</div>
|
|
300
|
+
];
|
|
301
|
+
|
|
302
|
+
render(<Container>{childrenArray}</Container>);
|
|
303
|
+
|
|
304
|
+
expect(screen.getByText('Array child 1')).toBeInTheDocument();
|
|
305
|
+
expect(screen.getByText('Array child 2')).toBeInTheDocument();
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
it('should handle React elements as children', () => {
|
|
309
|
+
const ChildComponent = () => <div>React component child</div>;
|
|
310
|
+
|
|
311
|
+
render(
|
|
312
|
+
<Container>
|
|
313
|
+
<ChildComponent />
|
|
314
|
+
</Container>
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
expect(screen.getByText('React component child')).toBeInTheDocument();
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
});
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { ComponentDocs, Note, md } from '@lighting-beetle/lighter-styleguide';
|
|
2
|
+
import { Preview } from '../../styleguide/';
|
|
3
|
+
import { Grid, GridCol } from './index';
|
|
4
|
+
import Table from '../Table';
|
|
5
|
+
import Section from '../Section';
|
|
6
|
+
import Image from '../Image';
|
|
7
|
+
import { breakpointsTableData } from '../../docs/breakpoints.mdx';
|
|
8
|
+
import {
|
|
9
|
+
ContainerHorizontal,
|
|
10
|
+
ContainerVertical,
|
|
11
|
+
ColumnVertical,
|
|
12
|
+
} from '../../docs/utils.flexalignment.mdx';
|
|
13
|
+
import spaces from '../../styles/export/space.scss';
|
|
14
|
+
|
|
15
|
+
# Grid
|
|
16
|
+
|
|
17
|
+
The main function of the grid is to distribute items to rows and columns.
|
|
18
|
+
|
|
19
|
+
Our grid has a maximum of 12 columns. Each column can have a [custom size](#columns)
|
|
20
|
+
defined by [breakpoints](#breakpoints).
|
|
21
|
+
|
|
22
|
+
## Breakpoints
|
|
23
|
+
|
|
24
|
+
Grid uses the mobile-first definition of [breakpoints](/fundamentals/breakpoints), which means that smallest
|
|
25
|
+
breakpoint defines default size.
|
|
26
|
+
|
|
27
|
+
## Columns
|
|
28
|
+
|
|
29
|
+
You can have a maximum of 12 columns in one row. A default column takes all the available
|
|
30
|
+
space.
|
|
31
|
+
|
|
32
|
+
<Preview className="preview-grid">
|
|
33
|
+
<Grid>
|
|
34
|
+
<GridCol>
|
|
35
|
+
<code>(default) 12</code>
|
|
36
|
+
</GridCol>
|
|
37
|
+
<GridCol size={6}>
|
|
38
|
+
<code>6</code>
|
|
39
|
+
</GridCol>
|
|
40
|
+
</Grid>
|
|
41
|
+
<hr />
|
|
42
|
+
<Grid>
|
|
43
|
+
<GridCol size="auto">
|
|
44
|
+
<code>auto</code>
|
|
45
|
+
</GridCol>
|
|
46
|
+
<GridCol size={4}>
|
|
47
|
+
<code>4</code>
|
|
48
|
+
</GridCol>
|
|
49
|
+
<GridCol size={6}>
|
|
50
|
+
<code>6</code>
|
|
51
|
+
</GridCol>
|
|
52
|
+
</Grid>
|
|
53
|
+
<hr />
|
|
54
|
+
<Grid>
|
|
55
|
+
<GridCol size="fill">
|
|
56
|
+
<code>fill</code>
|
|
57
|
+
</GridCol>
|
|
58
|
+
<GridCol size={4}>
|
|
59
|
+
<code>4</code>
|
|
60
|
+
</GridCol>
|
|
61
|
+
<GridCol size={6}>
|
|
62
|
+
<code>6</code>
|
|
63
|
+
</GridCol>
|
|
64
|
+
</Grid>
|
|
65
|
+
<hr />
|
|
66
|
+
<Grid>
|
|
67
|
+
<GridCol size="shrink">
|
|
68
|
+
<code>shrink</code>
|
|
69
|
+
</GridCol>
|
|
70
|
+
<GridCol size={6}>
|
|
71
|
+
<code>6</code>
|
|
72
|
+
</GridCol>
|
|
73
|
+
</Grid>
|
|
74
|
+
</Preview>
|
|
75
|
+
|
|
76
|
+
### Resizing
|
|
77
|
+
|
|
78
|
+
There are two ways of resizing a column.
|
|
79
|
+
|
|
80
|
+
1. `.grid__col--[size]` where `size` is a number 1-12 or one of `[shrink/fill/auto]`
|
|
81
|
+
2. `.grid__col--[breakpoint]-[size]` where `breakpoint` is used as a **minimum display width** to change the column size
|
|
82
|
+
|
|
83
|
+
<Note title="XS breakpoint size">
|
|
84
|
+
<p className="mb-none">
|
|
85
|
+
There is <strong>no need to specify the xs breakpoint size</strong> because
|
|
86
|
+
it's a default by definition of mobile-first philosophy.
|
|
87
|
+
</p>
|
|
88
|
+
</Note>
|
|
89
|
+
|
|
90
|
+
### What is shrink/fill/auto?
|
|
91
|
+
|
|
92
|
+
- `shrink` column takes **the least amount of space** available
|
|
93
|
+
- `fill` column takes **all the space** available and **does not shrink** to accomodate other columns
|
|
94
|
+
- `auto` takes **all available space**, also tries to **shrink** to fit into one row. This is the **same as** `.grid__col`.
|
|
95
|
+
|
|
96
|
+
<Preview className="preview-grid">
|
|
97
|
+
<Grid>
|
|
98
|
+
<GridCol>
|
|
99
|
+
<code>(default) 12</code>
|
|
100
|
+
</GridCol>
|
|
101
|
+
<GridCol size={4}>
|
|
102
|
+
<code>4</code>
|
|
103
|
+
</GridCol>
|
|
104
|
+
<GridCol size="shrink">
|
|
105
|
+
<code>shrink</code>
|
|
106
|
+
</GridCol>
|
|
107
|
+
<GridCol size="fill">
|
|
108
|
+
<code>fill</code>
|
|
109
|
+
</GridCol>
|
|
110
|
+
<GridCol size="auto">
|
|
111
|
+
<code>auto</code>
|
|
112
|
+
Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cum sociis
|
|
113
|
+
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
|
|
114
|
+
</GridCol>
|
|
115
|
+
</Grid>
|
|
116
|
+
</Preview>
|
|
117
|
+
|
|
118
|
+
### Available combinations
|
|
119
|
+
|
|
120
|
+
You can use combinations of different size types for one column at once.
|
|
121
|
+
Available types are `[1-12/shrink/fill/auto]` for every breakpoint.
|
|
122
|
+
|
|
123
|
+
<Preview className="preview-grid">
|
|
124
|
+
<Grid>
|
|
125
|
+
<GridCol size={{ sm: 9, md: 6, lg: 'fill' }}>
|
|
126
|
+
<code>(default) 12, sm-9, md-6, lg-fill</code>
|
|
127
|
+
</GridCol>
|
|
128
|
+
<GridCol size={{ sm: 3, md: 6, lg: 'fill' }}>
|
|
129
|
+
<code>(default) 12, sm-3, md-6, lg-fill</code>
|
|
130
|
+
</GridCol>
|
|
131
|
+
</Grid>
|
|
132
|
+
</Preview>
|
|
133
|
+
|
|
134
|
+
## How to create a grid
|
|
135
|
+
|
|
136
|
+
### Using React Components (Recommended)
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
import { Grid, GridCol } from './components/Grid';
|
|
140
|
+
|
|
141
|
+
// Basic grid
|
|
142
|
+
<Grid>
|
|
143
|
+
<GridCol>
|
|
144
|
+
<code>(default) 12</code>
|
|
145
|
+
</GridCol>
|
|
146
|
+
<GridCol size={6}>
|
|
147
|
+
<code>6</code>
|
|
148
|
+
</GridCol>
|
|
149
|
+
</Grid>
|
|
150
|
+
|
|
151
|
+
// Responsive grid
|
|
152
|
+
<Grid>
|
|
153
|
+
<GridCol size={{ sm: 9, md: 6, lg: 'fill' }}>
|
|
154
|
+
<code>Responsive column</code>
|
|
155
|
+
</GridCol>
|
|
156
|
+
<GridCol size={{ sm: 3, md: 6, lg: 'fill' }}>
|
|
157
|
+
<code>Another responsive column</code>
|
|
158
|
+
</GridCol>
|
|
159
|
+
</Grid>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Using HTML and CSS Classes
|
|
163
|
+
|
|
164
|
+
1. Start by creating a wrapper with a class of `.grid`
|
|
165
|
+
2. Add child elements with a class beginning with `.grid__col`
|
|
166
|
+
3. If you need, specify size of each with `.grid__col--[size]` or `.grid__col--[breakpoint]-[size]`
|
|
167
|
+
|
|
168
|
+
```html
|
|
169
|
+
<!-- grid base -->
|
|
170
|
+
<div class="grid">
|
|
171
|
+
<!-- default grid column (.grid__col--xs-12 by default) -->
|
|
172
|
+
<div class="grid__col">content</div>
|
|
173
|
+
<!-- grid column with specific sizes -->
|
|
174
|
+
<div class="grid__col grid__col--auto grid__col--md-6 grid__col--lg-4">
|
|
175
|
+
content
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Justify content height
|
|
181
|
+
|
|
182
|
+
Grid with justified content height uses flexbox with an attempt to equalize height of column children
|
|
183
|
+
|
|
184
|
+
<Preview>
|
|
185
|
+
<Grid justifyHeight>
|
|
186
|
+
<GridCol size={6} className="mb-small">
|
|
187
|
+
<div className="bg-gray">
|
|
188
|
+
<p>Children of these columns are the same height</p>
|
|
189
|
+
</div>
|
|
190
|
+
</GridCol>
|
|
191
|
+
<GridCol size={6} className="mb-small">
|
|
192
|
+
<div className="bg-gray">
|
|
193
|
+
<p>The most high column dictates the height of the row</p>
|
|
194
|
+
<Image src="https://placehold.co/150x150" alt="" />
|
|
195
|
+
</div>
|
|
196
|
+
</GridCol>
|
|
197
|
+
<GridCol className="mb-small">
|
|
198
|
+
<div className="bg-gray">
|
|
199
|
+
<p>Subsequent rows remain unaffected</p>
|
|
200
|
+
</div>
|
|
201
|
+
</GridCol>
|
|
202
|
+
</Grid>
|
|
203
|
+
</Preview>
|
|
204
|
+
|
|
205
|
+
## Container alignment
|
|
206
|
+
|
|
207
|
+
### Horizontal
|
|
208
|
+
|
|
209
|
+
<ContainerHorizontal />
|
|
210
|
+
|
|
211
|
+
### Vertical
|
|
212
|
+
|
|
213
|
+
<ContainerVertical />
|
|
214
|
+
|
|
215
|
+
## Children alignment
|
|
216
|
+
|
|
217
|
+
### Vertical
|
|
218
|
+
|
|
219
|
+
<ColumnVertical />
|
|
220
|
+
|
|
221
|
+
## Column gap size
|
|
222
|
+
|
|
223
|
+
Add larger space between grid columns or remove them completely
|
|
224
|
+
|
|
225
|
+
<Preview>
|
|
226
|
+
{['default', 'none'].map((size, index) => (
|
|
227
|
+
<>
|
|
228
|
+
<h3>Column gap size {JSON.stringify(size)}</h3>
|
|
229
|
+
<Grid
|
|
230
|
+
key={index.toString()}
|
|
231
|
+
columnGapSize={size === 'default' ? null : size}
|
|
232
|
+
className="mb-large"
|
|
233
|
+
>
|
|
234
|
+
{[1, 2, 3].map(key => (
|
|
235
|
+
<GridCol key={key.toString()} size={{ md: 4 }}>
|
|
236
|
+
<code> </code>
|
|
237
|
+
</GridCol>
|
|
238
|
+
))}
|
|
239
|
+
</Grid>
|
|
240
|
+
</>
|
|
241
|
+
))}
|
|
242
|
+
</Preview>
|
|
243
|
+
|
|
244
|
+
## Row gap size
|
|
245
|
+
|
|
246
|
+
Row gap helps to maintain space between grid rows and fixes
|
|
247
|
+
[unwanted spacing problems](/components/section#2-stacking-elements) on the bottom of grid's last row elements by removing their content margins.
|
|
248
|
+
|
|
249
|
+
There are two ways of adding a row gap.
|
|
250
|
+
|
|
251
|
+
1. `.grid-row-gap--[size]` where `size` is one of `[medium/xlarge]`
|
|
252
|
+
2. `.grid-row-gap--[breakpoint]-[size]` where `breakpoint` is used as a
|
|
253
|
+
**minimum display width** to change the gap size
|
|
254
|
+
|
|
255
|
+
<Preview>
|
|
256
|
+
{['medium', 'large', { xs: 'large', md: 'xlarge' }].map(
|
|
257
|
+
(size, index, array) => (
|
|
258
|
+
<Section key={index.toString()} className="pb-none">
|
|
259
|
+
<h3 className="mb-2">Row gap size {JSON.stringify(size)}</h3>
|
|
260
|
+
<Grid key={index.toString()} rowGapSize={size}>
|
|
261
|
+
{[1, 2, 3, 4, 5, 6].map(key => (
|
|
262
|
+
<GridCol key={key.toString()} size={{ md: 6 }}>
|
|
263
|
+
<code>6</code>
|
|
264
|
+
</GridCol>
|
|
265
|
+
))}
|
|
266
|
+
</Grid>
|
|
267
|
+
</Section>
|
|
268
|
+
)
|
|
269
|
+
)}
|
|
270
|
+
</Preview>
|
|
271
|
+
|
|
272
|
+
## Advanced Examples
|
|
273
|
+
|
|
274
|
+
### Complex Layout with Alignment
|
|
275
|
+
|
|
276
|
+
<Preview>
|
|
277
|
+
<Grid hAlign="center" vAlign="stretch">
|
|
278
|
+
<GridCol size={3} align="top">
|
|
279
|
+
<code>top aligned</code>
|
|
280
|
+
</GridCol>
|
|
281
|
+
<GridCol size="auto" align="middle">
|
|
282
|
+
<code>auto middle</code>
|
|
283
|
+
</GridCol>
|
|
284
|
+
<GridCol size="fill" align="bottom">
|
|
285
|
+
<code>fill bottom</code>
|
|
286
|
+
</GridCol>
|
|
287
|
+
<GridCol size={2} align="stretch">
|
|
288
|
+
<code>stretch</code>
|
|
289
|
+
</GridCol>
|
|
290
|
+
</Grid>
|
|
291
|
+
</Preview>
|
|
292
|
+
|
|
293
|
+
### Semantic HTML Tags
|
|
294
|
+
|
|
295
|
+
<Preview>
|
|
296
|
+
<Grid tag="section" justifyHeight>
|
|
297
|
+
<GridCol tag="article" size={8}>
|
|
298
|
+
<code>main content</code>
|
|
299
|
+
</GridCol>
|
|
300
|
+
<GridCol tag="aside" size={4}>
|
|
301
|
+
<code>sidebar</code>
|
|
302
|
+
</GridCol>
|
|
303
|
+
</Grid>
|
|
304
|
+
</Preview>
|
|
305
|
+
|
|
306
|
+
### All Column Sizes (1-12)
|
|
307
|
+
|
|
308
|
+
<Preview>
|
|
309
|
+
<Grid>
|
|
310
|
+
{Array.from({ length: 12 }, (_, i) => (
|
|
311
|
+
<GridCol key={i} size={i + 1}>
|
|
312
|
+
<code>{i + 1}</code>
|
|
313
|
+
</GridCol>
|
|
314
|
+
))}
|
|
315
|
+
</Grid>
|
|
316
|
+
</Preview>
|
|
317
|
+
|
|
318
|
+
<ComponentDocs title="<Grid />" component={Grid} />
|
|
319
|
+
<ComponentDocs title="<GridCol />" component={GridCol} />
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { genResponsiveClasses } from "../../utils";
|
|
4
|
+
|
|
5
|
+
export type GridVAlign = "stretch" | "start" | "end" | "center";
|
|
6
|
+
export type GridHAlign = "end" | "center" | "space-around" | "space-between";
|
|
7
|
+
export type GridRowGapSize =
|
|
8
|
+
| "medium"
|
|
9
|
+
| "large"
|
|
10
|
+
| "xlarge"
|
|
11
|
+
| Record<string, "medium" | "large" | "xlarge">;
|
|
12
|
+
export type GridColumnGapSize = "none";
|
|
13
|
+
|
|
14
|
+
export interface GridProps extends React.HTMLAttributes<HTMLElement> {
|
|
15
|
+
vAlign?: GridVAlign;
|
|
16
|
+
hAlign?: GridHAlign;
|
|
17
|
+
tag?: React.ElementType;
|
|
18
|
+
justifyHeight?: boolean;
|
|
19
|
+
rowGapSize?: GridRowGapSize;
|
|
20
|
+
columnGapSize?: GridColumnGapSize;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const CLASS_ROOT = "grid";
|
|
24
|
+
|
|
25
|
+
export const Grid = ({
|
|
26
|
+
className,
|
|
27
|
+
hAlign,
|
|
28
|
+
vAlign,
|
|
29
|
+
tag = "div",
|
|
30
|
+
justifyHeight,
|
|
31
|
+
rowGapSize,
|
|
32
|
+
columnGapSize,
|
|
33
|
+
...other
|
|
34
|
+
}: GridProps) => {
|
|
35
|
+
const classes = cx(
|
|
36
|
+
CLASS_ROOT,
|
|
37
|
+
{
|
|
38
|
+
[`align-items-${vAlign}`]: vAlign,
|
|
39
|
+
[`justify-content-${hAlign}`]: hAlign,
|
|
40
|
+
[`${CLASS_ROOT}--justify-height`]: justifyHeight,
|
|
41
|
+
[`${CLASS_ROOT}--column-gap-${columnGapSize}`]: columnGapSize,
|
|
42
|
+
},
|
|
43
|
+
...genResponsiveClasses(`${CLASS_ROOT}-row-gap`, rowGapSize),
|
|
44
|
+
className,
|
|
45
|
+
);
|
|
46
|
+
const TagName = tag;
|
|
47
|
+
|
|
48
|
+
return <TagName className={classes} {...other} />;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
Grid.displayName = "Grid";
|