@bitrise/bitkit 9.3.0-alpha.3 → 9.3.0-alpha.4
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/lib/cjs/Button2/Button2.d.ts +3 -2
- package/lib/cjs/Button2/Button2.d.ts.map +1 -1
- package/lib/cjs/Button2/Button2.js +3 -3
- package/lib/cjs/Button2/Button2.js.map +1 -1
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts +3 -2
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js +6 -4
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esn/Button2/Button2.d.ts +3 -2
- package/lib/esn/Button2/Button2.d.ts.map +1 -1
- package/lib/esn/Button2/Button2.js +4 -4
- package/lib/esn/Button2/Button2.js.map +1 -1
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts +3 -2
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js +7 -5
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
- package/lib/esn/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/site/components/Documentation/Components/SectionButton2.tsx +5 -1
- package/site/components/Documentation/Components/SectionButtons.tsx +1 -2
- package/src/Button2/Button2.tsx +6 -5
- package/src/ButtonWithDropdown/ButtonWithDropdown.tsx +7 -7
|
@@ -3,12 +3,13 @@ import { ButtonProps } from '@chakra-ui/react';
|
|
|
3
3
|
interface Props extends Pick<ButtonProps, 'as' | 'disabled' | 'leftIcon' | 'rightIcon' | 'sx'> {
|
|
4
4
|
children: ButtonProps['children'];
|
|
5
5
|
href?: string;
|
|
6
|
-
onClick?: (e: React.MouseEvent<
|
|
6
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
7
|
+
ref?: any;
|
|
7
8
|
size?: 'small' | 'medium';
|
|
8
9
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
9
10
|
type?: ButtonProps['type'];
|
|
10
11
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'dangerPrimary' | 'dangerSecondary';
|
|
11
12
|
}
|
|
12
|
-
declare const Button2: (
|
|
13
|
+
declare const Button2: import("@chakra-ui/react").ComponentWithAs<import("@chakra-ui/react").As<any>, Props>;
|
|
13
14
|
export default Button2;
|
|
14
15
|
//# sourceMappingURL=Button2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button2.d.ts","sourceRoot":"","sources":["../../../src/Button2/Button2.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA0B,WAAW,
|
|
1
|
+
{"version":3,"file":"Button2.d.ts","sourceRoot":"","sources":["../../../src/Button2/Button2.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA0B,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAEnF,UAAU,KAAM,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAE,IAAI,CAAC;IACzF,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACvE,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IACjD,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,eAAe,GAAG,iBAAiB,CAAC;CACtF;AAEH,QAAA,MAAM,OAAO,uFAOX,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable object-shorthand */
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Button as ChakraButton } from '@chakra-ui/react';
|
|
4
|
-
const Button2 = (props) => {
|
|
3
|
+
import { Button as ChakraButton, forwardRef } from '@chakra-ui/react';
|
|
4
|
+
const Button2 = forwardRef((props, ref) => {
|
|
5
5
|
const defaults = {
|
|
6
6
|
size: 'medium',
|
|
7
7
|
variant: 'primary',
|
|
8
8
|
};
|
|
9
9
|
const iconSpacing = props.size === 'medium' ? '10px' : '6px';
|
|
10
|
-
return React.createElement(ChakraButton, { iconSpacing: iconSpacing, ...defaults, ...props });
|
|
11
|
-
};
|
|
10
|
+
return React.createElement(ChakraButton, { iconSpacing: iconSpacing, ref: ref, ...defaults, ...props });
|
|
11
|
+
});
|
|
12
12
|
export default Button2;
|
|
13
13
|
//# sourceMappingURL=Button2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button2.js","sourceRoot":"","sources":["../../../src/Button2/Button2.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,YAAY,EAAe,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button2.js","sourceRoot":"","sources":["../../../src/Button2/Button2.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,YAAY,EAAe,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAanF,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,KAAY,EAAE,GAAG,EAAE,EAAE;IAC/C,MAAM,QAAQ,GAAG;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,SAAS;KACnB,CAAC;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7D,OAAO,oBAAC,YAAY,IAAC,WAAW,EAAG,WAAW,EAAG,GAAG,EAAG,GAAG,KAAQ,QAAQ,KAAQ,KAAK,GAAK,CAAC;AAC/F,CAAC,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DropdownMenuItemProps, PlacementProps } from '@bitrise/bitkit';
|
|
3
|
+
import { ButtonProps } from '@chakra-ui/react';
|
|
3
4
|
export interface ItemProps extends DropdownMenuItemProps {
|
|
4
5
|
component?: string;
|
|
5
6
|
disabled?: boolean;
|
|
@@ -9,7 +10,7 @@ export interface ItemProps extends DropdownMenuItemProps {
|
|
|
9
10
|
}
|
|
10
11
|
export interface Props {
|
|
11
12
|
buttonProps?: ButtonProps;
|
|
12
|
-
children?: React.
|
|
13
|
+
children?: React.ReactNode | undefined;
|
|
13
14
|
dropdownWidth?: string;
|
|
14
15
|
items: ItemProps[];
|
|
15
16
|
placementProps?: PlacementProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonWithDropdown.d.ts","sourceRoot":"","sources":["../../../src/ButtonWithDropdown/ButtonWithDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"ButtonWithDropdown.d.ts","sourceRoot":"","sources":["../../../src/ButtonWithDropdown/ButtonWithDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIH,qBAAqB,EAIrB,cAAc,EAEb,MAAM,iBAAiB,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,MAAM,WAAW,SAAU,SAAQ,qBAAqB;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,KAAK;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,cAAc,CAAC;CACnC;AAED,QAAA,MAAM,kBAAkB,qEAMrB,KAAK,KAAG,WAwCV,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Button2, DropdownMenu, DropdownMenuItem, Icon, Placement, PlacementManager, PlacementReference, } from '@bitrise/bitkit';
|
|
3
3
|
const ButtonWithDropdown = ({ buttonProps = {}, children, dropdownWidth, items, placementProps, }) => {
|
|
4
4
|
const [visible, setVisible] = React.useState(false);
|
|
5
5
|
return (React.createElement(PlacementManager, null,
|
|
6
|
-
React.createElement(PlacementReference, null, ({ ref }) => (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
!buttonProps.disabled && (React.createElement(Placement, { disableMargin: "left-right",
|
|
6
|
+
React.createElement(PlacementReference, null, ({ ref }) => (
|
|
7
|
+
/* @ts-ignore */
|
|
8
|
+
React.createElement(Button2, { onClick: () => setVisible(!visible), ref: ref, rightIcon: React.createElement(Icon, { name: "ChevronDown" }), ...buttonProps }, children))),
|
|
9
|
+
!buttonProps.disabled && (React.createElement(Placement, { disableMargin: "left-right",
|
|
10
|
+
// onClose={ () => setVisible(false) }
|
|
11
|
+
placement: "bottom-end", visible: visible, ...placementProps }, () => (React.createElement(DropdownMenu, { width: dropdownWidth, withArrow: true }, items.map(({ component, disabled, href, icon, onClick, target, text }) => (React.createElement(DropdownMenuItem, { Component: component || 'div', disabled: disabled, href: href, icon: icon, key: text, onClick: onClick, target: target }, text)))))))));
|
|
10
12
|
};
|
|
11
13
|
export default ButtonWithDropdown;
|
|
12
14
|
//# sourceMappingURL=ButtonWithDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonWithDropdown.js","sourceRoot":"","sources":["../../../src/ButtonWithDropdown/ButtonWithDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"ButtonWithDropdown.js","sourceRoot":"","sources":["../../../src/ButtonWithDropdown/ButtonWithDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACH,OAAO,EACP,YAAY,EACZ,gBAAgB,EAEhB,IAAI,EACJ,SAAS,EACT,gBAAgB,EAEhB,kBAAkB,GACjB,MAAM,iBAAiB,CAAC;AAmB7B,MAAM,kBAAkB,GAAG,CAAC,EAC1B,WAAW,GAAG,EAAE,EAChB,QAAQ,EACR,aAAa,EACb,KAAK,EACL,cAAc,GACR,EAAe,EAAE;IACvB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,OAAO,CACL,oBAAC,gBAAgB;QACf,oBAAC,kBAAkB,QACf,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;QACb,gBAAgB;QAChB,oBAAC,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