@bitrise/bitkit-v2 0.3.118 → 0.3.120

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.
Files changed (26) hide show
  1. package/dist/components/BitkitCheckbox/BitkitCheckbox.d.ts +10 -3
  2. package/dist/components/BitkitCheckbox/BitkitCheckbox.js +17 -15
  3. package/dist/components/BitkitCheckboxGroup/BitkitCheckboxGroup.d.ts +2 -1
  4. package/dist/components/BitkitCheckboxGroup/BitkitCheckboxGroup.js +12 -9
  5. package/dist/components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.d.ts +1 -1
  6. package/dist/components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.js +17 -9
  7. package/dist/components/BitkitRadio/BitkitRadio.d.ts +17 -0
  8. package/dist/components/BitkitRadio/BitkitRadio.js +22 -0
  9. package/dist/components/BitkitRadioGroup/BitkitRadioGroup.d.ts +17 -0
  10. package/dist/components/BitkitRadioGroup/BitkitRadioGroup.js +40 -0
  11. package/dist/components/BitkitTooltip/BitkitTooltip.d.ts +3 -2
  12. package/dist/components/BitkitTooltip/BitkitTooltip.js +15 -13
  13. package/dist/components/index.d.ts +2 -0
  14. package/dist/main.js +1098 -1094
  15. package/dist/theme/recipes/Badge.recipe.d.ts +8 -0
  16. package/dist/theme/recipes/Badge.recipe.js +15 -2
  17. package/dist/theme/recipes/index.d.ts +8 -0
  18. package/dist/theme/slot-recipes/Checkbox.recipe.d.ts +30 -1
  19. package/dist/theme/slot-recipes/Checkbox.recipe.js +35 -4
  20. package/dist/theme/slot-recipes/Fieldset.recipe.js +7 -0
  21. package/dist/theme/slot-recipes/RadioGroup.recipe.d.ts +38 -0
  22. package/dist/theme/slot-recipes/RadioGroup.recipe.js +93 -0
  23. package/dist/theme/slot-recipes/Select.recipe.d.ts +1 -1
  24. package/dist/theme/slot-recipes/index.d.ts +68 -2
  25. package/dist/theme/slot-recipes/index.js +16 -14
  26. package/package.json +1 -1
@@ -1,8 +1,15 @@
1
1
  import { Checkbox } from '@chakra-ui/react/checkbox';
2
+ import { InputHTMLAttributes } from 'react';
2
3
  export type BitkitCheckboxProps = {
3
4
  helperText?: string;
4
- label: string;
5
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
6
+ labelText: string;
5
7
  state?: 'disabled' | 'readOnly' | 'skeleton';
6
- } & Omit<Checkbox.RootProps, 'disabled' | 'label' | 'readOnly'>;
7
- declare const BitkitCheckbox: (props: BitkitCheckboxProps) => import("react/jsx-runtime").JSX.Element;
8
+ } & Omit<Checkbox.RootProps, 'disabled' | 'readOnly'>;
9
+ declare const BitkitCheckbox: import('react').ForwardRefExoticComponent<{
10
+ helperText?: string;
11
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
12
+ labelText: string;
13
+ state?: "disabled" | "readOnly" | "skeleton";
14
+ } & Omit<Checkbox.RootProps, "disabled" | "readOnly"> & import('react').RefAttributes<HTMLInputElement>>;
8
15
  export default BitkitCheckbox;
@@ -1,20 +1,22 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
2
  import { Checkbox as o } from "@chakra-ui/react/checkbox";
