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.cjs CHANGED
@@ -2199,6 +2199,8 @@ const Button = /*#__PURE__*/React.forwardRef(({
2199
2199
  onClick,
2200
2200
  onFocus,
2201
2201
  onKeyDown,
2202
+ onMouseEnter,
2203
+ onMouseLeave,
2202
2204
  ...other
2203
2205
  }, ref) => {
2204
2206
  const isIconOnly = icon && !children;
@@ -2216,6 +2218,12 @@ const Button = /*#__PURE__*/React.forwardRef(({
2216
2218
  const onBlurHandler = e => {
2217
2219
  onBlur?.(e);
2218
2220
  };
2221
+ const onMouseEnterHandler = e => {
2222
+ onMouseEnter?.(e);
2223
+ };
2224
+ const onMouseLeaveHandler = e => {
2225
+ onMouseLeave?.(e);
2226
+ };
2219
2227
  return jsx("button", {
2220
2228
  ref: ref,
2221
2229
  className: buttonClasses,
@@ -2227,6 +2235,8 @@ const Button = /*#__PURE__*/React.forwardRef(({
2227
2235
  onKeyDown: onKeyDownHandler,
2228
2236
  onFocus: onFocusHandler,
2229
2237
  onBlur: onBlurHandler,
2238
+ onMouseEnter: onMouseEnterHandler,
2239
+ onMouseLeave: onMouseLeaveHandler,
2230
2240
  ...other,
2231
2241
  children: icon ? jsxs(Fragment, {
2232
2242
  children: [icon, !isIconOnly && children]
@@ -2367,7 +2377,6 @@ const Avatar = ({
2367
2377
  sx,
2368
2378
  size = "medium"
2369
2379
  }) => {
2370
- console.log(className?.avatar);
2371
2380
  const initials = displayName.split(" ").map(n => n[0].toUpperCase());
2372
2381
  const avatarClasses = cx("ath-avatar", `ath-avatar-${size}`, className?.avatar);
2373
2382
  const initialsClasses = cx(`ath-avatar-initials`, className?.initials);
@@ -2383,6 +2392,20 @@ const Avatar = ({
2383
2392
  });
2384
2393
  };
2385
2394
 
2395
+ const Block = ({
2396
+ children,
2397
+ className,
2398
+ sx
2399
+ }) => {
2400
+ const blockClasses = cx("ath-block", className?.block);
2401
+ return jsx("div", {
2402
+ className: blockClasses,
2403
+ "data-testid": "block",
2404
+ css: sx?.block,
2405
+ children: children
2406
+ });
2407
+ };
2408
+
2386
2409
  const defaultAttributes = {
2387
2410
  xmlns: 'http://www.w3.org/2000/svg',
2388
2411
  width: 24,
@@ -2439,7 +2462,7 @@ const HugeiconsIcon = React.forwardRef(({ color = 'currentColor', size = 24, str
2439
2462
  });
2440
2463
  HugeiconsIcon.displayName = 'HugeiconsIcon';
2441
2464
 
2442
- 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"}]];
2465
+ 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"}]];
2443
2466
 
2444
2467
  const ScrollToTopButton = ({
2445
2468
  className,
@@ -2557,6 +2580,100 @@ const ButtonGroup = ({
2557
2580
  });
2558
2581
  };
2559
2582
 
2583
+ const Carousel = ({
2584
+ children,
2585
+ className,
2586
+ emptyMessage,
2587
+ sx
2588
+ }) => {
2589
+ const [isHovered, setIsHovered] = React.useState(false);
2590
+ const carouselRef = React.useRef(null);
2591
+ const carouselClasses = cx("ath-carousel", isHovered ? "ath-carousel-hover" : "", className?.carousel);
2592
+ const hasItems = React.Children.count(children) > 0;
2593
+ const scrollByPage = direction => {
2594
+ const el = carouselRef.current;
2595
+ if (!el) return;
2596
+ el.scrollBy({
2597
+ left: direction * el.clientWidth,
2598
+ behavior: "smooth"
2599
+ });
2600
+ };
2601
+ const handleLeftArrowClick = () => {
2602
+ scrollByPage(-1);
2603
+ };
2604
+ const handleRightArrowClick = () => {
2605
+ scrollByPage(1);
2606
+ };
2607
+ const handleMouseEnter = () => {
2608
+ setIsHovered(true);
2609
+ };
2610
+ const handleMouseLeave = () => {
2611
+ setIsHovered(false);
2612
+ };
2613
+ return jsx("div", {
2614
+ className: "ath-carousel-wrapper",
2615
+ children: jsxs("div", {
2616
+ className: carouselClasses,
2617
+ css: sx?.carousel,
2618
+ onMouseEnter: handleMouseEnter,
2619
+ onMouseLeave: handleMouseLeave,
2620
+ ref: carouselRef,
2621
+ children: [jsx(Button, {
2622
+ className: {
2623
+ button: "ath-carousel-arrow ath-carousel-left-arrow"
2624
+ },
2625
+ onClick: handleLeftArrowClick,
2626
+ onMouseEnter: handleMouseEnter,
2627
+ onMouseLeave: handleMouseLeave,
2628
+ icon: jsx(HugeiconsIcon, {
2629
+ icon: Qt,
2630
+ size: 36
2631
+ })
2632
+ }), hasItems ? children : emptyMessage, jsx(Button, {
2633
+ className: {
2634
+ button: "ath-carousel-arrow ath-carousel-right-arrow"
2635
+ },
2636
+ onClick: handleRightArrowClick,
2637
+ onMouseEnter: handleMouseEnter,
2638
+ onMouseLeave: handleMouseLeave,
2639
+ icon: jsx(HugeiconsIcon, {
2640
+ icon: un,
2641
+ size: 36
2642
+ })
2643
+ })]
2644
+ })
2645
+ });
2646
+ };
2647
+
2648
+ const Dropdown = ({
2649
+ children,
2650
+ className,
2651
+ isOpen,
2652
+ sx,
2653
+ onClose
2654
+ }) => {
2655
+ const dropdownRef = React.useRef(null);
2656
+ const dropdownClasses = cx("ath-dropdown", isOpen && "ath-dropdown-open", className?.dropdown);
2657
+ React.useEffect(() => {
2658
+ const handleOutsideClick = event => {
2659
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
2660
+ onClose();
2661
+ }
2662
+ };
2663
+ document.addEventListener("mousedown", handleOutsideClick);
2664
+ return () => {
2665
+ document.removeEventListener("mousedown", handleOutsideClick);
2666
+ };
2667
+ }, [onClose]);
2668
+ return jsx("div", {
2669
+ ref: dropdownRef,
2670
+ className: dropdownClasses,
2671
+ css: sx?.dropdown,
2672
+ "data-testid": "dropdown",
2673
+ children: children
2674
+ });
2675
+ };
2676
+
2560
2677
  const FormLabel = ({
2561
2678
  label,
2562
2679
  required,
@@ -2768,11 +2885,16 @@ const Main = ({
2768
2885
  className,
2769
2886
  sx
2770
2887
  }) => {
2771
- const classes = cx("ath-main", typeof className === "object" && className !== null ? className.main : className);
2888
+ const mainClasses = cx("ath-main", typeof className === "object" && className !== null ? className.main : "");
2889
+ const mainContentClasses = cx("ath-main-content", typeof className === "object" && className !== null ? className.mainContent : "");
2772
2890
  return jsx("main", {
2773
- css: sx,
2774
- className: classes,
2775
- children: children
2891
+ css: sx?.main,
2892
+ className: mainClasses,
2893
+ children: jsx("div", {
2894
+ css: sx?.mainContent,
2895
+ className: mainContentClasses,
2896
+ children: children
2897
+ })
2776
2898
  });
2777
2899
  };
2778
2900
 
@@ -3044,15 +3166,59 @@ const Search = ({
3044
3166
  });
3045
3167
  };
3046
3168
 
3169
+ const SlideOut = ({
3170
+ children,
3171
+ className,
3172
+ from = "right",
3173
+ isOpen = false,
3174
+ sx,
3175
+ onClose
3176
+ }) => {
3177
+ const slideOutClasses = cx("ath-slide-out", className?.slideOut);
3178
+ const overlayClasses = cx("ath-slide-out-overlay", isOpen && "ath-slide-out-overlay-open", className?.overlay);
3179
+ 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);
3180
+ const closeButtonClasses = cx("ath-slide-out-close-button", className?.closeButton);
3181
+ return jsxs("div", {
3182
+ className: slideOutClasses,
3183
+ css: sx?.slideOut,
3184
+ "data-testid": "slide-out",
3185
+ children: [jsx("div", {
3186
+ className: overlayClasses,
3187
+ css: sx?.overlay,
3188
+ onClick: onClose
3189
+ }), jsxs("div", {
3190
+ className: panelClasses,
3191
+ css: sx?.panel,
3192
+ children: [jsx(Button, {
3193
+ className: {
3194
+ button: closeButtonClasses
3195
+ },
3196
+ sx: {
3197
+ button: sx?.closeButton
3198
+ },
3199
+ onClick: onClose,
3200
+ "aria-label": "Close menu",
3201
+ variant: "ghost",
3202
+ dark: true,
3203
+ size: "medium",
3204
+ icon: jsx(HugeiconsIcon, {
3205
+ icon: uL,
3206
+ size: 24
3207
+ })
3208
+ }), children]
3209
+ })]
3210
+ });
3211
+ };
3212
+
3047
3213
  const breakpoints = {
3048
- xs: "360px",
3049
- sm: "480px",
3050
- md: "640px",
3051
- lg: "768px",
3052
- xl: "896px",
3053
- "2xl": "1024px",
3054
- "3xl": "1280px",
3055
- "4xl": "1536px"
3214
+ xs: 320,
3215
+ sm: 480,
3216
+ md: 620,
3217
+ lg: 768,
3218
+ xl: 896,
3219
+ "2xl": 1024,
3220
+ "3xl": 1280,
3221
+ "4xl": 1536
3056
3222
  };
3057
3223
 
3058
3224
  const tokens = {
@@ -3062,15 +3228,15 @@ const tokens = {
3062
3228
  serif: "Libre Baskerville, serif"
3063
3229
  },
3064
3230
  size: {
3065
- xs: "0.625rem",
3066
- sm: "0.75rem",
3067
- md: "0.875rem",
3068
- lg: "1rem",
3069
- xl: "1.25rem",
3070
- "2xl": "1.5rem",
3071
- "3xl": "2rem",
3072
- "4xl": "2.5rem",
3073
- "5xl": "3rem"
3231
+ xs: "0.75rem",
3232
+ sm: "0.875rem",
3233
+ md: "1rem",
3234
+ lg: "1.25rem",
3235
+ xl: "1.5rem",
3236
+ "2xl": "2rem",
3237
+ "3xl": "2.5rem",
3238
+ "4xl": "3rem",
3239
+ "5xl": "3.5rem"
3074
3240
  }
3075
3241
  },
3076
3242
  color: {
@@ -3203,27 +3369,18 @@ const tokens = {
3203
3369
  md: "5px",
3204
3370
  lg: "8px"
3205
3371
  },
3206
- screen: {
3207
- xs: "360px",
3208
- sm: "480px",
3209
- md: "768px",
3210
- lg: "896px",
3211
- xl: "1024px",
3212
- "2xl": "1280px",
3213
- "3xl": "1536px"
3214
- },
3215
3372
  media: {
3216
3373
  min: {
3217
- xs: "@media (min-width: 360px)",
3374
+ xs: "@media (min-width: 320px)",
3218
3375
  sm: "@media (min-width: 480px)",
3219
- md: "@media (min-width: 768px)",
3220
- lg: "@media (min-width: 896px)",
3221
- xl: "@media (min-width: 1024px)",
3222
- "2xl": "@media (min-width: 1280px)",
3223
- "3xl": "@media (min-width: 1536px)"
3376
+ md: "@media (min-width: 620px)",
3377
+ lg: "@media (min-width: 768px)",
3378
+ xl: "@media (min-width: 896px)",
3379
+ "2xl": "@media (min-width: 1024px)",
3380
+ "3xl": "@media (min-width: 1280px)"
3224
3381
  },
3225
3382
  max: {
3226
- xs: "@media (max-width: 359px)",
3383
+ xs: "@media (max-width: 319px)",
3227
3384
  sm: "@media (max-width: 479px)",
3228
3385
  md: "@media (max-width: 767px)",
3229
3386
  lg: "@media (max-width: 895px)",
@@ -3237,9 +3394,12 @@ const tokens = {
3237
3394
  exports.Accordion = Accordion;
3238
3395
  exports.AccordionItem = AccordionItem;
3239
3396
  exports.Avatar = Avatar;
3397
+ exports.Block = Block;
3240
3398
  exports.Button = Button;
3241
3399
  exports.ButtonGroup = ButtonGroup;
3400
+ exports.Carousel = Carousel;
3242
3401
  exports.ContainerScalingText = ContainerScalingText;
3402
+ exports.Dropdown = Dropdown;
3243
3403
  exports.Footer = Footer;
3244
3404
  exports.FormField = FormField;
3245
3405
  exports.FormLabel = FormLabel;
@@ -3251,6 +3411,7 @@ exports.Main = Main;
3251
3411
  exports.Modal = Modal;
3252
3412
  exports.ScrollToTopButton = ScrollToTopButton;
3253
3413
  exports.Search = Search;
3414
+ exports.SlideOut = SlideOut;
3254
3415
  exports.breakpoints = breakpoints;
3255
3416
  exports.cx = cx;
3256
3417
  exports.tokens = tokens;