@orz/ui 0.0.0-stage → 0.1.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 (270) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +541 -2
  3. package/dist/components/avatar.d.ts +14 -0
  4. package/dist/components/avatar.d.ts.map +1 -0
  5. package/dist/components/avatar.js +23 -0
  6. package/dist/components/avatar.js.map +1 -0
  7. package/dist/components/badge.d.ts +10 -0
  8. package/dist/components/badge.d.ts.map +1 -0
  9. package/dist/components/badge.js +26 -0
  10. package/dist/components/badge.js.map +1 -0
  11. package/dist/components/button.d.ts +11 -0
  12. package/dist/components/button.d.ts.map +1 -0
  13. package/dist/components/button.js +40 -0
  14. package/dist/components/button.js.map +1 -0
  15. package/dist/components/card.d.ts +12 -0
  16. package/dist/components/card.d.ts.map +1 -0
  17. package/dist/components/card.js +25 -0
  18. package/dist/components/card.js.map +1 -0
  19. package/dist/components/color-picker.d.ts +58 -0
  20. package/dist/components/color-picker.d.ts.map +1 -0
  21. package/dist/components/color-picker.js +950 -0
  22. package/dist/components/color-picker.js.map +1 -0
  23. package/dist/components/confirm-dialog.d.ts +26 -0
  24. package/dist/components/confirm-dialog.d.ts.map +1 -0
  25. package/dist/components/confirm-dialog.js +18 -0
  26. package/dist/components/confirm-dialog.js.map +1 -0
  27. package/dist/components/dialog.d.ts +26 -0
  28. package/dist/components/dialog.d.ts.map +1 -0
  29. package/dist/components/dialog.js +149 -0
  30. package/dist/components/dialog.js.map +1 -0
  31. package/dist/components/dropdown-menu.d.ts +30 -0
  32. package/dist/components/dropdown-menu.d.ts.map +1 -0
  33. package/dist/components/dropdown-menu.js +100 -0
  34. package/dist/components/dropdown-menu.js.map +1 -0
  35. package/dist/components/filter-menu.d.ts +98 -0
  36. package/dist/components/filter-menu.d.ts.map +1 -0
  37. package/dist/components/filter-menu.js +745 -0
  38. package/dist/components/filter-menu.js.map +1 -0
  39. package/dist/components/highlighted-input.d.ts +40 -0
  40. package/dist/components/highlighted-input.d.ts.map +1 -0
  41. package/dist/components/highlighted-input.js +95 -0
  42. package/dist/components/highlighted-input.js.map +1 -0
  43. package/dist/components/hover-card.d.ts +7 -0
  44. package/dist/components/hover-card.d.ts.map +1 -0
  45. package/dist/components/hover-card.js +22 -0
  46. package/dist/components/hover-card.js.map +1 -0
  47. package/dist/components/input.d.ts +4 -0
  48. package/dist/components/input.d.ts.map +1 -0
  49. package/dist/components/input.js +7 -0
  50. package/dist/components/input.js.map +1 -0
  51. package/dist/components/label.d.ts +5 -0
  52. package/dist/components/label.d.ts.map +1 -0
  53. package/dist/components/label.js +8 -0
  54. package/dist/components/label.js.map +1 -0
  55. package/dist/components/link-chip.d.ts +67 -0
  56. package/dist/components/link-chip.d.ts.map +1 -0
  57. package/dist/components/link-chip.js +71 -0
  58. package/dist/components/link-chip.js.map +1 -0
  59. package/dist/components/load-failure.d.ts +24 -0
  60. package/dist/components/load-failure.d.ts.map +1 -0
  61. package/dist/components/load-failure.js +27 -0
  62. package/dist/components/load-failure.js.map +1 -0
  63. package/dist/components/load-more.d.ts +15 -0
  64. package/dist/components/load-more.d.ts.map +1 -0
  65. package/dist/components/load-more.js +25 -0
  66. package/dist/components/load-more.js.map +1 -0
  67. package/dist/components/media-controls.d.ts +50 -0
  68. package/dist/components/media-controls.d.ts.map +1 -0
  69. package/dist/components/media-controls.js +71 -0
  70. package/dist/components/media-controls.js.map +1 -0
  71. package/dist/components/popover.d.ts +9 -0
  72. package/dist/components/popover.d.ts.map +1 -0
  73. package/dist/components/popover.js +82 -0
  74. package/dist/components/popover.js.map +1 -0
  75. package/dist/components/query-box.d.ts +78 -0
  76. package/dist/components/query-box.d.ts.map +1 -0
  77. package/dist/components/query-box.js +332 -0
  78. package/dist/components/query-box.js.map +1 -0
  79. package/dist/components/query-highlight.d.ts +14 -0
  80. package/dist/components/query-highlight.d.ts.map +1 -0
  81. package/dist/components/query-highlight.js +132 -0
  82. package/dist/components/query-highlight.js.map +1 -0
  83. package/dist/components/select.d.ts +19 -0
  84. package/dist/components/select.d.ts.map +1 -0
  85. package/dist/components/select.js +38 -0
  86. package/dist/components/select.js.map +1 -0
  87. package/dist/components/separator.d.ts +5 -0
  88. package/dist/components/separator.d.ts.map +1 -0
  89. package/dist/components/separator.js +9 -0
  90. package/dist/components/separator.js.map +1 -0
  91. package/dist/components/sheet.d.ts +16 -0
  92. package/dist/components/sheet.d.ts.map +1 -0
  93. package/dist/components/sheet.js +41 -0
  94. package/dist/components/sheet.js.map +1 -0
  95. package/dist/components/skeleton.d.ts +3 -0
  96. package/dist/components/skeleton.d.ts.map +1 -0
  97. package/dist/components/skeleton.js +7 -0
  98. package/dist/components/skeleton.js.map +1 -0
  99. package/dist/components/slider.d.ts +8 -0
  100. package/dist/components/slider.d.ts.map +1 -0
  101. package/dist/components/slider.js +14 -0
  102. package/dist/components/slider.js.map +1 -0
  103. package/dist/components/sonner.d.ts +4 -0
  104. package/dist/components/sonner.d.ts.map +1 -0
  105. package/dist/components/sonner.js +26 -0
  106. package/dist/components/sonner.js.map +1 -0
  107. package/dist/components/switch.d.ts +5 -0
  108. package/dist/components/switch.d.ts.map +1 -0
  109. package/dist/components/switch.js +8 -0
  110. package/dist/components/switch.js.map +1 -0
  111. package/dist/components/table.d.ts +11 -0
  112. package/dist/components/table.d.ts.map +1 -0
  113. package/dist/components/table.js +28 -0
  114. package/dist/components/table.js.map +1 -0
  115. package/dist/components/tabs.d.ts +8 -0
  116. package/dist/components/tabs.d.ts.map +1 -0
  117. package/dist/components/tabs.js +18 -0
  118. package/dist/components/tabs.js.map +1 -0
  119. package/dist/components/textarea.d.ts +4 -0
  120. package/dist/components/textarea.d.ts.map +1 -0
  121. package/dist/components/textarea.js +7 -0
  122. package/dist/components/textarea.js.map +1 -0
  123. package/dist/components/theme-editor/draft.d.ts +235 -0
  124. package/dist/components/theme-editor/draft.d.ts.map +1 -0
  125. package/dist/components/theme-editor/draft.js +638 -0
  126. package/dist/components/theme-editor/draft.js.map +1 -0
  127. package/dist/components/theme-editor/export-panel.d.ts +14 -0
  128. package/dist/components/theme-editor/export-panel.d.ts.map +1 -0
  129. package/dist/components/theme-editor/export-panel.js +39 -0
  130. package/dist/components/theme-editor/export-panel.js.map +1 -0
  131. package/dist/components/theme-editor/form.d.ts +69 -0
  132. package/dist/components/theme-editor/form.d.ts.map +1 -0
  133. package/dist/components/theme-editor/form.js +350 -0
  134. package/dist/components/theme-editor/form.js.map +1 -0
  135. package/dist/components/theme-editor/import-panel.d.ts +21 -0
  136. package/dist/components/theme-editor/import-panel.d.ts.map +1 -0
  137. package/dist/components/theme-editor/import-panel.js +117 -0
  138. package/dist/components/theme-editor/import-panel.js.map +1 -0
  139. package/dist/components/theme-editor/theme-list.d.ts +23 -0
  140. package/dist/components/theme-editor/theme-list.d.ts.map +1 -0
  141. package/dist/components/theme-editor/theme-list.js +42 -0
  142. package/dist/components/theme-editor/theme-list.js.map +1 -0
  143. package/dist/components/theme-editor/token-list.d.ts +30 -0
  144. package/dist/components/theme-editor/token-list.d.ts.map +1 -0
  145. package/dist/components/theme-editor/token-list.js +124 -0
  146. package/dist/components/theme-editor/token-list.js.map +1 -0
  147. package/dist/components/theme-editor/tokens.d.ts +37 -0
  148. package/dist/components/theme-editor/tokens.d.ts.map +1 -0
  149. package/dist/components/theme-editor/tokens.js +155 -0
  150. package/dist/components/theme-editor/tokens.js.map +1 -0
  151. package/dist/components/theme-editor.d.ts +26 -0
  152. package/dist/components/theme-editor.d.ts.map +1 -0
  153. package/dist/components/theme-editor.js +467 -0
  154. package/dist/components/theme-editor.js.map +1 -0
  155. package/dist/components/theme-menu.d.ts +28 -0
  156. package/dist/components/theme-menu.d.ts.map +1 -0
  157. package/dist/components/theme-menu.js +308 -0
  158. package/dist/components/theme-menu.js.map +1 -0
  159. package/dist/components/tooltip.d.ts +11 -0
  160. package/dist/components/tooltip.d.ts.map +1 -0
  161. package/dist/components/tooltip.js +18 -0
  162. package/dist/components/tooltip.js.map +1 -0
  163. package/dist/components/unsaved-changes-dialog.d.ts +39 -0
  164. package/dist/components/unsaved-changes-dialog.d.ts.map +1 -0
  165. package/dist/components/unsaved-changes-dialog.js +46 -0
  166. package/dist/components/unsaved-changes-dialog.js.map +1 -0
  167. package/dist/hooks/scroll-insets.d.ts +89 -0
  168. package/dist/hooks/scroll-insets.d.ts.map +1 -0
  169. package/dist/hooks/scroll-insets.js +265 -0
  170. package/dist/hooks/scroll-insets.js.map +1 -0
  171. package/dist/hooks/use-element-height.d.ts +11 -0
  172. package/dist/hooks/use-element-height.d.ts.map +1 -0
  173. package/dist/hooks/use-element-height.js +33 -0
  174. package/dist/hooks/use-element-height.js.map +1 -0
  175. package/dist/hooks/use-media-query.d.ts +22 -0
  176. package/dist/hooks/use-media-query.d.ts.map +1 -0
  177. package/dist/hooks/use-media-query.js +38 -0
  178. package/dist/hooks/use-media-query.js.map +1 -0
  179. package/dist/hooks/use-overlay-scrollbars.d.ts +31 -0
  180. package/dist/hooks/use-overlay-scrollbars.d.ts.map +1 -0
  181. package/dist/hooks/use-overlay-scrollbars.js +80 -0
  182. package/dist/hooks/use-overlay-scrollbars.js.map +1 -0
  183. package/dist/hooks/use-paged-append.d.ts +7 -0
  184. package/dist/hooks/use-paged-append.d.ts.map +1 -0
  185. package/dist/hooks/use-paged-append.js +53 -0
  186. package/dist/hooks/use-paged-append.js.map +1 -0
  187. package/dist/hooks/use-query-completion.d.ts +27 -0
  188. package/dist/hooks/use-query-completion.d.ts.map +1 -0
  189. package/dist/hooks/use-query-completion.js +100 -0
  190. package/dist/hooks/use-query-completion.js.map +1 -0
  191. package/dist/hooks/use-slash-shortcut.d.ts +9 -0
  192. package/dist/hooks/use-slash-shortcut.d.ts.map +1 -0
  193. package/dist/hooks/use-slash-shortcut.js +38 -0
  194. package/dist/hooks/use-slash-shortcut.js.map +1 -0
  195. package/dist/hooks/viewport-chrome.d.ts +50 -0
  196. package/dist/hooks/viewport-chrome.d.ts.map +1 -0
  197. package/dist/hooks/viewport-chrome.js +170 -0
  198. package/dist/hooks/viewport-chrome.js.map +1 -0
  199. package/dist/index.d.ts +2 -0
  200. package/dist/index.d.ts.map +1 -0
  201. package/dist/index.js +2 -0
  202. package/dist/index.js.map +1 -0
  203. package/dist/lib/cell-width-table.d.ts +3 -0
  204. package/dist/lib/cell-width-table.d.ts.map +1 -0
  205. package/dist/lib/cell-width-table.js +6 -0
  206. package/dist/lib/cell-width-table.js.map +1 -0
  207. package/dist/lib/cell-width.d.ts +7 -0
  208. package/dist/lib/cell-width.d.ts.map +1 -0
  209. package/dist/lib/cell-width.js +50 -0
  210. package/dist/lib/cell-width.js.map +1 -0
  211. package/dist/lib/clipboard.d.ts +8 -0
  212. package/dist/lib/clipboard.d.ts.map +1 -0
  213. package/dist/lib/clipboard.js +19 -0
  214. package/dist/lib/clipboard.js.map +1 -0
  215. package/dist/lib/color.d.ts +40 -0
  216. package/dist/lib/color.d.ts.map +1 -0
  217. package/dist/lib/color.js +177 -0
  218. package/dist/lib/color.js.map +1 -0
  219. package/dist/lib/scroll-map.d.ts +20 -0
  220. package/dist/lib/scroll-map.d.ts.map +1 -0
  221. package/dist/lib/scroll-map.js +46 -0
  222. package/dist/lib/scroll-map.js.map +1 -0
  223. package/dist/lib/text-metrics.d.ts +33 -0
  224. package/dist/lib/text-metrics.d.ts.map +1 -0
  225. package/dist/lib/text-metrics.js +89 -0
  226. package/dist/lib/text-metrics.js.map +1 -0
  227. package/dist/lib/theme-file.d.ts +51 -0
  228. package/dist/lib/theme-file.d.ts.map +1 -0
  229. package/dist/lib/theme-file.js +511 -0
  230. package/dist/lib/theme-file.js.map +1 -0
  231. package/dist/lib/unsaved-guard.d.ts +33 -0
  232. package/dist/lib/unsaved-guard.d.ts.map +1 -0
  233. package/dist/lib/unsaved-guard.js +37 -0
  234. package/dist/lib/unsaved-guard.js.map +1 -0
  235. package/dist/lib/utils.d.ts +3 -0
  236. package/dist/lib/utils.d.ts.map +1 -0
  237. package/dist/lib/utils.js +6 -0
  238. package/dist/lib/utils.js.map +1 -0
  239. package/dist/theme/custom.d.ts +8 -0
  240. package/dist/theme/custom.d.ts.map +1 -0
  241. package/dist/theme/custom.js +56 -0
  242. package/dist/theme/custom.js.map +1 -0
  243. package/dist/theme/index.d.ts +6 -0
  244. package/dist/theme/index.d.ts.map +1 -0
  245. package/dist/theme/index.js +5 -0
  246. package/dist/theme/index.js.map +1 -0
  247. package/dist/theme/paint-guard.d.ts +20 -0
  248. package/dist/theme/paint-guard.d.ts.map +1 -0
  249. package/dist/theme/paint-guard.js +120 -0
  250. package/dist/theme/paint-guard.js.map +1 -0
  251. package/dist/theme/picks.d.ts +22 -0
  252. package/dist/theme/picks.d.ts.map +1 -0
  253. package/dist/theme/picks.js +43 -0
  254. package/dist/theme/picks.js.map +1 -0
  255. package/dist/theme/pref.d.ts +39 -0
  256. package/dist/theme/pref.d.ts.map +1 -0
  257. package/dist/theme/pref.js +129 -0
  258. package/dist/theme/pref.js.map +1 -0
  259. package/dist/theme/provider.d.ts +41 -0
  260. package/dist/theme/provider.d.ts.map +1 -0
  261. package/dist/theme/provider.js +103 -0
  262. package/dist/theme/provider.js.map +1 -0
  263. package/dist/theme/store.d.ts +104 -0
  264. package/dist/theme/store.d.ts.map +1 -0
  265. package/dist/theme/store.js +509 -0
  266. package/dist/theme/store.js.map +1 -0
  267. package/package.json +94 -3
  268. package/styles.css +79 -0
  269. package/theme.css +186 -0
  270. package/vendor/shadcn-tailwind.css +664 -0
