athameui 0.0.12 → 0.0.14

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 (64) hide show
  1. package/components/Accordion/Accordion.tsx +23 -23
  2. package/components/Accordion/AccordionItem.tsx +7 -1
  3. package/components/Avatar/Avatar.tsx +6 -1
  4. package/components/Button/Button.tsx +11 -0
  5. package/components/Button/ScrollToTopButton.tsx +2 -1
  6. package/components/Carousel/Carousel.tsx +159 -37
  7. package/components/Checkbox/Checkbox.tsx +51 -0
  8. package/components/Checkbox/index.ts +1 -0
  9. package/components/FormField/FormField.tsx +24 -0
  10. package/components/FormTextInput/FormTextInput.tsx +11 -0
  11. package/components/Layout/Main.tsx +11 -2
  12. package/components/Modal/Modal.tsx +9 -2
  13. package/components/SlideOut/SlideOut.tsx +31 -2
  14. package/components/index.ts +1 -0
  15. package/dist/athameui.cjs +410 -262
  16. package/dist/athameui.cjs.map +1 -1
  17. package/dist/athameui.mjs +406 -248
  18. package/dist/athameui.mjs.map +1 -1
  19. package/dist/components/Accordion/AccordionItem.d.ts.map +1 -1
  20. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  21. package/dist/components/Button/Button.d.ts +5 -0
  22. package/dist/components/Button/Button.d.ts.map +1 -1
  23. package/dist/components/Button/ScrollToTopButton.d.ts.map +1 -1
  24. package/dist/components/Carousel/Carousel.d.ts +5 -1
  25. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  26. package/dist/components/Checkbox/Checkbox.d.ts +14 -0
  27. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
  28. package/dist/components/Checkbox/index.d.ts +2 -0
  29. package/dist/components/Checkbox/index.d.ts.map +1 -0
  30. package/dist/components/FormField/FormField.d.ts +3 -0
  31. package/dist/components/FormField/FormField.d.ts.map +1 -1
  32. package/dist/components/FormTextInput/FormTextInput.d.ts +6 -1
  33. package/dist/components/FormTextInput/FormTextInput.d.ts.map +1 -1
  34. package/dist/components/Layout/Main.d.ts +2 -1
  35. package/dist/components/Layout/Main.d.ts.map +1 -1
  36. package/dist/components/Modal/Modal.d.ts.map +1 -1
  37. package/dist/components/SlideOut/SlideOut.d.ts.map +1 -1
  38. package/dist/components/index.d.ts +1 -0
  39. package/dist/components/index.d.ts.map +1 -1
  40. package/dist/styles/components/carousel.css +28 -4
  41. package/dist/styles/components/checkbox.css +60 -0
  42. package/dist/styles/components/form-input.css +2 -1
  43. package/dist/styles/components/main.css +17 -2
  44. package/dist/styles/index.d.ts +0 -1
  45. package/dist/styles/index.d.ts.map +1 -1
  46. package/dist/styles/index.ts +0 -1
  47. package/dist/styles/theme.css +1 -0
  48. package/dist/styles/tokens.css +16 -17
  49. package/dist/styles/tokens.d.ts +209 -26
  50. package/dist/styles/tokens.d.ts.map +1 -1
  51. package/dist/styles/tokens.ts +190 -165
  52. package/package.json +1 -1
  53. package/styles/components/carousel.css +28 -4
  54. package/styles/components/checkbox.css +60 -0
  55. package/styles/components/form-input.css +2 -1
  56. package/styles/components/main.css +17 -2
  57. package/styles/index.ts +0 -1
  58. package/styles/theme.css +1 -0
  59. package/styles/tokens.css +16 -17
  60. package/styles/tokens.ts +190 -165
  61. package/dist/styles/breakpoints.d.ts +0 -29
  62. package/dist/styles/breakpoints.d.ts.map +0 -1
  63. package/dist/styles/breakpoints.ts +0 -34
  64. package/styles/breakpoints.ts +0 -34
package/dist/athameui.cjs CHANGED
@@ -2201,6 +2201,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
2201
2201
  onClick,
2202
2202
  onFocus,
2203
2203
  onKeyDown,
2204
+ onMouseDown,
2204
2205
  onMouseEnter,
2205
2206
  onMouseLeave,
2206
2207
  ...other
