@adea-ai/ui 0.110.1 → 0.112.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 (94) hide show
  1. package/dist/components/composites/action-button/action-button.d.ts +8 -0
  2. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  3. package/dist/components/composites/action-button/action-button.js +9 -3
  4. package/dist/components/composites/action-button/action-button.js.map +1 -1
  5. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +17 -2
  6. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts.map +1 -1
  7. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +47 -122
  8. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  9. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  10. package/dist/components/composites/appearance-editor/appearance-choices.js +0 -4
  11. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  12. package/dist/components/composites/appearance-editor/appearance-editor.js +1 -1
  13. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
  14. package/dist/components/composites/appearance-editor/font-settings-group.js +60 -68
  15. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/index.js +1 -1
  17. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  18. package/dist/components/theme/appearance-panel.js +0 -3
  19. package/dist/components/theme/appearance-panel.js.map +1 -1
  20. package/dist/components/ui/alert-dialog/alert-dialog.js +2 -2
  21. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  22. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  23. package/dist/components/ui/combobox/combobox.js +1 -1
  24. package/dist/components/ui/combobox/combobox.js.map +1 -1
  25. package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
  26. package/dist/components/ui/context-menu/context-menu.js +2 -2
  27. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  28. package/dist/components/ui/dialog/dialog.js +2 -2
  29. package/dist/components/ui/dialog/dialog.js.map +1 -1
  30. package/dist/components/ui/drawer/drawer.js +1 -1
  31. package/dist/components/ui/drawer/drawer.js.map +1 -1
  32. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +22 -2
  33. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  34. package/dist/components/ui/dropdown-menu/dropdown-menu.js +79 -30
  35. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  36. package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
  37. package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
  38. package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
  39. package/dist/components/ui/menubar/menubar.js +2 -2
  40. package/dist/components/ui/menubar/menubar.js.map +1 -1
  41. package/dist/components/ui/select/index.d.ts +1 -0
  42. package/dist/components/ui/select/index.d.ts.map +1 -1
  43. package/dist/components/ui/select/select.d.ts +7 -1
  44. package/dist/components/ui/select/select.d.ts.map +1 -1
  45. package/dist/components/ui/select/select.js +34 -20
  46. package/dist/components/ui/select/select.js.map +1 -1
  47. package/dist/components/ui/sheet/sheet.js +1 -1
  48. package/dist/components/ui/sheet/sheet.js.map +1 -1
  49. package/dist/components/ui/tooltip/tooltip.d.ts +16 -6
  50. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  51. package/dist/components/ui/tooltip/tooltip.js +15 -4
  52. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  53. package/dist/index.js +1 -1
  54. package/dist/lib/overlay.d.ts +30 -1
  55. package/dist/lib/overlay.d.ts.map +1 -1
  56. package/dist/lib/overlay.js +37 -2
  57. package/dist/lib/overlay.js.map +1 -1
  58. package/dist/r/src/components/composites/action-button/action-button.tsx +10 -1
  59. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +33 -86
  60. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +0 -3
  61. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +20 -7
  62. package/dist/r/src/components/theme/appearance-panel.tsx +0 -1
  63. package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +2 -2
  64. package/dist/r/src/components/ui/combobox/combobox.tsx +3 -1
  65. package/dist/r/src/components/ui/context-menu/context-menu.tsx +6 -2
  66. package/dist/r/src/components/ui/dialog/dialog.tsx +2 -2
  67. package/dist/r/src/components/ui/drawer/drawer.tsx +1 -1
  68. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +44 -6
  69. package/dist/r/src/components/ui/dropdown-menu/index.ts +1 -0
  70. package/dist/r/src/components/ui/menubar/menubar.tsx +6 -2
  71. package/dist/r/src/components/ui/select/index.ts +1 -0
  72. package/dist/r/src/components/ui/select/select.tsx +31 -6
  73. package/dist/r/src/components/ui/sheet/sheet.tsx +1 -1
  74. package/dist/r/src/components/ui/tooltip/tooltip.tsx +28 -2
  75. package/dist/r/src/lib/overlay.ts +45 -1
  76. package/package.json +1 -1
  77. package/src/components/composites/action-button/action-button.tsx +10 -1
  78. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +33 -86
  79. package/src/components/composites/appearance-editor/appearance-choices.tsx +0 -3
  80. package/src/components/composites/appearance-editor/font-settings-group.tsx +20 -7
  81. package/src/components/theme/appearance-panel.tsx +0 -1
  82. package/src/components/ui/alert-dialog/alert-dialog.tsx +2 -2
  83. package/src/components/ui/combobox/combobox.tsx +3 -1
  84. package/src/components/ui/context-menu/context-menu.tsx +6 -2
  85. package/src/components/ui/dialog/dialog.tsx +2 -2
  86. package/src/components/ui/drawer/drawer.tsx +1 -1
  87. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +44 -6
  88. package/src/components/ui/dropdown-menu/index.ts +1 -0
  89. package/src/components/ui/menubar/menubar.tsx +6 -2
  90. package/src/components/ui/select/index.ts +1 -0
  91. package/src/components/ui/select/select.tsx +31 -6
  92. package/src/components/ui/sheet/sheet.tsx +1 -1
  93. package/src/components/ui/tooltip/tooltip.tsx +28 -2
  94. package/src/lib/overlay.ts +45 -1
