@bitrise/bitkit-v2 0.3.358 → 0.3.359-beta.2314

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,6 +1,6 @@
1
1
  import { Checkbox } from '@chakra-ui/react/checkbox';
2
2
  import { DataAttr } from '@chakra-ui/react/styled-system';
3
- import { InputHTMLAttributes, ReactNode } from 'react';
3
+ import { InputHTMLAttributes, ReactElement, ReactNode, Ref } from 'react';
4
4
  type BitkitCheckboxBaseProps = {
5
5
  /** Props forwarded to the underlying `<input>` (e.g. `data-testid`). */
6
6
  inputProps?: InputHTMLAttributes<HTMLInputElement> & DataAttr;
@@ -12,13 +12,20 @@ type BitkitCheckboxBaseProps = {
12
12
  * select-all header — an `aria-label`, which is applied to the hidden input instead of being
13
13
  * rendered.
14
14
  */
15
- export type BitkitCheckboxProps = BitkitCheckboxBaseProps & ({
15
+ export type BitkitCheckboxProps<T extends NonNullable<ReactNode> = NonNullable<ReactNode>> = BitkitCheckboxBaseProps & ({
16
16
  helperText?: ReactNode;
17
- labelText: NonNullable<ReactNode>;
17
+ /**
18
+ * The visible label, which is where the checkbox gets its accessible name from. It has to be
19
+ * non-empty — an empty string is a compile error. When the layout has no room for a visible
20
+ * label, pass `aria-label` instead of an empty `labelText`.
21
+ */
22
+ labelText: T extends '' ? never : T;
18
23
  } | {
19
24
  'aria-label': string;
20
25
  helperText?: never;
21
26
  labelText?: null;
22
27
  });
23
- declare const BitkitCheckbox: import('react').ForwardRefExoticComponent<BitkitCheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
24
- export default BitkitCheckbox;
28
+ declare const _default: <T extends NonNullable<ReactNode>>(props: BitkitCheckboxProps<T> & {
29
+ ref?: Ref<HTMLInputElement>;
30
+ }) => ReactElement;
31
+ export default _default;
@@ -1,12 +1,12 @@
1
1
  import IconCheck from "../../icons/IconCheck.js";
2
2
  import IconMinus from "../../icons/IconMinus.js";
3
+ import { isEmptyNode } from "../../utilities/isEmptyNode.js";
3
4
  import { forwardRef } from "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { Text } from "@chakra-ui/react/text";
6
7
  import { Skeleton } from "@chakra-ui/react/skeleton";
7
8
  import { Checkbox } from "@chakra-ui/react/checkbox";
8
9
  //#region lib/components/BitkitCheckbox/BitkitCheckbox.tsx
9
- var isEmptyNode = (node) => node == null || node === "" || typeof node === "boolean";
10
10
  var BitkitCheckbox = forwardRef((props, ref) => {
11
11
  const { "aria-label": ariaLabel, helperText, inputProps, labelText, state, ...rest } = props;
12
12
  const hasHelperText = !isEmptyNode(helperText);
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitCheckbox.js","names":[],"sources":["../../../lib/components/BitkitCheckbox/BitkitCheckbox.tsx"],"sourcesContent":["import { Checkbox } from '@chakra-ui/react/checkbox';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { type DataAttr } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\n\nimport { IconCheck, IconMinus } from '../../icons';\n\ntype BitkitCheckboxBaseProps = {\n /** Props forwarded to the underlying `<input>` (e.g. `data-testid`). */\n inputProps?: InputHTMLAttributes<HTMLInputElement> & DataAttr;\n state?: 'disabled' | 'readOnly' | 'skeleton';\n} & Omit<Checkbox.RootProps, 'disabled' | 'readOnly'>;\n\n/**\n * A checkbox has to end up with an accessible name, and it takes that name from its label. So either\n * pass a visible `labelText`, or — for a checkbox in a layout with no room for one, like a table\n * select-all header — an `aria-label`, which is applied to the hidden input instead of being\n * rendered.\n */\nexport type BitkitCheckboxProps = BitkitCheckboxBaseProps &\n (\n | {\n helperText?: ReactNode;\n labelText: NonNullable<ReactNode>;\n }\n | { 'aria-label': string; helperText?: never; labelText?: null }\n );\n\nconst isEmptyNode = (node: ReactNode) => node == null || node === '' || typeof node === 'boolean';\n\nconst BitkitCheckbox = forwardRef<HTMLInputElement, BitkitCheckboxProps>((props, ref) => {\n const { 'aria-label': ariaLabel, helperText, inputProps, labelText, state, ...rest } = props;\n const hasHelperText = !isEmptyNode(helperText);\n const hasLabel = !isEmptyNode(labelText) || hasHelperText;\n\n // Skeleton has to set disabled to be inert: the Skeleton wrapper's own pointer-events: none never\n // stopped a click, it only moved the target to the <label>, which activates the control. The cursor\n // style prop then keeps the arrow plain — style props land outside @layer recipes, where the\n // recipe's _disabled: { cursor: 'not-allowed' } sits.\n return (\n <Checkbox.Root\n cursor={state === 'skeleton' ? 'default' : undefined}\n disabled={state === 'disabled' || state === 'skeleton'}\n readOnly={state === 'readOnly'}\n {...rest}\n >\n <Checkbox.HiddenInput aria-label={ariaLabel} ref={ref} {...inputProps} />\n <Skeleton loading={state === 'skeleton'}>\n <Checkbox.Control>{rest.checked === 'indeterminate' ? <IconMinus /> : <IconCheck />}</Checkbox.Control>\n </Skeleton>\n {hasLabel && (\n <Skeleton loading={state === 'skeleton'}>\n <Checkbox.Label as=\"div\">\n {labelText}\n {hasHelperText && (\n <Text color=\"text/helper\" textStyle=\"comp/input/helperText\">\n {helperText}\n </Text>\n )}\n </Checkbox.Label>\n </Skeleton>\n )}\n </Checkbox.Root>\n );\n});\n\nBitkitCheckbox.displayName = 'BitkitCheckbox';\n\nexport default BitkitCheckbox;\n"],"mappings":";;;;;;;;AA6BA,IAAM,eAAe,SAAoB,QAAQ,QAAQ,SAAS,MAAM,OAAO,SAAS;AAExF,IAAM,iBAAiB,YAAmD,OAAO,QAAQ;CACvF,MAAM,EAAE,cAAc,WAAW,YAAY,YAAY,WAAW,OAAO,GAAG,SAAS;CACvF,MAAM,gBAAgB,CAAC,YAAY,UAAU;CAC7C,MAAM,WAAW,CAAC,YAAY,SAAS,KAAK;CAM5C,OACE,qBAAC,SAAS,MAAV;EACE,QAAQ,UAAU,aAAa,YAAY,KAAA;EAC3C,UAAU,UAAU,cAAc,UAAU;EAC5C,UAAU,UAAU;EACpB,GAAI;EAJN,UAAA;GAME,oBAAC,SAAS,aAAV;IAAsB,cAAY;IAAgB;IAAK,GAAI;GAAa,CAAA;GACxE,oBAAC,UAAD;IAAU,SAAS,UAAU;IAC3B,UAAA,oBAAC,SAAS,SAAV,EAAA,UAAmB,KAAK,YAAY,kBAAkB,oBAAC,WAAD,CAAY,CAAA,IAAI,oBAAC,WAAD,CAAY,CAAA,EAAoB,CAAA;GAC9F,CAAA;GACT,YACC,oBAAC,UAAD;IAAU,SAAS,UAAU;IAC3B,UAAA,qBAAC,SAAS,OAAV;KAAgB,IAAG;KAAnB,UAAA,CACG,WACA,iBACC,oBAAC,MAAD;MAAM,OAAM;MAAc,WAAU;MACjC,UAAA;KACG,CAAA,CAEM;;GACR,CAAA;EAEC;;AAEnB,CAAC;AAED,eAAe,cAAc"}
1
+ {"version":3,"file":"BitkitCheckbox.js","names":[],"sources":["../../../lib/components/BitkitCheckbox/BitkitCheckbox.tsx"],"sourcesContent":["import { Checkbox } from '@chakra-ui/react/checkbox';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { type DataAttr } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type InputHTMLAttributes, type ReactElement, type ReactNode, type Ref } from 'react';\n\nimport { IconCheck, IconMinus } from '../../icons';\nimport { isEmptyNode } from '../../utilities/isEmptyNode';\n\ntype BitkitCheckboxBaseProps = {\n /** Props forwarded to the underlying `<input>` (e.g. `data-testid`). */\n inputProps?: InputHTMLAttributes<HTMLInputElement> & DataAttr;\n state?: 'disabled' | 'readOnly' | 'skeleton';\n} & Omit<Checkbox.RootProps, 'disabled' | 'readOnly'>;\n\n/**\n * A checkbox has to end up with an accessible name, and it takes that name from its label. So either\n * pass a visible `labelText`, or — for a checkbox in a layout with no room for one, like a table\n * select-all header — an `aria-label`, which is applied to the hidden input instead of being\n * rendered.\n */\nexport type BitkitCheckboxProps<T extends NonNullable<ReactNode> = NonNullable<ReactNode>> = BitkitCheckboxBaseProps &\n (\n | {\n helperText?: ReactNode;\n /**\n * The visible label, which is where the checkbox gets its accessible name from. It has to be\n * non-empty — an empty string is a compile error. When the layout has no room for a visible\n * label, pass `aria-label` instead of an empty `labelText`.\n */\n labelText: T extends '' ? never : T;\n }\n | { 'aria-label': string; helperText?: never; labelText?: null }\n );\n\nconst BitkitCheckbox = forwardRef<HTMLInputElement, BitkitCheckboxProps>((props, ref) => {\n const { 'aria-label': ariaLabel, helperText, inputProps, labelText, state, ...rest } = props;\n const hasHelperText = !isEmptyNode(helperText);\n const hasLabel = !isEmptyNode(labelText) || hasHelperText;\n\n // Skeleton has to set disabled to be inert: the Skeleton wrapper's own pointer-events: none never\n // stopped a click, it only moved the target to the <label>, which activates the control. The cursor\n // style prop then keeps the arrow plain — style props land outside @layer recipes, where the\n // recipe's _disabled: { cursor: 'not-allowed' } sits.\n return (\n <Checkbox.Root\n cursor={state === 'skeleton' ? 'default' : undefined}\n disabled={state === 'disabled' || state === 'skeleton'}\n readOnly={state === 'readOnly'}\n {...rest}\n >\n <Checkbox.HiddenInput aria-label={ariaLabel} ref={ref} {...inputProps} />\n <Skeleton loading={state === 'skeleton'}>\n <Checkbox.Control>{rest.checked === 'indeterminate' ? <IconMinus /> : <IconCheck />}</Checkbox.Control>\n </Skeleton>\n {hasLabel && (\n <Skeleton loading={state === 'skeleton'}>\n <Checkbox.Label as=\"div\">\n {labelText}\n {hasHelperText && (\n <Text color=\"text/helper\" textStyle=\"comp/input/helperText\">\n {helperText}\n </Text>\n )}\n </Checkbox.Label>\n </Skeleton>\n )}\n </Checkbox.Root>\n );\n});\n\nBitkitCheckbox.displayName = 'BitkitCheckbox';\n\n// The generic is what makes `labelText=\"\"` a compile error: `Exclude` cannot narrow `string` to\n// \"non-empty string\", but a conditional type on an inferred literal can. The cast carries the\n// generic through the call site, which `forwardRef`'s own signature would erase.\nexport default BitkitCheckbox as <T extends NonNullable<ReactNode>>(\n props: BitkitCheckboxProps<T> & { ref?: Ref<HTMLInputElement> },\n) => ReactElement;\n"],"mappings":";;;;;;;;;AAmCA,IAAM,iBAAiB,YAAmD,OAAO,QAAQ;CACvF,MAAM,EAAE,cAAc,WAAW,YAAY,YAAY,WAAW,OAAO,GAAG,SAAS;CACvF,MAAM,gBAAgB,CAAC,YAAY,UAAU;CAC7C,MAAM,WAAW,CAAC,YAAY,SAAS,KAAK;CAM5C,OACE,qBAAC,SAAS,MAAV;EACE,QAAQ,UAAU,aAAa,YAAY,KAAA;EAC3C,UAAU,UAAU,cAAc,UAAU;EAC5C,UAAU,UAAU;EACpB,GAAI;EAJN,UAAA;GAME,oBAAC,SAAS,aAAV;IAAsB,cAAY;IAAgB;IAAK,GAAI;GAAa,CAAA;GACxE,oBAAC,UAAD;IAAU,SAAS,UAAU;IAC3B,UAAA,oBAAC,SAAS,SAAV,EAAA,UAAmB,KAAK,YAAY,kBAAkB,oBAAC,WAAD,CAAY,CAAA,IAAI,oBAAC,WAAD,CAAY,CAAA,EAAoB,CAAA;GAC9F,CAAA;GACT,YACC,oBAAC,UAAD;IAAU,SAAS,UAAU;IAC3B,UAAA,qBAAC,SAAS,OAAV;KAAgB,IAAG;KAAnB,UAAA,CACG,WACA,iBACC,oBAAC,MAAD;MAAM,OAAM;MAAc,WAAU;MACjC,UAAA;KACG,CAAA,CAEM;;GACR,CAAA;EAEC;;AAEnB,CAAC;AAED,eAAe,cAAc"}
@@ -1,6 +1,6 @@
1
1
  import { RadioGroup } from '@chakra-ui/react/radio-group';
2
2
  import { DataAttr } from '@chakra-ui/react/styled-system';
3
- import { InputHTMLAttributes, ReactNode } from 'react';
3
+ import { InputHTMLAttributes, ReactElement, ReactNode, Ref } from 'react';
4
4
  /**
5
5
  * Passthrough attributes for the radio `<input>`. The RadioGroup machine owns the behavioral / state
6
6
  * attributes (`checked`, `value`, `name`, `type`, `disabled`, `onChange`, …), so they're excluded —
@@ -8,18 +8,30 @@ import { InputHTMLAttributes, ReactNode } from 'react';
8
8
  * things like `data-testid`.
9
9
  */
10
10
  type RadioInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'defaultChecked' | 'defaultValue' | 'disabled' | 'name' | 'onChange' | 'type' | 'value'> & DataAttr;
11
- export type BitkitRadioProps = {
11
+ type BitkitRadioBaseProps = {
12
12
  badge?: 'off' | 'on';
13
- helperText?: ReactNode;
14
13
  inputProps?: RadioInputProps;
15
- labelText: ReactNode;
16
14
  state?: 'disabled' | 'skeleton';
17
15
  } & Omit<RadioGroup.ItemProps, 'disabled'>;
18
- declare const BitkitRadio: import('react').ForwardRefExoticComponent<{
19
- badge?: "off" | "on";
16
+ /**
17
+ * A radio has to end up with an accessible name, and it takes that name from its label. So either
18
+ * pass a visible `labelText`, or — for a radio in a layout with no room for one, like a table row
19
+ * selector — an `aria-label`, which is applied to the hidden input instead of being rendered.
20
+ */
21
+ export type BitkitRadioProps<T extends NonNullable<ReactNode> = NonNullable<ReactNode>> = BitkitRadioBaseProps & ({
20
22
  helperText?: ReactNode;
21
- inputProps?: RadioInputProps;
22
- labelText: ReactNode;
23
- state?: "disabled" | "skeleton";
24
- } & Omit<RadioGroup.ItemProps, "disabled"> & import('react').RefAttributes<HTMLInputElement>>;
25
- export default BitkitRadio;
23
+ /**
24
+ * The visible label, which is where the radio gets its accessible name from. It has to be
25
+ * non-empty — an empty string is a compile error. When the layout has no room for a visible
26
+ * label, pass `aria-label` instead of an empty `labelText`.
27
+ */
28
+ labelText: T extends '' ? never : T;
29
+ } | {
30
+ 'aria-label': string;
31
+ helperText?: never;
32
+ labelText?: null;
33
+ });
34
+ declare const _default: <T extends NonNullable<ReactNode>>(props: BitkitRadioProps<T> & {
35
+ ref?: Ref<HTMLInputElement>;
36
+ }) => ReactElement;
37
+ export default _default;
@@ -1,4 +1,5 @@
1
1
  import BitkitBadge from "../BitkitBadge/BitkitBadge.js";
2
+ import { isEmptyNode } from "../../utilities/isEmptyNode.js";
2
3
  import { forwardRef } from "react";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { Text } from "@chakra-ui/react/text";
@@ -6,14 +7,17 @@ import { Skeleton } from "@chakra-ui/react/skeleton";
6
7
  import { RadioGroup, useRadioGroupStyles } from "@chakra-ui/react/radio-group";
7
8
  //#region lib/components/BitkitRadio/BitkitRadio.tsx
8
9
  var BitkitRadio = forwardRef((props, ref) => {
9
- const { badge, helperText, inputProps, labelText, state, ...rest } = props;
10
+ const { "aria-label": ariaLabel, badge, helperText, inputProps, labelText, state, ...rest } = props;
10
11
  const styles = useRadioGroupStyles();
12
+ const hasHelperText = !isEmptyNode(helperText);
13
+ const hasLabel = !isEmptyNode(labelText) || hasHelperText;
11
14
  return /* @__PURE__ */ jsxs(RadioGroup.Item, {
12
15
  cursor: state === "skeleton" ? "default" : void 0,
13
16
  disabled: state === "disabled" || state === "skeleton",
14
17
  ...rest,
15
18
  children: [
16
19
  /* @__PURE__ */ jsx(RadioGroup.ItemHiddenInput, {
20
+ "aria-label": ariaLabel,
17
21
  ref,
18
22
  ...inputProps
19
23
  }),
@@ -30,11 +34,11 @@ var BitkitRadio = forwardRef((props, ref) => {
30
34
  children: badge
31
35
  })
32
36
  }),
33
- /* @__PURE__ */ jsx(Skeleton, {
37
+ hasLabel && /* @__PURE__ */ jsx(Skeleton, {
34
38
  loading: state === "skeleton",
35
39
  children: /* @__PURE__ */ jsxs(RadioGroup.ItemText, {
36
40
  as: "div",
37
- children: [labelText, !!helperText && /* @__PURE__ */ jsx(Text, {
41
+ children: [labelText, hasHelperText && /* @__PURE__ */ jsx(Text, {
38
42
  color: state === "disabled" ? "text/disabled" : "text/helper",
39
43
  textStyle: "comp/input/helperText",
40
44
  children: helperText
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitRadio.js","names":[],"sources":["../../../lib/components/BitkitRadio/BitkitRadio.tsx"],"sourcesContent":["import { RadioGroup, useRadioGroupStyles } from '@chakra-ui/react/radio-group';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { type DataAttr } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\n\nimport BitkitBadge from '../BitkitBadge/BitkitBadge';\n\n/**\n * Passthrough attributes for the radio `<input>`. The RadioGroup machine owns the behavioral / state\n * attributes (`checked`, `value`, `name`, `type`, `disabled`, `onChange`, …), so they're excluded —\n * setting them here would let the input drift out of sync with its `RadioGroup.Item`. Keep it to\n * things like `data-testid`.\n */\ntype RadioInputProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'checked' | 'defaultChecked' | 'defaultValue' | 'disabled' | 'name' | 'onChange' | 'type' | 'value'\n> &\n DataAttr;\n\nexport type BitkitRadioProps = {\n badge?: 'off' | 'on';\n helperText?: ReactNode;\n inputProps?: RadioInputProps;\n labelText: ReactNode;\n state?: 'disabled' | 'skeleton';\n} & Omit<RadioGroup.ItemProps, 'disabled'>;\n\nconst BitkitRadio = forwardRef<HTMLInputElement, BitkitRadioProps>((props, ref) => {\n const { badge, helperText, inputProps, labelText, state, ...rest } = props;\n const styles = useRadioGroupStyles();\n\n // Skeleton has to set disabled to be inert: the Skeleton wrapper's own pointer-events: none never\n // stopped a click, it only moved the target to the <label>, which activates the control. The cursor\n // style prop then keeps the arrow plain — style props land outside @layer recipes, where the\n // recipe's _disabled: { cursor: 'not-allowed' } sits.\n return (\n <RadioGroup.Item\n cursor={state === 'skeleton' ? 'default' : undefined}\n disabled={state === 'disabled' || state === 'skeleton'}\n {...rest}\n >\n <RadioGroup.ItemHiddenInput ref={ref} {...inputProps} />\n <Skeleton borderRadius=\"50%\" loading={state === 'skeleton'}>\n <RadioGroup.ItemIndicator />\n </Skeleton>\n {!!badge && (\n <Skeleton loading={state === 'skeleton'}>\n <BitkitBadge colorVariant={badge === 'on' ? 'green' : 'neutral'} css={styles.badge}>\n {badge}\n </BitkitBadge>\n </Skeleton>\n )}\n <Skeleton loading={state === 'skeleton'}>\n <RadioGroup.ItemText as=\"div\">\n {labelText}\n {!!helperText && (\n <Text color={state === 'disabled' ? 'text/disabled' : 'text/helper'} textStyle=\"comp/input/helperText\">\n {helperText}\n </Text>\n )}\n </RadioGroup.ItemText>\n </Skeleton>\n </RadioGroup.Item>\n );\n});\n\nBitkitRadio.displayName = 'BitkitRadio';\n\nexport default BitkitRadio;\n"],"mappings":";;;;;;;AA4BA,IAAM,cAAc,YAAgD,OAAO,QAAQ;CACjF,MAAM,EAAE,OAAO,YAAY,YAAY,WAAW,OAAO,GAAG,SAAS;CACrE,MAAM,SAAS,oBAAoB;CAMnC,OACE,qBAAC,WAAW,MAAZ;EACE,QAAQ,UAAU,aAAa,YAAY,KAAA;EAC3C,UAAU,UAAU,cAAc,UAAU;EAC5C,GAAI;EAHN,UAAA;GAKE,oBAAC,WAAW,iBAAZ;IAAiC;IAAK,GAAI;GAAa,CAAA;GACvD,oBAAC,UAAD;IAAU,cAAa;IAAM,SAAS,UAAU;IAC9C,UAAA,oBAAC,WAAW,eAAZ,CAA2B,CAAA;GACnB,CAAA;GACT,CAAC,CAAC,SACD,oBAAC,UAAD;IAAU,SAAS,UAAU;IAC3B,UAAA,oBAAC,aAAD;KAAa,cAAc,UAAU,OAAO,UAAU;KAAW,KAAK,OAAO;KAC1E,UAAA;IACU,CAAA;GACL,CAAA;GAEZ,oBAAC,UAAD;IAAU,SAAS,UAAU;IAC3B,UAAA,qBAAC,WAAW,UAAZ;KAAqB,IAAG;KAAxB,UAAA,CACG,WACA,CAAC,CAAC,cACD,oBAAC,MAAD;MAAM,OAAO,UAAU,aAAa,kBAAkB;MAAe,WAAU;MAC5E,UAAA;KACG,CAAA,CAEW;;GACb,CAAA;EACK;;AAErB,CAAC;AAED,YAAY,cAAc"}
1
+ {"version":3,"file":"BitkitRadio.js","names":[],"sources":["../../../lib/components/BitkitRadio/BitkitRadio.tsx"],"sourcesContent":["import { RadioGroup, useRadioGroupStyles } from '@chakra-ui/react/radio-group';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { type DataAttr } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type InputHTMLAttributes, type ReactElement, type ReactNode, type Ref } from 'react';\n\nimport { isEmptyNode } from '../../utilities/isEmptyNode';\nimport BitkitBadge from '../BitkitBadge/BitkitBadge';\n\n/**\n * Passthrough attributes for the radio `<input>`. The RadioGroup machine owns the behavioral / state\n * attributes (`checked`, `value`, `name`, `type`, `disabled`, `onChange`, …), so they're excluded —\n * setting them here would let the input drift out of sync with its `RadioGroup.Item`. Keep it to\n * things like `data-testid`.\n */\ntype RadioInputProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'checked' | 'defaultChecked' | 'defaultValue' | 'disabled' | 'name' | 'onChange' | 'type' | 'value'\n> &\n DataAttr;\n\ntype BitkitRadioBaseProps = {\n badge?: 'off' | 'on';\n inputProps?: RadioInputProps;\n state?: 'disabled' | 'skeleton';\n} & Omit<RadioGroup.ItemProps, 'disabled'>;\n\n/**\n * A radio has to end up with an accessible name, and it takes that name from its label. So either\n * pass a visible `labelText`, or — for a radio in a layout with no room for one, like a table row\n * selector — an `aria-label`, which is applied to the hidden input instead of being rendered.\n */\nexport type BitkitRadioProps<T extends NonNullable<ReactNode> = NonNullable<ReactNode>> = BitkitRadioBaseProps &\n (\n | {\n helperText?: ReactNode;\n /**\n * The visible label, which is where the radio gets its accessible name from. It has to be\n * non-empty — an empty string is a compile error. When the layout has no room for a visible\n * label, pass `aria-label` instead of an empty `labelText`.\n */\n labelText: T extends '' ? never : T;\n }\n | { 'aria-label': string; helperText?: never; labelText?: null }\n );\n\nconst BitkitRadio = forwardRef<HTMLInputElement, BitkitRadioProps>((props, ref) => {\n const { 'aria-label': ariaLabel, badge, helperText, inputProps, labelText, state, ...rest } = props;\n const styles = useRadioGroupStyles();\n const hasHelperText = !isEmptyNode(helperText);\n const hasLabel = !isEmptyNode(labelText) || hasHelperText;\n\n // Skeleton has to set disabled to be inert: the Skeleton wrapper's own pointer-events: none never\n // stopped a click, it only moved the target to the <label>, which activates the control. The cursor\n // style prop then keeps the arrow plain — style props land outside @layer recipes, where the\n // recipe's _disabled: { cursor: 'not-allowed' } sits.\n return (\n <RadioGroup.Item\n cursor={state === 'skeleton' ? 'default' : undefined}\n disabled={state === 'disabled' || state === 'skeleton'}\n {...rest}\n >\n <RadioGroup.ItemHiddenInput aria-label={ariaLabel} ref={ref} {...inputProps} />\n <Skeleton borderRadius=\"50%\" loading={state === 'skeleton'}>\n <RadioGroup.ItemIndicator />\n </Skeleton>\n {!!badge && (\n <Skeleton loading={state === 'skeleton'}>\n <BitkitBadge colorVariant={badge === 'on' ? 'green' : 'neutral'} css={styles.badge}>\n {badge}\n </BitkitBadge>\n </Skeleton>\n )}\n {hasLabel && (\n <Skeleton loading={state === 'skeleton'}>\n <RadioGroup.ItemText as=\"div\">\n {labelText}\n {hasHelperText && (\n <Text color={state === 'disabled' ? 'text/disabled' : 'text/helper'} textStyle=\"comp/input/helperText\">\n {helperText}\n </Text>\n )}\n </RadioGroup.ItemText>\n </Skeleton>\n )}\n </RadioGroup.Item>\n );\n});\n\nBitkitRadio.displayName = 'BitkitRadio';\n\n// The generic is what makes `labelText=\"\"` a compile error: `Exclude` cannot narrow `string` to\n// \"non-empty string\", but a conditional type on an inferred literal can. The cast carries the\n// generic through the call site, which `forwardRef`'s own signature would erase.\nexport default BitkitRadio as <T extends NonNullable<ReactNode>>(\n props: BitkitRadioProps<T> & { ref?: Ref<HTMLInputElement> },\n) => ReactElement;\n"],"mappings":";;;;;;;;AA8CA,IAAM,cAAc,YAAgD,OAAO,QAAQ;CACjF,MAAM,EAAE,cAAc,WAAW,OAAO,YAAY,YAAY,WAAW,OAAO,GAAG,SAAS;CAC9F,MAAM,SAAS,oBAAoB;CACnC,MAAM,gBAAgB,CAAC,YAAY,UAAU;CAC7C,MAAM,WAAW,CAAC,YAAY,SAAS,KAAK;CAM5C,OACE,qBAAC,WAAW,MAAZ;EACE,QAAQ,UAAU,aAAa,YAAY,KAAA;EAC3C,UAAU,UAAU,cAAc,UAAU;EAC5C,GAAI;EAHN,UAAA;GAKE,oBAAC,WAAW,iBAAZ;IAA4B,cAAY;IAAgB;IAAK,GAAI;GAAa,CAAA;GAC9E,oBAAC,UAAD;IAAU,cAAa;IAAM,SAAS,UAAU;IAC9C,UAAA,oBAAC,WAAW,eAAZ,CAA2B,CAAA;GACnB,CAAA;GACT,CAAC,CAAC,SACD,oBAAC,UAAD;IAAU,SAAS,UAAU;IAC3B,UAAA,oBAAC,aAAD;KAAa,cAAc,UAAU,OAAO,UAAU;KAAW,KAAK,OAAO;KAC1E,UAAA;IACU,CAAA;GACL,CAAA;GAEX,YACC,oBAAC,UAAD;IAAU,SAAS,UAAU;IAC3B,UAAA,qBAAC,WAAW,UAAZ;KAAqB,IAAG;KAAxB,UAAA,CACG,WACA,iBACC,oBAAC,MAAD;MAAM,OAAO,UAAU,aAAa,kBAAkB;MAAe,WAAU;MAC5E,UAAA;KACG,CAAA,CAEW;;GACb,CAAA;EAEG;;AAErB,CAAC;AAED,YAAY,cAAc"}
@@ -56,7 +56,6 @@ export { default as BitkitProgressBar, type BitkitProgressBarProps, type BitkitP
56
56
  export { default as BitkitPromoBanner, type BitkitPromoBannerProps } from './BitkitPromoBanner/BitkitPromoBanner';
57
57
  export { default as BitkitRadio, type BitkitRadioProps } from './BitkitRadio/BitkitRadio';
58
58
  export { default as BitkitRadioGroup, type BitkitRadioGroupProps } from './BitkitRadioGroup/BitkitRadioGroup';
59
- export { default as BitkitRadioItem, type BitkitRadioItemProps } from './BitkitRadioItem/BitkitRadioItem';
60
59
  export { default as BitkitRibbon, type BitkitRibbonProps } from './BitkitRibbon/BitkitRibbon';
61
60
  export { default as BitkitSearchInput, type BitkitSearchInputProps } from './BitkitSearchInput/BitkitSearchInput';
62
61
  export { default as BitkitSectionHeading, type BitkitSectionHeadingProps, } from './BitkitSectionHeading/BitkitSectionHeading';
package/dist/main.js CHANGED
@@ -346,7 +346,6 @@ import BitkitProgressBar from "./components/BitkitProgressBar/BitkitProgressBar.
346
346
  import BitkitPromoBanner from "./components/BitkitPromoBanner/BitkitPromoBanner.js";
347
347
  import BitkitRadio from "./components/BitkitRadio/BitkitRadio.js";
348
348
  import BitkitRadioGroup from "./components/BitkitRadioGroup/BitkitRadioGroup.js";
349
- import BitkitRadioItem from "./components/BitkitRadioItem/BitkitRadioItem.js";
350
349
  import BitkitRibbon from "./components/BitkitRibbon/BitkitRibbon.js";
351
350
  import BitkitTextInput from "./components/BitkitTextInput/BitkitTextInput.js";
352
351
  import BitkitSearchInput from "./components/BitkitSearchInput/BitkitSearchInput.js";
@@ -374,4 +373,4 @@ import BitkitTreeView, { createTreeCollection } from "./components/BitkitTreeVie
374
373
  import useResponsive, { ResponsiveProvider } from "./hooks/useResponsive.js";
375
374
  import bitkitTheme from "./theme/index.js";
376
375
  import Provider from "./providers/BitkitProvider.js";
377
- export { BitkitAccordion, BitkitActionBar, BitkitActionMenu, BitkitAlert, BitkitAvatar, BitkitBadge, BitkitBreadcrumb, BitkitButton, BitkitCalendar, BitkitCheckbox, BitkitCheckboxGroup, BitkitCloseButton, BitkitCodeSnippet, BitkitCollapsible, BitkitColorButton, BitkitCombobox_default as BitkitCombobox, BitkitControlButton, BitkitDataWidget, BitkitDatePicker, BitkitDefinitionTooltip, BitkitDialog_default as BitkitDialog, BitkitDraggableCard, BitkitDrawer, BitkitEmptyState, BitkitExpandableCard, BitkitExpandableRow, BitkitField, BitkitFileInput, BitkitFormDialog_default as BitkitFormDialog, BitkitGroupHeading, BitkitHeading, BitkitIconButton, BitkitInlineLoading, BitkitLabel, BitkitLabelTooltip, BitkitLabeledData, BitkitLightbox, BitkitLink, BitkitLinkButton, BitkitList_default as BitkitList, BitkitMarkdown, BitkitMarkdownCard, BitkitMultiselect_default as BitkitMultiselect, BitkitMultiselectMenu, BitkitNativeSelect, BitkitNoteCard, BitkitNumberInput, BitkitOverflowContent, BitkitOverflowTooltip, BitkitPageFooter_default as BitkitPageFooter, BitkitPagination, BitkitPaginationLoadMore, BitkitPopover, BitkitProgressBar, BitkitPromoBanner, Provider as BitkitProvider, BitkitRadio, BitkitRadioGroup, BitkitRadioItem, BitkitRibbon, BitkitSearchInput, BitkitSectionHeading, BitkitSegmentedControl_default as BitkitSegmentedControl, BitkitSelect_default as BitkitSelect, BitkitSelectMenu, BitkitSelectMenuAction, BitkitSelectableTag_default as BitkitSelectableTag, BitkitSettingsCard_default as BitkitSettingsCard, BitkitSidebar_default as BitkitSidebar, BitkitSkeletonGroup, BitkitSortableColumnHeader, BitkitSpinner, BitkitSplitButton_default as BitkitSplitButton, BitkitStat, BitkitStepperDialog_default as BitkitStepperDialog, BitkitSteps_default as BitkitSteps, BitkitStepsCard_default as BitkitStepsCard, BitkitSwitch, BitkitTabs, BitkitTag, BitkitTagsInput, BitkitTextArea, BitkitTextInput, BitkitToggleButton, BitkitTooltip, BitkitTour, BitkitTreeView, IconAbortCircle, IconAbortCircleFilled, IconAddons, IconAgent, IconAnchor, IconAndroid, IconApp, IconAppSettings, IconAppStore, IconAppStoreColor, IconApple, IconArchive, IconArchiveDelete, IconArchiveRestore, IconArrowBackAndDown, IconArrowBackAndUp, IconArrowDown, IconArrowForwardAndDown, IconArrowForwardAndUp, IconArrowLeft, IconArrowNortheast, IconArrowNorthwest, IconArrowRight, IconArrowUp, IconArrowsHorizontal, IconArrowsVertical, IconAutomation, IconAws, IconAwsColor, IconBadge3RdParty, IconBadgeBitrise, IconBadgeUpgrade, IconBadgeVersionOk, IconBazel, IconBell, IconBitbot, IconBitbotError, IconBitbucket, IconBitbucketColor, IconBitbucketNeutral, IconBitbucketWhite, IconBlockCircle, IconBook, IconBoxArrowDown, IconBoxDot, IconBoxLinesOverflow, IconBoxLinesWrap, IconBranch, IconBrowserstackColor, IconBug, IconBuild, IconBuildCache, IconBuildCacheFilled, IconBuildEnvSetup, IconBuildHub, IconBuildHubFilled, IconCalendar, IconChangePlan, IconChat, IconCheck, IconCheckCircle, IconCheckCircleFilled, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCi, IconCiFilled, IconCircle, IconCircleDashed, IconCircleHalfFilled, IconClaude, IconClaudeColor, IconClock, IconCode, IconCodePush, IconCodeSigning, IconCoffee, IconCommit, IconConfigure, IconConnectedAccounts, IconContainer, IconCopy, IconCordova, IconCpu, IconCreditcard, IconCredits, IconCross, IconCrossCircle, IconCrossCircleFilled, IconCrown, IconCycle, IconDashboard, IconDashboardFilled, IconDeployment, IconDetails, IconDoc, IconDollar, IconDot, IconDotnet, IconDotnetColor, IconDotnetText, IconDotnetTextColor, IconDoubleCircle, IconDownload, IconDragHandle, IconEc2Ami, IconEnterprise, IconErrorCircle, IconErrorCircleFilled, IconExpand, IconExtraBuildCapacity, IconEye, IconEyeSlash, IconFastlane, IconFileDoc, IconFilePdf, IconFilePlist, IconFileYml, IconFileZip, IconFilter, IconFlag, IconFlutter, IconFolder, IconFullscreen, IconFullscreenExit, IconGauge, IconGit, IconGithub, IconGitlab, IconGitlabColor, IconGitlabWhite, IconGlobe, IconGo, IconGoogleColor, IconGooglePlay, IconGooglePlayColor, IconGradle, IconGroup, IconHashtag, IconHeadset, IconHeart, IconHistory, IconHourglass, IconImage, IconInfoCircle, IconInfoCircleFilled, IconInsights, IconInsightsFilled, IconInstall, IconInteraction, IconInvoice, IconIonic, IconJapanese, IconJava, IconJavaColor, IconJavaDuke, IconJavaDukeColor, IconKey, IconKotlin, IconKotlinColor, IconKotlinWhite, IconLaptop, IconLaunchdarkly, IconLegacyApp, IconLightbulb, IconLink, IconLinux, IconLock, IconLockOpen, IconLogin, IconLogout, IconMacos, IconMagicWand, IconMagnifier, IconMail, IconMedal, IconMemory, IconMenuGrid, IconMenuHamburger, IconMessage, IconMessageAlert, IconMessageQuestion, IconMicrophone, IconMinus, IconMinusCircle, IconMinusCircleFilled, IconMobile, IconMobileLandscape, IconMonitorChart, IconMoreHorizontal, IconMoreVertical, IconNews, IconNextjs, IconNodejs, IconOpenInNew, IconOther, IconOutsideContributor, IconOverview, IconPause, IconPencil, IconPeople, IconPercent, IconPerson, IconPersonWithDesk, IconPlay, IconPlus, IconPlusCircle, IconPlusCircleFilled, IconPower, IconProject, IconProjectSettings, IconPull, IconPush, IconPuzzle, IconPython, IconPythonColor, IconQuestionCircle, IconQuestionCircleFilled, IconReact, IconRefresh, IconRegex, IconRelease, IconReleaseFilled, IconRemoteAccess, IconReplace, IconResponsiveness, IconReviewerApproved, IconReviewerAssigned, IconReviewerRejected, IconRuby, IconRubyColor, IconSave, IconSecurityShield, IconSettings, IconSettingsFilled, IconShuffle, IconSiren, IconSkip, IconSkipCircle, IconSkipCircleFilled, IconSlack, IconSlackColor, IconSparkle, IconSparkleFilled, IconSpinnerOnDisabled, IconSpinnerPurple, IconSpinnerPurpleDouble, IconSpinnerWhite, IconStability, IconStack, IconStar, IconStep, IconStop, IconStopwatch, IconTag, IconTasks, IconTeams, IconTeamsColor, IconTemplateCode, IconTerminal, IconTestQuarantine, IconThemeDarkToggle, IconThumbDown, IconThumbUp, IconTools, IconTrash, IconTrigger, IconUbuntu, IconUbuntuColor, IconUnity3D, IconUpload, IconValidateShield, IconVideo, IconWarning, IconWarningYellow, IconWebUi, IconWebhooks, IconWorkflow, IconWorkflowFlow, IconXTwitter, IconXamarin, IconXcode, ResponsiveProvider, bitkitIcon, bitkitTheme as bitriseTheme, createBitkitToast, createTreeCollection, dismissBitkitToast, rem, useBitkitTour, useResponsive, useStepperDialog };
376
+ export { BitkitAccordion, BitkitActionBar, BitkitActionMenu, BitkitAlert, BitkitAvatar, BitkitBadge, BitkitBreadcrumb, BitkitButton, BitkitCalendar, BitkitCheckbox, BitkitCheckboxGroup, BitkitCloseButton, BitkitCodeSnippet, BitkitCollapsible, BitkitColorButton, BitkitCombobox_default as BitkitCombobox, BitkitControlButton, BitkitDataWidget, BitkitDatePicker, BitkitDefinitionTooltip, BitkitDialog_default as BitkitDialog, BitkitDraggableCard, BitkitDrawer, BitkitEmptyState, BitkitExpandableCard, BitkitExpandableRow, BitkitField, BitkitFileInput, BitkitFormDialog_default as BitkitFormDialog, BitkitGroupHeading, BitkitHeading, BitkitIconButton, BitkitInlineLoading, BitkitLabel, BitkitLabelTooltip, BitkitLabeledData, BitkitLightbox, BitkitLink, BitkitLinkButton, BitkitList_default as BitkitList, BitkitMarkdown, BitkitMarkdownCard, BitkitMultiselect_default as BitkitMultiselect, BitkitMultiselectMenu, BitkitNativeSelect, BitkitNoteCard, BitkitNumberInput, BitkitOverflowContent, BitkitOverflowTooltip, BitkitPageFooter_default as BitkitPageFooter, BitkitPagination, BitkitPaginationLoadMore, BitkitPopover, BitkitProgressBar, BitkitPromoBanner, Provider as BitkitProvider, BitkitRadio, BitkitRadioGroup, BitkitRibbon, BitkitSearchInput, BitkitSectionHeading, BitkitSegmentedControl_default as BitkitSegmentedControl, BitkitSelect_default as BitkitSelect, BitkitSelectMenu, BitkitSelectMenuAction, BitkitSelectableTag_default as BitkitSelectableTag, BitkitSettingsCard_default as BitkitSettingsCard, BitkitSidebar_default as BitkitSidebar, BitkitSkeletonGroup, BitkitSortableColumnHeader, BitkitSpinner, BitkitSplitButton_default as BitkitSplitButton, BitkitStat, BitkitStepperDialog_default as BitkitStepperDialog, BitkitSteps_default as BitkitSteps, BitkitStepsCard_default as BitkitStepsCard, BitkitSwitch, BitkitTabs, BitkitTag, BitkitTagsInput, BitkitTextArea, BitkitTextInput, BitkitToggleButton, BitkitTooltip, BitkitTour, BitkitTreeView, IconAbortCircle, IconAbortCircleFilled, IconAddons, IconAgent, IconAnchor, IconAndroid, IconApp, IconAppSettings, IconAppStore, IconAppStoreColor, IconApple, IconArchive, IconArchiveDelete, IconArchiveRestore, IconArrowBackAndDown, IconArrowBackAndUp, IconArrowDown, IconArrowForwardAndDown, IconArrowForwardAndUp, IconArrowLeft, IconArrowNortheast, IconArrowNorthwest, IconArrowRight, IconArrowUp, IconArrowsHorizontal, IconArrowsVertical, IconAutomation, IconAws, IconAwsColor, IconBadge3RdParty, IconBadgeBitrise, IconBadgeUpgrade, IconBadgeVersionOk, IconBazel, IconBell, IconBitbot, IconBitbotError, IconBitbucket, IconBitbucketColor, IconBitbucketNeutral, IconBitbucketWhite, IconBlockCircle, IconBook, IconBoxArrowDown, IconBoxDot, IconBoxLinesOverflow, IconBoxLinesWrap, IconBranch, IconBrowserstackColor, IconBug, IconBuild, IconBuildCache, IconBuildCacheFilled, IconBuildEnvSetup, IconBuildHub, IconBuildHubFilled, IconCalendar, IconChangePlan, IconChat, IconCheck, IconCheckCircle, IconCheckCircleFilled, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCi, IconCiFilled, IconCircle, IconCircleDashed, IconCircleHalfFilled, IconClaude, IconClaudeColor, IconClock, IconCode, IconCodePush, IconCodeSigning, IconCoffee, IconCommit, IconConfigure, IconConnectedAccounts, IconContainer, IconCopy, IconCordova, IconCpu, IconCreditcard, IconCredits, IconCross, IconCrossCircle, IconCrossCircleFilled, IconCrown, IconCycle, IconDashboard, IconDashboardFilled, IconDeployment, IconDetails, IconDoc, IconDollar, IconDot, IconDotnet, IconDotnetColor, IconDotnetText, IconDotnetTextColor, IconDoubleCircle, IconDownload, IconDragHandle, IconEc2Ami, IconEnterprise, IconErrorCircle, IconErrorCircleFilled, IconExpand, IconExtraBuildCapacity, IconEye, IconEyeSlash, IconFastlane, IconFileDoc, IconFilePdf, IconFilePlist, IconFileYml, IconFileZip, IconFilter, IconFlag, IconFlutter, IconFolder, IconFullscreen, IconFullscreenExit, IconGauge, IconGit, IconGithub, IconGitlab, IconGitlabColor, IconGitlabWhite, IconGlobe, IconGo, IconGoogleColor, IconGooglePlay, IconGooglePlayColor, IconGradle, IconGroup, IconHashtag, IconHeadset, IconHeart, IconHistory, IconHourglass, IconImage, IconInfoCircle, IconInfoCircleFilled, IconInsights, IconInsightsFilled, IconInstall, IconInteraction, IconInvoice, IconIonic, IconJapanese, IconJava, IconJavaColor, IconJavaDuke, IconJavaDukeColor, IconKey, IconKotlin, IconKotlinColor, IconKotlinWhite, IconLaptop, IconLaunchdarkly, IconLegacyApp, IconLightbulb, IconLink, IconLinux, IconLock, IconLockOpen, IconLogin, IconLogout, IconMacos, IconMagicWand, IconMagnifier, IconMail, IconMedal, IconMemory, IconMenuGrid, IconMenuHamburger, IconMessage, IconMessageAlert, IconMessageQuestion, IconMicrophone, IconMinus, IconMinusCircle, IconMinusCircleFilled, IconMobile, IconMobileLandscape, IconMonitorChart, IconMoreHorizontal, IconMoreVertical, IconNews, IconNextjs, IconNodejs, IconOpenInNew, IconOther, IconOutsideContributor, IconOverview, IconPause, IconPencil, IconPeople, IconPercent, IconPerson, IconPersonWithDesk, IconPlay, IconPlus, IconPlusCircle, IconPlusCircleFilled, IconPower, IconProject, IconProjectSettings, IconPull, IconPush, IconPuzzle, IconPython, IconPythonColor, IconQuestionCircle, IconQuestionCircleFilled, IconReact, IconRefresh, IconRegex, IconRelease, IconReleaseFilled, IconRemoteAccess, IconReplace, IconResponsiveness, IconReviewerApproved, IconReviewerAssigned, IconReviewerRejected, IconRuby, IconRubyColor, IconSave, IconSecurityShield, IconSettings, IconSettingsFilled, IconShuffle, IconSiren, IconSkip, IconSkipCircle, IconSkipCircleFilled, IconSlack, IconSlackColor, IconSparkle, IconSparkleFilled, IconSpinnerOnDisabled, IconSpinnerPurple, IconSpinnerPurpleDouble, IconSpinnerWhite, IconStability, IconStack, IconStar, IconStep, IconStop, IconStopwatch, IconTag, IconTasks, IconTeams, IconTeamsColor, IconTemplateCode, IconTerminal, IconTestQuarantine, IconThemeDarkToggle, IconThumbDown, IconThumbUp, IconTools, IconTrash, IconTrigger, IconUbuntu, IconUbuntuColor, IconUnity3D, IconUpload, IconValidateShield, IconVideo, IconWarning, IconWarningYellow, IconWebUi, IconWebhooks, IconWorkflow, IconWorkflowFlow, IconXTwitter, IconXamarin, IconXcode, ResponsiveProvider, bitkitIcon, bitkitTheme as bitriseTheme, createBitkitToast, createTreeCollection, dismissBitkitToast, rem, useBitkitTour, useResponsive, useStepperDialog };
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * True for nodes that render nothing (`null`, `undefined`, `''`, booleans, or an array of those) —
4
+ * so an "empty" slot can be left out of the DOM instead of rendering a wrapper that only adds gap.
5
+ */
6
+ export declare const isEmptyNode: (node: ReactNode) => boolean;
@@ -0,0 +1,10 @@
1
+ //#region lib/utilities/isEmptyNode.ts
2
+ /**
3
+ * True for nodes that render nothing (`null`, `undefined`, `''`, booleans, or an array of those) —
4
+ * so an "empty" slot can be left out of the DOM instead of rendering a wrapper that only adds gap.
5
+ */
6
+ var isEmptyNode = (node) => node == null || node === "" || typeof node === "boolean" || Array.isArray(node) && node.every(isEmptyNode);
7
+ //#endregion
8
+ export { isEmptyNode };
9
+
10
+ //# sourceMappingURL=isEmptyNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isEmptyNode.js","names":[],"sources":["../../lib/utilities/isEmptyNode.ts"],"sourcesContent":["import { type ReactNode } from 'react';\n\n/**\n * True for nodes that render nothing (`null`, `undefined`, `''`, booleans, or an array of those) —\n * so an \"empty\" slot can be left out of the DOM instead of rendering a wrapper that only adds gap.\n */\nexport const isEmptyNode = (node: ReactNode): boolean =>\n node == null || node === '' || typeof node === 'boolean' || (Array.isArray(node) && node.every(isEmptyNode));\n"],"mappings":";;;;;AAMA,IAAa,eAAe,SAC1B,QAAQ,QAAQ,SAAS,MAAM,OAAO,SAAS,aAAc,MAAM,QAAQ,IAAI,KAAK,KAAK,MAAM,WAAW"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.358",
4
+ "version": "0.3.359-beta.2314",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",
@@ -1,30 +0,0 @@
1
- import { RadioGroup } from '@chakra-ui/react/radio-group';
2
- import { DataAttr } from '@chakra-ui/react/styled-system';
3
- import { InputHTMLAttributes } from 'react';
4
- /**
5
- * Passthrough attributes for the radio `<input>`. The RadioGroup machine owns the behavioral / state
6
- * attributes (`checked`, `value`, `name`, `type`, `disabled`, `onChange`, …), so they're excluded —
7
- * setting them here would let the input drift out of sync with its `RadioGroup.Item`. Keep it to
8
- * things like `data-testid`.
9
- */
10
- type RadioInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'defaultChecked' | 'defaultValue' | 'disabled' | 'name' | 'onChange' | 'type' | 'value'> & DataAttr;
11
- export interface BitkitRadioItemProps extends Omit<RadioGroup.ItemProps, 'children' | 'disabled'> {
12
- /** Props forwarded to the underlying radio `<input>` (e.g. `data-testid`). */
13
- inputProps?: RadioInputProps;
14
- /**
15
- * Accessible name for the radio. Not rendered — this is an icon-only control — so it's required to
16
- * keep the radio from ending up with an empty accessible name.
17
- */
18
- label: string;
19
- state?: 'disabled';
20
- }
21
- /**
22
- * An icon-only radio: the styled indicator without any label chrome. Use it to place radios inside a
23
- * custom layout — table cells, a shared CSS grid, a virtualized list — where BitkitRadioGroup's
24
- * fieldset wrapper doesn't fit. Compose it under a Chakra `RadioGroup.Root` (kept layout-neutral with
25
- * `css` / `asChild`): the grouping semantics come from that root and the Bitkit visual from the
26
- * theme, while `label` supplies the required accessible name. Reach for BitkitRadio instead whenever
27
- * a visible label fits.
28
- */
29
- declare const BitkitRadioItem: import('react').ForwardRefExoticComponent<BitkitRadioItemProps & import('react').RefAttributes<HTMLInputElement>>;
30
- export default BitkitRadioItem;
@@ -1,29 +0,0 @@
1
- import { forwardRef } from "react";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { RadioGroup } from "@chakra-ui/react/radio-group";
4
- //#region lib/components/BitkitRadioItem/BitkitRadioItem.tsx
5
- /**
6
- * An icon-only radio: the styled indicator without any label chrome. Use it to place radios inside a
7
- * custom layout — table cells, a shared CSS grid, a virtualized list — where BitkitRadioGroup's
8
- * fieldset wrapper doesn't fit. Compose it under a Chakra `RadioGroup.Root` (kept layout-neutral with
9
- * `css` / `asChild`): the grouping semantics come from that root and the Bitkit visual from the
10
- * theme, while `label` supplies the required accessible name. Reach for BitkitRadio instead whenever
11
- * a visible label fits.
12
- */
13
- var BitkitRadioItem = forwardRef((props, ref) => {
14
- const { inputProps, label, state, ...rest } = props;
15
- return /* @__PURE__ */ jsxs(RadioGroup.Item, {
16
- disabled: state === "disabled",
17
- ...rest,
18
- children: [/* @__PURE__ */ jsx(RadioGroup.ItemHiddenInput, {
19
- ref,
20
- ...inputProps,
21
- "aria-label": label
22
- }), /* @__PURE__ */ jsx(RadioGroup.ItemIndicator, {})]
23
- });
24
- });
25
- BitkitRadioItem.displayName = "BitkitRadioItem";
26
- //#endregion
27
- export { BitkitRadioItem as default };
28
-
29
- //# sourceMappingURL=BitkitRadioItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BitkitRadioItem.js","names":[],"sources":["../../../lib/components/BitkitRadioItem/BitkitRadioItem.tsx"],"sourcesContent":["import { RadioGroup } from '@chakra-ui/react/radio-group';\nimport { type DataAttr } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type InputHTMLAttributes } from 'react';\n\n/**\n * Passthrough attributes for the radio `<input>`. The RadioGroup machine owns the behavioral / state\n * attributes (`checked`, `value`, `name`, `type`, `disabled`, `onChange`, …), so they're excluded —\n * setting them here would let the input drift out of sync with its `RadioGroup.Item`. Keep it to\n * things like `data-testid`.\n */\ntype RadioInputProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'checked' | 'defaultChecked' | 'defaultValue' | 'disabled' | 'name' | 'onChange' | 'type' | 'value'\n> &\n DataAttr;\n\nexport interface BitkitRadioItemProps extends Omit<RadioGroup.ItemProps, 'children' | 'disabled'> {\n /** Props forwarded to the underlying radio `<input>` (e.g. `data-testid`). */\n inputProps?: RadioInputProps;\n /**\n * Accessible name for the radio. Not rendered — this is an icon-only control — so it's required to\n * keep the radio from ending up with an empty accessible name.\n */\n label: string;\n state?: 'disabled';\n}\n\n/**\n * An icon-only radio: the styled indicator without any label chrome. Use it to place radios inside a\n * custom layout — table cells, a shared CSS grid, a virtualized list — where BitkitRadioGroup's\n * fieldset wrapper doesn't fit. Compose it under a Chakra `RadioGroup.Root` (kept layout-neutral with\n * `css` / `asChild`): the grouping semantics come from that root and the Bitkit visual from the\n * theme, while `label` supplies the required accessible name. Reach for BitkitRadio instead whenever\n * a visible label fits.\n */\nconst BitkitRadioItem = forwardRef<HTMLInputElement, BitkitRadioItemProps>((props, ref) => {\n const { inputProps, label, state, ...rest } = props;\n\n return (\n <RadioGroup.Item disabled={state === 'disabled'} {...rest}>\n <RadioGroup.ItemHiddenInput ref={ref} {...inputProps} aria-label={label} />\n <RadioGroup.ItemIndicator />\n </RadioGroup.Item>\n );\n});\n\nBitkitRadioItem.displayName = 'BitkitRadioItem';\n\nexport default BitkitRadioItem;\n"],"mappings":";;;;;;;;;;;;AAmCA,IAAM,kBAAkB,YAAoD,OAAO,QAAQ;CACzF,MAAM,EAAE,YAAY,OAAO,OAAO,GAAG,SAAS;CAE9C,OACE,qBAAC,WAAW,MAAZ;EAAiB,UAAU,UAAU;EAAY,GAAI;EAArD,UAAA,CACE,oBAAC,WAAW,iBAAZ;GAAiC;GAAK,GAAI;GAAY,cAAY;EAAQ,CAAA,GAC1E,oBAAC,WAAW,eAAZ,CAA2B,CAAA,CACZ;;AAErB,CAAC;AAED,gBAAgB,cAAc"}