@umami/react-zen 0.238.0 → 0.239.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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { Button as Button$1, DisclosureGroup, Disclosure, DisclosurePanel, Dialog as Dialog$1, Breadcrumbs as Breadcrumbs$1, Breadcrumb as Breadcrumb$1, Calendar as Calendar$1, Heading as Heading$1, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, Checkbox as Checkbox$1, Label as Label$1, ListBox, ListBoxItem, Separator, ListBoxSection, Header, Popover as Popover$1, ComboBox as ComboBox$1, Group, Input, TextField as TextField$1, TextArea, Table as Table$1, TableHeader as TableHeader$1, TableBody as TableBody$1, Row as Row$1, Column as Column$1, Cell, Tooltip as Tooltip$1, OverlayArrow, Menu as Menu$1, MenuItem as MenuItem$1, MenuSection as MenuSection$1, SubmenuTrigger, ModalOverlay, Modal as Modal$1, ProgressBar as ProgressBar$1, RadioGroup as RadioGroup$1, Radio as Radio$1, SearchField as SearchField$1, Select as Select$1, SelectValue, TooltipTrigger, Focusable, Slider as Slider$1, SliderOutput, SliderTrack, Switch as Switch$1, Tabs as Tabs$1, TabList as TabList$1, Tab as Tab$1, TabPanel as TabPanel$1, ToggleButton, TagGroup, TagList, Tag, SliderThumb } from 'react-aria-components';
1
+ import { Button as Button$1, DisclosureGroup, Disclosure, DisclosurePanel, Dialog as Dialog$1, Breadcrumbs as Breadcrumbs$1, Breadcrumb as Breadcrumb$1, Calendar as Calendar$1, Heading as Heading$1, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, Checkbox as Checkbox$1, Label as Label$1, ListBox, ListBoxItem, Separator, ListBoxSection, Header, Popover as Popover$1, ComboBox as ComboBox$1, Group, Input, TextField as TextField$1, TextArea, Table as Table$1, TableHeader as TableHeader$1, TableBody as TableBody$1, Row as Row$1, Column as Column$1, Cell, Tooltip as Tooltip$1, OverlayArrow, Menu as Menu$1, MenuItem as MenuItem$1, MenuSection as MenuSection$1, SubmenuTrigger, ModalOverlay, Modal as Modal$1, ProgressBar as ProgressBar$1, RadioGroup as RadioGroup$1, Radio as Radio$1, SearchField as SearchField$1, Select as Select$1, SelectValue, Slider as Slider$1, SliderOutput, SliderTrack, Switch as Switch$1, Tabs as Tabs$1, TabList as TabList$1, Tab as Tab$1, TabPanel as TabPanel$1, ToggleButton, TagGroup, TagList, Tag, SliderThumb } from 'react-aria-components';
2
2
  export { DialogTrigger, FileTrigger, Focusable, MenuTrigger, Pressable, RouterProvider, SubmenuTrigger, TooltipTrigger } from 'react-aria-components';
3
3
  import * as lucide_react_star from 'lucide-react';
4
4
  import { forwardRef, createContext, isValidElement, cloneElement, createElement, Fragment as Fragment$1, useState, useRef, useEffect, useId, Children, useCallback, useLayoutEffect, useContext } from 'react';
@@ -3107,8 +3107,9 @@ function CopyButton({ value, timeout = TIMEOUT, className, children, ...props })
3107
3107
  const [copied, setCopied] = useState(false);
3108
3108
  const ref = useRef(timeout);
