@primer/react 0.0.0-20260513162402 → 0.0.0-20260513164524

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260513162402
3
+ ## 0.0.0-20260513164524
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -96,7 +96,7 @@ const CheckboxGroup = t0 => {
96
96
  let t5;
97
97
  if ($[17] !== children || $[18] !== disabled || $[19] !== rest) {
98
98
  t5 = /*#__PURE__*/jsx(CheckboxOrRadioGroup, {
99
- parentName: "CheckboxGroup",
99
+ "data-component": "CheckboxGroup",
100
100
  disabled: disabled,
101
101
  ...rest,
102
102
  children: children
@@ -1,7 +1,5 @@
1
1
  import React from 'react';
2
2
  export type CheckboxOrRadioGroupProps = {
3
- /** Parent name for using data-component with either CheckboxGroup or RadioGroup and sub-components */
4
- parentName?: string;
5
3
  /** Class name for custom styling */
6
4
  className?: string;
7
5
  /**
@@ -21,6 +19,7 @@ export type CheckboxOrRadioGroupProps = {
21
19
  * If true, the user must make a selection before the owning form can be submitted
22
20
  */
23
21
  required?: boolean;
22
+ 'data-component'?: string;
24
23
  };
25
24
  export type { CheckboxOrRadioGroupLabelProps } from './CheckboxOrRadioGroupLabel';
26
25
  declare const _default: React.FC<React.PropsWithChildren<CheckboxOrRadioGroupProps>> & {
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxOrRadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,MAAM,MAAM,yBAAyB,GAAG;IACtC,sGAAsG;IACtG,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,CAAC,iBAAiB,CAAC,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AA4HD,YAAY,EAAC,8BAA8B,EAAC,MAAM,6BAA6B,CAAA;;;;;;;;;;AAC/E,wBAIE"}
1
+ {"version":3,"file":"CheckboxOrRadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,MAAM,MAAM,yBAAyB,GAAG;IACtC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,CAAC,iBAAiB,CAAC,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AA4HD,YAAY,EAAC,8BAA8B,EAAC,MAAM,6BAA6B,CAAA;;;;;;;;;;AAC/E,wBAIE"}
@@ -13,13 +13,13 @@ import { isSlot } from '../../../utils/is-slot.js';
13
13
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
14
14
 
15
15
  const CheckboxOrRadioGroup = ({
16
- parentName,
17
16
  'aria-labelledby': ariaLabelledby,
18
17
  children,
19
18
  disabled = false,
20
19
  id: idProp,
21
20
  required = false,
22
- className
21
+ className,
22
+ 'data-component': dataComponentProp
23
23
  }) => {
24
24
  const [slots, rest] = useSlots(children, {
25
25
  caption: CheckboxOrRadioGroupCaption,
@@ -45,11 +45,11 @@ const CheckboxOrRadioGroup = ({
45
45
  required,
46
46
  captionId,
47
47
  validationMessageId,
48
- parentName
48
+ parentName: dataComponentProp
49
49
  },
50
50
  children: /*#__PURE__*/jsxs("div", {
51
51
  children: [/*#__PURE__*/jsxs(Component, {
52
- "data-component": parentName,
52
+ "data-component": dataComponentProp,
53
53
  className: clsx(className, classes.GroupFieldset),
54
54
  "data-validation": validationChild ? '' : undefined,
55
55
  ...(labelChild ? {
@@ -16,7 +16,7 @@ const CheckboxOrRadioGroupCaption = ({
16
16
  return /*#__PURE__*/jsx(Text, {
17
17
  className: clsx(className, classes.CheckboxOrRadioGroupCaption),
18
18
  id: captionId,
19
- "data-component": parentName && `${parentName}.Caption`,
19
+ "data-component": parentName ? `${parentName}.Caption` : undefined,
20
20
  children: children
21
21
  });
22
22
  };
@@ -21,7 +21,7 @@ const CheckboxOrRadioGroupLabel = ({
21
21
  isVisible: !visuallyHidden,
22
22
  title: required ? 'required field' : undefined,
23
23
  "data-label-disabled": disabled ? '' : undefined,
24
- "data-component": parentName && `${parentName}.Label`,
24
+ "data-component": parentName ? `${parentName}.Label` : undefined,
25
25
  children: required ? /*#__PURE__*/jsxs(Stack, {
26
26
  direction: "horizontal",
27
27
  gap: "none",
@@ -14,7 +14,7 @@ const CheckboxOrRadioGroupValidation = ({
14
14
  return /*#__PURE__*/jsx(InputValidation, {
15
15
  validationStatus: variant,
16
16
  id: validationMessageId,
17
- "data-component": parentName && `${parentName}.Validation`,
17
+ "data-component": parentName ? `${parentName}.Validation` : undefined,
18
18
  children: children
19
19
  });
20
20
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260513162402",
4
+ "version": "0.0.0-20260513164524",
5
5
  "description": "An implementation of GitHub's Primer Design System using React",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",