@primer/react 0.0.0-20260218182609 → 0.0.0-20260218205658

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 (58) hide show
  1. package/CHANGELOG.md +4 -24
  2. package/dist/ActionList/Description.js +35 -113
  3. package/dist/ActionList/Divider.js +11 -30
  4. package/dist/ActionList/Group.js +117 -294
  5. package/dist/ActionList/Heading.js +22 -77
  6. package/dist/ActionList/Item.d.ts.map +1 -1
  7. package/dist/ActionList/Item.js +209 -679
  8. package/dist/ActionList/LinkItem.js +24 -80
  9. package/dist/ActionList/List.d.ts.map +1 -1
  10. package/dist/ActionList/List.js +33 -144
  11. package/dist/ActionList/Selection.js +30 -78
  12. package/dist/ActionList/TrailingAction.js +23 -83
  13. package/dist/ActionList/Visuals.js +64 -162
  14. package/dist/Banner/Banner.d.ts.map +1 -1
  15. package/dist/Banner/Banner.js +62 -72
  16. package/dist/Button/Button.js +11 -34
  17. package/dist/Button/ButtonBase.d.ts.map +1 -1
  18. package/dist/Button/ButtonBase.js +14 -9
  19. package/dist/Button/IconButton.js +51 -140
  20. package/dist/Button/LinkButton.js +11 -39
  21. package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css +2 -0
  22. package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css.map +1 -0
  23. package/dist/FilteredActionList/FilteredActionList.module.css.js +2 -2
  24. package/dist/PageLayout/PageLayout-06f4c069.css +2 -0
  25. package/dist/PageLayout/PageLayout-06f4c069.css.map +1 -0
  26. package/dist/PageLayout/PageLayout.d.ts +71 -2
  27. package/dist/PageLayout/PageLayout.d.ts.map +1 -1
  28. package/dist/PageLayout/PageLayout.js +498 -44
  29. package/dist/PageLayout/PageLayout.module.css.js +2 -2
  30. package/dist/PageLayout/usePaneWidth.d.ts +16 -4
  31. package/dist/PageLayout/usePaneWidth.d.ts.map +1 -1
  32. package/dist/PageLayout/usePaneWidth.js +123 -109
  33. package/dist/SplitPageLayout/SplitPageLayout.d.ts +4 -1
  34. package/dist/SplitPageLayout/SplitPageLayout.d.ts.map +1 -1
  35. package/dist/SplitPageLayout/SplitPageLayout.js +54 -2
  36. package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
  37. package/dist/UnderlineNav/UnderlineNav.js +4 -11
  38. package/dist/experimental/SelectPanel2/SelectPanel-1f8c23b5.css +2 -0
  39. package/dist/experimental/SelectPanel2/{SelectPanel-f0c4b9ca.css.map → SelectPanel-1f8c23b5.css.map} +1 -1
  40. package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +1 -1
  41. package/dist/hooks/useIsMacOS.d.ts +3 -15
  42. package/dist/hooks/useIsMacOS.d.ts.map +1 -1
  43. package/dist/hooks/useIsMacOS.js +26 -24
  44. package/dist/internal/components/UnderlineTabbedInterface-20c3ba3d.css +2 -0
  45. package/dist/internal/components/UnderlineTabbedInterface-20c3ba3d.css.map +1 -0
  46. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
  47. package/dist/live-region/Announce.d.ts.map +1 -1
  48. package/dist/live-region/Announce.js +4 -7
  49. package/dist/utils/environment.js +9 -0
  50. package/generated/components.json +200 -2
  51. package/package.json +2 -2
  52. package/dist/FilteredActionList/FilteredActionList-02db90c6.css +0 -2
  53. package/dist/FilteredActionList/FilteredActionList-02db90c6.css.map +0 -1
  54. package/dist/PageLayout/PageLayout-cb491b47.css +0 -2
  55. package/dist/PageLayout/PageLayout-cb491b47.css.map +0 -1
  56. package/dist/experimental/SelectPanel2/SelectPanel-f0c4b9ca.css +0 -2
  57. package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +0 -2
  58. package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +0 -1
@@ -1,54 +1,29 @@
1
- import { c } from 'react-compiler-runtime';
2
1
  import React from 'react';
3
2
  import { Item } from './Item.js';
4
3
  import { jsx } from 'react/jsx-runtime';
5
4
  import Link from '../Link/Link.js';
6
5
 
