@pingux/astro 2.203.0-alpha.0 → 2.205.0-alpha.0

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 (35) hide show
  1. package/lib/cjs/components/LinkSelectField/LinkSelectField.js +29 -10
  2. package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +55 -1
  3. package/lib/cjs/components/LinkSelectField/LinkSelectField.test.js +33 -8
  4. package/lib/cjs/components/Stepper/Line.d.ts +7 -0
  5. package/lib/cjs/components/Stepper/Line.js +0 -5
  6. package/lib/cjs/components/Stepper/Step.d.ts +10 -0
  7. package/lib/cjs/components/Stepper/Step.js +6 -14
  8. package/lib/cjs/components/Stepper/Stepper.constants.d.ts +6 -0
  9. package/lib/cjs/components/Stepper/Stepper.d.ts +4 -0
  10. package/lib/cjs/components/Stepper/Stepper.js +15 -29
  11. package/lib/cjs/components/Stepper/Stepper.stories.js +2 -2
  12. package/lib/cjs/components/Stepper/Stepper.styles.d.ts +257 -0
  13. package/lib/cjs/components/Stepper/Stepper.test.js +18 -20
  14. package/lib/cjs/components/Stepper/index.d.ts +2 -0
  15. package/lib/cjs/styles/themeOverrides/onyxDarkUiLibraryOverride.js +3 -1
  16. package/lib/cjs/types/Stepper.d.ts +33 -0
  17. package/lib/cjs/types/Stepper.js +6 -0
  18. package/lib/cjs/types/index.d.ts +1 -0
  19. package/lib/cjs/types/index.js +20 -9
  20. package/lib/cjs/types/tabs.d.ts +2 -2
  21. package/lib/cjs/utils/devUtils/props/isValidPositiveInt.d.ts +2 -0
  22. package/lib/cjs/utils/devUtils/props/isValidPositiveInt.js +2 -1
  23. package/lib/components/LinkSelectField/LinkSelectField.js +29 -10
  24. package/lib/components/LinkSelectField/LinkSelectField.stories.js +55 -1
  25. package/lib/components/LinkSelectField/LinkSelectField.test.js +33 -8
  26. package/lib/components/Stepper/Line.js +0 -5
  27. package/lib/components/Stepper/Step.js +6 -14
  28. package/lib/components/Stepper/Stepper.js +17 -31
  29. package/lib/components/Stepper/Stepper.stories.js +2 -2
  30. package/lib/components/Stepper/Stepper.test.js +18 -20
  31. package/lib/styles/themeOverrides/onyxDarkUiLibraryOverride.js +3 -1
  32. package/lib/types/Stepper.js +1 -0
  33. package/lib/types/index.js +1 -0
  34. package/lib/utils/devUtils/props/isValidPositiveInt.js +2 -1
  35. package/package.json +1 -1
