@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,184 @@
|
|
|
1
|
+
import { PROGRESS } from '../../../lib/constants/components';
|
|
2
|
+
|
|
3
|
+
interface ProgressOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Progress value from 0 to 100
|
|
6
|
+
*/
|
|
7
|
+
value?: number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Optional color variant
|
|
11
|
+
*/
|
|
12
|
+
variant?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional size
|
|
16
|
+
*/
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional aria-label for accessibility
|
|
21
|
+
*/
|
|
22
|
+
ariaLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Progress component class for vanilla JS implementation
|
|
27
|
+
*/
|
|
28
|
+
export class Progress {
|
|
29
|
+
private $element: HTMLElement;
|
|
30
|
+
private options: ProgressOptions;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Create a new Progress instance
|
|
34
|
+
* @param element - Element selector or DOM element
|
|
35
|
+
* @param options - Configuration options
|
|
36
|
+
*/
|
|
37
|
+
constructor(element: string | HTMLElement, options: ProgressOptions = {}) {
|
|
38
|
+
this.$element =
|
|
39
|
+
typeof element === 'string' ? (document.querySelector(element) as HTMLElement) : element;
|
|
40
|
+
|
|
41
|
+
if (!this.$element) {
|
|
42
|
+
throw new Error('Progress: Element not found');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
this.options = {
|
|
46
|
+
value: 0,
|
|
47
|
+
variant: 'primary',
|
|
48
|
+
size: 'md',
|
|
49
|
+
ariaLabel: PROGRESS.DEFAULTS.ARIA_LABEL,
|
|
50
|
+
...options,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
this._initialize();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Initialize the progress component
|
|
58
|
+
*/
|
|
59
|
+
private _initialize(): void {
|
|
60
|
+
// Set initial value
|
|
61
|
+
this.setValue(this.options.value || 0);
|
|
62
|
+
|
|
63
|
+
// Set variant and size
|
|
64
|
+
if (this.options.variant) {
|
|
65
|
+
this._setVariant(this.options.variant);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (this.options.size) {
|
|
69
|
+
this._setSize(this.options.size);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Set ARIA attributes
|
|
73
|
+
this.$element.setAttribute('role', 'progressbar');
|
|
74
|
+
this.$element.setAttribute(PROGRESS.ATTRIBUTES.ARIA_VALUEMIN, '0');
|
|
75
|
+
this.$element.setAttribute(PROGRESS.ATTRIBUTES.ARIA_VALUEMAX, '100');
|
|
76
|
+
this.$element.setAttribute(
|
|
77
|
+
PROGRESS.ATTRIBUTES.ARIA_LABEL,
|
|
78
|
+
this.options.ariaLabel || PROGRESS.DEFAULTS.ARIA_LABEL
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
// Ensure the bar element exists
|
|
82
|
+
if (!this.$element.querySelector(PROGRESS.SELECTORS.BAR)) {
|
|
83
|
+
const bar = document.createElement('div');
|
|
84
|
+
bar.className = PROGRESS.CLASSES.BAR;
|
|
85
|
+
this.$element.appendChild(bar);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Set the progress value
|
|
91
|
+
* @param value - Progress value (0-100)
|
|
92
|
+
*/
|
|
93
|
+
public setValue(value: number): void {
|
|
94
|
+
// Clamp value between 0 and 100
|
|
95
|
+
const progressValue = Math.min(Math.max(value, 0), 100);
|
|
96
|
+
|
|
97
|
+
// Update the CSS variable
|
|
98
|
+
this.$element.style.setProperty(PROGRESS.CSS_VARS.PERCENTAGE, `${progressValue}%`);
|
|
99
|
+
|
|
100
|
+
// Update ARIA attribute
|
|
101
|
+
this.$element.setAttribute(PROGRESS.ATTRIBUTES.ARIA_VALUENOW, progressValue.toString());
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Set the progress variant
|
|
106
|
+
* @param variant - Color variant
|
|
107
|
+
*/
|
|
108
|
+
private _setVariant(variant: string): void {
|
|
109
|
+
// Remove existing variant classes
|
|
110
|
+
const classList = this.$element.classList;
|
|
111
|
+
Array.from(classList)
|
|
112
|
+
.filter(
|
|
113
|
+
className =>
|
|
114
|
+
className.startsWith(`${PROGRESS.CLASSES.BASE}--`) &&
|
|
115
|
+
!className.includes('--sm') &&
|
|
116
|
+
!className.includes('--md') &&
|
|
117
|
+
!className.includes('--lg')
|
|
118
|
+
)
|
|
119
|
+
.forEach(className => classList.remove(className));
|
|
120
|
+
|
|
121
|
+
// Add new variant class
|
|
122
|
+
classList.add(`${PROGRESS.CLASSES.BASE}--${variant}`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Set the progress size
|
|
127
|
+
* @param size - Size variant
|
|
128
|
+
*/
|
|
129
|
+
private _setSize(size: string): void {
|
|
130
|
+
// Remove existing size classes
|
|
131
|
+
const classList = this.$element.classList;
|
|
132
|
+
[PROGRESS.CLASSES.SM, PROGRESS.CLASSES.MD, PROGRESS.CLASSES.LG].forEach(className =>
|
|
133
|
+
classList.remove(className)
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
// Add new size class
|
|
137
|
+
classList.add(`${PROGRESS.CLASSES.BASE}--${size}`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Update progress options
|
|
142
|
+
* @param options - New options
|
|
143
|
+
*/
|
|
144
|
+
public update(options: Partial<ProgressOptions>): void {
|
|
145
|
+
this.options = { ...this.options, ...options };
|
|
146
|
+
|
|
147
|
+
if (options.value !== undefined) {
|
|
148
|
+
this.setValue(options.value);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (options.variant) {
|
|
152
|
+
this._setVariant(options.variant);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (options.size) {
|
|
156
|
+
this._setSize(options.size);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (options.ariaLabel) {
|
|
160
|
+
this.$element.setAttribute(PROGRESS.ATTRIBUTES.ARIA_LABEL, options.ariaLabel);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Destroy the progress instance
|
|
166
|
+
*/
|
|
167
|
+
public destroy(): void {
|
|
168
|
+
// No event listeners to remove for this component
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Initialize all progress elements on the page
|
|
173
|
+
*/
|
|
174
|
+
public static initializeAll(): Progress[] {
|
|
175
|
+
const elements = document.querySelectorAll(PROGRESS.SELECTORS.PROGRESS);
|
|
176
|
+
return Array.from(elements).map(element => {
|
|
177
|
+
const value = Number(element.getAttribute('data-value') || 0);
|
|
178
|
+
const variant = element.getAttribute('data-variant') || 'primary';
|
|
179
|
+
const size = (element.getAttribute('data-size') as 'sm' | 'md' | 'lg') || 'md';
|
|
180
|
+
|
|
181
|
+
return new Progress(element as HTMLElement, { value, variant, size });
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
3
|
+
import { Rating } from './Rating';
|
|
4
|
+
import type { RatingProps } from '../../lib/types/components';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Rating',
|
|
8
|
+
component: Rating,
|
|
9
|
+
argTypes: {
|
|
10
|
+
value: { control: { type: 'number', min: 0, max: 5, step: 0.5 } },
|
|
11
|
+
maxValue: { control: { type: 'number', min: 1, max: 10 } },
|
|
12
|
+
allowHalf: { control: 'boolean' },
|
|
13
|
+
readOnly: { control: 'boolean' },
|
|
14
|
+
size: {
|
|
15
|
+
control: { type: 'select', options: ['sm', 'md', 'lg'] },
|
|
16
|
+
},
|
|
17
|
+
color: {
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'light', 'dark'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
onChange: { action: 'onChange' },
|
|
24
|
+
},
|
|
25
|
+
parameters: {
|
|
26
|
+
docs: {
|
|
27
|
+
description: {
|
|
28
|
+
component: 'Rating component for displaying and collecting star ratings',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
} as Meta;
|
|
33
|
+
|
|
34
|
+
const Template: StoryFn<RatingProps> = (args: RatingProps) => <Rating {...args} />;
|
|
35
|
+
|
|
36
|
+
export const Default = Template.bind({});
|
|
37
|
+
Default.args = {
|
|
38
|
+
value: 3,
|
|
39
|
+
maxValue: 5,
|
|
40
|
+
allowHalf: false,
|
|
41
|
+
readOnly: false,
|
|
42
|
+
size: 'md',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const ReadOnly = Template.bind({});
|
|
46
|
+
ReadOnly.args = {
|
|
47
|
+
value: 4,
|
|
48
|
+
maxValue: 5,
|
|
49
|
+
allowHalf: false,
|
|
50
|
+
readOnly: true,
|
|
51
|
+
size: 'md',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const HalfStars = Template.bind({});
|
|
55
|
+
HalfStars.args = {
|
|
56
|
+
value: 3.5,
|
|
57
|
+
maxValue: 5,
|
|
58
|
+
allowHalf: true,
|
|
59
|
+
readOnly: true,
|
|
60
|
+
size: 'md',
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Small = Template.bind({});
|
|
64
|
+
Small.args = {
|
|
65
|
+
value: 4,
|
|
66
|
+
maxValue: 5,
|
|
67
|
+
allowHalf: false,
|
|
68
|
+
readOnly: true,
|
|
69
|
+
size: 'sm',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Large = Template.bind({});
|
|
73
|
+
Large.args = {
|
|
74
|
+
value: 4,
|
|
75
|
+
maxValue: 5,
|
|
76
|
+
allowHalf: false,
|
|
77
|
+
readOnly: true,
|
|
78
|
+
size: 'lg',
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const CustomColor = Template.bind({});
|
|
82
|
+
CustomColor.args = {
|
|
83
|
+
value: 4,
|
|
84
|
+
maxValue: 5,
|
|
85
|
+
allowHalf: false,
|
|
86
|
+
readOnly: true,
|
|
87
|
+
size: 'md',
|
|
88
|
+
color: 'warning',
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const Interactive: StoryFn<RatingProps> = () => {
|
|
92
|
+
const [rating, setRating] = useState(3);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<div>
|
|
96
|
+
<p>Selected rating: {rating}</p>
|
|
97
|
+
<Rating value={rating} onChange={setRating} allowHalf={true} />
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const CustomMaxValue = Template.bind({});
|
|
103
|
+
CustomMaxValue.args = {
|
|
104
|
+
value: 7,
|
|
105
|
+
maxValue: 10,
|
|
106
|
+
allowHalf: false,
|
|
107
|
+
readOnly: true,
|
|
108
|
+
size: 'md',
|
|
109
|
+
};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useCallback, forwardRef } from 'react';
|
|
2
|
+
import { THEME_COLORS, SIZES, RATING } from '../../lib/constants/components';
|
|
3
|
+
import { useRating } from '../../lib/composables/useRating';
|
|
4
|
+
import type { RatingProps } from '../../lib/types/components';
|
|
5
|
+
import useForkRef from '../../lib/utils/useForkRef';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Rating component for displaying and collecting star ratings
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Basic usage
|
|
12
|
+
* <Rating value={3} onChange={handleRatingChange} />
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Read-only with custom color
|
|
16
|
+
* <Rating value={4.5} readOnly color="warning" />
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // With half-star support
|
|
20
|
+
* <Rating value={3.5} allowHalf maxValue={5} />
|
|
21
|
+
*/
|
|
22
|
+
export const Rating = forwardRef<HTMLDivElement, RatingProps>(
|
|
23
|
+
(
|
|
24
|
+
{
|
|
25
|
+
value: valueProp = 0,
|
|
26
|
+
defaultValue,
|
|
27
|
+
maxValue = 5,
|
|
28
|
+
allowHalf = false,
|
|
29
|
+
readOnly = false,
|
|
30
|
+
size = 'md',
|
|
31
|
+
color,
|
|
32
|
+
onChange,
|
|
33
|
+
className = '',
|
|
34
|
+
label,
|
|
35
|
+
id,
|
|
36
|
+
useVanillaJS = false,
|
|
37
|
+
...restProps
|
|
38
|
+
},
|
|
39
|
+
ref
|
|
40
|
+
) => {
|
|
41
|
+
const internalRef = useRef<HTMLDivElement>(null);
|
|
42
|
+
const ratingInstance = useRef<any>(null);
|
|
43
|
+
|
|
44
|
+
// Use the rating hook for React-based implementation
|
|
45
|
+
const { currentValue, hoverValue, focusedIndex, setHoverValue, setFocused, handleKeyDown } =
|
|
46
|
+
useRating({
|
|
47
|
+
value: valueProp !== undefined ? valueProp : defaultValue,
|
|
48
|
+
maxValue,
|
|
49
|
+
allowHalf,
|
|
50
|
+
readOnly,
|
|
51
|
+
onChange,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Handle mouse enter on star with half-star support
|
|
55
|
+
const handleMouseEnter = useCallback(
|
|
56
|
+
(e: React.MouseEvent, starValue: number) => {
|
|
57
|
+
if (readOnly) return;
|
|
58
|
+
|
|
59
|
+
if (allowHalf) {
|
|
60
|
+
// Get the star element's bounding rectangle
|
|
61
|
+
const starRect = (e.currentTarget as HTMLElement).getBoundingClientRect();
|
|
62
|
+
// Calculate the x position within the star
|
|
63
|
+
const starCenterX = starRect.left + starRect.width / 2;
|
|
64
|
+
// If mouse is on the left half of the star, use half value
|
|
65
|
+
const isHalfStar = e.clientX < starCenterX;
|
|
66
|
+
const adjustedValue = isHalfStar ? starValue - 0.5 : starValue;
|
|
67
|
+
setHoverValue(Math.max(0.5, adjustedValue)); // Ensure minimum of 0.5
|
|
68
|
+
} else {
|
|
69
|
+
setHoverValue(starValue);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
[readOnly, allowHalf, setHoverValue]
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// Handle mouse move on star for half-star precision
|
|
76
|
+
const handleMouseMove = useCallback(
|
|
77
|
+
(e: React.MouseEvent, starValue: number) => {
|
|
78
|
+
if (readOnly || !allowHalf) return;
|
|
79
|
+
|
|
80
|
+
// Get the star element's bounding rectangle
|
|
81
|
+
const starRect = (e.currentTarget as HTMLElement).getBoundingClientRect();
|
|
82
|
+
// Calculate the x position within the star
|
|
83
|
+
const starCenterX = starRect.left + starRect.width / 2;
|
|
84
|
+
// If mouse is on the left half of the star, use half value
|
|
85
|
+
const isHalfStar = e.clientX < starCenterX;
|
|
86
|
+
const adjustedValue = isHalfStar ? starValue - 0.5 : starValue;
|
|
87
|
+
setHoverValue(Math.max(0.5, adjustedValue)); // Ensure minimum of 0.5
|
|
88
|
+
},
|
|
89
|
+
[readOnly, allowHalf, setHoverValue]
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// Handle mouse leave from rating component
|
|
93
|
+
const handleMouseLeave = useCallback(() => {
|
|
94
|
+
if (readOnly) return;
|
|
95
|
+
setHoverValue(null);
|
|
96
|
+
}, [readOnly, setHoverValue]);
|
|
97
|
+
|
|
98
|
+
// Handle click on star with half-star support
|
|
99
|
+
const handleClick = useCallback(
|
|
100
|
+
(e: React.MouseEvent, starValue: number) => {
|
|
101
|
+
if (readOnly) return;
|
|
102
|
+
|
|
103
|
+
let newValue = starValue;
|
|
104
|
+
|
|
105
|
+
if (allowHalf) {
|
|
106
|
+
// Get the star element's bounding rectangle
|
|
107
|
+
const starRect = (e.currentTarget as HTMLElement).getBoundingClientRect();
|
|
108
|
+
// Calculate the x position within the star
|
|
109
|
+
const starCenterX = starRect.left + starRect.width / 2;
|
|
110
|
+
// If click is on the left half of the star, use half value
|
|
111
|
+
const isHalfStar = e.clientX < starCenterX;
|
|
112
|
+
newValue = isHalfStar ? starValue - 0.5 : starValue;
|
|
113
|
+
newValue = Math.max(0.5, newValue); // Ensure minimum of 0.5
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
onChange?.(newValue);
|
|
117
|
+
},
|
|
118
|
+
[readOnly, onChange, allowHalf]
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// Use vanilla JS implementation if specified
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
if (!useVanillaJS || typeof window === 'undefined' || !internalRef.current) return undefined;
|
|
124
|
+
|
|
125
|
+
// Cleanup on unmount
|
|
126
|
+
return () => {
|
|
127
|
+
if (ratingInstance.current) {
|
|
128
|
+
ratingInstance.current.destroy();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}, [
|
|
132
|
+
useVanillaJS,
|
|
133
|
+
valueProp,
|
|
134
|
+
defaultValue,
|
|
135
|
+
maxValue,
|
|
136
|
+
allowHalf,
|
|
137
|
+
readOnly,
|
|
138
|
+
size,
|
|
139
|
+
color,
|
|
140
|
+
onChange,
|
|
141
|
+
]);
|
|
142
|
+
|
|
143
|
+
// Update vanilla JS implementation when props change
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
if (!useVanillaJS || !ratingInstance.current) return undefined;
|
|
146
|
+
|
|
147
|
+
ratingInstance.current.updateOptions({
|
|
148
|
+
value: valueProp !== undefined ? valueProp : defaultValue,
|
|
149
|
+
maxValue,
|
|
150
|
+
allowHalf,
|
|
151
|
+
readOnly,
|
|
152
|
+
size,
|
|
153
|
+
color,
|
|
154
|
+
});
|
|
155
|
+
}, [useVanillaJS, valueProp, defaultValue, maxValue, allowHalf, readOnly, size, color]);
|
|
156
|
+
|
|
157
|
+
// Determine CSS classes
|
|
158
|
+
const ratingClasses = [
|
|
159
|
+
'c-rating',
|
|
160
|
+
size === 'sm' ? RATING.CLASSES.SMALL : '',
|
|
161
|
+
size === 'lg' ? RATING.CLASSES.LARGE : '',
|
|
162
|
+
color ? `c-rating--${color}` : '',
|
|
163
|
+
className,
|
|
164
|
+
]
|
|
165
|
+
.filter(Boolean)
|
|
166
|
+
.join(' ');
|
|
167
|
+
|
|
168
|
+
// If using vanilla JS, just render the container
|
|
169
|
+
if (useVanillaJS) {
|
|
170
|
+
return (
|
|
171
|
+
<div className={ratingClasses} ref={useForkRef(internalRef, ref)} id={id} {...restProps}>
|
|
172
|
+
{/* Stars will be generated by the vanilla JS implementation */}
|
|
173
|
+
</div>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// React-based implementation
|
|
178
|
+
// Determine the effective value (either hovered or actual)
|
|
179
|
+
const effectiveValue = hoverValue !== null ? hoverValue : currentValue;
|
|
180
|
+
|
|
181
|
+
// Generate stars
|
|
182
|
+
const renderStars = () => {
|
|
183
|
+
const stars = [];
|
|
184
|
+
const roundedValue = allowHalf
|
|
185
|
+
? Math.floor(effectiveValue * 2) / 2
|
|
186
|
+
: Math.round(effectiveValue);
|
|
187
|
+
const componentId = id || `rating-${Math.random().toString(36).substring(2, 9)}`;
|
|
188
|
+
|
|
189
|
+
for (let i = 1; i <= maxValue; i++) {
|
|
190
|
+
// For half-star support
|
|
191
|
+
const isFullStar = i <= Math.floor(roundedValue);
|
|
192
|
+
const isHalfStar = allowHalf && i - 0.5 === roundedValue;
|
|
193
|
+
|
|
194
|
+
const starClass = [
|
|
195
|
+
'c-rating__star',
|
|
196
|
+
isFullStar ? RATING.CLASSES.FULL : '',
|
|
197
|
+
isHalfStar ? RATING.CLASSES.HALF : '',
|
|
198
|
+
color ? `c-rating__star--${color}` : '',
|
|
199
|
+
focusedIndex === i ? 'c-rating__star--focused' : '',
|
|
200
|
+
]
|
|
201
|
+
.filter(Boolean)
|
|
202
|
+
.join(' ');
|
|
203
|
+
|
|
204
|
+
const starId = `${componentId}-star-${i}`;
|
|
205
|
+
|
|
206
|
+
stars.push(
|
|
207
|
+
<div
|
|
208
|
+
key={i}
|
|
209
|
+
id={starId}
|
|
210
|
+
className={starClass}
|
|
211
|
+
data-value={i}
|
|
212
|
+
role={readOnly ? 'presentation' : 'button'}
|
|
213
|
+
tabIndex={readOnly ? -1 : 0}
|
|
214
|
+
aria-label={`${i} ${i === 1 ? 'star' : 'stars'}`}
|
|
215
|
+
aria-checked={i <= roundedValue}
|
|
216
|
+
aria-setsize={maxValue}
|
|
217
|
+
aria-posinset={i}
|
|
218
|
+
onClick={e => handleClick(e, i)}
|
|
219
|
+
onMouseEnter={e => handleMouseEnter(e, i)}
|
|
220
|
+
onMouseMove={e => handleMouseMove(e, i)}
|
|
221
|
+
onFocus={() => setFocused(i)}
|
|
222
|
+
onBlur={() => setFocused(null)}
|
|
223
|
+
onKeyDown={e => handleKeyDown(e, i)}
|
|
224
|
+
>
|
|
225
|
+
<svg
|
|
226
|
+
viewBox="0 0 24 24"
|
|
227
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
228
|
+
aria-hidden="true"
|
|
229
|
+
focusable="false"
|
|
230
|
+
>
|
|
231
|
+
{/* Empty star (outline) */}
|
|
232
|
+
<path
|
|
233
|
+
className="c-rating__star-outline"
|
|
234
|
+
d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
|
|
235
|
+
strokeWidth="1"
|
|
236
|
+
/>
|
|
237
|
+
|
|
238
|
+
{/* Full star */}
|
|
239
|
+
<path
|
|
240
|
+
className="c-rating__star-full"
|
|
241
|
+
d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
|
|
242
|
+
/>
|
|
243
|
+
|
|
244
|
+
{/* Half star with proper clipping */}
|
|
245
|
+
<path
|
|
246
|
+
className="c-rating__star-half"
|
|
247
|
+
d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
|
|
248
|
+
clipPath={`url(#half-star-clip-${componentId}-${i})`}
|
|
249
|
+
/>
|
|
250
|
+
|
|
251
|
+
{/* Clipping path for half star */}
|
|
252
|
+
<defs>
|
|
253
|
+
<clipPath id={`half-star-clip-${componentId}-${i}`}>
|
|
254
|
+
<rect x="0" y="0" width="12" height="24" />
|
|
255
|
+
</clipPath>
|
|
256
|
+
</defs>
|
|
257
|
+
</svg>
|
|
258
|
+
</div>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return stars;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
return (
|
|
266
|
+
<div
|
|
267
|
+
className={ratingClasses}
|
|
268
|
+
ref={useForkRef(internalRef, ref)}
|
|
269
|
+
id={id}
|
|
270
|
+
data-readonly={readOnly ? 'true' : 'false'}
|
|
271
|
+
onMouseLeave={handleMouseLeave}
|
|
272
|
+
role={readOnly ? 'img' : 'radiogroup'}
|
|
273
|
+
aria-label={label || `Rating: ${currentValue} out of ${maxValue} stars`}
|
|
274
|
+
{...restProps}
|
|
275
|
+
>
|
|
276
|
+
{renderStars()}
|
|
277
|
+
</div>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
Rating.displayName = 'Rating';
|
|
283
|
+
|
|
284
|
+
export type { RatingProps };
|
|
285
|
+
|
|
286
|
+
export default Rating;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Rating from './index';
|
|
2
|
+
import {
|
|
3
|
+
initFromDataAttributes,
|
|
4
|
+
getInstance,
|
|
5
|
+
disposeAll,
|
|
6
|
+
enhanceWithKeyboardNavigation,
|
|
7
|
+
} from './ratingInteractions';
|
|
8
|
+
|
|
9
|
+
if (typeof window !== 'undefined') {
|
|
10
|
+
// Initialize the Atomix global object if it doesn't exist
|
|
11
|
+
(window as any).Atomix = (window as any).Atomix || {};
|
|
12
|
+
|
|
13
|
+
// Add Rating to the global Atomix object
|
|
14
|
+
(window as any).Atomix.Rating = {
|
|
15
|
+
create: Rating,
|
|
16
|
+
init: initFromDataAttributes,
|
|
17
|
+
get: getInstance,
|
|
18
|
+
disposeAll: disposeAll,
|
|
19
|
+
enhanceKeyboardNavigation: enhanceWithKeyboardNavigation,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Auto-initialize ratings when DOM is ready
|
|
23
|
+
if (document.readyState === 'loading') {
|
|
24
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
25
|
+
initFromDataAttributes();
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
initFromDataAttributes();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Export everything for module bundling
|
|
33
|
+
export {
|
|
34
|
+
Rating as default,
|
|
35
|
+
initFromDataAttributes,
|
|
36
|
+
getInstance,
|
|
37
|
+
disposeAll,
|
|
38
|
+
enhanceWithKeyboardNavigation,
|
|
39
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module './scripts' {
|
|
2
|
+
export default class Rating {
|
|
3
|
+
constructor(element: HTMLElement, options?: any);
|
|
4
|
+
init(): void;
|
|
5
|
+
handleMouseMove(e: MouseEvent): void;
|
|
6
|
+
handleMouseLeave(): void;
|
|
7
|
+
handleClick(e: MouseEvent): void;
|
|
8
|
+
setValue(value: number): void;
|
|
9
|
+
updateStarsDisplay(value: number, isHover?: boolean): void;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
}
|
|
12
|
+
}
|