@cognitap/radiant 0.0.78 → 0.0.79
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 +11 -0
- package/README.md +6 -3
- package/RELEASE_POLICY.md +8 -19
- package/dist/library/charts/Charts.js +1 -1
- package/dist/library/charts/Charts.js.map +1 -1
- package/dist/library/components/Accordion/Accordion.js +1 -1
- package/dist/library/components/Accordion/Accordion.js.map +1 -1
- package/dist/library/components/Alert/Alert.js +1 -1
- package/dist/library/components/Alert/Alert.js.map +1 -1
- package/dist/library/components/AppShell/AppShell.js +1 -1
- package/dist/library/components/AppShell/AppShell.js.map +1 -1
- package/dist/library/components/AspectRatio/AspectRatio.js +1 -1
- package/dist/library/components/AspectRatio/AspectRatio.js.map +1 -1
- package/dist/library/components/Avatar/Avatar.js +1 -1
- package/dist/library/components/Avatar/Avatar.js.map +1 -1
- package/dist/library/components/Badge/Badge.js +1 -1
- package/dist/library/components/Badge/Badge.js.map +1 -1
- package/dist/library/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/library/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/library/components/Button/Button.js +1 -1
- package/dist/library/components/Button/Button.js.map +1 -1
- package/dist/library/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/library/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/library/components/Card/Card.js +1 -1
- package/dist/library/components/Card/Card.js.map +1 -1
- package/dist/library/components/Carousel/Carousel.js +6 -6
- package/dist/library/components/Carousel/Carousel.js.map +1 -1
- package/dist/library/components/Checkbox/Checkbox.js +1 -1
- package/dist/library/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/library/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/dist/library/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/library/components/CodeBlock/CodeBlock.js +1 -1
- package/dist/library/components/CodeBlock/CodeBlock.js.map +1 -1
- package/dist/library/components/Collapsible/Collapsible.js +1 -1
- package/dist/library/components/Collapsible/Collapsible.js.map +1 -1
- package/dist/library/components/Combobox/Combobox.js +1 -1
- package/dist/library/components/Combobox/Combobox.js.map +1 -1
- package/dist/library/components/Command/Command.js +1 -1
- package/dist/library/components/Command/Command.js.map +1 -1
- package/dist/library/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/library/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/library/components/Dialog/Dialog.js +1 -1
- package/dist/library/components/Dialog/Dialog.js.map +1 -1
- package/dist/library/components/Drawer/Drawer.js +1 -1
- package/dist/library/components/Drawer/Drawer.js.map +1 -1
- package/dist/library/components/EmptyState/EmptyState.js +1 -1
- package/dist/library/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/library/components/Field/Field.js +1 -1
- package/dist/library/components/Field/Field.js.map +1 -1
- package/dist/library/components/Fieldset/Fieldset.js +1 -1
- package/dist/library/components/Fieldset/Fieldset.js.map +1 -1
- package/dist/library/components/FileInput/FileInput.js +1 -1
- package/dist/library/components/FileInput/FileInput.js.map +1 -1
- package/dist/library/components/Form/Form.js +4 -4
- package/dist/library/components/Form/Form.js.map +1 -1
- package/dist/library/components/HoverCard/HoverCard.js +1 -1
- package/dist/library/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/library/components/InlineCode/InlineCode.js +1 -1
- package/dist/library/components/InlineCode/InlineCode.js.map +1 -1
- package/dist/library/components/Input/Input.js +1 -1
- package/dist/library/components/Input/Input.js.map +1 -1
- package/dist/library/components/InputGroup/InputGroup.js +1 -1
- package/dist/library/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/library/components/Kbd/Kbd.js +1 -1
- package/dist/library/components/Kbd/Kbd.js.map +1 -1
- package/dist/library/components/Link/Link.js +1 -1
- package/dist/library/components/Link/Link.js.map +1 -1
- package/dist/library/components/Menu/Menu.js +1 -1
- package/dist/library/components/Menu/Menu.js.map +1 -1
- package/dist/library/components/Menubar/Menubar.js +1 -1
- package/dist/library/components/Menubar/Menubar.js.map +1 -1
- package/dist/library/components/Meter/Meter.js +1 -1
- package/dist/library/components/Meter/Meter.js.map +1 -1
- package/dist/library/components/NativeSelect/NativeSelect.js +1 -1
- package/dist/library/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/library/components/NavLink/NavLink.js +1 -1
- package/dist/library/components/NavLink/NavLink.js.map +1 -1
- package/dist/library/components/NavigationMenu/NavigationMenu.js +1 -1
- package/dist/library/components/NavigationMenu/NavigationMenu.js.map +1 -1
- package/dist/library/components/NumberField/NumberField.js +1 -1
- package/dist/library/components/NumberField/NumberField.js.map +1 -1
- package/dist/library/components/OTPField/OTPField.js +1 -1
- package/dist/library/components/OTPField/OTPField.js.map +1 -1
- package/dist/library/components/Pagination/Pagination.js +1 -1
- package/dist/library/components/Pagination/Pagination.js.map +1 -1
- package/dist/library/components/PasswordInput/PasswordInput.js +1 -1
- package/dist/library/components/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/library/components/Popover/Popover.js +1 -1
- package/dist/library/components/Popover/Popover.js.map +1 -1
- package/dist/library/components/Progress/Progress.js +1 -1
- package/dist/library/components/Progress/Progress.js.map +1 -1
- package/dist/library/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/library/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/library/components/Resizable/Resizable.js +1 -1
- package/dist/library/components/Resizable/Resizable.js.map +1 -1
- package/dist/library/components/ScrollArea/ScrollArea.js +1 -1
- package/dist/library/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/library/components/Select/Select.js +1 -1
- package/dist/library/components/Select/Select.js.map +1 -1
- package/dist/library/components/Separator/Separator.js +1 -1
- package/dist/library/components/Separator/Separator.js.map +1 -1
- package/dist/library/components/Skeleton/Skeleton.js +1 -1
- package/dist/library/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/library/components/Slider/Slider.js +1 -1
- package/dist/library/components/Slider/Slider.js.map +1 -1
- package/dist/library/components/Spinner/Spinner.js +1 -1
- package/dist/library/components/Spinner/Spinner.js.map +1 -1
- package/dist/library/components/Switch/Switch.js +1 -1
- package/dist/library/components/Switch/Switch.js.map +1 -1
- package/dist/library/components/Table/Table.js +1 -1
- package/dist/library/components/Table/Table.js.map +1 -1
- package/dist/library/components/Tabs/Tabs.js +1 -1
- package/dist/library/components/Tabs/Tabs.js.map +1 -1
- package/dist/library/components/Tag/Tag.js +1 -1
- package/dist/library/components/Tag/Tag.js.map +1 -1
- package/dist/library/components/TagsInput/TagsInput.js +1 -1
- package/dist/library/components/TagsInput/TagsInput.js.map +1 -1
- package/dist/library/components/Textarea/Textarea.js +1 -1
- package/dist/library/components/Textarea/Textarea.js.map +1 -1
- package/dist/library/components/ThemeScope/ThemeScope.js +1 -1
- package/dist/library/components/ThemeScope/ThemeScope.js.map +1 -1
- package/dist/library/components/Toast/Toast.js +1 -1
- package/dist/library/components/Toast/Toast.js.map +1 -1
- package/dist/library/components/ToggleGroup/ToggleGroup.js +3 -1
- package/dist/library/components/ToggleGroup/ToggleGroup.js.map +1 -1
- package/dist/library/components/Toolbar/Toolbar.js +1 -1
- package/dist/library/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/library/components/Tooltip/Tooltip.js +1 -1
- package/dist/library/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/library/motion/MotionLink.js +1 -1
- package/dist/library/motion/MotionLink.js.map +1 -1
- package/dist/library/react/useComboboxPopup.d.ts.map +1 -1
- package/dist/library/react/useComboboxPopup.js +45 -6
- package/dist/library/react/useComboboxPopup.js.map +1 -1
- package/dist/library/react/useRovingFocus.d.ts.map +1 -1
- package/dist/library/react/useRovingFocus.js +76 -11
- package/dist/library/react/useRovingFocus.js.map +1 -1
- package/dist/library/react/useToastTimer.d.ts.map +1 -1
- package/dist/library/react/useToastTimer.js +28 -9
- package/dist/library/react/useToastTimer.js.map +1 -1
- package/dist/library/styles.css +1 -1
- package/docs/accessibility.md +23 -111
- package/docs/architecture.md +48 -242
- package/docs/motion.md +65 -130
- package/docs/theming.md +51 -427
- package/package.json +21 -13
- package/src/charts/Charts.tsx +1 -1
- package/src/components/Accordion/Accordion.tsx +1 -1
- package/src/components/Alert/Alert.tsx +1 -1
- package/src/components/AppShell/AppShell.tsx +1 -1
- package/src/components/AspectRatio/AspectRatio.tsx +1 -1
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Badge/Badge.tsx +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/ButtonGroup/ButtonGroup.tsx +1 -1
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Carousel/Carousel.tsx +6 -6
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +1 -1
- package/src/components/CodeBlock/CodeBlock.tsx +1 -1
- package/src/components/Collapsible/Collapsible.tsx +1 -1
- package/src/components/Combobox/Combobox.tsx +1 -1
- package/src/components/Command/Command.tsx +1 -1
- package/src/components/ContextMenu/ContextMenu.tsx +1 -1
- package/src/components/Dialog/Dialog.tsx +1 -1
- package/src/components/Drawer/Drawer.tsx +1 -1
- package/src/components/EmptyState/EmptyState.tsx +1 -1
- package/src/components/Field/Field.tsx +1 -1
- package/src/components/Fieldset/Fieldset.tsx +1 -1
- package/src/components/FileInput/FileInput.tsx +1 -1
- package/src/components/Form/Form.tsx +4 -4
- package/src/components/HoverCard/HoverCard.tsx +1 -1
- package/src/components/InlineCode/InlineCode.tsx +1 -1
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/InputGroup/InputGroup.tsx +1 -1
- package/src/components/Kbd/Kbd.tsx +1 -1
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/Menu/Menu.tsx +1 -1
- package/src/components/Menubar/Menubar.tsx +1 -1
- package/src/components/Meter/Meter.tsx +1 -1
- package/src/components/NativeSelect/NativeSelect.tsx +1 -1
- package/src/components/NavLink/NavLink.tsx +1 -1
- package/src/components/NavigationMenu/NavigationMenu.tsx +1 -1
- package/src/components/NumberField/NumberField.tsx +1 -1
- package/src/components/OTPField/OTPField.tsx +1 -1
- package/src/components/Pagination/Pagination.tsx +1 -1
- package/src/components/PasswordInput/PasswordInput.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.tsx +1 -1
- package/src/components/Resizable/Resizable.tsx +1 -1
- package/src/components/ScrollArea/ScrollArea.tsx +1 -1
- package/src/components/Select/Select.tsx +1 -1
- package/src/components/Separator/Separator.tsx +1 -1
- package/src/components/Skeleton/Skeleton.tsx +1 -1
- package/src/components/Slider/Slider.tsx +1 -1
- package/src/components/Spinner/Spinner.tsx +1 -1
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +1 -1
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/TagsInput/TagsInput.tsx +1 -1
- package/src/components/Textarea/Textarea.tsx +1 -1
- package/src/components/ThemeScope/ThemeScope.tsx +1 -1
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/ToggleGroup/ToggleGroup.tsx +3 -1
- package/src/components/Toolbar/Toolbar.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/css.d.ts +2 -0
- package/src/motion/MotionLink.tsx +1 -1
- package/src/react/useComboboxPopup.ts +38 -6
- package/src/react/useRovingFocus.ts +73 -8
- package/src/react/useToastTimer.ts +24 -9
- package/src/styles.d.ts +1 -0
- package/src/themes/baseline.css +1 -1
- package/src/typography.css +17 -12
- package/dist/library/cn.d.ts +0 -3
- package/dist/library/cn.d.ts.map +0 -1
- package/dist/library/cn.js +0 -370
- package/dist/library/cn.js.map +0 -1
- package/src/cn.ts +0 -372
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { headings, type HeadingLevel } from '../../internal/headings.js'
|
|
2
2
|
import type { ComponentProps } from 'react'
|
|
3
|
-
import { cn } from '
|
|
3
|
+
import { cn } from 'cn'
|
|
4
4
|
import { actionTone } from '../shared/actionStyles.js'
|
|
5
5
|
import { joinIds } from '../../internal/ids.js'
|
|
6
6
|
import type { Tone } from '../../presentation.js'
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from '../shared/composedLink.js'
|
|
22
22
|
import { scrollbarClass } from '../shared/scrollbarStyles.js'
|
|
23
23
|
import { Drawer, DrawerContent, DrawerTitle, DrawerClose, useDrawer } from '../Drawer/Drawer.js'
|
|
24
|
-
import { cn } from '
|
|
24
|
+
import { cn } from 'cn'
|
|
25
25
|
import { joinIds } from '../../internal/ids.js'
|
|
26
26
|
import { composeAction } from '../../internal/events.js'
|
|
27
27
|
import type { WithoutToggle, DistributiveOmit } from '../../internal/types.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { useEffect, useRef, useState, type ComponentProps } from 'react'
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from 'cn'
|
|
5
5
|
import { joinIds } from '../../internal/ids.js'
|
|
6
6
|
import type { ControlSize, PartStyle } from '../../presentation.js'
|
|
7
7
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type ComposedLinkProps,
|
|
5
5
|
type ComposedLinkRenderProps
|
|
6
6
|
} from '../shared/composedLink.js'
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from 'cn'
|
|
8
8
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
9
9
|
import { joinIds } from '../../internal/ids.js'
|
|
10
10
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
@@ -7,7 +7,7 @@ import { usePressHost } from '../../motion/host.js'
|
|
|
7
7
|
import { actionVariants } from '../shared/actionStyles.js'
|
|
8
8
|
import type { ButtonVariant, ControlSize, Tone } from '../../presentation.js'
|
|
9
9
|
import { Spinner } from '../Spinner/Spinner.js'
|
|
10
|
-
import { cn } from '
|
|
10
|
+
import { cn } from 'cn'
|
|
11
11
|
import { joinIds } from '../../internal/ids.js'
|
|
12
12
|
import { composeAction } from '../../internal/events.js'
|
|
13
13
|
import { useControllableState } from '../../react/useControllableState.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* oxlint-disable jsx-a11y/prefer-tag-over-role -- A passive action group uses a div; fieldset would introduce form grouping. */
|
|
2
2
|
import type { ComponentProps } from 'react'
|
|
3
|
-
import { cn } from '
|
|
3
|
+
import { cn } from 'cn'
|
|
4
4
|
import { joinIds } from '../../internal/ids.js'
|
|
5
5
|
import type { Orientation } from '../../presentation.js'
|
|
6
6
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { headings as headingTag, type HeadingLevel } from '../../internal/headings.js'
|
|
2
2
|
import type { ComponentProps } from 'react'
|
|
3
3
|
import { cva } from 'class-variance-authority'
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from 'cn'
|
|
5
5
|
import { joinIds } from '../../internal/ids.js'
|
|
6
6
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type ReactNode
|
|
14
14
|
} from 'react'
|
|
15
15
|
import { Button, type ButtonProps } from '../Button/Button.js'
|
|
16
|
-
import { cn } from '
|
|
16
|
+
import { cn } from 'cn'
|
|
17
17
|
import { joinIds } from '../../internal/ids.js'
|
|
18
18
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
19
19
|
import type { WithoutToggle } from '../../internal/types.js'
|
|
@@ -55,7 +55,7 @@ const Context = createContext<Binding | null>(null)
|
|
|
55
55
|
export function useCarousel(): CarouselState | null {
|
|
56
56
|
return useContext(Context)
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function useBinding() {
|
|
59
59
|
const value = useContext(Context)
|
|
60
60
|
if (!value) throw new Error('Carousel parts must be inside Carousel.')
|
|
61
61
|
return value
|
|
@@ -309,7 +309,7 @@ export function CarouselViewport({
|
|
|
309
309
|
onClickCapture,
|
|
310
310
|
...props
|
|
311
311
|
}: CarouselViewportProps) {
|
|
312
|
-
const state =
|
|
312
|
+
const state = useBinding(),
|
|
313
313
|
host = useRef<HTMLDivElement>(null),
|
|
314
314
|
owned = useComposedRefs(host, state.setViewport),
|
|
315
315
|
composed = useComposedRefs(owned, ref),
|
|
@@ -457,7 +457,7 @@ export function CarouselViewport({
|
|
|
457
457
|
/* oxlint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-noninteractive-tabindex */
|
|
458
458
|
export type CarouselActionProps = WithoutToggle<ButtonProps>
|
|
459
459
|
function Action({ direction, ...props }: CarouselActionProps & { direction: -1 | 1 }) {
|
|
460
|
-
const state =
|
|
460
|
+
const state = useBinding(),
|
|
461
461
|
item = state.items[state.index + direction]
|
|
462
462
|
return (
|
|
463
463
|
<Button
|
|
@@ -502,7 +502,7 @@ export function CarouselIndicators({
|
|
|
502
502
|
className,
|
|
503
503
|
...props
|
|
504
504
|
}: CarouselIndicatorsProps) {
|
|
505
|
-
const state =
|
|
505
|
+
const state = useBinding()
|
|
506
506
|
return (
|
|
507
507
|
<div
|
|
508
508
|
{...props}
|
|
@@ -527,7 +527,7 @@ export function CarouselIndicators({
|
|
|
527
527
|
)
|
|
528
528
|
}
|
|
529
529
|
export function CarouselAutoPlay({ onClick, ...props }: CarouselActionProps) {
|
|
530
|
-
const state =
|
|
530
|
+
const state = useBinding()
|
|
531
531
|
return (
|
|
532
532
|
<Button
|
|
533
533
|
{...props}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCallback, useLayoutEffect, useRef, type ComponentProps, type ReactNode } from 'react'
|
|
4
4
|
import { cva } from 'class-variance-authority'
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'cn'
|
|
6
6
|
import { joinIds } from '../../internal/ids.js'
|
|
7
7
|
import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
8
8
|
import { useNativeOwner, type CheckedOwner } from '../../react/useNativeOwner.js'
|
|
@@ -14,7 +14,7 @@ import { Checkbox, type CheckboxProps } from '../Checkbox/Checkbox.js'
|
|
|
14
14
|
import { Field, type FieldProps } from '../Field/Field.js'
|
|
15
15
|
import { useNativeOwner, type ValueOwner, type CheckedOwner } from '../../react/useNativeOwner.js'
|
|
16
16
|
import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
17
|
-
import { cn } from '
|
|
17
|
+
import { cn } from 'cn'
|
|
18
18
|
import { joinIds } from '../../internal/ids.js'
|
|
19
19
|
import type { ControlSize, PartStyle } from '../../presentation.js'
|
|
20
20
|
type OptionPresentation = Omit<
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from 'react'
|
|
12
12
|
import { Button, type ButtonProps, type ButtonRenderProps } from '../Button/Button.js'
|
|
13
13
|
import { ScrollArea, type ScrollAreaProps } from '../ScrollArea/ScrollArea.js'
|
|
14
|
-
import { cn } from '
|
|
14
|
+
import { cn } from 'cn'
|
|
15
15
|
import { joinIds } from '../../internal/ids.js'
|
|
16
16
|
import { composeAction } from '../../internal/events.js'
|
|
17
17
|
import type { DistributiveOmit, WithoutToggle } from '../../internal/types.js'
|
|
@@ -4,7 +4,7 @@ import type { ComponentProps, ToggleEvent } from 'react'
|
|
|
4
4
|
import { createContext, useContext, useId, useLayoutEffect, useRef } from 'react'
|
|
5
5
|
import { cva } from 'class-variance-authority'
|
|
6
6
|
import { useTransitionHost } from '../../motion/host.js'
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from 'cn'
|
|
8
8
|
import { joinIds } from '../../internal/ids.js'
|
|
9
9
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
10
10
|
import { useControllableState } from '../../react/useControllableState.js'
|
|
@@ -25,7 +25,7 @@ import { validateTags } from '../../internal/tags.js'
|
|
|
25
25
|
import { useArrayFormBridge } from '../../react/useArrayFormBridge.js'
|
|
26
26
|
import { useField, useFieldControl } from '../Field/Field.js'
|
|
27
27
|
import type { DistributiveOmit, WithoutToggle } from '../../internal/types.js'
|
|
28
|
-
import { cn } from '
|
|
28
|
+
import { cn } from 'cn'
|
|
29
29
|
import { joinIds } from '../../internal/ids.js'
|
|
30
30
|
import { controlMetrics } from '../shared/controlStyles.js'
|
|
31
31
|
import {
|
|
@@ -32,7 +32,7 @@ import type { StateOwner } from '../../react/useNativeOwner.js'
|
|
|
32
32
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
33
33
|
import { WithoutField } from '../Field/Field.js'
|
|
34
34
|
import { Kbd, KbdGroup } from '../Kbd/Kbd.js'
|
|
35
|
-
import { cn } from '
|
|
35
|
+
import { cn } from 'cn'
|
|
36
36
|
import { itemGroupLabelClass } from '../shared/controlStyles.js'
|
|
37
37
|
import { useControllableState } from '../../react/useControllableState.js'
|
|
38
38
|
import type { ControlSize } from '../../presentation.js'
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
import { usePopoverContext } from '../Popover/Popover.js'
|
|
45
45
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
46
46
|
import { joinIds } from '../../internal/ids.js'
|
|
47
|
-
import { cn } from '
|
|
47
|
+
import { cn } from 'cn'
|
|
48
48
|
import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
49
49
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
50
50
|
import { focusRingClass } from '../shared/focusStyles.js'
|
|
@@ -6,7 +6,7 @@ import { cva } from 'class-variance-authority'
|
|
|
6
6
|
import { Button, type ButtonProps, type ButtonRenderProps } from '../Button/Button.js'
|
|
7
7
|
import { callerOwnsPress } from '../../motion/pressPolicy.js'
|
|
8
8
|
import { useTransitionHost } from '../../motion/host.js'
|
|
9
|
-
import { cn } from '
|
|
9
|
+
import { cn } from 'cn'
|
|
10
10
|
import { composeAction } from '../../internal/events.js'
|
|
11
11
|
import { joinIds } from '../../internal/ids.js'
|
|
12
12
|
import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type DialogTitleProps,
|
|
20
20
|
type DialogDescriptionProps
|
|
21
21
|
} from '../Dialog/Dialog.js'
|
|
22
|
-
import { cn } from '
|
|
22
|
+
import { cn } from 'cn'
|
|
23
23
|
import { composeAction } from '../../internal/events.js'
|
|
24
24
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
25
25
|
import { joinIds } from '../../internal/ids.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react'
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
-
import { cn } from '
|
|
3
|
+
import { cn } from 'cn'
|
|
4
4
|
import { joinIds } from '../../internal/ids.js'
|
|
5
5
|
import { headings, type HeadingLevel } from '../../internal/headings.js'
|
|
6
6
|
import { actionTone } from '../shared/actionStyles.js'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { createContext, useContext, useId } from 'react'
|
|
4
4
|
import type { ComponentProps, ReactNode } from 'react'
|
|
5
5
|
import { cva } from 'class-variance-authority'
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from 'cn'
|
|
7
7
|
import { joinIds } from '../../internal/ids.js'
|
|
8
8
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
9
9
|
import type { PartStyle } from '../../presentation.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react'
|
|
2
2
|
import { Field, type FieldProps } from '../Field/Field.js'
|
|
3
|
-
import { cn } from '
|
|
3
|
+
import { cn } from 'cn'
|
|
4
4
|
import { joinIds } from '../../internal/ids.js'
|
|
5
5
|
import type { PartStyle } from '../../presentation.js'
|
|
6
6
|
export type FieldsetProps = Omit<
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { ComponentProps } from 'react'
|
|
4
4
|
import { useEffect, useRef, useState } from 'react'
|
|
5
5
|
import { Button } from '../Button/Button.js'
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from 'cn'
|
|
7
7
|
import { joinIds } from '../../internal/ids.js'
|
|
8
8
|
import { controlMetrics } from '../shared/controlStyles.js'
|
|
9
9
|
import { useFieldControl } from '../Field/Field.js'
|
|
@@ -4,7 +4,7 @@ import { createContext, useContext, useCallback, useEffect, useRef, useState } f
|
|
|
4
4
|
import type { ComponentProps, ReactNode } from 'react'
|
|
5
5
|
import { Field, type FieldProps } from '../Field/Field.js'
|
|
6
6
|
import { Alert, type AlertProps } from '../Alert/Alert.js'
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from 'cn'
|
|
8
8
|
import { joinIds } from '../../internal/ids.js'
|
|
9
9
|
import { useControllableState } from '../../react/useControllableState.js'
|
|
10
10
|
import type { StateOwner } from '../../react/useNativeOwner.js'
|
|
@@ -44,7 +44,7 @@ const FormContext = createContext<FormState | null>(null)
|
|
|
44
44
|
export function useForm(): FormState | null {
|
|
45
45
|
return useContext(FormContext)
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function useRequiredForm() {
|
|
48
48
|
const state = useForm()
|
|
49
49
|
if (!state) throw new Error('Form parts must be inside Form.')
|
|
50
50
|
return state
|
|
@@ -238,7 +238,7 @@ export function Form({
|
|
|
238
238
|
export type FormFieldProps = DistributiveOmit<FieldProps, 'name'> & { name: string }
|
|
239
239
|
/** Name matches the real input's name; Field retains label and error relationships. */
|
|
240
240
|
export function FormField({ name, error, ...props }: FormFieldProps) {
|
|
241
|
-
const { errors } =
|
|
241
|
+
const { errors } = useRequiredForm()
|
|
242
242
|
return (
|
|
243
243
|
<Field
|
|
244
244
|
{...props}
|
|
@@ -249,7 +249,7 @@ export function FormField({ name, error, ...props }: FormFieldProps) {
|
|
|
249
249
|
}
|
|
250
250
|
export type FormErrorProps = Omit<AlertProps, 'children' | 'tabIndex'>
|
|
251
251
|
export function FormError(props: FormErrorProps) {
|
|
252
|
-
const { errors } =
|
|
252
|
+
const { errors } = useRequiredForm()
|
|
253
253
|
return errors.form ? (
|
|
254
254
|
<Alert
|
|
255
255
|
{...props}
|
|
@@ -15,7 +15,7 @@ import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
|
15
15
|
import { useHoverSurface } from '../../react/useHoverSurface.js'
|
|
16
16
|
import { composeAction } from '../../internal/events.js'
|
|
17
17
|
import { joinIds } from '../../internal/ids.js'
|
|
18
|
-
import { cn } from '
|
|
18
|
+
import { cn } from 'cn'
|
|
19
19
|
|
|
20
20
|
export type HoverCardProps = PopoverProps & { openDelay?: number; closeDelay?: number }
|
|
21
21
|
export type HoverCardState = PopoverState
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ComponentProps } from 'react'
|
|
4
4
|
import { cva } from 'class-variance-authority'
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'cn'
|
|
6
6
|
import { joinIds } from '../../internal/ids.js'
|
|
7
7
|
import { controlBorderClass, controlMetrics } from '../shared/controlStyles.js'
|
|
8
8
|
import { useNativeOwner, type ValueOwner } from '../../react/useNativeOwner.js'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { createContext, useContext, type ComponentProps } from 'react'
|
|
4
4
|
import { InputRoot, type InputProps } from '../Input/Input.js'
|
|
5
5
|
import { TextareaRoot, type TextareaProps } from '../Textarea/Textarea.js'
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from 'cn'
|
|
7
7
|
import { controlBorderClass, controlMetrics } from '../shared/controlStyles.js'
|
|
8
8
|
import { joinIds } from '../../internal/ids.js'
|
|
9
9
|
import type { ControlSize } from '../../presentation.js'
|
|
@@ -2,7 +2,7 @@ import { Fragment, isValidElement, type ComponentProps, type ReactElement } from
|
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
3
|
import type { ButtonVariant, ControlSize, Tone } from '../../presentation.js'
|
|
4
4
|
import { actionTone, actionVariants } from '../shared/actionStyles.js'
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'cn'
|
|
6
6
|
import { joinIds } from '../../internal/ids.js'
|
|
7
7
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
8
8
|
import { focusRingClass } from '../shared/focusStyles.js'
|
|
@@ -34,7 +34,7 @@ import { useControllableState } from '../../react/useControllableState.js'
|
|
|
34
34
|
import type { CheckedOwner, ValueOwner } from '../../react/useNativeOwner.js'
|
|
35
35
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
36
36
|
import type { PartStyle } from '../../presentation.js'
|
|
37
|
-
import { cn } from '
|
|
37
|
+
import { cn } from 'cn'
|
|
38
38
|
import { itemGroupLabelClass } from '../shared/controlStyles.js'
|
|
39
39
|
import { composeAction } from '../../internal/events.js'
|
|
40
40
|
import { joinIds } from '../../internal/ids.js'
|
|
@@ -49,7 +49,7 @@ import { requireAccessibleName, type AccessibleName } from '../../internal/acces
|
|
|
49
49
|
import type { ValueOwner } from '../../react/useNativeOwner.js'
|
|
50
50
|
import type { DistributiveOmit } from '../../internal/types.js'
|
|
51
51
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
52
|
-
import { cn } from '
|
|
52
|
+
import { cn } from 'cn'
|
|
53
53
|
import { joinIds } from '../../internal/ids.js'
|
|
54
54
|
import { composeAction } from '../../internal/events.js'
|
|
55
55
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import type { ComponentProps } from 'react'
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from 'cn'
|
|
5
5
|
import { controlBorderClass, controlMetrics } from '../shared/controlStyles.js'
|
|
6
6
|
import { useFieldControl } from '../Field/Field.js'
|
|
7
7
|
import { joinIds } from '../../internal/ids.js'
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type CollapsibleTriggerProps,
|
|
15
15
|
type CollapsibleContentProps
|
|
16
16
|
} from '../Collapsible/Collapsible.js'
|
|
17
|
-
import { cn } from '
|
|
17
|
+
import { cn } from 'cn'
|
|
18
18
|
import { controlMetrics } from '../shared/controlStyles.js'
|
|
19
19
|
import { joinIds } from '../../internal/ids.js'
|
|
20
20
|
import type { ControlSize, PartStyle } from '../../presentation.js'
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type ComposedLinkProps,
|
|
20
20
|
type ComposedLinkRenderProps
|
|
21
21
|
} from '../shared/composedLink.js'
|
|
22
|
-
import { cn } from '
|
|
22
|
+
import { cn } from 'cn'
|
|
23
23
|
import { ScrollArea } from '../ScrollArea/ScrollArea.js'
|
|
24
24
|
import { composeAction } from '../../internal/events.js'
|
|
25
25
|
import { joinIds } from '../../internal/ids.js'
|
|
@@ -8,7 +8,7 @@ import type { InputProps } from '../Input/Input.js'
|
|
|
8
8
|
import { InputGroup, InputGroupAddon, InputGroupInputRoot } from '../InputGroup/InputGroup.js'
|
|
9
9
|
import { Button } from '../Button/Button.js'
|
|
10
10
|
import { useFieldControl } from '../Field/Field.js'
|
|
11
|
-
import { cn } from '
|
|
11
|
+
import { cn } from 'cn'
|
|
12
12
|
import type { PartStyle } from '../../presentation.js'
|
|
13
13
|
import type { DistributiveOmit } from '../../internal/types.js'
|
|
14
14
|
import { requireAccessibleName } from '../../internal/accessibleName.js'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useEffect, useRef, useState } from 'react'
|
|
4
4
|
import { InputRoot, inputVariants, type InputProps } from '../Input/Input.js'
|
|
5
5
|
import { useFieldControl } from '../Field/Field.js'
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from 'cn'
|
|
7
7
|
import { controlMetrics } from '../shared/controlStyles.js'
|
|
8
8
|
import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
9
9
|
import { useNativeOwner, type ValueOwner } from '../../react/useNativeOwner.js'
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type ComposedLinkRenderProps
|
|
7
7
|
} from '../shared/composedLink.js'
|
|
8
8
|
import type { DistributiveOmit } from '../../internal/types.js'
|
|
9
|
-
import { cn } from '
|
|
9
|
+
import { cn } from 'cn'
|
|
10
10
|
import { joinIds } from '../../internal/ids.js'
|
|
11
11
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
12
12
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
@@ -6,7 +6,7 @@ import type { InputProps } from '../Input/Input.js'
|
|
|
6
6
|
import { InputGroup, InputGroupAddon, InputGroupInputRoot } from '../InputGroup/InputGroup.js'
|
|
7
7
|
import { Button } from '../Button/Button.js'
|
|
8
8
|
import { useFieldControl } from '../Field/Field.js'
|
|
9
|
-
import { cn } from '
|
|
9
|
+
import { cn } from 'cn'
|
|
10
10
|
import { requireAccessibleName } from '../../internal/accessibleName.js'
|
|
11
11
|
import type { DistributiveOmit } from '../../internal/types.js'
|
|
12
12
|
import { useNativeOwner, type ValueOwner } from '../../react/useNativeOwner.js'
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from 'react'
|
|
13
13
|
import { createPortal } from 'react-dom'
|
|
14
14
|
import { Button, type ButtonProps, type ButtonRenderProps } from '../Button/Button.js'
|
|
15
|
-
import { cn } from '
|
|
15
|
+
import { cn } from 'cn'
|
|
16
16
|
import { composeAction } from '../../internal/events.js'
|
|
17
17
|
import { joinIds } from '../../internal/ids.js'
|
|
18
18
|
import type { PopoverSide, PopoverAlign } from '../../internal/popover.js'
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from 'react'
|
|
12
12
|
import type { ChangeEvent, ComponentProps, ReactNode } from 'react'
|
|
13
13
|
import { cva } from 'class-variance-authority'
|
|
14
|
-
import { cn } from '
|
|
14
|
+
import { cn } from 'cn'
|
|
15
15
|
import { joinIds } from '../../internal/ids.js'
|
|
16
16
|
import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
17
17
|
import { useNativeOwner, type ValueOwner, type CheckedOwner } from '../../react/useNativeOwner.js'
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type ComponentProps
|
|
13
13
|
} from 'react'
|
|
14
14
|
import { SeparatorRoot, type SeparatorProps } from '../Separator/Separator.js'
|
|
15
|
-
import { cn } from '
|
|
15
|
+
import { cn } from 'cn'
|
|
16
16
|
import { joinIds } from '../../internal/ids.js'
|
|
17
17
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
18
18
|
import {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type PointerEvent
|
|
14
14
|
} from 'react'
|
|
15
15
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
16
|
-
import { cn } from '
|
|
16
|
+
import { cn } from 'cn'
|
|
17
17
|
import { joinIds } from '../../internal/ids.js'
|
|
18
18
|
import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
19
19
|
import type { Orientation, PartStyle } from '../../presentation.js'
|
|
@@ -16,7 +16,7 @@ import { createPortal } from 'react-dom'
|
|
|
16
16
|
import { Button, type ButtonProps, type ButtonRenderProps } from '../Button/Button.js'
|
|
17
17
|
import { useField, useFieldControl } from '../Field/Field.js'
|
|
18
18
|
import type { DistributiveOmit } from '../../internal/types.js'
|
|
19
|
-
import { cn } from '
|
|
19
|
+
import { cn } from 'cn'
|
|
20
20
|
import { joinIds } from '../../internal/ids.js'
|
|
21
21
|
import { controlMetrics, itemGroupLabelClass } from '../shared/controlStyles.js'
|
|
22
22
|
import { matchSelectText, moveSelectFocus, positionSelect } from '../../internal/select.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react'
|
|
2
|
-
import { cn } from '
|
|
2
|
+
import { cn } from 'cn'
|
|
3
3
|
import { joinIds } from '../../internal/ids.js'
|
|
4
4
|
import type { Orientation } from '../../presentation.js'
|
|
5
5
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { useContext, type ComponentProps } from 'react'
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from 'cn'
|
|
5
5
|
import { joinIds } from '../../internal/ids.js'
|
|
6
6
|
import { MotionProfileContext } from '../../motion/context.js'
|
|
7
7
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import type { ComponentProps } from 'react'
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from 'cn'
|
|
5
5
|
import { joinIds } from '../../internal/ids.js'
|
|
6
6
|
import { useFieldControl } from '../Field/Field.js'
|
|
7
7
|
import { controlBorderClass, controlMetrics } from '../shared/controlStyles.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { useContext, type ComponentProps } from 'react'
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from 'cn'
|
|
5
5
|
import { joinIds } from '../../internal/ids.js'
|
|
6
6
|
import { MotionProfileContext } from '../../motion/context.js'
|
|
7
7
|
import type { ControlSize, PartStyle } from '../../presentation.js'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCallback, useLayoutEffect, useRef, type ComponentProps, type ReactNode } from 'react'
|
|
4
4
|
import { cva } from 'class-variance-authority'
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'cn'
|
|
6
6
|
import { joinIds } from '../../internal/ids.js'
|
|
7
7
|
import { useSwitchDrag } from '../../react/useSwitchDrag.js'
|
|
8
8
|
import { useComposedRefs } from '../../react/useComposedRefs.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react'
|
|
2
|
-
import { cn } from '
|
|
2
|
+
import { cn } from 'cn'
|
|
3
3
|
import { requireAccessibleName, type AccessibleName } from '../../internal/accessibleName.js'
|
|
4
4
|
import { joinIds } from '../../internal/ids.js'
|
|
5
5
|
import type { ThemeStyle } from '../../themes/defineTheme.js'
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type ComponentProps
|
|
10
10
|
} from 'react'
|
|
11
11
|
import { Button, type ButtonProps, type ButtonRenderProps } from '../Button/Button.js'
|
|
12
|
-
import { cn } from '
|
|
12
|
+
import { cn } from 'cn'
|
|
13
13
|
import { controlMetrics } from '../shared/controlStyles.js'
|
|
14
14
|
import { scrollbarClass } from '../shared/scrollbarStyles.js'
|
|
15
15
|
import { composeAction } from '../../internal/events.js'
|
|
@@ -4,7 +4,7 @@ import { inlineActionClass } from '../shared/actionStyles.js'
|
|
|
4
4
|
import type { MouseEvent, ReactNode } from 'react'
|
|
5
5
|
import { Badge, type BadgeProps } from '../Badge/Badge.js'
|
|
6
6
|
import { Button } from '../Button/Button.js'
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from 'cn'
|
|
8
8
|
import { joinIds } from '../../internal/ids.js'
|
|
9
9
|
import { requireAccessibleName } from '../../internal/accessibleName.js'
|
|
10
10
|
import type { PartStyle } from '../../presentation.js'
|
|
@@ -4,7 +4,7 @@ import { useId, useLayoutEffect, useRef, useState } from 'react'
|
|
|
4
4
|
import { InputRoot, type InputProps } from '../Input/Input.js'
|
|
5
5
|
import { Tag } from '../Tag/Tag.js'
|
|
6
6
|
import { useFieldControl } from '../Field/Field.js'
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from 'cn'
|
|
8
8
|
import { controlBorderClass, controlMetrics } from '../shared/controlStyles.js'
|
|
9
9
|
import { joinIds } from '../../internal/ids.js'
|
|
10
10
|
import { sameSelection } from '../../internal/selection.js'
|