@@ -0,0 +1,257 @@
1
+ export declare const verticalLine: {
2
+ '&:before': {
3
+ position: string;
4
+ content: string;
5
+ borderLeft: string;
6
+ borderLeftColor: string;
7
+ left: string;
8
+ top: string;
9
+ height: string;
10
+ };
11
+ };
12
+ declare const _default: {
13
+ wrapper: {
14
+ width: string;
15
+ };
16
+ tabs: {
17
+ outline: string;
18
+ borderBottom: string;
19
+ mb: string;
20
+ justifyContent: string;
21
+ '&.is-horizontal': {
22
+ width: string;
23
+ };
24
+ '&.is-vertical': {
25
+ minWidth: string;
26
+ borderRight: string;
27
+ };
28
+ };
29
+ tab: {
30
+ '&.is-horizontal': {
31
+ mb: number;
32
+ mr: number;
33
+ outline: string;
34
+ '&.is-focused': {
35
+ outline: string;
36
+ outlineColor: string;
37
+ outlineOffset: string;
38
+ borderRadius: string;
39
+ };
40
+ '&:not(:first-of-type)': {
41
+ flex: number;
42
+ maxWidth: number;
43
+ };
44
+ };
45
+ '&.is-vertical': {
46
+ position: string;
47
+ height: string;
48
+ width: string;
49
+ py: string;
50
+ px: string;
51
+ ':focus-visible:not(.is-focused)': {
52
+ outline: string;
53
+ };
54
+ };
55
+ };
56
+ tabLabel: {
57
+ mb: number;
58
+ };
59
+ outerWrapper: {
60
+ alignItems: string;
61
+ };
62
+ step: {
63
+ active: {
64
+ '&.is-horizontal': {
65
+ display: string;
66
+ justifyContent: string;
67
+ alignItems: string;
68
+ width: number;
69
+ height: number;
70
+ minWidth: number;
71
+ minHeight: number;
72
+ borderWidth: number;
73
+ borderStyle: string;
74
+ borderRadius: string;
75
+ fontSize: string;
76
+ fontWeight: number;
77
+ cursor: string;
78
+ fontFamily: string;
79
+ '&[aria-expanded="true"]': {
80
+ backgroundColor: string;
81
+ borderColor: string;
82
+ color: string;
83
+ };
84
+ backgroundColor: string;
85
+ borderColor: string;
86
+ color: string;
87
+ };
88
+ '&.is-vertical': {
89
+ backgroundColor: string;
90
+ border: string;
91
+ borderColor: string;
92
+ width: number;
93
+ height: number;
94
+ minWidth: number;
95
+ minHeight: number;
96
+ display: string;
97
+ justifyContent: string;
98
+ alignItems: string;
99
+ borderWidth: number;
100
+ borderStyle: string;
101
+ borderRadius: string;
102
+ fontSize: string;
103
+ fontWeight: number;
104
+ cursor: string;
105
+ fontFamily: string;
106
+ '&[aria-expanded="true"]': {
107
+ backgroundColor: string;
108
+ borderColor: string;
109
+ color: string;
110
+ };
111
+ };
112
+ };
113
+ completed: {
114
+ '&.is-horizontal': {
115
+ display: string;
116
+ justifyContent: string;
117
+ alignItems: string;
118
+ width: number;
119
+ height: number;
120
+ minWidth: number;
121
+ minHeight: number;
122
+ borderWidth: number;
123
+ borderStyle: string;
124
+ borderRadius: string;
125
+ fontSize: string;
126
+ fontWeight: number;
127
+ cursor: string;
128
+ fontFamily: string;
129
+ '&[aria-expanded="true"]': {
130
+ backgroundColor: string;
131
+ borderColor: string;
132
+ color: string;
133
+ };
134
+ backgroundColor: string;
135
+ borderColor: string;
136
+ color: string;
137
+ };
138
+ '&.is-vertical': {
139
+ width: number;
140
+ height: number;
141
+ minWidth: number;
142
+ minHeight: number;
143
+ display: string;
144
+ justifyContent: string;
145
+ alignItems: string;
146
+ borderWidth: number;
147
+ borderStyle: string;
148
+ borderRadius: string;
149
+ fontSize: string;
150
+ fontWeight: number;
151
+ cursor: string;
152
+ fontFamily: string;
153
+ '&[aria-expanded="true"]': {
154
+ backgroundColor: string;
155
+ borderColor: string;
156
+ color: string;
157
+ };
158
+ backgroundColor: string;
159
+ borderColor: string;
160
+ };
161
+ };
162
+ inactive: {
163
+ '&.is-horizontal': {
164
+ display: string;
165
+ justifyContent: string;
166
+ alignItems: string;
167
+ width: number;
168
+ height: number;
169
+ minWidth: number;
170
+ minHeight: number;
171
+ borderWidth: number;
172
+ borderStyle: string;
173
+ borderRadius: string;
174
+ fontSize: string;
175
+ fontWeight: number;
176
+ cursor: string;
177
+ fontFamily: string;
178
+ '&[aria-expanded="true"]': {
179
+ backgroundColor: string;
180
+ borderColor: string;
181
+ color: string;
182
+ };
183
+ backgroundColor: string;
184
+ borderColor: string;
185
+ color: string;
186
+ };
187
+ '&.is-vertical': {
188
+ backgroundColor: string;
189
+ border: string;
190
+ width: number;
191
+ height: number;
192
+ minWidth: number;
193
+ minHeight: number;
194
+ display: string;
195
+ justifyContent: string;
196
+ alignItems: string;
197
+ borderWidth: number;
198
+ borderStyle: string;
199
+ borderRadius: string;
200
+ fontSize: string;
201
+ fontWeight: number;
202
+ cursor: string;
203
+ fontFamily: string;
204
+ '&[aria-expanded="true"]': {
205
+ backgroundColor: string;
206
+ borderColor: string;
207
+ color: string;
208
+ };
209
+ };
210
+ };
211
+ default: {
212
+ display: string;
213
+ justifyContent: string;
214
+ alignItems: string;
215
+ width: number;
216
+ height: number;
217
+ minWidth: number;
218
+ minHeight: number;
219
+ borderWidth: number;
220
+ borderStyle: string;
221
+ borderRadius: string;
222
+ fontSize: string;
223
+ fontWeight: number;
224
+ cursor: string;
225
+ fontFamily: string;
226
+ '&[aria-expanded="true"]': {
227
+ backgroundColor: string;
228
+ borderColor: string;
229
+ color: string;
230
+ };
231
+ backgroundColor: string;
232
+ borderColor: string;
233
+ color: string;
234
+ };
235
+ };
236
+ line: {
237
+ alignSelf: string;
238
+ width: string;
239
+ maxWidth: string;
240
+ borderBottomWidth: number;
241
+ borderBottomStyle: string;
242
+ borderBottomColor: string;
243
+ '&.is-inactive': {
244
+ borderBottomStyle: string;
245
+ borderBottomColor: string;
246
+ };
247
+ '&.is-default': {
248
+ width: number;
249
+ height: string;
250
+ maxHeight: string;
251
+ borderRightWidth: number;
252
+ borderRightStyle: string;
253
+ borderRightColor: string;
254
+ };
255
+ };
256
+ };
257
+ export default _default;
@@ -61,34 +61,31 @@ var defaultProps = {
61
61
  activeStep: 1,
62
62
  items: steps
63
63
  };
