@cognitap/radiant 0.0.62 → 0.0.64
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 +13 -0
- package/dist/library/Autocomplete.d.ts +3 -2
- package/dist/library/Autocomplete.d.ts.map +1 -1
- package/dist/library/Autocomplete.js +1 -1
- package/dist/library/Autocomplete.js.map +1 -1
- package/dist/library/CodeBlock.d.ts +2 -7
- package/dist/library/CodeBlock.d.ts.map +1 -1
- package/dist/library/CodeBlock.js.map +1 -1
- package/dist/library/Combobox.d.ts +14 -24
- package/dist/library/Combobox.d.ts.map +1 -1
- package/dist/library/Combobox.js +15 -14
- package/dist/library/Combobox.js.map +1 -1
- package/dist/library/Command.d.ts.map +1 -1
- package/dist/library/Command.js +2 -2
- package/dist/library/Command.js.map +1 -1
- package/dist/library/Dialog.d.ts +2 -9
- package/dist/library/Dialog.d.ts.map +1 -1
- package/dist/library/Dialog.js.map +1 -1
- package/dist/library/Menu.d.ts +2 -2
- package/dist/library/Menu.d.ts.map +1 -1
- package/dist/library/Menu.js.map +1 -1
- package/dist/library/MultiSelect.d.ts +4 -5
- package/dist/library/MultiSelect.d.ts.map +1 -1
- package/dist/library/MultiSelect.js +2 -2
- package/dist/library/MultiSelect.js.map +1 -1
- package/dist/library/NavigationMenu.d.ts +64 -0
- package/dist/library/NavigationMenu.d.ts.map +1 -0
- package/dist/library/NavigationMenu.js +346 -0
- package/dist/library/NavigationMenu.js.map +1 -0
- package/dist/library/Popover.d.ts +2 -2
- package/dist/library/Popover.d.ts.map +1 -1
- package/dist/library/Popover.js.map +1 -1
- package/dist/library/TagsInput.d.ts +2 -2
- package/dist/library/TagsInput.d.ts.map +1 -1
- package/dist/library/TagsInput.js +1 -1
- package/dist/library/TagsInput.js.map +1 -1
- package/dist/library/Toast.d.ts +2 -2
- package/dist/library/Toast.d.ts.map +1 -1
- package/dist/library/Toast.js.map +1 -1
- package/dist/library/cn.d.ts.map +1 -1
- package/dist/library/cn.js +5 -0
- package/dist/library/cn.js.map +1 -1
- package/dist/library/index.d.ts +4 -2
- package/dist/library/index.d.ts.map +1 -1
- package/dist/library/index.js +1 -0
- package/dist/library/index.js.map +1 -1
- package/dist/library/internal/types.d.ts +9 -0
- package/dist/library/internal/types.d.ts.map +1 -1
- package/dist/library/react/useHoverSurface.d.ts +1 -0
- package/dist/library/react/useHoverSurface.d.ts.map +1 -1
- package/dist/library/react/useHoverSurface.js +5 -0
- package/dist/library/react/useHoverSurface.js.map +1 -1
- package/dist/library/styles.css +1 -1
- package/dist/library/themes/components.d.ts +10 -0
- package/dist/library/themes/components.d.ts.map +1 -1
- package/dist/library/themes/components.js +10 -0
- package/dist/library/themes/components.js.map +1 -1
- package/docs/architecture.md +4 -3
- package/package.json +1 -1
- package/src/Autocomplete.tsx +4 -2
- package/src/CodeBlock.tsx +2 -7
- package/src/Combobox.tsx +55 -41
- package/src/Command.tsx +0 -2
- package/src/Dialog.tsx +2 -10
- package/src/Menu.tsx +2 -5
- package/src/MultiSelect.tsx +7 -7
- package/src/NavigationMenu.tsx +650 -0
- package/src/Popover.tsx +2 -5
- package/src/TagsInput.tsx +5 -5
- package/src/Toast.tsx +2 -5
- package/src/cn.ts +5 -0
- package/src/index.ts +28 -2
- package/src/internal/types.ts +10 -0
- package/src/react/useHoverSurface.ts +5 -0
- package/src/themes/components.ts +10 -0
package/src/Toast.tsx
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import { Button, type ButtonProps, type ButtonRenderProps } from './Button.js'
|
|
24
24
|
import { cn } from './cn.js'
|
|
25
25
|
import { joinIds } from './internal/ids.js'
|
|
26
|
-
import type {
|
|
26
|
+
import type { WithoutToggle } from './internal/types.js'
|
|
27
27
|
import { composeAction } from './internal/events.js'
|
|
28
28
|
import { validateToastDuration } from './internal/toast.js'
|
|
29
29
|
import { useControllableState } from './react/useControllableState.js'
|
|
@@ -49,10 +49,7 @@ export type ToastProps = Omit<
|
|
|
49
49
|
export type ToastState = { open: boolean; visible: boolean; setOpen: (open: boolean) => void }
|
|
50
50
|
export type ToastTitleProps = AlertTitleProps
|
|
51
51
|
export type ToastDescriptionProps = AlertDescriptionProps
|
|
52
|
-
type ToastButtonProps =
|
|
53
|
-
ButtonProps,
|
|
54
|
-
'pressed' | 'defaultPressed' | 'onPressedChange' | 'aria-pressed'
|
|
55
|
-
>
|
|
52
|
+
type ToastButtonProps = WithoutToggle<ButtonProps>
|
|
56
53
|
export type ToastActionProps = ToastButtonProps & { altText: string }
|
|
57
54
|
export type ToastCloseProps = ToastButtonProps
|
|
58
55
|
const notToggle = {
|
package/src/cn.ts
CHANGED
|
@@ -113,6 +113,7 @@ export const cn: CnFunction = createCn({
|
|
|
113
113
|
],
|
|
114
114
|
mb: ['mb-(--rad-multi-select-gap)', 'mb-(--rad-fieldset-gap)'],
|
|
115
115
|
gap: [
|
|
116
|
+
'gap-(--rad-navigation-menu-gap)',
|
|
116
117
|
'gap-(--rad-code-block-header-gap)',
|
|
117
118
|
'gap-(--rad-empty-state-gap)',
|
|
118
119
|
'gap-(--rad-empty-state-actions-gap)',
|
|
@@ -168,6 +169,7 @@ export const cn: CnFunction = createCn({
|
|
|
168
169
|
'px-(--rad-tabs-trigger-padding)'
|
|
169
170
|
],
|
|
170
171
|
p: [
|
|
172
|
+
'p-(--rad-navigation-menu-padding)',
|
|
171
173
|
'p-(--rad-code-block-padding)',
|
|
172
174
|
'p-(--rad-code-block-header-padding)',
|
|
173
175
|
'p-(--rad-empty-state-padding)',
|
|
@@ -186,6 +188,7 @@ export const cn: CnFunction = createCn({
|
|
|
186
188
|
'p-(--rad-tabs-content-padding)'
|
|
187
189
|
],
|
|
188
190
|
rounded: [
|
|
191
|
+
'rounded-(--rad-navigation-menu-radius)',
|
|
189
192
|
'rounded-(--rad-code-block-radius)',
|
|
190
193
|
'rounded-(--rad-inline-code-radius)',
|
|
191
194
|
'rounded-(--rad-empty-state-radius)',
|
|
@@ -228,6 +231,7 @@ export const cn: CnFunction = createCn({
|
|
|
228
231
|
'rounded-(--rad-tabs-content-radius)'
|
|
229
232
|
],
|
|
230
233
|
'border-w': [
|
|
234
|
+
'border-(--rad-navigation-menu-border-width)',
|
|
231
235
|
'border-(--rad-code-block-border-width)',
|
|
232
236
|
'border-(--rad-empty-state-border-width)',
|
|
233
237
|
'border-(--rad-meter-border-width)',
|
|
@@ -266,6 +270,7 @@ export const cn: CnFunction = createCn({
|
|
|
266
270
|
'border-(--rad-switch-border-style)'
|
|
267
271
|
],
|
|
268
272
|
shadow: [
|
|
273
|
+
'shadow-(--rad-navigation-menu-shadow)',
|
|
269
274
|
'shadow-(--_rad-native-select-shadow)',
|
|
270
275
|
'shadow-(--rad-native-select-shadow)',
|
|
271
276
|
'shadow-(--_rad-kbd-shadow)',
|
package/src/index.ts
CHANGED
|
@@ -55,7 +55,8 @@ export type {
|
|
|
55
55
|
ComboboxClearProps,
|
|
56
56
|
ComboboxContentProps,
|
|
57
57
|
ComboboxItemProps,
|
|
58
|
-
ComboboxStatusProps
|
|
58
|
+
ComboboxStatusProps,
|
|
59
|
+
ComboboxRenderProps
|
|
59
60
|
} from './Combobox.js'
|
|
60
61
|
export { Button } from './Button.js'
|
|
61
62
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipPortal, useTooltip } from './Tooltip.js'
|
|
@@ -613,7 +614,8 @@ export {
|
|
|
613
614
|
type AutocompletePortalProps,
|
|
614
615
|
type AutocompleteContentProps,
|
|
615
616
|
type AutocompleteItemProps,
|
|
616
|
-
type AutocompleteStatusProps
|
|
617
|
+
type AutocompleteStatusProps,
|
|
618
|
+
type AutocompleteRenderProps
|
|
617
619
|
} from './Autocomplete.js'
|
|
618
620
|
|
|
619
621
|
export {
|
|
@@ -685,3 +687,27 @@ export {
|
|
|
685
687
|
type ResizablePanelState,
|
|
686
688
|
type ResizableItem
|
|
687
689
|
} from './Resizable.js'
|
|
690
|
+
|
|
691
|
+
export {
|
|
692
|
+
NavigationMenu,
|
|
693
|
+
NavigationMenuList,
|
|
694
|
+
NavigationMenuItem,
|
|
695
|
+
NavigationMenuTrigger,
|
|
696
|
+
NavigationMenuLink,
|
|
697
|
+
NavigationMenuContent,
|
|
698
|
+
NavigationMenuViewport,
|
|
699
|
+
useNavigationMenu
|
|
700
|
+
} from './NavigationMenu.js'
|
|
701
|
+
export type {
|
|
702
|
+
NavigationMenuProps,
|
|
703
|
+
NavigationMenuState,
|
|
704
|
+
NavigationMenuItemConfig,
|
|
705
|
+
NavigationMenuListProps,
|
|
706
|
+
NavigationMenuItemProps,
|
|
707
|
+
NavigationMenuTriggerProps,
|
|
708
|
+
NavigationMenuLinkProps,
|
|
709
|
+
NavigationMenuContentProps,
|
|
710
|
+
NavigationMenuViewportProps,
|
|
711
|
+
NavigationMenuRenderProps,
|
|
712
|
+
NavigationMenuLinkRenderProps
|
|
713
|
+
} from './NavigationMenu.js'
|
package/src/internal/types.ts
CHANGED
|
@@ -2,3 +2,13 @@
|
|
|
2
2
|
export type DistributiveOmit<Value, Keys extends PropertyKey> = Value extends unknown
|
|
3
3
|
? Omit<Value, Keys>
|
|
4
4
|
: never
|
|
5
|
+
|
|
6
|
+
type NoToggle = {
|
|
7
|
+
pressed?: never
|
|
8
|
+
defaultPressed?: never
|
|
9
|
+
onPressedChange?: never
|
|
10
|
+
'aria-pressed'?: never
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Openers and actions are not toggles; `?: never` still lets callers pass `undefined`. */
|
|
14
|
+
export type WithoutToggle<Props> = DistributiveOmit<Props, keyof NoToggle> & NoToggle
|
|
@@ -107,6 +107,11 @@ export function useHoverSurface({
|
|
|
107
107
|
return () => trigger.ownerDocument.removeEventListener('pointermove', move)
|
|
108
108
|
}, [trigger, content, open, closeDelay, schedule])
|
|
109
109
|
return {
|
|
110
|
+
cancel: (reset = false) => {
|
|
111
|
+
clear()
|
|
112
|
+
if (reset)
|
|
113
|
+
activity.current = { focused: false, hovered: false, suppressed: false, touch: false }
|
|
114
|
+
},
|
|
110
115
|
setOpen,
|
|
111
116
|
enter,
|
|
112
117
|
leave,
|
package/src/themes/components.ts
CHANGED
|
@@ -63,6 +63,16 @@ export const componentRegistry = {
|
|
|
63
63
|
focusWidth: 'css',
|
|
64
64
|
focusOffset: 'css'
|
|
65
65
|
},
|
|
66
|
+
navigationMenu: {
|
|
67
|
+
gap: 'css',
|
|
68
|
+
padding: 'css',
|
|
69
|
+
radius: 'css',
|
|
70
|
+
borderWidth: 'css',
|
|
71
|
+
borderColor: 'css',
|
|
72
|
+
background: 'css',
|
|
73
|
+
color: 'css',
|
|
74
|
+
shadow: 'css'
|
|
75
|
+
},
|
|
66
76
|
resizable: {
|
|
67
77
|
handleSize: 'css',
|
|
68
78
|
handleColor: 'css',
|