3109
3109
  const handleCopy = async () => {
3110
- if (value) {
3111
- await navigator.clipboard.writeText(value);
3110
+ const text2 = typeof value === "function" ? value() : value;
3111
+ if (text2) {
3112
+ await navigator.clipboard.writeText(text2);
3112
3113
  setCopied(true);
3113
3114
  clearTimeout(ref.current);
3114
3115
  ref.current = +setTimeout(() => setCopied(false), timeout);
@@ -4134,21 +4135,6 @@ function useToast() {
4134
4135
  };
4135
4136
  return { toast: toast2, toasts };
4136
4137
  }
4137
- function IconLabel({
4138
- icon,
4139
- label,
4140
- iconProps,
4141
- labelProps,
4142
- showLabel = true,
4143
- children,
4144
- ...props
4145
- }) {
4146
- return /* @__PURE__ */ jsxs(Row, { alignItems: "center", gap: true, ...props, children: [
4147
- icon && /* @__PURE__ */ jsx(Icon, { ...iconProps, children: icon }),
4148
- showLabel && label && /* @__PURE__ */ jsx(Text, { ...labelProps, children: label }),
4149
- showLabel && children
4150
- ] });
4151
- }
4152
4138
  var objectFitMap = {
4153
4139
  fill: "object-fill",
4154
4140
  contain: "object-contain",
@@ -4240,7 +4226,11 @@ function MenuItem({
4240
4226
  className
4241
4227
  ),
4242
4228
  children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
4243
- /* @__PURE__ */ jsx(IconLabel, { icon, label, children }),
4229
+ /* @__PURE__ */ jsxs(Row, { alignItems: "center", gap: true, children: [
4230
+ icon && /* @__PURE__ */ jsx(Icon, { children: icon }),
4231
+ label && /* @__PURE__ */ jsx(Text, { children: label }),
4232
+ children
4233
+ ] }),
4244
4234
  showChecked && isSelected && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", children: /* @__PURE__ */ jsx(icons_exports.Check, {}) }),
4245
4235
  showSubMenuIcon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", children: /* @__PURE__ */ jsx(icons_exports.ChevronRight, {}) })
4246
4236
  ] })
@@ -4369,73 +4359,6 @@ function NavbarItem({
4369
4359
  }
4370
4360
  );
4371
4361
  }
4372
- var NavMenuContext = createContext(null);
4373
- function NavMenu({ muteItems, onItemClick, className, children, ...props }) {
4374
- return /* @__PURE__ */ jsx(NavMenuContext.Provider, { value: { onItemClick }, children: /* @__PURE__ */ jsx(Column, { ...props, color: muteItems ? "muted" : void 0, className, children }) });
4375
- }
4376
- function NavMenuGroup({
4377
- title,
4378
- allowMinimize = true,
4379
- isMinimized,
4380
- className,
4381
- children,
4382
- ...props
4383
- }) {
4384
- const [minimized, setMinimized] = useState(!!isMinimized);
4385
- const handleClick = () => {
4386
- if (allowMinimize) {
4387
- setMinimized((state) => !state);
4388
- }
4389
- };
4390
- return /* @__PURE__ */ jsxs(
4391
- Column,
4392
- {
4393
- ...props,
4394
- className: cn(
4395
- className,
4396
- allowMinimize && "cursor-pointer",
4397
- allowMinimize && minimized && "[&_.navmenu-children]:hidden"
4398
- ),
4399
- children: [
4400
- /* @__PURE__ */ jsxs(
4401
- Row,
4402
- {
4403
- paddingY: "2",
4404
- paddingX: "3",
4405
- alignItems: "center",
4406
- justifyContent: "space-between",
4407
- onClick: handleClick,
4408
- children: [
4409
- /* @__PURE__ */ jsx(Text, { size: "xs", weight: "semibold", color: "muted", transform: "uppercase", children: title }),
4410
- allowMinimize && /* @__PURE__ */ jsx(Icon, { rotate: minimized ? 0 : 90, color: "muted", children: /* @__PURE__ */ jsx(icons_exports.ChevronRight, {}) })
4411
- ]
4412
- }
4413
- ),
4414
- !minimized && /* @__PURE__ */ jsx(Column, { className: "navmenu-children", children })
4415
- ]
4416
- }
4417
- );
4418
- }
4419
- function NavMenuItem({ isSelected, className, children, ...props }) {
4420
- const { onItemClick } = useContext(NavMenuContext);
4421
- return /* @__PURE__ */ jsx(
4422
- Row,
4423
- {
4424
- ...props,
4425
- paddingY: "2",
4426
- paddingX: "3",
4427
- borderRadius: "md",
4428
- onClick: onItemClick,
4429
- className: cn(
4430
- "cursor-pointer",
4431
- "hover:bg-interactive",
4432
- isSelected && "bg-interactive font-medium",
4433
- className
4434
- ),
4435
- children
4436
- }
4437
- );
4438
- }
4439
4362
  var PALETTE_LABELS = {
4440
4363
  neutral: "Neutral",
4441
4364
  slate: "Slate",
@@ -4808,83 +4731,6 @@ function Select({
4808
4731
  }
4809
4732
  );
4810
4733
  }
