@stll/ui 0.2.0 → 0.4.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/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ import { CalendarCell, CalendarEntryButton, CalendarEntrySurface, CalendarGrid, CalendarHeaderCell, CalendarHeaderRow } from "./calendar/primitives.js";
2
+ import { CalendarDateRange, ResourceCalendarLaneLayout, ResourceCalendarLanePlacement, ResourceCalendarPlacement, assertConsecutiveCalendarDates, getResourceCalendarPlacement, layoutResourceCalendarEntries, nextCalendarDate } from "./calendar/resource-calendar.logic.js";
3
+ import { ResourceCalendar, ResourceCalendarColumn, ResourceCalendarEntry, ResourceCalendarEntryTone, ResourceCalendarResource } from "./calendar/resource-calendar.js";
4
+ import "./calendar/index.js";
1
5
  import { Accordion, AccordionContent as AccordionPanel, AccordionItem, AccordionTrigger } from "./components/accordion.js";
2
6
  import { OVERLAY_LAYER_CLASS_NAMES, OverlayLayer } from "./lib/overlay-layer.js";
3
7
  import { AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogContent as AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport } from "./components/alert-dialog.js";
@@ -45,6 +49,7 @@ import { SortDirection, SortableHead, Table, TableBody, TableCaption, TableCell,
45
49
  import { Tabs, TabsContent as TabsPanel, TabsList, TabsTab } from "./components/tabs.js";
46
50
  import { AnchoredToastProvider, TOAST_RIGHT_OFFSET_VAR, ToastPosition, ToastProvider, stellaToast } from "./components/toast.js";
47
51
  import { Tooltip, TooltipContent as TooltipPopup, TooltipCreateHandle, TooltipProvider, TooltipTrigger } from "./components/tooltip.js";
52
+ import { TableColumnCapabilities, TableColumnDescriptor, TableSchema, duplicateColumnIds, findTableColumn, hideableColumnIds, sortableColumnIds, tableColumnIds, tableColumnSizing, visibleColumnIds } from "./data-table/schema.js";
48
53
  import { containedEventHandler, containedHandler } from "./hooks/use-contained-handler.js";
49
54
  import { contentDir, isStructuredInputType, useContentDir } from "./hooks/use-content-dir.js";
50
55
  import { useIsMobile } from "./hooks/use-mobile.js";
@@ -55,6 +60,13 @@ import { PROPERTY_ROW_GRID, SIDE_RAIL_CONTAINER_CLASS, SIDE_RAIL_ICON_BUTTON_SIZ
55
60
  import { INSPECTOR_CONTENT_MIN_WIDTH, INSPECTOR_PANE_DEFAULT_WIDTH, INSPECTOR_PANE_MAX_WIDTH, INSPECTOR_PANE_MIN_WIDTH, INSPECTOR_RAIL_WIDTH, resolveInspectorDockWidth, resolveInspectorPaneMaxWidth, resolveInspectorPaneWidth, shouldForceSidebarCollapsed } from "./inspector/pane-width.js";
56
61
  import { INSPECTOR_PANE_KEYBOARD_PAGE_STEP, INSPECTOR_PANE_KEYBOARD_STEP, parsePersistedPaneWidth, resolveDragWidth, resolveKeyboardWidth, useInspectorPaneWidth } from "./inspector/use-pane-width.js";
57
62
  import "./inspector/index.js";
63
+ import { KanbanCardFieldSelection, selectKanbanCardFieldIds } from "./kanban/card-properties.js";
64
+ import { KanbanCardShell, KanbanCardShellProps } from "./kanban/card-shell.js";
65
+ import { KanbanColumnHeader, KanbanColumnHeaderProps } from "./kanban/column-header.js";
66
+ import { KANBAN_BOARD_AUTO_SCROLL_SOURCES, RegisterKanbanBoardAutoScrollOptions, RegisterKanbanCardDragOptions, registerKanbanBoardAutoScroll, registerKanbanCardDrag } from "./kanban/drag-interactions.js";
67
+ import { ColorVariants, OptionColor, emptyColor, optionColors, resolveOptionColor } from "./lib/option-color.js";
68
+ import { KanbanBuiltInGroup, KanbanGroup, KanbanGroupOption, KanbanGrouping, KanbanSchema, ResolveKanbanGroupingParams, getKanbanGroupingPropertyId, getKanbanGroups, isKanbanGroupingRenderable, resolveKanbanGroupOptions, resolveKanbanGrouping, selectKanbanRows } from "./kanban/grouping.js";
69
+ import "./kanban/index.js";
58
70
  import { cn, composeRefs } from "./lib/utils.js";
59
71
  import { getFirstWeekday, getLocaleWeekInfo, getWeekendDays } from "./lib/week.js";
60
- export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport, AnchoredToastProvider, Avatar, AvatarFallback, AvatarImage, type BidiDirection, BidiText, type BidiTextProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Checkbox, ColorPicker, ColorPickerContent, type ColorPickerContentProps, type ColorPickerProps, type ColorPreset, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandCollection, CommandDialog, CommandDialogPopup, CommandDialogTrigger, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut, DEFAULT_PRESETS, DatePickerPopover, type DatePickerPopoverProps, DestructiveActionConfirmation, DestructiveConfirmDialog, type DestructiveConfirmDialogProps, Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport, DirectionalIcon, DiscordLogoIcon, Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity, Form, Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, GitHubLogoIcon, HexColorPicker, type HexColorPickerProps, PreviewCard as HoverCard, PreviewCard, PreviewCardPopup as HoverCardContent, PreviewCardPopup, PreviewCardTrigger as HoverCardTrigger, PreviewCardTrigger, INSPECTOR_CONTENT_MIN_WIDTH, INSPECTOR_PANE_DEFAULT_WIDTH, INSPECTOR_PANE_KEYBOARD_PAGE_STEP, INSPECTOR_PANE_KEYBOARD_STEP, INSPECTOR_PANE_MAX_WIDTH, INSPECTOR_PANE_MIN_WIDTH, INSPECTOR_RAIL_WIDTH, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Inspector, InspectorActions, InspectorContent, InspectorDescription, InspectorDock, InspectorEmptyRow, InspectorHeader, InspectorHeaderText, InspectorProperty, InspectorPropertyLabel, InspectorPropertyList, InspectorPropertyValue, InspectorRail, InspectorRailCell, InspectorRailIconButton, InspectorRailTab, InspectorSection, InspectorSectionTitle, InspectorTitle, Label, MenuPreviewLayout, OVERLAY_LAYER_CLASS_NAMES, OutlineItem, OutlineRail, OutlineRailProps, OverlayLayer, PROPERTY_ROW_GRID, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger, PreviewCardPrimitive, PreviewPane, SIDE_RAIL_CONTAINER_CLASS, SIDE_RAIL_ICON_BUTTON_SIZE, SIDE_RAIL_TAB_ICON_SIZE, SIDE_RAIL_WIDTH, ScrollArea, ScrollBar, ScrollToTop, ScrollToTopProps, SecretInput, type SecretInputProps, SegmentedIconToggle, Select, SelectPopup as SelectContent, SelectPopup, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBackdrop, SheetBackdrop as SheetOverlay, SheetClose, SheetPopup as SheetContent, SheetPopup, SheetDescription, SheetFooter, SheetHeader, SheetPanel, SheetPortal, type SheetSide, SheetTitle, SheetTrigger, Skeleton, type SortDirection, SortableHead, StellaMark, StellaWordmarkLatin, TOAST_RIGHT_OFFSET_VAR, TOOLBAR_ROW_HEIGHT, TOOLBAR_ROW_HEIGHT_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsPanel as TabsContent, TabsPanel, TabsList, TabsTab, TabsTab as TabsTrigger, TextSeparator, Textarea, type TextareaProps, type ToastPosition, ToastProvider, Tooltip, TooltipPopup as TooltipContent, TooltipPopup, TooltipCreateHandle, TooltipProvider, TooltipTrigger, UserText, buttonAccessibleDisabledClass, buttonVariants, cn, composeRefs, containedEventHandler, containedHandler, contentDir, getFirstWeekday, getLocaleWeekInfo, getWeekendDays, isStructuredInputType, parsePersistedPaneWidth, resolveDragWidth, resolveInspectorDockWidth, resolveInspectorPaneMaxWidth, resolveInspectorPaneWidth, resolveKeyboardWidth, shouldForceSidebarCollapsed, stellaToast, useComboboxFilter, useContentDir, useDestructiveActionConfirmation, useInspectorPaneWidth, useIsMobile, useViewportWidth };
72
+ export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport, AnchoredToastProvider, Avatar, AvatarFallback, AvatarImage, type BidiDirection, BidiText, type BidiTextProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CalendarCell, type CalendarDateRange, CalendarEntryButton, CalendarEntrySurface, CalendarGrid, CalendarHeaderCell, CalendarHeaderRow, Checkbox, ColorPicker, ColorPickerContent, type ColorPickerContentProps, type ColorPickerProps, type ColorPreset, ColorVariants, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandCollection, CommandDialog, CommandDialogPopup, CommandDialogTrigger, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut, DEFAULT_PRESETS, DatePickerPopover, type DatePickerPopoverProps, DestructiveActionConfirmation, DestructiveConfirmDialog, type DestructiveConfirmDialogProps, Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport, DirectionalIcon, DiscordLogoIcon, Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity, Form, Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, GitHubLogoIcon, HexColorPicker, type HexColorPickerProps, PreviewCard as HoverCard, PreviewCard, PreviewCardPopup as HoverCardContent, PreviewCardPopup, PreviewCardTrigger as HoverCardTrigger, PreviewCardTrigger, INSPECTOR_CONTENT_MIN_WIDTH, INSPECTOR_PANE_DEFAULT_WIDTH, INSPECTOR_PANE_KEYBOARD_PAGE_STEP, INSPECTOR_PANE_KEYBOARD_STEP, INSPECTOR_PANE_MAX_WIDTH, INSPECTOR_PANE_MIN_WIDTH, INSPECTOR_RAIL_WIDTH, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Inspector, InspectorActions, InspectorContent, InspectorDescription, InspectorDock, InspectorEmptyRow, InspectorHeader, InspectorHeaderText, InspectorProperty, InspectorPropertyLabel, InspectorPropertyList, InspectorPropertyValue, InspectorRail, InspectorRailCell, InspectorRailIconButton, InspectorRailTab, InspectorSection, InspectorSectionTitle, InspectorTitle, KANBAN_BOARD_AUTO_SCROLL_SOURCES, type KanbanBuiltInGroup, type KanbanCardFieldSelection, KanbanCardShell, type KanbanCardShellProps, KanbanColumnHeader, type KanbanColumnHeaderProps, type KanbanGroup, type KanbanGroupOption, type KanbanGrouping, type KanbanSchema, Label, MenuPreviewLayout, OVERLAY_LAYER_CLASS_NAMES, OptionColor, OutlineItem, OutlineRail, OutlineRailProps, OverlayLayer, PROPERTY_ROW_GRID, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger, PreviewCardPrimitive, PreviewPane, type RegisterKanbanBoardAutoScrollOptions, type RegisterKanbanCardDragOptions, type ResolveKanbanGroupingParams, ResourceCalendar, type ResourceCalendarColumn, type ResourceCalendarEntry, type ResourceCalendarEntryTone, type ResourceCalendarLaneLayout, type ResourceCalendarLanePlacement, type ResourceCalendarPlacement, type ResourceCalendarResource, SIDE_RAIL_CONTAINER_CLASS, SIDE_RAIL_ICON_BUTTON_SIZE, SIDE_RAIL_TAB_ICON_SIZE, SIDE_RAIL_WIDTH, ScrollArea, ScrollBar, ScrollToTop, ScrollToTopProps, SecretInput, type SecretInputProps, SegmentedIconToggle, Select, SelectPopup as SelectContent, SelectPopup, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBackdrop, SheetBackdrop as SheetOverlay, SheetClose, SheetPopup as SheetContent, SheetPopup, SheetDescription, SheetFooter, SheetHeader, SheetPanel, SheetPortal, type SheetSide, SheetTitle, SheetTrigger, Skeleton, type SortDirection, SortableHead, StellaMark, StellaWordmarkLatin, TOAST_RIGHT_OFFSET_VAR, TOOLBAR_ROW_HEIGHT, TOOLBAR_ROW_HEIGHT_PX, Table, TableBody, TableCaption, TableCell, type TableColumnCapabilities, type TableColumnDescriptor, TableFooter, TableHead, TableHeader, TableRow, type TableSchema, Tabs, TabsPanel as TabsContent, TabsPanel, TabsList, TabsTab, TabsTab as TabsTrigger, TextSeparator, Textarea, type TextareaProps, type ToastPosition, ToastProvider, Tooltip, TooltipPopup as TooltipContent, TooltipPopup, TooltipCreateHandle, TooltipProvider, TooltipTrigger, UserText, assertConsecutiveCalendarDates, buttonAccessibleDisabledClass, buttonVariants, cn, composeRefs, containedEventHandler, containedHandler, contentDir, duplicateColumnIds, emptyColor, findTableColumn, getFirstWeekday, getKanbanGroupingPropertyId, getKanbanGroups, getLocaleWeekInfo, getResourceCalendarPlacement, getWeekendDays, hideableColumnIds, isKanbanGroupingRenderable, isStructuredInputType, layoutResourceCalendarEntries, nextCalendarDate, optionColors, parsePersistedPaneWidth, registerKanbanBoardAutoScroll, registerKanbanCardDrag, resolveDragWidth, resolveInspectorDockWidth, resolveInspectorPaneMaxWidth, resolveInspectorPaneWidth, resolveKanbanGroupOptions, resolveKanbanGrouping, resolveKeyboardWidth, resolveOptionColor, selectKanbanCardFieldIds, selectKanbanRows, shouldForceSidebarCollapsed, sortableColumnIds, stellaToast, tableColumnIds, tableColumnSizing, useComboboxFilter, useContentDir, useDestructiveActionConfirmation, useInspectorPaneWidth, useIsMobile, useViewportWidth, visibleColumnIds };
package/dist/index.js CHANGED
@@ -19,6 +19,9 @@ import { ScrollArea, ScrollBar } from "./components/scroll-area.js";
19
19
  import { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, useComboboxFilter } from "./components/combobox.js";
