athameui 0.0.9-c → 0.0.11
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 +18 -0
- package/components/Button/button.variants.ts +1 -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 +118 -6
- package/dist/athameui.cjs.map +1 -1
- package/dist/athameui.mjs +103 -8
- package/dist/athameui.mjs.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +3 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/button.variants.d.ts +1 -0
- package/dist/components/Button/button.variants.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/breakpoints.d.ts +16 -0
- package/dist/styles/breakpoints.d.ts.map +1 -1
- package/dist/styles/breakpoints.ts +21 -0
- package/dist/styles/components/button.css +4 -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/breakpoints.ts +21 -0
- package/styles/components/button.css +4 -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
|
|
|
@@ -2159,7 +2159,8 @@ const buttonVariants = {
|
|
|
2159
2159
|
outline: "ath-button-outline",
|
|
2160
2160
|
ghost: "ath-button-ghost"
|
|
2161
2161
|
},
|
|
2162
|
-
dark: "ath-button-dark"
|
|
2162
|
+
dark: "ath-button-dark",
|
|
2163
|
+
wrap: "ath-button-wrap"
|
|
2163
2164
|
};
|
|
2164
2165
|
|
|
2165
2166
|
const Button = /*#__PURE__*/forwardRef(({
|
|
@@ -2174,14 +2175,18 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
2174
2175
|
type = "button",
|
|
2175
2176
|
textPosition = "center",
|
|
2176
2177
|
variant = "secondary",
|
|
2178
|
+
wrap = false,
|
|
2177
2179
|
onBlur,
|
|
2178
2180
|
onClick,
|
|
2179
2181
|
onFocus,
|
|
2180
2182
|
onKeyDown,
|
|
2183
|
+
onMouseEnter,
|
|
2184
|
+
onMouseLeave,
|
|
2181
2185
|
...other
|
|
2182
2186
|
}, ref) => {
|
|
2187
|
+
console.log(sx);
|
|
2183
2188
|
const isIconOnly = icon && !children;
|
|
2184
|
-
const sharedClasses = cx("ath-button", buttonVariants.size[size], buttonVariants.variant[variant], isIconOnly ? "ath-button-icon-only" : "", dark ? buttonVariants.dark : "");
|
|
2189
|
+
const sharedClasses = cx("ath-button", buttonVariants.size[size], buttonVariants.variant[variant], isIconOnly ? "ath-button-icon-only" : "", dark ? buttonVariants.dark : "", wrap ? buttonVariants.wrap : "");
|
|
2185
2190
|
const buttonClasses = cx(sharedClasses, buttonVariants.textPosition[textPosition], typeof className === "object" && className !== null ? className.button : className);
|
|
2186
2191
|
const onClickHandler = e => {
|
|
2187
2192
|
onClick?.(e);
|
|
@@ -2195,6 +2200,12 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
2195
2200
|
const onBlurHandler = e => {
|
|
2196
2201
|
onBlur?.(e);
|
|
2197
2202
|
};
|
|
2203
|
+
const onMouseEnterHandler = e => {
|
|
2204
|
+
onMouseEnter?.(e);
|
|
2205
|
+
};
|
|
2206
|
+
const onMouseLeaveHandler = e => {
|
|
2207
|
+
onMouseLeave?.(e);
|
|
2208
|
+
};
|
|
2198
2209
|
return jsx("button", {
|
|
2199
2210
|
ref: ref,
|
|
2200
2211
|
className: buttonClasses,
|
|
@@ -2206,6 +2217,8 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
2206
2217
|
onKeyDown: onKeyDownHandler,
|
|
2207
2218
|
onFocus: onFocusHandler,
|
|
2208
2219
|
onBlur: onBlurHandler,
|
|
2220
|
+
onMouseEnter: onMouseEnterHandler,
|
|
2221
|
+
onMouseLeave: onMouseLeaveHandler,
|
|
2209
2222
|
...other,
|
|
2210
2223
|
children: icon ? jsxs(Fragment, {
|
|
2211
2224
|
children: [icon, !isIconOnly && children]
|
|
@@ -2346,7 +2359,6 @@ const Avatar = ({
|
|
|
2346
2359
|
sx,
|
|
2347
2360
|
size = "medium"
|
|
2348
2361
|
}) => {
|
|
2349
|
-
console.log(className?.avatar);
|
|
2350
2362
|
const initials = displayName.split(" ").map(n => n[0].toUpperCase());
|
|
2351
2363
|
const avatarClasses = cx("ath-avatar", `ath-avatar-${size}`, className?.avatar);
|
|
2352
2364
|
const initialsClasses = cx(`ath-avatar-initials`, className?.initials);
|
|
@@ -2432,7 +2444,7 @@ const HugeiconsIcon = forwardRef(({ color = 'currentColor', size = 24, strokeWid
|
|
|
2432
2444
|
});
|
|
2433
2445
|
HugeiconsIcon.displayName = 'HugeiconsIcon';
|
|
2434
2446
|
|
|
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"}]];
|
|
2447
|
+
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
2448
|
|
|
2437
2449
|
const ScrollToTopButton = ({
|
|
2438
2450
|
className,
|
|
@@ -2550,6 +2562,71 @@ const ButtonGroup = ({
|
|
|
2550
2562
|
});
|
|
2551
2563
|
};
|
|
2552
2564
|
|
|
2565
|
+
const Carousel = ({
|
|
2566
|
+
children,
|
|
2567
|
+
className,
|
|
2568
|
+
emptyMessage,
|
|
2569
|
+
sx
|
|
2570
|
+
}) => {
|
|
2571
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
2572
|
+
const carouselRef = useRef(null);
|
|
2573
|
+
const carouselClasses = cx("ath-carousel", isHovered ? "ath-carousel-hover" : "", className?.carousel);
|
|
2574
|
+
const hasItems = Children.count(children) > 0;
|
|
2575
|
+
const scrollByPage = direction => {
|
|
2576
|
+
const el = carouselRef.current;
|
|
2577
|
+
if (!el) return;
|
|
2578
|
+
el.scrollBy({
|
|
2579
|
+
left: direction * el.clientWidth,
|
|
2580
|
+
behavior: "smooth"
|
|
2581
|
+
});
|
|
2582
|
+
};
|
|
2583
|
+
const handleLeftArrowClick = () => {
|
|
2584
|
+
scrollByPage(-1);
|
|
2585
|
+
};
|
|
2586
|
+
const handleRightArrowClick = () => {
|
|
2587
|
+
scrollByPage(1);
|
|
2588
|
+
};
|
|
2589
|
+
const handleMouseEnter = () => {
|
|
2590
|
+
setIsHovered(true);
|
|
2591
|
+
};
|
|
2592
|
+
const handleMouseLeave = () => {
|
|
2593
|
+
setIsHovered(false);
|
|
2594
|
+
};
|
|
2595
|
+
return jsx("div", {
|
|
2596
|
+
className: "ath-carousel-wrapper",
|
|
2597
|
+
children: jsxs("div", {
|
|
2598
|
+
className: carouselClasses,
|
|
2599
|
+
css: sx?.carousel,
|
|
2600
|
+
onMouseEnter: handleMouseEnter,
|
|
2601
|
+
onMouseLeave: handleMouseLeave,
|
|
2602
|
+
ref: carouselRef,
|
|
2603
|
+
children: [jsx(Button, {
|
|
2604
|
+
className: {
|
|
2605
|
+
button: "ath-carousel-arrow ath-carousel-left-arrow"
|
|
2606
|
+
},
|
|
2607
|
+
onClick: handleLeftArrowClick,
|
|
2608
|
+
onMouseEnter: handleMouseEnter,
|
|
2609
|
+
onMouseLeave: handleMouseLeave,
|
|
2610
|
+
icon: jsx(HugeiconsIcon, {
|
|
2611
|
+
icon: Qt,
|
|
2612
|
+
size: 36
|
|
2613
|
+
})
|
|
2614
|
+
}), hasItems ? children : emptyMessage, jsx(Button, {
|
|
2615
|
+
className: {
|
|
2616
|
+
button: "ath-carousel-arrow ath-carousel-right-arrow"
|
|
2617
|
+
},
|
|
2618
|
+
onClick: handleRightArrowClick,
|
|
2619
|
+
onMouseEnter: handleMouseEnter,
|
|
2620
|
+
onMouseLeave: handleMouseLeave,
|
|
2621
|
+
icon: jsx(HugeiconsIcon, {
|
|
2622
|
+
icon: un,
|
|
2623
|
+
size: 36
|
|
2624
|
+
})
|
|
2625
|
+
})]
|
|
2626
|
+
})
|
|
2627
|
+
});
|
|
2628
|
+
};
|
|
2629
|
+
|
|
2553
2630
|
const Dropdown = ({
|
|
2554
2631
|
children,
|
|
2555
2632
|
className,
|
|
@@ -2570,12 +2647,12 @@ const Dropdown = ({
|
|
|
2570
2647
|
document.removeEventListener("mousedown", handleOutsideClick);
|
|
2571
2648
|
};
|
|
2572
2649
|
}, [onClose]);
|
|
2573
|
-
return
|
|
2650
|
+
return jsx("div", {
|
|
2574
2651
|
ref: dropdownRef,
|
|
2575
2652
|
className: dropdownClasses,
|
|
2576
2653
|
css: sx?.dropdown,
|
|
2577
2654
|
"data-testid": "dropdown",
|
|
2578
|
-
children:
|
|
2655
|
+
children: children
|
|
2579
2656
|
});
|
|
2580
2657
|
};
|
|
2581
2658
|
|
|
@@ -3125,6 +3202,24 @@ const breakpoints = {
|
|
|
3125
3202
|
"3xl": 1280,
|
|
3126
3203
|
"4xl": 1536
|
|
3127
3204
|
};
|
|
3205
|
+
const minWidth = width => `@media (min-width: ${width}px)`;
|
|
3206
|
+
const maxWidth = width => `@media (max-width: ${width - 1}px)`;
|
|
3207
|
+
const minXs = minWidth(breakpoints.xs);
|
|
3208
|
+
const minSm = minWidth(breakpoints.sm);
|
|
3209
|
+
const minMd = minWidth(breakpoints.md);
|
|
3210
|
+
const minLg = minWidth(breakpoints.lg);
|
|
3211
|
+
const minXl = minWidth(breakpoints.xl);
|
|
3212
|
+
const min2xl = minWidth(breakpoints["2xl"]);
|
|
3213
|
+
const min3xl = minWidth(breakpoints["3xl"]);
|
|
3214
|
+
const min4xl = minWidth(breakpoints["4xl"]);
|
|
3215
|
+
const maxXs = maxWidth(breakpoints.xs);
|
|
3216
|
+
const maxSm = maxWidth(breakpoints.sm);
|
|
3217
|
+
const maxMd = maxWidth(breakpoints.md);
|
|
3218
|
+
const maxLg = maxWidth(breakpoints.lg);
|
|
3219
|
+
const maxXl = maxWidth(breakpoints.xl);
|
|
3220
|
+
const max2xl = maxWidth(breakpoints["2xl"]);
|
|
3221
|
+
const max3xl = maxWidth(breakpoints["3xl"]);
|
|
3222
|
+
const max4xl = maxWidth(breakpoints["4xl"]);
|
|
3128
3223
|
|
|
3129
3224
|
const tokens = {
|
|
3130
3225
|
font: {
|
|
@@ -3296,5 +3391,5 @@ const tokens = {
|
|
|
3296
3391
|
}
|
|
3297
3392
|
};
|
|
3298
3393
|
|
|
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 };
|
|
3394
|
+
export { Accordion, AccordionItem, Avatar, Block, Button, ButtonGroup, Carousel, ContainerScalingText, Dropdown, Footer, FormField, FormLabel, FormTextInput, Header, List, ListItem, Main, Modal, ScrollToTopButton, Search, SlideOut, breakpoints, cx, max2xl, max3xl, max4xl, maxLg, maxMd, maxSm, maxXl, maxXs, min2xl, min3xl, min4xl, minLg, minMd, minSm, minXl, minXs, tokens };
|
|
3300
3395
|
//# sourceMappingURL=athameui.mjs.map
|