7
- const LinkItem = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
8
- const $ = c(22);
9
- let Component;
10
- let active;
11
- let className;
12
- let inactiveText;
13
- let props;
14
- let size;
15
- let variant;
16
- if ($[0] !== t0) {
17
- ({
18
- active,
19
- inactiveText,
20
- variant,
21
- size,
22
- as: Component,
23
- className,
24
- ...props
25
- } = t0);
26
- $[0] = t0;
27
- $[1] = Component;
28
- $[2] = active;
29
- $[3] = className;
30
- $[4] = inactiveText;
31
- $[5] = props;
32
- $[6] = size;
33
- $[7] = variant;
34
- } else {
35
- Component = $[1];
36
- active = $[2];
37
- className = $[3];
38
- inactiveText = $[4];
39
- props = $[5];
40
- size = $[6];
41
- variant = $[7];
42
- }
43
- const t1 = inactiveText ? true : undefined;
44
- let t2;
45
- if ($[8] !== Component || $[9] !== forwardedRef || $[10] !== inactiveText || $[11] !== props) {
46
- t2 = t3 => {
47
- const {
48
- children,
49
- onClick,
50
- ...rest
51
- } = t3;
6
+ const LinkItem = /*#__PURE__*/React.forwardRef(({
7
+ active,
8
+ inactiveText,
9
+ variant,
10
+ size,
11
+ as: Component,
12
+ className,
13
+ ...props
14
+ }, forwardedRef) => {
15
+ return /*#__PURE__*/jsx(Item, {
16
+ className: className,
17
+ active: active,
18
+ inactiveText: inactiveText,
19
+ "data-inactive": inactiveText ? true : undefined,
20
+ variant: variant,
21
+ size: size,
22
+ _PrivateItemWrapper: ({
23
+ children,
24
+ onClick,
25
+ ...rest
26
+ }) => {
52
27
  const clickHandler = event => {
53
28
  onClick && onClick(event);
54
29
  props.onClick && props.onClick(event);
@@ -64,40 +39,9 @@ const LinkItem = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
64
39
  ref: forwardedRef,
65
40
  children: children
66
41
  });
67
- };
68
- $[8] = Component;
69
- $[9] = forwardedRef;
70
- $[10] = inactiveText;
71
- $[11] = props;
72
- $[12] = t2;
73
- } else {
74
- t2 = $[12];
75
- }
76
- let t3;
77
- if ($[13] !== active || $[14] !== className || $[15] !== inactiveText || $[16] !== props.children || $[17] !== size || $[18] !== t1 || $[19] !== t2 || $[20] !== variant) {
78
- t3 = /*#__PURE__*/jsx(Item, {
79
- className: className,
80
- active: active,
81
- inactiveText: inactiveText,
82
- "data-inactive": t1,
83
- variant: variant,
84
- size: size,
85
- _PrivateItemWrapper: t2,
86
- children: props.children
87
- });
88
- $[13] = active;
89
- $[14] = className;
90
- $[15] = inactiveText;
91
- $[16] = props.children;
92
- $[17] = size;
93
- $[18] = t1;
94
- $[19] = t2;
95
- $[20] = variant;
96
- $[21] = t3;
97
- } else {
98
- t3 = $[21];
99
- }
100
- return t3;
42
+ },
43
+ children: props.children
44
+ });
101
45
  });
102
46
  LinkItem.displayName = 'ActionList.LinkItem';
103
47
  LinkItem.__SLOT__ = Symbol('ActionList.LinkItem');
@@ -1 +1 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAuFrC,QAAA,MAAM,IAAI,GA3Ea,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;oDA2ER,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAoFrC,QAAA,MAAM,IAAI,GAxEa,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;oDAwER,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
@@ -1,4 +1,3 @@
1
- import { c } from 'react-compiler-runtime';
2
1
  import React from 'react';
3
2
  import { fixedForwardRef } from '../utils/modern-polymorphic.js';
4
3
  import { ActionListContainerContext } from './ActionListContainerContext.js';
@@ -9,70 +8,33 @@ import { ListContext } from './shared.js';
9
8
  import { useFocusZone } from '../hooks/useFocusZone.js';
10
9
  import { clsx } from 'clsx';
11
10
  import classes from './ActionList.module.css.js';
12
- import { jsx, jsxs } from 'react/jsx-runtime';
11
+ import { jsxs, jsx } from 'react/jsx-runtime';
13
12
  import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
