@zendeskgarden/react-grid 8.57.1 → 8.58.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.
package/dist/index.cjs.js CHANGED
@@ -27,179 +27,41 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
27
27
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
28
28
  var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
29
29
 
30
- function ownKeys(object, enumerableOnly) {
31
- var keys = Object.keys(object);
32
-
33
- if (Object.getOwnPropertySymbols) {
34
- var symbols = Object.getOwnPropertySymbols(object);
35
- enumerableOnly && (symbols = symbols.filter(function (sym) {
36
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
37
- })), keys.push.apply(keys, symbols);
38
- }
39
-
40
- return keys;
41
- }
42
-
43
- function _objectSpread2(target) {
44
- for (var i = 1; i < arguments.length; i++) {
45
- var source = null != arguments[i] ? arguments[i] : {};
46
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
47
- _defineProperty(target, key, source[key]);
48
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
49
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
50
- });
51
- }
52
-
53
- return target;
54
- }
55
-
56
- function _defineProperty(obj, key, value) {
57
- if (key in obj) {
58
- Object.defineProperty(obj, key, {
59
- value: value,
60
- enumerable: true,
61
- configurable: true,
62
- writable: true
63
- });
64
- } else {
65
- obj[key] = value;
66
- }
67
-
68
- return obj;
69
- }
70
-
71
30
  function _extends() {
72
31
  _extends = Object.assign ? Object.assign.bind() : function (target) {
73
32
  for (var i = 1; i < arguments.length; i++) {
74
33
  var source = arguments[i];
75
-
76
34
  for (var key in source) {
77
35
  if (Object.prototype.hasOwnProperty.call(source, key)) {
78
36
  target[key] = source[key];
79
37
  }
80
38
  }
81
39
  }
82
-
83
40
  return target;
84
41
  };
85
42
  return _extends.apply(this, arguments);
86
43
  }
87
44
 