@@ -0,0 +1,332 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { orderRows, parseQuery, } from "@orz/query";
3
+ import { FilterIcon, TagIcon } from "lucide-react";
4
+ import { Fragment, useEffect, useId, useLayoutEffect, useRef, useState, } from "react";
5
+ import { useQueryCompletion } from "../hooks/use-query-completion.js";
6
+ import { cn } from "../lib/utils.js";
7
+ import { HighlightedInput } from "./highlighted-input.js";
8
+ import { highlightQuery } from "./query-highlight.js";
9
+ /**
10
+ * `w-full` because a `<button>` row resolves `width: auto` to fit-content and
11
+ * would otherwise shrink to a pill beside its full-width neighbours; on the
12
+ * `<a>` and `<div>` rows, which are block already, it changes nothing.
13
+ */
14
+ const OPTION = "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm";
15
+ /** Nothing highlighted. Enter then submits what was typed, not an offer. */
16
+ const NONE = -1;
17
+ /** Also the React key; the highlight follows it, not an index. */
18
+ function rowKey(row) {
19
+ if (row.kind === "submit")
20
+ return "submit";
21
+ if (row.kind === "app")
22
+ return `${row.source.id}:${row.source.key(row.row)}`;
23
+ return `completion:${row.row.id}`;
24
+ }
25
+ /**
26
+ * One glyph per kind of offer. A row is a short run of monospace and a few
27
+ * grey words, so the icon carries the whole distinction between a key and a
28
+ * value.
29
+ */
30
+ const COMPLETION_ICON = {
31
+ key: FilterIcon,
32
+ value: TagIcon,
33
+ };
34
+ /**
35
+ * A query box: `HighlightedInput` with the schema's colours, its completions,
36
+ * and the app's own rows in one panel, behind todou's keyboard model.
37
+ *
38
+ * A form, not a button with a handler: Enter submits it the way every search
39
+ * box on the web does. Where the query goes is the app's: `onSubmit`.
40
+ *
41
+ * The listbox is hand-rolled rather than a radix popover because focus has to
42
+ * stay in the input and `Content` wants to take it. Nothing is ever
43
+ * preselected: the reader is typing a query, so Enter belongs to the query
44
+ * unless they arrowed onto something else. Tab is the key that takes an offer.
45
+ */
46
+ export function QueryBox({ schema, providers, value, onValueChange, onSubmit, sources = [], renderSubmitRow, limit = 20, onEscape, onOpenChange, listAlign = "centered", leading, inputProps = {}, className, panelClassName, }) {
47
+ const [focused, setFocused] = useState(false);
48
+ const [dismissed, setDismissed] = useState(false);
49
+ // A key, so a search answer that lands rows above it does not move it.
50
+ const [highlightKey, setHighlightKey] = useState(null);
51
+ const [position, setPosition] = useState({ caret: 0 });
52
+ const input = useRef(null);
53
+ const list = useRef(null);
54
+ const listId = useId();
55
+ const { parts, completions, loading } = useQueryCompletion({
56
+ schema,
57
+ value,
58
+ caret: position.caret,
59
+ providers,
60
+ enabled: focused && !dismissed,
61
+ });
62
+ const results = [
63
+ // App sources first: a row the app recognises (a jump to what the query
64
+ // names) outranks finishing a word, as in todou.
65
+ ...sources.map((source) => ({
66
+ matched: source.matched,
67
+ ...(source.yields === undefined ? {} : { yields: source.yields }),
68
+ rows: source.rows.map((row) => ({ kind: "app", source, row })),
69
+ })),
70
+ ...completions.map((result) => ({
71
+ matched: result.matched,
72
+ rows: result.rows.map((row) => ({ kind: "completion", row })),
73
+ })),
74
+ ];
75
+ const rows = orderRows(results, { kind: "submit" }, limit);
76
+ const query = value.trim();
77
+ const open = focused && !dismissed && (query !== "" || rows.length > 1);
78
+ const hl = highlightKey === null
79
+ ? NONE
80
+ : rows.findIndex((row) => rowKey(row) === highlightKey);
81
+ const setHighlight = (idx) => {
82
+ const row = idx === NONE ? undefined : rows[idx];
83
+ setHighlightKey(row === undefined ? null : rowKey(row));
84
+ };
85
+ // A value the app set (a submitted row loaded into the box, say) is a new
86
+ // query, and nothing in it is aimed at yet.
87
+ const emitted = useRef(value);
88
+ const [seen, setSeen] = useState(value);
89
+ if (seen !== value) {
90
+ setSeen(value);
91
+ if (value !== emitted.current)
92
+ setHighlightKey(null);
93
+ }
94
+ const emit = (next) => {
95
+ emitted.current = next;
96
+ onValueChange(next);
97
+ };
98
+ const optionId = (idx) => `${listId}-${idx}`;
99
+ // Reported on change only, so an app can tie loading to it without being
100
+ // told the same thing on every keystroke.
101
+ const reportOpen = useRef(onOpenChange);
102
+ reportOpen.current = onOpenChange;
103
+ const wasOpen = useRef(false);
104
+ useEffect(() => {
105
+ if (wasOpen.current === open)
106
+ return;
107
+ wasOpen.current = open;
108
+ reportOpen.current?.(open);
109
+ }, [open]);
110
+ // Ten rows already keep the panel short in an ordinary window; this is the
111
+ // floor under a short one, where even a few rows reach past the bottom.
112
+ // Measured rather than a `calc(100vh - …)`, because the same box can sit
113
+ // anywhere on the page and the height above it is not a constant. Before
114
+ // paint, or there is a frame of the too-tall panel.
115
+ const [maxHeight, setMaxHeight] = useState(undefined);
116
+ // biome-ignore lint/correctness/useExhaustiveDependencies: re-measure whenever the panel opens or changes length
117
+ useLayoutEffect(() => {
118
+ const panel = list.current;
119
+ if (panel === null) {
120
+ setMaxHeight(undefined);
121
+ return;
122
+ }
123
+ const measure = () => {
124
+ setMaxHeight(window.innerHeight - panel.getBoundingClientRect().top - 8);
125
+ };
126
+ measure();
127
+ window.addEventListener("resize", measure);
128
+ return () => window.removeEventListener("resize", measure);
129
+ }, [open, rows.length]);
130
+ // A scroll container can hold the highlight out of sight, and then the
131
+ // arrow keys are moving something the reader cannot see. The rows are the
132
+ // panel's only children, so the index is the child.
133
+ useLayoutEffect(() => {
134
+ if (hl === NONE)
135
+ return;
136
+ list.current?.children[hl]?.scrollIntoView?.({ block: "nearest" });
137
+ }, [hl]);
138
+ /**
139
+ * Accepting an offer rewrites the query; the caret goes where it says once
140
+ * the new value is in the input. The value is the app's state, so that is
141
+ * a later commit than this one.
142
+ */
143
+ const pending = useRef(null);
144
+ const accept = (apply) => {
145
+ emit(apply.value);
146
+ setHighlight(NONE);
147
+ setDismissed(false);
148
+ pending.current = apply;
149
+ };
150
+ useLayoutEffect(() => {
151
+ const apply = pending.current;
152
+ const el = input.current;
153
+ if (apply === null || el === null || el.value !== apply.value)
154
+ return;
155
+ pending.current = null;
156
+ el.focus();
157
+ el.setSelectionRange(apply.caret, apply.caret);
158
+ setPosition({ caret: apply.caret });
159
+ });
160
+ /**
161
+ * What Tab takes — the submit row is not an offer.
162
+ *
163
+ * A highlighted app row with `apply` loads what it says into the box,
164
+ * which is what Tab already means: take the offer and keep editing. With
165
+ * nothing highlighted Tab still falls back to the first *completion* and
166
+ * never to an app row — an unaimed Tab means "finish the word I am
167
+ * typing", and a whole past query is a long way from that.
168
+ */
169
+ const acceptable = (from) => {
170
+ const at = rows[from];
171
+ if (at?.kind === "completion")
172
+ return at.row.apply;
173
+ if (at?.kind === "app") {
174
+ const apply = at.source.apply?.(at.row);
175
+ if (apply != null)
176
+ return apply;
177
+ }
178
+ for (const row of rows)
179
+ if (row.kind === "completion")
180
+ return row.row.apply;
181
+ return null;
182
+ };
183
+ /** Enter on `chosen`, or on nothing. */
184
+ const choose = (chosen) => {
185
+ // Enter on a completion takes it and stays put; the reader is still
186
+ // building the query, not asking for it.
187
+ if (chosen?.kind === "completion") {
188
+ accept(chosen.row.apply);
189
+ return;
190
+ }
191
+ // An empty box has nothing to submit — unless an app row is what is
192
+ // being submitted, a past query say.
193
+ if (query === "" && chosen?.kind !== "app")
194
+ return;
195
+ setDismissed(true);
196
+ setHighlight(NONE);
197
+ onSubmit(query, chosen?.kind === "app" ? chosen.row : undefined);
198
+ };
199
+ // An IME takes Enter to commit its candidate, and on some browsers the
200
+ // keydown arrives with the composition already ended; keyCode 229 is how
201
+ // that one still says so. Either way the form must not submit.
202
+ const imeEnter = useRef(false);
203
+ const submit = (e) => {
204
+ e.preventDefault();
205
+ if (imeEnter.current) {
206
+ imeEnter.current = false;
207
+ return;
208
+ }
209
+ // Esc hid the panel, and hiding it has to mean something: Enter then
210
+ // does the plain thing rather than following an invisible highlight.
211
+ // `open` is false after Escape, so nothing counts as chosen.
212
+ choose(open && hl !== NONE ? rows[hl] : undefined);
213
+ };
214
+ const onKeyDown = (e) => {
215
+ inputProps.onKeyDown?.(e);
216
+ if (e.defaultPrevented)
217
+ return;
218
+ const composing = e.nativeEvent.isComposing || e.keyCode === 229;
219
+ imeEnter.current = e.key === "Enter" && composing;
220
+ // The IME owns every key until it commits: Escape cancels its candidate,
221
+ // Tab and the arrows pick one.
222
+ if (composing)
223
+ return;
224
+ if (e.key === "Escape") {
225
+ // The first press closes the panel and stays the box's own; only with
226
+ // nothing left to close is Escape the app's (leaving an overlay, say).
227
+ if (!open) {
228
+ onEscape?.();
229
+ return;
230
+ }
231
+ setDismissed(true);
232
+ setHighlight(NONE);
233
+ }
234
+ else if (e.key === "Tab" && open && !e.shiftKey) {
235
+ // Never falls through to the submit row or an app row without
236
+ // `apply`: with nothing to take, Tab moves focus as it always does.
237
+ const apply = acceptable(hl);
238
+ if (apply === null)
239
+ return;
240
+ accept(apply);
241
+ }
242
+ else if (!open) {
243
+ return;
244
+ }
245
+ else if (e.key === "Delete" && e.shiftKey) {
246
+ // The address bar's own gesture for the same thing. macOS has no
247
+ // Delete key of its own; a button on the row is the path there.
248
+ const at = rows[hl];
249
+ if (at?.kind !== "app" || at.source.remove === undefined)
250
+ return;
251
+ at.source.remove(at.row);
252
+ }
253
+ else if (e.key === "ArrowDown") {
254
+ setHighlight(Math.min(hl + 1, rows.length - 1));
255
+ }
256
+ else if (e.key === "ArrowUp") {
257
+ // Back past the first row is back to nothing selected, which is where
258
+ // the box started and what Enter means by default.
259
+ setHighlight(Math.max(hl - 1, NONE));
260
+ }
261
+ else if (e.key === "Home") {
262
+ // While the panel is open the keys walk it, as in any listbox; with
263
+ // it closed they move the caret as usual.
264
+ setHighlight(0);
265
+ }
266
+ else if (e.key === "End") {
267
+ setHighlight(rows.length - 1);
268
+ }
269
+ else {
270
+ return;
271
+ }
272
+ e.preventDefault();
273
+ };
274
+ const optionProps = (idx) => ({
275
+ id: optionId(idx),
276
+ role: "option",
277
+ // Focus never leaves the input; aria-activedescendant does the walking.
278
+ tabIndex: -1,
279
+ "aria-selected": idx === hl,
280
+ className: cn(OPTION, idx === hl && "bg-accent"),
281
+ onMouseMove: () => setHighlight(idx),
282
+ onClick: () => choose(rows[idx]),
283
+ });
284
+ return (_jsxs("search", { className: cn("relative", className), children: [_jsxs("form", { onSubmit: submit, children: [leading !== undefined && (_jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute top-1/2 left-2 z-10 flex -translate-y-1/2 text-muted-foreground [&_svg]:size-3.5", children: leading })), _jsx(HighlightedInput, { type: "text", ...inputProps, inputRef: input,
285
+ // The browser's own drop-down would cover this panel, and it knows
286
+ // neither the syntax nor the app's values (T-268).
287
+ autoComplete: "off",
288
+ // A combobox, so a screen reader follows `aria-activedescendant`
289
+ // through the rows while focus stays here with the caret.
290
+ role: "combobox", "aria-expanded": open, "aria-controls": listId, "aria-activedescendant": open && hl !== NONE ? optionId(hl) : undefined, "aria-autocomplete": "list", "aria-busy": loading || undefined, value: value, onValueChange: (next) => {
291
+ emit(next);
292
+ setDismissed(false);
293
+ setHighlight(NONE);
294
+ }, onCaretChange: setPosition, render: (text) => highlightQuery(text, text === value ? parts : parseQuery(schema, text), schema, providers), onKeyDown: onKeyDown, onFocus: (e) => {
295
+ setFocused(true);
296
+ setDismissed(false);
297
+ setHighlight(NONE);
298
+ inputProps.onFocus?.(e);
299
+ }, onBlur: (e) => {
300
+ inputProps.onBlur?.(e);
301
+ // Clicking a row blurs the input before the click lands; the
302
+ // listbox's own mousedown guard covers the pointer, this covers
303
+ // a focus that really did move into it.
304
+ if (list.current?.contains(e.relatedTarget))
305
+ return;
306
+ setFocused(false);
307
+ }, ...(leading === undefined ? {} : { padding: "pl-7" }) })] }), open && (_jsx("div", { ref: list, id: listId, role: "listbox", "aria-label": "Suggestions",
308
+ // Without this, pressing on a row blurs the input first and the
309
+ // listbox is gone before the click arrives.
310
+ onMouseDown: (e) => e.preventDefault(), style: { maxHeight }, className: cn("absolute top-full z-50 mt-1 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-lg border bg-popover p-1 shadow-lg ring-1 ring-foreground/5", listAlign === "start"
311
+ ? // The box starts at the edge of the screen, so the panel
312
+ // takes its width and stops. A floor still applies, because
313
+ // the narrowest phone squeezes the box down to ~250px and a
314
+ // row has to survive — but the floor stops at the viewport,
315
+ // since a `min-width` beats a `max-width` and a flat 20rem
316
+ // would push the page 16px wider at 320.
317
+ "left-0 w-full min-w-[min(20rem,calc(100vw-2rem))]"
318
+ : // Centred on the box, not on the caret: the panel following
319
+ // the caret across the line made the reader chase it (T-268).
320
+ "left-1/2 w-[28rem] -translate-x-1/2", panelClassName), children: rows.map((row, idx) => {
321
+ const option = optionProps(idx);
322
+ if (row.kind === "submit") {
323
+ return (_jsx(Fragment, { children: renderSubmitRow(query, option) }, rowKey(row)));
324
+ }
325
+ if (row.kind === "app") {
326
+ return (_jsx(Fragment, { children: row.source.render(row.row, option) }, rowKey(row)));
327
+ }
328
+ const Icon = COMPLETION_ICON[row.row.icon];
329
+ return (_jsxs("button", { type: "button", ...option, onClick: () => accept(row.row.apply), children: [_jsx(Icon, { className: "size-3.5 shrink-0 text-muted-foreground", "aria-hidden": true }), _jsx("span", { className: "truncate font-mono text-xs", children: row.row.text }), row.row.hint !== undefined && (_jsx("span", { className: "truncate text-muted-foreground text-xs", children: row.row.hint }))] }, rowKey(row)));
330
+ }) }))] }));
331
+ }
332
+ //# sourceMappingURL=query-box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-box.js","sourceRoot":"","sources":["../../src/components/query-box.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,SAAS,EACT,UAAU,GAGX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOnD,OAAO,EACL,QAAQ,EACR,SAAS,EACT,KAAK,EACL,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAsB,gBAAgB,EAAE,MAAM,wBAAyB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAuB,CAAC;AAsCvD;;;;GAIG;AACH,MAAM,MAAM,GAAG,+DAA+D,CAAC;AAE/E,4EAA4E;AAC5E,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC;AAEhB,kEAAkE;AAClE,SAAS,MAAM,CAAI,GAAc;IAC/B,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC3C,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK;QAAE,OAAO,GAAG,GAAG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GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IADtB,MAAM,CAAC,GAAG,CAAC,CAEf,CACZ,CAAC;oBACJ,CAAC;oBACD,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAC3C,OAAO,CAIL,kBACE,IAAI,EAAC,QAAQ,KAET,MAAM,EACV,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,aAEpC,KAAC,IAAI,IACH,SAAS,EAAC,yCAAyC,wBAEnD,EACF,eAAM,SAAS,EAAC,4BAA4B,YACzC,GAAG,CAAC,GAAG,CAAC,IAAI,GACR,EACN,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,CAC7B,eAAM,SAAS,EAAC,wCAAwC,YACrD,GAAG,CAAC,GAAG,CAAC,IAAI,GACR,CACR,KAfI,MAAM,CAAC,GAAG,CAAC,CAgBT,CACV,CAAC;gBACJ,CAAC,CAAC,GACE,CACP,IACM,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type CompiledQuerySchema, type QueryPart, type ValueProviders } from "@orz/query";
2
+ import type { ReactNode } from "react";
3
+ /**
4
+ * The parsed query as spans, for the mirror layer behind the input. A pure
5
+ * function of the parts, so it is the same string the input holds — never a
6
+ * re-tokenization that could disagree with it.
7
+ *
8
+ * Values are coloured by their verdict against `providers`. A provider that
9
+ * has not loaded yet leaves its values `unknown`, which paints as valid:
10
+ * flashing every value amber and back as the list arrives is worse than
11
+ * being briefly quiet.
12
+ */
13
+ export declare function highlightQuery(text: string, parts: readonly QueryPart[], schema: CompiledQuerySchema, providers?: ValueProviders): ReactNode[];
14
+ //# sourceMappingURL=query-highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-highlight.d.ts","sourceRoot":"","sources":["../../src/components/query-highlight.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,SAAS,EAId,KAAK,cAAc,EAIpB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAuIvC;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,EAAE,mBAAmB,EAC3B,SAAS,GAAE,cAAmB,GAC7B,SAAS,EAAE,CAYb"}
@@ -0,0 +1,132 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { providerOf, shellWords, valueVerdict, worstVerdict, } from "@orz/query";
3
+ /**
4
+ * Every span carries colour and nothing else — no `padding`, no `margin`, no
5
+ * `border`. This markup is painted behind a transparent input and has to
6
+ * measure identically to the input's own text; anything that adds width slides
7
+ * the caret off the character it is standing on. It is also why a qualifier
8
+ * cannot be a rounded chip here, and why GitHub's own measures at `padding: 0`.
9
+ */
10
+ const KEY_CLASS = "text-primary";
11
+ const PUNCT_CLASS = "text-muted-foreground";
12
+ const VALUE_CLASS = {
13
+ valid: "text-foreground bg-primary/12 rounded-[3px]",
14
+ special: "text-foreground bg-violet-500/15 rounded-[3px]",
15
+ invalid: "text-amber-700 dark:text-amber-400 underline decoration-wavy",
16
+ unknown: "text-foreground bg-primary/12 rounded-[3px]",
17
+ };
18
+ /**
19
+ * One verdict for the whole value: a brace group paints as its worst
20
+ * expansion, so one bad alternative is not hidden by its good neighbours.
21
+ * Empty alternatives (`{,a}`) are skipped, as the server never sees them.
22
+ */
23
+ function verdictOf(schema, key, value, providers) {
24
+ if (value.error !== undefined)
25
+ return "invalid";
26
+ const spec = schema.qualifiers[key]?.value;
27
+ if (spec === undefined)
28
+ return "valid";
29
+ const provider = providerOf(spec, providers);
30
+ const verdicts = value.expanded
31
+ .filter((v) => v !== "")
32
+ .map((v) => valueVerdict(spec, v, provider));
33
+ return worstVerdict(verdicts) ?? "valid";
34
+ }
35
+ /** Offsets of the quotes and backslashes a shell word spends on quoting. */
36
+ function quotingOffsets(word, raw) {
37
+ const at = new Set();
38
+ const char = (i) => raw[i - word.start];
39
+ for (const segment of word.segments) {
40
+ if (segment.quoted === "escape") {
41
+ at.add(segment.start);
42
+ }
43
+ else if (segment.quoted === "single") {
44
+ at.add(segment.start);
45
+ if (segment.end - segment.start > 1 && char(segment.end - 1) === "'") {
46
+ at.add(segment.end - 1);
47
+ }
48
+ }
49
+ else if (segment.quoted === "double") {
50
+ at.add(segment.start);
51
+ for (let i = segment.start + 1; i < segment.end; i += 1) {
52
+ const c = char(i);
53
+ if (c === "\\" && (char(i + 1) === '"' || char(i + 1) === "\\")) {
54
+ at.add(i);
55
+ i += 1;
56
+ }
57
+ else if (c === '"') {
58
+ at.add(i);
59
+ }
60
+ }
61
+ }
62
+ }
63
+ return at;
64
+ }
65
+ /**
66
+ * A shell-mode value's own characters, with its quoting muted like the rest
67
+ * of the punctuation. These sit inside the value's span, so the background
68
+ * and underline still run under the whole value.
69
+ */
70
+ function shellValueChildren(raw, value) {
71
+ const word = shellWords(value.raw, value.start)[0];
72
+ if (word === undefined)
73
+ return value.raw;
74
+ const punct = quotingOffsets(word, value.raw);
75
+ if (punct.size === 0)
76
+ return value.raw;
77
+ const out = [];
78
+ let at = value.start;
79
+ while (at < value.end) {
80
+ const muted = punct.has(at);
81
+ let end = at + 1;
82
+ while (end < value.end && punct.has(end) === muted)
83
+ end += 1;
84
+ out.push(_jsx("span", { className: muted ? PUNCT_CLASS : undefined, children: raw.slice(at, end) }, at));
85
+ at = end;
86
+ }
87
+ return out;
88
+ }
89
+ function valueSpans(part, raw, schema, providers) {
90
+ const out = [];
91
+ // The head is `-?key:`; the tail after the last value is whatever commas
92
+ // and half-typed characters follow it. Walking offsets rather than
93
+ // re-joining is what keeps this a faithful copy of the input's own text.
94
+ let at = part.start;
95
+ const push = (end, className, key, children) => {
96
+ if (end <= at)
97
+ return;
98
+ out.push(_jsx("span", { className: className, children: children ?? raw.slice(at, end) }, key ?? `t${at}`));
99
+ at = end;
100
+ };
101
+ push(part.keyStart, PUNCT_CLASS, `neg${part.start}`);
102
+ push(part.keyEnd, KEY_CLASS, `key${part.start}`);
103
+ for (const value of part.values) {
104
+ push(value.start, PUNCT_CLASS, `sep${value.start}`);
105
+ push(value.end, VALUE_CLASS[verdictOf(schema, part.key, value, providers)], `val${value.start}`, schema.escapes === "shell" ? shellValueChildren(raw, value) : undefined);
106
+ }
107
+ push(part.end, PUNCT_CLASS, `tail${part.start}`);
108
+ return out;
109
+ }
110
+ /**
111
+ * The parsed query as spans, for the mirror layer behind the input. A pure
112
+ * function of the parts, so it is the same string the input holds — never a
113
+ * re-tokenization that could disagree with it.
114
+ *
115
+ * Values are coloured by their verdict against `providers`. A provider that
116
+ * has not loaded yet leaves its values `unknown`, which paints as valid:
117
+ * flashing every value amber and back as the list arrives is worse than
118
+ * being briefly quiet.
119
+ */
120
+ export function highlightQuery(text, parts, schema, providers = {}) {
121
+ const out = [];
122
+ for (const part of parts) {
123
+ if (part.kind === "filter") {
124
+ out.push(...valueSpans(part, text, schema, providers));
125
+ }
126
+ else {
127
+ out.push(_jsx("span", { children: text.slice(part.start, part.end) }, `p${part.start}`));
128
+ }
129
+ }
130
+ return out;
131
+ }
132
+ //# sourceMappingURL=query-highlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-highlight.js","sourceRoot":"","sources":["../../src/components/query-highlight.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,UAAU,EAGV,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAC5C,MAAM,WAAW,GAAiC;IAChD,KAAK,EAAE,6CAA6C;IACpD,OAAO,EAAE,gDAAgD;IACzD,OAAO,EAAE,8DAA8D;IACvE,OAAO,EAAE,6CAA6C;CACvD,CAAC;AAIF;;;;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AC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAnD,IAAI,IAAI,CAAC,KAAK,EAAE,CAA2C,CACvE,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { Select as SelectPrimitive } from "radix-ui";
2
+ import type * as React from "react";
3
+ declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
4
+ declare function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
5
+ declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
6
+ declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
+ size?: "sm" | "default";
8
+ }): React.JSX.Element;
9
+ declare function SelectContent({ className, children, position, align, container, ...props }: React.ComponentProps<typeof SelectPrimitive.Content> & {
10
+ /** Where the list is portalled. Default `document.body`; an element in fullscreen needs its own. */
11
+ container?: React.ComponentProps<typeof SelectPrimitive.Portal>["container"];
12
+ }): React.JSX.Element;
13
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
14
+ declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
15
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
16
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
17
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
18
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
19
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 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Q,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAkBnD;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,qBAQxD;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,qBAa7D;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,qBAa/D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
4
+ import { Select as SelectPrimitive } from "radix-ui";
5
+ import { cn } from "../lib/utils.js";
6
+ function Select({ ...props }) {
7
+ return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
8
+ }
9
+ function SelectGroup({ className, ...props }) {
10
+ return (_jsx(SelectPrimitive.Group, { "data-slot": "select-group", className: cn("scroll-my-1 p-1", className), ...props }));
11
+ }
12
+ function SelectValue({ ...props }) {
13
+ return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
14
+ }
15
+ function SelectTrigger({ className, size = "default", children, ...props }) {
16
+ return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })] }));
17
+ }
18
+ function SelectContent({ className, children, position = "item-aligned", align = "center", container, ...props }) {
19
+ return (_jsx(SelectPrimitive.Portal, { container: container, children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", "data-align-trigger": position === "item-aligned", className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", position === "popper" &&
20
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, align: align, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { "data-position": position, className: cn("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)", position === "popper" && ""), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
21
+ }
22
+ function SelectLabel({ className, ...props }) {
23
+ return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("px-1.5 py-1 text-xs text-muted-foreground", className), ...props }));
24
+ }
25
+ function SelectItem({ className, children, ...props }) {
26
+ return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "pointer-events-none" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
27
+ }
28
+ function SelectSeparator({ className, ...props }) {
29
+ return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className), ...props }));
30
+ }
31
+ function SelectScrollUpButton({ className, ...props }) {
32
+ return (_jsx(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: _jsx(ChevronUpIcon, {}) }));
33
+ }
34
+ function SelectScrollDownButton({ className, ...props }) {
35
+ return (_jsx(SelectPrimitive.ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: _jsx(ChevronDownIcon, {}) }));
36
+ }
37
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
38
+ //# sourceMappingURL=select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,SAAS,MAAM,CAAC,EACd,GAAG,KAAK,EAC0C;IAClD,OAAO,KAAC,eAAe,CAAC,IAAI,iBAAW,QAAQ,KAAK,KAAK,GAAI,CAAC;AAChE,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EAC2C;IACnD,OAAO,CACL,KAAC,eAAe,CAAC,KAAK,iBACV,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,KACvC,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EAC2C;IACnD,OAAO,KAAC,eAAe,CAAC,KAAK,iBAAW,cAAc,KAAK,KAAK,GAAI,CAAC;AACvE,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,IAAI,GAAG,SAAS,EAChB,QAAQ,EACR,GAAG,KAAK,EAGT;IACC,OAAO,CACL,MAAC,eAAe,CAAC,OAAO,iBACZ,gBAAgB,eACf,IAAI,EACf,SAAS,EAAE,EAAE,CACX,q2BAAq2B,EACr2B,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,KAAC,eAAe,CAAC,IAAI,IAAC,OAAO,kBAC3B,KAAC,eAAe,IAAC,SAAS,EAAC,kDAAkD,GAAG,GAC3D,IACC,CAC3B,CAAC;AACJ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AAQ,GAA4B,IAC1C,CACxB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EAC+C;IACvD,OAAO,CACL,KAAC,eAAe,CAAC,SAAS,iBACd,kBAAkB,EAC5B,SAAS,EAAE,EAAE,CAAC,+CAA+C,EAAE,SAAS,CAAC,KACrE,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACoD;IAC5D,OAAO,CACL,KAAC,eAAe,CAAC,cAAc,iBACnB,yBAAyB,EACnC,SAAS,EAAE,EAAE,CACX,2GAA2G,EAC3G,SAAS,CACV,KACG,KAAK,YAET,KAAC,aAAa,KAAG,GACc,CAClC,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACsD;IAC9D,OAAO,CACL,KAAC,eAAe,CAAC,gBAAgB,iBACrB,2BAA2B,EACrC,SAAS,EAAE,EAAE,CACX,2GAA2G,EAC3G,SAAS,CACV,KACG,KAAK,YAET,KAAC,eAAe,KAAG,GACc,CACpC,CAAC;AACJ,CAAC;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Separator as SeparatorPrimitive } from "radix-ui";
2
+ import type * as React from "react";
3
+ declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
4
+ export { Separator };
5
+ //# sourceMappingURL=separator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../src/components/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAA0B,EAC1B,UAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,qBAatD;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Separator as SeparatorPrimitive } from "radix-ui";
4
+ import { cn } from "../lib/utils.js";
5
+ function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
6
+ return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className), ...props }));
7
+ }
8
+ export { Separator };
9
+ //# sourceMappingURL=separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separator.js","sourceRoot":"","sources":["../../src/components/separator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG3D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,SAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,UAAU,GAAG,IAAI,EACjB,GAAG,KAAK,EAC6C;IACrD,OAAO,CACL,KAAC,kBAAkB,CAAC,IAAI,iBACZ,WAAW,EACrB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CACX,8GAA8G,EAC9G,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}