nexaas-ui-components 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +871 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +104 -8
- package/dist/index.d.ts +104 -8
- package/dist/index.js +859 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var lodashNamespace = require('lodash');
|
|
|
14
14
|
var InputMask = require('react-input-mask');
|
|
15
15
|
var ReactModalNamespace = require('react-modal');
|
|
16
16
|
var reactTooltip = require('react-tooltip');
|
|
17
|
-
var
|
|
17
|
+
var Select = require('react-select');
|
|
18
18
|
var AsyncSelect = require('react-select/async');
|
|
19
19
|
var reactTable = require('@tanstack/react-table');
|
|
20
20
|
var matchSorterUtils = require('@tanstack/match-sorter-utils');
|
|
@@ -47,6 +47,7 @@ var IntlCurrencyInputRaw__default = /*#__PURE__*/_interopDefault(IntlCurrencyInp
|
|
|
47
47
|
var lodashNamespace__namespace = /*#__PURE__*/_interopNamespace(lodashNamespace);
|
|
48
48
|
var InputMask__default = /*#__PURE__*/_interopDefault(InputMask);
|
|
49
49
|
var ReactModalNamespace__namespace = /*#__PURE__*/_interopNamespace(ReactModalNamespace);
|
|
50
|
+
var Select__default = /*#__PURE__*/_interopDefault(Select);
|
|
50
51
|
var AsyncSelect__default = /*#__PURE__*/_interopDefault(AsyncSelect);
|
|
51
52
|
var Fuse__default = /*#__PURE__*/_interopDefault(Fuse);
|
|
52
53
|
|
|
@@ -2506,7 +2507,7 @@ var ModalDialog = ({
|
|
|
2506
2507
|
description,
|
|
2507
2508
|
children
|
|
2508
2509
|
}) => {
|
|
2509
|
-
const
|
|
2510
|
+
const customStyles6 = {
|
|
2510
2511
|
content: {
|
|
2511
2512
|
top: "50%",
|
|
2512
2513
|
left: "50%",
|
|
@@ -2537,10 +2538,10 @@ var ModalDialog = ({
|
|
|
2537
2538
|
ariaHideApp: false,
|
|
2538
2539
|
isOpen: open,
|
|
2539
2540
|
onRequestClose: onClose,
|
|
2540
|
-
style:
|
|
2541
|
+
style: customStyles6,
|
|
2541
2542
|
contentLabel: "Example Modal",
|
|
2542
2543
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx9__default.default(sizes3[size]), children: [
|
|
2543
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pb-
|
|
2544
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pb-[6px] border-b border-b-neutral-200 flex items-center justify-between", children: [
|
|
2544
2545
|
/* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "text-[24px] font-bold flex items-center gap-2", children: [
|
|
2545
2546
|
alertType && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx9__default.default([alertTypes[alertType]], "text-[30px]"), children: icon }),
|
|
2546
2547
|
title
|
|
@@ -2568,7 +2569,7 @@ var ModalDialog = ({
|
|
|
2568
2569
|
}
|
|
2569
2570
|
},
|
|
2570
2571
|
variant: "secondary",
|
|
2571
|
-
size: "
|
|
2572
|
+
size: "md",
|
|
2572
2573
|
children: "Cancelar"
|
|
2573
2574
|
}
|
|
2574
2575
|
),
|
|
@@ -2746,7 +2747,7 @@ var SelectField = ({
|
|
|
2746
2747
|
small = false
|
|
2747
2748
|
}) => {
|
|
2748
2749
|
var _a;
|
|
2749
|
-
const { Option, DropdownIndicator, ClearIndicator, SingleValue } =
|
|
2750
|
+
const { Option, DropdownIndicator, ClearIndicator, SingleValue } = Select.components;
|
|
2750
2751
|
const selectRef = React4.useRef(null);
|
|
2751
2752
|
const [inputValue, setInputValue] = React4.useState("");
|
|
2752
2753
|
const [loading, setLoading] = React4.useState(false);
|
|
@@ -2988,7 +2989,7 @@ var SelectField = ({
|
|
|
2988
2989
|
);
|
|
2989
2990
|
};
|
|
2990
2991
|
var ValueContainer = ({ children, ...props }) => {
|
|
2991
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2992
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Select.components.ValueContainer, { ...props, children });
|
|
2992
2993
|
};
|
|
2993
2994
|
|
|
2994
2995
|
// src/components/SelectFieldBip/SelectFieldBip.styles.tsx
|
|
@@ -3136,14 +3137,14 @@ var SelectFieldBip = ({
|
|
|
3136
3137
|
onErrorBip,
|
|
3137
3138
|
clearAfterSelect = true,
|
|
3138
3139
|
messages = {
|
|
3139
|
-
searching: "
|
|
3140
|
-
debounce: `
|
|
3141
|
-
emptyMessage: "
|
|
3142
|
-
loading: "
|
|
3140
|
+
searching: "Buscando...",
|
|
3141
|
+
debounce: `Digite pelo menos {debounce} caracteres`,
|
|
3142
|
+
emptyMessage: "Nenhuma op\xE7\xE3o encontrada",
|
|
3143
|
+
loading: "Carregando..."
|
|
3143
3144
|
}
|
|
3144
3145
|
}) => {
|
|
3145
3146
|
var _a;
|
|
3146
|
-
const { Option, SingleValue } =
|
|
3147
|
+
const { Option, SingleValue } = Select.components;
|
|
3147
3148
|
const selectRef = React4.useRef(null);
|
|
3148
3149
|
const [inputValue, setInputValue] = React4.useState("");
|
|
3149
3150
|
const [loading, setLoading] = React4.useState(false);
|
|
@@ -3375,7 +3376,7 @@ var SelectFieldBip = ({
|
|
|
3375
3376
|
);
|
|
3376
3377
|
};
|
|
3377
3378
|
var ValueContainer2 = ({ children, ...props }) => {
|
|
3378
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3379
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Select.components.ValueContainer, { ...props, children });
|
|
3379
3380
|
};
|
|
3380
3381
|
var Radio = ({
|
|
3381
3382
|
disabled,
|
|
@@ -5373,6 +5374,855 @@ function InfoIcon({
|
|
|
5373
5374
|
);
|
|
5374
5375
|
}
|
|
5375
5376
|
|
|
5377
|
+
// src/components/MultiSelect/MultiSelect.styles.tsx
|
|
5378
|
+
var customStyles3 = {
|
|
5379
|
+
indicatorSeparator: (provided, { hasValue }) => {
|
|
5380
|
+
return {
|
|
5381
|
+
...provided,
|
|
5382
|
+
marginTop: "-6px",
|
|
5383
|
+
backgroundColor: hasValue ? "var(--input)" : "transparent"
|
|
5384
|
+
};
|
|
5385
|
+
},
|
|
5386
|
+
input: (provided, state) => ({
|
|
5387
|
+
...provided,
|
|
5388
|
+
outline: "none",
|
|
5389
|
+
paddingLeft: state.selectProps.hasIcon ? "2.5rem" : "0px"
|
|
5390
|
+
}),
|
|
5391
|
+
clearIndicator: (provided) => ({
|
|
5392
|
+
...provided,
|
|
5393
|
+
color: "var(--label)",
|
|
5394
|
+
marginTop: "-6px",
|
|
5395
|
+
":hover": {
|
|
5396
|
+
color: "var(--label)"
|
|
5397
|
+
}
|
|
5398
|
+
}),
|
|
5399
|
+
dropdownIndicator: (provided, state) => ({
|
|
5400
|
+
...provided,
|
|
5401
|
+
color: "var(--paragraph)",
|
|
5402
|
+
display: state.selectProps.isTargeted ? "none" : "flex",
|
|
5403
|
+
paddingRight: "12px",
|
|
5404
|
+
marginTop: "-6px",
|
|
5405
|
+
":hover": {
|
|
5406
|
+
color: "var(--paragraph)"
|
|
5407
|
+
}
|
|
5408
|
+
}),
|
|
5409
|
+
menu: (provided) => ({
|
|
5410
|
+
...provided,
|
|
5411
|
+
marginTop: "4px",
|
|
5412
|
+
border: "1px solid var(--neutral-300)",
|
|
5413
|
+
boxShadow: "none",
|
|
5414
|
+
borderRadius: "8px",
|
|
5415
|
+
padding: "0px 8px",
|
|
5416
|
+
zIndex: 70,
|
|
5417
|
+
background: "white"
|
|
5418
|
+
}),
|
|
5419
|
+
singleValue: (base, state) => ({
|
|
5420
|
+
...base,
|
|
5421
|
+
color: state.data.value === "active" ? "#0EAF86" : "black",
|
|
5422
|
+
display: "flex"
|
|
5423
|
+
}),
|
|
5424
|
+
control: (provided, state) => ({
|
|
5425
|
+
...provided,
|
|
5426
|
+
cursor: "pointer",
|
|
5427
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-500)" : state.menuIsOpen ? "1px solid var(--blue-500)" : "1px solid var(--neutral-300)",
|
|
5428
|
+
boxShadow: "none",
|
|
5429
|
+
outline: "none",
|
|
5430
|
+
borderRadius: "0.5rem",
|
|
5431
|
+
paddingLeft: "0px",
|
|
5432
|
+
placeholder: " ",
|
|
5433
|
+
minHeight: "46px",
|
|
5434
|
+
alignItems: "end",
|
|
5435
|
+
paddingTop: "8px",
|
|
5436
|
+
":hover": {
|
|
5437
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-500)" : state.menuIsOpen ? "1px solid var(--blue-500)" : "1px solid var(--neutral-300)"
|
|
5438
|
+
}
|
|
5439
|
+
}),
|
|
5440
|
+
multiValue: (provided) => ({
|
|
5441
|
+
...provided,
|
|
5442
|
+
borderRadius: "20px",
|
|
5443
|
+
backgroundColor: "var(--neutral-100)",
|
|
5444
|
+
padding: "0px"
|
|
5445
|
+
}),
|
|
5446
|
+
multiValueLabel: (provided) => ({
|
|
5447
|
+
...provided,
|
|
5448
|
+
color: "var(--paragraph)",
|
|
5449
|
+
paddingTop: "2px",
|
|
5450
|
+
lineHeight: "16px"
|
|
5451
|
+
}),
|
|
5452
|
+
multiValueRemove: (provided) => ({
|
|
5453
|
+
...provided,
|
|
5454
|
+
color: "var(--neutral-400)",
|
|
5455
|
+
paddingRight: "6px",
|
|
5456
|
+
paddingLeft: "0px",
|
|
5457
|
+
":hover": {
|
|
5458
|
+
color: "var(--dangerous-500)"
|
|
5459
|
+
}
|
|
5460
|
+
}),
|
|
5461
|
+
option: (provided, state) => {
|
|
5462
|
+
let color = state.isSelected && !state.selectProps.isTargeted ? "white" : "var(--paragraph)";
|
|
5463
|
+
if (state.isDisabled) {
|
|
5464
|
+
color = "rgba(0,0,0,0.30)";
|
|
5465
|
+
}
|
|
5466
|
+
return {
|
|
5467
|
+
...provided,
|
|
5468
|
+
height: "44px",
|
|
5469
|
+
cursor: "pointer",
|
|
5470
|
+
borderRadius: "8px",
|
|
5471
|
+
margin: "4px 0px",
|
|
5472
|
+
backgroundColor: state.isSelected && !state.selectProps.isTargeted ? "var(--blue-500)" : state.isFocused ? "var(--neutral-200)" : "white",
|
|
5473
|
+
color,
|
|
5474
|
+
fontWeight: state.isSelected && !state.selectProps.isTargeted ? 700 : 400,
|
|
5475
|
+
"&:hover": {
|
|
5476
|
+
backgroundColor: state.isSelected && !state.selectProps.isTargeted ? "var(--blue-500)" : "var(--neutral-200)"
|
|
5477
|
+
},
|
|
5478
|
+
"&:active": {
|
|
5479
|
+
backgroundColor: "var(--blue-500)",
|
|
5480
|
+
color: "white",
|
|
5481
|
+
fontWeight: 700
|
|
5482
|
+
},
|
|
5483
|
+
"&:active svg": {
|
|
5484
|
+
color: "white",
|
|
5485
|
+
fontWeight: 700
|
|
5486
|
+
},
|
|
5487
|
+
" svg": {
|
|
5488
|
+
color: "white"
|
|
5489
|
+
}
|
|
5490
|
+
};
|
|
5491
|
+
},
|
|
5492
|
+
container: (provided) => ({
|
|
5493
|
+
...provided,
|
|
5494
|
+
border: "none",
|
|
5495
|
+
outline: "none",
|
|
5496
|
+
boxShadow: "none",
|
|
5497
|
+
padding: "none",
|
|
5498
|
+
margin: "none"
|
|
5499
|
+
})
|
|
5500
|
+
};
|
|
5501
|
+
var MultiSelect = ({
|
|
5502
|
+
name,
|
|
5503
|
+
options,
|
|
5504
|
+
label = "",
|
|
5505
|
+
error,
|
|
5506
|
+
defaultValue,
|
|
5507
|
+
control,
|
|
5508
|
+
isSearchable = false,
|
|
5509
|
+
required,
|
|
5510
|
+
disabled
|
|
5511
|
+
}) => {
|
|
5512
|
+
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
5513
|
+
const hasError = {
|
|
5514
|
+
hasError: fieldValidationMessages.some((item) => item !== void 0)
|
|
5515
|
+
};
|
|
5516
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5517
|
+
reactHookForm.Controller,
|
|
5518
|
+
{
|
|
5519
|
+
name,
|
|
5520
|
+
control,
|
|
5521
|
+
defaultValue,
|
|
5522
|
+
render: ({ field }) => {
|
|
5523
|
+
const { DropdownIndicator, Option } = Select.components;
|
|
5524
|
+
const DropdownIndicatorCustom = (props) => {
|
|
5525
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-down text-[20px]" }) });
|
|
5526
|
+
};
|
|
5527
|
+
const IconOption = (props) => {
|
|
5528
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Option, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5529
|
+
"div",
|
|
5530
|
+
{
|
|
5531
|
+
style: {
|
|
5532
|
+
display: "flex",
|
|
5533
|
+
alignItems: "center",
|
|
5534
|
+
justifyContent: "space-between",
|
|
5535
|
+
height: "100%"
|
|
5536
|
+
},
|
|
5537
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx9__default.default("text-p-md focus:text-white"), children: props.data.label })
|
|
5538
|
+
}
|
|
5539
|
+
) });
|
|
5540
|
+
};
|
|
5541
|
+
const NoOptionsMessage = () => {
|
|
5542
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-neutral-300", children: "Nenhum dado encontrado" });
|
|
5543
|
+
};
|
|
5544
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-full", id: "multiselect", children: [
|
|
5545
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5546
|
+
Select__default.default,
|
|
5547
|
+
{
|
|
5548
|
+
...field,
|
|
5549
|
+
...hasError,
|
|
5550
|
+
isDisabled: disabled,
|
|
5551
|
+
name: field.name,
|
|
5552
|
+
ref: field.ref,
|
|
5553
|
+
styles: customStyles3,
|
|
5554
|
+
placeholder: " ",
|
|
5555
|
+
isSearchable,
|
|
5556
|
+
options,
|
|
5557
|
+
isMulti: true,
|
|
5558
|
+
tabSelectsValue: true,
|
|
5559
|
+
components: {
|
|
5560
|
+
ValueContainer: ValueContainer3,
|
|
5561
|
+
Option: IconOption,
|
|
5562
|
+
NoOptionsMessage,
|
|
5563
|
+
DropdownIndicator: DropdownIndicatorCustom
|
|
5564
|
+
},
|
|
5565
|
+
isOptionDisabled: (option) => option.blocked,
|
|
5566
|
+
hideSelectedOptions: false,
|
|
5567
|
+
closeMenuOnSelect: false
|
|
5568
|
+
}
|
|
5569
|
+
),
|
|
5570
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5571
|
+
"span",
|
|
5572
|
+
{
|
|
5573
|
+
className: clsx9__default.default("text-label text-sm left-2.5", {
|
|
5574
|
+
[" scale-75 -translate-y-3 "]: field.value && field.value.length > 0,
|
|
5575
|
+
["text-dangerous-500"]: hasError.hasError
|
|
5576
|
+
}),
|
|
5577
|
+
children: [
|
|
5578
|
+
label,
|
|
5579
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-500", children: "\xA0*" })
|
|
5580
|
+
]
|
|
5581
|
+
}
|
|
5582
|
+
),
|
|
5583
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5584
|
+
"div",
|
|
5585
|
+
{
|
|
5586
|
+
className: "text-dangerous-500 text-xs -mt-[5px]",
|
|
5587
|
+
role: "alert",
|
|
5588
|
+
"aria-label": message,
|
|
5589
|
+
children: message
|
|
5590
|
+
},
|
|
5591
|
+
index
|
|
5592
|
+
))
|
|
5593
|
+
] });
|
|
5594
|
+
}
|
|
5595
|
+
}
|
|
5596
|
+
);
|
|
5597
|
+
};
|
|
5598
|
+
var ValueContainer3 = ({ children, ...props }) => {
|
|
5599
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Select.components.ValueContainer, { ...props, children });
|
|
5600
|
+
};
|
|
5601
|
+
|
|
5602
|
+
// src/components/InputTag/InputTag.styles.tsx
|
|
5603
|
+
var customStyles4 = {
|
|
5604
|
+
input: (provided) => ({
|
|
5605
|
+
...provided,
|
|
5606
|
+
outline: "none",
|
|
5607
|
+
height: "100%"
|
|
5608
|
+
}),
|
|
5609
|
+
indicatorSeparator: (provided) => ({
|
|
5610
|
+
...provided,
|
|
5611
|
+
backgroundColor: "transparent"
|
|
5612
|
+
}),
|
|
5613
|
+
clearIndicator: (provided) => ({
|
|
5614
|
+
...provided,
|
|
5615
|
+
color: "var(--label)",
|
|
5616
|
+
":hover": {
|
|
5617
|
+
color: "var(--label)"
|
|
5618
|
+
}
|
|
5619
|
+
}),
|
|
5620
|
+
dropdownIndicator: (provided) => ({
|
|
5621
|
+
...provided,
|
|
5622
|
+
display: "none"
|
|
5623
|
+
}),
|
|
5624
|
+
menu: (provided) => ({
|
|
5625
|
+
...provided,
|
|
5626
|
+
marginTop: "4px",
|
|
5627
|
+
border: "1px solid var(--neutral-300)",
|
|
5628
|
+
boxShadow: "none",
|
|
5629
|
+
borderRadius: "8px",
|
|
5630
|
+
padding: "0px 8px",
|
|
5631
|
+
zIndex: 30,
|
|
5632
|
+
background: "white"
|
|
5633
|
+
}),
|
|
5634
|
+
control: (provided, state) => {
|
|
5635
|
+
return {
|
|
5636
|
+
...provided,
|
|
5637
|
+
cursor: "pointer",
|
|
5638
|
+
paddingTop: state.selectProps.hasLabel ? "18px" : "0px",
|
|
5639
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-500)" : state.isFocused ? "1px solid var(--blue-500)" : "1px solid var(--neutral-300)",
|
|
5640
|
+
boxShadow: "none",
|
|
5641
|
+
outline: "none",
|
|
5642
|
+
borderRadius: "0.5rem",
|
|
5643
|
+
// height: "52px",
|
|
5644
|
+
// paddingLeft: '8px',
|
|
5645
|
+
placeholder: state.selectProps.hasLabel ? " " : state.selectProps.placeholder,
|
|
5646
|
+
alignItems: state.selectProps.hasLabel ? "end" : "center",
|
|
5647
|
+
":hover": {
|
|
5648
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-500)" : state.isFocused ? "1px solid var(--blue-500)" : "1px solid var(--neutral-300)"
|
|
5649
|
+
// height: "52px",
|
|
5650
|
+
},
|
|
5651
|
+
":focus-within": {
|
|
5652
|
+
// height: "52px",
|
|
5653
|
+
}
|
|
5654
|
+
};
|
|
5655
|
+
},
|
|
5656
|
+
multiValue: (provided) => ({
|
|
5657
|
+
...provided,
|
|
5658
|
+
borderRadius: "20px",
|
|
5659
|
+
backgroundColor: "var(--neutral-100)",
|
|
5660
|
+
padding: "0px 6px"
|
|
5661
|
+
}),
|
|
5662
|
+
multiValueLabel: (provided) => ({
|
|
5663
|
+
...provided,
|
|
5664
|
+
color: "var(--paragraph)"
|
|
5665
|
+
}),
|
|
5666
|
+
multiValueRemove: (provided) => ({
|
|
5667
|
+
...provided,
|
|
5668
|
+
color: "var(--neutral-400)",
|
|
5669
|
+
":hover": {
|
|
5670
|
+
color: "var(--dangerous-500)"
|
|
5671
|
+
}
|
|
5672
|
+
}),
|
|
5673
|
+
container: (provided) => ({
|
|
5674
|
+
...provided,
|
|
5675
|
+
border: "none",
|
|
5676
|
+
outline: "none",
|
|
5677
|
+
boxShadow: "none",
|
|
5678
|
+
padding: "none",
|
|
5679
|
+
margin: "none"
|
|
5680
|
+
})
|
|
5681
|
+
};
|
|
5682
|
+
var InputTag = ({
|
|
5683
|
+
name,
|
|
5684
|
+
label = "",
|
|
5685
|
+
error,
|
|
5686
|
+
defaultValue,
|
|
5687
|
+
control,
|
|
5688
|
+
required,
|
|
5689
|
+
placeholder,
|
|
5690
|
+
blockSpaces = false
|
|
5691
|
+
}) => {
|
|
5692
|
+
const [inputValue, setInputValue] = React4.useState("");
|
|
5693
|
+
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
5694
|
+
const hasError = {
|
|
5695
|
+
hasError: fieldValidationMessages.some((item) => item !== void 0)
|
|
5696
|
+
};
|
|
5697
|
+
const removeSpaces = (value) => {
|
|
5698
|
+
return value == null ? void 0 : value.replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
|
|
5699
|
+
};
|
|
5700
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5701
|
+
reactHookForm.Controller,
|
|
5702
|
+
{
|
|
5703
|
+
name,
|
|
5704
|
+
control,
|
|
5705
|
+
defaultValue,
|
|
5706
|
+
render: ({ field }) => {
|
|
5707
|
+
const handleKeyDown = (event) => {
|
|
5708
|
+
if (!inputValue || ((field == null ? void 0 : field.value) || []).find((item) => (item == null ? void 0 : item.value) === inputValue))
|
|
5709
|
+
return;
|
|
5710
|
+
switch (event.key) {
|
|
5711
|
+
case "Enter":
|
|
5712
|
+
case "Tab":
|
|
5713
|
+
field.onChange([
|
|
5714
|
+
...(field == null ? void 0 : field.value) || [],
|
|
5715
|
+
{
|
|
5716
|
+
label: blockSpaces ? removeSpaces(inputValue) : inputValue,
|
|
5717
|
+
value: blockSpaces ? removeSpaces(inputValue) : inputValue
|
|
5718
|
+
}
|
|
5719
|
+
]);
|
|
5720
|
+
setInputValue("");
|
|
5721
|
+
event.preventDefault();
|
|
5722
|
+
}
|
|
5723
|
+
};
|
|
5724
|
+
const hasLabel = {
|
|
5725
|
+
hasLabel: (label == null ? void 0 : label.length) > 0
|
|
5726
|
+
};
|
|
5727
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5728
|
+
"div",
|
|
5729
|
+
{
|
|
5730
|
+
className: `relative ${label ? "with-label" : ""}`,
|
|
5731
|
+
id: "inputtag",
|
|
5732
|
+
children: [
|
|
5733
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5734
|
+
Select__default.default,
|
|
5735
|
+
{
|
|
5736
|
+
...hasError,
|
|
5737
|
+
...hasLabel,
|
|
5738
|
+
...{ placeholder },
|
|
5739
|
+
...field,
|
|
5740
|
+
styles: customStyles4,
|
|
5741
|
+
menuIsOpen: false,
|
|
5742
|
+
placeholder: hasLabel.hasLabel ? " " : placeholder,
|
|
5743
|
+
isMulti: true,
|
|
5744
|
+
tabSelectsValue: true,
|
|
5745
|
+
onKeyDown: handleKeyDown,
|
|
5746
|
+
isClearable: false,
|
|
5747
|
+
inputValue,
|
|
5748
|
+
onInputChange: (newValue) => setInputValue(newValue),
|
|
5749
|
+
isOptionDisabled: (option) => option.blocked
|
|
5750
|
+
}
|
|
5751
|
+
),
|
|
5752
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5753
|
+
"span",
|
|
5754
|
+
{
|
|
5755
|
+
className: clsx9__default.default("text-label text-sm left-2.5", {
|
|
5756
|
+
[" scale-75 -translate-y-3 "]: field.value && field.value.length > 0,
|
|
5757
|
+
["text-dangerous-500"]: hasError.hasError
|
|
5758
|
+
}),
|
|
5759
|
+
children: [
|
|
5760
|
+
label,
|
|
5761
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-500", children: "\xA0*" })
|
|
5762
|
+
]
|
|
5763
|
+
}
|
|
5764
|
+
),
|
|
5765
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5766
|
+
"div",
|
|
5767
|
+
{
|
|
5768
|
+
className: "text-dangerous-500 text-xs mt-[2px]",
|
|
5769
|
+
role: "alert",
|
|
5770
|
+
"aria-label": message,
|
|
5771
|
+
children: message
|
|
5772
|
+
},
|
|
5773
|
+
index
|
|
5774
|
+
))
|
|
5775
|
+
]
|
|
5776
|
+
}
|
|
5777
|
+
);
|
|
5778
|
+
}
|
|
5779
|
+
}
|
|
5780
|
+
);
|
|
5781
|
+
};
|
|
5782
|
+
var ValueContainer4 = ({ children, ...props }) => {
|
|
5783
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Select.components.ValueContainer, { ...props, children });
|
|
5784
|
+
};
|
|
5785
|
+
InputTag.displayName = "InputTag";
|
|
5786
|
+
|
|
5787
|
+
// src/components/MultiSelectBottom/MultiSelectBottom.styles.tsx
|
|
5788
|
+
var customStyles5 = {
|
|
5789
|
+
indicatorSeparator: (provided, { hasValue }) => {
|
|
5790
|
+
return {
|
|
5791
|
+
...provided,
|
|
5792
|
+
display: "none"
|
|
5793
|
+
};
|
|
5794
|
+
},
|
|
5795
|
+
input: (provided, state) => ({
|
|
5796
|
+
...provided,
|
|
5797
|
+
outline: "none",
|
|
5798
|
+
paddingLeft: state.selectProps.hasIcon ? "2.5rem" : "0px"
|
|
5799
|
+
}),
|
|
5800
|
+
clearIndicator: (provided) => ({
|
|
5801
|
+
...provided,
|
|
5802
|
+
display: "none"
|
|
5803
|
+
}),
|
|
5804
|
+
dropdownIndicator: (provided, state) => ({
|
|
5805
|
+
...provided,
|
|
5806
|
+
color: "var(--paragraph)",
|
|
5807
|
+
display: state.selectProps.isTargeted ? "none" : "flex",
|
|
5808
|
+
paddingRight: "12px",
|
|
5809
|
+
":hover": {
|
|
5810
|
+
color: "var(--paragraph)"
|
|
5811
|
+
}
|
|
5812
|
+
}),
|
|
5813
|
+
menu: (provided) => ({
|
|
5814
|
+
...provided,
|
|
5815
|
+
marginTop: "4px",
|
|
5816
|
+
border: "1px solid var(--neutral-300)",
|
|
5817
|
+
boxShadow: "none",
|
|
5818
|
+
borderRadius: "8px",
|
|
5819
|
+
padding: "0px 8px",
|
|
5820
|
+
zIndex: 70,
|
|
5821
|
+
background: "white"
|
|
5822
|
+
}),
|
|
5823
|
+
singleValue: (base, state) => ({
|
|
5824
|
+
...base,
|
|
5825
|
+
color: state.data.value === "active" ? "#0EAF86" : "black",
|
|
5826
|
+
display: "flex"
|
|
5827
|
+
}),
|
|
5828
|
+
control: (provided, state) => ({
|
|
5829
|
+
...provided,
|
|
5830
|
+
cursor: "pointer",
|
|
5831
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-500)" : state.menuIsOpen ? "1px solid var(--blue-500)" : "1px solid var(--neutral-300)",
|
|
5832
|
+
boxShadow: "none",
|
|
5833
|
+
outline: "none",
|
|
5834
|
+
borderRadius: "0.5rem",
|
|
5835
|
+
paddingLeft: "8px",
|
|
5836
|
+
placeholder: " ",
|
|
5837
|
+
height: "46px",
|
|
5838
|
+
alignItems: "end",
|
|
5839
|
+
":hover": {
|
|
5840
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-500)" : state.menuIsOpen ? "1px solid var(--blue-500)" : "1px solid var(--neutral-300)"
|
|
5841
|
+
}
|
|
5842
|
+
}),
|
|
5843
|
+
multiValue: (provided) => ({
|
|
5844
|
+
...provided,
|
|
5845
|
+
borderRadius: "20px",
|
|
5846
|
+
backgroundColor: "var(--neutral-100)",
|
|
5847
|
+
padding: "0px 0px",
|
|
5848
|
+
display: "none"
|
|
5849
|
+
}),
|
|
5850
|
+
multiValueLabel: (provided) => ({
|
|
5851
|
+
...provided,
|
|
5852
|
+
color: "var(--paragraph)",
|
|
5853
|
+
paddingTop: "6px"
|
|
5854
|
+
}),
|
|
5855
|
+
multiValueRemove: (provided) => ({
|
|
5856
|
+
...provided,
|
|
5857
|
+
paddingRight: "6px",
|
|
5858
|
+
paddingLeft: "0px",
|
|
5859
|
+
color: "var(--neutral-400)",
|
|
5860
|
+
":hover": {
|
|
5861
|
+
color: "var(--dangerous-500)"
|
|
5862
|
+
}
|
|
5863
|
+
}),
|
|
5864
|
+
option: (provided, state) => {
|
|
5865
|
+
let color = state.isSelected && !state.selectProps.isTargeted ? "white" : "var(--paragraph)";
|
|
5866
|
+
if (state.isDisabled) {
|
|
5867
|
+
color = "rgba(0,0,0,0.30)";
|
|
5868
|
+
}
|
|
5869
|
+
return {
|
|
5870
|
+
...provided,
|
|
5871
|
+
height: "44px",
|
|
5872
|
+
cursor: "pointer",
|
|
5873
|
+
borderRadius: "8px",
|
|
5874
|
+
margin: "4px 0px",
|
|
5875
|
+
backgroundColor: state.isSelected && !state.selectProps.isTargeted ? "var(--blue-500)" : state.isFocused ? "var(--neutral-200)" : "white",
|
|
5876
|
+
color,
|
|
5877
|
+
fontWeight: state.isSelected && !state.selectProps.isTargeted ? 700 : 400,
|
|
5878
|
+
"&:hover": {
|
|
5879
|
+
backgroundColor: state.isSelected && !state.selectProps.isTargeted ? "var(--blue-500)" : "var(--neutral-200)"
|
|
5880
|
+
},
|
|
5881
|
+
"&:active": {
|
|
5882
|
+
backgroundColor: "var(--blue-500)",
|
|
5883
|
+
color: "white",
|
|
5884
|
+
fontWeight: 700
|
|
5885
|
+
},
|
|
5886
|
+
"&:active svg": {
|
|
5887
|
+
color: "white",
|
|
5888
|
+
fontWeight: 700
|
|
5889
|
+
},
|
|
5890
|
+
" svg": {
|
|
5891
|
+
color: "white"
|
|
5892
|
+
}
|
|
5893
|
+
};
|
|
5894
|
+
},
|
|
5895
|
+
container: (provided) => ({
|
|
5896
|
+
...provided,
|
|
5897
|
+
border: "none",
|
|
5898
|
+
outline: "none",
|
|
5899
|
+
boxShadow: "none",
|
|
5900
|
+
padding: "none",
|
|
5901
|
+
margin: "none"
|
|
5902
|
+
}),
|
|
5903
|
+
valueContainer: (provided) => ({
|
|
5904
|
+
...provided,
|
|
5905
|
+
padding: "2px 0px"
|
|
5906
|
+
})
|
|
5907
|
+
};
|
|
5908
|
+
var MultiSelectBottom = ({
|
|
5909
|
+
name,
|
|
5910
|
+
options,
|
|
5911
|
+
label = "",
|
|
5912
|
+
error,
|
|
5913
|
+
defaultValue,
|
|
5914
|
+
control,
|
|
5915
|
+
isSearchable = false,
|
|
5916
|
+
required,
|
|
5917
|
+
disabled,
|
|
5918
|
+
emptyMessage,
|
|
5919
|
+
filterOptions,
|
|
5920
|
+
debounce: debounce2 = 0
|
|
5921
|
+
}) => {
|
|
5922
|
+
const [loading, setLoading] = React4.useState(false);
|
|
5923
|
+
const [optionsList, setOptionsList] = React4.useState(() => options || []);
|
|
5924
|
+
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
5925
|
+
const hasError = {
|
|
5926
|
+
hasError: fieldValidationMessages.some((item) => item !== void 0)
|
|
5927
|
+
};
|
|
5928
|
+
({
|
|
5929
|
+
hasLabel: (label == null ? void 0 : label.length) > 0
|
|
5930
|
+
});
|
|
5931
|
+
const loadOptions = (inputValue) => {
|
|
5932
|
+
setLoading(true);
|
|
5933
|
+
if (isSearchable && filterOptions) {
|
|
5934
|
+
if (!debounce2 || debounce2 && inputValue.length >= debounce2) {
|
|
5935
|
+
const result = filterOptions(inputValue);
|
|
5936
|
+
setLoading(false);
|
|
5937
|
+
return result;
|
|
5938
|
+
}
|
|
5939
|
+
} else {
|
|
5940
|
+
setOptionsList(options);
|
|
5941
|
+
}
|
|
5942
|
+
};
|
|
5943
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5944
|
+
reactHookForm.Controller,
|
|
5945
|
+
{
|
|
5946
|
+
name,
|
|
5947
|
+
control,
|
|
5948
|
+
defaultValue,
|
|
5949
|
+
render: ({ field }) => {
|
|
5950
|
+
var _a, _b;
|
|
5951
|
+
const { DropdownIndicator, Option } = Select.components;
|
|
5952
|
+
const DropdownIndicatorCustom = (props) => {
|
|
5953
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-down text-[20px]" }) });
|
|
5954
|
+
};
|
|
5955
|
+
const NoOptionsMessage = (props) => {
|
|
5956
|
+
var _a2;
|
|
5957
|
+
if (props.selectProps.inputValue.length == 0 && debounce2 > 0 || debounce2 > 0 && props.selectProps.inputValue.length < debounce2) {
|
|
5958
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 text-neutral-300", children: [
|
|
5959
|
+
"Digite ",
|
|
5960
|
+
debounce2,
|
|
5961
|
+
" ou mais caracteres para pesquisar"
|
|
5962
|
+
] });
|
|
5963
|
+
} else if (props.selectProps.inputValue.length > 0 && ((_a2 = props == null ? void 0 : props.options) == null ? void 0 : _a2.length) == 0) {
|
|
5964
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-neutral-300", children: "Nenhum dado encontrado" });
|
|
5965
|
+
}
|
|
5966
|
+
};
|
|
5967
|
+
const IconOption = (props) => {
|
|
5968
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Option, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5969
|
+
"div",
|
|
5970
|
+
{
|
|
5971
|
+
style: {
|
|
5972
|
+
display: "flex",
|
|
5973
|
+
alignItems: "center",
|
|
5974
|
+
justifyContent: "space-between",
|
|
5975
|
+
height: "100%"
|
|
5976
|
+
},
|
|
5977
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx9__default.default("text-p-md focus:text-white"), children: props.data.label })
|
|
5978
|
+
}
|
|
5979
|
+
) });
|
|
5980
|
+
};
|
|
5981
|
+
const LoadingMessage = (props) => {
|
|
5982
|
+
if (!debounce2 || debounce2 && props.selectProps.inputValue.length >= debounce2) {
|
|
5983
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5984
|
+
"div",
|
|
5985
|
+
{
|
|
5986
|
+
...props.innerProps,
|
|
5987
|
+
className: "flex items-center gap-[6px] p-2",
|
|
5988
|
+
children: [
|
|
5989
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5990
|
+
"img",
|
|
5991
|
+
{
|
|
5992
|
+
className: "animate-spin ",
|
|
5993
|
+
src: "/spinner.svg",
|
|
5994
|
+
alt: "circle",
|
|
5995
|
+
width: 16,
|
|
5996
|
+
height: 16
|
|
5997
|
+
}
|
|
5998
|
+
),
|
|
5999
|
+
"Buscando..."
|
|
6000
|
+
]
|
|
6001
|
+
}
|
|
6002
|
+
);
|
|
6003
|
+
} else if (debounce2 && props.selectProps.inputValue.length < debounce2) {
|
|
6004
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 text-neutral-300", children: [
|
|
6005
|
+
"Digite ",
|
|
6006
|
+
debounce2,
|
|
6007
|
+
" ou mais caracteres para pesquisar"
|
|
6008
|
+
] });
|
|
6009
|
+
}
|
|
6010
|
+
};
|
|
6011
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-full", id: "multiselectbottom", children: [
|
|
6012
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6013
|
+
AsyncSelect__default.default,
|
|
6014
|
+
{
|
|
6015
|
+
...field,
|
|
6016
|
+
...hasError,
|
|
6017
|
+
isDisabled: disabled,
|
|
6018
|
+
name: field.name,
|
|
6019
|
+
ref: field.ref,
|
|
6020
|
+
styles: customStyles5,
|
|
6021
|
+
placeholder: " ",
|
|
6022
|
+
isSearchable,
|
|
6023
|
+
options: optionsList,
|
|
6024
|
+
isMulti: true,
|
|
6025
|
+
defaultOptions: debounce2 > 0 ? false : options ? optionsList : true,
|
|
6026
|
+
loadOptions,
|
|
6027
|
+
tabSelectsValue: true,
|
|
6028
|
+
components: {
|
|
6029
|
+
ValueContainer: ValueContainer5,
|
|
6030
|
+
Option: IconOption,
|
|
6031
|
+
NoOptionsMessage,
|
|
6032
|
+
LoadingMessage,
|
|
6033
|
+
DropdownIndicator: DropdownIndicatorCustom
|
|
6034
|
+
},
|
|
6035
|
+
isOptionDisabled: (option) => option.blocked,
|
|
6036
|
+
hideSelectedOptions: false,
|
|
6037
|
+
closeMenuOnSelect: false,
|
|
6038
|
+
backspaceRemovesValue: false
|
|
6039
|
+
}
|
|
6040
|
+
),
|
|
6041
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6042
|
+
"span",
|
|
6043
|
+
{
|
|
6044
|
+
className: clsx9__default.default("text-label text-sm left-2.5", {
|
|
6045
|
+
["text-dangerous-500"]: hasError.hasError
|
|
6046
|
+
}),
|
|
6047
|
+
children: [
|
|
6048
|
+
label,
|
|
6049
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-500", children: "\xA0*" })
|
|
6050
|
+
]
|
|
6051
|
+
}
|
|
6052
|
+
),
|
|
6053
|
+
fieldValidationMessages == null ? void 0 : fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6054
|
+
"div",
|
|
6055
|
+
{
|
|
6056
|
+
className: "text-dangerous-500 text-xs mt-[3px]",
|
|
6057
|
+
role: "alert",
|
|
6058
|
+
"aria-label": message,
|
|
6059
|
+
children: message
|
|
6060
|
+
},
|
|
6061
|
+
index
|
|
6062
|
+
)),
|
|
6063
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-x-2 gap-y-1 flex-wrap", children: ((_a = field == null ? void 0 : field.value) == null ? void 0 : _a.length) > 0 ? (_b = field == null ? void 0 : field.value) == null ? void 0 : _b.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-p-sm bg-neutral-100 rounded-[20px] py-2 px-3 flex items-center justify-between mt-3", children: [
|
|
6064
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: item.label }),
|
|
6065
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6066
|
+
"button",
|
|
6067
|
+
{
|
|
6068
|
+
type: "button",
|
|
6069
|
+
onClick: () => {
|
|
6070
|
+
const copy = [...field.value];
|
|
6071
|
+
const index = copy.findIndex(
|
|
6072
|
+
(opt) => opt.value == item.value
|
|
6073
|
+
);
|
|
6074
|
+
copy.splice(index, 1);
|
|
6075
|
+
field.onChange(copy);
|
|
6076
|
+
},
|
|
6077
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-times text-sm text-neutral-400" })
|
|
6078
|
+
}
|
|
6079
|
+
)
|
|
6080
|
+
] })) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-p-md text-label pt-2 pl-2", children: emptyMessage || "Nenhuma op\xE7\xE3o selecionada" }) })
|
|
6081
|
+
] });
|
|
6082
|
+
}
|
|
6083
|
+
}
|
|
6084
|
+
);
|
|
6085
|
+
};
|
|
6086
|
+
var ValueContainer5 = ({ children, ...props }) => {
|
|
6087
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Select.components.ValueContainer, { ...props, children });
|
|
6088
|
+
};
|
|
6089
|
+
MultiSelectBottom.displayName = "MultiSelectBottom";
|
|
6090
|
+
function PageBox(props) {
|
|
6091
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-5 px-4 border border-neutral-200 rounded-lg", children: [
|
|
6092
|
+
(props == null ? void 0 : props.title) && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-t-xs font-bold text-title mb-4", children: props.title }),
|
|
6093
|
+
props == null ? void 0 : props.children
|
|
6094
|
+
] });
|
|
6095
|
+
}
|
|
6096
|
+
var PageHeader = ({
|
|
6097
|
+
title,
|
|
6098
|
+
breadcrumbs,
|
|
6099
|
+
children,
|
|
6100
|
+
description
|
|
6101
|
+
}) => {
|
|
6102
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row place-content-between font-sans pb-4 w-full", children: [
|
|
6103
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
6104
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center text-p-lg text-label", children: breadcrumbs && breadcrumbs.map((breadcrumb, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: breadcrumb.link ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6105
|
+
"a",
|
|
6106
|
+
{
|
|
6107
|
+
href: breadcrumb.link,
|
|
6108
|
+
className: "hover:no-underline hover:text-paragraph",
|
|
6109
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "cursor-pointer flex items-center", children: [
|
|
6110
|
+
index > 0 && /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-right" }),
|
|
6111
|
+
breadcrumb.name
|
|
6112
|
+
] })
|
|
6113
|
+
}
|
|
6114
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
6115
|
+
/* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-right" }),
|
|
6116
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6117
|
+
"span",
|
|
6118
|
+
{
|
|
6119
|
+
className: index === breadcrumbs.length - 1 ? "text-paragraph" : "",
|
|
6120
|
+
children: breadcrumb.name
|
|
6121
|
+
}
|
|
6122
|
+
)
|
|
6123
|
+
] }) }, index)) }),
|
|
6124
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6125
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-t-md text-title font-bold mb-1", children: title }),
|
|
6126
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-p-lg text-label", children: description })
|
|
6127
|
+
] })
|
|
6128
|
+
] }),
|
|
6129
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-6 md:justify-end flex-1 mt-2 md:mt-0", children })
|
|
6130
|
+
] });
|
|
6131
|
+
};
|
|
6132
|
+
var variants4 = {
|
|
6133
|
+
primary: {
|
|
6134
|
+
bar: "bg-gradient-to-b from-blue-start to-blue-end",
|
|
6135
|
+
text: "text-blue-500"
|
|
6136
|
+
},
|
|
6137
|
+
success: {
|
|
6138
|
+
bar: "bg-gradient-to-b from-success-start to-success-end",
|
|
6139
|
+
text: "text-success-500"
|
|
6140
|
+
},
|
|
6141
|
+
danger: {
|
|
6142
|
+
bar: "bg-gradient-to-b from-danger-start to-danger-end",
|
|
6143
|
+
text: "text-dangerous-600"
|
|
6144
|
+
},
|
|
6145
|
+
info: {
|
|
6146
|
+
bar: "bg-gradient-to-b from-blue-start to-blue-end",
|
|
6147
|
+
text: "text-blue-500"
|
|
6148
|
+
}
|
|
6149
|
+
};
|
|
6150
|
+
var ProgressBar = ({
|
|
6151
|
+
percentage,
|
|
6152
|
+
variant = "primary",
|
|
6153
|
+
status
|
|
6154
|
+
}) => {
|
|
6155
|
+
const [barPercentage, setBarPercentage] = React4.useState(() => fixPercentage());
|
|
6156
|
+
function fixPercentage() {
|
|
6157
|
+
if (percentage > 100) {
|
|
6158
|
+
return 100;
|
|
6159
|
+
} else {
|
|
6160
|
+
return percentage;
|
|
6161
|
+
}
|
|
6162
|
+
}
|
|
6163
|
+
React4.useEffect(() => {
|
|
6164
|
+
setBarPercentage(fixPercentage());
|
|
6165
|
+
}, [percentage]);
|
|
6166
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-[2px] min-w-[170px]", children: [
|
|
6167
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full p-[1px] border border-neutral-300 rounded-[15px]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6168
|
+
"div",
|
|
6169
|
+
{
|
|
6170
|
+
className: clsx9__default.default(variants4[variant].bar, "h-[14px] rounded-[15px]"),
|
|
6171
|
+
style: { width: `${barPercentage}%` }
|
|
6172
|
+
}
|
|
6173
|
+
) }),
|
|
6174
|
+
status && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: clsx9__default.default(variants4[variant].text, "text-blue-500 text-xs"), children: [
|
|
6175
|
+
status,
|
|
6176
|
+
percentage && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-bold", children: [
|
|
6177
|
+
"\xA0- ",
|
|
6178
|
+
percentage,
|
|
6179
|
+
" %"
|
|
6180
|
+
] })
|
|
6181
|
+
] })
|
|
6182
|
+
] });
|
|
6183
|
+
};
|
|
6184
|
+
function SimpleTab({ tabs, onClick }) {
|
|
6185
|
+
const [currentTab, setCurrentTab] = React4.useState(0);
|
|
6186
|
+
function isCurrentTab(index) {
|
|
6187
|
+
return index === currentTab;
|
|
6188
|
+
}
|
|
6189
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full flex-1", children: [
|
|
6190
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-neutral-200", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mb-px flex", "aria-label": "Tabs", children: tabs.filter((item) => !item.hidden).map((tab, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6191
|
+
"nav",
|
|
6192
|
+
{
|
|
6193
|
+
className: clsx9__default.default(
|
|
6194
|
+
isCurrentTab(index) ? "border-rose-700 text-rose-700 font-bold hover:border-rose-800 hover:text-rose-800 hover:font-bold" : "border-transparent text-label hover:text-paragraph",
|
|
6195
|
+
"group cursor-pointer flex items-center border-b-2 py-1 px-4 text-base"
|
|
6196
|
+
),
|
|
6197
|
+
"aria-current": isCurrentTab(index) ? "page" : void 0,
|
|
6198
|
+
onClick: () => {
|
|
6199
|
+
setCurrentTab(index);
|
|
6200
|
+
if (onClick) {
|
|
6201
|
+
onClick(tabs[index]);
|
|
6202
|
+
}
|
|
6203
|
+
},
|
|
6204
|
+
children: [
|
|
6205
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6206
|
+
"div",
|
|
6207
|
+
{
|
|
6208
|
+
id: "tab-icon",
|
|
6209
|
+
className: clsx9__default.default(
|
|
6210
|
+
isCurrentTab(index) ? "text-rose-700 group-hover:text-rose-800" : "text-label group-hover:text-paragraph",
|
|
6211
|
+
{ "-ml-0.5 mr-2": tab.icon }
|
|
6212
|
+
),
|
|
6213
|
+
"aria-hidden": "true",
|
|
6214
|
+
children: tab.icon
|
|
6215
|
+
}
|
|
6216
|
+
),
|
|
6217
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tab.label })
|
|
6218
|
+
]
|
|
6219
|
+
},
|
|
6220
|
+
tab.key
|
|
6221
|
+
)) }) }),
|
|
6222
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full flex-1 flex flex-col", children: tabs[currentTab].children })
|
|
6223
|
+
] }) });
|
|
6224
|
+
}
|
|
6225
|
+
|
|
5376
6226
|
exports.Accordion = Accordion;
|
|
5377
6227
|
exports.Badge = Badge;
|
|
5378
6228
|
exports.Button = Button;
|
|
@@ -5394,17 +6244,24 @@ exports.Input = Input;
|
|
|
5394
6244
|
exports.InputMoney = InputMoney;
|
|
5395
6245
|
exports.InputNumber = InputNumber;
|
|
5396
6246
|
exports.InputPercentage = InputPercentage;
|
|
6247
|
+
exports.InputTag = InputTag;
|
|
5397
6248
|
exports.Item = Item;
|
|
5398
6249
|
exports.Logo = Logo;
|
|
5399
6250
|
exports.MaskedInput = MaskedInput;
|
|
5400
6251
|
exports.Menu = Menu;
|
|
5401
6252
|
exports.ModalDialog = ModalDialog;
|
|
6253
|
+
exports.MultiSelect = MultiSelect;
|
|
6254
|
+
exports.MultiSelectBottom = MultiSelectBottom;
|
|
6255
|
+
exports.PageBox = PageBox;
|
|
6256
|
+
exports.PageHeader = PageHeader;
|
|
5402
6257
|
exports.PaginationSelect = PaginationSelect;
|
|
5403
6258
|
exports.Popover = Popover3;
|
|
6259
|
+
exports.ProgressBar = ProgressBar;
|
|
5404
6260
|
exports.Radio = Radio;
|
|
5405
6261
|
exports.RocketIcon = RocketIcon;
|
|
5406
6262
|
exports.SelectField = SelectField;
|
|
5407
6263
|
exports.SelectFieldBip = SelectFieldBip;
|
|
6264
|
+
exports.SimpleTab = SimpleTab;
|
|
5408
6265
|
exports.SpinnerIcon = SpinnerIcon;
|
|
5409
6266
|
exports.Table = Table;
|
|
5410
6267
|
exports.TableBody = TableBody;
|
|
@@ -5415,7 +6272,7 @@ exports.TableHead = TableHead;
|
|
|
5415
6272
|
exports.TableHeader = TableHeader;
|
|
5416
6273
|
exports.TableRow = TableRow;
|
|
5417
6274
|
exports.Toggle = Toggle;
|
|
5418
|
-
exports.ValueContainer =
|
|
6275
|
+
exports.ValueContainer = ValueContainer4;
|
|
5419
6276
|
exports.sizes = sizes2;
|
|
5420
6277
|
//# sourceMappingURL=index.cjs.map
|
|
5421
6278
|
//# sourceMappingURL=index.cjs.map
|