@epilot/spark-ui 0.29.0 → 0.30.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 (129) hide show
  1. package/dist/calendar-lists-CTby2kR5.d.cts +27 -0
  2. package/dist/calendar-lists-DoloqsCN.d.ts +27 -0
  3. package/dist/components/accordion.cjs +1 -1
  4. package/dist/components/accordion.js +1 -1
  5. package/dist/components/attachment.cjs +1 -1
  6. package/dist/components/attachment.d.cts +1 -1
  7. package/dist/components/attachment.d.ts +1 -1
  8. package/dist/components/attachment.js +1 -1
  9. package/dist/components/autocomplete.cjs +1 -0
  10. package/dist/components/autocomplete.cjs.map +1 -1
  11. package/dist/components/autocomplete.js +1 -0
  12. package/dist/components/autocomplete.js.map +1 -1
  13. package/dist/components/badge.cjs +1 -1
  14. package/dist/components/badge.js +1 -1
  15. package/dist/components/banner.cjs +1 -1
  16. package/dist/components/banner.js +1 -1
  17. package/dist/components/box.js +1 -1
  18. package/dist/components/breadcrumbs.cjs +1 -1
  19. package/dist/components/breadcrumbs.js +1 -1
  20. package/dist/components/bubble.cjs +1 -1
  21. package/dist/components/bubble.d.cts +1 -1
  22. package/dist/components/bubble.d.ts +1 -1
  23. package/dist/components/bubble.js +1 -1
  24. package/dist/components/button-group.cjs +1 -1
  25. package/dist/components/button-group.js +1 -1
  26. package/dist/components/button.cjs +1 -1
  27. package/dist/components/button.d.cts +2 -2
  28. package/dist/components/button.d.ts +2 -2
  29. package/dist/components/button.js +1 -1
  30. package/dist/components/calendar.cjs +23 -4
  31. package/dist/components/calendar.cjs.map +1 -1
  32. package/dist/components/calendar.d.cts +11 -2
  33. package/dist/components/calendar.d.ts +11 -2
  34. package/dist/components/calendar.js +23 -4
  35. package/dist/components/calendar.js.map +1 -1
  36. package/dist/components/callout.cjs +1 -1
  37. package/dist/components/callout.js +1 -1
  38. package/dist/components/card.cjs +1 -1
  39. package/dist/components/card.js +2 -2
  40. package/dist/components/combobox.cjs +45 -15
  41. package/dist/components/combobox.cjs.map +1 -1
  42. package/dist/components/combobox.d.cts +2 -0
  43. package/dist/components/combobox.d.ts +2 -0
  44. package/dist/components/combobox.js +46 -16
  45. package/dist/components/combobox.js.map +1 -1
  46. package/dist/components/drawer.cjs +1 -1
  47. package/dist/components/drawer.js +1 -1
  48. package/dist/components/empty-state.cjs +1 -1
  49. package/dist/components/empty-state.js +1 -1
  50. package/dist/components/entity-card.cjs +1 -1
  51. package/dist/components/entity-card.js +1 -1
  52. package/dist/components/field.cjs +1 -1
  53. package/dist/components/field.js +1 -1
  54. package/dist/components/hero-metric.cjs +1 -1
  55. package/dist/components/hero-metric.js +1 -1
  56. package/dist/components/info-block.cjs +1 -1
  57. package/dist/components/info-block.d.cts +1 -1
  58. package/dist/components/info-block.d.ts +1 -1
  59. package/dist/components/info-block.js +1 -1
  60. package/dist/components/input-date-time.cjs +212 -0
  61. package/dist/components/input-date-time.cjs.map +1 -0
  62. package/dist/components/input-date-time.d.cts +38 -0
  63. package/dist/components/input-date-time.d.ts +38 -0
  64. package/dist/components/input-date-time.js +205 -0
  65. package/dist/components/input-date-time.js.map +1 -0
  66. package/dist/components/input-group.cjs +2 -2
  67. package/dist/components/input-group.js +2 -2
  68. package/dist/components/input-otp.cjs +1 -1
  69. package/dist/components/input-otp.js +1 -1
  70. package/dist/components/input.cjs +1 -1
  71. package/dist/components/input.js +1 -1
  72. package/dist/components/list.cjs +1 -1
  73. package/dist/components/list.js +1 -1
  74. package/dist/components/marker.cjs +1 -1
  75. package/dist/components/marker.d.cts +1 -1
  76. package/dist/components/marker.d.ts +1 -1
  77. package/dist/components/marker.js +1 -1
  78. package/dist/components/message-scroller.cjs +1 -1
  79. package/dist/components/message-scroller.js +1 -1
  80. package/dist/components/page-header.cjs +1 -1
  81. package/dist/components/page-header.js +1 -1
  82. package/dist/components/popover.cjs +1 -1
  83. package/dist/components/popover.js +1 -1
  84. package/dist/components/select.cjs +2 -1
  85. package/dist/components/select.cjs.map +1 -1
  86. package/dist/components/select.js +2 -1
  87. package/dist/components/select.js.map +1 -1
  88. package/dist/components/separator.cjs +1 -1
  89. package/dist/components/separator.js +1 -1
  90. package/dist/components/skeleton.cjs +1 -1
  91. package/dist/components/skeleton.js +1 -1
  92. package/dist/components/textarea.cjs +1 -1
  93. package/dist/components/textarea.js +1 -1
  94. package/dist/components/theme.cjs +1 -1
  95. package/dist/components/theme.js +1 -1
  96. package/dist/components/toggle.cjs +1 -1
  97. package/dist/components/toggle.js +1 -1
  98. package/dist/lib/accent-theme.cjs +75 -17
  99. package/dist/lib/accent-theme.cjs.map +1 -1
  100. package/dist/lib/accent-theme.d.cts +14 -1
  101. package/dist/lib/accent-theme.d.ts +14 -1
  102. package/dist/lib/accent-theme.js +74 -18
  103. package/dist/lib/accent-theme.js.map +1 -1
  104. package/dist/lib/calendar-lists.cjs +222 -0
  105. package/dist/lib/calendar-lists.cjs.map +1 -0
  106. package/dist/lib/calendar-lists.d.cts +4 -0
  107. package/dist/lib/calendar-lists.d.ts +4 -0
  108. package/dist/lib/calendar-lists.js +217 -0
  109. package/dist/lib/calendar-lists.js.map +1 -0
  110. package/dist/lib/control-glyphs.cjs +37 -0
  111. package/dist/lib/control-glyphs.cjs.map +1 -0
  112. package/dist/lib/control-glyphs.d.cts +11 -0
  113. package/dist/lib/control-glyphs.d.ts +11 -0
  114. package/dist/lib/control-glyphs.js +35 -0
  115. package/dist/lib/control-glyphs.js.map +1 -0
  116. package/dist/lib/date-time-mask.cjs +155 -0
  117. package/dist/lib/date-time-mask.cjs.map +1 -0
  118. package/dist/lib/date-time-mask.d.cts +56 -0
  119. package/dist/lib/date-time-mask.d.ts +56 -0
  120. package/dist/lib/date-time-mask.js +147 -0
  121. package/dist/lib/date-time-mask.js.map +1 -0
  122. package/dist/lib/input-date-parts.cjs +154 -0
  123. package/dist/lib/input-date-parts.cjs.map +1 -0
  124. package/dist/lib/input-date-parts.d.cts +53 -0
  125. package/dist/lib/input-date-parts.d.ts +53 -0
  126. package/dist/lib/input-date-parts.js +147 -0
  127. package/dist/lib/input-date-parts.js.map +1 -0
  128. package/dist/styles/spark-default.css +366 -24
  129. package/package.json +1 -1
@@ -1,17 +1,26 @@
1
1
  "use client";
2
2
 
3
+ import { t as CalendarListLabels } from "../calendar-lists-DoloqsCN.js";
3
4
  import * as React$1 from "react";
4
5
  import { DayPicker } from "@daypicker/react";
5
6
 
6
7
  //#region src/components/calendar.d.ts