14
13
  import { FocusKeys } from '@primer/behaviors';
15
14
 
16
15
  const UnwrappedList = (props, forwardedRef) => {
17
16
  var _slots$heading$props$;
18
- const $ = c(37);
19
- let className;
20
- let restProps;
21
- let role;
22
- let selectionVariant;
23
- let t0;
24
- let t1;
25
- let t2;
26
- let t3;
27
- if ($[0] !== props) {
28
- ({
29
- as: t0,
30
- variant: t1,
31
- selectionVariant,
32
- showDividers: t2,
33
- role,
34
- disableFocusZone: t3,
35
- className,
36
- ...restProps
37
- } = props);
38
- $[0] = props;
39
- $[1] = className;
40
- $[2] = restProps;
41
- $[3] = role;
42
- $[4] = selectionVariant;
43
- $[5] = t0;
44
- $[6] = t1;
45
- $[7] = t2;
46
- $[8] = t3;
47
- } else {
48
- className = $[1];
49
- restProps = $[2];
50
- role = $[3];
51
- selectionVariant = $[4];
52
- t0 = $[5];
53
- t1 = $[6];
54
- t2 = $[7];
55
- t3 = $[8];
56
- }
57
- const Component = t0 === undefined ? "ul" : t0;
58
- const variant = t1 === undefined ? "inset" : t1;
59
- const showDividers = t2 === undefined ? false : t2;
60
- const disableFocusZone = t3 === undefined ? false : t3;
61
- let t4;
62
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
63
- t4 = {
64
- heading: Heading
65
- };
66
- $[9] = t4;
67
- } else {
68
- t4 = $[9];
69
- }
70
- const [slots, childrenWithoutSlots] = useSlots(restProps.children, t4);
17
+ const {
18
+ as: Component = 'ul',
19
+ variant = 'inset',
20
+ selectionVariant,
21
+ showDividers = false,
22
+ role,
23
+ disableFocusZone = false,
24
+ className,
25
+ ...restProps
26
+ } = props;
27
+ const [slots, childrenWithoutSlots] = useSlots(restProps.children, {
28
+ heading: Heading
29
+ });
71
30
  const headingId = useId();
31
+
32
+ /** if list is inside a Menu, it will get a role from the Menu */
72
33
  const {
73
34
  listRole: listRoleFromContainer,
74
35
  listLabelledBy,
75
36
  selectionVariant: containerSelectionVariant,
37
+ // TODO: Remove after DropdownMenu2 deprecation
76
38
  enableFocusZone: enableFocusZoneFromContainer,
77
39
  container
78
40
  } = React.useContext(ActionListContainerContext);
