@cascivo/react 0.11.0 → 0.12.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.
Files changed (37) hide show
  1. package/README.md +5 -2
  2. package/dist/alert-dialog/alert-dialog.js +2 -4
  3. package/dist/card/card.css +1 -1
  4. package/dist/card/card.js +21 -11
  5. package/dist/card/card.module.js +8 -5
  6. package/dist/checkbox/checkbox.js +2 -2
  7. package/dist/command-menu/command-menu.js +67 -71
  8. package/dist/dropdown/dropdown.js +48 -50
  9. package/dist/header-panel/header-panel.js +2 -4
  10. package/dist/icon-button/icon-button.js +10 -10
  11. package/dist/index.d.ts +29 -14
  12. package/dist/modal/modal.js +4 -4
  13. package/dist/node/alert-dialog/alert-dialog.js +2 -4
  14. package/dist/node/card/card.js +21 -11
  15. package/dist/node/card/card.module.js +8 -5
  16. package/dist/node/checkbox/checkbox.js +2 -2
  17. package/dist/node/command-menu/command-menu.js +67 -71
  18. package/dist/node/dropdown/dropdown.js +48 -50
  19. package/dist/node/header-panel/header-panel.js +2 -4
  20. package/dist/node/icon-button/icon-button.js +10 -10
  21. package/dist/node/modal/modal.js +4 -4
  22. package/dist/node/popover/use-popover.js +9 -9
  23. package/dist/node/react/src/index.js +63 -63
  24. package/dist/node/search/search.js +19 -22
  25. package/dist/node/sheet/sheet.js +2 -4
  26. package/dist/node/visually-hidden/visually-hidden.js +2 -13
  27. package/dist/popover/use-popover.js +9 -9
  28. package/dist/react/src/index.js +63 -63
  29. package/dist/search/search.js +19 -22
  30. package/dist/sheet/sheet.js +2 -4
  31. package/dist/styles.css +1 -3
  32. package/dist/visually-hidden/visually-hidden.js +2 -13
  33. package/package.json +4 -4
  34. package/readme.body.md +5 -2
  35. package/dist/node/visually-hidden/visually-hidden.module.js +0 -5
  36. package/dist/visually-hidden/visually-hidden.css +0 -1
  37. package/dist/visually-hidden/visually-hidden.module.js +0 -6
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  * Docs: https://cascivo.com/llms.txt — or fully offline, no website needed:
22
22
  * npx -y @cascivo/docs (index; `npx @cascivo/docs <component>` for one doc)
23
23
  */
24
- import { ErrorBoundary, FocusScope, LinkComponent, LinkComponentProps, Portal, RovingOrientation, Signal, SpaceStep, SuspenseBoundary, getLinkComponent, setLinkComponent } from "@cascivo/core";
24
+ import { DismissableLayer, DismissableLayerProps, ErrorBoundary, FocusScope, LinkComponent, LinkComponentProps, Machine, MachineConfig, Portal, Presence, RovingOrientation, Signal, Slot, SlotProps, SpaceStep, SuspenseBoundary, UseClipboardOptions, UseClipboardReturn, UseControllableSignalOptions, UseDisclosureOptions, UseDisclosureReturn, VisuallyHidden, VisuallyHiddenProps, batch, cn, composeRefs, computePosition, computed, createMachine, createScope, createStreamBuffer, effect, getLinkComponent, mergeProps, setLinkComponent, signal, useAnchorPosition, useClipboard, useComputed, useControllableSignal, useDisclosure, useEffectPropSignal, useId, useMachine, useMediaQuery, useRovingFocus, useScope, useScrollLock, useSignal, useSignalEffect, useSignals, useStreamBuffer, useTypeahead } from "@cascivo/core";
25
25
  import { AnchorHTMLAttributes, ButtonHTMLAttributes, FormHTMLAttributes, HTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, MouseEvent, ReactElement, ReactNode, RefObject, SelectHTMLAttributes, TextareaHTMLAttributes, TimeHTMLAttributes } from "react";
26
26
 
27
27
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
@@ -73,8 +73,20 @@ declare function Card({
73
73
  children,
74
74
  ...props
75
75
  }: CardProps): import("react").JSX.Element;
