@carbonid1/design-system 7.4.0 → 7.6.0
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/dist/Autocomplete/Autocomplete.d.ts +12 -12
- package/dist/Autocomplete/Autocomplete.js +9 -7
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +1 -1
- package/dist/Badge/Badge.variants.js +1 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.variants.js +4 -4
- package/dist/Card/Card.d.ts +7 -7
- package/dist/ContextMenu/ContextMenu.d.ts +10 -10
- package/dist/Dialog/Dialog.d.ts +3 -3
- package/dist/Dialog/Dialog.js +1 -1
- package/dist/Field/Field.d.ts +6 -6
- package/dist/Field/Field.js +2 -2
- package/dist/Input/Input.d.ts +1 -1
- package/dist/Input/Input.js +1 -1
- package/dist/InputGroup/InputGroup.d.ts +4 -3
- package/dist/InputGroup/InputGroup.js +4 -2
- package/dist/Item/Item.d.ts +6 -6
- package/dist/Item/Item.js +1 -1
- package/dist/Kbd/Kbd.d.ts +1 -1
- package/dist/Kbd/Kbd.js +42 -13
- package/dist/Kbd/Kbd.types.d.ts +3 -1
- package/dist/Menu/Menu.d.ts +10 -10
- package/dist/Menu/Menu.js +4 -4
- package/dist/MessageScroller/MessageScroller.d.ts +5 -5
- package/dist/MeterRing/MeterRing.d.ts +1 -1
- package/dist/Popover/Popover.d.ts +2 -2
- package/dist/Popover/Popover.js +2 -2
- package/dist/ProgressRing/ProgressRing.d.ts +1 -1
- package/dist/RingVisual/RingVisual.d.ts +1 -1
- package/dist/ScrollArea/ScrollArea.d.ts +6 -6
- package/dist/ScrollArea/ScrollArea.js +4 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts +2 -2
- package/dist/Select/Select.d.ts +10 -10
- package/dist/Select/Select.js +48 -11
- package/dist/Select/Select.types.d.ts +1 -0
- package/dist/Slider/Slider.d.ts +8 -8
- package/dist/Slider/Slider.js +2 -2
- package/dist/Switch/Switch.d.ts +2 -2
- package/dist/Switch/Switch.js +2 -2
- package/dist/Table/Table.d.ts +1 -1
- package/dist/TableScrollRegion/TableScrollRegion.d.ts +1 -1
- package/dist/TableScrollRegion/TableScrollRegion.js +1 -1
- package/dist/Text/Text.d.ts +1 -1
- package/dist/Text/Text.js +2 -2
- package/dist/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/Toaster/Toaster.d.ts +1 -1
- package/dist/Toaster/Toaster.js +2 -2
- package/dist/Tooltip/Tooltip.d.ts +4 -4
- package/dist/Tooltip/Tooltip.js +2 -2
- package/dist/helpers/cn/cn.tables.js +12 -12
- package/dist/helpers/contrast/contrast.d.ts +6 -0
- package/dist/helpers/contrast/contrast.js +26 -0
- package/package.json +31 -30
- package/skills/design-system/references/theming.md +23 -20
- package/skills/design-system-package/SKILL.md +10 -2
- package/skills/design-system-package/references/stories.md +44 -0
- package/skills/design-system-package/references/tokens.md +4 -0
- package/skills/design-system-package/references/verification.md +16 -3
- package/themes/dashboard.css +17 -3
- package/themes/reader.css +19 -4
|
@@ -2,21 +2,21 @@ import { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
|
2
2
|
import type { AutocompleteClearProps, AutocompleteEmptyProps, AutocompleteGroupLabelProps, AutocompleteInputGroupProps, AutocompleteInputProps, AutocompleteItemProps, AutocompleteListProps, AutocompletePopupProps, AutocompletePositionerProps, AutocompleteRootProps, AutocompleteStatusProps, AutocompleteTriggerProps } from './Autocomplete.types';
|
|
3
3
|
/** Searchable single selection, built on Base UI Combobox. Input text filters; only items are selected. */
|
|
4
4
|
export declare const Autocomplete: {
|
|
5
|
-
Root: <Value>({ autoHighlight, modal, ...props }: AutocompleteRootProps<Value>) => import("react
|
|
6
|
-
InputGroup: ({ className, ...props }: AutocompleteInputGroupProps) => import("react
|
|
7
|
-
Input: (props: AutocompleteInputProps) => import("react
|
|
8
|
-
Trigger: ({ children, className, "aria-label": ariaLabel, ...props }: AutocompleteTriggerProps) => import("react
|
|
9
|
-
Clear: ({ children, className, "aria-label": ariaLabel, keepMounted, ...props }: AutocompleteClearProps) => import("react
|
|
5
|
+
Root: <Value>({ autoHighlight, modal, ...props }: AutocompleteRootProps<Value>) => import("react").JSX.Element;
|
|
6
|
+
InputGroup: ({ className, ...props }: AutocompleteInputGroupProps) => import("react").JSX.Element;
|
|
7
|
+
Input: ({ className, ...props }: AutocompleteInputProps) => import("react").JSX.Element;
|
|
8
|
+
Trigger: ({ children, className, "aria-label": ariaLabel, ...props }: AutocompleteTriggerProps) => import("react").JSX.Element;
|
|
9
|
+
Clear: ({ children, className, "aria-label": ariaLabel, keepMounted, ...props }: AutocompleteClearProps) => import("react").JSX.Element;
|
|
10
10
|
Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
-
Positioner: ({ className, sideOffset, collisionPadding, positionMethod, ...props }: AutocompletePositionerProps) => import("react
|
|
12
|
-
Popup: ({ className, ...props }: AutocompletePopupProps) => import("react
|
|
13
|
-
List: ({ className, ...props }: AutocompleteListProps) => import("react
|
|
14
|
-
Item: ({ children, className, ...props }: AutocompleteItemProps) => import("react
|
|
15
|
-
Empty: ({ className, ...props }: AutocompleteEmptyProps) => import("react
|
|
11
|
+
Positioner: ({ className, sideOffset, collisionPadding, positionMethod, ...props }: AutocompletePositionerProps) => import("react").JSX.Element;
|
|
12
|
+
Popup: ({ className, ...props }: AutocompletePopupProps) => import("react").JSX.Element;
|
|
13
|
+
List: ({ className, ...props }: AutocompleteListProps) => import("react").JSX.Element;
|
|
14
|
+
Item: ({ children, className, ...props }: AutocompleteItemProps) => import("react").JSX.Element;
|
|
15
|
+
Empty: ({ className, ...props }: AutocompleteEmptyProps) => import("react").JSX.Element;
|
|
16
16
|
Group: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
-
GroupLabel: ({ className, ...props }: AutocompleteGroupLabelProps) => import("react
|
|
17
|
+
GroupLabel: ({ className, ...props }: AutocompleteGroupLabelProps) => import("react").JSX.Element;
|
|
18
18
|
Collection: typeof BaseCombobox.Collection;
|
|
19
|
-
Status: ({ className, ...props }: AutocompleteStatusProps) => import("react
|
|
19
|
+
Status: ({ className, ...props }: AutocompleteStatusProps) => import("react").JSX.Element;
|
|
20
20
|
useFilter: typeof BaseCombobox.useFilter;
|
|
21
21
|
useFilteredItems: typeof BaseCombobox.useFilteredItems;
|
|
22
22
|
};
|
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
4
4
|
import { Check, ChevronDown, X } from 'lucide-react';
|
|
5
|
-
import { InputGroup as StyledInputGroup } from '../InputGroup/InputGroup';
|
|
5
|
+
import { InputGroup as StyledInputGroup, inputGroupControlClassName, } from '../InputGroup/InputGroup';
|
|
6
6
|
import { mergeStatefulClassName } from '../helpers/mergeStatefulClassName/mergeStatefulClassName';
|
|
7
7
|
const Root = ({ autoHighlight = true, modal = false, ...props }) => (_jsx(BaseCombobox.Root, { autoHighlight: autoHighlight, modal: modal, ...props, multiple: false }));
|
|
8
8
|
const InputGroup = ({ className, ...props }) => (_jsx(BaseCombobox.InputGroup, { render: _jsx(StyledInputGroup.Root, {}), className: mergeStatefulClassName('min-h-9 gap-0 p-0.5', className), ...props }));
|
|
9
|
+
// Only the group's look, not InputGroup.Control: that is a Field control, and it would submit the
|
|
10
|
+
// typed text under the field's name next to the combobox's own hidden input.
|
|
9
11
|
/** Compose inside InputGroup so the input and its actions share one focus ring and surface. */
|
|
10
|
-
const Input = (props) => (_jsx(BaseCombobox.Input, {
|
|
11
|
-
const Trigger = ({ children, className, 'aria-label': ariaLabel = 'Show options', ...props }) => (_jsx(BaseCombobox.Trigger, { "aria-label": ariaLabel, "aria-labelledby": undefined, render: _jsx(StyledInputGroup.Action, { variant: "ghost" }), className: mergeStatefulClassName('group motion-reduce:transition-none
|
|
12
|
-
const Clear = ({ children, className, 'aria-label': ariaLabel = 'Clear selection', keepMounted = true, ...props }) => (_jsx(BaseCombobox.Clear, { "aria-label": ariaLabel, keepMounted: keepMounted, render: _jsx(StyledInputGroup.Action, { variant: "ghost" }), className: mergeStatefulClassName('not-data-[visible]:invisible motion-reduce:transition-none
|
|
13
|
-
const Positioner = ({ className, sideOffset = 4, collisionPadding = 8, positionMethod = 'fixed', ...props }) => (_jsx(BaseCombobox.Positioner, { sideOffset: sideOffset, collisionPadding: collisionPadding, positionMethod: positionMethod, className: mergeStatefulClassName('z-50
|
|
14
|
-
const Popup = ({ className, ...props }) => (_jsx(BaseCombobox.Popup, { className: mergeStatefulClassName('border-border bg-popover text-popover-foreground shadow-popover flex max-h-[var(--available-height)] w-[var(--anchor-width)] max-w-[var(--available-width)] flex-col overflow-hidden rounded-lg border outline-
|
|
12
|
+
const Input = ({ className, ...props }) => (_jsx(BaseCombobox.Input, { "data-slot": "input-group-control", className: mergeStatefulClassName(inputGroupControlClassName, className), ...props }));
|
|
13
|
+
const Trigger = ({ children, className, 'aria-label': ariaLabel = 'Show options', ...props }) => (_jsx(BaseCombobox.Trigger, { "aria-label": ariaLabel, "aria-labelledby": undefined, render: _jsx(StyledInputGroup.Action, { variant: "ghost" }), className: mergeStatefulClassName('group motion-reduce:transition-none', className), ...props, children: children ?? (_jsx(ChevronDown, { "aria-hidden": true, className: "size-4 transition-transform group-data-[popup-open]:rotate-180 motion-reduce:transition-none" })) }));
|
|
14
|
+
const Clear = ({ children, className, 'aria-label': ariaLabel = 'Clear selection', keepMounted = true, ...props }) => (_jsx(BaseCombobox.Clear, { "aria-label": ariaLabel, keepMounted: keepMounted, render: _jsx(StyledInputGroup.Action, { variant: "ghost" }), className: mergeStatefulClassName('not-data-[visible]:invisible motion-reduce:transition-none', className), ...props, children: children ?? _jsx(X, { "aria-hidden": true, className: "size-4" }) }));
|
|
15
|
+
const Positioner = ({ className, sideOffset = 4, collisionPadding = 8, positionMethod = 'fixed', ...props }) => (_jsx(BaseCombobox.Positioner, { sideOffset: sideOffset, collisionPadding: collisionPadding, positionMethod: positionMethod, className: mergeStatefulClassName('z-50', className), ...props }));
|
|
16
|
+
const Popup = ({ className, ...props }) => (_jsx(BaseCombobox.Popup, { className: mergeStatefulClassName('border-border bg-popover text-popover-foreground shadow-popover flex max-h-[var(--available-height)] w-[var(--anchor-width)] max-w-[var(--available-width)] flex-col overflow-hidden rounded-lg border outline-none', className), ...props }));
|
|
15
17
|
const List = ({ className, ...props }) => (_jsx(BaseCombobox.List, { className: mergeStatefulClassName('max-h-60 min-h-0 scroll-py-1 space-y-1 overflow-y-auto overscroll-contain p-1 empty:p-0', className), ...props }));
|
|
16
|
-
const Item = ({ children, className, ...props }) => (_jsxs(BaseCombobox.Item, { className: mergeStatefulClassName('data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[selected]:bg-primary/10 data-[selected]:ring-primary/20 relative flex min-h-9 cursor-default items-center gap-2 rounded-lg px-2.5 py-2 text-sm break-words outline-
|
|
18
|
+
const Item = ({ children, className, ...props }) => (_jsxs(BaseCombobox.Item, { className: mergeStatefulClassName('data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[selected]:bg-primary/10 data-[selected]:ring-primary/20 relative flex min-h-9 cursor-default items-center gap-2 rounded-lg px-2.5 py-2 text-sm break-words outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[selected]:font-medium data-[selected]:ring-1 data-[selected]:ring-inset forced-colors:data-[highlighted]:outline-2 forced-colors:data-[highlighted]:-outline-offset-2 forced-colors:data-[highlighted]:outline-[Highlight] forced-colors:data-[highlighted]:outline-solid', className), ...props, children: [_jsx("span", { className: "min-w-0 flex-1", children: children }), _jsx(BaseCombobox.ItemIndicator, { keepMounted: true, className: "invisible shrink-0 data-[selected]:visible", children: _jsx(Check, { "aria-hidden": true, className: "size-4" }) })] }));
|
|
17
19
|
const Empty = ({ className, ...props }) => (_jsx(BaseCombobox.Empty, { className: mergeStatefulClassName('text-muted-foreground overflow-y-auto px-3 text-sm not-empty:py-3', className), ...props }));
|
|
18
20
|
const GroupLabel = ({ className, ...props }) => (_jsx(BaseCombobox.GroupLabel, { className: mergeStatefulClassName('text-muted-foreground px-2.5 pt-2 pb-1 text-xs font-medium', className), ...props }));
|
|
19
21
|
const Status = ({ className, ...props }) => (_jsx(BaseCombobox.Status, { className: mergeStatefulClassName('text-muted-foreground px-3 text-sm not-empty:py-2', className), ...props }));
|
package/dist/Badge/Badge.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BadgeProps } from './Badge.types';
|
|
2
|
-
declare const Badge: ({ className, variant, onRemove, removeLabel, children, ...props }: BadgeProps) => import("react
|
|
2
|
+
declare const Badge: ({ className, variant, onRemove, removeLabel, children, ...props }: BadgeProps) => import("react").JSX.Element;
|
|
3
3
|
export { Badge };
|
package/dist/Badge/Badge.js
CHANGED
|
@@ -5,6 +5,6 @@ import { X } from 'lucide-react';
|
|
|
5
5
|
import { badgeVariants } from './Badge.variants';
|
|
6
6
|
const Badge = ({ className, variant, onRemove, removeLabel, children, ...props }) => {
|
|
7
7
|
const resolvedRemoveLabel = removeLabel ?? (typeof children === 'string' ? `Remove ${children}` : 'Remove');
|
|
8
|
-
return (_jsxs("span", { className: cn(badgeVariants({ variant }), className), ...props, children: [onRemove ? _jsx("span", { className: "truncate", children: children }) : children, onRemove && (_jsx("button", { type: "button", "aria-label": resolvedRemoveLabel, onClick: onRemove, className: "-me-0.5 inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full opacity-70 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-1 focus-visible:ring-offset-transparent focus-visible:outline-none", children: _jsx(X, { className: "size-3", "aria-hidden": "true" }) }))] }));
|
|
8
|
+
return (_jsxs("span", { className: cn(badgeVariants({ variant }), className), ...props, children: [onRemove ? _jsx("span", { className: "truncate", children: children }) : children, onRemove && (_jsx("button", { type: "button", "aria-label": resolvedRemoveLabel, onClick: onRemove, className: "-me-0.5 inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full opacity-70 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-1 focus-visible:ring-offset-transparent focus-visible:outline-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-[Highlight] forced-colors:focus-visible:outline-solid", children: _jsx(X, { className: "size-3", "aria-hidden": "true" }) }))] }));
|
|
9
9
|
};
|
|
10
10
|
export { Badge };
|
|
@@ -6,7 +6,7 @@ const badgeVariants = cva('inline-flex max-w-full min-w-0 items-center gap-1 rou
|
|
|
6
6
|
primary: 'bg-primary-border/30 text-primary',
|
|
7
7
|
success: 'bg-success/15 text-success-foreground',
|
|
8
8
|
attention: 'bg-attention-muted text-attention-foreground',
|
|
9
|
-
destructive: 'bg-destructive/15 text-destructive',
|
|
9
|
+
destructive: 'bg-destructive/15 text-destructive-foreground',
|
|
10
10
|
highlight: 'bg-highlight-muted text-highlight-foreground',
|
|
11
11
|
},
|
|
12
12
|
},
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ButtonProps } from './Button.types';
|
|
2
|
-
declare const Button: ({ className, variant, size, contentSpacing, selected, fullWidth, loading, disabled, children, ...props }: ButtonProps) => import("react
|
|
2
|
+
declare const Button: ({ className, variant, size, contentSpacing, selected, fullWidth, loading, disabled, children, ...props }: ButtonProps) => import("react").JSX.Element;
|
|
3
3
|
export { Button };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
|
-
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[color,background-color,opacity,translate]
|
|
2
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[color,background-color,opacity,translate] select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-hidden forced-colors:focus-visible:outline-[Highlight] active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
3
3
|
variants: {
|
|
4
4
|
variant: {
|
|
5
5
|
ghost: 'hover:bg-accent aria-expanded:bg-accent dark:hover:bg-accent/50',
|
|
6
|
-
primary: 'bg-primary text-primary-foreground font-medium hover:bg-primary
|
|
6
|
+
primary: 'bg-primary text-primary-foreground font-medium hover:bg-primary-hover',
|
|
7
7
|
outline: 'border-input-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30 dark:hover:bg-input/50',
|
|
8
|
-
destructive: 'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
8
|
+
destructive: 'bg-destructive/10 text-destructive-foreground hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
9
9
|
attention: 'text-attention-foreground hover:bg-attention-muted',
|
|
10
10
|
subtle: 'text-muted-foreground hover:text-primary',
|
|
11
11
|
danger: 'text-muted-foreground hover:text-destructive',
|
|
@@ -24,7 +24,7 @@ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justi
|
|
|
24
24
|
relaxed: 'gap-2',
|
|
25
25
|
},
|
|
26
26
|
selected: {
|
|
27
|
-
true: 'bg-primary/10 ring-1 ring-primary/20',
|
|
27
|
+
true: 'bg-primary/10 ring-1 ring-primary/20 forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none',
|
|
28
28
|
false: '',
|
|
29
29
|
},
|
|
30
30
|
},
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -16,12 +16,12 @@ declare const cardVariants: (props?: ({
|
|
|
16
16
|
* shadow renders outside the box and is unaffected).
|
|
17
17
|
*/
|
|
18
18
|
export declare const Card: {
|
|
19
|
-
Root: ({ className, elevation, ...props }: CardRootProps) => import("react
|
|
20
|
-
Content: ({ className, ...props }: CardContentProps) => import("react
|
|
21
|
-
Header: ({ className, ...props }: CardHeaderProps) => import("react
|
|
22
|
-
Title: ({ className, ...props }: CardTitleProps) => import("react
|
|
23
|
-
Description: ({ className, ...props }: CardDescriptionProps) => import("react
|
|
24
|
-
Action: ({ className, ...props }: CardActionProps) => import("react
|
|
25
|
-
Footer: ({ className, ...props }: CardFooterProps) => import("react
|
|
19
|
+
Root: ({ className, elevation, ...props }: CardRootProps) => import("react").JSX.Element;
|
|
20
|
+
Content: ({ className, ...props }: CardContentProps) => import("react").JSX.Element;
|
|
21
|
+
Header: ({ className, ...props }: CardHeaderProps) => import("react").JSX.Element;
|
|
22
|
+
Title: ({ className, ...props }: CardTitleProps) => import("react").JSX.Element;
|
|
23
|
+
Description: ({ className, ...props }: CardDescriptionProps) => import("react").JSX.Element;
|
|
24
|
+
Action: ({ className, ...props }: CardActionProps) => import("react").JSX.Element;
|
|
25
|
+
Footer: ({ className, ...props }: CardFooterProps) => import("react").JSX.Element;
|
|
26
26
|
};
|
|
27
27
|
export { cardVariants };
|
|
@@ -4,37 +4,37 @@ import { Menu } from '../Menu/Menu';
|
|
|
4
4
|
export declare const ContextMenu: {
|
|
5
5
|
Root: typeof BaseContextMenu.Root;
|
|
6
6
|
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuTriggerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
-
Popup: ({ className, ...props }: ComponentProps<typeof Menu.Popup>) => import("react
|
|
7
|
+
Popup: ({ className, ...props }: ComponentProps<typeof Menu.Popup>) => import("react").JSX.Element;
|
|
8
8
|
Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
9
|
Backdrop: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
-
Positioner: ({ className, sideOffset, ...props }: Omit<Omit<import("@base-ui/react").
|
|
10
|
+
Positioner: ({ className, sideOffset, ...props }: Omit<Omit<import("@base-ui/react").MenuPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
11
11
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
12
|
-
}) => import("react
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
13
13
|
Arrow: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuArrowProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
14
|
Group: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
15
|
GroupLabel: ({ className, ...props }: Omit<Omit<import("@base-ui/react").ContextMenuGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
16
16
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
17
|
-
}) => import("react
|
|
17
|
+
}) => import("react").JSX.Element;
|
|
18
18
|
Separator: ({ className, ...props }: Omit<Omit<import("@base-ui/react").SeparatorProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
19
19
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
20
|
-
}) => import("react
|
|
20
|
+
}) => import("react").JSX.Element;
|
|
21
21
|
Item: ({ className, variant, ...props }: Omit<Omit<import("@base-ui/react").ContextMenuItemProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
22
22
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
23
23
|
variant?: "default" | "destructive";
|
|
24
|
-
}) => import("react
|
|
24
|
+
}) => import("react").JSX.Element;
|
|
25
25
|
LinkItem: ({ className, variant, ...props }: Omit<Omit<import("@base-ui/react").ContextMenuLinkItemProps, "ref"> & import("react").RefAttributes<Element>, "ref"> & {
|
|
26
26
|
ref?: import("react").Ref<HTMLAnchorElement>;
|
|
27
27
|
variant?: "default" | "destructive";
|
|
28
|
-
}) => import("react
|
|
28
|
+
}) => import("react").JSX.Element;
|
|
29
29
|
CheckboxItem: ({ className, children, ...props }: Omit<Omit<import("@base-ui/react").ContextMenuCheckboxItemProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
30
30
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
31
|
-
}) => import("react
|
|
31
|
+
}) => import("react").JSX.Element;
|
|
32
32
|
RadioGroup: import("react").NamedExoticComponent<Omit<import("@base-ui/react").ContextMenuRadioGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
33
|
RadioItem: ({ className, children, ...props }: Omit<Omit<import("@base-ui/react").ContextMenuRadioItemProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
34
34
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
35
|
-
}) => import("react
|
|
35
|
+
}) => import("react").JSX.Element;
|
|
36
36
|
SubmenuRoot: typeof BaseContextMenu.SubmenuRoot;
|
|
37
37
|
SubmenuTrigger: ({ className, children, ...props }: Omit<Omit<import("@base-ui/react").ContextMenuSubmenuTriggerProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
38
38
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
39
|
-
}) => import("react
|
|
39
|
+
}) => import("react").JSX.Element;
|
|
40
40
|
};
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -25,11 +25,11 @@ type PopupProps = BasePopupProps & {
|
|
|
25
25
|
* `Trigger` and `Close` supply behavior without appearance. Compose them through `render` with a
|
|
26
26
|
* `Button` or another appropriate interactive element. */
|
|
27
27
|
export declare const Dialog: {
|
|
28
|
-
Root:
|
|
28
|
+
Root: <Payload>(props: BaseDialog.Root.Props<Payload>) => React.JSX.Element;
|
|
29
29
|
Trigger: BaseDialog.Trigger;
|
|
30
30
|
Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
|
-
Backdrop: ({ className, ...props }: BackdropProps) => import("react
|
|
32
|
-
Popup: ({ className, surface, ...props }: PopupProps) => import("react
|
|
31
|
+
Backdrop: ({ className, ...props }: BackdropProps) => import("react").JSX.Element;
|
|
32
|
+
Popup: ({ className, surface, ...props }: PopupProps) => import("react").JSX.Element;
|
|
33
33
|
Viewport: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
34
|
Title: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTitleProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
35
35
|
Description: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogDescriptionProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -7,7 +7,7 @@ import { mergeStatefulClassName } from '../helpers/mergeStatefulClassName/mergeS
|
|
|
7
7
|
// and size stay the caller's job — Base UI's Dialog.Popup isn't self-positioning, and consumers
|
|
8
8
|
// legitimately differ (a centred lightbox vs a command palette pinned near the top).
|
|
9
9
|
const backdropClasses = 'bg-overlay fixed inset-0 z-40 transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 motion-reduce:transition-none';
|
|
10
|
-
const popupBaseClasses = 'outline-
|
|
10
|
+
const popupBaseClasses = 'outline-none z-50 transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 motion-reduce:transition-none';
|
|
11
11
|
const popupSurfaceClasses = 'bg-popover text-popover-foreground shadow-popover border-border rounded-xl border';
|
|
12
12
|
const Backdrop = ({ className, ...props }) => (_jsx(BaseDialog.Backdrop, { className: mergeStatefulClassName(backdropClasses, className), ...props }));
|
|
13
13
|
const Popup = ({ className, surface = true, ...props }) => (_jsx(BaseDialog.Popup, { className: mergeStatefulClassName(cn(popupBaseClasses, surface && popupSurfaceClasses), className), ...props }));
|
package/dist/Field/Field.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FieldDescriptionProps, FieldErrorProps, FieldItemProps, FieldLabelProps, FieldRootProps } from './Field.types';
|
|
2
2
|
export declare const Field: {
|
|
3
|
-
Root: ({ className, ...props }: FieldRootProps) => import("react
|
|
4
|
-
Label: ({ className, ...props }: FieldLabelProps) => import("react
|
|
5
|
-
Description: ({ className, ...props }: FieldDescriptionProps) => import("react
|
|
6
|
-
Error: ({ className, ...props }: FieldErrorProps) => import("react
|
|
3
|
+
Root: ({ className, ...props }: FieldRootProps) => import("react").JSX.Element;
|
|
4
|
+
Label: ({ className, ...props }: FieldLabelProps) => import("react").JSX.Element;
|
|
5
|
+
Description: ({ className, ...props }: FieldDescriptionProps) => import("react").JSX.Element;
|
|
6
|
+
Error: ({ className, ...props }: FieldErrorProps) => import("react").JSX.Element;
|
|
7
7
|
Validity: import("react").FC<import("@base-ui/react").FieldValidityProps>;
|
|
8
|
-
Item: ({ className, ...props }: FieldItemProps) => import("react
|
|
9
|
-
Control: ({ className, ...props }: import("..").InputProps) => import("react
|
|
8
|
+
Item: ({ className, ...props }: FieldItemProps) => import("react").JSX.Element;
|
|
9
|
+
Control: ({ className, ...props }: import("..").InputProps) => import("react").JSX.Element;
|
|
10
10
|
};
|
package/dist/Field/Field.js
CHANGED
|
@@ -5,8 +5,8 @@ import { mergeStatefulClassName } from '../helpers/mergeStatefulClassName/mergeS
|
|
|
5
5
|
import { Input } from '../Input/Input';
|
|
6
6
|
const Root = ({ className, ...props }) => (_jsx(BaseField.Root, { "data-slot": "field", className: mergeStatefulClassName('grid w-full gap-1.5', className), ...props }));
|
|
7
7
|
const Label = ({ className, ...props }) => (_jsx(BaseField.Label, { "data-slot": "field-label", className: mergeStatefulClassName('text-foreground w-fit text-sm leading-5 font-medium data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50', className), ...props }));
|
|
8
|
-
const Description = ({ className, ...props }) => (_jsx(BaseField.Description, { "data-slot": "field-description", className: mergeStatefulClassName('text-muted-foreground text-sm leading-5
|
|
9
|
-
const Error = ({ className, ...props }) => (_jsx(BaseField.Error, { "data-slot": "field-error", className: mergeStatefulClassName('text-destructive text-sm leading-5', className), ...props }));
|
|
8
|
+
const Description = ({ className, ...props }) => (_jsx(BaseField.Description, { "data-slot": "field-description", className: mergeStatefulClassName('text-muted-foreground text-sm leading-5', className), ...props }));
|
|
9
|
+
const Error = ({ className, ...props }) => (_jsx(BaseField.Error, { "data-slot": "field-error", className: mergeStatefulClassName('text-destructive-foreground text-sm leading-5', className), ...props }));
|
|
10
10
|
const Item = ({ className, ...props }) => (_jsx(BaseField.Item, { "data-slot": "field-item", className: mergeStatefulClassName('grid grid-cols-[auto_1fr] items-start gap-x-2 gap-y-1 [&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2', className), ...props }));
|
|
11
11
|
export const Field = {
|
|
12
12
|
Root,
|
package/dist/Input/Input.d.ts
CHANGED
package/dist/Input/Input.js
CHANGED
|
@@ -3,5 +3,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Input as BaseInput } from '@base-ui/react/input';
|
|
4
4
|
import { cn } from '../helpers/cn/cn';
|
|
5
5
|
import { mergeStatefulClassName } from '../helpers/mergeStatefulClassName/mergeStatefulClassName';
|
|
6
|
-
const Input = ({ className, ...props }) => (_jsx(BaseInput, { ...props, "data-slot": "input", className: mergeStatefulClassName(cn('border-input-border bg-surface-inset inset-shadow-surface text-foreground placeholder:text-muted-foreground h-9 w-full min-w-0 rounded-lg border px-3 py-1 text-sm
|
|
6
|
+
const Input = ({ className, ...props }) => (_jsx(BaseInput, { ...props, "data-slot": "input", className: mergeStatefulClassName(cn('border-input-border bg-surface-inset inset-shadow-surface text-foreground placeholder:text-muted-foreground h-9 w-full min-w-0 rounded-lg border px-3 py-1 text-sm', 'enabled:hover:border-ring', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:outline-hidden forced-colors:focus-visible:outline-[Highlight]', 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50', 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 aria-invalid:ring-3'), className) }));
|
|
7
7
|
export { Input };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { InputGroupActionProps, InputGroupControlProps, InputGroupRootProps } from './InputGroup.types';
|
|
2
|
+
export declare const inputGroupControlClassName = "text-foreground placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent px-2 py-1 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50";
|
|
2
3
|
export declare const InputGroup: {
|
|
3
|
-
Root: ({ className, onPointerDown, ...props }: InputGroupRootProps) => import("react
|
|
4
|
-
Control: ({ className, ...props }: InputGroupControlProps) => import("react
|
|
5
|
-
Action: ({ className, variant, size, replacesNativePicker, ...props }: InputGroupActionProps) => import("react
|
|
4
|
+
Root: ({ className, onPointerDown, ...props }: InputGroupRootProps) => import("react").JSX.Element;
|
|
5
|
+
Control: ({ className, ...props }: InputGroupControlProps) => import("react").JSX.Element;
|
|
6
|
+
Action: ({ className, variant, size, replacesNativePicker, ...props }: InputGroupActionProps) => import("react").JSX.Element;
|
|
6
7
|
};
|
|
@@ -14,9 +14,11 @@ const Root = ({ className, onPointerDown, ...props }) => {
|
|
|
14
14
|
.querySelector('[data-slot="input-group-control"]')
|
|
15
15
|
?.focus();
|
|
16
16
|
};
|
|
17
|
-
return (_jsx("div", { ...props, "data-slot": "input-group", onPointerDown: focusControlFromShell, className: cn('border-input-border bg-surface-inset inset-shadow-surface flex min-h-11 w-full min-w-0 items-center gap-1 rounded-lg border p-2
|
|
17
|
+
return (_jsx("div", { ...props, "data-slot": "input-group", onPointerDown: focusControlFromShell, className: cn('border-input-border bg-surface-inset inset-shadow-surface flex min-h-11 w-full min-w-0 items-center gap-1 rounded-lg border p-2', 'has-[[data-slot=input-group-control]:enabled]:hover:border-ring', 'has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-3', 'has-[[data-slot=input-group-control][aria-invalid=true]]:border-destructive has-[[data-slot=input-group-control][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot=input-group-control][aria-invalid=true]]:border-destructive/50 dark:has-[[data-slot=input-group-control][aria-invalid=true]]:ring-destructive/40 has-[[data-slot=input-group-control][aria-invalid=true]]:ring-3', 'forced-colors:has-[[data-slot=input-group-control]:focus-visible]:ring-0 forced-colors:has-[[data-slot=input-group-control]:focus-visible]:outline-2 forced-colors:has-[[data-slot=input-group-control]:focus-visible]:outline-offset-2 forced-colors:has-[[data-slot=input-group-control]:focus-visible]:outline-[Highlight]', '[&:has([data-native-picker-action])_[data-slot=input-group-control]::-webkit-calendar-picker-indicator]:hidden', className) }));
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
// Shared with inputs that bring their own form behavior, like Autocomplete's combobox input.
|
|
20
|
+
export const inputGroupControlClassName = 'text-foreground placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent px-2 py-1 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50';
|
|
21
|
+
const Control = ({ className, ...props }) => (_jsx(BaseInput, { ...props, "data-slot": "input-group-control", className: mergeStatefulClassName(inputGroupControlClassName, className) }));
|
|
20
22
|
const Action = ({ className, variant = 'subtle', size = 'icon', replacesNativePicker = false, ...props }) => (_jsx(Button, { ...props, "data-slot": "input-group-action", "data-native-picker-action": replacesNativePicker ? '' : undefined, variant: variant, size: size, className: mergeStatefulClassName(cn('rounded-md',
|
|
21
23
|
// Firefox does not expose its native date indicator to author CSS, so it keeps that
|
|
22
24
|
// affordance and omits the replacement action instead of rendering two calendar buttons.
|
package/dist/Item/Item.d.ts
CHANGED
|
@@ -10,11 +10,11 @@ declare const itemVariants: (props?: ({
|
|
|
10
10
|
* appropriate owner. `interactive` adds visual feedback without adding semantics or handlers.
|
|
11
11
|
*/
|
|
12
12
|
export declare const Item: {
|
|
13
|
-
Root: <E extends ElementType = "div">({ as, className, surface, interactive, ...props }: ItemRootProps<E>) => import("react
|
|
14
|
-
Media: ({ className, ...props }: ItemMediaProps) => import("react
|
|
15
|
-
Content: ({ className, ...props }: ItemContentProps) => import("react
|
|
16
|
-
Title: ({ className, ...props }: ItemTitleProps) => import("react
|
|
17
|
-
Description: ({ className, ...props }: ItemDescriptionProps) => import("react
|
|
18
|
-
Actions: ({ className, ...props }: ItemActionsProps) => import("react
|
|
13
|
+
Root: <E extends ElementType = "div">({ as, className, surface, interactive, ...props }: ItemRootProps<E>) => import("react").JSX.Element;
|
|
14
|
+
Media: ({ className, ...props }: ItemMediaProps) => import("react").JSX.Element;
|
|
15
|
+
Content: ({ className, ...props }: ItemContentProps) => import("react").JSX.Element;
|
|
16
|
+
Title: ({ className, ...props }: ItemTitleProps) => import("react").JSX.Element;
|
|
17
|
+
Description: ({ className, ...props }: ItemDescriptionProps) => import("react").JSX.Element;
|
|
18
|
+
Actions: ({ className, ...props }: ItemActionsProps) => import("react").JSX.Element;
|
|
19
19
|
};
|
|
20
20
|
export { itemVariants };
|
package/dist/Item/Item.js
CHANGED
|
@@ -10,7 +10,7 @@ const itemVariants = cva('min-w-0 rounded-lg', {
|
|
|
10
10
|
outline: 'border-border border bg-transparent',
|
|
11
11
|
},
|
|
12
12
|
interactive: {
|
|
13
|
-
true: '
|
|
13
|
+
true: 'hover:bg-accent focus-within:bg-accent focus-visible:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-hidden dark:hover:bg-accent/50 dark:focus-within:bg-accent/50 dark:focus-visible:bg-accent/50 forced-colors:focus-visible:outline-[Highlight]',
|
|
14
14
|
false: '',
|
|
15
15
|
},
|
|
16
16
|
},
|
package/dist/Kbd/Kbd.d.ts
CHANGED
package/dist/Kbd/Kbd.js
CHANGED
|
@@ -1,38 +1,67 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useSyncExternalStore } from 'react';
|
|
4
4
|
import { getModKey } from '../helpers/getModKey/getModKey';
|
|
5
5
|
import { cn } from '../helpers/cn/cn';
|
|
6
6
|
import { kbdVariants } from './Kbd.variants';
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
// Apple keyboards print glyphs on their modifier keys; Windows and Linux keyboards print names.
|
|
8
|
+
const MAC_KEYS = {
|
|
9
|
+
mod: '⌘',
|
|
10
|
+
ctrl: '⌃',
|
|
10
11
|
alt: '⌥',
|
|
12
|
+
shift: '⇧',
|
|
11
13
|
enter: '↵',
|
|
12
14
|
backspace: '⌫',
|
|
13
|
-
escape: 'Esc',
|
|
14
15
|
space: '␣',
|
|
16
|
+
};
|
|
17
|
+
const OTHER_KEYS = {
|
|
18
|
+
mod: 'Ctrl',
|
|
19
|
+
ctrl: 'Ctrl',
|
|
20
|
+
alt: 'Alt',
|
|
21
|
+
shift: 'Shift',
|
|
22
|
+
enter: 'Enter',
|
|
23
|
+
backspace: 'Backspace',
|
|
24
|
+
space: 'Space',
|
|
25
|
+
};
|
|
26
|
+
const SHARED_KEYS = {
|
|
27
|
+
escape: 'Esc',
|
|
15
28
|
left: '←',
|
|
16
29
|
right: '→',
|
|
17
30
|
up: '↑',
|
|
18
31
|
down: '↓',
|
|
19
32
|
};
|
|
33
|
+
// Screen readers announce these glyphs by their symbol names ("upwards white arrow"), so each
|
|
34
|
+
// renders with the key's name as hidden text instead.
|
|
35
|
+
const GLYPH_NAMES = {
|
|
36
|
+
'⌘': 'Command',
|
|
37
|
+
'⌃': 'Control',
|
|
38
|
+
'⌥': 'Option',
|
|
39
|
+
'⇧': 'Shift',
|
|
40
|
+
'↵': 'Return',
|
|
41
|
+
'⌫': 'Delete',
|
|
42
|
+
'␣': 'Space',
|
|
43
|
+
'←': 'Left arrow',
|
|
44
|
+
'→': 'Right arrow',
|
|
45
|
+
'↑': 'Up arrow',
|
|
46
|
+
'↓': 'Down arrow',
|
|
47
|
+
};
|
|
20
48
|
const resolveKey = (key, modKey) => {
|
|
21
49
|
const lower = key.toLowerCase();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (lower === 'ctrl')
|
|
25
|
-
return modKey === 'Cmd' ? '⌃' : 'Ctrl';
|
|
26
|
-
return KEY_SYMBOLS[lower] ?? key;
|
|
50
|
+
const platformKeys = modKey === 'Cmd' ? MAC_KEYS : OTHER_KEYS;
|
|
51
|
+
return platformKeys[lower] ?? SHARED_KEYS[lower] ?? key;
|
|
27
52
|
};
|
|
28
53
|
// The platform never changes after load, so there is nothing to subscribe to. The server
|
|
29
|
-
// snapshot pins SSR and hydration to the non-Mac
|
|
30
|
-
// client's real platform, so Mac users get
|
|
54
|
+
// snapshot pins SSR and hydration to the non-Mac labels; React then re-renders with the
|
|
55
|
+
// client's real platform, so Mac users get glyphs without a hydration mismatch.
|
|
31
56
|
const subscribeToNothing = () => () => { };
|
|
32
57
|
const getServerModKey = () => 'Ctrl';
|
|
33
58
|
const Kbd = ({ keys, size, className }) => {
|
|
34
59
|
const keyList = Array.isArray(keys) ? keys : [keys];
|
|
35
60
|
const modKey = useSyncExternalStore(subscribeToNothing, getModKey, getServerModKey);
|
|
36
|
-
return (_jsx("span", { className: "inline-flex items-center gap-0.5", role: "presentation", children: keyList.map((key, i) =>
|
|
61
|
+
return (_jsx("span", { className: "inline-flex items-center gap-0.5", role: "presentation", children: keyList.map((key, i) => {
|
|
62
|
+
const label = resolveKey(key, modKey);
|
|
63
|
+
const name = GLYPH_NAMES[label];
|
|
64
|
+
return (_jsx("kbd", { className: cn(kbdVariants({ size }), className), children: name ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: label }), _jsx("span", { className: "sr-only", children: name })] })) : (label) }, i));
|
|
65
|
+
}) }));
|
|
37
66
|
};
|
|
38
67
|
export { Kbd };
|
package/dist/Kbd/Kbd.types.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type { kbdVariants } from './Kbd.variants';
|
|
3
3
|
type KbdProps = {
|
|
4
|
-
/** Single key or array of keys for combos. 'mod'
|
|
4
|
+
/** Single key or array of keys for combos. 'mod' resolves to ⌘ on Apple platforms and Ctrl
|
|
5
|
+
* elsewhere; other modifiers follow the platform too (⌥ vs Alt, ⇧ vs Shift). Glyphs carry their
|
|
6
|
+
* key name for screen readers. */
|
|
5
7
|
keys: string | string[];
|
|
6
8
|
className?: string;
|
|
7
9
|
} & VariantProps<typeof kbdVariants>;
|
package/dist/Menu/Menu.d.ts
CHANGED
|
@@ -40,22 +40,22 @@ type SubmenuTriggerProps = BaseSubmenuTriggerProps & {
|
|
|
40
40
|
ref?: Ref<HTMLDivElement>;
|
|
41
41
|
};
|
|
42
42
|
export declare const Menu: {
|
|
43
|
-
Root: <Payload>(props: BaseMenu.Root.Props<Payload>) =>
|
|
43
|
+
Root: <Payload>(props: BaseMenu.Root.Props<Payload>) => React.JSX.Element;
|
|
44
44
|
Trigger: BaseMenu.Trigger;
|
|
45
45
|
Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
46
|
Backdrop: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
-
Positioner: ({ className, sideOffset, ...props }: PositionerProps) => import("react
|
|
48
|
-
Popup: ({ className, ...props }: PopupProps) => import("react
|
|
47
|
+
Positioner: ({ className, sideOffset, ...props }: PositionerProps) => import("react").JSX.Element;
|
|
48
|
+
Popup: ({ className, ...props }: PopupProps) => import("react").JSX.Element;
|
|
49
49
|
Arrow: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuArrowProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
50
50
|
Group: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
|
-
GroupLabel: ({ className, ...props }: GroupLabelProps) => import("react
|
|
52
|
-
Separator: ({ className, ...props }: SeparatorProps) => import("react
|
|
53
|
-
Item: ({ className, variant, ...props }: ItemProps) => import("react
|
|
54
|
-
LinkItem: ({ className, variant, ...props }: LinkItemProps) => import("react
|
|
55
|
-
CheckboxItem: ({ className, children, ...props }: CheckboxItemProps) => import("react
|
|
51
|
+
GroupLabel: ({ className, ...props }: GroupLabelProps) => import("react").JSX.Element;
|
|
52
|
+
Separator: ({ className, ...props }: SeparatorProps) => import("react").JSX.Element;
|
|
53
|
+
Item: ({ className, variant, ...props }: ItemProps) => import("react").JSX.Element;
|
|
54
|
+
LinkItem: ({ className, variant, ...props }: LinkItemProps) => import("react").JSX.Element;
|
|
55
|
+
CheckboxItem: ({ className, children, ...props }: CheckboxItemProps) => import("react").JSX.Element;
|
|
56
56
|
RadioGroup: import("react").NamedExoticComponent<Omit<import("@base-ui/react").ContextMenuRadioGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
57
|
-
RadioItem: ({ className, children, ...props }: RadioItemProps) => import("react
|
|
57
|
+
RadioItem: ({ className, children, ...props }: RadioItemProps) => import("react").JSX.Element;
|
|
58
58
|
SubmenuRoot: typeof BaseMenu.SubmenuRoot;
|
|
59
|
-
SubmenuTrigger: ({ className, children, ...props }: SubmenuTriggerProps) => import("react
|
|
59
|
+
SubmenuTrigger: ({ className, children, ...props }: SubmenuTriggerProps) => import("react").JSX.Element;
|
|
60
60
|
};
|
|
61
61
|
export {};
|
package/dist/Menu/Menu.js
CHANGED
|
@@ -4,13 +4,13 @@ import { Menu as BaseMenu } from '@base-ui/react/menu';
|
|
|
4
4
|
import { ChevronRight } from 'lucide-react';
|
|
5
5
|
import { cn } from '../helpers/cn/cn';
|
|
6
6
|
import { mergeStatefulClassName } from '../helpers/mergeStatefulClassName/mergeStatefulClassName';
|
|
7
|
-
const popupClasses = 'bg-popover text-popover-foreground border-border shadow-popover z-50 min-w-36 origin-[var(--transform-origin)] rounded-lg border py-1 outline-
|
|
8
|
-
const itemBaseClasses = 'relative flex h-7 cursor-default items-center gap-1.5 rounded-[calc(var(--radius)-0.25rem)] px-2.5 text-[0.8rem] outline-
|
|
7
|
+
const popupClasses = 'bg-popover text-popover-foreground border-border shadow-popover z-50 min-w-36 origin-[var(--transform-origin)] rounded-lg border py-1 outline-none transition-[scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 motion-reduce:transition-none';
|
|
8
|
+
const itemBaseClasses = 'relative flex h-7 cursor-default items-center gap-1.5 rounded-[calc(var(--radius)-0.25rem)] px-2.5 text-[0.8rem] outline-none select-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 forced-colors:data-[highlighted]:outline-solid forced-colors:data-[highlighted]:outline-2 forced-colors:data-[highlighted]:-outline-offset-2 forced-colors:data-[highlighted]:outline-[Highlight]';
|
|
9
9
|
const itemVariantClasses = {
|
|
10
10
|
default: 'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground',
|
|
11
|
-
destructive: 'text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive',
|
|
11
|
+
destructive: 'text-destructive-foreground data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive-foreground',
|
|
12
12
|
};
|
|
13
|
-
const Positioner = ({ className, sideOffset = 4, ...props }) => (_jsx(BaseMenu.Positioner, { sideOffset: sideOffset, className: mergeStatefulClassName('z-50
|
|
13
|
+
const Positioner = ({ className, sideOffset = 4, ...props }) => (_jsx(BaseMenu.Positioner, { sideOffset: sideOffset, className: mergeStatefulClassName('z-50', className), ...props }));
|
|
14
14
|
const Popup = ({ className, ...props }) => (_jsx(BaseMenu.Popup, { className: mergeStatefulClassName(popupClasses, className), ...props }));
|
|
15
15
|
const Item = ({ className, variant = 'default', ...props }) => (_jsx(BaseMenu.Item, { className: mergeStatefulClassName(cn(itemBaseClasses, itemVariantClasses[variant]), className), ...props }));
|
|
16
16
|
const LinkItem = ({ className, variant = 'default', ...props }) => (_jsx(BaseMenu.LinkItem, { className: mergeStatefulClassName(cn(itemBaseClasses, itemVariantClasses[variant]), className), ...props }));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { MessageScrollerContentProps, MessageScrollerController, MessageScrollerItemProps, MessageScrollerProviderProps, MessageScrollerRootProps, MessageScrollerStatus, MessageScrollerViewportProps, MessageScrollerVisibility } from './MessageScroller.types';
|
|
2
|
-
declare function MessageScrollerProvider({ autoFollow, children, defaultScrollPosition, scrollEdgeThreshold, scrollMargin, scrollPreviousItemPeek, }: MessageScrollerProviderProps): import("react
|
|
3
|
-
declare function MessageScrollerRoot({ children, className, ref, ...props }: MessageScrollerRootProps): import("react
|
|
4
|
-
declare function MessageScrollerViewport({ 'aria-label': ariaLabel, children, className, onKeyDown, onScroll, onTouchCancel, onTouchEnd, onTouchMove, onTouchStart, onWheel, preserveScrollOnPrepend, ref, role, tabIndex, ...props }: MessageScrollerViewportProps): import("react
|
|
5
|
-
declare function MessageScrollerContent({ 'aria-relevant': ariaRelevant, children, className, ref, role, spacerClassName, ...props }: MessageScrollerContentProps): import("react
|
|
6
|
-
declare function MessageScrollerItem({ children, messageId, ref, scrollAnchor, ...props }: MessageScrollerItemProps): import("react
|
|
2
|
+
declare function MessageScrollerProvider({ autoFollow, children, defaultScrollPosition, scrollEdgeThreshold, scrollMargin, scrollPreviousItemPeek, }: MessageScrollerProviderProps): import("react").JSX.Element;
|
|
3
|
+
declare function MessageScrollerRoot({ children, className, ref, ...props }: MessageScrollerRootProps): import("react").JSX.Element;
|
|
4
|
+
declare function MessageScrollerViewport({ 'aria-label': ariaLabel, children, className, onKeyDown, onScroll, onTouchCancel, onTouchEnd, onTouchMove, onTouchStart, onWheel, preserveScrollOnPrepend, ref, role, tabIndex, ...props }: MessageScrollerViewportProps): import("react").JSX.Element;
|
|
5
|
+
declare function MessageScrollerContent({ 'aria-relevant': ariaRelevant, children, className, ref, role, spacerClassName, ...props }: MessageScrollerContentProps): import("react").JSX.Element;
|
|
6
|
+
declare function MessageScrollerItem({ children, messageId, ref, scrollAnchor, ...props }: MessageScrollerItemProps): import("react").JSX.Element;
|
|
7
7
|
/** Headless transcript scroller shared by carbonid1 apps; consumers own row rendering. */
|
|
8
8
|
declare function useMessageScroller(): MessageScrollerController;
|
|
9
9
|
declare function useMessageScrollerStatus(): MessageScrollerStatus;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { MeterRingProps } from './MeterRing.types';
|
|
2
|
-
export declare const MeterRing: ({ value, min, max, label, tone, testId, }: MeterRingProps) => import("react
|
|
2
|
+
export declare const MeterRing: ({ value, min, max, label, tone, testId, }: MeterRingProps) => import("react").JSX.Element;
|
|
@@ -14,8 +14,8 @@ export declare const Popover: {
|
|
|
14
14
|
Root: typeof BasePopover.Root;
|
|
15
15
|
Trigger: BasePopover.Trigger;
|
|
16
16
|
Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
-
Positioner: ({ className, sideOffset, collisionPadding, collisionAvoidance, positionMethod, ...props }: PositionerProps) => import("react
|
|
18
|
-
Popup: ({ className, ...props }: PopupProps) => import("react
|
|
17
|
+
Positioner: ({ className, sideOffset, collisionPadding, collisionAvoidance, positionMethod, ...props }: PositionerProps) => import("react").JSX.Element;
|
|
18
|
+
Popup: ({ className, ...props }: PopupProps) => import("react").JSX.Element;
|
|
19
19
|
Arrow: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverArrowProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
20
|
Backdrop: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
21
|
Title: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverTitleProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -7,8 +7,8 @@ const POPOVER_COLLISION_AVOIDANCE = {
|
|
|
7
7
|
align: 'shift',
|
|
8
8
|
fallbackAxisSide: 'none',
|
|
9
9
|
};
|
|
10
|
-
const popupClasses = 'bg-popover text-popover-foreground border-border shadow-popover box-border max-h-[var(--available-height)] max-w-[var(--available-width)] origin-[var(--transform-origin)] overflow-x-hidden overflow-y-auto rounded-lg border
|
|
11
|
-
const Positioner = ({ className, sideOffset = 6, collisionPadding = 8, collisionAvoidance = POPOVER_COLLISION_AVOIDANCE, positionMethod = 'fixed', ...props }) => (_jsx(BasePopover.Positioner, { sideOffset: sideOffset, collisionPadding: collisionPadding, collisionAvoidance: collisionAvoidance, positionMethod: positionMethod, className: mergeStatefulClassName('z-50
|
|
10
|
+
const popupClasses = 'bg-popover text-popover-foreground border-border shadow-popover box-border max-h-[var(--available-height)] max-w-[var(--available-width)] origin-[var(--transform-origin)] overflow-x-hidden overflow-y-auto rounded-lg border transition-[scale,opacity] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[instant]:transition-none data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:outline-hidden forced-colors:focus-visible:outline-[Highlight] focus-visible:transition-none motion-reduce:transition-none';
|
|
11
|
+
const Positioner = ({ className, sideOffset = 6, collisionPadding = 8, collisionAvoidance = POPOVER_COLLISION_AVOIDANCE, positionMethod = 'fixed', ...props }) => (_jsx(BasePopover.Positioner, { sideOffset: sideOffset, collisionPadding: collisionPadding, collisionAvoidance: collisionAvoidance, positionMethod: positionMethod, className: mergeStatefulClassName('z-50', className), ...props }));
|
|
12
12
|
const Popup = ({ className, ...props }) => (_jsx(BasePopover.Popup, { className: mergeStatefulClassName(popupClasses, className), ...props }));
|
|
13
13
|
/** Accessible floating disclosure over Base UI Popover. The popup supplies the semantic surface,
|
|
14
14
|
* viewport bounds, and vertical overflow; consumers own content dimensions and spacing. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ProgressRingProps } from './ProgressRing.types';
|
|
2
|
-
export declare const ProgressRing: ({ progress, colorClass, label, tone, animate, pendingStyle, testId, }: ProgressRingProps) => import("react
|
|
2
|
+
export declare const ProgressRing: ({ progress, colorClass, label, tone, animate, pendingStyle, testId, }: ProgressRingProps) => import("react").JSX.Element;
|
|
@@ -7,5 +7,5 @@ type RingVisualProps = {
|
|
|
7
7
|
pendingStyle?: 'none' | 'dashed';
|
|
8
8
|
testId?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const RingVisual: ({ progress, tone, colorClass, animate, pendingStyle, testId, }: RingVisualProps) => import("react
|
|
10
|
+
export declare const RingVisual: ({ progress, tone, colorClass, animate, pendingStyle, testId, }: RingVisualProps) => import("react").JSX.Element;
|
|
11
11
|
export {};
|