thailife-react 0.0.23 → 0.0.25

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 (106) hide show
  1. package/dist/cjs/index.js +508 -0
  2. package/dist/cjs/index.js.map +1 -0
  3. package/dist/esm/components/Autocomplete/Autocomplete.d.ts +18 -0
  4. package/dist/esm/components/Autocomplete/Autocomplete.d.ts.map +1 -0
  5. package/dist/esm/components/Autocomplete/index.d.ts +2 -0
  6. package/dist/esm/components/Autocomplete/index.d.ts.map +1 -0
  7. package/dist/esm/components/Button/Button.d.ts +14 -0
  8. package/dist/esm/components/Button/Button.d.ts.map +1 -0
  9. package/dist/esm/components/Button/index.d.ts +3 -0
  10. package/dist/esm/components/Button/index.d.ts.map +1 -0
  11. package/dist/esm/components/Checkbox/Checkbox.d.ts +12 -0
  12. package/dist/esm/components/Checkbox/Checkbox.d.ts.map +1 -0
  13. package/dist/esm/components/Checkbox/index.d.ts +3 -0
  14. package/dist/esm/components/Checkbox/index.d.ts.map +1 -0
  15. package/dist/esm/components/Datepicker/Datepicker.d.ts +23 -0
  16. package/dist/esm/components/Datepicker/Datepicker.d.ts.map +1 -0
  17. package/dist/esm/components/Datepicker/index.d.ts +3 -0
  18. package/dist/esm/components/Datepicker/index.d.ts.map +1 -0
  19. package/dist/esm/components/Input/Input.d.ts +27 -0
  20. package/dist/esm/components/Input/Input.d.ts.map +1 -0
  21. package/dist/esm/components/Input/index.d.ts +3 -0
  22. package/dist/esm/components/Input/index.d.ts.map +1 -0
  23. package/dist/esm/components/Radio/Radio.d.ts +12 -0
  24. package/dist/esm/components/Radio/Radio.d.ts.map +1 -0
  25. package/dist/esm/components/Radio/index.d.ts +3 -0
  26. package/dist/esm/components/Radio/index.d.ts.map +1 -0
  27. package/dist/esm/components/Select/Select.d.ts +16 -0
  28. package/dist/esm/components/Select/Select.d.ts.map +1 -0
  29. package/dist/esm/components/Select/index.d.ts +3 -0
  30. package/dist/esm/components/Select/index.d.ts.map +1 -0
  31. package/dist/esm/components/index.d.ts +8 -0
  32. package/dist/esm/components/index.d.ts.map +1 -0
  33. package/dist/esm/index.d.ts +3 -0
  34. package/dist/esm/index.d.ts.map +1 -0
  35. package/dist/esm/index.js +500 -0
  36. package/dist/esm/index.js.map +1 -0
  37. package/package.json +40 -74
  38. package/LICENSE +0 -21
  39. package/README.md +0 -118
  40. package/dist/components/Autocomplete/Autocomplete.d.ts +0 -17
  41. package/dist/components/Autocomplete/Autocomplete.d.ts.map +0 -1
  42. package/dist/components/Autocomplete/Autocomplete.stories.d.ts +0 -9
  43. package/dist/components/Autocomplete/Autocomplete.stories.d.ts.map +0 -1
  44. package/dist/components/Box/Box.d.ts +0 -86
  45. package/dist/components/Box/Box.d.ts.map +0 -1
  46. package/dist/components/Box/Box.stories.d.ts +0 -15
  47. package/dist/components/Box/Box.stories.d.ts.map +0 -1
  48. package/dist/components/Button/Button.d.ts +0 -12
  49. package/dist/components/Button/Button.d.ts.map +0 -1
  50. package/dist/components/Button/Button.stories.d.ts +0 -7
  51. package/dist/components/Button/Button.stories.d.ts.map +0 -1
  52. package/dist/components/Checkbox/Checkbox.d.ts +0 -13
  53. package/dist/components/Checkbox/Checkbox.d.ts.map +0 -1
  54. package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -7
  55. package/dist/components/Checkbox/Checkbox.stories.d.ts.map +0 -1
  56. package/dist/components/Container/Container.d.ts +0 -9
  57. package/dist/components/Container/Container.d.ts.map +0 -1
  58. package/dist/components/Container/Container.stories.d.ts +0 -12
  59. package/dist/components/Container/Container.stories.d.ts.map +0 -1
  60. package/dist/components/DataTable/DataTable.d.ts +0 -30
  61. package/dist/components/DataTable/DataTable.d.ts.map +0 -1
  62. package/dist/components/DataTable/DataTable.stories.d.ts +0 -7
  63. package/dist/components/DataTable/DataTable.stories.d.ts.map +0 -1
  64. package/dist/components/DatePicker/DatePicker.d.ts +0 -31
  65. package/dist/components/DatePicker/DatePicker.d.ts.map +0 -1
  66. package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -7
  67. package/dist/components/DatePicker/DatePicker.stories.d.ts.map +0 -1
  68. package/dist/components/DatePicker/examples.d.ts +0 -4
  69. package/dist/components/DatePicker/examples.d.ts.map +0 -1
  70. package/dist/components/DatePicker/index.d.ts +0 -4
  71. package/dist/components/DatePicker/index.d.ts.map +0 -1
  72. package/dist/components/Grid/Grid.d.ts +0 -30
  73. package/dist/components/Grid/Grid.d.ts.map +0 -1
  74. package/dist/components/Grid/Grid.stories.d.ts +0 -13
  75. package/dist/components/Grid/Grid.stories.d.ts.map +0 -1
  76. package/dist/components/Input/Input.d.ts +0 -13
  77. package/dist/components/Input/Input.d.ts.map +0 -1
  78. package/dist/components/Input/Input.stories.d.ts +0 -7
  79. package/dist/components/Input/Input.stories.d.ts.map +0 -1
  80. package/dist/components/InputFile/InputFile.d.ts +0 -14
  81. package/dist/components/InputFile/InputFile.d.ts.map +0 -1
  82. package/dist/components/InputFile/InputFile.stories.d.ts +0 -7
  83. package/dist/components/InputFile/InputFile.stories.d.ts.map +0 -1
  84. package/dist/components/Radio/Radio.d.ts +0 -12
  85. package/dist/components/Radio/Radio.d.ts.map +0 -1
  86. package/dist/components/Radio/Radio.stories.d.ts +0 -7
  87. package/dist/components/Radio/Radio.stories.d.ts.map +0 -1
  88. package/dist/components/Select/Select.d.ts +0 -19
  89. package/dist/components/Select/Select.d.ts.map +0 -1
  90. package/dist/components/Select/Select.stories.d.ts +0 -7
  91. package/dist/components/Select/Select.stories.d.ts.map +0 -1
  92. package/dist/components/Textarea/Textarea.d.ts +0 -13
  93. package/dist/components/Textarea/Textarea.d.ts.map +0 -1
  94. package/dist/components/Textarea/Textarea.stories.d.ts +0 -7
  95. package/dist/components/Textarea/Textarea.stories.d.ts.map +0 -1
  96. package/dist/index.d.ts +0 -31
  97. package/dist/index.d.ts.map +0 -1
  98. package/dist/index.esm.js +0 -2914
  99. package/dist/index.esm.js.map +0 -1
  100. package/dist/index.js +0 -2949
  101. package/dist/index.js.map +0 -1
  102. package/dist/styles/index.css +0 -1
  103. package/dist/styles/index.d.ts +0 -1
  104. package/dist/styles/index.d.ts.map +0 -1
  105. package/dist/styles/theme.d.ts +0 -87
  106. package/dist/styles/theme.d.ts.map +0 -1
