@cladd-ui/react 0.0.12 → 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.
- package/CHANGELOG.md +17 -0
- package/components/Backdrop.js +1 -1
- package/components/Button.d.ts +2 -2
- package/components/Button.js +5 -5
- package/components/Checkbox.d.ts +1 -1
- package/components/Checkbox.js +5 -5
- package/components/Chip.d.ts +1 -1
- package/components/Chip.js +2 -2
- package/components/Dialog.d.ts +2 -2
- package/components/Dialog.js +12 -12
- package/components/DialogsPortal.js +2 -2
- package/components/DialogsPortalContext.d.ts +1 -1
- package/components/FocusableLayer.d.ts +1 -1
- package/components/FocusableLayer.js +2 -2
- package/components/Input.d.ts +1 -1
- package/components/Input.js +7 -7
- package/components/Link.js +1 -1
- package/components/List.js +1 -1
- package/components/ListButton.d.ts +3 -3
- package/components/ListButton.js +2 -2
- package/components/ListItem.js +1 -1
- package/components/ListSeparator.js +1 -1
- package/components/ListTitle.js +1 -1
- package/components/NumberField.d.ts +2 -2
- package/components/NumberField.js +6 -6
- package/components/OTPField.d.ts +1 -1
- package/components/OTPField.js +5 -5
- package/components/OTPFieldContext.d.ts +1 -1
- package/components/OTPFieldInput.d.ts +2 -0
- package/components/OTPFieldInput.d.ts.map +1 -1
- package/components/OTPFieldInput.js +5 -5
- package/components/OTPFieldInput.js.map +1 -1
- package/components/OTPFieldSeparator.js +1 -1
- package/components/Popover.d.ts +2 -2
- package/components/Popover.js +6 -6
- package/components/Popup.d.ts +1 -1
- package/components/Popup.js +8 -8
- package/components/PopupContent.d.ts +1 -1
- package/components/PopupContent.js +2 -2
- package/components/Radio.d.ts +1 -1
- package/components/Radio.js +4 -4
- package/components/SearchField.d.ts +2 -2
- package/components/SearchField.js +4 -4
- package/components/SectionTitle.js +1 -1
- package/components/Segmented.d.ts +3 -3
- package/components/Segmented.js +3 -3
- package/components/SegmentedButton.d.ts +1 -1
- package/components/SegmentedButton.js +2 -2
- package/components/SegmentedContext.d.ts +2 -2
- package/components/Select.d.ts +4 -4
- package/components/Select.js +13 -13
- package/components/Shortcut.d.ts +2 -2
- package/components/Shortcut.d.ts.map +1 -1
- package/components/Shortcut.js +12 -12
- package/components/Shortcut.js.map +1 -1
- package/components/Slider.d.ts +1 -1
- package/components/Slider.js +5 -5
- package/components/Spinner.d.ts +1 -1
- package/components/Spinner.js +2 -2
- package/components/Surface.d.ts +1 -1
- package/components/Surface.js +4 -4
- package/components/SurfaceContent.js +1 -1
- package/components/SurfaceCut.d.ts +1 -1
- package/components/SurfaceCut.js +4 -4
- package/components/SurfaceCutContent.js +1 -1
- package/components/Switch.d.ts +2 -2
- package/components/Switch.js +4 -4
- package/components/TextArea.d.ts +1 -1
- package/components/TextArea.js +6 -6
- package/components/ThemeContext.d.ts +1 -1
- package/components/Toast.d.ts +2 -2
- package/components/Toast.js +7 -7
- package/components/ToastsPortal.js +2 -2
- package/components/ToastsPortalContext.d.ts +1 -1
- package/components/Toolbar.d.ts +3 -3
- package/components/Toolbar.js +4 -4
- package/components/ToolbarButton.d.ts +1 -1
- package/components/ToolbarButton.js +2 -2
- package/components/ToolbarContext.d.ts +2 -2
- package/components/ToolbarSeparator.js +1 -1
- package/components/Tooltip.d.ts +1 -1
- package/components/Tooltip.js +2 -2
- package/components/TooltipPrimitive.d.ts +2 -2
- package/components/TooltipPrimitive.js +5 -5
- package/components/UIProvider.d.ts +1 -1
- package/components/UIProvider.js +5 -5
- package/hooks/use-accent-color.d.ts +1 -1
- package/hooks/use-accent-color.d.ts.map +1 -1
- package/hooks/use-accent-color.js +1 -1
- package/hooks/use-dialog.d.ts +1 -1
- package/hooks/use-dialog.js +2 -2
- package/hooks/use-modal-utils.d.ts +1 -1
- package/hooks/use-modal-utils.js +1 -1
- package/hooks/use-surface.js +1 -1
- package/hooks/use-theme.js +1 -1
- package/hooks/use-toast.d.ts +1 -1
- package/hooks/use-toast.js +1 -1
- package/index.d.ts +55 -54
- package/index.d.ts.map +1 -1
- package/index.js +54 -54
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/shared/rounded-classes.d.ts +4 -4
package/components/Select.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ReactNode, Ref, MouseEvent } from 'react';
|
|
2
|
-
import { ButtonSize } from './Button';
|
|
3
|
-
import { PopoverOffset, PopoverPosition } from './Popover';
|
|
2
|
+
import { ButtonSize } from './Button.js';
|
|
3
|
+
import { PopoverOffset, PopoverPosition } from './Popover.js';
|
|
4
4
|
interface SelectOptionRenderParams<T> {
|
|
5
5
|
value: T;
|
|
6
6
|
index: number;
|
|
7
7
|
selected: boolean;
|
|
8
8
|
}
|
|
9
|
-
import { Color } from '../types';
|
|
10
|
-
import { ButtonProps } from './Button';
|
|
9
|
+
import { Color } from '../types.js';
|
|
10
|
+
import { ButtonProps } from './Button.js';
|
|
11
11
|
interface SelectOwnProps<T = string> {
|
|
12
12
|
/** Selected value (single-select) or array of selected values (when `multiple`). */
|
|
13
13
|
value?: T | T[];
|
package/components/Select.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, useEffect, useId, useRef, useState, } from 'react';
|
|
3
|
-
import { useDevice } from '../hooks/use-device';
|
|
4
|
-
import { useTheme } from '../hooks/use-theme';
|
|
5
|
-
import { cn } from '../shared/cn';
|
|
6
|
-
import { Button, buttonIconSizes } from './Button';
|
|
7
|
-
import { Checkbox } from './Checkbox';
|
|
8
|
-
import { DropdownIcon } from './icons/DropdownIcon';
|
|
9
|
-
import { List } from './List';
|
|
10
|
-
import { ListButton } from './ListButton';
|
|
11
|
-
import { Popover } from './Popover';
|
|
12
|
-
import { Radio } from './Radio';
|
|
13
|
-
import { SearchField } from './SearchField';
|
|
14
|
-
import { SectionTitle } from './SectionTitle';
|
|
15
|
-
import { Shortcut } from './Shortcut';
|
|
3
|
+
import { useDevice } from '../hooks/use-device.js';
|
|
4
|
+
import { useTheme } from '../hooks/use-theme.js';
|
|
5
|
+
import { cn } from '../shared/cn.js';
|
|
6
|
+
import { Button, buttonIconSizes } from './Button.js';
|
|
7
|
+
import { Checkbox } from './Checkbox.js';
|
|
8
|
+
import { DropdownIcon } from './icons/DropdownIcon.js';
|
|
9
|
+
import { List } from './List.js';
|
|
10
|
+
import { ListButton } from './ListButton.js';
|
|
11
|
+
import { Popover } from './Popover.js';
|
|
12
|
+
import { Radio } from './Radio.js';
|
|
13
|
+
import { SearchField } from './SearchField.js';
|
|
14
|
+
import { SectionTitle } from './SectionTitle.js';
|
|
15
|
+
import { Shortcut } from './Shortcut.js';
|
|
16
16
|
export function Select(props) {
|
|
17
17
|
const theme = useTheme();
|
|
18
18
|
const { value = '', placeholder = '', title = '', options = [], multiple, disabled, readOnly,
|
package/components/Shortcut.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, 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
|
export type ShortcutSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
5
|
interface ShortcutOwnProps {
|
|
6
6
|
/** Extra classes for the shortcut root container. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shortcut.d.ts","sourceRoot":"","sources":["../../../src/components/Shortcut.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,SAAS,EACT,GAAG,EAGJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAUjC,OAAO,EAAW,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE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AC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,sDAAsD;IACtD,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAC1C,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,gBAAgB,CAAC,CAAC;AAEhE,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CA6K5C,CAAC"}
|
package/components/Shortcut.js
CHANGED
|
@@ -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);
|
|
@@ -129,6 +129,6 @@ export const Shortcut = (props) => {
|
|
|
129
129
|
useLayoutEffect(() => {
|
|
130
130
|
setIsMac(navigator.userAgent.includes('Mac'));
|
|
131
131
|
}, []);
|
|
132
|
-
return (_jsx("div", { ref: ref, className: cn('shortcut inline-flex shrink-0 items-center gap-0.5 self-center align-middle font-mono leading-0 tabular-nums', className), ...rest, children: keys.map((key, index) => (_jsx(Surface, { color: color, variant: variant, level: surfaceLevel, className: cn('relative shrink-0 font-semibold', !isFill && 'text-primary', fontSizeClass, roundedClass, sizeClass, keyClassName), outline: outline, contentClassName: cn('flex items-center justify-center px-0.5', isTextKey(key) && 'px-1', keyContentClassName), children: getKey(key) }, index))) }));
|
|
132
|
+
return (_jsx("div", { ref: ref, className: cn('shortcut inline-flex shrink-0 items-center gap-0.5 self-center align-middle font-mono leading-0 tabular-nums', className), ...rest, children: keys.map((key, index) => (_jsx(Surface, { component: "kbd", color: color, variant: variant, level: surfaceLevel, className: cn('relative shrink-0 font-semibold', !isFill && 'text-primary', fontSizeClass, roundedClass, sizeClass, keyClassName), outline: outline, contentClassName: cn('flex items-center justify-center px-0.5', isTextKey(key) && 'px-1', keyContentClassName), children: getKey(key) }, index))) }));
|
|
133
133
|
};
|
|
134
134
|
//# sourceMappingURL=Shortcut.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shortcut.js","sourceRoot":"","sources":["../../../src/components/Shortcut.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,eAAe,EACf,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAkB,MAAM,WAAW,CAAC;AAwCpD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC/C,MAAM,EACJ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O,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3D,CAAC,CAAC;IACF,eAAe,CAAC,GAAG,EAAE;QACnB,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,8GAA8G,EAC9G,SAAS,CACV,KACG,IAAI,YAEP,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,KAAC,OAAO,IACN,SAAS,EAAC,KAAK,EACf,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,EAAE,CACX,iCAAiC,EACjC,CAAC,MAAM,IAAI,cAAc,EACzB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,YAAY,CACb,EACD,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,EAAE,CAClB,yCAAyC,EACzC,SAAS,CAAC,GAAG,CAAC,IAAI,MAAM,EACxB,mBAAmB,CACpB,YAGA,MAAM,CAAC,GAAG,CAAC,IAFP,KAAK,CAGF,CACX,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/components/Slider.d.ts
CHANGED
|
@@ -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`. */
|
package/components/Slider.js
CHANGED
|
@@ -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;
|
package/components/Spinner.d.ts
CHANGED
package/components/Spinner.js
CHANGED
|
@@ -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;
|
package/components/Surface.d.ts
CHANGED
|
@@ -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
|
/**
|
package/components/Surface.js
CHANGED
|
@@ -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;
|
package/components/SurfaceCut.js
CHANGED
|
@@ -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;
|
package/components/Switch.d.ts
CHANGED
|
@@ -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`. */
|
package/components/Switch.js
CHANGED
|
@@ -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;
|
package/components/TextArea.d.ts
CHANGED
|
@@ -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>`. */
|
package/components/TextArea.js
CHANGED
|
@@ -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;
|
package/components/Toast.d.ts
CHANGED
|
@@ -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
|
package/components/Toast.js
CHANGED
|
@@ -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)
|
package/components/Toolbar.d.ts
CHANGED
|
@@ -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;
|
package/components/Toolbar.js
CHANGED
|
@@ -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 }));
|
package/components/Tooltip.d.ts
CHANGED
|
@@ -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
|
/**
|
package/components/Tooltip.js
CHANGED
|
@@ -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`;
|
package/components/UIProvider.js
CHANGED
|
@@ -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("
|
|
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,
|
|
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"}
|
package/hooks/use-dialog.d.ts
CHANGED
package/hooks/use-dialog.js
CHANGED
|
@@ -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;
|
package/hooks/use-modal-utils.js
CHANGED
|
@@ -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);
|
package/hooks/use-surface.js
CHANGED
package/hooks/use-theme.js
CHANGED
package/hooks/use-toast.d.ts
CHANGED
|
@@ -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
|
package/hooks/use-toast.js
CHANGED
|
@@ -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, }) => {
|