7
- type CalendarProps = React$1.ComponentProps<typeof DayPicker> & {
8
+ type DayPickerProps = React$1.ComponentProps<typeof DayPicker>;
9
+ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
10
+ type CalendarProps = DistributiveOmit<DayPickerProps, 'captionLayout'> & {
11
+ /** `lists`: month and year each step with arrows and open a list in place of the days. */captionLayout?: DayPickerProps['captionLayout'] | 'lists'; /** Names the year arrows of `captionLayout="lists"`. */
12
+ listLabels?: CalendarListLabels;
8
13
  showTodayDot?: boolean;
9
14
  };
10
15
  declare function Calendar({
16
+ captionLayout,
11
17
  className,
12
18
  classNames,
13
- showOutsideDays,
19
+ components,
14
20
  fixedWeeks,
21
+ hideNavigation,
22
+ listLabels,
23
+ showOutsideDays,
15
24
  showTodayDot,
16
25
  ...props
17
26
  }: CalendarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,22 @@
1
1
  "use client";
2
2
  import { cn } from "../utils/cn.js";
3
3
  import { buttonVariants } from "./button.js";
4
+ import { CalendarListsProvider, ListMonthCaption as MonthCaption, ListMonthGrid as MonthGrid$1 } from "../lib/calendar-lists.js";
4
5
  import "react";
6
+ import { DayPicker } from "@daypicker/react";
5
7
  import { ChevronLeft, ChevronRight } from "@epilot/spark-icons";
6
8
  import { jsx } from "react/jsx-runtime";
7
- import { DayPicker } from "@daypicker/react";
8
9
  //#region src/components/calendar.tsx
10
+ const LIST_LABELS = {
11
+ nextYear: "Next year",
12
+ previousYear: "Previous year"
13
+ };
9
14
  function CalendarChevron({ orientation }) {
10
15
  return /* @__PURE__ */ jsx(orientation === "right" ? ChevronRight : ChevronLeft, { className: cn("[--spark-icon-size:20px]", orientation === "up" && "rotate-90", orientation === "down" && "-rotate-90") });
11
16
  }
12
- function Calendar({ className, classNames, showOutsideDays = true, fixedWeeks = true, showTodayDot = true, ...props }) {
13
- return /* @__PURE__ */ jsx(DayPicker, {
17
+ function Calendar({ captionLayout, className, classNames, components, fixedWeeks = true, hideNavigation, listLabels = LIST_LABELS, showOutsideDays = true, showTodayDot = true, ...props }) {
18
+ const lists = captionLayout === "lists";
19
+ const picker = /* @__PURE__ */ jsx(DayPicker, {
14
20
  className: cn("p-3", className),
15
21
  classNames: {
16
22
  months: "relative",
@@ -44,11 +50,24 @@ function Calendar({ className, classNames, showOutsideDays = true, fixedWeeks =
44
50
  hidden: "invisible",
45
51
  ...classNames
46
52
  },
47
- components: { Chevron: CalendarChevron },
53
+ captionLayout: lists ? "label" : captionLayout,
54
+ components: {
55
+ Chevron: CalendarChevron,
56
+ ...lists && {
57
+ MonthCaption,
58
+ MonthGrid: MonthGrid$1
59
+ },
60
+ ...components
61
+ },
48
62
  fixedWeeks,
63
+ hideNavigation: lists || hideNavigation,
49
64
  showOutsideDays,
50
65
  ...props
51
66
  });
67
+ return lists ? /* @__PURE__ */ jsx(CalendarListsProvider, {
68
+ labels: listLabels,
69
+ children: picker
70
+ }) : picker;
52
71
  }
53
72
  //#endregion
54
73
  export { Calendar };
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","names":[],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import { DayPicker } from '@daypicker/react'\nimport { ChevronLeft, ChevronRight } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\n\ntype CalendarProps = React.ComponentProps<typeof DayPicker> & {\n showTodayDot?: boolean\n}\n\nfunction CalendarChevron({\n orientation,\n}: {\n orientation?: 'up' | 'down' | 'left' | 'right'\n}) {\n const Glyph = orientation === 'right' ? ChevronRight : ChevronLeft\n return (\n <Glyph\n className={cn(\n '[--spark-icon-size:20px]',\n orientation === 'up' && 'rotate-90',\n orientation === 'down' && '-rotate-90',\n )}\n />\n )\n}\n\n// Pass `locale` (from '@daypicker/react/locale') for localized month/weekday\n// names — the library ships no language default.\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n fixedWeeks = true,\n showTodayDot = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n months: 'relative',\n month: 'flex flex-col gap-2',\n month_caption: 'flex h-10 items-center justify-center',\n caption_label: 'text-sm font-bold text-gray',\n button_previous: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 left-0 z-10 text-gray-light hover:text-gray focus-visible:focus-outline [[data-high-contrast]_&]:text-gray-a12',\n ),\n button_next: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 right-0 z-10 text-gray-light hover:text-gray focus-visible:focus-outline [[data-high-contrast]_&]:text-gray-a12',\n ),\n month_grid: 'w-full border-collapse',\n weekdays: 'flex w-full justify-between',\n weekday:\n 'mt-0.5 flex h-10 w-10 items-center justify-center rounded-full text-sm font-bold text-gray',\n week: 'mt-1 flex w-full justify-between',\n day: cn(\n 'relative mx-0.5 flex h-10 w-10 items-center justify-center rounded-full p-0 text-center text-sm focus-within:relative focus-within:z-20',\n props.mode === 'range'\n ? '[&:has(>.range-end)]:rounded-r-full [&:has(>.range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full'\n : '[&:has([aria-selected])]:rounded-full',\n ),\n day_button: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n // hover:…:bg-(--spark-style-bg-hover) outranks tertiary's hover:bg-gray-a3 —\n // selected days darken like a solid button instead of washing out gray\n 'size-10 shrink-0 rounded-full p-0 font-normal text-gray focus-visible:focus-outline in-aria-selected:rounded-full in-aria-selected:bg-(--spark-style-bg,var(--color-primary)) in-aria-selected:text-(--spark-style-fg,var(--color-primary-foreground)) hover:in-aria-selected:bg-(--spark-style-bg-hover,var(--color-primary-hover)) [[data-high-contrast]_[data-outside]:not([data-disabled])_&]:text-gray-a12 [[data-outside]:not([data-disabled])_&]:text-gray-light',\n ),\n range_start: 'range-start',\n range_end: 'range-end',\n selected: 'rounded-full',\n today: cn(\n 'relative bg-base-gray-soft text-gray',\n showTodayDot &&\n 'after:absolute after:right-0 after:-bottom-1 after:left-0 after:m-auto after:inline-flex after:h-1 after:w-1 after:rounded-full after:bg-(--spark-style-bg,var(--color-primary)) after:content-[\"\"]',\n ),\n outside:\n 'outside aria-selected:bg-base-gray-soft aria-selected:text-gray-light',\n disabled: 'text-gray-light opacity-50',\n range_middle: 'aria-selected:bg-base-gray-soft aria-selected:text-gray',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{ Chevron: CalendarChevron }}\n fixedWeeks={fixedWeeks}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n )\n}\n\nexport { Calendar }\nexport type { CalendarProps }\n"],"mappings":";;;;;;;;AAUA,SAAS,gBAAgB,EACvB,eAGC;CAED,OACE,oBAFY,gBAAgB,UAAU,eAAe,aAErD,EACE,WAAW,GACT,4BACA,gBAAgB,QAAQ,aACxB,gBAAgB,UAAU,YAC5B,EACD,CAAA;AAEL;AAIA,SAAS,SAAS,EAChB,WACA,YACA,kBAAkB,MAClB,aAAa,MACb,eAAe,MACf,GAAG,SACa;CAChB,OACE,oBAAC,WAAD;EACE,WAAW,GAAG,OAAO,SAAS;EAC9B,YAAY;GACV,QAAQ;GACR,OAAO;GACP,eAAe;GACf,eAAe;GACf,iBAAiB,GACf,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,+HACF;GACA,aAAa,GACX,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,gIACF;GACA,YAAY;GACZ,UAAU;GACV,SACE;GACF,MAAM;GACN,KAAK,GACH,2IACA,MAAM,SAAS,UACX,yKACA,uCACN;GACA,YAAY,GACV,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GAGpD,ycACF;GACA,aAAa;GACb,WAAW;GACX,UAAU;GACV,OAAO,GACL,wCACA,gBACE,uMACJ;GACA,SACE;GACF,UAAU;GACV,cAAc;GACd,QAAQ;GACR,GAAG;EACL;EACA,YAAY,EAAE,SAAS,gBAAgB;EAC3B;EACK;EACjB,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"calendar.js","names":["ListMonthCaption","ListMonthGrid"],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import { DayPicker } from '@daypicker/react'\nimport { ChevronLeft, ChevronRight } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport {\n type CalendarListLabels,\n CalendarListsProvider,\n ListMonthCaption,\n ListMonthGrid,\n} from '../lib/calendar-lists'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\n\ntype DayPickerProps = React.ComponentProps<typeof DayPicker>\n\n// keeps the union on `mode`, which a plain Omit would flatten\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown\n ? Omit<T, K>\n : never\n\ntype CalendarProps = DistributiveOmit<DayPickerProps, 'captionLayout'> & {\n /** `lists`: month and year each step with arrows and open a list in place of the days. */\n captionLayout?: DayPickerProps['captionLayout'] | 'lists'\n /** Names the year arrows of `captionLayout=\"lists\"`. */\n listLabels?: CalendarListLabels\n showTodayDot?: boolean\n}\n\nconst LIST_LABELS: CalendarListLabels = {\n nextYear: 'Next year',\n previousYear: 'Previous year',\n}\n\nfunction CalendarChevron({\n orientation,\n}: {\n orientation?: 'up' | 'down' | 'left' | 'right'\n}) {\n const Glyph = orientation === 'right' ? ChevronRight : ChevronLeft\n return (\n <Glyph\n className={cn(\n '[--spark-icon-size:20px]',\n orientation === 'up' && 'rotate-90',\n orientation === 'down' && '-rotate-90',\n )}\n />\n )\n}\n\n// Pass `locale` (from '@daypicker/react/locale') for localized month/weekday\n// names — the library ships no language default.\nfunction Calendar({\n captionLayout,\n className,\n classNames,\n components,\n fixedWeeks = true,\n hideNavigation,\n listLabels = LIST_LABELS,\n showOutsideDays = true,\n showTodayDot = true,\n ...props\n}: CalendarProps) {\n const lists = captionLayout === 'lists'\n const picker = (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n months: 'relative',\n month: 'flex flex-col gap-2',\n month_caption: 'flex h-10 items-center justify-center',\n caption_label: 'text-sm font-bold text-gray',\n button_previous: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 left-0 z-10 text-gray-light hover:text-gray focus-visible:focus-outline [[data-high-contrast]_&]:text-gray-a12',\n ),\n button_next: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 right-0 z-10 text-gray-light hover:text-gray focus-visible:focus-outline [[data-high-contrast]_&]:text-gray-a12',\n ),\n month_grid: 'w-full border-collapse',\n weekdays: 'flex w-full justify-between',\n weekday:\n 'mt-0.5 flex h-10 w-10 items-center justify-center rounded-full text-sm font-bold text-gray',\n week: 'mt-1 flex w-full justify-between',\n day: cn(\n 'relative mx-0.5 flex h-10 w-10 items-center justify-center rounded-full p-0 text-center text-sm focus-within:relative focus-within:z-20',\n props.mode === 'range'\n ? '[&:has(>.range-end)]:rounded-r-full [&:has(>.range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full'\n : '[&:has([aria-selected])]:rounded-full',\n ),\n day_button: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n // hover:…:bg-(--spark-style-bg-hover) outranks tertiary's hover:bg-gray-a3 —\n // selected days darken like a solid button instead of washing out gray\n 'size-10 shrink-0 rounded-full p-0 font-normal text-gray focus-visible:focus-outline in-aria-selected:rounded-full in-aria-selected:bg-(--spark-style-bg,var(--color-primary)) in-aria-selected:text-(--spark-style-fg,var(--color-primary-foreground)) hover:in-aria-selected:bg-(--spark-style-bg-hover,var(--color-primary-hover)) [[data-high-contrast]_[data-outside]:not([data-disabled])_&]:text-gray-a12 [[data-outside]:not([data-disabled])_&]:text-gray-light',\n ),\n range_start: 'range-start',\n range_end: 'range-end',\n selected: 'rounded-full',\n today: cn(\n 'relative bg-base-gray-soft text-gray',\n showTodayDot &&\n 'after:absolute after:right-0 after:-bottom-1 after:left-0 after:m-auto after:inline-flex after:h-1 after:w-1 after:rounded-full after:bg-(--spark-style-bg,var(--color-primary)) after:content-[\"\"]',\n ),\n outside:\n 'outside aria-selected:bg-base-gray-soft aria-selected:text-gray-light',\n disabled: 'text-gray-light opacity-50',\n range_middle: 'aria-selected:bg-base-gray-soft aria-selected:text-gray',\n hidden: 'invisible',\n ...classNames,\n }}\n captionLayout={lists ? 'label' : captionLayout}\n components={{\n Chevron: CalendarChevron,\n ...(lists && {\n MonthCaption: ListMonthCaption,\n MonthGrid: ListMonthGrid,\n }),\n ...components,\n }}\n fixedWeeks={fixedWeeks}\n hideNavigation={lists || hideNavigation}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n )\n return lists ? (\n <CalendarListsProvider labels={listLabels}>{picker}</CalendarListsProvider>\n ) : (\n picker\n )\n}\n\nexport { Calendar }\nexport type { CalendarProps }\n"],"mappings":";;;;;;;;;AA2BA,MAAM,cAAkC;CACtC,UAAU;CACV,cAAc;AAChB;AAEA,SAAS,gBAAgB,EACvB,eAGC;CAED,OACE,oBAFY,gBAAgB,UAAU,eAAe,aAErD,EACE,WAAW,GACT,4BACA,gBAAgB,QAAQ,aACxB,gBAAgB,UAAU,YAC5B,EACD,CAAA;AAEL;AAIA,SAAS,SAAS,EAChB,eACA,WACA,YACA,YACA,aAAa,MACb,gBACA,aAAa,aACb,kBAAkB,MAClB,eAAe,MACf,GAAG,SACa;CAChB,MAAM,QAAQ,kBAAkB;CAChC,MAAM,SACJ,oBAAC,WAAD;EACE,WAAW,GAAG,OAAO,SAAS;EAC9B,YAAY;GACV,QAAQ;GACR,OAAO;GACP,eAAe;GACf,eAAe;GACf,iBAAiB,GACf,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,+HACF;GACA,aAAa,GACX,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,gIACF;GACA,YAAY;GACZ,UAAU;GACV,SACE;GACF,MAAM;GACN,KAAK,GACH,2IACA,MAAM,SAAS,UACX,yKACA,uCACN;GACA,YAAY,GACV,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GAGpD,ycACF;GACA,aAAa;GACb,WAAW;GACX,UAAU;GACV,OAAO,GACL,wCACA,gBACE,uMACJ;GACA,SACE;GACF,UAAU;GACV,cAAc;GACd,QAAQ;GACR,GAAG;EACL;EACA,eAAe,QAAQ,UAAU;EACjC,YAAY;GACV,SAAS;GACT,GAAI,SAAS;IACGA;IACd,WAAWC;GACb;GACA,GAAG;EACL;EACY;EACZ,gBAAgB,SAAS;EACR;EACjB,GAAI;CACL,CAAA;CAEH,OAAO,QACL,oBAAC,uBAAD;EAAuB,QAAQ;YAAa;CAA8B,CAAA,IAE1E;AAEJ"}
@@ -5,8 +5,8 @@ const require_components_button = require("./button.cjs");
5
5
  let react = require("react");
6
6
  react = require_chunk.__toESM(react);
7
7
  let _epilot_spark_icons = require("@epilot/spark-icons");
8
- let react_jsx_runtime = require("react/jsx-runtime");
9
8
  let class_variance_authority = require("class-variance-authority");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
10
  let cn = require("cn");
11
11
  //#region src/components/callout.tsx
12
12
  const calloutVariants = (0, class_variance_authority.cva)("group/callout flex w-full items-start gap-2 rounded-lg px-4 py-3 text-sm transition-colors duration-150 ease-out motion-reduce:transition-none", {
@@ -3,8 +3,8 @@ import { cn } from "../utils/cn.js";
3
3
  import { Button } from "./button.js";
4
4
  import * as React$1 from "react";
5
5
  import { Cancel, CheckCircle, Info, Warning } from "@epilot/spark-icons";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
6
  import { cva } from "class-variance-authority";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region src/components/callout.tsx
9
9
  const calloutVariants = cva("group/callout flex w-full items-start gap-2 rounded-lg px-4 py-3 text-sm transition-colors duration-150 ease-out motion-reduce:transition-none", {
10
10
  variants: { variant: {
@@ -4,9 +4,9 @@ const require_chunk = require("../chunk-DY84GLCh.cjs");
4
4
  const require_lib_container_chrome = require("../lib/container-chrome.cjs");
5
5
  let react = require("react");
6
6
  react = require_chunk.__toESM(react);
7
- let react_jsx_runtime = require("react/jsx-runtime");
8
7
  let class_variance_authority = require("class-variance-authority");
9
8
  let _base_ui_react_use_render = require("@base-ui/react/use-render");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
10
  let cn = require("cn");
11
11
  //#region src/components/card.tsx
12
12
  const cardVariants = (0, class_variance_authority.cva)("relative flex w-full flex-col gap-1 py-3", {
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { containerChrome, containerInteractiveClasses, containerPaddingX, radiusClasses } from "../lib/container-chrome.js";
3
2
  import { cn } from "../utils/cn.js";
3
+ import { containerChrome, containerInteractiveClasses, containerPaddingX, radiusClasses } from "../lib/container-chrome.js";
4
4
  import * as React$1 from "react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
5
  import { cva } from "class-variance-authority";
7
6
  import { useRender } from "@base-ui/react/use-render";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region src/components/card.tsx
9
9
  const cardVariants = cva("relative flex w-full flex-col gap-1 py-3", {
10
10
  variants: { variant: {
@@ -2,10 +2,12 @@
2
2
  "use client";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const require_chunk = require("../chunk-DY84GLCh.cjs");
5
- const require_lib_input_box_variants = require("../lib/input-box-variants.cjs");
6
5
  const require_components_theme = require("./theme.cjs");
7
6
  const require_components_button = require("./button.cjs");
7
+ const require_lib_control_glyphs = require("../lib/control-glyphs.cjs");
8
+ const require_lib_input_box_variants = require("../lib/input-box-variants.cjs");
8
9
  const require_components_field = require("./field.cjs");
10
+ const require_components_checkbox = require("./checkbox.cjs");
9
11
  const require_components_pill = require("./pill.cjs");
10
12
  let react = require("react");
11
13
  react = require_chunk.__toESM(react);
@@ -76,10 +78,9 @@ function ComboboxTrigger({ className, children, variant, id: idProp, "aria-descr
76
78
  "aria-invalid": ariaInvalid,
77
79
  ...props,
78
80
  "aria-describedby": ariaDescribedBy,
79
- children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_epilot_spark_icons.KeyboardArrowDown, {
80
- "aria-hidden": true,
81
+ children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_control_glyphs.ChevronDownGlyph, {
81
82
  "data-slot": "combobox-chevron",
82
- className: (0, cn.cn)("pointer-events-none absolute shrink-0 text-gray-light transition-transform [--spark-icon-size:14px] in-data-popup-open:rotate-180 motion-reduce:transition-none", isGhost ? "right-1" : "right-3")
83
+ className: (0, cn.cn)("pointer-events-none absolute shrink-0 text-gray-light transition-transform in-data-popup-open:rotate-180 motion-reduce:transition-none", isGhost ? "right-1" : "right-3")
83
84
  })]
84
85
  });
85
86
  }
@@ -146,14 +147,17 @@ function ComboboxClear({ className, children, onClick, ...props }) {
146
147
  },
147
148
  ...props,
148
149
  hidden: group.disabled || group.readOnly || props.hidden,
149
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_epilot_spark_icons.Close, {
150
- "aria-hidden": true,
151
- className: "[--spark-icon-size:14px]"
152
- })
150
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_control_glyphs.ClearGlyph, {})
153
151
  });
154
152
  }
155
153
  const ComboboxToggleContext = react.createContext(null);
156
- function ComboboxContent({ className, children, align = "start", alignOffset, side, sideOffset = 4, container, ...props }) {
154
+ const HIGHLIGHT_KEYS = new Set([
155
+ "ArrowDown",
156
+ "ArrowUp",
157
+ "Home",
158
+ "End"
159
+ ]);
160
+ function ComboboxContent({ className, children, align = "start", alignOffset, side, sideOffset = 4, container, onKeyDownCapture, onPointerDownCapture, ...props }) {
157
161
  const [tracker] = react.useState(() => ({
158
162
  pending: null,
159
163
  values: /* @__PURE__ */ new WeakMap()
@@ -175,6 +179,14 @@ function ComboboxContent({ className, children, align = "start", alignOffset, si
175
179
  "data-slot": "combobox-content",
176
180
  className: (0, cn.cn)("relative isolate z-50 flex max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) flex-col overflow-hidden rounded-lg border border-gray-a1 bg-gray-1 p-1 text-gray-a12 shadow-lg dark:bg-gray-3 [[data-high-contrast]_&]:border-gray-a11", "transition-[opacity,scale,translate] duration-100 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none", "sm:data-[side=bottom]:data-starting-style:-translate-y-2 sm:data-[side=left]:data-starting-style:translate-x-2 sm:data-[side=right]:data-starting-style:-translate-x-2 sm:data-[side=top]:data-starting-style:translate-y-2", "max-sm:max-h-[80dvh] max-sm:w-full max-sm:max-w-none max-sm:rounded-b-none max-sm:border-x-0 max-sm:border-b-0 max-sm:px-4 max-sm:pt-3 max-sm:pb-[calc(env(safe-area-inset-bottom)+var(--spacing)*4)] max-sm:data-ending-style:translate-y-full max-sm:data-ending-style:scale-100 max-sm:data-ending-style:opacity-100 max-sm:data-starting-style:translate-y-full max-sm:data-starting-style:scale-100 max-sm:data-starting-style:opacity-100", className),
177
181
  ...props,
182
+ onKeyDownCapture: (event) => {
183
+ onKeyDownCapture?.(event);
184
+ if (HIGHLIGHT_KEYS.has(event.key)) event.currentTarget.setAttribute("data-keyboard", "");
185
+ },
186
+ onPointerDownCapture: (event) => {
187
+ onPointerDownCapture?.(event);
188
+ event.currentTarget.removeAttribute("data-keyboard");
189
+ },
178
190
  children
179
191
  })
180
192
  })] })
@@ -249,20 +261,38 @@ const ComboboxItem = react.forwardRef(function ComboboxItem({ className, value,
249
261
  },
250
262
  value,
251
263
  "data-slot": "combobox-item",
252
- className: (0, cn.cn)("relative flex w-full cursor-default items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-sm text-gray outline-hidden transition-colors select-none touch-target-row data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-gray-a3 motion-reduce:transition-none max-sm:gap-3 max-sm:text-base", className),
264
+ className: (0, cn.cn)("relative flex w-full cursor-default items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-sm text-gray outline-hidden transition-colors select-none touch-target-row data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-gray-a3 motion-reduce:transition-none max-sm:gap-3 max-sm:text-base [@media(hover:none)]:[[data-slot=combobox-content]:not([data-keyboard])_&]:data-highlighted:bg-transparent", className),
253
265
  ...props
254
266
  });
255
267
  });
268
+ const setInert = (node) => {
269
+ node?.setAttribute("inert", "");
270
+ };
256
271
  function ComboboxItemIndicator({ className, children, keepMounted = true, ...props }) {
257
272
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_combobox.Combobox.ItemIndicator, {
258
273
  "data-slot": "combobox-item-indicator",
259
274
  keepMounted,
260
- className: (0, cn.cn)("flex size-3.5 shrink-0 items-center justify-center [[data-slot=combobox-item]:not([data-selected])_&_svg]:invisible", "max-sm:size-5 max-sm:rounded-sm max-sm:border-2 max-sm:border-(--color-accent-ui) max-sm:bg-base-accent-soft max-sm:[[data-selected]_&]:border-(--color-primary) max-sm:[[data-selected]_&]:bg-(--color-primary) max-sm:[[data-selected]_&]:text-(--spark-on-solid)", className),
275
+ className: (0, cn.cn)("flex shrink-0 items-center justify-center", className),
261
276
  ...props,
262
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_epilot_spark_icons.Check, {
263
- "aria-hidden": true,
264
- className: "[--spark-icon-size:11px]"
265
- })
277
+ render: props.render ?? ((indicatorProps, { selected }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
278
+ ...indicatorProps,
279
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
280
+ className: (0, cn.cn)("flex size-3.5 items-center justify-center max-sm:hidden", !selected && "invisible"),
281
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_epilot_spark_icons.Check, {
282
+ "aria-hidden": true,
283
+ className: "[--spark-icon-size:11px]"
284
+ })
285
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
286
+ className: "flex sm:hidden",
287
+ ref: setInert,
288
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_checkbox.Checkbox, {
289
+ checked: selected,
290
+ className: "my-0 any-pointer-coarse:my-0",
291
+ readOnly: true,
292
+ render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {})
293
+ })
294
+ })]
295
+ }))
266
296
  });
