@umami/react-zen 0.190.0 → 0.191.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.
package/dist/index.d.mts CHANGED
@@ -250,6 +250,16 @@ declare function useToast(): {
250
250
  toasts: ToastState[];
251
251
  };
252
252
 
253
+ declare const breakpoints: {
254
+ xs: number[];
255
+ sm: number[];
256
+ md: number[];
257
+ lg: number[];
258
+ xl: number[];
259
+ };
260
+ type BreakpointKey = keyof typeof breakpoints;
261
+ declare function useBreakpoints(): "xs" | "sm" | "md" | "lg" | "xl" | null;
262
+
253
263
  interface AccordionProps extends DisclosureGroupProps {
254
264
  type: 'single' | 'multiple';
255
265
  className?: string;
@@ -743,4 +753,4 @@ interface ZenProviderProps {
743
753
  }
744
754
  declare function ZenProvider({ children, theme, colorScheme, toast, }: ZenProviderProps): react.JSX.Element;
745
755
 
746
- export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, AlertBanner, type AlertBannerProps, AlertDialog, type AlertDialogProps, Blockquote, type BlockquoteProps, Box, type BoxProps, Breadcrumb, Breadcrumbs, Button, type ButtonProps, Calendar, type CalendarProps, Checkbox, type CheckboxProps, Code, type CodeProps, Column, type ColumnProps, ComboBox, type ComboBoxProps, ConfirmationDialog, type ConfirmationDialogProps, Container, type ContainerProps, CopyButton, DataColumn, type DataColumnProps, DataTable, type DataTableProps, Dialog, type DialogProps, Dots, type DotsProps, Flexbox, type FlexboxProps, FloatingTooltip, type FloatingTooltipProps, Form, FormButtons, type FormButtonsProps, FormController, type FormControllerProps, FormField, FormFieldArray, type FormFieldArrayProps, type FormFieldProps, type FormProps, FormResetButton, type FormResetButtonProps, FormSubmitButton, Grid, type GridProps, Heading, type HeadingProps, type HoverButtonProps, HoverTrigger, Icon, IconLabel, type IconLabelProps, type IconProps, Image, type ImageProps, InlineEditField, type InlineEditFieldProps, Label, type LabelProps, List, ListItem, type ListItemProps, type ListProps, ListSection, type ListSectionProps, ListSeparator, Loading, LoadingButton, type LoadingButtonProps, type LoadingProps, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, Modal, type ModalProps, NavMenu, NavMenuGroup, type NavMenuGroupProps, NavMenuItem, type NavMenuItemProps, type NavMenuProps, Navbar, NavbarContext, NavbarItem, type NavbarItemProps, type NavbarProps, type NavigationContext, PasswordField, type PasswordFieldProps, Popover, ProgressBar, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, Radio, RadioGroup, type RadioGroupProps, Row, type RowProps, SearchField, type SearchFieldProps, Select, type SelectProps, Sidebar, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, Slider, type SliderProps, Slot, Spinner, type SpinnerProps, StatusLight, type StatusLightProps, SubMenuTrigger, type SubmenuTriggerProps, Switch, type SwitchProps, Tab, TabList, TabPanel, Table, TableBody, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableHeader, TableRow, Tabs, Text, TextField, type TextFieldProps, type TextProps, ThemeButton, Toast, type ToastOptions, type ToastProps, ToastProvider, type ToastProviderProps, type ToastState, type ToastVariant, Toaster, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipBubble, type TooltipBubbleProps, type TooltipProps, ZenProvider, type ZenProviderProps, useDebounce, useNavigationContext, useTheme, useToast };
756
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, AlertBanner, type AlertBannerProps, AlertDialog, type AlertDialogProps, Blockquote, type BlockquoteProps, Box, type BoxProps, Breadcrumb, Breadcrumbs, type BreakpointKey, Button, type ButtonProps, Calendar, type CalendarProps, Checkbox, type CheckboxProps, Code, type CodeProps, Column, type ColumnProps, ComboBox, type ComboBoxProps, ConfirmationDialog, type ConfirmationDialogProps, Container, type ContainerProps, CopyButton, DataColumn, type DataColumnProps, DataTable, type DataTableProps, Dialog, type DialogProps, Dots, type DotsProps, Flexbox, type FlexboxProps, FloatingTooltip, type FloatingTooltipProps, Form, FormButtons, type FormButtonsProps, FormController, type FormControllerProps, FormField, FormFieldArray, type FormFieldArrayProps, type FormFieldProps, type FormProps, FormResetButton, type FormResetButtonProps, FormSubmitButton, Grid, type GridProps, Heading, type HeadingProps, type HoverButtonProps, HoverTrigger, Icon, IconLabel, type IconLabelProps, type IconProps, Image, type ImageProps, InlineEditField, type InlineEditFieldProps, Label, type LabelProps, List, ListItem, type ListItemProps, type ListProps, ListSection, type ListSectionProps, ListSeparator, Loading, LoadingButton, type LoadingButtonProps, type LoadingProps, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, Modal, type ModalProps, NavMenu, NavMenuGroup, type NavMenuGroupProps, NavMenuItem, type NavMenuItemProps, type NavMenuProps, Navbar, NavbarContext, NavbarItem, type NavbarItemProps, type NavbarProps, type NavigationContext, PasswordField, type PasswordFieldProps, Popover, ProgressBar, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, Radio, RadioGroup, type RadioGroupProps, Row, type RowProps, SearchField, type SearchFieldProps, Select, type SelectProps, Sidebar, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, Slider, type SliderProps, Slot, Spinner, type SpinnerProps, StatusLight, type StatusLightProps, SubMenuTrigger, type SubmenuTriggerProps, Switch, type SwitchProps, Tab, TabList, TabPanel, Table, TableBody, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableHeader, TableRow, Tabs, Text, TextField, type TextFieldProps, type TextProps, ThemeButton, Toast, type ToastOptions, type ToastProps, ToastProvider, type ToastProviderProps, type ToastState, type ToastVariant, Toaster, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipBubble, type TooltipBubbleProps, type TooltipProps, ZenProvider, type ZenProviderProps, useBreakpoints, useDebounce, useNavigationContext, useTheme, useToast };
package/dist/index.d.ts CHANGED
@@ -250,6 +250,16 @@ declare function useToast(): {
250
250
  toasts: ToastState[];
251
251
  };
252
252
 