@@ -80,71 +42,23 @@ const UnwrappedList = (props, forwardedRef) => {
80
42
  const listRole = role || listRoleFromContainer;
81
43
  const listRef = useProvidedRefOrCreate(forwardedRef);
82
44
  let enableFocusZone = false;
83
- if (enableFocusZoneFromContainer !== undefined) {
84
- enableFocusZone = enableFocusZoneFromContainer;
85
- } else {
86
- if (listRole && !disableFocusZone) {
87
- let t5;
88
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
89
- t5 = ["menu", "menubar", "listbox"];
90
- $[10] = t5;
91
- } else {
92
- t5 = $[10];
93
- }
94
- enableFocusZone = t5.includes(listRole);
95
- }
96
- }
97
- const t5 = !enableFocusZone;
98
- const t6 = listRole === "menu" || container === "SelectPanel" || container === "FilteredActionList" ? "wrap" : undefined;
99
- let t7;
100
- if ($[11] !== listRef || $[12] !== t5 || $[13] !== t6) {
101
- t7 = {
102
- disabled: t5,
103
- containerRef: listRef,
104
- bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd | FocusKeys.PageUpDown,
105
- focusOutBehavior: t6
106
- };
107
- $[11] = listRef;
108
- $[12] = t5;
109
- $[13] = t6;
110
- $[14] = t7;
111
- } else {
112
- t7 = $[14];
113
- }
114
- useFocusZone(t7);
115
- const t8 = selectionVariant || containerSelectionVariant;
116
- let t9;
117
- if ($[15] !== headingId || $[16] !== listRole || $[17] !== showDividers || $[18] !== t8 || $[19] !== variant) {
118
- t9 = {
45
+ if (enableFocusZoneFromContainer !== undefined) enableFocusZone = enableFocusZoneFromContainer;else if (listRole && !disableFocusZone) enableFocusZone = ['menu', 'menubar', 'listbox'].includes(listRole);
46
+ useFocusZone({
47
+ disabled: !enableFocusZone,
48
+ containerRef: listRef,
49
+ bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd | FocusKeys.PageUpDown,
50
+ focusOutBehavior: listRole === 'menu' || container === 'SelectPanel' || container === 'FilteredActionList' ? 'wrap' : undefined
51
+ });
52
+ return /*#__PURE__*/jsxs(ListContext.Provider, {
53
+ value: {
119
54
  variant,
120
- selectionVariant: t8,
55
+ selectionVariant: selectionVariant || containerSelectionVariant,
121
56
  showDividers,
122
57
  role: listRole,
123
58
  headingId
124
- };
125
- $[15] = headingId;
126
- $[16] = listRole;
127
- $[17] = showDividers;
128
- $[18] = t8;
129
- $[19] = variant;
130
- $[20] = t9;
131
- } else {
132
- t9 = $[20];
133
- }
134
- const listContextValue = t9;
135
- const t10 = slots.heading;
136
- let t11;
137
- if ($[21] !== className) {
138
- t11 = clsx(classes.ActionList, className);
139
- $[21] = className;
140
- $[22] = t11;
141
- } else {
142
- t11 = $[22];
143
- }
144
- let t12;
145
- if ($[23] !== Component || $[24] !== ariaLabelledBy || $[25] !== childrenWithoutSlots || $[26] !== listRef || $[27] !== listRole || $[28] !== restProps || $[29] !== showDividers || $[30] !== t11 || $[31] !== variant) {
146
- t12 = /*#__PURE__*/jsx(Component, {
147
- className: t11,
59
+ },
60
+ children: [slots.heading, /*#__PURE__*/jsx(Component, {
61
+ className: clsx(classes.ActionList, className),
148
62
  role: listRole,
149
63
  "aria-labelledby": ariaLabelledBy,
150
64
  ref: listRef,
@@ -152,35 +66,10 @@ const UnwrappedList = (props, forwardedRef) => {
152
66
  "data-variant": variant,
153
67
  ...restProps,
154
68
  children: childrenWithoutSlots
155
- });
156
- $[23] = Component;
157
- $[24] = ariaLabelledBy;
158
- $[25] = childrenWithoutSlots;
159
- $[26] = listRef;
160
- $[27] = listRole;
161
- $[28] = restProps;
162
- $[29] = showDividers;
163
- $[30] = t11;
164
- $[31] = variant;
165
- $[32] = t12;
166
- } else {
167
- t12 = $[32];
168
- }
169
- let t13;
170
- if ($[33] !== listContextValue || $[34] !== slots.heading || $[35] !== t12) {
171
- t13 = /*#__PURE__*/jsxs(ListContext.Provider, {
172
- value: listContextValue,
173
- children: [t10, t12]
174
- });
175
- $[33] = listContextValue;
176
- $[34] = slots.heading;
177
- $[35] = t12;
178
- $[36] = t13;
179
- } else {
180
- t13 = $[36];
181
- }
182
- return t13;
69
+ })]
70
+ });
183
71
  };
72
+ UnwrappedList.displayName = "UnwrappedList";
184
73
  const List = fixedForwardRef(UnwrappedList);
