@primer/react 0.0.0-20260623170141 → 0.0.0-20260623184653

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 (39) hide show
  1. package/CHANGELOG.md +10 -16
  2. package/dist/ConfirmationDialog/useConfirm.d.ts.map +1 -1
  3. package/dist/ConfirmationDialog/useConfirm.js +4 -8
  4. package/dist/Radio/Radio.d.ts.map +1 -1
  5. package/dist/Radio/Radio.js +1 -2
  6. package/dist/RadioGroup/RadioGroup.js +0 -1
  7. package/dist/RelativeTime/RelativeTime.js +0 -1
  8. package/dist/ScrollableRegion/ScrollableRegion.d.ts.map +1 -1
  9. package/dist/ScrollableRegion/ScrollableRegion.js +0 -1
  10. package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  11. package/dist/SegmentedControl/SegmentedControl.js +0 -1
  12. package/dist/SegmentedControl/SegmentedControlButton.d.ts.map +1 -1
  13. package/dist/SegmentedControl/SegmentedControlButton.js +0 -1
  14. package/dist/SegmentedControl/SegmentedControlIconButton.d.ts.map +1 -1
  15. package/dist/SegmentedControl/SegmentedControlIconButton.js +0 -1
  16. package/dist/Select/Select.d.ts.map +1 -1
  17. package/dist/Select/Select.js +2 -6
  18. package/dist/SideNav.d.ts.map +1 -1
  19. package/dist/SideNav.js +0 -2
  20. package/dist/Skeleton/SkeletonBox.d.ts +0 -1
  21. package/dist/Skeleton/SkeletonBox.d.ts.map +1 -1
  22. package/dist/Skeleton/SkeletonBox.js +47 -54
  23. package/dist/SkeletonText/SkeletonText.d.ts.map +1 -1
  24. package/dist/SkeletonText/SkeletonText.js +2 -2
  25. package/dist/Spinner/Spinner.js +0 -1
  26. package/dist/TextInput/TextInput.d.ts.map +1 -1
  27. package/dist/TextInput/TextInput.js +27 -68
  28. package/dist/Textarea/Textarea.d.ts.map +1 -1
  29. package/dist/Textarea/Textarea.js +158 -186
  30. package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
  31. package/dist/UnderlineNav/UnderlineNav.js +52 -12
  32. package/dist/_VisuallyHidden.js +2 -2
  33. package/dist/_VisuallyHidden.module.css.js +2 -2
  34. package/dist/live-region/Announce.d.ts.map +1 -1
  35. package/dist/live-region/Announce.js +51 -36
  36. package/dist/utils/character-counter.d.ts +16 -21
  37. package/dist/utils/character-counter.d.ts.map +1 -1
  38. package/dist/utils/character-counter.js +23 -59
  39. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,27 +1,21 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260623170141
3
+ ## 0.0.0-20260623184653
4
4
 
