@ballistix.digital/react-components 0.4.84 → 0.4.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +172 -172
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +171 -171
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
-
import { ArrowPathIcon,
|
|
2
|
+
import { ArrowPathIcon, ChevronDownIcon, EllipsisVerticalIcon, ExclamationCircleIcon, ChevronLeftIcon, ChevronRightIcon, HomeIcon, ArrowLongLeftIcon, ArrowLongRightIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
import { set, get } from 'lodash';
|
|
4
4
|
import get$1 from 'lodash/get';
|
|
5
|
-
import React, { Children, Fragment, useRef, useCallback, useEffect, forwardRef, useState, useMemo, createContext, useContext } from 'react';
|
|
6
|
-
import { Menu, Transition, Dialog } from '@headlessui/react';
|
|
7
5
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
8
6
|
import { fal } from '@fortawesome/pro-light-svg-icons';
|
|
9
7
|
import { far } from '@fortawesome/pro-regular-svg-icons';
|
|
10
8
|
import { fas } from '@fortawesome/pro-solid-svg-icons';
|
|
11
9
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
10
|
+
import React, { Children, Fragment, useRef, useCallback, useEffect, forwardRef, useState, useMemo, createContext, useContext } from 'react';
|
|
11
|
+
import { Menu, Transition, Dialog } from '@headlessui/react';
|
|
12
12
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
13
13
|
import { ViewColumnsIcon, ChevronDownIcon as ChevronDownIcon$1, TableCellsIcon } from '@heroicons/react/24/outline';
|
|
14
14
|
import { useReactTable, getCoreRowModel, flexRender, createColumnHelper as createColumnHelper$1 } from '@tanstack/react-table';
|
|
@@ -326,175 +326,6 @@ var styles$l = {
|
|
|
326
326
|
loading: loading$1,
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
-
var ButtonElement = function (props) {
|
|
330
|
-
var children = props.children, innerRef = props.innerRef, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, _b = props.type, type = _b === void 0 ? 'primary' : _b, _c = props.size, size = _c === void 0 ? 'md' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, _e = props.status, status = _e === void 0 ? 'idle' : _e, isDisabled = props.isDisabled, stylesOverrides = props.styles, onClick = props.onClick;
|
|
331
|
-
var handleGenerateStyle = function () {
|
|
332
|
-
var result = deepCopyObject(styles$k.base);
|
|
333
|
-
var keys = calculateNestedKeys(styles$k.base);
|
|
334
|
-
keys.forEach(function (key) {
|
|
335
|
-
set(result, key, toClassName(get(styles$k.base, key), type && get(styles$k[type], key), size && get(styles$k[size], key), figure && get(styles$k[figure], key), status && get(styles$k[status], key), isDisabled && get(styles$k.disabled, key), get(stylesOverrides, key)));
|
|
336
|
-
});
|
|
337
|
-
return result;
|
|
338
|
-
};
|
|
339
|
-
var styles = handleGenerateStyle();
|
|
340
|
-
return (jsxs("button", __assign({ type: htmlType, className: styles.container, disabled: isDisabled || status !== 'idle', onClick: onClick, ref: innerRef }, { children: [status === 'idle' && children, status === 'loading' && (jsxs("div", __assign({ className: styles.content }, { children: [jsx(ArrowPathIcon, { className: styles.spinner }), jsx("div", { children: children })] }))), status === 'error' && (jsxs("div", __assign({ className: styles.content }, { children: [jsx(ExclamationCircleIcon, { className: styles.icon }), jsx("div", { children: children })] }))), status === 'success' && (jsxs("div", __assign({ className: styles.content }, { children: [jsx(CheckIcon, { className: styles.icon }), jsx("div", { children: children })] })))] })));
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
var base$h = {
|
|
344
|
-
container: 'inline-flex items-center border border-transparent font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 duration-300',
|
|
345
|
-
content: 'flex gap-2',
|
|
346
|
-
icon: 'w-5',
|
|
347
|
-
spinner: 'w-5 animate-spin',
|
|
348
|
-
};
|
|
349
|
-
var primary = {
|
|
350
|
-
container: "shadow-sm text-white bg-primary-600 hover:bg-primary-700",
|
|
351
|
-
};
|
|
352
|
-
var secondary = {
|
|
353
|
-
container: "shadow-none text-primary-700 bg-primary-100 hover:bg-primary-200",
|
|
354
|
-
};
|
|
355
|
-
var outline = {
|
|
356
|
-
container: "border-gray-300 text-gray-700 bg-white hover:bg-gray-50",
|
|
357
|
-
};
|
|
358
|
-
var xs$3 = {
|
|
359
|
-
container: 'px-3 py-1.5 text-xs',
|
|
360
|
-
};
|
|
361
|
-
var sm$3 = {
|
|
362
|
-
container: 'px-3.5 py-2 text-sm',
|
|
363
|
-
};
|
|
364
|
-
var md$3 = {
|
|
365
|
-
container: 'px-4 py-2.5 text-sm',
|
|
366
|
-
};
|
|
367
|
-
var lg$3 = {
|
|
368
|
-
container: 'px-5 py-2.5 text-base',
|
|
369
|
-
};
|
|
370
|
-
var xl$3 = {
|
|
371
|
-
container: 'px-6 py-3 text-base',
|
|
372
|
-
};
|
|
373
|
-
var block = {
|
|
374
|
-
container: 'rounded-md',
|
|
375
|
-
};
|
|
376
|
-
var rounded = {
|
|
377
|
-
container: 'rounded-full',
|
|
378
|
-
};
|
|
379
|
-
var idle = {};
|
|
380
|
-
var loading = {
|
|
381
|
-
container: 'cursor-progress',
|
|
382
|
-
content: 'flex items-center',
|
|
383
|
-
};
|
|
384
|
-
var success = {
|
|
385
|
-
container: '!bg-emerald-500 hover:bg-emerald-600 !text-white duration-300',
|
|
386
|
-
content: 'flex items-center',
|
|
387
|
-
};
|
|
388
|
-
var error = {
|
|
389
|
-
container: 'bg-rose-400 hover:bg-rose-500 !text-white duration-300',
|
|
390
|
-
content: 'flex items-center',
|
|
391
|
-
};
|
|
392
|
-
var disabled$2 = {
|
|
393
|
-
container: '!opacity-20 !cursor-not-allowed',
|
|
394
|
-
};
|
|
395
|
-
var styles$k = {
|
|
396
|
-
base: base$h,
|
|
397
|
-
primary: primary,
|
|
398
|
-
secondary: secondary,
|
|
399
|
-
outline: outline,
|
|
400
|
-
xs: xs$3,
|
|
401
|
-
sm: sm$3,
|
|
402
|
-
md: md$3,
|
|
403
|
-
lg: lg$3,
|
|
404
|
-
xl: xl$3,
|
|
405
|
-
block: block,
|
|
406
|
-
rounded: rounded,
|
|
407
|
-
idle: idle,
|
|
408
|
-
loading: loading,
|
|
409
|
-
success: success,
|
|
410
|
-
error: error,
|
|
411
|
-
disabled: disabled$2,
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
var ButtonGroupElement = function (props) {
|
|
415
|
-
var children = props.children, stylesOverrides = props.styles;
|
|
416
|
-
var handleGenerateStyle = function () {
|
|
417
|
-
var result = deepCopyObject(styles$j.base);
|
|
418
|
-
var keys = calculateNestedKeys(styles$j.base);
|
|
419
|
-
keys.forEach(function (key) {
|
|
420
|
-
set(result, key, toClassName(get(styles$j.base, key), get(stylesOverrides, key)));
|
|
421
|
-
});
|
|
422
|
-
return result;
|
|
423
|
-
};
|
|
424
|
-
var styles = handleGenerateStyle();
|
|
425
|
-
return (jsx("span", __assign({ className: styles.container }, { children: Children.map(children, function (child, index) {
|
|
426
|
-
var _a;
|
|
427
|
-
var className = styles.button;
|
|
428
|
-
if (index === 0) {
|
|
429
|
-
className = styles.firstButton;
|
|
430
|
-
}
|
|
431
|
-
if (index === children.length - 1) {
|
|
432
|
-
className = styles.lastButton;
|
|
433
|
-
}
|
|
434
|
-
return (jsx("button", __assign({ className: className }, { children: child }), (_a = child.key) !== null && _a !== void 0 ? _a : index));
|
|
435
|
-
}) })));
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
var base$g = {
|
|
439
|
-
container: 'relative z-0 inline-flex shadow-sm rounded-md',
|
|
440
|
-
firstButton: 'relative inline-flex items-center px-4 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
441
|
-
button: '-ml-px relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
442
|
-
lastButton: '-ml-px relative inline-flex items-center px-4 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
443
|
-
};
|
|
444
|
-
var styles$j = {
|
|
445
|
-
base: base$g,
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
var Container$3 = function (props) {
|
|
449
|
-
var children = props.children, label = props.label, trigger = props.trigger, _a = props.type, type = _a === void 0 ? 'button' : _a, _b = props.direction, direction = _b === void 0 ? 'bottom-left' : _b, stylesOverrides = props.styles;
|
|
450
|
-
var handleGenerateStyle = function () {
|
|
451
|
-
var result = deepCopyObject(styles$i.base);
|
|
452
|
-
var keys = calculateNestedKeys(styles$i.base);
|
|
453
|
-
keys.forEach(function (key) {
|
|
454
|
-
set(result, key, toClassName(get(styles$i.base, key), type && get(styles$i[type], key), direction && get(styles$i[direction], key), get(stylesOverrides, key)));
|
|
455
|
-
});
|
|
456
|
-
return result;
|
|
457
|
-
};
|
|
458
|
-
var styles = handleGenerateStyle();
|
|
459
|
-
return (jsxs(Menu, __assign({ as: "div", className: styles.container }, { children: [jsxs("div", { children: [type === 'button' &&
|
|
460
|
-
(!trigger ? (jsxs(Menu.Button, __assign({ className: styles.button }, { children: [label, jsx(ChevronDownIcon, { className: "-mr-1 ml-2 h-5 w-5", "aria-hidden": "true" })] }))) : (jsx(Menu.Button, { children: trigger }))), type === 'compact' && (jsxs(Menu.Button, __assign({ className: styles.compact }, { children: [jsx("span", __assign({ className: "sr-only" }, { children: label })), jsx(EllipsisVerticalIcon, { className: styles.dots, "aria-hidden": "true" })] })))] }), jsx(Transition, __assign({ as: Fragment, enter: "transition ease-out duration-100", enterFrom: "transform opacity-0 scale-95", enterTo: "transform opacity-100 scale-100", leave: "transition ease-in duration-75", leaveFrom: "transform opacity-100 scale-100", leaveTo: "transform opacity-0 scale-95" }, { children: jsx(Menu.Items, __assign({ className: styles.items }, { children: children })) }))] })));
|
|
461
|
-
};
|
|
462
|
-
var DropdownElement = {
|
|
463
|
-
Container: Container$3,
|
|
464
|
-
Item: Menu.Item,
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
var base$f = {
|
|
468
|
-
container: 'relative inline-block text-left',
|
|
469
|
-
button: 'inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-primary-500',
|
|
470
|
-
compact: 'bg-gray-100 rounded-full flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-primary-500',
|
|
471
|
-
dots: 'h-7 w-7 p-1',
|
|
472
|
-
items: 'absolute mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none',
|
|
473
|
-
};
|
|
474
|
-
var button = {};
|
|
475
|
-
var compact = {};
|
|
476
|
-
var bottomLeft = {
|
|
477
|
-
items: 'origin-top-right right-0',
|
|
478
|
-
};
|
|
479
|
-
var bottomRight = {
|
|
480
|
-
items: 'origin-top-left left-0',
|
|
481
|
-
};
|
|
482
|
-
var topLeft = {
|
|
483
|
-
items: 'origin-bottom-right right-0 bottom-0',
|
|
484
|
-
};
|
|
485
|
-
var topRight = {
|
|
486
|
-
items: 'origin-bottom-left left-0 bottom-0',
|
|
487
|
-
};
|
|
488
|
-
var styles$i = {
|
|
489
|
-
base: base$f,
|
|
490
|
-
button: button,
|
|
491
|
-
compact: compact,
|
|
492
|
-
'bottom-left': bottomLeft,
|
|
493
|
-
'bottom-right': bottomRight,
|
|
494
|
-
'top-left': topLeft,
|
|
495
|
-
'top-right': topRight,
|
|
496
|
-
};
|
|
497
|
-
|
|
498
329
|
var faMonero = {
|
|
499
330
|
prefix: 'fab',
|
|
500
331
|
iconName: 'monero',
|
|
@@ -3430,6 +3261,175 @@ var IconElement = function (props) {
|
|
|
3430
3261
|
return component;
|
|
3431
3262
|
};
|
|
3432
3263
|
|
|
3264
|
+
var ButtonElement = function (props) {
|
|
3265
|
+
var children = props.children, innerRef = props.innerRef, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, _b = props.type, type = _b === void 0 ? 'primary' : _b, _c = props.size, size = _c === void 0 ? 'md' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, _e = props.status, status = _e === void 0 ? 'idle' : _e, isDisabled = props.isDisabled, stylesOverrides = props.styles, onClick = props.onClick;
|
|
3266
|
+
var handleGenerateStyle = function () {
|
|
3267
|
+
var result = deepCopyObject(styles$k.base);
|
|
3268
|
+
var keys = calculateNestedKeys(styles$k.base);
|
|
3269
|
+
keys.forEach(function (key) {
|
|
3270
|
+
set(result, key, toClassName(get(styles$k.base, key), type && get(styles$k[type], key), size && get(styles$k[size], key), figure && get(styles$k[figure], key), status && get(styles$k[status], key), isDisabled && get(styles$k.disabled, key), get(stylesOverrides, key)));
|
|
3271
|
+
});
|
|
3272
|
+
return result;
|
|
3273
|
+
};
|
|
3274
|
+
var styles = handleGenerateStyle();
|
|
3275
|
+
return (jsxs("button", __assign({ type: htmlType, className: styles.container, disabled: isDisabled || status !== 'idle', onClick: onClick, ref: innerRef }, { children: [status === 'idle' && children, status === 'loading' && (jsxs("div", __assign({ className: styles.content }, { children: [jsx(IconElement, { type: "regular", accessor: "spinner", className: styles.spinner }), jsx("div", { children: children })] }))), status === 'error' && (jsxs("div", __assign({ className: styles.content }, { children: [jsx(IconElement, { type: "regular", accessor: "circle-exclamation", className: styles.icon }), jsx("div", { children: children })] }))), status === 'success' && (jsxs("div", __assign({ className: styles.content }, { children: [jsx(IconElement, { type: "regular", accessor: "circle-check", className: styles.icon }), jsx("div", { children: children })] })))] })));
|
|
3276
|
+
};
|
|
3277
|
+
|
|
3278
|
+
var base$h = {
|
|
3279
|
+
container: 'inline-flex items-center border border-transparent font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 duration-300',
|
|
3280
|
+
content: 'flex gap-2',
|
|
3281
|
+
icon: '',
|
|
3282
|
+
spinner: 'animate-spin',
|
|
3283
|
+
};
|
|
3284
|
+
var primary = {
|
|
3285
|
+
container: "shadow-sm text-white bg-primary-600 hover:bg-primary-700",
|
|
3286
|
+
};
|
|
3287
|
+
var secondary = {
|
|
3288
|
+
container: "shadow-none text-primary-700 bg-primary-100 hover:bg-primary-200",
|
|
3289
|
+
};
|
|
3290
|
+
var outline = {
|
|
3291
|
+
container: "border-gray-300 text-gray-700 bg-white hover:bg-gray-50",
|
|
3292
|
+
};
|
|
3293
|
+
var xs$3 = {
|
|
3294
|
+
container: 'px-3 py-1.5 text-xs',
|
|
3295
|
+
};
|
|
3296
|
+
var sm$3 = {
|
|
3297
|
+
container: 'px-3.5 py-2 text-sm',
|
|
3298
|
+
};
|
|
3299
|
+
var md$3 = {
|
|
3300
|
+
container: 'px-4 py-2.5 text-sm',
|
|
3301
|
+
};
|
|
3302
|
+
var lg$3 = {
|
|
3303
|
+
container: 'px-5 py-2.5 text-base',
|
|
3304
|
+
};
|
|
3305
|
+
var xl$3 = {
|
|
3306
|
+
container: 'px-6 py-3 text-base',
|
|
3307
|
+
};
|
|
3308
|
+
var block = {
|
|
3309
|
+
container: 'rounded-md',
|
|
3310
|
+
};
|
|
3311
|
+
var rounded = {
|
|
3312
|
+
container: 'rounded-full',
|
|
3313
|
+
};
|
|
3314
|
+
var idle = {};
|
|
3315
|
+
var loading = {
|
|
3316
|
+
container: 'cursor-progress',
|
|
3317
|
+
content: 'flex items-center',
|
|
3318
|
+
};
|
|
3319
|
+
var success = {
|
|
3320
|
+
container: '!bg-emerald-500 hover:bg-emerald-600 !text-white duration-300',
|
|
3321
|
+
content: 'flex items-center',
|
|
3322
|
+
};
|
|
3323
|
+
var error = {
|
|
3324
|
+
container: 'bg-rose-400 hover:bg-rose-500 !text-white duration-300',
|
|
3325
|
+
content: 'flex items-center',
|
|
3326
|
+
};
|
|
3327
|
+
var disabled$2 = {
|
|
3328
|
+
container: '!opacity-20 !cursor-not-allowed',
|
|
3329
|
+
};
|
|
3330
|
+
var styles$k = {
|
|
3331
|
+
base: base$h,
|
|
3332
|
+
primary: primary,
|
|
3333
|
+
secondary: secondary,
|
|
3334
|
+
outline: outline,
|
|
3335
|
+
xs: xs$3,
|
|
3336
|
+
sm: sm$3,
|
|
3337
|
+
md: md$3,
|
|
3338
|
+
lg: lg$3,
|
|
3339
|
+
xl: xl$3,
|
|
3340
|
+
block: block,
|
|
3341
|
+
rounded: rounded,
|
|
3342
|
+
idle: idle,
|
|
3343
|
+
loading: loading,
|
|
3344
|
+
success: success,
|
|
3345
|
+
error: error,
|
|
3346
|
+
disabled: disabled$2,
|
|
3347
|
+
};
|
|
3348
|
+
|
|
3349
|
+
var ButtonGroupElement = function (props) {
|
|
3350
|
+
var children = props.children, stylesOverrides = props.styles;
|
|
3351
|
+
var handleGenerateStyle = function () {
|
|
3352
|
+
var result = deepCopyObject(styles$j.base);
|
|
3353
|
+
var keys = calculateNestedKeys(styles$j.base);
|
|
3354
|
+
keys.forEach(function (key) {
|
|
3355
|
+
set(result, key, toClassName(get(styles$j.base, key), get(stylesOverrides, key)));
|
|
3356
|
+
});
|
|
3357
|
+
return result;
|
|
3358
|
+
};
|
|
3359
|
+
var styles = handleGenerateStyle();
|
|
3360
|
+
return (jsx("span", __assign({ className: styles.container }, { children: Children.map(children, function (child, index) {
|
|
3361
|
+
var _a;
|
|
3362
|
+
var className = styles.button;
|
|
3363
|
+
if (index === 0) {
|
|
3364
|
+
className = styles.firstButton;
|
|
3365
|
+
}
|
|
3366
|
+
if (index === children.length - 1) {
|
|
3367
|
+
className = styles.lastButton;
|
|
3368
|
+
}
|
|
3369
|
+
return (jsx("button", __assign({ className: className }, { children: child }), (_a = child.key) !== null && _a !== void 0 ? _a : index));
|
|
3370
|
+
}) })));
|
|
3371
|
+
};
|
|
3372
|
+
|
|
3373
|
+
var base$g = {
|
|
3374
|
+
container: 'relative z-0 inline-flex shadow-sm rounded-md',
|
|
3375
|
+
firstButton: 'relative inline-flex items-center px-4 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
3376
|
+
button: '-ml-px relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
3377
|
+
lastButton: '-ml-px relative inline-flex items-center px-4 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
3378
|
+
};
|
|
3379
|
+
var styles$j = {
|
|
3380
|
+
base: base$g,
|
|
3381
|
+
};
|
|
3382
|
+
|
|
3383
|
+
var Container$3 = function (props) {
|
|
3384
|
+
var children = props.children, label = props.label, trigger = props.trigger, _a = props.type, type = _a === void 0 ? 'button' : _a, _b = props.direction, direction = _b === void 0 ? 'bottom-left' : _b, stylesOverrides = props.styles;
|
|
3385
|
+
var handleGenerateStyle = function () {
|
|
3386
|
+
var result = deepCopyObject(styles$i.base);
|
|
3387
|
+
var keys = calculateNestedKeys(styles$i.base);
|
|
3388
|
+
keys.forEach(function (key) {
|
|
3389
|
+
set(result, key, toClassName(get(styles$i.base, key), type && get(styles$i[type], key), direction && get(styles$i[direction], key), get(stylesOverrides, key)));
|
|
3390
|
+
});
|
|
3391
|
+
return result;
|
|
3392
|
+
};
|
|
3393
|
+
var styles = handleGenerateStyle();
|
|
3394
|
+
return (jsxs(Menu, __assign({ as: "div", className: styles.container }, { children: [jsxs("div", { children: [type === 'button' &&
|
|
3395
|
+
(!trigger ? (jsxs(Menu.Button, __assign({ className: styles.button }, { children: [label, jsx(ChevronDownIcon, { className: "-mr-1 ml-2 h-5 w-5", "aria-hidden": "true" })] }))) : (jsx(Menu.Button, { children: trigger }))), type === 'compact' && (jsxs(Menu.Button, __assign({ className: styles.compact }, { children: [jsx("span", __assign({ className: "sr-only" }, { children: label })), jsx(EllipsisVerticalIcon, { className: styles.dots, "aria-hidden": "true" })] })))] }), jsx(Transition, __assign({ as: Fragment, enter: "transition ease-out duration-100", enterFrom: "transform opacity-0 scale-95", enterTo: "transform opacity-100 scale-100", leave: "transition ease-in duration-75", leaveFrom: "transform opacity-100 scale-100", leaveTo: "transform opacity-0 scale-95" }, { children: jsx(Menu.Items, __assign({ className: styles.items }, { children: children })) }))] })));
|
|
3396
|
+
};
|
|
3397
|
+
var DropdownElement = {
|
|
3398
|
+
Container: Container$3,
|
|
3399
|
+
Item: Menu.Item,
|
|
3400
|
+
};
|
|
3401
|
+
|
|
3402
|
+
var base$f = {
|
|
3403
|
+
container: 'relative inline-block text-left',
|
|
3404
|
+
button: 'inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-primary-500',
|
|
3405
|
+
compact: 'bg-gray-100 rounded-full flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-primary-500',
|
|
3406
|
+
dots: 'h-7 w-7 p-1',
|
|
3407
|
+
items: 'absolute mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none',
|
|
3408
|
+
};
|
|
3409
|
+
var button = {};
|
|
3410
|
+
var compact = {};
|
|
3411
|
+
var bottomLeft = {
|
|
3412
|
+
items: 'origin-top-right right-0',
|
|
3413
|
+
};
|
|
3414
|
+
var bottomRight = {
|
|
3415
|
+
items: 'origin-top-left left-0',
|
|
3416
|
+
};
|
|
3417
|
+
var topLeft = {
|
|
3418
|
+
items: 'origin-bottom-right right-0 bottom-0',
|
|
3419
|
+
};
|
|
3420
|
+
var topRight = {
|
|
3421
|
+
items: 'origin-bottom-left left-0 bottom-0',
|
|
3422
|
+
};
|
|
3423
|
+
var styles$i = {
|
|
3424
|
+
base: base$f,
|
|
3425
|
+
button: button,
|
|
3426
|
+
compact: compact,
|
|
3427
|
+
'bottom-left': bottomLeft,
|
|
3428
|
+
'bottom-right': bottomRight,
|
|
3429
|
+
'top-left': topLeft,
|
|
3430
|
+
'top-right': topRight,
|
|
3431
|
+
};
|
|
3432
|
+
|
|
3433
3433
|
var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);},a(e,t)};var l$1=function(){return l$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},l$1.apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);}return r}var i$1=function(e){function t(t,r){var n=e.call(this,t)||this;return n.name="SyntheticChangeError",n.cause=r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e;}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r);}(t,e),t}(Error);function u$1(e,t){var r=t.value,n=t.selectionStart,a=t.selectionEnd;void 0!==r&&(e.value=r),void 0!==n&&void 0!==a&&e.setSelectionRange(n,a);}var c$1=function(e){return null!==e&&"text"===e.type};function s$1(a){var l=a.init,o=a.tracking,s=a.customInputEventType,p=a.customInputEventHandler,v=useRef(null),d=useRef({requestID:-1,fallbackRequestID:-1,cachedRequestID:-1,start:0,end:0}),f=function(r,a,l){var o=useRef(!0),i=useCallback((function(e){if(null!==r.current&&a&&l){var t=r.current,i=t.value,c=t.selectionStart,s=t.selectionEnd;o.current=!1,setTimeout((function(){if(null!==r.current){u$1(r.current,{value:i,selectionStart:null!=c?c:i.length,selectionEnd:null!=s?s:i.length});var t=new CustomEvent(a,{bubbles:!0,cancelable:!1,composed:!0,detail:e});r.current.dispatchEvent(t),unstable_batchedUpdates?unstable_batchedUpdates(l,t):l(t),o.current=!0;}}));}}),[r,a,l]);return [o,i]}(v,s,p),h=f[0],m=f[1];return useEffect((function(){"production"!==process.env.NODE_ENV&&(null===v.current&&console.error(new Error("Input element does not exist.")),null!==v.current&&"text"!==v.current.type&&console.error(new Error('The type of the input element does not match the type "text".')));}),[]),useEffect((function(){var e;if(null!==v.current&&c$1(v.current)){var t=null!==(e=v.current._wrapperState)&&void 0!==e?e:{},r=t.controlled,n=void 0!==r&&r,a=t.initialValue,o=l({controlled:n,initialValue:void 0===a?"":a});u$1(v.current,{value:o.value});}}),[]),useEffect((function(){var e=function(e){var t,r,n,a,l,s,p,f,h,y,g,k,b,w,E,O;if(c$1(v.current))try{if(null===v.current)throw new i$1("Reference to input element is not initialized.");if(d.current.cachedRequestID===d.current.requestID)throw new i$1("The input selection has not been updated.");d.current.cachedRequestID=d.current.requestID;var _=v.current,I=_.value,S=_.selectionStart,R=_.selectionEnd;if(null===S||null===R)throw new i$1("The selection attributes have not been initialized.");var j=null!==(n=null===(r=null===(t=v.current._valueTracker)||void 0===t?void 0:t.getValue)||void 0===r?void 0:r.call(t))&&void 0!==n?n:"",x="initial";if(S>d.current.start?x="insert":S<=d.current.start&&S<d.current.end?x="deleteBackward":S===d.current.end&&I.length<j.length&&(x="deleteForward"),("deleteBackward"===x||"deleteForward"===x)&&I.length>j.length)throw new i$1("Input type detection error.");var q="",D="",T=d.current.start,P=d.current.end;switch(x){case"insert":q=I.slice(d.current.start,S);break;case"deleteBackward":case"deleteForward":var V=j.length-I.length;T=S,P=S+V,D=j.slice(T,P);break;default:throw new i$1("The input type is undefined.")}var C=o({inputType:x,added:q,deleted:D,previousValue:j,selectionStartRange:T,selectionEndRange:P,value:I,selectionStart:S,selectionEnd:R});u$1(v.current,{value:C.value,selectionStart:C.selectionStart,selectionEnd:C.selectionEnd}),m(C.__detail),null===(l=null===(a=v.current._valueTracker)||void 0===a?void 0:a.setValue)||void 0===l||l.call(a,j),d.current.start=C.selectionStart,d.current.end=C.selectionEnd;}catch(t){var F=t,z=F.name,A=F.cause;if(null!==v.current&&u$1(v.current,{value:null!==(y=null!==(p=null===(s=null==A?void 0:A.__attributes)||void 0===s?void 0:s.value)&&void 0!==p?p:null===(h=null===(f=v.current._valueTracker)||void 0===f?void 0:f.getValue)||void 0===h?void 0:h.call(f))&&void 0!==y?y:"",selectionStart:null!==(k=null===(g=null==A?void 0:A.__attributes)||void 0===g?void 0:g.selectionStart)&&void 0!==k?k:d.current.start,selectionEnd:null!==(w=null===(b=null==A?void 0:A.__attributes)||void 0===b?void 0:b.selectionEnd)&&void 0!==w?w:d.current.end}),void 0!==(null===(E=null==A?void 0:A.__attributes)||void 0===E?void 0:E.selectionStart)&&(d.current.start=A.__attributes.selectionStart),void 0!==(null===(O=null==A?void 0:A.__attributes)||void 0===O?void 0:O.selectionEnd)&&(d.current.end=A.__attributes.selectionEnd),e.preventDefault(),e.stopPropagation(),"SyntheticChangeError"!==z)throw t}},t=v.current;return null==t||t.addEventListener("input",e),function(){null==t||t.removeEventListener("input",e);}}),[o,m]),useEffect((function(){var e=function(){if(c$1(v.current)){var e=function(){var t,r,n,a;h.current?(d.current.start=null!==(r=null===(t=v.current)||void 0===t?void 0:t.selectionStart)&&void 0!==r?r:0,d.current.end=null!==(a=null===(n=v.current)||void 0===n?void 0:n.selectionEnd)&&void 0!==a?a:0,d.current.requestID=requestAnimationFrame(e)):d.current.fallbackRequestID=requestAnimationFrame(e);};d.current.requestID=requestAnimationFrame(e);}};null!==v.current&&document.activeElement===v.current&&e();var t=v.current;return null==t||t.addEventListener("focus",e),function(){null==t||t.removeEventListener("focus",e);}}),[]),useEffect((function(){var e=function(){c$1(v.current)&&(cancelAnimationFrame(d.current.requestID),cancelAnimationFrame(d.current.fallbackRequestID),d.current.requestID=-1,d.current.fallbackRequestID=-1,d.current.cachedRequestID=-1);},t=v.current;return null==t||t.addEventListener("blur",e),function(){null==t||t.removeEventListener("blur",e);}}),[]),v}function p$1(e){var t=e.value,r=e.replacementChars,n=e.replacement,a=e.separate,l=r;return t.split("").reduce((function(e,t){var r,o=!Object.prototype.hasOwnProperty.call(n,t)&&(null===(r=n[l[0]])||void 0===r?void 0:r.test(t));return a&&t===l[0]||o?(l=l.slice(1),e+t):e}),"")}function v(e,t,r){var n=["[","]","\\","/","^","$",".","|","?","*","+","(",")","{","}"];return e.split("").reduce((function(e,a,l,o){var i=Object.prototype.hasOwnProperty.call(t,a),u=r?"(?!".concat(a,")"):"",c=e+(i?u+t[a].toString().slice(1,-1):n.includes(a)?"\\".concat(a):a);return l+1===o.length?"".concat(c,"$"):c}),"^")}function d(e,t){var r=t.mask,n=t.replacement,a=t.showMask,l=function(e,t){var r=t.mask,n=t.replacement,a=0;return r.split("").reduce((function(t,r){return Object.prototype.hasOwnProperty.call(n,r)&&void 0!==e[a]?t+e[a++]:t+r}),"")}(e,{mask:r,replacement:n}),o=function(e,t){var r=t.mask,n=t.replacement;return e.split("").map((function(e,t){return {type:Object.prototype.hasOwnProperty.call(n,e)?"replacement":e===r[t]?"mask":"input",value:e,index:t}}))}(l,{mask:r,replacement:n});if(!a){for(var i=-1,u=o.length-1;u>=0;u--)if("input"===o[u].type){i=o[u].index;break}l=l.slice(0,i+1);}var c=v(r,n,!1),s=v(r,n,!0);return {value:l,input:e,parts:o,pattern:c,isValid:RegExp(s).test(l)}}function f$1(e){var t=e.value,r=e.start,n=void 0===r?0:r,a=e.end,l=e.mask,o=e.replacement,i=e.separate,u=l.slice(n,a),c=t.slice(n,a);return u.split("").reduce((function(e,t,r){var n=Object.prototype.hasOwnProperty.call(o,t);return n&&void 0!==c[r]&&c[r]!==t?e+c[r]:n&&i?e+t:e}),"")}var h=function(e,t){var r="".concat(e,"\n\n").concat(t,"\n");return new Error(r)};var m=function(e){var t;return e.length>0?((t={})[e]=/./,t):{}};function y(n){var a=null!=n?n:{},l=a.mask,o=void 0===l?"":l,u=a.replacement,c=void 0===u?{}:u,v=a.showMask,y=void 0!==v&&v,g=a.separate,k=void 0!==g&&g,b=a.modify,w=a.onMask,E="string"==typeof c?m(c):c,O=useRef(null),_=JSON.stringify(E,(function(e,t){return t instanceof RegExp?t.toString():t})),I=useCallback((function(e){var t=e.controlled,r=e.initialValue;r=t||r?r:y?o:"";var n={mask:o,replacement:E,showMask:y,separate:k};return O.current={value:r,props:n,fallbackProps:n},{value:r}}),[]),S=useCallback((function(e){var t,r=e.inputType,n=e.added,a=e.previousValue,l=e.selectionStartRange,u=e.selectionEndRange;if(null===O.current)throw new i$1("The state has not been initialized.");O.current.value!==a?O.current.props=O.current.fallbackProps:O.current.fallbackProps=O.current.props;var c=f$1({value:a,end:l,mask:O.current.props.mask,replacement:O.current.props.replacement,separate:O.current.props.separate}),s=RegExp("[^".concat(Object.keys(O.current.props.replacement),"]"),"g"),v=O.current.props.mask.replace(s,"");if(c&&(c=p$1({value:c,replacementChars:v,replacement:O.current.props.replacement,separate:O.current.props.separate})),n&&(n=p$1({value:n,replacementChars:v.slice(c.length),replacement:O.current.props.replacement,separate:!1})),"insert"===r&&""===n)throw new i$1("The character does not match the key value of the `replacement` object.");var h=f$1({value:a,start:u,mask:O.current.props.mask,replacement:O.current.props.replacement,separate:O.current.props.separate});if(O.current.props.separate){var g=O.current.props.mask.slice(l,u).replace(s,""),w=g.length-n.length;w<0?h=h.slice(-w):w>0&&(h=g.slice(-w)+h);}h&&(h=p$1({value:h,replacementChars:v.slice(c.length+n.length),replacement:O.current.props.replacement,separate:O.current.props.separate}));var _=c+n+h,I=null!==(t=null==b?void 0:b(_))&&void 0!==t?t:{},S=I.mask,R=void 0===S?o:S,j=I.replacement,x=void 0===j?E:j,q=I.showMask,D=void 0===q?y:q,T=I.separate,P=void 0===T?k:T;"string"==typeof x&&(x=m(x));var V=d(_,{mask:R,replacement:x,showMask:D}),C=function(e){var t,r,n,a=e.inputType,l=e.added,o=e.beforeRange;e.afterRange;var i=e.value,u=e.parts,c=e.replacement,s=e.separate,p=u.filter((function(e){var t=e.type;return "input"===t||s&&"replacement"===t})),v=null===(t=p[o.length+l.length-1])||void 0===t?void 0:t.index,d=null===(r=p[o.length-1])||void 0===r?void 0:r.index,f=null===(n=p[o.length+l.length])||void 0===n?void 0:n.index;if("insert"===a){if(void 0!==v)return v+1;if(void 0!==f)return f;if(void 0!==d)return d+1}if("deleteForward"===a){if(void 0!==f)return f;if(void 0!==d)return d+1}if("deleteBackward"===a){if(void 0!==d)return d+1;if(void 0!==f)return f}var h=i.split("").findIndex((function(e){return Object.prototype.hasOwnProperty.call(c,e)}));return -1!==h?h:i.length}({inputType:r,added:n,beforeRange:c,afterRange:h,value:V.value,parts:V.parts,replacement:x,separate:P});return O.current.value=V.value,O.current.props={mask:R,replacement:x,showMask:D,separate:P},{value:V.value,selectionStart:C,selectionEnd:C,__detail:V}}),[o,_,y,k,b]),R=s$1({init:I,tracking:S,customInputEventType:"input-mask",customInputEventHandler:w});return function(e){var t=e.inputRef,n=e.mask,a=e.replacement;useEffect((function(){var e,r,l;if("production"!==process.env.NODE_ENV){var o=null!==(l=null===(r=null===(e=t.current)||void 0===e?void 0:e._wrapperState)||void 0===r?void 0:r.initialValue)&&void 0!==l?l:"";o.length>n.length&&console.error(h("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.",'Invalid value: "'.concat(o,'".')));var i=Object.keys(a).filter((function(e){return e.length>1}));i.length>0&&console.error(h("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.","Invalid keys: ".concat(i.join(", "),".")));var u=n.slice(0,o.length).split("").findIndex((function(e,t){var r=Object.prototype.hasOwnProperty.call(a,e),n=e!==o[t];return r?!!n&&!a[e].test(o[t]):n}));-1!==u&&console.error(h("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(u,"). Check the correctness of the initialized value in the specified property."),'Invalid value: "'.concat(o,'".')));}}),[]);}({inputRef:R,mask:o,replacement:E}),R}
|
|
3434
3434
|
|
|
3435
3435
|
var i,s={},c={};var u,f,l={};
|