@bitrise/bitkit-v2 0.3.152 → 0.3.154

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.
@@ -0,0 +1,24 @@
1
+ import { Dialog } from '@chakra-ui/react/dialog';
2
+ import { ReactNode } from 'react';
3
+ export interface BitkitDialogProps {
4
+ label?: string;
5
+ maxHeight?: string;
6
+ onOpenChange?: (details: {
7
+ open: boolean;
8
+ }) => void;
9
+ open?: boolean;
10
+ preventScroll?: boolean;
11
+ scrollBehavior?: 'inside' | 'outside';
12
+ showScrollGradient?: boolean;
13
+ size?: 'sm' | 'md' | 'lg';
14
+ title: ReactNode;
15
+ trigger?: ReactNode;
16
+ children?: ReactNode;
17
+ }
18
+ declare const BitkitDialog: {
19
+ ({ label, maxHeight, onOpenChange, open, title, trigger, children, preventScroll, scrollBehavior, showScrollGradient, size, }: BitkitDialogProps): import("react/jsx-runtime").JSX.Element;
20
+ displayName: string;
21
+ };
22
+ export declare const BitkitDialogActionTrigger: import('react').ForwardRefExoticComponent<Dialog.ActionTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
23
+ export declare const BitkitDialogFooter: import('react').ForwardRefExoticComponent<Dialog.FooterProps & import('react').RefAttributes<HTMLDivElement>>;
24
+ export default BitkitDialog;
@@ -0,0 +1,50 @@
1
+ import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
+ import { Dialog as i } from "@chakra-ui/react/dialog";
3
+ import { Portal as f } from "@chakra-ui/react/portal";
4
+ import k from "./BitkitDialogContent.js";
5
+ import D from "./BitkitDialogRoot.js";
6
+ const h = ({
7
+ label: e,
8
+ maxHeight: l,
9
+ onOpenChange: m,
10
+ open: n,
11
+ title: d,
12
+ trigger: t,
13
+ children: p,
14
+ preventScroll: g,
15
+ scrollBehavior: r,
16
+ showScrollGradient: s,
17
+ size: c
18
+ }) => /* @__PURE__ */ a(
19
+ D,
20
+ {
21
+ open: n,
22
+ preventScroll: g,
23
+ scrollBehavior: r,
24
+ size: c,
25
+ onOpenChange: m,
26
+ children: [
27
+ t && /* @__PURE__ */ o(i.Trigger, { asChild: !0, children: t }),
28
+ /* @__PURE__ */ a(f, { children: [
29
+ /* @__PURE__ */ o(i.Backdrop, {}),
30
+ /* @__PURE__ */ o(i.Positioner, { children: /* @__PURE__ */ o(
31
+ k,
32
+ {
33
+ label: e,
34
+ maxHeight: l,
35
+ scrollBehavior: r,
36
+ showScrollGradient: s,
37
+ title: d,
38
+ children: p
39
+ }
40
+ ) })
41
+ ] })
42
+ ]
43
+ }
44
+ );
45
+ i.ActionTrigger;
46
+ i.Footer;
47
+ h.displayName = "BitkitDialog";
48
+ export {
49
+ h as default
50
+ };
@@ -0,0 +1,9 @@
1
+ import { Dialog } from '@chakra-ui/react/dialog';
2
+ interface DialogBodyContext {
3
+ scrollBehavior: 'inside' | 'outside';
4
+ showScrollGradient: boolean;
5
+ }
6
+ export type BitkitDialogBodyProps = Dialog.BodyProps;
7
+ export declare const DialogBodyContext: import('react').Context<DialogBodyContext>;
8
+ declare const BitkitDialogBody: (props: BitkitDialogBodyProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default BitkitDialogBody;
@@ -0,0 +1,53 @@
1
+ import { jsx as t, jsxs as u, Fragment as p } from "react/jsx-runtime";
2
+ import { Box as d } from "@chakra-ui/react/box";
3
+ import { Dialog as f, useDialogContext as y } from "@chakra-ui/react/dialog";
4
+ import { useSlotRecipe as g, chakra as S } from "@chakra-ui/react/styled-system";
5
+ import { useContext as m, createContext as v, useRef as x, useState as C, useCallback as D, useEffect as k } from "react";
6
+ import w from "../../icons/IconArrowDown.js";
7
+ const B = v({
8
+ scrollBehavior: "outside",
9
+ showScrollGradient: !0
10
+ }), R = ({ children: r, ...n }) => {
11
+ const { showScrollGradient: b } = m(B), c = g({ key: "dialog" })({}), { open: i } = y(), e = x(null), [h, a] = C(!1), s = D(() => {
12
+ const o = e.current;
13
+ if (!o) {
14
+ a(!1);
15
+ return;
16
+ }
17
+ const l = o.scrollTop >= o.scrollHeight - o.offsetHeight - 1;
18
+ a(!l);
19
+ }, []);
20
+ return k(() => {
21
+ const o = e.current;
22
+ if (!i || !o) return;
23
+ o.addEventListener("scroll", s);
24
+ const l = new ResizeObserver(s);
25
+ return l.observe(o), () => {
26
+ o.removeEventListener("scroll", s), l.disconnect();
27
+ };
28
+ }, [i, s]), /* @__PURE__ */ u(d, { css: c.scrollBody, children: [
29
+ /* @__PURE__ */ t(f.Body, { ref: e, ...n, children: r }),
30
+ h && /* @__PURE__ */ u(p, { children: [
31
+ b && /* @__PURE__ */ t(d, { css: c.scrollGradient }),
32
+ /* @__PURE__ */ t(
33
+ S.button,
34
+ {
35
+ "aria-label": "Scroll to bottom",
36
+ css: c.scrollButton,
37
+ type: "button",
38
+ onClick: () => {
39
+ e.current?.scrollTo({ top: e.current.scrollHeight, behavior: "smooth" });
40
+ },
41
+ children: /* @__PURE__ */ t(w, { color: "icon/tertiary", size: "16" })
42
+ }
43
+ )
44
+ ] })
45
+ ] });
46
+ }, I = (r) => {
47
+ const { scrollBehavior: n } = m(B);
48
+ return n === "inside" ? /* @__PURE__ */ t(R, { ...r }) : /* @__PURE__ */ t(f.Body, { ...r });
49
+ };
50
+ export {
51
+ B as DialogBodyContext,
52
+ I as default
53
+ };
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ export interface BitkitDialogContentProps {
3
+ label?: string;
4
+ maxHeight?: string;
5
+ scrollBehavior?: 'inside' | 'outside';
6
+ showScrollGradient?: boolean;
7
+ title: ReactNode;
8
+ children?: ReactNode;
9
+ }
10
+ declare const BitkitDialogContent: ({ label, maxHeight, title, scrollBehavior, showScrollGradient, children, }: BitkitDialogContentProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default BitkitDialogContent;
@@ -0,0 +1,29 @@
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { Box as m } from "@chakra-ui/react/box";
3
+ import { Dialog as i } from "@chakra-ui/react/dialog";
4
+ import { useSlotRecipe as a, chakra as p } from "@chakra-ui/react/styled-system";
5
+ import f from "../BitkitCloseButton/BitkitCloseButton.js";
6
+ import { DialogBodyContext as h } from "./BitkitDialogBody.js";
7
+ const D = ({
8
+ label: r,
9
+ maxHeight: t,
10
+ title: l,
11
+ scrollBehavior: n = "outside",
12
+ showScrollGradient: s = !0,
13
+ children: c
14
+ }) => {
15
+ const d = a({ key: "dialog" })({});
16
+ return /* @__PURE__ */ e(i.Content, { maxHeight: t, children: /* @__PURE__ */ o(h.Provider, { value: { scrollBehavior: n, showScrollGradient: s }, children: [
17
+ /* @__PURE__ */ o(i.Header, { children: [
18
+ /* @__PURE__ */ o(m, { display: "flex", flexDirection: "column", gap: "4", children: [
19
+ r && /* @__PURE__ */ e(p.p, { css: d.label, children: r }),
20
+ /* @__PURE__ */ e(i.Title, { children: l })
21
+ ] }),
22
+ /* @__PURE__ */ e(i.CloseTrigger, { asChild: !0, children: /* @__PURE__ */ e(f, { size: "md" }) })
23
+ ] }),
24
+ c
25
+ ] }) });
26
+ };
27
+ export {
28
+ D as default
29
+ };
@@ -0,0 +1,4 @@
1
+ import { Dialog } from '@chakra-ui/react/dialog';
2
+ export type BitkitDialogRootProps = Dialog.RootProps;
3
+ declare const BitkitDialogRoot: ({ closeOnInteractOutside, preventScroll, ...props }: BitkitDialogRootProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default BitkitDialogRoot;
@@ -0,0 +1,10 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Dialog as a } from "@chakra-ui/react/dialog";
3
+ const l = ({
4
+ closeOnInteractOutside: o = !1,
5
+ preventScroll: t = !0,
6
+ ...i
7
+ }) => /* @__PURE__ */ r(a.Root, { closeOnInteractOutside: o, preventScroll: t, ...i });
8
+ export {
9
+ l as default
10
+ };
@@ -0,0 +1,9 @@
1
+ import { HTMLChakraProps, RecipeProps } from '@chakra-ui/react/styled-system';
2
+ import { BitkitIconComponent } from '../../icons';
3
+ export interface BitkitLinkButtonProps extends Omit<HTMLChakraProps<'button'>, 'css' | 'disabled' | 'type'>, RecipeProps<'linkButton'> {
4
+ children: string;
5
+ state?: 'disabled';
6
+ suffixIcon?: BitkitIconComponent;
7
+ }
8
+ declare const BitkitLinkButton: import('react').ForwardRefExoticComponent<BitkitLinkButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
9
+ export default BitkitLinkButton;
@@ -0,0 +1,14 @@
1
+ import { jsxs as f, jsx as u } from "react/jsx-runtime";
2
+ import { useRecipe as d, chakra as l } from "@chakra-ui/react/styled-system";
3
+ import { forwardRef as p } from "react";
4
+ const k = p((e, o) => {
5
+ const { children: s, size: t, state: n, suffixIcon: i, ...r } = e, c = d({ key: "linkButton" }), a = t === "lg" ? "24" : "16";
6
+ return /* @__PURE__ */ f(l.button, { ref: o, ...r, css: c({ size: t }), disabled: n === "disabled", type: "button", children: [
7
+ s,
8
+ i && /* @__PURE__ */ u(i, { size: a })
9
+ ] });
10
+ });
11
+ k.displayName = "BitkitLinkButton";
12
+ export {
13
+ k as default
14
+ };
@@ -13,12 +13,17 @@ export { default as BitkitColorButton, type BitkitColorButtonProps } from './Bit
13
13
  export { default as BitkitCombobox, type BitkitComboboxProps } from './BitkitCombobox/BitkitCombobox';
14
14
  export { default as BitkitControlButton, type BitkitControlButtonProps, } from './BitkitControlButton/BitkitControlButton';
15
15
  export { default as BitkitDefinitionTooltip, type BitkitDefinitionTooltipProps, } from './BitkitDefinitionTooltip/BitkitDefinitionTooltip';
16
+ export { default as BitkitDialog, type BitkitDialogProps } from './BitkitDialog/BitkitDialog';
17
+ export { default as BitkitDialogBody, type BitkitDialogBodyProps } from './BitkitDialog/BitkitDialogBody';
18
+ export { default as BitkitDialogContent, type BitkitDialogContentProps } from './BitkitDialog/BitkitDialogContent';
19
+ export { default as BitkitDialogRoot, type BitkitDialogRootProps } from './BitkitDialog/BitkitDialogRoot';
16
20
  export { default as BitkitEmptyState, type BitkitEmptyStateProps } from './BitkitEmptyState/BitkitEmptyState';
17
21
  export { default as BitkitExpandableCard, type BitkitExpandableCardProps, } from './BitkitExpandableCard/BitkitExpandableCard';
18
22
  export { default as BitkitField, type BitkitFieldProps } from './BitkitField/BitkitField';
19
23
  export { default as BitkitIconButton, type BitkitIconButtonProps } from './BitkitIconButton/BitkitIconButton';
20
24
  export { default as BitkitInteractiveTooltip, type BitkitInteractiveTooltipProps, } from './BitkitInteractiveTooltip/BitkitInteractiveTooltip';
21
25
  export { default as BitkitLink, type BitkitLinkProps } from './BitkitLink/BitkitLink';
26
+ export { default as BitkitLinkButton, type BitkitLinkButtonProps } from './BitkitLinkButton/BitkitLinkButton';
22
27
  export { default as BitkitNativeSelect, type BitkitNativeSelectProps } from './BitkitNativeSelect/BitkitNativeSelect';
23
28
  export { default as BitkitNumberInput, type BitkitNumberInputProps } from './BitkitNumberInput/BitkitNumberInput';
24
29
  export { default as BitkitRadio, type BitkitRadioProps } from './BitkitRadio/BitkitRadio';