@bitrise/bitkit 9.4.0 → 9.4.1-alpha.1
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/.eslintrc.js +9 -2
- package/.storybook/main.js +35 -0
- package/.storybook/preview.js +20 -0
- package/.stylelintignore +1 -0
- package/.stylelintrc +2 -3
- package/CHANGELOG.md +2 -0
- package/jest.setup.js +1 -1
- package/lib/cjs/Dropdown/DropdownMenu.css +1 -1
- package/lib/cjs/chakra/BitkitProvider.d.ts +5 -0
- package/lib/cjs/chakra/BitkitProvider.d.ts.map +1 -0
- package/lib/cjs/chakra/BitkitProvider.js +14 -0
- package/lib/cjs/chakra/BitkitProvider.js.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.d.ts +22 -0
- package/lib/cjs/chakra/components/Button/Button.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.js +61 -0
- package/lib/cjs/chakra/components/Button/Button.js.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts +6 -0
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.stories.js +37 -0
- package/lib/cjs/chakra/components/Button/Button.stories.js.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts +117 -0
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.theme.js +119 -0
- package/lib/cjs/chakra/components/Button/Button.theme.js.map +1 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts +14 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.js +41 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.js.map +1 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts +6 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js +48 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js.map +1 -0
- package/lib/cjs/chakra/components/Link/Link.d.ts +16 -0
- package/lib/cjs/chakra/components/Link/Link.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Link/Link.js +44 -0
- package/lib/cjs/chakra/components/Link/Link.js.map +1 -0
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts +12 -0
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Link/Link.stories.js +42 -0
- package/lib/cjs/chakra/components/Link/Link.stories.js.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.d.ts +6 -0
- package/lib/cjs/chakra/components/Menu/Menu.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.js +21 -0
- package/lib/cjs/chakra/components/Menu/Menu.js.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts +9 -0
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.stories.js +48 -0
- package/lib/cjs/chakra/components/Menu/Menu.stories.js.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts +4 -0
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.theme.js +23 -0
- package/lib/cjs/chakra/components/Menu/Menu.theme.js.map +1 -0
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts +10 -0
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Menu/MenuItem.js +39 -0
- package/lib/cjs/chakra/components/Menu/MenuItem.js.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts +16 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js +36 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts +13 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js +44 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts +45 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js +47 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js.map +1 -0
- package/lib/cjs/chakra/components/Text/Text.d.ts +32 -0
- package/lib/cjs/chakra/components/Text/Text.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Text/Text.js +38 -0
- package/lib/cjs/chakra/components/Text/Text.js.map +1 -0
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts +12 -0
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Text/Text.stories.js +42 -0
- package/lib/cjs/chakra/components/Text/Text.stories.js.map +1 -0
- package/lib/cjs/chakra/shared.d.ts +2 -0
- package/lib/cjs/chakra/shared.d.ts.map +1 -0
- package/lib/cjs/chakra/shared.js +15 -0
- package/lib/cjs/chakra/shared.js.map +1 -0
- package/lib/cjs/chakra/theme/theme.d.ts +3 -0
- package/lib/cjs/chakra/theme/theme.d.ts.map +1 -0
- package/lib/cjs/chakra/theme/theme.js +54 -0
- package/lib/cjs/chakra/theme/theme.js.map +1 -0
- package/lib/cjs/chakra/theme/typographyConfig.d.ts +4 -0
- package/lib/cjs/chakra/theme/typographyConfig.d.ts.map +1 -0
- package/lib/cjs/chakra/theme/typographyConfig.js +38 -0
- package/lib/cjs/chakra/theme/typographyConfig.js.map +1 -0
- package/lib/cjs/index.d.ts +9 -0
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +20 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esn/Dropdown/DropdownMenu.css +1 -1
- package/lib/esn/chakra/BitkitProvider.d.ts +5 -0
- package/lib/esn/chakra/BitkitProvider.d.ts.map +1 -0
- package/lib/esn/chakra/BitkitProvider.js +8 -0
- package/lib/esn/chakra/BitkitProvider.js.map +1 -0
- package/lib/esn/chakra/components/Button/Button.d.ts +22 -0
- package/lib/esn/chakra/components/Button/Button.d.ts.map +1 -0
- package/lib/esn/chakra/components/Button/Button.js +34 -0
- package/lib/esn/chakra/components/Button/Button.js.map +1 -0
- package/lib/esn/chakra/components/Button/Button.stories.d.ts +6 -0
- package/lib/esn/chakra/components/Button/Button.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/Button/Button.stories.js +29 -0
- package/lib/esn/chakra/components/Button/Button.stories.js.map +1 -0
- package/lib/esn/chakra/components/Button/Button.theme.d.ts +117 -0
- package/lib/esn/chakra/components/Button/Button.theme.d.ts.map +1 -0
- package/lib/esn/chakra/components/Button/Button.theme.js +117 -0
- package/lib/esn/chakra/components/Button/Button.theme.js.map +1 -0
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts +14 -0
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/esn/chakra/components/IconButton/IconButton.js +18 -0
- package/lib/esn/chakra/components/IconButton/IconButton.js.map +1 -0
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts +6 -0
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js +21 -0
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js.map +1 -0
- package/lib/esn/chakra/components/Link/Link.d.ts +16 -0
- package/lib/esn/chakra/components/Link/Link.d.ts.map +1 -0
- package/lib/esn/chakra/components/Link/Link.js +17 -0
- package/lib/esn/chakra/components/Link/Link.js.map +1 -0
- package/lib/esn/chakra/components/Link/Link.stories.d.ts +12 -0
- package/lib/esn/chakra/components/Link/Link.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/Link/Link.stories.js +16 -0
- package/lib/esn/chakra/components/Link/Link.stories.js.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.d.ts +6 -0
- package/lib/esn/chakra/components/Menu/Menu.d.ts.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.js +5 -0
- package/lib/esn/chakra/components/Menu/Menu.js.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts +9 -0
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.stories.js +39 -0
- package/lib/esn/chakra/components/Menu/Menu.stories.js.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts +4 -0
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.theme.js +21 -0
- package/lib/esn/chakra/components/Menu/Menu.theme.js.map +1 -0
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts +10 -0
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts.map +1 -0
- package/lib/esn/chakra/components/Menu/MenuItem.js +12 -0
- package/lib/esn/chakra/components/Menu/MenuItem.js.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts +16 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.js +30 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.js.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts +13 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js +16 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts +45 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js +45 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js.map +1 -0
- package/lib/esn/chakra/components/Text/Text.d.ts +32 -0
- package/lib/esn/chakra/components/Text/Text.d.ts.map +1 -0
- package/lib/esn/chakra/components/Text/Text.js +22 -0
- package/lib/esn/chakra/components/Text/Text.js.map +1 -0
- package/lib/esn/chakra/components/Text/Text.stories.d.ts +12 -0
- package/lib/esn/chakra/components/Text/Text.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/Text/Text.stories.js +19 -0
- package/lib/esn/chakra/components/Text/Text.stories.js.map +1 -0
- package/lib/esn/chakra/shared.d.ts +2 -0
- package/lib/esn/chakra/shared.d.ts.map +1 -0
- package/lib/esn/chakra/shared.js +11 -0
- package/lib/esn/chakra/shared.js.map +1 -0
- package/lib/esn/chakra/theme/theme.d.ts +3 -0
- package/lib/esn/chakra/theme/theme.d.ts.map +1 -0
- package/lib/esn/chakra/theme/theme.js +49 -0
- package/lib/esn/chakra/theme/theme.js.map +1 -0
- package/lib/esn/chakra/theme/typographyConfig.d.ts +4 -0
- package/lib/esn/chakra/theme/typographyConfig.d.ts.map +1 -0
- package/lib/esn/chakra/theme/typographyConfig.js +36 -0
- package/lib/esn/chakra/theme/typographyConfig.js.map +1 -0
- package/lib/esn/index.d.ts +9 -0
- package/lib/esn/index.d.ts.map +1 -1
- package/lib/esn/index.js +9 -0
- package/lib/esn/index.js.map +1 -1
- package/lib/esn/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -21
- package/src/Dropdown/DropdownMenu.css +1 -1
- package/src/chakra/BitkitProvider.tsx +9 -0
- package/src/chakra/components/Button/Button.stories.tsx +32 -0
- package/src/chakra/components/Button/Button.theme.ts +117 -0
- package/src/chakra/components/Button/Button.tsx +52 -0
- package/src/chakra/components/IconButton/IconButton.stories.tsx +24 -0
- package/src/chakra/components/IconButton/IconButton.tsx +29 -0
- package/src/chakra/components/Link/Link.stories.tsx +19 -0
- package/src/chakra/components/Link/Link.tsx +30 -0
- package/src/chakra/components/Menu/Menu.stories.tsx +57 -0
- package/src/chakra/components/Menu/Menu.theme.ts +23 -0
- package/src/chakra/components/Menu/Menu.tsx +8 -0
- package/src/chakra/components/Menu/MenuItem.tsx +19 -0
- package/src/chakra/components/StatusTag/StatusTag.stories.tsx +19 -0
- package/src/chakra/components/StatusTag/StatusTag.theme.ts +45 -0
- package/src/chakra/components/StatusTag/StatusTag.tsx +55 -0
- package/src/chakra/components/Text/Text.stories.tsx +22 -0
- package/src/chakra/components/Text/Text.tsx +73 -0
- package/src/chakra/shared.ts +11 -0
- package/src/chakra/theme/theme.ts +50 -0
- package/src/chakra/theme/typographyConfig.ts +38 -0
- package/src/index.ts +10 -0
- package/tsconfig.json +5 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitkitProvider.d.ts","sourceRoot":"","sources":["../../../src/chakra/BitkitProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvE,QAAA,MAAM,cAAc,iBAAkB,mBAAmB,gBAExD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChakraProvider } from '@chakra-ui/react';
|
|
3
|
+
import theme from './theme/theme';
|
|
4
|
+
const BitkitProvider = ({ children }) => {
|
|
5
|
+
return React.createElement(ChakraProvider, { theme: theme }, children);
|
|
6
|
+
};
|
|
7
|
+
export default BitkitProvider;
|
|
8
|
+
//# sourceMappingURL=BitkitProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitkitProvider.js","sourceRoot":"","sources":["../../../src/chakra/BitkitProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,MAAM,eAAe,CAAC;AAElC,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAuB,EAAE,EAAE;IAC3D,OAAO,oBAAC,cAAc,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAkB,CAAC;AACnE,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from '@chakra-ui/react';
|
|
3
|
+
import { TypeIconName } from '@bitrise/bitkit';
|
|
4
|
+
export interface Props {
|
|
5
|
+
as?: 'a' | 'button';
|
|
6
|
+
children: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
leftIconName?: TypeIconName;
|
|
11
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
12
|
+
ref?: ButtonProps['itemRef'];
|
|
13
|
+
rightIconName?: TypeIconName;
|
|
14
|
+
size?: 'small' | 'medium';
|
|
15
|
+
sx?: ButtonProps['sx'];
|
|
16
|
+
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
17
|
+
type?: ButtonProps['type'];
|
|
18
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'dangerPrimary' | 'dangerSecondary';
|
|
19
|
+
}
|
|
20
|
+
declare const Button: React.ForwardRefExoticComponent<Pick<Props, "size" | "className" | "children" | "onClick" | "href" | "variant" | "target" | "type" | "as" | "sx" | "isDisabled" | "leftIconName" | "rightIconName"> & React.RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
export default Button;
|
|
22
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAQ,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,KAAK;IACpB,EAAE,CAAC,EAAE,GAAG,GAAG,QAAQ,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACvE,GAAG,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,EAAE,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACvB,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;AAED,QAAA,MAAM,MAAM,+OAqBV,CAAC;AAQH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button as ChakraButton } from '@chakra-ui/react';
|
|
4
|
+
import { Icon } from '@bitrise/bitkit';
|
|
5
|
+
const Button = React.forwardRef((props, ref) => {
|
|
6
|
+
const { as, leftIconName, rightIconName, size, ...rest } = props;
|
|
7
|
+
const properties = { as, size, ...rest };
|
|
8
|
+
if (leftIconName) {
|
|
9
|
+
properties.leftIcon = React.createElement(Icon, { name: leftIconName });
|
|
10
|
+
}
|
|
11
|
+
if (rightIconName) {
|
|
12
|
+
properties.rightIcon = React.createElement(Icon, { name: rightIconName });
|
|
13
|
+
}
|
|
14
|
+
if (leftIconName || rightIconName) {
|
|
15
|
+
properties.iconSpacing = size === 'medium' ? '10px' : '6px';
|
|
16
|
+
}
|
|
17
|
+
if (as === 'a') {
|
|
18
|
+
delete properties.type;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
/* @ts-ignore */
|
|
22
|
+
delete properties.href;
|
|
23
|
+
/* @ts-ignore */
|
|
24
|
+
delete properties.target;
|
|
25
|
+
}
|
|
26
|
+
return React.createElement(ChakraButton, { ref: ref, ...properties });
|
|
27
|
+
});
|
|
28
|
+
Button.defaultProps = {
|
|
29
|
+
as: 'button',
|
|
30
|
+
size: 'medium',
|
|
31
|
+
variant: 'primary',
|
|
32
|
+
};
|
|
33
|
+
export default Button;
|
|
34
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/chakra/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,YAAY,EAAe,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAgB,MAAM,iBAAiB,CAAC;AAmBrD,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAA2B,CAAC,KAAY,EAAE,GAAG,EAAE,EAAE;IAC9E,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACjE,MAAM,UAAU,GAAgB,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;IACtD,IAAI,YAAY,EAAE;QAChB,UAAU,CAAC,QAAQ,GAAG,oBAAC,IAAI,IAAC,IAAI,EAAE,YAAY,GAAI,CAAC;KACpD;IACD,IAAI,aAAa,EAAE;QACjB,UAAU,CAAC,SAAS,GAAG,oBAAC,IAAI,IAAC,IAAI,EAAE,aAAa,GAAI,CAAC;KACtD;IACD,IAAI,YAAY,IAAI,aAAa,EAAE;QACjC,UAAU,CAAC,WAAW,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;KAC7D;IACD,IAAI,EAAE,KAAK,GAAG,EAAE;QACd,OAAO,UAAU,CAAC,IAAI,CAAC;KACxB;SAAM;QACL,gBAAgB;QAChB,OAAO,UAAU,CAAC,IAAI,CAAC;QACvB,gBAAgB;QAChB,OAAO,UAAU,CAAC,MAAM,CAAC;KAC1B;IACD,OAAO,oBAAC,YAAY,IAAC,GAAG,EAAE,GAAG,KAAM,UAAU,GAAI,CAAC;AACpD,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,YAAY,GAAG;IACpB,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Pick<import("./Button").Props, "size" | "className" | "children" | "onClick" | "href" | "variant" | "target" | "type" | "as" | "sx" | "isDisabled" | "leftIconName" | "rightIconName"> & React.RefAttributes<HTMLButtonElement>>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const WithProps: ComponentStory<React.ForwardRefExoticComponent<Pick<import("./Button").Props, "size" | "className" | "children" | "onClick" | "href" | "variant" | "target" | "type" | "as" | "sx" | "isDisabled" | "leftIconName" | "rightIconName"> & React.RefAttributes<HTMLButtonElement>>>;
|
|
6
|
+
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;;AAKjE,wBAWkC;AAIlC,eAAO,MAAM,SAAS,kRAAoB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { sortObjectByKey } from '../../shared';
|
|
3
|
+
import { IconList } from '../../../Icon/tsx';
|
|
4
|
+
import Button from './Button';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Button',
|
|
7
|
+
component: Button,
|
|
8
|
+
argTypes: {
|
|
9
|
+
leftIconName: {
|
|
10
|
+
options: IconList,
|
|
11
|
+
},
|
|
12
|
+
rightIconName: {
|
|
13
|
+
options: IconList,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const Template = (props) => React.createElement(Button, { ...props });
|
|
18
|
+
export const WithProps = Template.bind({});
|
|
19
|
+
WithProps.args = sortObjectByKey({
|
|
20
|
+
...Button.defaultProps,
|
|
21
|
+
as: 'button',
|
|
22
|
+
className: '',
|
|
23
|
+
isDisabled: false,
|
|
24
|
+
href: '',
|
|
25
|
+
target: '_self',
|
|
26
|
+
type: 'button',
|
|
27
|
+
children: 'Button',
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../../../src/chakra/components/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,eAAe;IACb,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,OAAO,EAAE,QAAQ;SAClB;QACD,aAAa,EAAE;YACb,OAAO,EAAE,QAAQ;SAClB;KACF;CAC8B,CAAC;AAElC,MAAM,QAAQ,GAAkC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,MAAM,OAAK,KAAK,GAAI,CAAC;AAEjF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG,eAAe,CAAC;IAC/B,GAAG,MAAM,CAAC,YAAY;IACtB,EAAE,EAAE,QAAQ;IACZ,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,QAAQ;CACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
declare const ButtonTheme: {
|
|
2
|
+
baseStyle: {
|
|
3
|
+
border: string;
|
|
4
|
+
borderRadius: string;
|
|
5
|
+
fontWeight: string;
|
|
6
|
+
lineHeight: number;
|
|
7
|
+
};
|
|
8
|
+
variants: {
|
|
9
|
+
primary: {
|
|
10
|
+
bgGradient: string;
|
|
11
|
+
borderColor: string;
|
|
12
|
+
color: string;
|
|
13
|
+
fontWeight: string;
|
|
14
|
+
_hover: {
|
|
15
|
+
bgGradient: string;
|
|
16
|
+
_disabled: {
|
|
17
|
+
bgGradient: string;
|
|
18
|
+
borderColor: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
_active: {
|
|
22
|
+
bgGradient: string;
|
|
23
|
+
};
|
|
24
|
+
_disabled: {
|
|
25
|
+
bgGradient: string;
|
|
26
|
+
borderColor: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
secondary: {
|
|
30
|
+
bgGradient: string;
|
|
31
|
+
borderColor: string;
|
|
32
|
+
color: string;
|
|
33
|
+
_hover: {
|
|
34
|
+
bgGradient: string;
|
|
35
|
+
};
|
|
36
|
+
_active: {
|
|
37
|
+
bgGradient: string;
|
|
38
|
+
color: string;
|
|
39
|
+
};
|
|
40
|
+
_disabled: {
|
|
41
|
+
color: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
tertiary: {
|
|
45
|
+
background: string;
|
|
46
|
+
borderColor: string;
|
|
47
|
+
color: string;
|
|
48
|
+
_hover: {
|
|
49
|
+
background: string;
|
|
50
|
+
};
|
|
51
|
+
_active: {
|
|
52
|
+
background: string;
|
|
53
|
+
color: string;
|
|
54
|
+
};
|
|
55
|
+
_disabled: {
|
|
56
|
+
color: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
dangerPrimary: {
|
|
60
|
+
bgGradient: string;
|
|
61
|
+
borderColor: string;
|
|
62
|
+
color: string;
|
|
63
|
+
fontWeight: string;
|
|
64
|
+
_hover: {
|
|
65
|
+
bgGradient: string;
|
|
66
|
+
_disabled: {
|
|
67
|
+
bgGradient: string;
|
|
68
|
+
borderColor: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
_active: {
|
|
72
|
+
bgGradient: string;
|
|
73
|
+
};
|
|
74
|
+
_disabled: {
|
|
75
|
+
bgGradient: string;
|
|
76
|
+
borderColor: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
dangerSecondary: {
|
|
80
|
+
bgGradient: string;
|
|
81
|
+
borderColor: string;
|
|
82
|
+
color: string;
|
|
83
|
+
_hover: {
|
|
84
|
+
bgGradient: string;
|
|
85
|
+
borderColor: string;
|
|
86
|
+
_disabled: {
|
|
87
|
+
bgGradient: string;
|
|
88
|
+
borderColor: string;
|
|
89
|
+
color: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
_active: {
|
|
93
|
+
bgGradient: string;
|
|
94
|
+
color: string;
|
|
95
|
+
};
|
|
96
|
+
_disabled: {
|
|
97
|
+
color: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
sizes: {
|
|
102
|
+
small: {
|
|
103
|
+
minWidth: string;
|
|
104
|
+
height: string;
|
|
105
|
+
fontSize: number;
|
|
106
|
+
paddingX: string;
|
|
107
|
+
};
|
|
108
|
+
medium: {
|
|
109
|
+
minWidth: string;
|
|
110
|
+
height: string;
|
|
111
|
+
fontSize: number;
|
|
112
|
+
paddingX: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
export default ButtonTheme;
|
|
117
|
+
//# sourceMappingURL=Button.theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.theme.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/Button/Button.theme.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
const ButtonTheme = {
|
|
2
|
+
baseStyle: {
|
|
3
|
+
border: '1px solid',
|
|
4
|
+
borderRadius: 'base',
|
|
5
|
+
fontWeight: 'normal',
|
|
6
|
+
lineHeight: 3,
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
primary: {
|
|
10
|
+
bgGradient: 'linear(to-b, #6C0EB2, #450674)',
|
|
11
|
+
borderColor: '#683D87',
|
|
12
|
+
color: '#F8F8F8',
|
|
13
|
+
fontWeight: 'bold',
|
|
14
|
+
_hover: {
|
|
15
|
+
bgGradient: 'linear(to-b, #50167B, #3D125D)',
|
|
16
|
+
_disabled: {
|
|
17
|
+
bgGradient: 'linear(to-b, #ccc, #ACACAC)',
|
|
18
|
+
borderColor: '#ACACAC',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
_active: {
|
|
22
|
+
bgGradient: 'linear(to-b, #351D48, #351D48)',
|
|
23
|
+
},
|
|
24
|
+
_disabled: {
|
|
25
|
+
bgGradient: 'linear(to-b, #ccc, #ACACAC)',
|
|
26
|
+
borderColor: '#ACACAC',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
secondary: {
|
|
30
|
+
bgGradient: 'linear(to-b, #f8f8f8, #fff)',
|
|
31
|
+
borderColor: '#ddd',
|
|
32
|
+
color: '#351D48',
|
|
33
|
+
_hover: {
|
|
34
|
+
bgGradient: 'linear(to-b, #ECECEC, #ECECEC)',
|
|
35
|
+
},
|
|
36
|
+
_active: {
|
|
37
|
+
bgGradient: 'linear(to-b, #351D48, #351D48)',
|
|
38
|
+
color: '#F8F8F8',
|
|
39
|
+
},
|
|
40
|
+
_disabled: {
|
|
41
|
+
color: '#ACACAC',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
tertiary: {
|
|
45
|
+
background: 'transparent',
|
|
46
|
+
borderColor: 'transparent',
|
|
47
|
+
color: '#760FC3',
|
|
48
|
+
_hover: {
|
|
49
|
+
background: '#F8F0FF',
|
|
50
|
+
},
|
|
51
|
+
_active: {
|
|
52
|
+
background: '#351D48',
|
|
53
|
+
color: '#F8F8F8',
|
|
54
|
+
},
|
|
55
|
+
_disabled: {
|
|
56
|
+
color: '#ACACAC',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
dangerPrimary: {
|
|
60
|
+
bgGradient: 'linear(to-b, #E41447, #FF2158)',
|
|
61
|
+
borderColor: '#D4093C',
|
|
62
|
+
color: '#fff',
|
|
63
|
+
fontWeight: 'bold',
|
|
64
|
+
_hover: {
|
|
65
|
+
bgGradient: 'linear(to-b, #C90032, #C90032)',
|
|
66
|
+
_disabled: {
|
|
67
|
+
bgGradient: 'linear(to-b, #ccc, #acacac)',
|
|
68
|
+
borderColor: '#ACACAC',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
_active: {
|
|
72
|
+
bgGradient: 'linear(to-b, #C02048, #C02048)',
|
|
73
|
+
},
|
|
74
|
+
_disabled: {
|
|
75
|
+
bgGradient: 'linear(to-b, #ccc, #acacac)',
|
|
76
|
+
borderColor: '#ACACAC',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
dangerSecondary: {
|
|
80
|
+
bgGradient: 'linear(to-b, #f8f8f8, #fff)',
|
|
81
|
+
borderColor: '#ddd',
|
|
82
|
+
color: '#FF2158',
|
|
83
|
+
_hover: {
|
|
84
|
+
bgGradient: 'linear(to-b, #FFE8EE, #FFE8EE)',
|
|
85
|
+
borderColor: '#FF8FAB',
|
|
86
|
+
_disabled: {
|
|
87
|
+
bgGradient: 'linear(to-b, #f8f8f8, #fff)',
|
|
88
|
+
borderColor: '#ddd',
|
|
89
|
+
color: '#ACACAC',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
_active: {
|
|
93
|
+
bgGradient: 'linear(to-b, #C02048, #C02048)',
|
|
94
|
+
color: '#fff',
|
|
95
|
+
},
|
|
96
|
+
_disabled: {
|
|
97
|
+
color: '#ACACAC',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
sizes: {
|
|
102
|
+
small: {
|
|
103
|
+
minWidth: '32px',
|
|
104
|
+
height: '32px',
|
|
105
|
+
fontSize: 2,
|
|
106
|
+
paddingX: '12px',
|
|
107
|
+
},
|
|
108
|
+
medium: {
|
|
109
|
+
minWidth: '48px',
|
|
110
|
+
height: '48px',
|
|
111
|
+
fontSize: 3,
|
|
112
|
+
paddingX: '16px',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
export default ButtonTheme;
|
|
117
|
+
//# sourceMappingURL=Button.theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.theme.js","sourceRoot":"","sources":["../../../../../src/chakra/components/Button/Button.theme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE;QACT,MAAM,EAAE,WAAW;QACnB,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,QAAQ;QACpB,UAAU,EAAE,CAAC;KACd;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,UAAU,EAAE,gCAAgC;YAC5C,WAAW,EAAE,SAAS;YACtB,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE;gBACN,UAAU,EAAE,gCAAgC;gBAC5C,SAAS,EAAE;oBACT,UAAU,EAAE,6BAA6B;oBACzC,WAAW,EAAE,SAAS;iBACvB;aACF;YACD,OAAO,EAAE;gBACP,UAAU,EAAE,gCAAgC;aAC7C;YACD,SAAS,EAAE;gBACT,UAAU,EAAE,6BAA6B;gBACzC,WAAW,EAAE,SAAS;aACvB;SACF;QACD,SAAS,EAAE;YACT,UAAU,EAAE,6BAA6B;YACzC,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE;gBACN,UAAU,EAAE,gCAAgC;aAC7C;YACD,OAAO,EAAE;gBACP,UAAU,EAAE,gCAAgC;gBAC5C,KAAK,EAAE,SAAS;aACjB;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,SAAS;aACjB;SACF;QACD,QAAQ,EAAE;YACR,UAAU,EAAE,aAAa;YACzB,WAAW,EAAE,aAAa;YAC1B,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE;gBACN,UAAU,EAAE,SAAS;aACtB;YACD,OAAO,EAAE;gBACP,UAAU,EAAE,SAAS;gBACrB,KAAK,EAAE,SAAS;aACjB;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,SAAS;aACjB;SACF;QACD,aAAa,EAAE;YACb,UAAU,EAAE,gCAAgC;YAC5C,WAAW,EAAE,SAAS;YACtB,KAAK,EAAE,MAAM;YACb,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE;gBACN,UAAU,EAAE,gCAAgC;gBAC5C,SAAS,EAAE;oBACT,UAAU,EAAE,6BAA6B;oBACzC,WAAW,EAAE,SAAS;iBACvB;aACF;YACD,OAAO,EAAE;gBACP,UAAU,EAAE,gCAAgC;aAC7C;YACD,SAAS,EAAE;gBACT,UAAU,EAAE,6BAA6B;gBACzC,WAAW,EAAE,SAAS;aACvB;SACF;QACD,eAAe,EAAE;YACf,UAAU,EAAE,6BAA6B;YACzC,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE;gBACN,UAAU,EAAE,gCAAgC;gBAC5C,WAAW,EAAE,SAAS;gBACtB,SAAS,EAAE;oBACT,UAAU,EAAE,6BAA6B;oBACzC,WAAW,EAAE,MAAM;oBACnB,KAAK,EAAE,SAAS;iBACjB;aACF;YACD,OAAO,EAAE;gBACP,UAAU,EAAE,gCAAgC;gBAC5C,KAAK,EAAE,MAAM;aACd;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,SAAS;aACjB;SACF;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,MAAM;SACjB;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,MAAM;SACjB;KACF;CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconButtonProps } from '@chakra-ui/react';
|
|
3
|
+
import { TypeIconName } from '@bitrise/bitkit';
|
|
4
|
+
export interface Props {
|
|
5
|
+
iconName: TypeIconName;
|
|
6
|
+
label: IconButtonProps['aria-label'];
|
|
7
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
8
|
+
size?: 'small' | 'medium';
|
|
9
|
+
sx?: IconButtonProps['sx'];
|
|
10
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'dangerPrimary' | 'dangerSecondary';
|
|
11
|
+
}
|
|
12
|
+
declare const IconButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
export default IconButton;
|
|
14
|
+
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkC,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAQ,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACvE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,EAAE,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,eAAe,GAAG,iBAAiB,CAAC;CACtF;AAED,QAAA,MAAM,UAAU,iFAQd,CAAC;AAOH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconButton as ChakraIconButton } from '@chakra-ui/react';
|
|
3
|
+
import { Icon } from '@bitrise/bitkit';
|
|
4
|
+
const IconButton = React.forwardRef((props, ref) => {
|
|
5
|
+
const { iconName, label, ...rest } = props;
|
|
6
|
+
const properties = {
|
|
7
|
+
'aria-label': label,
|
|
8
|
+
icon: React.createElement(Icon, { name: iconName }),
|
|
9
|
+
...rest,
|
|
10
|
+
};
|
|
11
|
+
return React.createElement(ChakraIconButton, { ref: ref, ...properties });
|
|
12
|
+
});
|
|
13
|
+
IconButton.defaultProps = {
|
|
14
|
+
size: 'medium',
|
|
15
|
+
variant: 'primary',
|
|
16
|
+
};
|
|
17
|
+
export default IconButton;
|
|
18
|
+
//# sourceMappingURL=IconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../../../src/chakra/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAmB,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,IAAI,EAAgB,MAAM,iBAAiB,CAAC;AAWrD,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAA2B,CAAC,KAAY,EAAE,GAAG,EAAE,EAAE;IAClF,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,UAAU,GAAoB;QAClC,YAAY,EAAE,KAAK;QACnB,IAAI,EAAE,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,GAAI;QAC9B,GAAG,IAAI;KACR,CAAC;IACF,OAAO,oBAAC,gBAAgB,IAAC,GAAG,EAAE,GAAG,KAAM,UAAU,GAAI,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("./IconButton").Props & React.RefAttributes<HTMLButtonElement>>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const WithProps: ComponentStory<React.ForwardRefExoticComponent<import("./IconButton").Props & React.RefAttributes<HTMLButtonElement>>>;
|
|
6
|
+
//# sourceMappingURL=IconButton.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/IconButton/IconButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;;AAKjE,wBAQsC;AAItC,eAAO,MAAM,SAAS,wHAAoB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { sortObjectByKey } from '../../shared';
|
|
3
|
+
import { IconList } from '../../../Icon/tsx';
|
|
4
|
+
import IconButton from './IconButton';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/IconButton',
|
|
7
|
+
component: IconButton,
|
|
8
|
+
argTypes: {
|
|
9
|
+
iconName: {
|
|
10
|
+
options: IconList,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
const Template = ({ ...props }) => React.createElement(IconButton, { ...props });
|
|
15
|
+
export const WithProps = Template.bind({});
|
|
16
|
+
WithProps.args = sortObjectByKey({
|
|
17
|
+
...IconButton.defaultProps,
|
|
18
|
+
iconName: 'AddOns',
|
|
19
|
+
label: 'This is the label',
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=IconButton.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.stories.js","sourceRoot":"","sources":["../../../../../src/chakra/components/IconButton/IconButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,OAAO,EAAE,QAAQ;SAClB;KACF;CACkC,CAAC;AAEtC,MAAM,QAAQ,GAAsC,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,oBAAC,UAAU,OAAK,KAAK,GAAI,CAAC;AAEhG,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG,eAAe,CAAC;IAC/B,GAAG,UAAU,CAAC,YAAY;IAC1B,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,mBAAmB;CAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LinkProps } from '@chakra-ui/react';
|
|
3
|
+
export declare type TypeLinkColor = 'grape-3' | 'grape-5' | 'gray-1' | 'gray-5' | 'white' | 'inherit';
|
|
4
|
+
export interface Props {
|
|
5
|
+
children: LinkProps['children'];
|
|
6
|
+
color?: TypeLinkColor;
|
|
7
|
+
href: string;
|
|
8
|
+
isUnderlined?: boolean;
|
|
9
|
+
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
10
|
+
}
|
|
11
|
+
declare const Link: {
|
|
12
|
+
(props: Props): JSX.Element;
|
|
13
|
+
defaultProps: Props;
|
|
14
|
+
};
|
|
15
|
+
export default Link;
|
|
16
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/Link/Link.tsx"],"names":[],"mappings":";AACA,OAAO,EAAsB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEjE,oBAAY,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9F,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;CAClD;AAED,QAAA,MAAM,IAAI;YAAW,KAAK;;CASzB,CAAC;AAOF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link as ChakraLink } from '@chakra-ui/react';
|
|
3
|
+
const Link = (props) => {
|
|
4
|
+
const { isUnderlined, ...rest } = props;
|
|
5
|
+
const properties = { ...rest };
|
|
6
|
+
properties.as = 'a';
|
|
7
|
+
if (isUnderlined) {
|
|
8
|
+
properties.textDecoration = 'underline';
|
|
9
|
+
}
|
|
10
|
+
return React.createElement(ChakraLink, { ...properties });
|
|
11
|
+
};
|
|
12
|
+
Link.defaultProps = {
|
|
13
|
+
color: 'grape-3',
|
|
14
|
+
isUnderlined: true,
|
|
15
|
+
};
|
|
16
|
+
export default Link;
|
|
17
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../../../../src/chakra/components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,IAAI,UAAU,EAAa,MAAM,kBAAkB,CAAC;AAYjE,MAAM,IAAI,GAAG,CAAC,KAAY,EAAE,EAAE;IAC5B,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,UAAU,GAAc,EAAE,GAAG,IAAI,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,GAAG,GAAG,CAAC;IACpB,IAAI,YAAY,EAAE;QAChB,UAAU,CAAC,cAAc,GAAG,WAAW,CAAC;KACzC;IAED,OAAO,oBAAC,UAAU,OAAK,UAAU,GAAI,CAAC;AACxC,CAAC,CAAC;AAEF,IAAI,CAAC,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,IAAI;CACV,CAAC;AAEX,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<{
|
|
4
|
+
(props: import("./Link").Props): JSX.Element;
|
|
5
|
+
defaultProps: import("./Link").Props;
|
|
6
|
+
}>;
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const WithProps: ComponentStory<{
|
|
9
|
+
(props: import("./Link").Props): JSX.Element;
|
|
10
|
+
defaultProps: import("./Link").Props;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=Link.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.stories.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/Link/Link.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;;;;;AAIjE,wBAGgC;AAIhC,eAAO,MAAM,SAAS;;;EAAoB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { sortObjectByKey } from '../../shared';
|
|
3
|
+
import Link from './Link';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Link',
|
|
6
|
+
component: Link,
|
|
7
|
+
};
|
|
8
|
+
const Template = ({ ...props }) => React.createElement(Link, { ...props });
|
|
9
|
+
export const WithProps = Template.bind({});
|
|
10
|
+
WithProps.args = sortObjectByKey({
|
|
11
|
+
...Link.defaultProps,
|
|
12
|
+
children: 'The quick brown fox jumps over the lazy dog.',
|
|
13
|
+
href: '#',
|
|
14
|
+
target: '_self',
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=Link.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.stories.js","sourceRoot":"","sources":["../../../../../src/chakra/components/Link/Link.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,IAAI;CACc,CAAC;AAEhC,MAAM,QAAQ,GAAgC,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,oBAAC,IAAI,OAAK,KAAK,GAAI,CAAC;AAEpF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG,eAAe,CAAC;IAC/B,GAAG,IAAI,CAAC,YAAY;IACpB,QAAQ,EAAE,8CAA8C;IACxD,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,OAAO;CAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/Menu/Menu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAsB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEjE,oBAAY,KAAK,GAAG,SAAS,CAAC;AAE9B,QAAA,MAAM,IAAI,UAAW,KAAK,gBAA8B,CAAC;AAEzD,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../../../src/chakra/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,IAAI,UAAU,EAAa,MAAM,kBAAkB,CAAC;AAIjE,MAAM,IAAI,GAAG,CAAC,KAAY,EAAE,EAAE,CAAC,oBAAC,UAAU,OAAK,KAAK,GAAI,CAAC;AAEzD,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import Menu from './Menu';
|
|
4
|
+
declare const _default: ComponentMeta<(props: import("@chakra-ui/react").MenuProps) => JSX.Element>;
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const WithButton: ComponentStory<typeof Menu>;
|
|
7
|
+
export declare const WithIconButton: ComponentStory<typeof Menu>;
|
|
8
|
+
export declare const WithButtonGroup: ComponentStory<typeof Menu>;
|
|
9
|
+
//# sourceMappingURL=Menu.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.stories.d.ts","sourceRoot":"","sources":["../../../../../src/chakra/components/Menu/Menu.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjE,OAAO,IAAI,MAAM,QAAQ,CAAC;;AAG1B,wBAIgC;AAEhC,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,OAAO,IAAI,CAWlD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,OAAO,IAAI,CAWtD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,OAAO,IAAI,CAgBvD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonGroup, HStack, MenuButton, MenuList } from '@chakra-ui/react';
|
|
3
|
+
import Button from '../Button/Button';
|
|
4
|
+
import IconButton from '../IconButton/IconButton';
|
|
5
|
+
import Menu from './Menu';
|
|
6
|
+
import MenuItem from './MenuItem';
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Menu',
|
|
9
|
+
component: Menu,
|
|
10
|
+
subcomponents: { MenuButton, MenuList, MenuItem },
|
|
11
|
+
};
|
|
12
|
+
export const WithButton = () => (React.createElement(Menu, null,
|
|
13
|
+
React.createElement(MenuButton, { as: Button }, "Actions"),
|
|
14
|
+
React.createElement(MenuList, null,
|
|
15
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Download"),
|
|
16
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Create a Copy"),
|
|
17
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Mark as Draft"),
|
|
18
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Delete"),
|
|
19
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Attend a Workshop"))));
|
|
20
|
+
export const WithIconButton = () => (React.createElement(Menu, null,
|
|
21
|
+
React.createElement(MenuButton, { as: IconButton, iconName: "AddOnsColorTuorqouise", label: "Open menu" }),
|
|
22
|
+
React.createElement(MenuList, null,
|
|
23
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Download"),
|
|
24
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Create a Copy"),
|
|
25
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Mark as Draft"),
|
|
26
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Delete"),
|
|
27
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Attend a Workshop"))));
|
|
28
|
+
export const WithButtonGroup = () => (React.createElement(HStack, { justifyContent: "end" },
|
|
29
|
+
React.createElement(ButtonGroup, { isAttached: true },
|
|
30
|
+
React.createElement(Button, null, "Button"),
|
|
31
|
+
React.createElement(Menu, null,
|
|
32
|
+
React.createElement(MenuButton, { as: IconButton, iconName: "AddOnsColorTuorqouise", label: "Open menu" }),
|
|
33
|
+
React.createElement(MenuList, null,
|
|
34
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Download"),
|
|
35
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Create a Copy"),
|
|
36
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Mark as Draft"),
|
|
37
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Delete"),
|
|
38
|
+
React.createElement(MenuItem, { iconName: "AddOnsColorTuorqouise" }, "Attend a Workshop"))))));
|
|
39
|
+
//# sourceMappingURL=Menu.stories.js.map
|