@dartcom/ui-kit 10.2.3 → 10.2.5
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/components/buttons/icon/icon.d.ts.map +1 -1
- package/dist/components/buttons/icon/icon.stories.d.ts +14 -0
- package/dist/components/buttons/icon/icon.stories.d.ts.map +1 -0
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwCzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IconButton } from '.';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof IconButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Save: Story;
|
|
7
|
+
export declare const SaveWithTitle: Story;
|
|
8
|
+
export declare const Edit: Story;
|
|
9
|
+
export declare const EditWithTitle: Story;
|
|
10
|
+
export declare const Move: Story;
|
|
11
|
+
export declare const MoveWithTitle: Story;
|
|
12
|
+
export declare const Reset: Story;
|
|
13
|
+
export declare const ResetWithTitle: Story;
|
|
14
|
+
//# sourceMappingURL=icon.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/icon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAE/B,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAWjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAQ5B,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -12043,10 +12043,17 @@ const icons = {
|
|
|
12043
12043
|
const IconButton = ({ title, iconProps, ...props }) => {
|
|
12044
12044
|
const buttonId = React__namespace.useId();
|
|
12045
12045
|
const Icon = icons[iconProps.name];
|
|
12046
|
+
const iconColor = iconProps.color ?? 'primary';
|
|
12046
12047
|
if (title) {
|
|
12047
|
-
return (jsxRuntime.jsx(material.Tooltip, { title: title, children: jsxRuntime.jsx(material.IconButton, { id: buttonId, ...props,
|
|
12048
|
+
return (jsxRuntime.jsx(material.Tooltip, { title: title, children: jsxRuntime.jsx(material.IconButton, { id: buttonId, ...props, onClick: (event) => {
|
|
12049
|
+
event.stopPropagation();
|
|
12050
|
+
props.onClick?.(event);
|
|
12051
|
+
}, children: jsxRuntime.jsx(Icon, { fontSize: "medium", color: iconColor }) }) }));
|
|
12048
12052
|
}
|
|
12049
|
-
return (jsxRuntime.jsx(material.IconButton, { id: buttonId, ...props,
|
|
12053
|
+
return (jsxRuntime.jsx(material.IconButton, { id: buttonId, ...props, onClick: (event) => {
|
|
12054
|
+
event.stopPropagation();
|
|
12055
|
+
props.onClick?.(event);
|
|
12056
|
+
}, children: jsxRuntime.jsx(Icon, { fontSize: "medium", color: iconColor }) }));
|
|
12050
12057
|
};
|
|
12051
12058
|
|
|
12052
12059
|
const VisuallyHiddenInput = material.styled('input')({
|