athameui 0.0.8 → 0.0.10

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.
Files changed (77) hide show
  1. package/components/Avatar/Avatar.tsx +0 -2
  2. package/components/Block/Block.tsx +22 -0
  3. package/components/Block/index.ts +1 -0
  4. package/components/Button/Button.tsx +14 -0
  5. package/components/Carousel/Carousel.tsx +84 -0
  6. package/components/Carousel/index.ts +1 -0
  7. package/components/DropDown/Dropdown.tsx +60 -0
  8. package/components/DropDown/index.ts +1 -0
  9. package/components/Layout/Main.tsx +21 -14
  10. package/components/Modal/Modal.tsx +1 -1
  11. package/components/SlideOut/SlideOut.tsx +71 -0
  12. package/components/SlideOut/index.ts +1 -0
  13. package/components/index.ts +4 -0
  14. package/dist/athameui.cjs +200 -39
  15. package/dist/athameui.cjs.map +1 -1
  16. package/dist/athameui.mjs +198 -41
  17. package/dist/athameui.mjs.map +1 -1
  18. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  19. package/dist/components/Block/Block.d.ts +13 -0
  20. package/dist/components/Block/Block.d.ts.map +1 -0
  21. package/dist/components/Block/index.d.ts +2 -0
  22. package/dist/components/Block/index.d.ts.map +1 -0
  23. package/dist/components/Button/Button.d.ts +2 -0
  24. package/dist/components/Button/Button.d.ts.map +1 -1
  25. package/dist/components/Carousel/Carousel.d.ts +14 -0
  26. package/dist/components/Carousel/Carousel.d.ts.map +1 -0
  27. package/dist/components/Carousel/index.d.ts +2 -0
  28. package/dist/components/Carousel/index.d.ts.map +1 -0
  29. package/dist/components/DropDown/Dropdown.d.ts +14 -0
  30. package/dist/components/DropDown/Dropdown.d.ts.map +1 -0
  31. package/dist/components/DropDown/index.d.ts +2 -0
  32. package/dist/components/DropDown/index.d.ts.map +1 -0
  33. package/dist/components/Layout/Main.d.ts +7 -3
  34. package/dist/components/Layout/Main.d.ts.map +1 -1
  35. package/dist/components/SlideOut/SlideOut.d.ts +21 -0
  36. package/dist/components/SlideOut/SlideOut.d.ts.map +1 -0
  37. package/dist/components/SlideOut/index.d.ts +2 -0
  38. package/dist/components/SlideOut/index.d.ts.map +1 -0
  39. package/dist/components/index.d.ts +4 -0
  40. package/dist/components/index.d.ts.map +1 -1
  41. package/dist/styles/breakpoints.d.ts +13 -0
  42. package/dist/styles/breakpoints.d.ts.map +1 -0
  43. package/dist/styles/breakpoints.ts +13 -0
  44. package/dist/styles/components/accordion.css +8 -5
  45. package/dist/styles/components/block.css +8 -0
  46. package/dist/styles/components/button.css +1 -1
  47. package/dist/styles/components/carousel.css +43 -0
  48. package/dist/styles/components/dropdown.css +18 -0
  49. package/dist/styles/components/form-input.css +10 -1
  50. package/dist/styles/components/main.css +14 -3
  51. package/dist/styles/components/slide-out.css +69 -0
  52. package/dist/styles/index.d.ts +1 -1
  53. package/dist/styles/index.d.ts.map +1 -1
  54. package/dist/styles/index.ts +1 -1
  55. package/dist/styles/theme.css +4 -0
  56. package/dist/styles/tokens.css +44 -28
  57. package/dist/styles/tokens.d.ts +0 -10
  58. package/dist/styles/tokens.d.ts.map +1 -1
  59. package/dist/styles/tokens.ts +16 -26
  60. package/package.json +1 -1
  61. package/styles/breakpoints.ts +13 -0
  62. package/styles/components/accordion.css +8 -5
  63. package/styles/components/block.css +8 -0
  64. package/styles/components/button.css +1 -1
  65. package/styles/components/carousel.css +43 -0
  66. package/styles/components/dropdown.css +18 -0
  67. package/styles/components/form-input.css +10 -1
  68. package/styles/components/main.css +14 -3
  69. package/styles/components/slide-out.css +69 -0
  70. package/styles/index.ts +1 -1
  71. package/styles/theme.css +4 -0
  72. package/styles/tokens.css +44 -28
  73. package/styles/tokens.ts +16 -26
  74. package/dist/styles/mediaQueries.d.ts +0 -11
  75. package/dist/styles/mediaQueries.d.ts.map +0 -1
  76. package/dist/styles/mediaQueries.ts +0 -10
  77. package/styles/mediaQueries.ts +0 -10
