@hachej/boring-ui-kit 0.1.62 → 0.1.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -446,4 +446,13 @@ declare function ChoiceItemBody({ className, ...props }: React.ComponentProps<'s
446
446
  declare function ChoiceItemTitle({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
447
447
  declare function ChoiceItemDescription({ className, ...props }: React.ComponentProps<'small'>): react_jsx_runtime.JSX.Element;
448
448
 
449
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, type AvatarFallbackProps, type AvatarProps, Badge, type BadgeProps, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, ChipButton, type ChipButtonProps, type ChipProps, ChipRemove, type ChipRemoveProps, ChoiceGroup, ChoiceGroupLegend, ChoiceItem, ChoiceItemBody, ChoiceItemDescription, ChoiceItemTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DetailLine, type DetailLineProps, DetailList, type DetailListProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Disclosure, DisclosureChevron, DisclosureContent, DisclosureTrigger, type DisclosureTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, Field, FieldDescription, FieldError, FieldLabel, FloatingPanel, FloatingPanelBody, type FloatingPanelBodyProps, FloatingPanelHeader, type FloatingPanelHeaderProps, type FloatingPanelProps, HoverCard, HoverCardContent, HoverCardTrigger, IconButton, type IconButtonProps, InitialsAvatar, type InitialsAvatarProps, InlineCode, type InlineCodeProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, type InputProps, Kbd, type KbdProps, Label, List, type ListProps, ListRow, ListRowActions, type ListRowActionsProps, ListRowDescription, type ListRowDescriptionProps, ListRowMain, type ListRowMainProps, ListRowMeta, type ListRowMetaProps, type ListRowProps, ListRowTitle, type ListRowTitleProps, LoadingState, type LoadingStateProps, Notice, type NoticeProps, type NoticeTone, Pane, PaneBody, PaneDescription, PaneFooter, PaneHeader, PaneTitle, PaneToolbar, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Radio, type RadioProps, ResizeHandle, type ResizeHandleOrientation, type ResizeHandleProps, ScrollArea, ScrollBar, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, SettingsActionRow, type SettingsActionRowProps, SettingsNav, type SettingsNavItem, type SettingsNavProps, SettingsPageHeader, type SettingsPageHeaderProps, SettingsPanel, type SettingsPanelProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type ToastApi$1 as ToastApi, type ToastApi as ToastEventApi, type ToastInput as ToastEventInput, type ToastVariant as ToastEventVariant, type ToastInput$1 as ToastInput, type ToastRecord, type ToastVariant$1 as ToastVariant, Toaster, type ToasterProps, Toolbar, ToolbarButton, type ToolbarButtonProps, ToolbarGroup, type ToolbarGroupProps, type ToolbarProps, ToolbarSeparator, type ToolbarSeparatorProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, clearToasts, cn, dismissToast, getActiveToasts, subscribeToasts, tabsListVariants, toast, useToast };
449
+ interface BoringPerspectiveThemeOptions {
450
+ /** Hide Perspective/d3fc axis titles when surrounding UI already labels the chart. */
451
+ hideAxisLabels?: boolean;
452
+ /** Use app sans font for d3fc axis/tick labels instead of Perspective's mono token. */
453
+ chartTicksUseSans?: boolean;
454
+ }
455
+ declare function boringPerspectiveThemeName(root?: Pick<Element, "classList"> | null | undefined): "Pro Light" | "Pro Dark";
456
+ declare function applyBoringPerspectiveTheme(element: HTMLElement, options?: BoringPerspectiveThemeOptions): void;
457
+
458
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, type AvatarFallbackProps, type AvatarProps, Badge, type BadgeProps, type BoringPerspectiveThemeOptions, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, ChipButton, type ChipButtonProps, type ChipProps, ChipRemove, type ChipRemoveProps, ChoiceGroup, ChoiceGroupLegend, ChoiceItem, ChoiceItemBody, ChoiceItemDescription, ChoiceItemTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DetailLine, type DetailLineProps, DetailList, type DetailListProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Disclosure, DisclosureChevron, DisclosureContent, DisclosureTrigger, type DisclosureTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, Field, FieldDescription, FieldError, FieldLabel, FloatingPanel, FloatingPanelBody, type FloatingPanelBodyProps, FloatingPanelHeader, type FloatingPanelHeaderProps, type FloatingPanelProps, HoverCard, HoverCardContent, HoverCardTrigger, IconButton, type IconButtonProps, InitialsAvatar, type InitialsAvatarProps, InlineCode, type InlineCodeProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, type InputProps, Kbd, type KbdProps, Label, List, type ListProps, ListRow, ListRowActions, type ListRowActionsProps, ListRowDescription, type ListRowDescriptionProps, ListRowMain, type ListRowMainProps, ListRowMeta, type ListRowMetaProps, type ListRowProps, ListRowTitle, type ListRowTitleProps, LoadingState, type LoadingStateProps, Notice, type NoticeProps, type NoticeTone, Pane, PaneBody, PaneDescription, PaneFooter, PaneHeader, PaneTitle, PaneToolbar, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Radio, type RadioProps, ResizeHandle, type ResizeHandleOrientation, type ResizeHandleProps, ScrollArea, ScrollBar, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, SettingsActionRow, type SettingsActionRowProps, SettingsNav, type SettingsNavItem, type SettingsNavProps, SettingsPageHeader, type SettingsPageHeaderProps, SettingsPanel, type SettingsPanelProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type ToastApi$1 as ToastApi, type ToastApi as ToastEventApi, type ToastInput as ToastEventInput, type ToastVariant as ToastEventVariant, type ToastInput$1 as ToastInput, type ToastRecord, type ToastVariant$1 as ToastVariant, Toaster, type ToasterProps, Toolbar, ToolbarButton, type ToolbarButtonProps, ToolbarGroup, type ToolbarGroupProps, type ToolbarProps, ToolbarSeparator, type ToolbarSeparatorProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, applyBoringPerspectiveTheme, badgeVariants, boringPerspectiveThemeName, buttonGroupVariants, buttonVariants, clearToasts, cn, dismissToast, getActiveToasts, subscribeToasts, tabsListVariants, toast, useToast };
package/dist/index.js CHANGED
@@ -2375,6 +2375,62 @@ function ChoiceItemTitle({ className, ...props }) {
2375
2375
  function ChoiceItemDescription({ className, ...props }) {
2376
2376
  return /* @__PURE__ */ jsx46("small", { "data-slot": "choice-item-description", className: cn("text-sm leading-5 text-muted-foreground", className), ...props });
2377
2377
  }
2378
+
2379
+ // src/perspective-theme.ts
2380
+ function boringPerspectiveThemeName(root = globalThis.document?.documentElement) {
2381
+ return root?.classList.contains("dark") ? "Pro Dark" : "Pro Light";
2382
+ }
2383
+ function resolveCssColor(value, fallback) {
2384
+ if (typeof document === "undefined") return fallback;
2385
+ const probe = document.createElement("span");
2386
+ probe.style.color = value;
2387
+ probe.style.position = "fixed";
2388
+ probe.style.pointerEvents = "none";
2389
+ probe.style.opacity = "0";
2390
+ document.body.appendChild(probe);
2391
+ const computed = getComputedStyle(probe).color || fallback;
2392
+ probe.remove();
2393
+ const canvas = document.createElement("canvas");
2394
+ const context = canvas.getContext("2d");
2395
+ if (!context) return computed || fallback;
2396
+ context.fillStyle = computed;
2397
+ const normalized = context.fillStyle || computed || fallback;
2398
+ return /^oklch\(/i.test(normalized) || /^var\(/i.test(normalized) ? fallback : normalized;
2399
+ }
2400
+ function applyBoringPerspectiveTheme(element, options = {}) {
2401
+ const primaryColor = resolveCssColor("var(--boring-primary, var(--primary))", "#2f2d2a");
2402
+ const fontSans = "var(--boring-font-sans, var(--font-sans, ui-sans-serif, system-ui, sans-serif))";
2403
+ element.style.background = "var(--boring-card, var(--card))";
2404
+ element.style.color = "var(--boring-card-foreground, var(--card-foreground))";
2405
+ element.style.fontFamily = fontSans;
2406
+ element.style.setProperty("--psp--background-color", "var(--boring-card, var(--card))");
2407
+ element.style.setProperty("--psp--color", "var(--boring-foreground, var(--foreground))");
2408
+ element.style.setProperty("--psp-active--color", "var(--boring-primary, var(--primary))");
2409
+ element.style.setProperty("--psp-inactive--color", "var(--boring-muted-foreground, var(--muted-foreground))");
2410
+ element.style.setProperty("--psp-inactive--border-color", "var(--boring-border, var(--border))");
2411
+ element.style.setProperty("--psp-font-family", fontSans);
2412
+ element.style.setProperty(
2413
+ "--psp-interface-monospace--font-family",
2414
+ options.chartTicksUseSans === false ? "var(--boring-font-mono, var(--font-mono, ui-monospace, monospace))" : fontSans
2415
+ );
2416
+ element.style.setProperty("--psp-datagrid--row--height", "28px");
2417
+ element.style.setProperty("--psp-d3fc--axis-ticks--color", "var(--boring-muted-foreground, var(--muted-foreground))");
2418
+ element.style.setProperty("--psp-d3fc--axis-lines--color", "var(--boring-border, var(--border))");
2419
+ element.style.setProperty("--psp-d3fc--series--color", primaryColor);
2420
+ for (let index = 1; index <= 12; index += 1) {
2421
+ element.style.setProperty(`--psp-d3fc--series--color-${index}`, primaryColor);
2422
+ }
2423
+ element.style.setProperty("--psp-d3fc--legend--color", "var(--boring-foreground, var(--foreground))");
2424
+ element.style.setProperty("--psp-d3fc--legend--background", "var(--boring-card, var(--card))");
2425
+ element.style.setProperty("--psp-d3fc--tooltip--background", "var(--boring-popover, var(--popover))");
2426
+ element.style.setProperty("--psp-d3fc--tooltip--color", "var(--boring-popover-foreground, var(--popover-foreground))");
2427
+ element.style.setProperty("--psp-d3fc--tooltip--border-color", "var(--boring-border, var(--border))");
2428
+ element.style.setProperty("--psp-datagrid--pos-cell--color", "var(--boring-success, var(--success))");
2429
+ element.style.setProperty("--psp-datagrid--neg-cell--color", "var(--boring-destructive, var(--destructive))");
2430
+ if (options.hideAxisLabels !== false) {
2431
+ element.style.setProperty("--psp-d3fc--label--color", "transparent");
2432
+ }
2433
+ }
2378
2434
  export {
2379
2435
  AlertDialog,
2380
2436
  AlertDialogAction,
@@ -2548,7 +2604,9 @@ export {
2548
2604
  TooltipContent,
2549
2605
  TooltipProvider,
2550
2606
  TooltipTrigger,
2607
+ applyBoringPerspectiveTheme,
2551
2608
  badgeVariants,
2609
+ boringPerspectiveThemeName,
2552
2610
  buttonGroupVariants,
2553
2611
  buttonVariants,
2554
2612
  clearToasts,
package/dist/styles.css CHANGED
@@ -3,6 +3,8 @@
3
3
  @layer theme, utilities;
4
4
  @layer theme {
5
5
  :root, :host {
6
+ --font-sans: var(--boring-font-sans);
7
+ --font-mono: var(--boring-font-mono);
6
8
  --color-black: #000;
7
9
  --spacing: 0.25rem;
8
10
  --container-xs: 20rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hachej/boring-ui-kit",
3
- "version": "0.1.62",
3
+ "version": "0.1.64",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Shared shadcn-style UI primitives for Boring packages and app-generated panes.",