4811
- var SidebarContext = createContext(null);
4812
- function Sidebar({ isCollapsed, muteItems, className, children, ...props }) {
4813
- return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: { isCollapsed }, children: /* @__PURE__ */ jsx(
4814
- Column,
4815
- {
4816
- border: "right",
4817
- ...props,
4818
- className: cn(
4819
- "text-base",
4820
- isCollapsed && "w-16",
4821
- muteItems && "text-foreground-muted",
4822
- className
4823
- ),
4824
- children
4825
- }
4826
- ) });
4827
- }
4828
- function SidebarSection({
4829
- title,
4830
- className,
4831
- children,
4832
- ...props
4833
- }) {
4834
- return /* @__PURE__ */ jsxs(Column, { ...props, paddingY: "2", className, children: [
4835
- title && /* @__PURE__ */ jsx(Box, { paddingX: "4", paddingY: "2", children: /* @__PURE__ */ jsx(Text, { size: "xs", weight: "semibold", transform: "uppercase", color: "muted", children: title }) }),
4836
- /* @__PURE__ */ jsx(Column, { children })
4837
- ] });
4838
- }
4839
- function SidebarHeader({
4840
- label,
4841
- icon,
4842
- className,
4843
- children,
4844
- ...props
4845
- }) {
4846
- return /* @__PURE__ */ jsxs(Row, { ...props, paddingX: "4", paddingY: "3", gap: "3", alignItems: "center", className, children: [
4847
- icon && /* @__PURE__ */ jsx(Icon, { size: "sm", children: icon }),
4848
- label && /* @__PURE__ */ jsx(Text, { weight: "semibold", children: label }),
4849
- children
4850
- ] });
4851
- }
4852
- function SidebarItem({
4853
- label,
4854
- icon,
4855
- isSelected,
4856
- className,
4857
- children,
4858
- ...props
4859
- }) {
4860
- const { isCollapsed } = useContext(SidebarContext);
4861
- return /* @__PURE__ */ jsxs(TooltipTrigger, { delay: 0, closeDelay: 0, isDisabled: !isCollapsed, children: [
4862
- /* @__PURE__ */ jsx(Focusable, { children: /* @__PURE__ */ jsxs(
4863
- Row,
4864
- {
4865
- ...props,
4866
- paddingX: isCollapsed ? "0" : "4",
4867
- paddingY: "2",
4868
- gap: "3",
4869
- alignItems: "center",
4870
- justifyContent: isCollapsed ? "center" : void 0,
4871
- borderRadius: "md",
4872
- className: cn(
4873
- "cursor-pointer",
4874
- "hover:bg-interactive",
4875
- isSelected && "bg-interactive font-medium",
4876
- className
4877
- ),
4878
- children: [
4879
- icon && /* @__PURE__ */ jsx(Icon, { size: "sm", children: icon }),
4880
- label && !isCollapsed && /* @__PURE__ */ jsx(Text, { children: label }),
4881
- children
4882
- ]
4883
- }
4884
- ) }),
4885
- /* @__PURE__ */ jsx(Tooltip, { placement: "right", children: label })
4886
- ] });
4887
- }
4888
4734
  function Fill2({ percentage }) {
4889
4735
  const width = `calc(10px + ${percentage}% - ${percentage * 0.2}px)`;
4890
4736
  return /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 rounded-full bg-primary", style: { width } });
@@ -5220,6 +5066,6 @@ function ZenProvider({
5220
5066
  return /* @__PURE__ */ jsx(ToastProvider, { ...toast2, children });
5221
5067
  }
5222
5068
 
5223
- export { Accordion, AccordionItem, AlertBanner, AlertDialog, Blockquote, Box, Breadcrumb, Breadcrumbs, Button, Calendar, Checkbox, Code, Column, ComboBox, ConfirmationDialog, Container, CopyButton, DataCard, DataColumn, DataTable, Dialog, Dots, Flexbox, FloatingTooltip, Form, FormButtons, FormController, FormField, FormFieldArray, FormResetButton, FormSubmitButton, Grid, Heading, HoverTrigger, Icon, IconLabel, Image, Label, List, ListItem, ListSection, ListSeparator, Loading, LoadingButton, Menu, MenuItem, MenuSection, MenuSeparator, Modal, NavMenu, NavMenuGroup, NavMenuItem, Navbar, NavbarContext, NavbarItem, PALETTES, PaletteSwitcher, PasswordField, Popover, ProgressBar, ProgressCircle, Radio, RadioGroup, Row, SearchField, Select, Sidebar, SidebarHeader, SidebarItem, SidebarSection, Slider, Spinner, StatusLight, SubMenuTrigger, Switch, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Tabs, Text, TextField, ThemeButton, ThemeSwitcher, Toast, ToastContext, ToastProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipBubble, ZenProvider, cn, getCssColorValue, isHeightPreset, isMaxHeightPreset, isMaxWidthPreset, isMinHeightPreset, isMinWidthPreset, isWidthPreset, mapAlignContent, mapAlignItems, mapAlignSelf, mapBackgroundColor, mapBorder, mapBorderColor, mapBorderRadius, mapBorderWidth, mapCursor, mapDisplay, mapFlexDirection, mapFlexWrap, mapFontSize, mapFontWeight, mapGap, mapGridAutoFlow, mapGridColumns, mapGridRows, mapHeadingSize, mapHeight, mapJustifyContent, mapJustifyItems, mapLetterSpacing, mapLineHeight, mapMargin, mapMaxHeight, mapMaxWidth, mapMinHeight, mapMinWidth, mapOpacity, mapOverflow, mapPadding, mapPointerEvents, mapPosition, mapShadow, mapStateStyles, mapTextAlign, mapTextColor, mapTextDecorationStyle, mapTextIndent, mapTextTransform, mapTextWrap, mapVerticalAlign, mapWhitespace, mapWidth, mapWordBreak, removeToast, resolveRender, useBreakpoint, useDebounce, useInitTheme, useNavigationContext, useTheme, useToast };
5069
+ export { Accordion, AccordionItem, AlertBanner, AlertDialog, Blockquote, Box, Breadcrumb, Breadcrumbs, Button, Calendar, Checkbox, Code, Column, ComboBox, ConfirmationDialog, Container, CopyButton, DataCard, DataColumn, DataTable, Dialog, Dots, Flexbox, FloatingTooltip, Form, FormButtons, FormController, FormField, FormFieldArray, FormResetButton, FormSubmitButton, Grid, Heading, HoverTrigger, Icon, Image, Label, List, ListItem, ListSection, ListSeparator, Loading, LoadingButton, Menu, MenuItem, MenuSection, MenuSeparator, Modal, Navbar, NavbarContext, NavbarItem, PALETTES, PaletteSwitcher, PasswordField, Popover, ProgressBar, ProgressCircle, Radio, RadioGroup, Row, SearchField, Select, Slider, Spinner, StatusLight, SubMenuTrigger, Switch, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Tabs, Text, TextField, ThemeButton, ThemeSwitcher, Toast, ToastContext, ToastProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipBubble, ZenProvider, cn, getCssColorValue, isHeightPreset, isMaxHeightPreset, isMaxWidthPreset, isMinHeightPreset, isMinWidthPreset, isWidthPreset, mapAlignContent, mapAlignItems, mapAlignSelf, mapBackgroundColor, mapBorder, mapBorderColor, mapBorderRadius, mapBorderWidth, mapCursor, mapDisplay, mapFlexDirection, mapFlexWrap, mapFontSize, mapFontWeight, mapGap, mapGridAutoFlow, mapGridColumns, mapGridRows, mapHeadingSize, mapHeight, mapJustifyContent, mapJustifyItems, mapLetterSpacing, mapLineHeight, mapMargin, mapMaxHeight, mapMaxWidth, mapMinHeight, mapMinWidth, mapOpacity, mapOverflow, mapPadding, mapPointerEvents, mapPosition, mapShadow, mapStateStyles, mapTextAlign, mapTextColor, mapTextDecorationStyle, mapTextIndent, mapTextTransform, mapTextWrap, mapVerticalAlign, mapWhitespace, mapWidth, mapWordBreak, removeToast, resolveRender, useBreakpoint, useDebounce, useInitTheme, useNavigationContext, useTheme, useToast };
5224
5070
  //# sourceMappingURL=index.mjs.map
5225
5071
  //# sourceMappingURL=index.mjs.map