package/dist/athameui.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import * as ReactJSXRuntime from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
- import React__default, { forwardRef, useContext, useRef, useState, createElement, useEffect, useLayoutEffect } from 'react';
4
+ import React__default, { forwardRef, useContext, useRef, useState, createElement, useEffect, Children, useLayoutEffect } from 'react';
5
5
 
6
6
  /*
7
7
 
@@ -2178,6 +2178,8 @@ const Button = /*#__PURE__*/forwardRef(({
2178
2178
  onClick,
2179
2179
  onFocus,
2180
2180
  onKeyDown,
2181
+ onMouseEnter,
2182
+ onMouseLeave,
2181
2183
  ...other
2182
2184
  }, ref) => {
2183
2185
  const isIconOnly = icon && !children;
@@ -2195,6 +2197,12 @@ const Button = /*#__PURE__*/forwardRef(({
2195
2197
  const onBlurHandler = e => {
2196
2198
  onBlur?.(e);
2197
2199
  };
2200
+ const onMouseEnterHandler = e => {
2201
+ onMouseEnter?.(e);
2202
+ };
2203
+ const onMouseLeaveHandler = e => {
2204
+ onMouseLeave?.(e);
2205
+ };
2198
2206
  return jsx("button", {
2199
2207
  ref: ref,
2200
2208
  className: buttonClasses,
@@ -2206,6 +2214,8 @@ const Button = /*#__PURE__*/forwardRef(({
2206
2214
  onKeyDown: onKeyDownHandler,
2207
2215
  onFocus: onFocusHandler,
2208
2216
  onBlur: onBlurHandler,
2217
+ onMouseEnter: onMouseEnterHandler,
2218
+ onMouseLeave: onMouseLeaveHandler,
2209
2219
  ...other,
2210
2220
  children: icon ? jsxs(Fragment, {
2211
2221
  children: [icon, !isIconOnly && children]
@@ -2346,7 +2356,6 @@ const Avatar = ({
2346
2356
  sx,
2347
2357
  size = "medium"
2348
2358
  }) => {
2349
- console.log(className?.avatar);
2350
2359
  const initials = displayName.split(" ").map(n => n[0].toUpperCase());
2351
2360
  const avatarClasses = cx("ath-avatar", `ath-avatar-${size}`, className?.avatar);
2352
2361
  const initialsClasses = cx(`ath-avatar-initials`, className?.initials);
@@ -2362,6 +2371,20 @@ const Avatar = ({
2362
2371
  });
2363
2372
  };
2364
2373
 
2374
+ const Block = ({
2375
+ children,
2376
+ className,
2377
+ sx
2378
+ }) => {
2379
+ const blockClasses = cx("ath-block", className?.block);
2380
+ return jsx("div", {
2381
+ className: blockClasses,
2382
+ "data-testid": "block",
2383
+ css: sx?.block,
2384
+ children: children
2385
+ });
2386
+ };
2387
+
2365
2388
  const defaultAttributes = {
2366
2389
  xmlns: 'http://www.w3.org/2000/svg',
2367
2390
  width: 24,
@@ -2418,7 +2441,7 @@ const HugeiconsIcon = forwardRef(({ color = 'currentColor', size = 24, strokeWid
2418
2441
  });
2419
2442
  HugeiconsIcon.displayName = 'HugeiconsIcon';
2420
2443
 
2421
- const uL=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.9994 15L9 9M9.00064 15L15 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],ll=[["path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 9.00014V16.0002M15.5 11.5C15.5 11.5 12.9223 8.00001 12 8C11.0777 7.99999 8.50003 11.5 8.50003 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];
2444
+ const Qt=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],un=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],uL=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.9994 15L9 9M9.00064 15L15 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],ll=[["path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 9.00014V16.0002M15.5 11.5C15.5 11.5 12.9223 8.00001 12 8C11.0777 7.99999 8.50003 11.5 8.50003 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];
2422
2445
 
2423
2446
  const ScrollToTopButton = ({
2424
2447
  className,
@@ -2536,6 +2559,100 @@ const ButtonGroup = ({
2536
2559
  });
2537
2560
  };
2538
2561
 
2562
+ const Carousel = ({
2563
+ children,
2564
+ className,
2565
+ emptyMessage,
2566
+ sx
2567
+ }) => {
2568
+ const [isHovered, setIsHovered] = useState(false);
2569
+ const carouselRef = useRef(null);
2570
+ const carouselClasses = cx("ath-carousel", isHovered ? "ath-carousel-hover" : "", className?.carousel);
2571
+ const hasItems = Children.count(children) > 0;
2572
+ const scrollByPage = direction => {
2573
+ const el = carouselRef.current;
2574
+ if (!el) return;
2575
+ el.scrollBy({
2576
+ left: direction * el.clientWidth,
2577
+ behavior: "smooth"
2578
+ });
2579
+ };
2580
+ const handleLeftArrowClick = () => {
2581
+ scrollByPage(-1);
2582
+ };
2583
+ const handleRightArrowClick = () => {
2584
+ scrollByPage(1);
2585
+ };
2586
+ const handleMouseEnter = () => {
2587
+ setIsHovered(true);
2588
+ };
2589
+ const handleMouseLeave = () => {
2590
+ setIsHovered(false);
2591
+ };
2592
+ return jsx("div", {
2593
+ className: "ath-carousel-wrapper",
2594
+ children: jsxs("div", {
2595
+ className: carouselClasses,
2596
+ css: sx?.carousel,
2597
+ onMouseEnter: handleMouseEnter,
2598
+ onMouseLeave: handleMouseLeave,
2599
+ ref: carouselRef,
2600
+ children: [jsx(Button, {
2601
+ className: {
2602
+ button: "ath-carousel-arrow ath-carousel-left-arrow"
2603
+ },
2604
+ onClick: handleLeftArrowClick,
2605
+ onMouseEnter: handleMouseEnter,
2606
+ onMouseLeave: handleMouseLeave,
2607
+ icon: jsx(HugeiconsIcon, {
2608
+ icon: Qt,
2609
+ size: 36
2610
+ })
2611
+ }), hasItems ? children : emptyMessage, jsx(Button, {
2612
+ className: {
2613
+ button: "ath-carousel-arrow ath-carousel-right-arrow"
2614
+ },
2615
+ onClick: handleRightArrowClick,
2616
+ onMouseEnter: handleMouseEnter,
2617
+ onMouseLeave: handleMouseLeave,
2618
+ icon: jsx(HugeiconsIcon, {
2619
+ icon: un,
2620
+ size: 36
2621
+ })
2622
+ })]
2623
+ })
2624
+ });
2625
+ };
2626
+
2627
+ const Dropdown = ({
2628
+ children,
2629
+ className,
2630
+ isOpen,
2631
+ sx,
2632
+ onClose
2633
+ }) => {
2634
+ const dropdownRef = useRef(null);
2635
+ const dropdownClasses = cx("ath-dropdown", isOpen && "ath-dropdown-open", className?.dropdown);
2636
+ useEffect(() => {
2637
+ const handleOutsideClick = event => {
2638
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
2639
+ onClose();
2640
+ }
2641
+ };
2642
+ document.addEventListener("mousedown", handleOutsideClick);
2643
+ return () => {
2644
+ document.removeEventListener("mousedown", handleOutsideClick);
2645
+ };
2646
+ }, [onClose]);
2647
+ return jsx("div", {
2648
+ ref: dropdownRef,
2649
+ className: dropdownClasses,
2650
+ css: sx?.dropdown,
2651
+ "data-testid": "dropdown",
2652
+ children: children
2653
+ });
2654
+ };
2655
+
2539
2656
  const FormLabel = ({
2540
2657
  label,
2541
2658
  required,
@@ -2747,11 +2864,16 @@ const Main = ({
2747
2864
  className,
2748
2865
  sx
2749
2866
  }) => {
2750
- const classes = cx("ath-main", typeof className === "object" && className !== null ? className.main : className);
2867
+ const mainClasses = cx("ath-main", typeof className === "object" && className !== null ? className.main : "");
2868
+ const mainContentClasses = cx("ath-main-content", typeof className === "object" && className !== null ? className.mainContent : "");
2751
2869
  return jsx("main", {
2752
- css: sx,
2753
- className: classes,
2754
- children: children
2870
+ css: sx?.main,
2871
+ className: mainClasses,
2872
+ children: jsx("div", {
2873
+ css: sx?.mainContent,
2874
+ className: mainContentClasses,
2875
+ children: children
2876
+ })
2755
2877
  });
2756
2878
  };
2757
2879
 
@@ -3023,15 +3145,59 @@ const Search = ({
3023
3145
  });
3024
3146
  };
3025
3147
 
3148
+ const SlideOut = ({
3149
+ children,
3150
+ className,
3151
+ from = "right",
3152
+ isOpen = false,
3153
+ sx,
3154
+ onClose
3155
+ }) => {
3156
+ const slideOutClasses = cx("ath-slide-out", className?.slideOut);
3157
+ const overlayClasses = cx("ath-slide-out-overlay", isOpen && "ath-slide-out-overlay-open", className?.overlay);
3158
+ const panelClasses = cx("ath-slide-out-panel", from === "left" ? "ath-slide-out-from-left" : "ath-slide-out-from-right", isOpen && "ath-slide-out-panel-open", className?.panel);
3159
+ const closeButtonClasses = cx("ath-slide-out-close-button", className?.closeButton);
3160
+ return jsxs("div", {
3161
+ className: slideOutClasses,
3162
+ css: sx?.slideOut,
3163
+ "data-testid": "slide-out",
3164
+ children: [jsx("div", {
3165
+ className: overlayClasses,
3166
+ css: sx?.overlay,
3167
+ onClick: onClose
3168
+ }), jsxs("div", {
3169
+ className: panelClasses,
3170
+ css: sx?.panel,
3171
+ children: [jsx(Button, {
3172
+ className: {
3173
+ button: closeButtonClasses
3174
+ },
3175
+ sx: {
3176
+ button: sx?.closeButton
3177
+ },
3178
+ onClick: onClose,
3179
+ "aria-label": "Close menu",
3180
+ variant: "ghost",
3181
+ dark: true,
3182
+ size: "medium",
3183
+ icon: jsx(HugeiconsIcon, {
3184
+ icon: uL,
3185
+ size: 24
3186
+ })
3187
+ }), children]
3188
+ })]
3189
+ });
3190
+ };
3191
+
3026
3192
  const breakpoints = {
3027
- xs: "360px",
3028
- sm: "480px",
3029
- md: "640px",
3030
- lg: "768px",
3031
- xl: "896px",
3032
- "2xl": "1024px",
3033
- "3xl": "1280px",
3034
- "4xl": "1536px"
3193
+ xs: 320,
3194
+ sm: 480,
3195
+ md: 620,
3196
+ lg: 768,
3197
+ xl: 896,
3198
+ "2xl": 1024,
3199
+ "3xl": 1280,
3200
+ "4xl": 1536
3035
3201
  };
3036
3202
 
3037
3203
  const tokens = {
@@ -3041,15 +3207,15 @@ const tokens = {
3041
3207
  serif: "Libre Baskerville, serif"
3042
3208
  },
3043
3209
  size: {
3044
- xs: "0.625rem",
3045
- sm: "0.75rem",
3046
- md: "0.875rem",
3047
- lg: "1rem",
3048
- xl: "1.25rem",
3049
- "2xl": "1.5rem",
3050
- "3xl": "2rem",
3051
- "4xl": "2.5rem",
3052
- "5xl": "3rem"
3210
+ xs: "0.75rem",
3211
+ sm: "0.875rem",
3212
+ md: "1rem",
3213
+ lg: "1.25rem",
3214
+ xl: "1.5rem",
3215
+ "2xl": "2rem",
3216
+ "3xl": "2.5rem",
3217
+ "4xl": "3rem",
3218
+ "5xl": "3.5rem"
3053
3219
  }
3054
3220
  },
3055
3221
  color: {
@@ -3182,27 +3348,18 @@ const tokens = {
3182
3348
  md: "5px",
3183
3349
  lg: "8px"
3184
3350
  },
3185
- screen: {
3186
- xs: "360px",
3187
- sm: "480px",
3188
- md: "768px",
3189
- lg: "896px",
3190
- xl: "1024px",
3191
- "2xl": "1280px",
3192
- "3xl": "1536px"
3193
- },
3194
3351
  media: {
3195
3352
  min: {
3196
- xs: "@media (min-width: 360px)",
3353
+ xs: "@media (min-width: 320px)",
3197
3354
  sm: "@media (min-width: 480px)",
3198
- md: "@media (min-width: 768px)",
3199
- lg: "@media (min-width: 896px)",
3200
- xl: "@media (min-width: 1024px)",
3201
- "2xl": "@media (min-width: 1280px)",
3202
- "3xl": "@media (min-width: 1536px)"
3355
+ md: "@media (min-width: 620px)",
3356
+ lg: "@media (min-width: 768px)",
3357
+ xl: "@media (min-width: 896px)",
3358
+ "2xl": "@media (min-width: 1024px)",
3359
+ "3xl": "@media (min-width: 1280px)"
3203
3360
  },
3204
3361
  max: {
3205
- xs: "@media (max-width: 359px)",
3362
+ xs: "@media (max-width: 319px)",
3206
3363
  sm: "@media (max-width: 479px)",
3207
3364
  md: "@media (max-width: 767px)",
3208
3365
  lg: "@media (max-width: 895px)",
@@ -3213,5 +3370,5 @@ const tokens = {
3213
3370
  }
3214
3371
  };
3215
3372
 
3216
- export { Accordion, AccordionItem, Avatar, Button, ButtonGroup, ContainerScalingText, Footer, FormField, FormLabel, FormTextInput, Header, List, ListItem, Main, Modal, ScrollToTopButton, Search, breakpoints, cx, tokens };
3373
+ export { Accordion, AccordionItem, Avatar, Block, Button, ButtonGroup, Carousel, ContainerScalingText, Dropdown, Footer, FormField, FormLabel, FormTextInput, Header, List, ListItem, Main, Modal, ScrollToTopButton, Search, SlideOut, breakpoints, cx, tokens };
3217
3374
  //# sourceMappingURL=athameui.mjs.map