185
74
  Object.assign(List, {
186
75
  displayName: 'ActionList'
@@ -1,4 +1,3 @@
1
- import { c } from 'react-compiler-runtime';
2
1
  import React from 'react';
3
2
  import { CheckIcon } from '@primer/octicons-react';
4
3
  import { GroupContext } from './Group.js';
@@ -9,12 +8,10 @@ import { warning } from '../utils/warning.js';
9
8
  import { jsx } from 'react/jsx-runtime';
10
9
  import Radio from '../Radio/Radio.js';
11
10
 
12
- const Selection = t0 => {
13
- const $ = c(11);
14
- const {
15
- selected,
16
- className
17
- } = t0;
11
+ const Selection = ({
12
+ selected,
13
+ className
14
+ }) => {
18
15
  const {
19
16
  selectionVariant: listSelectionVariant,
20
17
  role: listRole
@@ -22,93 +19,48 @@ const Selection = t0 => {
22
19
  const {
23
20
  selectionVariant: groupSelectionVariant
24
21
  } = React.useContext(GroupContext);
22
+
23
+ /** selectionVariant in Group can override the selectionVariant in List root */
24
+ /** fallback to selectionVariant from container menu if any (ActionMenu, SelectPanel ) */
25
25
  let selectionVariant;
26
- if (typeof groupSelectionVariant !== "undefined") {
27
- selectionVariant = groupSelectionVariant;
28
- } else {
29
- selectionVariant = listSelectionVariant;
30
- }
26
+ if (typeof groupSelectionVariant !== 'undefined') selectionVariant = groupSelectionVariant;else selectionVariant = listSelectionVariant;
31
27
  if (!selectionVariant) {
28
+ // if selectionVariant is not set on List, but Item is selected
29
+ // warn in development
32
30
  if (selected) {
33
- process.env.NODE_ENV !== "production" ? warning(true, "For Item to be selected, ActionList or ActionList.Group should have a selectionVariant defined.") : void 0;
31
+ process.env.NODE_ENV !== "production" ? warning(true, 'For Item to be selected, ActionList or ActionList.Group should have a selectionVariant defined.') : void 0;
34
32
  }
35
33
  return null;
36
34
  }
37
- if (selectionVariant === "radio") {
38
- let t1;
39
- if ($[0] !== selected) {
40
- t1 = /*#__PURE__*/jsx(Radio, {
35
+ if (selectionVariant === 'radio') {
36
+ return /*#__PURE__*/jsx(VisualContainer, {
37
+ className: className,
38
+ "data-component": "ActionList.Selection",
39
+ children: /*#__PURE__*/jsx(Radio, {
41
40
  value: "unused",
42
41
  checked: selected,
43
42
  "aria-hidden": true,
44
43
  tabIndex: -1
45
- });
46
- $[0] = selected;
47
- $[1] = t1;
48
- } else {
49
- t1 = $[1];
50
- }
51
- let t2;
52
- if ($[2] !== className || $[3] !== t1) {
53
- t2 = /*#__PURE__*/jsx(VisualContainer, {
54
- className: className,
55
- "data-component": "ActionList.Selection",
56
- children: t1
57
- });
58
- $[2] = className;
59
- $[3] = t1;
60
- $[4] = t2;
61
- } else {
62
- t2 = $[4];
63
- }
64
- return t2;
65
- }
66
- if (selectionVariant === "single" || listRole === "menu") {
67
- let t1;
68
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
69
- t1 = /*#__PURE__*/jsx(CheckIcon, {
70
- className: classes.SingleSelectCheckmark
71
- });
72
- $[5] = t1;
73
- } else {
74
- t1 = $[5];
75
- }
76
- let t2;
77
- if ($[6] !== className) {
78
- t2 = /*#__PURE__*/jsx(VisualContainer, {
79
- className: className,
80
- "data-component": "ActionList.Selection",
81
- children: t1
82
- });
83
- $[6] = className;
84
- $[7] = t2;
85
- } else {
86
- t2 = $[7];
87
- }
88
- return t2;
89
- }
90
- let t1;
91
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
92
- t1 = /*#__PURE__*/jsx("div", {
93
- className: classes.MultiSelectCheckbox
44
+ })
94
45
  });
95
- $[8] = t1;
96
- } else {
97
- t1 = $[8];
98
46
  }
99
- let t2;
100
- if ($[9] !== className) {
101
- t2 = /*#__PURE__*/jsx(VisualContainer, {
47
+ if (selectionVariant === 'single' || listRole === 'menu') {
48
+ return /*#__PURE__*/jsx(VisualContainer, {
102
49
  className: className,
103
50
  "data-component": "ActionList.Selection",
104
- children: t1
51
+ children: /*#__PURE__*/jsx(CheckIcon, {
52
+ className: classes.SingleSelectCheckmark
53
+ })
105
54
  });
106
- $[9] = className;
107
- $[10] = t2;
108
- } else {
109
- t2 = $[10];
110
55
  }
111
- return t2;
56
+ return /*#__PURE__*/jsx(VisualContainer, {
57
+ className: className,
58
+ "data-component": "ActionList.Selection",
59
+ children: /*#__PURE__*/jsx("div", {
60
+ className: classes.MultiSelectCheckbox
61
+ })
62
+ });
112
63
  };
64
+ Selection.displayName = "Selection";
113
65
 
114
66
  export { Selection };
@@ -1,4 +1,3 @@
1
- import { c } from 'react-compiler-runtime';
2
1
  import { forwardRef } from 'react';
3
2
  import { IconButton } from '../Button/IconButton.js';
4
3
  import { ButtonComponent } from '../Button/Button.js';
@@ -6,59 +5,20 @@ import { clsx } from 'clsx';
6
5
  import classes from './ActionList.module.css.js';
7
6
  import { jsx } from 'react/jsx-runtime';
8
7
 
9
- const TrailingAction = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
10
- const $ = c(23);
11
- let className;
12
- let icon;
13
- let label;
14
- let loading;
15
- let props;
16
- let style;
17
- let t1;
18
- let t2;
19
- if ($[0] !== t0) {
20
- ({
21
- as: t1,
22
- icon,
23
- label,
24
- href: t2,
25
- className,
26
- style,
27
- loading,
28
- ...props
29
- } = t0);
30
- $[0] = t0;
31
- $[1] = className;
32
- $[2] = icon;
33
- $[3] = label;
34
- $[4] = loading;
35
- $[5] = props;
36
- $[6] = style;
37
- $[7] = t1;
38
- $[8] = t2;
39
- } else {
40
- className = $[1];
41
- icon = $[2];
42
- label = $[3];
43
- loading = $[4];
44
- props = $[5];
45
- style = $[6];
46
- t1 = $[7];
47
- t2 = $[8];
48
- }
49
- const as = t1 === undefined ? "button" : t1;
50
- const href = t2 === undefined ? null : t2;
51
- let t3;
52
- if ($[9] !== className) {
53
- t3 = clsx(className, classes.TrailingAction);
54
- $[9] = className;
55
- $[10] = t3;
56
- } else {
57
- t3 = $[10];
58
- }
59
- let t4;
60
- if ($[11] !== as || $[12] !== forwardedRef || $[13] !== href || $[14] !== icon || $[15] !== label || $[16] !== loading || $[17] !== props) {
61
- t4 = icon ? /*#__PURE__*/jsx(IconButton, {
8
+ const TrailingAction = /*#__PURE__*/forwardRef(({
9
+ as = 'button',
10
+ icon,
11
+ label,
12
+ href = null,
13
+ className,
14
+ style,
15
+ loading,
16
+ ...props
17
+ }, forwardedRef) => {
18
+ return /*#__PURE__*/jsx("span", {
19
+ className: clsx(className, classes.TrailingAction),
20
+ style: style,
21
+ children: icon ? /*#__PURE__*/jsx(IconButton, {
62
22
  as: as,
63
23
  "aria-label": label,
64
24
  icon: icon,
@@ -66,11 +26,16 @@ const TrailingAction = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
66
26
  tooltipDirection: "w",
67
27
  href: href,
68
28
  loading: loading,
69
- "data-loading": Boolean(loading),
29
+ "data-loading": Boolean(loading)
30
+ // @ts-expect-error StyledButton wants both Anchor and Button refs
31
+ ,
70
32
  ref: forwardedRef,
71
33
  className: classes.TrailingActionButton,
72
34
  ...props
73
- }) : /*#__PURE__*/jsx(ButtonComponent, {
35
+ }) :
36
+ /*#__PURE__*/
37
+ // @ts-expect-error shhh
38
+ jsx(ButtonComponent, {
74
39
  variant: "invisible",
75
40
  as: as,
76
41
  href: href,
@@ -80,33 +45,8 @@ const TrailingAction = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
80
45
  className: classes.TrailingActionButton,
81
46
  ...props,
82
47
  children: label
83
- });
84
- $[11] = as;
85
- $[12] = forwardedRef;
86
- $[13] = href;
87
- $[14] = icon;
88
- $[15] = label;
89
- $[16] = loading;
90
- $[17] = props;
91
- $[18] = t4;
92
- } else {
93
- t4 = $[18];
94
- }
95
- let t5;
96
- if ($[19] !== style || $[20] !== t3 || $[21] !== t4) {
97
- t5 = /*#__PURE__*/jsx("span", {
98
- className: t3,
99
- style: style,
100
- children: t4
101
- });
102
- $[19] = style;
103
- $[20] = t3;
104
- $[21] = t4;
105
- $[22] = t5;
106
- } else {
107
- t5 = $[22];
108
- }
109
- return t5;
48
+ })
49
+ });
110
50
  });
111
51
  TrailingAction.__SLOT__ = Symbol('ActionList.TrailingAction');
112
52