20
20
  import { Dialog, DialogBackdrop, DialogClose, DialogContent as DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport } from "./components/dialog.js";
21
21
  import { Command, CommandCollection, CommandDialog, CommandDialogPopup, CommandDialogTrigger, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut } from "./components/command.js";
22
+ import { CalendarCell, CalendarEntryButton, CalendarEntrySurface, CalendarGrid, CalendarHeaderCell, CalendarHeaderRow } from "./calendar/primitives.js";
23
+ import { assertConsecutiveCalendarDates, getResourceCalendarPlacement, layoutResourceCalendarEntries, nextCalendarDate } from "./calendar/resource-calendar.logic.js";
24
+ import { ResourceCalendar } from "./calendar/resource-calendar.js";
22
25
  import { getFirstWeekday, getLocaleWeekInfo, getWeekendDays } from "./lib/week.js";
23
26
  import { Popover, PopoverClose, PopoverContent as PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger } from "./components/popover.js";
24
27
  import { DatePickerPopover } from "./components/date-picker-popover.js";
@@ -49,6 +52,7 @@ import { StellaWordmarkLatin } from "./components/stella-wordmark.js";
49
52
  import { SortableHead, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./components/table.js";
50
53
  import { Tabs, TabsContent as TabsPanel, TabsList, TabsTab } from "./components/tabs.js";
51
54
  import { AnchoredToastProvider, TOAST_RIGHT_OFFSET_VAR, ToastProvider, stellaToast } from "./components/toast.js";
55
+ import { duplicateColumnIds, findTableColumn, hideableColumnIds, sortableColumnIds, tableColumnIds, tableColumnSizing, visibleColumnIds } from "./data-table/schema.js";
52
56
  import { useIsMobile } from "./hooks/use-mobile.js";
53
57
  import { useViewportWidth } from "./hooks/use-viewport-width.js";
54
58
  import { PROPERTY_ROW_GRID, SIDE_RAIL_CONTAINER_CLASS, SIDE_RAIL_ICON_BUTTON_SIZE, SIDE_RAIL_TAB_ICON_SIZE, SIDE_RAIL_WIDTH, TOOLBAR_ROW_HEIGHT, TOOLBAR_ROW_HEIGHT_PX } from "./inspector/layout-tokens.js";
@@ -56,4 +60,10 @@ import { Inspector, InspectorActions, InspectorContent, InspectorDescription, In
56
60
  import { InspectorDock } from "./inspector/dock.js";
57
61
  import { INSPECTOR_CONTENT_MIN_WIDTH, INSPECTOR_PANE_DEFAULT_WIDTH, INSPECTOR_PANE_MAX_WIDTH, INSPECTOR_PANE_MIN_WIDTH, INSPECTOR_RAIL_WIDTH, resolveInspectorDockWidth, resolveInspectorPaneMaxWidth, resolveInspectorPaneWidth, shouldForceSidebarCollapsed } from "./inspector/pane-width.js";
58
62
  import { INSPECTOR_PANE_KEYBOARD_PAGE_STEP, INSPECTOR_PANE_KEYBOARD_STEP, parsePersistedPaneWidth, resolveDragWidth, resolveKeyboardWidth, useInspectorPaneWidth } from "./inspector/use-pane-width.js";
59
- export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport, AnchoredToastProvider, Avatar, AvatarFallback, AvatarImage, BidiText, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Checkbox, ColorPicker, ColorPickerContent, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandCollection, CommandDialog, CommandDialogPopup, CommandDialogTrigger, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut, DEFAULT_PRESETS, DatePickerPopover, DestructiveActionConfirmation, DestructiveConfirmDialog, Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport, DirectionalIcon, DiscordLogoIcon, Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity, Form, Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, GitHubLogoIcon, HexColorPicker, PreviewCard as HoverCard, PreviewCard, PreviewCardPopup as HoverCardContent, PreviewCardPopup, PreviewCardTrigger as HoverCardTrigger, PreviewCardTrigger, INSPECTOR_CONTENT_MIN_WIDTH, INSPECTOR_PANE_DEFAULT_WIDTH, INSPECTOR_PANE_KEYBOARD_PAGE_STEP, INSPECTOR_PANE_KEYBOARD_STEP, INSPECTOR_PANE_MAX_WIDTH, INSPECTOR_PANE_MIN_WIDTH, INSPECTOR_RAIL_WIDTH, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Inspector, InspectorActions, InspectorContent, InspectorDescription, InspectorDock, InspectorEmptyRow, InspectorHeader, InspectorHeaderText, InspectorProperty, InspectorPropertyLabel, InspectorPropertyList, InspectorPropertyValue, InspectorRail, InspectorRailCell, InspectorRailIconButton, InspectorRailTab, InspectorSection, InspectorSectionTitle, InspectorTitle, Label, MenuPreviewLayout, OVERLAY_LAYER_CLASS_NAMES, OutlineRail, PROPERTY_ROW_GRID, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger, PreviewCardPrimitive, PreviewPane, SIDE_RAIL_CONTAINER_CLASS, SIDE_RAIL_ICON_BUTTON_SIZE, SIDE_RAIL_TAB_ICON_SIZE, SIDE_RAIL_WIDTH, ScrollArea, ScrollBar, ScrollToTop, SecretInput, SegmentedIconToggle, Select, SelectPopup as SelectContent, SelectPopup, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBackdrop, SheetBackdrop as SheetOverlay, SheetClose, SheetPopup as SheetContent, SheetPopup, SheetDescription, SheetFooter, SheetHeader, SheetPanel, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortableHead, StellaMark, StellaWordmarkLatin, TOAST_RIGHT_OFFSET_VAR, TOOLBAR_ROW_HEIGHT, TOOLBAR_ROW_HEIGHT_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsPanel as TabsContent, TabsPanel, TabsList, TabsTab, TabsTab as TabsTrigger, TextSeparator, Textarea, ToastProvider, Tooltip, TooltipPopup as TooltipContent, TooltipPopup, TooltipCreateHandle, TooltipProvider, TooltipTrigger, UserText, buttonAccessibleDisabledClass, buttonVariants, cn, composeRefs, containedEventHandler, containedHandler, contentDir, getFirstWeekday, getLocaleWeekInfo, getWeekendDays, isStructuredInputType, parsePersistedPaneWidth, resolveDragWidth, resolveInspectorDockWidth, resolveInspectorPaneMaxWidth, resolveInspectorPaneWidth, resolveKeyboardWidth, shouldForceSidebarCollapsed, stellaToast, useComboboxFilter, useContentDir, useDestructiveActionConfirmation, useInspectorPaneWidth, useIsMobile, useViewportWidth };
63
+ import { selectKanbanCardFieldIds } from "./kanban/card-properties.js";
64
+ import { KanbanCardShell } from "./kanban/card-shell.js";
65
+ import { KanbanColumnHeader } from "./kanban/column-header.js";
66
+ import { KANBAN_BOARD_AUTO_SCROLL_SOURCES, registerKanbanBoardAutoScroll, registerKanbanCardDrag } from "./kanban/drag-interactions.js";
67
+ import { getKanbanGroupingPropertyId, getKanbanGroups, isKanbanGroupingRenderable, resolveKanbanGroupOptions, resolveKanbanGrouping, selectKanbanRows } from "./kanban/grouping.js";
68
+ import { emptyColor, optionColors, resolveOptionColor } from "./lib/option-color.js";
69
+ export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport, AnchoredToastProvider, Avatar, AvatarFallback, AvatarImage, BidiText, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CalendarCell, CalendarEntryButton, CalendarEntrySurface, CalendarGrid, CalendarHeaderCell, CalendarHeaderRow, Checkbox, ColorPicker, ColorPickerContent, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandCollection, CommandDialog, CommandDialogPopup, CommandDialogTrigger, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut, DEFAULT_PRESETS, DatePickerPopover, DestructiveActionConfirmation, DestructiveConfirmDialog, Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport, DirectionalIcon, DiscordLogoIcon, Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity, Form, Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, GitHubLogoIcon, HexColorPicker, PreviewCard as HoverCard, PreviewCard, PreviewCardPopup as HoverCardContent, PreviewCardPopup, PreviewCardTrigger as HoverCardTrigger, PreviewCardTrigger, INSPECTOR_CONTENT_MIN_WIDTH, INSPECTOR_PANE_DEFAULT_WIDTH, INSPECTOR_PANE_KEYBOARD_PAGE_STEP, INSPECTOR_PANE_KEYBOARD_STEP, INSPECTOR_PANE_MAX_WIDTH, INSPECTOR_PANE_MIN_WIDTH, INSPECTOR_RAIL_WIDTH, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Inspector, InspectorActions, InspectorContent, InspectorDescription, InspectorDock, InspectorEmptyRow, InspectorHeader, InspectorHeaderText, InspectorProperty, InspectorPropertyLabel, InspectorPropertyList, InspectorPropertyValue, InspectorRail, InspectorRailCell, InspectorRailIconButton, InspectorRailTab, InspectorSection, InspectorSectionTitle, InspectorTitle, KANBAN_BOARD_AUTO_SCROLL_SOURCES, KanbanCardShell, KanbanColumnHeader, Label, MenuPreviewLayout, OVERLAY_LAYER_CLASS_NAMES, OutlineRail, PROPERTY_ROW_GRID, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger, PreviewCardPrimitive, PreviewPane, ResourceCalendar, SIDE_RAIL_CONTAINER_CLASS, SIDE_RAIL_ICON_BUTTON_SIZE, SIDE_RAIL_TAB_ICON_SIZE, SIDE_RAIL_WIDTH, ScrollArea, ScrollBar, ScrollToTop, SecretInput, SegmentedIconToggle, Select, SelectPopup as SelectContent, SelectPopup, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBackdrop, SheetBackdrop as SheetOverlay, SheetClose, SheetPopup as SheetContent, SheetPopup, SheetDescription, SheetFooter, SheetHeader, SheetPanel, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortableHead, StellaMark, StellaWordmarkLatin, TOAST_RIGHT_OFFSET_VAR, TOOLBAR_ROW_HEIGHT, TOOLBAR_ROW_HEIGHT_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsPanel as TabsContent, TabsPanel, TabsList, TabsTab, TabsTab as TabsTrigger, TextSeparator, Textarea, ToastProvider, Tooltip, TooltipPopup as TooltipContent, TooltipPopup, TooltipCreateHandle, TooltipProvider, TooltipTrigger, UserText, assertConsecutiveCalendarDates, buttonAccessibleDisabledClass, buttonVariants, cn, composeRefs, containedEventHandler, containedHandler, contentDir, duplicateColumnIds, emptyColor, findTableColumn, getFirstWeekday, getKanbanGroupingPropertyId, getKanbanGroups, getLocaleWeekInfo, getResourceCalendarPlacement, getWeekendDays, hideableColumnIds, isKanbanGroupingRenderable, isStructuredInputType, layoutResourceCalendarEntries, nextCalendarDate, optionColors, parsePersistedPaneWidth, registerKanbanBoardAutoScroll, registerKanbanCardDrag, resolveDragWidth, resolveInspectorDockWidth, resolveInspectorPaneMaxWidth, resolveInspectorPaneWidth, resolveKanbanGroupOptions, resolveKanbanGrouping, resolveKeyboardWidth, resolveOptionColor, selectKanbanCardFieldIds, selectKanbanRows, shouldForceSidebarCollapsed, sortableColumnIds, stellaToast, tableColumnIds, tableColumnSizing, useComboboxFilter, useContentDir, useDestructiveActionConfirmation, useInspectorPaneWidth, useIsMobile, useViewportWidth, visibleColumnIds };
@@ -0,0 +1,27 @@
1
+ //#region src/kanban/card-properties.d.ts
2
+ /**
3
+ * Which properties a kanban card renders as values.
4
+ *
5
+ * A card draws some fields itself — a title, a badge row, a footer — and the
6
+ * rest as generic property values. The split used to be a chain of literal id
7
+ * comparisons inside the card component, which meant the card knew every id the
8
+ * board could hold. Here the caller names its reserved ids once and vetoes the
9
+ * rest through a predicate.
10
+ */
11
+ type KanbanCardFieldSelection = {
12
+ /** Field ids the card renders itself, so they are not repeated as values. */
13
+ reservedFieldIds: readonly string[];
14
+ /**
15
+ * Vetoes a field the board could render but this card should not (a
16
+ * system-computed property whose value the column already conveys, say).
17
+ * Omit to render every unreserved field.
18
+ */
19
+ isRenderable?: ((fieldId: string) => boolean) | undefined;
20
+ };
21
+ /**
22
+ * The visible field ids a card renders as property values, in view order and
23
+ * without duplicates.
24
+ */
25
+ declare const selectKanbanCardFieldIds: (visibleFieldIds: readonly string[], { reservedFieldIds, isRenderable }: KanbanCardFieldSelection) => string[];
26
+ //#endregion
27
+ export { KanbanCardFieldSelection, selectKanbanCardFieldIds };
@@ -0,0 +1,19 @@
1
+ //#region src/kanban/card-properties.ts
2
+ /**
3
+ * The visible field ids a card renders as property values, in view order and
4
+ * without duplicates.
5
+ */
6
+ const selectKanbanCardFieldIds = (visibleFieldIds, { reservedFieldIds, isRenderable }) => {
7
+ const reserved = new Set(reservedFieldIds);
8
+ const seen = /* @__PURE__ */ new Set();
9
+ const selected = [];
10
+ for (const fieldId of visibleFieldIds) {
11
+ if (reserved.has(fieldId) || seen.has(fieldId)) continue;
12
+ seen.add(fieldId);
13
+ if (isRenderable && !isRenderable(fieldId)) continue;
14
+ selected.push(fieldId);
15
+ }
16
+ return selected;
17
+ };
18
+ //#endregion
19
+ export { selectKanbanCardFieldIds };
@@ -0,0 +1,32 @@
1
+ import { ReactNode, RefObject } from "react";
2
+ //#region src/kanban/card-shell.d.ts
3
+ type KanbanCardShellProps = {
4
+ children: ReactNode;
5
+ /** Overlay slot pinned to the top-end corner (row actions). */
6
+ actions?: ReactNode;
7
+ /** Marks the card whose detail is currently open. */
8
+ active?: boolean | undefined;
9
+ /**
10
+ * Opens the card. Omit for a card with nothing to open: the shell then
11
+ * renders a plain region instead of a button, so a card that does nothing
12
+ * never lands in the tab order.
13
+ */
14
+ onOpen?: (() => void) | undefined;
15
+ /** The card body, for callers that measure or flash it. */
16
+ bodyRef?: RefObject<HTMLDivElement | null> | undefined;
17
+ /** The drag source the shell wraps the card in. */
18
+ dragRef?: RefObject<HTMLDivElement | null> | undefined;
19
+ className?: string | undefined;
20
+ };
21
+ /**
22
+ * The card chrome: border, hover lift, active ring, drag wrapper, and the
23
+ * keyboard contract for a card that opens something.
24
+ *
25
+ * The shell carries no idea of what a card holds. Every board rendered one of
26
+ * three near-identical copies of this markup, differing only in whether the
27
+ * card opened anything, which is why opening is a prop rather than a branch at
28
+ * each call site.
29
+ */
30
+ declare const KanbanCardShell: ({ children, actions, active, onOpen, bodyRef, dragRef, className }: KanbanCardShellProps) => import("react").JSX.Element;
31
+ //#endregion
32
+ export { KanbanCardShell, KanbanCardShellProps };
@@ -0,0 +1,46 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { containedHandler } from "../hooks/use-contained-handler.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/kanban/card-shell.tsx
5
+ /**
6
+ * The card chrome: border, hover lift, active ring, drag wrapper, and the
7
+ * keyboard contract for a card that opens something.
8
+ *
9
+ * The shell carries no idea of what a card holds. Every board rendered one of
10
+ * three near-identical copies of this markup, differing only in whether the
11
+ * card opened anything, which is why opening is a prop rather than a branch at
12
+ * each call site.
13
+ */
14
+ const KanbanCardShell = ({ children, actions, active, onOpen, bodyRef, dragRef, className }) => {
15
+ const body = /* @__PURE__ */ jsxs(Fragment, { children: [children, actions] });
16
+ if (!onOpen) return /* @__PURE__ */ jsx("div", {
17
+ className: "group/card",
18
+ ref: dragRef,
19
+ children: /* @__PURE__ */ jsx("div", {
20
+ className: cn(CARD_CLASS, active && ACTIVE_CLASS, className),
21
+ ref: bodyRef,
22
+ children: body
23
+ })
24
+ });
25
+ return /* @__PURE__ */ jsx("div", {
26
+ className: "group/card",
27
+ ref: dragRef,
28
+ children: /* @__PURE__ */ jsx("div", {
29
+ className: cn(CARD_CLASS, "cursor-pointer transition-shadow hover:shadow-md", active && ACTIVE_CLASS, className),
30
+ onClick: containedHandler(bodyRef, onOpen),
31
+ onKeyDown: (event) => {
32
+ if (event.key !== "Enter" && event.key !== " ") return;
33
+ event.preventDefault();
34
+ onOpen();
35
+ },
36
+ ref: bodyRef,
37
+ role: "button",
38
+ tabIndex: 0,
39
+ children: body
40
+ })
41
+ });
42
+ };
43
+ const CARD_CLASS = "bg-card relative block w-full rounded-lg border p-3 text-start shadow-xs";
44
+ const ACTIVE_CLASS = "ring-primary/30 ring-2";
45
+ //#endregion
46
+ export { KanbanCardShell };
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/kanban/column-header.d.ts
3
+ type KanbanColumnHeaderProps = {
4
+ /** Colour swatch, or the control that changes it. */
5
+ swatch?: ReactNode;
6
+ /** The column name, or the editor that has taken its place. */
7
+ title: ReactNode;
8
+ /** Short text after the name, such as the card count the caller formatted. */
9
+ meta?: ReactNode;
10
+ /** Column calculation, rendered after the count. */
11
+ calculation?: ReactNode;
12
+ /** Drag affordance, revealed on hover over the column. */
13
+ dragHandle?: ReactNode;
14
+ /** Column menu. */
15
+ actions?: ReactNode;
16
+ };
17
+ /**
18
+ * The column header row: one rhythm for the swatch, the name, the count, the
19
+ * calculation, and the column's controls, so every board's header lines up.
20
+ */
21
+ declare const KanbanColumnHeader: ({ swatch, title, meta, calculation, dragHandle, actions }: KanbanColumnHeaderProps) => import("react").JSX.Element;
22
+ //#endregion
23
+ export { KanbanColumnHeader, KanbanColumnHeaderProps };
@@ -0,0 +1,24 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ //#region src/kanban/column-header.tsx
3
+ /**
4
+ * The column header row: one rhythm for the swatch, the name, the count, the
5
+ * calculation, and the column's controls, so every board's header lines up.
6
+ */
7
+ const KanbanColumnHeader = ({ swatch, title, meta, calculation, dragHandle, actions }) => /* @__PURE__ */ jsxs("div", {
8
+ className: "flex items-center gap-2 px-3 py-2",
9
+ children: [
10
+ swatch,
11
+ /* @__PURE__ */ jsxs("span", {
12
+ className: "flex min-w-0 flex-1 items-center gap-1.5 truncate",
13
+ children: [title, meta !== void 0 && /* @__PURE__ */ jsx("span", {
14
+ className: "text-muted-foreground text-xs",
15
+ children: meta
16
+ })]
17
+ }),
18
+ calculation,
19
+ dragHandle,
20
+ actions
21
+ ]
22
+ });
23
+ //#endregion
24
+ export { KanbanColumnHeader };
@@ -0,0 +1,35 @@
1
+ import { draggable } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
2
+ //#region src/kanban/drag-interactions.d.ts
3
+ type AtlaskitDraggableOptions = Parameters<typeof draggable>[0];
4
+ type RegisterKanbanCardDragOptions = {
5
+ /** The drag wrapper rendered by `KanbanCardShell`. */
6
+ element: AtlaskitDraggableOptions["element"];
7
+ /** Domain data read by the board's drop monitor. */
8
+ getInitialData: NonNullable<AtlaskitDraggableOptions["getInitialData"]>;
9
+ /** Omit when every rendered card may move. */
10
+ canDrag?: AtlaskitDraggableOptions["canDrag"];
11
+ onDragStart?: AtlaskitDraggableOptions["onDragStart"];
12
+ onDrop?: AtlaskitDraggableOptions["onDrop"];
13
+ };
14
+ /**
15
+ * Register the standard kanban card drag source and native preview.
16
+ *
17
+ * Movement remains with the caller: the package does not inspect the drag data
18
+ * or persist a drop. It owns the interaction every card shares, including a
19
+ * pointer-centred preview cloned from the styled card inside the shell.
20
+ */
21
+ declare const registerKanbanCardDrag: ({ element, getInitialData, canDrag, onDragStart, onDrop }: RegisterKanbanCardDragOptions) => (() => void);
22
+ declare const KANBAN_BOARD_AUTO_SCROLL_SOURCES: {
23
+ readonly elements: "elements";
24
+ readonly elementsAndExternal: "elements-and-external";
25
+ };
26
+ type KanbanBoardAutoScrollSource = (typeof KANBAN_BOARD_AUTO_SCROLL_SOURCES)[keyof typeof KANBAN_BOARD_AUTO_SCROLL_SOURCES];
27
+ type RegisterKanbanBoardAutoScrollOptions = {
28
+ element: HTMLElement;
29
+ /** External sources include files dragged in from outside the page. */
30
+ sources: KanbanBoardAutoScrollSource;
31
+ };
32
+ /** Register horizontal auto-scroll at the board's overflow boundary. */
33
+ declare const registerKanbanBoardAutoScroll: ({ element, sources }: RegisterKanbanBoardAutoScrollOptions) => (() => void);
34
+ //#endregion
35
+ export { KANBAN_BOARD_AUTO_SCROLL_SOURCES, RegisterKanbanBoardAutoScrollOptions, RegisterKanbanCardDragOptions, registerKanbanBoardAutoScroll, registerKanbanCardDrag };
@@ -0,0 +1,53 @@
1
+ import { autoScrollForElements } from "@atlaskit/pragmatic-drag-and-drop-auto-scroll/element";
2
+ import { autoScrollForExternal } from "@atlaskit/pragmatic-drag-and-drop-auto-scroll/external";
3
+ import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
4
+ import { draggable } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
5
+ import { centerUnderPointer } from "@atlaskit/pragmatic-drag-and-drop/element/center-under-pointer";
6
+ import { setCustomNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview";
7
+ //#region src/kanban/drag-interactions.ts
8
+ /**
9
+ * Register the standard kanban card drag source and native preview.
10
+ *
11
+ * Movement remains with the caller: the package does not inspect the drag data
12
+ * or persist a drop. It owns the interaction every card shares, including a
13
+ * pointer-centred preview cloned from the styled card inside the shell.
14
+ */
15
+ const registerKanbanCardDrag = ({ element, getInitialData, canDrag, onDragStart, onDrop }) => draggable({
16
+ element,
17
+ getInitialData,
18
+ ...canDrag === void 0 ? {} : { canDrag },
19
+ ...onDragStart === void 0 ? {} : { onDragStart },
20
+ ...onDrop === void 0 ? {} : { onDrop },
21
+ onGenerateDragPreview: ({ nativeSetDragImage }) => {
22
+ setCustomNativeDragPreview({
23
+ nativeSetDragImage,
24
+ getOffset: centerUnderPointer,
25
+ render: ({ container }) => {
26
+ const card = element.firstElementChild;
27
+ if (!(card instanceof HTMLElement)) return;
28
+ const clone = card.cloneNode(true);
29
+ if (!(clone instanceof HTMLElement)) return;
30
+ clone.style.width = `${card.getBoundingClientRect().width}px`;
31
+ container.append(clone);
32
+ }
33
+ });
34
+ }
35
+ });
36
+ const KANBAN_BOARD_AUTO_SCROLL_SOURCES = {
37
+ elements: "elements",
38
+ elementsAndExternal: "elements-and-external"
39
+ };
40
+ /** Register horizontal auto-scroll at the board's overflow boundary. */
41
+ const registerKanbanBoardAutoScroll = ({ element, sources }) => {
42
+ const elementCleanup = autoScrollForElements({
43
+ element,
44
+ getAllowedAxis: () => "horizontal"
45
+ });
46
+ if (sources === KANBAN_BOARD_AUTO_SCROLL_SOURCES.elements) return elementCleanup;
47
+ return combine(elementCleanup, autoScrollForExternal({
48
+ element,
49
+ getAllowedAxis: () => "horizontal"
50
+ }));
51
+ };
52
+ //#endregion
53
+ export { KANBAN_BOARD_AUTO_SCROLL_SOURCES, registerKanbanBoardAutoScroll, registerKanbanCardDrag };
@@ -0,0 +1,84 @@
1
+ import { OptionColor } from "../lib/option-color.js";
2
+ //#region src/kanban/grouping.d.ts
3
+ /** One column, before the uncategorized bucket is appended. */
4
+ type KanbanGroupOption = {
5
+ value: string;
6
+ label: string;
7
+ color?: string | undefined;
8
+ colorBg?: string | undefined;
9
+ optionColor?: OptionColor | undefined;
10
+ };
11
+ /** A column, including the uncategorized bucket (`value: null`). */
12
+ type KanbanGroup = {
13
+ value: string | null;
14
+ label: string;
15
+ color?: string | undefined;
16
+ colorBg?: string | undefined;
17
+ optionColor?: OptionColor | undefined;
18
+ };
19
+ /**
20
+ * A column source that is not a schema property, addressed by a reserved id.
21
+ *
22
+ * The board's columns are the caller's `options`, in the caller's order, so a
23
+ * built-in grouping is a data declaration rather than a branch this module has
24
+ * to know about.
25
+ */
26
+ type KanbanBuiltInGroup<TRow> = {
27
+ /** Reserved group id, distinct from any property id. */
28
+ id: string;
29
+ /** Ordered columns, without the uncategorized bucket. */
30
+ options: readonly KanbanGroupOption[];
31
+ /**
32
+ * Narrows the board to the rows this grouping can place. Omit when every row
33
+ * belongs on the board.
34
+ */
35
+ selectRows?: ((rows: readonly TRow[]) => TRow[]) | undefined;
36
+ };
37
+ /**
38
+ * Everything the grouping needs to know about a board.
39
+ *
40
+ * `getPropertyOptions` returns `null` for a property that cannot carry columns,
41
+ * which keeps the decision — and the property model it depends on — with the
42
+ * caller.
43
+ */
44
+ type KanbanSchema<TRow, TProperty> = {
45
+ builtInGroups: readonly KanbanBuiltInGroup<TRow>[];
46
+ properties: readonly TProperty[];
47
+ getPropertyId: (property: TProperty) => string;
48
+ getPropertyOptions: (property: TProperty) => readonly KanbanGroupOption[] | null;
49
+ };
50
+ type KanbanGrouping<TRow, TProperty> = {
51
+ type: "none";
52
+ } | {
53
+ type: "built-in";
54
+ propertyId: string;
55
+ group: KanbanBuiltInGroup<TRow>;
56
+ } | {
57
+ type: "property";
58
+ propertyId: string;
59
+ property: TProperty;
60
+ options: readonly KanbanGroupOption[];
61
+ };
62
+ type ResolveKanbanGroupingParams<TRow, TProperty> = {
63
+ /** The group-by id the view carries; empty means no grouping. */
64
+ groupBy: string;
65
+ schema: KanbanSchema<TRow, TProperty>;
66
+ };
67
+ /** Resolve a stored group-by id against a schema. */
68
+ declare const resolveKanbanGrouping: <TRow, TProperty>({ groupBy, schema }: ResolveKanbanGroupingParams<TRow, TProperty>) => KanbanGrouping<TRow, TProperty>;
69
+ declare const getKanbanGroupingPropertyId: <TRow, TProperty>(grouping: KanbanGrouping<TRow, TProperty>) => string | null;
70
+ /**
71
+ * A grouping with no columns is not a board. A built-in grouping declares its
72
+ * columns up front, so an empty declaration is the signal that the board cannot
73
+ * be drawn; a property grouping always draws, even when the property has no
74
+ * options yet, because rows still land in the uncategorized bucket.
75
+ */
76
+ declare const isKanbanGroupingRenderable: <TRow, TProperty>(grouping: KanbanGrouping<TRow, TProperty>) => boolean;
77
+ /** The rows a grouping can place on the board, in their incoming order. */
78
+ declare const selectKanbanRows: <TRow, TProperty>(rows: readonly TRow[], grouping: KanbanGrouping<TRow, TProperty>) => TRow[];
79
+ /** The static column options for a grouping, excluding uncategorized. */
80
+ declare const resolveKanbanGroupOptions: <TRow, TProperty>(grouping: KanbanGrouping<TRow, TProperty>) => readonly KanbanGroupOption[];
81
+ /** Append the uncategorized bucket (null value) after the options. */
82
+ declare const getKanbanGroups: (options: readonly KanbanGroupOption[], uncategorizedLabel: string) => KanbanGroup[];
83
+ //#endregion
84
+ export { KanbanBuiltInGroup, KanbanGroup, KanbanGroupOption, KanbanGrouping, KanbanSchema, ResolveKanbanGroupingParams, getKanbanGroupingPropertyId, getKanbanGroups, isKanbanGroupingRenderable, resolveKanbanGroupOptions, resolveKanbanGrouping, selectKanbanRows };
@@ -0,0 +1,76 @@
1
+ //#region src/kanban/grouping.ts
2
+ /** Resolve a stored group-by id against a schema. */
3
+ const resolveKanbanGrouping = ({ groupBy, schema }) => {
4
+ if (groupBy === "") return { type: "none" };
5
+ const builtIn = schema.builtInGroups.find((group) => group.id === groupBy);
6
+ if (builtIn !== void 0) return {
7
+ type: "built-in",
8
+ propertyId: groupBy,
9
+ group: builtIn
10
+ };
11
+ const property = schema.properties.find((candidate) => schema.getPropertyId(candidate) === groupBy);
12
+ if (property === void 0) return { type: "none" };
13
+ return {
14
+ type: "property",
15
+ propertyId: groupBy,
16
+ property,
17
+ options: schema.getPropertyOptions(property) ?? []
18
+ };
19
+ };
20
+ const getKanbanGroupingPropertyId = (grouping) => {
21
+ switch (grouping.type) {
22
+ case "none": return null;
23
+ case "built-in":
24
+ case "property": return grouping.propertyId;
25
+ default: return grouping;
26
+ }
27
+ };
28
+ /**
29
+ * A grouping with no columns is not a board. A built-in grouping declares its
30
+ * columns up front, so an empty declaration is the signal that the board cannot
31
+ * be drawn; a property grouping always draws, even when the property has no
32
+ * options yet, because rows still land in the uncategorized bucket.
33
+ */
34
+ const isKanbanGroupingRenderable = (grouping) => {
35
+ switch (grouping.type) {
36
+ case "none": return false;
37
+ case "built-in": return grouping.group.options.length > 0;
38
+ case "property": return true;
39
+ default: return grouping;
40
+ }
41
+ };
42
+ /** The rows a grouping can place on the board, in their incoming order. */
43
+ const selectKanbanRows = (rows, grouping) => {
44
+ switch (grouping.type) {
45
+ case "none": return [];
46
+ case "built-in": return grouping.group.selectRows ? grouping.group.selectRows(rows) : [...rows];
47
+ case "property": return [...rows];
48
+ default: return grouping;
49
+ }
50
+ };
51
+ /** The static column options for a grouping, excluding uncategorized. */
52
+ const resolveKanbanGroupOptions = (grouping) => {
53
+ switch (grouping.type) {
54
+ case "none": return [];
55
+ case "built-in": return grouping.group.options;
56
+ case "property": return grouping.options;
57
+ default: return grouping;
58
+ }
59
+ };
60
+ /** Append the uncategorized bucket (null value) after the options. */
61
+ const getKanbanGroups = (options, uncategorizedLabel) => {
62
+ const result = options.map((option) => ({
63
+ value: option.value,
64
+ label: option.label,
65
+ color: option.color,
66
+ colorBg: option.colorBg,
67
+ optionColor: option.optionColor
68
+ }));
69
+ result.push({
70
+ value: null,
71
+ label: uncategorizedLabel
72
+ });
73
+ return result;
74
+ };
75
+ //#endregion
76
+ export { getKanbanGroupingPropertyId, getKanbanGroups, isKanbanGroupingRenderable, resolveKanbanGroupOptions, resolveKanbanGrouping, selectKanbanRows };
@@ -0,0 +1,6 @@
1
+ import { KanbanCardFieldSelection, selectKanbanCardFieldIds } from "./card-properties.js";
2
+ import { KanbanCardShell, KanbanCardShellProps } from "./card-shell.js";
3
+ import { KanbanColumnHeader, KanbanColumnHeaderProps } from "./column-header.js";
4
+ import { KANBAN_BOARD_AUTO_SCROLL_SOURCES, RegisterKanbanBoardAutoScrollOptions, RegisterKanbanCardDragOptions, registerKanbanBoardAutoScroll, registerKanbanCardDrag } from "./drag-interactions.js";
5
+ import { KanbanBuiltInGroup, KanbanGroup, KanbanGroupOption, KanbanGrouping, KanbanSchema, ResolveKanbanGroupingParams, getKanbanGroupingPropertyId, getKanbanGroups, isKanbanGroupingRenderable, resolveKanbanGroupOptions, resolveKanbanGrouping, selectKanbanRows } from "./grouping.js";
6
+ export { KANBAN_BOARD_AUTO_SCROLL_SOURCES, type KanbanBuiltInGroup, type KanbanCardFieldSelection, KanbanCardShell, type KanbanCardShellProps, KanbanColumnHeader, type KanbanColumnHeaderProps, type KanbanGroup, type KanbanGroupOption, type KanbanGrouping, type KanbanSchema, type RegisterKanbanBoardAutoScrollOptions, type RegisterKanbanCardDragOptions, type ResolveKanbanGroupingParams, getKanbanGroupingPropertyId, getKanbanGroups, isKanbanGroupingRenderable, registerKanbanBoardAutoScroll, registerKanbanCardDrag, resolveKanbanGroupOptions, resolveKanbanGrouping, selectKanbanCardFieldIds, selectKanbanRows };
@@ -0,0 +1,6 @@
1
+ import { selectKanbanCardFieldIds } from "./card-properties.js";
2
+ import { KanbanCardShell } from "./card-shell.js";
3
+ import { KanbanColumnHeader } from "./column-header.js";
4
+ import { KANBAN_BOARD_AUTO_SCROLL_SOURCES, registerKanbanBoardAutoScroll, registerKanbanCardDrag } from "./drag-interactions.js";
5
+ import { getKanbanGroupingPropertyId, getKanbanGroups, isKanbanGroupingRenderable, resolveKanbanGroupOptions, resolveKanbanGrouping, selectKanbanRows } from "./grouping.js";
6
+ export { KANBAN_BOARD_AUTO_SCROLL_SOURCES, KanbanCardShell, KanbanColumnHeader, getKanbanGroupingPropertyId, getKanbanGroups, isKanbanGroupingRenderable, registerKanbanBoardAutoScroll, registerKanbanCardDrag, resolveKanbanGroupOptions, resolveKanbanGrouping, selectKanbanCardFieldIds, selectKanbanRows };
@@ -0,0 +1,28 @@
1
+ //#region src/lib/option-color.d.ts
2
+ /**
3
+ * The kit's colour token for user-chosen option colours.
4
+ *
5
+ * A token is either one of the sixteen named presets, which resolve to the
6
+ * theme's `--option-*` custom properties, or a six-character hex string, which
7
+ * resolves to a `color-mix` against the current background and foreground. The
8
+ * indirection is what keeps a stored colour theme-aware: nothing persists a
9
+ * literal colour the palette cannot re-tint.
10
+ *
11
+ * This lives in the kit rather than beside a data model because the resolver is
12
+ * pure presentation: it maps a token to CSS, and knows nothing about what the
13
+ * token was chosen for.
14
+ */
15
+ /** Named preset or arbitrary 6-character hex colour (e.g. "FF0000"). */
16
+ type OptionColor = "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "gray" | (string & Record<never, never>);
17
+ type ColorVariants = {
18
+ background: string;
19
+ foreground: string;
20
+ color: string;
21
+ };
22
+ declare const emptyColor: ColorVariants;
23
+ /** Resolve any OptionColor (named or hex) to CSS color variants. */
24
+ declare const resolveOptionColor: (color: OptionColor) => ColorVariants;
25
+ /** The 16 named preset color keys. */
26
+ declare const optionColors: readonly OptionColor[];
27
+ //#endregion
28
+ export { ColorVariants, OptionColor, emptyColor, optionColors, resolveOptionColor };