@bitrise/bitkit 9.4.1-alpha.2 → 9.4.1-beta.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 +1 -1
- package/.husky/commit-msg +4 -0
- package/.nvmrc +1 -1
- package/.stylelintignore +0 -1
- package/.tool-versions +1 -1
- package/CHANGELOG.md +1 -3
- package/bitrise.yml +41 -27
- package/jest.setup.js +1 -0
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts +6 -3
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js +13 -6
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
- package/lib/cjs/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/cjs/Dropdown/Dropdown.js +9 -8
- package/lib/cjs/Dropdown/Dropdown.js.map +1 -1
- package/lib/cjs/Placement/Placement.css +17 -35
- package/lib/cjs/Placement/Placement.d.ts +5 -8
- package/lib/cjs/Placement/Placement.d.ts.map +1 -1
- package/lib/cjs/Placement/Placement.js.map +1 -1
- package/lib/cjs/Placement/PlacementPopper.d.ts +3 -4
- package/lib/cjs/Placement/PlacementPopper.d.ts.map +1 -1
- package/lib/cjs/Placement/PlacementPopper.js +32 -17
- package/lib/cjs/Placement/PlacementPopper.js.map +1 -1
- package/lib/cjs/Tooltip/Tooltip.d.ts +1 -1
- package/lib/cjs/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/cjs/hooks/useEventListener.d.ts.map +1 -1
- package/lib/cjs/hooks/useEventListener.js +0 -1
- package/lib/cjs/hooks/useEventListener.js.map +1 -1
- package/lib/cjs/index.d.ts +0 -9
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +1 -20
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts +6 -3
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js +10 -3
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
- package/lib/esn/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/esn/Dropdown/Dropdown.js +9 -5
- package/lib/esn/Dropdown/Dropdown.js.map +1 -1
- package/lib/esn/Placement/Placement.css +17 -35
- package/lib/esn/Placement/Placement.d.ts +5 -8
- package/lib/esn/Placement/Placement.d.ts.map +1 -1
- package/lib/esn/Placement/Placement.js.map +1 -1
- package/lib/esn/Placement/PlacementPopper.d.ts +3 -4
- package/lib/esn/Placement/PlacementPopper.d.ts.map +1 -1
- package/lib/esn/Placement/PlacementPopper.js +44 -29
- package/lib/esn/Placement/PlacementPopper.js.map +1 -1
- package/lib/esn/Tooltip/Tooltip.d.ts +1 -1
- package/lib/esn/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/esn/hooks/useEventListener.d.ts.map +1 -1
- package/lib/esn/hooks/useEventListener.js +0 -1
- package/lib/esn/hooks/useEventListener.js.map +1 -1
- package/lib/esn/index.d.ts +0 -9
- package/lib/esn/index.d.ts.map +1 -1
- package/lib/esn/index.js +0 -9
- package/lib/esn/index.js.map +1 -1
- package/lib/esn/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -42
- package/postcss.config.js +9 -5
- package/release.config.js +2 -1
- package/site/components/Documentation/Components/SectionButtons.tsx +8 -4
- package/site/components/Documentation/Components/SectionDropdowns.tsx +1 -1
- package/site/components/Documentation/Components/SectionPlacement.tsx +7 -1
- package/src/ButtonWithDropdown/ButtonWithDropdown.tsx +22 -21
- package/src/Dropdown/Dropdown.tsx +16 -8
- package/src/Placement/Placement.css +17 -35
- package/src/Placement/Placement.tsx +5 -8
- package/src/Placement/PlacementPopper.tsx +64 -48
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/hooks/useEventListener.ts +25 -5
- package/src/index.ts +0 -10
- package/tsconfig.json +2 -5
- package/.storybook/main.js +0 -35
- package/.storybook/preview.js +0 -20
- package/lib/cjs/chakra/BitkitProvider.d.ts +0 -5
- package/lib/cjs/chakra/BitkitProvider.d.ts.map +0 -1
- package/lib/cjs/chakra/BitkitProvider.js +0 -14
- package/lib/cjs/chakra/BitkitProvider.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.d.ts +0 -22
- package/lib/cjs/chakra/components/Button/Button.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.js +0 -61
- package/lib/cjs/chakra/components/Button/Button.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts +0 -6
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.stories.js +0 -37
- package/lib/cjs/chakra/components/Button/Button.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts +0 -117
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.theme.js +0 -119
- package/lib/cjs/chakra/components/Button/Button.theme.js.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts +0 -14
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.js +0 -41
- package/lib/cjs/chakra/components/IconButton/IconButton.js.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js +0 -48
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.d.ts +0 -16
- package/lib/cjs/chakra/components/Link/Link.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.js +0 -44
- package/lib/cjs/chakra/components/Link/Link.js.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts +0 -12
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.stories.js +0 -42
- package/lib/cjs/chakra/components/Link/Link.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.d.ts +0 -6
- package/lib/cjs/chakra/components/Menu/Menu.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.js +0 -21
- package/lib/cjs/chakra/components/Menu/Menu.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts +0 -9
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.stories.js +0 -48
- package/lib/cjs/chakra/components/Menu/Menu.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts +0 -4
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.theme.js +0 -23
- package/lib/cjs/chakra/components/Menu/Menu.theme.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts +0 -12
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/MenuItem.js +0 -39
- package/lib/cjs/chakra/components/Menu/MenuItem.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts +0 -16
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js +0 -36
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js +0 -44
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js +0 -47
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.d.ts +0 -32
- package/lib/cjs/chakra/components/Text/Text.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.js +0 -38
- package/lib/cjs/chakra/components/Text/Text.js.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts +0 -12
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.stories.js +0 -42
- package/lib/cjs/chakra/components/Text/Text.stories.js.map +0 -1
- package/lib/cjs/chakra/shared.d.ts +0 -2
- package/lib/cjs/chakra/shared.d.ts.map +0 -1
- package/lib/cjs/chakra/shared.js +0 -15
- package/lib/cjs/chakra/shared.js.map +0 -1
- package/lib/cjs/chakra/theme/theme.d.ts +0 -3
- package/lib/cjs/chakra/theme/theme.d.ts.map +0 -1
- package/lib/cjs/chakra/theme/theme.js +0 -54
- package/lib/cjs/chakra/theme/theme.js.map +0 -1
- package/lib/cjs/chakra/theme/typographyConfig.d.ts +0 -4
- package/lib/cjs/chakra/theme/typographyConfig.d.ts.map +0 -1
- package/lib/cjs/chakra/theme/typographyConfig.js +0 -38
- package/lib/cjs/chakra/theme/typographyConfig.js.map +0 -1
- package/lib/esn/chakra/BitkitProvider.d.ts +0 -5
- package/lib/esn/chakra/BitkitProvider.d.ts.map +0 -1
- package/lib/esn/chakra/BitkitProvider.js +0 -8
- package/lib/esn/chakra/BitkitProvider.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.d.ts +0 -22
- package/lib/esn/chakra/components/Button/Button.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.js +0 -34
- package/lib/esn/chakra/components/Button/Button.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.stories.d.ts +0 -6
- package/lib/esn/chakra/components/Button/Button.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.stories.js +0 -29
- package/lib/esn/chakra/components/Button/Button.stories.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.theme.d.ts +0 -117
- package/lib/esn/chakra/components/Button/Button.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.theme.js +0 -117
- package/lib/esn/chakra/components/Button/Button.theme.js.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts +0 -14
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.js +0 -18
- package/lib/esn/chakra/components/IconButton/IconButton.js.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js +0 -21
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js.map +0 -1
- package/lib/esn/chakra/components/Link/Link.d.ts +0 -16
- package/lib/esn/chakra/components/Link/Link.d.ts.map +0 -1
- package/lib/esn/chakra/components/Link/Link.js +0 -17
- package/lib/esn/chakra/components/Link/Link.js.map +0 -1
- package/lib/esn/chakra/components/Link/Link.stories.d.ts +0 -12
- package/lib/esn/chakra/components/Link/Link.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Link/Link.stories.js +0 -16
- package/lib/esn/chakra/components/Link/Link.stories.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.d.ts +0 -6
- package/lib/esn/chakra/components/Menu/Menu.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.js +0 -5
- package/lib/esn/chakra/components/Menu/Menu.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts +0 -9
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.stories.js +0 -39
- package/lib/esn/chakra/components/Menu/Menu.stories.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts +0 -4
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.theme.js +0 -21
- package/lib/esn/chakra/components/Menu/Menu.theme.js.map +0 -1
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts +0 -12
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/MenuItem.js +0 -12
- package/lib/esn/chakra/components/Menu/MenuItem.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts +0 -16
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.js +0 -30
- package/lib/esn/chakra/components/StatusTag/StatusTag.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js +0 -16
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js +0 -45
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
- package/lib/esn/chakra/components/Text/Text.d.ts +0 -32
- package/lib/esn/chakra/components/Text/Text.d.ts.map +0 -1
- package/lib/esn/chakra/components/Text/Text.js +0 -22
- package/lib/esn/chakra/components/Text/Text.js.map +0 -1
- package/lib/esn/chakra/components/Text/Text.stories.d.ts +0 -12
- package/lib/esn/chakra/components/Text/Text.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Text/Text.stories.js +0 -19
- package/lib/esn/chakra/components/Text/Text.stories.js.map +0 -1
- package/lib/esn/chakra/shared.d.ts +0 -2
- package/lib/esn/chakra/shared.d.ts.map +0 -1
- package/lib/esn/chakra/shared.js +0 -11
- package/lib/esn/chakra/shared.js.map +0 -1
- package/lib/esn/chakra/theme/theme.d.ts +0 -3
- package/lib/esn/chakra/theme/theme.d.ts.map +0 -1
- package/lib/esn/chakra/theme/theme.js +0 -49
- package/lib/esn/chakra/theme/theme.js.map +0 -1
- package/lib/esn/chakra/theme/typographyConfig.d.ts +0 -4
- package/lib/esn/chakra/theme/typographyConfig.d.ts.map +0 -1
- package/lib/esn/chakra/theme/typographyConfig.js +0 -36
- package/lib/esn/chakra/theme/typographyConfig.js.map +0 -1
- package/src/chakra/BitkitProvider.tsx +0 -9
- package/src/chakra/components/Button/Button.stories.tsx +0 -32
- package/src/chakra/components/Button/Button.theme.ts +0 -117
- package/src/chakra/components/Button/Button.tsx +0 -52
- package/src/chakra/components/IconButton/IconButton.stories.tsx +0 -24
- package/src/chakra/components/IconButton/IconButton.tsx +0 -29
- package/src/chakra/components/Link/Link.stories.tsx +0 -19
- package/src/chakra/components/Link/Link.tsx +0 -30
- package/src/chakra/components/Menu/Menu.stories.tsx +0 -57
- package/src/chakra/components/Menu/Menu.theme.ts +0 -23
- package/src/chakra/components/Menu/Menu.tsx +0 -8
- package/src/chakra/components/Menu/MenuItem.tsx +0 -20
- package/src/chakra/components/StatusTag/StatusTag.stories.tsx +0 -19
- package/src/chakra/components/StatusTag/StatusTag.theme.ts +0 -45
- package/src/chakra/components/StatusTag/StatusTag.tsx +0 -55
- package/src/chakra/components/Text/Text.stories.tsx +0 -22
- package/src/chakra/components/Text/Text.tsx +0 -73
- package/src/chakra/shared.ts +0 -11
- package/src/chakra/theme/theme.ts +0 -50
- package/src/chakra/theme/typographyConfig.ts +0 -38
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/* eslint-disable react/default-props-match-prop-types */
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import { Placement as TypePlacement
|
|
4
|
+
import { Placement as TypePlacement } from '@popperjs/core';
|
|
4
5
|
import { Popper, PopperProps } from 'react-popper';
|
|
5
6
|
import { CSSTransition } from 'react-transition-group';
|
|
6
7
|
import classnames from 'classnames';
|
|
@@ -27,15 +28,14 @@ const transitionClasses = {
|
|
|
27
28
|
|
|
28
29
|
export interface Props extends BaseProps {
|
|
29
30
|
animatePosition?: boolean;
|
|
30
|
-
children: (props: {
|
|
31
|
+
children: (props: { update: () => void; width?: number }) => React.ReactNode;
|
|
31
32
|
closeElement?: null | HTMLElement;
|
|
32
|
-
disableMargin?: boolean | 'top-bottom' | 'left-right';
|
|
33
33
|
disableReposition?: boolean;
|
|
34
34
|
flip?: boolean;
|
|
35
35
|
isInsideModal?: boolean;
|
|
36
36
|
onClose?: (event: MouseEvent) => void;
|
|
37
37
|
placement?: TypePlacement;
|
|
38
|
-
referenceElement?:
|
|
38
|
+
referenceElement?: any;
|
|
39
39
|
visible?: boolean;
|
|
40
40
|
timeout?: number;
|
|
41
41
|
}
|
|
@@ -46,13 +46,13 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
46
46
|
backgroundColor,
|
|
47
47
|
children,
|
|
48
48
|
closeElement,
|
|
49
|
-
disableMargin,
|
|
50
49
|
disableReposition,
|
|
51
50
|
flip,
|
|
52
51
|
isInsideModal,
|
|
53
52
|
onClose,
|
|
54
53
|
placement: desiredPlacement,
|
|
55
54
|
referenceElement,
|
|
55
|
+
sameWidth,
|
|
56
56
|
visible,
|
|
57
57
|
timeout = transitionDurationFast,
|
|
58
58
|
...rest
|
|
@@ -71,7 +71,7 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
71
71
|
closeElement || document,
|
|
72
72
|
'click',
|
|
73
73
|
(event) => {
|
|
74
|
-
if (onClose && ref.current && !ref.current.contains(event.target as Node)) {
|
|
74
|
+
if (onClose && ref.current && !ref.current.contains(event.target as Node) && visible) {
|
|
75
75
|
onClose(event as MouseEvent);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
@@ -93,19 +93,36 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
preventOverflow: {
|
|
102
|
-
boundariesElement: 'window',
|
|
103
|
-
},
|
|
104
|
-
flip: {
|
|
105
|
-
behavior: 'flip',
|
|
106
|
-
enabled: flip,
|
|
96
|
+
const modifiers: any[] = [
|
|
97
|
+
{
|
|
98
|
+
name: 'offset',
|
|
99
|
+
options: {
|
|
100
|
+
offset: [0, 12],
|
|
107
101
|
},
|
|
108
102
|
},
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
if (sameWidth) {
|
|
106
|
+
modifiers.push({
|
|
107
|
+
enabled: true,
|
|
108
|
+
name: 'sameWidth',
|
|
109
|
+
phase: 'beforeWrite',
|
|
110
|
+
requires: ['computeStyles'],
|
|
111
|
+
fn: ({ state }: any) => {
|
|
112
|
+
// eslint-disable-next-line no-param-reassign
|
|
113
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
114
|
+
},
|
|
115
|
+
effect: ({ state }: any) => {
|
|
116
|
+
// eslint-disable-next-line no-param-reassign
|
|
117
|
+
state.elements.popper.style.width = `${state.elements.reference.getBoundingClientRect().width || 0}px`;
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const popperProps: PopperProps<any> = {
|
|
123
|
+
children: () => null,
|
|
124
|
+
placement: desiredPlacement,
|
|
125
|
+
modifiers,
|
|
109
126
|
};
|
|
110
127
|
|
|
111
128
|
if (referenceElement) {
|
|
@@ -116,37 +133,36 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
116
133
|
// eslint-disable-next-line no-return-assign
|
|
117
134
|
<Popper {...popperProps} innerRef={(el) => (ref.current = el || null)}>
|
|
118
135
|
{/* eslint-disable-next-line @typescript-eslint/no-shadow */}
|
|
119
|
-
{({ arrowProps, placement, ref,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
'Placement
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
)}
|
|
136
|
+
{({ arrowProps, placement, ref, update, style }) => {
|
|
137
|
+
return (
|
|
138
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
139
|
+
<PlacementArrowPropsContext.Provider value={{ ...arrowProps, backgroundColor }}>
|
|
140
|
+
<div
|
|
141
|
+
className={classnames('Placement', `Placement--${placement}`, {
|
|
142
|
+
'Placement--above-modal': isInsideModal,
|
|
143
|
+
'Placement--animate': animatePosition,
|
|
144
|
+
})}
|
|
145
|
+
ref={ref}
|
|
146
|
+
style={style}
|
|
147
|
+
>
|
|
148
|
+
<CSSTransition appear={visible} classNames={transitionClasses} in={visible} timeout={timeout}>
|
|
149
|
+
<div className="Placement__content">
|
|
150
|
+
<Base {...rest} backgroundColor={backgroundColor} className="Placement__shadow">
|
|
151
|
+
<PlacementManagerContext.Consumer>
|
|
152
|
+
{({ referenceNode }) =>
|
|
153
|
+
children({
|
|
154
|
+
update,
|
|
155
|
+
width: (referenceNode && referenceNode.clientWidth) || undefined,
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
</PlacementManagerContext.Consumer>
|
|
159
|
+
</Base>
|
|
160
|
+
</div>
|
|
161
|
+
</CSSTransition>
|
|
162
|
+
</div>
|
|
163
|
+
</PlacementArrowPropsContext.Provider>
|
|
164
|
+
);
|
|
165
|
+
}}
|
|
150
166
|
</Popper>,
|
|
151
167
|
document.body,
|
|
152
168
|
);
|
package/src/Tooltip/Tooltip.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReferenceChildrenProps } from 'react-popper';
|
|
3
|
-
import { Placement as TypePlacement } from '
|
|
3
|
+
import { Placement as TypePlacement } from '@popperjs/core';
|
|
4
4
|
import { Props as BaseProps } from '../Base/Base';
|
|
5
5
|
import Placement from '../Placement/Placement';
|
|
6
6
|
import PlacementArea from '../Placement/PlacementArea';
|
|
@@ -4,10 +4,30 @@ type HTMLElementOrDocumentOrWindow = HTMLElement | Document | Window;
|
|
|
4
4
|
interface HTMLElementOrDocumentOrWindowEventMap extends HTMLElementEventMap, DocumentEventMap, WindowEventMap {}
|
|
5
5
|
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
-
function useEventListener<E extends Window, K extends keyof WindowEventMap>(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
function useEventListener<E extends Window, K extends keyof WindowEventMap>(
|
|
8
|
+
el: E | null | undefined,
|
|
9
|
+
type: K,
|
|
10
|
+
handler: (evnt: WindowEventMap[K]) => void,
|
|
11
|
+
watch?: any[],
|
|
12
|
+
): void;
|
|
13
|
+
function useEventListener<E extends Document, K extends keyof DocumentEventMap>(
|
|
14
|
+
el: E | null | undefined,
|
|
15
|
+
type: K,
|
|
16
|
+
handler: (evt: DocumentEventMap[K]) => void,
|
|
17
|
+
watch?: any[],
|
|
18
|
+
): void;
|
|
19
|
+
function useEventListener<E extends HTMLElement, K extends keyof HTMLElementEventMap>(
|
|
20
|
+
el: E | null | undefined,
|
|
21
|
+
type: K,
|
|
22
|
+
handler: (evt: HTMLElementEventMap[K]) => void,
|
|
23
|
+
watch?: any[],
|
|
24
|
+
): void;
|
|
25
|
+
function useEventListener<K extends keyof HTMLElementOrDocumentOrWindowEventMap>(
|
|
26
|
+
el: HTMLElementOrDocumentOrWindow,
|
|
27
|
+
type: string,
|
|
28
|
+
handler: (evt: HTMLElementOrDocumentOrWindowEventMap[K]) => void,
|
|
29
|
+
watch?: any[],
|
|
30
|
+
): void;
|
|
11
31
|
function useEventListener(el: any, type: string, handler: any, watch?: any[]) {
|
|
12
32
|
useEffect(() => {
|
|
13
33
|
if (el) {
|
|
@@ -20,6 +40,6 @@ function useEventListener(el: any, type: string, handler: any, watch?: any[]) {
|
|
|
20
40
|
}
|
|
21
41
|
};
|
|
22
42
|
}, watch || []);
|
|
23
|
-
}
|
|
43
|
+
}
|
|
24
44
|
|
|
25
45
|
export default useEventListener;
|
package/src/index.ts
CHANGED
|
@@ -106,13 +106,3 @@ export { default as Toggle, Props as ToggleProps } from './Toggle/Toggle';
|
|
|
106
106
|
export { default as Tooltip, Props as TooltipProps } from './Tooltip/Tooltip';
|
|
107
107
|
export { default as Visibility, Props as VisibilityProps } from './Visibility/Visibility';
|
|
108
108
|
export { default as VisibilityContainer, Props as VisibilityContainerProps } from './Visibility/VisibilityContainer';
|
|
109
|
-
|
|
110
|
-
export { default as BitkitProvider } from './chakra/BitkitProvider';
|
|
111
|
-
export { default as BitkitTheme } from './chakra/theme/theme';
|
|
112
|
-
export { default as NewButton, Props as NewButtonProps } from './chakra/components/Button/Button';
|
|
113
|
-
export { default as NewIconButton, Props as NewIconButtonProps } from './chakra/components/IconButton/IconButton';
|
|
114
|
-
export { default as NewLink, Props as NewLinkProps } from './chakra/components/Link/Link';
|
|
115
|
-
export { default as Menu, Props as MenuProps } from './chakra/components/Menu/Menu';
|
|
116
|
-
export { default as MenuItem, Props as MenuItemProps } from './chakra/components/Menu/MenuItem';
|
|
117
|
-
export { default as StatusTag, Props as StatusTagProps } from './chakra/components/StatusTag/StatusTag';
|
|
118
|
-
export { default as NewText, Props as NewTextProps } from './chakra/components/Text/Text';
|
package/tsconfig.json
CHANGED
|
@@ -12,14 +12,11 @@
|
|
|
12
12
|
"moduleResolution": "node",
|
|
13
13
|
"paths": {
|
|
14
14
|
"*": ["@types/*"],
|
|
15
|
-
"@": ["src"]
|
|
16
|
-
"@bitrise/bitkit": ["src"],
|
|
15
|
+
"@bitrise/bitkit": ["src"]
|
|
17
16
|
},
|
|
18
17
|
"resolveJsonModule": true,
|
|
19
18
|
"sourceMap": true,
|
|
20
19
|
"strict": true,
|
|
21
|
-
"target": "es5"
|
|
22
|
-
// https://github.com/chakra-ui/chakra-ui/issues/2955 :(
|
|
23
|
-
"skipLibCheck": true,
|
|
20
|
+
"target": "es5"
|
|
24
21
|
}
|
|
25
22
|
}
|
package/.storybook/main.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
core: {
|
|
5
|
-
builder: 'webpack5',
|
|
6
|
-
},
|
|
7
|
-
stories: [
|
|
8
|
-
"../src/**/*.stories.mdx",
|
|
9
|
-
"../src/**/*.stories.@(js|jsx|ts|tsx)"
|
|
10
|
-
],
|
|
11
|
-
addons: [
|
|
12
|
-
"@storybook/addon-links",
|
|
13
|
-
"@storybook/addon-essentials",
|
|
14
|
-
"@storybook/addon-interactions"
|
|
15
|
-
],
|
|
16
|
-
framework: "@storybook/react",
|
|
17
|
-
features: { emotionAlias: false },
|
|
18
|
-
refs: {
|
|
19
|
-
'@chakra-ui/react': { disable: true }
|
|
20
|
-
},
|
|
21
|
-
webpackFinal: async (config) => {
|
|
22
|
-
config.module.rules.push({
|
|
23
|
-
test: /\.mjs$/,
|
|
24
|
-
include: /node_modules/,
|
|
25
|
-
type: 'javascript/auto',
|
|
26
|
-
});
|
|
27
|
-
config.resolve.plugins = [
|
|
28
|
-
...(config.resolve.plugins || []),
|
|
29
|
-
new TsconfigPathsPlugin({
|
|
30
|
-
extensions: config.resolve.extensions,
|
|
31
|
-
}),
|
|
32
|
-
];
|
|
33
|
-
return config;
|
|
34
|
-
},
|
|
35
|
-
};
|
package/.storybook/preview.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import BitkitProvider from '../src/chakra/BitkitProvider';
|
|
2
|
-
import '../site/index.css'
|
|
3
|
-
|
|
4
|
-
export const decorators = [
|
|
5
|
-
(Story) => (
|
|
6
|
-
<BitkitProvider>
|
|
7
|
-
<Story />
|
|
8
|
-
</BitkitProvider>
|
|
9
|
-
),
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
export const parameters = {
|
|
13
|
-
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
14
|
-
controls: {
|
|
15
|
-
matchers: {
|
|
16
|
-
color: /(background|color)$/i,
|
|
17
|
-
date: /Date$/,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var react_2 = require("@chakra-ui/react");
|
|
8
|
-
var theme_1 = __importDefault(require("./theme/theme"));
|
|
9
|
-
var BitkitProvider = function (_a) {
|
|
10
|
-
var children = _a.children;
|
|
11
|
-
return react_1.default.createElement(react_2.ChakraProvider, { theme: theme_1.default }, children);
|
|
12
|
-
};
|
|
13
|
-
exports.default = BitkitProvider;
|
|
14
|
-
//# sourceMappingURL=BitkitProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitProvider.js","sourceRoot":"","sources":["../../../src/chakra/BitkitProvider.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAC1B,0CAAuE;AACvE,wDAAkC;AAElC,IAAM,cAAc,GAAG,UAAC,EAAiC;QAA/B,QAAQ,cAAA;IAChC,OAAO,8BAAC,sBAAc,IAAC,KAAK,EAAE,eAAK,IAAG,QAAQ,CAAkB,CAAC;AACnE,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
29
|
-
var react_1 = __importDefault(require("react"));
|
|
30
|
-
var react_2 = require("@chakra-ui/react");
|
|
31
|
-
var bitkit_1 = require("@bitrise/bitkit");
|
|
32
|
-
var Button = react_1.default.forwardRef(function (props, ref) {
|
|
33
|
-
var as = props.as, leftIconName = props.leftIconName, rightIconName = props.rightIconName, size = props.size, rest = __rest(props, ["as", "leftIconName", "rightIconName", "size"]);
|
|
34
|
-
var properties = __assign({ as: as, size: size }, rest);
|
|
35
|
-
if (leftIconName) {
|
|
36
|
-
properties.leftIcon = react_1.default.createElement(bitkit_1.Icon, { name: leftIconName });
|
|
37
|
-
}
|
|
38
|
-
if (rightIconName) {
|
|
39
|
-
properties.rightIcon = react_1.default.createElement(bitkit_1.Icon, { name: rightIconName });
|
|
40
|
-
}
|
|
41
|
-
if (leftIconName || rightIconName) {
|
|
42
|
-
properties.iconSpacing = size === 'medium' ? '10px' : '6px';
|
|
43
|
-
}
|
|
44
|
-
if (as === 'a') {
|
|
45
|
-
delete properties.type;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
/* @ts-ignore */
|
|
49
|
-
delete properties.href;
|
|
50
|
-
/* @ts-ignore */
|
|
51
|
-
delete properties.target;
|
|
52
|
-
}
|
|
53
|
-
return react_1.default.createElement(react_2.Button, __assign({ ref: ref }, properties));
|
|
54
|
-
});
|
|
55
|
-
Button.defaultProps = {
|
|
56
|
-
as: 'button',
|
|
57
|
-
size: 'medium',
|
|
58
|
-
variant: 'primary',
|
|
59
|
-
};
|
|
60
|
-
exports.default = Button;
|
|
61
|
-
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/chakra/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,gDAA0B;AAC1B,0CAAuE;AACvE,0CAAqD;AAmBrD,IAAM,MAAM,GAAG,eAAK,CAAC,UAAU,CAA2B,UAAC,KAAY,EAAE,GAAG;IAClE,IAAA,EAAE,GAAiD,KAAK,GAAtD,EAAE,YAAY,GAAmC,KAAK,aAAxC,EAAE,aAAa,GAAoB,KAAK,cAAzB,EAAE,IAAI,GAAc,KAAK,KAAnB,EAAK,IAAI,UAAK,KAAK,EAA1D,+CAAkD,CAAF,CAAW;IACjE,IAAM,UAAU,cAAkB,EAAE,IAAA,EAAE,IAAI,MAAA,IAAK,IAAI,CAAE,CAAC;IACtD,IAAI,YAAY,EAAE;QAChB,UAAU,CAAC,QAAQ,GAAG,8BAAC,aAAI,IAAC,IAAI,EAAE,YAAY,GAAI,CAAC;KACpD;IACD,IAAI,aAAa,EAAE;QACjB,UAAU,CAAC,SAAS,GAAG,8BAAC,aAAI,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,8BAAC,cAAY,aAAC,GAAG,EAAE,GAAG,IAAM,UAAU,EAAI,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,kBAAe,MAAM,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WithProps = void 0;
|
|
18
|
-
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var shared_1 = require("../../shared");
|
|
20
|
-
var tsx_1 = require("../../../Icon/tsx");
|
|
21
|
-
var Button_1 = __importDefault(require("./Button"));
|
|
22
|
-
exports.default = {
|
|
23
|
-
title: 'Components/Button',
|
|
24
|
-
component: Button_1.default,
|
|
25
|
-
argTypes: {
|
|
26
|
-
leftIconName: {
|
|
27
|
-
options: tsx_1.IconList,
|
|
28
|
-
},
|
|
29
|
-
rightIconName: {
|
|
30
|
-
options: tsx_1.IconList,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
var Template = function (props) { return react_1.default.createElement(Button_1.default, __assign({}, props)); };
|
|
35
|
-
exports.WithProps = Template.bind({});
|
|
36
|
-
exports.WithProps.args = (0, shared_1.sortObjectByKey)(__assign(__assign({}, Button_1.default.defaultProps), { as: 'button', className: '', isDisabled: false, href: '', target: '_self', type: 'button', children: 'Button' }));
|
|
37
|
-
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../../../src/chakra/components/Button/Button.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAE1B,uCAA+C;AAC/C,yCAA6C;AAC7C,oDAA8B;AAE9B,kBAAe;IACb,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,gBAAM;IACjB,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,OAAO,EAAE,cAAQ;SAClB;QACD,aAAa,EAAE;YACb,OAAO,EAAE,cAAQ;SAClB;KACF;CAC8B,CAAC;AAElC,IAAM,QAAQ,GAAkC,UAAC,KAAK,IAAK,OAAA,8BAAC,gBAAM,eAAK,KAAK,EAAI,EAArB,CAAqB,CAAC;AAEpE,QAAA,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,iBAAS,CAAC,IAAI,GAAG,IAAA,wBAAe,wBAC3B,gBAAM,CAAC,YAAY,KACtB,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,EAAE,EACb,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,EAAE,EACR,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,QAAQ,IAClB,CAAC"}
|
|
@@ -1,117 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|