@@ -1,2 +1,3 @@
1
1
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownMenuContentProps, } from './dropdown-menu';
2
+ export type { MenuSwatchTone } from '#lib/overlay';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/menubar/menubar.tsx"],"names":[],"m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AC,kCAY5F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,UAAU,CAAC,kCAExF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,SAAS,CAAC,kCAYtF;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,UAAU,CAAC,kCAGnF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,kCAE9E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,SAAS,CAAC,kCAGtF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,GAAG,CAAC,kCAE1E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,UAAU,CAAC,kCAQxF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,UAAU,CAAC,kCAiBxF"}
@@ -81,7 +81,7 @@ function MenubarCheckboxItem(props) {
81
81
  return cn(menuItem, "pe-8", local.class);
82
82
  } }, rest, { get children() {
83
83
  return [memo(() => local.children), createComponent(Menubar.ItemIndicator, {
84
- "class": "absolute end-2 flex size-4 items-center justify-center",
84
+ "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
85
85
  get children() {
86
86
  return createComponent(Check, { "class": "size-4" });
87
87
  }
@@ -97,7 +97,7 @@ function MenubarRadioItem(props) {
97
97
  return cn(menuItem, "pe-8", local.class);
98
98
  } }, rest, { get children() {
99
99
  return [memo(() => local.children), createComponent(Menubar.ItemIndicator, {
100
- "class": "absolute end-2 flex size-4 items-center justify-center",
100
+ "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
101
101
  get children() {
102
102
  return createComponent(Circle, { "class": "size-2 fill-current" });
103
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"menubar.js","names":["Menubar","KobalteMenubar","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","topLayerProps","cn","props","local","rest","_$createComponent","_$mergeProps","class","MenubarMenu","Menu","MenubarTrigger","Trigger","MenubarContent","Content","Portal","children","Arrow","_$memo","MenubarItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_el$","_tmpl$","_$insert","MenubarCheckboxItem","CheckboxItem","ItemIndicator","MenubarRadioGroup","RadioGroup","MenubarRadioItem","RadioItem","MenubarLabel","GroupLabel","MenubarGroup","Group","MenubarSeparator","Separator","MenubarSub","Sub","MenubarSubTrigger","SubTrigger","MenubarSubContent","SubContent","Menubar","_$createComponent","KobalteMenubar","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/menubar/menubar.tsx"],"sourcesContent":["import { Menubar as KobalteMenubar } from '@kobalte/core/menubar'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Menubar.\n *\n * A persistent row of menus at the top of a surface — the desktop application\n * pattern. Each trigger opens its own menu, and the arrow keys move *between*\n * menus once one is open, which is what makes a menubar a single control rather\n * than five menus that happen to be adjacent.\n *\n * This is for a window-level command surface. For actions on one thing, use\n * DropdownMenu; a menubar on a row would be a menu pretending to be chrome.\n */\nexport function Menubar(props: ComponentProps<typeof KobalteMenubar>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar\n class={cn(\n 'flex items-center gap-0.5 rounded-md border border-border bg-card p-0.5',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * One top-level menu: a trigger and the panel it opens.\n *\n * Required, and the reason the component is not just a row of triggers — the\n * menubar's arrow keys move *between* menus, which only works when each trigger\n * belongs to a menu the bar knows about. `value` names it.\n */\nexport function MenubarMenu(props: ComponentProps<typeof KobalteMenubar.Menu>) {\n return <KobalteMenubar.Menu {...props} />\n}\n\nexport function MenubarTrigger(props: ComponentProps<typeof KobalteMenubar.Trigger>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar.Trigger\n class={cn(\n 'flex items-center rounded-sm px-2 py-1 text-sm font-medium select-none',\n 'transition-colors ease-out outline-none',\n 'data-[expanded]:bg-surface-active',\n 'data-[highlighted]:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function MenubarContent(props: ComponentProps<typeof KobalteMenubar.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.Portal>\n <KobalteMenubar.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n <KobalteMenubar.Arrow aria-hidden=\"true\" class={popoverArrow} />\n {local.children}\n </KobalteMenubar.Content>\n </KobalteMenubar.Portal>\n )\n}\n\nexport function MenubarItem(\n props: ComponentProps<typeof KobalteMenubar.Item> & {\n variant?: 'default' | 'destructive'\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+N`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n return (\n <KobalteMenubar.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteMenubar.Item>\n )\n}\n\nexport function MenubarCheckboxItem(props: ComponentProps<typeof KobalteMenubar.CheckboxItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteMenubar.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteMenubar.ItemIndicator>\n </KobalteMenubar.CheckboxItem>\n )\n}\n\nexport function MenubarRadioGroup(props: ComponentProps<typeof KobalteMenubar.RadioGroup>) {\n return <KobalteMenubar.RadioGroup {...props} />\n}\n\nexport function MenubarRadioItem(props: ComponentProps<typeof KobalteMenubar.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteMenubar.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteMenubar.ItemIndicator>\n </KobalteMenubar.RadioItem>\n )\n}\n\n/**\n * The caption of a `MenubarGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function MenubarLabel(props: ComponentProps<typeof KobalteMenubar.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteMenubar.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function MenubarGroup(props: ComponentProps<typeof KobalteMenubar.Group>) {\n return <KobalteMenubar.Group {...props} />\n}\n\nexport function MenubarSeparator(props: ComponentProps<typeof KobalteMenubar.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteMenubar.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function MenubarSub(props: ComponentProps<typeof KobalteMenubar.Sub>) {\n return <KobalteMenubar.Sub {...props} />\n}\n\nexport function MenubarSubTrigger(props: ComponentProps<typeof KobalteMenubar.SubTrigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteMenubar.SubTrigger>\n )\n}\n\nexport function MenubarSubContent(props: ComponentProps<typeof KobalteMenubar.SubContent>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar.Portal>\n <KobalteMenubar.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteMenubar.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,SAAgBA,UAAQiB,OAA8C;CACpE,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,SAAcoB,WAAA,EAAA,KAAA,WAAA;EAAA,OACNL,GACL,2EACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;;;;;;;;AASA,SAAgBI,YAAYN,OAAmD;CAC7E,OAAAG,gBAAQnB,QAAeuB,MAASP,KAAK;AACvC;AAEA,SAAgBQ,eAAeR,OAAsD;CACnF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,QAAe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AAA,GAAMH,IAAI,CAAA;AAC/E;AAEA,SAAgBgC,aAAalC,OAAoD;CAC/E,OAAAG,gBAAQnB,QAAemD,OAAUnC,KAAK;AACxC;AAEA,SAAgBoC,iBAAiBpC,OAAwD;CACvF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQnB,QAAeqD,WAASjC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAGL,eAAeO,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AAClF;AAEA,SAAgBoC,WAAWtC,OAAkD;CAC3E,OAAAG,gBAAQnB,QAAeuD,KAAQvC,KAAK;AACtC;AAEA,SAAgBwC,kBAAkBxC,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,SAAS,UAAU,CAAC;CAC7D,OAAAG,gBACGnB,QAAeyD,YAAUrC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAGP,UAAUS,MAAMI,KAAK;CAAC,EAAA,GAAMH,MAAI,EAAA,IAAAW,WAAA;EAAA,OAAA,CAAAE,WAClEd,MAAMY,QAAQ,GAAAV,gBACdjB,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBwD,kBAAkB1C,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,QAAe4B,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAV,gBACnBnB,QAAe2D,YAAUvC,WACpBN,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLH,gBACAD,eACA,yFAAA,OAEAM,MAAMI,KACR;EAAC,EAAA,GACGH,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
1
+ {"version":3,"file":"menubar.js","names":["Menubar","KobalteMenubar","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","topLayerProps","cn","props","local","rest","_$createComponent","_$mergeProps","class","MenubarMenu","Menu","MenubarTrigger","Trigger","MenubarContent","Content","Portal","children","Arrow","_$memo","MenubarItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_el$","_tmpl$","_$insert","MenubarCheckboxItem","CheckboxItem","ItemIndicator","MenubarRadioGroup","RadioGroup","MenubarRadioItem","RadioItem","MenubarLabel","GroupLabel","MenubarGroup","Group","MenubarSeparator","Separator","MenubarSub","Sub","MenubarSubTrigger","SubTrigger","MenubarSubContent","SubContent","Menubar","_$createComponent","KobalteMenubar","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/menubar/menubar.tsx"],"sourcesContent":["import { Menubar as KobalteMenubar } from '@kobalte/core/menubar'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Menubar.\n *\n * A persistent row of menus at the top of a surface — the desktop application\n * pattern. Each trigger opens its own menu, and the arrow keys move *between*\n * menus once one is open, which is what makes a menubar a single control rather\n * than five menus that happen to be adjacent.\n *\n * This is for a window-level command surface. For actions on one thing, use\n * DropdownMenu; a menubar on a row would be a menu pretending to be chrome.\n */\nexport function Menubar(props: ComponentProps<typeof KobalteMenubar>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar\n class={cn(\n 'flex items-center gap-0.5 rounded-md border border-border bg-card p-0.5',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * One top-level menu: a trigger and the panel it opens.\n *\n * Required, and the reason the component is not just a row of triggers — the\n * menubar's arrow keys move *between* menus, which only works when each trigger\n * belongs to a menu the bar knows about. `value` names it.\n */\nexport function MenubarMenu(props: ComponentProps<typeof KobalteMenubar.Menu>) {\n return <KobalteMenubar.Menu {...props} />\n}\n\nexport function MenubarTrigger(props: ComponentProps<typeof KobalteMenubar.Trigger>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar.Trigger\n class={cn(\n 'flex items-center rounded-sm px-2 py-1 text-sm font-medium select-none',\n 'transition-colors ease-out outline-none',\n 'data-[expanded]:bg-surface-active',\n 'data-[highlighted]:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function MenubarContent(props: ComponentProps<typeof KobalteMenubar.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.Portal>\n <KobalteMenubar.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n <KobalteMenubar.Arrow aria-hidden=\"true\" class={popoverArrow} />\n {local.children}\n </KobalteMenubar.Content>\n </KobalteMenubar.Portal>\n )\n}\n\nexport function MenubarItem(\n props: ComponentProps<typeof KobalteMenubar.Item> & {\n variant?: 'default' | 'destructive'\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+N`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n return (\n <KobalteMenubar.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteMenubar.Item>\n )\n}\n\nexport function MenubarCheckboxItem(props: ComponentProps<typeof KobalteMenubar.CheckboxItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system. */}\n <KobalteMenubar.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center text-primary\">\n <Check class=\"size-4\" />\n </KobalteMenubar.ItemIndicator>\n </KobalteMenubar.CheckboxItem>\n )\n}\n\nexport function MenubarRadioGroup(props: ComponentProps<typeof KobalteMenubar.RadioGroup>) {\n return <KobalteMenubar.RadioGroup {...props} />\n}\n\nexport function MenubarRadioItem(props: ComponentProps<typeof KobalteMenubar.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system. */}\n <KobalteMenubar.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center text-primary\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteMenubar.ItemIndicator>\n </KobalteMenubar.RadioItem>\n )\n}\n\n/**\n * The caption of a `MenubarGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function MenubarLabel(props: ComponentProps<typeof KobalteMenubar.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteMenubar.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function MenubarGroup(props: ComponentProps<typeof KobalteMenubar.Group>) {\n return <KobalteMenubar.Group {...props} />\n}\n\nexport function MenubarSeparator(props: ComponentProps<typeof KobalteMenubar.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteMenubar.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function MenubarSub(props: ComponentProps<typeof KobalteMenubar.Sub>) {\n return <KobalteMenubar.Sub {...props} />\n}\n\nexport function MenubarSubTrigger(props: ComponentProps<typeof KobalteMenubar.SubTrigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteMenubar.SubTrigger>\n )\n}\n\nexport function MenubarSubContent(props: ComponentProps<typeof KobalteMenubar.SubContent>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar.Portal>\n <KobalteMenubar.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteMenubar.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,SAAgBA,UAAQiB,OAA8C;CACpE,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,SAAcoB,WAAA,EAAA,KAAA,WAAA;EAAA,OACNL,GACL,2EACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;;;;;;;;AASA,SAAgBI,YAAYN,OAAmD;CAC7E,OAAAG,gBAAQnB,QAAeuB,MAASP,KAAK;AACvC;AAEA,SAAgBQ,eAAeR,OAAsD;CACnF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,QAAeyB,SAAOL,WAAA,EAAA,KAAA,WAAA;EAAA,OACdL,GACL,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AalC,OAAoD;CAC/E,OAAAG,gBAAQnB,QAAemD,OAAUnC,KAAK;AACxC;AAEA,SAAgBoC,iBAAiBpC,OAAwD;CACvF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQnB,QAAeqD,WAASjC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAGL,eAAeO,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AAClF;AAEA,SAAgBoC,WAAWtC,OAAkD;CAC3E,OAAAG,gBAAQnB,QAAeuD,KAAQvC,KAAK;AACtC;AAEA,SAAgBwC,kBAAkBxC,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,SAAS,UAAU,CAAC;CAC7D,OAAAG,gBACGnB,QAAeyD,YAAUrC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAGP,UAAUS,MAAMI,KAAK;CAAC,EAAA,GAAMH,MAAI,EAAA,IAAAW,WAAA;EAAA,OAAA,CAAAE,WAClEd,MAAMY,QAAQ,GAAAV,gBACdjB,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBwD,kBAAkB1C,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,QAAe4B,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAV,gBACnBnB,QAAe2D,YAAUvC,WACpBN,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLH,gBACAD,eACA,yFAAA,OAEAM,MAAMI,KACR;EAAC,EAAA,GACGH,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
@@ -1,2 +1,3 @@
1
1
  export { Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, type SelectTriggerProps, } from './select';
2
+ export type { MenuSwatchTone } from '#lib/overlay';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,kBAAkB,GACxB,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,kBAAkB,GACxB,MAAM,UAAU,CAAA;AACjB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { Select as KobalteSelect } from '@kobalte/core/select';
2
2
  import type { ComponentProps } from 'solid-js';
3
+ import { type MenuSwatchTone } from '#lib/overlay';
3
4
  /**
4
5
  * Select.
5
6
  *
@@ -58,7 +59,12 @@ export type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> &
58
59
  portalMount?: HTMLElement;
59
60
  };
60
61
  export declare function SelectContent(props: SelectContentProps): import("solid-js").JSX.Element;
61
- export declare function SelectItem(props: ComponentProps<typeof KobalteSelect.Item>): import("solid-js").JSX.Element;
62
+ export declare function SelectItem(props: ComponentProps<typeof KobalteSelect.Item> & {
63
+ /** Draw a leading colour dot from the shared tone ladder — the accent or
64
+ * status role the option's card badge carries. `aria-hidden`; the label
65
+ * carries the meaning. */
66
+ swatch?: MenuSwatchTone;
67
+ }): import("solid-js").JSX.Element;
62
68
  export declare function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>): import("solid-js").JSX.Element;
63
69
  export declare function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>): import("solid-js").JSX.Element;
64
70
  /** The chevron pair used when a Select is composed by hand in a field. */
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,EAC7C,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,kCAG9D;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG;IAC9E,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACzB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,kCAgCtD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,KAAK,mBAAmB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAA;AAEjF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG;IAC1E;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAA;IACzC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CAC/B,CAAA;AAkBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kCAalD;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG;IAC9E,0EAA0E;IAC1E,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,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AAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG;IAC1E;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAA;IACzC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CAC/B,CAAA;AAkBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kCAalD;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG;IAC9E,0EAA0E;IAC1E,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,kCA0BtD;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,GAAG;IACjD;;8BAE0B;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,kCAiBF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,kCAGhF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,kCAQ5E;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAEhE"}
@@ -1,10 +1,11 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
- import { menuItem, popoverArrow, topLayerProps } from "../../../lib/overlay.js";
3
- import { createComponent, memo, mergeProps } from "solid-js/web";
2
+ import { menuItem, menuSwatchTone, topLayerProps } from "../../../lib/overlay.js";
3
+ import { className, createComponent, effect, memo, mergeProps, template } from "solid-js/web";
4
4
  import { Check, ChevronDown, ChevronsUpDown } from "lucide-solid";
5
5
  import { Show, splitProps } from "solid-js";
6
6
  import { Select } from "@kobalte/core/select";
7
7
  //#region src/components/ui/select/select.tsx
8
+ var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true>`);
8
9
  /**
9
10
  * Select.
10
11
  *
@@ -19,7 +20,10 @@ import { Select } from "@kobalte/core/select";
19
20
  * raw id.
20
21
  */
21
22
  function Select$1(props) {
22
- return createComponent(Select, props);
23
+ const [local, rest] = splitProps(props, ["gutter"]);
24
+ return createComponent(Select, mergeProps({ get gutter() {
25
+ return local.gutter ?? 4;
26
+ } }, rest));
23
27
  }
24
28
  function SelectTrigger(props) {
25
29
  const [local, rest] = splitProps(props, [
@@ -97,31 +101,41 @@ function SelectContent(props) {
97
101
  return createComponent(Select.Content, mergeProps(topLayerProps, { get ["class"]() {
98
102
  return cn("bg-popover text-popover-foreground rounded-xl border border-border shadow-lg", "z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden", "p-1", "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-expanded:duration-150 data-closed:duration-100", local.class);
99
103
  } }, rest, { get children() {
100
- return [
101
- memo(() => local.children),
102
- createComponent(Select.Listbox, { "class": "flex flex-col" }),
103
- createComponent(Select.Arrow, {
104
- "aria-hidden": "true",
105
- "class": popoverArrow
106
- })
107
- ];
104
+ return [memo(() => local.children), createComponent(Select.Listbox, { "class": "flex flex-col" })];
108
105
  } }));
109
106
  }
110
107
  });
111
108
  }
112
109
  function SelectItem(props) {
113
- const [local, rest] = splitProps(props, ["class", "children"]);
110
+ const [local, rest] = splitProps(props, [
111
+ "class",
112
+ "children",
113
+ "swatch"
114
+ ]);
114
115
  return createComponent(Select.Item, mergeProps({ get ["class"]() {
115
116
  return cn(menuItem, "pe-8", local.class);
116
117
  } }, rest, { get children() {
117
- return [createComponent(Select.ItemLabel, { get children() {
118
- return local.children;
119
- } }), createComponent(Select.ItemIndicator, {
120
- "class": "absolute end-2 flex size-4 items-center justify-center",
121
- get children() {
122
- return createComponent(Check, { "class": "size-4" });
123
- }
124
- })];
118
+ return [
119
+ createComponent(Show, {
120
+ get when() {
121
+ return local.swatch;
122
+ },
123
+ get children() {
124
+ var _el$ = _tmpl$();
125
+ effect(() => className(_el$, menuSwatchTone({ tone: local.swatch })));
126
+ return _el$;
127
+ }
128
+ }),
129
+ createComponent(Select.ItemLabel, { get children() {
130
+ return local.children;
131
+ } }),
132
+ createComponent(Select.ItemIndicator, {
133
+ "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
134
+ get children() {
135
+ return createComponent(Check, { "class": "size-4" });
136
+ }
137
+ })
138
+ ];
125
139
  } }));
126
140
  }
127
141
  function SelectSection(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":["Select","KobalteSelect","Check","ChevronDown","ChevronsUpDown","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","topLayerProps","cn","props","Option","OptGroup","_$createComponent","SelectTriggerProps","Trigger","size","hideIcon","SelectTrigger","local","rest","_$mergeProps","class","undefined","children","_$memo","when","Icon","SelectValueChildren","Value","SelectValueProps","optionLabel","option","LABEL_FIELDS","const","labelFromOption","field","value","Record","SelectValue","readLabel","state","selectedOption","SelectContentProps","Content","portalMount","HTMLElement","SelectContent","Portal","mount","Listbox","Arrow","SelectItem","Item","ItemLabel","ItemIndicator","SelectSection","Section","SelectLabel","Label","SelectChevronsUpDown","Select","_$createComponent","KobalteSelect","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as KobalteSelect } from '@kobalte/core/select'\nimport { Check, ChevronDown, ChevronsUpDown } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow, topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * `Select.Value` renders the human-readable label of the selection, not its\n * value — the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>\n) {\n return <KobalteSelect {...props} />\n}\n\nexport type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'size', 'hideIcon', 'children'])\n\n return (\n <KobalteSelect.Trigger\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': local.size === 'sm',\n 'h-control-md text-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg text-sm': local.size === 'lg',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={!local.hideIcon}>\n <KobalteSelect.Icon class=\"text-muted-foreground\">\n <ChevronDown />\n </KobalteSelect.Icon>\n </Show>\n </KobalteSelect.Trigger>\n )\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at all.\n * Kobalte's own `Value` draws *only* its children, so a bare `<SelectValue />`\n * shows the placeholder and then goes blank the moment something is chosen: the\n * value is there, nothing paints it.\n *\n * Kobalte cannot supply a default itself, because an option is the caller's type\n * — it has no way to know which field is the label. So this reads a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\ntype SelectValueChildren = ComponentProps<typeof KobalteSelect.Value>['children']\n\nexport type SelectValueProps = ComponentProps<typeof KobalteSelect.Value> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: SelectValueChildren\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'optionLabel'])\n\n const readLabel = (state: { selectedOption: () => unknown }): string => {\n const option = state.selectedOption()\n return local.optionLabel ? local.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <KobalteSelect.Value data-slot=\"select-value\" class={cn('truncate', local.class)} {...rest}>\n {local.children ?? (readLabel as unknown as SelectValueChildren)}\n </KobalteSelect.Value>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> & {\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'portalMount'])\n\n return (\n <KobalteSelect.Portal mount={local.portalMount}>\n <KobalteSelect.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteSelect.Listbox class=\"flex flex-col\" />\n <KobalteSelect.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteSelect.Content>\n </KobalteSelect.Portal>\n )\n}\n\nexport function SelectItem(props: ComponentProps<typeof KobalteSelect.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>\n <KobalteSelect.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteSelect.ItemIndicator>\n </KobalteSelect.Item>\n )\n}\n\nexport function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteSelect.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\nexport function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSelect.Label\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', local.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpD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AAMG,KAAK;CAAC,EAAA,GAAMF,MAAI,EAAA,IAAAI,WAAA;EAAA,OAAA,CAAAX,gBACnEf,OAAcwD,WAAS,EAAA,IAAA9B,WAAA;GAAA,OAAEL,MAAMK;EAAQ,EAAA,CAAA,GAAAX,gBACvCf,OAAcyD,eAAa;GAAA,SAAA;GAAA,IAAA/B,WAAA;IAAA,OAAAX,gBACzBd,OAAK,EAAA,SAAA,SAAA,CAAA;GAAA;EAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgByD,cAAc9C,OAAqD;CACjF,MAAM,CAACS,OAAOC,QAAQhB,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQf,OAAc2D,SAAOpC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQZ,GAAG,iBAAiBU,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AACjF;AAEA,SAAgBsC,YAAYhD,OAAmD;CAC7E,MAAM,CAACS,OAAOC,QAAQhB,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGf,OAAc6D,OAAKtC,WAAA,EAAA,KAAA,WAAA;EAAA,OACXZ,GAAG,oEAAoEU,MAAMG,KAAK;CAAC,EAAA,GACtFF,IAAI,CAAA;AAGd;;AAGA,SAAgBwC,qBAAqBlD,OAA8B;CACjE,OAAAG,gBAAQZ,gBAAcoB,WAAA,EAAA,eAAA,OAAA,GAAwBX,KAAK,CAAA;AACrD"}
1
+ {"version":3,"file":"select.js","names":["Select","KobalteSelect","Check","ChevronDown","ChevronsUpDown","ComponentProps","Show","splitProps","menuContentPadding","menuItem","menuSwatchTone","MenuSwatchTone","topLayerProps","cn","props","Option","OptGroup","local","rest","_$createComponent","_$mergeProps","gutter","SelectTriggerProps","Trigger","size","hideIcon","SelectTrigger","class","undefined","children","_$memo","when","Icon","SelectValueChildren","Value","SelectValueProps","optionLabel","option","LABEL_FIELDS","const","labelFromOption","field","value","Record","SelectValue","readLabel","state","selectedOption","SelectContentProps","Content","portalMount","HTMLElement","SelectContent","Portal","mount","Listbox","SelectItem","Item","swatch","_el$","_tmpl$","_$effect","_$className","tone","ItemLabel","ItemIndicator","SelectSection","Section","SelectLabel","Label","SelectChevronsUpDown","Select","_$createComponent","KobalteSelect","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as KobalteSelect } from '@kobalte/core/select'\nimport { Check, ChevronDown, ChevronsUpDown } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n menuItem,\n menuSwatchTone,\n type MenuSwatchTone,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * `Select.Value` renders the human-readable label of the selection, not its\n * value — the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>\n) {\n // Kobalte's own default gutter is 8px; without the arrow (removed below) the\n // popper no longer folds half an arrow box into that offset, and 8px read as\n // a detached list. Four pixels is shadcn's `sideOffset` — attached, with\n // room for the trigger's own border.\n const [local, rest] = splitProps(props, ['gutter'])\n return <KobalteSelect gutter={local.gutter ?? 4} {...rest} />\n}\n\nexport type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'size', 'hideIcon', 'children'])\n\n return (\n <KobalteSelect.Trigger\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': local.size === 'sm',\n 'h-control-md text-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg text-sm': local.size === 'lg',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={!local.hideIcon}>\n <KobalteSelect.Icon class=\"text-muted-foreground\">\n <ChevronDown />\n </KobalteSelect.Icon>\n </Show>\n </KobalteSelect.Trigger>\n )\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at all.\n * Kobalte's own `Value` draws *only* its children, so a bare `<SelectValue />`\n * shows the placeholder and then goes blank the moment something is chosen: the\n * value is there, nothing paints it.\n *\n * Kobalte cannot supply a default itself, because an option is the caller's type\n * — it has no way to know which field is the label. So this reads a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\ntype SelectValueChildren = ComponentProps<typeof KobalteSelect.Value>['children']\n\nexport type SelectValueProps = ComponentProps<typeof KobalteSelect.Value> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: SelectValueChildren\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'optionLabel'])\n\n const readLabel = (state: { selectedOption: () => unknown }): string => {\n const option = state.selectedOption()\n return local.optionLabel ? local.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <KobalteSelect.Value data-slot=\"select-value\" class={cn('truncate', local.class)} {...rest}>\n {local.children ?? (readLabel as unknown as SelectValueChildren)}\n </KobalteSelect.Value>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> & {\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'portalMount'])\n\n return (\n <KobalteSelect.Portal mount={local.portalMount}>\n <KobalteSelect.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n {/* No arrow: the list is the trigger's own value opened up, and Kobalte\n reserves half the arrow's 30px box as popper gutter, which is where\n the reported gap between a form trigger and its options came from. */}\n <KobalteSelect.Listbox class=\"flex flex-col\" />\n </KobalteSelect.Content>\n </KobalteSelect.Portal>\n )\n}\n\nexport function SelectItem(\n props: ComponentProps<typeof KobalteSelect.Item> & {\n /** Draw a leading colour dot from the shared tone ladder — the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'children', 'swatch'])\n\n return (\n <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>\n {/* The indicator reads in the accent, like every other selected state in\n the system — the row's own foreground reads as decoration. */}\n <KobalteSelect.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center text-primary\">\n <Check class=\"size-4\" />\n </KobalteSelect.ItemIndicator>\n </KobalteSelect.Item>\n )\n}\n\nexport function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteSelect.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\nexport function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSelect.Label\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', local.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <ChevronsUpDown aria-hidden=\"true\" {...props} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgBA,SACdc,OACA;CAKA,MAAM,CAACG,OAAOC,QAAQX,WAAWO,OAAO,CAAC,QAAQ,CAAC;CAClD,OAAAK,gBAAQlB,QAAamB,WAAA,EAAA,IAACC,SAAM;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KAAA,IAAA8B,OAAAC,OAAA;KAAAC,aAAAC,UAAAH,MACUjD,eAAe,EAAEqD,MAAM9C,MAAMyC,OAAO,CAAC,CAAC,CAAA;KAAA,OAAAC;IAAA;GAAA,CAAA;GAAAxC,gBAEvElB,OAAc+D,WAAS,EAAA,IAAAnC,WAAA;IAAA,OAAEZ,MAAMY;GAAQ,EAAA,CAAA;GAAAV,gBAGvClB,OAAcgE,eAAa;IAAA,SAAA;IAAA,IAAApC,WAAA;KAAA,OAAAV,gBACzBjB,OAAK,EAAA,SAAA,SAAA,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgBgE,cAAcpD,OAAqD;CACjF,MAAM,CAACG,OAAOC,QAAQX,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBAAQlB,OAAckE,SAAO/C,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQP,GAAG,iBAAiBI,MAAMU,KAAK;CAAC,EAAA,GAAMT,IAAI,CAAA;AACjF;AAEA,SAAgBkD,YAAYtD,OAAmD;CAC7E,MAAM,CAACG,OAAOC,QAAQX,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBACGlB,OAAcoE,OAAKjD,WAAA,EAAA,KAAA,WAAA;EAAA,OACXP,GAAG,oEAAoEI,MAAMU,KAAK;CAAC,EAAA,GACtFT,IAAI,CAAA;AAGd;;AAGA,SAAgBoD,qBAAqBxD,OAA8B;CACjE,OAAAK,gBAAQf,gBAAcgB,WAAA,EAAA,eAAA,OAAA,GAAwBN,KAAK,CAAA;AACrD"}
@@ -40,7 +40,7 @@ var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=sheet-footer>`);
40
40
  * opener must be used instead, such as when another layer closes before the
41
41
  * sheet opens.
42
42
  */
43
- var sheetVariants = cva("bg-popover text-popover-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg", {
43
+ var sheetVariants = cva("bg-background text-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg", {
44
44
  variants: {
45
45
  side: {
46
46
  top: "data-expanded:slide-in-from-top data-closed:slide-out-to-top",
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","useDialogContext","X","Accessor","ComponentProps","JSX","Show","splitProps","cva","VariantProps","overlayTitle","cn","createDialogFocusRestoration","DialogOverlay","sheetVariants","variants","side","top","bottom","start","end","variant","edge","inset","compoundVariants","class","defaultVariants","sheetVariantFor","SheetContentProps","closeButton","Element","closeLabel","restoreFocusRef","HTMLElement","SheetContent","props","local","rest","dialog","focusRestoration","open","isOpen","onOpenAutoFocus","onCloseAutoFocus","_$createComponent","Portal","children","when","_$mergeProps","data-variant","_$memo","CloseButton","aria-label","tabindex","Sheet","SheetTrigger","Trigger","SheetCloseButton","SheetHeader","_el$","_tmpl$","_$spread","SheetBody","_el$2","_tmpl$2","SheetFooter","_el$3","_tmpl$3","SheetTitle","Title","SheetDescription","Description","_$createComponent","KobalteDialog","KobalteDialogContent","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n useDialogContext,\n} from '@kobalte/core/dialog'\n// AlertDialog shares DialogRoot.Content; Sheet uses the stable named primitive.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createDialogFocusRestoration, DialogOverlay } from '../dialog/dialog'\n\n/**\n * Sheet.\n *\n * A dialog anchored to an edge of the window rather than centred. Use it when\n * the content is a *panel beside* the work — a details inspector, a filter rail,\n * a settings flyout — so the user keeps the context it belongs to in view.\n * A centred dialog interrupts; a sheet is inspected.\n *\n * `side` decides which edge; the panel is a full-height column for `start` and\n * `end`, and a full-width row for `top` and `bottom`. The slide-in direction\n * follows from the side, so a caller never pairs them by hand.\n *\n * `variant` decides how it meets that edge. `inset` — the default for `end` —\n * docks the panel inside the main view: below the top bar, one equal gap from\n * the top bar, the end edge and the bottom, with no scrim, so the work it edits\n * stays visible and the top bar stays reachable. It is the shape for editing one\n * thing beside its context (appearance settings, a task, a record). `edge` runs\n * edge to edge over a scrim — the shape of a navigation drawer, and the default\n * for every other side.\n *\n * Its parts read alike everywhere: `SheetHeader` holds a heading, a description\n * and a full-width rule beneath, with the close button in the corner;\n * `SheetBody` scrolls on its own; `SheetFooter` is a full-width tinted band that\n * holds the decision.\n *\n * Controlled sheets opened from outside a `SheetTrigger` restore focus to the\n * element focused before opening. Pass `restoreFocusRef` when a stable external\n * opener must be used instead, such as when another layer closes before the\n * sheet opens.\n */\n// `overflow-clip`, not `overflow-hidden`: a hidden overflow can still be\n// scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the\n// pinned footer out of view. Only SheetBody scrolls.\nconst sheetVariants = cva(\n 'bg-popover text-popover-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',\n {\n variants: {\n side: {\n top: 'data-expanded:slide-in-from-top data-closed:slide-out-to-top',\n bottom: 'data-expanded:slide-in-from-bottom data-closed:slide-out-to-bottom',\n start: 'data-expanded:slide-in-from-left data-closed:slide-out-to-left',\n end: 'data-expanded:slide-in-from-right data-closed:slide-out-to-right',\n },\n variant: {\n edge: '',\n inset: 'panel-dialog-inset w-lg rounded-xl border',\n },\n },\n compoundVariants: [\n {\n side: 'top',\n variant: 'edge',\n class: 'inset-x-0 top-0 h-auto max-h-[85vh] rounded-b-xl border-b',\n },\n {\n side: 'bottom',\n variant: 'edge',\n class: 'inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-xl border-t',\n },\n {\n side: 'start',\n variant: 'edge',\n class: 'inset-y-0 start-0 h-full w-80 max-w-[85vw] rounded-e-xl border-e',\n },\n {\n side: 'end',\n variant: 'edge',\n class: 'inset-y-0 end-0 h-full w-80 max-w-[85vw] rounded-s-xl border-s',\n },\n ],\n defaultVariants: { side: 'end', variant: 'edge' },\n }\n)\n\n/** `inset` for the end edge, `edge` for every other side, unless the caller says. */\nconst sheetVariantFor = (\n side: SheetContentProps['side'],\n variant: SheetContentProps['variant']\n): 'edge' | 'inset' => variant ?? ((side ?? 'end') === 'end' ? 'inset' : 'edge')\n\nexport type SheetContentProps = ComponentProps<typeof KobalteDialogContent> &\n VariantProps<typeof sheetVariants> & {\n closeButton?: JSX.Element | false\n /** The close button's accessible name. Defaults to \"Close\". */\n closeLabel?: string\n /** Supplies the stable external element to focus when the controlled sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n }\n\nexport function SheetContent(props: SheetContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'side',\n 'variant',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const dialog = useDialogContext()\n const focusRestoration = createDialogFocusRestoration({\n open: dialog.isOpen,\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: local.onOpenAutoFocus,\n onCloseAutoFocus: local.onCloseAutoFocus,\n })\n\n const variant = () => sheetVariantFor(local.side, local.variant)\n\n return (\n <KobalteDialog.Portal>\n {/* An inset panel is beside the work, so the work stays in view: no scrim.\n It is still modal — focus stays inside and an outside click dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogOverlay />\n </Show>\n <KobalteDialogContent\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: local.side, variant: variant() }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n local.class\n )}\n {...rest}\n onOpenAutoFocus={focusRestoration.onOpenAutoFocus}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <KobalteDialog.CloseButton\n aria-label={local.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class=\"absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground transition-colors ease-out outline-none hover:bg-surface-hover hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </KobalteDialogContent>\n </KobalteDialog.Portal>\n )\n}\n\nexport function Sheet(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function SheetTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function SheetCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn(local.class)} {...rest} />\n}\n\nexport function SheetHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function SheetFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function SheetDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAMiB,gBAAgBN,IACpB,+GACA;CACEO,UAAU;EACRC,MAAM;GACJC,KAAK;GACLC,QAAQ;GACRC,OAAO;GACPC,KAAK;EACP;EACAC,SAAS;GACPC,MAAM;GACNC,OAAO;EACT;CACF;CACAC,kBAAkB;EAChB;GACER,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;CAAC;CAEHC,iBAAiB;EAAEV,MAAM;EAAOK,SAAS;CAAO;AAClD,CACF;;AAGA,IAAMM,mBACJX,MACAK,YACqBA,aAAaL,QAAQ,WAAW,QAAQ,UAAU;AAWzE,SAAgBkB,aAAaC,OAA0B;CACrD,MAAM,CAACC,OAAOC,QAAQ9B,WAAW4B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAkB,CACnB;CACD,MAAMG,SAASrC,iBAAiB;CAChC,MAAMsC,mBAAmB3B,6BAA6B;EACpD4B,MAAMF,OAAOG;EACbT,iBAAiBI,MAAMJ;EACvBU,iBAAiBN,MAAMM;EACvBC,kBAAkBP,MAAMO;CAC1B,CAAC;CAED,MAAMtB,gBAAgBM,gBAAgBS,MAAMpB,MAAMoB,MAAMf,OAAO;CAE/D,OAAAuB,gBACG9C,OAAc+C,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAA,CAAAF,gBAGlBtC,MAAI;GAAA,IAACy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CAAA;AAC5E;AAEA,SAAgBiC,iBAAiBnC,OAAyD;CACxF,MAAM,CAACC,OAAOC,QAAQ9B,WAAW4B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAS,gBACG9C,OAAcyE,aAAWvB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQrC,GAAG,iCAAiCyB,MAAMX,KAAK;CAAC,EAAA,GAAMY,IAAI,CAAA;AAEhG"}
1
+ {"version":3,"file":"sheet.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","useDialogContext","X","Accessor","ComponentProps","JSX","Show","splitProps","cva","VariantProps","overlayTitle","cn","createDialogFocusRestoration","DialogOverlay","sheetVariants","variants","side","top","bottom","start","end","variant","edge","inset","compoundVariants","class","defaultVariants","sheetVariantFor","SheetContentProps","closeButton","Element","closeLabel","restoreFocusRef","HTMLElement","SheetContent","props","local","rest","dialog","focusRestoration","open","isOpen","onOpenAutoFocus","onCloseAutoFocus","_$createComponent","Portal","children","when","_$mergeProps","data-variant","_$memo","CloseButton","aria-label","tabindex","Sheet","SheetTrigger","Trigger","SheetCloseButton","SheetHeader","_el$","_tmpl$","_$spread","SheetBody","_el$2","_tmpl$2","SheetFooter","_el$3","_tmpl$3","SheetTitle","Title","SheetDescription","Description","_$createComponent","KobalteDialog","KobalteDialogContent","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n useDialogContext,\n} from '@kobalte/core/dialog'\n// AlertDialog shares DialogRoot.Content; Sheet uses the stable named primitive.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createDialogFocusRestoration, DialogOverlay } from '../dialog/dialog'\n\n/**\n * Sheet.\n *\n * A dialog anchored to an edge of the window rather than centred. Use it when\n * the content is a *panel beside* the work — a details inspector, a filter rail,\n * a settings flyout — so the user keeps the context it belongs to in view.\n * A centred dialog interrupts; a sheet is inspected.\n *\n * `side` decides which edge; the panel is a full-height column for `start` and\n * `end`, and a full-width row for `top` and `bottom`. The slide-in direction\n * follows from the side, so a caller never pairs them by hand.\n *\n * `variant` decides how it meets that edge. `inset` — the default for `end` —\n * docks the panel inside the main view: below the top bar, one equal gap from\n * the top bar, the end edge and the bottom, with no scrim, so the work it edits\n * stays visible and the top bar stays reachable. It is the shape for editing one\n * thing beside its context (appearance settings, a task, a record). `edge` runs\n * edge to edge over a scrim — the shape of a navigation drawer, and the default\n * for every other side.\n *\n * Its parts read alike everywhere: `SheetHeader` holds a heading, a description\n * and a full-width rule beneath, with the close button in the corner;\n * `SheetBody` scrolls on its own; `SheetFooter` is a full-width tinted band that\n * holds the decision.\n *\n * Controlled sheets opened from outside a `SheetTrigger` restore focus to the\n * element focused before opening. Pass `restoreFocusRef` when a stable external\n * opener must be used instead, such as when another layer closes before the\n * sheet opens.\n */\n// `overflow-clip`, not `overflow-hidden`: a hidden overflow can still be\n// scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the\n// pinned footer out of view. Only SheetBody scrolls.\nconst sheetVariants = cva(\n 'bg-background text-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',\n {\n variants: {\n side: {\n top: 'data-expanded:slide-in-from-top data-closed:slide-out-to-top',\n bottom: 'data-expanded:slide-in-from-bottom data-closed:slide-out-to-bottom',\n start: 'data-expanded:slide-in-from-left data-closed:slide-out-to-left',\n end: 'data-expanded:slide-in-from-right data-closed:slide-out-to-right',\n },\n variant: {\n edge: '',\n inset: 'panel-dialog-inset w-lg rounded-xl border',\n },\n },\n compoundVariants: [\n {\n side: 'top',\n variant: 'edge',\n class: 'inset-x-0 top-0 h-auto max-h-[85vh] rounded-b-xl border-b',\n },\n {\n side: 'bottom',\n variant: 'edge',\n class: 'inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-xl border-t',\n },\n {\n side: 'start',\n variant: 'edge',\n class: 'inset-y-0 start-0 h-full w-80 max-w-[85vw] rounded-e-xl border-e',\n },\n {\n side: 'end',\n variant: 'edge',\n class: 'inset-y-0 end-0 h-full w-80 max-w-[85vw] rounded-s-xl border-s',\n },\n ],\n defaultVariants: { side: 'end', variant: 'edge' },\n }\n)\n\n/** `inset` for the end edge, `edge` for every other side, unless the caller says. */\nconst sheetVariantFor = (\n side: SheetContentProps['side'],\n variant: SheetContentProps['variant']\n): 'edge' | 'inset' => variant ?? ((side ?? 'end') === 'end' ? 'inset' : 'edge')\n\nexport type SheetContentProps = ComponentProps<typeof KobalteDialogContent> &\n VariantProps<typeof sheetVariants> & {\n closeButton?: JSX.Element | false\n /** The close button's accessible name. Defaults to \"Close\". */\n closeLabel?: string\n /** Supplies the stable external element to focus when the controlled sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n }\n\nexport function SheetContent(props: SheetContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'side',\n 'variant',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const dialog = useDialogContext()\n const focusRestoration = createDialogFocusRestoration({\n open: dialog.isOpen,\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: local.onOpenAutoFocus,\n onCloseAutoFocus: local.onCloseAutoFocus,\n })\n\n const variant = () => sheetVariantFor(local.side, local.variant)\n\n return (\n <KobalteDialog.Portal>\n {/* An inset panel is beside the work, so the work stays in view: no scrim.\n It is still modal — focus stays inside and an outside click dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogOverlay />\n </Show>\n <KobalteDialogContent\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: local.side, variant: variant() }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n local.class\n )}\n {...rest}\n onOpenAutoFocus={focusRestoration.onOpenAutoFocus}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <KobalteDialog.CloseButton\n aria-label={local.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class=\"absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground transition-colors ease-out outline-none hover:bg-surface-hover hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </KobalteDialogContent>\n </KobalteDialog.Portal>\n )\n}\n\nexport function Sheet(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function SheetTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function SheetCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn(local.class)} {...rest} />\n}\n\nexport function SheetHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function SheetFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function SheetDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAMiB,gBAAgBN,IACpB,0GACA;CACEO,UAAU;EACRC,MAAM;GACJC,KAAK;GACLC,QAAQ;GACRC,OAAO;GACPC,KAAK;EACP;EACAC,SAAS;GACPC,MAAM;GACNC,OAAO;EACT;CACF;CACAC,kBAAkB;EAChB;GACER,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;CAAC;CAEHC,iBAAiB;EAAEV,MAAM;EAAOK,SAAS;CAAO;AAClD,CACF;;AAGA,IAAMM,mBACJX,MACAK,YACqBA,aAAaL,QAAQ,WAAW,QAAQ,UAAU;AAWzE,SAAgBkB,aAAaC,OAA0B;CACrD,MAAM,CAACC,OAAOC,QAAQ9B,WAAW4B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAkB,CACnB;CACD,MAAMG,SAASrC,iBAAiB;CAChC,MAAMsC,mBAAmB3B,6BAA6B;EACpD4B,MAAMF,OAAOG;EACbT,iBAAiBI,MAAMJ;EACvBU,iBAAiBN,MAAMM;EACvBC,kBAAkBP,MAAMO;CAC1B,CAAC;CAED,MAAMtB,gBAAgBM,gBAAgB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AC;CACjD,OAAAS,gBAAQ9C,OAAcuE,OAAKrB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQrC,GAAGD,cAAc0B,MAAMX,KAAK;CAAC,EAAA,GAAMY,IAAI,CAAA;AAC5E;AAEA,SAAgBiC,iBAAiBnC,OAAyD;CACxF,MAAM,CAACC,OAAOC,QAAQ9B,WAAW4B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAS,gBACG9C,OAAcyE,aAAWvB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQrC,GAAG,iCAAiCyB,MAAMX,KAAK;CAAC,EAAA,GAAMY,IAAI,CAAA;AAEhG"}
@@ -1,15 +1,25 @@
1
1
  import { Tooltip as KobalteTooltip } from '@kobalte/core/tooltip';
2
- import type { ComponentProps } from 'solid-js';
2
+ import type { ComponentProps, JSX } from 'solid-js';
3
3
  export type TooltipProviderProps = {
4
4
  children?: ComponentProps<'div'>['children'];
5
5
  openDelay?: number;
6
6
  closeDelay?: number;
7
7
  skipDelayDuration?: number;
8
8
  };
9
- export declare function TooltipProvider(props: TooltipProviderProps): import("solid-js").JSX.Element;
9
+ export declare function TooltipProvider(props: TooltipProviderProps): JSX.Element;
10
10
  export type TooltipRootProps = ComponentProps<typeof KobalteTooltip>;
11
- export declare function Tooltip(props: TooltipRootProps): import("solid-js").JSX.Element;
12
- export declare function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>): import("solid-js").JSX.Element;
13
- export type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content>;
14
- export declare function TooltipContent(props: TooltipContentProps): import("solid-js").JSX.Element;
11
+ export declare function Tooltip(props: TooltipRootProps): JSX.Element;
12
+ export declare function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>): JSX.Element;
13
+ export type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {
14
+ /**
15
+ * A leading icon, repeating the trigger's glyph inside the tip — the side
16
+ * rail's icon+label treatment, offered so a toolbar or rail tooltip does not
17
+ * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`
18
+ * while closed and never the accessible name, so the icon must not be the
19
+ * only carrier of meaning. Size it by leaving the svg bare; the slot fixes
20
+ * it to the system's control size.
21
+ */
22
+ icon?: JSX.Element;
23
+ };
24
+ export declare function TooltipContent(props: TooltipContentProps): JSX.Element;
15
25
  //# sourceMappingURL=tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAqB,MAAM,uBAAuB,CAAA;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAyI9C,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAA;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,kCAY1D;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,CAAA;AAEpE,wBAAgB,OAAO,CAAC,KAAK,EAAE,gBAAgB,kCAgJ9C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,kCA0ClF;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,CAAA;AAE/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,kCAyDxD"}
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAqB,MAAM,uBAAuB,CAAA;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AA0InD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAA;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAY1D;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,CAAA;AAEpE,wBAAgB,OAAO,CAAC,KAAK,EAAE,gBAAgB,eAgJ9C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,eA0ClF;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG;IAChF;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAwExD"}
@@ -1,9 +1,10 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { tooltipTip, topLayerProps } from "../../../lib/overlay.js";
3
- import { createComponent, isServer, memo, mergeProps } from "solid-js/web";
4
- import { createContext, createEffect, createSignal, createUniqueId, onCleanup, splitProps, useContext } from "solid-js";
3
+ import { createComponent, insert, isServer, memo, mergeProps, template } from "solid-js/web";
4
+ import { Show, createContext, createEffect, createSignal, createUniqueId, onCleanup, splitProps, useContext } from "solid-js";
5
5
  import { Tooltip, useTooltipContext } from "@kobalte/core/tooltip";
6
6
  //#region src/components/ui/tooltip/tooltip.tsx
7
+ var _tmpl$ = /*#__PURE__*/ template(`<span data-slot=tooltip-icon aria-hidden=true class="flex size-4 shrink-0 items-center justify-center [&amp;_svg]:size-4">`);
7
8
  var tooltipDefaults = {
8
9
  /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */
9
10
  openDelay: 400,
@@ -257,6 +258,7 @@ function TooltipContent(props) {
257
258
  const [local, rest] = splitProps(props, [
258
259
  "class",
259
260
  "children",
261
+ "icon",
260
262
  "aria-hidden",
261
263
  "onEscapeKeyDown",
262
264
  "onPointerDownOutside"
@@ -266,7 +268,7 @@ function TooltipContent(props) {
266
268
  return createComponent(Tooltip.Content, mergeProps({
267
269
  "data-slot": "tooltip-content",
268
270
  get ["class"]() {
269
- return cn(tooltipTip, "z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1", "origin-(--kb-tooltip-content-transform-origin) text-balance", "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-expanded:duration-150 data-closed:duration-100", local.class);
271
+ return cn(tooltipTip, "z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1", "origin-(--kb-tooltip-content-transform-origin) text-balance", "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-expanded:duration-150 data-closed:duration-100", { "flex items-center gap-2 whitespace-nowrap": !!local.icon }, local.class);
270
272
  },
271
273
  style: { "pointer-events": "none" },
272
274
  get ["aria-hidden"]() {
@@ -281,7 +283,16 @@ function TooltipContent(props) {
281
283
  if (!event.defaultPrevented) interaction?.markCloseIntent();
282
284
  }
283
285
  }, topLayerProps, rest, { get children() {
284
- return local.children;
286
+ return [createComponent(Show, {
287
+ get when() {
288
+ return local.icon;
289
+ },
290
+ children: (icon) => (() => {
291
+ var _el$ = _tmpl$();
292
+ insert(_el$, icon);
293
+ return _el$;
294
+ })()
295
+ }), memo(() => local.children)];
285
296
  } }));
286
297
  } });
287
298
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":["Tooltip","KobalteTooltip","useTooltipContext","ComponentProps","createContext","createEffect","createSignal","createUniqueId","onCleanup","splitProps","useContext","isServer","tooltipTip","topLayerProps","cn","TooltipTiming","openDelay","closeDelay","skipDelayDuration","tooltipDefaults","TooltipTimingContext","TooltipInteraction","id","trigger","HTMLElement","setTrigger","element","isOpen","isDisabled","isTriggerFocused","markOpenIntent","clearOpenIntent","requestCloseFromAnotherTooltip","markPointerCloseIntent","clearPointerCloseIntent","markCloseIntent","TooltipInteractionContext","openTooltipInteractions","Set","pendingTooltipOpenId","tooltipScrollListenerAttached","clearPendingTooltipOpen","undefined","tooltipScrollContainsTrigger","event","Event","target","window","Node","contains","handleTooltipScroll","interaction","handleTooltipPointerMove","PointerEvent","setTooltipInteractionOpen","open","has","add","addEventListener","document","delete","size","removeEventListener","registerTooltipInteraction","invokeEventHandler","handler","Array","isArray","callback","data","TooltipProviderProps","children","TooltipProvider","props","_$createComponent","Provider","value","TooltipRootProps","timing","local","rest","controlled","uncontrolledOpen","setUncontrolledOpen","defaultOpen","closeIntent","ignoreDuplicateClose","onOpenChange","next","source","pointerCloseIntentUntil","pointerCloseIntentTimeout","ReturnType","setTimeout","clearTimeout","Date","now","queueMicrotask","disabled","Boolean","activeElement","openInteraction","focusedTrigger","anotherTooltipOpening","pointerClosePending","handleKeyDown","KeyboardEvent","key","_$mergeProps","TooltipTrigger","Trigger","ref","onFocus","defaultPrevented","onBlur","onPointerEnter","onPointerLeave","onClick","TooltipContentProps","Content","TooltipContent","context","Portal","class","style","aria-hidden","_$memo","onEscapeKeyDown","onPointerDownOutside","_$createComponent","Tooltip","KobalteTooltip","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'\nimport type { ComponentProps } from 'solid-js'\nimport {\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { tooltipTip, topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * The provider sets the *timing* defaults for every tooltip below it.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * After a tooltip has been seen, the next one opens immediately for this\n * long. This is what makes moving along a row of icons feel like one\n * gesture instead of four separate waits.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\ntype TooltipInteraction = {\n id: string\n trigger: () => HTMLElement | undefined\n setTrigger: (element: HTMLElement) => void\n isOpen: () => boolean\n isDisabled: () => boolean\n isTriggerFocused: () => boolean\n markOpenIntent: () => void\n clearOpenIntent: () => void\n requestCloseFromAnotherTooltip: () => void\n markPointerCloseIntent: () => void\n clearPointerCloseIntent: () => void\n markCloseIntent: () => void\n}\n\nconst TooltipInteractionContext = createContext<TooltipInteraction>()\nconst openTooltipInteractions = new Set<TooltipInteraction>()\nlet pendingTooltipOpenId: string | undefined\nlet tooltipScrollListenerAttached = false\n\nfunction clearPendingTooltipOpen(id: string) {\n if (pendingTooltipOpenId === id) pendingTooltipOpenId = undefined\n}\n\nfunction tooltipScrollContainsTrigger(event: Event, trigger: HTMLElement) {\n const target = event.target\n return target === window || (target instanceof Node && target.contains(trigger))\n}\n\nfunction handleTooltipScroll(event: Event) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n if (interaction.isOpen() && trigger && tooltipScrollContainsTrigger(event, trigger)) {\n interaction.markCloseIntent()\n }\n }\n}\n\nfunction handleTooltipPointerMove(event: PointerEvent) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n const target = event.target\n if (\n interaction.isOpen() &&\n interaction.isTriggerFocused() &&\n trigger &&\n !(target instanceof Node && trigger.contains(target))\n ) {\n interaction.markPointerCloseIntent()\n }\n }\n}\n\nfunction setTooltipInteractionOpen(interaction: TooltipInteraction, open: boolean) {\n if (isServer) return\n\n if (open) {\n if (openTooltipInteractions.has(interaction)) return\n openTooltipInteractions.add(interaction)\n if (!tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = true\n // Register before Kobalte's global listeners so intentional scroll\n // dismissal can be distinguished from its delayed pointer dismissal.\n window.addEventListener('scroll', handleTooltipScroll, true)\n document.addEventListener('pointermove', handleTooltipPointerMove, true)\n }\n } else {\n openTooltipInteractions.delete(interaction)\n if (openTooltipInteractions.size === 0 && tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = false\n window.removeEventListener('scroll', handleTooltipScroll, true)\n document.removeEventListener('pointermove', handleTooltipPointerMove, true)\n }\n }\n}\n\nfunction registerTooltipInteraction(interaction: TooltipInteraction) {\n onCleanup(() => {\n setTooltipInteractionOpen(interaction, false)\n clearPendingTooltipOpen(interaction.id)\n })\n}\n\nfunction invokeEventHandler(handler: unknown, event: Event) {\n if (Array.isArray(handler)) {\n const [callback, data] = handler as [(data: unknown, event: Event) => void, unknown]\n callback(data, event)\n } else if (typeof handler === 'function') {\n const callback = handler as (event: Event) => void\n callback(event)\n }\n}\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext.Provider\n value={{\n openDelay: props.openDelay ?? tooltipDefaults.openDelay,\n closeDelay: props.closeDelay ?? tooltipDefaults.closeDelay,\n skipDelayDuration: props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration,\n }}\n >\n {props.children}\n </TooltipTimingContext.Provider>\n )\n}\n\nexport type TooltipRootProps = ComponentProps<typeof KobalteTooltip>\n\nexport function Tooltip(props: TooltipRootProps) {\n const timing = useContext(TooltipTimingContext)\n const [local, rest] = splitProps(props, ['open', 'defaultOpen', 'onOpenChange', 'disabled'])\n const id = createUniqueId()\n const controlled = () => local.open !== undefined\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const isOpen = () => (controlled() ? (local.open ?? false) : uncontrolledOpen())\n const [trigger, setTrigger] = createSignal<HTMLElement>()\n let closeIntent = false\n let ignoreDuplicateClose = false\n let onOpenChange: (next: boolean, source?: 'handoff') => void\n let pointerCloseIntentUntil = 0\n let pointerCloseIntentTimeout: ReturnType<typeof setTimeout> | undefined\n const clearPointerCloseIntent = () => {\n pointerCloseIntentUntil = 0\n if (pointerCloseIntentTimeout) clearTimeout(pointerCloseIntentTimeout)\n pointerCloseIntentTimeout = undefined\n }\n const markPointerCloseIntent = () => {\n if (!isOpen()) return\n clearPointerCloseIntent()\n const closeDelay = props.closeDelay ?? timing.closeDelay\n pointerCloseIntentUntil = Date.now() + closeDelay + 50\n pointerCloseIntentTimeout = setTimeout(clearPointerCloseIntent, closeDelay + 50)\n }\n const markCloseIntent = () => {\n closeIntent = true\n clearPointerCloseIntent()\n queueMicrotask(() => {\n closeIntent = false\n })\n }\n const requestCloseFromAnotherTooltip = () => {\n if (!isOpen()) return\n\n // Another trigger is an explicit handoff, even when a focused tooltip has\n // a pending pointer-close intent that would otherwise suppress Kobalte's\n // close callback. Route the request through the same controlled/uncontrolled\n // state contract as Kobalte and ignore its duplicate callback for this turn.\n ignoreDuplicateClose = true\n queueMicrotask(() => {\n ignoreDuplicateClose = false\n })\n onOpenChange(false, 'handoff')\n }\n const interaction: TooltipInteraction = {\n id,\n trigger,\n setTrigger,\n isOpen,\n isDisabled: () => local.disabled ?? false,\n isTriggerFocused: () =>\n Boolean(trigger() && typeof document !== 'undefined' && trigger() === document.activeElement),\n markOpenIntent: () => {\n clearPointerCloseIntent()\n pendingTooltipOpenId = id\n // A focused tooltip ignores ordinary pointer movement, but entering or\n // focusing another tooltip is an explicit transfer.\n for (const openInteraction of openTooltipInteractions) {\n if (openInteraction.id !== id) openInteraction.requestCloseFromAnotherTooltip()\n }\n },\n clearOpenIntent: () => clearPendingTooltipOpen(id),\n requestCloseFromAnotherTooltip,\n markPointerCloseIntent,\n clearPointerCloseIntent,\n markCloseIntent,\n }\n registerTooltipInteraction(interaction)\n onCleanup(() => {\n clearPointerCloseIntent()\n ignoreDuplicateClose = false\n })\n if (isOpen()) setTooltipInteractionOpen(interaction, true)\n createEffect(() => setTooltipInteractionOpen(interaction, isOpen()))\n onOpenChange = (next: boolean, source) => {\n if (!next && source !== 'handoff' && ignoreDuplicateClose) return\n\n if (next) {\n clearPendingTooltipOpen(id)\n clearPointerCloseIntent()\n // Install this capture listener before Kobalte's open-state effect adds\n // its scroll listener later in the same update.\n setTooltipInteractionOpen(interaction, true)\n } else {\n const focusedTrigger = interaction.isTriggerFocused()\n const anotherTooltipOpening =\n pendingTooltipOpenId !== undefined && pendingTooltipOpenId !== id\n const pointerClosePending = Date.now() <= pointerCloseIntentUntil\n if (\n source !== 'handoff' &&\n focusedTrigger &&\n pointerClosePending &&\n !closeIntent &&\n !anotherTooltipOpening\n ) {\n clearPointerCloseIntent()\n return\n }\n closeIntent = false\n clearPointerCloseIntent()\n clearPendingTooltipOpen(id)\n }\n\n if (!controlled()) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n if (next) {\n // A controlled parent can reject the open request without changing its\n // signal, so the effect above would not rerun to release this listener.\n queueMicrotask(() => {\n if (!isOpen()) setTooltipInteractionOpen(interaction, false)\n })\n }\n }\n\n // Kobalte dismisses on Escape only when its content owns the top-most\n // layer, and a handoff keeps the previous tooltip's content mounted while\n // it exits — swallowing the key for the tooltip that just took over.\n // Listening on document (capture) closes this tooltip first; the layer's\n // own handler still runs for anything stacked above it.\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n markCloseIntent()\n onOpenChange(false)\n }\n createEffect(() => {\n if (isServer || !isOpen()) return\n document.addEventListener('keydown', handleKeyDown, true)\n onCleanup(() => document.removeEventListener('keydown', handleKeyDown, true))\n })\n\n return (\n <TooltipInteractionContext.Provider value={interaction}>\n <KobalteTooltip\n open={isOpen()}\n onOpenChange={onOpenChange}\n disabled={local.disabled}\n openDelay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n skipDelayDuration={props.skipDelayDuration ?? timing.skipDelayDuration}\n {...rest}\n />\n </TooltipInteractionContext.Provider>\n )\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'ref',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onClick',\n ])\n\n return (\n <KobalteTooltip.Trigger\n {...rest}\n ref={(element) => {\n interaction?.setTrigger(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onFocus={(event) => {\n invokeEventHandler(local.onFocus, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onBlur={(event) => {\n invokeEventHandler(local.onBlur, event)\n interaction?.clearOpenIntent()\n interaction?.markCloseIntent()\n }}\n onPointerEnter={(event) => {\n invokeEventHandler(local.onPointerEnter, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onPointerLeave={(event) => {\n invokeEventHandler(local.onPointerLeave, event)\n interaction?.clearOpenIntent()\n interaction?.markPointerCloseIntent()\n }}\n onClick={(event) => {\n invokeEventHandler(local.onClick, event)\n interaction?.markCloseIntent()\n }}\n />\n )\n}\n\nexport type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content>\n\nexport function TooltipContent(props: TooltipContentProps) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'aria-hidden',\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n ])\n const context = useTooltipContext()\n\n // Kobalte keeps force-mounted and exiting content present after close. Hide\n // that retained tooltip from assistive technology until it opens again.\n return (\n <KobalteTooltip.Portal>\n <KobalteTooltip.Content\n /* The slot is what base.css's pointer-transparency rule keys on; every\n tip carries it, so no consumer has to remember to pass it. */\n data-slot=\"tooltip-content\"\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which\n // Kobalte can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1',\n 'origin-(--kb-tooltip-content-transform-origin) text-balance',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. Kobalte\n // inlines pointer-events auto, so this is forced after its merge; the\n // pointer belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n aria-hidden={context.isOpen() ? local['aria-hidden'] : true}\n onEscapeKeyDown={(event) => {\n invokeEventHandler(local.onEscapeKeyDown, event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n onPointerDownOutside={(event) => {\n invokeEventHandler(local.onPointerDownOutside, event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n // A tooltip opened from inside a modal dialog is part of that dialog's\n // surface, so it carries the same top-layer exemption as a menu or a\n // popover — without it the dialog's hide-outside observer aria-hides\n // the tip while it is on screen.\n {...topLayerProps}\n {...rest}\n >\n {local.children}\n </KobalteTooltip.Content>\n </KobalteTooltip.Portal>\n )\n}\n"],"mappings":";;;;;;AA8BA,IAAMmB,kBAAiC;;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AAyB;CACxD,MAAM,CAAC2C,OAAOC,QAAQvE,WAAWgE,OAAO;EACtC;EACA;EACA;EACA;EACA;CAAsB,CACvB;CACD,MAAMgD,UAAUvH,kBAAkB;CAIlC,OAAAwE,gBACGzE,QAAeyH,QAAM,EAAA,IAAAnD,WAAA;EAAA,OAAAG,gBACnBzE,QAAesH,SAAOX,WAAA;GAAA,aAAA;GAAA,KAAA,WAAA;IAAA,OAId9F,GACLF,YAIA,+DACA,+DACA,6EACA,0EACA,uDACAmE,MAAM4C,KACR;GAAC;GAMDC,OAAO,EAAE,kBAAkB,OAAO;GAAC,KAAA,iBAAA;IAAA,OACtBE,WAAA,CAAA,CAAAL,QAAQ9F,OAAO,CAAC,CAAA,CAAA,IAAGoD,MAAM,iBAAiB;GAAI;GAC3DgD,kBAAkBnF,UAAU;IAC1BoB,mBAAmBe,MAAMgD,iBAAiBnF,KAAK;IAC/C,IAAI,CAACA,MAAMqE,kBAAkB9D,aAAahB,gBAAgB;GAC5D;GACA6F,uBAAuBpF,UAAU;IAC/BoB,mBAAmBe,MAAMiD,sBAAsBpF,KAAK;IACpD,IAAI,CAACA,MAAMqE,kBAAkB9D,aAAahB,gBAAgB;GAC5D;EAAC,GAKGtB,eACAmE,MAAI,EAAA,IAAAT,WAAA;GAAA,OAEPQ,MAAMR;EAAQ,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAIvB"}
1
+ {"version":3,"file":"tooltip.js","names":["Tooltip","KobalteTooltip","useTooltipContext","ComponentProps","JSX","createContext","createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","useContext","isServer","tooltipTip","topLayerProps","cn","TooltipTiming","openDelay","closeDelay","skipDelayDuration","tooltipDefaults","TooltipTimingContext","TooltipInteraction","id","trigger","HTMLElement","setTrigger","element","isOpen","isDisabled","isTriggerFocused","markOpenIntent","clearOpenIntent","requestCloseFromAnotherTooltip","markPointerCloseIntent","clearPointerCloseIntent","markCloseIntent","TooltipInteractionContext","openTooltipInteractions","Set","pendingTooltipOpenId","tooltipScrollListenerAttached","clearPendingTooltipOpen","undefined","tooltipScrollContainsTrigger","event","Event","target","window","Node","contains","handleTooltipScroll","interaction","handleTooltipPointerMove","PointerEvent","setTooltipInteractionOpen","open","has","add","addEventListener","document","delete","size","removeEventListener","registerTooltipInteraction","invokeEventHandler","handler","Array","isArray","callback","data","TooltipProviderProps","children","TooltipProvider","props","_$createComponent","Provider","value","TooltipRootProps","timing","local","rest","controlled","uncontrolledOpen","setUncontrolledOpen","defaultOpen","closeIntent","ignoreDuplicateClose","onOpenChange","next","source","pointerCloseIntentUntil","pointerCloseIntentTimeout","ReturnType","setTimeout","clearTimeout","Date","now","queueMicrotask","disabled","Boolean","activeElement","openInteraction","focusedTrigger","anotherTooltipOpening","pointerClosePending","handleKeyDown","KeyboardEvent","key","_$mergeProps","TooltipTrigger","Trigger","ref","onFocus","defaultPrevented","onBlur","onPointerEnter","onPointerLeave","onClick","TooltipContentProps","Content","icon","Element","TooltipContent","context","Portal","class","style","aria-hidden","_$memo","onEscapeKeyDown","onPointerDownOutside","when","_el$","_tmpl$","_$insert","_$createComponent","Tooltip","KobalteTooltip","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport {\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { tooltipTip, topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * The provider sets the *timing* defaults for every tooltip below it.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * After a tooltip has been seen, the next one opens immediately for this\n * long. This is what makes moving along a row of icons feel like one\n * gesture instead of four separate waits.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\ntype TooltipInteraction = {\n id: string\n trigger: () => HTMLElement | undefined\n setTrigger: (element: HTMLElement) => void\n isOpen: () => boolean\n isDisabled: () => boolean\n isTriggerFocused: () => boolean\n markOpenIntent: () => void\n clearOpenIntent: () => void\n requestCloseFromAnotherTooltip: () => void\n markPointerCloseIntent: () => void\n clearPointerCloseIntent: () => void\n markCloseIntent: () => void\n}\n\nconst TooltipInteractionContext = createContext<TooltipInteraction>()\nconst openTooltipInteractions = new Set<TooltipInteraction>()\nlet pendingTooltipOpenId: string | undefined\nlet tooltipScrollListenerAttached = false\n\nfunction clearPendingTooltipOpen(id: string) {\n if (pendingTooltipOpenId === id) pendingTooltipOpenId = undefined\n}\n\nfunction tooltipScrollContainsTrigger(event: Event, trigger: HTMLElement) {\n const target = event.target\n return target === window || (target instanceof Node && target.contains(trigger))\n}\n\nfunction handleTooltipScroll(event: Event) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n if (interaction.isOpen() && trigger && tooltipScrollContainsTrigger(event, trigger)) {\n interaction.markCloseIntent()\n }\n }\n}\n\nfunction handleTooltipPointerMove(event: PointerEvent) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n const target = event.target\n if (\n interaction.isOpen() &&\n interaction.isTriggerFocused() &&\n trigger &&\n !(target instanceof Node && trigger.contains(target))\n ) {\n interaction.markPointerCloseIntent()\n }\n }\n}\n\nfunction setTooltipInteractionOpen(interaction: TooltipInteraction, open: boolean) {\n if (isServer) return\n\n if (open) {\n if (openTooltipInteractions.has(interaction)) return\n openTooltipInteractions.add(interaction)\n if (!tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = true\n // Register before Kobalte's global listeners so intentional scroll\n // dismissal can be distinguished from its delayed pointer dismissal.\n window.addEventListener('scroll', handleTooltipScroll, true)\n document.addEventListener('pointermove', handleTooltipPointerMove, true)\n }\n } else {\n openTooltipInteractions.delete(interaction)\n if (openTooltipInteractions.size === 0 && tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = false\n window.removeEventListener('scroll', handleTooltipScroll, true)\n document.removeEventListener('pointermove', handleTooltipPointerMove, true)\n }\n }\n}\n\nfunction registerTooltipInteraction(interaction: TooltipInteraction) {\n onCleanup(() => {\n setTooltipInteractionOpen(interaction, false)\n clearPendingTooltipOpen(interaction.id)\n })\n}\n\nfunction invokeEventHandler(handler: unknown, event: Event) {\n if (Array.isArray(handler)) {\n const [callback, data] = handler as [(data: unknown, event: Event) => void, unknown]\n callback(data, event)\n } else if (typeof handler === 'function') {\n const callback = handler as (event: Event) => void\n callback(event)\n }\n}\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext.Provider\n value={{\n openDelay: props.openDelay ?? tooltipDefaults.openDelay,\n closeDelay: props.closeDelay ?? tooltipDefaults.closeDelay,\n skipDelayDuration: props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration,\n }}\n >\n {props.children}\n </TooltipTimingContext.Provider>\n )\n}\n\nexport type TooltipRootProps = ComponentProps<typeof KobalteTooltip>\n\nexport function Tooltip(props: TooltipRootProps) {\n const timing = useContext(TooltipTimingContext)\n const [local, rest] = splitProps(props, ['open', 'defaultOpen', 'onOpenChange', 'disabled'])\n const id = createUniqueId()\n const controlled = () => local.open !== undefined\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const isOpen = () => (controlled() ? (local.open ?? false) : uncontrolledOpen())\n const [trigger, setTrigger] = createSignal<HTMLElement>()\n let closeIntent = false\n let ignoreDuplicateClose = false\n let onOpenChange: (next: boolean, source?: 'handoff') => void\n let pointerCloseIntentUntil = 0\n let pointerCloseIntentTimeout: ReturnType<typeof setTimeout> | undefined\n const clearPointerCloseIntent = () => {\n pointerCloseIntentUntil = 0\n if (pointerCloseIntentTimeout) clearTimeout(pointerCloseIntentTimeout)\n pointerCloseIntentTimeout = undefined\n }\n const markPointerCloseIntent = () => {\n if (!isOpen()) return\n clearPointerCloseIntent()\n const closeDelay = props.closeDelay ?? timing.closeDelay\n pointerCloseIntentUntil = Date.now() + closeDelay + 50\n pointerCloseIntentTimeout = setTimeout(clearPointerCloseIntent, closeDelay + 50)\n }\n const markCloseIntent = () => {\n closeIntent = true\n clearPointerCloseIntent()\n queueMicrotask(() => {\n closeIntent = false\n })\n }\n const requestCloseFromAnotherTooltip = () => {\n if (!isOpen()) return\n\n // Another trigger is an explicit handoff, even when a focused tooltip has\n // a pending pointer-close intent that would otherwise suppress Kobalte's\n // close callback. Route the request through the same controlled/uncontrolled\n // state contract as Kobalte and ignore its duplicate callback for this turn.\n ignoreDuplicateClose = true\n queueMicrotask(() => {\n ignoreDuplicateClose = false\n })\n onOpenChange(false, 'handoff')\n }\n const interaction: TooltipInteraction = {\n id,\n trigger,\n setTrigger,\n isOpen,\n isDisabled: () => local.disabled ?? false,\n isTriggerFocused: () =>\n Boolean(trigger() && typeof document !== 'undefined' && trigger() === document.activeElement),\n markOpenIntent: () => {\n clearPointerCloseIntent()\n pendingTooltipOpenId = id\n // A focused tooltip ignores ordinary pointer movement, but entering or\n // focusing another tooltip is an explicit transfer.\n for (const openInteraction of openTooltipInteractions) {\n if (openInteraction.id !== id) openInteraction.requestCloseFromAnotherTooltip()\n }\n },\n clearOpenIntent: () => clearPendingTooltipOpen(id),\n requestCloseFromAnotherTooltip,\n markPointerCloseIntent,\n clearPointerCloseIntent,\n markCloseIntent,\n }\n registerTooltipInteraction(interaction)\n onCleanup(() => {\n clearPointerCloseIntent()\n ignoreDuplicateClose = false\n })\n if (isOpen()) setTooltipInteractionOpen(interaction, true)\n createEffect(() => setTooltipInteractionOpen(interaction, isOpen()))\n onOpenChange = (next: boolean, source) => {\n if (!next && source !== 'handoff' && ignoreDuplicateClose) return\n\n if (next) {\n clearPendingTooltipOpen(id)\n clearPointerCloseIntent()\n // Install this capture listener before Kobalte's open-state effect adds\n // its scroll listener later in the same update.\n setTooltipInteractionOpen(interaction, true)\n } else {\n const focusedTrigger = interaction.isTriggerFocused()\n const anotherTooltipOpening =\n pendingTooltipOpenId !== undefined && pendingTooltipOpenId !== id\n const pointerClosePending = Date.now() <= pointerCloseIntentUntil\n if (\n source !== 'handoff' &&\n focusedTrigger &&\n pointerClosePending &&\n !closeIntent &&\n !anotherTooltipOpening\n ) {\n clearPointerCloseIntent()\n return\n }\n closeIntent = false\n clearPointerCloseIntent()\n clearPendingTooltipOpen(id)\n }\n\n if (!controlled()) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n if (next) {\n // A controlled parent can reject the open request without changing its\n // signal, so the effect above would not rerun to release this listener.\n queueMicrotask(() => {\n if (!isOpen()) setTooltipInteractionOpen(interaction, false)\n })\n }\n }\n\n // Kobalte dismisses on Escape only when its content owns the top-most\n // layer, and a handoff keeps the previous tooltip's content mounted while\n // it exits — swallowing the key for the tooltip that just took over.\n // Listening on document (capture) closes this tooltip first; the layer's\n // own handler still runs for anything stacked above it.\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n markCloseIntent()\n onOpenChange(false)\n }\n createEffect(() => {\n if (isServer || !isOpen()) return\n document.addEventListener('keydown', handleKeyDown, true)\n onCleanup(() => document.removeEventListener('keydown', handleKeyDown, true))\n })\n\n return (\n <TooltipInteractionContext.Provider value={interaction}>\n <KobalteTooltip\n open={isOpen()}\n onOpenChange={onOpenChange}\n disabled={local.disabled}\n openDelay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n skipDelayDuration={props.skipDelayDuration ?? timing.skipDelayDuration}\n {...rest}\n />\n </TooltipInteractionContext.Provider>\n )\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'ref',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onClick',\n ])\n\n return (\n <KobalteTooltip.Trigger\n {...rest}\n ref={(element) => {\n interaction?.setTrigger(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onFocus={(event) => {\n invokeEventHandler(local.onFocus, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onBlur={(event) => {\n invokeEventHandler(local.onBlur, event)\n interaction?.clearOpenIntent()\n interaction?.markCloseIntent()\n }}\n onPointerEnter={(event) => {\n invokeEventHandler(local.onPointerEnter, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onPointerLeave={(event) => {\n invokeEventHandler(local.onPointerLeave, event)\n interaction?.clearOpenIntent()\n interaction?.markPointerCloseIntent()\n }}\n onClick={(event) => {\n invokeEventHandler(local.onClick, event)\n interaction?.markCloseIntent()\n }}\n />\n )\n}\n\nexport type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does not\n * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'icon',\n 'aria-hidden',\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n ])\n const context = useTooltipContext()\n\n // Kobalte keeps force-mounted and exiting content present after close. Hide\n // that retained tooltip from assistive technology until it opens again.\n return (\n <KobalteTooltip.Portal>\n <KobalteTooltip.Content\n /* The slot is what base.css's pointer-transparency rule keys on; every\n tip carries it, so no consumer has to remember to pass it. */\n data-slot=\"tooltip-content\"\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which\n // Kobalte can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1',\n 'origin-(--kb-tooltip-content-transform-origin) text-balance',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!local.icon },\n local.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. Kobalte\n // inlines pointer-events auto, so this is forced after its merge; the\n // pointer belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n aria-hidden={context.isOpen() ? local['aria-hidden'] : true}\n onEscapeKeyDown={(event) => {\n invokeEventHandler(local.onEscapeKeyDown, event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n onPointerDownOutside={(event) => {\n invokeEventHandler(local.onPointerDownOutside, event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n // A tooltip opened from inside a modal dialog is part of that dialog's\n // surface, so it carries the same top-layer exemption as a menu or a\n // popover — without it the dialog's hide-outside observer aria-hides\n // the tip while it is on screen.\n {...topLayerProps}\n {...rest}\n >\n <Show when={local.icon}>\n {(icon) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-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