@cladd-ui/react 0.0.13 → 0.0.14

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.
Files changed (98) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/components/Backdrop.js +1 -1
  3. package/components/Button.d.ts +2 -2
  4. package/components/Button.js +5 -5
  5. package/components/Checkbox.d.ts +1 -1
  6. package/components/Checkbox.js +5 -5
  7. package/components/Chip.d.ts +1 -1
  8. package/components/Chip.js +2 -2
  9. package/components/Dialog.d.ts +2 -2
  10. package/components/Dialog.js +12 -12
  11. package/components/DialogsPortal.js +2 -2
  12. package/components/DialogsPortalContext.d.ts +1 -1
  13. package/components/FocusableLayer.d.ts +1 -1
  14. package/components/FocusableLayer.js +2 -2
  15. package/components/Input.d.ts +1 -1
  16. package/components/Input.js +7 -7
  17. package/components/Link.js +1 -1
  18. package/components/List.js +1 -1
  19. package/components/ListButton.d.ts +3 -3
  20. package/components/ListButton.js +2 -2
  21. package/components/ListItem.js +1 -1
  22. package/components/ListSeparator.js +1 -1
  23. package/components/ListTitle.js +1 -1
  24. package/components/NumberField.d.ts +2 -2
  25. package/components/NumberField.js +6 -6
  26. package/components/OTPField.d.ts +1 -1
  27. package/components/OTPField.js +5 -5
  28. package/components/OTPFieldContext.d.ts +1 -1
  29. package/components/OTPFieldInput.js +3 -3
  30. package/components/OTPFieldSeparator.js +1 -1
  31. package/components/Popover.d.ts +2 -2
  32. package/components/Popover.js +6 -6
  33. package/components/Popup.d.ts +1 -1
  34. package/components/Popup.js +8 -8
  35. package/components/PopupContent.d.ts +1 -1
  36. package/components/PopupContent.js +2 -2
  37. package/components/Radio.d.ts +1 -1
  38. package/components/Radio.js +4 -4
  39. package/components/SearchField.d.ts +2 -2
  40. package/components/SearchField.js +4 -4
  41. package/components/SectionTitle.js +1 -1
  42. package/components/Segmented.d.ts +3 -3
  43. package/components/Segmented.js +3 -3
  44. package/components/SegmentedButton.d.ts +1 -1
  45. package/components/SegmentedButton.js +2 -2
  46. package/components/SegmentedContext.d.ts +2 -2
  47. package/components/Select.d.ts +4 -4
  48. package/components/Select.js +13 -13
  49. package/components/Shortcut.d.ts +2 -2
  50. package/components/Shortcut.js +11 -11
  51. package/components/Slider.d.ts +1 -1
  52. package/components/Slider.js +5 -5
  53. package/components/Spinner.d.ts +1 -1
  54. package/components/Spinner.js +2 -2
  55. package/components/Surface.d.ts +1 -1
  56. package/components/Surface.js +4 -4
  57. package/components/SurfaceContent.js +1 -1
  58. package/components/SurfaceCut.d.ts +1 -1
  59. package/components/SurfaceCut.js +4 -4
  60. package/components/SurfaceCutContent.js +1 -1
  61. package/components/Switch.d.ts +2 -2
  62. package/components/Switch.js +4 -4
  63. package/components/TextArea.d.ts +1 -1
  64. package/components/TextArea.js +6 -6
  65. package/components/ThemeContext.d.ts +1 -1
  66. package/components/Toast.d.ts +2 -2
  67. package/components/Toast.js +7 -7
  68. package/components/ToastsPortal.js +2 -2
  69. package/components/ToastsPortalContext.d.ts +1 -1
  70. package/components/Toolbar.d.ts +3 -3
  71. package/components/Toolbar.js +4 -4
  72. package/components/ToolbarButton.d.ts +1 -1
  73. package/components/ToolbarButton.js +2 -2
  74. package/components/ToolbarContext.d.ts +2 -2
  75. package/components/ToolbarSeparator.js +1 -1
  76. package/components/Tooltip.d.ts +1 -1
  77. package/components/Tooltip.js +2 -2
  78. package/components/TooltipPrimitive.d.ts +2 -2
  79. package/components/TooltipPrimitive.js +5 -5
  80. package/components/UIProvider.d.ts +1 -1
  81. package/components/UIProvider.js +5 -5
  82. package/hooks/use-accent-color.d.ts +1 -1
  83. package/hooks/use-accent-color.d.ts.map +1 -1
  84. package/hooks/use-accent-color.js +1 -1
  85. package/hooks/use-dialog.d.ts +1 -1
  86. package/hooks/use-dialog.js +2 -2
  87. package/hooks/use-modal-utils.d.ts +1 -1
  88. package/hooks/use-modal-utils.js +1 -1
  89. package/hooks/use-surface.js +1 -1
  90. package/hooks/use-theme.js +1 -1
  91. package/hooks/use-toast.d.ts +1 -1
  92. package/hooks/use-toast.js +1 -1
  93. package/index.d.ts +55 -54
  94. package/index.d.ts.map +1 -1
  95. package/index.js +54 -54
  96. package/index.js.map +1 -1
  97. package/package.json +1 -1
  98. package/shared/rounded-classes.d.ts +4 -4
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useLayoutEffect, useState, } from 'react';
3
- import { cn } from '../shared/cn';
4
- import { KeyboardArrowLeftIcon } from './icons/KeyboardArrowLeftIcon';
5
- import { KeyboardBackspaceIcon } from './icons/KeyboardBackspaceIcon';
6
- import { KeyboardCommandIcon } from './icons/KeyboardCommandIcon';
7
- import { KeyboardControlIcon } from './icons/KeyboardControlIcon';
8
- import { KeyboardOptionIcon } from './icons/KeyboardOptionIcon';
9
- import { KeyboardReturnIcon } from './icons/KeyboardReturnIcon';
10
- import { KeyboardShiftIcon } from './icons/KeyboardShiftIcon';
11
- import { KeyboardSpaceIcon } from './icons/KeyboardSpaceIcon';
12
- import { KeyboardTabIcon } from './icons/KeyboardTabIcon';
13
- import { Surface } from './Surface';
3
+ import { cn } from '../shared/cn.js';
4
+ import { KeyboardArrowLeftIcon } from './icons/KeyboardArrowLeftIcon.js';
5
+ import { KeyboardBackspaceIcon } from './icons/KeyboardBackspaceIcon.js';
6
+ import { KeyboardCommandIcon } from './icons/KeyboardCommandIcon.js';
7
+ import { KeyboardControlIcon } from './icons/KeyboardControlIcon.js';
8
+ import { KeyboardOptionIcon } from './icons/KeyboardOptionIcon.js';
9
+ import { KeyboardReturnIcon } from './icons/KeyboardReturnIcon.js';
10
+ import { KeyboardShiftIcon } from './icons/KeyboardShiftIcon.js';
11
+ import { KeyboardSpaceIcon } from './icons/KeyboardSpaceIcon.js';
12
+ import { KeyboardTabIcon } from './icons/KeyboardTabIcon.js';
13
+ import { Surface } from './Surface.js';
14
14
  export const Shortcut = (props) => {
15
15
  const { className = '', iconClassName = '', keyClassName = '', keyContentClassName = '', surfaceLevel = '+2', outline = true, variant = 'gradient', color, children, size = 'md', ref, ...rest } = props;
16
16
  const [isMac, setIsMac] = useState(false);
@@ -1,5 +1,5 @@
1
1
  import { ChangeEvent } from 'react';
2
- import { Color } from '../types';
2
+ import { Color } from '../types.js';
3
3
  export type SliderSize = 'sm' | 'md';
4
4
  export interface SliderProps {
5
5
  /** Controlled value. When omitted, the component falls back to uncontrolled mode using `defaultValue`. */
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from 'react';
3
- import { useAccentColor } from '../hooks/use-accent-color';
4
- import { cn } from '../shared/cn';
5
- import { FocusableLayer } from './FocusableLayer';
6
- import { Surface } from './Surface';
7
- import { SurfaceCut } from './SurfaceCut';
3
+ import { useAccentColor } from '../hooks/use-accent-color.js';
4
+ import { cn } from '../shared/cn.js';
5
+ import { FocusableLayer } from './FocusableLayer.js';
6
+ import { Surface } from './Surface.js';
7
+ import { SurfaceCut } from './SurfaceCut.js';
8
8
  export function Slider(props) {
9
9
  const accentColor = useAccentColor();
10
10
  const { value: valueProp, defaultValue = 0, min = 0, max = 100, step = 1, size = 'sm', readOnly = false, disabled = false, onChange = () => { }, className, color = accentColor, input: _input = false, debounce = 0, } = props;
@@ -1,4 +1,4 @@
1
- import { Color } from '../types';
1
+ import { Color } from '../types.js';
2
2
  export type SpinnerSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
3
3
  export interface SpinnerProps {
4
4
  /** Spinner dimension. Default `'sm'`. Drives the size, knob position, and border thickness. */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useAccentColor } from '../hooks/use-accent-color';
3
- import { cn } from '../shared/cn';
2
+ import { useAccentColor } from '../hooks/use-accent-color.js';
3
+ import { cn } from '../shared/cn.js';
4
4
  export function Spinner(props) {
5
5
  const accentColor = useAccentColor();
6
6
  const { size = 'sm', color = accentColor, className } = props;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, Ref, ElementType, ComponentPropsWithoutRef } from 'react';
2
- import { Color } from '../types';
2
+ import { Color } from '../types.js';
3
3
  export type SurfaceVariant = 'transparent' | 'solid' | 'gradient' | 'solid-fill' | 'gradient-fill';
4
4
  interface SurfaceOwnProps<C extends ElementType = 'div'> {
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useSurface } from '../hooks/use-surface';
3
- import { cn } from '../shared/cn';
4
- import { SurfaceContent } from './SurfaceContent';
5
- import { SurfaceContextProvider } from './SurfaceContext';
2
+ import { useSurface } from '../hooks/use-surface.js';
3
+ import { cn } from '../shared/cn.js';
4
+ import { SurfaceContent } from './SurfaceContent.js';
5
+ import { SurfaceContextProvider } from './SurfaceContext.js';
6
6
  export const Surface = (props) => {
7
7
  const MAX_LEVEL = 5;
8
8
  const { level, children, className = '', contentClassName = '', bgClassName = '', outline = false, variant = 'solid', component = 'div', clickable = false, pressed, hoverable = false, color = '', wrapContent = true, beforeContent, ref, ...rest } = props;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '../shared/cn';
2
+ import { cn } from '../shared/cn.js';
3
3
  export const SurfaceContent = (props) => {
4
4
  const { children, className = '', ref, ...rest } = props;
5
5
  return (_jsx("div", { ref: ref, className: cn(`relative h-full`, className), ...rest, children: children }));
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, Ref, ElementType, ComponentPropsWithoutRef } from 'react';
2
- import { Color } from '../types';
2
+ import { Color } from '../types.js';
3
3
  interface SurfaceCutOwnProps<C extends ElementType = 'div'> {
4
4
  /** Surface-cut content. */
5
5
  children?: ReactNode;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useSurface } from '../hooks/use-surface';
3
- import { cn } from '../shared/cn';
4
- import { SurfaceContextProvider } from './SurfaceContext';
5
- import { SurfaceCutContent } from './SurfaceCutContent';
2
+ import { useSurface } from '../hooks/use-surface.js';
3
+ import { cn } from '../shared/cn.js';
4
+ import { SurfaceContextProvider } from './SurfaceContext.js';
5
+ import { SurfaceCutContent } from './SurfaceCutContent.js';
6
6
  export const SurfaceCut = (props) => {
7
7
  const { children, className = '', outline = true, color, hoverable = false, clickable = false, pressed = false, component = 'div', wrapContent = true, contentClassName = '', ref, ...rest } = props;
8
8
  const Component = component;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '../shared/cn';
2
+ import { cn } from '../shared/cn.js';
3
3
  export const SurfaceCutContent = (props) => {
4
4
  const { children, fullHeight = true, component = 'div', className = '', ref, ...rest } = props;
5
5
  const Component = component;
@@ -1,6 +1,6 @@
1
1
  import { ElementType, ReactNode, ComponentPropsWithoutRef } from 'react';
2
- import { Color } from '../types';
3
- import { SurfaceVariant } from './Surface';
2
+ import { Color } from '../types.js';
3
+ import { SurfaceVariant } from './Surface.js';
4
4
  export type SwitchSize = 'sm' | 'md';
5
5
  interface SwitchOwnProps<C extends ElementType = 'label'> {
6
6
  /** Controlled checked state. Default `false`. */
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, } from 'react';
3
- import { useAccentColor } from '../hooks/use-accent-color';
4
- import { cn } from '../shared/cn';
5
- import { FocusableLayer } from './FocusableLayer';
6
- import { Surface } from './Surface';
3
+ import { useAccentColor } from '../hooks/use-accent-color.js';
4
+ import { cn } from '../shared/cn.js';
5
+ import { FocusableLayer } from './FocusableLayer.js';
6
+ import { Surface } from './Surface.js';
7
7
  export function Switch(props) {
8
8
  const accentColor = useAccentColor();
9
9
  const { checked = false, disabled = false, readOnly, onChange = () => { }, color = accentColor, component = 'label', icon, size = 'md', className, input = true, hoverable, focusable, outline = true, variant = 'solid', surfaceLevel = '+1', knobOutline = true, knobVariant = 'gradient', knobSurfaceLevel = '+2', } = props;
@@ -1,5 +1,5 @@
1
1
  import { ElementType, ReactNode, Ref, FocusEvent, KeyboardEvent, FormEvent, ComponentPropsWithoutRef } from 'react';
2
- import { Color } from '../types';
2
+ import { Color } from '../types.js';
3
3
  export type TextAreaSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
4
4
  interface TextAreaOwnProps<C extends ElementType = 'div'> {
5
5
  /** Polymorphic wrapper element. Defaults to `'div'`. The editable area itself is always a `contenteditable` `<div>`. */
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState, } from 'react';
3
- import { useAccentColor } from '../hooks/use-accent-color';
4
- import { cn } from '../shared/cn';
5
- import { roundedClasses } from '../shared/rounded-classes';
6
- import { FocusableLayer } from './FocusableLayer';
7
- import { SurfaceCut } from './SurfaceCut';
8
- import { SurfaceCutContent } from './SurfaceCutContent';
3
+ import { useAccentColor } from '../hooks/use-accent-color.js';
4
+ import { cn } from '../shared/cn.js';
5
+ import { roundedClasses } from '../shared/rounded-classes.js';
6
+ import { FocusableLayer } from './FocusableLayer.js';
7
+ import { SurfaceCut } from './SurfaceCut.js';
8
+ import { SurfaceCutContent } from './SurfaceCutContent.js';
9
9
  export const TextArea = (props) => {
10
10
  const accentColor = useAccentColor();
11
11
  const { component = 'div', ref: externalRef, value, placeholder, disabled = false, readOnly, rounded = false, size = 'lg', onChange = () => { }, onKeyDown = () => { }, onFocus = () => { }, onBlur = () => { }, color = accentColor, prefix, suffix, updateContentOnChange = true, className, contentClassName, inputClassName, placeholderClassName = '', valid = true, infoMessage, errorMessage, icon, surfaceClassName, } = props;
@@ -1,4 +1,4 @@
1
- import { Color } from '../types';
1
+ import { Color } from '../types.js';
2
2
  type ThemeContextValue = {
3
3
  theme: 'dark' | 'light';
4
4
  accentColor: Color;
@@ -1,6 +1,6 @@
1
1
  import { ElementType, ReactNode, Ref } from 'react';
2
- import { Color } from '../types';
3
- import { SurfaceVariant } from './Surface';
2
+ import { Color } from '../types.js';
3
+ import { SurfaceVariant } from './Surface.js';
4
4
  /**
5
5
  * State container for the `Toast` + `ToastTrigger` + `Toast` compound. Less commonly used than
6
6
  * the imperative `useToasts()` portal API - prefer the portal for app-wide notifications and
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cloneElement, createContext, useContext, useState, useEffect, useRef, } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
- import { useModalUtils } from '../hooks/use-modal-utils';
5
- import { useTheme } from '../hooks/use-theme';
6
- import { cn } from '../shared/cn';
7
- import { Button } from './Button';
8
- import { CloseIcon } from './icons/CloseIcon';
9
- import { ModalController } from './ModalController';
10
- import { Surface } from './Surface';
4
+ import { useModalUtils } from '../hooks/use-modal-utils.js';
5
+ import { useTheme } from '../hooks/use-theme.js';
6
+ import { cn } from '../shared/cn.js';
7
+ import { Button } from './Button.js';
8
+ import { CloseIcon } from './icons/CloseIcon.js';
9
+ import { ModalController } from './ModalController.js';
10
+ import { Surface } from './Surface.js';
11
11
  const ToastRootContext = createContext(null);
12
12
  /**
13
13
  * State container for the `Toast` + `ToastTrigger` + `Toast` compound. Less commonly used than
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Toast } from './Toast';
3
- import { useToastsPortalContext } from './ToastsPortalContext';
2
+ import { Toast } from './Toast.js';
3
+ import { useToastsPortalContext } from './ToastsPortalContext.js';
4
4
  export function ToastsPortal() {
5
5
  const { data, state, setState, setData } = useToastsPortalContext();
6
6
  if (!data)
@@ -1,4 +1,4 @@
1
- import { Color } from '../types';
1
+ import { Color } from '../types.js';
2
2
  /**
3
3
  * Shape of a queued toast in the imperative toast portal. Mirrors `ToastProps` but adds an
4
4
  * `id` (used as React key + lifecycle handle) and an internal `removed` flag.
@@ -1,7 +1,7 @@
1
1
  import { ReactNode, Ref, ElementType } from 'react';
2
- import { Color } from '../types';
3
- import { ButtonSize } from './Button';
4
- import { SurfaceProps, SurfaceVariant } from './Surface';
2
+ import { Color } from '../types.js';
3
+ import { ButtonSize } from './Button.js';
4
+ import { SurfaceProps, SurfaceVariant } from './Surface.js';
5
5
  interface ToolbarOwnProps<C extends ElementType = 'div'> {
6
6
  /** Toolbar items - typically `ToolbarButton` and `ToolbarSeparator`. */
7
7
  children?: ReactNode;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useRef } from 'react';
3
- import { cn } from '../shared/cn';
4
- import { roundedClasses } from '../shared/rounded-classes';
5
- import { Surface } from './Surface';
6
- import { ToolbarContextProvider } from './ToolbarContext';
3
+ import { cn } from '../shared/cn.js';
4
+ import { roundedClasses } from '../shared/rounded-classes.js';
5
+ import { Surface } from './Surface.js';
6
+ import { ToolbarContextProvider } from './ToolbarContext.js';
7
7
  export const Toolbar = (props) => {
8
8
  const elRef = useRef(null);
9
9
  const { children, className = '', contentClassName = '', rounded = true, size = 'md', component = 'div', color = '', ref, variant = 'gradient', outline = true, buttonVariant = 'transparent', buttonOutline = false, surfaceLevel, ...rest } = props;
@@ -1,5 +1,5 @@
1
1
  import { ElementType } from 'react';
2
- import { ButtonProps } from './Button';
2
+ import { ButtonProps } from './Button.js';
3
3
  /**
4
4
  * `ToolbarButton` accepts the full `Button` API. When rendered inside a `Toolbar`,
5
5
  * `size`, `rounded`, `variant`, and `outline` default to the values supplied by the
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Button } from './Button';
3
- import { useToolbarContext } from './ToolbarContext';
2
+ import { Button } from './Button.js';
3
+ import { useToolbarContext } from './ToolbarContext.js';
4
4
  export const ToolbarButton = (props) => {
5
5
  const { size = 'md', rounded = true, variant = 'transparent', outline = false, } = useToolbarContext();
6
6
  return (_jsx(Button, { size: size, rounded: rounded, variant: variant, outline: outline, ...props }));
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { ButtonSize } from './Button';
3
- import { SurfaceVariant } from './Surface';
2
+ import { ButtonSize } from './Button.js';
3
+ import { SurfaceVariant } from './Surface.js';
4
4
  interface ToolbarContextValue {
5
5
  size?: ButtonSize;
6
6
  rounded?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '../shared/cn';
2
+ import { cn } from '../shared/cn.js';
3
3
  export const ToolbarSeparator = (props) => {
4
4
  const { children, className = '', ref, ...rest } = props;
5
5
  return (_jsx("div", { ref: ref, className: cn('mx-1 h-1/2 w-px bg-surface-outline', className), ...rest, children: children }));
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { TooltipPrimitiveProps, TooltipPosition } from './TooltipPrimitive';
2
+ import { TooltipPrimitiveProps, TooltipPosition } from './TooltipPrimitive.js';
3
3
  export type { TooltipPosition };
4
4
  export interface TooltipProps extends Omit<TooltipPrimitiveProps, 'children' | 'ref'> {
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cloneElement, useEffect, useRef, useState } from 'react';
3
- import { useDevice } from '../hooks/use-device';
4
- import { TooltipPrimitive, } from './TooltipPrimitive';
3
+ import { useDevice } from '../hooks/use-device.js';
4
+ import { TooltipPrimitive, } from './TooltipPrimitive.js';
5
5
  let tooltipGlobalTimeout = 0;
6
6
  let tooltipGlobalTimeoutId = 0;
7
7
  const resetGlobalTimeout = () => {
@@ -1,6 +1,6 @@
1
1
  import { ReactNode, Ref } from 'react';
2
- import { Color } from '../types';
3
- import { SurfaceProps } from './Surface';
2
+ import { Color } from '../types.js';
3
+ import { SurfaceProps } from './Surface.js';
4
4
  type OffsetValue = number | string;
5
5
  export type TooltipPosition = 'top' | 'bottom';
6
6
  interface TooltipPrimitiveOwnProps {
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useRef } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
- import { useModalUtils } from '../hooks/use-modal-utils';
5
- import { useTheme } from '../hooks/use-theme';
6
- import { cn } from '../shared/cn';
7
- import { ModalController } from './ModalController';
8
- import { Surface } from './Surface';
4
+ import { useModalUtils } from '../hooks/use-modal-utils.js';
5
+ import { useTheme } from '../hooks/use-theme.js';
6
+ import { cn } from '../shared/cn.js';
7
+ import { ModalController } from './ModalController.js';
8
+ import { Surface } from './Surface.js';
9
9
  const resolveOffset = (value) => {
10
10
  if (typeof value === 'number')
11
11
  return `${value}px`;
@@ -1,4 +1,4 @@
1
- import { Color } from '../types';
1
+ import { Color } from '../types.js';
2
2
  export interface UIProviderProps {
3
3
  /**
4
4
  * Color scheme. Default `'dark'`. Read by `useTheme` and used to switch surface defaults
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { DialogsPortal } from './DialogsPortal';
3
- import { DialogsPortalProvider } from './DialogsPortalContext';
4
- import { ThemeProvider } from './ThemeContext';
5
- import { ToastsPortal } from './ToastsPortal';
6
- import { ToastsPortalProvider } from './ToastsPortalContext';
2
+ import { DialogsPortal } from './DialogsPortal.js';
3
+ import { DialogsPortalProvider } from './DialogsPortalContext.js';
4
+ import { ThemeProvider } from './ThemeContext.js';
5
+ import { ToastsPortal } from './ToastsPortal.js';
6
+ import { ToastsPortalProvider } from './ToastsPortalContext.js';
7
7
  export const UIProvider = (props) => {
8
8
  const { theme = 'dark', accentColor = 'brand', children } = props;
9
9
  return (_jsx(ThemeProvider, { theme: theme, accentColor: accentColor, children: _jsx(DialogsPortalProvider, { children: _jsxs(ToastsPortalProvider, { children: [children, _jsx(DialogsPortal, {}), _jsx(ToastsPortal, {})] }) }) }));
@@ -1,2 +1,2 @@
1
- export declare const useAccentColor: () => import("../types").Color;
1
+ export declare const useAccentColor: () => import("..").Color;
2
2
  //# sourceMappingURL=use-accent-color.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-accent-color.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-accent-color.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,gCAE1B,CAAC"}
1
+ {"version":3,"file":"use-accent-color.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-accent-color.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,0BAE1B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { useContext } from 'react';
2
- import { ThemeContext } from '../components/ThemeContext';
2
+ import { ThemeContext } from '../components/ThemeContext.js';
3
3
  export const useAccentColor = () => {
4
4
  return useContext(ThemeContext).accentColor;
5
5
  };
@@ -1,4 +1,4 @@
1
- import { DialogsPortalData } from '../components/DialogsPortalContext';
1
+ import { DialogsPortalData } from '../components/DialogsPortalContext.js';
2
2
  export declare const useDialog: ({ lazy }?: {
3
3
  lazy?: boolean;
4
4
  }) => {
@@ -1,5 +1,5 @@
1
- import { useDialogsPortalContext, } from '../components/DialogsPortalContext';
2
- import { useAccentColor } from './use-accent-color';
1
+ import { useDialogsPortalContext, } from '../components/DialogsPortalContext.js';
2
+ import { useAccentColor } from './use-accent-color.js';
3
3
  export const useDialog = ({ lazy } = {}) => {
4
4
  const { setState, setData } = useDialogsPortalContext();
5
5
  const accentColor = useAccentColor();
@@ -1,4 +1,4 @@
1
- import { ModalPhase } from '../components/ModalController';
1
+ import { ModalPhase } from '../components/ModalController.js';
2
2
  export declare const useModalUtils: ({ phase, onPhaseChange, lazy, onClose, onClosed, onOpen, onOpened, transitionEndElRef, closeOnEscape, }: {
3
3
  phase: ModalPhase;
4
4
  onPhaseChange?: (phase: ModalPhase) => void;
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
- import { nextTick } from '../shared/next-tick';
2
+ import { nextTick } from '../shared/next-tick.js';
3
3
  export const useModalUtils = ({ phase, onPhaseChange = () => { }, lazy, onClose = () => { }, onClosed = () => { }, onOpen = () => { }, onOpened = () => { }, transitionEndElRef, closeOnEscape = true, }) => {
4
4
  const initiallyOpenedRef = useRef(false);
5
5
  const [opened, setOpened] = useState(false);
@@ -1,5 +1,5 @@
1
1
  import { useContext } from 'react';
2
- import { SurfaceContext } from '../components/SurfaceContext';
2
+ import { SurfaceContext } from '../components/SurfaceContext.js';
3
3
  export function useSurface() {
4
4
  return (useContext(SurfaceContext) || { level: 0 }).level;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { useContext } from 'react';
2
- import { ThemeContext } from '../components/ThemeContext';
2
+ import { ThemeContext } from '../components/ThemeContext.js';
3
3
  export const useTheme = () => {
4
4
  return useContext(ThemeContext).theme;
5
5
  };
@@ -1,3 +1,3 @@
1
- import { ToastsPortalData } from '../components/ToastsPortalContext';
1
+ import { ToastsPortalData } from '../components/ToastsPortalContext.js';
2
2
  export declare const useToast: () => ({ title, text, color, closeButton, icon, iconComponent, onClosed, }: Partial<ToastsPortalData>) => void;
3
3
  //# sourceMappingURL=use-toast.d.ts.map
@@ -1,4 +1,4 @@
1
- import { useToastsPortalContext, } from '../components/ToastsPortalContext';
1
+ import { useToastsPortalContext, } from '../components/ToastsPortalContext.js';
2
2
  export const useToast = () => {
3
3
  const { setState, state, setData, data } = useToastsPortalContext();
4
4
  return ({ title, text, color, closeButton, icon, iconComponent, onClosed, }) => {
package/index.d.ts CHANGED
@@ -1,55 +1,56 @@
1
- export { useDevice } from './hooks/use-device';
2
- export { useDialog } from './hooks/use-dialog';
3
- export { useSurface } from './hooks/use-surface';
4
- export { useTheme } from './hooks/use-theme';
5
- export { useToast } from './hooks/use-toast';
6
- export { useAccentColor } from './hooks/use-accent-color';
7
- export { cn } from './shared/cn';
8
- export { nextTick } from './shared/next-tick';
9
- export { CloseIcon } from './components/icons/CloseIcon';
10
- export { SearchIcon } from './components/icons/SearchIcon';
11
- export { DropdownIcon } from './components/icons/DropdownIcon';
12
- export { CheckIcon } from './components/icons/CheckIcon';
13
- export { Backdrop, type BackdropProps } from './components/Backdrop';
14
- export { Button, type ButtonProps, type ButtonSize } from './components/Button';
15
- export { Checkbox, type CheckboxProps, type CheckboxSize, } from './components/Checkbox';
16
- export { Chip, type ChipProps, type ChipSize } from './components/Chip';
17
- export { Dialog, DialogClose, DialogRoot, DialogTrigger, type DialogProps, } from './components/Dialog';
18
- export { Input, type InputProps, type InputSize } from './components/Input';
19
- export { Link, type LinkProps } from './components/Link';
20
- export { List, type ListProps } from './components/List';
21
- export { ListButton, type ListButtonProps } from './components/ListButton';
22
- export { ListItem, type ListItemProps } from './components/ListItem';
23
- export { ListSeparator, type ListSeparatorProps, } from './components/ListSeparator';
24
- export { ListTitle, type ListTitleProps } from './components/ListTitle';
25
- export { NumberField, type NumberFieldProps, type NumberFieldSize, } from './components/NumberField';
26
- export { OTPField, type OTPFieldProps } from './components/OTPField';
27
- export { OTPFieldInput, type OTPFieldInputProps, } from './components/OTPFieldInput';
28
- export { OTPFieldSeparator, type OTPFieldSeparatorProps, } from './components/OTPFieldSeparator';
29
- export { Popover, PopoverClose, PopoverRoot, PopoverTrigger, type PopoverProps, } from './components/Popover';
30
- export { Popup, PopupClose, PopupRoot, PopupTrigger, type PopupProps, } from './components/Popup';
31
- export { PopupContent, type PopupContentProps, } from './components/PopupContent';
32
- export { Radio, type RadioProps, type RadioSize } from './components/Radio';
33
- export { SearchField, type SearchFieldProps } from './components/SearchField';
34
- export { SectionTitle, type SectionTitleProps, } from './components/SectionTitle';
35
- export { Segmented, type SegmentedProps } from './components/Segmented';
36
- export { SegmentedButton, type SegmentedButtonProps, } from './components/SegmentedButton';
37
- export { Select, type SelectProps } from './components/Select';
38
- export { Shortcut, type ShortcutProps, type ShortcutSize, } from './components/Shortcut';
39
- export { Slider, type SliderProps, type SliderSize } from './components/Slider';
40
- export { Spinner, type SpinnerProps, type SpinnerSize, } from './components/Spinner';
41
- export { SurfaceContextProvider } from './components/SurfaceContext';
42
- export { Surface, type SurfaceProps } from './components/Surface';
43
- export { SurfaceContent, type SurfaceContentProps, } from './components/SurfaceContent';
44
- export { SurfaceCut, type SurfaceCutProps } from './components/SurfaceCut';
45
- export { SurfaceCutContent, type SurfaceCutContentProps, } from './components/SurfaceCutContent';
46
- export { Switch, type SwitchProps, type SwitchSize } from './components/Switch';
47
- export { TextArea, type TextAreaProps, type TextAreaSize, } from './components/TextArea';
48
- export { Toast, ToastClose, ToastRoot, ToastTrigger, type ToastProps, } from './components/Toast';
49
- export { Toolbar, type ToolbarProps } from './components/Toolbar';
50
- export { ToolbarButton, type ToolbarButtonProps, } from './components/ToolbarButton';
51
- export { ToolbarSeparator, type ToolbarSeparatorProps, } from './components/ToolbarSeparator';
52
- export { Tooltip, type TooltipPosition, type TooltipProps, } from './components/Tooltip';
53
- export { TooltipPrimitive, type TooltipPrimitiveProps, } from './components/TooltipPrimitive';
54
- export { UIProvider, type UIProviderProps } from './components/UIProvider';
1
+ export { useDevice } from './hooks/use-device.js';
2
+ export { useDialog } from './hooks/use-dialog.js';
3
+ export { useSurface } from './hooks/use-surface.js';
4
+ export { useTheme } from './hooks/use-theme.js';
5
+ export { useToast } from './hooks/use-toast.js';
6
+ export { useAccentColor } from './hooks/use-accent-color.js';
7
+ export { type Color } from './types.js';
8
+ export { cn } from './shared/cn.js';
9
+ export { nextTick } from './shared/next-tick.js';
10
+ export { CloseIcon } from './components/icons/CloseIcon.js';
11
+ export { SearchIcon } from './components/icons/SearchIcon.js';
12
+ export { DropdownIcon } from './components/icons/DropdownIcon.js';
13
+ export { CheckIcon } from './components/icons/CheckIcon.js';
14
+ export { Backdrop, type BackdropProps } from './components/Backdrop.js';
15
+ export { Button, type ButtonProps, type ButtonSize } from './components/Button.js';
16
+ export { Checkbox, type CheckboxProps, type CheckboxSize, } from './components/Checkbox.js';
17
+ export { Chip, type ChipProps, type ChipSize } from './components/Chip.js';
18
+ export { Dialog, DialogClose, DialogRoot, DialogTrigger, type DialogProps, } from './components/Dialog.js';
19
+ export { Input, type InputProps, type InputSize } from './components/Input.js';
20
+ export { Link, type LinkProps } from './components/Link.js';
21
+ export { List, type ListProps } from './components/List.js';
22
+ export { ListButton, type ListButtonProps } from './components/ListButton.js';
23
+ export { ListItem, type ListItemProps } from './components/ListItem.js';
24
+ export { ListSeparator, type ListSeparatorProps, } from './components/ListSeparator.js';
25
+ export { ListTitle, type ListTitleProps } from './components/ListTitle.js';
26
+ export { NumberField, type NumberFieldProps, type NumberFieldSize, } from './components/NumberField.js';
27
+ export { OTPField, type OTPFieldProps } from './components/OTPField.js';
28
+ export { OTPFieldInput, type OTPFieldInputProps, } from './components/OTPFieldInput.js';
29
+ export { OTPFieldSeparator, type OTPFieldSeparatorProps, } from './components/OTPFieldSeparator.js';
30
+ export { Popover, PopoverClose, PopoverRoot, PopoverTrigger, type PopoverProps, } from './components/Popover.js';
31
+ export { Popup, PopupClose, PopupRoot, PopupTrigger, type PopupProps, } from './components/Popup.js';
32
+ export { PopupContent, type PopupContentProps, } from './components/PopupContent.js';
33
+ export { Radio, type RadioProps, type RadioSize } from './components/Radio.js';
34
+ export { SearchField, type SearchFieldProps } from './components/SearchField.js';
35
+ export { SectionTitle, type SectionTitleProps, } from './components/SectionTitle.js';
36
+ export { Segmented, type SegmentedProps } from './components/Segmented.js';
37
+ export { SegmentedButton, type SegmentedButtonProps, } from './components/SegmentedButton.js';
38
+ export { Select, type SelectProps } from './components/Select.js';
39
+ export { Shortcut, type ShortcutProps, type ShortcutSize, } from './components/Shortcut.js';
40
+ export { Slider, type SliderProps, type SliderSize } from './components/Slider.js';
41
+ export { Spinner, type SpinnerProps, type SpinnerSize, } from './components/Spinner.js';
42
+ export { SurfaceContextProvider } from './components/SurfaceContext.js';
43
+ export { Surface, type SurfaceProps } from './components/Surface.js';
44
+ export { SurfaceContent, type SurfaceContentProps, } from './components/SurfaceContent.js';
45
+ export { SurfaceCut, type SurfaceCutProps } from './components/SurfaceCut.js';
46
+ export { SurfaceCutContent, type SurfaceCutContentProps, } from './components/SurfaceCutContent.js';
47
+ export { Switch, type SwitchProps, type SwitchSize } from './components/Switch.js';
48
+ export { TextArea, type TextAreaProps, type TextAreaSize, } from './components/TextArea.js';
49
+ export { Toast, ToastClose, ToastRoot, ToastTrigger, type ToastProps, } from './components/Toast.js';
50
+ export { Toolbar, type ToolbarProps } from './components/Toolbar.js';
51
+ export { ToolbarButton, type ToolbarButtonProps, } from './components/ToolbarButton.js';
52
+ export { ToolbarSeparator, type ToolbarSeparatorProps, } from './components/ToolbarSeparator.js';
53
+ export { Tooltip, type TooltipPosition, type TooltipProps, } from './components/Tooltip.js';
54
+ export { TooltipPrimitive, type TooltipPrimitiveProps, } from './components/TooltipPrimitive.js';
55
+ export { UIProvider, type UIProviderProps } from './components/UIProvider.js';
55
56
  //# sourceMappingURL=index.d.ts.map