@umami/react-zen 0.181.0 → 0.183.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
@@ -3,6 +3,7 @@ export { BreadcrumbProps, BreadcrumbsProps, DialogTrigger, FileTrigger, Focusabl
3
3
  import * as react from 'react';
4
4
  import { HTMLAttributes, ReactNode, ReactElement, Dispatch, SetStateAction } from 'react';
5
5
  import { UseFormProps, SubmitHandler, UseFormReturn, ControllerProps, ControllerRenderProps, FieldValues, ControllerFieldState, UseFormStateReturn, RegisterOptions } from 'react-hook-form';
6
+ import * as zustand from 'zustand';
6
7
 
7
8
  interface FormProps extends UseFormProps, Omit<HTMLAttributes<HTMLFormElement>, 'children'> {
8
9
  autoComplete?: string;
@@ -222,11 +223,13 @@ declare function ToastProvider({ children, ...props }: ToastProviderProps): reac
222
223
 
223
224
  declare function useDebounce(value: string, delay: number): string;
224
225
 
225
- declare function setTheme(theme: string): void;
226
- declare function useTheme(defaultTheme?: string): {
227
- theme: string;
228
- setTheme: typeof setTheme;
229
- };
226
+ type Theme = 'light' | 'dark';
227
+ interface ThemeState {
228
+ theme: Theme;
229
+ setTheme: (theme: Theme) => void;
230
+ initTheme: (preferred?: Theme, colorScheme?: 'light' | 'dark' | 'system') => void;
231
+ }
232
+ declare const useTheme: zustand.UseBoundStore<zustand.StoreApi<ThemeState>>;
230
233
 
231
234
  type ToastVariant = 'success' | 'error';
232
235
  interface ToastOptions {
@@ -261,7 +264,7 @@ interface AlertBannerProps {
261
264
  title?: ReactNode;
262
265
  description?: ReactNode;
263
266
  icon?: ReactNode;
264
- variant?: 'error';
267
+ variant?: 'error' | 'info';
265
268
  align?: 'start' | 'center' | 'end';
266
269
  allowClose?: boolean;
267
270
  onClose?: () => void;
@@ -323,7 +326,7 @@ interface ListProps extends ListBoxProps<any> {
323
326
  value?: string[];
324
327
  onChange?: (value: string[]) => void;
325
328
  }
326
- declare function List({ items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, label, value, onChange, className, selectedKeys, defaultSelectedKeys, onSelectionChange, style, children, ...props }: ListProps): react.JSX.Element;
329
+ declare function List({ id, items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, label, value, onChange, className, selectedKeys, defaultSelectedKeys, onSelectionChange, style, children, ...props }: ListProps): react.JSX.Element;
327
330
  interface ListItemProps extends ListBoxItemProps<any> {
328
331
  showCheckmark?: boolean;
329
332
  }
@@ -703,10 +706,7 @@ interface TextFieldProps extends TextFieldProps$1 {
703
706
  }
704
707
  declare function TextField({ value, defaultValue, label, placeholder, allowCopy, asTextArea, resize, onChange, isReadOnly, isDisabled, className, children, ...props }: TextFieldProps): react.JSX.Element;
705
708
 
706
- interface ThemeButtonProps extends ButtonProps {
707
- defaultTheme?: string;
708
- }
709
- declare function ThemeButton({ className, variant, defaultTheme, onPress, ...props }: ThemeButtonProps): react.JSX.Element;
709
+ declare function ThemeButton({ className, variant, onPress, ...props }: ButtonProps): react.JSX.Element;
710
710
 
711
711
  interface ToggleProps extends ToggleButtonProps {
712
712
  label?: string;
@@ -727,11 +727,11 @@ interface ToggleGroupItemProps extends TagProps {
727
727
  declare function ToggleGroupItem({ className, children, ...props }: ToggleGroupItemProps): react.JSX.Element;
728
728
 
729
729
  interface ZenProviderProps {
730
- theme?: string;
730
+ theme?: Theme;
731
731
  colorScheme?: 'light' | 'dark' | 'system';
732
732
  toast?: ToasterProps;
733
733
  children: ReactNode;
734
734
  }
735
- declare function ZenProvider({ children, ...props }: ZenProviderProps): react.JSX.Element;
735
+ declare function ZenProvider({ children, theme, colorScheme, toast, }: ZenProviderProps): react.JSX.Element;
736
736
 
737
- 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, 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, type ThemeButtonProps, 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 };
737
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { BreadcrumbProps, BreadcrumbsProps, DialogTrigger, FileTrigger, Focusabl
3
3
  import * as react from 'react';
4
4
  import { HTMLAttributes, ReactNode, ReactElement, Dispatch, SetStateAction } from 'react';
5
5
  import { UseFormProps, SubmitHandler, UseFormReturn, ControllerProps, ControllerRenderProps, FieldValues, ControllerFieldState, UseFormStateReturn, RegisterOptions } from 'react-hook-form';
6
+ import * as zustand from 'zustand';
6
7
 
7
8
  interface FormProps extends UseFormProps, Omit<HTMLAttributes<HTMLFormElement>, 'children'> {
8
9
  autoComplete?: string;
@@ -222,11 +223,13 @@ declare function ToastProvider({ children, ...props }: ToastProviderProps): reac
222
223
 
223
224
  declare function useDebounce(value: string, delay: number): string;
224
225
 
225
- declare function setTheme(theme: string): void;
226
- declare function useTheme(defaultTheme?: string): {
227
- theme: string;
228
- setTheme: typeof setTheme;
229
- };
226
+ type Theme = 'light' | 'dark';
227
+ interface ThemeState {
228
+ theme: Theme;
229
+ setTheme: (theme: Theme) => void;
230
+ initTheme: (preferred?: Theme, colorScheme?: 'light' | 'dark' | 'system') => void;
231
+ }
232
+ declare const useTheme: zustand.UseBoundStore<zustand.StoreApi<ThemeState>>;
230
233
 
231
234
  type ToastVariant = 'success' | 'error';
232
235
  interface ToastOptions {
@@ -261,7 +264,7 @@ interface AlertBannerProps {
261
264
  title?: ReactNode;
262
265
  description?: ReactNode;
263
266
  icon?: ReactNode;
264
- variant?: 'error';
267
+ variant?: 'error' | 'info';
265
268
  align?: 'start' | 'center' | 'end';
266
269
  allowClose?: boolean;
267
270
  onClose?: () => void;
@@ -323,7 +326,7 @@ interface ListProps extends ListBoxProps<any> {
323
326
  value?: string[];
324
327
  onChange?: (value: string[]) => void;
325
328
  }
326
- declare function List({ items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, label, value, onChange, className, selectedKeys, defaultSelectedKeys, onSelectionChange, style, children, ...props }: ListProps): react.JSX.Element;
329
+ declare function List({ id, items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, label, value, onChange, className, selectedKeys, defaultSelectedKeys, onSelectionChange, style, children, ...props }: ListProps): react.JSX.Element;
327
330
  interface ListItemProps extends ListBoxItemProps<any> {
328
331
  showCheckmark?: boolean;
329
332
  }
@@ -703,10 +706,7 @@ interface TextFieldProps extends TextFieldProps$1 {
703
706
  }
704
707
  declare function TextField({ value, defaultValue, label, placeholder, allowCopy, asTextArea, resize, onChange, isReadOnly, isDisabled, className, children, ...props }: TextFieldProps): react.JSX.Element;
705
708
 
706
- interface ThemeButtonProps extends ButtonProps {
707
- defaultTheme?: string;
708
- }
709
- declare function ThemeButton({ className, variant, defaultTheme, onPress, ...props }: ThemeButtonProps): react.JSX.Element;
709
+ declare function ThemeButton({ className, variant, onPress, ...props }: ButtonProps): react.JSX.Element;
710
710
 
711
711
  interface ToggleProps extends ToggleButtonProps {
712
712
  label?: string;
@@ -727,11 +727,11 @@ interface ToggleGroupItemProps extends TagProps {
727
727
  declare function ToggleGroupItem({ className, children, ...props }: ToggleGroupItemProps): react.JSX.Element;
728
728
 
729
729
  interface ZenProviderProps {
730
- theme?: string;
730
+ theme?: Theme;
731
731
  colorScheme?: 'light' | 'dark' | 'system';
732
732
  toast?: ToasterProps;
733
733
  children: ReactNode;
734
734
  }
735
- declare function ZenProvider({ children, ...props }: ZenProviderProps): react.JSX.Element;
735
+ declare function ZenProvider({ children, theme, colorScheme, toast, }: ZenProviderProps): react.JSX.Element;
736
736
 
737
- 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, 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, type ThemeButtonProps, 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 };
737
+ 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, 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 };