@kopexa/button 13.0.1 → 13.0.3
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/chunk-7ROCG4IU.mjs +20 -0
- package/dist/icon-button.d.mts +1 -0
- package/dist/icon-button.d.ts +1 -0
- package/dist/icon-button.js +2 -10
- package/dist/icon-button.mjs +1 -2
- package/dist/index.js +2 -9
- package/dist/index.mjs +1 -1
- package/package.json +8 -8
- package/dist/chunk-AKZB54J4.mjs +0 -27
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "./chunk-SNQHD6JL.mjs";
|
|
5
|
+
|
|
6
|
+
// src/icon-button.tsx
|
|
7
|
+
import { cloneElement, isValidElement } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var IconButton = (props) => {
|
|
10
|
+
const { "aria-label": ariaLabel, children, tooltip, ...rest } = props;
|
|
11
|
+
const clonedChildren = isValidElement(children) ? (
|
|
12
|
+
// biome-ignore lint/suspicious/noExplicitAny: forcing type to any
|
|
13
|
+
cloneElement(children, { "aria-hidden": true })
|
|
14
|
+
) : children;
|
|
15
|
+
return /* @__PURE__ */ jsx(Button, { ...rest, tooltip, "aria-label": ariaLabel, isIconOnly: true, children: clonedChildren });
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
IconButton
|
|
20
|
+
};
|
package/dist/icon-button.d.mts
CHANGED
package/dist/icon-button.d.ts
CHANGED
package/dist/icon-button.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
|
-
"use client";
|
|
4
3
|
var __create = Object.create;
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
6
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -184,19 +183,12 @@ var ShortcutDisplay = ({
|
|
|
184
183
|
// src/icon-button.tsx
|
|
185
184
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
186
185
|
var IconButton = (props) => {
|
|
187
|
-
const { "aria-label": ariaLabel, children, ...rest } = props;
|
|
188
|
-
const label = ariaLabel || children;
|
|
189
|
-
const toolip = (0, import_react2.useMemo)(() => {
|
|
190
|
-
if (label && typeof label === "string") {
|
|
191
|
-
return label;
|
|
192
|
-
}
|
|
193
|
-
return void 0;
|
|
194
|
-
}, [label]);
|
|
186
|
+
const { "aria-label": ariaLabel, children, tooltip, ...rest } = props;
|
|
195
187
|
const clonedChildren = (0, import_react2.isValidElement)(children) ? (
|
|
196
188
|
// biome-ignore lint/suspicious/noExplicitAny: forcing type to any
|
|
197
189
|
(0, import_react2.cloneElement)(children, { "aria-hidden": true })
|
|
198
190
|
) : children;
|
|
199
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Button, { ...rest, tooltip
|
|
191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Button, { ...rest, tooltip, "aria-label": ariaLabel, isIconOnly: true, children: clonedChildren });
|
|
200
192
|
};
|
|
201
193
|
// Annotate the CommonJS export names for ESM import in node:
|
|
202
194
|
0 && (module.exports = {
|
package/dist/icon-button.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -295,19 +295,12 @@ var CopyButton = ({
|
|
|
295
295
|
var import_react3 = require("react");
|
|
296
296
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
297
297
|
var IconButton = (props) => {
|
|
298
|
-
const { "aria-label": ariaLabel, children, ...rest } = props;
|
|
299
|
-
const label = ariaLabel || children;
|
|
300
|
-
const toolip = (0, import_react3.useMemo)(() => {
|
|
301
|
-
if (label && typeof label === "string") {
|
|
302
|
-
return label;
|
|
303
|
-
}
|
|
304
|
-
return void 0;
|
|
305
|
-
}, [label]);
|
|
298
|
+
const { "aria-label": ariaLabel, children, tooltip, ...rest } = props;
|
|
306
299
|
const clonedChildren = (0, import_react3.isValidElement)(children) ? (
|
|
307
300
|
// biome-ignore lint/suspicious/noExplicitAny: forcing type to any
|
|
308
301
|
(0, import_react3.cloneElement)(children, { "aria-hidden": true })
|
|
309
302
|
) : children;
|
|
310
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, { ...rest, tooltip
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, { ...rest, tooltip, "aria-label": ariaLabel, isIconOnly: true, children: clonedChildren });
|
|
311
304
|
};
|
|
312
305
|
// Annotate the CommonJS export names for ESM import in node:
|
|
313
306
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/button",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.3",
|
|
4
4
|
"description": "Buttons allow users to perform actions and choose with a single tap.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"button"
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"motion": ">=12.23.6",
|
|
29
29
|
"react": ">=19.0.0-rc.0",
|
|
30
30
|
"react-dom": ">=19.0.0-rc.0",
|
|
31
|
-
"@kopexa/theme": "13.0.
|
|
31
|
+
"@kopexa/theme": "13.0.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@radix-ui/react-slot": "^1.2.3",
|
|
35
|
-
"@kopexa/shared-utils": "13.0.
|
|
36
|
-
"@kopexa/react-utils": "13.0.
|
|
37
|
-
"@kopexa/spinner": "13.0.
|
|
38
|
-
"@kopexa/tooltip": "13.0.
|
|
39
|
-
"@kopexa/ripple": "13.0.
|
|
40
|
-
"@kopexa/icons": "13.0.
|
|
35
|
+
"@kopexa/shared-utils": "13.0.3",
|
|
36
|
+
"@kopexa/react-utils": "13.0.3",
|
|
37
|
+
"@kopexa/spinner": "13.0.3",
|
|
38
|
+
"@kopexa/tooltip": "13.0.3",
|
|
39
|
+
"@kopexa/ripple": "13.0.3",
|
|
40
|
+
"@kopexa/icons": "13.0.3"
|
|
41
41
|
},
|
|
42
42
|
"clean-package": "../../../clean-package.config.json",
|
|
43
43
|
"module": "dist/index.mjs",
|
package/dist/chunk-AKZB54J4.mjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
Button
|
|
4
|
-
} from "./chunk-SNQHD6JL.mjs";
|
|
5
|
-
|
|
6
|
-
// src/icon-button.tsx
|
|
7
|
-
import { cloneElement, isValidElement, useMemo } from "react";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
var IconButton = (props) => {
|
|
10
|
-
const { "aria-label": ariaLabel, children, ...rest } = props;
|
|
11
|
-
const label = ariaLabel || children;
|
|
12
|
-
const toolip = useMemo(() => {
|
|
13
|
-
if (label && typeof label === "string") {
|
|
14
|
-
return label;
|
|
15
|
-
}
|
|
16
|
-
return void 0;
|
|
17
|
-
}, [label]);
|
|
18
|
-
const clonedChildren = isValidElement(children) ? (
|
|
19
|
-
// biome-ignore lint/suspicious/noExplicitAny: forcing type to any
|
|
20
|
-
cloneElement(children, { "aria-hidden": true })
|
|
21
|
-
) : children;
|
|
22
|
-
return /* @__PURE__ */ jsx(Button, { ...rest, tooltip: toolip, "aria-label": ariaLabel, isIconOnly: true, children: clonedChildren });
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
IconButton
|
|
27
|
-
};
|