@@ -2220,6 +2221,9 @@ const Button = /*#__PURE__*/React.forwardRef(({
2220
2221
  const onBlurHandler = e => {
2221
2222
  onBlur?.(e);
2222
2223
  };
2224
+ const onMouseDownHandler = e => {
2225
+ onMouseDown?.(e);
2226
+ };
2223
2227
  const onMouseEnterHandler = e => {
2224
2228
  onMouseEnter?.(e);
2225
2229
  };
@@ -2239,6 +2243,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
2239
2243
  onBlur: onBlurHandler,
2240
2244
  onMouseEnter: onMouseEnterHandler,
2241
2245
  onMouseLeave: onMouseLeaveHandler,
2246
+ onMouseDown: onMouseDownHandler,
2242
2247
  ...other,
2243
2248
  children: icon ? jsxs(Fragment, {
2244
2249
  children: [icon, !isIconOnly && children]
@@ -2285,6 +2290,8 @@ const AccordionItem = ({
2285
2290
  textPosition: headingTextPosition,
2286
2291
  onClick: onToggleHandler,
2287
2292
  disabled: disabled,
2293
+ "aria-expanded": expanded,
2294
+ "aria-controls": `accordion-content-${item.id}`,
2288
2295
  sx: sx?.accordionHeading,
2289
2296
  dark: true,
2290
2297
  children: jsx("div", {
@@ -2292,9 +2299,11 @@ const AccordionItem = ({
2292
2299
  children: item.heading
2293
2300
  })
2294
2301
  }), jsx("div", {
2302
+ id: `accordion-content-${item.id}`,
2295
2303
  className: expansionClasses,
2296
2304
  style: {
2297
- height: expanded ? contentHeight : 0
2305
+ height: expanded ? contentHeight : 0,
2306
+ visibility: expanded ? "visible" : "hidden"
2298
2307
  },
2299
2308
  children: jsx("div", {
2300
2309
  ref: contentRef,
@@ -2353,20 +2362,18 @@ const Accordion = ({
2353
2362
  className: accordionClasses,
2354
2363
  css: sx?.accordion,
2355
2364
  children: [childrenFirst && children, jsx(List, {
2356
- children: items.map(item => jsx("div", {
2357
- children: CustomAccordionItem ? jsx(CustomAccordionItem, {
2358
- expanded: expandedItems.includes(item.id),
2359
- onToggle: expandToggle,
2360
- ...item
2361
- }) : jsx(AccordionItem, {
2362
- sx: sx,
2363
- item: item,
2364
- expanded: expandedItems.includes(item.id),
2365
- onToggle: expandToggle,
2366
- className: className?.accordionItem ? {
2367
- ...className.accordionItem
2368
- } : undefined
2369
- })
2365
+ children: items.map(item => CustomAccordionItem ? jsx(CustomAccordionItem, {
2366
+ expanded: expandedItems.includes(item.id),
2367
+ onToggle: expandToggle,
2368
+ ...item
2369
+ }, item.id) : jsx(AccordionItem, {
2370
+ sx: sx,
2371
+ item: item,
2372
+ expanded: expandedItems.includes(item.id),
2373
+ onToggle: expandToggle,
2374
+ className: className?.accordionItem ? {
2375
+ ...className.accordionItem
2376
+ } : undefined
2370
2377
  }, item.id))
2371
2378
  }), !childrenFirst && children]
2372
2379
  });
@@ -2386,6 +2393,8 @@ const Avatar = ({
2386
2393
  return jsx("div", {
2387
2394
  css: sx?.avatar,
2388
2395
  className: avatarClasses,
2396
+ role: "img",
2397
+ "aria-label": displayName,
2389
2398
  children: jsxs("div", {
2390
2399
  css: sx?.initials,
2391
2400
  className: initialsClasses,
@@ -2464,7 +2473,7 @@ const HugeiconsIcon = React.forwardRef(({ color = 'currentColor', size = 24, str
2464
2473
  });
2465
2474
  HugeiconsIcon.displayName = 'HugeiconsIcon';
2466
2475
 
2467
- 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"}]];
2476
+ 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"}]],eI=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]];
2468
2477
 
2469
2478
  const ScrollToTopButton = ({
2470
2479
  className,
@@ -2502,7 +2511,8 @@ const ScrollToTopButton = ({
2502
2511
  "data-testid": "ath-scroll-to-top-button",
2503
2512
  onClick: scrollToTop,
2504
2513
  variant: variant ?? "secondary",
2505
- title: title ?? "Back to Top",
2514
+ title: title ?? "Back to top",
2515
+ "aria-label": "Back to top",
2506
2516
  dark: dark,
2507
2517
  children: jsx(HugeiconsIcon, {
2508
2518
  icon: ll,
@@ -2582,16 +2592,96 @@ const ButtonGroup = ({
2582
2592
  });
2583
2593
  };
2584
2594
 
2595
+ const FormLabel = ({
2596
+ label,
2597
+ required,
2598
+ className,
2599
+ labelPosition = "above",
2600
+ dark,
2601
+ sx,
2602
+ ...other
2603
+ }) => {
2604
+ const labelClasses = cx("ath-form-input-label", labelPosition ? `ath-form-input-label-${labelPosition}` : "", dark ? "ath-form-input-label-dark" : "", className?.label);
2605
+ const requiredClasses = cx("ath-form-input-label-required", dark ? "ath-form-input-label-required-dark" : "", className?.required);
2606
+ return jsxs("label", {
2607
+ className: labelClasses,
2608
+ css: sx?.label,
2609
+ ...other,
2610
+ children: [label, required && jsx("span", {
2611
+ className: requiredClasses,
2612
+ css: sx?.required,
2613
+ "aria-label": "required",
2614
+ children: "*"
2615
+ })]
2616
+ });
2617
+ };
2618
+
2585
2619
  const Carousel = ({
2586
2620
  children,
2587
2621
  className,
2588
2622
  emptyMessage = "Nothing here yet",
2623
+ label,
2624
+ onRemove,
2625
+ onReorder,
2626
+ removeLabel = "Remove item",
2589
2627
  sx
2590
2628
  }) => {
2591
2629
  const [isHovered, setIsHovered] = React.useState(false);
2630
+ const [showLeftArrow, setShowLeftArrow] = React.useState(false);
2631
+ const [showRightArrow, setShowRightArrow] = React.useState(false);
2632
+ const [dropIndex, setDropIndex] = React.useState(null);
2592
2633
  const carouselRef = React.useRef(null);
2593
- const carouselClasses = cx("ath-carousel", isHovered ? "ath-carousel-hover" : "", className?.carousel);
2594
- const hasItems = React.Children.count(children) > 0;
2634
+ const dragIndex = React.useRef(null);
2635
+ const carouselClasses = cx("ath-carousel", className?.carousel);
2636
+ const items = React.Children.toArray(children);
2637
+ const itemCount = items.length;
2638
+ const interactive = Boolean(onRemove || onReorder);
2639
+ const finishDrag = () => {
2640
+ dragIndex.current = null;
2641
+ setDropIndex(null);
2642
+ };
2643
+ const handleDragStart = index => event => {
2644
+ const target = event.target;
2645
+ if (target instanceof Element && target.closest(".ath-carousel-remove, .ath-carousel-remove-button")) {
2646
+ event.preventDefault();
2647
+ return;
2648
+ }
2649
+ dragIndex.current = index;
2650
+ event.dataTransfer.effectAllowed = "move";
2651
+ event.dataTransfer.setData("text/plain", String(index));
2652
+ };
2653
+ const handleDragOver = index => event => {
2654
+ if (!onReorder) return;
2655
+ event.preventDefault();
2656
+ event.dataTransfer.dropEffect = "move";
2657
+ if (dropIndex !== index) setDropIndex(index);
2658
+ };
2659
+ const handleDrop = index => event => {
2660
+ event.preventDefault();
2661
+ const from = dragIndex.current;
2662
+ finishDrag();
2663
+ if (from == null || !onReorder) return;
2664
+ onReorder(from, index);
2665
+ };
2666
+ React.useLayoutEffect(() => {
2667
+ const el = carouselRef.current;
2668
+ if (!el) return;
2669
+ const updateArrows = () => {
2670
+ const hidden = el.scrollWidth - el.clientWidth;
2671
+ setShowLeftArrow(el.scrollLeft > 1);
2672
+ setShowRightArrow(hidden - el.scrollLeft > 1);
2673
+ };
2674
+ updateArrows();
2675
+ el.addEventListener("scroll", updateArrows, {
2676
+ passive: true
2677
+ });
2678
+ const observer = new ResizeObserver(updateArrows);
2679
+ observer.observe(el);
2680
+ return () => {
2681
+ el.removeEventListener("scroll", updateArrows);
2682
+ observer.disconnect();
2683
+ };
2684
+ }, [itemCount]);
2595
2685
  const scrollByPage = direction => {
2596
2686
  const el = carouselRef.current;
2597
2687
  if (!el) return;
@@ -2600,53 +2690,109 @@ const Carousel = ({
2600
2690
  behavior: "smooth"
2601
2691
  });
2602
2692
  };
2603
- const handleLeftArrowClick = () => {
2604
- scrollByPage(-1);
2605
- };
2606
- const handleRightArrowClick = () => {
2607
- scrollByPage(1);
2608
- };
2609
2693
  const handleMouseEnter = () => {
2610
2694
  setIsHovered(true);
2611
2695
  };
2612
2696
  const handleMouseLeave = () => {
2613
2697
  setIsHovered(false);
2614
2698
  };
2615
- return jsx("div", {
2616
- className: "ath-carousel-wrapper",
2617
- children: jsxs("div", {
2618
- className: carouselClasses,
2619
- css: sx?.carousel,
2699
+ return jsxs("div", {
2700
+ className: "ath-carousel-container",
2701
+ style: {
2702
+ minWidth: itemCount === 1 ? "" : 0
2703
+ },
2704
+ children: [label && jsx(FormLabel, {
2705
+ label: label,
2706
+ dark: true
2707
+ }), jsxs("div", {
2708
+ className: cx("ath-carousel-wrapper", isHovered && "ath-carousel-hover", label && "ath-carousel-label"),
2620
2709
  onMouseEnter: handleMouseEnter,
2621
2710
  onMouseLeave: handleMouseLeave,
2622
- ref: carouselRef,
2623
- children: [jsx(Button, {
2711
+ children: [showLeftArrow && jsx(Button, {
2624
2712
  className: {
2625
2713
  button: "ath-carousel-arrow ath-carousel-left-arrow"
2626
2714
  },
2627
- onClick: handleLeftArrowClick,
2628
- onMouseEnter: handleMouseEnter,
2629
- onMouseLeave: handleMouseLeave,
2715
+ onClick: () => scrollByPage(-1),
2716
+ "aria-label": label ? `Scroll ${label} backward` : "Scroll backward",
2630
2717
  icon: jsx(HugeiconsIcon, {
2631
2718
  icon: Qt,
2632
2719
  size: 36
2633
2720
  })
2634
- }), hasItems ? children : jsx("div", {
2635
- className: "ath-carousel-empty",
2636
- children: emptyMessage
2637
- }), jsx(Button, {
2721
+ }), jsx("div", {
2722
+ className: carouselClasses,
2723
+ css: sx?.carousel,
2724
+ ref: carouselRef,
2725
+ children: itemCount > 0 ? interactive ? items.map((child, index) => jsxs("div", {
2726
+ className: cx("ath-carousel-slot", onReorder && dropIndex === index && "ath-carousel-slot-target"),
2727
+ draggable: Boolean(onReorder),
2728
+ onDragStart: onReorder ? handleDragStart(index) : undefined,
2729
+ onDragOver: onReorder ? handleDragOver(index) : undefined,
2730
+ onDrop: onReorder ? handleDrop(index) : undefined,
2731
+ onDragEnd: onReorder ? finishDrag : undefined,
2732
+ children: [onRemove && jsx(Button, {
2733
+ variant: "ghost",
2734
+ size: "small",
2735
+ type: "button",
2736
+ className: {
2737
+ button: "ath-carousel-remove-button"
2738
+ },
2739
+ icon: jsx(HugeiconsIcon, {
2740
+ icon: eI,
2741
+ size: 16
2742
+ }),
2743
+ "aria-label": typeof removeLabel === "function" ? removeLabel(index) : removeLabel,
2744
+ onMouseDown: event => event.stopPropagation(),
2745
+ onClick: event => {
2746
+ event.stopPropagation();
2747
+ onRemove(index);
2748
+ }
2749
+ }), child]
2750
+ }, /*#__PURE__*/React.isValidElement(child) ? child.key ?? index : index)) : children : jsx("div", {
2751
+ className: "ath-carousel-empty",
2752
+ children: emptyMessage
2753
+ })
2754
+ }), showRightArrow && jsx(Button, {
2638
2755
  className: {
2639
2756
  button: "ath-carousel-arrow ath-carousel-right-arrow"
2640
2757
  },
2641
- onClick: handleRightArrowClick,
2642
- onMouseEnter: handleMouseEnter,
2643
- onMouseLeave: handleMouseLeave,
2758
+ onClick: () => scrollByPage(1),
2759
+ "aria-label": label ? `Scroll ${label} forward` : "Scroll forward",
2644
2760
  icon: jsx(HugeiconsIcon, {
2645
2761
  icon: un,
2646
2762
  size: 36
2647
2763
  })
2648
2764
  })]
2649
- })
2765
+ })]
2766
+ });
2767
+ };
2768
+
2769
+ const Checkbox = ({
2770
+ checked,
2771
+ className,
2772
+ dark = false,
2773
+ disabled = false,
2774
+ id,
2775
+ label,
2776
+ name,
2777
+ sx,
2778
+ onChange
2779
+ }) => {
2780
+ return jsxs("label", {
2781
+ className: cx("ath-checkbox", dark && "ath-checkbox-dark", disabled && "ath-checkbox-disabled", className),
2782
+ css: sx,
2783
+ htmlFor: id,
2784
+ children: [jsx("input", {
2785
+ id: id,
2786
+ className: "ath-checkbox-input",
2787
+ type: "checkbox",
2788
+ name: name,
2789
+ checked: checked,
2790
+ disabled: disabled,
2791
+ onChange: event => onChange(event.target.checked)
2792
+ }), label && jsx("span", {
2793
+ className: "ath-checkbox-label",
2794
+ children: label
2795
+ })]
2650
2796
  });
2651
2797
  };
2652
2798
 
@@ -2679,30 +2825,6 @@ const Dropdown = ({
2679
2825
  });
2680
2826
  };
2681
2827
 
2682
- const FormLabel = ({
2683
- label,
2684
- required,
2685
- className,
2686
- labelPosition = "above",
2687
- dark,
2688
- sx,
2689
- ...other
2690
- }) => {
2691
- const labelClasses = cx("ath-form-input-label", labelPosition ? `ath-form-input-label-${labelPosition}` : "", dark ? "ath-form-input-label-dark" : "", className?.label);
2692
- const requiredClasses = cx("ath-form-input-label-required", dark ? "ath-form-input-label-required-dark" : "", className?.required);
2693
- return jsxs("label", {
2694
- className: labelClasses,
2695
- css: sx?.label,
2696
- ...other,
2697
- children: [label, required && jsx("span", {
2698
- className: requiredClasses,
2699
- css: sx?.required,
2700
- "aria-label": "required",
2701
- children: "*"
2702
- })]
2703
- });
2704
- };
2705
-
2706
2828
  const FormTextInput = ({
2707
2829
  autoComplete,
2708
2830
  autoFocus,
@@ -2711,6 +2833,7 @@ const FormTextInput = ({
2711
2833
  error,
2712
2834
  disabled,
2713
2835
  id,
2836
+ inputMode,
2714
2837
  name,
2715
2838
  placeholder,
2716
2839
  readOnly,
@@ -2720,6 +2843,8 @@ const FormTextInput = ({
2720
2843
  type = "text",
2721
2844
  value,
2722
2845
  onChange,
2846
+ onBlur,
2847
+ onFocus,
2723
2848
  onKeyDown,
2724
2849
  ...other
2725
2850
  }) => {
@@ -2736,12 +2861,15 @@ const FormTextInput = ({
2736
2861
  css: sx?.input,
2737
2862
  disabled: disabled,
2738
2863
  name: name,
2864
+ inputMode: inputMode,
2739
2865
  placeholder: placeholder,
2740
2866
  readOnly: readOnly,
2741
2867
  tabIndex: disabled ? -1 : tabIndex,
2742
2868
  type: type,
2743
2869
  value: value,
2744
2870
  onChange: onChangeHandler,
2871
+ onBlur: onBlur,
2872
+ onFocus: onFocus,
2745
2873
  onKeyDown: onKeyDown,
2746
2874
  id: id,
2747
2875
  ...other
@@ -2758,6 +2886,7 @@ const FormField = ({
2758
2886
  error,
2759
2887
  helperText,
2760
2888
  id,
2889
+ inputMode,
2761
2890
  label,
2762
2891
  labelPosition = "above",
2763
2892
  name,
@@ -2770,6 +2899,8 @@ const FormField = ({
2770
2899
  type = "text",
2771
2900
  value,
2772
2901
  onChange,
2902
+ onBlur,
2903
+ onFocus,
2773
2904
  onKeyDown,
2774
2905
  ...other
2775
2906
  }) => {
@@ -2814,14 +2945,20 @@ const FormField = ({
2814
2945
  labelPosition: labelPosition,
2815
2946
  dark: dark
2816
2947
  }) : null;
2948
+ const describedBy = [error && name ? `${name}-error` : "", helperText && name ? `${name}-helper` : ""].filter(Boolean).join(" ") || undefined;
2817
2949
  const inputElement = type === "textarea" ? jsx("textarea", {
2818
2950
  autoComplete: autoComplete,
2819
2951
  autoFocus: autoFocus,
2820
2952
  ref: textAreaRef,
2953
+ id: id,
2821
2954
  name: name,
2955
+ "aria-invalid": error ? true : undefined,
2956
+ "aria-describedby": describedBy,
2822
2957
  onChange: handleTextAreaChange,
2823
2958
  disabled: disabled,
2824
2959
  readOnly: readOnly,
2960
+ onBlur: onBlur,
2961
+ onFocus: onFocus,
2825
2962
  onKeyDown: onKeyDown,
2826
2963
  tabIndex: disabled ? -1 : tabIndex,
2827
2964
  className: textAreaClasses,
@@ -2833,10 +2970,13 @@ const FormField = ({
2833
2970
  autoComplete: autoComplete,
2834
2971
  autoFocus: autoFocus,
2835
2972
  name: name,
2973
+ inputMode: inputMode,
2836
2974
  type: type,
2837
2975
  onChange: handleInputChange,
2838
2976
  disabled: disabled,
2839
2977
  readOnly: readOnly,
2978
+ onBlur: onBlur,
2979
+ onFocus: onFocus,
2840
2980
  onKeyDown: onKeyDown,
2841
2981
  tabIndex: disabled ? -1 : tabIndex,
2842
2982
  className: {
@@ -2847,6 +2987,8 @@ const FormField = ({
2847
2987
  placeholder: placeholder,
2848
2988
  size: size,
2849
2989
  id: id,
2990
+ "aria-invalid": error ? true : undefined,
2991
+ "aria-describedby": describedBy,
2850
2992
  ...other
2851
2993
  });
2852
2994
  const errorElement = error ? jsx("div", {
@@ -2888,10 +3030,11 @@ const Header = ({
2888
3030
  const Main = ({
2889
3031
  children,
2890
3032
  className,
2891
- sx
3033
+ sx,
3034
+ width = "wide"
2892
3035
  }) => {
2893
3036
  const mainClasses = cx("ath-main", typeof className === "object" && className !== null ? className.main : "");
2894
- const mainContentClasses = cx("ath-main-content", typeof className === "object" && className !== null ? className.mainContent : "");
3037
+ const mainContentClasses = cx("ath-main-content", typeof className === "object" && className !== null ? className.mainContent : "", width === "full" ? "full" : "", width === "wide" ? "wide" : "", width === "medium" ? "medium" : "", width === "narrow" ? "narrow" : "");
2895
3038
  return jsx("main", {
2896
3039
  css: sx?.main,
2897
3040
  className: mainClasses,
@@ -2957,6 +3100,9 @@ const Modal = ({
2957
3100
  trapFocus = true,
2958
3101
  initialFocusRef,
2959
3102
  finalFocusRef,
3103
+ ariaLabel,
3104
+ ariaLabelledBy,
3105
+ ariaDescribedBy,
2960
3106
  sx,
2961
3107
  onClose,
2962
3108
  ...other
@@ -3045,11 +3191,15 @@ const Modal = ({
3045
3191
  css: sx?.modal,
3046
3192
  className: modalClasses,
3047
3193
  role: "dialog",
3194
+ "aria-modal": "true",
3195
+ "aria-labelledby": ariaLabelledBy || titleId,
3196
+ "aria-label": ariaLabelledBy || titleId ? undefined : ariaLabel,
3197
+ "aria-describedby": ariaDescribedBy,
3048
3198
  ...other,
3049
3199
  children: [(title || showCloseButton) && jsxs("div", {
3050
3200
  css: sx?.header,
3051
3201
  className: headerClasses,
3052
- children: [title && jsx("h1", {
3202
+ children: [title && jsx("h2", {
3053
3203
  css: sx?.title,
3054
3204
  className: titleClasses,
3055
3205
  id: titleId,
@@ -3183,7 +3333,22 @@ const SlideOut = ({
3183
3333
  const overlayClasses = cx("ath-slide-out-overlay", isOpen && "ath-slide-out-overlay-open", className?.overlay);
3184
3334
  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);
3185
3335
  const closeButtonClasses = cx("ath-slide-out-close-button", className?.closeButton);
3336
+ const slideOutRef = React.useRef(null);
3337
+ React.useEffect(() => {
3338
+ const element = slideOutRef.current;
3339
+ if (!element) return;
3340
+ if (isOpen) element.removeAttribute("inert");else element.setAttribute("inert", "");
3341
+ }, [isOpen]);
3342
+ React.useEffect(() => {
3343
+ if (!isOpen) return;
3344
+ const handleKeyDown = event => {
3345
+ if (event.key === "Escape") onClose();
3346
+ };
3347
+ document.addEventListener("keydown", handleKeyDown);
3348
+ return () => document.removeEventListener("keydown", handleKeyDown);
3349
+ }, [isOpen, onClose]);
3186
3350
  return jsxs("div", {
3351
+ ref: slideOutRef,
3187
3352
  className: slideOutClasses,
3188
3353
  css: sx?.slideOut,
3189
3354
  "data-testid": "slide-out",
@@ -3194,6 +3359,9 @@ const SlideOut = ({
3194
3359
  }), jsxs("div", {
3195
3360
  className: panelClasses,
3196
3361
  css: sx?.panel,
3362
+ role: "dialog",
3363
+ "aria-modal": "true",
3364
+ "aria-label": "Menu",
3197
3365
  children: [jsx(Button, {
3198
3366
  className: {
3199
3367
  button: closeButtonClasses
@@ -3227,192 +3395,182 @@ const breakpoints = {
3227
3395
  };
3228
3396
  const minWidth = width => `@media (min-width: ${width}px)`;
3229
3397
  const maxWidth = width => `@media (max-width: ${width - 1}px)`;
3230
- const minXs = minWidth(breakpoints.xs);
3231
- const minSm = minWidth(breakpoints.sm);
3232
- const minMd = minWidth(breakpoints.md);
3233
- const minLg = minWidth(breakpoints.lg);
3234
- const minXl = minWidth(breakpoints.xl);
3235
- const min2xl = minWidth(breakpoints["2xl"]);
3236
- const min3xl = minWidth(breakpoints["3xl"]);
3237
- const min4xl = minWidth(breakpoints["4xl"]);
3238
- const maxXs = maxWidth(breakpoints.xs);
3239
- const maxSm = maxWidth(breakpoints.sm);
3240
- const maxMd = maxWidth(breakpoints.md);
3241
- const maxLg = maxWidth(breakpoints.lg);
3242
- const maxXl = maxWidth(breakpoints.xl);
3243
- const max2xl = maxWidth(breakpoints["2xl"]);
3244
- const max3xl = maxWidth(breakpoints["3xl"]);
3245
- const max4xl = maxWidth(breakpoints["4xl"]);
3246
-
3247
- const tokens = {
3248
- font: {
3249
- family: {
3250
- sans: "Montserrat, sans-serif",
3251
- serif: "Libre Baskerville, serif"
3252
- },
3253
- size: {
3254
- xs: "0.75rem",
3255
- sm: "0.875rem",
3256
- md: "1rem",
3257
- lg: "1.25rem",
3258
- xl: "1.5rem",
3259
- "2xl": "2rem",
3260
- "3xl": "2.5rem",
3261
- "4xl": "3rem",
3262
- "5xl": "3.5rem"
3398
+ const media = {
3399
+ min: {
3400
+ xs: minWidth(breakpoints.xs),
3401
+ sm: minWidth(breakpoints.sm),
3402
+ md: minWidth(breakpoints.md),
3403
+ lg: minWidth(breakpoints.lg),
3404
+ xl: minWidth(breakpoints.xl),
3405
+ "2xl": minWidth(breakpoints["2xl"]),
3406
+ "3xl": minWidth(breakpoints["3xl"]),
3407
+ "4xl": minWidth(breakpoints["4xl"])
3408
+ },
3409
+ max: {
3410
+ xs: maxWidth(breakpoints.xs),
3411
+ sm: maxWidth(breakpoints.sm),
3412
+ md: maxWidth(breakpoints.md),
3413
+ lg: maxWidth(breakpoints.lg),
3414
+ xl: maxWidth(breakpoints.xl),
3415
+ "2xl": maxWidth(breakpoints["2xl"]),
3416
+ "3xl": maxWidth(breakpoints["3xl"]),
3417
+ "4xl": maxWidth(breakpoints["4xl"])
3418
+ }
3419
+ };
3420
+ const font = {
3421
+ family: {
3422
+ sans: "Montserrat, sans-serif",
3423
+ serif: "Libre Baskerville, serif"
3424
+ },
3425
+ size: {
3426
+ xs: "0.75rem",
3427
+ sm: "0.875rem",
3428
+ md: "1rem",
3429
+ lg: "1.25rem",
3430
+ xl: "1.5rem",
3431
+ "2xl": "2rem",
3432
+ "3xl": "2.5rem",
3433
+ "4xl": "3rem",
3434
+ "5xl": "3.5rem"
3435
+ }
3436
+ };
3437
+ const color = {
3438
+ primary: {
3439
+ "50": "#f0f2f5",
3440
+ "100": "#d9dee6",
3441
+ "200": "#b8c3d1",
3442
+ "300": "#8a9bae",
3443
+ "400": "#4a5f7a",
3444
+ "500": "#0b1828",
3445
+ "600": "#081320",
3446
+ "700": "#060e18",
3447
+ "800": "#04090f",
3448
+ "900": "#020407",
3449
+ default: "#0b1828",
3450
+ vibrant: {
3451
+ "300": "#8ab6ff",
3452
+ "500": "#4f86f7",
3453
+ "700": "#1e3a8a"
3263
3454
  }
3264
3455
  },
3265
- color: {
3266
- primary: {
3267
- "50": "#f0f2f5",
3268
- "100": "#d9dee6",
3269
- "200": "#b8c3d1",
3270
- "300": "#8a9bae",
3271
- "400": "#4a5f7a",
3272
- "500": "#0b1828",
3273
- "600": "#081320",
3274
- "700": "#060e18",
3275
- "800": "#04090f",
3276
- "900": "#020407",
3277
- "default": "#0b1828",
3278
- vibrant: {
3279
- "300": "#8ab6ff",
3280
- "500": "#4f86f7",
3281
- "700": "#1e3a8a"
3282
- }
3283
- },
3284
- secondary: {
3285
- "50": "#e6f7f6",
3286
- "100": "#b3e8e5",
3287
- "200": "#80d9d4",
3288
- "300": "#4dcac3",
3289
- "400": "#2aa39b",
3290
- "500": "#146b68",
3291
- "600": "#125a57",
3292
- "700": "#0f4a47",
3293
- "800": "#0c3835",
3294
- "900": "#081f1c",
3295
- "default": "#146b68",
3296
- vibrant: {
3297
- "300": "#75dac7",
3298
- "500": "#1abc9c",
3299
- "700": "#138f6e"
3300
- }
3301
- },
3302
- tertiary: {
3303
- "50": "#f7f4f0",
3304
- "100": "#eedecc",
3305
- "200": "#e5c8a8",
3306
- "300": "#dcb184",
3307
- "400": "#d19b60",
3308
- "500": "#bfa081",
3309
- "600": "#a68965",
3310
- "700": "#7d6748",
3311
- "800": "#54442c",
3312
- "900": "#2b2216",
3313
- "default": "#bfa081",
3314
- vibrant: {
3315
- "300": "#f7c873",
3316
- "500": "#f39c12",
3317
- "700": "#c9780e"
3318
- }
3319
- },
3320
- error: {
3321
- "50": "#fee6e6",
3322
- "100": "#fbb3b3",
3323
- "200": "#f88080",
3324
- "300": "#f54d4d",
3325
- "400": "#f21a1a",
3326
- "500": "#9f0001",
3327
- "600": "#800001",
3328
- "700": "#600001",
3329
- "800": "#400000",
3330
- "900": "#200000",
3331
- "default": "#9f0001",
3332
- vibrant: {
3333
- "300": "#f48a6f",
3334
- "500": "#e74c3c",
3335
- "700": "#c0392b"
3336
- }
3337
- },
3338
- warning: {
3339
- "50": "#fef5ec",
3340
- "100": "#fdebda",
3341
- "200": "#fad8b3",
3342
- "300": "#f8c48c",
3343
- "400": "#f5b065",
3456
+ secondary: {
3457
+ "50": "#e6f7f6",
3458
+ "100": "#b3e8e5",
3459
+ "200": "#80d9d4",
3460
+ "300": "#4dcac3",
3461
+ "400": "#2aa39b",
3462
+ "500": "#146b68",
3463
+ "600": "#125a57",
3464
+ "700": "#0f4a47",
3465
+ "800": "#0c3835",
3466
+ "900": "#081f1c",
3467
+ default: "#146b68",
3468
+ vibrant: {
3469
+ "300": "#75dac7",
3470
+ "500": "#1abc9c",
3471
+ "700": "#138f6e"
3472
+ }
3473
+ },
3474
+ tertiary: {
3475
+ "50": "#f7f4f0",
3476
+ "100": "#eedecc",
3477
+ "200": "#e5c8a8",
3478
+ "300": "#dcb184",
3479
+ "400": "#d19b60",
3480
+ "500": "#bfa081",
3481
+ "600": "#a68965",
3482
+ "700": "#7d6748",
3483
+ "800": "#54442c",
3484
+ "900": "#2b2216",
3485
+ default: "#bfa081",
3486
+ vibrant: {
3487
+ "300": "#f7c873",
3344
3488
  "500": "#f39c12",
3345
- "600": "#c27d0e",
3346
- "700": "#925e0b",
3347
- "800": "#613e07",
3348
- "900": "#311f04",
3349
- "default": "#f39c12",
3350
- vibrant: {
3351
- "300": "#fce705",
3352
- "500": "#fbc306",
3353
- "700": "#f8950a"
3354
- }
3355
- },
3356
- success: {
3357
- "50": "#e8f5f2",
3358
- "100": "#d1ece4",
3359
- "200": "#a3d8ca",
3360
- "300": "#76c5af",
3361
- "400": "#48b195",
3362
- "500": "#1a9e7a",
3363
- "600": "#157e62",
3364
- "700": "#105f49",
3365
- "800": "#0a3f31",
3366
- "900": "#052018",
3367
- "default": "#1a9e7a",
3368
- vibrant: {
3369
- "300": "#07e71f",
3370
- "500": "#08e27e",
3371
- "700": "#26b656"
3372
- }
3373
- },
3374
- text: {
3375
- dark: "#040a0c",
3376
- light: "#fcfbf7"
3377
- },
3378
- background: {
3379
- light: "#fcfbf7",
3380
- dark: "#040a0c"
3489
+ "700": "#c9780e"
3381
3490
  }
3382
3491
  },
3383
- padding: {
3384
- xs: "2px",
3385
- sm: "4px",
3386
- md: "6px",
3387
- lg: "10px",
3388
- xl: "16px"
3492
+ error: {
3493
+ "50": "#fee6e6",
3494
+ "100": "#fbb3b3",
3495
+ "200": "#f88080",
3496
+ "300": "#f54d4d",
3497
+ "400": "#f21a1a",
3498
+ "500": "#9f0001",
3499
+ "600": "#800001",
3500
+ "700": "#600001",
3501
+ "800": "#400000",
3502
+ "900": "#200000",
3503
+ default: "#9f0001",
3504
+ vibrant: {
3505
+ "300": "#f48a6f",
3506
+ "500": "#e74c3c",
3507
+ "700": "#c0392b"
3508
+ }
3389
3509
  },
3390
- radius: {
3391
- sm: "3px",
3392
- md: "5px",
3393
- lg: "8px"
3510
+ warning: {
3511
+ "50": "#fef5ec",
3512
+ "100": "#fdebda",
3513
+ "200": "#fad8b3",
3514
+ "300": "#f8c48c",
3515
+ "400": "#f5b065",
3516
+ "500": "#f39c12",
3517
+ "600": "#c27d0e",
3518
+ "700": "#925e0b",
3519
+ "800": "#613e07",
3520
+ "900": "#311f04",
3521
+ default: "#f39c12",
3522
+ vibrant: {
3523
+ "300": "#fce705",
3524
+ "500": "#fbc306",
3525
+ "700": "#f8950a"
3526
+ }
3394
3527
  },
3395
- media: {
3396
- min: {
3397
- xs: "@media (min-width: 320px)",
3398
- sm: "@media (min-width: 480px)",
3399
- md: "@media (min-width: 620px)",
3400
- lg: "@media (min-width: 768px)",
3401
- xl: "@media (min-width: 896px)",
3402
- "2xl": "@media (min-width: 1024px)",
3403
- "3xl": "@media (min-width: 1280px)"
3404
- },
3405
- max: {
3406
- xs: "@media (max-width: 319px)",
3407
- sm: "@media (max-width: 479px)",
3408
- md: "@media (max-width: 767px)",
3409
- lg: "@media (max-width: 895px)",
3410
- xl: "@media (max-width: 1023px)",
3411
- "2xl": "@media (max-width: 1279px)",
3412
- "3xl": "@media (max-width: 1535px)"
3528
+ success: {
3529
+ "50": "#e8f5f2",
3530
+ "100": "#d1ece4",
3531
+ "200": "#a3d8ca",
3532
+ "300": "#76c5af",
3533
+ "400": "#48b195",
3534
+ "500": "#1a9e7a",
3535
+ "600": "#157e62",
3536
+ "700": "#105f49",
3537
+ "800": "#0a3f31",
3538
+ "900": "#052018",
3539
+ default: "#1a9e7a",
3540
+ vibrant: {
3541
+ "300": "#07e71f",
3542
+ "500": "#08e27e",
3543
+ "700": "#26b656"
3413
3544
  }
3545
+ },
3546
+ text: {
3547
+ dark: "#040a0c",
3548
+ light: "#fcfbf7"
3549
+ },
3550
+ background: {
3551
+ light: "#fcfbf7",
3552
+ dark: "#040a0c"
3414
3553
  }
3415
3554
  };
3555
+ const padding = {
3556
+ xs: "2px",
3557
+ sm: "4px",
3558
+ md: "6px",
3559
+ lg: "10px",
3560
+ xl: "16px"
3561
+ };
3562
+ const radius = {
3563
+ sm: "3px",
3564
+ md: "5px",
3565
+ lg: "8px"
3566
+ };
3567
+ const tokens = {
3568
+ font,
3569
+ color,
3570
+ media,
3571
+ padding,
3572
+ radius
3573
+ };
3416
3574
 
3417
3575
  exports.Accordion = Accordion;
3418
3576
  exports.AccordionItem = AccordionItem;
@@ -3421,6 +3579,7 @@ exports.Block = Block;
3421
3579
  exports.Button = Button;
3422
3580
  exports.ButtonGroup = ButtonGroup;
3423
3581
  exports.Carousel = Carousel;
3582
+ exports.Checkbox = Checkbox;
3424
3583
  exports.ContainerScalingText = ContainerScalingText;
3425
3584
  exports.Dropdown = Dropdown;
3426
3585
  exports.Footer = Footer;
@@ -3436,22 +3595,11 @@ exports.ScrollToTopButton = ScrollToTopButton;
3436
3595
  exports.Search = Search;
3437
3596
  exports.SlideOut = SlideOut;
3438
3597
  exports.breakpoints = breakpoints;
3598
+ exports.color = color;
3439
3599
  exports.cx = cx;
3440
- exports.max2xl = max2xl;
3441
- exports.max3xl = max3xl;
3442
- exports.max4xl = max4xl;
3443
- exports.maxLg = maxLg;
3444
- exports.maxMd = maxMd;
3445
- exports.maxSm = maxSm;
3446
- exports.maxXl = maxXl;
3447
- exports.maxXs = maxXs;
3448
- exports.min2xl = min2xl;
3449
- exports.min3xl = min3xl;
3450
- exports.min4xl = min4xl;
3451
- exports.minLg = minLg;
3452
- exports.minMd = minMd;
3453
- exports.minSm = minSm;
3454
- exports.minXl = minXl;
3455
- exports.minXs = minXs;
3600
+ exports.font = font;
3601
+ exports.media = media;
3602
+ exports.padding = padding;
3603
+ exports.radius = radius;
3456
3604
  exports.tokens = tokens;
3457
3605
  //# sourceMappingURL=athameui.cjs.map