76
- interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {}
76
+ interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
77
+ /**
78
+ * Trailing content pinned to the inline-end of the header — an overflow menu, a status
79
+ * badge, a link. Without it the header is a column (title over description), which is
80
+ * why `justify-content: space-between` alone does nothing: the most common dashboard
81
+ * card layout is title-left / action-right, and it needs a row.
82
+ *
83
+ * The title column keeps `min-inline-size: 0`, so a long title truncates instead of
84
+ * pushing the actions out of the card.
85
+ */
86
+ actions?: ReactNode;
87
+ }
77
88
  declare function CardHeader({
89
+ actions,
78
90
  className,
79
91
  children,
80
92
  ...props
@@ -2032,14 +2044,6 @@ declare function Status({
2032
2044
  children,
2033
2045
  ...props
2034
2046
  }: StatusProps): import("react").JSX.Element;
2035
- interface VisuallyHiddenProps extends HTMLAttributes<HTMLSpanElement> {
2036
- children: ReactNode;
2037
- }
2038
- declare function VisuallyHidden({
2039
- children,
2040
- className,
2041
- ...props
2042
- }: VisuallyHiddenProps): import("react").JSX.Element;
2043
2047
  interface SkipNavLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
2044
2048
  targetId?: string;
2045
2049
  labels?: {
@@ -2392,9 +2396,7 @@ declare function Filter({
2392
2396
  className,
2393
2397
  ...aria
2394
2398
  }: FilterProps): import("react").JSX.Element;
2395
- interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
2396
- /** Accessible name for the icon-only control. Required — there is no visible text. */
2397
- label: string;
2399
+ interface IconButtonBaseProps extends ButtonHTMLAttributes<HTMLButtonElement> {
2398
2400
  /** The icon to render. Alias for `children`. Any ReactNode — `@cascivo/icons`
2399
2401
  * ships ~440 ready-made SVG icon components, or pass your own. */
2400
2402
  icon?: ReactNode;
@@ -2403,6 +2405,19 @@ interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
2403
2405
  /** Render the single child element instead of a `<button>` (composition). */
2404
2406
  asChild?: boolean;
2405
2407
  }
2408
+ /**
2409
+ * Exactly one of `label` / `ariaLabel` is required — an icon-only control with no
2410
+ * accessible name is a bug, so this stays enforced by the type rather than a dev warning.
2411
+ * `ariaLabel` is the catalog's convention for an invisible accessible name; `IconButton`
2412
+ * predates it and shipped `label`, so both work and neither is deprecated.
2413
+ */
2414
+ type IconButtonProps = IconButtonBaseProps & ({
2415
+ label: string;
2416
+ ariaLabel?: never;
2417
+ } | {
2418
+ ariaLabel: string;
2419
+ label?: never;
2420
+ });
2406
2421
  declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
2407
2422
  interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
2408
2423
  orientation?: 'horizontal' | 'vertical';
@@ -3522,4 +3537,4 @@ declare function themePreloadScript(options?: {
3522
3537
  attribute?: string;
3523
3538
  defaultTheme?: string;
3524
3539
  }): string;
3525
- export { Accordion, AccordionContent, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, ActionSheet, ActionSheetAction, ActionSheetProps, Alert, AlertDialog, AlertDialogLabels, AlertDialogProps, AlertProps, AppShell, AppShellProps, AspectRatio, AspectRatioProps, AutoGrid, AutoGridProps, Avatar, AvatarGroup, AvatarGroupLabels, AvatarGroupProps, AvatarProps, Badge, BadgeProps, Blockquote, BlockquoteProps, BottomSheet, BottomSheetProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Calendar, CalendarLabels, CalendarProps, Card, CardContent, CardContentProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselLabels, CarouselProps, Center, CenterProps, ChatBubble, ChatBubbleProps, ChatBubbleSide, Checkbox, CheckboxCard, CheckboxCardProps, CheckboxProps, Code, type CodeLang, CodeProps, CodeSnippet, CodeSnippetProps, Collapsible, CollapsibleProps, ColorPicker, ColorPickerLabels, ColorPickerProps, Column, Columns, ColumnsProps, Combobox, ComboboxLabels, ComboboxOption, ComboboxProps, CommandAction, CommandGroup, CommandItem, CommandMenu, CommandMenuProps, CommandPage, CommandScope, CommandStatus, Comparison, ComparisonProps, ContainedList, ContainedListItem, ContainedListItemProps, ContainedListProps, ContextMenu, ContextMenuItem, ContextMenuItemProps, ContextMenuProps, CopyButton, CopyButtonProps, DataList, DataListItem, DataListProps, DataTable, DataTableLabels, DataTableProps, DatePicker, DatePickerLabels, DatePickerProps, DateRange, DateRangePicker, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, Dock, DockItem, DockProps, Drawer, DrawerProps, Dropdown, DropdownItem, DropdownProps, Editable, EditableProps, EmptyState, EmptyStateProps, ErrorBoundary, Fab, FabAction, FabProps, Field, FieldProps, FileUploader, FileUploaderLabels, FileUploaderProps, Filter, FilterOption, FilterProps, FilterVariant, Flex, FlexProps, FocusScope, Form, FormConfig, FormProps, FormStore, FuzzyMatch, Grid, GridAlign, GridItem, GridItemProps, GridProps, Header, HeaderLabels, HeaderLink, HeaderPanel, HeaderPanelLabels, HeaderPanelProps, HeaderProps, Heading, HeadingLevel, HeadingProps, HeadingSize, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, IconButton, IconButtonProps, Image, ImageProps, Indicator, IndicatorPlacement, IndicatorProps, InlineLoading, InlineLoadingProps, InlineLoadingStatus, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, type InputGroupProps, InputProps, Item, ItemActions, ItemActionsProps, ItemContent, ItemContentProps, ItemDescription, ItemDescriptionProps, ItemMedia, ItemMediaProps, ItemProps, ItemTitle, ItemTitleProps, Join, JoinOrientation, JoinProps, Kbd, KbdProps, Label, LabelProps, Link, type LinkComponent, type LinkComponentProps, LinkProps, List, ListItem, ListItemProps, ListProps, LogLevel, LogLine, LogViewer, LogViewerLabels, LogViewerProps, Menu, MenuButton, MenuButtonItem, MenuButtonProps, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, MenuTriggerProps, Menubar, MenubarItem, MenubarMenu, MenubarProps, Modal, ModalProps, MultiSelect, MultiSelectLabels, MultiSelectOption, MultiSelectProps, NativeSelect, NativeSelectOption, NativeSelectProps, NavigationMenu, NavigationMenuItem, NavigationMenuProps, Notification, NotificationProps, NotificationVariant, NumberInput, NumberInputProps, OtpInput, OtpInputProps, OverflowMenu, OverflowMenuItem, OverflowMenuProps, Pagination, PaginationLabels, PaginationProps, PasswordInput, PasswordInputLabels, PasswordInputProps, Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps, Portal, Progress, ProgressBar, ProgressBarProps, ProgressCircle, ProgressCircleProps, ProgressIndicator, ProgressIndicatorProps, ProgressProps, ProgressSize, ProgressStep, ProgressVariant, Prose, ProseProps, PullToRefresh, PullToRefreshProps, QrCode, QrCodeProps, RadialProgress, RadialProgressProps, RadialProgressSize, RadialProgressVariant, Radio, RadioCard, RadioCardGroup, RadioCardGroupProps, RadioCardProps, RadioGroup, RadioGroupProps, RadioProps, RatingGroup, RatingGroupLabels, RatingGroupProps, RelativeTime, RelativeTimeProps, Resizable, ResizableProps, Responsive, ScrollArea, ScrollAreaProps, Search, SearchProps, SegmentedControl, SegmentedControlOption, SegmentedControlProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, ShellHeader, ShellHeaderAction, ShellHeaderBrand, ShellHeaderLabels, ShellHeaderNavItem, ShellHeaderNavLink, ShellHeaderNavMenu, ShellHeaderNavMenuItem, ShellHeaderProps, SideNav, SideNavGroup, SideNavItem, SideNavLinkProps, SideNavLinkSubItem, SideNavProps, SideNavSubItem, SideNavTone, Skeleton, SkeletonProps, SkipNavLink, SkipNavLinkProps, SkipNavTarget, SkipNavTargetProps, Slider, SliderProps, SortDirection, SortState, Spacer, SpacerProps, Spinner, SpinnerProps, Stack, StackProps, type StandardSchemaV1, Stat, StatProps, Status, StatusProps, Step, StepState, Steps, StepsProps, StructuredList, StructuredListItem, StructuredListProps, SuspenseBoundary, Swap, SwapMode, SwapProps, SwipeAction, SwipeItem, SwipeItemProps, Switcher, SwitcherEntry, SwitcherLink, SwitcherProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsProps, TabsTrigger, TabsTriggerProps, Tag, TagProps, TagsInput, TagsInputProps, Text, TextProps, Textarea, TextareaProps, ThemeProvider, type ThemeProviderProps, Tile, TileProps, TimePicker, TimePickerProps, Timeline, TimelineItem, TimelineProps, ToastOptions, ToastProvider, ToastVariant, Toc, TocItem, TocProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupProps, ToggleProps, Toggletip, ToggletipPlacement, ToggletipProps, Tooltip, TooltipProps, TreeNode, TreeView, TreeViewProps, UploaderFile, type UsePopoverOptions, type UsePopoverReturn, type UseTocFromRegionOptions, User, UserProps, VisuallyHidden, VisuallyHiddenProps, createForm, dismissAllToasts, fuzzyMatch, fuzzyScore, getLinkComponent, setLinkComponent, setTheme, themePreloadScript, themeSignal, treeViewMessages, useForm, usePopover, useTheme, useToast, useTocFromRegion };
3540
+ export { Accordion, AccordionContent, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, ActionSheet, ActionSheetAction, ActionSheetProps, Alert, AlertDialog, AlertDialogLabels, AlertDialogProps, AlertProps, AppShell, AppShellProps, AspectRatio, AspectRatioProps, AutoGrid, AutoGridProps, Avatar, AvatarGroup, AvatarGroupLabels, AvatarGroupProps, AvatarProps, Badge, BadgeProps, Blockquote, BlockquoteProps, BottomSheet, BottomSheetProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Calendar, CalendarLabels, CalendarProps, Card, CardContent, CardContentProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselLabels, CarouselProps, Center, CenterProps, ChatBubble, ChatBubbleProps, ChatBubbleSide, Checkbox, CheckboxCard, CheckboxCardProps, CheckboxProps, Code, type CodeLang, CodeProps, CodeSnippet, CodeSnippetProps, Collapsible, CollapsibleProps, ColorPicker, ColorPickerLabels, ColorPickerProps, Column, Columns, ColumnsProps, Combobox, ComboboxLabels, ComboboxOption, ComboboxProps, CommandAction, CommandGroup, CommandItem, CommandMenu, CommandMenuProps, CommandPage, CommandScope, CommandStatus, Comparison, ComparisonProps, ContainedList, ContainedListItem, ContainedListItemProps, ContainedListProps, ContextMenu, ContextMenuItem, ContextMenuItemProps, ContextMenuProps, CopyButton, CopyButtonProps, DataList, DataListItem, DataListProps, DataTable, DataTableLabels, DataTableProps, DatePicker, DatePickerLabels, DatePickerProps, DateRange, DateRangePicker, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, DismissableLayer, type DismissableLayerProps, Dock, DockItem, DockProps, Drawer, DrawerProps, Dropdown, DropdownItem, DropdownProps, Editable, EditableProps, EmptyState, EmptyStateProps, ErrorBoundary, Fab, FabAction, FabProps, Field, FieldProps, FileUploader, FileUploaderLabels, FileUploaderProps, Filter, FilterOption, FilterProps, FilterVariant, Flex, FlexProps, FocusScope, Form, FormConfig, FormProps, FormStore, FuzzyMatch, Grid, GridAlign, GridItem, GridItemProps, GridProps, Header, HeaderLabels, HeaderLink, HeaderPanel, HeaderPanelLabels, HeaderPanelProps, HeaderProps, Heading, HeadingLevel, HeadingProps, HeadingSize, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, IconButton, IconButtonProps, Image, ImageProps, Indicator, IndicatorPlacement, IndicatorProps, InlineLoading, InlineLoadingProps, InlineLoadingStatus, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, type InputGroupProps, InputProps, Item, ItemActions, ItemActionsProps, ItemContent, ItemContentProps, ItemDescription, ItemDescriptionProps, ItemMedia, ItemMediaProps, ItemProps, ItemTitle, ItemTitleProps, Join, JoinOrientation, JoinProps, Kbd, KbdProps, Label, LabelProps, Link, type LinkComponent, type LinkComponentProps, LinkProps, List, ListItem, ListItemProps, ListProps, LogLevel, LogLine, LogViewer, LogViewerLabels, LogViewerProps, type Machine, type MachineConfig, Menu, MenuButton, MenuButtonItem, MenuButtonProps, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, MenuTriggerProps, Menubar, MenubarItem, MenubarMenu, MenubarProps, Modal, ModalProps, MultiSelect, MultiSelectLabels, MultiSelectOption, MultiSelectProps, NativeSelect, NativeSelectOption, NativeSelectProps, NavigationMenu, NavigationMenuItem, NavigationMenuProps, Notification, NotificationProps, NotificationVariant, NumberInput, NumberInputProps, OtpInput, OtpInputProps, OverflowMenu, OverflowMenuItem, OverflowMenuProps, Pagination, PaginationLabels, PaginationProps, PasswordInput, PasswordInputLabels, PasswordInputProps, Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps, Portal, Presence, Progress, ProgressBar, ProgressBarProps, ProgressCircle, ProgressCircleProps, ProgressIndicator, ProgressIndicatorProps, ProgressProps, ProgressSize, ProgressStep, ProgressVariant, Prose, ProseProps, PullToRefresh, PullToRefreshProps, QrCode, QrCodeProps, RadialProgress, RadialProgressProps, RadialProgressSize, RadialProgressVariant, Radio, RadioCard, RadioCardGroup, RadioCardGroupProps, RadioCardProps, RadioGroup, RadioGroupProps, RadioProps, RatingGroup, RatingGroupLabels, RatingGroupProps, RelativeTime, RelativeTimeProps, Resizable, ResizableProps, Responsive, ScrollArea, ScrollAreaProps, Search, SearchProps, SegmentedControl, SegmentedControlOption, SegmentedControlProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, ShellHeader, ShellHeaderAction, ShellHeaderBrand, ShellHeaderLabels, ShellHeaderNavItem, ShellHeaderNavLink, ShellHeaderNavMenu, ShellHeaderNavMenuItem, ShellHeaderProps, SideNav, SideNavGroup, SideNavItem, SideNavLinkProps, SideNavLinkSubItem, SideNavProps, SideNavSubItem, SideNavTone, Skeleton, SkeletonProps, SkipNavLink, SkipNavLinkProps, SkipNavTarget, SkipNavTargetProps, Slider, SliderProps, Slot, type SlotProps, SortDirection, SortState, Spacer, SpacerProps, Spinner, SpinnerProps, Stack, StackProps, type StandardSchemaV1, Stat, StatProps, Status, StatusProps, Step, StepState, Steps, StepsProps, StructuredList, StructuredListItem, StructuredListProps, SuspenseBoundary, Swap, SwapMode, SwapProps, SwipeAction, SwipeItem, SwipeItemProps, Switcher, SwitcherEntry, SwitcherLink, SwitcherProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsProps, TabsTrigger, TabsTriggerProps, Tag, TagProps, TagsInput, TagsInputProps, Text, TextProps, Textarea, TextareaProps, ThemeProvider, type ThemeProviderProps, Tile, TileProps, TimePicker, TimePickerProps, Timeline, TimelineItem, TimelineProps, ToastOptions, ToastProvider, ToastVariant, Toc, TocItem, TocProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupProps, ToggleProps, Toggletip, ToggletipPlacement, ToggletipProps, Tooltip, TooltipProps, TreeNode, TreeView, TreeViewProps, UploaderFile, type UseClipboardOptions, type UseClipboardReturn, type UseControllableSignalOptions, type UseDisclosureOptions, type UseDisclosureReturn, type UsePopoverOptions, type UsePopoverReturn, type UseTocFromRegionOptions, User, UserProps, VisuallyHidden, VisuallyHiddenProps, batch, cn, composeRefs, computePosition, computed, createForm, createMachine, createScope, createStreamBuffer, dismissAllToasts, effect, fuzzyMatch, fuzzyScore, getLinkComponent, mergeProps, setLinkComponent, setTheme, signal, themePreloadScript, themeSignal, treeViewMessages, useAnchorPosition, useClipboard, useComputed, useControllableSignal, useDisclosure, useEffectPropSignal, useForm, useId, useMachine, useMediaQuery, usePopover, useRovingFocus, useScope, useScrollLock, useSignal, useSignalEffect, useSignals, useStreamBuffer, useTheme, useToast, useTocFromRegion, useTypeahead };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./modal.module.js";
4
- import { cn as t, useDraggable as n, useId as r, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
4
+ import { cn as t, useDraggable as n, useEffectPropSignal as r, useId as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
5
5
  import { builtin as s, t as c } from "@cascivo/i18n";
6
6
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
7
  import { useRef as d } from "react";
@@ -10,11 +10,11 @@ function f({ open: f = !1, onClose: p, title: m, description: h, children: g, cl
10
10
  o();
11
11
  let b = d(null), x = d(p);
12
12
  x.current = p;
13
- let S = r("cascivo-modal-title"), C = r("cascivo-modal-desc"), { handleRef: w, offset: T } = n({ isDisabled: !y }), E = y ? {
13
+ let S = i("cascivo-modal-title"), C = i("cascivo-modal-desc"), { handleRef: w, offset: T } = n({ isDisabled: !y }), E = y ? {
14
14
  "--modal-x": `${T.value.x}px`,
15
15
  "--modal-y": `${T.value.y}px`
16
- } : void 0, D = i(f);
17
- return D.value = f, a(() => {
16
+ } : void 0, D = r(f);
17
+ return a(() => {
18
18
  let e = b.current;
19
19
  e && (D.value ? e.open || e.showModal() : e.open && e.close());
20
20
  }), a(() => {
@@ -1,15 +1,13 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./alert-dialog.module.js";
4
- import { useId as t, useSignal as n, useSignalEffect as r } from "@cascivo/core";
4
+ import { useEffectPropSignal as t, useId as n, useSignalEffect as r } from "@cascivo/core";
5
5
  import { builtin as i, t as a } from "@cascivo/i18n";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  import { useRef as c } from "react";
8
8
  //#region ../components/src/alert-dialog/alert-dialog.tsx
9
9
  function l({ open: l, title: u, description: d, onConfirm: f, onCancel: p, labels: m, variant: h = "default" }) {
10
- let g = c(null), _ = t("cascivo-alert-dialog-title"), v = t("cascivo-alert-dialog-desc"), y = n(l);
11
- y.value = l;
12
- let b = c(null), x = c(p);
10
+ let g = c(null), _ = n("cascivo-alert-dialog-title"), v = n("cascivo-alert-dialog-desc"), y = t(l), b = c(null), x = c(p);
13
11
  x.current = p;
14
12
  let S = c(f);
15
13
  return S.current = f, r(() => {
@@ -2,9 +2,9 @@
2
2
 
3
3
  import e from "./card.module.js";
4
4
  import { cn as t } from "@cascivo/core";
5
- import { jsx as n } from "react/jsx-runtime";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
6
  //#region ../components/src/card/card.tsx
7
- function r({ variant: r = "default", padding: i = "md", className: a, children: o, ...s }) {
7
+ function i({ variant: r = "default", padding: i = "md", className: a, children: o, ...s }) {
8
8
  return /* @__PURE__ */ n("div", {
9
9
  "data-variant": r,
10
10
  "data-padding": i,
@@ -13,28 +13,38 @@ function r({ variant: r = "default", padding: i = "md", className: a, children:
13
13
  children: o
14
14
  });
15
15
  }
16
- function i({ className: r, children: i, ...a }) {
17
- return /* @__PURE__ */ n("div", {
18
- className: t(e.header, r),
19
- ...a,
20
- children: i
16
+ function a({ actions: i, className: a, children: o, ...s }) {
17
+ return i === void 0 ? /* @__PURE__ */ n("div", {
18
+ className: t(e.header, a),
19
+ ...s,
20
+ children: o
21
+ }) : /* @__PURE__ */ r("div", {
22
+ className: t(e.header, e.headerRow, a),
23
+ ...s,
24
+ children: [/* @__PURE__ */ n("div", {
25
+ className: e.headerMain,
26
+ children: o
27
+ }), /* @__PURE__ */ n("div", {
28
+ className: e.headerActions,
29
+ children: i
30
+ })]
21
31
  });
22
32
  }
23
- function a({ className: r, children: i, ...a }) {
33
+ function o({ className: r, children: i, ...a }) {
24
34
  return /* @__PURE__ */ n("h3", {
25
35
  className: t(e.title, r),
26
36
  ...a,
27
37
  children: i
28
38
  });
29
39
  }
30
- function o({ className: r, children: i, ...a }) {
40
+ function s({ className: r, children: i, ...a }) {
31
41
  return /* @__PURE__ */ n("div", {
32
42
  className: t(e.content, r),
33
43
  ...a,
34
44
  children: i
35
45
  });
36
46
  }
37
- function s({ className: r, children: i, ...a }) {
47
+ function c({ className: r, children: i, ...a }) {
38
48
  return /* @__PURE__ */ n("div", {
39
49
  className: t(e.footer, r),
40
50
  ...a,
@@ -42,4 +52,4 @@ function s({ className: r, children: i, ...a }) {
42
52
  });
43
53
  }
44
54
  //#endregion
45
- export { r as Card, o as CardContent, s as CardFooter, i as CardHeader, a as CardTitle };
55
+ export { i as Card, s as CardContent, c as CardFooter, a as CardHeader, o as CardTitle };
@@ -1,11 +1,14 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- card: "_card_16415_2",
5
- header: "_header_16415_35",
6
- title: "_title_16415_46",
7
- content: "_content_16415_55",
8
- footer: "_footer_16415_63"
4
+ card: "_card_4huda_2",
5
+ header: "_header_4huda_35",
6
+ headerRow: "_headerRow_4huda_49",
7
+ headerMain: "_headerMain_4huda_57",
8
+ headerActions: "_headerActions_4huda_64",
9
+ title: "_title_4huda_72",
10
+ content: "_content_4huda_81",
11
+ footer: "_footer_4huda_89"
9
12
  };
10
13
  //#endregion
11
14
  export { e as default };
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./checkbox.module.js";
4
- import { cn as t, useSignal as n, useSignalEffect as r } from "@cascivo/core";
4
+ import { cn as t, useEffectPropSignal as n, useSignalEffect as r } from "@cascivo/core";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  import { useRef as o } from "react";
7
7
  //#region ../components/src/checkbox/checkbox.tsx
8
8
  function s({ label: s, indeterminate: c = !1, className: l, id: u, disabled: d, ...f }) {
9
9
  let p = o(null), m = n(c);
10
- m.value = c, r(() => {
10
+ r(() => {
11
11
  p.current && (p.current.indeterminate = m.value);
12
12
  });
13
13
  let h = u ?? (s ? `cascade-checkbox-${s.toLowerCase().replace(/\s+/g, "-")}` : void 0);
@@ -3,10 +3,10 @@
3
3
  import { Spinner as e } from "../spinner/spinner.js";
4
4
  import { Kbd as t } from "../kbd/kbd.js";
5
5
  import n from "./command-menu.module.js";
6
- import { batch as r, cn as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
6
+ import { batch as r, cn as i, useEffectPropSignal as a, useSignal as o, useSignalEffect as s, useSignals as ee } from "@cascivo/core";
7
7
  import { builtin as c, t as l } from "@cascivo/i18n";
8
8
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { useId as ee, useRef as f } from "react";
9
+ import { useId as te, useRef as f } from "react";
10
10
  //#region ../components/src/command-menu/command-menu.tsx
11
11
  function p(e, t) {
12
12
  if (e.length === 0) return {
@@ -66,46 +66,42 @@ function _(e, t) {
66
66
  }
67
67
  return null;
68
68
  }
69
- function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b, hotkey: x = !0, label: S, loading: C = !1, onQueryChange: w, scopes: T = [], className: E }) {
70
- s();
71
- let D = S ?? l(c.commandMenu.label), ne = b ?? l(c.commandMenu.empty), O = ee(), k = `${O}-listbox`, A = f(null), j = f(null), M = f([]), N = f(v);
72
- N.current = v;
73
- let P = f(w);
74
- P.current = w;
75
- let F = a(m);
76
- F.value = m;
77
- let I = a(x);
78
- I.value = x;
79
- let L = a(""), R = a(0), z = a([]), B = a(null), re = z.value.at(-1)?.groups ?? te, ie = y ?? z.value.at(-1)?.placeholder ?? l(c.commandMenu.placeholder), V = T.find((e) => e.id === B.value) ?? null, H = re.filter((e) => !B.value || !e.scope || e.scope === B.value).map((e) => ({
69
+ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel: ie, hotkey: y = !0, label: b, loading: x = !1, onQueryChange: S, scopes: C = [], className: ae }) {
70
+ ee();
71
+ let w = b ?? l(c.commandMenu.label), T = ie ?? l(c.commandMenu.empty), E = te(), D = `${E}-listbox`, O = f(null), k = f(null), A = f([]), j = f(v);
72
+ j.current = v;
73
+ let M = f(S);
74
+ M.current = S;
75
+ let N = a(m), P = a(y), F = o(""), I = o(0), L = o([]), R = o(null), z = L.value.at(-1)?.groups ?? ne, B = re ?? L.value.at(-1)?.placeholder ?? l(c.commandMenu.placeholder), V = C.find((e) => e.id === R.value) ?? null, H = z.filter((e) => !R.value || !e.scope || e.scope === R.value).map((e) => ({
80
76
  heading: e.heading,
81
77
  items: e.items.map((e) => ({
82
78
  item: e,
83
- score: h(L.value, e)
79
+ score: h(F.value, e)
84
80
  })).filter(({ score: e }) => e > 0).sort((e, t) => t.score - e.score).map(({ item: e }) => ({
85
81
  item: e,
86
- indices: p(L.value, e.label)?.indices ?? []
82
+ indices: p(F.value, e.label)?.indices ?? []
87
83
  }))
88
- })).filter((e) => e.items.length > 0), U = H.flatMap((e) => e.items.map((e) => e.item)), W = U.flatMap((e, t) => e.disabled ? [] : [t]), G = W.includes(R.value) ? R.value : W[0] ?? -1, K = (e) => `${O}-option-${e}`;
89
- o(() => {
90
- let e = A.current;
91
- e && (F.value ? e.open || (r(() => {
92
- L.value = "", R.value = 0, z.value = [], B.value = null;
93
- }), typeof e.showModal == "function" && e.showModal(), j.current?.focus()) : e.open && (z.value = [], e.close()));
94
- }), o(() => {
95
- let e = A.current;
84
+ })).filter((e) => e.items.length > 0), U = H.flatMap((e) => e.items.map((e) => e.item)), W = U.flatMap((e, t) => e.disabled ? [] : [t]), G = W.includes(I.value) ? I.value : W[0] ?? -1, K = (e) => `${E}-option-${e}`;
85
+ s(() => {
86
+ let e = O.current;
87
+ e && (N.value ? e.open || (r(() => {
88
+ F.value = "", I.value = 0, L.value = [], R.value = null;
89
+ }), typeof e.showModal == "function" && e.showModal(), k.current?.focus()) : e.open && (L.value = [], e.close()));
90
+ }), s(() => {
91
+ let e = O.current;
96
92
  if (!e) return;
97
- let t = () => N.current(!1);
93
+ let t = () => j.current(!1);
98
94
  return e.addEventListener("close", t), () => e.removeEventListener("close", t);
99
- }), o(() => {
100
- if (!I.value) return;
95
+ }), s(() => {
96
+ if (!P.value) return;
101
97
  let e = (e) => {
102
- (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), N.current(!F.value));
98
+ (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), j.current(!N.value));
103
99
  };
104
100
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
105
101
  });
106
102
  let q = (e) => {
107
- R.value = e;
108
- let t = M.current[e];
103
+ I.value = e;
104
+ let t = A.current[e];
109
105
  t && typeof t.scrollIntoView == "function" && t.scrollIntoView({ block: "nearest" });
110
106
  }, J = (e) => {
111
107
  if (W.length === 0) return;
@@ -118,7 +114,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
118
114
  if (e.page) {
119
115
  if (t === "secondary") return;
120
116
  r(() => {
121
- z.value = [...z.value, e.page], L.value = "", R.value = 0;
117
+ L.value = [...L.value, e.page], F.value = "", I.value = 0;
122
118
  });
123
119
  return;
124
120
  }
@@ -129,21 +125,21 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
129
125
  }
130
126
  t !== "secondary" && (e.onSelect?.(), v(!1));
131
127
  }
132
- }, ae = (e) => {
133
- if (T.length === 0) return;
134
- let t = [null, ...T.map((e) => e.id)], n = t[(t.indexOf(B.value) + e + t.length) % t.length];
128
+ }, oe = (e) => {
129
+ if (C.length === 0) return;
130
+ let t = [null, ...C.map((e) => e.id)], n = t[(t.indexOf(R.value) + e + t.length) % t.length];
135
131
  r(() => {
136
- B.value = n ?? null, R.value = 0;
132
+ R.value = n ?? null, I.value = 0;
137
133
  });
138
134
  }, Z = () => {
139
135
  r(() => {
140
- B.value = null, R.value = 0;
141
- }), j.current?.focus();
136
+ R.value = null, I.value = 0;
137
+ }), k.current?.focus();
142
138
  }, Q = () => {
143
139
  r(() => {
144
- z.value = z.value.slice(0, -1), L.value = "", R.value = 0;
140
+ L.value = L.value.slice(0, -1), F.value = "", I.value = 0;
145
141
  });
146
- }, oe = (e) => {
142
+ }, se = (e) => {
147
143
  switch (e.key) {
148
144
  case "ArrowDown":
149
145
  e.preventDefault(), J(1);
@@ -152,7 +148,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
152
148
  e.preventDefault(), J(-1);
153
149
  break;
154
150
  case "Tab":
155
- T.length > 0 && (e.preventDefault(), ae(e.shiftKey ? -1 : 1));
151
+ C.length > 0 && (e.preventDefault(), oe(e.shiftKey ? -1 : 1));
156
152
  break;
157
153
  case "Home":
158
154
  e.preventDefault(), W[0] !== void 0 && q(W[0]);
@@ -167,20 +163,20 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
167
163
  e.preventDefault(), G >= 0 && X(U[G], e.metaKey || e.ctrlKey ? "secondary" : "primary");
168
164
  break;
169
165
  case "Backspace":
170
- L.value === "" && (z.value.length > 0 ? (e.preventDefault(), Q()) : B.value && (e.preventDefault(), Z()));
166
+ F.value === "" && (L.value.length > 0 ? (e.preventDefault(), Q()) : R.value && (e.preventDefault(), Z()));
171
167
  break;
172
168
  }
173
- }, se = (e) => {
174
- e.key === "Escape" && (e.preventDefault(), z.value.length > 0 ? Q() : A.current?.close());
175
169
  }, ce = (e) => {
176
- e.target === A.current && A.current?.close();
170
+ e.key === "Escape" && (e.preventDefault(), L.value.length > 0 ? Q() : O.current?.close());
171
+ }, le = (e) => {
172
+ e.target === O.current && O.current?.close();
177
173
  }, $ = -1;
178
174
  return /* @__PURE__ */ u("dialog", {
179
- ref: A,
180
- "aria-label": D,
181
- className: i(n.dialog, E),
182
- onClick: ce,
183
- onKeyDown: se,
175
+ ref: O,
176
+ "aria-label": w,
177
+ className: i(n.dialog, ae),
178
+ onClick: le,
179
+ onKeyDown: ce,
184
180
  children: /* @__PURE__ */ d("div", {
185
181
  className: n.panel,
186
182
  children: [
@@ -231,44 +227,44 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
231
227
  })]
232
228
  }),
233
229
  /* @__PURE__ */ u("input", {
234
- ref: j,
230
+ ref: k,
235
231
  type: "text",
236
232
  role: "combobox",
237
233
  "aria-expanded": "true",
238
- "aria-controls": k,
234
+ "aria-controls": D,
239
235
  "aria-activedescendant": G >= 0 ? K(G) : void 0,
240
236
  "aria-autocomplete": "list",
241
- "aria-label": D,
237
+ "aria-label": w,
242
238
  autoComplete: "off",
243
239
  spellCheck: !1,
244
240
  className: n.input,
245
- placeholder: ie,
246
- value: L.value,
241
+ placeholder: B,
242
+ value: F.value,
247
243
  onChange: (e) => {
248
244
  let t = e.target.value;
249
- if (!B.value && T.length > 0) {
250
- let e = _(t, T);
251
- e && (B.value = e.scope.id, t = e.rest);
245
+ if (!R.value && C.length > 0) {
246
+ let e = _(t, C);
247
+ e && (R.value = e.scope.id, t = e.rest);
252
248
  }
253
- L.value = t, R.value = 0, P.current?.(t);
249
+ F.value = t, I.value = 0, M.current?.(t);
254
250
  },
255
- onKeyDown: oe
251
+ onKeyDown: se
256
252
  })
257
253
  ]
258
254
  }),
259
- T.length > 0 && /* @__PURE__ */ d("div", {
255
+ C.length > 0 && /* @__PURE__ */ d("div", {
260
256
  className: n.scopes,
261
257
  children: [/* @__PURE__ */ u("span", {
262
258
  className: n.scopesLabel,
263
259
  children: l(c.commandMenu.scopeLabel)
264
- }), T.map((e) => /* @__PURE__ */ d("button", {
260
+ }), C.map((e) => /* @__PURE__ */ d("button", {
265
261
  type: "button",
266
262
  className: n.scopePill,
267
- "data-active": e.id === B.value || void 0,
263
+ "data-active": e.id === R.value || void 0,
268
264
  onClick: () => {
269
265
  r(() => {
270
- B.value = B.value === e.id ? null : e.id, R.value = 0;
271
- }), j.current?.focus();
266
+ R.value = R.value === e.id ? null : e.id, I.value = 0;
267
+ }), k.current?.focus();
272
268
  },
273
269
  children: [e.prefix && /* @__PURE__ */ u("span", {
274
270
  className: n.scopePrefix,
@@ -280,8 +276,8 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
280
276
  className: n.list,
281
277
  children: [/* @__PURE__ */ u("div", {
282
278
  role: "listbox",
283
- id: k,
284
- "aria-label": S,
279
+ id: D,
280
+ "aria-label": b,
285
281
  tabIndex: 0,
286
282
  children: H.map((e, r) => /* @__PURE__ */ d("div", {
287
283
  role: "group",
@@ -290,7 +286,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
290
286
  children: [e.heading && /* @__PURE__ */ d("div", {
291
287
  className: n.heading,
292
288
  "aria-hidden": "true",
293
- children: [/* @__PURE__ */ u("span", { children: e.heading }), L.value !== "" && /* @__PURE__ */ u("span", {
289
+ children: [/* @__PURE__ */ u("span", { children: e.heading }), F.value !== "" && /* @__PURE__ */ u("span", {
294
290
  className: n.count,
295
291
  children: l(c.commandMenu.matches, { count: e.items.length })
296
292
  })]
@@ -300,7 +296,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
300
296
  let a = $;
301
297
  return /* @__PURE__ */ d("div", {
302
298
  ref: (e) => {
303
- M.current[a] = e;
299
+ A.current[a] = e;
304
300
  },
305
301
  id: K(a),
306
302
  role: "option",
@@ -310,7 +306,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
310
306
  "data-disabled": r.disabled || void 0,
311
307
  className: n.option,
312
308
  onMouseEnter: () => {
313
- r.disabled || (R.value = a);
309
+ r.disabled || (I.value = a);
314
310
  },
315
311
  onClick: () => X(r, "primary"),
316
312
  children: [
@@ -366,14 +362,14 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
366
362
  }, r.id);
367
363
  })]
368
364
  }, e.heading ?? `group-${r}`))
369
- }), U.length === 0 && (C ? /* @__PURE__ */ d("div", {
365
+ }), U.length === 0 && (x ? /* @__PURE__ */ d("div", {
370
366
  role: "status",
371
367
  className: n.empty,
372
368
  children: [/* @__PURE__ */ u(e, { size: "sm" }), l(c.commandMenu.loading)]
373
369
  }) : /* @__PURE__ */ u("div", {
374
370
  role: "status",
375
371
  className: n.empty,
376
- children: ne
372
+ children: T
377
373
  }))]
378
374
  }),
379
375
  /* @__PURE__ */ d("div", {
@@ -401,7 +397,7 @@ function v({ open: m, onOpenChange: v, groups: te, placeholder: y, emptyLabel: b
401
397
  children: "↵"
402
398
  }), " open"]
403
399
  }),
404
- T.length > 0 && /* @__PURE__ */ d("span", {
400
+ C.length > 0 && /* @__PURE__ */ d("span", {
405
401
  className: n.hint,
406
402
  children: [/* @__PURE__ */ u(t, {
407
403
  size: "sm",