3
- import { Skeleton as i } from "@chakra-ui/react/skeleton";
4
- import { Text as m } from "@chakra-ui/react/text";
5
- import s from "../../icons/24x24/IconCheck24.js";
6
- import a from "../../icons/24x24/IconMinus24.js";
7
- const u = (d) => {
8
- const { helperText: r, label: c, state: t, ...l } = d;
9
- return /* @__PURE__ */ n(o.Root, { disabled: t === "disabled", readOnly: t === "readOnly", ...l, children: [
10
- /* @__PURE__ */ e(o.HiddenInput, {}),
11
- /* @__PURE__ */ e(i, { loading: t === "skeleton", children: /* @__PURE__ */ e(o.Control, { children: l.checked === "indeterminate" ? /* @__PURE__ */ e(a, {}) : /* @__PURE__ */ e(s, {}) }) }),
12
- /* @__PURE__ */ e(i, { loading: t === "skeleton", children: /* @__PURE__ */ n(o.Label, { as: "div", children: [
13
- c,
14
- !!r && /* @__PURE__ */ e(m, { color: "text/helper", textStyle: "comp/input/helperText", children: r })
3
+ import { Skeleton as n } from "@chakra-ui/react/skeleton";
4
+ import { Text as a } from "@chakra-ui/react/text";
5
+ import { forwardRef as s } from "react";
6
+ import h from "../../icons/24x24/IconCheck24.js";
7
+ import x from "../../icons/24x24/IconMinus24.js";
8
+ const f = s((d, c) => {
9
+ const { helperText: r, inputProps: m, labelText: p, state: t, ...i } = d;
10
+ return /* @__PURE__ */ l(o.Root, { disabled: t === "disabled", readOnly: t === "readOnly", ...i, children: [
11
+ /* @__PURE__ */ e(o.HiddenInput, { ref: c, ...m }),
12
+ /* @__PURE__ */ e(n, { loading: t === "skeleton", children: /* @__PURE__ */ e(o.Control, { children: i.checked === "indeterminate" ? /* @__PURE__ */ e(x, {}) : /* @__PURE__ */ e(h, {}) }) }),
13
+ /* @__PURE__ */ e(n, { loading: t === "skeleton", children: /* @__PURE__ */ l(o.Label, { as: "div", children: [
14
+ p,
15
+ !!r && /* @__PURE__ */ e(a, { color: "text/helper", textStyle: "comp/input/helperText", children: r })
15
16
  ] }) })
16
17
  ] });
17
- };
18
+ });
19
+ f.displayName = "BitkitCheckbox";
18
20
  export {
19
- u as default
21
+ f as default
20
22
  };
@@ -4,11 +4,12 @@ import { ReactNode } from 'react';
4
4
  export interface BitkitCheckboxGroupProps extends Fieldset.RootProps {
5
5
  checkboxGroupProps?: CheckboxGroupProps;
6
6
  children: ReactNode;
7
+ errorText?: string;
7
8
  helperText?: string;
8
9
  label: string;
9
10
  name?: CheckboxGroupProps['name'];
10
11
  onValueChange: CheckboxGroupProps['onValueChange'];
11
12
  value: CheckboxGroupProps['value'];
12
13
  }
13
- declare const BitkitCheckboxGroup: (props: BitkitCheckboxGroupProps) => import("react/jsx-runtime").JSX.Element;
14
+ declare const BitkitCheckboxGroup: import('react').ForwardRefExoticComponent<BitkitCheckboxGroupProps & import('react').RefAttributes<HTMLFieldSetElement>>;
14
15
  export default BitkitCheckboxGroup;
@@ -1,14 +1,17 @@
1
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { CheckboxGroup as d } from "@chakra-ui/react/checkbox";
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { CheckboxGroup as s } from "@chakra-ui/react/checkbox";
3
3
  import { Fieldset as r } from "@chakra-ui/react/fieldset";
4
- const f = (t) => {
5
- const { checkboxGroupProps: l, children: n, helperText: o, label: i, name: c, onValueChange: a, value: p, ...h } = t;
6
- return /* @__PURE__ */ s(r.Root, { ...h, children: [
7
- /* @__PURE__ */ e(r.Legend, { children: i }),
8
- !!o && /* @__PURE__ */ e(r.HelperText, { children: o }),
9
- /* @__PURE__ */ e(r.Content, { display: "flex", flexDirection: "column", gap: "12", marginBlockStart: "12", asChild: !0, children: /* @__PURE__ */ e(d, { name: c, onValueChange: a, value: p, ...l, children: n }) })
4
+ import { forwardRef as u } from "react";
5
+ const f = u((l, n) => {
6
+ const { checkboxGroupProps: a, children: c, errorText: o, helperText: t, label: d, name: p, onValueChange: h, value: x, ...i } = l;
7
+ return /* @__PURE__ */ m(r.Root, { ref: n, ...i, invalid: i.invalid || !!o, children: [
8
+ /* @__PURE__ */ e(r.Legend, { children: d }),
9
+ !!t && /* @__PURE__ */ e(r.HelperText, { children: t }),
10
+ /* @__PURE__ */ e(r.Content, { display: "flex", flexDirection: "column", gap: "12", marginBlockStart: "12", asChild: !0, children: /* @__PURE__ */ e(s, { name: p, onValueChange: h, value: x, ...a, children: c }) }),
11
+ !!o && /* @__PURE__ */ e(r.ErrorText, { children: o })
10
12
  ] });
11
- };
13
+ });
14
+ f.displayName = "BitkitCheckboxGroup";
12
15
  export {
13
16
  f as default
14
17
  };
@@ -1,5 +1,5 @@
1
1
  import { BitkitTooltipProps } from '../BitkitTooltip/BitkitTooltip';
2
- export interface BitkitDefinitionTooltipProps extends Pick<BitkitTooltipProps, 'placement' | 'tooltipProps'> {
2
+ export interface BitkitDefinitionTooltipProps extends Pick<BitkitTooltipProps, 'placement' | 'tooltipRootProps'> {
3
3
  children: string;
4
4
  method?: 'click' | 'hover';
5
5
  text: string;
@@ -3,17 +3,25 @@ import { useRecipe as a, chakra as m } from "@chakra-ui/react/styled-system";
3
3
  import { useState as d } from "react";
4
4
  import f from "../BitkitTooltip/BitkitTooltip.js";
5
5
  const y = (r) => {
6
- const { children: n, method: t = "click", text: p, tooltipProps: i, ...c } = r, s = a({ key: "definitionTooltip" }), [o, l] = d(!1);
7
- return /* @__PURE__ */ e(f, { tooltipProps: t === "click" ? { ...i, open: o } : i, text: p, ...c, children: /* @__PURE__ */ e(
8
- m.button,
6
+ const { children: n, method: t = "click", text: p, tooltipRootProps: i, ...c } = r, s = a({ key: "definitionTooltip" }), [o, l] = d(!1);
7
+ return /* @__PURE__ */ e(
8
+ f,
9
9
  {
10
- "aria-expanded": o,
11
- css: s({ method: t }),
12
- onClick: t === "click" ? () => l(!o) : void 0,
13
- type: "button",
14
- children: n
10
+ tooltipRootProps: t === "click" ? { ...i, open: o } : i,
11
+ text: p,
12
+ ...c,
13
+ children: /* @__PURE__ */ e(
14
+ m.button,
15
+ {
16
+ "aria-expanded": o,
17
+ css: s({ method: t }),
18
+ onClick: t === "click" ? () => l(!o) : void 0,
19
+ type: "button",
20
+ children: n
21
+ }
22
+ )
15
23
  }
16
- ) });
24
+ );
17
25
  };
18
26
  export {
19
27
  y as default
@@ -0,0 +1,17 @@
1
+ import { RadioGroup } from '@chakra-ui/react/radio-group';
2
+ import { InputHTMLAttributes } from 'react';
3
+ export type BitkitRadioProps = {
4
+ badge?: 'off' | 'on';
5
+ helperText?: string;
6
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
7
+ labelText: string;
8
+ state?: 'disabled' | 'skeleton';
9
+ } & Omit<RadioGroup.ItemProps, 'disabled'>;
10
+ declare const BitkitRadio: import('react').ForwardRefExoticComponent<{
11
+ badge?: "off" | "on";
12
+ helperText?: string;
13
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
14
+ labelText: string;
15
+ state?: "disabled" | "skeleton";
16
+ } & Omit<RadioGroup.ItemProps, "disabled"> & import('react').RefAttributes<HTMLInputElement>>;
17
+ export default BitkitRadio;
@@ -0,0 +1,22 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { RadioGroup as r } from "@chakra-ui/react/radio-group";
3
+ import { Skeleton as i } from "@chakra-ui/react/skeleton";
4
+ import { Text as c } from "@chakra-ui/react/text";
5
+ import { forwardRef as h } from "react";
6
+ import x from "../BitkitBadge/BitkitBadge.js";
7
+ const f = h((n, a) => {
8
+ const { badge: o, helperText: d, inputProps: m, labelText: p, state: t, ...s } = n;
9
+ return /* @__PURE__ */ l(r.Item, { disabled: t === "disabled", ...s, children: [
10
+ /* @__PURE__ */ e(r.ItemHiddenInput, { ref: a, ...m }),
11
+ /* @__PURE__ */ e(i, { borderRadius: "50%", loading: t === "skeleton", children: /* @__PURE__ */ e(r.ItemIndicator, {}) }),
12
+ !!o && /* @__PURE__ */ e(i, { loading: t === "skeleton", children: /* @__PURE__ */ e(x, { colorPalette: o === "on" ? "green" : "neutral", width: "40", children: o }) }),
13
+ /* @__PURE__ */ e(i, { loading: t === "skeleton", children: /* @__PURE__ */ l(r.ItemText, { as: "div", children: [
14
+ p,
15
+ !!d && /* @__PURE__ */ e(c, { color: "text/helper", textStyle: "comp/input/helperText", children: d })
16
+ ] }) })
17
+ ] });
18
+ });
19
+ f.displayName = "BitkitRadio";
20
+ export {
21
+ f as default
22
+ };
@@ -0,0 +1,17 @@
1
+ import { Fieldset } from '@chakra-ui/react/fieldset';
2
+ import { RadioGroupRootProps } from '@chakra-ui/react/radio-group';
3
+ import { ReactNode } from 'react';
4
+ export interface BitkitRadioGroupProps extends Fieldset.RootProps {
5
+ children: ReactNode;
6
+ errorText?: string;
7
+ helperText?: string;
8
+ label: string;
9
+ layout?: RadioGroupRootProps['orientation'];
10
+ name?: RadioGroupRootProps['name'];
11
+ onValueChange: RadioGroupRootProps['onValueChange'];
12
+ radioGroupRootProps?: RadioGroupRootProps;
13
+ size?: RadioGroupRootProps['size'];
14
+ value: RadioGroupRootProps['value'];
15
+ }
16
+ declare const BitkitRadioGroup: import('react').ForwardRefExoticComponent<BitkitRadioGroupProps & import('react').RefAttributes<HTMLFieldSetElement>>;
17
+ export default BitkitRadioGroup;
@@ -0,0 +1,40 @@
1
+ import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
+ import { Fieldset as o } from "@chakra-ui/react/fieldset";
3
+ import { RadioGroup as x } from "@chakra-ui/react/radio-group";
4
+ import { forwardRef as R } from "react";
5
+ const G = R((a, l) => {
6
+ const {
7
+ children: n,
8
+ errorText: e,
9
+ helperText: t,
10
+ label: d,
11
+ layout: p,
12
+ name: s,
13
+ onValueChange: m,
14
+ radioGroupRootProps: u,
15
+ size: c,
16
+ value: h,
17
+ ...i
18
+ } = a;
19
+ return /* @__PURE__ */ f(o.Root, { ref: l, ...i, invalid: i.invalid || !!e, children: [
20
+ /* @__PURE__ */ r(o.Legend, { children: d }),
21
+ !!t && /* @__PURE__ */ r(o.HelperText, { children: t }),
22
+ /* @__PURE__ */ r(o.Content, { marginBlockStart: "12", asChild: !0, children: /* @__PURE__ */ r(
23
+ x.Root,
24
+ {
25
+ name: s,
26
+ size: c,
27
+ orientation: p,
28
+ onValueChange: m,
29
+ value: h,
30
+ ...u,
31
+ children: n
32
+ }
33
+ ) }),
34
+ !!e && /* @__PURE__ */ r(o.ErrorText, { children: e })
35
+ ] });
36
+ });
37
+ G.displayName = "BitkitRadioGroup";
38
+ export {
39
+ G as default
40
+ };
@@ -3,14 +3,15 @@ import { ReactNode } from 'react';
3
3
  export type BitkitTooltipProps = {
4
4
  children: ReactNode;
5
5
  disabled?: TooltipRootProps['disabled'];
6
+ ids?: TooltipRootProps['ids'];
6
7
  placement?: NonNullable<TooltipRootProps['positioning']>['placement'];
7
8
  showArrow?: boolean;
8
9
  size?: TooltipRootProps['size'];
9
10
  text: string;
10
- tooltipProps?: TooltipRootProps;
11
+ tooltipRootProps?: TooltipRootProps;
11
12
  };
12
13
  declare const BitkitTooltip: {
13
- ({ children, disabled, placement, showArrow, size, text, tooltipProps, }: BitkitTooltipProps): import("react/jsx-runtime").JSX.Element;
14
+ ({ children, disabled, ids, placement, showArrow, size, text, tooltipRootProps, }: BitkitTooltipProps): import("react/jsx-runtime").JSX.Element;
14
15
  displayName: string;
15
16
  };
16
17
  export default BitkitTooltip;
@@ -1,30 +1,32 @@
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 m = ({
3
+ const a = ({
4
4
  children: r,
5
5
  disabled: e,
6
- placement: s = "top",
7
- showArrow: n = !0,
8
- size: l = "md",
9
- text: p,
10
- tooltipProps: d
6
+ ids: s,
7
+ placement: n = "top",
8
+ showArrow: l = !0,
9
+ size: p = "md",
10
+ text: d,
11
+ tooltipRootProps: m
11
12
  }) => /* @__PURE__ */ t(
12
13
  i.Root,
13
14
  {
14
15
  disabled: e,
15
- positioning: { placement: s, offset: { mainAxis: 8, crossAxis: 0 } },
16
- size: l,
17
- ...d,
16
+ ids: s,
17
+ positioning: { placement: n, offset: { mainAxis: 8, crossAxis: 0 } },
18
+ size: p,
19
+ ...m,
18
20
  children: [
19
21
  /* @__PURE__ */ o(i.Trigger, { asChild: !0, children: r }),
20
22
  /* @__PURE__ */ o(i.Positioner, { children: /* @__PURE__ */ t(i.Content, { children: [
21
- n && /* @__PURE__ */ o(i.Arrow, { children: /* @__PURE__ */ o(i.ArrowTip, {}) }),
22
- p
23
+ l && /* @__PURE__ */ o(i.Arrow, { children: /* @__PURE__ */ o(i.ArrowTip, {}) }),
24
+ d
23
25
  ] }) })
24
26
  ]
25
27
  }
26
28
  );
27
- m.displayName = "BitkitTooltip";
29
+ a.displayName = "BitkitTooltip";
28
30
  export {
29
- m as default
31
+ a as default
30
32
  };
@@ -15,6 +15,8 @@ export { default as BitkitField, type BitkitFieldProps } from './BitkitField/Bit
15
15
  export { default as BitkitInteractiveTooltip, type BitkitInteractiveTooltipProps, } from './BitkitInteractiveTooltip/BitkitInteractiveTooltip';
16
16
  export { default as BitkitNativeSelect, type BitkitNativeSelectProps } from './BitkitNativeSelect/BitkitNativeSelect';
17
17
  export { default as BitkitNumberInput, type BitkitNumberInputProps } from './BitkitNumberInput/BitkitNumberInput';
18
+ export { default as BitkitRadio, type BitkitRadioProps } from './BitkitRadio/BitkitRadio';
19
+ export { default as BitkitRadioGroup, type BitkitRadioGroupProps } from './BitkitRadioGroup/BitkitRadioGroup';
18
20
  export { default as BitkitSelect, type BitkitSelectProps } from './BitkitSelect/BitkitSelect';
19
21
  export { default as BitkitSelectMenu, type BitkitSelectMenuProps } from './BitkitSelectMenu/BitkitSelectMenu';
20
22
  export { default as BitkitTabs } from './BitkitTabs/BitkitTabs';