64
+
65
+ // StepperProps.children is ReactNode (from BoxProps), but Stepper also accepts a render-prop
66
+ // function via react-stately's collection mechanism. We cast to silence the assignability error.
67
+ var stepperChildren = function stepperChildren(_ref) {
68
+ var name = _ref.name,
69
+ children = _ref.children;
70
+ return (0, _react2.jsx)(_reactStately.Item, {
71
+ key: name || children,
72
+ textValue: name || children
73
+ }, (0, _react2.jsx)(_Text["default"], null, children));
74
+ };
64
75
  var getComponent = function getComponent() {
65
76
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
66
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
67
- _ref$renderFn = _ref.renderFn,
68
- renderFn = _ref$renderFn === void 0 ? _testWrapper.render : _ref$renderFn;
77
+ var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
78
+ _ref2$renderFn = _ref2.renderFn,
79
+ renderFn = _ref2$renderFn === void 0 ? _testWrapper.render : _ref2$renderFn;
69
80
  return renderFn((0, _react2.jsx)(_react2.CacheProvider, {
70
81
  value: emotionCache
71
- }, (0, _react2.jsx)(_Stepper["default"], (0, _extends2["default"])({}, defaultProps, props), function (_ref2) {
72
- var name = _ref2.name,
73
- children = _ref2.children;
74
- return (0, _react2.jsx)(_reactStately.Item, {
75
- key: name || children,
76
- textValue: name || children
77
- }, (0, _react2.jsx)(_Text["default"], null, children));
78
- })));
82
+ }, (0, _react2.jsx)(_Stepper["default"], (0, _extends2["default"])({}, defaultProps, props), stepperChildren)));
79
83
  };
80
84
 
81
85
  // Needs to be added to each components test file