5
- ### Minor Changes
6
-
7
- - [#7991](https://github.com/primer/react/pull/7991) [`8d5609e`](https://github.com/primer/react/commit/8d5609e816db6cc8e548e73560363fc4e6fdb2dd) Thanks [@llastflowers](https://github.com/llastflowers)! - Add data-component attributes and associated tests for:
5
+ ### Patch Changes
8
6
 
9
- Radio
10
- RadioGroup
11
- RelativeTime
12
- ScrollableRegion
13
- SegmentedControl
14
- Select
15
- SideNav
16
- SkeletonBox
17
- SkeletonAvatar
18
- SkeletonText
19
- Spinner
7
+ - [#8021](https://github.com/primer/react/pull/8021) [`6131a94`](https://github.com/primer/react/commit/6131a9424b5bd5bb98b7ae05771d8187fe2f58cd) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Announce, AriaStatus, AriaAlert: Avoid an extra React render on every content change (e.g. per keystroke when tied to an input)
20
8
 
21
- ### Patch Changes
9
+ - [#7935](https://github.com/primer/react/pull/7935) [`5b3c806`](https://github.com/primer/react/commit/5b3c806305cfa09d33d42fc2957d55105725ea3b) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - ConfirmationDialog: `useConfirm`/`confirm` now removes its host element from `document.body` after the dialog is closed, and uses a fresh host element per call, so the empty container no longer lingers or leaks into other components and tests
22
10
 
23
11
  - Fake entry to force publishing
24
12
 
13
+ - [#8021](https://github.com/primer/react/pull/8021) [`6131a94`](https://github.com/primer/react/commit/6131a9424b5bd5bb98b7ae05771d8187fe2f58cd) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Textarea: Improve typing performance by deriving the character counter in render instead of in effects, removing extra re-renders on each keystroke.
14
+
15
+ - [#8021](https://github.com/primer/react/pull/8021) [`6131a94`](https://github.com/primer/react/commit/6131a9424b5bd5bb98b7ae05771d8187fe2f58cd) Thanks [@mattcosta7](https://github.com/mattcosta7)! - TextInput: Improve typing performance by deriving the character counter in render instead of in effects, removing extra re-renders on each keystroke.
16
+
17
+ - [#8037](https://github.com/primer/react/pull/8037) [`7749e0d`](https://github.com/primer/react/commit/7749e0da6eaf7baec66a106846e8159880cd434f) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Fix `UnderlineNav` not re-rendering when child tabs are added, removed, or reordered.
18
+
25
19
  ## 38.29.0
26
20
 
27
21
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"useConfirm.d.ts","sourceRoot":"","sources":["../../src/ConfirmationDialog/useConfirm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAqB,KAAK,uBAAuB,EAAC,MAAM,sBAAsB,CAAA;AAIrF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,CAAA;AA0BlG;;;;GAIG;AACH,wBAAgB,UAAU,cACa,cAAc,sBAIpD"}
1
+ {"version":3,"file":"useConfirm.d.ts","sourceRoot":"","sources":["../../src/ConfirmationDialog/useConfirm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAqB,KAAK,uBAAuB,EAAC,MAAM,sBAAsB,CAAA;AAErF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,CAAA;AAuBlG;;;;GAIG;AACH,wBAAgB,UAAU,cACa,cAAc,sBAIpD"}
@@ -3,23 +3,19 @@ import { createRoot } from 'react-dom/client';
3
3
  import BaseStyles from '../BaseStyles.js';
4
4
  import { ConfirmationDialog } from './ConfirmationDialog.js';
5
5
 
6
- let hostElement = null;
7
6
  async function confirm(options) {
8
7
  const {
9
8
  content,
10
9
  ...confirmationDialogProps
11
10
  } = options;
12
11
  return new Promise(resolve => {
13
- hostElement ||= document.createElement('div');
14
- if (!hostElement.isConnected) document.body.append(hostElement);
12
+ const hostElement = document.createElement('div');
13
+ document.body.append(hostElement);
15
14
  const root = createRoot(hostElement);
16
15
  const onClose = gesture => {
17
16
  root.unmount();
18
- if (gesture === 'confirm') {
19
- resolve(true);
20
- } else {
21
- resolve(false);
22
- }
17
+ hostElement.remove();
18
+ resolve(gesture === 'confirm');
23
19
  };
24
20
  root.render(/*#__PURE__*/React.createElement(BaseStyles, null, /*#__PURE__*/React.createElement(ConfirmationDialog, {
25
21
  ...confirmationDialogProps,
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../src/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,mBAAmB,EAAe,MAAM,OAAO,CAAA;AAChF,OAAO,KAAmB,MAAM,OAAO,CAAA;AAKvC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAElD,MAAM,MAAM,UAAU,GAAG;IACvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;AAEzC;;GAEG;AACH,QAAA,MAAM,KAAK,kGA+CV,CAAA;wBAKuB,cAAc,CAAC,OAAO,KAAK,CAAC;AAApD,wBAAoD"}
1
+ {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../src/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,mBAAmB,EAAe,MAAM,OAAO,CAAA;AAChF,OAAO,KAAmB,MAAM,OAAO,CAAA;AAKvC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAElD,MAAM,MAAM,UAAU,GAAG;IACvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;AAEzC;;GAEG;AACH,QAAA,MAAM,KAAK,kGA8CV,CAAA;wBAKuB,cAAc,CAAC,OAAO,KAAK,CAAC;AAApD,wBAAoD"}
@@ -94,8 +94,7 @@ const Radio = /*#__PURE__*/React.forwardRef((t0, ref) => {
94
94
  required: required,
95
95
  onChange: handleOnChange,
96
96
  className: t4,
97
- ...rest,
98
- "data-component": "Radio"
97
+ ...rest
99
98
  });
100
99
  $[15] = checked;
101
100
  $[16] = disabled;
@@ -87,7 +87,6 @@ const RadioGroup = t0 => {
87
87
  if ($[16] !== children || $[17] !== disabled || $[18] !== rest) {
88
88
  t4 = /*#__PURE__*/jsx(CheckboxOrRadioGroup, {
89
89
  disabled: disabled,
90
- "data-component": "RadioGroup",
91
90
  ...rest,
92
91
  children: children
93
92
  });
@@ -65,7 +65,6 @@ function RelativeTime(t0) {
65
65
  ...props,
66
66
  date: date,
67
67
  "no-title": t1,
68
- "data-component": "RelativeTime",
69
68
  children: t2
70
69
  });
71
70
  $[11] = date;
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollableRegion.d.ts","sourceRoot":"","sources":["../../src/ScrollableRegion/ScrollableRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,KAAK,QAAQ,GACT;IACE,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,KAAK,CAAA;CAC1B,GACD;IACE,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAEL,KAAK,qBAAqB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAA;AAE7E,iBAAS,gBAAgB,CAAC,EACxB,YAAY,EAAE,KAAK,EACnB,iBAAiB,EAAE,UAAU,EAC7B,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,qBAAqB,qBAuBvB;AAED,OAAO,EAAC,gBAAgB,EAAC,CAAA;AACzB,YAAY,EAAC,qBAAqB,EAAC,CAAA"}
1
+ {"version":3,"file":"ScrollableRegion.d.ts","sourceRoot":"","sources":["../../src/ScrollableRegion/ScrollableRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,KAAK,QAAQ,GACT;IACE,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,KAAK,CAAA;CAC1B,GACD;IACE,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAEL,KAAK,qBAAqB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAA;AAE7E,iBAAS,gBAAgB,CAAC,EACxB,YAAY,EAAE,KAAK,EACnB,iBAAiB,EAAE,UAAU,EAC7B,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,qBAAqB,qBAiBvB;AAED,OAAO,EAAC,gBAAgB,EAAC,CAAA;AACzB,YAAY,EAAC,qBAAqB,EAAC,CAAA"}
@@ -66,7 +66,6 @@ function ScrollableRegion(t0) {
66
66
  ...regionProps,
67
67
  ref: ref,
68
68
  className: t2,
69
- "data-component": "ScrollableRegion",
70
69
  children: children
71
70
  });
72
71
  $[12] = children;
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAC7C,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,0BAA0B,CAAA;AAEzE,OAAO,KAAK,EAAC,+BAA+B,EAAC,MAAM,8BAA8B,CAAA;AAIjF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAEhE,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAA;AAMhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAC9C,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,8BAA8B;IAC9B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC,CAAA;IACxG,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAuMD,eAAO,MAAM,gBAAgB;;;CAG3B,CAAA"}
1
+ {"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAC7C,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,0BAA0B,CAAA;AAEzE,OAAO,KAAK,EAAC,+BAA+B,EAAC,MAAM,8BAA8B,CAAA;AAIjF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAEhE,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,kCAAkC,CAAA;AAMhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAC9C,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,8BAA8B;IAC9B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC,CAAA;IACxG,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAsMD,eAAO,MAAM,gBAAgB;;;CAG3B,CAAA"}
@@ -226,7 +226,6 @@ const Root = t0 => {
226
226
  ...t7,
227
227
  "data-size": size,
228
228
  ...rest,
229
- "data-component": "SegmentedControl",
230
229
  children: t8
231
230
  });
232
231
  $[41] = ariaLabel;
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlButton.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControlButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAMrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,2BAA2B,GAAG;IACxC,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,oKAAoK;IACpK,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sKAAsK;IACtK,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iDAAiD;IAEjD,aAAa,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACrG,wFAAwF;IAExF,WAAW,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACnG,gHAAgH;IAChH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB,GAAG,oBAAoB,CAAC,iBAAiB,GAAG,aAAa,CAAC,CAAA;AAE3D,QAAA,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CA6ClG,CAAA;AAED,eAAe,sBAAsB,CAAA"}
1
+ {"version":3,"file":"SegmentedControlButton.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControlButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAMrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,2BAA2B,GAAG;IACxC,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,oKAAoK;IACpK,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sKAAsK;IACtK,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iDAAiD;IAEjD,aAAa,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACrG,wFAAwF;IAExF,WAAW,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACnG,gHAAgH;IAChH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB,GAAG,oBAAoB,CAAC,iBAAiB,GAAG,aAAa,CAAC,CAAA;AAE3D,QAAA,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAyClG,CAAA;AAED,eAAe,sBAAsB,CAAA"}
@@ -174,7 +174,6 @@ const SegmentedControlButton = t0 => {
174
174
  t12 = /*#__PURE__*/jsx("li", {
175
175
  className: t1,
176
176
  "data-selected": t2,
177
- "data-component": "SegmentedControl.Button",
178
177
  children: t11
179
178
  });
180
179
  $[33] = t11;
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlIconButton.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControlIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAA;AAIlD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,0DAA0D;IAE1D,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC3F,8JAA8J;IAC9J,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kKAAkK;IAClK,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG,oBAAoB,CAAC,iBAAiB,GAAG,aAAa,CAAC,CAAA;AAE3D,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,CAqCjH,CAAA;AAID,eAAe,0BAA0B,CAAA"}
1
+ {"version":3,"file":"SegmentedControlIconButton.d.ts","sourceRoot":"","sources":["../../src/SegmentedControl/SegmentedControlIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAA;AAIlD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,0DAA0D;IAE1D,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC3F,8JAA8J;IAC9J,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kKAAkK;IAClK,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG,oBAAoB,CAAC,iBAAiB,GAAG,aAAa,CAAC,CAAA;AAE3D,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,CAiCjH,CAAA;AAID,eAAe,0BAA0B,CAAA"}
@@ -146,7 +146,6 @@ const SegmentedControlIconButton = t0 => {
146
146
  t13 = /*#__PURE__*/jsx("li", {
147
147
  className: t1,
148
148
  "data-selected": t2,
149
- "data-component": "SegmentedControl.IconButton",
150
149
  children: t12
151
150
  });
152
151
  $[31] = t1;
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAA;AAE/E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAI/F,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,UAAU,CAAC,EAC/F,UAAU,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,IAAI,CAC7D,GAAG;IACF,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;;;;eAqE2F,MAAM;;;;AAQlG,wBAIE"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAA;AAE/E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAI/F,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,UAAU,CAAC,EAC/F,UAAU,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,IAAI,CAC7D,GAAG;IACF,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;;;;eAoE2F,MAAM;;;;AAQlG,wBAIE"}
@@ -137,7 +137,6 @@ const Select = /*#__PURE__*/React.forwardRef((t0, ref) => {
137
137
  value: "",
138
138
  disabled: required,
139
139
  hidden: required,
140
- "data-component": "Select.Option",
141
140
  children: placeholder
142
141
  });
143
142
  $[15] = placeholder;
@@ -157,7 +156,6 @@ const Select = /*#__PURE__*/React.forwardRef((t0, ref) => {
157
156
  className: t4,
158
157
  "data-hasplaceholder": t5,
159
158
  defaultValue: t6,
160
- "data-component": "Select",
161
159
  children: [t7, children]
162
160
  });
163
161
  $[18] = children;
@@ -210,8 +208,7 @@ const Option = props => {
210
208
  let t0;
211
209
  if ($[0] !== props) {
212
210
  t0 = /*#__PURE__*/jsx("option", {
213
- ...props,
214
- "data-component": "Select.Option"
211
+ ...props
215
212
  });
216
213
  $[0] = props;
217
214
  $[1] = t0;
@@ -225,8 +222,7 @@ const OptGroup = props => {
225
222
  let t0;
226
223
  if ($[0] !== props) {
227
224
  t0 = /*#__PURE__*/jsx("optgroup", {
228
- ...props,
229
- "data-component": "Select.OptGroup"
225
+ ...props
230
226
  });
231
227
  $[0] = props;
232
228
  $[1] = t0;
@@ -1 +1 @@
1
- {"version":3,"file":"SideNav.d.ts","sourceRoot":"","sources":["../src/SideNav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,eAAe,CAAA;AACjD,OAAa,EAAC,KAAK,SAAS,EAAC,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAI5C,KAAK,gBAAgB,GAAG;IACtB,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,OAAO,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,iBAAS,OAAO,CAAC,EACf,EAAE,EAAE,SAAiB,EACrB,OAAkB,EAClB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EAAE,SAAS,GACxB,EAAE,gBAAgB,qBAkBlB;AAED,KAAK,sBAAsB,GAAG,iBAAiB,CAAC;IAC9C,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,QAAQ,CAAC,EAA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,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAC5B,CAAC,GACA,SAAS,CAAA;AAEX,QAAA,MAAM,WAAW;8DAA2D,sBAAsB;;CAUjG,CAAA;AAID,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,CAAA;AACzD,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAA;AAEjE,4EAA4E;;;kEAjBA,sBAAsB;;;;AAkBlG,wBAA0D"}
package/dist/SideNav.js CHANGED
@@ -18,7 +18,6 @@ function SideNav({
18
18
  return /*#__PURE__*/jsx(Component, {
19
19
  className: newClassName,
20
20
  "aria-label": ariaLabel,
21
- "data-component": "SideNav",
22
21
  children: children
23
22
  });
24
23
  }
@@ -41,7 +40,6 @@ const SideNavLink = ({
41
40
  "aria-current": isReactRouter || selected ? 'page' : undefined,
42
41
  className: newClassName,
43
42
  ...rest,
44
- "data-component": "SideNav.Link",
45
43
  children: children
46
44
  });
47
45
  };
@@ -9,7 +9,6 @@ export type SkeletonBoxProps = {
9
9
  className?: string;
10
10
  /** Controls whether and how long to delay rendering the SkeletonBox. Set to 'short' to delay by 300ms, 'long' to delay by 1000ms, or provide a custom number of milliseconds.*/
11
11
  delay?: 'short' | 'long' | number;
12
- 'data-component'?: string;
13
12
  } & HTMLProps<HTMLElement>;
14
13
  export declare const SkeletonBox: React.ForwardRefExoticComponent<Omit<SkeletonBoxProps, "ref"> & React.RefAttributes<HTMLElement>>;
15
14
  //# sourceMappingURL=SkeletonBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SkeletonBox.d.ts","sourceRoot":"","sources":["../../src/Skeleton/SkeletonBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAC,KAAK,aAAa,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAA;AAIxD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,0EAA0E;IAC1E,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAChC,wEAAwE;IACxE,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9B,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gLAAgL;IAChL,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,SAAS,CAAC,WAAW,CAAC,CAAA;AAE1B,eAAO,MAAM,WAAW,mGAgCtB,CAAA"}
1
+ {"version":3,"file":"SkeletonBox.d.ts","sourceRoot":"","sources":["../../src/Skeleton/SkeletonBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAC,KAAK,aAAa,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAA;AAIxD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,0EAA0E;IAC1E,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAChC,wEAAwE;IACxE,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9B,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gLAAgL;IAChL,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;CAClC,GAAG,SAAS,CAAC,WAAW,CAAC,CAAA;AAE1B,eAAO,MAAM,WAAW,mGA+BtB,CAAA"}
@@ -5,13 +5,12 @@ import classes from './SkeletonBox.module.css.js';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  const SkeletonBox = /*#__PURE__*/React.forwardRef(function SkeletonBox(t0, ref) {
8
- const $ = c(25);
8
+ const $ = c(23);
9
9
  let className;
10
10
  let delay;
11
11
  let height;
12
12
  let props;
13
13
  let style;
14
- let t1;
15
14
  let width;
16
15
  if ($[0] !== t0) {
17
16
  ({
@@ -20,7 +19,6 @@ const SkeletonBox = /*#__PURE__*/React.forwardRef(function SkeletonBox(t0, ref)
20
19
  className,
21
20
  style,
22
21
  delay,
23
- "data-component": t1,
24
22
  ...props
25
23
  } = t0);
26
24
  $[0] = t0;
@@ -29,23 +27,20 @@ const SkeletonBox = /*#__PURE__*/React.forwardRef(function SkeletonBox(t0, ref)
29
27
  $[3] = height;
30
28
  $[4] = props;
31
29
  $[5] = style;
32
- $[6] = t1;
33
- $[7] = width;
30
+ $[6] = width;
34
31
  } else {
35
32
  className = $[1];
36
33
  delay = $[2];
37
34
  height = $[3];
38
35
  props = $[4];
39
36
  style = $[5];
40
- t1 = $[6];
41
- width = $[7];
37
+ width = $[6];
42
38
  }
43
- const dataComponent = t1 === undefined ? "SkeletonBox" : t1;
44
39
  const [isVisible, setIsVisible] = useState(!delay);
40
+ let t1;
45
41
  let t2;
46
- let t3;
47
- if ($[8] !== delay) {
48
- t2 = () => {
42
+ if ($[7] !== delay) {
43
+ t1 = () => {
49
44
  if (delay) {
50
45
  const timeoutId = setTimeout(() => {
51
46
  setIsVisible(true);
@@ -53,68 +48,66 @@ const SkeletonBox = /*#__PURE__*/React.forwardRef(function SkeletonBox(t0, ref)
53
48
  return () => clearTimeout(timeoutId);
54
49
  }
55
50
  };
56
- t3 = [delay];
57
- $[8] = delay;
51
+ t2 = [delay];
52
+ $[7] = delay;
53
+ $[8] = t1;
58
54
  $[9] = t2;
59
- $[10] = t3;
60
55
  } else {
56
+ t1 = $[8];
61
57
  t2 = $[9];
62
- t3 = $[10];
63
58
  }
64
- useEffect(t2, t3);
59
+ useEffect(t1, t2);
65
60
  if (!isVisible) {
66
61
  return null;
67
62
  }
68
- const t4 = ref;
69
- let t5;
70
- if ($[11] !== className) {
71
- t5 = clsx(className, classes.SkeletonBox);
72
- $[11] = className;
73
- $[12] = t5;
63
+ const t3 = ref;
64
+ let t4;
65
+ if ($[10] !== className) {
66
+ t4 = clsx(className, classes.SkeletonBox);
67
+ $[10] = className;
68
+ $[11] = t4;
74
69
  } else {
75
- t5 = $[12];
70
+ t4 = $[11];
76
71
  }
77
- let t6;
78
- if ($[13] !== style) {
79
- t6 = style || {};
80
- $[13] = style;
81
- $[14] = t6;
72
+ let t5;
73
+ if ($[12] !== style) {
74
+ t5 = style || {};
75
+ $[12] = style;
76
+ $[13] = t5;
82
77
  } else {
83
- t6 = $[14];
78
+ t5 = $[13];
84
79
  }
85
- let t7;
86
- if ($[15] !== height || $[16] !== t6 || $[17] !== width) {
87
- t7 = {
80
+ let t6;
81
+ if ($[14] !== height || $[15] !== t5 || $[16] !== width) {
82
+ t6 = {
88
83
  height,
89
84
  width,
90
- ...t6
85
+ ...t5
91
86
  };
92
- $[15] = height;
93
- $[16] = t6;
94
- $[17] = width;
95
- $[18] = t7;
87
+ $[14] = height;
88
+ $[15] = t5;
89
+ $[16] = width;
90
+ $[17] = t6;
96
91
  } else {
97
- t7 = $[18];
92
+ t6 = $[17];
98
93
  }
99
- let t8;
100
- if ($[19] !== dataComponent || $[20] !== props || $[21] !== t4 || $[22] !== t5 || $[23] !== t7) {
101
- t8 = /*#__PURE__*/jsx("div", {
102
- ref: t4,
103
- className: t5,
104
- style: t7,
105
- ...props,
106
- "data-component": dataComponent
94
+ let t7;
95
+ if ($[18] !== props || $[19] !== t3 || $[20] !== t4 || $[21] !== t6) {
96
+ t7 = /*#__PURE__*/jsx("div", {
97
+ ref: t3,
98
+ className: t4,
99
+ style: t6,
100
+ ...props
107
101
  });
108
- $[19] = dataComponent;
109
- $[20] = props;
110
- $[21] = t4;
111
- $[22] = t5;
112
- $[23] = t7;
113
- $[24] = t8;
102
+ $[18] = props;
103
+ $[19] = t3;
104
+ $[20] = t4;
105
+ $[21] = t6;
106
+ $[22] = t7;
114
107
  } else {
115
- t8 = $[24];
108
+ t7 = $[22];
116
109
  }
117
- return t8;
110
+ return t7;
118
111
  });
119
112
 
120
113
  export { SkeletonBox };
@@ -1 +1 @@
1
- {"version":3,"file":"SkeletonText.d.ts","sourceRoot":"","sources":["../../src/SkeletonText/SkeletonText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAA;AAKpC,UAAU,iBAAkB,SAAQ,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IACtE,uDAAuD;IACvD,IAAI,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,CAAA;IACtH,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;IAC1C,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,iBAAS,YAAY,CAAC,EAAC,KAAS,EAAE,QAAQ,EAAE,IAAmB,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAC,EAAE,iBAAiB,qBAuC7G;AAED,OAAO,EAAC,YAAY,EAAC,CAAA;AACrB,YAAY,EAAC,iBAAiB,EAAC,CAAA"}
1
+ {"version":3,"file":"SkeletonText.d.ts","sourceRoot":"","sources":["../../src/SkeletonText/SkeletonText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAA;AAKpC,UAAU,iBAAkB,SAAQ,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IACtE,uDAAuD;IACvD,IAAI,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,CAAA;IACtH,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;IAC1C,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,iBAAS,YAAY,CAAC,EAAC,KAAS,EAAE,QAAQ,EAAE,IAAmB,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAC,EAAE,iBAAiB,qBAsC7G;AAED,OAAO,EAAC,YAAY,EAAC,CAAA;AACrB,YAAY,EAAC,iBAAiB,EAAC,CAAA"}
@@ -62,12 +62,12 @@ function SkeletonText(t0) {
62
62
  let t5;
63
63
  if ($[12] !== rest || $[13] !== size || $[14] !== t3 || $[15] !== t4) {
64
64
  t5 = /*#__PURE__*/jsx(SkeletonBox, {
65
+ "data-component": "SkeletonText",
65
66
  "data-text-skeleton-size": size,
66
67
  width: "100%",
67
68
  className: t3,
68
69
  style: t4,
69
- ...rest,
70
- "data-component": "SkeletonText"
70
+ ...rest
71
71
  });
72
72
  $[12] = rest;
73
73
  $[13] = size;
@@ -191,7 +191,6 @@ function Spinner(t0) {
191
191
  if ($[32] !== t14 || $[33] !== t15) {
192
192
  t16 = /*#__PURE__*/jsxs("span", {
193
193
  className: classes.Box,
194
- "data-component": "Spinner",
195
194
  children: [t14, t15]
196
195
  });
197
196
  $[32] = t14;
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwD,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAO/F,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAA;AAQ/E,MAAM,MAAM,4BAA4B,GAAG;IACzC,uEAAuE;IACvE,IAA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AM,4BAA4B,GAAG;IACzC,uEAAuE;IACvE,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;QAKI;IACJ,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;IAChD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACnD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACpD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;IACvE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,OAAO,CACT,IAAI,CACF,kBAAkB,EAChB,OAAO,GACP,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,GACT,MAAM,GACN,kBAAkB,CACrB,CACF,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,4BAA4B,CAAC,CAAA;;;;;;;;;;;AAyNzG,wBAGE"}
@@ -1,4 +1,4 @@
1
- import React, { useState, useRef, useId, useCallback, useEffect } from 'react';
1
+ import React, { useState, useId, useCallback } from 'react';
2
2
  import { isValidElementType } from 'react-is';
3
3
  import { clsx } from 'clsx';
4
4
  import { AlertFillIcon } from '@primer/octicons-react';
@@ -8,9 +8,11 @@ import { TextInputWrapper } from '../internal/components/TextInputWrapper.js';
8
8
  import TextInputAction from '../internal/components/TextInputInnerAction.js';
9
9
  import UnstyledTextInput from '../internal/components/UnstyledTextInput.js';
10
10
  import VisuallyHidden from '../_VisuallyHidden.js';
11
- import { CharacterCounter } from '../utils/character-counter.js';
11
+ import visuallyHiddenClasses from '../_VisuallyHidden.module.css.js';
12
+ import { SCREEN_READER_DELAY, getCharacterCountState } from '../utils/character-counter.js';
12
13
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
13
14
  import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
15
+ import { AriaStatus } from '../live-region/AriaStatus.js';
14
16
  import Text from '../Text/Text.js';
15
17
 
16
18
  // using forwardRef is important so that other components can autofocus the input
@@ -46,16 +48,22 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
46
48
  'data-component': dataComponent,
47
49
  ...inputProps
48
50
  }, ref) => {
51
+ var _counter$isOverLimit;
49
52
  const [isInputFocused, setIsInputFocused] = useState(false);
50
53
  const inputRef = useProvidedRefOrCreate(ref);
51
- const [characterCount, setCharacterCount] = useState('');
52
- const [isOverLimit, setIsOverLimit] = useState(false);
53
- const [screenReaderMessage, setScreenReaderMessage] = useState('');
54
- const characterCounterRef = useRef(null);
55
- const lastCountedLengthRef = useRef(null);
56
- const lastCharacterCountRef = useRef('');
57
- const lastIsOverLimitRef = useRef(false);
58
- const lastScreenReaderMessageRef = useRef('');
54
+
55
+ // For uncontrolled usage we track the length of the input's content so the
56
+ // character counter can be derived during render rather than synced from an
57
+ // effect (which would trigger an extra render on every keystroke). For
58
+ // controlled usage the `value` prop is the source of truth.
59
+ const isControlled = value !== undefined;
60
+ const [uncontrolledLength, setUncontrolledLength] = useState(() => defaultValue !== undefined ? String(defaultValue).length : 0);
61
+ const currentLength = isControlled ? String(value).length : uncontrolledLength;
62
+
63
+ // The counter and validation state are derived directly from the current
64
+ // length, so they stay in sync with the input without an extra render.
65
+ const counter = characterLimit ? getCharacterCountState(currentLength, characterLimit) : undefined;
66
+ const isOverLimit = (_counter$isOverLimit = counter === null || counter === void 0 ? void 0 : counter.isOverLimit) !== null && _counter$isOverLimit !== void 0 ? _counter$isOverLimit : false;
59
67
 
60
68
  // this class is necessary to style FilterSearch, plz no touchy!
61
69
  const wrapperClasses = clsx(className, 'TextInput-wrapper');
@@ -84,63 +92,13 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
84
92
  onBlur && onBlur(e_1);
85
93
  }, [onBlur]);
86
94
 
87
- // Initialize character counter
88
- useEffect(() => {
89
- if (characterLimit) {
90
- characterCounterRef.current = new CharacterCounter({
91
- onCountUpdate: (count, overLimit, message) => {
92
- if (message !== lastCharacterCountRef.current) {
93
- lastCharacterCountRef.current = message;
94
- setCharacterCount(message);
95
- }
96
- if (overLimit !== lastIsOverLimitRef.current) {
97
- lastIsOverLimitRef.current = overLimit;
98
- setIsOverLimit(overLimit);
99
- }
100
- },
101
- onScreenReaderAnnounce: message_0 => {
102
- if (message_0 !== lastScreenReaderMessageRef.current) {
103
- lastScreenReaderMessageRef.current = message_0;
104
- setScreenReaderMessage(message_0);
105
- }
106
- }
107
- });
108
- lastCountedLengthRef.current = null;
109
- return () => {
110
- var _characterCounterRef$;
111
- (_characterCounterRef$ = characterCounterRef.current) === null || _characterCounterRef$ === void 0 ? void 0 : _characterCounterRef$.cleanup();
112
- characterCounterRef.current = null;
113
- lastCountedLengthRef.current = null;
114
- lastCharacterCountRef.current = '';
115
- lastIsOverLimitRef.current = false;
116
- lastScreenReaderMessageRef.current = '';
117
- };
118
- }
119
- }, [characterLimit]);
120
-
121
- // Update character count when value changes or on mount
122
- useEffect(() => {
123
- if (characterLimit && characterCounterRef.current) {
124
- const currentValue = value !== undefined ? String(value) : defaultValue !== undefined ? String(defaultValue) : '';
125
- const currentLength = currentValue.length;
126
- if (currentLength !== lastCountedLengthRef.current) {
127
- lastCountedLengthRef.current = currentLength;
128
- characterCounterRef.current.updateCharacterCount(currentLength, characterLimit);
129
- }
130
- }
131
- }, [value, defaultValue, characterLimit]);
132
-
133
95
  // Handle input change with character counter
134
96
  const handleInputChange = useCallback(e_2 => {
135
- if (characterLimit && characterCounterRef.current) {
136
- const currentLength_0 = e_2.target.value.length;
137
- if (currentLength_0 !== lastCountedLengthRef.current) {
138
- lastCountedLengthRef.current = currentLength_0;
139
- characterCounterRef.current.updateCharacterCount(currentLength_0, characterLimit);
140
- }
97
+ if (characterLimit && !isControlled) {
98
+ setUncontrolledLength(e_2.target.value.length);
141
99
  }
142
100
  onChange === null || onChange === void 0 ? void 0 : onChange(e_2);
143
- }, [onChange, characterLimit]);
101
+ }, [onChange, characterLimit, isControlled]);
144
102
  const characterCountId = useId();
145
103
  const characterCountStaticMessageId = useId();
146
104
  const isValid = isOverLimit ? 'error' : validationStatus;
@@ -202,10 +160,11 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
202
160
  children: typeof TrailingVisual !== 'string' && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual
203
161
  }), trailingAction]
204
162
  }), characterLimit && /*#__PURE__*/jsxs(Fragment, {
205
- children: [/*#__PURE__*/jsx(VisuallyHidden, {
206
- "aria-live": "polite",
207
- role: "status",
208
- children: screenReaderMessage
163
+ children: [/*#__PURE__*/jsx(AriaStatus, {
164
+ announceOnShow: false,
165
+ delayMs: SCREEN_READER_DELAY,
166
+ className: visuallyHiddenClasses.InternalVisuallyHidden,
167
+ children: counter === null || counter === void 0 ? void 0 : counter.message
209
168
  }), /*#__PURE__*/jsxs(VisuallyHidden, {
210
169
  id: characterCountStaticMessageId,
211
170
  children: ["You can enter up to ", characterLimit, " ", characterLimit === 1 ? 'character' : 'characters']
@@ -217,7 +176,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
217
176
  "data-component": "TextInput.CharacterCounter",
218
177
  children: [isOverLimit && /*#__PURE__*/jsx(AlertFillIcon, {
219
178
  size: 16
220
- }), characterCount]
179
+ }), counter === null || counter === void 0 ? void 0 : counter.message]
221
180
  })]
222
181
  })]
223
182
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","source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