athameui 0.0.10 → 0.0.12
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/Button/Button.tsx +3 -0
- package/components/Button/button.variants.ts +1 -0
- package/components/Carousel/Carousel.tsx +6 -2
- package/components/FormField/FormField.tsx +1 -0
- package/dist/athameui.cjs +44 -5
- package/dist/athameui.cjs.map +1 -1
- package/dist/athameui.mjs +29 -6
- package/dist/athameui.mjs.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -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.map +1 -1
- package/dist/components/FormField/FormField.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 +9 -2
- package/dist/styles/components/form-input.css +27 -7
- package/dist/styles/tokens.css +0 -3
- package/package.json +1 -1
- package/styles/breakpoints.ts +21 -0
- package/styles/components/button.css +4 -1
- package/styles/components/carousel.css +9 -2
- package/styles/components/form-input.css +27 -7
- package/styles/tokens.css +0 -3
|
@@ -29,6 +29,7 @@ export type ButtonProps = {
|
|
|
29
29
|
textPosition?: "left" | "center" | "right";
|
|
30
30
|
type?: "button" | "submit" | "reset";
|
|
31
31
|
variant?: ButtonVariant;
|
|
32
|
+
wrap?: boolean;
|
|
32
33
|
|
|
33
34
|
onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
34
35
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
@@ -52,6 +53,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
52
53
|
type = "button",
|
|
53
54
|
textPosition = "center",
|
|
54
55
|
variant = "secondary",
|
|
56
|
+
wrap = false,
|
|
55
57
|
|
|
56
58
|
onBlur,
|
|
57
59
|
onClick,
|
|
@@ -71,6 +73,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
71
73
|
buttonVariants.variant[variant],
|
|
72
74
|
isIconOnly ? "ath-button-icon-only" : "",
|
|
73
75
|
dark ? buttonVariants.dark : "",
|
|
76
|
+
wrap ? buttonVariants.wrap : "",
|
|
74
77
|
);
|
|
75
78
|
|
|
76
79
|
const buttonClasses = cx(
|
|
@@ -19,7 +19,7 @@ export type CarouselProps = {
|
|
|
19
19
|
export const Carousel = ({
|
|
20
20
|
children,
|
|
21
21
|
className,
|
|
22
|
-
emptyMessage,
|
|
22
|
+
emptyMessage = "Nothing here yet",
|
|
23
23
|
sx,
|
|
24
24
|
}: CarouselProps) => {
|
|
25
25
|
const [isHovered, setIsHovered] = useState(false);
|
|
@@ -70,7 +70,11 @@ export const Carousel = ({
|
|
|
70
70
|
onMouseLeave={handleMouseLeave}
|
|
71
71
|
icon={<HugeiconsIcon icon={ArrowLeftIcon} size={36} />}
|
|
72
72
|
/>
|
|
73
|
-
{hasItems ?
|
|
73
|
+
{hasItems ? (
|
|
74
|
+
children
|
|
75
|
+
) : (
|
|
76
|
+
<div className="ath-carousel-empty">{emptyMessage}</div>
|
|
77
|
+
)}
|
|
74
78
|
<Button
|
|
75
79
|
className={{ button: "ath-carousel-arrow ath-carousel-right-arrow" }}
|
|
76
80
|
onClick={handleRightArrowClick}
|
|
@@ -92,6 +92,7 @@ export const FormField: React.FC<FormFieldProps> = ({
|
|
|
92
92
|
|
|
93
93
|
const containerClasses = cx(
|
|
94
94
|
"ath-form-input-container",
|
|
95
|
+
readOnly && "ath-form-input-container-readonly",
|
|
95
96
|
(labelPosition === "left" || labelPosition === "right") &&
|
|
96
97
|
"ath-form-input-container-horizontal",
|
|
97
98
|
className?.container ? className.container : "",
|
package/dist/athameui.cjs
CHANGED
|
@@ -2180,7 +2180,8 @@ const buttonVariants = {
|
|
|
2180
2180
|
outline: "ath-button-outline",
|
|
2181
2181
|
ghost: "ath-button-ghost"
|
|
2182
2182
|
},
|
|
2183
|
-
dark: "ath-button-dark"
|
|
2183
|
+
dark: "ath-button-dark",
|
|
2184
|
+
wrap: "ath-button-wrap"
|
|
2184
2185
|
};
|
|
2185
2186
|
|
|
2186
2187
|
const Button = /*#__PURE__*/React.forwardRef(({
|
|
@@ -2195,6 +2196,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
2195
2196
|
type = "button",
|
|
2196
2197
|
textPosition = "center",
|
|
2197
2198
|
variant = "secondary",
|
|
2199
|
+
wrap = false,
|
|
2198
2200
|
onBlur,
|
|
2199
2201
|
onClick,
|
|
2200
2202
|
onFocus,
|
|
@@ -2204,7 +2206,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
2204
2206
|
...other
|
|
2205
2207
|
}, ref) => {
|
|
2206
2208
|
const isIconOnly = icon && !children;
|
|
2207
|
-
const sharedClasses = cx("ath-button", buttonVariants.size[size], buttonVariants.variant[variant], isIconOnly ? "ath-button-icon-only" : "", dark ? buttonVariants.dark : "");
|
|
2209
|
+
const sharedClasses = cx("ath-button", buttonVariants.size[size], buttonVariants.variant[variant], isIconOnly ? "ath-button-icon-only" : "", dark ? buttonVariants.dark : "", wrap ? buttonVariants.wrap : "");
|
|
2208
2210
|
const buttonClasses = cx(sharedClasses, buttonVariants.textPosition[textPosition], typeof className === "object" && className !== null ? className.button : className);
|
|
2209
2211
|
const onClickHandler = e => {
|
|
2210
2212
|
onClick?.(e);
|
|
@@ -2583,7 +2585,7 @@ const ButtonGroup = ({
|
|
|
2583
2585
|
const Carousel = ({
|
|
2584
2586
|
children,
|
|
2585
2587
|
className,
|
|
2586
|
-
emptyMessage,
|
|
2588
|
+
emptyMessage = "Nothing here yet",
|
|
2587
2589
|
sx
|
|
2588
2590
|
}) => {
|
|
2589
2591
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
@@ -2629,7 +2631,10 @@ const Carousel = ({
|
|
|
2629
2631
|
icon: Qt,
|
|
2630
2632
|
size: 36
|
|
2631
2633
|
})
|
|
2632
|
-
}), hasItems ? children :
|
|
2634
|
+
}), hasItems ? children : jsx("div", {
|
|
2635
|
+
className: "ath-carousel-empty",
|
|
2636
|
+
children: emptyMessage
|
|
2637
|
+
}), jsx(Button, {
|
|
2633
2638
|
className: {
|
|
2634
2639
|
button: "ath-carousel-arrow ath-carousel-right-arrow"
|
|
2635
2640
|
},
|
|
@@ -2769,7 +2774,7 @@ const FormField = ({
|
|
|
2769
2774
|
...other
|
|
2770
2775
|
}) => {
|
|
2771
2776
|
const textAreaRef = React.useRef(null);
|
|
2772
|
-
const containerClasses = cx("ath-form-input-container", (labelPosition === "left" || labelPosition === "right") && "ath-form-input-container-horizontal", className?.container ? className.container : "");
|
|
2777
|
+
const containerClasses = cx("ath-form-input-container", readOnly && "ath-form-input-container-readonly", (labelPosition === "left" || labelPosition === "right") && "ath-form-input-container-horizontal", className?.container ? className.container : "");
|
|
2773
2778
|
const inputSharedClasses = cx(`ath-form-input-${size}`, disabled && "ath-form-input-shared-disabled", readOnly && "ath-form-input-shared-readonly", dark && "ath-form-input-shared-dark", className?.input ? className.input : "");
|
|
2774
2779
|
const inputClasses = cx("ath-form-input", inputSharedClasses, error && "ath-form-input-error");
|
|
2775
2780
|
const textAreaClasses = cx("ath-form-textarea", inputSharedClasses, autoResize && "ath-form-textarea-auto-resize", error && "ath-form-textarea-error");
|
|
@@ -3220,6 +3225,24 @@ const breakpoints = {
|
|
|
3220
3225
|
"3xl": 1280,
|
|
3221
3226
|
"4xl": 1536
|
|
3222
3227
|
};
|
|
3228
|
+
const minWidth = width => `@media (min-width: ${width}px)`;
|
|
3229
|
+
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"]);
|
|
3223
3246
|
|
|
3224
3247
|
const tokens = {
|
|
3225
3248
|
font: {
|
|
@@ -3414,5 +3437,21 @@ exports.Search = Search;
|
|
|
3414
3437
|
exports.SlideOut = SlideOut;
|
|
3415
3438
|
exports.breakpoints = breakpoints;
|
|
3416
3439
|
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;
|
|
3417
3456
|
exports.tokens = tokens;
|
|
3418
3457
|
//# sourceMappingURL=athameui.cjs.map
|