@motor-hero/ui-kit 0.49.0 → 0.51.0

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.
@@ -6,6 +6,10 @@ export interface ComboboxOption {
6
6
  /** Optional leading decoration rendered before the label (icon, colored
7
7
  * dot) — purely visual, doesn't affect filtering/matching. */
8
8
  icon?: React.ReactNode;
9
+ /** Linha secundária abaixo do rótulo na lista (ex.: e-mail de uma pessoa,
10
+ * para separar homônimos). No gatilho vira o `title`. Entra na busca do
11
+ * modo cliente. */
12
+ description?: string;
9
13
  }
10
14
  export interface ComboboxProps {
11
15
  options: ComboboxOption[];
@@ -59,4 +63,7 @@ export interface ComboboxProps {
59
63
  * estado de erro) e fica com a borda vermelha quando inválido.
60
64
  */
61
65
  export declare function Combobox({ options, value, onChange, placeholder, searchPlaceholder, emptyMessage, disabled, id, className, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, onSearchChange, onLoadMore, loading, hasMore, selectedOption, creatable, formatCreateLabel, deselectable, }: ComboboxProps): React.JSX.Element;
66
+ export declare function OptionText({ option }: {
67
+ option: ComboboxOption;
68
+ }): React.JSX.Element;
62
69
  //# sourceMappingURL=combobox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;kEAC8D;IAC9D,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI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C,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C;mFAC+E;IAC/E,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,EACxB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAA4B,EAC5B,iBAA+B,EAC/B,YAA6C,EAC7C,QAAQ,EACR,EAAE,EACF,SAAS,EACT,cAAc,EAAE,WAAW,EAC3B,kBAAkB,EAAE,eAAe,EACnC,cAAc,EACd,UAAU,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,YAAY,GACZ,EAAE,aAAa,qBA0Lf;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,qBAchE"}
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import type { ComboboxOption } from "./combobox";
2
+ import { type ComboboxOption } from "./combobox";
3
3
  export interface MultiComboboxProps {
4
4
  options: ComboboxOption[];
5
5
  value: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"multi-combobox.d.ts","sourceRoot":"","sources":["../../src/components/multi-combobox.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACnC,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,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A+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;qEACiE;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;+DAC2D;IAC3D,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;CACnC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAA4B,EAC5B,iBAA+B,EAC/B,YAA6C,EAC7C,QAAQ,EACR,EAAE,EACF,SAAS,EACT,cAAc,EAAE,WAAW,EAC3B,kBAAkB,EAAE,eAAe,EACnC,cAAc,EACd,UAAU,EACV,OAAO,EACP,OAAO,EACP,eAAe,GAChB,EAAE,kBAAkB,qBA4MpB"}
@@ -1,10 +1,8 @@
1
- export interface PaginationProps {
1
+ interface PaginationBaseProps {
2
2
  page: number;
3
3
  onPageChange: (page: number) => void;
4
4
  hasNextPage: boolean;
5
5
  hasPreviousPage: boolean;
6
- /** Total de páginas. Quando informado, o rótulo vira "Página {page} de {totalPages}". */
7
- totalPages?: number;
8
6
  /** Exibe o seletor de itens por página. Use com `pageSize`, `onPageSizeChange` e `pageSizeOptions`. */
9
7
  showPageSizeSelector?: boolean;
10
8
  pageSize?: number;
@@ -12,5 +10,16 @@ export interface PaginationProps {
12
10
  pageSizeOptions?: number[];
13
11
  className?: string;
14
12
  }
15
- export declare function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, totalPages, showPageSizeSelector, pageSize, onPageSizeChange, pageSizeOptions, className, }: PaginationProps): import("react").JSX.Element;
13
+ type PageJumpProps = {
14
+ /** Total de páginas. Quando informado, o rótulo vira "Página {page} de {totalPages}". */
15
+ totalPages?: number;
16
+ showPageJump?: false;
17
+ } | {
18
+ totalPages: number;
19
+ /** Torna o número da página editável para pular direto a uma página. Exige `totalPages`. */
20
+ showPageJump: true;
21
+ };
22
+ export type PaginationProps = PaginationBaseProps & PageJumpProps;
23
+ export declare function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, totalPages, showPageJump, showPageSizeSelector, pageSize, onPageSizeChange, pageSizeOptions, className, }: PaginationProps): import("react").JSX.Element;
24
+ export {};
16
25
  //# sourceMappingURL=pagination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,EACV,oBAA4B,EAC5B,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,EAAE,eAAe,+BAmDjB"}
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,KAAK,aAAa,GACd;IACE,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,KAAK,CAAA;CACrB,GACD;IACE,UAAU,EAAE,MAAM,CAAA;IAClB,4FAA4F;IAC5F,YAAY,EAAE,IAAI,CAAA;CACnB,CAAA;AAEL,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,aAAa,CAAA;AAMjE,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,EACV,YAAoB,EACpB,oBAA4B,EAC5B,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,EAAE,eAAe,+BAuDjB"}
package/dist/index.cjs CHANGED
@@ -926,6 +926,7 @@ function Combobox({
926
926
  import_cmdk.Command.Item,
927
927
  {
928
928
  value: isServer ? option.value : option.label,
929
+ keywords: option.description ? [option.description] : void 0,
929
930
  disabled: option.disabled,
930
931
  onSelect: () => handleSelect(option.value),
931
932
  className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 sm:py-1.5",
@@ -940,7 +941,7 @@ function Combobox({
940
941
  }
941
942
  ),
942
943
  option.icon,
943
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "truncate", children: option.label })
944
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(OptionText, { option })
944
945
  ]
