@aristobyte-ui/button 1.0.73 → 1.0.75
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/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -86,12 +86,12 @@ var Button = ({
|
|
|
86
86
|
onClick == null ? void 0 : onClick(e);
|
|
87
87
|
};
|
|
88
88
|
const buttonClasses = clsx_default(
|
|
89
|
-
"
|
|
90
|
-
transparent && "
|
|
91
|
-
`
|
|
92
|
-
`
|
|
93
|
-
`
|
|
94
|
-
isLoading && "
|
|
89
|
+
"button",
|
|
90
|
+
transparent && "button-transparent",
|
|
91
|
+
`button-${variant}-${appearance}`,
|
|
92
|
+
`button-${size}`,
|
|
93
|
+
`button-radius-${radius}`,
|
|
94
|
+
isLoading && "button-loading",
|
|
95
95
|
className
|
|
96
96
|
);
|
|
97
97
|
const renderContent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -108,8 +108,8 @@ var Button = ({
|
|
|
108
108
|
"span",
|
|
109
109
|
{
|
|
110
110
|
className: clsx_default(
|
|
111
|
-
"
|
|
112
|
-
icon.align === "right" && "
|
|
111
|
+
"button-icon",
|
|
112
|
+
icon.align === "right" && "button-icon-right"
|
|
113
113
|
),
|
|
114
114
|
children: icon.component({ color: icon.color, size: icon.size })
|
|
115
115
|
}
|
|
@@ -161,11 +161,11 @@ var ButtonGroup = ({
|
|
|
161
161
|
style = {}
|
|
162
162
|
}) => {
|
|
163
163
|
const groupClasses = clsx_default(
|
|
164
|
-
"
|
|
165
|
-
`
|
|
166
|
-
`
|
|
167
|
-
`
|
|
168
|
-
`
|
|
164
|
+
"button-group",
|
|
165
|
+
`button-group-${align}`,
|
|
166
|
+
`button-group-variant-${variant}`,
|
|
167
|
+
`button-group-radius-${radius}`,
|
|
168
|
+
`button-group-size-${size}`,
|
|
169
169
|
className
|
|
170
170
|
);
|
|
171
171
|
const buttons = React2.Children.toArray(
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../index.ts","../components/Button.tsx","../../../node_modules/clsx/dist/clsx.mjs","../components/ButtonGroup.tsx"],"sourcesContent":["export * from \"./components\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport clsx from \"clsx\";\nimport { Spinner } from \"@aristobyte-ui/spinner\";\nimport { type IconPropsType, renderRipple } from \"@aristobyte-ui/utils\";\n\nexport interface IButton {\n type?: \"button\" | \"link\";\n text?: string;\n children?: React.ReactNode;\n href?: string;\n target?: \"_self\" | \"_blank\" | \"_parent\" | \"_top\";\n onClick?: (\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => void | Promise<void>;\n disabled?: boolean;\n transparent?: boolean;\n variant?:\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"error\"\n | \"warning\";\n appearance?:\n | \"solid\"\n | \"outline\"\n | \"outline-dashed\"\n | \"no-outline\"\n | \"glowing\";\n size?: \"xsm\" | \"sm\" | \"md\" | \"lg\" | \"xlg\";\n radius?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n icon?: {\n component: (props: IconPropsType) => React.ReactElement;\n color?: string;\n size?: number;\n align?: \"left\" | \"right\";\n };\n isLoading?: boolean;\n spinnerType?: \"default\" | \"duo\" | \"gradient\" | \"pulse\" | \"pulse-duo\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport const Button: React.FC<IButton> = ({\n onClick,\n text = \"\",\n href = \"\",\n target = \"_self\",\n children = \"\",\n type = \"button\",\n variant = \"default\",\n appearance = \"solid\",\n size = \"md\",\n radius = \"md\",\n icon,\n spinnerType = \"default\",\n transparent = false,\n isLoading = false,\n disabled = false,\n className = \"\",\n style = {},\n}) => {\n const uniqueId = React.useId();\n const ref = React.useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n\n const handleClick = (\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => {\n const { clientX, clientY } = e;\n renderRipple({ ref, clientX, clientY });\n onClick?.(e);\n };\n\n const buttonClasses = clsx(\n \"
|
|
1
|
+
{"version":3,"sources":["../index.ts","../components/Button.tsx","../../../node_modules/clsx/dist/clsx.mjs","../components/ButtonGroup.tsx"],"sourcesContent":["export * from \"./components\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport clsx from \"clsx\";\nimport { Spinner } from \"@aristobyte-ui/spinner\";\nimport { type IconPropsType, renderRipple } from \"@aristobyte-ui/utils\";\n\nexport interface IButton {\n type?: \"button\" | \"link\";\n text?: string;\n children?: React.ReactNode;\n href?: string;\n target?: \"_self\" | \"_blank\" | \"_parent\" | \"_top\";\n onClick?: (\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => void | Promise<void>;\n disabled?: boolean;\n transparent?: boolean;\n variant?:\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"error\"\n | \"warning\";\n appearance?:\n | \"solid\"\n | \"outline\"\n | \"outline-dashed\"\n | \"no-outline\"\n | \"glowing\";\n size?: \"xsm\" | \"sm\" | \"md\" | \"lg\" | \"xlg\";\n radius?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n icon?: {\n component: (props: IconPropsType) => React.ReactElement;\n color?: string;\n size?: number;\n align?: \"left\" | \"right\";\n };\n isLoading?: boolean;\n spinnerType?: \"default\" | \"duo\" | \"gradient\" | \"pulse\" | \"pulse-duo\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport const Button: React.FC<IButton> = ({\n onClick,\n text = \"\",\n href = \"\",\n target = \"_self\",\n children = \"\",\n type = \"button\",\n variant = \"default\",\n appearance = \"solid\",\n size = \"md\",\n radius = \"md\",\n icon,\n spinnerType = \"default\",\n transparent = false,\n isLoading = false,\n disabled = false,\n className = \"\",\n style = {},\n}) => {\n const uniqueId = React.useId();\n const ref = React.useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n\n const handleClick = (\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => {\n const { clientX, clientY } = e;\n renderRipple({ ref, clientX, clientY });\n onClick?.(e);\n };\n\n const buttonClasses = clsx(\n \"button\",\n transparent && \"button-transparent\",\n `button-${variant}-${appearance}`,\n `button-${size}`,\n `button-radius-${radius}`,\n isLoading && \"button-loading\",\n className\n );\n\n const renderContent = () => (\n <>\n {isLoading && (\n <Spinner\n size={size}\n variant={variant}\n type={spinnerType}\n className=\"inline-block\"\n />\n )}\n {icon && (\n <span\n className={clsx(\n \"button-icon\",\n icon.align === \"right\" && \"button-icon-right\"\n )}\n >\n {icon.component({ color: icon.color, size: icon.size })}\n </span>\n )}\n {text || children}\n </>\n );\n\n if (type === \"link\") {\n return (\n <a\n key={uniqueId}\n ref={ref as React.RefObject<HTMLAnchorElement>}\n href={href}\n target={target}\n style={style}\n className={buttonClasses}\n onClick={handleClick}\n >\n {renderContent()}\n </a>\n );\n }\n\n return (\n <button\n key={uniqueId}\n ref={ref as React.RefObject<HTMLButtonElement>}\n type=\"button\"\n disabled={disabled || isLoading}\n style={style}\n className={buttonClasses}\n onClick={handleClick}\n >\n {renderContent()}\n </button>\n );\n};\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","\"use client\";\n\nimport * as React from \"react\";\nimport { type IButton, Button } from \"./Button\";\nimport clsx from \"clsx\";\n\nexport interface IButtonGroup {\n children:\n | React.ReactElement<IButton, typeof Button>\n | React.ReactElement<IButton, typeof Button>[];\n align?: \"vertical\" | \"horizontal\";\n variant?:\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"error\"\n | \"warning\";\n size?: \"xsm\" | \"sm\" | \"md\" | \"lg\" | \"xlg\";\n radius?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n disabled?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport const ButtonGroup: React.FC<IButtonGroup> = ({\n children,\n align = \"horizontal\",\n variant = \"default\",\n size = \"md\",\n radius = \"md\",\n disabled = false,\n className = \"\",\n style = {},\n}) => {\n const groupClasses = clsx(\n \"button-group\",\n `button-group-${align}`,\n `button-group-variant-${variant}`,\n `button-group-radius-${radius}`,\n `button-group-size-${size}`,\n className\n );\n\n const buttons = React.Children.toArray(\n children\n ) as React.ReactElement<IButton>[];\n\n return (\n <div className={groupClasses} style={style}>\n {buttons.map(({ props }, index) => (\n <Button\n {...props}\n key={index}\n size={props.size || size}\n disabled={props.disabled || disabled}\n variant={props.variant || variant}\n radius=\"none\"\n />\n ))}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,YAAuB;;;ACFvB,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAA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 0 : onClick(e);
|
|
51
51
|
};
|
|
52
52
|
const buttonClasses = clsx_default(
|
|
53
|
-
"
|
|
54
|
-
transparent && "
|
|
55
|
-
`
|
|
56
|
-
`
|
|
57
|
-
`
|
|
58
|
-
isLoading && "
|
|
53
|
+
"button",
|
|
54
|
+
transparent && "button-transparent",
|
|
55
|
+
`button-${variant}-${appearance}`,
|
|
56
|
+
`button-${size}`,
|
|
57
|
+
`button-radius-${radius}`,
|
|
58
|
+
isLoading && "button-loading",
|
|
59
59
|
className
|
|
60
60
|
);
|
|
61
61
|
const renderContent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -72,8 +72,8 @@ var Button = ({
|
|
|
72
72
|
"span",
|
|
73
73
|
{
|
|
74
74
|
className: clsx_default(
|
|
75
|
-
"
|
|
76
|
-
icon.align === "right" && "
|
|
75
|
+
"button-icon",
|
|
76
|
+
icon.align === "right" && "button-icon-right"
|
|
77
77
|
),
|
|
78
78
|
children: icon.component({ color: icon.color, size: icon.size })
|
|
79
79
|
}
|
|
@@ -125,11 +125,11 @@ var ButtonGroup = ({
|
|
|
125
125
|
style = {}
|
|
126
126
|
}) => {
|
|
127
127
|
const groupClasses = clsx_default(
|
|
128
|
-
"
|
|
129
|
-
`
|
|
130
|
-
`
|
|
131
|
-
`
|
|
132
|
-
`
|
|
128
|
+
"button-group",
|
|
129
|
+
`button-group-${align}`,
|
|
130
|
+
`button-group-variant-${variant}`,
|
|
131
|
+
`button-group-radius-${radius}`,
|
|
132
|
+
`button-group-size-${size}`,
|
|
133
133
|
className
|
|
134
134
|
);
|
|
135
135
|
const buttons = React2.Children.toArray(
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../components/Button.tsx","../../../node_modules/clsx/dist/clsx.mjs","../components/ButtonGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport clsx from \"clsx\";\nimport { Spinner } from \"@aristobyte-ui/spinner\";\nimport { type IconPropsType, renderRipple } from \"@aristobyte-ui/utils\";\n\nexport interface IButton {\n type?: \"button\" | \"link\";\n text?: string;\n children?: React.ReactNode;\n href?: string;\n target?: \"_self\" | \"_blank\" | \"_parent\" | \"_top\";\n onClick?: (\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => void | Promise<void>;\n disabled?: boolean;\n transparent?: boolean;\n variant?:\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"error\"\n | \"warning\";\n appearance?:\n | \"solid\"\n | \"outline\"\n | \"outline-dashed\"\n | \"no-outline\"\n | \"glowing\";\n size?: \"xsm\" | \"sm\" | \"md\" | \"lg\" | \"xlg\";\n radius?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n icon?: {\n component: (props: IconPropsType) => React.ReactElement;\n color?: string;\n size?: number;\n align?: \"left\" | \"right\";\n };\n isLoading?: boolean;\n spinnerType?: \"default\" | \"duo\" | \"gradient\" | \"pulse\" | \"pulse-duo\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport const Button: React.FC<IButton> = ({\n onClick,\n text = \"\",\n href = \"\",\n target = \"_self\",\n children = \"\",\n type = \"button\",\n variant = \"default\",\n appearance = \"solid\",\n size = \"md\",\n radius = \"md\",\n icon,\n spinnerType = \"default\",\n transparent = false,\n isLoading = false,\n disabled = false,\n className = \"\",\n style = {},\n}) => {\n const uniqueId = React.useId();\n const ref = React.useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n\n const handleClick = (\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => {\n const { clientX, clientY } = e;\n renderRipple({ ref, clientX, clientY });\n onClick?.(e);\n };\n\n const buttonClasses = clsx(\n \"
|
|
1
|
+
{"version":3,"sources":["../components/Button.tsx","../../../node_modules/clsx/dist/clsx.mjs","../components/ButtonGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport clsx from \"clsx\";\nimport { Spinner } from \"@aristobyte-ui/spinner\";\nimport { type IconPropsType, renderRipple } from \"@aristobyte-ui/utils\";\n\nexport interface IButton {\n type?: \"button\" | \"link\";\n text?: string;\n children?: React.ReactNode;\n href?: string;\n target?: \"_self\" | \"_blank\" | \"_parent\" | \"_top\";\n onClick?: (\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => void | Promise<void>;\n disabled?: boolean;\n transparent?: boolean;\n variant?:\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"error\"\n | \"warning\";\n appearance?:\n | \"solid\"\n | \"outline\"\n | \"outline-dashed\"\n | \"no-outline\"\n | \"glowing\";\n size?: \"xsm\" | \"sm\" | \"md\" | \"lg\" | \"xlg\";\n radius?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n icon?: {\n component: (props: IconPropsType) => React.ReactElement;\n color?: string;\n size?: number;\n align?: \"left\" | \"right\";\n };\n isLoading?: boolean;\n spinnerType?: \"default\" | \"duo\" | \"gradient\" | \"pulse\" | \"pulse-duo\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport const Button: React.FC<IButton> = ({\n onClick,\n text = \"\",\n href = \"\",\n target = \"_self\",\n children = \"\",\n type = \"button\",\n variant = \"default\",\n appearance = \"solid\",\n size = \"md\",\n radius = \"md\",\n icon,\n spinnerType = \"default\",\n transparent = false,\n isLoading = false,\n disabled = false,\n className = \"\",\n style = {},\n}) => {\n const uniqueId = React.useId();\n const ref = React.useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n\n const handleClick = (\n e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => {\n const { clientX, clientY } = e;\n renderRipple({ ref, clientX, clientY });\n onClick?.(e);\n };\n\n const buttonClasses = clsx(\n \"button\",\n transparent && \"button-transparent\",\n `button-${variant}-${appearance}`,\n `button-${size}`,\n `button-radius-${radius}`,\n isLoading && \"button-loading\",\n className\n );\n\n const renderContent = () => (\n <>\n {isLoading && (\n <Spinner\n size={size}\n variant={variant}\n type={spinnerType}\n className=\"inline-block\"\n />\n )}\n {icon && (\n <span\n className={clsx(\n \"button-icon\",\n icon.align === \"right\" && \"button-icon-right\"\n )}\n >\n {icon.component({ color: icon.color, size: icon.size })}\n </span>\n )}\n {text || children}\n </>\n );\n\n if (type === \"link\") {\n return (\n <a\n key={uniqueId}\n ref={ref as React.RefObject<HTMLAnchorElement>}\n href={href}\n target={target}\n style={style}\n className={buttonClasses}\n onClick={handleClick}\n >\n {renderContent()}\n </a>\n );\n }\n\n return (\n <button\n key={uniqueId}\n ref={ref as React.RefObject<HTMLButtonElement>}\n type=\"button\"\n disabled={disabled || isLoading}\n style={style}\n className={buttonClasses}\n onClick={handleClick}\n >\n {renderContent()}\n </button>\n );\n};\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","\"use client\";\n\nimport * as React from \"react\";\nimport { type IButton, Button } from \"./Button\";\nimport clsx from \"clsx\";\n\nexport interface IButtonGroup {\n children:\n | React.ReactElement<IButton, typeof Button>\n | React.ReactElement<IButton, typeof Button>[];\n align?: \"vertical\" | \"horizontal\";\n variant?:\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"error\"\n | \"warning\";\n size?: \"xsm\" | \"sm\" | \"md\" | \"lg\" | \"xlg\";\n radius?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n disabled?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport const ButtonGroup: React.FC<IButtonGroup> = ({\n children,\n align = \"horizontal\",\n variant = \"default\",\n size = \"md\",\n radius = \"md\",\n disabled = false,\n className = \"\",\n style = {},\n}) => {\n const groupClasses = clsx(\n \"button-group\",\n `button-group-${align}`,\n `button-group-variant-${variant}`,\n `button-group-radius-${radius}`,\n `button-group-size-${size}`,\n className\n );\n\n const buttons = React.Children.toArray(\n children\n ) as React.ReactElement<IButton>[];\n\n return (\n <div className={groupClasses} style={style}>\n {buttons.map(({ props }, index) => (\n <Button\n {...props}\n key={index}\n size={props.size || size}\n disabled={props.disabled || disabled}\n variant={props.variant || variant}\n radius=\"none\"\n />\n ))}\n </div>\n );\n};\n"],"mappings":";;;AAEA,YAAY,WAAW;;;ACFvB,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,OAAK,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAC,IAAO,eAAQ;;;ADI/X,SAAS,eAAe;AACxB,SAA6B,oBAAoB;AAiF7C,mBAEI,KAFJ;AAzCG,IAAM,SAA4B,CAAC;AAAA,EACxC;AAAA,EACA,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,aAAa;AAAA,EACb,OAAO;AA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,EASP;AAEJ;;;AExIA,YAAYA,YAAW;AA+CnB,gBAAAC,YAAA;AAEI;AA1BD,IAAM,cAAsC,CAAC;AAAA,EAClD;AAAA,EACA,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,QAAQ,CAAC;AACX,MAAM;AACJ,QAAM,eAAe;AAAA,IACnB;AAAA,IACA,gBAAgB,KAAK;AAAA,IACrB,wBAAwB,OAAO;AAAA,IAC/B,uBAAuB,MAAM;AAAA,IAC7B,qBAAqB,IAAI;AAAA,IACzB;AAAA,EACF;AAEA,QAAM,UAAgB,gBAAS;AAAA,IAC7B;AAAA,EACF;AAEA,SACE,gBAAAA,KAAC,SAAI,WAAW,cAAc,OAC3B,kBAAQ,IAAI,CAAC,EAAE,MAAM,GAAG,UACvB;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,MAAM,MAAM,QAAQ;AAAA,MACpB,UAAU,MAAM,YAAY;AAAA,MAC5B,SAAS,MAAM,WAAW;AAAA,MAC1B,QAAO;AAAA;AAAA,EACT,CACD,GACH;AAEJ;","names":["React","jsx"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aristobyte-ui/button",
|
|
3
3
|
"description": "react button and buttongroup components with multiple variants, appearances, sizes, radius options, icons, ripple feedback, and fully typed typescript support",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.75",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "AristoByte <info@aristobyte.com>",
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"check-types": "tsc --noEmit"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@aristobyte-ui/spinner": "^1.0.
|
|
64
|
-
"@aristobyte-ui/utils": "^1.0.
|
|
63
|
+
"@aristobyte-ui/spinner": "^1.0.75",
|
|
64
|
+
"@aristobyte-ui/utils": "^1.0.75",
|
|
65
65
|
"react": "^19.1.0",
|
|
66
66
|
"react-dom": "^19.1.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@aristobyte-ui/eslint-config": "^1.0.
|
|
70
|
-
"@aristobyte-ui/typescript-config": "^1.0.
|
|
69
|
+
"@aristobyte-ui/eslint-config": "^1.0.75",
|
|
70
|
+
"@aristobyte-ui/typescript-config": "^1.0.75",
|
|
71
71
|
"@turbo/gen": "^2.5.0",
|
|
72
72
|
"@types/node": "^24.3.0",
|
|
73
73
|
"@types/react": "19.1.0",
|