athameui 0.0.10 → 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/Button/Button.tsx +4 -0
- package/components/Button/button.variants.ts +1 -0
- package/dist/athameui.cjs +39 -2
- package/dist/athameui.cjs.map +1 -1
- package/dist/athameui.mjs +24 -3
- 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/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/package.json +1 -1
- package/styles/breakpoints.ts +21 -0
- package/styles/components/button.css +4 -1
|
@@ -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,
|
|
@@ -63,6 +65,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
63
65
|
},
|
|
64
66
|
ref,
|
|
65
67
|
) => {
|
|
68
|
+
console.log(sx);
|
|
66
69
|
const isIconOnly = icon && !children;
|
|
67
70
|
|
|
68
71
|
const sharedClasses = cx(
|
|
@@ -71,6 +74,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
71
74
|
buttonVariants.variant[variant],
|
|
72
75
|
isIconOnly ? "ath-button-icon-only" : "",
|
|
73
76
|
dark ? buttonVariants.dark : "",
|
|
77
|
+
wrap ? buttonVariants.wrap : "",
|
|
74
78
|
);
|
|
75
79
|
|
|
76
80
|
const buttonClasses = cx(
|
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,
|
|
@@ -2203,8 +2205,9 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
2203
2205
|
onMouseLeave,
|
|
2204
2206
|
...other
|
|
2205
2207
|
}, ref) => {
|
|
2208
|
+
console.log(sx);
|
|
2206
2209
|
const isIconOnly = icon && !children;
|
|
2207
|
-
const sharedClasses = cx("ath-button", buttonVariants.size[size], buttonVariants.variant[variant], isIconOnly ? "ath-button-icon-only" : "", dark ? buttonVariants.dark : "");
|
|
2210
|
+
const sharedClasses = cx("ath-button", buttonVariants.size[size], buttonVariants.variant[variant], isIconOnly ? "ath-button-icon-only" : "", dark ? buttonVariants.dark : "", wrap ? buttonVariants.wrap : "");
|
|
2208
2211
|
const buttonClasses = cx(sharedClasses, buttonVariants.textPosition[textPosition], typeof className === "object" && className !== null ? className.button : className);
|
|
2209
2212
|
const onClickHandler = e => {
|
|
2210
2213
|
onClick?.(e);
|
|
@@ -3220,6 +3223,24 @@ const breakpoints = {
|
|
|
3220
3223
|
"3xl": 1280,
|
|
3221
3224
|
"4xl": 1536
|
|
3222
3225
|
};
|
|
3226
|
+
const minWidth = width => `@media (min-width: ${width}px)`;
|
|
3227
|
+
const maxWidth = width => `@media (max-width: ${width - 1}px)`;
|
|
3228
|
+
const minXs = minWidth(breakpoints.xs);
|
|
3229
|
+
const minSm = minWidth(breakpoints.sm);
|
|
3230
|
+
const minMd = minWidth(breakpoints.md);
|
|
3231
|
+
const minLg = minWidth(breakpoints.lg);
|
|
3232
|
+
const minXl = minWidth(breakpoints.xl);
|
|
3233
|
+
const min2xl = minWidth(breakpoints["2xl"]);
|
|
3234
|
+
const min3xl = minWidth(breakpoints["3xl"]);
|
|
3235
|
+
const min4xl = minWidth(breakpoints["4xl"]);
|
|
3236
|
+
const maxXs = maxWidth(breakpoints.xs);
|
|
3237
|
+
const maxSm = maxWidth(breakpoints.sm);
|
|
3238
|
+
const maxMd = maxWidth(breakpoints.md);
|
|
3239
|
+
const maxLg = maxWidth(breakpoints.lg);
|
|
3240
|
+
const maxXl = maxWidth(breakpoints.xl);
|
|
3241
|
+
const max2xl = maxWidth(breakpoints["2xl"]);
|
|
3242
|
+
const max3xl = maxWidth(breakpoints["3xl"]);
|
|
3243
|
+
const max4xl = maxWidth(breakpoints["4xl"]);
|
|
3223
3244
|
|
|
3224
3245
|
const tokens = {
|
|
3225
3246
|
font: {
|
|
@@ -3414,5 +3435,21 @@ exports.Search = Search;
|
|
|
3414
3435
|
exports.SlideOut = SlideOut;
|
|
3415
3436
|
exports.breakpoints = breakpoints;
|
|
3416
3437
|
exports.cx = cx;
|
|
3438
|
+
exports.max2xl = max2xl;
|
|
3439
|
+
exports.max3xl = max3xl;
|
|
3440
|
+
exports.max4xl = max4xl;
|
|
3441
|
+
exports.maxLg = maxLg;
|
|
3442
|
+
exports.maxMd = maxMd;
|
|
3443
|
+
exports.maxSm = maxSm;
|
|
3444
|
+
exports.maxXl = maxXl;
|
|
3445
|
+
exports.maxXs = maxXs;
|
|
3446
|
+
exports.min2xl = min2xl;
|
|
3447
|
+
exports.min3xl = min3xl;
|
|
3448
|
+
exports.min4xl = min4xl;
|
|
3449
|
+
exports.minLg = minLg;
|
|
3450
|
+
exports.minMd = minMd;
|
|
3451
|
+
exports.minSm = minSm;
|
|
3452
|
+
exports.minXl = minXl;
|
|
3453
|
+
exports.minXs = minXs;
|
|
3417
3454
|
exports.tokens = tokens;
|
|
3418
3455
|
//# sourceMappingURL=athameui.cjs.map
|