945
946
  },
946
947
  option.value
@@ -981,6 +982,21 @@ function Combobox({
981
982
  ] })
982
983
  ] });
983
984
  }
985
+ function OptionText({ option }) {
986
+ if (!option.description)
987
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "truncate", children: option.label });
988
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex min-w-0 flex-col", children: [
989
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "truncate", children: option.label }),
990
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
991
+ "span",
992
+ {
993
+ title: option.description,
994
+ className: "truncate text-xs text-muted-foreground",
995
+ children: option.description
996
+ }
997
+ )
998
+ ] });
999
+ }
984
1000
 
985
1001
  // src/components/confirm-dialog.tsx
986
1002
  var AlertDialog = __toESM(require("@radix-ui/react-alert-dialog"), 1);
@@ -1898,6 +1914,10 @@ function MultiCombobox({
1898
1914
  for (const [key, option] of byValue) labelCache.current.set(key, option);
1899
1915
  });
1900
1916
  const selected = value.map((v) => byValue.get(v) ?? labelCache.current.get(v)).filter((option) => option !== void 0);
1917
+ const labelCounts = /* @__PURE__ */ new Map();
1918
+ for (const option of selected)
1919
+ labelCounts.set(option.label, (labelCounts.get(option.label) ?? 0) + 1);
1920
+ const chipLabel = (option) => option.description && (labelCounts.get(option.label) ?? 0) > 1 ? `${option.label} \xB7 ${option.description}` : option.label;
1901
1921
  const { listRef, sentinelRef } = useInfiniteScrollSentinel({
1902
1922
  enabled: isServer && !!hasMore,
1903
1923
  loading,
@@ -1936,9 +1956,10 @@ function MultiCombobox({
1936
1956
  selected.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-muted-foreground", children: placeholder }) : selected.map((option) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1937
1957
  "span",
1938
1958
  {
1959
+ title: option.description,
1939
1960
  className: "inline-flex items-center gap-1 rounded bg-secondary px-1.5 py-0.5 text-xs text-secondary-foreground",
1940
1961
  children: [
1941
- option.label,
1962
+ chipLabel(option),
1942
1963
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1943
1964
  "button",
1944
1965
  {
@@ -1990,6 +2011,7 @@ function MultiCombobox({
1990
2011
  import_cmdk2.Command.Item,
1991
2012
  {
1992
2013
  value: isServer ? option.value : option.label,
2014
+ keywords: option.description ? [option.description] : void 0,
1993
2015
  disabled: option.disabled,
1994
2016
  onSelect: () => toggleValue(option.value),
1995
2017
  className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 sm:py-1.5",
@@ -2003,7 +2025,7 @@ function MultiCombobox({
2003
2025
  )
2004
2026
  }
2005
2027
  ),
2006
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "truncate", children: option.label })
2028
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionText, { option })
2007
2029
  ]
2008
2030
  },
2009
2031
  option.value
@@ -2064,6 +2086,7 @@ function PageHeader({ title, description, action, className }) {
2064
2086
  }
2065
2087
 
2066
2088
  // src/components/pagination.tsx
2089
+ var import_react7 = require("react");
2067
2090
  var import_jsx_runtime23 = require("react/jsx-runtime");
2068
2091
  var navButtonClass2 = "inline-flex h-8 max-sm:h-10 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50";
2069
2092
  function Pagination({
@@ -2072,6 +2095,7 @@ function Pagination({
2072
2095
  hasNextPage,
2073
2096
  hasPreviousPage,
2074
2097
  totalPages,
2098
+ showPageJump = false,
2075
2099
  showPageSizeSelector = false,
2076
2100
  pageSize,
2077
2101
  onPageSizeChange,
@@ -2107,7 +2131,7 @@ function Pagination({
2107
2131
  children: "Anterior"
2108
2132
  }
2109
2133
  ),
2110
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
2134
+ showPageJump && totalPages !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PageJumpInput, { page, totalPages, onPageChange }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
2111
2135
  "P\xE1gina ",
2112
2136
  page,
2113
2137
  totalPages ? ` de ${totalPages}` : ""
@@ -2127,6 +2151,50 @@ function Pagination({
2127
2151
  }
2128
2152
  );
2129
2153
  }
2154
+ function PageJumpInput({ page, totalPages, onPageChange }) {
2155
+ const inputId = (0, import_react7.useId)();
2156
+ const [draft, setDraft] = (0, import_react7.useState)(null);
2157
+ const [prevPage, setPrevPage] = (0, import_react7.useState)(page);
2158
+ if (page !== prevPage) {
2159
+ setPrevPage(page);
2160
+ setDraft(null);
2161
+ }
2162
+ const commit = () => {
2163
+ if (draft === null) return;
2164
+ setDraft(null);
2165
+ if (draft === "") return;
2166
+ const target = Math.max(1, Math.min(Number(draft), totalPages));
2167
+ if (target !== page) onPageChange(target);
2168
+ };
2169
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "flex items-center gap-1.5 whitespace-nowrap text-sm text-muted-foreground", children: [
2170
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("label", { htmlFor: inputId, className: "max-sm:sr-only", children: "P\xE1gina" }),
2171
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2172
+ "input",
2173
+ {
2174
+ id: inputId,
2175
+ type: "text",
2176
+ inputMode: "numeric",
2177
+ enterKeyHint: "go",
2178
+ autoComplete: "off",
2179
+ "aria-label": "Ir para a p\xE1gina",
2180
+ value: draft ?? String(page),
2181
+ onChange: (e) => setDraft(e.target.value.replace(/\D/g, "")),
2182
+ onFocus: (e) => e.target.select(),
2183
+ onBlur: commit,
2184
+ onKeyDown: (e) => {
2185
+ if (e.key === "Enter") commit();
2186
+ else if (e.key === "Escape") setDraft(null);
2187
+ },
2188
+ style: { width: `${String(totalPages).length + 3}ch` },
2189
+ className: "h-8 max-sm:h-10 rounded-md border border-input bg-background px-1.5 text-center text-xs font-medium tabular-nums text-foreground shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
2190
+ }
2191
+ ),
2192
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { children: [
2193
+ "de ",
2194
+ totalPages
2195
+ ] })
2196
+ ] });
2197
+ }
2130
2198
 
2131
2199
  // src/components/password-input.tsx
2132
2200
  var import_lucide_react11 = require("lucide-react");
@@ -2249,7 +2317,7 @@ function ResponsiveDataView({
2249
2317
  // src/components/row-actions-menu.tsx
2250
2318
  var DropdownMenu3 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
2251
2319
  var import_lucide_react12 = require("lucide-react");
2252
- var import_react7 = require("react");
2320
+ var import_react8 = require("react");
2253
2321
  var import_vaul6 = require("vaul");
2254
2322
  var import_jsx_runtime27 = require("react/jsx-runtime");
2255
2323
  var triggerClass = "inline-flex h-8 w-8 max-sm:h-10 max-sm:w-10 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
@@ -2263,7 +2331,7 @@ function RowActionsMenu({
2263
2331
  renderLink = defaultRenderLink
2264
2332
  }) {
2265
2333
  const isDesktop = useIsDesktop();
2266
- const [open, setOpen] = (0, import_react7.useState)(false);
2334
+ const [open, setOpen] = (0, import_react8.useState)(false);
2267
2335
  if (actions.length === 0) return null;
2268
2336
  const trigger = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2269
2337
  "button",
@@ -2607,15 +2675,15 @@ function Toaster(props) {
2607
2675
  var import_lucide_react13 = require("lucide-react");
2608
2676
 
2609
2677
  // src/hooks/use-version-check.ts
2610
- var import_react8 = require("react");
2678
+ var import_react9 = require("react");
2611
2679
  function useVersionCheck({
2612
2680
  currentBuild,
2613
2681
  url = "/version.json",
2614
2682
  intervalMs = 6e4
2615
2683
  }) {
2616
- const [latestBuild, setLatestBuild] = (0, import_react8.useState)(null);
2617
- const [staleChecks, setStaleChecks] = (0, import_react8.useState)(0);
2618
- (0, import_react8.useEffect)(() => {
2684
+ const [latestBuild, setLatestBuild] = (0, import_react9.useState)(null);
2685
+ const [staleChecks, setStaleChecks] = (0, import_react9.useState)(0);
2686
+ (0, import_react9.useEffect)(() => {
2619
2687
  if (!currentBuild) return;
2620
2688
  let cancelled = false;
2621
2689
  const check = async () => {
@@ -2646,7 +2714,7 @@ function useVersionCheck({
2646
2714
  document.removeEventListener("visibilitychange", onVisible);
2647
2715
  };
2648
2716
  }, [currentBuild, url, intervalMs]);
2649
- const reload = (0, import_react8.useCallback)(() => window.location.reload(), []);
2717
+ const reload = (0, import_react9.useCallback)(() => window.location.reload(), []);
2650
2718
  return { updateAvailable: latestBuild !== null, staleChecks, latestBuild, reload };
2651
2719
  }
2652
2720
 
@@ -2692,7 +2760,7 @@ function UpdateBanner({
2692
2760
  }
2693
2761
 
2694
2762
  // src/hooks/use-company-subdomain.ts
2695
- var import_react9 = require("react");
2763
+ var import_react10 = require("react");
2696
2764
  var ALWAYS_RESERVED = ["www", "localhost"];
2697
2765
  function getSubdomain(hostname, reservedSubdomains = []) {
2698
2766
  const labels = hostname.split(".");
@@ -2725,7 +2793,7 @@ function useCompanySubdomain(opts = {}) {
2725
2793
  overrideStorageKey = "company-subdomain",
2726
2794
  reservedSubdomains = []
2727
2795
  } = opts;
2728
- const [subdomain] = (0, import_react9.useState)(() => {
2796
+ const [subdomain] = (0, import_react10.useState)(() => {
2729
2797
  if (enableOverride) {
2730
2798
  const override = resolveOverride(overrideStorageKey);
2731
2799
  if (override) return override;
@@ -2737,20 +2805,20 @@ function useCompanySubdomain(opts = {}) {
2737
2805
  }
2738
2806
 
2739
2807
  // src/hooks/use-disclosure.ts
2740
- var import_react10 = require("react");
2808
+ var import_react11 = require("react");
2741
2809
  function useDisclosure(initial = false) {
2742
- const [open, setOpen] = (0, import_react10.useState)(initial);
2743
- const onOpen = (0, import_react10.useCallback)(() => setOpen(true), []);
2744
- const onClose = (0, import_react10.useCallback)(() => setOpen(false), []);
2745
- const onToggle = (0, import_react10.useCallback)(() => setOpen((v) => !v), []);
2810
+ const [open, setOpen] = (0, import_react11.useState)(initial);
2811
+ const onOpen = (0, import_react11.useCallback)(() => setOpen(true), []);
2812
+ const onClose = (0, import_react11.useCallback)(() => setOpen(false), []);
2813
+ const onToggle = (0, import_react11.useCallback)(() => setOpen((v) => !v), []);
2746
2814
  return { open, onOpen, onClose, onToggle, setOpen };
2747
2815
  }
2748
2816
 
2749
2817
  // src/hooks/use-toast.ts
2750
2818
  var import_sonner2 = require("sonner");
2751
- var import_react11 = require("react");
2819
+ var import_react12 = require("react");
2752
2820
  function useCustomToast() {
2753
- const showToast = (0, import_react11.useCallback)(
2821
+ const showToast = (0, import_react12.useCallback)(
2754
2822
  (title, description, status = "success") => {
2755
2823
  switch (status) {
2756
2824
  case "success":