253
+ declare const breakpoints: {
254
+ xs: number[];
255
+ sm: number[];
256
+ md: number[];
257
+ lg: number[];
258
+ xl: number[];
259
+ };
260
+ type BreakpointKey = keyof typeof breakpoints;
261
+ declare function useBreakpoints(): "xs" | "sm" | "md" | "lg" | "xl" | null;
262
+
253
263
  interface AccordionProps extends DisclosureGroupProps {
254
264
  type: 'single' | 'multiple';
255
265
  className?: string;
@@ -743,4 +753,4 @@ interface ZenProviderProps {
743
753
  }
744
754
  declare function ZenProvider({ children, theme, colorScheme, toast, }: ZenProviderProps): react.JSX.Element;
745
755
 
746
- export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, AlertBanner, type AlertBannerProps, AlertDialog, type AlertDialogProps, Blockquote, type BlockquoteProps, Box, type BoxProps, Breadcrumb, Breadcrumbs, Button, type ButtonProps, Calendar, type CalendarProps, Checkbox, type CheckboxProps, Code, type CodeProps, Column, type ColumnProps, ComboBox, type ComboBoxProps, ConfirmationDialog, type ConfirmationDialogProps, Container, type ContainerProps, CopyButton, DataColumn, type DataColumnProps, DataTable, type DataTableProps, Dialog, type DialogProps, Dots, type DotsProps, Flexbox, type FlexboxProps, FloatingTooltip, type FloatingTooltipProps, Form, FormButtons, type FormButtonsProps, FormController, type FormControllerProps, FormField, FormFieldArray, type FormFieldArrayProps, type FormFieldProps, type FormProps, FormResetButton, type FormResetButtonProps, FormSubmitButton, Grid, type GridProps, Heading, type HeadingProps, type HoverButtonProps, HoverTrigger, Icon, IconLabel, type IconLabelProps, type IconProps, Image, type ImageProps, InlineEditField, type InlineEditFieldProps, Label, type LabelProps, List, ListItem, type ListItemProps, type ListProps, ListSection, type ListSectionProps, ListSeparator, Loading, LoadingButton, type LoadingButtonProps, type LoadingProps, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, Modal, type ModalProps, NavMenu, NavMenuGroup, type NavMenuGroupProps, NavMenuItem, type NavMenuItemProps, type NavMenuProps, Navbar, NavbarContext, NavbarItem, type NavbarItemProps, type NavbarProps, type NavigationContext, PasswordField, type PasswordFieldProps, Popover, ProgressBar, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, Radio, RadioGroup, type RadioGroupProps, Row, type RowProps, SearchField, type SearchFieldProps, Select, type SelectProps, Sidebar, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, Slider, type SliderProps, Slot, Spinner, type SpinnerProps, StatusLight, type StatusLightProps, SubMenuTrigger, type SubmenuTriggerProps, Switch, type SwitchProps, Tab, TabList, TabPanel, Table, TableBody, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableHeader, TableRow, Tabs, Text, TextField, type TextFieldProps, type TextProps, ThemeButton, Toast, type ToastOptions, type ToastProps, ToastProvider, type ToastProviderProps, type ToastState, type ToastVariant, Toaster, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipBubble, type TooltipBubbleProps, type TooltipProps, ZenProvider, type ZenProviderProps, useDebounce, useNavigationContext, useTheme, useToast };
756
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, AlertBanner, type AlertBannerProps, AlertDialog, type AlertDialogProps, Blockquote, type BlockquoteProps, Box, type BoxProps, Breadcrumb, Breadcrumbs, type BreakpointKey, Button, type ButtonProps, Calendar, type CalendarProps, Checkbox, type CheckboxProps, Code, type CodeProps, Column, type ColumnProps, ComboBox, type ComboBoxProps, ConfirmationDialog, type ConfirmationDialogProps, Container, type ContainerProps, CopyButton, DataColumn, type DataColumnProps, DataTable, type DataTableProps, Dialog, type DialogProps, Dots, type DotsProps, Flexbox, type FlexboxProps, FloatingTooltip, type FloatingTooltipProps, Form, FormButtons, type FormButtonsProps, FormController, type FormControllerProps, FormField, FormFieldArray, type FormFieldArrayProps, type FormFieldProps, type FormProps, FormResetButton, type FormResetButtonProps, FormSubmitButton, Grid, type GridProps, Heading, type HeadingProps, type HoverButtonProps, HoverTrigger, Icon, IconLabel, type IconLabelProps, type IconProps, Image, type ImageProps, InlineEditField, type InlineEditFieldProps, Label, type LabelProps, List, ListItem, type ListItemProps, type ListProps, ListSection, type ListSectionProps, ListSeparator, Loading, LoadingButton, type LoadingButtonProps, type LoadingProps, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, Modal, type ModalProps, NavMenu, NavMenuGroup, type NavMenuGroupProps, NavMenuItem, type NavMenuItemProps, type NavMenuProps, Navbar, NavbarContext, NavbarItem, type NavbarItemProps, type NavbarProps, type NavigationContext, PasswordField, type PasswordFieldProps, Popover, ProgressBar, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, Radio, RadioGroup, type RadioGroupProps, Row, type RowProps, SearchField, type SearchFieldProps, Select, type SelectProps, Sidebar, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, Slider, type SliderProps, Slot, Spinner, type SpinnerProps, StatusLight, type StatusLightProps, SubMenuTrigger, type SubmenuTriggerProps, Switch, type SwitchProps, Tab, TabList, TabPanel, Table, TableBody, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableHeader, TableRow, Tabs, Text, TextField, type TextFieldProps, type TextProps, ThemeButton, Toast, type ToastOptions, type ToastProps, ToastProvider, type ToastProviderProps, type ToastState, type ToastVariant, Toaster, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipBubble, type TooltipBubbleProps, type TooltipProps, ZenProvider, type ZenProviderProps, useBreakpoints, useDebounce, useNavigationContext, useTheme, useToast };
package/dist/index.js CHANGED
@@ -34,18 +34,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
34
  // node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