package/dist/index.js DELETED
@@ -1,2949 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- function _interopNamespaceDefault(e) {
8
- var n = Object.create(null);
9
- if (e) {
10
- Object.keys(e).forEach(function (k) {
11
- if (k !== 'default') {
12
- var d = Object.getOwnPropertyDescriptor(e, k);
13
- Object.defineProperty(n, k, d.get ? d : {
14
- enumerable: true,
15
- get: function () { return e[k]; }
16
- });
17
- }
18
- });
19
- }
20
- n.default = e;
21
- return Object.freeze(n);
22
- }
23
-
24
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
25
-
26
- function _defineProperty(e, r, t) {
27
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
28
- value: t,
29
- enumerable: true,
30
- configurable: true,
31
- writable: true
32
- }) : e[r] = t, e;
33
- }
34
- function ownKeys(e, r) {
35
- var t = Object.keys(e);
36
- if (Object.getOwnPropertySymbols) {
37
- var o = Object.getOwnPropertySymbols(e);
38
- r && (o = o.filter(function (r) {
39
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
40
- })), t.push.apply(t, o);
41
- }
42
- return t;
43
- }
44
- function _objectSpread2(e) {
45
- for (var r = 1; r < arguments.length; r++) {
46
- var t = null != arguments[r] ? arguments[r] : {};
47
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
48
- _defineProperty(e, r, t[r]);
49
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
50
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
51
- });
52
- }
53
- return e;
54
- }
55
- function _objectWithoutProperties(e, t) {
56
- if (null == e) return {};
57
- var o,
58
- r,
59
- i = _objectWithoutPropertiesLoose(e, t);
60
- if (Object.getOwnPropertySymbols) {
61
- var n = Object.getOwnPropertySymbols(e);
62
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
63
- }
64
- return i;
65
- }
66
- function _objectWithoutPropertiesLoose(r, e) {
67
- if (null == r) return {};
68
- var t = {};
69
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
70
- if (-1 !== e.indexOf(n)) continue;
71
- t[n] = r[n];
72
- }
73
- return t;
74
- }
75
- function _toPrimitive(t, r) {
76
- if ("object" != typeof t || !t) return t;
77
- var e = t[Symbol.toPrimitive];
78
- if (void 0 !== e) {
79
- var i = e.call(t, r);
80
- if ("object" != typeof i) return i;
81
- throw new TypeError("@@toPrimitive must return a primitive value.");
82
- }
83
- return ("string" === r ? String : Number)(t);
84
- }
85
- function _toPropertyKey(t) {
86
- var i = _toPrimitive(t, "string");
87
- return "symbol" == typeof i ? i : i + "";
88
- }
89
-
90
- function getDefaultExportFromNamespaceIfNotNamed (n) {
91
- return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
92
- }
93
-
94
- var jsxRuntime = {exports: {}};
95
-
96
- var reactJsxRuntime_production_min = {};
97
-
98
- var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(React__namespace);
99
-
100
- /**
101
- * @license React
102
- * react-jsx-runtime.production.min.js
103
- *
104
- * Copyright (c) Facebook, Inc. and its affiliates.
105
- *
106
- * This source code is licensed under the MIT license found in the
107
- * LICENSE file in the root directory of this source tree.
108
- */
109
-
110
- var hasRequiredReactJsxRuntime_production_min;
111
-
112
- function requireReactJsxRuntime_production_min () {
113
- if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
114
- hasRequiredReactJsxRuntime_production_min = 1;
115
- var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
116
- function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
117
- return reactJsxRuntime_production_min;
118
- }
119
-
120
- var reactJsxRuntime_development = {};
121
-
122
- /**
123
- * @license React
124
- * react-jsx-runtime.development.js
125
- *
126
- * Copyright (c) Facebook, Inc. and its affiliates.
127
- *
128
- * This source code is licensed under the MIT license found in the
129
- * LICENSE file in the root directory of this source tree.
130
- */
131
-
132
- var hasRequiredReactJsxRuntime_development;
133
-
134
- function requireReactJsxRuntime_development () {
135
- if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
136
- hasRequiredReactJsxRuntime_development = 1;
137
-
138
- if (process.env.NODE_ENV !== "production") {
139
- (function() {
140
-
141
- var React = require$$0;
142
-
143
- // ATTENTION
144
- // When adding new symbols to this file,
145
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
146
- // The Symbol used to tag the ReactElement-like types.
147
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
148
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
149
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
150
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
151
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
152
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
153
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
154
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
155
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
156
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
157
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
158
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
159
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
160
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
161
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
162
- function getIteratorFn(maybeIterable) {
163
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
164
- return null;
165
- }
166
-
167
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
168
-
169
- if (typeof maybeIterator === 'function') {
170
- return maybeIterator;
171
- }
172
-
173
- return null;
174
- }
175
-
176
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
177
-
178
- function error(format) {
179
- {
180
- {
181
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
182
- args[_key2 - 1] = arguments[_key2];
183
- }
184
-
185
- printWarning('error', format, args);
186
- }
187
- }
188
- }
189
-
190
- function printWarning(level, format, args) {
191
- // When changing this logic, you might want to also
192
- // update consoleWithStackDev.www.js as well.
193
- {
194
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
195
- var stack = ReactDebugCurrentFrame.getStackAddendum();
196
-
197
- if (stack !== '') {
198
- format += '%s';
199
- args = args.concat([stack]);
200
- } // eslint-disable-next-line react-internal/safe-string-coercion
201
-
202
-
203
- var argsWithFormat = args.map(function (item) {
204
- return String(item);
205
- }); // Careful: RN currently depends on this prefix
206
-
207
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
208
- // breaks IE9: https://github.com/facebook/react/issues/13610
209
- // eslint-disable-next-line react-internal/no-production-logging
210
-
211
- Function.prototype.apply.call(console[level], console, argsWithFormat);
212
- }
213
- }
214
-
215
- // -----------------------------------------------------------------------------
216
-
217
- var enableScopeAPI = false; // Experimental Create Event Handle API.
218
- var enableCacheElement = false;
219
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
220
-
221
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
222
- // stuff. Intended to enable React core members to more easily debug scheduling
223
- // issues in DEV builds.
224
-
225
- var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
226
-
227
- var REACT_MODULE_REFERENCE;
228
-
229
- {
230
- REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
231
- }
232
-
233
- function isValidElementType(type) {
234
- if (typeof type === 'string' || typeof type === 'function') {
235
- return true;
236
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
237
-
238
-
239
- if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
240
- return true;
241
- }
242
-
243
- if (typeof type === 'object' && type !== null) {
244
- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
245
- // types supported by any Flight configuration anywhere since
246
- // we don't know which Flight build this will end up being used
247
- // with.
248
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
249
- return true;
250
- }
251
- }
252
-
253
- return false;
254
- }
255
-
256
- function getWrappedName(outerType, innerType, wrapperName) {
257
- var displayName = outerType.displayName;
258
-
259
- if (displayName) {
260
- return displayName;
261
- }
262
-
263
- var functionName = innerType.displayName || innerType.name || '';
264
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
265
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
266
-
267
-
268
- function getContextName(type) {
269
- return type.displayName || 'Context';
270
- } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
271
-
272
-
273
- function getComponentNameFromType(type) {
274
- if (type == null) {
275
- // Host root, text node or just invalid type.
276
- return null;
277
- }
278
-
279
- {
280
- if (typeof type.tag === 'number') {
281
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
282
- }
283
- }
284
-
285
- if (typeof type === 'function') {
286
- return type.displayName || type.name || null;
287
- }
288
-
289
- if (typeof type === 'string') {
290
- return type;
291
- }
292
-
293
- switch (type) {
294
- case REACT_FRAGMENT_TYPE:
295
- return 'Fragment';
296
-
297
- case REACT_PORTAL_TYPE:
298
- return 'Portal';
299
-
300
- case REACT_PROFILER_TYPE:
301
- return 'Profiler';
302
-
303
- case REACT_STRICT_MODE_TYPE:
304
- return 'StrictMode';
305
-
306
- case REACT_SUSPENSE_TYPE:
307
- return 'Suspense';
308
-
309
- case REACT_SUSPENSE_LIST_TYPE:
310
- return 'SuspenseList';
311
-
312
- }
313
-
314
- if (typeof type === 'object') {
315
- switch (type.$$typeof) {
316
- case REACT_CONTEXT_TYPE:
317
- var context = type;
318
- return getContextName(context) + '.Consumer';
319
-
320
- case REACT_PROVIDER_TYPE:
321
- var provider = type;
322
- return getContextName(provider._context) + '.Provider';
323
-
324
- case REACT_FORWARD_REF_TYPE:
325
- return getWrappedName(type, type.render, 'ForwardRef');
326
-
327
- case REACT_MEMO_TYPE:
328
- var outerName = type.displayName || null;
329
-
330
- if (outerName !== null) {
331
- return outerName;
332
- }
333
-
334
- return getComponentNameFromType(type.type) || 'Memo';
335
-
336
- case REACT_LAZY_TYPE:
337
- {
338
- var lazyComponent = type;
339
- var payload = lazyComponent._payload;
340
- var init = lazyComponent._init;
341
-
342
- try {
343
- return getComponentNameFromType(init(payload));
344
- } catch (x) {
345
- return null;
346
- }
347
- }
348
-
349
- // eslint-disable-next-line no-fallthrough
350
- }
351
- }
352
-
353
- return null;
354
- }
355
-
356
- var assign = Object.assign;
357
-
358
- // Helpers to patch console.logs to avoid logging during side-effect free
359
- // replaying on render function. This currently only patches the object
360
- // lazily which won't cover if the log function was extracted eagerly.
361
- // We could also eagerly patch the method.
362
- var disabledDepth = 0;
363
- var prevLog;
364
- var prevInfo;
365
- var prevWarn;
366
- var prevError;
367
- var prevGroup;
368
- var prevGroupCollapsed;
369
- var prevGroupEnd;
370
-
371
- function disabledLog() {}
372
-
373
- disabledLog.__reactDisabledLog = true;
374
- function disableLogs() {
375
- {
376
- if (disabledDepth === 0) {
377
- /* eslint-disable react-internal/no-production-logging */
378
- prevLog = console.log;
379
- prevInfo = console.info;
380
- prevWarn = console.warn;
381
- prevError = console.error;
382
- prevGroup = console.group;
383
- prevGroupCollapsed = console.groupCollapsed;
384
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
385
-
386
- var props = {
387
- configurable: true,
388
- enumerable: true,
389
- value: disabledLog,
390
- writable: true
391
- }; // $FlowFixMe Flow thinks console is immutable.
392
-
393
- Object.defineProperties(console, {
394
- info: props,
395
- log: props,
396
- warn: props,
397
- error: props,
398
- group: props,
399
- groupCollapsed: props,
400
- groupEnd: props
401
- });
402
- /* eslint-enable react-internal/no-production-logging */
403
- }
404
-
405
- disabledDepth++;
406
- }
407
- }
408
- function reenableLogs() {
409
- {
410
- disabledDepth--;
411
-
412
- if (disabledDepth === 0) {
413
- /* eslint-disable react-internal/no-production-logging */
414
- var props = {
415
- configurable: true,
416
- enumerable: true,
417
- writable: true
418
- }; // $FlowFixMe Flow thinks console is immutable.
419
-
420
- Object.defineProperties(console, {
421
- log: assign({}, props, {
422
- value: prevLog
423
- }),
424
- info: assign({}, props, {
425
- value: prevInfo
426
- }),
427
- warn: assign({}, props, {
428
- value: prevWarn
429
- }),
430
- error: assign({}, props, {
431
- value: prevError
432
- }),
433
- group: assign({}, props, {
434
- value: prevGroup
435
- }),
436
- groupCollapsed: assign({}, props, {
437
- value: prevGroupCollapsed
438
- }),
439
- groupEnd: assign({}, props, {
440
- value: prevGroupEnd
441
- })
442
- });
443
- /* eslint-enable react-internal/no-production-logging */
444
- }
445
-
446
- if (disabledDepth < 0) {
447
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
448
- }
449
- }
450
- }
451
-
452
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
453
- var prefix;
454
- function describeBuiltInComponentFrame(name, source, ownerFn) {
455
- {
456
- if (prefix === undefined) {
457
- // Extract the VM specific prefix used by each line.
458
- try {
459
- throw Error();
460
- } catch (x) {
461
- var match = x.stack.trim().match(/\n( *(at )?)/);
462
- prefix = match && match[1] || '';
463
- }
464
- } // We use the prefix to ensure our stacks line up with native stack frames.
465
-
466
-
467
- return '\n' + prefix + name;
468
- }
469
- }
470
- var reentry = false;
471
- var componentFrameCache;
472
-
473
- {
474
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
475
- componentFrameCache = new PossiblyWeakMap();
476
- }
477
-
478
- function describeNativeComponentFrame(fn, construct) {
479
- // If something asked for a stack inside a fake render, it should get ignored.
480
- if ( !fn || reentry) {
481
- return '';
482
- }
483
-
484
- {
485
- var frame = componentFrameCache.get(fn);
486
-
487
- if (frame !== undefined) {
488
- return frame;
489
- }
490
- }
491
-
492
- var control;
493
- reentry = true;
494
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
495
-
496
- Error.prepareStackTrace = undefined;
497
- var previousDispatcher;
498
-
499
- {
500
- previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
501
- // for warnings.
502
-
503
- ReactCurrentDispatcher.current = null;
504
- disableLogs();
505
- }
506
-
507
- try {
508
- // This should throw.
509
- if (construct) {
510
- // Something should be setting the props in the constructor.
511
- var Fake = function () {
512
- throw Error();
513
- }; // $FlowFixMe
514
-
515
-
516
- Object.defineProperty(Fake.prototype, 'props', {
517
- set: function () {
518
- // We use a throwing setter instead of frozen or non-writable props
519
- // because that won't throw in a non-strict mode function.
520
- throw Error();
521
- }
522
- });
523
-
524
- if (typeof Reflect === 'object' && Reflect.construct) {
525
- // We construct a different control for this case to include any extra
526
- // frames added by the construct call.
527
- try {
528
- Reflect.construct(Fake, []);
529
- } catch (x) {
530
- control = x;
531
- }
532
-
533
- Reflect.construct(fn, [], Fake);
534
- } else {
535
- try {
536
- Fake.call();
537
- } catch (x) {
538
- control = x;
539
- }
540
-
541
- fn.call(Fake.prototype);
542
- }
543
- } else {
544
- try {
545
- throw Error();
546
- } catch (x) {
547
- control = x;
548
- }
549
-
550
- fn();
551
- }
552
- } catch (sample) {
553
- // This is inlined manually because closure doesn't do it for us.
554
- if (sample && control && typeof sample.stack === 'string') {
555
- // This extracts the first frame from the sample that isn't also in the control.
556
- // Skipping one frame that we assume is the frame that calls the two.
557
- var sampleLines = sample.stack.split('\n');
558
- var controlLines = control.stack.split('\n');
559
- var s = sampleLines.length - 1;
560
- var c = controlLines.length - 1;
561
-
562
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
563
- // We expect at least one stack frame to be shared.
564
- // Typically this will be the root most one. However, stack frames may be
565
- // cut off due to maximum stack limits. In this case, one maybe cut off
566
- // earlier than the other. We assume that the sample is longer or the same
567
- // and there for cut off earlier. So we should find the root most frame in
568
- // the sample somewhere in the control.
569
- c--;
570
- }
571
-
572
- for (; s >= 1 && c >= 0; s--, c--) {
573
- // Next we find the first one that isn't the same which should be the
574
- // frame that called our sample function and the control.
575
- if (sampleLines[s] !== controlLines[c]) {
576
- // In V8, the first line is describing the message but other VMs don't.
577
- // If we're about to return the first line, and the control is also on the same
578
- // line, that's a pretty good indicator that our sample threw at same line as
579
- // the control. I.e. before we entered the sample frame. So we ignore this result.
580
- // This can happen if you passed a class to function component, or non-function.
581
- if (s !== 1 || c !== 1) {
582
- do {
583
- s--;
584
- c--; // We may still have similar intermediate frames from the construct call.
585
- // The next one that isn't the same should be our match though.
586
-
587
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
588
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
589
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
590
- // but we have a user-provided "displayName"
591
- // splice it in to make the stack more readable.
592
-
593
-
594
- if (fn.displayName && _frame.includes('<anonymous>')) {
595
- _frame = _frame.replace('<anonymous>', fn.displayName);
596
- }
597
-
598
- {
599
- if (typeof fn === 'function') {
600
- componentFrameCache.set(fn, _frame);
601
- }
602
- } // Return the line we found.
603
-
604
-
605
- return _frame;
606
- }
607
- } while (s >= 1 && c >= 0);
608
- }
609
-
610
- break;
611
- }
612
- }
613
- }
614
- } finally {
615
- reentry = false;
616
-
617
- {
618
- ReactCurrentDispatcher.current = previousDispatcher;
619
- reenableLogs();
620
- }
621
-
622
- Error.prepareStackTrace = previousPrepareStackTrace;
623
- } // Fallback to just using the name if we couldn't make it throw.
624
-
625
-
626
- var name = fn ? fn.displayName || fn.name : '';
627
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
628
-
629
- {
630
- if (typeof fn === 'function') {
631
- componentFrameCache.set(fn, syntheticFrame);
632
- }
633
- }
634
-
635
- return syntheticFrame;
636
- }
637
- function describeFunctionComponentFrame(fn, source, ownerFn) {
638
- {
639
- return describeNativeComponentFrame(fn, false);
640
- }
641
- }
642
-
643
- function shouldConstruct(Component) {
644
- var prototype = Component.prototype;
645
- return !!(prototype && prototype.isReactComponent);
646
- }
647
-
648
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
649
-
650
- if (type == null) {
651
- return '';
652
- }
653
-
654
- if (typeof type === 'function') {
655
- {
656
- return describeNativeComponentFrame(type, shouldConstruct(type));
657
- }
658
- }
659
-
660
- if (typeof type === 'string') {
661
- return describeBuiltInComponentFrame(type);
662
- }
663
-
664
- switch (type) {
665
- case REACT_SUSPENSE_TYPE:
666
- return describeBuiltInComponentFrame('Suspense');
667
-
668
- case REACT_SUSPENSE_LIST_TYPE:
669
- return describeBuiltInComponentFrame('SuspenseList');
670
- }
671
-
672
- if (typeof type === 'object') {
673
- switch (type.$$typeof) {
674
- case REACT_FORWARD_REF_TYPE:
675
- return describeFunctionComponentFrame(type.render);
676
-
677
- case REACT_MEMO_TYPE:
678
- // Memo may contain any component type so we recursively resolve it.
679
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
680
-
681
- case REACT_LAZY_TYPE:
682
- {
683
- var lazyComponent = type;
684
- var payload = lazyComponent._payload;
685
- var init = lazyComponent._init;
686
-
687
- try {
688
- // Lazy may contain any component type so we recursively resolve it.
689
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
690
- } catch (x) {}
691
- }
692
- }
693
- }
694
-
695
- return '';
696
- }
697
-
698
- var hasOwnProperty = Object.prototype.hasOwnProperty;
699
-
700
- var loggedTypeFailures = {};
701
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
702
-
703
- function setCurrentlyValidatingElement(element) {
704
- {
705
- if (element) {
706
- var owner = element._owner;
707
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
708
- ReactDebugCurrentFrame.setExtraStackFrame(stack);
709
- } else {
710
- ReactDebugCurrentFrame.setExtraStackFrame(null);
711
- }
712
- }
713
- }
714
-
715
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
716
- {
717
- // $FlowFixMe This is okay but Flow doesn't know it.
718
- var has = Function.call.bind(hasOwnProperty);
719
-
720
- for (var typeSpecName in typeSpecs) {
721
- if (has(typeSpecs, typeSpecName)) {
722
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
723
- // fail the render phase where it didn't fail before. So we log it.
724
- // After these have been cleaned up, we'll let them throw.
725
-
726
- try {
727
- // This is intentionally an invariant that gets caught. It's the same
728
- // behavior as without this statement except with a better message.
729
- if (typeof typeSpecs[typeSpecName] !== 'function') {
730
- // eslint-disable-next-line react-internal/prod-error-codes
731
- var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
732
- err.name = 'Invariant Violation';
733
- throw err;
734
- }
735
-
736
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
737
- } catch (ex) {
738
- error$1 = ex;
739
- }
740
-
741
- if (error$1 && !(error$1 instanceof Error)) {
742
- setCurrentlyValidatingElement(element);
743
-
744
- error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
745
-
746
- setCurrentlyValidatingElement(null);
747
- }
748
-
749
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
750
- // Only monitor this failure once because there tends to be a lot of the
751
- // same error.
752
- loggedTypeFailures[error$1.message] = true;
753
- setCurrentlyValidatingElement(element);
754
-
755
- error('Failed %s type: %s', location, error$1.message);
756
-
757
- setCurrentlyValidatingElement(null);
758
- }
759
- }
760
- }
761
- }
762
- }
763
-
764
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
765
-
766
- function isArray(a) {
767
- return isArrayImpl(a);
768
- }
769
-
770
- /*
771
- * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
772
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
773
- *
774
- * The functions in this module will throw an easier-to-understand,
775
- * easier-to-debug exception with a clear errors message message explaining the
776
- * problem. (Instead of a confusing exception thrown inside the implementation
777
- * of the `value` object).
778
- */
779
- // $FlowFixMe only called in DEV, so void return is not possible.
780
- function typeName(value) {
781
- {
782
- // toStringTag is needed for namespaced types like Temporal.Instant
783
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
784
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
785
- return type;
786
- }
787
- } // $FlowFixMe only called in DEV, so void return is not possible.
788
-
789
-
790
- function willCoercionThrow(value) {
791
- {
792
- try {
793
- testStringCoercion(value);
794
- return false;
795
- } catch (e) {
796
- return true;
797
- }
798
- }
799
- }
800
-
801
- function testStringCoercion(value) {
802
- // If you ended up here by following an exception call stack, here's what's
803
- // happened: you supplied an object or symbol value to React (as a prop, key,
804
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
805
- // coerce it to a string using `'' + value`, an exception was thrown.
806
- //
807
- // The most common types that will cause this exception are `Symbol` instances
808
- // and Temporal objects like `Temporal.Instant`. But any object that has a
809
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
810
- // exception. (Library authors do this to prevent users from using built-in
811
- // numeric operators like `+` or comparison operators like `>=` because custom
812
- // methods are needed to perform accurate arithmetic or comparison.)
813
- //
814
- // To fix the problem, coerce this object or symbol value to a string before
815
- // passing it to React. The most reliable way is usually `String(value)`.
816
- //
817
- // To find which value is throwing, check the browser or debugger console.
818
- // Before this exception was thrown, there should be `console.error` output
819
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
820
- // problem and how that type was used: key, atrribute, input value prop, etc.
821
- // In most cases, this console output also shows the component and its
822
- // ancestor components where the exception happened.
823
- //
824
- // eslint-disable-next-line react-internal/safe-string-coercion
825
- return '' + value;
826
- }
827
- function checkKeyStringCoercion(value) {
828
- {
829
- if (willCoercionThrow(value)) {
830
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
831
-
832
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
833
- }
834
- }
835
- }
836
-
837
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
838
- var RESERVED_PROPS = {
839
- key: true,
840
- ref: true,
841
- __self: true,
842
- __source: true
843
- };
844
- var specialPropKeyWarningShown;
845
- var specialPropRefWarningShown;
846
-
847
- function hasValidRef(config) {
848
- {
849
- if (hasOwnProperty.call(config, 'ref')) {
850
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
851
-
852
- if (getter && getter.isReactWarning) {
853
- return false;
854
- }
855
- }
856
- }
857
-
858
- return config.ref !== undefined;
859
- }
860
-
861
- function hasValidKey(config) {
862
- {
863
- if (hasOwnProperty.call(config, 'key')) {
864
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
865
-
866
- if (getter && getter.isReactWarning) {
867
- return false;
868
- }
869
- }
870
- }
871
-
872
- return config.key !== undefined;
873
- }
874
-
875
- function warnIfStringRefCannotBeAutoConverted(config, self) {
876
- {
877
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
878
- }
879
- }
880
-
881
- function defineKeyPropWarningGetter(props, displayName) {
882
- {
883
- var warnAboutAccessingKey = function () {
884
- if (!specialPropKeyWarningShown) {
885
- specialPropKeyWarningShown = true;
886
-
887
- error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
888
- }
889
- };
890
-
891
- warnAboutAccessingKey.isReactWarning = true;
892
- Object.defineProperty(props, 'key', {
893
- get: warnAboutAccessingKey,
894
- configurable: true
895
- });
896
- }
897
- }
898
-
899
- function defineRefPropWarningGetter(props, displayName) {
900
- {
901
- var warnAboutAccessingRef = function () {
902
- if (!specialPropRefWarningShown) {
903
- specialPropRefWarningShown = true;
904
-
905
- error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
906
- }
907
- };
908
-
909
- warnAboutAccessingRef.isReactWarning = true;
910
- Object.defineProperty(props, 'ref', {
911
- get: warnAboutAccessingRef,
912
- configurable: true
913
- });
914
- }
915
- }
916
- /**
917
- * Factory method to create a new React element. This no longer adheres to
918
- * the class pattern, so do not use new to call it. Also, instanceof check
919
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
920
- * if something is a React Element.
921
- *
922
- * @param {*} type
923
- * @param {*} props
924
- * @param {*} key
925
- * @param {string|object} ref
926
- * @param {*} owner
927
- * @param {*} self A *temporary* helper to detect places where `this` is
928
- * different from the `owner` when React.createElement is called, so that we
929
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
930
- * functions, and as long as `this` and owner are the same, there will be no
931
- * change in behavior.
932
- * @param {*} source An annotation object (added by a transpiler or otherwise)
933
- * indicating filename, line number, and/or other information.
934
- * @internal
935
- */
936
-
937
-
938
- var ReactElement = function (type, key, ref, self, source, owner, props) {
939
- var element = {
940
- // This tag allows us to uniquely identify this as a React Element
941
- $$typeof: REACT_ELEMENT_TYPE,
942
- // Built-in properties that belong on the element
943
- type: type,
944
- key: key,
945
- ref: ref,
946
- props: props,
947
- // Record the component responsible for creating this element.
948
- _owner: owner
949
- };
950
-
951
- {
952
- // The validation flag is currently mutative. We put it on
953
- // an external backing store so that we can freeze the whole object.
954
- // This can be replaced with a WeakMap once they are implemented in
955
- // commonly used development environments.
956
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
957
- // the validation flag non-enumerable (where possible, which should
958
- // include every environment we run tests in), so the test framework
959
- // ignores it.
960
-
961
- Object.defineProperty(element._store, 'validated', {
962
- configurable: false,
963
- enumerable: false,
964
- writable: true,
965
- value: false
966
- }); // self and source are DEV only properties.
967
-
968
- Object.defineProperty(element, '_self', {
969
- configurable: false,
970
- enumerable: false,
971
- writable: false,
972
- value: self
973
- }); // Two elements created in two different places should be considered
974
- // equal for testing purposes and therefore we hide it from enumeration.
975
-
976
- Object.defineProperty(element, '_source', {
977
- configurable: false,
978
- enumerable: false,
979
- writable: false,
980
- value: source
981
- });
982
-
983
- if (Object.freeze) {
984
- Object.freeze(element.props);
985
- Object.freeze(element);
986
- }
987
- }
988
-
989
- return element;
990
- };
991
- /**
992
- * https://github.com/reactjs/rfcs/pull/107
993
- * @param {*} type
994
- * @param {object} props
995
- * @param {string} key
996
- */
997
-
998
- function jsxDEV(type, config, maybeKey, source, self) {
999
- {
1000
- var propName; // Reserved names are extracted
1001
-
1002
- var props = {};
1003
- var key = null;
1004
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
1005
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
1006
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
1007
- // but as an intermediary step, we will use jsxDEV for everything except
1008
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
1009
- // key is explicitly declared to be undefined or not.
1010
-
1011
- if (maybeKey !== undefined) {
1012
- {
1013
- checkKeyStringCoercion(maybeKey);
1014
- }
1015
-
1016
- key = '' + maybeKey;
1017
- }
1018
-
1019
- if (hasValidKey(config)) {
1020
- {
1021
- checkKeyStringCoercion(config.key);
1022
- }
1023
-
1024
- key = '' + config.key;
1025
- }
1026
-
1027
- if (hasValidRef(config)) {
1028
- ref = config.ref;
1029
- warnIfStringRefCannotBeAutoConverted(config, self);
1030
- } // Remaining properties are added to a new props object
1031
-
1032
-
1033
- for (propName in config) {
1034
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1035
- props[propName] = config[propName];
1036
- }
1037
- } // Resolve default props
1038
-
1039
-
1040
- if (type && type.defaultProps) {
1041
- var defaultProps = type.defaultProps;
1042
-
1043
- for (propName in defaultProps) {
1044
- if (props[propName] === undefined) {
1045
- props[propName] = defaultProps[propName];
1046
- }
1047
- }
1048
- }
1049
-
1050
- if (key || ref) {
1051
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1052
-
1053
- if (key) {
1054
- defineKeyPropWarningGetter(props, displayName);
1055
- }
1056
-
1057
- if (ref) {
1058
- defineRefPropWarningGetter(props, displayName);
1059
- }
1060
- }
1061
-
1062
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1063
- }
1064
- }
1065
-
1066
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
1067
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1068
-
1069
- function setCurrentlyValidatingElement$1(element) {
1070
- {
1071
- if (element) {
1072
- var owner = element._owner;
1073
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1074
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1075
- } else {
1076
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1077
- }
1078
- }
1079
- }
1080
-
1081
- var propTypesMisspellWarningShown;
1082
-
1083
- {
1084
- propTypesMisspellWarningShown = false;
1085
- }
1086
- /**
1087
- * Verifies the object is a ReactElement.
1088
- * See https://reactjs.org/docs/react-api.html#isvalidelement
1089
- * @param {?object} object
1090
- * @return {boolean} True if `object` is a ReactElement.
1091
- * @final
1092
- */
1093
-
1094
-
1095
- function isValidElement(object) {
1096
- {
1097
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1098
- }
1099
- }
1100
-
1101
- function getDeclarationErrorAddendum() {
1102
- {
1103
- if (ReactCurrentOwner$1.current) {
1104
- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
1105
-
1106
- if (name) {
1107
- return '\n\nCheck the render method of `' + name + '`.';
1108
- }
1109
- }
1110
-
1111
- return '';
1112
- }
1113
- }
1114
-
1115
- function getSourceInfoErrorAddendum(source) {
1116
- {
1117
-
1118
- return '';
1119
- }
1120
- }
1121
- /**
1122
- * Warn if there's no key explicitly set on dynamic arrays of children or
1123
- * object keys are not valid. This allows us to keep track of children between
1124
- * updates.
1125
- */
1126
-
1127
-
1128
- var ownerHasKeyUseWarning = {};
1129
-
1130
- function getCurrentComponentErrorInfo(parentType) {
1131
- {
1132
- var info = getDeclarationErrorAddendum();
1133
-
1134
- if (!info) {
1135
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1136
-
1137
- if (parentName) {
1138
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1139
- }
1140
- }
1141
-
1142
- return info;
1143
- }
1144
- }
1145
- /**
1146
- * Warn if the element doesn't have an explicit key assigned to it.
1147
- * This element is in an array. The array could grow and shrink or be
1148
- * reordered. All children that haven't already been validated are required to
1149
- * have a "key" property assigned to it. Error statuses are cached so a warning
1150
- * will only be shown once.
1151
- *
1152
- * @internal
1153
- * @param {ReactElement} element Element that requires a key.
1154
- * @param {*} parentType element's parent's type.
1155
- */
1156
-
1157
-
1158
- function validateExplicitKey(element, parentType) {
1159
- {
1160
- if (!element._store || element._store.validated || element.key != null) {
1161
- return;
1162
- }
1163
-
1164
- element._store.validated = true;
1165
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1166
-
1167
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1168
- return;
1169
- }
1170
-
1171
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1172
- // property, it may be the creator of the child that's responsible for
1173
- // assigning it a key.
1174
-
1175
- var childOwner = '';
1176
-
1177
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1178
- // Give the component that originally created this child.
1179
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1180
- }
1181
-
1182
- setCurrentlyValidatingElement$1(element);
1183
-
1184
- error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
1185
-
1186
- setCurrentlyValidatingElement$1(null);
1187
- }
1188
- }
1189
- /**
1190
- * Ensure that every element either is passed in a static location, in an
1191
- * array with an explicit keys property defined, or in an object literal
1192
- * with valid key property.
1193
- *
1194
- * @internal
1195
- * @param {ReactNode} node Statically passed child of any type.
1196
- * @param {*} parentType node's parent's type.
1197
- */
1198
-
1199
-
1200
- function validateChildKeys(node, parentType) {
1201
- {
1202
- if (typeof node !== 'object') {
1203
- return;
1204
- }
1205
-
1206
- if (isArray(node)) {
1207
- for (var i = 0; i < node.length; i++) {
1208
- var child = node[i];
1209
-
1210
- if (isValidElement(child)) {
1211
- validateExplicitKey(child, parentType);
1212
- }
1213
- }
1214
- } else if (isValidElement(node)) {
1215
- // This element was passed in a valid location.
1216
- if (node._store) {
1217
- node._store.validated = true;
1218
- }
1219
- } else if (node) {
1220
- var iteratorFn = getIteratorFn(node);
1221
-
1222
- if (typeof iteratorFn === 'function') {
1223
- // Entry iterators used to provide implicit keys,
1224
- // but now we print a separate warning for them later.
1225
- if (iteratorFn !== node.entries) {
1226
- var iterator = iteratorFn.call(node);
1227
- var step;
1228
-
1229
- while (!(step = iterator.next()).done) {
1230
- if (isValidElement(step.value)) {
1231
- validateExplicitKey(step.value, parentType);
1232
- }
1233
- }
1234
- }
1235
- }
1236
- }
1237
- }
1238
- }
1239
- /**
1240
- * Given an element, validate that its props follow the propTypes definition,
1241
- * provided by the type.
1242
- *
1243
- * @param {ReactElement} element
1244
- */
1245
-
1246
-
1247
- function validatePropTypes(element) {
1248
- {
1249
- var type = element.type;
1250
-
1251
- if (type === null || type === undefined || typeof type === 'string') {
1252
- return;
1253
- }
1254
-
1255
- var propTypes;
1256
-
1257
- if (typeof type === 'function') {
1258
- propTypes = type.propTypes;
1259
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
1260
- // Inner props are checked in the reconciler.
1261
- type.$$typeof === REACT_MEMO_TYPE)) {
1262
- propTypes = type.propTypes;
1263
- } else {
1264
- return;
1265
- }
1266
-
1267
- if (propTypes) {
1268
- // Intentionally inside to avoid triggering lazy initializers:
1269
- var name = getComponentNameFromType(type);
1270
- checkPropTypes(propTypes, element.props, 'prop', name, element);
1271
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1272
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1273
-
1274
- var _name = getComponentNameFromType(type);
1275
-
1276
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1277
- }
1278
-
1279
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1280
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1281
- }
1282
- }
1283
- }
1284
- /**
1285
- * Given a fragment, validate that it can only be provided with fragment props
1286
- * @param {ReactElement} fragment
1287
- */
1288
-
1289
-
1290
- function validateFragmentProps(fragment) {
1291
- {
1292
- var keys = Object.keys(fragment.props);
1293
-
1294
- for (var i = 0; i < keys.length; i++) {
1295
- var key = keys[i];
1296
-
1297
- if (key !== 'children' && key !== 'key') {
1298
- setCurrentlyValidatingElement$1(fragment);
1299
-
1300
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1301
-
1302
- setCurrentlyValidatingElement$1(null);
1303
- break;
1304
- }
1305
- }
1306
-
1307
- if (fragment.ref !== null) {
1308
- setCurrentlyValidatingElement$1(fragment);
1309
-
1310
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
1311
-
1312
- setCurrentlyValidatingElement$1(null);
1313
- }
1314
- }
1315
- }
1316
-
1317
- var didWarnAboutKeySpread = {};
1318
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1319
- {
1320
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1321
- // succeed and there will likely be errors in render.
1322
-
1323
- if (!validType) {
1324
- var info = '';
1325
-
1326
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1327
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
1328
- }
1329
-
1330
- var sourceInfo = getSourceInfoErrorAddendum();
1331
-
1332
- if (sourceInfo) {
1333
- info += sourceInfo;
1334
- } else {
1335
- info += getDeclarationErrorAddendum();
1336
- }
1337
-
1338
- var typeString;
1339
-
1340
- if (type === null) {
1341
- typeString = 'null';
1342
- } else if (isArray(type)) {
1343
- typeString = 'array';
1344
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1345
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1346
- info = ' Did you accidentally export a JSX literal instead of a component?';
1347
- } else {
1348
- typeString = typeof type;
1349
- }
1350
-
1351
- error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
1352
- }
1353
-
1354
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1355
- // TODO: Drop this when these are no longer allowed as the type argument.
1356
-
1357
- if (element == null) {
1358
- return element;
1359
- } // Skip key warning if the type isn't valid since our key validation logic
1360
- // doesn't expect a non-string/function type and can throw confusing errors.
1361
- // We don't want exception behavior to differ between dev and prod.
1362
- // (Rendering will throw with a helpful message and as soon as the type is
1363
- // fixed, the key warnings will appear.)
1364
-
1365
-
1366
- if (validType) {
1367
- var children = props.children;
1368
-
1369
- if (children !== undefined) {
1370
- if (isStaticChildren) {
1371
- if (isArray(children)) {
1372
- for (var i = 0; i < children.length; i++) {
1373
- validateChildKeys(children[i], type);
1374
- }
1375
-
1376
- if (Object.freeze) {
1377
- Object.freeze(children);
1378
- }
1379
- } else {
1380
- error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
1381
- }
1382
- } else {
1383
- validateChildKeys(children, type);
1384
- }
1385
- }
1386
- }
1387
-
1388
- {
1389
- if (hasOwnProperty.call(props, 'key')) {
1390
- var componentName = getComponentNameFromType(type);
1391
- var keys = Object.keys(props).filter(function (k) {
1392
- return k !== 'key';
1393
- });
1394
- var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
1395
-
1396
- if (!didWarnAboutKeySpread[componentName + beforeExample]) {
1397
- var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
1398
-
1399
- error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
1400
-
1401
- didWarnAboutKeySpread[componentName + beforeExample] = true;
1402
- }
1403
- }
1404
- }
1405
-
1406
- if (type === REACT_FRAGMENT_TYPE) {
1407
- validateFragmentProps(element);
1408
- } else {
1409
- validatePropTypes(element);
1410
- }
1411
-
1412
- return element;
1413
- }
1414
- } // These two functions exist to still get child warnings in dev
1415
- // even with the prod transform. This means that jsxDEV is purely
1416
- // opt-in behavior for better messages but that we won't stop
1417
- // giving you warnings if you use production apis.
1418
-
1419
- function jsxWithValidationStatic(type, props, key) {
1420
- {
1421
- return jsxWithValidation(type, props, key, true);
1422
- }
1423
- }
1424
- function jsxWithValidationDynamic(type, props, key) {
1425
- {
1426
- return jsxWithValidation(type, props, key, false);
1427
- }
1428
- }
1429
-
1430
- var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
1431
- // for now we can ship identical prod functions
1432
-
1433
- var jsxs = jsxWithValidationStatic ;
1434
-
1435
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1436
- reactJsxRuntime_development.jsx = jsx;
1437
- reactJsxRuntime_development.jsxs = jsxs;
1438
- })();
1439
- }
1440
- return reactJsxRuntime_development;
1441
- }
1442
-
1443
- if (process.env.NODE_ENV === 'production') {
1444
- jsxRuntime.exports = requireReactJsxRuntime_production_min();
1445
- } else {
1446
- jsxRuntime.exports = requireReactJsxRuntime_development();
1447
- }
1448
-
1449
- var jsxRuntimeExports = jsxRuntime.exports;
1450
-
1451
- const _excluded$d = ["className", "color", "variant", "size", "fullWidth", "loading", "disabled", "children"];
1452
- const Button = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1453
- let {
1454
- className,
1455
- color = 'primary',
1456
- variant = 'contained',
1457
- size = 'md',
1458
- fullWidth = false,
1459
- loading = false,
1460
- disabled,
1461
- children
1462
- } = _ref,
1463
- props = _objectWithoutProperties(_ref, _excluded$d);
1464
- const classNames = ['btn', "btn--".concat(variant), "btn--".concat(size), "btn--".concat(color), fullWidth ? 'btn--full-width' : '', loading ? 'btn--loading' : '', disabled ? 'btn--disabled' : '', className].filter(Boolean).join(' ');
1465
- return jsxRuntimeExports.jsxs("button", _objectSpread2(_objectSpread2({
1466
- className: classNames,
1467
- disabled: disabled || loading,
1468
- ref: ref
1469
- }, props), {}, {
1470
- children: [loading && jsxRuntimeExports.jsx("span", {
1471
- className: "btn__loader"
1472
- }), children]
1473
- }));
1474
- });
1475
- Button.displayName = 'Button';
1476
-
1477
- function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
1478
-
1479
- const _excluded$c = ["className", "type", "label", "error", "helperText", "size", "fullWidth", "id", "unit"];
1480
- const Input = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1481
- let {
1482
- className,
1483
- type = 'text',
1484
- label,
1485
- error,
1486
- helperText,
1487
- size = 'md',
1488
- fullWidth = false,
1489
- id,
1490
- unit
1491
- } = _ref,
1492
- props = _objectWithoutProperties(_ref, _excluded$c);
1493
- const inputId = id || "input-".concat(Math.random().toString(36).substr(2, 9));
1494
- return (
1495
- // <div className={clsx('input-container', fullWidth && 'input-container--full-width', className)}>
1496
- // {label && (
1497
- // <label className="input-label" htmlFor={inputId}>
1498
- // {label}
1499
- // </label>
1500
- // )}
1501
- // <input
1502
- // type={type}
1503
- // className={clsx('input', error && 'input--error', fullWidth && 'input--full-width')}
1504
- // ref={ref}
1505
- // id={inputId}
1506
- // {...props}
1507
- // />
1508
- // {(error || helperText) && <p className={clsx('input-helper-text', error && 'input-helper-text--error')}>{error || helperText}</p>}
1509
- // </div>
1510
- jsxRuntimeExports.jsxs("div", {
1511
- className: clsx('input-container', fullWidth && 'input-container--full-width', unit && 'input-container--has-unit', className),
1512
- children: [jsxRuntimeExports.jsx("input", _objectSpread2({
1513
- type: type,
1514
- className: clsx('input', error && 'input--error', fullWidth && 'input--full-width'),
1515
- ref: ref,
1516
- id: inputId
1517
- }, props)), unit && jsxRuntimeExports.jsx("span", {
1518
- className: "input-unit",
1519
- children: unit
1520
- })]
1521
- })
1522
- );
1523
- });
1524
- Input.displayName = 'Input';
1525
-
1526
- const _excluded$b = ["className", "label", "error", "helperText", "size", "fullWidth", "rows", "id"];
1527
- const Textarea = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1528
- let {
1529
- className,
1530
- label,
1531
- error,
1532
- helperText,
1533
- size = 'md',
1534
- fullWidth = false,
1535
- rows = 3,
1536
- id
1537
- } = _ref,
1538
- props = _objectWithoutProperties(_ref, _excluded$b);
1539
- const textareaId = id || "textarea-".concat(Math.random().toString(36).substr(2, 9));
1540
- return jsxRuntimeExports.jsxs("div", {
1541
- className: clsx('textarea-container', fullWidth && 'textarea-container--full-width', className),
1542
- children: [label && jsxRuntimeExports.jsx("label", {
1543
- className: "textarea-label",
1544
- htmlFor: textareaId,
1545
- children: label
1546
- }), jsxRuntimeExports.jsx("textarea", _objectSpread2({
1547
- className: clsx('textarea', error && 'textarea--error', fullWidth && 'textarea--full-width'),
1548
- ref: ref,
1549
- id: textareaId,
1550
- rows: rows
1551
- }, props)), (error || helperText) && jsxRuntimeExports.jsx("p", {
1552
- className: clsx('input-helper-text', error && 'input-helper-text--error'),
1553
- children: error || helperText
1554
- })]
1555
- });
1556
- });
1557
- Textarea.displayName = 'Textarea';
1558
-
1559
- const _excluded$a = ["className", "label", "error", "helperText", "size", "fullWidth", "multiple", "accept", "buttonText", "id"];
1560
- const InputFile = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1561
- let {
1562
- className,
1563
- label,
1564
- error,
1565
- helperText,
1566
- size = 'md',
1567
- fullWidth = false,
1568
- multiple = false,
1569
- accept,
1570
- buttonText = 'Choose File',
1571
- id
1572
- } = _ref,
1573
- props = _objectWithoutProperties(_ref, _excluded$a);
1574
- const inputId = id || "input-file-".concat(Math.random().toString(36).substr(2, 9));
1575
- return jsxRuntimeExports.jsxs("div", {
1576
- className: clsx('input-file-container', fullWidth && 'input-file-container--full-width', className),
1577
- children: [label && jsxRuntimeExports.jsx("label", {
1578
- className: "input-file-label",
1579
- htmlFor: inputId,
1580
- children: label
1581
- }), jsxRuntimeExports.jsxs("div", {
1582
- className: "input-file-wrapper",
1583
- children: [jsxRuntimeExports.jsx("input", _objectSpread2({
1584
- type: "file",
1585
- className: "input-file-hidden",
1586
- ref: ref,
1587
- id: inputId,
1588
- multiple: multiple,
1589
- accept: accept
1590
- }, props)), jsxRuntimeExports.jsxs("div", {
1591
- className: clsx('input-file-upload-area', error && 'input-file-upload-area--error', fullWidth && 'input-file-upload-area--full-width'),
1592
- children: [jsxRuntimeExports.jsx("span", {
1593
- className: "input-file-button-text",
1594
- children: buttonText
1595
- }), multiple && jsxRuntimeExports.jsx("span", {
1596
- className: "input-file-multiple-text",
1597
- children: "or drag and drop"
1598
- })]
1599
- })]
1600
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
1601
- className: clsx('input-helper-text', error && 'input-helper-text--error'),
1602
- children: error || helperText
1603
- })]
1604
- });
1605
- });
1606
- InputFile.displayName = 'InputFile';
1607
-
1608
- const _excluded$9 = ["className", "label", "error", "helperText", "size", "fullWidth", "indeterminate", "id"];
1609
- const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1610
- let {
1611
- className,
1612
- label,
1613
- error,
1614
- helperText,
1615
- size = 'md',
1616
- fullWidth = false,
1617
- indeterminate = false,
1618
- id
1619
- } = _ref,
1620
- props = _objectWithoutProperties(_ref, _excluded$9);
1621
- const checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
1622
- React.useEffect(() => {
1623
- if (ref && typeof ref === 'object' && ref.current) {
1624
- ref.current.indeterminate = indeterminate;
1625
- }
1626
- }, [indeterminate, ref]);
1627
- return jsxRuntimeExports.jsxs("div", {
1628
- className: clsx('checkbox-container', fullWidth && 'checkbox-container--full-width', className),
1629
- children: [jsxRuntimeExports.jsx("div", {
1630
- className: "checkbox-wrapper",
1631
- children: jsxRuntimeExports.jsx("input", _objectSpread2({
1632
- type: "checkbox",
1633
- className: clsx('checkbox', "checkbox--".concat(size), error && 'checkbox--error'),
1634
- ref: ref,
1635
- id: checkboxId
1636
- }, props))
1637
- }), jsxRuntimeExports.jsxs("div", {
1638
- className: "checkbox-label-container",
1639
- children: [label && jsxRuntimeExports.jsx("label", {
1640
- className: "checkbox-label",
1641
- htmlFor: checkboxId,
1642
- children: label
1643
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
1644
- className: clsx('input-helper-text', error && 'input-helper-text--error'),
1645
- children: error || helperText
1646
- })]
1647
- })]
1648
- });
1649
- });
1650
- Checkbox.displayName = 'Checkbox';
1651
-
1652
- const _excluded$8 = ["className", "label", "error", "helperText", "size", "fullWidth", "id"];
1653
- const Radio = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1654
- let {
1655
- className,
1656
- label,
1657
- error,
1658
- helperText,
1659
- size = 'md',
1660
- fullWidth = false,
1661
- id
1662
- } = _ref,
1663
- props = _objectWithoutProperties(_ref, _excluded$8);
1664
- const radioId = id || "radio-".concat(Math.random().toString(36).substr(2, 9));
1665
- return jsxRuntimeExports.jsxs("div", {
1666
- className: clsx('radio-container', fullWidth && 'radio-container--full-width', className),
1667
- children: [jsxRuntimeExports.jsx("div", {
1668
- className: "radio-wrapper",
1669
- children: jsxRuntimeExports.jsx("input", _objectSpread2({
1670
- type: "radio",
1671
- className: clsx('radio', error && 'radio--error'),
1672
- ref: ref,
1673
- id: radioId
1674
- }, props))
1675
- }), jsxRuntimeExports.jsxs("div", {
1676
- className: "radio-label-container",
1677
- children: [label && jsxRuntimeExports.jsx("label", {
1678
- className: "radio-label",
1679
- htmlFor: radioId,
1680
- children: label
1681
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
1682
- className: clsx('input-helper-text', error && 'input-helper-text--error'),
1683
- children: error || helperText
1684
- })]
1685
- })]
1686
- });
1687
- });
1688
- Radio.displayName = 'Radio';
1689
-
1690
- const _excluded$7 = ["className", "label", "error", "helperText", "size", "fullWidth", "options", "placeholder", "id"];
1691
- const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1692
- let {
1693
- className,
1694
- label,
1695
- error,
1696
- helperText,
1697
- size = 'md',
1698
- fullWidth = false,
1699
- options,
1700
- placeholder,
1701
- id
1702
- } = _ref,
1703
- props = _objectWithoutProperties(_ref, _excluded$7);
1704
- const selectId = id || "select-".concat(Math.random().toString(36).substr(2, 9));
1705
- return jsxRuntimeExports.jsxs("div", {
1706
- className: clsx('select-container', fullWidth && 'select-container--full-width', className),
1707
- children: [label && jsxRuntimeExports.jsx("label", {
1708
- className: "select-label",
1709
- htmlFor: selectId,
1710
- children: label
1711
- }), jsxRuntimeExports.jsxs("div", {
1712
- className: "select-wrapper",
1713
- children: [jsxRuntimeExports.jsxs("select", _objectSpread2(_objectSpread2({
1714
- className: clsx('select', error && 'select--error', fullWidth && 'select--full-width'),
1715
- ref: ref,
1716
- id: selectId
1717
- }, props), {}, {
1718
- children: [placeholder && jsxRuntimeExports.jsx("option", {
1719
- value: "",
1720
- disabled: true,
1721
- children: placeholder
1722
- }), options.map(option => jsxRuntimeExports.jsx("option", {
1723
- value: option.value,
1724
- disabled: option.disabled,
1725
- children: option.label
1726
- }, option.value))]
1727
- })), jsxRuntimeExports.jsx("div", {
1728
- className: "select-icon",
1729
- children: jsxRuntimeExports.jsx("svg", {
1730
- width: "16",
1731
- height: "16",
1732
- fill: "none",
1733
- stroke: "currentColor",
1734
- viewBox: "0 0 24 24",
1735
- style: {
1736
- color: '#9ca3af'
1737
- },
1738
- children: jsxRuntimeExports.jsx("path", {
1739
- strokeLinecap: "round",
1740
- strokeLinejoin: "round",
1741
- strokeWidth: 2,
1742
- d: "M19 9l-7 7-7-7"
1743
- })
1744
- })
1745
- })]
1746
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
1747
- className: clsx('input-helper-text', error && 'input-helper-text--error'),
1748
- children: error || helperText
1749
- })]
1750
- });
1751
- });
1752
- Select.displayName = 'Select';
1753
-
1754
- /**
1755
- * @license lucide-react v0.542.0 - ISC
1756
- *
1757
- * This source code is licensed under the ISC license.
1758
- * See the LICENSE file in the root directory of this source tree.
1759
- */
1760
-
1761
- const toKebabCase = string => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1762
- const toCamelCase = string => string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase());
1763
- const toPascalCase = string => {
1764
- const camelCase = toCamelCase(string);
1765
- return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
1766
- };
1767
- const mergeClasses = function () {
1768
- for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
1769
- classes[_key] = arguments[_key];
1770
- }
1771
- return classes.filter((className, index, array) => {
1772
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
1773
- }).join(" ").trim();
1774
- };
1775
- const hasA11yProp = props => {
1776
- for (const prop in props) {
1777
- if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
1778
- return true;
1779
- }
1780
- }
1781
- };
1782
-
1783
- /**
1784
- * @license lucide-react v0.542.0 - ISC
1785
- *
1786
- * This source code is licensed under the ISC license.
1787
- * See the LICENSE file in the root directory of this source tree.
1788
- */
1789
-
1790
- var defaultAttributes = {
1791
- xmlns: "http://www.w3.org/2000/svg",
1792
- width: 24,
1793
- height: 24,
1794
- viewBox: "0 0 24 24",
1795
- fill: "none",
1796
- stroke: "currentColor",
1797
- strokeWidth: 2,
1798
- strokeLinecap: "round",
1799
- strokeLinejoin: "round"
1800
- };
1801
-
1802
- const _excluded$6 = ["color", "size", "strokeWidth", "absoluteStrokeWidth", "className", "children", "iconNode"];
1803
- const Icon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1804
- let {
1805
- color = "currentColor",
1806
- size = 24,
1807
- strokeWidth = 2,
1808
- absoluteStrokeWidth,
1809
- className = "",
1810
- children,
1811
- iconNode
1812
- } = _ref,
1813
- rest = _objectWithoutProperties(_ref, _excluded$6);
1814
- return /*#__PURE__*/React.createElement("svg", _objectSpread2(_objectSpread2(_objectSpread2({
1815
- ref
1816
- }, defaultAttributes), {}, {
1817
- width: size,
1818
- height: size,
1819
- stroke: color,
1820
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
1821
- className: mergeClasses("lucide", className)
1822
- }, !children && !hasA11yProp(rest) && {
1823
- "aria-hidden": "true"
1824
- }), rest), [...iconNode.map(_ref2 => {
1825
- let [tag, attrs] = _ref2;
1826
- return /*#__PURE__*/React.createElement(tag, attrs);
1827
- }), ...(Array.isArray(children) ? children : [children])]);
1828
- });
1829
-
1830
- const _excluded$5 = ["className"];
1831
- const createLucideIcon = (iconName, iconNode) => {
1832
- const Component = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1833
- let {
1834
- className
1835
- } = _ref,
1836
- props = _objectWithoutProperties(_ref, _excluded$5);
1837
- return /*#__PURE__*/React.createElement(Icon, _objectSpread2({
1838
- ref,
1839
- iconNode,
1840
- className: mergeClasses("lucide-".concat(toKebabCase(toPascalCase(iconName))), "lucide-".concat(iconName), className)
1841
- }, props));
1842
- });
1843
- Component.displayName = toPascalCase(iconName);
1844
- return Component;
1845
- };
1846
-
1847
- /**
1848
- * @license lucide-react v0.542.0 - ISC
1849
- *
1850
- * This source code is licensed under the ISC license.
1851
- * See the LICENSE file in the root directory of this source tree.
1852
- */
1853
-
1854
- const __iconNode = [["path", {
1855
- d: "M8 2v4",
1856
- key: "1cmpym"
1857
- }], ["path", {
1858
- d: "M16 2v4",
1859
- key: "4m81vk"
1860
- }], ["rect", {
1861
- width: "18",
1862
- height: "18",
1863
- x: "3",
1864
- y: "4",
1865
- rx: "2",
1866
- key: "1hopcy"
1867
- }], ["path", {
1868
- d: "M3 10h18",
1869
- key: "8toen8"
1870
- }], ["path", {
1871
- d: "M8 14h.01",
1872
- key: "6423bh"
1873
- }], ["path", {
1874
- d: "M12 14h.01",
1875
- key: "1etili"
1876
- }], ["path", {
1877
- d: "M16 14h.01",
1878
- key: "1gbofw"
1879
- }], ["path", {
1880
- d: "M8 18h.01",
1881
- key: "lrp35t"
1882
- }], ["path", {
1883
- d: "M12 18h.01",
1884
- key: "mhygvu"
1885
- }], ["path", {
1886
- d: "M16 18h.01",
1887
- key: "kzsmim"
1888
- }]];
1889
- const CalendarDays = createLucideIcon("calendar-days", __iconNode);
1890
-
1891
- // Translations
1892
- const translations = {
1893
- th: {
1894
- months: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],
1895
- weekdaysShort: ['อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส'],
1896
- today: 'วันนี้',
1897
- clear: 'ล้าง',
1898
- ok: 'ตกลง',
1899
- hour: 'ชั่วโมง',
1900
- minute: 'นาที'
1901
- },
1902
- en: {
1903
- months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
1904
- weekdaysShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1905
- today: 'Today',
1906
- clear: 'Clear',
1907
- ok: 'OK',
1908
- hour: 'Hour',
1909
- minute: 'Minute'
1910
- }
1911
- };
1912
- // Utility functions
1913
- const convertYear = (year, fromType, toType) => {
1914
- return year + 543;
1915
- };
1916
- const formatDate = (date, format, yearType) => {
1917
- if (!date || isNaN(date.getTime())) return '';
1918
- const day = String(date.getDate()).padStart(2, '0');
1919
- const month = String(date.getMonth() + 1).padStart(2, '0');
1920
- const year = yearType === 'be' ? convertYear(date.getFullYear()) : date.getFullYear();
1921
- const hours = String(date.getHours()).padStart(2, '0');
1922
- const minutes = String(date.getMinutes()).padStart(2, '0');
1923
- let formatted = format.replace('DD', day).replace('MM', month).replace('YYYY', year.toString()).replace('HH', hours).replace('mm', minutes);
1924
- return formatted;
1925
- };
1926
- const isSameDay = (date1, date2) => {
1927
- return date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear();
1928
- };
1929
- // New utility function to check for disabled dates
1930
- const isDisabled = (date, disabledPast, disabledFuture) => {
1931
- const today = new Date();
1932
- const dateOnly = new Date(date.getFullYear(), date.getMonth(), date.getDate());
1933
- const todayOnly = new Date(today.getFullYear(), today.getMonth(), today.getDate());
1934
- if (disabledPast && dateOnly < todayOnly) {
1935
- return true;
1936
- }
1937
- if (disabledFuture && dateOnly > todayOnly) {
1938
- return true;
1939
- }
1940
- return false;
1941
- };
1942
- const DatePicker = _ref => {
1943
- let {
1944
- format = 'DD/MM/YYYY',
1945
- language = 'en',
1946
- yearType = 'ad',
1947
- value = null,
1948
- onChange,
1949
- placeholder = '',
1950
- disabled = false,
1951
- className = '',
1952
- showClear = true,
1953
- showToday = true,
1954
- disabledPast = false,
1955
- disabledFuture = false,
1956
- fullWidth = false,
1957
- label,
1958
- error,
1959
- helperText,
1960
- id,
1961
- showIcon = true
1962
- } = _ref;
1963
- // State
1964
- const [isOpen, setIsOpen] = React.useState(false);
1965
- const [selectedDate, setSelectedDate] = React.useState(null);
1966
- const [currentMonth, setCurrentMonth] = React.useState(new Date().getMonth());
1967
- const [currentYear, setCurrentYear] = React.useState(new Date().getFullYear());
1968
- const [inputValue, setInputValue] = React.useState('');
1969
- const [timeHour, setTimeHour] = React.useState(0);
1970
- const [timeMinute, setTimeMinute] = React.useState(0);
1971
- // Refs
1972
- const containerRef = React.useRef(null);
1973
- // Constants
1974
- const includeTime = format.includes('HH:mm');
1975
- const t = translations[language];
1976
- const inputId = id || "datepicker-".concat(Math.random().toString(36).substr(2, 9));
1977
- // Initialize from value prop
1978
- React.useEffect(() => {
1979
- if (value) {
1980
- const date = new Date(value);
1981
- if (!isNaN(date.getTime())) {
1982
- setSelectedDate(date);
1983
- setCurrentMonth(date.getMonth());
1984
- setCurrentYear(date.getFullYear());
1985
- setTimeHour(date.getHours());
1986
- setTimeMinute(date.getMinutes());
1987
- setInputValue(formatDate(date, format, yearType));
1988
- }
1989
- } else {
1990
- setSelectedDate(null);
1991
- setInputValue('');
1992
- }
1993
- }, [value, format, yearType]);
1994
- // Handle date selection
1995
- const handleDateSelect = (day, year, month) => {
1996
- const newDate = new Date(year, month, day, timeHour, timeMinute);
1997
- // Check if the selected date is disabled before proceeding
1998
- if (isDisabled(newDate, disabledPast, disabledFuture)) {
1999
- return;
2000
- }
2001
- setSelectedDate(newDate);
2002
- setInputValue(formatDate(newDate, format, yearType));
2003
- onChange === null || onChange === void 0 || onChange(newDate);
2004
- if (!includeTime) {
2005
- setIsOpen(false);
2006
- }
2007
- };
2008
- // Handle time change
2009
- const handleTimeChange = (type, newValue) => {
2010
- if (type === 'hour') {
2011
- setTimeHour(newValue);
2012
- } else {
2013
- setTimeMinute(newValue);
2014
- }
2015
- if (selectedDate) {
2016
- const newDate = new Date(selectedDate);
2017
- if (type === 'hour') {
2018
- newDate.setHours(newValue);
2019
- } else {
2020
- newDate.setMinutes(newValue);
2021
- }
2022
- setSelectedDate(newDate);
2023
- setInputValue(formatDate(newDate, format, yearType));
2024
- onChange === null || onChange === void 0 || onChange(newDate);
2025
- }
2026
- };
2027
- // Handle today button
2028
- const handleToday = () => {
2029
- const today = new Date();
2030
- if (isDisabled(today, disabledPast, disabledFuture)) {
2031
- return;
2032
- }
2033
- setSelectedDate(today);
2034
- setCurrentMonth(today.getMonth());
2035
- setCurrentYear(today.getFullYear());
2036
- setTimeHour(today.getHours());
2037
- setTimeMinute(today.getMinutes());
2038
- setInputValue(formatDate(today, format, yearType));
2039
- onChange === null || onChange === void 0 || onChange(today);
2040
- if (!includeTime) {
2041
- setIsOpen(false);
2042
- }
2043
- };
2044
- // Handle clear button
2045
- const handleClear = () => {
2046
- setSelectedDate(null);
2047
- setInputValue('');
2048
- onChange === null || onChange === void 0 || onChange(null);
2049
- setIsOpen(false);
2050
- };
2051
- // Handle confirm (for time picker)
2052
- const handleConfirm = () => {
2053
- setIsOpen(false);
2054
- };
2055
- // Navigation handlers
2056
- const goToPreviousMonth = () => {
2057
- if (currentMonth === 0) {
2058
- setCurrentMonth(11);
2059
- setCurrentYear(currentYear - 1);
2060
- } else {
2061
- setCurrentMonth(currentMonth - 1);
2062
- }
2063
- };
2064
- const goToNextMonth = () => {
2065
- if (currentMonth === 11) {
2066
- setCurrentMonth(0);
2067
- setCurrentYear(currentYear + 1);
2068
- } else {
2069
- setCurrentMonth(currentMonth + 1);
2070
- }
2071
- };
2072
- const goToPreviousYear = () => {
2073
- setCurrentYear(currentYear - 1);
2074
- };
2075
- const goToNextYear = () => {
2076
- setCurrentYear(currentYear + 1);
2077
- };
2078
- // Generate calendar days
2079
- const generateCalendarDays = () => {
2080
- const firstDayOfMonth = new Date(currentYear, currentMonth, 1);
2081
- const lastDayOfMonth = new Date(currentYear, currentMonth + 1, 0);
2082
- const firstDayOfWeek = firstDayOfMonth.getDay();
2083
- const daysInMonth = lastDayOfMonth.getDate();
2084
- const days = [];
2085
- // Previous month days
2086
- const prevMonth = new Date(currentYear, currentMonth - 1, 0);
2087
- const daysFromPrevMonth = firstDayOfWeek;
2088
- for (let i = daysFromPrevMonth - 1; i >= 0; i--) {
2089
- days.push({
2090
- day: prevMonth.getDate() - i,
2091
- isCurrentMonth: false,
2092
- isOtherMonth: true,
2093
- month: currentMonth - 1,
2094
- year: currentYear
2095
- });
2096
- }
2097
- // Current month days
2098
- for (let day = 1; day <= daysInMonth; day++) {
2099
- days.push({
2100
- day,
2101
- isCurrentMonth: true,
2102
- isOtherMonth: false,
2103
- month: currentMonth,
2104
- year: currentYear
2105
- });
2106
- }
2107
- // Next month days
2108
- const remainingDays = 42 - days.length;
2109
- for (let day = 1; day <= remainingDays; day++) {
2110
- days.push({
2111
- day,
2112
- isCurrentMonth: false,
2113
- isOtherMonth: true,
2114
- month: currentMonth + 1,
2115
- year: currentYear
2116
- });
2117
- }
2118
- return days;
2119
- };
2120
- // Click outside handler
2121
- React.useEffect(() => {
2122
- const handleClickOutside = event => {
2123
- if (containerRef.current && !containerRef.current.contains(event.target)) {
2124
- setIsOpen(false);
2125
- }
2126
- };
2127
- if (isOpen) {
2128
- document.addEventListener('mousedown', handleClickOutside);
2129
- }
2130
- return () => {
2131
- document.removeEventListener('mousedown', handleClickOutside);
2132
- };
2133
- }, [isOpen]);
2134
- const calendarDays = generateCalendarDays();
2135
- const today = new Date();
2136
- const displayYear = yearType === 'be' ? convertYear(currentYear) : currentYear;
2137
- const containerClasses = ['datepicker-container', fullWidth ? 'datepicker-container-full-width' : '', className].filter(Boolean).join(' ');
2138
- const inputClasses = ['datepicker-input', error ? 'datepicker-input-error' : ''].filter(Boolean).join(' ');
2139
- return jsxRuntimeExports.jsxs("div", {
2140
- className: containerClasses,
2141
- children: [label && jsxRuntimeExports.jsx("label", {
2142
- className: "input-label",
2143
- htmlFor: inputId,
2144
- children: label
2145
- }), jsxRuntimeExports.jsxs("div", {
2146
- ref: containerRef,
2147
- className: "datepicker ".concat(fullWidth ? 'datepicker-full-width' : ''),
2148
- children: [jsxRuntimeExports.jsxs("div", {
2149
- className: "datepicker-input-wrapper",
2150
- children: [jsxRuntimeExports.jsx("input", {
2151
- type: "text",
2152
- value: inputValue,
2153
- placeholder: placeholder || format,
2154
- disabled: disabled,
2155
- readOnly: true,
2156
- onClick: () => !disabled && setIsOpen(true),
2157
- className: inputClasses,
2158
- id: inputId
2159
- }), showIcon && jsxRuntimeExports.jsx("div", {
2160
- className: "datepicker-icon",
2161
- children: jsxRuntimeExports.jsx(CalendarDays, {
2162
- size: "18"
2163
- })
2164
- })]
2165
- }), isOpen && jsxRuntimeExports.jsx("div", {
2166
- className: "datepicker-dropdown",
2167
- children: jsxRuntimeExports.jsxs("div", {
2168
- children: [jsxRuntimeExports.jsxs("div", {
2169
- className: "calendar-header",
2170
- children: [jsxRuntimeExports.jsx("button", {
2171
- type: "button",
2172
- onClick: goToPreviousYear,
2173
- className: "nav-button",
2174
- children: "\u27EA"
2175
- }), jsxRuntimeExports.jsx("button", {
2176
- type: "button",
2177
- onClick: goToPreviousMonth,
2178
- className: "nav-button",
2179
- children: "\u27E8"
2180
- }), jsxRuntimeExports.jsxs("div", {
2181
- className: "current-month-year",
2182
- children: [t.months[currentMonth], " ", displayYear]
2183
- }), jsxRuntimeExports.jsx("button", {
2184
- type: "button",
2185
- onClick: goToNextMonth,
2186
- className: "nav-button",
2187
- children: "\u27E9"
2188
- }), jsxRuntimeExports.jsx("button", {
2189
- type: "button",
2190
- onClick: goToNextYear,
2191
- className: "nav-button",
2192
- children: "\u27EB"
2193
- })]
2194
- }), jsxRuntimeExports.jsx("div", {
2195
- className: "weekdays",
2196
- children: t.weekdaysShort.map((day, index) => jsxRuntimeExports.jsx("div", {
2197
- className: "weekday",
2198
- children: day
2199
- }, index))
2200
- }), jsxRuntimeExports.jsx("div", {
2201
- className: "calendar-days",
2202
- children: calendarDays.map((dateInfo, index) => {
2203
- let actualDate;
2204
- // Determine the correct date object for the day
2205
- if (dateInfo.isCurrentMonth) {
2206
- actualDate = new Date(currentYear, currentMonth, dateInfo.day);
2207
- } else if (index < 7 && dateInfo.day > 20) {
2208
- actualDate = new Date(currentYear, currentMonth - 1, dateInfo.day);
2209
- } else {
2210
- actualDate = new Date(currentYear, currentMonth + 1, dateInfo.day);
2211
- }
2212
- const isSelected = selectedDate && isSameDay(actualDate, selectedDate);
2213
- const isToday = isSameDay(actualDate, today);
2214
- const isDayDisabled = isDisabled(actualDate, disabledPast, disabledFuture);
2215
- const dayClasses = ['calendar-day', dateInfo.isOtherMonth ? 'calendar-day-other-month' : '', isSelected ? 'calendar-day-selected' : '', isToday ? 'calendar-day-today' : '', isDayDisabled ? 'calendar-day-disabled' : ''].filter(Boolean).join(' ');
2216
- return jsxRuntimeExports.jsx("button", {
2217
- type: "button",
2218
- onClick: () => {
2219
- if (dateInfo.isCurrentMonth) {
2220
- handleDateSelect(dateInfo.day, currentYear, currentMonth);
2221
- } else if (index < 7 && dateInfo.day > 20) {
2222
- // Navigate to previous month and select date
2223
- const prevMonth = currentMonth === 0 ? 11 : currentMonth - 1;
2224
- const prevYear = currentMonth === 0 ? currentYear - 1 : currentYear;
2225
- const newDate = new Date(prevYear, prevMonth, dateInfo.day);
2226
- if (isDisabled(newDate, disabledPast, disabledFuture)) return;
2227
- setCurrentMonth(prevMonth);
2228
- setCurrentYear(prevYear);
2229
- handleDateSelect(dateInfo.day, prevYear, prevMonth);
2230
- } else {
2231
- // Navigate to next month and select date
2232
- const nextMonth = currentMonth === 11 ? 0 : currentMonth + 1;
2233
- const nextYear = currentMonth === 11 ? currentYear + 1 : currentYear;
2234
- const newDate = new Date(nextYear, nextMonth, dateInfo.day);
2235
- if (isDisabled(newDate, disabledPast, disabledFuture)) return;
2236
- setCurrentMonth(nextMonth);
2237
- setCurrentYear(nextYear);
2238
- handleDateSelect(dateInfo.day, nextYear, nextMonth);
2239
- }
2240
- },
2241
- disabled: isDayDisabled,
2242
- className: dayClasses,
2243
- children: dateInfo.day
2244
- }, index);
2245
- })
2246
- }), includeTime && jsxRuntimeExports.jsxs("div", {
2247
- className: "time-picker",
2248
- children: [jsxRuntimeExports.jsxs("div", {
2249
- className: "time-picker-section",
2250
- children: [jsxRuntimeExports.jsx("label", {
2251
- children: t.hour
2252
- }), jsxRuntimeExports.jsx("select", {
2253
- value: timeHour,
2254
- onChange: e => handleTimeChange('hour', parseInt(e.target.value)),
2255
- className: "time-select",
2256
- children: Array.from({
2257
- length: 24
2258
- }, (_, i) => jsxRuntimeExports.jsx("option", {
2259
- value: i,
2260
- children: String(i).padStart(2, '0')
2261
- }, i))
2262
- })]
2263
- }), jsxRuntimeExports.jsxs("div", {
2264
- className: "time-picker-section",
2265
- children: [jsxRuntimeExports.jsx("label", {
2266
- children: t.minute
2267
- }), jsxRuntimeExports.jsx("select", {
2268
- value: timeMinute,
2269
- onChange: e => handleTimeChange('minute', parseInt(e.target.value)),
2270
- className: "time-select",
2271
- children: Array.from({
2272
- length: 60
2273
- }, (_, i) => jsxRuntimeExports.jsx("option", {
2274
- value: i,
2275
- children: String(i).padStart(2, '0')
2276
- }, i))
2277
- })]
2278
- })]
2279
- }), jsxRuntimeExports.jsxs("div", {
2280
- className: "calendar-footer",
2281
- children: [showToday && jsxRuntimeExports.jsx("button", {
2282
- type: "button",
2283
- onClick: handleToday,
2284
- disabled: isDisabled(today, disabledPast, disabledFuture),
2285
- className: "footer-button today-button ".concat(isDisabled(today, disabledPast, disabledFuture) ? 'calendar-day-disabled' : ''),
2286
- children: t.today
2287
- }), showClear && jsxRuntimeExports.jsx("button", {
2288
- type: "button",
2289
- onClick: handleClear,
2290
- className: "footer-button clear-button",
2291
- children: t.clear
2292
- }), includeTime && jsxRuntimeExports.jsx("button", {
2293
- type: "button",
2294
- onClick: handleConfirm,
2295
- className: "footer-button confirm-button",
2296
- children: t.ok
2297
- })]
2298
- })]
2299
- })
2300
- })]
2301
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
2302
- className: "input-helper-text ".concat(error ? 'input-helper-text-error' : ''),
2303
- children: error || helperText
2304
- })]
2305
- });
2306
- };
2307
-
2308
- const _excluded$4 = ["columns", "data", "className", "emptyMessage", "pagination", "paginationPerPage", "paginationRowsPerPageOptions", "search", "searchPlaceholder", "searchableColumns", "onSort", "onPageChange", "onRowsPerPageChange", "onSearch"];
2309
- const DataTable = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2310
- let {
2311
- columns,
2312
- data,
2313
- className,
2314
- emptyMessage = "No data available",
2315
- pagination = false,
2316
- paginationPerPage = 10,
2317
- paginationRowsPerPageOptions = [10, 25, 50, 100],
2318
- search = false,
2319
- searchPlaceholder = "Search...",
2320
- searchableColumns,
2321
- onSort,
2322
- onPageChange,
2323
- onRowsPerPageChange,
2324
- onSearch
2325
- } = _ref,
2326
- props = _objectWithoutProperties(_ref, _excluded$4);
2327
- const [sortField, setSortField] = React.useState(null);
2328
- const [sortDirection, setSortDirection] = React.useState("asc");
2329
- const [currentPage, setCurrentPage] = React.useState(1);
2330
- const [rowsPerPage, setRowsPerPage] = React.useState(paginationPerPage);
2331
- const rowsPerPageOptions = React.useMemo(() => {
2332
- const options = [...paginationRowsPerPageOptions];
2333
- if (!options.includes(paginationPerPage)) {
2334
- options.push(paginationPerPage);
2335
- options.sort((a, b) => a - b);
2336
- }
2337
- return options;
2338
- }, [paginationRowsPerPageOptions, paginationPerPage]);
2339
- const [searchTerm, setSearchTerm] = React.useState("");
2340
- const defaultSearchableColumns = searchableColumns || columns.map(col => col.key);
2341
- const filteredData = React.useMemo(() => {
2342
- if (!searchTerm) return data;
2343
- return data.filter(row => defaultSearchableColumns.some(key => String(row[key]).toLowerCase().includes(searchTerm.toLowerCase())));
2344
- }, [data, searchTerm, defaultSearchableColumns]);
2345
- const sortedData = React.useMemo(() => {
2346
- if (!sortField) return filteredData;
2347
- return [...filteredData].sort((a, b) => {
2348
- const aValue = a[sortField];
2349
- const bValue = b[sortField];
2350
- if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
2351
- if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
2352
- return 0;
2353
- });
2354
- }, [filteredData, sortField, sortDirection]);
2355
- const paginatedData = React.useMemo(() => {
2356
- if (!pagination) return sortedData;
2357
- const start = (currentPage - 1) * rowsPerPage;
2358
- return sortedData.slice(start, start + rowsPerPage);
2359
- }, [sortedData, currentPage, rowsPerPage, pagination]);
2360
- const totalPages = Math.ceil(sortedData.length / rowsPerPage);
2361
- const handleSort = columnKey => {
2362
- const newDirection = sortField === columnKey && sortDirection === "asc" ? "desc" : "asc";
2363
- setSortField(columnKey);
2364
- setSortDirection(newDirection);
2365
- onSort === null || onSort === void 0 || onSort(columnKey, newDirection);
2366
- };
2367
- const handlePageChange = page => {
2368
- setCurrentPage(page);
2369
- onPageChange === null || onPageChange === void 0 || onPageChange(page);
2370
- };
2371
- const handleRowsPerPageChange = newRowsPerPage => {
2372
- setRowsPerPage(newRowsPerPage);
2373
- setCurrentPage(1);
2374
- onRowsPerPageChange === null || onRowsPerPageChange === void 0 || onRowsPerPageChange(newRowsPerPage);
2375
- };
2376
- const handleSearchChange = e => {
2377
- const term = e.target.value;
2378
- setSearchTerm(term);
2379
- setCurrentPage(1);
2380
- onSearch === null || onSearch === void 0 || onSearch(term);
2381
- };
2382
- const renderPagination = () => {
2383
- if (!pagination) return null;
2384
- const pageNumbers = [];
2385
- const maxPagesToShow = 5;
2386
- const halfPages = Math.floor(maxPagesToShow / 2);
2387
- let startPage = Math.max(1, currentPage - halfPages);
2388
- let endPage = Math.min(totalPages, startPage + maxPagesToShow - 1);
2389
- if (endPage - startPage < maxPagesToShow - 1) {
2390
- startPage = Math.max(1, endPage - maxPagesToShow + 1);
2391
- }
2392
- for (let i = startPage; i <= endPage; i++) {
2393
- pageNumbers.push(i);
2394
- }
2395
- return jsxRuntimeExports.jsxs("div", {
2396
- className: "data-table-pagination-container",
2397
- children: [jsxRuntimeExports.jsxs("div", {
2398
- children: ["Rows per page:", jsxRuntimeExports.jsx("select", {
2399
- value: rowsPerPage,
2400
- onChange: e => handleRowsPerPageChange(Number(e.target.value)),
2401
- className: "data-table-pagination-select",
2402
- children: rowsPerPageOptions.map(option => jsxRuntimeExports.jsx("option", {
2403
- value: option,
2404
- children: option
2405
- }, option))
2406
- })]
2407
- }), jsxRuntimeExports.jsxs("div", {
2408
- className: "data-table-pagination-controls",
2409
- children: [jsxRuntimeExports.jsx("button", {
2410
- onClick: () => handlePageChange(1),
2411
- disabled: currentPage === 1,
2412
- className: "data-table-pagination-button",
2413
- children: "First"
2414
- }), jsxRuntimeExports.jsx("button", {
2415
- onClick: () => handlePageChange(currentPage - 1),
2416
- disabled: currentPage === 1,
2417
- className: "data-table-pagination-button",
2418
- children: "Previous"
2419
- }), startPage > 1 && jsxRuntimeExports.jsx("span", {
2420
- className: "pagination-ellipsis",
2421
- children: "..."
2422
- }), pageNumbers.map(page => jsxRuntimeExports.jsx("button", {
2423
- onClick: () => handlePageChange(page),
2424
- className: "data-table-pagination-button ".concat(currentPage === page ? 'active' : ''),
2425
- children: page
2426
- }, page)), endPage < totalPages && jsxRuntimeExports.jsx("span", {
2427
- className: "pagination-ellipsis",
2428
- children: "..."
2429
- }), jsxRuntimeExports.jsx("button", {
2430
- onClick: () => handlePageChange(currentPage + 1),
2431
- disabled: currentPage === totalPages,
2432
- className: "data-table-pagination-button",
2433
- children: "Next"
2434
- }), jsxRuntimeExports.jsx("button", {
2435
- onClick: () => handlePageChange(totalPages),
2436
- disabled: currentPage === totalPages,
2437
- className: "data-table-pagination-button",
2438
- children: "Last"
2439
- })]
2440
- })]
2441
- });
2442
- };
2443
- return jsxRuntimeExports.jsxs("div", {
2444
- className: "data-table-container",
2445
- children: [search && jsxRuntimeExports.jsx("div", {
2446
- className: "data-table-search-container",
2447
- children: jsxRuntimeExports.jsx(Input, {
2448
- type: "text",
2449
- placeholder: searchPlaceholder,
2450
- value: searchTerm,
2451
- onChange: handleSearchChange,
2452
- fullWidth: true
2453
- })
2454
- }), jsxRuntimeExports.jsxs("table", _objectSpread2(_objectSpread2({
2455
- className: "data-table ".concat(className || ''),
2456
- ref: ref
2457
- }, props), {}, {
2458
- children: [jsxRuntimeExports.jsx("thead", {
2459
- className: "data-table-header",
2460
- children: jsxRuntimeExports.jsx("tr", {
2461
- children: columns.map(column => {
2462
- const thClasses = ["data-table-header-cell", column.align === "center" && "text-center", column.align === "right" && "text-right", column.sortable && "sortable"].filter(Boolean).join(" ");
2463
- const contentClasses = ["header-cell-content", "justify-".concat(column.align || 'start')].join(' ');
2464
- return jsxRuntimeExports.jsx("th", {
2465
- className: thClasses,
2466
- style: {
2467
- width: column.width
2468
- },
2469
- onClick: column.sortable ? () => handleSort(column.key) : undefined,
2470
- children: jsxRuntimeExports.jsxs("div", {
2471
- className: contentClasses,
2472
- children: [column.label, column.sortable && sortField === column.key && jsxRuntimeExports.jsx("span", {
2473
- className: "sort-icon",
2474
- children: sortDirection === "asc" ? "↑" : "↓"
2475
- })]
2476
- })
2477
- }, column.key);
2478
- })
2479
- })
2480
- }), jsxRuntimeExports.jsx("tbody", {
2481
- className: "data-table-body",
2482
- children: paginatedData.length === 0 ? jsxRuntimeExports.jsx("tr", {
2483
- children: jsxRuntimeExports.jsx("td", {
2484
- colSpan: columns.length,
2485
- className: "data-table-empty-cell",
2486
- children: emptyMessage
2487
- })
2488
- }) : paginatedData.map((row, rowIndex) => jsxRuntimeExports.jsx("tr", {
2489
- className: "data-table-row",
2490
- children: columns.map(column => {
2491
- const value = row[column.key];
2492
- const cellContent = column.render ? column.render(value, row, rowIndex) : value;
2493
- const tdClasses = ["data-table-cell", column.align === "center" && "text-center", column.align === "right" && "text-right"].filter(Boolean).join(" ");
2494
- return jsxRuntimeExports.jsx("td", {
2495
- className: tdClasses,
2496
- children: cellContent
2497
- }, column.key);
2498
- })
2499
- }, rowIndex))
2500
- })]
2501
- })), renderPagination()]
2502
- });
2503
- });
2504
- DataTable.displayName = "DataTable";
2505
-
2506
- const _excluded$3 = ["options", "value", "onChange", "placeholder", "disabled", "fullWidth", "label", "helperText", "error", "multiple"];
2507
- const Autocomplete = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2508
- let {
2509
- options,
2510
- value,
2511
- onChange,
2512
- placeholder = 'Type to search...',
2513
- disabled = false,
2514
- fullWidth = false,
2515
- label,
2516
- helperText,
2517
- error = false,
2518
- multiple = false
2519
- } = _ref,
2520
- props = _objectWithoutProperties(_ref, _excluded$3);
2521
- const getInitialInputValue = () => {
2522
- if (!multiple && value && typeof value === 'string') {
2523
- return value;
2524
- }
2525
- return '';
2526
- };
2527
- const [inputValue, setInputValue] = React.useState(getInitialInputValue);
2528
- const [showDropdown, setShowDropdown] = React.useState(false);
2529
- const [filteredOptions, setFilteredOptions] = React.useState([]);
2530
- const [selectedIndex, setSelectedIndex] = React.useState(-1);
2531
- const inputRef = React.useRef(null);
2532
- const dropdownRef = React.useRef(null);
2533
- const currentValues = Array.isArray(value) ? value : value ? [value] : [];
2534
- const isSelected = option => currentValues.includes(option);
2535
- React.useEffect(() => {
2536
- if (!multiple && value && typeof value === 'string') {
2537
- setInputValue(value);
2538
- } else if (!multiple && !value) {
2539
- setInputValue('');
2540
- }
2541
- }, [value, multiple]);
2542
- React.useEffect(() => {
2543
- const filtered = options.filter(option => option.toLowerCase().includes(inputValue.toLowerCase()) && (!multiple || !isSelected(option)));
2544
- setFilteredOptions(filtered);
2545
- setSelectedIndex(-1);
2546
- }, [inputValue, options, multiple, currentValues]);
2547
- React.useEffect(() => {
2548
- if (!multiple && showDropdown && inputValue === '' && options.length > 0) {
2549
- setFilteredOptions(options.filter(option => !isSelected(option)));
2550
- }
2551
- }, [showDropdown, inputValue, options, multiple, isSelected]);
2552
- const handleInputChange = e => {
2553
- const newValue = e.target.value;
2554
- setInputValue(newValue);
2555
- setShowDropdown(true);
2556
- if (!multiple && value && newValue !== value) {
2557
- onChange === null || onChange === void 0 || onChange('');
2558
- }
2559
- };
2560
- const handleInputFocus = () => {
2561
- setShowDropdown(true);
2562
- if (!multiple && (inputValue === '' || !value)) {
2563
- setFilteredOptions(options);
2564
- }
2565
- };
2566
- const handleInputBlur = () => {
2567
- setTimeout(() => setShowDropdown(false), 150);
2568
- };
2569
- const handleOptionClick = option => {
2570
- if (multiple) {
2571
- const newValues = isSelected(option) ? currentValues.filter(v => v !== option) : [...currentValues, option];
2572
- onChange === null || onChange === void 0 || onChange(newValues);
2573
- setInputValue('');
2574
- } else {
2575
- onChange === null || onChange === void 0 || onChange(option);
2576
- setInputValue(option);
2577
- setFilteredOptions([]);
2578
- }
2579
- setShowDropdown(false);
2580
- };
2581
- const handleRemoveTag = option => {
2582
- if (multiple) {
2583
- const newValues = currentValues.filter(v => v !== option);
2584
- onChange === null || onChange === void 0 || onChange(newValues);
2585
- }
2586
- };
2587
- const handleKeyDown = e => {
2588
- if (!showDropdown) return;
2589
- switch (e.key) {
2590
- case 'ArrowDown':
2591
- e.preventDefault();
2592
- setSelectedIndex(prev => Math.min(prev + 1, filteredOptions.length - 1));
2593
- break;
2594
- case 'ArrowUp':
2595
- e.preventDefault();
2596
- setSelectedIndex(prev => Math.max(prev - 1, -1));
2597
- break;
2598
- case 'Enter':
2599
- e.preventDefault();
2600
- if (selectedIndex >= 0 && filteredOptions[selectedIndex]) {
2601
- handleOptionClick(filteredOptions[selectedIndex]);
2602
- }
2603
- break;
2604
- case 'Escape':
2605
- setShowDropdown(false);
2606
- setSelectedIndex(-1);
2607
- break;
2608
- }
2609
- };
2610
- return jsxRuntimeExports.jsxs("div", {
2611
- className: clsx('autocomplete-container', fullWidth && 'autocomplete-container--full-width'),
2612
- children: [label && jsxRuntimeExports.jsx("label", {
2613
- className: "input-label",
2614
- children: label
2615
- }), jsxRuntimeExports.jsxs("div", {
2616
- className: "autocomplete-wrapper",
2617
- children: [jsxRuntimeExports.jsxs("div", {
2618
- className: clsx('autocomplete-input-area', error && 'autocomplete-input-area--error', disabled && 'autocomplete-input-area--disabled', fullWidth && 'autocomplete-input-area--full-width'),
2619
- children: [multiple && currentValues.map((val, index) => jsxRuntimeExports.jsxs("span", {
2620
- className: "autocomplete-tag",
2621
- children: [val, jsxRuntimeExports.jsx("button", {
2622
- type: "button",
2623
- onClick: () => handleRemoveTag(val),
2624
- className: "autocomplete-tag-remove",
2625
- children: "\u00D7"
2626
- })]
2627
- }, "".concat(val, "-").concat(index))), jsxRuntimeExports.jsx("input", _objectSpread2({
2628
- ref: ref || inputRef,
2629
- type: "text",
2630
- value: inputValue,
2631
- onChange: handleInputChange,
2632
- onFocus: handleInputFocus,
2633
- onBlur: handleInputBlur,
2634
- onKeyDown: handleKeyDown,
2635
- placeholder: multiple ? currentValues.length > 0 ? '' : placeholder : inputValue ? '' : placeholder,
2636
- disabled: disabled,
2637
- className: "autocomplete-input"
2638
- }, props))]
2639
- }), showDropdown && filteredOptions.length > 0 && jsxRuntimeExports.jsx("ul", {
2640
- ref: dropdownRef,
2641
- className: "autocomplete-dropdown",
2642
- children: filteredOptions.map((option, index) => jsxRuntimeExports.jsx("li", {
2643
- onClick: () => handleOptionClick(option),
2644
- className: clsx('autocomplete-option', selectedIndex === index && 'autocomplete-option--selected'),
2645
- children: option
2646
- }, option))
2647
- })]
2648
- }), helperText && jsxRuntimeExports.jsx("div", {
2649
- className: clsx('input-helper-text', error && 'input-helper-text--error'),
2650
- children: helperText
2651
- })]
2652
- });
2653
- });
2654
- Autocomplete.displayName = 'Autocomplete';
2655
-
2656
- const _excluded$2 = ["component", "sx", "children", "className", "style", "display", "flexDirection", "justifyContent", "alignItems", "flexWrap", "gap", "p", "pt", "pr", "pb", "pl", "px", "py", "m", "mt", "mr", "mb", "ml", "mx", "my", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "bgcolor", "color", "borderRadius", "boxShadow", "position", "top", "right", "bottom", "left", "zIndex", "overflow", "textAlign"];
2657
- // Hardcoded theme for now
2658
- const theme = {
2659
- spacing: {
2660
- '0': '0',
2661
- '1': '0.25rem',
2662
- '2': '0.5rem',
2663
- '3': '0.75rem',
2664
- '4': '1rem',
2665
- '5': '1.25rem',
2666
- '6': '1.5rem',
2667
- '8': '2rem',
2668
- '10': '2.5rem',
2669
- '12': '3rem',
2670
- '16': '4rem',
2671
- '20': '5rem',
2672
- '24': '6rem',
2673
- '32': '8rem',
2674
- '40': '10rem',
2675
- '48': '12rem',
2676
- '56': '14rem',
2677
- '64': '16rem'
2678
- },
2679
- borderRadius: {
2680
- sm: '0.125rem',
2681
- md: '0.25rem',
2682
- lg: '0.5rem',
2683
- full: '9999px'
2684
- },
2685
- shadows: {
2686
- sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
2687
- md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
2688
- lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)'
2689
- }
2690
- };
2691
- // Helper function to convert system props to a style object
2692
- const createSystemStyles = props => {
2693
- const styles = {};
2694
- if (props.display) styles.display = props.display;
2695
- if (props.flexDirection) styles.flexDirection = props.flexDirection;
2696
- if (props.justifyContent) styles.justifyContent = props.justifyContent;
2697
- if (props.alignItems) styles.alignItems = props.alignItems;
2698
- if (props.flexWrap) styles.flexWrap = props.flexWrap;
2699
- if (props.gap) styles.gap = theme.spacing[props.gap];
2700
- // Padding
2701
- if (props.p) styles.padding = theme.spacing[props.p];
2702
- if (props.pt) styles.paddingTop = theme.spacing[props.pt];
2703
- if (props.pr) styles.paddingRight = theme.spacing[props.pr];
2704
- if (props.pb) styles.paddingBottom = theme.spacing[props.pb];
2705
- if (props.pl) styles.paddingLeft = theme.spacing[props.pl];
2706
- if (props.px) {
2707
- styles.paddingLeft = theme.spacing[props.px];
2708
- styles.paddingRight = theme.spacing[props.px];
2709
- }
2710
- if (props.py) {
2711
- styles.paddingTop = theme.spacing[props.py];
2712
- styles.paddingBottom = theme.spacing[props.py];
2713
- }
2714
- // Margin
2715
- if (props.m) styles.margin = theme.spacing[props.m];
2716
- if (props.mt) styles.marginTop = theme.spacing[props.mt];
2717
- if (props.mr) styles.marginRight = theme.spacing[props.mr];
2718
- if (props.mb) styles.marginBottom = theme.spacing[props.mb];
2719
- if (props.ml) styles.marginLeft = theme.spacing[props.ml];
2720
- if (props.mx) {
2721
- styles.marginLeft = theme.spacing[props.mx];
2722
- styles.marginRight = theme.spacing[props.mx];
2723
- }
2724
- if (props.my) {
2725
- styles.marginTop = theme.spacing[props.my];
2726
- styles.marginBottom = theme.spacing[props.my];
2727
- }
2728
- // Dimensions
2729
- if (props.width) styles.width = typeof props.width === 'number' ? "".concat(props.width, "px") : props.width;
2730
- if (props.height) styles.height = typeof props.height === 'number' ? "".concat(props.height, "px") : props.height;
2731
- if (props.minWidth) styles.minWidth = typeof props.minWidth === 'number' ? "".concat(props.minWidth, "px") : props.minWidth;
2732
- if (props.minHeight) styles.minHeight = typeof props.minHeight === 'number' ? "".concat(props.minHeight, "px") : props.minHeight;
2733
- if (props.maxWidth) styles.maxWidth = typeof props.maxWidth === 'number' ? "".concat(props.maxWidth, "px") : props.maxWidth;
2734
- if (props.maxHeight) styles.maxHeight = typeof props.maxHeight === 'number' ? "".concat(props.maxHeight, "px") : props.maxHeight;
2735
- // Colors
2736
- if (props.bgcolor) styles.backgroundColor = props.bgcolor;
2737
- if (props.color) styles.color = props.color;
2738
- // Border radius
2739
- if (props.borderRadius) styles.borderRadius = theme.borderRadius[props.borderRadius];
2740
- // Box shadow
2741
- if (props.boxShadow) styles.boxShadow = theme.shadows[props.boxShadow];
2742
- // Position
2743
- if (props.position) styles.position = props.position;
2744
- if (props.top) styles.top = typeof props.top === 'number' ? "".concat(props.top, "px") : props.top;
2745
- if (props.right) styles.right = typeof props.right === 'number' ? "".concat(props.right, "px") : props.right;
2746
- if (props.bottom) styles.bottom = typeof props.bottom === 'number' ? "".concat(props.bottom, "px") : props.bottom;
2747
- if (props.left) styles.left = typeof props.left === 'number' ? "".concat(props.left, "px") : props.left;
2748
- if (props.zIndex) styles.zIndex = props.zIndex;
2749
- // Overflow
2750
- if (props.overflow) styles.overflow = props.overflow;
2751
- // Text align
2752
- if (props.textAlign) styles.textAlign = props.textAlign;
2753
- return styles;
2754
- };
2755
- const Box = /*#__PURE__*/React.forwardRef((props, ref) => {
2756
- const {
2757
- component = 'div',
2758
- sx,
2759
- children,
2760
- className,
2761
- style,
2762
- // System props
2763
- display,
2764
- flexDirection,
2765
- justifyContent,
2766
- alignItems,
2767
- flexWrap,
2768
- gap,
2769
- p,
2770
- pt,
2771
- pr,
2772
- pb,
2773
- pl,
2774
- px,
2775
- py,
2776
- m,
2777
- mt,
2778
- mr,
2779
- mb,
2780
- ml,
2781
- mx,
2782
- my,
2783
- width,
2784
- height,
2785
- minWidth,
2786
- minHeight,
2787
- maxWidth,
2788
- maxHeight,
2789
- bgcolor,
2790
- color,
2791
- borderRadius,
2792
- boxShadow,
2793
- position,
2794
- top,
2795
- right,
2796
- bottom,
2797
- left,
2798
- zIndex,
2799
- overflow,
2800
- textAlign
2801
- } = props,
2802
- otherProps = _objectWithoutProperties(props, _excluded$2);
2803
- const Component = component;
2804
- // Create system styles from individual props
2805
- const systemProps = {
2806
- display,
2807
- flexDirection,
2808
- justifyContent,
2809
- alignItems,
2810
- flexWrap,
2811
- gap,
2812
- p,
2813
- pt,
2814
- pr,
2815
- pb,
2816
- pl,
2817
- px,
2818
- py,
2819
- m,
2820
- mt,
2821
- mr,
2822
- mb,
2823
- ml,
2824
- mx,
2825
- my,
2826
- width,
2827
- height,
2828
- minWidth,
2829
- minHeight,
2830
- maxWidth,
2831
- maxHeight,
2832
- bgcolor,
2833
- color,
2834
- borderRadius,
2835
- boxShadow,
2836
- position,
2837
- top,
2838
- right,
2839
- bottom,
2840
- left,
2841
- zIndex,
2842
- overflow,
2843
- textAlign
2844
- };
2845
- const systemStyles = createSystemStyles(systemProps);
2846
- const sxStyles = sx ? createSystemStyles(sx) : {};
2847
- const combinedStyles = _objectSpread2(_objectSpread2(_objectSpread2({}, systemStyles), sxStyles), style);
2848
- return jsxRuntimeExports.jsx(Component, _objectSpread2(_objectSpread2({
2849
- className: className,
2850
- style: combinedStyles,
2851
- ref: ref
2852
- }, otherProps), {}, {
2853
- children: children
2854
- }));
2855
- });
2856
- Box.displayName = 'Box';
2857
-
2858
- const _excluded$1 = ["className", "maxWidth", "disableGutters", "fixed", "children"];
2859
- const Container = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2860
- let {
2861
- className,
2862
- maxWidth = 'lg',
2863
- disableGutters = false,
2864
- fixed = false,
2865
- children
2866
- } = _ref,
2867
- props = _objectWithoutProperties(_ref, _excluded$1);
2868
- const classNames = clsx('container', !disableGutters && 'container--gutters', fixed && 'container--fixed', maxWidth !== 'none' && "container--max-width-".concat(maxWidth), className);
2869
- return jsxRuntimeExports.jsx("div", _objectSpread2(_objectSpread2({
2870
- className: classNames,
2871
- ref: ref
2872
- }, props), {}, {
2873
- children: children
2874
- }));
2875
- });
2876
- Container.displayName = 'Container';
2877
-
2878
- const _excluded = ["children", "className", "container", "item", "spacing", "direction", "justifyContent", "alignItems", "wrap", "xs", "sm", "md", "lg", "xl"];
2879
- const Grid = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2880
- let {
2881
- children,
2882
- className,
2883
- container = false,
2884
- item = false,
2885
- spacing = 0,
2886
- direction = 'row',
2887
- justifyContent,
2888
- alignItems,
2889
- wrap = 'wrap',
2890
- xs,
2891
- sm,
2892
- md,
2893
- lg,
2894
- xl
2895
- } = _ref,
2896
- props = _objectWithoutProperties(_ref, _excluded);
2897
- const classNames = ['grid'];
2898
- if (container) {
2899
- classNames.push('grid-container');
2900
- classNames.push("grid-direction-".concat(direction));
2901
- if (justifyContent) {
2902
- classNames.push("grid-justify-content-".concat(justifyContent));
2903
- }
2904
- if (alignItems) {
2905
- classNames.push("grid-align-items-".concat(alignItems));
2906
- }
2907
- classNames.push("grid-wrap-".concat(wrap));
2908
- if (spacing) {
2909
- classNames.push("grid-spacing-".concat(spacing));
2910
- }
2911
- }
2912
- if (item) {
2913
- classNames.push('grid-item');
2914
- if (xs) classNames.push("grid-xs-".concat(String(xs)));
2915
- if (sm) classNames.push("grid-sm-".concat(String(sm)));
2916
- if (md) classNames.push("grid-md-".concat(String(md)));
2917
- if (lg) classNames.push("grid-lg-".concat(String(lg)));
2918
- if (xl) classNames.push("grid-xl-".concat(String(xl)));
2919
- }
2920
- if (className) {
2921
- classNames.push(className);
2922
- }
2923
- return jsxRuntimeExports.jsx("div", _objectSpread2(_objectSpread2({
2924
- className: classNames.join(' '),
2925
- ref: ref
2926
- }, props), {}, {
2927
- children: children
2928
- }));
2929
- });
2930
- Grid.displayName = 'Grid';
2931
-
2932
- // Ensure React is available before importing components
2933
-
2934
- exports.React = React;
2935
- exports.default = React;
2936
- exports.Autocomplete = Autocomplete;
2937
- exports.Box = Box;
2938
- exports.Button = Button;
2939
- exports.Checkbox = Checkbox;
2940
- exports.Container = Container;
2941
- exports.DataTable = DataTable;
2942
- exports.DatePicker = DatePicker;
2943
- exports.Grid = Grid;
2944
- exports.Input = Input;
2945
- exports.InputFile = InputFile;
2946
- exports.Radio = Radio;
2947
- exports.Select = Select;
2948
- exports.Textarea = Textarea;
2949
- //# sourceMappingURL=index.js.map