@shohojdhara/atomix 0.1.17 → 0.1.18
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/CONTRIBUTING.md +151 -0
- package/NEXTJS_INTEGRATION.md +358 -0
- package/README.md +168 -119
- package/babel.config.js +58 -0
- package/css.d.ts +10 -0
- package/dist/css/atomix.css +1 -1
- package/dist/js/244.js +1 -0
- package/dist/js/atomix.react.cjs.js +1 -0
- package/dist/js/atomix.react.esm.js +1 -1
- package/dist/js/atomix.react.umd.js +1 -1
- package/dist/js/chunks/cjs/202.9d3b1ef1eaa0d5c8a309.js +1 -0
- package/dist/js/chunks/cjs/308.6ea9685ea38ead4120d0.js +1 -0
- package/dist/js/chunks/cjs/54.73db6922594e421ba6b1.js +1 -0
- package/dist/js/chunks/cjs/619.51feecaadcab819780d4.js +1 -0
- package/dist/js/chunks/cjs/690.90f6d11164081cbcbc4d.js +1 -0
- package/dist/js/chunks/cjs/894.24877561df336a8dfd14.js +1 -0
- package/dist/js/chunks/cjs/897.6c2a71fae95338890de7.js +1 -0
- package/dist/types/components/{Navbar → Navigation/Menu}/MegaMenu.d.ts +1 -1
- package/dist/types/components/{Navbar → Navigation/Menu}/Menu.d.ts +1 -1
- package/dist/types/components/Navigation/Nav/Nav.d.ts +20 -0
- package/dist/types/components/{Navbar → Navigation/Nav}/NavDropdown.d.ts +1 -1
- package/dist/types/components/Navigation/Nav/NavItem.d.ts +33 -0
- package/dist/types/components/Navigation/Navbar/Navbar.d.ts +19 -0
- package/dist/types/components/Navigation/SideMenu/SideMenu.d.ts +20 -0
- package/dist/types/components/Navigation/SideMenu/SideMenuItem.d.ts +30 -0
- package/dist/types/components/Navigation/SideMenu/SideMenuList.d.ts +17 -0
- package/dist/types/components/Navigation/index.d.ts +10 -0
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/lib/composables/index.d.ts +1 -0
- package/dist/types/lib/composables/useSideMenu.d.ts +28 -0
- package/dist/types/lib/constants/components.d.ts +72 -0
- package/dist/types/lib/types/components.d.ts +103 -0
- package/examples/nextjs-example.tsx +271 -0
- package/implementation-guide.md +505 -0
- package/next.config.js +69 -0
- package/package.json +26 -5
- package/postcss.config.js +28 -0
- package/src/Introduction.mdx +44 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-Alternatives.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-Alternatives.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-Alternatives.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-Alternatives.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-Expert.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-Expert.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-Expert.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-Expert.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-ItalicSwash.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-ItalicSwash.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-ItalicSwash.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-ItalicSwash.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-SmallCaps.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-SmallCaps.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-SmallCaps.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslon-SmallCaps.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Black.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Black.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Black.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Black.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-BlackItalic.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-BlackItalic.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-BlackItalic.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-BlackItalic.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Bold.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Bold.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Bold.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Bold.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-BoldItalic.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-BoldItalic.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-BoldItalic.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Italic.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Italic.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Italic.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Italic.woff2 +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Regular.eot +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Regular.ttf +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Regular.woff +0 -0
- package/src/assets/fonts/BigCaslon/BigCaslonFB-Regular.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Black.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Black.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Black.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Black.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BlackItalic.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BlackItalic.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BlackItalic.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BlackItalic.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Bold.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Bold.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Bold.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Bold.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BoldItalic.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BoldItalic.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BoldItalic.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Book.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Book.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Book.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Book.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BookItalic.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BookItalic.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BookItalic.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-BookItalic.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Heavy.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Heavy.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Heavy.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Heavy.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-HeavyItalic.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-HeavyItalic.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-HeavyItalic.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-HeavyItalic.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Light.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Light.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Light.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Light.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-LightItalic.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-LightItalic.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-LightItalic.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-LightItalic.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Medium.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Medium.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Medium.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Medium.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-MediumItalic.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-MediumItalic.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-MediumItalic.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Regular.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Regular.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Regular.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Regular.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-RegularItalic.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-RegularItalic.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-RegularItalic.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-RegularItalic.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Thin.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Thin.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Thin.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-Thin.woff2 +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-ThinItalic.eot +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-ThinItalic.ttf +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-ThinItalic.woff +0 -0
- package/src/assets/fonts/FilsonPro/FilsonPro-ThinItalic.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Bold.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Bold.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Bold.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Bold.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-BoldItalic.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-BoldItalic.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-BoldItalic.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-CondensedBlack.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-CondensedBlack.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-CondensedBlack.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-CondensedBlack.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-CondensedBold.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-CondensedBold.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-CondensedBold.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-CondensedBold.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Italic.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Italic.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Italic.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Italic.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Light.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Light.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Light.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Light.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-LightItalic.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-LightItalic.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-LightItalic.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-LightItalic.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Medium.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Medium.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Medium.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Medium.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-MediumItalic.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-MediumItalic.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-MediumItalic.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Thin.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Thin.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Thin.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-Thin.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-ThinItalic.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-ThinItalic.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-ThinItalic.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-ThinItalic.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-UltraLight.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-UltraLight.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-UltraLight.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-UltraLight.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-UltraLightItalic.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-UltraLightItalic.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-UltraLightItalic.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue-UltraLightItalic.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue.eot +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue.ttf +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue.woff +0 -0
- package/src/assets/fonts/HelveticaNeue/HelveticaNeue.woff2 +0 -0
- package/src/assets/fonts/HelveticaNeue/demo.html +569 -0
- package/src/assets/fonts/HelveticaNeue/stylesheet.css +181 -0
- package/src/assets/fonts/Lato/Lato-Black.eot +0 -0
- package/src/assets/fonts/Lato/Lato-Black.ttf +0 -0
- package/src/assets/fonts/Lato/Lato-Black.woff +0 -0
- package/src/assets/fonts/Lato/Lato-Black.woff2 +0 -0
- package/src/assets/fonts/Lato/Lato-Bold.eot +0 -0
- package/src/assets/fonts/Lato/Lato-Bold.ttf +0 -0
- package/src/assets/fonts/Lato/Lato-Bold.woff +0 -0
- package/src/assets/fonts/Lato/Lato-Bold.woff2 +0 -0
- package/src/assets/fonts/Lato/Lato-Light.eot +0 -0
- package/src/assets/fonts/Lato/Lato-Light.ttf +0 -0
- package/src/assets/fonts/Lato/Lato-Light.woff +0 -0
- package/src/assets/fonts/Lato/Lato-Light.woff2 +0 -0
- package/src/assets/fonts/Lato/Lato-Regular.eot +0 -0
- package/src/assets/fonts/Lato/Lato-Regular.ttf +0 -0
- package/src/assets/fonts/Lato/Lato-Regular.woff +0 -0
- package/src/assets/fonts/Lato/Lato-Regular.woff2 +0 -0
- package/src/assets/fonts/Lux-Icons.woff2 +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.eot +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.ttf +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.woff +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.woff2 +0 -0
- package/src/assets/fonts/OpenSans-Regular.ttf +0 -0
- package/src/assets/fonts/Roboto-Regular.ttf +0 -0
- package/src/assets/images/logo-transparent.png +0 -0
- package/src/assets/svgs/atomix-logo.svg +9 -0
- package/src/components/Accordion/Accordion.stories.tsx +271 -0
- package/src/components/Accordion/Accordion.tsx +131 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/Accordion/scripts/accordionInteractions.ts +70 -0
- package/src/components/Accordion/scripts/bundle.ts +24 -0
- package/src/components/Accordion/scripts/constants.ts +11 -0
- package/src/components/Accordion/scripts/index.ts +212 -0
- package/src/components/AtomixLogo/AtomixLogo.tsx +36 -0
- package/src/components/AtomixLogo/index.ts +3 -0
- package/src/components/AtomixLogo.tsx +40 -0
- package/src/components/Avatar/Avatar.stories.tsx +263 -0
- package/src/components/Avatar/Avatar.tsx +68 -0
- package/src/components/Avatar/AvatarGroup.tsx +73 -0
- package/src/components/Avatar/index.ts +3 -0
- package/src/components/Avatar/scripts/index.ts +497 -0
- package/src/components/Badge/Badge.stories.tsx +374 -0
- package/src/components/Badge/Badge.tsx +39 -0
- package/src/components/Badge/index.ts +3 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +108 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +98 -0
- package/src/components/Breadcrumb/index.ts +3 -0
- package/src/components/Breadcrumb/scripts/breadcrumb.ts +208 -0
- package/src/components/Breadcrumb/scripts/demo.html +246 -0
- package/src/components/Breadcrumb/scripts/index.ts +5 -0
- package/src/components/Breadcrumb/scripts/types.ts +69 -0
- package/src/components/Button/Button.stories.tsx +313 -0
- package/src/components/Button/Button.tsx +70 -0
- package/src/components/Button/index.ts +3 -0
- package/src/components/Button/scripts/buttonInteractions.ts +73 -0
- package/src/components/Button/scripts/index.ts +1 -0
- package/src/components/Callout/Callout.stories.tsx +595 -0
- package/src/components/Callout/Callout.tsx +78 -0
- package/src/components/Callout/index.ts +1 -0
- package/src/components/Callout/scripts/CalloutInteractions.ts +350 -0
- package/src/components/Callout/scripts/bundle.ts +18 -0
- package/src/components/Callout/scripts/index.ts +130 -0
- package/src/components/Card/Card.stories.tsx +107 -0
- package/src/components/Card/Card.tsx +69 -0
- package/src/components/Card/ElevationCard.tsx +47 -0
- package/src/components/Card/index.ts +15 -0
- package/src/components/Card/scripts/bundle.ts +30 -0
- package/src/components/Card/scripts/cardInteractions.ts +171 -0
- package/src/components/Card/scripts/demo.html +322 -0
- package/src/components/Card/scripts/index.ts +318 -0
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +46 -0
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +85 -0
- package/src/components/ColorModeToggle/index.ts +2 -0
- package/src/components/Countdown/Countdown.stories.tsx +47 -0
- package/src/components/Countdown/Countdown.tsx +90 -0
- package/src/components/Countdown/index.ts +2 -0
- package/src/components/Countdown/scripts/index.ts +238 -0
- package/src/components/DataTable/DataTable.stories.tsx +249 -0
- package/src/components/DataTable/DataTable.tsx +213 -0
- package/src/components/DataTable/index.ts +3 -0
- package/src/components/DataTable/scripts/bundle.ts +20 -0
- package/src/components/DataTable/scripts/index.ts +781 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +365 -0
- package/src/components/DatePicker/DatePicker.tsx +504 -0
- package/src/components/DatePicker/index.ts +4 -0
- package/src/components/DatePicker/readme.md +106 -0
- package/src/components/DatePicker/scripts/bundle.ts +39 -0
- package/src/components/DatePicker/scripts/componentInteractions.ts +230 -0
- package/src/components/DatePicker/scripts/index.ts +907 -0
- package/src/components/DatePicker/types.ts +167 -0
- package/src/components/DatePicker/utils.ts +163 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +359 -0
- package/src/components/Dropdown/Dropdown.tsx +342 -0
- package/src/components/Dropdown/index.ts +14 -0
- package/src/components/Dropdown/readme.md +151 -0
- package/src/components/Dropdown/scripts/bundle.ts +24 -0
- package/src/components/Dropdown/scripts/componentInteractions.ts +39 -0
- package/src/components/Dropdown/scripts/index.ts +612 -0
- package/src/components/EdgePanel/EdgePanel.stories.tsx +267 -0
- package/src/components/EdgePanel/EdgePanel.tsx +73 -0
- package/src/components/EdgePanel/index.ts +1 -0
- package/src/components/EdgePanel/scripts/bundle.ts +30 -0
- package/src/components/EdgePanel/scripts/edgePanelInteractions.ts +206 -0
- package/src/components/EdgePanel/scripts/index.ts +415 -0
- package/src/components/Form/Checkbox.stories.tsx +77 -0
- package/src/components/Form/Checkbox.tsx +69 -0
- package/src/components/Form/Form.stories.tsx +491 -0
- package/src/components/Form/Form.tsx +46 -0
- package/src/components/Form/FormGroup.stories.tsx +163 -0
- package/src/components/Form/FormGroup.tsx +53 -0
- package/src/components/Form/Input.stories.tsx +107 -0
- package/src/components/Form/Input.tsx +87 -0
- package/src/components/Form/Radio.stories.tsx +95 -0
- package/src/components/Form/Radio.tsx +65 -0
- package/src/components/Form/Select.stories.tsx +152 -0
- package/src/components/Form/Select.tsx +191 -0
- package/src/components/Form/Textarea.stories.tsx +124 -0
- package/src/components/Form/Textarea.tsx +78 -0
- package/src/components/Form/index.ts +7 -0
- package/src/components/Hero/Hero.stories.tsx +297 -0
- package/src/components/Hero/Hero.tsx +175 -0
- package/src/components/Hero/index.ts +6 -0
- package/src/components/Hero/scripts/bundle.ts +33 -0
- package/src/components/Hero/scripts/heroInteractions.ts +130 -0
- package/src/components/Hero/scripts/index.ts +144 -0
- package/src/components/Icon/Icon.tsx +87 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/List/List.stories.tsx +123 -0
- package/src/components/List/List.tsx +35 -0
- package/src/components/List/ListGroup.tsx +34 -0
- package/src/components/List/index.ts +2 -0
- package/src/components/Messages/Messages.stories.tsx +161 -0
- package/src/components/Messages/Messages.tsx +172 -0
- package/src/components/Messages/index.ts +3 -0
- package/src/components/Messages/scripts/bundle.ts +47 -0
- package/src/components/Messages/scripts/componentInteractions.ts +132 -0
- package/src/components/Messages/scripts/index.ts +378 -0
- package/src/components/Modal/Modal.stories.tsx +288 -0
- package/src/components/Modal/Modal.tsx +198 -0
- package/src/components/Modal/README.md +169 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Modal/scripts/bundle.ts +23 -0
- package/src/components/Modal/scripts/index.ts +374 -0
- package/src/components/Modal/scripts/modalInteractions.ts +141 -0
- package/src/components/Navigation/Menu/MegaMenu.tsx +107 -0
- package/src/components/Navigation/Menu/Menu.stories.tsx +340 -0
- package/src/components/Navigation/Menu/Menu.tsx +110 -0
- package/src/components/Navigation/Nav/Nav.stories.tsx +458 -0
- package/src/components/Navigation/Nav/Nav.tsx +50 -0
- package/src/components/Navigation/Nav/NavDropdown.tsx +105 -0
- package/src/components/Navigation/Nav/NavItem.tsx +159 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +552 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +150 -0
- package/src/components/Navigation/README.md +314 -0
- package/src/components/Navigation/SideMenu/SideMenu.README.md +494 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +618 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +101 -0
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +95 -0
- package/src/components/Navigation/SideMenu/SideMenuList.tsx +41 -0
- package/src/components/Navigation/index.ts +23 -0
- package/src/components/Navigation/scripts/NavbarInteractions.ts +171 -0
- package/src/components/Navigation/scripts/SideMenu.ts +319 -0
- package/src/components/Navigation/scripts/SideMenuBundle.ts +69 -0
- package/src/components/Navigation/scripts/SideMenuInteractions.ts +250 -0
- package/src/components/Navigation/scripts/bundle.ts +58 -0
- package/src/components/Navigation/scripts/index.ts +248 -0
- package/src/components/Pagination/Pagination.stories.tsx +194 -0
- package/src/components/Pagination/Pagination.tsx +162 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/Pagination/scripts/bundle.ts +15 -0
- package/src/components/Pagination/scripts/index.ts +315 -0
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +160 -0
- package/src/components/PhotoViewer/PhotoViewer.tsx +246 -0
- package/src/components/PhotoViewer/PhotoViewerHeader.tsx +177 -0
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +173 -0
- package/src/components/PhotoViewer/PhotoViewerInfo.tsx +65 -0
- package/src/components/PhotoViewer/PhotoViewerNavigation.tsx +82 -0
- package/src/components/PhotoViewer/PhotoViewerThumbnails.tsx +53 -0
- package/src/components/PhotoViewer/README.md +358 -0
- package/src/components/PhotoViewer/examples/ImageGallery.tsx +190 -0
- package/src/components/PhotoViewer/examples/SimpleGallery.tsx +77 -0
- package/src/components/PhotoViewer/examples/index.ts +2 -0
- package/src/components/PhotoViewer/index.ts +14 -0
- package/src/components/PhotoViewer/scripts/PhotoViewerInteractions.ts +253 -0
- package/src/components/PhotoViewer/scripts/bundle.ts +81 -0
- package/src/components/PhotoViewer/scripts/index.ts +947 -0
- package/src/components/Popover/Popover.stories.tsx +143 -0
- package/src/components/Popover/Popover.tsx +137 -0
- package/src/components/Popover/index.ts +5 -0
- package/src/components/Popover/readme.md +120 -0
- package/src/components/Popover/scripts/bundle.ts +12 -0
- package/src/components/Popover/scripts/componentInteractions.ts +299 -0
- package/src/components/Popover/scripts/index.ts +342 -0
- package/src/components/ProductReview/ProductReview.stories.tsx +88 -0
- package/src/components/ProductReview/ProductReview.tsx +169 -0
- package/src/components/ProductReview/index.ts +3 -0
- package/src/components/ProductReview/scripts/bundle.ts +3 -0
- package/src/components/ProductReview/scripts/componentInteractions.ts +129 -0
- package/src/components/ProductReview/scripts/index.ts +3 -0
- package/src/components/Progress/Progress.stories.tsx +75 -0
- package/src/components/Progress/Progress.tsx +45 -0
- package/src/components/Progress/index.ts +1 -0
- package/src/components/Progress/scripts/bundle.ts +17 -0
- package/src/components/Progress/scripts/componentInteractions.ts +101 -0
- package/src/components/Progress/scripts/index.ts +184 -0
- package/src/components/Rating/Rating.stories.tsx +109 -0
- package/src/components/Rating/Rating.tsx +286 -0
- package/src/components/Rating/index.ts +6 -0
- package/src/components/Rating/scripts/bundle.ts +39 -0
- package/src/components/Rating/scripts/index.d.ts +12 -0
- package/src/components/Rating/scripts/index.ts +336 -0
- package/src/components/Rating/scripts/ratingInteractions.ts +160 -0
- package/src/components/River/River.stories.tsx +230 -0
- package/src/components/River/River.tsx +162 -0
- package/src/components/River/examples.html +223 -0
- package/src/components/River/index.ts +2 -0
- package/src/components/River/scripts/index.ts +137 -0
- package/src/components/SectionIntro/SectionIntro.stories.tsx +145 -0
- package/src/components/SectionIntro/SectionIntro.tsx +197 -0
- package/src/components/SectionIntro/index.ts +3 -0
- package/src/components/SectionIntro/scripts/bundle.ts +9 -0
- package/src/components/SectionIntro/scripts/componentInteractions.ts +37 -0
- package/src/components/SectionIntro/scripts/index.ts +163 -0
- package/src/components/Spinner/Spinner.stories.tsx +66 -0
- package/src/components/Spinner/Spinner.tsx +36 -0
- package/src/components/Spinner/index.ts +2 -0
- package/src/components/Steps/Steps.stories.tsx +158 -0
- package/src/components/Steps/Steps.tsx +154 -0
- package/src/components/Steps/index.ts +3 -0
- package/src/components/Steps/scripts/index.ts +159 -0
- package/src/components/Tab/Tab.stories.tsx +129 -0
- package/src/components/Tab/Tab.tsx +133 -0
- package/src/components/Tab/index.ts +2 -0
- package/src/components/Tab/scripts/index.ts +200 -0
- package/src/components/Testimonial/Testimonial.stories.tsx +180 -0
- package/src/components/Testimonial/Testimonial.tsx +148 -0
- package/src/components/Testimonial/index.ts +3 -0
- package/src/components/Testimonial/scripts/index.ts +107 -0
- package/src/components/Todo/Todo.stories.tsx +155 -0
- package/src/components/Todo/Todo.tsx +158 -0
- package/src/components/Todo/index.ts +1 -0
- package/src/components/Todo/scripts/bundle.ts +14 -0
- package/src/components/Todo/scripts/index.ts +534 -0
- package/src/components/Todo/scripts/todoInteractions.ts +118 -0
- package/src/components/Todo/scripts/types.ts +19 -0
- package/src/components/Toggle/Toggle.stories.tsx +50 -0
- package/src/components/Toggle/Toggle.tsx +114 -0
- package/src/components/Toggle/index.ts +2 -0
- package/src/components/Toggle/scripts/bundle.ts +19 -0
- package/src/components/Toggle/scripts/index.ts +118 -0
- package/src/components/Toggle/scripts/toggleInteractions.ts +77 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +115 -0
- package/src/components/Tooltip/Tooltip.tsx +105 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Tooltip/scripts/bundle.ts +0 -0
- package/src/components/Tooltip/scripts/index.ts +395 -0
- package/src/components/Tooltip/scripts/tooltipInteractions.ts +165 -0
- package/src/components/Upload/Upload.stories.tsx +221 -0
- package/src/components/Upload/Upload.tsx +422 -0
- package/src/components/Upload/index.ts +3 -0
- package/src/components/Upload/scripts/index.ts +467 -0
- package/src/components/index.ts +117 -0
- package/src/design-tokens/BoxShadow/BoxShadow.stories.tsx +115 -0
- package/src/design-tokens/Colors/colors.scss +121 -0
- package/src/design-tokens/Colors/colors.stories.tsx +313 -0
- package/src/design-tokens/Spacing/Spacing.scss +62 -0
- package/src/design-tokens/Spacing/Spacing.stories.tsx +115 -0
- package/src/design-tokens/Typography/Typography.scss +240 -0
- package/src/design-tokens/Typography/Typography.stories.tsx +167 -0
- package/src/docs/atomix-component-guidelines.mdx +942 -0
- package/src/docs/atomix-roadmap.mdx +325 -0
- package/src/docs/implementation-guide.mdx +506 -0
- package/src/htmlComponentsEntry.ts +318 -0
- package/src/index.ts +21 -0
- package/src/layouts/Grid/Container.tsx +56 -0
- package/src/layouts/Grid/Grid.stories.tsx +560 -0
- package/src/layouts/Grid/Grid.tsx +67 -0
- package/src/layouts/Grid/GridCol.tsx +160 -0
- package/src/layouts/Grid/README.md +108 -0
- package/src/layouts/Grid/Row.tsx +68 -0
- package/src/layouts/Grid/index.ts +8 -0
- package/src/layouts/MasonryGrid/MasonryGrid.stories.tsx +388 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +406 -0
- package/src/layouts/MasonryGrid/MasonryGridItem.tsx +42 -0
- package/src/layouts/MasonryGrid/README.md +117 -0
- package/src/layouts/MasonryGrid/index.ts +4 -0
- package/src/layouts/index.ts +9 -0
- package/src/lib/README.md +89 -0
- package/src/lib/composables/index.ts +44 -0
- package/src/lib/composables/useAccordion.ts +129 -0
- package/src/lib/composables/useBadge.ts +42 -0
- package/src/lib/composables/useBreadcrumb.ts +74 -0
- package/src/lib/composables/useButton.ts +59 -0
- package/src/lib/composables/useCallout.ts +55 -0
- package/src/lib/composables/useCard.ts +155 -0
- package/src/lib/composables/useCheckbox.ts +70 -0
- package/src/lib/composables/useDataTable.ts +208 -0
- package/src/lib/composables/useDatePicker.ts +562 -0
- package/src/lib/composables/useDropdown.ts +272 -0
- package/src/lib/composables/useEdgePanel.ts +261 -0
- package/src/lib/composables/useForm.ts +62 -0
- package/src/lib/composables/useFormGroup.ts +51 -0
- package/src/lib/composables/useHero.ts +250 -0
- package/src/lib/composables/useInput.ts +58 -0
- package/src/lib/composables/useMessages.ts +77 -0
- package/src/lib/composables/useModal.ts +110 -0
- package/src/lib/composables/useNavbar.ts +288 -0
- package/src/lib/composables/usePagination.ts +101 -0
- package/src/lib/composables/usePhotoViewer.ts +904 -0
- package/src/lib/composables/usePopover.ts +354 -0
- package/src/lib/composables/useProgress.ts +74 -0
- package/src/lib/composables/useRadio.ts +47 -0
- package/src/lib/composables/useRating.ts +174 -0
- package/src/lib/composables/useRiver.ts +205 -0
- package/src/lib/composables/useSelect.ts +52 -0
- package/src/lib/composables/useSideMenu.ts +197 -0
- package/src/lib/composables/useSpinner.ts +42 -0
- package/src/lib/composables/useTextarea.ts +55 -0
- package/src/lib/composables/useTodo.ts +142 -0
- package/src/lib/constants/components.ts +1050 -0
- package/src/lib/constants/index.ts +4 -0
- package/src/lib/index.ts +11 -0
- package/src/lib/types/components.ts +2498 -0
- package/src/lib/types/index.ts +2 -0
- package/src/lib/utils/dom.ts +41 -0
- package/src/lib/utils/icons.ts +74 -0
- package/src/lib/utils/index.ts +7 -0
- package/src/lib/utils/useForkRef.ts +36 -0
- package/src/styles/01-settings/_index.scss +64 -0
- package/src/styles/01-settings/_settings.accordion.scss +29 -0
- package/src/styles/01-settings/_settings.animations.scss +2 -0
- package/src/styles/01-settings/_settings.avatar-group.scss +20 -0
- package/src/styles/01-settings/_settings.avatar.scss +46 -0
- package/src/styles/01-settings/_settings.badge.scss +12 -0
- package/src/styles/01-settings/_settings.border-radius.scss +12 -0
- package/src/styles/01-settings/_settings.border.scss +14 -0
- package/src/styles/01-settings/_settings.box-shadow.scss +28 -0
- package/src/styles/01-settings/_settings.breadcrumb.scss +19 -0
- package/src/styles/01-settings/_settings.breakpoints.scss +8 -0
- package/src/styles/01-settings/_settings.btn-group.scss +1 -0
- package/src/styles/01-settings/_settings.button.scss +81 -0
- package/src/styles/01-settings/_settings.callout.scss +61 -0
- package/src/styles/01-settings/_settings.card.scss +36 -0
- package/src/styles/01-settings/_settings.checkbox-group.scss +2 -0
- package/src/styles/01-settings/_settings.checkbox.scss +20 -0
- package/src/styles/01-settings/_settings.color-mode.scss +5 -0
- package/src/styles/01-settings/_settings.colors.scss +252 -0
- package/src/styles/01-settings/_settings.config.scss +4 -0
- package/src/styles/01-settings/_settings.countdown.scss +15 -0
- package/src/styles/01-settings/_settings.data-table.scss +52 -0
- package/src/styles/01-settings/_settings.datepicker.scss +44 -0
- package/src/styles/01-settings/_settings.dropdown.scss +38 -0
- package/src/styles/01-settings/_settings.edge-panel.scss +17 -0
- package/src/styles/01-settings/_settings.fonts.scss +17 -0
- package/src/styles/01-settings/_settings.form-group.scss +11 -0
- package/src/styles/01-settings/_settings.form.scss +3 -0
- package/src/styles/01-settings/_settings.grid.scss +15 -0
- package/src/styles/01-settings/_settings.hero.scss +30 -0
- package/src/styles/01-settings/_settings.input.scss +38 -0
- package/src/styles/01-settings/_settings.link.scss +12 -0
- package/src/styles/01-settings/_settings.list-group.scss +14 -0
- package/src/styles/01-settings/_settings.list.scss +10 -0
- package/src/styles/01-settings/_settings.maps.scss +278 -0
- package/src/styles/01-settings/_settings.masonry-grid.scss +17 -0
- package/src/styles/01-settings/_settings.menu.scss +35 -0
- package/src/styles/01-settings/_settings.messages.scss +71 -0
- package/src/styles/01-settings/_settings.modal.scss +31 -0
- package/src/styles/01-settings/_settings.nav.scss +18 -0
- package/src/styles/01-settings/_settings.navbar.scss +46 -0
- package/src/styles/01-settings/_settings.pagination.scss +29 -0
- package/src/styles/01-settings/_settings.photoviewer.scss +35 -0
- package/src/styles/01-settings/_settings.popover.scss +13 -0
- package/src/styles/01-settings/_settings.position.scss +7 -0
- package/src/styles/01-settings/_settings.progress.scss +15 -0
- package/src/styles/01-settings/_settings.rating.scss +8 -0
- package/src/styles/01-settings/_settings.river.scss +34 -0
- package/src/styles/01-settings/_settings.sectionintro.scss +21 -0
- package/src/styles/01-settings/_settings.select.scss +32 -0
- package/src/styles/01-settings/_settings.side-menu.scss +64 -0
- package/src/styles/01-settings/_settings.skeleton.scss +14 -0
- package/src/styles/01-settings/_settings.spacing.scss +68 -0
- package/src/styles/01-settings/_settings.spinner.scss +13 -0
- package/src/styles/01-settings/_settings.steps.scss +26 -0
- package/src/styles/01-settings/_settings.tabs.scss +28 -0
- package/src/styles/01-settings/_settings.testimonials.scss +18 -0
- package/src/styles/01-settings/_settings.todo.scss +50 -0
- package/src/styles/01-settings/_settings.toggle.scss +34 -0
- package/src/styles/01-settings/_settings.tooltip.scss +19 -0
- package/src/styles/01-settings/_settings.typography.scss +93 -0
- package/src/styles/01-settings/_settings.upload.scss +70 -0
- package/src/styles/01-settings/_settings.z-layers.scss +9 -0
- package/src/styles/02-tools/_index.scss +20 -0
- package/src/styles/02-tools/_tools.animations.scss +19 -0
- package/src/styles/02-tools/_tools.border-radius.scss +78 -0
- package/src/styles/02-tools/_tools.breakpoints.scss +48 -0
- package/src/styles/02-tools/_tools.button.scss +115 -0
- package/src/styles/02-tools/_tools.clearfix.scss +10 -0
- package/src/styles/02-tools/_tools.color-functions.scss +28 -0
- package/src/styles/02-tools/_tools.color-mode.scss +22 -0
- package/src/styles/02-tools/_tools.event.scss +22 -0
- package/src/styles/02-tools/_tools.grid.scss +76 -0
- package/src/styles/02-tools/_tools.hidden-visually.scss +32 -0
- package/src/styles/02-tools/_tools.hidden.scss +2 -0
- package/src/styles/02-tools/_tools.map-loop.scss +31 -0
- package/src/styles/02-tools/_tools.media-queries.scss +69 -0
- package/src/styles/02-tools/_tools.object-fit.scss +4 -0
- package/src/styles/02-tools/_tools.placeholder.scss +17 -0
- package/src/styles/02-tools/_tools.rem.scss +5 -0
- package/src/styles/02-tools/_tools.size.scss +8 -0
- package/src/styles/02-tools/_tools.spacing.scss +140 -0
- package/src/styles/02-tools/_tools.to-rgb.scss +9 -0
- package/src/styles/02-tools/_tools.transition.scss +50 -0
- package/src/styles/02-tools/_tools.utilities.scss +14 -0
- package/src/styles/02-tools/_tools.utility-api.scss +144 -0
- package/src/styles/03-generic/_generic.fonts.scss +24 -0
- package/src/styles/03-generic/_generic.reset.scss +402 -0
- package/src/styles/03-generic/_generic.root.scss +184 -0
- package/src/styles/03-generic/_generic.selection.scss +15 -0
- package/src/styles/03-generic/_index.scss +5 -0
- package/src/styles/04-elements/_elements.all.scss +16 -0
- package/src/styles/04-elements/_elements.body.scss +15 -0
- package/src/styles/04-elements/_elements.heading.scss +54 -0
- package/src/styles/04-elements/_elements.html.scss +9 -0
- package/src/styles/04-elements/_elements.links.scss +11 -0
- package/src/styles/04-elements/_index.scss +6 -0
- package/src/styles/05-objects/_index.scss +4 -0
- package/src/styles/05-objects/_objects.container.scss +36 -0
- package/src/styles/05-objects/_objects.grid.scss +25 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +96 -0
- package/src/styles/06-components/_components.accordion.scss +109 -0
- package/src/styles/06-components/_components.avatar-group.scss +85 -0
- package/src/styles/06-components/_components.avatar.scss +101 -0
- package/src/styles/06-components/_components.badge.scss +62 -0
- package/src/styles/06-components/_components.breadcrumb.scss +80 -0
- package/src/styles/06-components/_components.btn-group.scss +35 -0
- package/src/styles/06-components/_components.button.scss +134 -0
- package/src/styles/06-components/_components.callout.scss +272 -0
- package/src/styles/06-components/_components.card.scss +148 -0
- package/src/styles/06-components/_components.checkbox-group.scss +17 -0
- package/src/styles/06-components/_components.checkbox.scss +135 -0
- package/src/styles/06-components/_components.color-mode-toggle.scss +36 -0
- package/src/styles/06-components/_components.countdown.scss +63 -0
- package/src/styles/06-components/_components.data-table.scss +183 -0
- package/src/styles/06-components/_components.datepicker.scss +546 -0
- package/src/styles/06-components/_components.dropdown.scss +255 -0
- package/src/styles/06-components/_components.edge-panel.scss +350 -0
- package/src/styles/06-components/_components.form-group.scss +78 -0
- package/src/styles/06-components/_components.form.scss +21 -0
- package/src/styles/06-components/_components.hero.scss +147 -0
- package/src/styles/06-components/_components.icon.scss +80 -0
- package/src/styles/06-components/_components.image-gallery.scss +72 -0
- package/src/styles/06-components/_components.input.scss +107 -0
- package/src/styles/06-components/_components.list-group.scss +63 -0
- package/src/styles/06-components/_components.list.scss +57 -0
- package/src/styles/06-components/_components.menu.scss +239 -0
- package/src/styles/06-components/_components.messages.scss +332 -0
- package/src/styles/06-components/_components.modal.scss +153 -0
- package/src/styles/06-components/_components.nav.scss +172 -0
- package/src/styles/06-components/_components.navbar.scss +310 -0
- package/src/styles/06-components/_components.pagination.scss +155 -0
- package/src/styles/06-components/_components.photoviewer.scss +878 -0
- package/src/styles/06-components/_components.popover.scss +99 -0
- package/src/styles/06-components/_components.product-review.scss +128 -0
- package/src/styles/06-components/_components.progress.scss +43 -0
- package/src/styles/06-components/_components.rating.scss +161 -0
- package/src/styles/06-components/_components.river.scss +216 -0
- package/src/styles/06-components/_components.sectionintro.scss +163 -0
- package/src/styles/06-components/_components.select.scss +125 -0
- package/src/styles/06-components/_components.side-menu.scss +234 -0
- package/src/styles/06-components/_components.skeleton.scss +55 -0
- package/src/styles/06-components/_components.spinner.scss +45 -0
- package/src/styles/06-components/_components.steps.scss +99 -0
- package/src/styles/06-components/_components.tabs.scss +124 -0
- package/src/styles/06-components/_components.testimonials.scss +65 -0
- package/src/styles/06-components/_components.todo.scss +163 -0
- package/src/styles/06-components/_components.toggle.scss +100 -0
- package/src/styles/06-components/_components.tooltip.scss +136 -0
- package/src/styles/06-components/_components.upload.scss +250 -0
- package/src/styles/06-components/_index.scss +49 -0
- package/src/styles/99-utilities/_index.scss +21 -0
- package/src/styles/99-utilities/_utilities.background.scss +28 -0
- package/src/styles/99-utilities/_utilities.border.scss +157 -0
- package/src/styles/99-utilities/_utilities.clearfix.scss +5 -0
- package/src/styles/99-utilities/_utilities.display.scss +13 -0
- package/src/styles/99-utilities/_utilities.flex.scss +109 -0
- package/src/styles/99-utilities/_utilities.link.scss +96 -0
- package/src/styles/99-utilities/_utilities.object-fit.scss +17 -0
- package/src/styles/99-utilities/_utilities.opacity.scss +16 -0
- package/src/styles/99-utilities/_utilities.overflow.scss +20 -0
- package/src/styles/99-utilities/_utilities.position.scss +40 -0
- package/src/styles/99-utilities/_utilities.scss +42 -0
- package/src/styles/99-utilities/_utilities.shadow.scss +19 -0
- package/src/styles/99-utilities/_utilities.sizes.scss +81 -0
- package/src/styles/99-utilities/_utilities.spacing.scss +188 -0
- package/src/styles/99-utilities/_utilities.text.scss +87 -0
- package/src/styles/99-utilities/_utilities.visibility.scss +13 -0
- package/src/styles/99-utilities/_utilities.visually-hidden.scss +5 -0
- package/src/styles/99-utilities/_utilities.z-index.scss +11 -0
- package/src/styles/index.scss +12 -0
- package/tsconfig.json +74 -0
- package/webpack.config.js +463 -0
- package/dist/types/components/Navbar/Nav.d.ts +0 -5
- package/dist/types/components/Navbar/NavItem.d.ts +0 -5
- package/dist/types/components/Navbar/Navbar.d.ts +0 -5
- package/dist/types/components/Navbar/index.d.ts +0 -6
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
forwardRef,
|
|
3
|
+
HTMLAttributes,
|
|
4
|
+
ReactNode,
|
|
5
|
+
useEffect,
|
|
6
|
+
useImperativeHandle,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
useCallback,
|
|
10
|
+
useMemo,
|
|
11
|
+
Children,
|
|
12
|
+
cloneElement,
|
|
13
|
+
isValidElement,
|
|
14
|
+
} from 'react';
|
|
15
|
+
// Import styles for scoped CSS modules
|
|
16
|
+
|
|
17
|
+
export interface MasonryGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
/**
|
|
19
|
+
* The content to be rendered within the masonry grid
|
|
20
|
+
*/
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Additional CSS class names
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Number of columns at extra small breakpoint (default)
|
|
28
|
+
*/
|
|
29
|
+
xs?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Number of columns at small breakpoint
|
|
32
|
+
*/
|
|
33
|
+
sm?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Number of columns at medium breakpoint
|
|
36
|
+
*/
|
|
37
|
+
md?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Number of columns at large breakpoint
|
|
40
|
+
*/
|
|
41
|
+
lg?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Number of columns at extra large breakpoint
|
|
44
|
+
*/
|
|
45
|
+
xl?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Number of columns at extra extra large breakpoint
|
|
48
|
+
*/
|
|
49
|
+
xxl?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Gap between items (in pixels)
|
|
52
|
+
*/
|
|
53
|
+
gap?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Whether to animate item transitions
|
|
56
|
+
*/
|
|
57
|
+
animate?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to handle image loading to prevent layout shifts
|
|
60
|
+
* When true, items will be shown immediately and positions updated as images load
|
|
61
|
+
*/
|
|
62
|
+
imagesLoaded?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Callback fired when all images are loaded and layout is complete
|
|
65
|
+
*/
|
|
66
|
+
onLayoutComplete?: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Callback fired each time an image loads and layout is updated
|
|
69
|
+
*/
|
|
70
|
+
onImageLoad?: (loadedCount: number, totalCount: number) => void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface ItemPosition {
|
|
74
|
+
left: number;
|
|
75
|
+
top: number;
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface MasonryItemData {
|
|
81
|
+
element: React.ReactElement;
|
|
82
|
+
position: ItemPosition | null;
|
|
83
|
+
ref: React.RefObject<HTMLDivElement>;
|
|
84
|
+
id: string;
|
|
85
|
+
imageLoaded?: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* MasonryGrid component for creating a responsive masonry layout.
|
|
90
|
+
* Uses JavaScript to position items optimally based on available vertical space,
|
|
91
|
+
* similar to how a mason fits stones in a wall.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```tsx
|
|
95
|
+
* <MasonryGrid xs={1} sm={2} md={3} lg={4}>
|
|
96
|
+
* <MasonryGridItem>Item 1</MasonryGridItem>
|
|
97
|
+
* <MasonryGridItem>Item 2</MasonryGridItem>
|
|
98
|
+
* <MasonryGridItem>Item 3</MasonryGridItem>
|
|
99
|
+
* </MasonryGrid>
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export const MasonryGrid = forwardRef<HTMLDivElement, MasonryGridProps>(
|
|
103
|
+
(
|
|
104
|
+
{
|
|
105
|
+
children,
|
|
106
|
+
className = '',
|
|
107
|
+
xs = 1,
|
|
108
|
+
sm,
|
|
109
|
+
md,
|
|
110
|
+
lg,
|
|
111
|
+
xl,
|
|
112
|
+
xxl,
|
|
113
|
+
gap = 16,
|
|
114
|
+
animate = true,
|
|
115
|
+
imagesLoaded = true,
|
|
116
|
+
onLayoutComplete,
|
|
117
|
+
onImageLoad,
|
|
118
|
+
...props
|
|
119
|
+
},
|
|
120
|
+
ref
|
|
121
|
+
) => {
|
|
122
|
+
// === REFS & STATE ===
|
|
123
|
+
const [columns, setColumns] = useState(xs);
|
|
124
|
+
const [positions, setPositions] = useState<ItemPosition[]>([]);
|
|
125
|
+
const [layoutComplete, setLayoutComplete] = useState(false);
|
|
126
|
+
const [loadingImages, setLoadingImages] = useState(false);
|
|
127
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
128
|
+
const columnHeights = useRef<number[]>([]);
|
|
129
|
+
const imagesLoadedCount = useRef(0);
|
|
130
|
+
const totalImagesCount = useRef(0);
|
|
131
|
+
const imageElements = useRef<Map<HTMLImageElement, boolean>>(new Map());
|
|
132
|
+
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (imagesLoaded) setLoadingImages(true);
|
|
135
|
+
else setLoadingImages(false);
|
|
136
|
+
}, [columns, imagesLoaded]);
|
|
137
|
+
|
|
138
|
+
// Types
|
|
139
|
+
type MasonryImageElement = HTMLImageElement & {
|
|
140
|
+
_masonryLoadHandler?: EventListener;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// Forward ref for parent components
|
|
144
|
+
useImperativeHandle(ref, () => containerRef.current as HTMLDivElement);
|
|
145
|
+
|
|
146
|
+
// === HANDLE RESPONSIVE COLUMNS ===
|
|
147
|
+
const getResponsiveColumns = useCallback(() => {
|
|
148
|
+
const width = window.innerWidth;
|
|
149
|
+
if (width >= 1400 && xxl !== undefined) return xxl;
|
|
150
|
+
if (width >= 1200 && xl !== undefined) return xl;
|
|
151
|
+
if (width >= 992 && lg !== undefined) return lg;
|
|
152
|
+
if (width >= 768 && md !== undefined) return md;
|
|
153
|
+
if (width >= 576 && sm !== undefined) return sm;
|
|
154
|
+
return xs;
|
|
155
|
+
}, [xs, sm, md, lg, xl, xxl]);
|
|
156
|
+
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
const handleResize = () => setColumns(getResponsiveColumns());
|
|
159
|
+
handleResize(); // Set on mount
|
|
160
|
+
window.addEventListener('resize', handleResize);
|
|
161
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
162
|
+
}, [getResponsiveColumns]);
|
|
163
|
+
|
|
164
|
+
// === PREPARE ITEMS WITH REFS ===
|
|
165
|
+
const [items, setItems] = useState<MasonryItemData[]>([]);
|
|
166
|
+
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
const newItems: MasonryItemData[] = [];
|
|
169
|
+
Children.forEach(children, (child, index) => {
|
|
170
|
+
if (!isValidElement(child)) return;
|
|
171
|
+
newItems.push({
|
|
172
|
+
id: child.key?.toString() || `masonry-item-${index}`,
|
|
173
|
+
element: child,
|
|
174
|
+
position: null,
|
|
175
|
+
ref: React.createRef<HTMLDivElement>(),
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
setItems(newItems);
|
|
179
|
+
}, [children]);
|
|
180
|
+
|
|
181
|
+
// === TRACK & MANAGE IMAGES ===
|
|
182
|
+
|
|
183
|
+
const handleImageLoad = useCallback(
|
|
184
|
+
(img: HTMLImageElement) => {
|
|
185
|
+
if (imageElements.current.get(img)) return;
|
|
186
|
+
imageElements.current.set(img, true);
|
|
187
|
+
imagesLoadedCount.current += 1;
|
|
188
|
+
// Add loaded class for animation
|
|
189
|
+
if (containerRef.current && imagesLoaded) {
|
|
190
|
+
const itemElement = img.closest('.o-masonry-grid > div');
|
|
191
|
+
if (itemElement) {
|
|
192
|
+
// FORCE a sync browser reflow so offsetHeight reflects the new image size before measuring Masonry
|
|
193
|
+
void (itemElement as HTMLElement).offsetHeight;
|
|
194
|
+
itemElement.classList.add('o-masonry-grid__item-loaded');
|
|
195
|
+
itemElement.classList.remove('o-masonry-grid__item-loading');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Ensure layout is recalculated after DOM paints the item image (prevents overlap on slow/late image loads)
|
|
199
|
+
requestAnimationFrame(() => {
|
|
200
|
+
requestAnimationFrame(() => {
|
|
201
|
+
calculateLayout();
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
onImageLoad?.(imagesLoadedCount.current, totalImagesCount.current);
|
|
205
|
+
|
|
206
|
+
// If all images have loaded, update loading state and complete layout
|
|
207
|
+
if (imagesLoadedCount.current >= totalImagesCount.current && totalImagesCount.current > 0) {
|
|
208
|
+
setLayoutComplete(true);
|
|
209
|
+
setLoadingImages(false); // This ensures the loading class is removed *immediately* after images load
|
|
210
|
+
// Force a double requestAnimationFrame for final layout calculation after all images are loaded (guarantees DOM paint)
|
|
211
|
+
requestAnimationFrame(() => {
|
|
212
|
+
requestAnimationFrame(() => {
|
|
213
|
+
calculateLayout();
|
|
214
|
+
// As a failsafe, if still present for some render lag, force another setLoadingImages(false)
|
|
215
|
+
setLoadingImages(false);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
onLayoutComplete?.();
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
[onImageLoad, onLayoutComplete, imagesLoaded]
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
const trackImages = useCallback(() => {
|
|
225
|
+
if (!imagesLoaded || !containerRef.current) return undefined;
|
|
226
|
+
imageElements.current.clear();
|
|
227
|
+
imagesLoadedCount.current = 0;
|
|
228
|
+
const images = containerRef.current.querySelectorAll('img');
|
|
229
|
+
totalImagesCount.current = images.length;
|
|
230
|
+
if (images.length === 0) {
|
|
231
|
+
setLayoutComplete(true);
|
|
232
|
+
setLoadingImages(false);
|
|
233
|
+
onLayoutComplete?.();
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
setLoadingImages(true);
|
|
237
|
+
images.forEach(img => {
|
|
238
|
+
const masonryImg = img as MasonryImageElement;
|
|
239
|
+
const itemElement = img.closest('.o-masonry-grid > div');
|
|
240
|
+
if (itemElement) {
|
|
241
|
+
itemElement.classList.add('o-masonry-grid__item-loading');
|
|
242
|
+
}
|
|
243
|
+
if (img.complete) {
|
|
244
|
+
handleImageLoad(img);
|
|
245
|
+
} else {
|
|
246
|
+
const loadHandler = () => handleImageLoad(img);
|
|
247
|
+
img.addEventListener('load', loadHandler);
|
|
248
|
+
img.addEventListener('error', loadHandler);
|
|
249
|
+
masonryImg._masonryLoadHandler = loadHandler;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
// Cleanup
|
|
253
|
+
return () => {
|
|
254
|
+
images.forEach(img => {
|
|
255
|
+
const masonryImg = img as MasonryImageElement;
|
|
256
|
+
if (masonryImg._masonryLoadHandler) {
|
|
257
|
+
img.removeEventListener('load', masonryImg._masonryLoadHandler);
|
|
258
|
+
img.removeEventListener('error', masonryImg._masonryLoadHandler);
|
|
259
|
+
delete masonryImg._masonryLoadHandler;
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
}, [imagesLoaded, handleImageLoad, onLayoutComplete]);
|
|
264
|
+
|
|
265
|
+
// === MANAGE ITEM LAYOUT ===
|
|
266
|
+
const calculateLayout = useCallback(() => {
|
|
267
|
+
if (!containerRef.current || items.length === 0) return;
|
|
268
|
+
const containerWidth = containerRef.current.offsetWidth;
|
|
269
|
+
const colWidth = (containerWidth - gap * (columns - 1)) / columns;
|
|
270
|
+
columnHeights.current = Array(columns).fill(0);
|
|
271
|
+
const newPositions: ItemPosition[] = [];
|
|
272
|
+
items.forEach((item, index) => {
|
|
273
|
+
if (item.ref.current) {
|
|
274
|
+
// Find the shortest column
|
|
275
|
+
const shortestCol = columnHeights.current.indexOf(Math.min(...columnHeights.current));
|
|
276
|
+
const left = shortestCol * (colWidth + gap);
|
|
277
|
+
const top = columnHeights.current[shortestCol];
|
|
278
|
+
const height = item.ref.current.offsetHeight;
|
|
279
|
+
columnHeights.current[shortestCol] = top + height + gap;
|
|
280
|
+
newPositions[index] = {
|
|
281
|
+
left,
|
|
282
|
+
top,
|
|
283
|
+
width: colWidth,
|
|
284
|
+
height,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
setPositions(newPositions);
|
|
289
|
+
}, [items, columns, gap]);
|
|
290
|
+
|
|
291
|
+
// === OBSERVE CONTAINER RESIZE ===
|
|
292
|
+
useEffect(() => {
|
|
293
|
+
if (!containerRef.current) return undefined;
|
|
294
|
+
let animationFrame: ReturnType<typeof requestAnimationFrame> | null = null;
|
|
295
|
+
const observer = new ResizeObserver(() => {
|
|
296
|
+
if (animationFrame) cancelAnimationFrame(animationFrame);
|
|
297
|
+
animationFrame = requestAnimationFrame(() => calculateLayout());
|
|
298
|
+
});
|
|
299
|
+
observer.observe(containerRef.current);
|
|
300
|
+
return () => {
|
|
301
|
+
observer.disconnect();
|
|
302
|
+
if (animationFrame) cancelAnimationFrame(animationFrame);
|
|
303
|
+
};
|
|
304
|
+
}, [calculateLayout]);
|
|
305
|
+
|
|
306
|
+
// === LAYOUT EFFECT (REPLACES setTimeout) ===
|
|
307
|
+
React.useLayoutEffect(() => {
|
|
308
|
+
if (imagesLoaded) {
|
|
309
|
+
const cleanup = trackImages();
|
|
310
|
+
return cleanup;
|
|
311
|
+
} else {
|
|
312
|
+
calculateLayout();
|
|
313
|
+
setLayoutComplete(true);
|
|
314
|
+
setLoadingImages(false);
|
|
315
|
+
return undefined;
|
|
316
|
+
}
|
|
317
|
+
// Only reset layoutComplete when items or columns change
|
|
318
|
+
}, [items, columns, calculateLayout, imagesLoaded, trackImages]);
|
|
319
|
+
|
|
320
|
+
// === NEW: Add ResizeObservers to all grid items for bulletproof image+content measurement ===
|
|
321
|
+
React.useEffect(() => {
|
|
322
|
+
// Clean up old observers if items ever change
|
|
323
|
+
const observers: ResizeObserver[] = [];
|
|
324
|
+
items.forEach(item => {
|
|
325
|
+
if (item.ref.current) {
|
|
326
|
+
const obs = new ResizeObserver(() => {
|
|
327
|
+
// Double rAF: ensures layout only runs after DOM/paint/async renders
|
|
328
|
+
requestAnimationFrame(() => {
|
|
329
|
+
requestAnimationFrame(() => {
|
|
330
|
+
calculateLayout();
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
obs.observe(item.ref.current);
|
|
335
|
+
observers.push(obs);
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
return () => {
|
|
339
|
+
observers.forEach(obs => obs.disconnect());
|
|
340
|
+
};
|
|
341
|
+
}, [items, calculateLayout]);
|
|
342
|
+
|
|
343
|
+
// Ensure loadingImages state resets when items/columns/imagesLoaded change
|
|
344
|
+
|
|
345
|
+
// === DETERMINE CONTAINER HEIGHT ===
|
|
346
|
+
const containerHeight =
|
|
347
|
+
columnHeights.current.length > 0 ? Math.max(...columnHeights.current) : 0;
|
|
348
|
+
|
|
349
|
+
// === DETERMINE CLASSES ===
|
|
350
|
+
const classes = [
|
|
351
|
+
'o-masonry-grid',
|
|
352
|
+
className,
|
|
353
|
+
animate ? 'o-masonry-grid--animate' : '',
|
|
354
|
+
loadingImages ? 'o-masonry-grid--loading-images' : '',
|
|
355
|
+
]
|
|
356
|
+
.filter(Boolean)
|
|
357
|
+
.join(' ');
|
|
358
|
+
|
|
359
|
+
// === RENDER ===
|
|
360
|
+
|
|
361
|
+
return (
|
|
362
|
+
<div
|
|
363
|
+
ref={containerRef}
|
|
364
|
+
className={classes}
|
|
365
|
+
style={{
|
|
366
|
+
position: 'relative',
|
|
367
|
+
width: '100%',
|
|
368
|
+
height: `${containerHeight}px`,
|
|
369
|
+
...props.style,
|
|
370
|
+
}}
|
|
371
|
+
{...props}
|
|
372
|
+
>
|
|
373
|
+
{items.map((item, index) => {
|
|
374
|
+
const position = positions[index];
|
|
375
|
+
if (!position) {
|
|
376
|
+
return (
|
|
377
|
+
<div key={item.id} ref={item.ref} style={{ opacity: 0, position: 'absolute' }}>
|
|
378
|
+
{item.element}
|
|
379
|
+
</div>
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
return (
|
|
383
|
+
<div
|
|
384
|
+
key={item.id}
|
|
385
|
+
ref={item.ref}
|
|
386
|
+
className="o-masonry-grid__item"
|
|
387
|
+
style={{
|
|
388
|
+
position: 'absolute',
|
|
389
|
+
left: `${position.left}px`,
|
|
390
|
+
top: `${position.top}px`,
|
|
391
|
+
width: `${position.width}px`,
|
|
392
|
+
opacity: 1,
|
|
393
|
+
}}
|
|
394
|
+
>
|
|
395
|
+
{item.element}
|
|
396
|
+
</div>
|
|
397
|
+
);
|
|
398
|
+
})}
|
|
399
|
+
</div>
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
);
|
|
403
|
+
|
|
404
|
+
MasonryGrid.displayName = 'MasonryGrid';
|
|
405
|
+
|
|
406
|
+
// Ensure loadingImages state resets when items/columns/imagesLoaded change
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { forwardRef, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface MasonryGridItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The content to be rendered within the masonry grid item
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class names
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* MasonryGridItem component for creating items within a MasonryGrid.
|
|
16
|
+
* Each item will be positioned optimally by the parent MasonryGrid component.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <MasonryGrid>
|
|
21
|
+
* <MasonryGridItem>Item 1</MasonryGridItem>
|
|
22
|
+
* <MasonryGridItem>Item 2</MasonryGridItem>
|
|
23
|
+
* </MasonryGrid>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export const MasonryGridItem = forwardRef<HTMLDivElement, MasonryGridItemProps>(
|
|
27
|
+
({ children, className = '', ...props }, ref) => {
|
|
28
|
+
const classes = ['o-masonry-grid__item-inner'];
|
|
29
|
+
|
|
30
|
+
if (className) {
|
|
31
|
+
classes.push(className);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div ref={ref} className={classes.join(' ')} {...props}>
|
|
36
|
+
{children}
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
MasonryGridItem.displayName = 'MasonryGridItem';
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Masonry Grid
|
|
2
|
+
|
|
3
|
+
A responsive masonry grid layout component for creating Pinterest-like grid layouts with items of varying heights.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
The MasonryGrid component creates a responsive grid layout that arranges items optimally based on their height, similar to Pinterest or other masonry-style layouts.
|
|
8
|
+
|
|
9
|
+
```jsx
|
|
10
|
+
import { MasonryGrid, MasonryGridItem } from './MasonryGrid';
|
|
11
|
+
|
|
12
|
+
<MasonryGrid xs={1} sm={2} md={3} lg={4}>
|
|
13
|
+
<MasonryGridItem>
|
|
14
|
+
<div>Item 1</div>
|
|
15
|
+
</MasonryGridItem>
|
|
16
|
+
<MasonryGridItem>
|
|
17
|
+
<div>Item 2</div>
|
|
18
|
+
</MasonryGridItem>
|
|
19
|
+
<MasonryGridItem>
|
|
20
|
+
<div>Item 3</div>
|
|
21
|
+
</MasonryGridItem>
|
|
22
|
+
</MasonryGrid>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
### MasonryGrid
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Default | Description |
|
|
30
|
+
|------|------|---------|-------------|
|
|
31
|
+
| `xs` | `number` | `1` | Number of columns at extra small breakpoint (default) |
|
|
32
|
+
| `sm` | `number` | - | Number of columns at small breakpoint |
|
|
33
|
+
| `md` | `number` | - | Number of columns at medium breakpoint |
|
|
34
|
+
| `lg` | `number` | - | Number of columns at large breakpoint |
|
|
35
|
+
| `xl` | `number` | - | Number of columns at extra large breakpoint |
|
|
36
|
+
| `xxl` | `number` | - | Number of columns at extra extra large breakpoint |
|
|
37
|
+
| `gap` | `number` | `16` | Gap between items (in pixels) |
|
|
38
|
+
| `className` | `string` | - | Additional CSS class names |
|
|
39
|
+
|
|
40
|
+
### MasonryGridItem
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default | Description |
|
|
43
|
+
|------|------|---------|-------------|
|
|
44
|
+
| `className` | `string` | - | Additional CSS class names |
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
### Basic Masonry Grid
|
|
49
|
+
|
|
50
|
+
```jsx
|
|
51
|
+
<MasonryGrid xs={1} sm={2} md={3} lg={4}>
|
|
52
|
+
<MasonryGridItem>
|
|
53
|
+
<div>Item 1</div>
|
|
54
|
+
</MasonryGridItem>
|
|
55
|
+
<MasonryGridItem>
|
|
56
|
+
<div>Item 2</div>
|
|
57
|
+
</MasonryGridItem>
|
|
58
|
+
<MasonryGridItem>
|
|
59
|
+
<div>Item 3</div>
|
|
60
|
+
</MasonryGridItem>
|
|
61
|
+
</MasonryGrid>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Custom Gap
|
|
65
|
+
|
|
66
|
+
```jsx
|
|
67
|
+
<MasonryGrid xs={1} sm={2} md={3} lg={4} gap={24}>
|
|
68
|
+
<MasonryGridItem>
|
|
69
|
+
<div>Item 1</div>
|
|
70
|
+
</MasonryGridItem>
|
|
71
|
+
<MasonryGridItem>
|
|
72
|
+
<div>Item 2</div>
|
|
73
|
+
</MasonryGridItem>
|
|
74
|
+
</MasonryGrid>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Custom Column Configuration
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
<MasonryGrid xs={1} sm={2} md={2} lg={3} xl={4} xxl={5}>
|
|
81
|
+
<MasonryGridItem>
|
|
82
|
+
<div>Item 1</div>
|
|
83
|
+
</MasonryGridItem>
|
|
84
|
+
<MasonryGridItem>
|
|
85
|
+
<div>Item 2</div>
|
|
86
|
+
</MasonryGridItem>
|
|
87
|
+
</MasonryGrid>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Styling
|
|
91
|
+
|
|
92
|
+
The MasonryGrid component uses CSS Grid to create the masonry layout. You can customize the appearance by modifying the following SCSS variables:
|
|
93
|
+
|
|
94
|
+
```scss
|
|
95
|
+
// In your theme file or custom styles
|
|
96
|
+
$masonry-grid-gap: 16px;
|
|
97
|
+
$masonry-grid-gap-sm: 8px;
|
|
98
|
+
$masonry-grid-gap-lg: 24px;
|
|
99
|
+
$masonry-grid-columns-xs: 1;
|
|
100
|
+
$masonry-grid-columns-sm: 2;
|
|
101
|
+
$masonry-grid-columns-md: 3;
|
|
102
|
+
$masonry-grid-columns-lg: 4;
|
|
103
|
+
$masonry-grid-columns-xl: 4;
|
|
104
|
+
$masonry-grid-columns-xxl: 5;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Accessibility
|
|
108
|
+
|
|
109
|
+
The MasonryGrid component is built with accessibility in mind:
|
|
110
|
+
|
|
111
|
+
- It uses semantic HTML elements
|
|
112
|
+
- It maintains proper focus management
|
|
113
|
+
- It ensures content is readable at various screen sizes
|
|
114
|
+
|
|
115
|
+
## Browser Support
|
|
116
|
+
|
|
117
|
+
The MasonryGrid component uses CSS Grid, which is supported in all modern browsers. For older browsers, it will gracefully degrade to a single-column layout.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Component Library TypeScript Functionality
|
|
2
|
+
|
|
3
|
+
This directory contains TypeScript functionality for component behaviors, interactions, and utilities.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
├── components/ # UI Components
|
|
10
|
+
│ ├── ComponentName/ # Individual component folders
|
|
11
|
+
│ │ ├── scripts/ # Component-specific scripts
|
|
12
|
+
│ │ │ ├── index.ts # Exports all component functionality
|
|
13
|
+
│ │ │ └── componentInteractions.ts # Component-specific interactions
|
|
14
|
+
│ │ ├── ComponentName.tsx # Component React implementation
|
|
15
|
+
│ │ └── ComponentName.stories.tsx # Storybook stories
|
|
16
|
+
│ └── ...
|
|
17
|
+
│
|
|
18
|
+
├── lib/ # Shared functionality
|
|
19
|
+
│ ├── composables/ # Reusable component logic hooks
|
|
20
|
+
│ │ ├── index.ts # Export all composables
|
|
21
|
+
│ │ └── useComponent.ts # Component-specific composable
|
|
22
|
+
│ │
|
|
23
|
+
│ ├── utils/ # Utility functions
|
|
24
|
+
│ │ ├── index.ts # Export all utilities
|
|
25
|
+
│ │ └── dom.ts # DOM manipulation utilities
|
|
26
|
+
│ │
|
|
27
|
+
│ ├── types/ # TypeScript type definitions
|
|
28
|
+
│ │ ├── index.ts # Export all types
|
|
29
|
+
│ │ └── components.ts # Component-related type definitions
|
|
30
|
+
│ │
|
|
31
|
+
│ └── constants/ # Constant values
|
|
32
|
+
│ ├── index.ts # Export all constants
|
|
33
|
+
│ └── components.ts # Component-related constants
|
|
34
|
+
│
|
|
35
|
+
└── main.ts # Entry point that initializes components
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Composables
|
|
41
|
+
|
|
42
|
+
Composables are reusable pieces of component logic that can be shared across components.
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { useButton } from '../lib/composables/useButton';
|
|
46
|
+
|
|
47
|
+
// In your component
|
|
48
|
+
const { generateButtonClass, handleClick } = useButton();
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Component Interactions
|
|
52
|
+
|
|
53
|
+
Component scripts handle direct DOM interactions:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { initializeButton } from './components/Button/scripts';
|
|
57
|
+
|
|
58
|
+
// Initialize a button element
|
|
59
|
+
const buttonElement = document.querySelector('.c-btn');
|
|
60
|
+
if (buttonElement) {
|
|
61
|
+
initializeButton(buttonElement);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Utilities
|
|
66
|
+
|
|
67
|
+
Utility functions provide common functionality:
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import { addClass, removeClass } from '../lib/utils/dom';
|
|
71
|
+
|
|
72
|
+
// Add a class to an element
|
|
73
|
+
addClass(element, 'is-active');
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Adding New Component Functionality
|
|
77
|
+
|
|
78
|
+
1. Create composables for reusable logic
|
|
79
|
+
2. Add component-specific scripts in the component folder
|
|
80
|
+
3. Define types in the types folder
|
|
81
|
+
4. Update main.ts to initialize your component
|
|
82
|
+
|
|
83
|
+
## Best Practices
|
|
84
|
+
|
|
85
|
+
- Keep functionality modular and focused
|
|
86
|
+
- Follow the established folder structure
|
|
87
|
+
- Document functions with JSDoc comments
|
|
88
|
+
- Use TypeScript types for better code completion
|
|
89
|
+
- Export components through index files
|