267
297
  }
268
298
  const isSelectedGroup = (group) => typeof group === "object" && group !== null && "optionCount" in group;
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.cjs","names":["ComboboxPrimitive","React","useFieldControl","boxChrome","KeyboardArrowDown","Pill","Add","Close","PortalTheme","Search","buttonVariants","Check"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["'use client'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox'\nimport {\n Add,\n Check,\n Close,\n KeyboardArrowDown,\n Search,\n} from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { boxChrome } from '../lib/input-box-variants'\nimport type { SparkInputStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\nimport { useFieldControl } from './field'\nimport { Pill } from './pill'\nimport { PortalTheme } from './theme'\n\nconst Combobox = ComboboxPrimitive.Root\nconst ComboboxValue = ComboboxPrimitive.Value\nconst ComboboxCollection = ComboboxPrimitive.Collection\nconst useComboboxFilter = ComboboxPrimitive.useFilter\nconst useComboboxFilteredItems = ComboboxPrimitive.useFilteredItems\n\ntype ComboboxSelectedGroup<Item> = {\n value: 'selected' | 'items'\n label: string\n items: Item[]\n /** Options left unpicked before the search filters them; ComboboxEmpty reads it. */\n optionCount: number\n}\n\n/** Splits `items` into a group with every pick, never filtered, and a group with the rest. */\nfunction useComboboxSelectedGroups<Item>(\n items: readonly Item[],\n value: readonly Item[],\n {\n selected,\n items: itemsLabel,\n isItemEqualToValue = Object.is,\n }: {\n selected: string\n items: string\n isItemEqualToValue?: (item: Item, value: Item) => boolean\n },\n) {\n const { contains } = useComboboxFilter()\n const isPicked = (item: Item) =>\n value.some((picked) => isItemEqualToValue(item, picked))\n const options = items.filter((item) => !isPicked(item))\n const groups: ComboboxSelectedGroup<Item>[] = [\n {\n value: 'selected',\n label: selected,\n items: [...value],\n optionCount: options.length,\n },\n {\n value: 'items',\n label: itemsLabel,\n items: options,\n optionCount: options.length,\n },\n ]\n const filter = (\n item: Item,\n query: string,\n itemToString?: (item: Item) => string,\n ) => isPicked(item) || contains(item, query, itemToString)\n return { items: groups, filter, isItemEqualToValue }\n}\n\nconst CLEAR_BUTTON =\n \"relative inline-flex size-6 min-h-[24px] min-w-[24px] shrink-0 items-center justify-center rounded-sm p-0 text-gray-light outline-hidden transition-colors hover:text-gray focus-visible:ring-2 focus-visible:ring-(--color-focus-root)! focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0 before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']\"\n\nconst ComboboxGroupStateContext = React.createContext({\n disabled: false,\n readOnly: false,\n})\n\n// the trigger is a native <button>, so ComboboxClear sits beside it, not inside it;\n// Base UI's InputGroup is the only part whose state carries readOnly, so its render stays ours\nfunction ComboboxTriggerGroup({\n className,\n ...props\n}: Omit<React.ComponentProps<typeof ComboboxPrimitive.InputGroup>, 'render'>) {\n return (\n <ComboboxPrimitive.InputGroup\n data-slot=\"combobox-trigger-group\"\n className={cn(\n 'relative flex w-full items-center has-[[data-slot=combobox-clear]:not([hidden])]:[&_[data-slot=combobox-trigger]]:pr-15',\n className,\n )}\n {...props}\n render={({ role: _group, ...groupProps }, state) => (\n <ComboboxGroupStateContext.Provider\n value={{ disabled: state.disabled, readOnly: state.readOnly }}\n >\n <div {...groupProps} />\n </ComboboxGroupStateContext.Provider>\n )}\n />\n )\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n variant,\n id: idProp,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Trigger> & {\n // input-style override; falls back to Field / <Theme>, then soft (like Input)\n variant?: SparkInputStyle\n}) {\n const { field, id, ariaDescribedBy, ariaInvalid, inputStyle, inputColor } =\n useFieldControl({\n id: idProp,\n ariaDescribedBy: ariaDescribedByProp,\n variant,\n })\n const inset = !variant && field?.labelPosition === 'inset'\n const isGhost = inputStyle === 'ghost' || inset\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n id={id}\n className={cn(\n 'relative flex w-full min-w-0 items-center gap-1.5 rounded-md px-3 text-left text-base text-gray transition-colors select-none disabled:cursor-not-allowed disabled:text-gray-disabled motion-reduce:transition-none',\n !isGhost && 'h-11 min-h-[2.75rem]',\n boxChrome[isGhost ? 'ghost' : inputStyle][inputColor],\n 'pr-8',\n // the inset Field shell draws the outline (field.tsx)\n inset && 'focus-visible:outline-hidden',\n className,\n )}\n aria-invalid={ariaInvalid}\n {...props}\n aria-describedby={ariaDescribedBy}\n >\n {children}\n <KeyboardArrowDown\n aria-hidden\n data-slot=\"combobox-chevron\"\n className={cn(\n 'pointer-events-none absolute shrink-0 text-gray-light transition-transform [--spark-icon-size:14px] in-data-popup-open:rotate-180 motion-reduce:transition-none',\n isGhost ? 'right-1' : 'right-3',\n )}\n />\n </ComboboxPrimitive.Trigger>\n )\n}\n\ntype ComboboxChipsProps<Item> = Omit<\n React.ComponentProps<'div'>,\n 'children'\n> & {\n /** Renders one chip per selected value, in pick order. */\n children: (item: Item, index: number) => React.ReactNode\n /** Renders at most this many chips, then a \"+N\" pill for the rest. */\n max?: number\n overflowLabel?: (count: number) => string\n /** Shown while nothing is selected: text, or a `ComboboxAddChip`. */\n placeholder?: React.ReactNode\n}\n\n// one row that never wraps: chips past the row's width are clipped, `max` folds them into \"+N\"\nfunction ComboboxChips<Item>({\n className,\n children,\n max,\n overflowLabel = (count) => `${count} more selected`,\n placeholder,\n ...props\n}: ComboboxChipsProps<Item>) {\n return (\n <div\n data-slot=\"combobox-chips\"\n className={cn(\n 'flex min-w-0 flex-1 flex-nowrap items-center gap-1 overflow-hidden',\n className,\n )}\n {...props}\n >\n <ComboboxPrimitive.Value>\n {(value: Item[]) => {\n if (value.length === 0) {\n return typeof placeholder === 'string' ? (\n <span className=\"truncate text-gray-placeholder in-data-disabled:text-gray-disabled\">\n {placeholder}\n </span>\n ) : (\n placeholder\n )\n }\n const shown = max === undefined ? value : value.slice(0, max)\n const hidden = value.length - shown.length\n return (\n <>\n {shown.map(children)}\n {hidden > 0 && (\n <Pill\n data-slot=\"combobox-chips-overflow\"\n className=\"shrink-0 in-data-disabled:opacity-50\"\n >\n <span aria-hidden=\"true\">+{hidden}</span>\n <span className=\"sr-only\">{overflowLabel(hidden)}</span>\n </Pill>\n )}\n </>\n )\n }}\n </ComboboxPrimitive.Value>\n </div>\n )\n}\n\n// display-only: chips sit inside the trigger button, so nothing in them may be interactive\nfunction ComboboxChip({\n className,\n children,\n ...props\n}: Omit<React.HTMLAttributes<HTMLSpanElement>, 'onClick' | 'color'>) {\n return (\n <Pill\n data-slot=\"combobox-chip\"\n className={cn('min-w-0 shrink in-data-disabled:opacity-50', className)}\n {...props}\n >\n <span className=\"truncate\">{children}</span>\n </Pill>\n )\n}\n\nfunction ComboboxAddChip({\n className,\n children,\n ...props\n}: Omit<React.HTMLAttributes<HTMLSpanElement>, 'onClick' | 'color'>) {\n return (\n <Pill\n data-slot=\"combobox-add-chip\"\n className={cn(\n 'shrink-0 border border-dashed border-spark-a6 bg-transparent pl-1.5 text-spark-a11 in-data-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <Add aria-hidden className=\"[--spark-icon-size:14px]\" />\n {children}\n </Pill>\n )\n}\n\nfunction ComboboxClear({\n className,\n children,\n onClick,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Clear>) {\n const group = React.useContext(ComboboxGroupStateContext)\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={(buttonProps, state) => (\n <button\n {...buttonProps}\n hidden={state.disabled || buttonProps.hidden}\n />\n )}\n className={cn(CLEAR_BUTTON, 'absolute right-8', className)}\n onClick={(event) => {\n onClick?.(event)\n // Base UI refocuses the search input, which is unmounted while the popup is closed\n event.currentTarget\n .closest('[data-slot=\"combobox-trigger-group\"]')\n ?.querySelector<HTMLElement>('[data-slot=\"combobox-trigger\"]')\n ?.focus()\n }}\n {...props}\n hidden={group.disabled || group.readOnly || props.hidden}\n >\n {children ?? <Close aria-hidden className=\"[--spark-icon-size:14px]\" />}\n </ComboboxPrimitive.Clear>\n )\n}\n\ntype ComboboxContentProps = React.ComponentProps<\n typeof ComboboxPrimitive.Popup\n> &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n > &\n Pick<ComboboxPrimitive.Portal.Props, 'container'>\n\n// a toggled item changes group and so its index; Enter records it so the remounted\n// item can take the highlight back (Base UI only highlights on hover or arrow keys)\ntype ComboboxToggleTracker = {\n pending: { value: unknown } | null\n values: WeakMap<Element, unknown>\n}\nconst ComboboxToggleContext = React.createContext<ComboboxToggleTracker | null>(\n null,\n)\n\n// below `sm` the popup is a bottom sheet; `!` beats the positioner's inline position styles\nfunction ComboboxContent({\n className,\n children,\n align = 'start',\n alignOffset,\n side,\n sideOffset = 4,\n container,\n ...props\n}: ComboboxContentProps) {\n const [tracker] = React.useState<ComboboxToggleTracker>(() => ({\n pending: null,\n values: new WeakMap(),\n }))\n return (\n <ComboboxToggleContext.Provider value={tracker}>\n <ComboboxPrimitive.Portal container={container}>\n <PortalTheme>\n <ComboboxPrimitive.Backdrop\n data-slot=\"combobox-backdrop\"\n className=\"fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none sm:hidden\"\n />\n <ComboboxPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"z-50 max-sm:fixed! max-sm:inset-x-0! max-sm:top-auto! max-sm:bottom-(--spark-viewport-bottom-offset,0)! max-sm:transform-none!\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n className={cn(\n 'relative isolate z-50 flex max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) flex-col overflow-hidden rounded-lg border border-gray-a1 bg-gray-1 p-1 text-gray-a12 shadow-lg dark:bg-gray-3 [[data-high-contrast]_&]:border-gray-a11',\n 'transition-[opacity,scale,translate] duration-100 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none',\n 'sm:data-[side=bottom]:data-starting-style:-translate-y-2 sm:data-[side=left]:data-starting-style:translate-x-2 sm:data-[side=right]:data-starting-style:-translate-x-2 sm:data-[side=top]:data-starting-style:translate-y-2',\n 'max-sm:max-h-[80dvh] max-sm:w-full max-sm:max-w-none max-sm:rounded-b-none max-sm:border-x-0 max-sm:border-b-0 max-sm:px-4 max-sm:pt-3 max-sm:pb-[calc(env(safe-area-inset-bottom)+var(--spacing)*4)] max-sm:data-ending-style:translate-y-full max-sm:data-ending-style:scale-100 max-sm:data-ending-style:opacity-100 max-sm:data-starting-style:translate-y-full max-sm:data-starting-style:scale-100 max-sm:data-starting-style:opacity-100',\n className,\n )}\n {...props}\n >\n {children}\n </ComboboxPrimitive.Popup>\n </ComboboxPrimitive.Positioner>\n </PortalTheme>\n </ComboboxPrimitive.Portal>\n </ComboboxToggleContext.Provider>\n )\n}\n\n// Base UI removes the last pick on Backspace in the empty input only inside Chips\nfunction ComboboxInput({\n className,\n onKeyDown,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Input>) {\n const tracker = React.useContext(ComboboxToggleContext)\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-search\"\n // Chips adds role=\"toolbar\" for arrow keys between chips; this row holds none\n render={({ role: _toolbar, ...chipsProps }) => <div {...chipsProps} />}\n className=\"-mx-1 -mt-1 mb-1 flex shrink-0 items-center gap-1.5 border-b border-gray-a4 px-2.5 text-gray-light max-sm:mx-0 max-sm:mt-0 max-sm:mb-2 max-sm:rounded-md max-sm:border-b-0 max-sm:bg-gray-a3\"\n >\n <Search aria-hidden className=\"shrink-0 [--spark-icon-size:16px]\" />\n <ComboboxPrimitive.Input\n data-slot=\"combobox-input\"\n className={cn(\n 'h-10 w-full min-w-0 bg-transparent text-base text-gray outline-hidden placeholder:text-gray-placeholder',\n className,\n )}\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (!tracker || event.key !== 'Enter') return\n const highlighted = event.currentTarget\n .closest('[data-slot=\"combobox-content\"]')\n ?.querySelector('[data-slot=\"combobox-item\"][data-highlighted]')\n if (!highlighted) return\n tracker.pending = { value: tracker.values.get(highlighted) }\n setTimeout(() => {\n tracker.pending = null\n })\n }}\n {...props}\n />\n </ComboboxPrimitive.Chips>\n )\n}\n\n// the bottom sheet's \"Done\"; hidden from `sm` up, where the popup closes on outside press\nfunction ComboboxClose({\n className,\n onClick,\n ...props\n}: React.ComponentProps<'button'>) {\n return (\n <button\n data-slot=\"combobox-close\"\n type=\"button\"\n className={cn(\n buttonVariants({ variant: 'primary' }),\n 'mt-3 w-full shrink-0 sm:hidden',\n className,\n )}\n onClick={(event) => {\n onClick?.(event)\n // Combobox has no Close part; Escape is the key Base UI closes on\n event.currentTarget.dispatchEvent(\n new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }),\n )\n }}\n {...props}\n />\n )\n}\n\nfunction ComboboxList({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.List>) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n 'min-h-0 flex-1 overflow-y-auto overscroll-contain outline-hidden data-empty:p-0',\n className,\n )}\n {...props}\n />\n )\n}\n\n// forwardRef keeps refs working for React 18 consumers (ref-as-prop is 19-only)\nconst ComboboxItem = React.forwardRef<\n HTMLDivElement,\n ComboboxPrimitive.Item.Props\n>(function ComboboxItem({ className, value, ...props }, refProp) {\n const tracker = React.useContext(ComboboxToggleContext)\n const ref = React.useRef<HTMLDivElement | null>(null)\n React.useEffect(() => {\n const node = ref.current\n if (!tracker || !node) return\n tracker.values.set(node, value)\n if (!tracker.pending || !Object.is(tracker.pending.value, value)) return\n tracker.pending = null\n // after Base UI has registered the remounted item's new index\n const timer = setTimeout(() =>\n node.dispatchEvent(new MouseEvent('mousemove', { bubbles: true })),\n )\n return () => clearTimeout(timer)\n }, [tracker, value])\n return (\n <ComboboxPrimitive.Item\n ref={(node: HTMLDivElement | null) => {\n ref.current = node\n if (typeof refProp === 'function') refProp(node)\n else if (refProp) refProp.current = node\n }}\n value={value}\n data-slot=\"combobox-item\"\n className={cn(\n 'relative flex w-full cursor-default items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-sm text-gray outline-hidden transition-colors select-none touch-target-row data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-gray-a3 motion-reduce:transition-none max-sm:gap-3 max-sm:text-base',\n className,\n )}\n {...props}\n />\n )\n})\n\n// kept mounted so the bottom sheet draws an empty checkbox for unpicked items\nfunction ComboboxItemIndicator({\n className,\n children,\n keepMounted = true,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.ItemIndicator>) {\n return (\n <ComboboxPrimitive.ItemIndicator\n data-slot=\"combobox-item-indicator\"\n keepMounted={keepMounted}\n className={cn(\n 'flex size-3.5 shrink-0 items-center justify-center [[data-slot=combobox-item]:not([data-selected])_&_svg]:invisible',\n 'max-sm:size-5 max-sm:rounded-sm max-sm:border-2 max-sm:border-(--color-accent-ui) max-sm:bg-base-accent-soft max-sm:[[data-selected]_&]:border-(--color-primary) max-sm:[[data-selected]_&]:bg-(--color-primary) max-sm:[[data-selected]_&]:text-(--spark-on-solid)',\n className,\n )}\n {...props}\n >\n {children ?? <Check aria-hidden className=\"[--spark-icon-size:11px]\" />}\n </ComboboxPrimitive.ItemIndicator>\n )\n}\n\nconst isSelectedGroup = (\n group: unknown,\n): group is ComboboxSelectedGroup<unknown> =>\n typeof group === 'object' && group !== null && 'optionCount' in group\n\n// with useComboboxSelectedGroups the picks never filter out, so Base UI alone would never\n// see an empty list; \"no matches\" is the options group gone while it had options\nfunction ComboboxEmpty({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Empty>) {\n const filtered: readonly unknown[] = useComboboxFilteredItems()\n const groups = filtered.filter(isSelectedGroup)\n const noOptionMatches =\n groups.some((group) => group.optionCount > 0) &&\n !groups.some((group) => group.value === 'items')\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n 'px-1.5 py-1.5 text-sm text-gray-light empty:p-0',\n className,\n )}\n {...props}\n render={({ children: _baseChildren, ...emptyProps }) => (\n <div {...emptyProps}>\n {filtered.length === 0 || noOptionMatches ? children : null}\n </div>\n )}\n />\n )\n}\n\nfunction ComboboxStatus({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Status>) {\n return (\n <ComboboxPrimitive.Status\n data-slot=\"combobox-status\"\n className={cn(\n 'px-1.5 py-1.5 text-sm text-gray-light empty:p-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Group>) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(\n 'scroll-my-1 [&+&]:mt-1 [&+&]:border-t [&+&]:border-gray-a4 [&+&]:pt-1',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxGroupLabel({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.GroupLabel>) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-group-label\"\n className={cn(\n 'px-1.5 py-1 text-xs font-medium text-gray-light [[data-high-contrast]_&]:text-gray-a12',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n return (\n <div\n aria-hidden=\"true\"\n data-slot=\"combobox-separator\"\n className={cn(\n 'pointer-events-none -mx-1 my-1 h-px bg-gray-a3 [[data-high-contrast]_&]:bg-gray-a6',\n className,\n )}\n {...props}\n />\n )\n}\n\nexport {\n Combobox,\n ComboboxAddChip,\n ComboboxChip,\n ComboboxChips,\n ComboboxClear,\n ComboboxClose,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxInput,\n ComboboxItem,\n ComboboxItemIndicator,\n ComboboxList,\n ComboboxSeparator,\n ComboboxStatus,\n ComboboxTrigger,\n ComboboxTriggerGroup,\n ComboboxValue,\n useComboboxFilter,\n useComboboxFilteredItems,\n useComboboxSelectedGroups,\n}\nexport type { ComboboxSelectedGroup }\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,MAAM,WAAWA,wBAAAA,SAAkB;AACnC,MAAM,gBAAgBA,wBAAAA,SAAkB;AACxC,MAAM,qBAAqBA,wBAAAA,SAAkB;AAC7C,MAAM,oBAAoBA,wBAAAA,SAAkB;AAC5C,MAAM,2BAA2BA,wBAAAA,SAAkB;;AAWnD,SAAS,0BACP,OACA,OACA,EACE,UACA,OAAO,YACP,qBAAqB,OAAO,MAM9B;CACA,MAAM,EAAE,aAAa,kBAAkB;CACvC,MAAM,YAAY,SAChB,MAAM,MAAM,WAAW,mBAAmB,MAAM,MAAM,CAAC;CACzD,MAAM,UAAU,MAAM,QAAQ,SAAS,CAAC,SAAS,IAAI,CAAC;CACtD,MAAM,SAAwC,CAC5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,GAAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,KAACA,wBAAAA,SAAkB,OAAnB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,yEACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,iBAAA,GAAA,kBAAA,KAACA,wBAAAA,SAAkB,YAAnB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,0FACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SAC2B;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,eAAY;EACZ,aAAU;EACV,YAAA,GAAA,GAAA,IACE,sFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"combobox.cjs","names":["ComboboxPrimitive","React","useFieldControl","boxChrome","ChevronDownGlyph","Pill","Add","ClearGlyph","PortalTheme","Search","buttonVariants","Check","Checkbox"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["'use client'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox'\nimport { Add, Check, Search } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { ChevronDownGlyph, ClearGlyph } from '../lib/control-glyphs'\nimport { boxChrome } from '../lib/input-box-variants'\nimport type { SparkInputStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\nimport { Checkbox } from './checkbox'\nimport { useFieldControl } from './field'\nimport { Pill } from './pill'\nimport { PortalTheme } from './theme'\n\nconst Combobox = ComboboxPrimitive.Root\nconst ComboboxValue = ComboboxPrimitive.Value\nconst ComboboxCollection = ComboboxPrimitive.Collection\nconst useComboboxFilter = ComboboxPrimitive.useFilter\nconst useComboboxFilteredItems = ComboboxPrimitive.useFilteredItems\n\ntype ComboboxSelectedGroup<Item> = {\n value: 'selected' | 'items'\n label: string\n items: Item[]\n /** Options left unpicked before the search filters them; ComboboxEmpty reads it. */\n optionCount: number\n}\n\n/** Splits `items` into a group with every pick, never filtered, and a group with the rest. */\nfunction useComboboxSelectedGroups<Item>(\n items: readonly Item[],\n value: readonly Item[],\n {\n selected,\n items: itemsLabel,\n isItemEqualToValue = Object.is,\n }: {\n selected: string\n items: string\n isItemEqualToValue?: (item: Item, value: Item) => boolean\n },\n) {\n const { contains } = useComboboxFilter()\n const isPicked = (item: Item) =>\n value.some((picked) => isItemEqualToValue(item, picked))\n const options = items.filter((item) => !isPicked(item))\n const groups: ComboboxSelectedGroup<Item>[] = [\n {\n value: 'selected',\n label: selected,\n items: [...value],\n optionCount: options.length,\n },\n {\n value: 'items',\n label: itemsLabel,\n items: options,\n optionCount: options.length,\n },\n ]\n const filter = (\n item: Item,\n query: string,\n itemToString?: (item: Item) => string,\n ) => isPicked(item) || contains(item, query, itemToString)\n return { items: groups, filter, isItemEqualToValue }\n}\n\nconst CLEAR_BUTTON =\n \"relative inline-flex size-6 min-h-[24px] min-w-[24px] shrink-0 items-center justify-center rounded-sm p-0 text-gray-light outline-hidden transition-colors hover:text-gray focus-visible:ring-2 focus-visible:ring-(--color-focus-root)! focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0 before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']\"\n\nconst ComboboxGroupStateContext = React.createContext({\n disabled: false,\n readOnly: false,\n})\n\n// the trigger is a native <button>, so ComboboxClear sits beside it, not inside it;\n// Base UI's InputGroup is the only part whose state carries readOnly, so its render stays ours\nfunction ComboboxTriggerGroup({\n className,\n ...props\n}: Omit<React.ComponentProps<typeof ComboboxPrimitive.InputGroup>, 'render'>) {\n return (\n <ComboboxPrimitive.InputGroup\n data-slot=\"combobox-trigger-group\"\n className={cn(\n 'relative flex w-full items-center has-[[data-slot=combobox-clear]:not([hidden])]:[&_[data-slot=combobox-trigger]]:pr-15',\n className,\n )}\n {...props}\n render={({ role: _group, ...groupProps }, state) => (\n <ComboboxGroupStateContext.Provider\n value={{ disabled: state.disabled, readOnly: state.readOnly }}\n >\n <div {...groupProps} />\n </ComboboxGroupStateContext.Provider>\n )}\n />\n )\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n variant,\n id: idProp,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Trigger> & {\n // input-style override; falls back to Field / <Theme>, then soft (like Input)\n variant?: SparkInputStyle\n}) {\n const { field, id, ariaDescribedBy, ariaInvalid, inputStyle, inputColor } =\n useFieldControl({\n id: idProp,\n ariaDescribedBy: ariaDescribedByProp,\n variant,\n })\n const inset = !variant && field?.labelPosition === 'inset'\n const isGhost = inputStyle === 'ghost' || inset\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n id={id}\n className={cn(\n 'relative flex w-full min-w-0 items-center gap-1.5 rounded-md px-3 text-left text-base text-gray transition-colors select-none disabled:cursor-not-allowed disabled:text-gray-disabled motion-reduce:transition-none',\n !isGhost && 'h-11 min-h-[2.75rem]',\n boxChrome[isGhost ? 'ghost' : inputStyle][inputColor],\n 'pr-8',\n // the inset Field shell draws the outline (field.tsx)\n inset && 'focus-visible:outline-hidden',\n className,\n )}\n aria-invalid={ariaInvalid}\n {...props}\n aria-describedby={ariaDescribedBy}\n >\n {children}\n <ChevronDownGlyph\n data-slot=\"combobox-chevron\"\n className={cn(\n 'pointer-events-none absolute shrink-0 text-gray-light transition-transform in-data-popup-open:rotate-180 motion-reduce:transition-none',\n isGhost ? 'right-1' : 'right-3',\n )}\n />\n </ComboboxPrimitive.Trigger>\n )\n}\n\ntype ComboboxChipsProps<Item> = Omit<\n React.ComponentProps<'div'>,\n 'children'\n> & {\n /** Renders one chip per selected value, in pick order. */\n children: (item: Item, index: number) => React.ReactNode\n /** Renders at most this many chips, then a \"+N\" pill for the rest. */\n max?: number\n overflowLabel?: (count: number) => string\n /** Shown while nothing is selected: text, or a `ComboboxAddChip`. */\n placeholder?: React.ReactNode\n}\n\n// one row that never wraps: chips past the row's width are clipped, `max` folds them into \"+N\"\nfunction ComboboxChips<Item>({\n className,\n children,\n max,\n overflowLabel = (count) => `${count} more selected`,\n placeholder,\n ...props\n}: ComboboxChipsProps<Item>) {\n return (\n <div\n data-slot=\"combobox-chips\"\n className={cn(\n 'flex min-w-0 flex-1 flex-nowrap items-center gap-1 overflow-hidden',\n className,\n )}\n {...props}\n >\n <ComboboxPrimitive.Value>\n {(value: Item[]) => {\n if (value.length === 0) {\n return typeof placeholder === 'string' ? (\n <span className=\"truncate text-gray-placeholder in-data-disabled:text-gray-disabled\">\n {placeholder}\n </span>\n ) : (\n placeholder\n )\n }\n const shown = max === undefined ? value : value.slice(0, max)\n const hidden = value.length - shown.length\n return (\n <>\n {shown.map(children)}\n {hidden > 0 && (\n <Pill\n data-slot=\"combobox-chips-overflow\"\n className=\"shrink-0 in-data-disabled:opacity-50\"\n >\n <span aria-hidden=\"true\">+{hidden}</span>\n <span className=\"sr-only\">{overflowLabel(hidden)}</span>\n </Pill>\n )}\n </>\n )\n }}\n </ComboboxPrimitive.Value>\n </div>\n )\n}\n\n// display-only: chips sit inside the trigger button, so nothing in them may be interactive\nfunction ComboboxChip({\n className,\n children,\n ...props\n}: Omit<React.HTMLAttributes<HTMLSpanElement>, 'onClick' | 'color'>) {\n return (\n <Pill\n data-slot=\"combobox-chip\"\n className={cn('min-w-0 shrink in-data-disabled:opacity-50', className)}\n {...props}\n >\n <span className=\"truncate\">{children}</span>\n </Pill>\n )\n}\n\nfunction ComboboxAddChip({\n className,\n children,\n ...props\n}: Omit<React.HTMLAttributes<HTMLSpanElement>, 'onClick' | 'color'>) {\n return (\n <Pill\n data-slot=\"combobox-add-chip\"\n className={cn(\n 'shrink-0 border border-dashed border-spark-a6 bg-transparent pl-1.5 text-spark-a11 in-data-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <Add aria-hidden className=\"[--spark-icon-size:14px]\" />\n {children}\n </Pill>\n )\n}\n\nfunction ComboboxClear({\n className,\n children,\n onClick,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Clear>) {\n const group = React.useContext(ComboboxGroupStateContext)\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={(buttonProps, state) => (\n <button\n {...buttonProps}\n hidden={state.disabled || buttonProps.hidden}\n />\n )}\n className={cn(CLEAR_BUTTON, 'absolute right-8', className)}\n onClick={(event) => {\n onClick?.(event)\n // Base UI refocuses the search input, which is unmounted while the popup is closed\n event.currentTarget\n .closest('[data-slot=\"combobox-trigger-group\"]')\n ?.querySelector<HTMLElement>('[data-slot=\"combobox-trigger\"]')\n ?.focus()\n }}\n {...props}\n hidden={group.disabled || group.readOnly || props.hidden}\n >\n {children ?? <ClearGlyph />}\n </ComboboxPrimitive.Clear>\n )\n}\n\ntype ComboboxContentProps = React.ComponentProps<\n typeof ComboboxPrimitive.Popup\n> &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n > &\n Pick<ComboboxPrimitive.Portal.Props, 'container'>\n\n// a toggled item changes group and so its index; Enter records it so the remounted\n// item can take the highlight back (Base UI only highlights on hover or arrow keys)\ntype ComboboxToggleTracker = {\n pending: { value: unknown } | null\n values: WeakMap<Element, unknown>\n}\nconst ComboboxToggleContext = React.createContext<ComboboxToggleTracker | null>(\n null,\n)\n\n// a tap leaves Base UI's highlight on a list index, which the next pick moves to another\n// option; without hover the highlight shows only once these keys have moved it\nconst HIGHLIGHT_KEYS = new Set(['ArrowDown', 'ArrowUp', 'Home', 'End'])\n\n// below `sm` the popup is a bottom sheet; `!` beats the positioner's inline position styles\nfunction ComboboxContent({\n className,\n children,\n align = 'start',\n alignOffset,\n side,\n sideOffset = 4,\n container,\n onKeyDownCapture,\n onPointerDownCapture,\n ...props\n}: ComboboxContentProps) {\n const [tracker] = React.useState<ComboboxToggleTracker>(() => ({\n pending: null,\n values: new WeakMap(),\n }))\n return (\n <ComboboxToggleContext.Provider value={tracker}>\n <ComboboxPrimitive.Portal container={container}>\n <PortalTheme>\n <ComboboxPrimitive.Backdrop\n data-slot=\"combobox-backdrop\"\n className=\"fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none sm:hidden\"\n />\n <ComboboxPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"z-50 max-sm:fixed! max-sm:inset-x-0! max-sm:top-auto! max-sm:bottom-(--spark-viewport-bottom-offset,0)! max-sm:transform-none!\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n className={cn(\n 'relative isolate z-50 flex max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) flex-col overflow-hidden rounded-lg border border-gray-a1 bg-gray-1 p-1 text-gray-a12 shadow-lg dark:bg-gray-3 [[data-high-contrast]_&]:border-gray-a11',\n 'transition-[opacity,scale,translate] duration-100 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none',\n 'sm:data-[side=bottom]:data-starting-style:-translate-y-2 sm:data-[side=left]:data-starting-style:translate-x-2 sm:data-[side=right]:data-starting-style:-translate-x-2 sm:data-[side=top]:data-starting-style:translate-y-2',\n 'max-sm:max-h-[80dvh] max-sm:w-full max-sm:max-w-none max-sm:rounded-b-none max-sm:border-x-0 max-sm:border-b-0 max-sm:px-4 max-sm:pt-3 max-sm:pb-[calc(env(safe-area-inset-bottom)+var(--spacing)*4)] max-sm:data-ending-style:translate-y-full max-sm:data-ending-style:scale-100 max-sm:data-ending-style:opacity-100 max-sm:data-starting-style:translate-y-full max-sm:data-starting-style:scale-100 max-sm:data-starting-style:opacity-100',\n className,\n )}\n {...props}\n onKeyDownCapture={(event) => {\n onKeyDownCapture?.(event)\n if (HIGHLIGHT_KEYS.has(event.key))\n event.currentTarget.setAttribute('data-keyboard', '')\n }}\n onPointerDownCapture={(event) => {\n onPointerDownCapture?.(event)\n event.currentTarget.removeAttribute('data-keyboard')\n }}\n >\n {children}\n </ComboboxPrimitive.Popup>\n </ComboboxPrimitive.Positioner>\n </PortalTheme>\n </ComboboxPrimitive.Portal>\n </ComboboxToggleContext.Provider>\n )\n}\n\n// Base UI removes the last pick on Backspace in the empty input only inside Chips\nfunction ComboboxInput({\n className,\n onKeyDown,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Input>) {\n const tracker = React.useContext(ComboboxToggleContext)\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-search\"\n // Chips adds role=\"toolbar\" for arrow keys between chips; this row holds none\n render={({ role: _toolbar, ...chipsProps }) => <div {...chipsProps} />}\n className=\"-mx-1 -mt-1 mb-1 flex shrink-0 items-center gap-1.5 border-b border-gray-a4 px-2.5 text-gray-light max-sm:mx-0 max-sm:mt-0 max-sm:mb-2 max-sm:rounded-md max-sm:border-b-0 max-sm:bg-gray-a3\"\n >\n <Search aria-hidden className=\"shrink-0 [--spark-icon-size:16px]\" />\n <ComboboxPrimitive.Input\n data-slot=\"combobox-input\"\n className={cn(\n 'h-10 w-full min-w-0 bg-transparent text-base text-gray outline-hidden placeholder:text-gray-placeholder',\n className,\n )}\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (!tracker || event.key !== 'Enter') return\n const highlighted = event.currentTarget\n .closest('[data-slot=\"combobox-content\"]')\n ?.querySelector('[data-slot=\"combobox-item\"][data-highlighted]')\n if (!highlighted) return\n tracker.pending = { value: tracker.values.get(highlighted) }\n setTimeout(() => {\n tracker.pending = null\n })\n }}\n {...props}\n />\n </ComboboxPrimitive.Chips>\n )\n}\n\n// the bottom sheet's \"Done\"; hidden from `sm` up, where the popup closes on outside press\nfunction ComboboxClose({\n className,\n onClick,\n ...props\n}: React.ComponentProps<'button'>) {\n return (\n <button\n data-slot=\"combobox-close\"\n type=\"button\"\n className={cn(\n buttonVariants({ variant: 'primary' }),\n 'mt-3 w-full shrink-0 sm:hidden',\n className,\n )}\n onClick={(event) => {\n onClick?.(event)\n // Combobox has no Close part; Escape is the key Base UI closes on\n event.currentTarget.dispatchEvent(\n new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }),\n )\n }}\n {...props}\n />\n )\n}\n\nfunction ComboboxList({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.List>) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n 'min-h-0 flex-1 overflow-y-auto overscroll-contain outline-hidden data-empty:p-0',\n className,\n )}\n {...props}\n />\n )\n}\n\n// forwardRef keeps refs working for React 18 consumers (ref-as-prop is 19-only)\nconst ComboboxItem = React.forwardRef<\n HTMLDivElement,\n ComboboxPrimitive.Item.Props\n>(function ComboboxItem({ className, value, ...props }, refProp) {\n const tracker = React.useContext(ComboboxToggleContext)\n const ref = React.useRef<HTMLDivElement | null>(null)\n React.useEffect(() => {\n const node = ref.current\n if (!tracker || !node) return\n tracker.values.set(node, value)\n if (!tracker.pending || !Object.is(tracker.pending.value, value)) return\n tracker.pending = null\n // after Base UI has registered the remounted item's new index\n const timer = setTimeout(() =>\n node.dispatchEvent(new MouseEvent('mousemove', { bubbles: true })),\n )\n return () => clearTimeout(timer)\n }, [tracker, value])\n return (\n <ComboboxPrimitive.Item\n ref={(node: HTMLDivElement | null) => {\n ref.current = node\n if (typeof refProp === 'function') refProp(node)\n else if (refProp) refProp.current = node\n }}\n value={value}\n data-slot=\"combobox-item\"\n className={cn(\n 'relative flex w-full cursor-default items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-sm text-gray outline-hidden transition-colors select-none touch-target-row data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-gray-a3 motion-reduce:transition-none max-sm:gap-3 max-sm:text-base [@media(hover:none)]:[[data-slot=combobox-content]:not([data-keyboard])_&]:data-highlighted:bg-transparent',\n className,\n )}\n {...props}\n />\n )\n})\n\nconst setInert = (node: HTMLElement | null) => {\n node?.setAttribute('inert', '')\n}\n\n// kept mounted so the bottom sheet draws an empty checkbox for unpicked items\nfunction ComboboxItemIndicator({\n className,\n children,\n keepMounted = true,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.ItemIndicator>) {\n return (\n <ComboboxPrimitive.ItemIndicator\n data-slot=\"combobox-item-indicator\"\n keepMounted={keepMounted}\n className={cn('flex shrink-0 items-center justify-center', className)}\n {...props}\n render={\n props.render ??\n ((indicatorProps, { selected }) => (\n <span {...indicatorProps}>\n <span\n className={cn(\n 'flex size-3.5 items-center justify-center max-sm:hidden',\n !selected && 'invisible',\n )}\n >\n {children ?? (\n <Check aria-hidden className=\"[--spark-icon-size:11px]\" />\n )}\n </span>\n {/* the option owns the press and the selected state; this only draws\n it. inert is set on the node as React 18 has no `inert` prop */}\n <span className=\"flex sm:hidden\" ref={setInert}>\n <Checkbox\n checked={selected}\n className=\"my-0 any-pointer-coarse:my-0\"\n readOnly\n render={<span />}\n />\n </span>\n </span>\n ))\n }\n />\n )\n}\n\nconst isSelectedGroup = (\n group: unknown,\n): group is ComboboxSelectedGroup<unknown> =>\n typeof group === 'object' && group !== null && 'optionCount' in group\n\n// with useComboboxSelectedGroups the picks never filter out, so Base UI alone would never\n// see an empty list; \"no matches\" is the options group gone while it had options\nfunction ComboboxEmpty({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Empty>) {\n const filtered: readonly unknown[] = useComboboxFilteredItems()\n const groups = filtered.filter(isSelectedGroup)\n const noOptionMatches =\n groups.some((group) => group.optionCount > 0) &&\n !groups.some((group) => group.value === 'items')\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n 'px-1.5 py-1.5 text-sm text-gray-light empty:p-0',\n className,\n )}\n {...props}\n render={({ children: _baseChildren, ...emptyProps }) => (\n <div {...emptyProps}>\n {filtered.length === 0 || noOptionMatches ? children : null}\n </div>\n )}\n />\n )\n}\n\nfunction ComboboxStatus({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Status>) {\n return (\n <ComboboxPrimitive.Status\n data-slot=\"combobox-status\"\n className={cn(\n 'px-1.5 py-1.5 text-sm text-gray-light empty:p-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.Group>) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(\n 'scroll-my-1 [&+&]:mt-1 [&+&]:border-t [&+&]:border-gray-a4 [&+&]:pt-1',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxGroupLabel({\n className,\n ...props\n}: React.ComponentProps<typeof ComboboxPrimitive.GroupLabel>) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-group-label\"\n className={cn(\n 'px-1.5 py-1 text-xs font-medium text-gray-light [[data-high-contrast]_&]:text-gray-a12',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n return (\n <div\n aria-hidden=\"true\"\n data-slot=\"combobox-separator\"\n className={cn(\n 'pointer-events-none -mx-1 my-1 h-px bg-gray-a3 [[data-high-contrast]_&]:bg-gray-a6',\n className,\n )}\n {...props}\n />\n )\n}\n\nexport {\n Combobox,\n ComboboxAddChip,\n ComboboxChip,\n ComboboxChips,\n ComboboxClear,\n ComboboxClose,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxInput,\n ComboboxItem,\n ComboboxItemIndicator,\n ComboboxList,\n ComboboxSeparator,\n ComboboxStatus,\n ComboboxTrigger,\n ComboboxTriggerGroup,\n ComboboxValue,\n useComboboxFilter,\n useComboboxFilteredItems,\n useComboboxSelectedGroups,\n}\n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AAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,KAACA,wBAAAA,SAAkB,OAAnB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,yEACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,iBAAA,GAAA,kBAAA,KAACA,wBAAAA,SAAkB,YAAnB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,0FACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SAC2B;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,eAAY;EACZ,aAAU;EACV,YAAA,GAAA,GAAA,IACE,sFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -83,6 +83,8 @@ declare function ComboboxContent({
83
83
  side,