88
- function _objectWithoutPropertiesLoose(source, excluded) {
89
- if (source == null) return {};
90
- var target = {};
91
- var sourceKeys = Object.keys(source);
92
- var key, i;
93
-
94
- for (i = 0; i < sourceKeys.length; i++) {
95
- key = sourceKeys[i];
96
- if (excluded.indexOf(key) >= 0) continue;
97
- target[key] = source[key];
98
- }
99
-
100
- return target;
101
- }
102
-
103
- function _objectWithoutProperties(source, excluded) {
104
- if (source == null) return {};
105
-
106
- var target = _objectWithoutPropertiesLoose(source, excluded);
107
-
108
- var key, i;
109
-
110
- if (Object.getOwnPropertySymbols) {
111
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
112
-
113
- for (i = 0; i < sourceSymbolKeys.length; i++) {
114
- key = sourceSymbolKeys[i];
115
- if (excluded.indexOf(key) >= 0) continue;
116
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
117
- target[key] = source[key];
118
- }
119
- }
120
-
121
- return target;
122
- }
123
-
124
- function _slicedToArray(arr, i) {
125
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
126
- }
127
-
128
- function _arrayWithHoles(arr) {
129
- if (Array.isArray(arr)) return arr;
130
- }
131
-
132
- function _iterableToArrayLimit(arr, i) {
133
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
134
-
135
- if (_i == null) return;
136
- var _arr = [];
137
- var _n = true;
138
- var _d = false;
139
-
140
- var _s, _e;
141
-
142
- try {
143
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
144
- _arr.push(_s.value);
145
-
146
- if (i && _arr.length === i) break;
147
- }
148
- } catch (err) {
149
- _d = true;
150
- _e = err;
151
- } finally {
152
- try {
153
- if (!_n && _i["return"] != null) _i["return"]();
154
- } finally {
155
- if (_d) throw _e;
156
- }
157
- }
158
-
159
- return _arr;
160
- }
161
-
162
- function _unsupportedIterableToArray(o, minLen) {
163
- if (!o) return;
164
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
165
- var n = Object.prototype.toString.call(o).slice(8, -1);
166
- if (n === "Object" && o.constructor) n = o.constructor.name;
167
- if (n === "Map" || n === "Set") return Array.from(o);
168
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
169
- }
170
-
171
- function _arrayLikeToArray(arr, len) {
172
- if (len == null || len > arr.length) len = arr.length;
173
-
174
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
175
-
176
- return arr2;
177
- }
178
-
179
- function _nonIterableRest() {
180
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
181
- }
182
-
183
- var ALIGN_ITEMS = ['start', 'end', 'center', 'baseline', 'stretch'];
184
- var ALIGN_SELF = ['auto'].concat(ALIGN_ITEMS);
185
- var DIRECTION = ['row', 'row-reverse', 'column', 'column-reverse'];
186
- var JUSTIFY_CONTENT = ['start', 'end', 'center', 'between', 'around'];
187
- var TEXT_ALIGN = ['start', 'end', 'center', 'justify'];
188
- var SPACE = [false, 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
189
- var WRAP = ['nowrap', 'wrap', 'wrap-reverse'];
190
- var ORIENTATION = ['top', 'bottom', 'start', 'end'];
191
-
192
- var COMPONENT_ID$6 = 'grid.col';
193
- var colorStyles$4 = function colorStyles(props) {
194
- var backgroundColor = reactTheming.getColor('primaryHue', 600, props.theme, 0.1);
45
+ const ALIGN_ITEMS = ['start', 'end', 'center', 'baseline', 'stretch'];
46
+ const ALIGN_SELF = ['auto', ...ALIGN_ITEMS];
47
+ const DIRECTION = ['row', 'row-reverse', 'column', 'column-reverse'];
48
+ const JUSTIFY_CONTENT = ['start', 'end', 'center', 'between', 'around'];
49
+ const TEXT_ALIGN = ['start', 'end', 'center', 'justify'];
50
+ const SPACE = [false, 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
51
+ const WRAP = ['nowrap', 'wrap', 'wrap-reverse'];
52
+ const ORIENTATION = ['top', 'bottom', 'start', 'end'];
53
+
54
+ const COMPONENT_ID$6 = 'grid.col';
55
+ const colorStyles$4 = props => {
56
+ const backgroundColor = reactTheming.getColor('primaryHue', 600, props.theme, 0.1);
195
57
  return styled.css(["background-clip:content-box;background-color:", ";"], backgroundColor);
196
58
  };
197
- var flexStyles$1 = function flexStyles(size, alignSelf, textAlign, offset, order, props) {
198
- var margin = offset && "".concat(polished.math("".concat(offset, " / ").concat(props.columns, " * 100")), "%");
199
- var flexBasis;
200
- var flexGrow;
201
- var maxWidth;
202
- var width;
59
+ const flexStyles$1 = (size, alignSelf, textAlign, offset, order, props) => {
60
+ const margin = offset && `${polished.math(`${offset} / ${props.columns} * 100`)}%`;
61
+ let flexBasis;
62
+ let flexGrow;
63
+ let maxWidth;
64
+ let width;
203
65
  if (typeof size === 'boolean') {
204
66
  flexBasis = 0;
205
67
  flexGrow = 1;
@@ -210,11 +72,11 @@ var flexStyles$1 = function flexStyles(size, alignSelf, textAlign, offset, order
210
72
  maxWidth = '100%';
211
73
  width = 'auto';
212
74
  } else if (size !== undefined) {
213
- flexBasis = "".concat(polished.math("".concat(size, " / ").concat(props.columns, " * 100")), "%");
75
+ flexBasis = `${polished.math(`${size} / ${props.columns} * 100`)}%`;
214
76
  flexGrow = 0;
215
77
  maxWidth = flexBasis;
216
78
  }
217
- var horizontalAlign;
79
+ let horizontalAlign;
218
80
  if (textAlign === 'start') {
219
81
  horizontalAlign = props.theme.rtl ? 'right' : 'left';
220
82
  } else if (textAlign === 'end') {
@@ -222,192 +84,144 @@ var flexStyles$1 = function flexStyles(size, alignSelf, textAlign, offset, order
222
84
  } else {
223
85
  horizontalAlign = textAlign;
224
86
  }
225
- var flexOrder;
87
+ let flexOrder;
226
88
  if (order === 'first') {
227
89
  flexOrder = -1;
228
90
  } else if (order === 'last') {
229
- flexOrder = polished.math("".concat(props.columns, " + 1"));
91
+ flexOrder = polished.math(`${props.columns} + 1`);
230
92
  } else {
231
93
  flexOrder = order;
232
94
  }
233
- return styled.css(["flex-basis:", ";flex-grow:", ";flex-shrink:", ";align-self:", ";order:", ";margin-", ":", ";width:", ";max-width:", ";text-align:", ";"], flexBasis, flexGrow, size && 0, alignSelf === 'start' || alignSelf === 'end' ? "flex-".concat(alignSelf) : alignSelf, flexOrder, props.theme.rtl ? 'right' : 'left', margin, width, maxWidth, horizontalAlign);
95
+ return styled.css(["flex-basis:", ";flex-grow:", ";flex-shrink:", ";align-self:", ";order:", ";margin-", ":", ";width:", ";max-width:", ";text-align:", ";"], flexBasis, flexGrow, size && 0, alignSelf === 'start' || alignSelf === 'end' ? `flex-${alignSelf}` : alignSelf, flexOrder, props.theme.rtl ? 'right' : 'left', margin, width, maxWidth, horizontalAlign);
234
96
  };
235
- var mediaStyles$1 = function mediaStyles(minWidth, size, alignSelf, textAlign, offset, order, props) {
97
+ const mediaStyles$1 = (minWidth, size, alignSelf, textAlign, offset, order, props) => {
236
98
  return styled.css(["@media (min-width:", "){", ";}"], minWidth, flexStyles$1(size, alignSelf, textAlign, offset, order, props));
237
99
  };
238
- var sizeStyles$4 = function sizeStyles(props) {
239
- var padding = props.gutters ? polished.math("".concat(props.theme.space[props.gutters], " / 2")) : 0;
100
+ const sizeStyles$4 = props => {
101
+ const padding = props.gutters ? polished.math(`${props.theme.space[props.gutters]} / 2`) : 0;
240
102
  return styled.css(["padding-right:", ";padding-left:", ";"], padding, padding);
241
103
  };
242
- var StyledCol = styled__default["default"].div.attrs({
104
+ const StyledCol = styled__default["default"].div.attrs({
243
105
  'data-garden-id': COMPONENT_ID$6,
244
- 'data-garden-version': '8.57.1'
106
+ 'data-garden-version': '8.58.0'
245
107
  }).withConfig({
246
108
  displayName: "StyledCol",
247
109
  componentId: "sc-inuw62-0"
248
- })(["box-sizing:border-box;width:100%;", ";", ";", ";", ";", ";", ";", ";", ";", ";"], function (props) {
249
- return flexStyles$1(!props.sizeAll && (props.xs || props.sm || props.md || props.lg || props.xl) ? undefined : props.sizeAll || false, props.alignSelf, props.textAlign, props.offset, props.order, props);
250
- }, function (props) {
251
- return sizeStyles$4(props);
252
- }, function (props) {
253
- return props.debug && colorStyles$4(props);
254
- }, function (props) {
255
- return mediaStyles$1(props.theme.breakpoints.xs, props.xs, props.alignSelfXs, props.textAlignXs, props.offsetXs, props.orderXs, props);
256
- }, function (props) {
257
- return mediaStyles$1(props.theme.breakpoints.sm, props.sm, props.alignSelfSm, props.textAlignSm, props.offsetSm, props.orderSm, props);
258
- }, function (props) {
259
- return mediaStyles$1(props.theme.breakpoints.md, props.md, props.alignSelfMd, props.textAlignMd, props.offsetMd, props.orderMd, props);
260
- }, function (props) {
261
- return mediaStyles$1(props.theme.breakpoints.lg, props.lg, props.alignSelfLg, props.textAlignLg, props.offsetLg, props.orderLg, props);
262
- }, function (props) {
263
- return mediaStyles$1(props.theme.breakpoints.xl, props.xl, props.alignSelfXl, props.textAlignXl, props.offsetXl, props.orderXl, props);
264
- }, function (props) {
265
- return reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props);
266
- });
110
+ })(["box-sizing:border-box;width:100%;", ";", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles$1(!props.sizeAll && (props.xs || props.sm || props.md || props.lg || props.xl) ? undefined : props.sizeAll || false, props.alignSelf, props.textAlign, props.offset, props.order, props), props => sizeStyles$4(props), props => props.debug && colorStyles$4(props), props => mediaStyles$1(props.theme.breakpoints.xs, props.xs, props.alignSelfXs, props.textAlignXs, props.offsetXs, props.orderXs, props), props => mediaStyles$1(props.theme.breakpoints.sm, props.sm, props.alignSelfSm, props.textAlignSm, props.offsetSm, props.orderSm, props), props => mediaStyles$1(props.theme.breakpoints.md, props.md, props.alignSelfMd, props.textAlignMd, props.offsetMd, props.orderMd, props), props => mediaStyles$1(props.theme.breakpoints.lg, props.lg, props.alignSelfLg, props.textAlignLg, props.offsetLg, props.orderLg, props), props => mediaStyles$1(props.theme.breakpoints.xl, props.xl, props.alignSelfXl, props.textAlignXl, props.offsetXl, props.orderXl, props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
267
111
  StyledCol.defaultProps = {
268
112
  columns: 12,
269
113
  theme: reactTheming.DEFAULT_THEME
270
114
  };
271
115
 
272
- var COMPONENT_ID$5 = 'grid.grid';
273
- var colorStyles$3 = function colorStyles(props) {
274
- var borderColor = reactTheming.getColor(props.theme.palette.crimson, 400, props.theme, 0.5);
275
- var borderWidth = polished.math("".concat(props.theme.borderWidths.sm, " * 2"));
116
+ const COMPONENT_ID$5 = 'grid.grid';
117
+ const colorStyles$3 = props => {
118
+ const borderColor = reactTheming.getColor(props.theme.palette.crimson, 400, props.theme, 0.5);
119
+ const borderWidth = polished.math(`${props.theme.borderWidths.sm} * 2`);
276
120
  return styled.css(["box-shadow:-", " 0 0 0 ", ",", " 0 0 0 ", ";"], borderWidth, borderColor, borderWidth, borderColor);
277
121
  };
278
- var sizeStyles$3 = function sizeStyles(props) {
279
- var padding = props.gutters ? polished.math("".concat(props.theme.space[props.gutters], " / 2")) : 0;
122
+ const sizeStyles$3 = props => {
123
+ const padding = props.gutters ? polished.math(`${props.theme.space[props.gutters]} / 2`) : 0;
280
124
  return styled.css(["padding-right:", ";padding-left:", ";"], padding, padding);
281
125
  };
282
- var StyledGrid = styled__default["default"].div.attrs({
126
+ const StyledGrid = styled__default["default"].div.attrs({
283
127
  'data-garden-id': COMPONENT_ID$5,
284
- 'data-garden-version': '8.57.1'
128
+ 'data-garden-version': '8.58.0'
285
129
  }).withConfig({
286
130
  displayName: "StyledGrid",
287
131
  componentId: "sc-oxgg5i-0"
288
- })(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], function (props) {
289
- return props.theme.rtl && 'rtl';
290
- }, function (props) {
291
- return sizeStyles$3(props);
292
- }, function (props) {
293
- return props.debug && colorStyles$3(props);
294
- }, function (props) {
295
- return reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props);
296
- });
132
+ })(["direction:", ";margin-right:auto;margin-left:auto;width:100%;box-sizing:border-box;", ";", ";", ";"], props => props.theme.rtl && 'rtl', props => sizeStyles$3(props), props => props.debug && colorStyles$3(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
297
133
  StyledGrid.defaultProps = {
298
134
  gutters: 'md',
299
135
  theme: reactTheming.DEFAULT_THEME
300
136
  };
301
137
 
302
- var COMPONENT_ID$4 = 'grid.row';
303
- var colorStyles$2 = function colorStyles(props) {
304
- var borderColor = reactTheming.getColor(props.theme.palette.mint, 600, props.theme, 0.5);
305
- var borderWidth = props.theme.borderWidths.sm;
138
+ const COMPONENT_ID$4 = 'grid.row';
139
+ const colorStyles$2 = props => {
140
+ const borderColor = reactTheming.getColor(props.theme.palette.mint, 600, props.theme, 0.5);
141
+ const borderWidth = props.theme.borderWidths.sm;
306
142
  return styled.css(["box-shadow:inset 0 ", " 0 0 ", ",inset 0 -", " 0 0 ", ";"], borderWidth, borderColor, borderWidth, borderColor);
307
143
  };
308
- var flexStyles = function flexStyles(alignItems, justifyContent, wrap) {
309
- var flexAlignItems;
310
- var flexJustifyContent;
144
+ const flexStyles = (alignItems, justifyContent, wrap) => {
145
+ let flexAlignItems;
146
+ let flexJustifyContent;
311
147
  if (alignItems === 'start' || alignItems === 'end') {
312
- flexAlignItems = "flex-".concat(alignItems);
148
+ flexAlignItems = `flex-${alignItems}`;
313
149
  } else {
314
150
  flexAlignItems = alignItems;
315
151
  }
316
152
  if (justifyContent === 'start' || justifyContent === 'end') {
317
- flexJustifyContent = "flex-".concat(justifyContent);
153
+ flexJustifyContent = `flex-${justifyContent}`;
318
154
  } else if (justifyContent === 'between' || justifyContent === 'around') {
319
- flexJustifyContent = "space-".concat(justifyContent);
155
+ flexJustifyContent = `space-${justifyContent}`;
320
156
  } else {
321
157
  flexJustifyContent = justifyContent;
322
158
  }
323
159
  return styled.css(["flex-wrap:", ";align-items:", ";justify-content:", ";"], wrap, flexAlignItems, flexJustifyContent);
324
160
  };
325
- var mediaStyles = function mediaStyles(minWidth, alignItems, justifyContent, wrap) {
161
+ const mediaStyles = (minWidth, alignItems, justifyContent, wrap) => {
326
162
  return styled.css(["@media (min-width:", "){", ";}"], minWidth, flexStyles(alignItems, justifyContent, wrap));
327
163
  };
328
- var sizeStyles$2 = function sizeStyles(props) {
329
- var margin = props.gutters ? polished.math("".concat(props.theme.space[props.gutters], " / 2")) : 0;
164
+ const sizeStyles$2 = props => {
165
+ const margin = props.gutters ? polished.math(`${props.theme.space[props.gutters]} / 2`) : 0;
330
166
  return styled.css(["margin-right:-", ";margin-left:-", ";"], margin, margin);
331
167
  };
332
- var StyledRow = styled__default["default"].div.attrs({
168
+ const StyledRow = styled__default["default"].div.attrs({
333
169
  'data-garden-id': COMPONENT_ID$4,
334
- 'data-garden-version': '8.57.1'
170
+ 'data-garden-version': '8.58.0'
335
171
  }).withConfig({
336
172
  displayName: "StyledRow",
337
173
  componentId: "sc-xjsdg1-0"
338
- })(["display:flex;box-sizing:border-box;", " ", ";", ";", ";", ";", ";", ";", ";", ";"], function (props) {
339
- return flexStyles(props.alignItems, props.justifyContent, props.wrapAll);
340
- }, function (props) {
341
- return sizeStyles$2(props);
342
- }, function (props) {
343
- return props.debug && colorStyles$2(props);
344
- }, function (props) {
345
- return mediaStyles(props.theme.breakpoints.xs, props.alignItemsXs, props.justifyContentXs, props.wrapXs);
346
- }, function (props) {
347
- return mediaStyles(props.theme.breakpoints.sm, props.alignItemsSm, props.justifyContentSm, props.wrapSm);
348
- }, function (props) {
349
- return mediaStyles(props.theme.breakpoints.md, props.alignItemsMd, props.justifyContentMd, props.wrapMd);
350
- }, function (props) {
351
- return mediaStyles(props.theme.breakpoints.lg, props.alignItemsLg, props.justifyContentLg, props.wrapLg);
352
- }, function (props) {
353
- return mediaStyles(props.theme.breakpoints.xl, props.alignItemsXl, props.justifyContentXl, props.wrapXl);
354
- }, function (props) {
355
- return reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props);
356
- });
174
+ })(["display:flex;box-sizing:border-box;", " ", ";", ";", ";", ";", ";", ";", ";", ";"], props => flexStyles(props.alignItems, props.justifyContent, props.wrapAll), props => sizeStyles$2(props), props => props.debug && colorStyles$2(props), props => mediaStyles(props.theme.breakpoints.xs, props.alignItemsXs, props.justifyContentXs, props.wrapXs), props => mediaStyles(props.theme.breakpoints.sm, props.alignItemsSm, props.justifyContentSm, props.wrapSm), props => mediaStyles(props.theme.breakpoints.md, props.alignItemsMd, props.justifyContentMd, props.wrapMd), props => mediaStyles(props.theme.breakpoints.lg, props.alignItemsLg, props.justifyContentLg, props.wrapLg), props => mediaStyles(props.theme.breakpoints.xl, props.alignItemsXl, props.justifyContentXl, props.wrapXl), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
357
175
  StyledRow.defaultProps = {
358
176
  wrapAll: 'wrap',
359
177
  theme: reactTheming.DEFAULT_THEME
360
178
  };
361
179
 
362
- var COMPONENT_ID$3 = 'pane';
363
- var StyledPane = styled__default["default"].div.attrs({
180
+ const COMPONENT_ID$3 = 'pane';
181
+ const StyledPane = styled__default["default"].div.attrs({
364
182
  'data-garden-id': COMPONENT_ID$3,
365
- 'data-garden-version': '8.57.1'
183
+ 'data-garden-version': '8.58.0'
366
184
  }).withConfig({
367
185
  displayName: "StyledPane",
368
186
  componentId: "sc-1ltjst7-0"
369
- })(["position:relative;min-width:0;min-height:0;", ";"], function (props) {
370
- return reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props);
371
- });
187
+ })(["position:relative;min-width:0;min-height:0;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
372
188
  StyledPane.defaultProps = {
373
189
  theme: reactTheming.DEFAULT_THEME
374
190
  };
375
191
 
376
- var COMPONENT_ID$2 = 'pane.content';
377
- var StyledPaneContent = styled__default["default"].div.attrs({
192
+ const COMPONENT_ID$2 = 'pane.content';
193
+ const StyledPaneContent = styled__default["default"].div.attrs({
378
194
  'data-garden-id': COMPONENT_ID$2,
379
- 'data-garden-version': '8.57.1'
195
+ 'data-garden-version': '8.58.0'
380
196
  }).withConfig({
381
197
  displayName: "StyledPaneContent",
382
198
  componentId: "sc-1b38mbh-0"
383
- })(["height:100%;overflow:auto;", ";"], function (props) {
384
- return reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props);
385
- });
199
+ })(["height:100%;overflow:auto;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
386
200
  StyledPaneContent.defaultProps = {
387
201
  theme: reactTheming.DEFAULT_THEME
388
202
  };
389
203
 
390
- var COMPONENT_ID$1 = 'pane.splitter';
391
- var colorStyles$1 = function colorStyles(props) {
392
- var color = reactTheming.getColor('neutralHue', 300, props.theme);
393
- var hoverColor = reactTheming.getColor('primaryHue', 600, props.theme);
394
- var activeColor = reactTheming.getColor('primaryHue', 800, props.theme);
395
- var boxShadow = props.theme.shadows.md(polished.rgba(hoverColor, 0.35));
204
+ const COMPONENT_ID$1 = 'pane.splitter';
205
+ const colorStyles$1 = props => {
206
+ const color = reactTheming.getColor('neutralHue', 300, props.theme);
207
+ const hoverColor = reactTheming.getColor('primaryHue', 600, props.theme);
208
+ const activeColor = reactTheming.getColor('primaryHue', 800, props.theme);
209
+ const boxShadow = props.theme.shadows.md(polished.rgba(hoverColor, 0.35));
396
210
  return styled.css(["&::before{background-color:", ";}&:hover::before{background-color:", ";}&[data-garden-focus-visible]::before{box-shadow:", ";background-color:", ";}&:active::before{background-color:", ";}"], color, props.isHovered && hoverColor, boxShadow, hoverColor, props.isHovered && activeColor);
397
211
  };
398
- var sizeStyles$1 = function sizeStyles(props) {
399
- var size = polished.math("".concat(props.theme.shadowWidths.md, " * 2"));
400
- var separatorSize = polished.math("".concat(props.theme.borderWidths.sm, " * 2"));
401
- var offset = polished.math("-".concat(size, " / 2"));
402
- var cursor;
403
- var top;
404
- var right;
405
- var left;
406
- var bottom;
407
- var width;
408
- var height;
409
- var separatorWidth;
410
- var separatorHeight;
212
+ const sizeStyles$1 = props => {
213
+ const size = polished.math(`${props.theme.shadowWidths.md} * 2`);
214
+ const separatorSize = polished.math(`${props.theme.borderWidths.sm} * 2`);
215
+ const offset = polished.math(`-${size} / 2`);
216
+ let cursor;
217
+ let top;
218
+ let right;
219
+ let left;
220
+ let bottom;
221
+ let width;
222
+ let height;
223
+ let separatorWidth;
224
+ let separatorHeight;
411
225
  switch (props.orientation) {
412
226
  case 'top':
413
227
  cursor = 'row-resize';
@@ -453,25 +267,23 @@ var sizeStyles$1 = function sizeStyles(props) {
453
267
  }
454
268
  break;
455
269
  }
456
- var dimensionProperty = width === '100%' ? 'height' : 'width';
270
+ const dimensionProperty = width === '100%' ? 'height' : 'width';
457
271
  return styled.css(["top:", ";right:", ";bottom:", ";left:", ";cursor:", ";width:", ";height:", ";&::before{width:", ";height:", ";}&:hover::before{", ":", ";}&[data-garden-focus-visible]::before,&:focus::before{", ":", ";}&[data-garden-focus-visible]::before{border-radius:", ";}"], top, right, bottom, left, cursor, width, height, separatorWidth, separatorHeight, dimensionProperty, props.isHovered && separatorSize, dimensionProperty, separatorSize, props.theme.borderRadii.md);
458
272
  };
459
- var StyledPaneSplitter = styled__default["default"].div.attrs({
273
+ const StyledPaneSplitter = styled__default["default"].div.attrs({
460
274
  'data-garden-id': COMPONENT_ID$1,
461
- 'data-garden-version': '8.57.1'
275
+ 'data-garden-version': '8.58.0'
462
276
  }).withConfig({
463
277
  displayName: "StyledPaneSplitter",
464
278
  componentId: "sc-jylemn-0"
465
- })(["display:flex;position:absolute;align-items:center;justify-content:center;z-index:1;user-select:none;", ";&:focus{outline:none;}&::before{position:absolute;transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out;z-index:-1;content:'';}", ";", ";"], sizeStyles$1, colorStyles$1, function (props) {
466
- return reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props);
467
- });
279
+ })(["display:flex;position:absolute;align-items:center;justify-content:center;z-index:1;user-select:none;", ";&:focus{outline:none;}&::before{position:absolute;transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out;z-index:-1;content:'';}", ";", ";"], sizeStyles$1, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
468
280
  StyledPaneSplitter.defaultProps = {
469
281
  theme: reactTheming.DEFAULT_THEME
470
282
  };
471
283
 
472
- var COMPONENT_ID = 'pane.splitter_button';
473
- var transformStyles = function transformStyles(props) {
474
- var degrees = 0;
284
+ const COMPONENT_ID = 'pane.splitter_button';
285
+ const transformStyles = props => {
286
+ let degrees = 0;
475
287
  if (props.isRotated) {
476
288
  degrees = props.theme.rtl ? -180 : 180;
477
289
  }
@@ -484,21 +296,23 @@ var transformStyles = function transformStyles(props) {
484
296
  }
485
297
  return styled.css(["& > svg{transform:rotate(", "deg);}"], degrees);
486
298
  };
487
- var colorStyles = function colorStyles(_ref) {
488
- var theme = _ref.theme;
489
- var boxShadow = theme.shadows.lg("".concat(theme.space.base, "px"), "".concat(theme.space.base * 2, "px"), reactTheming.getColor('chromeHue', 600, theme, 0.15));
490
- var focusBoxShadow = theme.shadows.md(reactTheming.getColor('primaryHue', 600, theme, 0.35));
299
+ const colorStyles = _ref => {
300
+ let {
301
+ theme
302
+ } = _ref;
303
+ const boxShadow = theme.shadows.lg(`${theme.space.base}px`, `${theme.space.base * 2}px`, reactTheming.getColor('chromeHue', 600, theme, 0.15));
304
+ const focusBoxShadow = theme.shadows.md(reactTheming.getColor('primaryHue', 600, theme, 0.35));
491
305
  return styled.css(["box-shadow:", ";&[data-garden-focus-visible]{box-shadow:", ",", ";}"], boxShadow, focusBoxShadow, boxShadow);
492
306
  };
493
- var sizeStyles = function sizeStyles(props) {
494
- var size = "".concat(props.theme.space.base * 6, "px");
495
- var display = props.splitterSize <= polished.stripUnit(polished.math("".concat(props.theme.shadowWidths.md, " * 2 + ").concat(size))) && 'none';
496
- var isVertical = props.orientation === 'start' || props.orientation === 'end';
497
- var top;
498
- var left;
499
- var right;
500
- var bottom;
501
- if (props.splitterSize >= polished.stripUnit(polished.math("".concat(size, " * 3")))) {
307
+ const sizeStyles = props => {
308
+ const size = `${props.theme.space.base * 6}px`;
309
+ const display = props.splitterSize <= polished.stripUnit(polished.math(`${props.theme.shadowWidths.md} * 2 + ${size}`)) && 'none';
310
+ const isVertical = props.orientation === 'start' || props.orientation === 'end';
311
+ let top;
312
+ let left;
313
+ let right;
314
+ let bottom;
315
+ if (props.splitterSize >= polished.stripUnit(polished.math(`${size} * 3`))) {
502
316
  if (props.placement === 'start') {
503
317
  if (isVertical) {
504
318
  top = size;
@@ -519,39 +333,37 @@ var sizeStyles = function sizeStyles(props) {
519
333
  }
520
334
  return styled.css(["display:", ";top:", ";right:", ";bottom:", ";left:", ";width:", ";min-width:", ";height:", ";"], display, top, right, bottom, left, size, size, size);
521
335
  };
522
- var StyledPaneSplitterButton = styled__default["default"](reactButtons.ChevronButton).attrs({
336
+ const StyledPaneSplitterButton = styled__default["default"](reactButtons.ChevronButton).attrs({
523
337
  'data-garden-id': COMPONENT_ID,
524
- 'data-garden-version': '8.57.1',
338
+ 'data-garden-version': '8.58.0',
525
339
  isBasic: true,
526
340
  isPill: true,
527
341
  size: 'small'
528
342
  }).withConfig({
529
343
  displayName: "StyledPaneSplitterButton",
530
344
  componentId: "sc-zh032e-0"
531
- })(["position:absolute;transition:background-color 0.25s ease-in-out,opacity 0.25s ease-in-out 0.1s;opacity:0;&[data-garden-focus-visible],", ":hover &,", "[data-garden-focus-visible] &{opacity:1;}", ";", ";", ";&::before{position:absolute;z-index:-1;background-color:", ";width:100%;height:100%;content:'';}", ";"], StyledPaneSplitter, StyledPaneSplitter, sizeStyles, transformStyles, colorStyles, function (props) {
532
- return props.theme.colors.background;
533
- }, function (props) {
534
- return reactTheming.retrieveComponentStyles(COMPONENT_ID, props);
535
- });
345
+ })(["position:absolute;transition:background-color 0.25s ease-in-out,opacity 0.25s ease-in-out 0.1s;opacity:0;&[data-garden-focus-visible],", ":hover &,", "[data-garden-focus-visible] &{opacity:1;}", ";", ";", ";&::before{position:absolute;z-index:-1;background-color:", ";width:100%;height:100%;content:'';}", ";"], StyledPaneSplitter, StyledPaneSplitter, sizeStyles, transformStyles, colorStyles, props => props.theme.colors.background, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
536
346
  StyledPaneSplitterButton.defaultProps = {
537
347
  theme: reactTheming.DEFAULT_THEME
538
348
  };
539
349
 
540
- var GridContext = React.createContext({
350
+ const GridContext = React.createContext({
541
351
  gutters: 'md'
542
352
  });
543
- var useGridContext = function useGridContext() {
353
+ const useGridContext = () => {
544
354
  return React.useContext(GridContext);
545
355
  };
546
356
 
547
- var _excluded$4 = ["size"];
548
- var Col = React__default["default"].forwardRef(function (_ref, ref) {
549
- var size = _ref.size,
550
- props = _objectWithoutProperties(_ref, _excluded$4);
551
- var _useGridContext = useGridContext(),
552
- columns = _useGridContext.columns,
553
- gutters = _useGridContext.gutters,
554
- debug = _useGridContext.debug;
357
+ const Col = React__default["default"].forwardRef((_ref, ref) => {
358
+ let {
359
+ size,
360
+ ...props
361
+ } = _ref;
362
+ const {
363
+ columns,
364
+ gutters,
365
+ debug
366
+ } = useGridContext();
555
367
  return React__default["default"].createElement(StyledCol, _extends({
556
368
  sizeAll: size,
557
369
  columns: columns,
@@ -594,18 +406,17 @@ Col.propTypes = {
594
406
  orderXl: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string])
595
407
  };
596
408
 
597
- var _excluded$3 = ["columns", "debug"];
598
- var Grid = React__default["default"].forwardRef(function (_ref, ref) {
599
- var columns = _ref.columns,
600
- debug = _ref.debug,
601
- props = _objectWithoutProperties(_ref, _excluded$3);
602
- var value = React.useMemo(function () {
603
- return {
604
- columns: columns,
605
- gutters: props.gutters,
606
- debug: debug
607
- };
608
- }, [columns, props.gutters, debug]);
409
+ const Grid = React__default["default"].forwardRef((_ref, ref) => {
410
+ let {
411
+ columns,
412
+ debug,
413
+ ...props
414
+ } = _ref;
415
+ const value = React.useMemo(() => ({
416
+ columns,
417
+ gutters: props.gutters,
418
+ debug
419
+ }), [columns, props.gutters, debug]);
609
420
  return React__default["default"].createElement(GridContext.Provider, {
610
421
  value: value
611
422
  }, React__default["default"].createElement(StyledGrid, _extends({
@@ -624,13 +435,15 @@ Grid.defaultProps = {
624
435
  gutters: 'md'
625
436
  };
626
437
 
627
- var _excluded$2 = ["wrap"];
628
- var Row = React__default["default"].forwardRef(function (_ref, ref) {
629
- var wrap = _ref.wrap,
630
- props = _objectWithoutProperties(_ref, _excluded$2);
631
- var _useGridContext = useGridContext(),
632
- gutters = _useGridContext.gutters,
633
- debug = _useGridContext.debug;
438
+ const Row = React__default["default"].forwardRef((_ref, ref) => {
439
+ let {
440
+ wrap,
441
+ ...props
442
+ } = _ref;
443
+ const {
444
+ gutters,
445
+ debug
446
+ } = useGridContext();
634
447
  return React__default["default"].createElement(StyledRow, _extends({
635
448
  gutters: gutters,
636
449
  debug: debug,
@@ -660,197 +473,184 @@ Row.propTypes = {
660
473
  wrapXl: PropTypes__default["default"].oneOf(WRAP)
661
474
  };
662
475
 
663
- var PaneProviderContext = React.createContext({});
664
- var usePaneProviderContextData = function usePaneProviderContextData(providerId) {
665
- var context = React.useContext(PaneProviderContext);
666
- var id = providerId || context.providerId;
476
+ const PaneProviderContext = React.createContext({});
477
+ const usePaneProviderContextData = providerId => {
478
+ const context = React.useContext(PaneProviderContext);
479
+ const id = providerId || context.providerId;
667
480
  return id && context.contextData ? context.contextData[id] : undefined;
668
481
  };
669
- var usePaneProviderContext = function usePaneProviderContext() {
670
- return React.useContext(PaneProviderContext);
671
- };
482
+ const usePaneProviderContext = () => React.useContext(PaneProviderContext);
672
483
 
673
- var getPixelsPerFr = function getPixelsPerFr(totalFrs, totalDimension) {
484
+ const getPixelsPerFr = (totalFrs, totalDimension) => {
674
485
  return totalDimension / totalFrs;
675
486
  };
676
- var convertToPixels = function convertToPixels(values, pixelsPerFr) {
677
- return Object.entries(values).reduce(function (prev, _ref) {
678
- var _ref2 = _slicedToArray(_ref, 2),
679
- key = _ref2[0],
680
- value = _ref2[1];
487
+ const convertToPixels = (values, pixelsPerFr) => {
488
+ return Object.entries(values).reduce((prev, _ref) => {
489
+ let [key, value] = _ref;
681
490
  prev[key] = value * pixelsPerFr;
682
491
  return prev;
683
492
  }, {});
684
493
  };
685
- var PaneProvider = function PaneProvider(_ref3) {
686
- var id = _ref3.id,
687
- totalPanesWidth = _ref3.totalPanesWidth,
688
- totalPanesHeight = _ref3.totalPanesHeight,
689
- defaultRowValues = _ref3.defaultRowValues,
690
- defaultColumnValues = _ref3.defaultColumnValues,
691
- rowValues = _ref3.rowValues,
692
- columnValues = _ref3.columnValues,
693
- onChange = _ref3.onChange,
694
- children = _ref3.children;
695
- var isControlled = rowValues !== undefined && rowValues !== null && columnValues !== undefined && columnValues !== null;
696
- var _useState = React.useState(defaultRowValues || {}),
697
- _useState2 = _slicedToArray(_useState, 2),
698
- rowState = _useState2[0],
699
- setRowState = _useState2[1];
700
- var _useState3 = React.useState(defaultColumnValues || {}),
701
- _useState4 = _slicedToArray(_useState3, 2),
702
- columnState = _useState4[0],
703
- setColumnState = _useState4[1];
704
- var rowsTrack = isControlled ? rowValues : rowState;
705
- var columnsTrack = isControlled ? columnValues : columnState;
706
- var setRowsTrack = React.useCallback(function (values) {
494
+ const PaneProvider = _ref2 => {
495
+ let {
496
+ id,
497
+ totalPanesWidth,
498
+ totalPanesHeight,
499
+ defaultRowValues,
500
+ defaultColumnValues,
501
+ rowValues,
502
+ columnValues,
503
+ onChange,
504
+ children
505
+ } = _ref2;
506
+ const isControlled = rowValues !== undefined && rowValues !== null && columnValues !== undefined && columnValues !== null;
507
+ const [rowState, setRowState] = React.useState(defaultRowValues || {});
508
+ const [columnState, setColumnState] = React.useState(defaultColumnValues || {});
509
+ const rowsTrack = isControlled ? rowValues : rowState;
510
+ const columnsTrack = isControlled ? columnValues : columnState;
511
+ const setRowsTrack = React.useCallback(values => {
707
512
  if (isControlled && onChange) {
708
513
  return onChange(values(rowsTrack), columnsTrack);
709
514
  }
710
515
  return setRowState(values);
711
516
  }, [isControlled, onChange, setRowState, columnsTrack, rowsTrack]);
712
- var setColumnsTrack = React.useCallback(function (values) {
517
+ const setColumnsTrack = React.useCallback(values => {
713
518
  if (isControlled && onChange) {
714
519
  return onChange(rowsTrack, values(columnsTrack));
715
520
  }
716
521
  return setColumnState(values);
717
522
  }, [isControlled, onChange, setColumnState, rowsTrack, columnsTrack]);
718
- var totalFractions = React.useMemo(function () {
719
- return {
720
- rows: Object.values(rowsTrack).reduce(function (prev, value) {
721
- return value + prev;
722
- }, 0),
723
- columns: Object.values(columnsTrack).reduce(function (prev, value) {
724
- return value + prev;
725
- }, 0)
726
- };
727
- }, [rowsTrack, columnsTrack]);
728
- var pixelsPerFr = React.useMemo(function () {
729
- return {
730
- rows: getPixelsPerFr(totalFractions.rows, totalPanesHeight),
731
- columns: getPixelsPerFr(totalFractions.columns, totalPanesWidth)
732
- };
733
- }, [totalFractions, totalPanesHeight, totalPanesWidth]);
734
- var layoutStateInPixels = React.useMemo(function () {
735
- return {
736
- rows: convertToPixels(rowsTrack, pixelsPerFr.rows),
737
- columns: convertToPixels(columnsTrack, pixelsPerFr.columns)
738
- };
739
- }, [rowsTrack, columnsTrack, pixelsPerFr]);
740
- var layoutIndices = React.useMemo(function () {
741
- var rowArray = Object.keys(rowsTrack);
742
- var columnArray = Object.keys(columnsTrack);
743
- var rows = rowArray.reduce(function (prev, key, index) {
523
+ const totalFractions = React.useMemo(() => ({
524
+ rows: Object.values(rowsTrack).reduce((prev, value) => value + prev, 0),
525
+ columns: Object.values(columnsTrack).reduce((prev, value) => value + prev, 0)
526
+ }), [rowsTrack, columnsTrack]);
527
+ const pixelsPerFr = React.useMemo(() => ({
528
+ rows: getPixelsPerFr(totalFractions.rows, totalPanesHeight),
529
+ columns: getPixelsPerFr(totalFractions.columns, totalPanesWidth)
530
+ }), [totalFractions, totalPanesHeight, totalPanesWidth]);
531
+ const layoutStateInPixels = React.useMemo(() => ({
532
+ rows: convertToPixels(rowsTrack, pixelsPerFr.rows),
533
+ columns: convertToPixels(columnsTrack, pixelsPerFr.columns)
534
+ }), [rowsTrack, columnsTrack, pixelsPerFr]);
535
+ const layoutIndices = React.useMemo(() => {
536
+ const rowArray = Object.keys(rowsTrack);
537
+ const columnArray = Object.keys(columnsTrack);
538
+ const rows = rowArray.reduce((prev, key, index) => {
744
539
  prev[key] = index;
745
540
  return prev;
746
541
  }, {});
747
- var columns = columnArray.reduce(function (prev, key, index) {
542
+ const columns = columnArray.reduce((prev, key, index) => {
748
543
  prev[key] = index;
749
544
  return prev;
750
545
  }, {});
751
546
  return {
752
- rows: rows,
753
- columns: columns,
754
- rowArray: rowArray,
755
- columnArray: columnArray
547
+ rows,
548
+ columns,
549
+ rowArray,
550
+ columnArray
756
551
  };
757
552
  }, [rowsTrack, columnsTrack]);
758
- var setRowValue = React.useCallback(function (isTop, splitterId, value) {
759
- var rows = layoutIndices.rows,
760
- rowArray = layoutIndices.rowArray;
761
- var stealFromTraversal = isTop ? -1 : 1;
762
- var addToTraversal = 0;
763
- setRowsTrack(function (state) {
764
- var oldValue = rowsTrack[splitterId];
765
- var stealFromIndex = rows[splitterId] + stealFromTraversal;
766
- var addToIndex = rows[splitterId] + addToTraversal;
767
- var stealFromKey = rowArray[stealFromIndex];
768
- var addToKey = rowArray[addToIndex];
769
- var difference = oldValue - value;
770
- var nextState = _objectSpread2({}, state);
553
+ const setRowValue = React.useCallback((isTop, splitterId, value) => {
554
+ const {
555
+ rows,
556
+ rowArray
557
+ } = layoutIndices;
558
+ const stealFromTraversal = isTop ? -1 : 1;
559
+ const addToTraversal = 0;
560
+ setRowsTrack(state => {
561
+ const oldValue = rowsTrack[splitterId];
562
+ const stealFromIndex = rows[splitterId] + stealFromTraversal;
563
+ const addToIndex = rows[splitterId] + addToTraversal;
564
+ const stealFromKey = rowArray[stealFromIndex];
565
+ const addToKey = rowArray[addToIndex];
566
+ const difference = oldValue - value;
567
+ const nextState = {
568
+ ...state
569
+ };
771
570
  nextState[addToKey] = rowsTrack[addToKey] - difference;
772
571
  nextState[stealFromKey] = rowsTrack[stealFromKey] + difference;
773
572
  return nextState;
774
573
  });
775
574
  }, [layoutIndices, rowsTrack, setRowsTrack]);
776
- var setColumnValue = React.useCallback(function (isStart, splitterId, value) {
777
- var columns = layoutIndices.columns,
778
- columnArray = layoutIndices.columnArray;
779
- var stealFromTraversal = isStart ? -1 : 1;
780
- var addToTraversal = 0;
781
- setColumnsTrack(function (state) {
782
- var stealFromIndex = columns[splitterId] + stealFromTraversal;
783
- var addToIndex = columns[splitterId] + addToTraversal;
784
- var oldValue = columnsTrack[splitterId];
785
- var stealFromKey = columnArray[stealFromIndex];
786
- var addToKey = columnArray[addToIndex];
787
- var difference = oldValue - value;
788
- var nextState = _objectSpread2({}, state);
575
+ const setColumnValue = React.useCallback((isStart, splitterId, value) => {
576
+ const {
577
+ columns,
578
+ columnArray
579
+ } = layoutIndices;
580
+ const stealFromTraversal = isStart ? -1 : 1;
581
+ const addToTraversal = 0;
582
+ setColumnsTrack(state => {
583
+ const stealFromIndex = columns[splitterId] + stealFromTraversal;
584
+ const addToIndex = columns[splitterId] + addToTraversal;
585
+ const oldValue = columnsTrack[splitterId];
586
+ const stealFromKey = columnArray[stealFromIndex];
587
+ const addToKey = columnArray[addToIndex];
588
+ const difference = oldValue - value;
589
+ const nextState = {
590
+ ...state
591
+ };
789
592
  nextState[addToKey] = columnsTrack[addToKey] - difference;
790
593
  nextState[stealFromKey] = columnsTrack[stealFromKey] + difference;
791
594
  return nextState;
792
595
  });
793
596
  }, [layoutIndices, columnsTrack, setColumnsTrack]);
794
- var getColumnValue = React.useCallback(function (splitterKey, isPixels) {
597
+ const getColumnValue = React.useCallback((splitterKey, isPixels) => {
795
598
  if (isPixels) {
796
599
  return layoutStateInPixels.columns[splitterKey];
797
600
  }
798
601
  return columnsTrack[splitterKey];
799
602
  }, [columnsTrack, layoutStateInPixels]);
800
- var getRowValue = React.useCallback(function (splitterKey, isPixels) {
603
+ const getRowValue = React.useCallback((splitterKey, isPixels) => {
801
604
  if (isPixels) {
802
605
  return layoutStateInPixels.rows[splitterKey];
803
606
  }
804
607
  return rowsTrack[splitterKey];
805
608
  }, [rowsTrack, layoutStateInPixels]);
806
- var getGridTemplateColumns = React.useCallback(function (isPixels) {
807
- var columnArray = layoutIndices.columnArray;
609
+ const getGridTemplateColumns = React.useCallback(isPixels => {
610
+ const {
611
+ columnArray
612
+ } = layoutIndices;
808
613
  if (isPixels) {
809
- return columnArray.map(function (col) {
810
- return "".concat(layoutStateInPixels.columns[col], "px");
811
- }).join(' ');
614
+ return columnArray.map(col => `${layoutStateInPixels.columns[col]}px`).join(' ');
812
615
  }
813
- return columnArray.map(function (col) {
814
- return "".concat(columnsTrack[col], "fr");
815
- }).join(' ');
616
+ return columnArray.map(col => `${columnsTrack[col]}fr`).join(' ');
816
617
  }, [layoutIndices, columnsTrack, layoutStateInPixels]);
817
- var getGridTemplateRows = React.useCallback(function (isPixels) {
818
- var rowArray = layoutIndices.rowArray;
618
+ const getGridTemplateRows = React.useCallback(isPixels => {
619
+ const {
620
+ rowArray
621
+ } = layoutIndices;
819
622
  if (isPixels) {
820
- return rowArray.map(function (row) {
821
- return "".concat(layoutStateInPixels.rows[row], "px");
822
- }).join(' ');
623
+ return rowArray.map(row => `${layoutStateInPixels.rows[row]}px`).join(' ');
823
624
  }
824
- return rowArray.map(function (row) {
825
- return "".concat(rowsTrack[row], "fr");
826
- }).join(' ');
625
+ return rowArray.map(row => `${rowsTrack[row]}fr`).join(' ');
827
626
  }, [layoutIndices, rowsTrack, layoutStateInPixels]);
828
- var providerId = containerUtilities.useId(id);
829
- var parentPaneProviderContext = usePaneProviderContext();
830
- var paneProviderContext = React.useMemo(function () {
831
- return providerId ? {
832
- providerId: providerId,
833
- contextData: _objectSpread2(_objectSpread2({}, parentPaneProviderContext.contextData), {}, _defineProperty({}, providerId, {
834
- columnState: columnState,
835
- rowState: rowState,
836
- setRowValue: setRowValue,
837
- setColumnValue: setColumnValue,
838
- getRowValue: getRowValue,
839
- getColumnValue: getColumnValue,
840
- totalPanesHeight: totalPanesHeight,
841
- totalPanesWidth: totalPanesWidth,
842
- pixelsPerFr: pixelsPerFr
843
- }))
844
- } : {};
845
- }, [providerId, parentPaneProviderContext, rowState, columnState, setRowValue, setColumnValue, getRowValue, getColumnValue, totalPanesHeight, totalPanesWidth, pixelsPerFr]);
627
+ const providerId = containerUtilities.useId(id);
628
+ const parentPaneProviderContext = usePaneProviderContext();
629
+ const paneProviderContext = React.useMemo(() => providerId ? {
630
+ providerId,
631
+ contextData: {
632
+ ...parentPaneProviderContext.contextData,
633
+ [providerId]: {
634
+ columnState,
635
+ rowState,
636
+ setRowValue,
637
+ setColumnValue,
638
+ getRowValue,
639
+ getColumnValue,
640
+ totalPanesHeight,
641
+ totalPanesWidth,
642
+ pixelsPerFr
643
+ }
644
+ }
645
+ } : {}, [providerId, parentPaneProviderContext, rowState, columnState, setRowValue, setColumnValue, getRowValue, getColumnValue, totalPanesHeight, totalPanesWidth, pixelsPerFr]);
846
646
  return React__default["default"].createElement(PaneProviderContext.Provider, {
847
647
  value: paneProviderContext
848
648
  }, children === null || children === void 0 ? void 0 : children({
849
649
  id: providerId,
850
- getRowValue: getRowValue,
851
- getColumnValue: getColumnValue,
852
- getGridTemplateColumns: getGridTemplateColumns,
853
- getGridTemplateRows: getGridTemplateRows
650
+ getRowValue,
651
+ getColumnValue,
652
+ getGridTemplateColumns,
653
+ getGridTemplateRows
854
654
  }));
855
655
  };
856
656
  PaneProvider.displayName = 'PaneProvider';
@@ -866,16 +666,14 @@ PaneProvider.propTypes = {
866
666
  children: PropTypes__default["default"].func
867
667
  };
868
668
 
869
- var PaneContext = React.createContext({
870
- setId: function setId() {
871
- return undefined;
872
- }
669
+ const PaneContext = React.createContext({
670
+ setId: () => undefined
873
671
  });
874
- var usePaneContext = function usePaneContext() {
672
+ const usePaneContext = () => {
875
673
  return React.useContext(PaneContext);
876
674
  };
877
675
 
878
- var PaneSplitterContext = React.createContext({
676
+ const PaneSplitterContext = React.createContext({
879
677
  orientation: 'start',
880
678
  min: 0,
881
679
  max: 0,
@@ -884,91 +682,92 @@ var PaneSplitterContext = React.createContext({
884
682
  size: 0,
885
683
  isRow: false
886
684
  });
887
- var usePaneSplitterContext = function usePaneSplitterContext() {
685
+ const usePaneSplitterContext = () => {
888
686
  return React.useContext(PaneSplitterContext);
889
687
  };
890
688
 
891
- var _excluded$1 = ["providerId", "layoutKey", "min", "max", "orientation"];
892
- var paneToSplitterOrientation = {
689
+ const paneToSplitterOrientation = {
893
690
  start: 'vertical',
894
691
  end: 'vertical',
895
692
  top: 'horizontal',
896
693
  bottom: 'horizontal'
897
694
  };
898
- var orientationToDimension = {
695
+ const orientationToDimension = {
899
696
  start: 'columns',
900
697
  end: 'columns',
901
698
  top: 'rows',
902
699
  bottom: 'rows'
903
700
  };
904
- var SplitterComponent = React.forwardRef(function (_ref, ref) {
701
+ const SplitterComponent = React.forwardRef((_ref, ref) => {
905
702
  var _separatorRef$current, _separatorRef$current2;
906
- var providerId = _ref.providerId,
907
- layoutKey = _ref.layoutKey,
908
- min = _ref.min,
909
- max = _ref.max,
910
- orientation = _ref.orientation,
911
- props = _objectWithoutProperties(_ref, _excluded$1);
912
- var paneProviderContext = usePaneProviderContextData(providerId);
913
- var paneContext = usePaneContext();
914
- var themeContext = React.useContext(styled.ThemeContext);
915
- var environment = reactTheming.useDocument(themeContext);
916
- var _useState = React.useState(false),
917
- _useState2 = _slicedToArray(_useState, 2),
918
- isHovered = _useState2[0],
919
- setIsHovered = _useState2[1];
920
- var isRow = orientationToDimension[orientation] === 'rows';
921
- var separatorRef = React.useRef(null);
922
- var splitterOrientation = paneToSplitterOrientation[orientation || 'end'];
923
- var pixelsPerFr = paneProviderContext ? paneProviderContext.pixelsPerFr[orientationToDimension[orientation]] : 0;
924
- var value = isRow ? paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.getRowValue(layoutKey, true) : paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.getColumnValue(layoutKey, true);
925
- var valueInFr = isRow ? paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.getRowValue(layoutKey) : paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.getColumnValue(layoutKey);
926
- var _useSplitter = containerSplitter.useSplitter({
703
+ let {
704
+ providerId,
705
+ layoutKey,
706
+ min,
707
+ max,
708
+ orientation,
709
+ onMouseDown,
710
+ onTouchStart,
711
+ onKeyDown,
712
+ onClick,
713
+ ...props
714
+ } = _ref;
715
+ const paneProviderContext = usePaneProviderContextData(providerId);
716
+ const paneContext = usePaneContext();
717
+ const themeContext = React.useContext(styled.ThemeContext);
718
+ const environment = reactTheming.useDocument(themeContext);
719
+ const [isHovered, setIsHovered] = React.useState(false);
720
+ const isRow = orientationToDimension[orientation] === 'rows';
721
+ const separatorRef = React.useRef(null);
722
+ const splitterOrientation = paneToSplitterOrientation[orientation || 'end'];
723
+ const pixelsPerFr = paneProviderContext ? paneProviderContext.pixelsPerFr[orientationToDimension[orientation]] : 0;
724
+ const value = isRow ? paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.getRowValue(layoutKey, true) : paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.getColumnValue(layoutKey, true);
725
+ const valueInFr = isRow ? paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.getRowValue(layoutKey) : paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.getColumnValue(layoutKey);
726
+ const {
727
+ getSeparatorProps,
728
+ getPrimaryPaneProps
729
+ } = containerSplitter.useSplitter({
927
730
  orientation: splitterOrientation,
928
731
  isLeading: orientation === 'start' || orientation === 'top',
929
732
  min: min * pixelsPerFr,
930
733
  max: max * pixelsPerFr,
931
734
  rtl: themeContext.rtl,
932
- environment: environment,
933
- onChange: function onChange(valueNow) {
735
+ environment,
736
+ onChange: valueNow => {
934
737
  if (isRow) {
935
738
  return paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.setRowValue(orientation === 'top', layoutKey, valueNow / pixelsPerFr);
936
739
  }
937
740
  return paneProviderContext === null || paneProviderContext === void 0 ? void 0 : paneProviderContext.setColumnValue(orientation === 'start', layoutKey, valueNow / pixelsPerFr);
938
741
  },
939
742
  valueNow: value,
940
- separatorRef: separatorRef
941
- }),
942
- getSeparatorProps = _useSplitter.getSeparatorProps,
943
- getPrimaryPaneProps = _useSplitter.getPrimaryPaneProps;
944
- React.useEffect(function () {
743
+ separatorRef
744
+ });
745
+ React.useEffect(() => {
945
746
  if (!paneContext.id) {
946
747
  paneContext.setId(getPrimaryPaneProps().id);
947
748
  }
948
749
  }, [paneContext, getPrimaryPaneProps]);
949
- var ariaLabel = reactTheming.useText(SplitterComponent, props, 'aria-label', "".concat(splitterOrientation, " splitter"));
950
- var separatorProps = getSeparatorProps({
750
+ const ariaLabel = reactTheming.useText(SplitterComponent, props, 'aria-label', `${splitterOrientation} splitter`);
751
+ const separatorProps = getSeparatorProps({
951
752
  'aria-controls': paneContext.id,
952
- 'aria-label': ariaLabel
753
+ 'aria-label': ariaLabel,
754
+ onMouseDown,
755
+ onTouchStart,
756
+ onKeyDown,
757
+ onClick
953
758
  });
954
- var size = isRow ? (_separatorRef$current = separatorRef.current) === null || _separatorRef$current === void 0 ? void 0 : _separatorRef$current.clientWidth : (_separatorRef$current2 = separatorRef.current) === null || _separatorRef$current2 === void 0 ? void 0 : _separatorRef$current2.clientHeight;
955
- var onMouseOver = React.useMemo(function () {
956
- return containerUtilities.composeEventHandlers(props.onMouseOver, function (event) {
957
- return setIsHovered(event.target === separatorRef.current);
958
- });
959
- }, [props.onMouseOver, separatorRef]);
759
+ const size = isRow ? (_separatorRef$current = separatorRef.current) === null || _separatorRef$current === void 0 ? void 0 : _separatorRef$current.clientWidth : (_separatorRef$current2 = separatorRef.current) === null || _separatorRef$current2 === void 0 ? void 0 : _separatorRef$current2.clientHeight;
760
+ const onMouseOver = React.useMemo(() => containerUtilities.composeEventHandlers(props.onMouseOver, event => setIsHovered(event.target === separatorRef.current)), [props.onMouseOver, separatorRef]);
960
761
  return React__default["default"].createElement(PaneSplitterContext.Provider, {
961
- value: React.useMemo(function () {
962
- return {
963
- orientation: orientation,
964
- layoutKey: layoutKey,
965
- min: min,
966
- max: max,
967
- valueNow: valueInFr,
968
- size: size,
969
- isRow: isRow
970
- };
971
- }, [orientation, layoutKey, min, max, valueInFr, size, isRow])
762
+ value: React.useMemo(() => ({
763
+ orientation,
764
+ layoutKey,
765
+ min,
766
+ max,
767
+ valueNow: valueInFr,
768
+ size,
769
+ isRow
770
+ }), [orientation, layoutKey, min, max, valueInFr, size, isRow])
972
771
  }, React__default["default"].createElement(StyledPaneSplitter, _extends({
973
772
  isHovered: isHovered,
974
773
  orientation: orientation
@@ -987,33 +786,36 @@ SplitterComponent.propTypes = {
987
786
  SplitterComponent.defaultProps = {
988
787
  orientation: 'end'
989
788
  };
990
- var Splitter = SplitterComponent;
789
+ const Splitter = SplitterComponent;
991
790
 
992
- var ContentComponent = React.forwardRef(function (props, ref) {
791
+ const ContentComponent = React.forwardRef((props, ref) => {
993
792
  return React__default["default"].createElement(StyledPaneContent, _extends({
994
793
  ref: ref
995
794
  }, props));
996
795
  });
997
796
  ContentComponent.displayName = 'Pane.Content';
998
- var Content = ContentComponent;
999
-
1000
- var SplitterButtonComponent = React.forwardRef(function (props, ref) {
1001
- var label = props.label,
1002
- defaultPlacement = props.placement;
1003
- var _usePaneSplitterConte = usePaneSplitterContext(),
1004
- orientation = _usePaneSplitterConte.orientation,
1005
- layoutKey = _usePaneSplitterConte.layoutKey,
1006
- min = _usePaneSplitterConte.min,
1007
- max = _usePaneSplitterConte.max,
1008
- isRow = _usePaneSplitterConte.isRow,
1009
- valueNow = _usePaneSplitterConte.valueNow,
1010
- size = _usePaneSplitterConte.size,
1011
- providerId = _usePaneSplitterConte.providerId;
1012
- var paneProviderContext = usePaneProviderContextData(providerId);
1013
- var isTop = orientation === 'top';
1014
- var isStart = orientation === 'start';
1015
- var isMin = valueNow === min;
1016
- var placement = defaultPlacement;
797
+ const Content = ContentComponent;
798
+
799
+ const SplitterButtonComponent = React.forwardRef((props, ref) => {
800
+ const {
801
+ label,
802
+ placement: defaultPlacement
803
+ } = props;
804
+ const {
805
+ orientation,
806
+ layoutKey,
807
+ min,
808
+ max,
809
+ isRow,
810
+ valueNow,
811
+ size,
812
+ providerId
813
+ } = usePaneSplitterContext();
814
+ const paneProviderContext = usePaneProviderContextData(providerId);
815
+ const isTop = orientation === 'top';
816
+ const isStart = orientation === 'start';
817
+ const isMin = valueNow === min;
818
+ let placement = defaultPlacement;
1017
819
  if (!defaultPlacement) {
1018
820
  if (isRow) {
1019
821
  placement = 'center';
@@ -1021,36 +823,30 @@ var SplitterButtonComponent = React.forwardRef(function (props, ref) {
1021
823
  placement = 'start';
1022
824
  }
1023
825
  }
1024
- var setValue = React.useCallback(function (value) {
826
+ const setValue = React.useCallback(value => {
1025
827
  if (isRow) {
1026
828
  paneProviderContext.setRowValue(isTop, layoutKey, value);
1027
829
  } else {
1028
830
  paneProviderContext.setColumnValue(isStart, layoutKey, value);
1029
831
  }
1030
832
  }, [isRow, isTop, isStart, layoutKey, paneProviderContext]);
1031
- var onClick = containerUtilities.composeEventHandlers(props.onClick, function () {
833
+ const onClick = containerUtilities.composeEventHandlers(props.onClick, () => {
1032
834
  if (isMin) {
1033
835
  setValue(max);
1034
836
  } else {
1035
837
  setValue(min);
1036
838
  }
1037
839
  });
1038
- var onKeyDown = containerUtilities.composeEventHandlers(props.onKeyDown, function (event) {
1039
- return event.stopPropagation();
1040
- }
840
+ const onKeyDown = containerUtilities.composeEventHandlers(props.onKeyDown, event => event.stopPropagation()
1041
841
  );
1042
- var onMouseDown = containerUtilities.composeEventHandlers(props.onMouseDown, function (event) {
1043
- return event.stopPropagation();
1044
- }
842
+ const onMouseDown = containerUtilities.composeEventHandlers(props.onMouseDown, event => event.stopPropagation()
1045
843
  );
1046
844
  return React__default["default"].createElement(reactTooltips.Tooltip, {
1047
845
  content: label,
1048
846
  style: {
1049
847
  cursor: 'default'
1050
848
  },
1051
- onMouseDown: function onMouseDown(e) {
1052
- return e.stopPropagation();
1053
- }
849
+ onMouseDown: e => e.stopPropagation()
1054
850
  }, React__default["default"].createElement(StyledPaneSplitterButton, _extends({
1055
851
  "aria-label": label
1056
852
  }, props, {
@@ -1065,24 +861,18 @@ var SplitterButtonComponent = React.forwardRef(function (props, ref) {
1065
861
  })));
1066
862
  });
1067
863
  SplitterButtonComponent.displayName = 'Pane.SplitterButton';
1068
- var SplitterButton = SplitterButtonComponent;
1069
-
1070
- var _excluded = ["children"];
1071
- var PaneComponent = React.forwardRef(function (_ref, ref) {
1072
- var children = _ref.children,
1073
- props = _objectWithoutProperties(_ref, _excluded);
1074
- var _useState = React.useState(),
1075
- _useState2 = _slicedToArray(_useState, 2),
1076
- paneId = _useState2[0],
1077
- setPaneId = _useState2[1];
1078
- var paneContext = React.useMemo(function () {
1079
- return {
1080
- id: paneId,
1081
- setId: function setId(id) {
1082
- return setPaneId(id);
1083
- }
1084
- };
1085
- }, [paneId]);
864
+ const SplitterButton = SplitterButtonComponent;
865
+
866
+ const PaneComponent = React.forwardRef((_ref, ref) => {
867
+ let {
868
+ children,
869
+ ...props
870
+ } = _ref;
871
+ const [paneId, setPaneId] = React.useState();
872
+ const paneContext = React.useMemo(() => ({
873
+ id: paneId,
874
+ setId: id => setPaneId(id)
875
+ }), [paneId]);
1086
876
  return React__default["default"].createElement(PaneContext.Provider, {
1087
877
  value: paneContext
1088
878
  }, React__default["default"].createElement(StyledPane, _extends({
@@ -1091,7 +881,7 @@ var PaneComponent = React.forwardRef(function (_ref, ref) {
1091
881
  }, props), children));
1092
882
  });
1093
883
  PaneComponent.displayName = 'Pane';
1094
- var Pane = PaneComponent;
884
+ const Pane = PaneComponent;
1095
885
  Pane.Content = Content;
1096
886
  Pane.Splitter = Splitter;
1097
887
  Pane.SplitterButton = SplitterButton;