@homecode/ui 4.18.52 → 4.18.54
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/esm/index.js +1 -0
- package/dist/esm/src/components/IconButton/IconButton.js +13 -0
- package/dist/esm/src/components/IconButton/IconButton.styl.js +7 -0
- package/dist/esm/src/components/Input/Input.js +1 -0
- package/dist/esm/src/components/InputFile/InputFile.js +1 -0
- package/dist/esm/src/components/Tabs/Tabs.js +1 -1
- package/dist/esm/types/src/components/IconButton/IconButton.d.ts +9 -0
- package/dist/esm/types/src/components/index.d.ts +1 -0
- package/package.json +1 -1
- package/tests/mocks/svgMock.js +0 -11
package/dist/esm/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { Form } from './src/components/Form/Form.js';
|
|
|
13
13
|
export { Gallery } from './src/components/Gallery/Gallery.js';
|
|
14
14
|
export { Heading } from './src/components/Heading/Heading.js';
|
|
15
15
|
export { Icon, icons } from './src/components/Icon/Icon.js';
|
|
16
|
+
export { IconButton } from './src/components/IconButton/IconButton.js';
|
|
16
17
|
export { Input } from './src/components/Input/Input.js';
|
|
17
18
|
export { InputFile } from './src/components/InputFile/InputFile.js';
|
|
18
19
|
export { Label } from './src/components/Label/Label.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { Button } from '../Button/Button.js';
|
|
4
|
+
import { Icon } from '../Icon/Icon.js';
|
|
5
|
+
import S from './IconButton.styl.js';
|
|
6
|
+
|
|
7
|
+
function IconButton({ type, size, className,
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
...rest }) {
|
|
10
|
+
return (jsx(Button, { ...rest, className: cn(S.root, className), variant: "clear", size: size, children: jsx(Icon, { type: type, size: size }) }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { IconButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".IconButton_root__qAQqw{background-color:transparent!important}.IconButton_root__qAQqw:hover{color:var(--active-color)}";
|
|
4
|
+
var S = {"root":"IconButton_root__qAQqw"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -37,6 +37,7 @@ import '../Form/SubmitButtons/SubmitButtons.styl.js';
|
|
|
37
37
|
import '../Spinner/Spinner.styl.js';
|
|
38
38
|
import '../Gallery/Gallery.styl.js';
|
|
39
39
|
import '../Heading/Heading.js';
|
|
40
|
+
import '../IconButton/IconButton.styl.js';
|
|
40
41
|
import '../InputFile/InputFile.styl.js';
|
|
41
42
|
import '../InputFile/Item/Item.styl.js';
|
|
42
43
|
import '../LightBox/LightBox.styl.js';
|
|
@@ -39,6 +39,7 @@ import '../Form/Validator.js';
|
|
|
39
39
|
import '../Form/SubmitButtons/SubmitButtons.styl.js';
|
|
40
40
|
import '../Gallery/Gallery.styl.js';
|
|
41
41
|
import '../Heading/Heading.js';
|
|
42
|
+
import '../IconButton/IconButton.styl.js';
|
|
42
43
|
import '../LightBox/LightBox.styl.js';
|
|
43
44
|
import '../Notifications/Notifications.js';
|
|
44
45
|
import '../PopupMenu/PopupMenu.styl.js';
|
|
@@ -8,7 +8,7 @@ import S from './Tabs.styl.js';
|
|
|
8
8
|
const isId = id => ['string', 'number'].includes(typeof id);
|
|
9
9
|
function Tabs(props) {
|
|
10
10
|
const { size = 'm', className, contentClassName, items, hideTabsIfSingle = false, allowEmpty = false, onChange, renderAll, activeId: initialId, children, ...rest } = props;
|
|
11
|
-
const [activeId, setActiveId] = useState(isId(initialId) ? initialId : items[0].id);
|
|
11
|
+
const [activeId, setActiveId] = useState(isId(initialId) ? initialId : allowEmpty ? null : items[0].id);
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
if (isId(initialId)) {
|
|
14
14
|
setActiveId(initialId);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IconType } from 'uilib/components/Icon/Icon.types';
|
|
2
|
+
import type { ButtonProps } from 'uilib/components/Button/Button';
|
|
3
|
+
import type { Size } from 'uilib/types';
|
|
4
|
+
export type IconButtonProps = Omit<ButtonProps, 'variant' | 'square' | 'children'> & {
|
|
5
|
+
type: IconType;
|
|
6
|
+
className?: string;
|
|
7
|
+
size?: Size;
|
|
8
|
+
};
|
|
9
|
+
export declare function IconButton({ type, size, className, ...rest }: IconButtonProps): JSX.Element;
|
|
@@ -13,6 +13,7 @@ export * from './Form/Form';
|
|
|
13
13
|
export * from './Gallery/Gallery';
|
|
14
14
|
export * from './Heading/Heading';
|
|
15
15
|
export * from './Icon/Icon';
|
|
16
|
+
export * from './IconButton/IconButton';
|
|
16
17
|
export * from './Input/Input';
|
|
17
18
|
export * from './InputFile/InputFile';
|
|
18
19
|
export * from './Label/Label';
|
package/package.json
CHANGED