84
84
  sideOffset,
85
85
  container,
86
+ onKeyDownCapture,
87
+ onPointerDownCapture,
86
88
  ...props
87
89
  }: ComboboxContentProps): import("react/jsx-runtime").JSX.Element;
88
90
  declare function ComboboxInput({
@@ -83,6 +83,8 @@ declare function ComboboxContent({
83
83
  side,
84
84
  sideOffset,
85
85
  container,
86
+ onKeyDownCapture,
87
+ onPointerDownCapture,
86
88
  ...props
87
89
  }: ComboboxContentProps): import("react/jsx-runtime").JSX.Element;
88
90
  declare function ComboboxInput({
@@ -1,13 +1,15 @@
1
1
  "use client";
2
2
  "use client";
3
3
  import { cn } from "../utils/cn.js";
4
- import { boxChrome } from "../lib/input-box-variants.js";
5
4
  import { PortalTheme } from "./theme.js";
6
5
  import { buttonVariants } from "./button.js";
6
+ import { ChevronDownGlyph, ClearGlyph } from "../lib/control-glyphs.js";
7
+ import { boxChrome } from "../lib/input-box-variants.js";
7
8
  import { useFieldControl } from "./field.js";
9
+ import { Checkbox } from "./checkbox.js";
8
10
  import { Pill } from "./pill.js";
9
11
  import * as React$1 from "react";
10
- import { Add, Check, Close, KeyboardArrowDown, Search } from "@epilot/spark-icons";
12
+ import { Add, Check, Search } from "@epilot/spark-icons";
11
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
14
  import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
13
15
  //#region src/components/combobox.tsx
@@ -73,10 +75,9 @@ function ComboboxTrigger({ className, children, variant, id: idProp, "aria-descr
73
75
  "aria-invalid": ariaInvalid,
74
76
  ...props,
75
77
  "aria-describedby": ariaDescribedBy,
76
- children: [children, /* @__PURE__ */ jsx(KeyboardArrowDown, {
77
- "aria-hidden": true,
78
+ children: [children, /* @__PURE__ */ jsx(ChevronDownGlyph, {
78
79
  "data-slot": "combobox-chevron",
79
- className: cn("pointer-events-none absolute shrink-0 text-gray-light transition-transform [--spark-icon-size:14px] in-data-popup-open:rotate-180 motion-reduce:transition-none", isGhost ? "right-1" : "right-3")
80
+ className: cn("pointer-events-none absolute shrink-0 text-gray-light transition-transform in-data-popup-open:rotate-180 motion-reduce:transition-none", isGhost ? "right-1" : "right-3")
80
81
  })]
81
82
  });
82
83
  }
@@ -143,14 +144,17 @@ function ComboboxClear({ className, children, onClick, ...props }) {
143
144
  },
144
145
  ...props,
145
146
  hidden: group.disabled || group.readOnly || props.hidden,
146
- children: children ?? /* @__PURE__ */ jsx(Close, {
147
- "aria-hidden": true,
148
- className: "[--spark-icon-size:14px]"
149
- })
147
+ children: children ?? /* @__PURE__ */ jsx(ClearGlyph, {})
150
148
  });
151
149
  }
152
150
  const ComboboxToggleContext = React$1.createContext(null);
153
- function ComboboxContent({ className, children, align = "start", alignOffset, side, sideOffset = 4, container, ...props }) {
151
+ const HIGHLIGHT_KEYS = new Set([
152
+ "ArrowDown",
153
+ "ArrowUp",
154
+ "Home",
155
+ "End"
156
+ ]);
157
+ function ComboboxContent({ className, children, align = "start", alignOffset, side, sideOffset = 4, container, onKeyDownCapture, onPointerDownCapture, ...props }) {
154
158
  const [tracker] = React$1.useState(() => ({
155
159
  pending: null,
156
160
  values: /* @__PURE__ */ new WeakMap()
@@ -172,6 +176,14 @@ function ComboboxContent({ className, children, align = "start", alignOffset, si
172
176
  "data-slot": "combobox-content",
173
177
  className: cn("relative isolate z-50 flex max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) flex-col overflow-hidden rounded-lg border border-gray-a1 bg-gray-1 p-1 text-gray-a12 shadow-lg dark:bg-gray-3 [[data-high-contrast]_&]:border-gray-a11", "transition-[opacity,scale,translate] duration-100 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none", "sm:data-[side=bottom]:data-starting-style:-translate-y-2 sm:data-[side=left]:data-starting-style:translate-x-2 sm:data-[side=right]:data-starting-style:-translate-x-2 sm:data-[side=top]:data-starting-style:translate-y-2", "max-sm:max-h-[80dvh] max-sm:w-full max-sm:max-w-none max-sm:rounded-b-none max-sm:border-x-0 max-sm:border-b-0 max-sm:px-4 max-sm:pt-3 max-sm:pb-[calc(env(safe-area-inset-bottom)+var(--spacing)*4)] max-sm:data-ending-style:translate-y-full max-sm:data-ending-style:scale-100 max-sm:data-ending-style:opacity-100 max-sm:data-starting-style:translate-y-full max-sm:data-starting-style:scale-100 max-sm:data-starting-style:opacity-100", className),
174
178
  ...props,
179
+ onKeyDownCapture: (event) => {
180
+ onKeyDownCapture?.(event);
181
+ if (HIGHLIGHT_KEYS.has(event.key)) event.currentTarget.setAttribute("data-keyboard", "");
182
+ },
183
+ onPointerDownCapture: (event) => {
184
+ onPointerDownCapture?.(event);
185
+ event.currentTarget.removeAttribute("data-keyboard");
186
+ },
175
187
  children
176
188
  })
177
189
  })] })
@@ -246,20 +258,38 @@ const ComboboxItem = React$1.forwardRef(function ComboboxItem({ className, value
246
258
  },
247
259
  value,
248
260
  "data-slot": "combobox-item",
249
- className: cn("relative flex w-full cursor-default items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-sm text-gray outline-hidden transition-colors select-none touch-target-row data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-gray-a3 motion-reduce:transition-none max-sm:gap-3 max-sm:text-base", className),
261
+ className: cn("relative flex w-full cursor-default items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-sm text-gray outline-hidden transition-colors select-none touch-target-row data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-gray-a3 motion-reduce:transition-none max-sm:gap-3 max-sm:text-base [@media(hover:none)]:[[data-slot=combobox-content]:not([data-keyboard])_&]:data-highlighted:bg-transparent", className),
250
262
  ...props
251
263
  });
252
264
  });
265
+ const setInert = (node) => {
266
+ node?.setAttribute("inert", "");
267
+ };
253
268
  function ComboboxItemIndicator({ className, children, keepMounted = true, ...props }) {
254
269
  return /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, {
255
270
  "data-slot": "combobox-item-indicator",
256
271
  keepMounted,
257
- className: cn("flex size-3.5 shrink-0 items-center justify-center [[data-slot=combobox-item]:not([data-selected])_&_svg]:invisible", "max-sm:size-5 max-sm:rounded-sm max-sm:border-2 max-sm:border-(--color-accent-ui) max-sm:bg-base-accent-soft max-sm:[[data-selected]_&]:border-(--color-primary) max-sm:[[data-selected]_&]:bg-(--color-primary) max-sm:[[data-selected]_&]:text-(--spark-on-solid)", className),
272
+ className: cn("flex shrink-0 items-center justify-center", className),
258
273
  ...props,
259
- children: children ?? /* @__PURE__ */ jsx(Check, {
260
- "aria-hidden": true,
261
- className: "[--spark-icon-size:11px]"
262
- })
274
+ render: props.render ?? ((indicatorProps, { selected }) => /* @__PURE__ */ jsxs("span", {
275
+ ...indicatorProps,
276
+ children: [/* @__PURE__ */ jsx("span", {
277
+ className: cn("flex size-3.5 items-center justify-center max-sm:hidden", !selected && "invisible"),
278
+ children: children ?? /* @__PURE__ */ jsx(Check, {
279
+ "aria-hidden": true,
280
+ className: "[--spark-icon-size:11px]"
281
+ })
282
+ }), /* @__PURE__ */ jsx("span", {
283
+ className: "flex sm:hidden",
284
+ ref: setInert,
285
+ children: /* @__PURE__ */ jsx(Checkbox, {
286
+ checked: selected,
287
+ className: "my-0 any-pointer-coarse:my-0",
288
+ readOnly: true,
289
+ render: /* @__PURE__ */ jsx("span", {})
290
+ })
291
+ })]
292
+ }))
263
293
  });
264
294
  }
265
295
  const isSelectedGroup = (group) => typeof group === "object" && group !== null && "optionCount" in group;