@bitrise/bitkit-v2 0.3.141 → 0.3.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BitkitControlButton/BitkitControlButton.d.ts +14 -0
- package/dist/components/BitkitControlButton/BitkitControlButton.js +23 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/main.js +576 -574
- package/dist/theme/recipes/ControlButton.recipe.d.ts +50 -0
- package/dist/theme/recipes/ControlButton.recipe.js +67 -0
- package/dist/theme/recipes/index.d.ts +49 -0
- package/dist/theme/recipes/index.js +18 -16
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
|
|
2
|
+
import { BitkitIconComponent } from '../../icons';
|
|
3
|
+
import { BitkitTooltipProps } from '../BitkitTooltip/BitkitTooltip';
|
|
4
|
+
type ControlButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
export interface BitkitControlButtonProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled' | 'size'> {
|
|
6
|
+
icon: BitkitIconComponent;
|
|
7
|
+
isDanger?: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
size?: ControlButtonSize;
|
|
10
|
+
state?: 'disabled' | 'skeleton';
|
|
11
|
+
tooltipProps?: Partial<Omit<BitkitTooltipProps, 'children' | 'text'>>;
|
|
12
|
+
}
|
|
13
|
+
declare const BitkitControlButton: import('react').ForwardRefExoticComponent<BitkitControlButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export default BitkitControlButton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton as d } from "@chakra-ui/react/skeleton";
|
|
3
|
+
import { useRecipe as f, chakra as k } from "@chakra-ui/react/styled-system";
|
|
4
|
+
import { forwardRef as u } from "react";
|
|
5
|
+
import x from "../BitkitTooltip/BitkitTooltip.js";
|
|
6
|
+
const B = u((r, n) => {
|
|
7
|
+
const { icon: s, isDanger: l, label: i, size: o = "sm", state: e, tooltipProps: a, ...c } = r, m = f({ key: "controlButton" }), p = o === "xxs" || o === "xs" ? "16" : "24";
|
|
8
|
+
return /* @__PURE__ */ t(x, { text: i, ...a, children: /* @__PURE__ */ t(
|
|
9
|
+
k.button,
|
|
10
|
+
{
|
|
11
|
+
ref: n,
|
|
12
|
+
"aria-label": i,
|
|
13
|
+
disabled: e === "disabled" || e === "skeleton",
|
|
14
|
+
...c,
|
|
15
|
+
css: m({ isDanger: l, size: o }),
|
|
16
|
+
children: /* @__PURE__ */ t(d, { loading: e === "skeleton", children: /* @__PURE__ */ t(s, { size: p }) })
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
});
|
|
20
|
+
B.displayName = "BitkitControlButton";
|
|
21
|
+
export {
|
|
22
|
+
B as default
|
|
23
|
+
};
|
|
@@ -11,6 +11,7 @@ export { default as BitkitCheckboxGroup, type BitkitCheckboxGroupProps, } from '
|
|
|
11
11
|
export { default as BitkitCloseButton, type BitkitCloseButtonProps } from './BitkitCloseButton/BitkitCloseButton';
|
|
12
12
|
export { default as BitkitColorButton, type BitkitColorButtonProps } from './BitkitColorButton/BitkitColorButton';
|
|
13
13
|
export { default as BitkitCombobox, type BitkitComboboxProps } from './BitkitCombobox/BitkitCombobox';
|
|
14
|
+
export { default as BitkitControlButton, type BitkitControlButtonProps, } from './BitkitControlButton/BitkitControlButton';
|
|
14
15
|
export { default as BitkitDefinitionTooltip, type BitkitDefinitionTooltipProps, } from './BitkitDefinitionTooltip/BitkitDefinitionTooltip';
|
|
15
16
|
export { default as BitkitEmptyState, type BitkitEmptyStateProps } from './BitkitEmptyState/BitkitEmptyState';
|
|
16
17
|
export { default as BitkitExpandableCard, type BitkitExpandableCardProps, } from './BitkitExpandableCard/BitkitExpandableCard';
|