@viax.io/uxm 4.44.0 → 4.45.0
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/CHANGELOG.md +7 -0
- package/dist/ui/button/button.cjs +10 -10
- package/dist/ui/button/button.cjs.map +1 -1
- package/dist/ui/button/button.d.ts +20 -8
- package/dist/ui/button/button.d.ts.map +1 -1
- package/dist/ui/button/button.js +10 -10
- package/dist/ui/button/button.js.map +1 -1
- package/dist/ui/icon-button/icon-button.cjs +2 -0
- package/dist/ui/icon-button/icon-button.cjs.map +1 -1
- package/dist/ui/icon-button/icon-button.d.ts +3 -3
- package/dist/ui/icon-button/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-button/icon-button.js +2 -0
- package/dist/ui/icon-button/icon-button.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [4.45.0](https://github.com/viax-io/uxm/compare/v4.44.0...v4.45.0) (2026-09-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **button,icon-button:** declare ref on the button family ([ee76076](https://github.com/viax-io/uxm/commit/ee760764465faf8054f550d816d2c188adf0bc82))
|
|
7
|
+
|
|
1
8
|
# [4.44.0](https://github.com/viax-io/uxm/compare/v4.43.2...v4.44.0) (2026-09-22)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -27,20 +27,20 @@ __export(button_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(button_exports);
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
var import_helpers = require("../../helpers/index.cjs");
|
|
30
|
-
function ButtonPrimary({ className, type = "button", ...rest }) {
|
|
31
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type, className: (0, import_helpers.cn)("uxm-button-primary", className), ...rest });
|
|
30
|
+
function ButtonPrimary({ className, type = "button", ref, ...rest }) {
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ref, type, className: (0, import_helpers.cn)("uxm-button-primary", className), ...rest });
|
|
32
32
|
}
|
|
33
|
-
function ButtonSecondary({ className, type = "button", ...rest }) {
|
|
34
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type, className: (0, import_helpers.cn)("uxm-button-secondary", className), ...rest });
|
|
33
|
+
function ButtonSecondary({ className, type = "button", ref, ...rest }) {
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ref, type, className: (0, import_helpers.cn)("uxm-button-secondary", className), ...rest });
|
|
35
35
|
}
|
|
36
|
-
function ButtonTertiary({ className, type = "button", ...rest }) {
|
|
37
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type, className: (0, import_helpers.cn)("uxm-button-tertiary", className), ...rest });
|
|
36
|
+
function ButtonTertiary({ className, type = "button", ref, ...rest }) {
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ref, type, className: (0, import_helpers.cn)("uxm-button-tertiary", className), ...rest });
|
|
38
38
|
}
|
|
39
|
-
function ButtonGhost({ className, type = "button", ...rest }) {
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type, className: (0, import_helpers.cn)("uxm-button-ghost", className), ...rest });
|
|
39
|
+
function ButtonGhost({ className, type = "button", ref, ...rest }) {
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ref, type, className: (0, import_helpers.cn)("uxm-button-ghost", className), ...rest });
|
|
41
41
|
}
|
|
42
|
-
function ButtonDanger({ className, type = "button", ...rest }) {
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type, className: (0, import_helpers.cn)("uxm-button-danger", className), ...rest });
|
|
42
|
+
function ButtonDanger({ className, type = "button", ref, ...rest }) {
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ref, type, className: (0, import_helpers.cn)("uxm-button-danger", className), ...rest });
|
|
44
44
|
}
|
|
45
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
46
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/button/button.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/button/button.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport type { ComponentPropsWithRef } from 'react';\n\n/**\n * Native `<button>` attributes **including `ref`**, shared by every variant.\n *\n * `ComponentPropsWithRef<'button'>` rather than `ButtonHTMLAttributes`: React 19\n * passes `ref` as an ordinary prop, so it already reached the element through\n * the rest spread — but `ButtonHTMLAttributes` does not declare it, so\n * `<ButtonPrimary ref={…}>` was a type error for every TypeScript consumer even\n * though it worked at runtime. That is what blocked the buttons from being\n * `HoverTooltip` / `Popover` anchors without a wrapper element around them.\n *\n * Not `forwardRef`: 4.39 deliberately moved `Modal`'s sub-components the other\n * way, off `forwardRef` and onto React 19 ref props.\n */\nexport type ButtonProps = ComponentPropsWithRef<'button'>;\n\nexport function ButtonPrimary({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-primary', className)} {...rest} />;\n}\n\nexport function ButtonSecondary({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-secondary', className)} {...rest} />;\n}\n\nexport function ButtonTertiary({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-tertiary', className)} {...rest} />;\n}\n\nexport function ButtonGhost({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-ghost', className)} {...rest} />;\n}\n\nexport function ButtonDanger({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-danger', className)} {...rest} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBS;AApBT,qBAAmB;AAmBZ,SAAS,cAAc,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACvF,SAAO,4CAAC,YAAO,KAAU,MAAY,eAAW,mBAAG,sBAAsB,SAAS,GAAI,GAAG,MAAM;AACjG;AAEO,SAAS,gBAAgB,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACzF,SAAO,4CAAC,YAAO,KAAU,MAAY,eAAW,mBAAG,wBAAwB,SAAS,GAAI,GAAG,MAAM;AACnG;AAEO,SAAS,eAAe,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACxF,SAAO,4CAAC,YAAO,KAAU,MAAY,eAAW,mBAAG,uBAAuB,SAAS,GAAI,GAAG,MAAM;AAClG;AAEO,SAAS,YAAY,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACrF,SAAO,4CAAC,YAAO,KAAU,MAAY,eAAW,mBAAG,oBAAoB,SAAS,GAAI,GAAG,MAAM;AAC/F;AAEO,SAAS,aAAa,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACtF,SAAO,4CAAC,YAAO,KAAU,MAAY,eAAW,mBAAG,qBAAqB,SAAS,GAAI,GAAG,MAAM;AAChG;","names":[]}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Native `<button>` attributes **including `ref`**, shared by every variant.
|
|
4
|
+
*
|
|
5
|
+
* `ComponentPropsWithRef<'button'>` rather than `ButtonHTMLAttributes`: React 19
|
|
6
|
+
* passes `ref` as an ordinary prop, so it already reached the element through
|
|
7
|
+
* the rest spread — but `ButtonHTMLAttributes` does not declare it, so
|
|
8
|
+
* `<ButtonPrimary ref={…}>` was a type error for every TypeScript consumer even
|
|
9
|
+
* though it worked at runtime. That is what blocked the buttons from being
|
|
10
|
+
* `HoverTooltip` / `Popover` anchors without a wrapper element around them.
|
|
11
|
+
*
|
|
12
|
+
* Not `forwardRef`: 4.39 deliberately moved `Modal`'s sub-components the other
|
|
13
|
+
* way, off `forwardRef` and onto React 19 ref props.
|
|
14
|
+
*/
|
|
15
|
+
export type ButtonProps = ComponentPropsWithRef<'button'>;
|
|
16
|
+
export declare function ButtonPrimary({ className, type, ref, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
17
|
+
export declare function ButtonSecondary({ className, type, ref, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
18
|
+
export declare function ButtonTertiary({ className, type, ref, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
19
|
+
export declare function ButtonGhost({ className, type, ref, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
20
|
+
export declare function ButtonDanger({ className, type, ref, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
9
21
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/ui/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/ui/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AAE1D,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,IAAe,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAEtF;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,IAAe,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAExF;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,IAAe,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAEvF;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,IAAe,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAEpF;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,IAAe,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAErF"}
|
package/dist/ui/button/button.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../helpers/index.js";
|
|
3
|
-
function ButtonPrimary({ className, type = "button", ...rest }) {
|
|
4
|
-
return /* @__PURE__ */ jsx("button", { type, className: cn("uxm-button-primary", className), ...rest });
|
|
3
|
+
function ButtonPrimary({ className, type = "button", ref, ...rest }) {
|
|
4
|
+
return /* @__PURE__ */ jsx("button", { ref, type, className: cn("uxm-button-primary", className), ...rest });
|
|
5
5
|
}
|
|
6
|
-
function ButtonSecondary({ className, type = "button", ...rest }) {
|
|
7
|
-
return /* @__PURE__ */ jsx("button", { type, className: cn("uxm-button-secondary", className), ...rest });
|
|
6
|
+
function ButtonSecondary({ className, type = "button", ref, ...rest }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("button", { ref, type, className: cn("uxm-button-secondary", className), ...rest });
|
|
8
8
|
}
|
|
9
|
-
function ButtonTertiary({ className, type = "button", ...rest }) {
|
|
10
|
-
return /* @__PURE__ */ jsx("button", { type, className: cn("uxm-button-tertiary", className), ...rest });
|
|
9
|
+
function ButtonTertiary({ className, type = "button", ref, ...rest }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("button", { ref, type, className: cn("uxm-button-tertiary", className), ...rest });
|
|
11
11
|
}
|
|
12
|
-
function ButtonGhost({ className, type = "button", ...rest }) {
|
|
13
|
-
return /* @__PURE__ */ jsx("button", { type, className: cn("uxm-button-ghost", className), ...rest });
|
|
12
|
+
function ButtonGhost({ className, type = "button", ref, ...rest }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("button", { ref, type, className: cn("uxm-button-ghost", className), ...rest });
|
|
14
14
|
}
|
|
15
|
-
function ButtonDanger({ className, type = "button", ...rest }) {
|
|
16
|
-
return /* @__PURE__ */ jsx("button", { type, className: cn("uxm-button-danger", className), ...rest });
|
|
15
|
+
function ButtonDanger({ className, type = "button", ref, ...rest }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("button", { ref, type, className: cn("uxm-button-danger", className), ...rest });
|
|
17
17
|
}
|
|
18
18
|
export {
|
|
19
19
|
ButtonDanger,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/button/button.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/button/button.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport type { ComponentPropsWithRef } from 'react';\n\n/**\n * Native `<button>` attributes **including `ref`**, shared by every variant.\n *\n * `ComponentPropsWithRef<'button'>` rather than `ButtonHTMLAttributes`: React 19\n * passes `ref` as an ordinary prop, so it already reached the element through\n * the rest spread — but `ButtonHTMLAttributes` does not declare it, so\n * `<ButtonPrimary ref={…}>` was a type error for every TypeScript consumer even\n * though it worked at runtime. That is what blocked the buttons from being\n * `HoverTooltip` / `Popover` anchors without a wrapper element around them.\n *\n * Not `forwardRef`: 4.39 deliberately moved `Modal`'s sub-components the other\n * way, off `forwardRef` and onto React 19 ref props.\n */\nexport type ButtonProps = ComponentPropsWithRef<'button'>;\n\nexport function ButtonPrimary({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-primary', className)} {...rest} />;\n}\n\nexport function ButtonSecondary({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-secondary', className)} {...rest} />;\n}\n\nexport function ButtonTertiary({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-tertiary', className)} {...rest} />;\n}\n\nexport function ButtonGhost({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-ghost', className)} {...rest} />;\n}\n\nexport function ButtonDanger({ className, type = 'button', ref, ...rest }: ButtonProps) {\n return <button ref={ref} type={type} className={cn('uxm-button-danger', className)} {...rest} />;\n}\n"],"mappings":"AAoBS;AApBT,SAAS,UAAU;AAmBZ,SAAS,cAAc,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACvF,SAAO,oBAAC,YAAO,KAAU,MAAY,WAAW,GAAG,sBAAsB,SAAS,GAAI,GAAG,MAAM;AACjG;AAEO,SAAS,gBAAgB,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACzF,SAAO,oBAAC,YAAO,KAAU,MAAY,WAAW,GAAG,wBAAwB,SAAS,GAAI,GAAG,MAAM;AACnG;AAEO,SAAS,eAAe,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACxF,SAAO,oBAAC,YAAO,KAAU,MAAY,WAAW,GAAG,uBAAuB,SAAS,GAAI,GAAG,MAAM;AAClG;AAEO,SAAS,YAAY,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACrF,SAAO,oBAAC,YAAO,KAAU,MAAY,WAAW,GAAG,oBAAoB,SAAS,GAAI,GAAG,MAAM;AAC/F;AAEO,SAAS,aAAa,EAAE,WAAW,OAAO,UAAU,KAAK,GAAG,KAAK,GAAgB;AACtF,SAAO,oBAAC,YAAO,KAAU,MAAY,WAAW,GAAG,qBAAqB,SAAS,GAAI,GAAG,MAAM;AAChG;","names":[]}
|
|
@@ -28,11 +28,13 @@ function IconButton({
|
|
|
28
28
|
className,
|
|
29
29
|
type = "button",
|
|
30
30
|
variant = "ghost",
|
|
31
|
+
ref,
|
|
31
32
|
...rest
|
|
32
33
|
}) {
|
|
33
34
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
34
35
|
"button",
|
|
35
36
|
{
|
|
37
|
+
ref,
|
|
36
38
|
type,
|
|
37
39
|
className: (0, import_helpers.cn)("uxm-icon-button", variant === "filled" && "uxm-icon-button--filled", className),
|
|
38
40
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/icon-button/icon-button.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/icon-button/icon-button.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type IconButtonVariant = 'ghost' | 'filled';\n\nexport interface IconButtonProps extends ComponentPropsWithRef<'button'> {\n /** SVG content (use the Icon component or a raw <svg>). */\n children: ReactNode;\n /** Required for accessibility on icon-only buttons. */\n 'aria-label': string;\n /**\n * `ghost` (default) — 32px, transparent, for toolbars, row ⋮ and inline\n * chrome. `filled` — 40px, `--color-surface-alt` fill, radius 8, for a\n * standalone action (\"add\", \"create\"). `filled` is the successor of the\n * deprecated `ButtonIcon` atom and paints exactly what it painted.\n */\n variant?: IconButtonVariant;\n}\n\nexport function IconButton({\n children,\n className,\n type = 'button',\n variant = 'ghost',\n ref,\n ...rest\n}: IconButtonProps) {\n return (\n <button\n ref={ref}\n type={type}\n className={cn('uxm-icon-button', variant === 'filled' && 'uxm-icon-button--filled', className)}\n {...rest}\n >\n {children}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BI;AA7BJ,qBAAmB;AAoBZ,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAW,mBAAG,mBAAmB,YAAY,YAAY,2BAA2B,SAAS;AAAA,MAC5F,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
export type IconButtonVariant = 'ghost' | 'filled';
|
|
3
|
-
export interface IconButtonProps extends
|
|
3
|
+
export interface IconButtonProps extends ComponentPropsWithRef<'button'> {
|
|
4
4
|
/** SVG content (use the Icon component or a raw <svg>). */
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
/** Required for accessibility on icon-only buttons. */
|
|
@@ -13,5 +13,5 @@ export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
13
13
|
*/
|
|
14
14
|
variant?: IconButtonVariant;
|
|
15
15
|
}
|
|
16
|
-
export declare function IconButton({ children, className, type, variant, ...rest }: IconButtonProps): import("react").JSX.Element;
|
|
16
|
+
export declare function IconButton({ children, className, type, variant, ref, ...rest }: IconButtonProps): import("react").JSX.Element;
|
|
17
17
|
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/ui/icon-button/icon-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/ui/icon-button/icon-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEnD,MAAM,WAAW,eAAgB,SAAQ,qBAAqB,CAAC,QAAQ,CAAC;IACtE,2DAA2D;IAC3D,QAAQ,EAAE,SAAS,CAAC;IACpB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAe,EACf,OAAiB,EACjB,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,+BAWjB"}
|
|
@@ -5,11 +5,13 @@ function IconButton({
|
|
|
5
5
|
className,
|
|
6
6
|
type = "button",
|
|
7
7
|
variant = "ghost",
|
|
8
|
+
ref,
|
|
8
9
|
...rest
|
|
9
10
|
}) {
|
|
10
11
|
return /* @__PURE__ */ jsx(
|
|
11
12
|
"button",
|
|
12
13
|
{
|
|
14
|
+
ref,
|
|
13
15
|
type,
|
|
14
16
|
className: cn("uxm-icon-button", variant === "filled" && "uxm-icon-button--filled", className),
|
|
15
17
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/icon-button/icon-button.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/icon-button/icon-button.tsx"],"sourcesContent":["import { cn } from '@/helpers';\n\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type IconButtonVariant = 'ghost' | 'filled';\n\nexport interface IconButtonProps extends ComponentPropsWithRef<'button'> {\n /** SVG content (use the Icon component or a raw <svg>). */\n children: ReactNode;\n /** Required for accessibility on icon-only buttons. */\n 'aria-label': string;\n /**\n * `ghost` (default) — 32px, transparent, for toolbars, row ⋮ and inline\n * chrome. `filled` — 40px, `--color-surface-alt` fill, radius 8, for a\n * standalone action (\"add\", \"create\"). `filled` is the successor of the\n * deprecated `ButtonIcon` atom and paints exactly what it painted.\n */\n variant?: IconButtonVariant;\n}\n\nexport function IconButton({\n children,\n className,\n type = 'button',\n variant = 'ghost',\n ref,\n ...rest\n}: IconButtonProps) {\n return (\n <button\n ref={ref}\n type={type}\n className={cn('uxm-icon-button', variant === 'filled' && 'uxm-icon-button--filled', className)}\n {...rest}\n >\n {children}\n </button>\n );\n}\n"],"mappings":"AA6BI;AA7BJ,SAAS,UAAU;AAoBZ,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW,GAAG,mBAAmB,YAAY,YAAY,2BAA2B,SAAS;AAAA,MAC5F,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":[]}
|