@bitrise/bitkit-v2 0.3.221 → 0.3.222
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/BitkitCheckboxGroup/BitkitCheckboxGroup.d.ts +5 -1
- package/dist/components/BitkitCheckboxGroup/BitkitCheckboxGroup.js +4 -3
- package/dist/components/BitkitCheckboxGroup/BitkitCheckboxGroup.js.map +1 -1
- package/dist/components/BitkitRadioGroup/BitkitRadioGroup.d.ts +5 -1
- package/dist/components/BitkitRadioGroup/BitkitRadioGroup.js +4 -3
- package/dist/components/BitkitRadioGroup/BitkitRadioGroup.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,8 +5,12 @@ export interface BitkitCheckboxGroupProps extends Fieldset.RootProps {
|
|
|
5
5
|
checkboxGroupProps?: CheckboxGroupProps;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
errorText?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Visible legend rendered above the group. Optional — if you omit it, pass `aria-label` or
|
|
10
|
+
* `aria-labelledby` instead so the fieldset still has an accessible name.
|
|
11
|
+
*/
|
|
12
|
+
groupLabel?: string;
|
|
8
13
|
helperText?: string;
|
|
9
|
-
label: string;
|
|
10
14
|
name?: CheckboxGroupProps['name'];
|
|
11
15
|
onValueChange: CheckboxGroupProps['onValueChange'];
|
|
12
16
|
value: CheckboxGroupProps['value'];
|
|
@@ -4,19 +4,20 @@ import { CheckboxGroup } from "@chakra-ui/react/checkbox";
|
|
|
4
4
|
import { Fieldset } from "@chakra-ui/react/fieldset";
|
|
5
5
|
//#region lib/components/BitkitCheckboxGroup/BitkitCheckboxGroup.tsx
|
|
6
6
|
var BitkitCheckboxGroup = forwardRef((props, ref) => {
|
|
7
|
-
const { checkboxGroupProps, children, errorText, helperText,
|
|
7
|
+
const { checkboxGroupProps, children, errorText, helperText, groupLabel, name, onValueChange, value, ...rest } = props;
|
|
8
|
+
const hasHeader = !!groupLabel || !!helperText;
|
|
8
9
|
return /* @__PURE__ */ jsxs(Fieldset.Root, {
|
|
9
10
|
ref,
|
|
10
11
|
...rest,
|
|
11
12
|
invalid: rest.invalid || !!errorText,
|
|
12
13
|
children: [
|
|
13
|
-
/* @__PURE__ */ jsx(Fieldset.Legend, { children:
|
|
14
|
+
groupLabel && /* @__PURE__ */ jsx(Fieldset.Legend, { children: groupLabel }),
|
|
14
15
|
!!helperText && /* @__PURE__ */ jsx(Fieldset.HelperText, { children: helperText }),
|
|
15
16
|
/* @__PURE__ */ jsx(Fieldset.Content, {
|
|
16
17
|
display: "flex",
|
|
17
18
|
flexDirection: "column",
|
|
18
19
|
gap: "12",
|
|
19
|
-
marginBlockStart: "12",
|
|
20
|
+
marginBlockStart: hasHeader ? "12" : void 0,
|
|
20
21
|
asChild: true,
|
|
21
22
|
children: /* @__PURE__ */ jsx(CheckboxGroup, {
|
|
22
23
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitCheckboxGroup.js","names":[],"sources":["../../../lib/components/BitkitCheckboxGroup/BitkitCheckboxGroup.tsx"],"sourcesContent":["import { CheckboxGroup, type CheckboxGroupProps } from '@chakra-ui/react/checkbox';\nimport { Fieldset } from '@chakra-ui/react/fieldset';\nimport { forwardRef, type ReactNode } from 'react';\n\nexport interface BitkitCheckboxGroupProps extends Fieldset.RootProps {\n checkboxGroupProps?: CheckboxGroupProps;\n children: ReactNode;\n errorText?: string;\n
|
|
1
|
+
{"version":3,"file":"BitkitCheckboxGroup.js","names":[],"sources":["../../../lib/components/BitkitCheckboxGroup/BitkitCheckboxGroup.tsx"],"sourcesContent":["import { CheckboxGroup, type CheckboxGroupProps } from '@chakra-ui/react/checkbox';\nimport { Fieldset } from '@chakra-ui/react/fieldset';\nimport { forwardRef, type ReactNode } from 'react';\n\nexport interface BitkitCheckboxGroupProps extends Fieldset.RootProps {\n checkboxGroupProps?: CheckboxGroupProps;\n children: ReactNode;\n errorText?: string;\n /**\n * Visible legend rendered above the group. Optional — if you omit it, pass `aria-label` or\n * `aria-labelledby` instead so the fieldset still has an accessible name.\n */\n groupLabel?: string;\n helperText?: string;\n name?: CheckboxGroupProps['name'];\n onValueChange: CheckboxGroupProps['onValueChange'];\n value: CheckboxGroupProps['value'];\n}\n\nconst BitkitCheckboxGroup = forwardRef<HTMLFieldSetElement, BitkitCheckboxGroupProps>((props, ref) => {\n const { checkboxGroupProps, children, errorText, helperText, groupLabel, name, onValueChange, value, ...rest } =\n props;\n const hasHeader = !!groupLabel || !!helperText;\n return (\n <Fieldset.Root ref={ref} {...rest} invalid={rest.invalid || !!errorText}>\n {groupLabel && <Fieldset.Legend>{groupLabel}</Fieldset.Legend>}\n {!!helperText && <Fieldset.HelperText>{helperText}</Fieldset.HelperText>}\n <Fieldset.Content\n display=\"flex\"\n flexDirection=\"column\"\n gap=\"12\"\n marginBlockStart={hasHeader ? '12' : undefined}\n asChild\n >\n <CheckboxGroup name={name} onValueChange={onValueChange} value={value} {...checkboxGroupProps}>\n {children}\n </CheckboxGroup>\n </Fieldset.Content>\n {!!errorText && <Fieldset.ErrorText>{errorText}</Fieldset.ErrorText>}\n </Fieldset.Root>\n );\n});\n\nBitkitCheckboxGroup.displayName = 'BitkitCheckboxGroup';\n\nexport default BitkitCheckboxGroup;\n"],"mappings":";;;;;AAmBA,IAAM,sBAAsB,YAA2D,OAAO,QAAQ;CACpG,MAAM,EAAE,oBAAoB,UAAU,WAAW,YAAY,YAAY,MAAM,eAAe,OAAO,GAAG,SACtG;CACF,MAAM,YAAY,CAAC,CAAC,cAAc,CAAC,CAAC;CACpC,OACE,qBAAC,SAAS,MAAV;EAAoB;EAAK,GAAI;EAAM,SAAS,KAAK,WAAW,CAAC,CAAC;YAA9D;GACG,cAAc,oBAAC,SAAS,QAAV,EAAA,UAAkB,WAA4B,CAAA;GAC5D,CAAC,CAAC,cAAc,oBAAC,SAAS,YAAV,EAAA,UAAsB,WAAgC,CAAA;GACvE,oBAAC,SAAS,SAAV;IACE,SAAQ;IACR,eAAc;IACd,KAAI;IACJ,kBAAkB,YAAY,OAAO,KAAA;IACrC,SAAA;cAEA,oBAAC,eAAD;KAAqB;KAAqB;KAAsB;KAAO,GAAI;KACxE;IACY,CAAA;GACC,CAAA;GACjB,CAAC,CAAC,aAAa,oBAAC,SAAS,WAAV,EAAA,UAAqB,UAA8B,CAAA;EACtD;;AAEnB,CAAC;AAED,oBAAoB,cAAc"}
|
|
@@ -4,8 +4,12 @@ import { ReactNode } from 'react';
|
|
|
4
4
|
export interface BitkitRadioGroupProps extends Fieldset.RootProps {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
errorText?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Visible legend rendered above the group. Optional — if you omit it, pass `aria-label` or
|
|
9
|
+
* `aria-labelledby` instead so the fieldset still has an accessible name.
|
|
10
|
+
*/
|
|
11
|
+
groupLabel?: string;
|
|
7
12
|
helperText?: string;
|
|
8
|
-
label: string;
|
|
9
13
|
layout?: RadioGroupRootProps['orientation'];
|
|
10
14
|
name?: RadioGroupRootProps['name'];
|
|
11
15
|
onValueChange: RadioGroupRootProps['onValueChange'];
|
|
@@ -4,16 +4,17 @@ import { Fieldset } from "@chakra-ui/react/fieldset";
|
|
|
4
4
|
import { RadioGroup } from "@chakra-ui/react/radio-group";
|
|
5
5
|
//#region lib/components/BitkitRadioGroup/BitkitRadioGroup.tsx
|
|
6
6
|
var BitkitRadioGroup = forwardRef((props, ref) => {
|
|
7
|
-
const { children, errorText, helperText,
|
|
7
|
+
const { children, errorText, helperText, groupLabel, layout, name, onValueChange, radioGroupRootProps, size, value, ...rest } = props;
|
|
8
|
+
const hasHeader = !!groupLabel || !!helperText;
|
|
8
9
|
return /* @__PURE__ */ jsxs(Fieldset.Root, {
|
|
9
10
|
ref,
|
|
10
11
|
...rest,
|
|
11
12
|
invalid: rest.invalid || !!errorText,
|
|
12
13
|
children: [
|
|
13
|
-
/* @__PURE__ */ jsx(Fieldset.Legend, { children:
|
|
14
|
+
groupLabel && /* @__PURE__ */ jsx(Fieldset.Legend, { children: groupLabel }),
|
|
14
15
|
!!helperText && /* @__PURE__ */ jsx(Fieldset.HelperText, { children: helperText }),
|
|
15
16
|
/* @__PURE__ */ jsx(Fieldset.Content, {
|
|
16
|
-
marginBlockStart: "12",
|
|
17
|
+
marginBlockStart: hasHeader ? "12" : void 0,
|
|
17
18
|
asChild: true,
|
|
18
19
|
children: /* @__PURE__ */ jsx(RadioGroup.Root, {
|
|
19
20
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitRadioGroup.js","names":[],"sources":["../../../lib/components/BitkitRadioGroup/BitkitRadioGroup.tsx"],"sourcesContent":["import { Fieldset } from '@chakra-ui/react/fieldset';\nimport { RadioGroup, type RadioGroupRootProps } from '@chakra-ui/react/radio-group';\nimport { forwardRef, type ReactNode } from 'react';\n\nexport interface BitkitRadioGroupProps extends Fieldset.RootProps {\n children: ReactNode;\n errorText?: string;\n
|
|
1
|
+
{"version":3,"file":"BitkitRadioGroup.js","names":[],"sources":["../../../lib/components/BitkitRadioGroup/BitkitRadioGroup.tsx"],"sourcesContent":["import { Fieldset } from '@chakra-ui/react/fieldset';\nimport { RadioGroup, type RadioGroupRootProps } from '@chakra-ui/react/radio-group';\nimport { forwardRef, type ReactNode } from 'react';\n\nexport interface BitkitRadioGroupProps extends Fieldset.RootProps {\n children: ReactNode;\n errorText?: string;\n /**\n * Visible legend rendered above the group. Optional — if you omit it, pass `aria-label` or\n * `aria-labelledby` instead so the fieldset still has an accessible name.\n */\n groupLabel?: string;\n helperText?: string;\n layout?: RadioGroupRootProps['orientation'];\n name?: RadioGroupRootProps['name'];\n onValueChange: RadioGroupRootProps['onValueChange'];\n radioGroupRootProps?: RadioGroupRootProps;\n size?: RadioGroupRootProps['size'];\n value: RadioGroupRootProps['value'];\n}\n\nconst BitkitRadioGroup = forwardRef<HTMLFieldSetElement, BitkitRadioGroupProps>((props, ref) => {\n const {\n children,\n errorText,\n helperText,\n groupLabel,\n layout,\n name,\n onValueChange,\n radioGroupRootProps,\n size,\n value,\n ...rest\n } = props;\n const hasHeader = !!groupLabel || !!helperText;\n return (\n <Fieldset.Root ref={ref} {...rest} invalid={rest.invalid || !!errorText}>\n {groupLabel && <Fieldset.Legend>{groupLabel}</Fieldset.Legend>}\n {!!helperText && <Fieldset.HelperText>{helperText}</Fieldset.HelperText>}\n <Fieldset.Content marginBlockStart={hasHeader ? '12' : undefined} asChild>\n <RadioGroup.Root\n name={name}\n size={size}\n orientation={layout}\n onValueChange={onValueChange}\n value={value}\n {...radioGroupRootProps}\n >\n {children}\n </RadioGroup.Root>\n </Fieldset.Content>\n {!!errorText && <Fieldset.ErrorText>{errorText}</Fieldset.ErrorText>}\n </Fieldset.Root>\n );\n});\n\nBitkitRadioGroup.displayName = 'BitkitRadioGroup';\n\nexport default BitkitRadioGroup;\n"],"mappings":";;;;;AAqBA,IAAM,mBAAmB,YAAwD,OAAO,QAAQ;CAC9F,MAAM,EACJ,UACA,WACA,YACA,YACA,QACA,MACA,eACA,qBACA,MACA,OACA,GAAG,SACD;CACJ,MAAM,YAAY,CAAC,CAAC,cAAc,CAAC,CAAC;CACpC,OACE,qBAAC,SAAS,MAAV;EAAoB;EAAK,GAAI;EAAM,SAAS,KAAK,WAAW,CAAC,CAAC;YAA9D;GACG,cAAc,oBAAC,SAAS,QAAV,EAAA,UAAkB,WAA4B,CAAA;GAC5D,CAAC,CAAC,cAAc,oBAAC,SAAS,YAAV,EAAA,UAAsB,WAAgC,CAAA;GACvE,oBAAC,SAAS,SAAV;IAAkB,kBAAkB,YAAY,OAAO,KAAA;IAAW,SAAA;cAChE,oBAAC,WAAW,MAAZ;KACQ;KACA;KACN,aAAa;KACE;KACR;KACP,GAAI;KAEH;IACc,CAAA;GACD,CAAA;GACjB,CAAC,CAAC,aAAa,oBAAC,SAAS,WAAV,EAAA,UAAqB,UAA8B,CAAA;EACtD;;AAEnB,CAAC;AAED,iBAAiB,cAAc"}
|