@bitrise/bitkit-v2 0.3.78 → 0.3.80

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.
@@ -1,24 +1,24 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as t } from "react/jsx-runtime";
2
2
  import { useRecipe as l, chakra as m } from "@chakra-ui/react/styled-system";
3
3
  import { forwardRef as c } from "react";
4
4
  import n from "../../icons/16x16/IconCross16.js";
5
- import p from "../../icons/24x24/IconCross24.js";
6
- import f from "../BitkitTooltip/BitkitTooltip.js";
7
- const u = c((i, s) => {
8
- const { "aria-label": t = "Close", size: r, ...e } = i, a = l({ key: "closeButton" });
9
- return /* @__PURE__ */ o(f, { showArrow: !1, size: "sm", text: t, children: /* @__PURE__ */ o(
5
+ import d from "../../icons/24x24/IconCross24.js";
6
+ import p from "../BitkitTooltip/BitkitTooltip.js";
7
+ const f = c((i, s) => {
8
+ const { "aria-label": r = "Close", size: e, ...o } = i, a = l({ key: "closeButton" });
9
+ return /* @__PURE__ */ t(p, { disabled: o.disabled, showArrow: !1, size: "sm", text: r, children: /* @__PURE__ */ t(
10
10
  m.button,
11
11
  {
12
12
  ref: s,
13
- "aria-label": t,
14
- ...e,
15
- css: a({ size: r }),
16
- color: e.colorPalette === "neutral" ? "icon/primary" : void 0,
17
- children: r === "xs" ? /* @__PURE__ */ o(n, {}) : /* @__PURE__ */ o(p, {})
13
+ "aria-label": r,
14
+ ...o,
15
+ css: a({ size: e }),
16
+ color: o.colorPalette === "neutral" && !o.disabled ? "icon/primary" : void 0,
17
+ children: e === "xs" ? /* @__PURE__ */ t(n, {}) : /* @__PURE__ */ t(d, {})
18
18
  }
19
19
  ) });
20
20
  });
21
- u.displayName = "BitkitCloseButton";
21
+ f.displayName = "BitkitCloseButton";
22
22
  export {
23
- u as default
23
+ f as default
24
24
  };
@@ -0,0 +1,10 @@
1
+ import { TagRootProps } from '@chakra-ui/react/tag';
2
+ import { ReactNode } from 'react';
3
+ export interface BitkitTagProps extends TagRootProps {
4
+ icon?: ReactNode;
5
+ labelText: string;
6
+ onRemove?: () => void;
7
+ state?: 'disabled' | 'skeleton';
8
+ }
9
+ declare const BitkitTag: (props: BitkitTagProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default BitkitTag;
@@ -0,0 +1,24 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { Skeleton as m } from "@chakra-ui/react/skeleton";
3
+ import { Tag as t } from "@chakra-ui/react/tag";
4
+ import h from "../BitkitCloseButton/BitkitCloseButton.js";
5
+ const g = (a) => {
6
+ const { labelText: n, icon: l, onRemove: r, state: d, ...o } = a, i = d === "skeleton", s = !!o.disabled || d === "disabled";
7
+ return /* @__PURE__ */ c(t.Root, { ...o, disabled: s, children: [
8
+ !!l && /* @__PURE__ */ e(t.StartElement, { asChild: !0, children: l }),
9
+ /* @__PURE__ */ e(m, { loading: i, height: i ? "8" : void 0, overflow: "hidden", borderRadius: "0", children: /* @__PURE__ */ e(t.Label, { children: n }) }),
10
+ !!r && /* @__PURE__ */ e(t.EndElement, { asChild: !0, children: /* @__PURE__ */ e(
11
+ h,
12
+ {
13
+ disabled: s || i,
14
+ size: "xs",
15
+ "aria-label": "Remove tag",
16
+ colorPalette: o.colorPalette,
17
+ onClick: r
18
+ }
19
+ ) })
20
+ ] });
21
+ };
22
+ export {
23
+ g as default
24
+ };
@@ -1,7 +1,7 @@
1
1
  import { FieldRootProps } from '@chakra-ui/react/field';
2
2
  import { InputProps } from '@chakra-ui/react/input';
3
3
  import { BitkitFieldProps } from '../BitkitField/BitkitField';
4
- export interface BitkitTextFieldProps extends FieldRootProps {
4
+ export interface BitkitTextInputProps extends FieldRootProps {
5
5
  counter?: boolean;
6
6
  errorText?: BitkitFieldProps['errorText'];
7
7
  helperText?: BitkitFieldProps['helperText'];
@@ -15,5 +15,5 @@ export interface BitkitTextFieldProps extends FieldRootProps {
15
15
  tooltip?: BitkitFieldProps['tooltip'];
16
16
  warningText?: BitkitFieldProps['warningText'];
17
17
  }
18
- declare const BitkitTextField: import('react').ForwardRefExoticComponent<BitkitTextFieldProps & import('react').RefAttributes<HTMLDivElement>>;
19
- export default BitkitTextField;
18
+ declare const BitkitTextInput: import('react').ForwardRefExoticComponent<BitkitTextInputProps & import('react').RefAttributes<HTMLDivElement>>;
19
+ export default BitkitTextInput;
@@ -0,0 +1,62 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Input as T } from "@chakra-ui/react/input";
3
+ import { InputGroup as E } from "@chakra-ui/react/input-group";
4
+ import { forwardRef as b } from "react";
5
+ import k from "../../icons/16x16/IconErrorCircleFilled16.js";
6
+ import y from "../../icons/16x16/IconWarningYellow16.js";
7
+ import B from "../../icons/24x24/IconErrorCircleFilled24.js";
8
+ import F from "../../icons/24x24/IconWarningYellow24.js";
9
+ import { rem as c } from "../../theme/themeUtils.js";
10
+ import W from "../BitkitField/BitkitField.js";
11
+ const C = b((d, p) => {
12
+ const {
13
+ counter: s,
14
+ errorText: l,
15
+ helperText: g,
16
+ inputProps: n,
17
+ label: f,
18
+ maxLength: e,
19
+ optional: u,
20
+ placeholder: I,
21
+ size: o,
22
+ state: i,
23
+ tooltip: v,
24
+ warningText: a,
25
+ ...x
26
+ } = d, h = i === "warning" || !!a, m = i === "error" || !!l;
27
+ let t;
28
+ m ? t = o === "lg" ? /* @__PURE__ */ r(B, { color: "icon/negative" }) : /* @__PURE__ */ r(k, { color: "icon/negative" }) : h && (t = o === "lg" ? /* @__PURE__ */ r(F, { color: "icon/warning" }) : /* @__PURE__ */ r(y, { color: "icon/warning" }));
29
+ const w = s && e && n?.value !== void 0 ? `${n.value.toString().length}/${e}` : void 0;
30
+ return /* @__PURE__ */ r(
31
+ W,
32
+ {
33
+ counterText: w,
34
+ disabled: i === "disabled",
35
+ errorText: l,
36
+ helperText: g,
37
+ invalid: m,
38
+ label: f,
39
+ optional: u,
40
+ readOnly: i === "readOnly",
41
+ ref: p,
42
+ tooltip: v,
43
+ warningText: a,
44
+ ...x,
45
+ children: /* @__PURE__ */ r(
46
+ E,
47
+ {
48
+ endElement: t,
49
+ endElementProps: {
50
+ marginInlineEnd: o === "lg" ? c(15) : c(11)
51
+ },
52
+ width: "100%",
53
+ children: /* @__PURE__ */ r(T, { placeholder: I, size: o, maxLength: e, ...n })
54
+ }
55
+ )
56
+ }
57
+ );
58
+ });
59
+ C.displayName = "BitkitTextInput";
60
+ export {
61
+ C as default
62
+ };
@@ -1,9 +1,9 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import { useSwitchContext as i } from "@chakra-ui/react/switch";
3
3
  import n from "../../BitkitBadge/BitkitBadge.js";
4
4
  const d = ({ state: e, children: o }) => {
5
- const { checked: r } = i();
6
- return e === "readOnly" && r ? /* @__PURE__ */ t(n, { colorScheme: "green", variant: "subtle", children: "ON" }) : e === "readOnly" && !r ? /* @__PURE__ */ t(n, { colorScheme: "neutral", variant: "subtle", children: "OFF" }) : o;
5
+ const { checked: t } = i();
6
+ return e === "readOnly" && t ? /* @__PURE__ */ r(n, { colorPalette: "green", variant: "subtle", children: "ON" }) : e === "readOnly" && !t ? /* @__PURE__ */ r(n, { colorPalette: "neutral", variant: "subtle", children: "OFF" }) : o;
7
7
  };
8
8
  export {
9
9
  d as default
@@ -2,6 +2,7 @@ import { TooltipRootProps } from '@chakra-ui/react/tooltip';
2
2
  import { ReactNode } from 'react';
3
3
  export type BitkitTooltipProps = {
4
4
  children: ReactNode;
5
+ disabled?: TooltipRootProps['disabled'];
5
6
  placement?: NonNullable<TooltipRootProps['positioning']>['placement'];
6
7
  showArrow?: boolean;
7
8
  size?: TooltipRootProps['size'];
@@ -9,7 +10,7 @@ export type BitkitTooltipProps = {
9
10
  tooltipProps?: TooltipRootProps;
10
11
  };
11
12
  declare const BitkitTooltip: {
12
- ({ children, placement, showArrow, size, text, tooltipProps, }: BitkitTooltipProps): import("react/jsx-runtime").JSX.Element;
13
+ ({ children, disabled, placement, showArrow, size, text, tooltipProps, }: BitkitTooltipProps): import("react/jsx-runtime").JSX.Element;
13
14
  displayName: string;
14
15
  };
15
16
  export default BitkitTooltip;
@@ -1,20 +1,30 @@
1
1
  import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
2
  import { Tooltip as i } from "@chakra-ui/react/tooltip";
3
- const d = ({
3
+ const m = ({
4
4
  children: r,
5
- placement: e = "top",
6
- showArrow: s = !0,
7
- size: n = "md",
8
- text: l,
9
- tooltipProps: p
10
- }) => /* @__PURE__ */ t(i.Root, { positioning: { placement: e, offset: { mainAxis: 8, crossAxis: 0 } }, size: n, ...p, children: [
11
- /* @__PURE__ */ o(i.Trigger, { asChild: !0, children: r }),
12
- /* @__PURE__ */ o(i.Positioner, { children: /* @__PURE__ */ t(i.Content, { children: [
13
- s && /* @__PURE__ */ o(i.Arrow, { children: /* @__PURE__ */ o(i.ArrowTip, {}) }),
14
- l
15
- ] }) })
16
- ] });
17
- d.displayName = "BitkitTooltip";
5
+ disabled: e,
6
+ placement: s = "top",
7
+ showArrow: n = !0,
8
+ size: l = "md",
9
+ text: p,
10
+ tooltipProps: d
11
+ }) => /* @__PURE__ */ t(
12
+ i.Root,
13
+ {
14
+ disabled: e,
15
+ positioning: { placement: s, offset: { mainAxis: 8, crossAxis: 0 } },
16
+ size: l,
17
+ ...d,
18
+ children: [
19
+ /* @__PURE__ */ o(i.Trigger, { asChild: !0, children: r }),
20
+ /* @__PURE__ */ o(i.Positioner, { children: /* @__PURE__ */ t(i.Content, { children: [
21
+ n && /* @__PURE__ */ o(i.Arrow, { children: /* @__PURE__ */ o(i.ArrowTip, {}) }),
22
+ p
23
+ ] }) })
24
+ ]
25
+ }
26
+ );
27
+ m.displayName = "BitkitTooltip";
18
28
  export {
19
- d as default
29
+ m as default
20
30
  };
@@ -10,6 +10,7 @@ export { default as BitkitInteractiveTooltip, type BitkitInteractiveTooltipProps
10
10
  export { default as BitkitNumberInput, type BitkitNumberInputProps } from './BitkitNumberInput/BitkitNumberInput';
11
11
  export { default as BitkitSelect, type BitkitSelectProps } from './BitkitSelect/BitkitSelect';
12
12
  export { default as BitkitTabs } from './BitkitTabs/BitkitTabs';
13
- export { default as BitkitTextField, type BitkitTextFieldProps } from './BitkitTextField/BitkitTextField';
13
+ export { default as BitkitTag, type BitkitTagProps } from './BitkitTag/BitkitTag';
14
+ export { default as BitkitTextInput, type BitkitTextInputProps } from './BitkitTextInput/BitkitTextInput';
14
15
  export { default as BitkitToggle, type BitkitToggleProps } from './BitkitToggle';
15
16
  export { default as BitkitTooltip, type BitkitTooltipProps } from './BitkitTooltip/BitkitTooltip';