athameui 0.0.9-c → 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.
- package/components/Avatar/Avatar.tsx +0 -1
- package/components/Button/Button.tsx +14 -0
- package/components/Carousel/Carousel.tsx +84 -0
- package/components/Carousel/index.ts +1 -0
- package/components/DropDown/Dropdown.tsx +0 -1
- package/components/index.ts +1 -0
- package/dist/athameui.cjs +79 -4
- package/dist/athameui.cjs.map +1 -1
- package/dist/athameui.mjs +80 -6
- package/dist/athameui.mjs.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +14 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -0
- package/dist/components/Carousel/index.d.ts +2 -0
- package/dist/components/Carousel/index.d.ts.map +1 -0
- package/dist/components/DropDown/Dropdown.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/styles/components/carousel.css +43 -0
- package/dist/styles/components/form-input.css +10 -1
- package/dist/styles/components/main.css +3 -1
- package/dist/styles/theme.css +1 -0
- package/dist/styles/tokens.css +6 -10
- package/package.json +1 -1
- package/styles/components/carousel.css +43 -0
- package/styles/components/form-input.css +10 -1
- package/styles/components/main.css +3 -1
- package/styles/theme.css +1 -0
- package/styles/tokens.css +6 -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);
|
|
@@ -2432,7 +2441,7 @@ const HugeiconsIcon = forwardRef(({ color = 'currentColor', size = 24, strokeWid
|
|
|
2432
2441
|
});
|
|
2433
2442
|
HugeiconsIcon.displayName = 'HugeiconsIcon';
|
|
2434
2443
|
|
|
2435
|
-
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"}]];
|
|
2436
2445
|
|
|
2437
2446
|
const ScrollToTopButton = ({
|
|
2438
2447
|
className,
|
|
@@ -2550,6 +2559,71 @@ const ButtonGroup = ({
|
|
|
2550
2559
|
});
|
|
2551
2560
|
};
|
|
2552
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
|
+
|
|
2553
2627
|
const Dropdown = ({
|
|
2554
2628
|
children,
|
|
2555
2629
|
className,
|
|
@@ -2570,12 +2644,12 @@ const Dropdown = ({
|
|
|
2570
2644
|
document.removeEventListener("mousedown", handleOutsideClick);
|
|
2571
2645
|
};
|
|
2572
2646
|
}, [onClose]);
|
|
2573
|
-
return
|
|
2647
|
+
return jsx("div", {
|
|
2574
2648
|
ref: dropdownRef,
|
|
2575
2649
|
className: dropdownClasses,
|
|
2576
2650
|
css: sx?.dropdown,
|
|
2577
2651
|
"data-testid": "dropdown",
|
|
2578
|
-
children:
|
|
2652
|
+
children: children
|
|
2579
2653
|
});
|
|
2580
2654
|
};
|
|
2581
2655
|
|
|
@@ -3296,5 +3370,5 @@ const tokens = {
|
|
|
3296
3370
|
}
|
|
3297
3371
|
};
|
|
3298
3372
|
|
|
3299
|
-
export { Accordion, AccordionItem, Avatar, Block, Button, ButtonGroup, ContainerScalingText, Dropdown, Footer, FormField, FormLabel, FormTextInput, Header, List, ListItem, Main, Modal, ScrollToTopButton, Search, SlideOut, 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 };
|
|
3300
3374
|
//# sourceMappingURL=athameui.mjs.map
|