@charcoal-ui/react 4.0.0-beta.11 → 4.0.0-beta.12
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/IconButton/index.d.ts +1 -2
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/index.cjs.js +3 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +11 -15
- package/src/_lib/index.ts +1 -1
- package/src/components/Button/__snapshots__/index.story.storyshot +9 -9
- package/src/components/Checkbox/CheckboxInput/__snapshots__/index.story.storyshot +6 -6
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +6 -6
- package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
- package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +3 -3
- package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +3 -3
- package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +5 -5
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +53 -53
- package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
- package/src/components/IconButton/__snapshots__/index.story.storyshot +3 -3
- package/src/components/IconButton/index.tsx +3 -6
- package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +8 -8
- package/src/components/Modal/__snapshots__/index.story.storyshot +45 -28
- package/src/components/Modal/index.story.tsx +2 -0
- package/src/components/Radio/__snapshots__/index.story.storyshot +10 -10
- package/src/components/Radio/index.test.tsx +4 -3
- package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
- package/src/components/Switch/__snapshots__/index.story.storyshot +4 -4
- package/src/components/TagItem/__snapshots__/index.story.storyshot +16 -16
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +31 -31
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +25 -25
|
@@ -8,8 +8,7 @@ export type IconButtonProps<T extends React.ElementType = 'button'> = {
|
|
|
8
8
|
readonly size?: Size;
|
|
9
9
|
readonly icon: keyof KnownIconType;
|
|
10
10
|
readonly isActive?: boolean;
|
|
11
|
-
|
|
12
|
-
componentAs?: React.ComponentPropsWithRef<T>['as'];
|
|
11
|
+
component?: T;
|
|
13
12
|
} & Omit<React.ComponentPropsWithRef<T>, 'children' | 'as'>;
|
|
14
13
|
declare const IconButton: <T extends React.ElementType<any> = "button">(p: IconButtonProps<T>) => JSX.Element;
|
|
15
14
|
export default IconButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,aAAa,CAAA;AAEpB,KAAK,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AACpC,KAAK,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAE5B,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,aAAa,CAAA;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,aAAa,CAAA;AAEpB,KAAK,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AACpC,KAAK,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAE5B,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,aAAa,CAAA;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,SAAS,CAAC,EAAE,CAAC,CAAA;CACd,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC,CAAA;AAE3D,QAAA,MAAM,UAAU,0EA+BX,WAAW,CAAA;AAEhB,eAAe,UAAU,CAAA"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -122,14 +122,13 @@ var IconButton = (0, import_react5.forwardRef)(function IconButtonInner({
|
|
|
122
122
|
size = "M",
|
|
123
123
|
icon,
|
|
124
124
|
isActive = false,
|
|
125
|
-
|
|
126
|
-
as,
|
|
125
|
+
component,
|
|
127
126
|
...rest
|
|
128
127
|
}, ref) {
|
|
129
128
|
validateIconSize(size, icon);
|
|
130
|
-
const Component = (0, import_react5.useMemo)(() =>
|
|
129
|
+
const Component = (0, import_react5.useMemo)(() => component ?? "button", [component]);
|
|
131
130
|
const classNames = useClassNames("charcoal-icon-button", rest.className);
|
|
132
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Component, { ...rest,
|
|
131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Component, { ...rest, ref, className: classNames, "data-size": size, "data-active": isActive, "data-variant": variant, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pixiv-icon", { name: icon }) });
|
|
133
132
|
});
|
|
134
133
|
var IconButton_default = IconButton;
|
|
135
134
|
function validateIconSize(size, icon) {
|