@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.14 (2026-04-26)
|
|
4
|
+
|
|
5
|
+
### Build System
|
|
6
|
+
|
|
7
|
+
- bundle Colors and add extensions (29c311f)
|
|
8
|
+
|
|
9
|
+
## 0.0.13 (2026-04-26)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- OTP - add placeholder (fd7aaf4)
|
|
14
|
+
- Shortcut - render as <kbd> (dec931a)
|
|
15
|
+
|
|
16
|
+
### Chores
|
|
17
|
+
|
|
18
|
+
- placeholder in OTP (8195af4)
|
|
19
|
+
|
|
3
20
|
## 0.0.12 (2026-04-26)
|
|
4
21
|
|
|
5
22
|
### Features
|
package/components/Backdrop.js
CHANGED
|
@@ -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 Backdrop = (props) => {
|
|
4
4
|
const { className = '', children, ref, ...rest } = props;
|
|
5
5
|
return (_jsx("div", { ref: ref, className: cn('backdrop fixed inset-0 z-50 bg-backdrop/90', className), ...rest, children: children }));
|
package/components/Button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementType, ReactNode, Ref, CSSProperties, 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 ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
5
|
type ButtonSurface = 'surface' | 'cut';
|
|
6
6
|
interface ButtonOwnProps<C extends ElementType = 'button'> {
|
package/components/Button.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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 { FocusableLayer } from './FocusableLayer';
|
|
6
|
-
import { Surface } from './Surface';
|
|
7
|
-
import { SurfaceCut } from './SurfaceCut';
|
|
3
|
+
import { cn } from '../shared/cn.js';
|
|
4
|
+
import { roundedClasses } from '../shared/rounded-classes.js';
|
|
5
|
+
import { FocusableLayer } from './FocusableLayer.js';
|
|
6
|
+
import { Surface } from './Surface.js';
|
|
7
|
+
import { SurfaceCut } from './SurfaceCut.js';
|
|
8
8
|
export const buttonIconSizes = {
|
|
9
9
|
sm: '[&>svg]:size-4',
|
|
10
10
|
md: '[&>svg]:size-4',
|
package/components/Checkbox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, ChangeEvent, MouseEvent, PointerEvent, ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import { Color } from '../types';
|
|
2
|
+
import { Color } from '../types.js';
|
|
3
3
|
export type CheckboxSize = 'sm' | 'md';
|
|
4
4
|
interface CheckboxOwnProps<C extends ElementType = 'label'> {
|
|
5
5
|
/** Controlled checked state. Default `false`. */
|
package/components/Checkbox.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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 { CheckIcon } from './icons/CheckIcon';
|
|
7
|
-
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 { CheckIcon } from './icons/CheckIcon.js';
|
|
7
|
+
import { Surface } from './Surface.js';
|
|
8
8
|
export function Checkbox(props) {
|
|
9
9
|
const accentColor = useAccentColor();
|
|
10
10
|
const { checked = false, disabled = false, readOnly, value, name, size = 'sm', required = false, onChange = () => { }, onClick = () => { }, onPointerDown = () => { }, input = true, inputId, className, checkClassName, color = accentColor, component = 'label', hoverable, focusable, ...rest } = props;
|
package/components/Chip.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 ChipSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
4
4
|
interface ChipOwnProps<C extends ElementType = 'span'> {
|
|
5
5
|
/** Chip content - typically a short label, optionally with an icon. */
|
package/components/Chip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, } from 'react';
|
|
3
|
-
import { cn } from '../shared/cn';
|
|
4
|
-
import { Surface } from './Surface';
|
|
3
|
+
import { cn } from '../shared/cn.js';
|
|
4
|
+
import { Surface } from './Surface.js';
|
|
5
5
|
export const Chip = (props) => {
|
|
6
6
|
const elRef = useRef(null);
|
|
7
7
|
const { children, disabled, className = '', contentClassName = '', rounded = false, size = 'md', component = 'span', outline, hoverable, clickable, color = '', icon: IconComponent, iconProps = {}, ref, ...rest } = props;
|
package/components/Dialog.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { 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 `Dialog` + `DialogTrigger` + `Dialog` compound. Use when you want
|
|
6
6
|
* the trigger and the dialog to be siblings in JSX:
|
package/components/Dialog.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cloneElement, createContext, useContext, useEffect, useId, useRef, useState, } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import { useAccentColor } from '../hooks/use-accent-color';
|
|
5
|
-
import { useDevice } from '../hooks/use-device';
|
|
6
|
-
import { useFocusTrap } from '../hooks/use-focus-trap';
|
|
7
|
-
import { useModalUtils } from '../hooks/use-modal-utils';
|
|
8
|
-
import { useTheme } from '../hooks/use-theme';
|
|
9
|
-
import { cn } from '../shared/cn';
|
|
10
|
-
import { nextTick } from '../shared/next-tick';
|
|
11
|
-
import { Backdrop } from './Backdrop';
|
|
12
|
-
import { Button } from './Button';
|
|
13
|
-
import { Input } from './Input';
|
|
14
|
-
import { ModalController } from './ModalController';
|
|
15
|
-
import { Surface } from './Surface';
|
|
4
|
+
import { useAccentColor } from '../hooks/use-accent-color.js';
|
|
5
|
+
import { useDevice } from '../hooks/use-device.js';
|
|
6
|
+
import { useFocusTrap } from '../hooks/use-focus-trap.js';
|
|
7
|
+
import { useModalUtils } from '../hooks/use-modal-utils.js';
|
|
8
|
+
import { useTheme } from '../hooks/use-theme.js';
|
|
9
|
+
import { cn } from '../shared/cn.js';
|
|
10
|
+
import { nextTick } from '../shared/next-tick.js';
|
|
11
|
+
import { Backdrop } from './Backdrop.js';
|
|
12
|
+
import { Button } from './Button.js';
|
|
13
|
+
import { Input } from './Input.js';
|
|
14
|
+
import { ModalController } from './ModalController.js';
|
|
15
|
+
import { Surface } from './Surface.js';
|
|
16
16
|
const DialogRootContext = createContext(null);
|
|
17
17
|
/**
|
|
18
18
|
* State container for the `Dialog` + `DialogTrigger` + `Dialog` compound. Use when you want
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog } from './Dialog';
|
|
3
|
-
import { useDialogsPortalContext } from './DialogsPortalContext';
|
|
2
|
+
import { Dialog } from './Dialog.js';
|
|
3
|
+
import { useDialogsPortalContext } from './DialogsPortalContext.js';
|
|
4
4
|
export function DialogsPortal() {
|
|
5
5
|
const { data, state, setState, setData } = useDialogsPortalContext();
|
|
6
6
|
if (!data)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Color } from '../types';
|
|
2
|
+
import { Color } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Shape of the currently open dialog in the imperative dialog portal. The portal renders at
|
|
5
5
|
* most one dialog at a time; opening a new one replaces the previous via the context setter.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } 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 const FocusableLayer = (props) => {
|
|
5
5
|
const accentColor = useAccentColor();
|
|
6
6
|
const { className, group, color = accentColor, force } = props;
|
package/components/Input.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, ReactNode, Ref, ChangeEvent, KeyboardEvent, FocusEvent, ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import { Color } from '../types';
|
|
2
|
+
import { Color } from '../types.js';
|
|
3
3
|
export type InputSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
4
4
|
interface InputOwnProps<C extends ElementType = 'div', IC extends ElementType = 'input'> {
|
|
5
5
|
/** Polymorphic **wrapper** element. Defaults to `'div'`. (For the inner input, see `inputComponent`.) */
|
package/components/Input.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { 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 { Button } from './Button';
|
|
7
|
-
import { FocusableLayer } from './FocusableLayer';
|
|
8
|
-
import { CloseIcon } from './icons/CloseIcon';
|
|
9
|
-
import { SurfaceCut } from './SurfaceCut';
|
|
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 { Button } from './Button.js';
|
|
7
|
+
import { FocusableLayer } from './FocusableLayer.js';
|
|
8
|
+
import { CloseIcon } from './icons/CloseIcon.js';
|
|
9
|
+
import { SurfaceCut } from './SurfaceCut.js';
|
|
10
10
|
export const Input = (props) => {
|
|
11
11
|
const accentColor = useAccentColor();
|
|
12
12
|
const { component = 'div', type = 'text', value, displayValue, placeholder, name, required = false, disabled = false, readOnly, inputId, rounded = false, size = 'lg', onChange = () => { }, onKeyDown = () => { }, onFocus = () => { }, onBlur = () => { }, onClear = () => { }, color = accentColor, prefix, min, step, suffix, className, contentClassName, inputClassName, max, maxLength, clearButton, valid = true, infoMessage, errorMessage, pattern, inputMode, icon, surfaceClassName, autoFocus, inputComponent = 'input', inputComponentProps = {}, ref: externalRef, inputRef: externalInputRef, } = props;
|
package/components/Link.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from 'react';
|
|
3
|
-
import { cn } from '../shared/cn';
|
|
3
|
+
import { cn } from '../shared/cn.js';
|
|
4
4
|
export const Link = ({ children, className = '', disabled = false, readOnly = false, component, focusable = true, onClick, href, ref, ...rest }) => {
|
|
5
5
|
const elRef = useRef(null);
|
|
6
6
|
const Component = (typeof component === 'undefined'
|
package/components/List.js
CHANGED
|
@@ -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 List = (props) => {
|
|
4
4
|
const { children, className = '', ref, ...rest } = props;
|
|
5
5
|
return (_jsx("div", { ref: ref, className: cn('list flex flex-col p-2', className), ...rest, children: children }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode, Ref, ElementType } from 'react';
|
|
2
|
-
import { Color } from '../types';
|
|
3
|
-
import { ButtonProps, ButtonSize } from './Button';
|
|
4
|
-
import { SurfaceVariant } from './Surface';
|
|
2
|
+
import { Color } from '../types.js';
|
|
3
|
+
import { ButtonProps, ButtonSize } from './Button.js';
|
|
4
|
+
import { SurfaceVariant } from './Surface.js';
|
|
5
5
|
interface ListButtonOwnProps<C extends ElementType = 'button'> {
|
|
6
6
|
/** Title content of the row (the main text/element on the row). */
|
|
7
7
|
children?: ReactNode;
|
package/components/ListButton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../shared/cn';
|
|
3
|
-
import { Button, buttonIconSizes } from './Button';
|
|
2
|
+
import { cn } from '../shared/cn.js';
|
|
3
|
+
import { Button, buttonIconSizes } from './Button.js';
|
|
4
4
|
export const ListButton = (props) => {
|
|
5
5
|
const { children, className = '', contentClassName = '', innerContentClassName = '', disabled = false, readOnly = false, size = 'lg', component = 'button', color = '', icon, iconClassName = '', header, headerClassName = '', footer, footerClassName = '', selected = false, titleClassName = '', after, ref, variant = 'transparent', outline = false, rounded = true, ...rest } = props;
|
|
6
6
|
const ButtonEl = Button;
|
package/components/ListItem.js
CHANGED
|
@@ -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 ListItem = (props, ref) => {
|
|
4
4
|
const { children, className = '', ...rest } = props;
|
|
5
5
|
return (_jsx("div", { ref: ref, className: cn('flex min-h-9 items-center gap-4 px-2 py-1 text-xs font-medium', className), ...rest, children: children }));
|
|
@@ -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 ListSeparator = (props) => {
|
|
4
4
|
const { children, className = '', ref, ...rest } = props;
|
|
5
5
|
return (_jsx("div", { ref: ref, className: cn('list-separator -mx-2 my-2 h-px bg-surface-outline', className), ...rest, children: children }));
|
package/components/ListTitle.js
CHANGED
|
@@ -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 ListTitle = (props) => {
|
|
4
4
|
const { children, className = '', ref, ...rest } = props;
|
|
5
5
|
return (_jsx("div", { ref: ref, className: cn('list-title flex items-end gap-4 p-2 text-xs font-medium text-on-surface-dark uppercase select-none', className), ...rest, children: children }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode, Ref } from 'react';
|
|
2
|
-
import { Color } from '../types';
|
|
3
|
-
import { SurfaceProps, SurfaceVariant } from './Surface';
|
|
2
|
+
import { Color } from '../types.js';
|
|
3
|
+
import { SurfaceProps, SurfaceVariant } from './Surface.js';
|
|
4
4
|
export type NumberFieldSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
5
|
interface NumberFieldOwnProps {
|
|
6
6
|
/** Custom content rendered inside the number field container (rare - most usage is value-only). */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../shared/cn';
|
|
3
|
-
import { roundedClasses } from '../shared/rounded-classes';
|
|
4
|
-
import { Button } from './Button';
|
|
5
|
-
import { Input } from './Input';
|
|
6
|
-
import { Surface } from './Surface';
|
|
7
|
-
import { SurfaceCut } from './SurfaceCut';
|
|
2
|
+
import { cn } from '../shared/cn.js';
|
|
3
|
+
import { roundedClasses } from '../shared/rounded-classes.js';
|
|
4
|
+
import { Button } from './Button.js';
|
|
5
|
+
import { Input } from './Input.js';
|
|
6
|
+
import { Surface } from './Surface.js';
|
|
7
|
+
import { SurfaceCut } from './SurfaceCut.js';
|
|
8
8
|
export const NumberField = (props) => {
|
|
9
9
|
const { children, input = true, inputClassName = '', className = '', contentClassName = '', disabled = false, readOnly = false, rounded = true, valueRounded = false, size = 'md', color = '', outline = true, variant = 'gradient', buttonVariant = 'transparent', buttonOutline = false, surfaceLevel, min = 0, max = 1000000, value = 0, step = 1, onChange = () => { }, ref, ...rest } = props;
|
|
10
10
|
const decrease = () => {
|
package/components/OTPField.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
|
-
import { InputSize } from './Input';
|
|
2
|
+
import { InputSize } from './Input.js';
|
|
3
3
|
interface OTPFieldOwnProps {
|
|
4
4
|
/** OTP cells - one or more `OTPFieldInput`, with optional `OTPFieldSeparator` between. */
|
|
5
5
|
children?: ReactNode;
|
package/components/OTPField.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Children, cloneElement, isValidElement, useCallback, useMemo, useRef, } from 'react';
|
|
3
|
-
import { cn } from '../shared/cn';
|
|
4
|
-
import { roundedClasses } from '../shared/rounded-classes';
|
|
5
|
-
import { FocusableLayer } from './FocusableLayer';
|
|
6
|
-
import { OTPFieldContextProvider } from './OTPFieldContext';
|
|
7
|
-
import { OTPFieldInput } from './OTPFieldInput';
|
|
3
|
+
import { cn } from '../shared/cn.js';
|
|
4
|
+
import { roundedClasses } from '../shared/rounded-classes.js';
|
|
5
|
+
import { FocusableLayer } from './FocusableLayer.js';
|
|
6
|
+
import { OTPFieldContextProvider } from './OTPFieldContext.js';
|
|
7
|
+
import { OTPFieldInput } from './OTPFieldInput.js';
|
|
8
8
|
const isOTPInputElement = (child) => isValidElement(child) &&
|
|
9
9
|
child.type?.__OTPFieldInput ===
|
|
10
10
|
true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTPFieldInput.d.ts","sourceRoot":"","sources":["../../../src/components/OTPFieldInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,GAAG,EAAE,MAAM,OAAO,CAAC;AAM5C,UAAU,qBAAqB;IAC7B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAUvD,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,
|
|
1
|
+
{"version":3,"file":"OTPFieldInput.d.ts","sourceRoot":"","sources":["../../../src/components/OTPFieldInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,GAAG,EAAE,MAAM,OAAO,CAAC;AAM5C,UAAU,qBAAqB;IAC7B,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAUvD,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CAwCtD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../shared/cn';
|
|
3
|
-
import { Input } from './Input';
|
|
4
|
-
import { useOTPFieldContext } from './OTPFieldContext';
|
|
2
|
+
import { cn } from '../shared/cn.js';
|
|
3
|
+
import { Input } from './Input.js';
|
|
4
|
+
import { useOTPFieldContext } from './OTPFieldContext.js';
|
|
5
5
|
const widthClasses = {
|
|
6
6
|
sm: 'w-6',
|
|
7
7
|
md: 'w-7',
|
|
@@ -10,9 +10,9 @@ const widthClasses = {
|
|
|
10
10
|
'2xl': 'w-12',
|
|
11
11
|
};
|
|
12
12
|
export const OTPFieldInput = (props) => {
|
|
13
|
-
const { className, inputClassName, ref, index = 0 } = props;
|
|
13
|
+
const { placeholder, className, inputClassName, ref, index = 0 } = props;
|
|
14
14
|
const { size, pattern, disabled, readOnly, inputMode, getCellValue, registerInput, onCellChange, onCellKeyDown, onCellFocus, onCellPaste, } = useOTPFieldContext();
|
|
15
|
-
return (_jsx(Input, { ref: ref, size: size, pattern: pattern, inputMode: inputMode, disabled: disabled, readOnly: readOnly, maxLength: 1, value: getCellValue(index), className: cn(widthClasses[size], className), inputClassName: cn('px-0 text-center', inputClassName), inputRef: (el) => registerInput(index, el), onChange: (value, event) => onCellChange(index, value, event), onKeyDown: (event) => onCellKeyDown(index, event), onFocus: (event) => onCellFocus(index, event), inputComponentProps: {
|
|
15
|
+
return (_jsx(Input, { ref: ref, size: size, pattern: pattern, inputMode: inputMode, disabled: disabled, readOnly: readOnly, maxLength: 1, value: getCellValue(index), className: cn(widthClasses[size], className), inputClassName: cn('px-0 text-center', inputClassName), inputRef: (el) => registerInput(index, el), onChange: (value, event) => onCellChange(index, value, event), onKeyDown: (event) => onCellKeyDown(index, event), onFocus: (event) => onCellFocus(index, event), placeholder: placeholder, inputComponentProps: {
|
|
16
16
|
autoComplete: index === 0 ? 'one-time-code' : 'off',
|
|
17
17
|
onPaste: (event) => onCellPaste(index, event),
|
|
18
18
|
} }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTPFieldInput.js","sourceRoot":"","sources":["../../../src/components/OTPFieldInput.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"OTPFieldInput.js","sourceRoot":"","sources":["../../../src/components/OTPFieldInput.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAiBvD,MAAM,YAAY,GAA8B;IAC9C,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAE,EAAE;IACzD,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,GACZ,GAAG,kBAAkB,EAAE,CAAC;IAEzB,OAAO,CACL,KAAC,KAAK,IACJ,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,CAAC,EACZ,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,EAC1B,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAC5C,cAAc,EAAE,EAAE,CAAC,kBAAkB,EAAE,cAAc,CAAC,EACtD,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,CAAC,EAC1C,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAC7D,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,EACjD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,EAC7C,WAAW,EAAE,WAAW,EACxB,mBAAmB,EAAE;YACnB,YAAY,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK;YACnD,OAAO,EAAE,CAAC,KAAuC,EAAE,EAAE,CACnD,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC;SAC5B,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAED,aAAyD,CAAC,eAAe;IACxE,IAAI,CAAC"}
|
|
@@ -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 OTPFieldSeparator = (props) => {
|
|
4
4
|
const { children, className, ref, ...rest } = props;
|
|
5
5
|
return (_jsx("div", { ref: ref, "aria-hidden": true, className: cn('flex items-center text-surface-outline select-none', className), ...rest, children: children ?? _jsx("span", { className: "h-0.5 w-2 bg-surface-outline" }) }));
|
package/components/Popover.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Color } from '../types';
|
|
2
|
-
import { SurfaceProps, SurfaceVariant } from './Surface';
|
|
1
|
+
import { Color } from '../types.js';
|
|
2
|
+
import { SurfaceProps, SurfaceVariant } from './Surface.js';
|
|
3
3
|
/**
|
|
4
4
|
* State container for the `Popover` + `PopoverTrigger` + `Popover` compound. Holds the open
|
|
5
5
|
* state and the anchor ref so a `PopoverTrigger` can register the anchor element and a sibling
|
package/components/Popover.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cloneElement, createContext, useContext, useEffect, useRef, useState, } 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 { Backdrop } from './Backdrop';
|
|
8
|
-
import { ModalController } from './ModalController';
|
|
9
|
-
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 { Backdrop } from './Backdrop.js';
|
|
8
|
+
import { ModalController } from './ModalController.js';
|
|
9
|
+
import { Surface } from './Surface.js';
|
|
10
10
|
const PopoverContext = createContext(null);
|
|
11
11
|
const PopoverRootContext = createContext(null);
|
|
12
12
|
/**
|
package/components/Popup.d.ts
CHANGED
package/components/Popup.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cloneElement, createContext, useContext, useEffect, useRef, useState, } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import { useFocusTrap } from '../hooks/use-focus-trap';
|
|
5
|
-
import { useModalUtils } from '../hooks/use-modal-utils';
|
|
6
|
-
import { cn } from '../shared/cn';
|
|
7
|
-
import { Backdrop } from './Backdrop';
|
|
8
|
-
import { Button } from './Button';
|
|
9
|
-
import { CloseIcon } from './icons/CloseIcon';
|
|
10
|
-
import { ModalController } from './ModalController';
|
|
11
|
-
import { Surface } from './Surface';
|
|
4
|
+
import { useFocusTrap } from '../hooks/use-focus-trap.js';
|
|
5
|
+
import { useModalUtils } from '../hooks/use-modal-utils.js';
|
|
6
|
+
import { cn } from '../shared/cn.js';
|
|
7
|
+
import { Backdrop } from './Backdrop.js';
|
|
8
|
+
import { Button } from './Button.js';
|
|
9
|
+
import { CloseIcon } from './icons/CloseIcon.js';
|
|
10
|
+
import { ModalController } from './ModalController.js';
|
|
11
|
+
import { Surface } from './Surface.js';
|
|
12
12
|
const PopupRootContext = createContext(null);
|
|
13
13
|
/**
|
|
14
14
|
* State container for the `Popup` + `PopupTrigger` + `Popup` compound. Use when you want
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SurfaceVariant } from './Surface';
|
|
1
|
+
import { SurfaceVariant } from './Surface.js';
|
|
2
2
|
export interface PopupContentProps {
|
|
3
3
|
/** Forwarded to the underlying `Surface` as `level`. Default `1`. Accepts the relative (`"+1"`/`"-1"`) syntax via `Surface.level`. */
|
|
4
4
|
surfaceLevel?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../shared/cn';
|
|
3
|
-
import { Surface } from './Surface';
|
|
2
|
+
import { cn } from '../shared/cn.js';
|
|
3
|
+
import { Surface } from './Surface.js';
|
|
4
4
|
export const PopupContent = (props) => {
|
|
5
5
|
const { surfaceLevel = 1, children, contentClassName = '', className = '', variant = 'solid', outline = true, ref, } = props;
|
|
6
6
|
return (_jsx(Surface, { level: surfaceLevel, className: cn('rounded-3xl', className), ref: ref, variant: variant, outline: outline, contentClassName: cn('!h-auto w-full p-4', contentClassName), children: children }));
|
package/components/Radio.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, ChangeEvent, MouseEvent, PointerEvent, ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import { Color } from '../types';
|
|
2
|
+
import { Color } from '../types.js';
|
|
3
3
|
export type RadioSize = 'sm' | 'md';
|
|
4
4
|
interface RadioOwnProps<C extends ElementType = 'label'> {
|
|
5
5
|
/** Controlled checked state. Default `false`. */
|
package/components/Radio.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 Radio(props) {
|
|
8
8
|
const accentColor = useAccentColor();
|
|
9
9
|
const { checked = false, disabled = false, readOnly, value, name, size = 'sm', required = false, onChange = () => { }, onClick = () => { }, onPointerDown = () => { }, input = true, inputId, className, color = accentColor, component = 'label', hoverable, focusable, ...rest } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref, ChangeEvent } from 'react';
|
|
2
|
-
import { InputSize } from './Input';
|
|
3
|
-
import { SurfaceProps } from './Surface';
|
|
2
|
+
import { InputSize } from './Input.js';
|
|
3
|
+
import { SurfaceProps } from './Surface.js';
|
|
4
4
|
interface SearchFieldOwnProps {
|
|
5
5
|
/** Controlled query string. Default `''`. */
|
|
6
6
|
value?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../shared/cn';
|
|
3
|
-
import { SearchIcon } from './icons/SearchIcon';
|
|
4
|
-
import { Input } from './Input';
|
|
5
|
-
import { Surface } from './Surface';
|
|
2
|
+
import { cn } from '../shared/cn.js';
|
|
3
|
+
import { SearchIcon } from './icons/SearchIcon.js';
|
|
4
|
+
import { Input } from './Input.js';
|
|
5
|
+
import { Surface } from './Surface.js';
|
|
6
6
|
export const SearchField = (props) => {
|
|
7
7
|
const { value = '', inset = false, size = 'md', placeholder = 'Search', className = '', onChange = () => { }, ref, ...rest } = props;
|
|
8
8
|
return (_jsx(Surface, { level: inset ? '+0' : '+1', className: cn('sticky z-20', !inset && 'top-0 ml-px rounded-t-3xl', inset && 'top-2 mx-2 w-auto rounded-full', className), outline: !inset, ref: ref, ...rest, children: _jsxs("div", { className: cn('flex items-center', !inset && 'p-1.5'), children: [_jsx(Input, { className: "w-full", placeholder: placeholder, onChange: (v, e) => onChange(v, e), contentClassName: "pl-6.5", value: value, clearButton: true, rounded: true, onClear: () => onChange('') }), _jsx(SearchIcon, { className: cn('pointer-events-none absolute top-1/2 left-2 size-4 -translate-y-1/2 text-on-surface-darker', inset ? 'left-2' : 'left-4') })] }) }));
|
|
@@ -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 SectionTitle = (props) => {
|
|
4
4
|
const { children, className = '', ref, ...rest } = props;
|
|
5
5
|
return (_jsx("div", { ref: ref, className: cn('section-title flex items-end gap-4 text-xs font-medium text-on-surface-dark uppercase select-none', className), ...rest, children: children }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode, Ref, ElementType, ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import { Color } from '../types';
|
|
3
|
-
import { ButtonSize } from './Button';
|
|
4
|
-
import { SurfaceVariant } from './Surface';
|
|
2
|
+
import { Color } from '../types.js';
|
|
3
|
+
import { ButtonSize } from './Button.js';
|
|
4
|
+
import { SurfaceVariant } from './Surface.js';
|
|
5
5
|
interface SegmentedOwnProps<C extends ElementType = 'div'> {
|
|
6
6
|
/** Should be one or more `SegmentedButton` elements. */
|
|
7
7
|
children?: ReactNode;
|
package/components/Segmented.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } 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 { SegmentedContextProvider } from './SegmentedContext';
|
|
3
|
+
import { useAccentColor } from '../hooks/use-accent-color.js';
|
|
4
|
+
import { cn } from '../shared/cn.js';
|
|
5
|
+
import { SegmentedContextProvider } from './SegmentedContext.js';
|
|
6
6
|
export const Segmented = (props) => {
|
|
7
7
|
const elRef = useRef(null);
|
|
8
8
|
const accentColor = useAccentColor();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
-
import { ButtonProps } from './Button';
|
|
2
|
+
import { ButtonProps } from './Button.js';
|
|
3
3
|
export type SegmentedButtonProps<C extends ElementType = 'button'> = ButtonProps<C> & {
|
|
4
4
|
/**
|
|
5
5
|
* Marks this button as the selected segment. When `true`, switches to the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from './Button';
|
|
3
|
-
import { useSegmentedContext } from './SegmentedContext';
|
|
2
|
+
import { Button } from './Button.js';
|
|
3
|
+
import { useSegmentedContext } from './SegmentedContext.js';
|
|
4
4
|
export const SegmentedButton = (props) => {
|
|
5
5
|
const { size = 'md', rounded = true, color, variant, outline, activeColor, activeVariant, activeOutline, } = useSegmentedContext();
|
|
6
6
|
const { active, ...rest } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { Color } from '../types';
|
|
3
|
-
import { ButtonProps, ButtonSize } from './Button';
|
|
2
|
+
import { Color } from '../types.js';
|
|
3
|
+
import { ButtonProps, ButtonSize } from './Button.js';
|
|
4
4
|
/**
|
|
5
5
|
* Shape of the data published by `Segmented` to its child `SegmentedButton`s.
|
|
6
6
|
* Each `SegmentedButton` reads this via `useSegmentedContext()` to pick its inactive vs active
|