82
86
  (0, _universalComponentTest.universalComponentTests)({
83
87
  renderComponent: function renderComponent(props) {
84
- return (0, _react2.jsx)(_Stepper["default"], (0, _extends2["default"])({}, defaultProps, props), function (_ref3) {
85
- var name = _ref3.name,
86
- children = _ref3.children;
87
- return (0, _react2.jsx)(_reactStately.Item, {
88
- key: name || children,
89
- textValue: name || children
90
- }, (0, _react2.jsx)(_Text["default"], null, children));
91
- });
88
+ return (0, _react2.jsx)(_Stepper["default"], (0, _extends2["default"])({}, defaultProps, props), stepperChildren);
92
89
  }
93
90
  });
94
91
  test('renders Stepper component in the default state', function () {
@@ -162,8 +159,9 @@ test('tooltip renders expected content based on props', /*#__PURE__*/(0, _asyncT
162
159
  _testWrapper.fireEvent.mouseMove(tab0);
163
160
  _testWrapper.fireEvent.mouseEnter(tab0);
164
161
  (0, _setTimeout2["default"])(function () {
162
+ var _steps$0$label;
165
163
  expect(_testWrapper.screen.queryByRole('tooltip')).toBeInTheDocument();
166
- expect(_testWrapper.screen.queryByRole('tooltip')).toHaveTextContent(steps[0].label);
164
+ expect(_testWrapper.screen.queryByRole('tooltip')).toHaveTextContent((_steps$0$label = steps[0].label) !== null && _steps$0$label !== void 0 ? _steps$0$label : '');
167
165
  }, 0);
168
166
 
169
167
  // Should render textValue
@@ -0,0 +1,2 @@
1
+ export { default as Step } from './Step';
2
+ export { default } from './Stepper';
@@ -118,7 +118,9 @@ var forms = {
118
118
  '& input[type=search]': _objectSpread(_objectSpread({}, _nextGenDarkMode["default"].text.inputValue), {}, {
119
119
  borderColor: _onyxTokens.astroTokensDark.color.gray[500],
120
120
  fontSize: '15px',
121
- bg: 'white',
121
+ bg: _onyxTokens.astroTokensDark.color.gray[900],
122
+ height: '50px',
123
+ borderRadius: '4px',
122
124
  '::placeholder': _objectSpread(_objectSpread({}, _nextGenDarkMode["default"].text.placeholder), {}, {
123
125
  fontStyle: 'unset',
124
126
  fontSize: '15px'
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ import { TestingAttributes } from './shared/test';
3
+ import { ValidPositiveInteger } from './shared/validPositiveInteger';
4
+ import { BoxProps } from './box';
5
+ export interface StepperItemProps {
6
+ /** The primary option for the tooltip label. */
7
+ label?: string;
8
+ children?: ReactNode;
9
+ name?: string;
10
+ /** Whether the step is required. */
11
+ isRequired?: boolean;
12
+ }
13
+ export interface StepperProps extends BoxProps, TestingAttributes {
14
+ /**
15
+ * *For performance reasons,
16
+ * use this prop instead of Array.map when iteratively rendering Items*.
17
+ * For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections).
18
+ */
19
+ items?: Array<StepperItemProps>;
20
+ /** The number of the current step (using one-based indexing) */
21
+ activeStep?: ValidPositiveInteger;
22
+ /**
23
+ * Handler that is called when the current step changes.
24
+ * `(index: number) => void`
25
+ */
26
+ onStepChange?: (index: number) => void;
27
+ /** A props object that is subsequently spread into the rendered tablist. */
28
+ tabListProps?: Record<string, unknown>;
29
+ /** A props object that is subsequently spread into the rendered tooltip. */
30
+ tooltipProps?: Record<string, unknown>;
31
+ /** The orientation of the stepper. */
32
+ orientation?: 'vertical' | 'horizontal';
33
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -52,6 +52,7 @@ export * from './separator';
52
52
  export * from './ServerErrorBoundary';
53
53
  export * from './shared';
54
54
  export * from './skeleton';
55
+ export * from './Stepper';
55
56
  export * from './switchField';
56
57
  export * from './tab';
57
58
  export * from './table';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0, _context1, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32, _context33, _context34, _context35, _context36, _context37, _context38, _context39, _context40, _context41, _context42, _context43, _context44, _context45, _context46, _context47, _context48, _context49, _context50, _context51, _context52, _context53, _context54, _context55, _context56, _context57, _context58, _context59, _context60;
3
+ var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0, _context1, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32, _context33, _context34, _context35, _context36, _context37, _context38, _context39, _context40, _context41, _context42, _context43, _context44, _context45, _context46, _context47, _context48, _context49, _context50, _context51, _context52, _context53, _context54, _context55, _context56, _context57, _context58, _context59, _context60, _context61;
4
4
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
5
5
  var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6
6
  var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
@@ -601,8 +601,19 @@ _forEachInstanceProperty(_context52 = _Object$keys(_skeleton)).call(_context52,
601
601
  }
602
602
  });
603
603
  });
604
+ var _Stepper = require("./Stepper");
605
+ _forEachInstanceProperty(_context53 = _Object$keys(_Stepper)).call(_context53, function (key) {
606
+ if (key === "default" || key === "__esModule") return;
607
+ if (key in exports && exports[key] === _Stepper[key]) return;
608
+ _Object$defineProperty(exports, key, {
609
+ enumerable: true,
610
+ get: function get() {
611
+ return _Stepper[key];
612
+ }
613
+ });
614
+ });
604
615
  var _switchField = require("./switchField");
605
- _forEachInstanceProperty(_context53 = _Object$keys(_switchField)).call(_context53, function (key) {
616
+ _forEachInstanceProperty(_context54 = _Object$keys(_switchField)).call(_context54, function (key) {
606
617
  if (key === "default" || key === "__esModule") return;
607
618
  if (key in exports && exports[key] === _switchField[key]) return;
608
619
  _Object$defineProperty(exports, key, {
@@ -613,7 +624,7 @@ _forEachInstanceProperty(_context53 = _Object$keys(_switchField)).call(_context5
613
624
  });
614
625
  });
615
626
  var _tab = require("./tab");
616
- _forEachInstanceProperty(_context54 = _Object$keys(_tab)).call(_context54, function (key) {
627
+ _forEachInstanceProperty(_context55 = _Object$keys(_tab)).call(_context55, function (key) {
617
628
  if (key === "default" || key === "__esModule") return;
618
629
  if (key in exports && exports[key] === _tab[key]) return;
619
630
  _Object$defineProperty(exports, key, {
@@ -624,7 +635,7 @@ _forEachInstanceProperty(_context54 = _Object$keys(_tab)).call(_context54, funct
624
635
  });
625
636
  });
626
637
  var _table = require("./table");
627
- _forEachInstanceProperty(_context55 = _Object$keys(_table)).call(_context55, function (key) {
638
+ _forEachInstanceProperty(_context56 = _Object$keys(_table)).call(_context56, function (key) {
628
639
  if (key === "default" || key === "__esModule") return;
629
640
  if (key in exports && exports[key] === _table[key]) return;
630
641
  _Object$defineProperty(exports, key, {
@@ -635,7 +646,7 @@ _forEachInstanceProperty(_context55 = _Object$keys(_table)).call(_context55, fun
635
646
  });
636
647
  });
637
648
  var _tabs = require("./tabs");
638
- _forEachInstanceProperty(_context56 = _Object$keys(_tabs)).call(_context56, function (key) {
649
+ _forEachInstanceProperty(_context57 = _Object$keys(_tabs)).call(_context57, function (key) {
639
650
  if (key === "default" || key === "__esModule") return;
640
651
  if (key in exports && exports[key] === _tabs[key]) return;
641
652
  _Object$defineProperty(exports, key, {
@@ -646,7 +657,7 @@ _forEachInstanceProperty(_context56 = _Object$keys(_tabs)).call(_context56, func
646
657
  });
647
658
  });
648
659
  var _text = require("./text");
649
- _forEachInstanceProperty(_context57 = _Object$keys(_text)).call(_context57, function (key) {
660
+ _forEachInstanceProperty(_context58 = _Object$keys(_text)).call(_context58, function (key) {
650
661
  if (key === "default" || key === "__esModule") return;
651
662
  if (key in exports && exports[key] === _text[key]) return;
652
663
  _Object$defineProperty(exports, key, {
@@ -657,7 +668,7 @@ _forEachInstanceProperty(_context57 = _Object$keys(_text)).call(_context57, func
657
668
  });
658
669
  });
659
670
  var _textField = require("./textField");
660
- _forEachInstanceProperty(_context58 = _Object$keys(_textField)).call(_context58, function (key) {
671
+ _forEachInstanceProperty(_context59 = _Object$keys(_textField)).call(_context59, function (key) {
661
672
  if (key === "default" || key === "__esModule") return;
662
673
  if (key in exports && exports[key] === _textField[key]) return;
663
674
  _Object$defineProperty(exports, key, {
@@ -668,7 +679,7 @@ _forEachInstanceProperty(_context58 = _Object$keys(_textField)).call(_context58,
668
679
  });
669
680
  });
670
681
  var _timefield = require("./timefield");
671
- _forEachInstanceProperty(_context59 = _Object$keys(_timefield)).call(_context59, function (key) {
682
+ _forEachInstanceProperty(_context60 = _Object$keys(_timefield)).call(_context60, function (key) {
672
683
  if (key === "default" || key === "__esModule") return;
673
684
  if (key in exports && exports[key] === _timefield[key]) return;
674
685
  _Object$defineProperty(exports, key, {
@@ -679,7 +690,7 @@ _forEachInstanceProperty(_context59 = _Object$keys(_timefield)).call(_context59,
679
690
  });
680
691
  });
681
692
  var _tooltipTrigger = require("./tooltipTrigger");
682
- _forEachInstanceProperty(_context60 = _Object$keys(_tooltipTrigger)).call(_context60, function (key) {
693
+ _forEachInstanceProperty(_context61 = _Object$keys(_tooltipTrigger)).call(_context61, function (key) {
683
694
  if (key === "default" || key === "__esModule") return;
684
695
  if (key in exports && exports[key] === _tooltipTrigger[key]) return;
685
696
  _Object$defineProperty(exports, key, {
@@ -1,4 +1,4 @@
1
- import { Dispatch, ReactNode, SetStateAction } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { AriaTabListProps } from '@react-aria/tabs';
3
3
  import { TabListState } from '@react-stately/tabs';
4
4
  import type { CollectionChildren } from '@react-types/shared';
@@ -21,7 +21,7 @@ export interface TabsProps extends StyleProps, TestingAttributes, OrientationPro
21
21
  /** Whether the entire tablist is disabled. */
22
22
  isDisabled?: boolean;
23
23
  /** Handler that is called when the selected tab has changed. */
24
- onSelectionChange?: Dispatch<SetStateAction<string | undefined>>;
24
+ onSelectionChange?: (key: string) => void;
25
25
  /** A props object that is subsequently spread into the rendered tablist. */
26
26
  tabListProps?: object;
27
27
  /** Props object that is spread directly into all of the tab panel wrapper elements. */
@@ -0,0 +1,2 @@
1
+ declare const isValidPositiveInt: (props: Record<string, unknown>, propName: string, componentName: string) => null | Error;
2
+ export default isValidPositiveInt;
@@ -20,7 +20,8 @@ var validatePositiveInteger = function validatePositiveInteger() {
20
20
  var isPositiveInteger = isWithinRange(1, Infinity);
21
21
  if (props[propName] && !isPositiveInteger(props[propName])) {
22
22
  var _context, _context2;
23
- return new Error((0, _concat["default"])(_context = (0, _concat["default"])(_context2 = "Expected a positive integer for ".concat(propName, " in ")).call(_context2, componentName, ", but instead received `")).call(_context, props[propName], "`."));
23
+ var received = props[propName];
24
+ return new Error((0, _concat["default"])(_context = (0, _concat["default"])(_context2 = "Expected a positive integer for ".concat(propName, " in ")).call(_context2, componentName, ", but instead received `")).call(_context, received, "`."));
24
25
  }
25
26
  // Everything is fine
26
27
  return null;
@@ -6,9 +6,11 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
6
6
  import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
7
  import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
8
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
9
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
11
  import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty";
11
12
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
13
+ var _excluded = ["sx"];
12
14
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
14
16
  import React, { forwardRef } from 'react';
@@ -30,10 +32,11 @@ var LinkSelectField = /*#__PURE__*/forwardRef(function (props, ref) {
30
32
  isDisabled = props.isDisabled,
31
33
  status = props.status,
32
34
  helperText = props.helperText,
33
- iconProps = props.iconProps,
34
35
  hasInlineLoader = props.hasInlineLoader,
35
36
  popoverWidth = props.popoverWidth,
36
- triggerProps = props.triggerProps;
37
+ iconProps = props.iconProps,
38
+ triggerProps = props.triggerProps,
39
+ triggerProp = props.trigger;
37
40
  var _getAriaAttributeProp = getAriaAttributeProps(props),
38
41
  ariaProps = _getAriaAttributeProp.ariaProps;
39
42
  var _useGetTheme = useGetTheme(),
@@ -57,7 +60,10 @@ var LinkSelectField = /*#__PURE__*/forwardRef(function (props, ref) {
57
60
  state = selectFieldProps.state,
58
61
  raTriggerProps = selectFieldProps.triggerProps,
59
62
  triggerRef = selectFieldProps.triggerRef;
60
- var trigger = ___EmotionJSX(Button, _extends({
63
+ var _ref = iconProps || {},
64
+ iconPropsSx = _ref.sx,
65
+ restIconProps = _objectWithoutProperties(_ref, _excluded);
66
+ var triggerNode = ___EmotionJSX(Button, _extends({
61
67
  className: fieldControlInputProps.className,
62
68
  ref: triggerRef,
63
69
  variant: "selectLink",
@@ -77,23 +83,25 @@ var LinkSelectField = /*#__PURE__*/forwardRef(function (props, ref) {
77
83
  variant: "forms.select.arrow"
78
84
  }, ___EmotionJSX(Icon, _extends({
79
85
  icon: MenuDown,
86
+ title: {
87
+ name: 'Menu Down Icon'
88
+ },
89
+ sx: _objectSpread(_objectSpread({}, state.isOpen ? {
90
+ transform: 'rotate(180deg)'
91
+ } : null), iconPropsSx)
92
+ }, restIconProps, {
80
93
  title: {
81
94
  name: ''
82
95
  },
83
96
  color: isOnyx ? 'font.link' : 'active',
84
97
  size: linkSelectFieldIcon,
85
98
  "aria-hidden": "true"
86
- }, iconProps, {
87
- sx: _objectSpread({
88
- transform: state.isOpen ? 'rotate(180deg)' : 'rotate(0deg)',
89
- transition: 'transform 150ms ease'
90
- }, iconProps === null || iconProps === void 0 ? void 0 : iconProps.sx)
91
99
  })))), ___EmotionJSX(VisuallyHidden, {
92
100
  "aria-live": "polite",
93
101
  id: helperTextId
94
102
  }, helperText));
95
103
  return ___EmotionJSX(SelectFieldBase, _extends({}, props, selectFieldProps, {
96
- trigger: trigger
104
+ trigger: triggerProp || triggerNode
97
105
  }));
98
106
  });
99
107
  LinkSelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
@@ -162,8 +170,19 @@ LinkSelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
162
170
  onSelectionChange: PropTypes.func,
163
171
  /** Display an inline loader inside the select trigger while loading. */
164
172
  hasInlineLoader: PropTypes.bool,
173
+ /**
174
+ * Props object that is spread directly into the Icon inside the default trigger button.
175
+ * Supports all IconProps (icon, title, size, color, sx, etc.).
176
+ * The sx prop is merged with the rotation style.
177
+ */
178
+ iconProps: PropTypes.shape({}),
165
179
  /** Width of the popover menu. Accepts any valid CSS unit. */
166
- popoverWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
180
+ popoverWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
181
+ /**
182
+ * A ReactNode that replaces the default Button trigger entirely.
183
+ * When provided, the local Button element is not rendered.
184
+ */
185
+ trigger: PropTypes.node
167
186
  }, statusPropTypes), inputFieldAttributesBasePropTypes), ariaAttributesBasePropTypes);
168
187
  LinkSelectField.defaultProps = _objectSpread({
169
188
  placeholder: 'Select',