@charcoal-ui/react 2.0.0-alpha.21 → 2.0.0-alpha.22

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.
@@ -1,6 +1,6 @@
1
- import React, { useContext, useCallback, createContext, useMemo, useRef, useState, useEffect } from 'react';
1
+ import React, { useContext, useCallback, createContext, useMemo, useRef, useState, useEffect, useImperativeHandle } from 'react';
2
2
  export { SSRProvider } from '@react-aria/ssr';
3
- import styled, { css } from 'styled-components';
3
+ import styled, { css, keyframes } from 'styled-components';
4
4
  import { createTheme } from '@charcoal-ui/styled';
5
5
  import { disabledSelector, px } from '@charcoal-ui/utils';
6
6
  import warning from 'warning';
@@ -9,6 +9,7 @@ import { useToggleState } from 'react-stately';
9
9
  import { useTextField } from '@react-aria/textfield';
10
10
  import { useVisuallyHidden } from '@react-aria/visually-hidden';
11
11
  import '@charcoal-ui/icons';
12
+ import { transparentize } from 'polished';
12
13
 
13
14
  function _extends() {
14
15
  _extends = Object.assign || function (target) {
@@ -81,10 +82,10 @@ function unreachable(value) {
81
82
 
82
83
  const theme$2 = createTheme(styled);
83
84
 
84
- let _$7 = t => t,
85
- _t$7,
86
- _t2$5,
87
- _t3$5;
85
+ let _$8 = t => t,
86
+ _t$8,
87
+ _t2$6,
88
+ _t3$6;
88
89
 
89
90
  const _excluded$6 = ["onClick", "disabled"];
90
91
  const Clickable = React.forwardRef(function Clickable(props, ref) {
@@ -111,7 +112,7 @@ const Clickable = React.forwardRef(function Clickable(props, ref) {
111
112
  }));
112
113
  }
113
114
  });
114
- const clickableCss = css(_t$7 || (_t$7 = _$7`
115
+ const clickableCss = css(_t$8 || (_t$8 = _$8`
115
116
  /* Clickable style */
116
117
  cursor: pointer;
117
118
 
@@ -119,7 +120,7 @@ const clickableCss = css(_t$7 || (_t$7 = _$7`
119
120
  cursor: default;
120
121
  }
121
122
  `), disabledSelector);
122
- const Button$1 = styled.button(_t2$5 || (_t2$5 = _$7`
123
+ const Button$1 = styled.button(_t2$6 || (_t2$6 = _$8`
123
124
  /* Reset button appearance */
124
125
  appearance: none;
125
126
  background: transparent;
@@ -155,7 +156,7 @@ const Button$1 = styled.button(_t2$5 || (_t2$5 = _$7`
155
156
 
156
157
  ${0}
157
158
  `), clickableCss);
158
- const A = styled.span(_t3$5 || (_t3$5 = _$7`
159
+ const A = styled.span(_t3$6 || (_t3$6 = _$8`
159
160
  /* Reset a-tag appearance */
160
161
  color: inherit;
161
162
 
@@ -170,8 +171,8 @@ const A = styled.span(_t3$5 || (_t3$5 = _$7`
170
171
  ${0}
171
172
  `), clickableCss);
172
173
 
173
- let _$6 = t => t,
174
- _t$6;
174
+ let _$7 = t => t,
175
+ _t$7;
175
176
 
176
177
  const _excluded$5 = ["children", "variant", "size", "fixed", "disabled"];
177
178
  const Button = React.forwardRef(function Button(_ref, ref) {
@@ -198,7 +199,7 @@ const StyledButton = styled(Clickable).withConfig({
198
199
  return prop !== 'fixed';
199
200
  }
200
201
 
201
- }).attrs(styledProps$1)(_t$6 || (_t$6 = _$6`
202
+ }).attrs(styledProps$1)(_t$7 || (_t$7 = _$7`
202
203
  width: ${0};
203
204
  display: inline-grid;
204
205
  align-items: center;
@@ -270,8 +271,8 @@ function sizeToProps$1(size) {
270
271
  }
271
272
  }
272
273
 
273
- let _$5 = t => t,
274
- _t$5;
274
+ let _$6 = t => t,
275
+ _t$6;
275
276
 
276
277
  const _excluded$4 = ["variant", "size", "icon"];
277
278
  const IconButton = React.forwardRef(function IconButtonInner(_ref, ref) {
@@ -291,7 +292,7 @@ const IconButton = React.forwardRef(function IconButtonInner(_ref, ref) {
291
292
  name: icon
292
293
  }));
293
294
  });
294
- const StyledIconButton = styled(Clickable).attrs(styledProps)(_t$5 || (_t$5 = _$5`
295
+ const StyledIconButton = styled(Clickable).attrs(styledProps)(_t$6 || (_t$6 = _$6`
295
296
  user-select: none;
296
297
 
297
298
  width: ${0}px;
@@ -381,10 +382,10 @@ function validateIconSize(size, icon) {
381
382
  }
382
383
  }
383
384
 
384
- let _$4 = t => t,
385
- _t$4,
386
- _t2$4,
387
- _t3$4,
385
+ let _$5 = t => t,
386
+ _t$5,
387
+ _t2$5,
388
+ _t3$5,
388
389
  _t4$3;
389
390
  function Radio({
390
391
  value,
@@ -419,7 +420,7 @@ function Radio({
419
420
  disabled: isDisabled || isReadonly
420
421
  }), children != null && /*#__PURE__*/React.createElement(RadioLabel, null, children));
421
422
  }
422
- const RadioRoot = styled.label(_t$4 || (_t$4 = _$4`
423
+ const RadioRoot = styled.label(_t$5 || (_t$5 = _$5`
423
424
  display: grid;
424
425
  grid-template-columns: auto 1fr;
425
426
  grid-gap: ${0};
@@ -432,7 +433,7 @@ const RadioRoot = styled.label(_t$4 || (_t$4 = _$4`
432
433
  }) => px(theme.spacing[4]), theme$2(o => [o.disabled]));
433
434
  const RadioInput = styled.input.attrs({
434
435
  type: 'radio'
435
- })(_t2$4 || (_t2$4 = _$4`
436
+ })(_t2$5 || (_t2$5 = _$5`
436
437
  /** Make prior to browser default style */
437
438
  &[type='radio'] {
438
439
  appearance: none;
@@ -473,11 +474,11 @@ const RadioInput = styled.input.attrs({
473
474
  }) => theme$2(o => [o.borderRadius('oval'), o.bg.text5.hover.press, _hasError && o.outline.assertive]), ({
474
475
  theme
475
476
  }) => theme.color.text4, theme$2(o => o.bg.brand.hover.press), theme$2(o => [o.bg.text5.hover.press, o.borderRadius('oval')]), theme$2(o => o.outline.default.focus));
476
- const RadioLabel = styled.div(_t3$4 || (_t3$4 = _$4`
477
+ const RadioLabel = styled.div(_t3$5 || (_t3$5 = _$5`
477
478
  ${0}
478
479
  `), theme$2(o => [o.typography(14)])); // TODO: use (or polyfill) flex gap
479
480
 
480
- const StyledRadioGroup = styled.div(_t4$3 || (_t4$3 = _$4`
481
+ const StyledRadioGroup = styled.div(_t4$3 || (_t4$3 = _$5`
481
482
  display: grid;
482
483
  grid-template-columns: 1fr;
483
484
  grid-gap: ${0};
@@ -541,10 +542,10 @@ const SelectGroupContext = createContext({
541
542
 
542
543
  });
543
544
 
544
- let _$3 = t => t,
545
- _t$3,
546
- _t2$3,
547
- _t3$3,
545
+ let _$4 = t => t,
546
+ _t$4,
547
+ _t2$4,
548
+ _t3$4,
548
549
  _t4$2,
549
550
  _t5$1;
550
551
  function Select({
@@ -601,7 +602,7 @@ function Select({
601
602
  "unsafe-non-guideline-scale": 16 / 24
602
603
  })), Boolean(children) && /*#__PURE__*/React.createElement(SelectLabel, null, children));
603
604
  }
604
- const SelectRoot = styled.label(_t$3 || (_t$3 = _$3`
605
+ const SelectRoot = styled.label(_t$4 || (_t$4 = _$4`
605
606
  display: grid;
606
607
  grid-template-columns: auto 1fr;
607
608
  align-items: center;
@@ -615,14 +616,14 @@ const SelectRoot = styled.label(_t$3 || (_t$3 = _$3`
615
616
  `), disabledSelector, ({
616
617
  theme
617
618
  }) => px(theme.spacing[4]), theme$2(o => o.disabled));
618
- const SelectLabel = styled.div(_t2$3 || (_t2$3 = _$3`
619
+ const SelectLabel = styled.div(_t2$4 || (_t2$4 = _$4`
619
620
  display: flex;
620
621
  align-items: center;
621
622
  ${0}
622
623
  `), theme$2(o => [o.typography(14), o.font.text1]));
623
624
  const SelectInput = styled.input.attrs({
624
625
  type: 'checkbox'
625
- })(_t3$3 || (_t3$3 = _$3`
626
+ })(_t3$4 || (_t3$4 = _$4`
626
627
  &[type='checkbox'] {
627
628
  appearance: none;
628
629
  display: block;
@@ -640,7 +641,7 @@ const SelectInput = styled.input.attrs({
640
641
  hasError,
641
642
  overlay
642
643
  }) => theme$2(o => [o.bg.text3.hover.press, o.borderRadius('oval'), hasError && !overlay && o.outline.assertive, overlay && o.bg.surface4]));
643
- const SelectInputOverlay = styled.div(_t4$2 || (_t4$2 = _$3`
644
+ const SelectInputOverlay = styled.div(_t4$2 || (_t4$2 = _$4`
644
645
  position: absolute;
645
646
  top: -2px;
646
647
  left: -2px;
@@ -657,7 +658,7 @@ const SelectInputOverlay = styled.div(_t4$2 || (_t4$2 = _$3`
657
658
  overlay
658
659
  }) => theme$2(o => [o.width.px(24), o.height.px(24), o.borderRadius('oval'), o.font.text5, hasError && overlay && o.outline.assertive]), ({
659
660
  overlay
660
- }) => overlay && css(_t5$1 || (_t5$1 = _$3`
661
+ }) => overlay && css(_t5$1 || (_t5$1 = _$4`
661
662
  border-color: ${0};
662
663
  border-width: 2px;
663
664
  border-style: solid;
@@ -704,10 +705,10 @@ function SelectGroup({
704
705
  }, children));
705
706
  }
706
707
 
707
- let _$2 = t => t,
708
- _t$2,
709
- _t2$2,
710
- _t3$2;
708
+ let _$3 = t => t,
709
+ _t$3,
710
+ _t2$3,
711
+ _t3$3;
711
712
 
712
713
  const _excluded$3 = ["className", "type"];
713
714
  function SwitchCheckbox(props) {
@@ -737,7 +738,7 @@ function SwitchCheckbox(props) {
737
738
  // eslint-disable-next-line react/destructuring-assignment
738
739
  React.createElement(LabelInner, null, props.children) : undefined);
739
740
  }
740
- const Label$1 = styled.label(_t$2 || (_t$2 = _$2`
741
+ const Label$1 = styled.label(_t$3 || (_t$3 = _$3`
741
742
  display: inline-grid;
742
743
  grid-template-columns: auto 1fr;
743
744
  gap: ${0};
@@ -752,12 +753,12 @@ const Label$1 = styled.label(_t$2 || (_t$2 = _$2`
752
753
  `), ({
753
754
  theme
754
755
  }) => px(theme.spacing[4]), theme$2(o => o.disabled), disabledSelector);
755
- const LabelInner = styled.div(_t2$2 || (_t2$2 = _$2`
756
+ const LabelInner = styled.div(_t2$3 || (_t2$3 = _$3`
756
757
  ${0}
757
758
  `), theme$2(o => o.typography(14)));
758
759
  const SwitchInput = styled.input.attrs({
759
760
  type: 'checkbox'
760
- })(_t3$2 || (_t3$2 = _$2`
761
+ })(_t3$3 || (_t3$3 = _$3`
761
762
  &[type='checkbox'] {
762
763
  appearance: none;
763
764
  display: inline-flex;
@@ -792,10 +793,10 @@ const SwitchInput = styled.input.attrs({
792
793
  }
793
794
  `), theme$2(o => [o.borderRadius(16), o.height.px(16), o.bg.text4.hover.press, o.outline.default.focus]), theme$2(o => [o.bg.text5.hover.press, o.borderRadius('oval')]), theme$2(o => o.bg.brand.hover.press));
794
795
 
795
- let _$1 = t => t,
796
- _t$1,
797
- _t2$1,
798
- _t3$1,
796
+ let _$2 = t => t,
797
+ _t$2,
798
+ _t2$2,
799
+ _t3$2,
799
800
  _t4$1;
800
801
 
801
802
  const _excluded$2 = ["style", "className", "label", "required", "requiredText", "subLabel"];
@@ -818,16 +819,16 @@ const FieldLabel = React.forwardRef(function FieldLabel(_ref, ref) {
818
819
  }, labelProps), label), required && /*#__PURE__*/React.createElement(RequiredText, null, requiredText), /*#__PURE__*/React.createElement(SubLabelClickable, null, /*#__PURE__*/React.createElement("span", null, subLabel)));
819
820
  });
820
821
  const theme$1 = createTheme(styled);
821
- const Label = styled.label(_t$1 || (_t$1 = _$1`
822
+ const Label = styled.label(_t$2 || (_t$2 = _$2`
822
823
  ${0}
823
824
  `), theme$1(o => [o.typography(14).bold, o.font.text1]));
824
- const RequiredText = styled.span(_t2$1 || (_t2$1 = _$1`
825
+ const RequiredText = styled.span(_t2$2 || (_t2$2 = _$2`
825
826
  ${0}
826
827
  `), theme$1(o => [o.typography(14), o.font.text3]));
827
- const SubLabelClickable = styled.div(_t3$1 || (_t3$1 = _$1`
828
+ const SubLabelClickable = styled.div(_t3$2 || (_t3$2 = _$2`
828
829
  ${0}
829
830
  `), theme$1(o => [o.typography(14), o.font.text3.hover.press, o.outline.default.focus]));
830
- const FieldLabelWrapper = styled.div(_t4$1 || (_t4$1 = _$1`
831
+ const FieldLabelWrapper = styled.div(_t4$1 || (_t4$1 = _$2`
831
832
  display: inline-flex;
832
833
  align-items: center;
833
834
 
@@ -840,10 +841,10 @@ const FieldLabelWrapper = styled.div(_t4$1 || (_t4$1 = _$1`
840
841
  }
841
842
  `), RequiredText, theme$1(o => o.margin.left(4)), SubLabelClickable, theme$1(o => o.margin.left('auto')));
842
843
 
843
- let _ = t => t,
844
- _t,
845
- _t2,
846
- _t3,
844
+ let _$1 = t => t,
845
+ _t$1,
846
+ _t2$1,
847
+ _t3$1,
847
848
  _t4,
848
849
  _t5,
849
850
  _t6,
@@ -1025,11 +1026,8 @@ const MultiLineTextField = React.forwardRef(function MultiLineTextFieldInner(_re
1025
1026
  const syncHeight = useCallback(textarea => {
1026
1027
  var _$match$length, _$match;
1027
1028
 
1028
- const rows = (_$match$length = (_$match = `${textarea.value}\n`.match(/\n/g)) == null ? void 0 : _$match.length) != null ? _$match$length : 1;
1029
-
1030
- if (initialRows <= rows) {
1031
- setRows(rows);
1032
- }
1029
+ const rows = ((_$match$length = (_$match = `${textarea.value}\n`.match(/\n/g)) == null ? void 0 : _$match.length) != null ? _$match$length : 0) || 1;
1030
+ setRows(initialRows <= rows ? rows : initialRows);
1033
1031
  }, [initialRows]);
1034
1032
  const nonControlled = props.value === undefined;
1035
1033
  const handleChange = useCallback(value => {
@@ -1092,7 +1090,7 @@ const MultiLineTextField = React.forwardRef(function MultiLineTextFieldInner(_re
1092
1090
  invalid: invalid
1093
1091
  }, invalid ? errorMessageProps : descriptionProps), assistiveText));
1094
1092
  });
1095
- const TextFieldRoot = styled.div(_t || (_t = _`
1093
+ const TextFieldRoot = styled.div(_t$1 || (_t$1 = _$1`
1096
1094
  display: flex;
1097
1095
  flex-direction: column;
1098
1096
 
@@ -1100,21 +1098,21 @@ const TextFieldRoot = styled.div(_t || (_t = _`
1100
1098
  `), p => p.isDisabled && {
1101
1099
  opacity: p.theme.elementEffect.disabled.opacity
1102
1100
  });
1103
- const TextFieldLabel = styled(FieldLabel)(_t2 || (_t2 = _`
1101
+ const TextFieldLabel = styled(FieldLabel)(_t2$1 || (_t2$1 = _$1`
1104
1102
  ${0}
1105
1103
  `), theme(o => o.margin.bottom(8)));
1106
- const StyledInputContainer = styled.div(_t3 || (_t3 = _`
1104
+ const StyledInputContainer = styled.div(_t3$1 || (_t3$1 = _$1`
1107
1105
  height: 40px;
1108
1106
  display: grid;
1109
1107
  position: relative;
1110
1108
  `));
1111
- const PrefixContainer = styled.span(_t4 || (_t4 = _`
1109
+ const PrefixContainer = styled.span(_t4 || (_t4 = _$1`
1112
1110
  position: absolute;
1113
1111
  top: 50%;
1114
1112
  left: 8px;
1115
1113
  transform: translateY(-50%);
1116
1114
  `));
1117
- const SuffixContainer = styled.span(_t5 || (_t5 = _`
1115
+ const SuffixContainer = styled.span(_t5 || (_t5 = _$1`
1118
1116
  position: absolute;
1119
1117
  top: 50%;
1120
1118
  right: 8px;
@@ -1123,12 +1121,12 @@ const SuffixContainer = styled.span(_t5 || (_t5 = _`
1123
1121
  display: flex;
1124
1122
  gap: 8px;
1125
1123
  `));
1126
- const Affix = styled.span(_t6 || (_t6 = _`
1124
+ const Affix = styled.span(_t6 || (_t6 = _$1`
1127
1125
  user-select: none;
1128
1126
 
1129
1127
  ${0}
1130
1128
  `), theme(o => [o.typography(14).preserveHalfLeading, o.font.text2]));
1131
- const StyledInput = styled.input(_t7 || (_t7 = _`
1129
+ const StyledInput = styled.input(_t7 || (_t7 = _$1`
1132
1130
  border: none;
1133
1131
  box-sizing: border-box;
1134
1132
  outline: none;
@@ -1154,7 +1152,7 @@ const StyledInput = styled.input(_t7 || (_t7 = _`
1154
1152
  ${0}
1155
1153
  }
1156
1154
  `), p => p.extraLeftPadding, p => p.extraRightPadding, p => theme(o => [o.bg.surface3.hover, o.outline.default.focus, p.invalid && o.outline.assertive, o.font.text2]), theme(o => o.font.text3));
1157
- const StyledTextareaContainer = styled.div(_t8 || (_t8 = _`
1155
+ const StyledTextareaContainer = styled.div(_t8 || (_t8 = _$1`
1158
1156
  position: relative;
1159
1157
  overflow: hidden;
1160
1158
  padding: 0 8px;
@@ -1168,10 +1166,10 @@ const StyledTextareaContainer = styled.div(_t8 || (_t8 = _`
1168
1166
  ${0};
1169
1167
  `), p => theme(o => [o.bg.surface3.hover, p.invalid && o.outline.assertive, o.font.text2, o.borderRadius(4)]), p => theme(o => p.invalid ? o.outline.assertive : o.outline.default), ({
1170
1168
  rows
1171
- }) => css(_t9 || (_t9 = _`
1169
+ }) => css(_t9 || (_t9 = _$1`
1172
1170
  height: calc(22px * ${0} + 18px);
1173
1171
  `), rows));
1174
- const StyledTextarea = styled.textarea(_t10 || (_t10 = _`
1172
+ const StyledTextarea = styled.textarea(_t10 || (_t10 = _$1`
1175
1173
  border: none;
1176
1174
  outline: none;
1177
1175
  resize: none;
@@ -1206,25 +1204,25 @@ const StyledTextarea = styled.textarea(_t10 || (_t10 = _`
1206
1204
  scrollbar-width: none; /* Firefox */
1207
1205
  `), p => p.noBottomPadding ? 0 : '', ({
1208
1206
  rows: _rows = 1
1209
- }) => css(_t11 || (_t11 = _`
1207
+ }) => css(_t11 || (_t11 = _$1`
1210
1208
  height: calc(22px / 0.875 * ${0});
1211
1209
  `), _rows), theme(o => o.font.text3));
1212
- const SingleLineCounter = styled.span(_t12 || (_t12 = _`
1210
+ const SingleLineCounter = styled.span(_t12 || (_t12 = _$1`
1213
1211
  ${0}
1214
1212
  `), theme(o => [o.typography(14).preserveHalfLeading, o.font.text3]));
1215
- const MultiLineCounter = styled.span(_t13 || (_t13 = _`
1213
+ const MultiLineCounter = styled.span(_t13 || (_t13 = _$1`
1216
1214
  position: absolute;
1217
1215
  bottom: 9px;
1218
1216
  right: 8px;
1219
1217
 
1220
1218
  ${0}
1221
1219
  `), theme(o => [o.typography(14).preserveHalfLeading, o.font.text3]));
1222
- const AssistiveText = styled.p(_t14 || (_t14 = _`
1220
+ const AssistiveText = styled.p(_t14 || (_t14 = _$1`
1223
1221
  ${0}
1224
1222
  `), p => theme(o => [o.typography(14), o.margin.top(8), o.margin.bottom(0), o.font[p.invalid ? 'assertive' : 'text1']]));
1225
1223
 
1226
1224
  const _excluded = ["name", "scale", "unsafeNonGuidelineScale", "className"];
1227
- const Icon = React.forwardRef(function IconInner(_ref, ref) {
1225
+ const Icon$1 = React.forwardRef(function IconInner(_ref, ref) {
1228
1226
  let {
1229
1227
  name,
1230
1228
  scale,
@@ -1242,5 +1240,82 @@ const Icon = React.forwardRef(function IconInner(_ref, ref) {
1242
1240
  }, rest));
1243
1241
  });
1244
1242
 
1245
- export { Button, Clickable, ComponentAbstraction, Icon, IconButton, Radio, RadioGroup, Select, SelectGroup, SwitchCheckbox as Switch, TextField, useComponentAbstraction };
1243
+ let _ = t => t,
1244
+ _t,
1245
+ _t2,
1246
+ _t3;
1247
+ function LoadingSpinner({
1248
+ size = 48,
1249
+ padding = 16,
1250
+ transparent = false
1251
+ }) {
1252
+ return /*#__PURE__*/React.createElement(LoadingSpinnerRoot, {
1253
+ size: size,
1254
+ padding: padding,
1255
+ transparent: transparent
1256
+ }, /*#__PURE__*/React.createElement(LoadingSpinnerIcon, null));
1257
+ }
1258
+ const LoadingSpinnerRoot = styled.div.attrs({
1259
+ role: 'progressbar'
1260
+ })(_t || (_t = _`
1261
+ margin: auto;
1262
+ padding: ${0}px;
1263
+ border-radius: 8px;
1264
+ font-size: ${0}px;
1265
+ width: ${0}px;
1266
+ height: ${0}px;
1267
+ background-color: ${0};
1268
+ color: ${0};
1269
+ `), props => props.padding, props => props.size, props => props.size, props => props.size, ({
1270
+ theme,
1271
+ transparent
1272
+ }) => transparent ? 'transparent' : transparentize(0.32, theme.color.background1), ({
1273
+ theme
1274
+ }) => theme.color.text4);
1275
+ const scaleout = keyframes(_t2 || (_t2 = _`
1276
+ from {
1277
+ transform: scale(0);
1278
+ opacity: 1;
1279
+ }
1280
+
1281
+ to {
1282
+ transform: scale(1);
1283
+ opacity: 0;
1284
+ }
1285
+ `));
1286
+ const Icon = styled.div.attrs({
1287
+ role: 'presentation'
1288
+ })(_t3 || (_t3 = _`
1289
+ width: 1em;
1290
+ height: 1em;
1291
+ border-radius: 1em;
1292
+ background-color: currentColor;
1293
+ animation: ${0} 1s both ease-out;
1294
+ animation-iteration-count: ${0};
1295
+
1296
+ &[data-reset-animation] {
1297
+ animation: none;
1298
+ }
1299
+ `), scaleout, p => p.once ? 1 : 'infinite');
1300
+ const LoadingSpinnerIcon = React.forwardRef(function LoadingSpinnerIcon({
1301
+ once = false
1302
+ }, ref) {
1303
+ const iconRef = useRef(null);
1304
+ useImperativeHandle(ref, () => ({
1305
+ restart: () => {
1306
+ if (!iconRef.current) {
1307
+ return;
1308
+ }
1309
+
1310
+ iconRef.current.dataset.resetAnimation = 'true'; // Force reflow hack!
1311
+ delete iconRef.current.dataset.resetAnimation;
1312
+ }
1313
+ }));
1314
+ return /*#__PURE__*/React.createElement(Icon, {
1315
+ ref: iconRef,
1316
+ once: once
1317
+ });
1318
+ });
1319
+
1320
+ export { Button, Clickable, ComponentAbstraction, Icon$1 as Icon, IconButton, LoadingSpinner, LoadingSpinnerIcon, Radio, RadioGroup, Select, SelectGroup, SwitchCheckbox as Switch, TextField, useComponentAbstraction };
1246
1321
  //# sourceMappingURL=index.modern.js.map