nexaas-ui-components 1.0.73 → 1.0.77

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.js CHANGED
@@ -92,7 +92,7 @@ var variants = {
92
92
  text: "shadow-button text-white bg-gradient-to-b from-success-start to-success-end hover:from-[#40f09b] hover:to-[#28c67a] active:from-success-600 active:to-success-600 disabled:opacity-50 disabled:from-success-start disabled:to-success-end active:shadow-none"
93
93
  },
94
94
  successOutline: {
95
- text: "active:shadow-none shadow-green-sm text-green-500 font-bold bg-surface border-[0.5px] border-green-500 hover:bg-green-100 active:bg-green-100 active:text-white disabled:opacity-50 disabled:bg-surface disabled:text-green-500"
95
+ text: "active:shadow-none shadow-green-sm text-green-500 font-bold bg-surface border-[0.5px] border-green-500 hover:bg-green-100 active:bg-green-500 active:text-white disabled:opacity-50 disabled:bg-surface disabled:text-green-500"
96
96
  },
97
97
  warn: {
98
98
  text: "shadow-button text-white bg-gradient-to-b from-warning-start to-warning-end hover:from-[#febd5b] hover:to-[#f4a52e] active:from-warning-600 active:to-warning-600 disabled:opacity-50 disabled:from-warning-start disabled:to-warning-end active:shadow-none"
@@ -160,7 +160,7 @@ var Button = ({
160
160
  useEffect(() => {
161
161
  if (!hotkey || !props.onClick) return;
162
162
  const handleKeyDown = (event) => {
163
- var _a;
163
+ var _a, _b;
164
164
  if (props.disabled || props.loading) return;
165
165
  const keys = hotkey.toLowerCase().split("+").map((k) => k.trim());
166
166
  const primaryKey = keys.pop();
@@ -169,10 +169,17 @@ var Button = ({
169
169
  const requiredAlt = keys.includes("alt");
170
170
  const requiredShift = keys.includes("shift");
171
171
  const requiredMeta = keys.includes("meta") || keys.includes("cmd");
172
- const match = event.key.toLowerCase() === primaryKey && event.ctrlKey === requiredCtrl && event.altKey === requiredAlt && event.shiftKey === requiredShift && event.metaKey === requiredMeta;
172
+ const keyAliases = {
173
+ esc: "escape",
174
+ del: "delete",
175
+ space: " ",
176
+ spacebar: " "
177
+ };
178
+ const normalizedPrimary = (_a = keyAliases[primaryKey]) != null ? _a : primaryKey;
179
+ const match = event.key.toLowerCase() === normalizedPrimary && event.ctrlKey === requiredCtrl && event.altKey === requiredAlt && event.shiftKey === requiredShift && event.metaKey === requiredMeta;
173
180
  if (match) {
174
181
  event.preventDefault();
175
- (_a = props.onClick) == null ? void 0 : _a.call(props, event);
182
+ (_b = props.onClick) == null ? void 0 : _b.call(props, event);
176
183
  }
177
184
  };
178
185
  window.addEventListener("keydown", handleKeyDown);
@@ -462,7 +469,7 @@ var Input = ({
462
469
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
463
470
  const [showPassword, setShowPassword] = React5__default.useState(false);
464
471
  const styles = {
465
- input: `text-p-md pl-2 peer text-paragraph bg-surface shadow-input border border-[0.5px] rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:ring-[1.5px] focus-visible:ring-blue-500 focus-visible:ring-offset-[2px] focus-visible:rounded-[2px] ${label ? "pt-[22px]" : "pt-[10px]"}
472
+ input: `text-p-md pl-2 peer text-paragraph bg-surface shadow-input border border-[0.5px] rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 disabled:text-disabled disabled:cursor-not-allowed focus-visible:ring-[1.5px] focus-visible:ring-blue-500 focus-visible:ring-offset-[2px] focus-visible:rounded-[2px] ${label ? "pt-[22px]" : "pt-[10px]"}
466
473
  ${!hasError ? "border-neutral-300" : ""}`,
467
474
  icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] rounded-l-lg text-[20px] ${hasError ? "text-dangerous-500" : "text-label peer-focus:text-blue-500"} peer-focus:border-blue-500`,
468
475
  rightIcon: "absolute h-[44px] top-[1px] right-[1.5px] w-[38px] text-[22px]",
@@ -1202,7 +1209,8 @@ var FilterCalendar = ({
1202
1209
  defaultShortcut,
1203
1210
  shortcutsChange,
1204
1211
  singleMonth = false,
1205
- maxDate = void 0
1212
+ maxDate = void 0,
1213
+ labelClassName
1206
1214
  }) => {
1207
1215
  const style = {
1208
1216
  filter: "rounded-3xl shadow-input bg-surface hover:bg-neutral-100 border border-[0.5px] border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",
@@ -1210,7 +1218,6 @@ var FilterCalendar = ({
1210
1218
  filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-accent-label active:text-accent-label active:bg-blue-600 active:border-blue-600"
1211
1219
  };
1212
1220
  const [currentValue, setCurrentValue] = useState([]);
1213
- const [calendarLabel, setCalendarLabel] = useState("");
1214
1221
  const isMobileSize = (window == null ? void 0 : window.innerWidth) < 768;
1215
1222
  const shorcuts = [
1216
1223
  {
@@ -1374,6 +1381,9 @@ var FilterCalendar = ({
1374
1381
  const [selectedShortcut, setSelectedShortcut] = useState(
1375
1382
  defaultShortcut || shorcuts[0]
1376
1383
  );
1384
+ const [calendarLabel, setCalendarLabel] = useState(
1385
+ defaultShortcut != null && shorcuts[defaultShortcut] ? shorcuts[defaultShortcut].label : ""
1386
+ );
1377
1387
  const calendar = /* @__PURE__ */ jsx("div", { id: "group-input-calendar", className: "relative", children: rangeCalendar ? /* @__PURE__ */ jsx(
1378
1388
  DateRangePicker3,
1379
1389
  {
@@ -1439,7 +1449,7 @@ var FilterCalendar = ({
1439
1449
  control,
1440
1450
  render: ({ field }) => {
1441
1451
  var _a;
1442
- let hasValue = ((_a = field == null ? void 0 : field.value) == null ? void 0 : _a.length) > 0;
1452
+ let hasValue = ((_a = field == null ? void 0 : field.value) == null ? void 0 : _a.length) > 0 || !!calendarLabel && calendarLabel !== shorcuts[0].label;
1443
1453
  return /* @__PURE__ */ jsx(
1444
1454
  Popover,
1445
1455
  {
@@ -1466,9 +1476,9 @@ var FilterCalendar = ({
1466
1476
  "div",
1467
1477
  {
1468
1478
  className: clsx9({
1469
- ["text-label group-active:text-blue-500"]: !field.value && !open,
1470
- ["text-blue-500"]: open && !field.value,
1471
- ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: open && field.value
1479
+ ["text-label group-active:text-blue-500"]: !hasValue && !open,
1480
+ ["text-blue-500"]: open && !hasValue,
1481
+ ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: open && hasValue || !open && hasValue
1472
1482
  }),
1473
1483
  children: icon
1474
1484
  }
@@ -1478,9 +1488,9 @@ var FilterCalendar = ({
1478
1488
  {
1479
1489
  className: clsx9(
1480
1490
  {
1481
- ["text-paragraph group-active:text-blue-500"]: !field.value && !open,
1482
- ["text-blue-500"]: open && !field.value,
1483
- ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: open && field.value
1491
+ [`${labelClassName != null ? labelClassName : "text-paragraph"} group-active:text-blue-500`]: !hasValue && !open,
1492
+ ["text-blue-500"]: open && !hasValue,
1493
+ ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: open && hasValue || !open && hasValue
1484
1494
  },
1485
1495
  "truncate cursor-pointer"
1486
1496
  ),
@@ -1494,9 +1504,9 @@ var FilterCalendar = ({
1494
1504
  {
1495
1505
  className: clsx9(
1496
1506
  {
1497
- ["text-label group-active:text-blue-500"]: !field.value && !open,
1498
- ["text-blue-500"]: open && !field.value,
1499
- ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: open && field.value
1507
+ ["text-label group-active:text-blue-500"]: !hasValue && !open,
1508
+ ["text-blue-500"]: open && !hasValue,
1509
+ ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: open && hasValue || !open && hasValue
1500
1510
  },
1501
1511
  "uil uil-angle-down text-[18px]"
1502
1512
  )
@@ -1588,7 +1598,7 @@ function InputSmall({
1588
1598
  }) {
1589
1599
  const inputRef = useRef(null);
1590
1600
  const styles = {
1591
- input: `text-p-md text-paragraph w-full outline-none placeholder:text-label`,
1601
+ input: `text-p-md text-paragraph w-full outline-none placeholder:text-label disabled:text-disabled disabled:cursor-not-allowed bg-transparent`,
1592
1602
  icon: "text-label group-focus-within:text-neutral-600 m-[10px]",
1593
1603
  wrapper: `shadow-input border border-neutral-300 focus-within:border-blue-500 group rounded-lg h-9 w-full text-paragraph flex items-center justify-between disabled:bg-neutral-100 ${disabled ? "bg-neutral-100" : "bg-surface"} ${className}`,
1594
1604
  clear: "pr-[5px] cursor-pointer text-label text-[16px]"
@@ -1663,7 +1673,13 @@ var FilterOptions = ({
1663
1673
  initialMessage,
1664
1674
  applyOnClick = false,
1665
1675
  showFilter = false,
1666
- renderOption
1676
+ renderOption,
1677
+ searchPlaceholder = "Pesquisar",
1678
+ panelClassName = "p-2",
1679
+ applyLabel = "Aplicar",
1680
+ cancelLabel = "Cancelar",
1681
+ clearLabel = "Limpar",
1682
+ selectAllLabel = "Marcar todos"
1667
1683
  }) => {
1668
1684
  const style = {
1669
1685
  filter: "rounded-3xl shadow-input bg-surface hover:bg-neutral-50 border border-[0.5px] border-neutral-200 active:text-blue-500 active:bg-blue-100 active:border-blue-500",
@@ -1755,9 +1771,10 @@ var FilterOptions = ({
1755
1771
  {
1756
1772
  className: clsx9(
1757
1773
  {
1758
- ["font-semibold text-accent-label"]: isSelected
1774
+ ["font-semibold text-accent-label"]: isSelected,
1775
+ ["text-label"]: !isSelected
1759
1776
  },
1760
- "w-[200px] whitespace-nowrap text-ellipsis overflow-hidden text-label text-p-sm block"
1777
+ "w-[200px] whitespace-nowrap text-ellipsis overflow-hidden text-p-sm block"
1761
1778
  ),
1762
1779
  children: option == null ? void 0 : option.description
1763
1780
  }
@@ -1788,226 +1805,242 @@ var FilterOptions = ({
1788
1805
  children: ({ open }) => {
1789
1806
  var _a2, _b2;
1790
1807
  return /* @__PURE__ */ jsxs(Float, { composable: true, shift: 8, zIndex: 99, offset: 6, children: [
1791
- /* @__PURE__ */ jsx(Float.Reference, { children: /* @__PURE__ */ jsx(PopoverButton, { as: "button", children: /* @__PURE__ */ jsxs(
1792
- "div",
1808
+ /* @__PURE__ */ jsx(Float.Reference, { children: /* @__PURE__ */ jsx(
1809
+ PopoverButton,
1793
1810
  {
1794
- className: clsx9(
1811
+ as: "button",
1812
+ className: "rounded-3xl outline-none focus:outline-none focus-visible:ring-[1.5px] focus-visible:ring-blue-500 focus-visible:ring-offset-[2px]",
1813
+ children: /* @__PURE__ */ jsxs(
1814
+ "div",
1795
1815
  {
1796
- [style.filter]: !hasValue && !open,
1797
- [style.filterOpen]: open && !hasValue,
1798
- [style.filterActive]: open && hasValue || !open && hasValue
1799
- },
1800
- `group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2`
1801
- ),
1802
- children: [
1803
- icon && /* @__PURE__ */ jsx(
1804
- "div",
1805
- {
1806
- className: clsx9({
1807
- ["text-paragraph group-active:text-blue-500"]: !field.value && !open,
1808
- ["text-blue-500"]: open && !field.value,
1809
- ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: field.value
1810
- }),
1811
- children: icon
1812
- }
1813
- ),
1814
- /* @__PURE__ */ jsx(
1815
- "label",
1816
- {
1817
- className: clsx9(
1816
+ className: clsx9(
1817
+ {
1818
+ [style.filter]: !hasValue && !open,
1819
+ [style.filterOpen]: open && !hasValue,
1820
+ [style.filterActive]: open && hasValue || !open && hasValue
1821
+ },
1822
+ `group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2`
1823
+ ),
1824
+ children: [
1825
+ icon && /* @__PURE__ */ jsx(
1826
+ "div",
1818
1827
  {
1819
- ["text-paragraph group-active:text-blue-500"]: !field.value && !open,
1820
- ["text-blue-500"]: open && !field.value,
1821
- ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: field.value
1822
- },
1823
- "truncate cursor-pointer"
1828
+ className: clsx9({
1829
+ ["text-paragraph group-active:text-blue-500"]: !hasValue && !open,
1830
+ ["text-blue-500"]: open && !hasValue,
1831
+ ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: hasValue
1832
+ }),
1833
+ children: icon
1834
+ }
1824
1835
  ),
1825
- children: isMulti ? label : ((_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.id) ? (_b2 = field == null ? void 0 : field.value) == null ? void 0 : _b2.label : label
1826
- }
1827
- ),
1828
- isMulti && field.value && field.value.length > 0 && /* @__PURE__ */ jsx("div", { className: "bg-blue-500 text-accent-label text-p-xs px-1 py-[2px] rounded group-hover:bg-blue-500", children: field.value.length }),
1829
- open ? /* @__PURE__ */ jsx(
1830
- "i",
1831
- {
1832
- className: clsx9(
1836
+ /* @__PURE__ */ jsx(
1837
+ "label",
1833
1838
  {
1834
- ["text-paragraph group-active:text-blue-500"]: !field.value && !open,
1835
- ["text-blue-500"]: open && !field.value,
1836
- ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: field.value
1837
- },
1838
- "uil uil-angle-up text-[18px]"
1839
- )
1840
- }
1841
- ) : /* @__PURE__ */ jsx(
1842
- "i",
1843
- {
1844
- className: clsx9(
1839
+ className: clsx9(
1840
+ {
1841
+ ["text-paragraph group-active:text-blue-500"]: !hasValue && !open,
1842
+ ["text-blue-500"]: open && !hasValue,
1843
+ ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: hasValue
1844
+ },
1845
+ "truncate cursor-pointer"
1846
+ ),
1847
+ children: isMulti ? label : ((_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.id) ? (_b2 = field == null ? void 0 : field.value) == null ? void 0 : _b2.label : label
1848
+ }
1849
+ ),
1850
+ isMulti && field.value && field.value.length > 0 && /* @__PURE__ */ jsx("div", { className: "bg-blue-500 text-accent-label text-p-xs px-1 py-[2px] rounded group-hover:bg-blue-500", children: field.value.length }),
1851
+ open ? /* @__PURE__ */ jsx(
1852
+ "i",
1845
1853
  {
1846
- ["text-paragraph group-active:text-blue-500"]: !field.value && !open,
1847
- ["text-blue-500"]: open && !field.value,
1848
- ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: field.value
1849
- },
1850
- "uil uil-angle-down text-[18px]"
1854
+ className: clsx9(
1855
+ {
1856
+ ["text-paragraph group-active:text-blue-500"]: !hasValue && !open,
1857
+ ["text-blue-500"]: open && !hasValue,
1858
+ ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: hasValue
1859
+ },
1860
+ "uil uil-angle-up text-[18px]"
1861
+ )
1862
+ }
1863
+ ) : /* @__PURE__ */ jsx(
1864
+ "i",
1865
+ {
1866
+ className: clsx9(
1867
+ {
1868
+ ["text-paragraph group-active:text-blue-500"]: !hasValue && !open,
1869
+ ["text-blue-500"]: open && !hasValue,
1870
+ ["text-blue-500 group-hover:text-accent-label group-active:text-accent-label"]: hasValue
1871
+ },
1872
+ "uil uil-angle-down text-[18px]"
1873
+ )
1874
+ }
1851
1875
  )
1852
- }
1853
- )
1854
- ]
1876
+ ]
1877
+ }
1878
+ )
1855
1879
  }
1856
- ) }) }),
1857
- open && /* @__PURE__ */ jsx(Float.Content, { children: /* @__PURE__ */ jsx(PopoverPanel, { className: "p-2 whitespace-nowrap bg-surface rounded-lg shadow-dropdown border-[0.5px] border-neutral-200", children: ({ close }) => {
1858
- const onClose = () => {
1859
- setCurrentValue(field.value);
1860
- close();
1861
- };
1862
- useEffect(() => {
1863
- setCurrentValue(field.value);
1864
- }, [open]);
1865
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1866
- /* @__PURE__ */ jsx(
1867
- Listbox,
1868
- {
1869
- value: currentValue || [],
1870
- onChange: setCurrentValue,
1871
- multiple: isMulti,
1872
- children: /* @__PURE__ */ jsxs(
1873
- ListboxOptions,
1880
+ ) }),
1881
+ open && /* @__PURE__ */ jsx(Float.Content, { children: /* @__PURE__ */ jsx(
1882
+ PopoverPanel,
1883
+ {
1884
+ className: clsx9(
1885
+ "whitespace-nowrap bg-surface rounded-lg shadow-dropdown border-[0.5px] border-neutral-200",
1886
+ panelClassName
1887
+ ),
1888
+ children: ({ close }) => {
1889
+ const onClose = () => {
1890
+ setCurrentValue(field.value);
1891
+ close();
1892
+ };
1893
+ useEffect(() => {
1894
+ setCurrentValue(field.value);
1895
+ }, [open]);
1896
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1897
+ /* @__PURE__ */ jsx(
1898
+ Listbox,
1874
1899
  {
1875
- static: true,
1876
- className: clsx9(
1877
- "max-h-60 w-full overflow-x-hidden overflow-y-auto bg-surface text-p-md focus:outline-none sm:text-sm relative",
1900
+ value: currentValue || [],
1901
+ onChange: setCurrentValue,
1902
+ multiple: isMulti,
1903
+ children: /* @__PURE__ */ jsxs(
1904
+ ListboxOptions,
1878
1905
  {
1879
- "pr-2": options.some(
1880
- (option) => option.description
1881
- ) ? options.length > 3 : options.length > 4
1882
- }
1883
- ),
1884
- children: [
1885
- /* @__PURE__ */ jsxs("div", { className: "mr-1 sticky top-0 z-30", children: [
1886
- showFilter && /* @__PURE__ */ jsx(
1887
- InputSmall,
1906
+ static: true,
1907
+ className: clsx9(
1908
+ "max-h-60 w-full overflow-x-hidden overflow-y-auto bg-surface text-p-md focus:outline-none sm:text-sm relative",
1888
1909
  {
1889
- icon: /* @__PURE__ */ jsx("i", { className: "uil uil-search" }),
1890
- onChange: (e) => setFilter(e),
1891
- value: filter,
1892
- placeholder: "Pesquisar",
1893
- clearField: true,
1894
- onKeyDown: (e) => {
1895
- if (e.key === " " || e.code === "Space") {
1896
- e.stopPropagation();
1897
- }
1898
- }
1910
+ "pr-2": options.some(
1911
+ (option) => option.description
1912
+ ) ? options.length > 3 : options.length > 4
1899
1913
  }
1900
1914
  ),
1901
- subFilters && fetch && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 pt-2 bg-surface", children: subFilters.map((item, index) => {
1902
- const active = (item == null ? void 0 : item.id) === subFilter;
1903
- return /* @__PURE__ */ jsx(
1904
- "button",
1905
- {
1906
- className: clsx9(
1915
+ children: [
1916
+ /* @__PURE__ */ jsxs("div", { className: "mr-1 sticky top-0 z-30", children: [
1917
+ showFilter && /* @__PURE__ */ jsx(
1918
+ InputSmall,
1919
+ {
1920
+ icon: /* @__PURE__ */ jsx("i", { className: "uil uil-search" }),
1921
+ onChange: (e) => setFilter(e),
1922
+ value: filter,
1923
+ placeholder: searchPlaceholder,
1924
+ clearField: true,
1925
+ onKeyDown: (e) => {
1926
+ if (e.key === " " || e.code === "Space") {
1927
+ e.stopPropagation();
1928
+ }
1929
+ }
1930
+ }
1931
+ ),
1932
+ subFilters && fetch && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 pt-2 bg-surface", children: subFilters.map((item, index) => {
1933
+ const active = (item == null ? void 0 : item.id) === subFilter;
1934
+ return /* @__PURE__ */ jsx(
1935
+ "button",
1907
1936
  {
1908
- ["bg-blue-500 text-accent-label"]: active,
1909
- ["text-paragraph"]: !active
1937
+ className: clsx9(
1938
+ {
1939
+ ["bg-blue-500 text-accent-label"]: active,
1940
+ ["text-paragraph"]: !active
1941
+ },
1942
+ `rounded-[20px] border-[0.5px] border-neutral-200 px-4 py-[6px]`
1943
+ ),
1944
+ onClick: () => {
1945
+ if (subFilter == item.id) {
1946
+ setSubFilter(null);
1947
+ } else {
1948
+ setSubFilter(item.id);
1949
+ }
1950
+ },
1951
+ children: item.name
1910
1952
  },
1911
- `rounded-[20px] border-[0.5px] border-neutral-200 px-4 py-[6px]`
1912
- ),
1913
- onClick: () => {
1914
- if (subFilter == item.id) {
1915
- setSubFilter(null);
1916
- } else {
1917
- setSubFilter(item.id);
1918
- }
1919
- },
1920
- children: item.name
1921
- },
1922
- index
1923
- );
1924
- }) })
1925
- ] }),
1926
- loading && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 w-full my-4", children: [
1927
- /* @__PURE__ */ jsx(SpinnerIcon, { className: "animate-spin w-[16px] h-[16px]" }),
1928
- "Carregando"
1929
- ] }),
1930
- (data == null ? void 0 : data.length) === 0 && (filter == null ? void 0 : filter.length) > 0 && !loading && /* @__PURE__ */ jsx("div", { className: "py-4", children: /* @__PURE__ */ jsx("span", { className: "text-label text-p-md", children: emptyMessage }) }),
1931
- initialMessage && (data == null ? void 0 : data.length) === 0 && (filter == null ? void 0 : filter.length) === 0 && !loading && (options == null ? void 0 : options.length) === 0 && !(currentValue == null ? void 0 : currentValue.id) && /* @__PURE__ */ jsx("div", { className: "py-4", children: /* @__PURE__ */ jsx("span", { className: "text-label text-p-md", children: initialMessage }) }),
1932
- initialMessage && currentValue && (currentValue == null ? void 0 : currentValue.id) && (filter == null ? void 0 : filter.length) === 0 && /* @__PURE__ */ jsx("div", { className: "py-2", children: isMulti ? /* @__PURE__ */ jsx(Fragment, { children: currentValue == null ? void 0 : currentValue.map((option) => {
1933
- let isSelected = isMulti ? currentValue && (currentValue == null ? void 0 : currentValue.length) > 0 && (currentValue == null ? void 0 : currentValue.some(
1934
- (e) => e.id === option.id
1935
- )) : currentValue && (currentValue == null ? void 0 : currentValue.id) === option.id;
1936
- return optionStyle(
1937
- options,
1938
- isSelected
1939
- );
1940
- }) }) : optionStyle(field.value, true) }),
1941
- !loading && (data == null ? void 0 : data.map((option) => {
1942
- let isSelected = isMulti ? currentValue && currentValue.length > 0 && currentValue.some(
1943
- (e) => e.id === option.id
1944
- ) : currentValue && currentValue.id === option.id;
1945
- return optionStyle(option, isSelected);
1946
- }))
1947
- ]
1953
+ index
1954
+ );
1955
+ }) })
1956
+ ] }),
1957
+ loading && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 w-full my-4", children: [
1958
+ /* @__PURE__ */ jsx(SpinnerIcon, { className: "animate-spin w-[16px] h-[16px]" }),
1959
+ "Carregando"
1960
+ ] }),
1961
+ (data == null ? void 0 : data.length) === 0 && (filter == null ? void 0 : filter.length) > 0 && !loading && /* @__PURE__ */ jsx("div", { className: "py-4", children: /* @__PURE__ */ jsx("span", { className: "text-label text-p-md", children: emptyMessage }) }),
1962
+ initialMessage && (data == null ? void 0 : data.length) === 0 && (filter == null ? void 0 : filter.length) === 0 && !loading && (options == null ? void 0 : options.length) === 0 && !(currentValue == null ? void 0 : currentValue.id) && /* @__PURE__ */ jsx("div", { className: "py-4", children: /* @__PURE__ */ jsx("span", { className: "text-label text-p-md", children: initialMessage }) }),
1963
+ initialMessage && currentValue && (currentValue == null ? void 0 : currentValue.id) && (filter == null ? void 0 : filter.length) === 0 && /* @__PURE__ */ jsx("div", { className: "py-2", children: isMulti ? /* @__PURE__ */ jsx(Fragment, { children: currentValue == null ? void 0 : currentValue.map((option) => {
1964
+ let isSelected = isMulti ? currentValue && (currentValue == null ? void 0 : currentValue.length) > 0 && (currentValue == null ? void 0 : currentValue.some(
1965
+ (e) => e.id === option.id
1966
+ )) : currentValue && (currentValue == null ? void 0 : currentValue.id) === option.id;
1967
+ return optionStyle(
1968
+ options,
1969
+ isSelected
1970
+ );
1971
+ }) }) : optionStyle(field.value, true) }),
1972
+ !loading && (data == null ? void 0 : data.map((option) => {
1973
+ let isSelected = isMulti ? currentValue && currentValue.length > 0 && currentValue.some(
1974
+ (e) => e.id === option.id
1975
+ ) : currentValue && currentValue.id === option.id;
1976
+ return optionStyle(option, isSelected);
1977
+ }))
1978
+ ]
1979
+ }
1980
+ )
1948
1981
  }
1949
- )
1950
- }
1951
- ),
1952
- !applyOnClick && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3", children: [
1953
- isMulti && onSelectAll && /* @__PURE__ */ jsx("div", { className: "border-r pr-2 border-neutral-300", children: /* @__PURE__ */ jsx(
1954
- Button,
1955
- {
1956
- variant: "link",
1957
- size: "xxs",
1958
- onClick: () => {
1959
- onSelectAll();
1960
- field.onChange(options);
1961
- setCurrentValue(options);
1962
- close();
1963
- },
1964
- children: "Marcar todos"
1965
- }
1966
- ) }),
1967
- onClear && /* @__PURE__ */ jsx("div", { className: "mr-1", children: /* @__PURE__ */ jsx(
1968
- Button,
1969
- {
1970
- variant: "link",
1971
- size: "xxs",
1972
- onClick: () => {
1973
- if (onClear) {
1974
- onClear();
1975
- setCurrentValue([]);
1976
- field.onChange([]);
1982
+ ),
1983
+ !applyOnClick && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3", children: [
1984
+ isMulti && onSelectAll && /* @__PURE__ */ jsx("div", { className: "border-r pr-2 border-neutral-300", children: /* @__PURE__ */ jsx(
1985
+ Button,
1986
+ {
1987
+ variant: "link",
1988
+ size: "xxs",
1989
+ onClick: () => {
1990
+ onSelectAll();
1991
+ field.onChange(options);
1992
+ setCurrentValue(options);
1993
+ close();
1994
+ },
1995
+ children: selectAllLabel
1977
1996
  }
1978
- close();
1979
- },
1980
- children: "Limpar"
1981
- }
1982
- ) }),
1983
- /* @__PURE__ */ jsx(
1984
- Button,
1985
- {
1986
- size: "xs",
1987
- variant: "secondary",
1988
- onClick: () => {
1989
- onClose();
1990
- },
1991
- children: "Cancelar"
1992
- }
1993
- ),
1994
- /* @__PURE__ */ jsx(
1995
- Button,
1996
- {
1997
- size: "xs",
1998
- variant: "primary",
1999
- disabled: JSON.stringify(currentValue) === JSON.stringify(field == null ? void 0 : field.value),
2000
- onClick: () => {
2001
- field.onChange(currentValue);
2002
- if (onApply) onApply();
2003
- close();
2004
- },
2005
- children: "Aplicar"
2006
- }
2007
- )
2008
- ] })
2009
- ] });
2010
- } }) })
1997
+ ) }),
1998
+ onClear && /* @__PURE__ */ jsx("div", { className: "mr-1", children: /* @__PURE__ */ jsx(
1999
+ Button,
2000
+ {
2001
+ variant: "link",
2002
+ size: "xxs",
2003
+ onClick: () => {
2004
+ if (onClear) {
2005
+ onClear();
2006
+ setCurrentValue([]);
2007
+ field.onChange([]);
2008
+ }
2009
+ close();
2010
+ },
2011
+ children: clearLabel
2012
+ }
2013
+ ) }),
2014
+ /* @__PURE__ */ jsx(
2015
+ Button,
2016
+ {
2017
+ size: "xs",
2018
+ variant: "secondary",
2019
+ onClick: () => {
2020
+ onClose();
2021
+ },
2022
+ children: cancelLabel
2023
+ }
2024
+ ),
2025
+ /* @__PURE__ */ jsx(
2026
+ Button,
2027
+ {
2028
+ size: "xs",
2029
+ variant: "primary",
2030
+ disabled: JSON.stringify(currentValue) === JSON.stringify(field == null ? void 0 : field.value),
2031
+ onClick: () => {
2032
+ field.onChange(currentValue);
2033
+ if (onApply) onApply();
2034
+ close();
2035
+ },
2036
+ children: applyLabel
2037
+ }
2038
+ )
2039
+ ] })
2040
+ ] });
2041
+ }
2042
+ }
2043
+ ) })
2011
2044
  ] });
2012
2045
  }
2013
2046
  }
@@ -3603,7 +3636,7 @@ var Radio = ({
3603
3636
  "input",
3604
3637
  {
3605
3638
  name,
3606
- id: name,
3639
+ id: `${name}-${value}`,
3607
3640
  type: "radio",
3608
3641
  className: "",
3609
3642
  onClick: (e) => {
@@ -3617,7 +3650,7 @@ var Radio = ({
3617
3650
  ),
3618
3651
  /* @__PURE__ */ jsx("span", {})
3619
3652
  ] }),
3620
- label && /* @__PURE__ */ jsx("label", { htmlFor: name, className: "text-p-md cursor-pointer -pt-1", children: label })
3653
+ label && /* @__PURE__ */ jsx("label", { htmlFor: `${name}-${value}`, className: "text-p-md cursor-pointer -pt-1", children: label })
3621
3654
  ] });
3622
3655
  }
3623
3656
  }
@@ -6687,7 +6720,7 @@ var Tabs = ({
6687
6720
  {
6688
6721
  disabled: tab == null ? void 0 : tab.disabled,
6689
6722
  className: ({ selected }) => clsx9(
6690
- "group inline-flex rounded-t-lg font-bold text-p-md border border-neutral-200 px-6 py-3 z-20",
6723
+ "group inline-flex rounded-t-lg font-bold text-p-md border border-neutral-200 px-6 py-3 z-20 outline-none focus:outline-none focus-visible:ring-[1.5px] focus-visible:ring-blue-500 focus-visible:ring-offset-[2px]",
6691
6724
  {
6692
6725
  "text-rose-700 border-b-0 bg-surface shadow-tabs": selected,
6693
6726
  "bg-neutral-100 text-rose-700 opacity-80 shadow-tabDisabled": !selected && !tab.disabled,