35
35
  var require_use_sync_external_store_shim_production = __commonJS({
36
36
  "node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
37
- var import_react198 = __toESM(require("react"));
38
- var React5 = import_react198.default;
37
+ var import_react199 = __toESM(require("react"));
38
+ var React5 = import_react199.default;
39
39
  function is2(x, y) {
40
40
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
41
41
  }
42
42
  var objectIs = "function" === typeof Object.is ? Object.is : is2;
43
- var useState19 = React5.useState;
44
- var useEffect12 = React5.useEffect;
43
+ var useState20 = React5.useState;
44
+ var useEffect13 = React5.useEffect;
45
45
  var useLayoutEffect3 = React5.useLayoutEffect;
46
46
  var useDebugValue = React5.useDebugValue;
47
47
  function useSyncExternalStore$2(subscribe, getSnapshot) {
48
- var value = getSnapshot(), _useState = useState19({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
48
+ var value = getSnapshot(), _useState = useState20({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
49
49
  useLayoutEffect3(
50
50
  function() {
51
51
  inst.value = value;
@@ -54,7 +54,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
54
54
  },
55
55
  [subscribe, value, getSnapshot]
56
56
  );
57
- useEffect12(
57
+ useEffect13(
58
58
  function() {
59
59
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
60
60
  return subscribe(function() {
@@ -87,7 +87,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
87
87
  // node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
88
88
  var require_use_sync_external_store_shim_development = __commonJS({
89
89
  "node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
90
- var import_react198 = __toESM(require("react"));
90
+ var import_react199 = __toESM(require("react"));
91
91
  (function() {
92
92
  function is2(x, y) {
93
93
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
@@ -103,7 +103,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
103
103
  "The result of getSnapshot should be cached to avoid an infinite loop"
104
104
  ), didWarnUncachedGetSnapshot = true);
105
105
  }
106
- cachedValue = useState19({
106
+ cachedValue = useState20({
107
107
  inst: { value, getSnapshot }
108
108
  });
109
109
  var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
@@ -115,7 +115,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
115
115
  },
116
116
  [subscribe, value, getSnapshot]
117
117
  );
118
- useEffect12(
118
+ useEffect13(
119
119
  function() {
120
120
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
121
121
  return subscribe(function() {
@@ -141,7 +141,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
141
141
  return getSnapshot();
142
142
  }
143
143
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
144
- var React5 = import_react198.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState19 = React5.useState, useEffect12 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
144
+ var React5 = import_react199.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState20 = React5.useState, useEffect13 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
145
145
  exports.useSyncExternalStore = void 0 !== React5.useSyncExternalStore ? React5.useSyncExternalStore : shim;
146
146
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
147
147
  })();
@@ -328,6 +328,7 @@ __export(index_exports, {
328
328
  TooltipBubble: () => TooltipBubble,
329
329
  TooltipTrigger: () => $4e3b923658d69c60$export$8c610744efcf8a1d,
330
330
  ZenProvider: () => ZenProvider,
331
+ useBreakpoints: () => useBreakpoints,
331
332
  useDebounce: () => useDebounce,
332
333
  useNavigationContext: () => useNavigationContext,
333
334
  useTheme: () => useTheme,
@@ -26617,7 +26618,7 @@ function createFormControl(props = {}) {
26617
26618
  state: createSubject()
26618
26619
  };
26619
26620
  const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
26620
- const debounce = (callback) => (wait) => {
26621
+ const debounce2 = (callback) => (wait) => {
26621
26622
  clearTimeout(timer);
26622
26623
  timer = setTimeout(callback, wait);
26623
26624
  };
@@ -26730,7 +26731,7 @@ function createFormControl(props = {}) {
26730
26731
  const previousFieldError = get(_formState.errors, name);
26731
26732
  const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isBoolean(isValid) && _formState.isValid !== isValid;
26732
26733
  if (_options.delayError && error) {
26733
- delayErrorCallback = debounce(() => updateErrors(name, error));
26734
+ delayErrorCallback = debounce2(() => updateErrors(name, error));
26734
26735
  delayErrorCallback(_options.delayError);
26735
26736
  } else {
26736
26737
  clearTimeout(timer);
@@ -32565,8 +32566,55 @@ function useInitTheme(preferred, colorScheme) {
32565
32566
  }, [preferred, colorScheme, initTheme]);
32566
32567
  }
32567
32568
 
32568
- // src/components/Accordion.tsx
32569
+ // src/components/hooks/useBreakpoints.ts
32569
32570
  var import_react182 = require("react");
32571
+
32572
+ // src/lib/utils.ts
32573
+ var debounce = (func, delay) => {
32574
+ let timer;
32575
+ return (...args) => {
32576
+ clearTimeout(timer);
32577
+ timer = window.setTimeout(() => {
32578
+ func(...args);
32579
+ }, delay);
32580
+ };
32581
+ };
32582
+
32583
+ // src/components/hooks/useBreakpoints.ts
32584
+ var breakpoints = {
32585
+ xs: [0, 576],
32586
+ sm: [576, 768],
32587
+ md: [768, 992],
32588
+ lg: [992, 1200],
32589
+ xl: [1200, Infinity]
32590
+ };
32591
+ var DEBOUNCE_DELAY_MS = 150;
32592
+ function useBreakpoints() {
32593
+ const [breakpoint, setBreakpoint] = (0, import_react182.useState)(null);
32594
+ const calculateBreakpoint = (0, import_react182.useCallback)(() => {
32595
+ if (typeof window === "undefined") {
32596
+ return;
32597
+ }
32598
+ const width = window.innerWidth;
32599
+ const currentBreakpointKey = Object.keys(breakpoints).find((key) => {
32600
+ const [min, max] = breakpoints[key];
32601
+ return width >= min && width < max;
32602
+ }) || "xs";
32603
+ setBreakpoint(currentBreakpointKey);
32604
+ }, []);
32605
+ (0, import_react182.useEffect)(() => {
32606
+ calculateBreakpoint();
32607
+ const debouncedResize = debounce(calculateBreakpoint, DEBOUNCE_DELAY_MS);
32608
+ window.addEventListener("resize", debouncedResize);
32609
+ return () => {
32610
+ window.removeEventListener("resize", debouncedResize);
32611
+ };
32612
+ }, [calculateBreakpoint]);
32613
+ return breakpoint;
32614
+ }
32615
+
32616
+ // src/components/Accordion.tsx
32617
+ var import_react183 = require("react");
32570
32618
  var import_classnames14 = __toESM(require_classnames());
32571
32619
 
32572
32620
  // src/components/Text.tsx
@@ -32640,7 +32688,7 @@ function AccordionItem({
32640
32688
  ...props
32641
32689
  }) {
32642
32690
  const [trigger, panel] = children;
32643
- const [expanded, setExpanded] = (0, import_react182.useState)(defaultExpanded);
32691
+ const [expanded, setExpanded] = (0, import_react183.useState)(defaultExpanded);
32644
32692
  const handleExpandedChange = (isExpanded) => {
32645
32693
  requestAnimationFrame(() => setExpanded(isExpanded));
32646
32694
  };
@@ -32851,7 +32899,7 @@ function Checkbox2({ label, className, children, ...props }) {
32851
32899
  var import_classnames22 = __toESM(require_classnames());
32852
32900
 
32853
32901
  // src/components/List.tsx
32854
- var import_react183 = require("react");
32902
+ var import_react184 = require("react");
32855
32903
  var import_classnames20 = __toESM(require_classnames());
32856
32904
 
32857
32905
  // src/lib/constants.ts
@@ -32943,7 +32991,7 @@ function List({
32943
32991
  children: children || items?.map((item) => {
32944
32992
  const id2 = item[idProperty] || item.toString();
32945
32993
  const label2 = item[labelProperty] || item.toString();
32946
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react183.Fragment, { children: [
32994
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react184.Fragment, { children: [
32947
32995
  item[separatorProperty] && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)($431f98aba6844401$export$1ff3c3f08ae963c0, { className: List_default.separator }),
32948
32996
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ListItem, { id: id2, className: List_default.item, children: label2 })
32949
32997
  ] }, id2);
@@ -33063,15 +33111,15 @@ function Code({ asChild, children }) {
33063
33111
  }
33064
33112
 
33065
33113
  // src/components/ConfirmationDialog.tsx
33066
- var import_react186 = require("react");
33114
+ var import_react187 = require("react");
33067
33115
  var import_classnames25 = __toESM(require_classnames());
33068
33116
 
33069
33117
  // src/components/TextField.tsx
33070
- var import_react185 = require("react");
33118
+ var import_react186 = require("react");
33071
33119
  var import_classnames24 = __toESM(require_classnames());
33072
33120
 
33073
33121
  // src/components/CopyButton.tsx
33074
- var import_react184 = require("react");
33122
+ var import_react185 = require("react");
33075
33123
  var import_classnames23 = __toESM(require_classnames());
33076
33124
 
33077
33125
  // css-modules:E:\dev\umami-react-zen\src\components\CopyButton.module.css
@@ -33081,8 +33129,8 @@ var CopyButton_default = { "icon": "CopyButton_icon__YTM2Y", "copy-button": "Cop
33081
33129
  var import_jsx_runtime37 = require("react/jsx-runtime");
33082
33130
  var TIMEOUT = 2e3;
33083
33131
  function CopyButton({ value, timeout = TIMEOUT, className, children, ...props }) {
33084
- const [copied, setCopied] = (0, import_react184.useState)(false);
33085
- const ref = (0, import_react184.useRef)(timeout);
33132
+ const [copied, setCopied] = (0, import_react185.useState)(false);
33133
+ const ref = (0, import_react185.useRef)(timeout);
33086
33134
  const handleCopy = async () => {
33087
33135
  if (value) {
33088
33136
  await navigator.clipboard.writeText(value);
@@ -33114,13 +33162,13 @@ function TextField2({
33114
33162
  children,
33115
33163
  ...props
33116
33164
  }) {
33117
- const [inputValue, setInputValue] = (0, import_react185.useState)(defaultValue || value);
33165
+ const [inputValue, setInputValue] = (0, import_react186.useState)(defaultValue || value);
33118
33166
  const Component = asTextArea ? $216918bed6669f72$export$f5c9f3c2c4054eec : $3985021b0ad6602f$export$f5b8910cec6cf069;
33119
33167
  const handleChange = (value2) => {
33120
33168
  setInputValue(value2);
33121
33169
  return onChange?.(value2);
33122
33170
  };
33123
- (0, import_react185.useEffect)(() => {
33171
+ (0, import_react186.useEffect)(() => {
33124
33172
  setInputValue(value);
33125
33173
  }, [value]);
33126
33174
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
@@ -33163,7 +33211,7 @@ function ConfirmationDialog({
33163
33211
  children,
33164
33212
  ...props
33165
33213
  }) {
33166
- const [canSave, setCanSave] = (0, import_react186.useState)(false);
33214
+ const [canSave, setCanSave] = (0, import_react187.useState)(false);
33167
33215
  const handleChange = (e) => {
33168
33216
  setCanSave(e.target.value === value);
33169
33217
  };
@@ -33220,7 +33268,7 @@ function Container({
33220
33268
 
33221
33269
  // src/components/DataTable.tsx
33222
33270
  var import_classnames28 = __toESM(require_classnames());
33223
- var import_react187 = require("react");
33271
+ var import_react188 = require("react");
33224
33272
 
33225
33273
  // src/components/Table.tsx
33226
33274
  var import_classnames27 = __toESM(require_classnames());
@@ -33279,11 +33327,11 @@ var DataTable_default = { "datatable": "DataTable_datatable__MWRkN", "cell": "Da
33279
33327
 
33280
33328
  // src/components/DataTable.tsx
33281
33329
  var import_jsx_runtime42 = require("react/jsx-runtime");
33282
- var import_react188 = require("react");
33330
+ var import_react189 = require("react");
33283
33331
  function DataTable({ data = [], className, children, ...props }) {
33284
33332
  const items = data.length && data?.[0]?.id === void 0 ? data.map((row, id) => ({ ...row, id })) : data;
33285
33333
  const widths = [];
33286
- const columns = import_react187.Children.map(children, (child) => {
33334
+ const columns = import_react188.Children.map(children, (child) => {
33287
33335
  if (child) {
33288
33336
  widths.push(child?.props?.width || "1fr");
33289
33337
  return { ...child?.props };
@@ -33296,7 +33344,7 @@ function DataTable({ data = [], className, children, ...props }) {
33296
33344
  if (hidden) {
33297
33345
  return null;
33298
33346
  }
33299
- return /* @__PURE__ */ (0, import_react188.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
33347
+ return /* @__PURE__ */ (0, import_react189.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
33300
33348
  }) }),
33301
33349
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBody, { children: items.map((row, index) => {
33302
33350
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
@@ -33304,14 +33352,14 @@ function DataTable({ data = [], className, children, ...props }) {
33304
33352
  return null;
33305
33353
  }
33306
33354
  const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
33307
- return /* @__PURE__ */ (0, import_react188.createElement)(
33355
+ return /* @__PURE__ */ (0, import_react189.createElement)(
33308
33356
  TableCell,
33309
33357
  {
33310
33358
  ...cellProps,
33311
33359
  key: id,
33312
33360
  className: (0, import_classnames28.default)(DataTable_default.cell, className2)
33313
33361
  },
33314
- as ? (0, import_react187.createElement)(as, {}, value) : value
33362
+ as ? (0, import_react188.createElement)(as, {}, value) : value
33315
33363
  );
33316
33364
  }) }, index);
33317
33365
  }) })
@@ -33338,7 +33386,7 @@ function Dots({ size = "md", className, ...props }) {
33338
33386
  }
33339
33387
 
33340
33388
  // src/components/FloatingTooltip.tsx
33341
- var import_react189 = require("react");
33389
+ var import_react190 = require("react");
33342
33390
  var import_classnames31 = __toESM(require_classnames());
33343
33391
 
33344
33392
  // src/components/Tooltip.tsx
@@ -33365,8 +33413,8 @@ var FloatingTooltip_default = { "floating": "FloatingTooltip_floating__ZjM4N" };
33365
33413
  // src/components/FloatingTooltip.tsx
33366
33414
  var import_jsx_runtime45 = require("react/jsx-runtime");
33367
33415
  function FloatingTooltip({ className, style, children, ...props }) {
33368
- const [position, setPosition] = (0, import_react189.useState)({ x: -1e3, y: -1e3 });
33369
- (0, import_react189.useEffect)(() => {
33416
+ const [position, setPosition] = (0, import_react190.useState)({ x: -1e3, y: -1e3 });
33417
+ (0, import_react190.useEffect)(() => {
33370
33418
  const handler = (e) => {
33371
33419
  setPosition({ x: e.clientX, y: e.clientY });
33372
33420
  };
@@ -33422,7 +33470,7 @@ function Heading2({
33422
33470
  }
33423
33471
 
33424
33472
  // src/components/HoverTrigger.tsx
33425
- var import_react190 = require("react");
33473
+ var import_react191 = require("react");
33426
33474
 
33427
33475
  // css-modules:E:\dev\umami-react-zen\src\components\HoverTrigger.module.css
33428
33476
  var HoverTrigger_default = { "wrapper": "HoverTrigger_wrapper__NGFlN" };
@@ -33438,12 +33486,12 @@ function HoverTrigger({
33438
33486
  children
33439
33487
  }) {
33440
33488
  const [triggerElement, popupElement] = children;
33441
- const triggerRef = (0, import_react190.useRef)(null);
33442
- const [open, setOpen] = (0, import_react190.useState)(isOpen);
33443
- const isOverMenu = (0, import_react190.useRef)(false);
33444
- const isOverButton = (0, import_react190.useRef)(false);
33445
- const timeout = (0, import_react190.useRef)(null);
33446
- (0, import_react190.useEffect)(() => {
33489
+ const triggerRef = (0, import_react191.useRef)(null);
33490
+ const [open, setOpen] = (0, import_react191.useState)(isOpen);
33491
+ const isOverMenu = (0, import_react191.useRef)(false);
33492
+ const isOverButton = (0, import_react191.useRef)(false);
33493
+ const timeout = (0, import_react191.useRef)(null);
33494
+ (0, import_react191.useEffect)(() => {
33447
33495
  if (isOpen !== open) {
33448
33496
  setOpen(isOpen);
33449
33497
  }
@@ -33551,7 +33599,7 @@ function Image({
33551
33599
  }
33552
33600
 
33553
33601
  // src/components/InlineEditField.tsx
33554
- var import_react191 = require("react");
33602
+ var import_react192 = require("react");
33555
33603
  var import_classnames34 = __toESM(require_classnames());
33556
33604
 
33557
33605
  // css-modules:E:\dev\umami-react-zen\src\components\InlineEditField.module.css
@@ -33570,8 +33618,8 @@ function InlineEditField({
33570
33618
  onCancel,
33571
33619
  ...props
33572
33620
  }) {
33573
- const [value, setValue] = (0, import_react191.useState)(defaultValue);
33574
- const [edit, setEdit] = (0, import_react191.useState)(defaultEdit);
33621
+ const [value, setValue] = (0, import_react192.useState)(defaultValue);
33622
+ const [edit, setEdit] = (0, import_react192.useState)(defaultEdit);
33575
33623
  const handleEdit = () => setEdit(true);
33576
33624
  const handleChange = (e) => {
33577
33625
  const val = e.target.value;
@@ -33582,7 +33630,7 @@ function InlineEditField({
33582
33630
  setEdit(false);
33583
33631
  onCommit?.(value);
33584
33632
  };
33585
- const handleCancel = (0, import_react191.useCallback)(() => {
33633
+ const handleCancel = (0, import_react192.useCallback)(() => {
33586
33634
  setEdit(false);
33587
33635
  setValue(defaultValue);
33588
33636
  onCancel?.();
@@ -33722,7 +33770,7 @@ function Modal2({
33722
33770
  }
33723
33771
 
33724
33772
  // src/components/Navbar.tsx
33725
- var import_react192 = require("react");
33773
+ var import_react193 = require("react");
33726
33774
  var import_classnames38 = __toESM(require_classnames());
33727
33775
 
33728
33776
  // css-modules:E:\dev\umami-react-zen\src\components\Navbar.module.css
@@ -33730,16 +33778,16 @@ var Navbar_default = { "nav": "Navbar_nav__ZjEwM", "item": "Navbar_item__MWVhZ",
33730
33778
 
33731
33779
  // src/components/Navbar.tsx
33732
33780
  var import_jsx_runtime54 = require("react/jsx-runtime");
33733
- var NavbarContext = (0, import_react192.createContext)(void 0);
33781
+ var NavbarContext = (0, import_react193.createContext)(void 0);
33734
33782
  var useNavigationContext = () => {
33735
- const context = (0, import_react192.useContext)(NavbarContext);
33783
+ const context = (0, import_react193.useContext)(NavbarContext);
33736
33784
  if (!context) {
33737
33785
  throw new Error("useNavigationContext must be used within a Navbar");
33738
33786
  }
33739
33787
  return context;
33740
33788
  };
33741
33789
  function Navbar({ showArrow = true, className, children, ...props }) {
33742
- const [activeMenu, setActiveMenu] = (0, import_react192.useState)("");
33790
+ const [activeMenu, setActiveMenu] = (0, import_react193.useState)("");
33743
33791
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NavbarContext.Provider, { value: { activeMenu, setActiveMenu }, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { ...props, className: (0, import_classnames38.default)(Navbar_default.nav, className), children }) });
33744
33792
  }
33745
33793
  function NavbarItem({ label, children, className, ...props }) {
@@ -33757,7 +33805,7 @@ function NavbarItem({ label, children, className, ...props }) {
33757
33805
  }
33758
33806
 
33759
33807
  // src/components/NavMenu.tsx
33760
- var import_react193 = require("react");
33808
+ var import_react194 = require("react");
33761
33809
  var import_classnames39 = __toESM(require_classnames());
33762
33810
 
33763
33811
  // css-modules:E:\dev\umami-react-zen\src\components\NavMenu.module.css
@@ -33765,7 +33813,7 @@ var NavMenu_default = { "navmenu": "NavMenu_navmenu__MzRmN", "item": "NavMenu_it
33765
33813
 
33766
33814
  // src/components/NavMenu.tsx
33767
33815
  var import_jsx_runtime55 = require("react/jsx-runtime");
33768
- var NavMenuContext = (0, import_react193.createContext)(null);
33816
+ var NavMenuContext = (0, import_react194.createContext)(null);
33769
33817
  function NavMenu({
33770
33818
  itemBackgroundColor = "2",
33771
33819
  muteItems,
@@ -33791,7 +33839,7 @@ function NavMenuGroup({
33791
33839
  children,
33792
33840
  ...props
33793
33841
  }) {
33794
- const [minimized, setMinimized] = (0, import_react193.useState)(!!isMinimized);
33842
+ const [minimized, setMinimized] = (0, import_react194.useState)(!!isMinimized);
33795
33843
  const handleClick = () => {
33796
33844
  if (allowMinimize) {
33797
33845
  setMinimized((state) => !state);
@@ -33827,7 +33875,7 @@ function NavMenuGroup({
33827
33875
  );
33828
33876
  }
33829
33877
  function NavMenuItem({ isSelected, className, children, ...props }) {
33830
- const { itemBackgroundColor } = (0, import_react193.useContext)(NavMenuContext);
33878
+ const { itemBackgroundColor } = (0, import_react194.useContext)(NavMenuContext);
33831
33879
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
33832
33880
  Row,
33833
33881
  {
@@ -33841,11 +33889,11 @@ function NavMenuItem({ isSelected, className, children, ...props }) {
33841
33889
  }
33842
33890
 
33843
33891
  // src/components/PasswordField.tsx
33844
- var import_react194 = require("react");
33892
+ var import_react195 = require("react");
33845
33893
  var import_classnames40 = __toESM(require_classnames());
33846
33894
  var import_jsx_runtime56 = require("react/jsx-runtime");
33847
33895
  function PasswordField({ label, className, ...props }) {
33848
- const [show, setShow] = (0, import_react194.useState)(false);
33896
+ const [show, setShow] = (0, import_react195.useState)(false);
33849
33897
  const type = show ? "text" : "password";
33850
33898
  const handleShowPassword = () => setShow((state) => !state);
33851
33899
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
@@ -33952,7 +34000,7 @@ function Radio2({ children, className, ...props }) {
33952
34000
  }
33953
34001
 
33954
34002
  // src/components/SearchField.tsx
33955
- var import_react195 = require("react");
34003
+ var import_react196 = require("react");
33956
34004
  var import_classnames45 = __toESM(require_classnames());
33957
34005
  var import_jsx_runtime61 = require("react/jsx-runtime");
33958
34006
  function SearchField2({
@@ -33966,7 +34014,7 @@ function SearchField2({
33966
34014
  className,
33967
34015
  ...props
33968
34016
  }) {
33969
- const [search, setSearch] = (0, import_react195.useState)(defaultValue);
34017
+ const [search, setSearch] = (0, import_react196.useState)(defaultValue);
33970
34018
  const searchValue = useDebounce(search, delay);
33971
34019
  const handleChange = (value2) => {
33972
34020
  setSearch(value2);
@@ -33980,7 +34028,7 @@ function SearchField2({
33980
34028
  onSearch?.("");
33981
34029
  onChange?.("");
33982
34030
  };
33983
- (0, import_react195.useEffect)(() => {
34031
+ (0, import_react196.useEffect)(() => {
33984
34032
  if (delay > 0) {
33985
34033
  onSearch?.(searchValue);
33986
34034
  }
@@ -34005,7 +34053,7 @@ function SearchField2({
34005
34053
  }
34006
34054
 
34007
34055
  // src/components/Select.tsx
34008
- var import_react196 = require("react");
34056
+ var import_react197 = require("react");
34009
34057
  var import_classnames46 = __toESM(require_classnames());
34010
34058
 
34011
34059
  // css-modules:E:\dev\umami-react-zen\src\components\Select.module.css
@@ -34033,7 +34081,7 @@ function Select2({
34033
34081
  children,
34034
34082
  ...props
34035
34083
  }) {
34036
- const [search, setSearch] = (0, import_react196.useState)("");
34084
+ const [search, setSearch] = (0, import_react197.useState)("");
34037
34085
  const handleChange = (e) => {
34038
34086
  onSelectionChange?.(e);
34039
34087
  onChange?.(e);
@@ -34098,7 +34146,7 @@ function Select2({
34098
34146
  }
34099
34147
 
34100
34148
  // src/components/Sidebar.tsx
34101
- var import_react197 = require("react");
34149
+ var import_react198 = require("react");
34102
34150
  var import_classnames47 = __toESM(require_classnames());
34103
34151
 
34104
34152
  // css-modules:E:\dev\umami-react-zen\src\components\Sidebar.module.css
@@ -34106,7 +34154,7 @@ var Sidebar_default = { "sidebar": "Sidebar_sidebar__NDg2N", "header": "Sidebar_
34106
34154
 
34107
34155
  // src/components/Sidebar.tsx
34108
34156
  var import_jsx_runtime63 = require("react/jsx-runtime");
34109
- var SidebarContext = (0, import_react197.createContext)(null);
34157
+ var SidebarContext = (0, import_react198.createContext)(null);
34110
34158
  function Sidebar({
34111
34159
  itemBackgroundColor = "2",
34112
34160
  isCollapsed,
@@ -34162,7 +34210,7 @@ function SidebarItem({
34162
34210
  children,
34163
34211
  ...props
34164
34212
  }) {
34165
- const { isCollapsed, itemBackgroundColor } = (0, import_react197.useContext)(SidebarContext);
34213
+ const { isCollapsed, itemBackgroundColor } = (0, import_react198.useContext)(SidebarContext);
34166
34214
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)($4e3b923658d69c60$export$8c610744efcf8a1d, { delay: 0, closeDelay: 0, isDisabled: !isCollapsed, children: [
34167
34215
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)($f645667febf57a63$export$35a3bebf7ef2d934, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
34168
34216
  Row,
package/dist/index.mjs CHANGED
@@ -34,12 +34,12 @@ var require_use_sync_external_store_shim_production = __commonJS({
34
34
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
35
35
  }
36
36
  var objectIs = "function" === typeof Object.is ? Object.is : is2;
37
- var useState19 = React5.useState;
38
- var useEffect12 = React5.useEffect;
37
+ var useState20 = React5.useState;
38
+ var useEffect13 = React5.useEffect;
39
39
  var useLayoutEffect3 = React5.useLayoutEffect;
40
40
  var useDebugValue = React5.useDebugValue;
41
41
  function useSyncExternalStore$2(subscribe, getSnapshot) {
42
- var value = getSnapshot(), _useState = useState19({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
42
+ var value = getSnapshot(), _useState = useState20({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
43
43
  useLayoutEffect3(
44
44
  function() {
45
45
  inst.value = value;
@@ -48,7 +48,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
48
48
  },
49
49
  [subscribe, value, getSnapshot]
50
50
  );
51
- useEffect12(
51
+ useEffect13(
52
52
  function() {
53
53
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
54
54
  return subscribe(function() {
@@ -97,7 +97,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
97
97
  "The result of getSnapshot should be cached to avoid an infinite loop"
98
98
  ), didWarnUncachedGetSnapshot = true);
99
99
  }
100
- cachedValue = useState19({
100
+ cachedValue = useState20({
101
101
  inst: { value, getSnapshot }
102
102
  });
103
103
  var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
@@ -109,7 +109,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
109
109
  },
110
110
  [subscribe, value, getSnapshot]
111
111
  );
112
- useEffect12(
112
+ useEffect13(
113
113
  function() {
114
114
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
115
115
  return subscribe(function() {
@@ -135,7 +135,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
135
135
  return getSnapshot();
136
136
  }
137
137
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
138
- var React5 = __import_react2, objectIs = "function" === typeof Object.is ? Object.is : is2, useState19 = React5.useState, useEffect12 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
138
+ var React5 = __import_react2, objectIs = "function" === typeof Object.is ? Object.is : is2, useState20 = React5.useState, useEffect13 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
139
139
  exports.useSyncExternalStore = void 0 !== React5.useSyncExternalStore ? React5.useSyncExternalStore : shim;
140
140
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
141
141
  })();
@@ -26497,7 +26497,7 @@ function createFormControl(props = {}) {
26497
26497
  state: createSubject()
26498
26498
  };
26499
26499
  const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
26500
- const debounce = (callback) => (wait) => {
26500
+ const debounce2 = (callback) => (wait) => {
26501
26501
  clearTimeout(timer);
26502
26502
  timer = setTimeout(callback, wait);
26503
26503
  };
@@ -26610,7 +26610,7 @@ function createFormControl(props = {}) {
26610
26610
  const previousFieldError = get(_formState.errors, name);
26611
26611
  const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isBoolean(isValid) && _formState.isValid !== isValid;
26612
26612
  if (_options.delayError && error) {
26613
- delayErrorCallback = debounce(() => updateErrors(name, error));
26613
+ delayErrorCallback = debounce2(() => updateErrors(name, error));
26614
26614
  delayErrorCallback(_options.delayError);
26615
26615
  } else {
26616
26616
  clearTimeout(timer);
@@ -32445,8 +32445,55 @@ function useInitTheme(preferred, colorScheme) {
32445
32445
  }, [preferred, colorScheme, initTheme]);
32446
32446
  }
32447
32447
 
32448
+ // src/components/hooks/useBreakpoints.ts
32449
+ import { useState as useState7, useEffect as useEffect8, useCallback as useCallback2 } from "react";
32450
+
32451
+ // src/lib/utils.ts
32452
+ var debounce = (func, delay) => {
32453
+ let timer;
32454
+ return (...args) => {
32455
+ clearTimeout(timer);
32456
+ timer = window.setTimeout(() => {
32457
+ func(...args);
32458
+ }, delay);
32459
+ };
32460
+ };
32461
+
32462
+ // src/components/hooks/useBreakpoints.ts
32463
+ var breakpoints = {
32464
+ xs: [0, 576],
32465
+ sm: [576, 768],
32466
+ md: [768, 992],
32467
+ lg: [992, 1200],
32468
+ xl: [1200, Infinity]
32469
+ };
32470
+ var DEBOUNCE_DELAY_MS = 150;
32471
+ function useBreakpoints() {
32472
+ const [breakpoint, setBreakpoint] = useState7(null);
32473
+ const calculateBreakpoint = useCallback2(() => {
32474
+ if (typeof window === "undefined") {
32475
+ return;
32476
+ }
32477
+ const width = window.innerWidth;
32478
+ const currentBreakpointKey = Object.keys(breakpoints).find((key) => {
32479
+ const [min, max] = breakpoints[key];
32480
+ return width >= min && width < max;
32481
+ }) || "xs";
32482
+ setBreakpoint(currentBreakpointKey);
32483
+ }, []);
32484
+ useEffect8(() => {
32485
+ calculateBreakpoint();
32486
+ const debouncedResize = debounce(calculateBreakpoint, DEBOUNCE_DELAY_MS);
32487
+ window.addEventListener("resize", debouncedResize);
32488
+ return () => {
32489
+ window.removeEventListener("resize", debouncedResize);
32490
+ };
32491
+ }, [calculateBreakpoint]);
32492
+ return breakpoint;
32493
+ }
32494
+
32448
32495
  // src/components/Accordion.tsx
32449
- import { useState as useState7 } from "react";
32496
+ import { useState as useState8 } from "react";
32450
32497
  var import_classnames14 = __toESM(require_classnames());
32451
32498
 
32452
32499
  // src/components/Text.tsx
@@ -32520,7 +32567,7 @@ function AccordionItem({
32520
32567
  ...props
32521
32568
  }) {
32522
32569
  const [trigger, panel] = children;
32523
- const [expanded, setExpanded] = useState7(defaultExpanded);
32570
+ const [expanded, setExpanded] = useState8(defaultExpanded);
32524
32571
  const handleExpandedChange = (isExpanded) => {
32525
32572
  requestAnimationFrame(() => setExpanded(isExpanded));
32526
32573
  };
@@ -32944,15 +32991,15 @@ function Code({ asChild, children }) {
32944
32991
 
32945
32992
  // src/components/ConfirmationDialog.tsx
32946
32993
  var import_classnames25 = __toESM(require_classnames());
32947
- import { useState as useState10 } from "react";
32994
+ import { useState as useState11 } from "react";
32948
32995
 
32949
32996
  // src/components/TextField.tsx
32950
- import { useEffect as useEffect8, useState as useState9 } from "react";
32997
+ import { useEffect as useEffect9, useState as useState10 } from "react";
32951
32998
  var import_classnames24 = __toESM(require_classnames());
32952
32999
 
32953
33000
  // src/components/CopyButton.tsx
32954
33001
  var import_classnames23 = __toESM(require_classnames());
32955
- import { useState as useState8, useRef as useRef7 } from "react";
33002
+ import { useState as useState9, useRef as useRef7 } from "react";
32956
33003
 
32957
33004
  // css-modules:E:\dev\umami-react-zen\src\components\CopyButton.module.css
32958
33005
  var CopyButton_default = { "icon": "CopyButton_icon__YTM2Y", "copy-button": "CopyButton_copy-button__MjY1M" };
@@ -32961,7 +33008,7 @@ var CopyButton_default = { "icon": "CopyButton_icon__YTM2Y", "copy-button": "Cop
32961
33008
  import { jsx as jsx37 } from "react/jsx-runtime";
32962
33009
  var TIMEOUT = 2e3;
32963
33010
  function CopyButton({ value, timeout = TIMEOUT, className, children, ...props }) {
32964
- const [copied, setCopied] = useState8(false);
33011
+ const [copied, setCopied] = useState9(false);
32965
33012
  const ref = useRef7(timeout);
32966
33013
  const handleCopy = async () => {
32967
33014
  if (value) {
@@ -32994,13 +33041,13 @@ function TextField2({
32994
33041
  children,
32995
33042
  ...props
32996
33043
  }) {
32997
- const [inputValue, setInputValue] = useState9(defaultValue || value);
33044
+ const [inputValue, setInputValue] = useState10(defaultValue || value);
32998
33045
  const Component = asTextArea ? $216918bed6669f72$export$f5c9f3c2c4054eec : $3985021b0ad6602f$export$f5b8910cec6cf069;
32999
33046
  const handleChange = (value2) => {
33000
33047
  setInputValue(value2);
33001
33048
  return onChange?.(value2);
33002
33049
  };
33003
- useEffect8(() => {
33050
+ useEffect9(() => {
33004
33051
  setInputValue(value);
33005
33052
  }, [value]);
33006
33053
  return /* @__PURE__ */ jsxs20(Fragment6, { children: [
@@ -33043,7 +33090,7 @@ function ConfirmationDialog({
33043
33090
  children,
33044
33091
  ...props
33045
33092
  }) {
33046
- const [canSave, setCanSave] = useState10(false);
33093
+ const [canSave, setCanSave] = useState11(false);
33047
33094
  const handleChange = (e) => {
33048
33095
  setCanSave(e.target.value === value);
33049
33096
  };
@@ -33219,7 +33266,7 @@ function Dots({ size = "md", className, ...props }) {
33219
33266
 
33220
33267
  // src/components/FloatingTooltip.tsx
33221
33268
  var import_classnames31 = __toESM(require_classnames());
33222
- import { useEffect as useEffect9, useState as useState11 } from "react";
33269
+ import { useEffect as useEffect10, useState as useState12 } from "react";
33223
33270
 
33224
33271
  // src/components/Tooltip.tsx
33225
33272
  var import_classnames30 = __toESM(require_classnames());
@@ -33245,8 +33292,8 @@ var FloatingTooltip_default = { "floating": "FloatingTooltip_floating__ZjM4N" };
33245
33292
  // src/components/FloatingTooltip.tsx
33246
33293
  import { jsx as jsx45 } from "react/jsx-runtime";
33247
33294
  function FloatingTooltip({ className, style, children, ...props }) {
33248
- const [position, setPosition] = useState11({ x: -1e3, y: -1e3 });
33249
- useEffect9(() => {
33295
+ const [position, setPosition] = useState12({ x: -1e3, y: -1e3 });
33296
+ useEffect10(() => {
33250
33297
  const handler = (e) => {
33251
33298
  setPosition({ x: e.clientX, y: e.clientY });
33252
33299
  };
@@ -33302,7 +33349,7 @@ function Heading2({
33302
33349
  }
33303
33350
 
33304
33351
  // src/components/HoverTrigger.tsx
33305
- import { useRef as useRef8, useState as useState12, useEffect as useEffect10 } from "react";
33352
+ import { useRef as useRef8, useState as useState13, useEffect as useEffect11 } from "react";
33306
33353
 
33307
33354
  // css-modules:E:\dev\umami-react-zen\src\components\HoverTrigger.module.css
33308
33355
  var HoverTrigger_default = { "wrapper": "HoverTrigger_wrapper__NGFlN" };
@@ -33319,11 +33366,11 @@ function HoverTrigger({
33319
33366
  }) {
33320
33367
  const [triggerElement, popupElement] = children;
33321
33368
  const triggerRef = useRef8(null);
33322
- const [open, setOpen] = useState12(isOpen);
33369
+ const [open, setOpen] = useState13(isOpen);
33323
33370
  const isOverMenu = useRef8(false);
33324
33371
  const isOverButton = useRef8(false);
33325
33372
  const timeout = useRef8(null);
33326
- useEffect10(() => {
33373
+ useEffect11(() => {
33327
33374
  if (isOpen !== open) {
33328
33375
  setOpen(isOpen);
33329
33376
  }
@@ -33432,7 +33479,7 @@ function Image({
33432
33479
 
33433
33480
  // src/components/InlineEditField.tsx
33434
33481
  var import_classnames34 = __toESM(require_classnames());
33435
- import { useState as useState13, useCallback as useCallback2 } from "react";
33482
+ import { useState as useState14, useCallback as useCallback3 } from "react";
33436
33483
 
33437
33484
  // css-modules:E:\dev\umami-react-zen\src\components\InlineEditField.module.css
33438
33485
  var InlineEditField_default = { "edit": "InlineEditField_edit__MDliZ", "icon": "InlineEditField_icon__ZjE1O" };
@@ -33450,8 +33497,8 @@ function InlineEditField({
33450
33497
  onCancel,
33451
33498
  ...props
33452
33499
  }) {
33453
- const [value, setValue] = useState13(defaultValue);
33454
- const [edit, setEdit] = useState13(defaultEdit);
33500
+ const [value, setValue] = useState14(defaultValue);
33501
+ const [edit, setEdit] = useState14(defaultEdit);
33455
33502
  const handleEdit = () => setEdit(true);
33456
33503
  const handleChange = (e) => {
33457
33504
  const val = e.target.value;
@@ -33462,7 +33509,7 @@ function InlineEditField({
33462
33509
  setEdit(false);
33463
33510
  onCommit?.(value);
33464
33511
  };
33465
- const handleCancel = useCallback2(() => {
33512
+ const handleCancel = useCallback3(() => {
33466
33513
  setEdit(false);
33467
33514
  setValue(defaultValue);
33468
33515
  onCancel?.();
@@ -33606,7 +33653,7 @@ var import_classnames38 = __toESM(require_classnames());
33606
33653
  import {
33607
33654
  createContext as createContext3,
33608
33655
  useContext as useContext5,
33609
- useState as useState14
33656
+ useState as useState15
33610
33657
  } from "react";
33611
33658
 
33612
33659
  // css-modules:E:\dev\umami-react-zen\src\components\Navbar.module.css
@@ -33623,7 +33670,7 @@ var useNavigationContext = () => {
33623
33670
  return context;
33624
33671
  };
33625
33672
  function Navbar({ showArrow = true, className, children, ...props }) {
33626
- const [activeMenu, setActiveMenu] = useState14("");
33673
+ const [activeMenu, setActiveMenu] = useState15("");
33627
33674
  return /* @__PURE__ */ jsx54(NavbarContext.Provider, { value: { activeMenu, setActiveMenu }, children: /* @__PURE__ */ jsx54("div", { ...props, className: (0, import_classnames38.default)(Navbar_default.nav, className), children }) });
33628
33675
  }
33629
33676
  function NavbarItem({ label, children, className, ...props }) {
@@ -33642,7 +33689,7 @@ function NavbarItem({ label, children, className, ...props }) {
33642
33689
 
33643
33690
  // src/components/NavMenu.tsx
33644
33691
  var import_classnames39 = __toESM(require_classnames());
33645
- import { createContext as createContext4, useContext as useContext6, useState as useState15 } from "react";
33692
+ import { createContext as createContext4, useContext as useContext6, useState as useState16 } from "react";
33646
33693
 
33647
33694
  // css-modules:E:\dev\umami-react-zen\src\components\NavMenu.module.css
33648
33695
  var NavMenu_default = { "navmenu": "NavMenu_navmenu__MzRmN", "item": "NavMenu_item__ZWRjZ", "selected": "NavMenu_selected__ZDU1N", "muted": "NavMenu_muted__MTgxN", "title": "NavMenu_title__ZjJhN", "clickable": "NavMenu_clickable__Mjg0O" };
@@ -33675,7 +33722,7 @@ function NavMenuGroup({
33675
33722
  children,
33676
33723
  ...props
33677
33724
  }) {
33678
- const [minimized, setMinimized] = useState15(!!isMinimized);
33725
+ const [minimized, setMinimized] = useState16(!!isMinimized);
33679
33726
  const handleClick = () => {
33680
33727
  if (allowMinimize) {
33681
33728
  setMinimized((state) => !state);
@@ -33725,11 +33772,11 @@ function NavMenuItem({ isSelected, className, children, ...props }) {
33725
33772
  }
33726
33773
 
33727
33774
  // src/components/PasswordField.tsx
33728
- import { useState as useState16 } from "react";
33775
+ import { useState as useState17 } from "react";
33729
33776
  var import_classnames40 = __toESM(require_classnames());
33730
33777
  import { Fragment as Fragment10, jsx as jsx56, jsxs as jsxs32 } from "react/jsx-runtime";
33731
33778
  function PasswordField({ label, className, ...props }) {
33732
- const [show, setShow] = useState16(false);
33779
+ const [show, setShow] = useState17(false);
33733
33780
  const type = show ? "text" : "password";
33734
33781
  const handleShowPassword = () => setShow((state) => !state);
33735
33782
  return /* @__PURE__ */ jsxs32(Fragment10, { children: [
@@ -33836,7 +33883,7 @@ function Radio2({ children, className, ...props }) {
33836
33883
  }
33837
33884
 
33838
33885
  // src/components/SearchField.tsx
33839
- import { useState as useState17, useEffect as useEffect11 } from "react";
33886
+ import { useState as useState18, useEffect as useEffect12 } from "react";
33840
33887
  var import_classnames45 = __toESM(require_classnames());
33841
33888
  import { Fragment as Fragment13, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
33842
33889
  function SearchField2({
@@ -33850,7 +33897,7 @@ function SearchField2({
33850
33897
  className,
33851
33898
  ...props
33852
33899
  }) {
33853
- const [search, setSearch] = useState17(defaultValue);
33900
+ const [search, setSearch] = useState18(defaultValue);
33854
33901
  const searchValue = useDebounce(search, delay);
33855
33902
  const handleChange = (value2) => {
33856
33903
  setSearch(value2);
@@ -33864,7 +33911,7 @@ function SearchField2({
33864
33911
  onSearch?.("");
33865
33912
  onChange?.("");
33866
33913
  };
33867
- useEffect11(() => {
33914
+ useEffect12(() => {
33868
33915
  if (delay > 0) {
33869
33916
  onSearch?.(searchValue);
33870
33917
  }
@@ -33889,7 +33936,7 @@ function SearchField2({
33889
33936
  }
33890
33937
 
33891
33938
  // src/components/Select.tsx
33892
- import { useState as useState18 } from "react";
33939
+ import { useState as useState19 } from "react";
33893
33940
  var import_classnames46 = __toESM(require_classnames());
33894
33941
 
33895
33942
  // css-modules:E:\dev\umami-react-zen\src\components\Select.module.css
@@ -33917,7 +33964,7 @@ function Select2({
33917
33964
  children,
33918
33965
  ...props
33919
33966
  }) {
33920
- const [search, setSearch] = useState18("");
33967
+ const [search, setSearch] = useState19("");
33921
33968
  const handleChange = (e) => {
33922
33969
  onSelectionChange?.(e);
33923
33970
  onChange?.(e);
@@ -34389,6 +34436,7 @@ export {
34389
34436
  TooltipBubble,
34390
34437
  $4e3b923658d69c60$export$8c610744efcf8a1d as TooltipTrigger,
34391
34438
  ZenProvider,
34439
+ useBreakpoints,
34392
34440
  useDebounce,
34393
34441
  useNavigationContext,
34394
34442
  useTheme,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/react-zen",
3
- "version": "0.190.0",
3
+ "version": "0.191.0",
4
4
  "description": "Modern, minimalist React component library",
5
5
  "author": "Umami <hello@umami.is>",
6
6
  "license": "MIT",