@vielzeug/refine 26.10.5 → 26.10.7

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 (44) hide show
  1. package/dist/core/aria-reflection.cjs +1 -1
  2. package/dist/core/aria-reflection.cjs.map +1 -1
  3. package/dist/core/aria-reflection.d.ts +8 -8
  4. package/dist/core/aria-reflection.d.ts.map +1 -1
  5. package/dist/core/aria-reflection.js +1 -1
  6. package/dist/core/aria-reflection.js.map +1 -1
  7. package/dist/custom-elements.json +293 -0
  8. package/dist/frameworks/elements.d.ts +1 -1
  9. package/dist/inputs/index.d.ts +2 -0
  10. package/dist/inputs/index.d.ts.map +1 -1
  11. package/dist/inputs/query-bar/query-bar-grammar.cjs +2 -0
  12. package/dist/inputs/query-bar/query-bar-grammar.cjs.map +1 -0
  13. package/dist/inputs/query-bar/query-bar-grammar.d.ts +85 -0
  14. package/dist/inputs/query-bar/query-bar-grammar.d.ts.map +1 -0
  15. package/dist/inputs/query-bar/query-bar-grammar.js +2 -0
  16. package/dist/inputs/query-bar/query-bar-grammar.js.map +1 -0
  17. package/dist/inputs/query-bar/query-bar.css.cjs +2 -0
  18. package/dist/inputs/query-bar/query-bar.css.cjs.map +1 -0
  19. package/dist/inputs/query-bar/query-bar.css.js +2 -0
  20. package/dist/inputs/query-bar/query-bar.css.js.map +1 -0
  21. package/dist/inputs/query-bar/query-bar.d.ts +68 -0
  22. package/dist/inputs/query-bar/query-bar.d.ts.map +1 -0
  23. package/dist/inputs/query-bar/query-bar.types.d.ts +42 -0
  24. package/dist/inputs/query-bar/query-bar.types.d.ts.map +1 -0
  25. package/dist/navbar.cjs +2 -2
  26. package/dist/navbar.cjs.map +1 -1
  27. package/dist/navbar.js +2 -2
  28. package/dist/navbar.js.map +1 -1
  29. package/dist/query-bar.cjs +77 -0
  30. package/dist/query-bar.cjs.map +1 -0
  31. package/dist/query-bar.js +77 -0
  32. package/dist/query-bar.js.map +1 -0
  33. package/dist/refine.cjs +104 -29
  34. package/dist/refine.cjs.map +1 -1
  35. package/dist/refine.iife.js +104 -29
  36. package/dist/refine.iife.js.map +1 -1
  37. package/dist/refine.js +104 -29
  38. package/dist/refine.js.map +1 -1
  39. package/dist/tabs.cjs +1 -1
  40. package/dist/tabs.cjs.map +1 -1
  41. package/dist/tabs.js +1 -1
  42. package/dist/tabs.js.map +1 -1
  43. package/dist/types/elements.d.ts +2 -0
  44. package/package.json +25 -18
@@ -1,2 +1,2 @@
1
- var e={ariaControlsElements:`aria-controls`,ariaDescribedByElements:`aria-describedby`,ariaLabelledByElements:`aria-labelledby`};function setAriaReflection(t,n,r){if(n in t){t[n]=r.length>0?r:null;return}let i=e[n],a=r.map(e=>e.id).filter(Boolean);a.length===0?t.removeAttribute(i):t.setAttribute(i,a.join(` `))}exports.setAriaReflection=setAriaReflection;
1
+ var e={ariaActiveDescendantElement:`aria-activedescendant`,ariaControlsElements:`aria-controls`,ariaDescribedByElements:`aria-describedby`,ariaLabelledByElements:`aria-labelledby`};function setAriaReflection(t,n,r){if(n in t){if(n===`ariaActiveDescendantElement`){let e=t,n=r[0]??null;if(e.ariaActiveDescendantElement=n,e.ariaActiveDescendantElement===n)return}else{let e=t;e[n]=r.length>0?r:null;let i=e[n];if(r.length===0?!i||i.length===0:i?.length===r.length&&r.every((e,t)=>i[t]===e))return}}let i=e[n],a=r.map(e=>e.id).filter(Boolean);a.length===0?t.removeAttribute(i):t.setAttribute(i,a.join(` `))}exports.setAriaReflection=setAriaReflection;
2
2
  //# sourceMappingURL=aria-reflection.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"aria-reflection.cjs","names":[],"sources":["../../src/core/aria-reflection.ts"],"sourcesContent":["/**\n * Cross-shadow-root ARIA relationship helper.\n *\n * Plain IDREF attributes (`aria-controls`, `aria-describedby`, `aria-labelledby`, …) cannot\n * resolve across shadow-tree boundaries: the browser only looks up an `id` within the same\n * root as the referencing element, so `<div id=\"x\">` inside one component's shadow root is\n * invisible to `aria-controls=\"x\"` set inside another component's shadow root, even when both\n * custom elements are siblings in the light DOM. This is a platform limitation, not a bug :\n * see the WICG \"reference target\" explainer for the full rationale.\n *\n * Modern browsers instead expose element-reflection IDL properties\n * (`ariaControlsElements`, `ariaDescribedByElements`, `ariaLabelledByElements`, …) that accept\n * live `Element` references directly, sidestepping ID lookup entirely: these work across\n * shadow roots by design. Where unsupported, this falls back to the plain IDREF attribute,\n * which is still correct for same-root pairings and degrades gracefully (no relationship)\n * for cross-root ones instead of throwing.\n */\n\nexport type AriaReflectionProperty = 'ariaControlsElements' | 'ariaDescribedByElements' | 'ariaLabelledByElements';\n\nconst ATTR_BY_PROPERTY: Record<AriaReflectionProperty, string> = {\n ariaControlsElements: 'aria-controls',\n ariaDescribedByElements: 'aria-describedby',\n ariaLabelledByElements: 'aria-labelledby',\n};\n\n/**\n * Associates `el` with `targets` via the given ARIA relationship. Prefers the\n * cross-shadow-root-safe element-reflection property; falls back to a plain IDREF attribute\n * built from `targets`' own `id`s when the browser doesn't support element reflection yet.\n *\n * Pass an empty array to clear the relationship.\n */\nexport function setAriaReflection(el: Element, property: AriaReflectionProperty, targets: readonly Element[]): void {\n if (property in el) {\n (el as unknown as Record<AriaReflectionProperty, readonly Element[] | null>)[property] =\n targets.length > 0 ? targets : null;\n\n return;\n }\n\n const attr = ATTR_BY_PROPERTY[property];\n const ids = targets.map((target) => target.id).filter(Boolean);\n\n if (ids.length === 0) el.removeAttribute(attr);\n else el.setAttribute(attr, ids.join(' '));\n}\n"],"mappings":"AAoBA,IAAM,EAA2D,CAC/D,qBAAsB,gBACtB,wBAAyB,mBACzB,uBAAwB,iBAC1B,EASA,SAAgB,kBAAkB,EAAa,EAAkC,EAAmC,CAClH,GAAI,KAAY,EAAI,CAClB,EAA6E,GAC3E,EAAQ,OAAS,EAAI,EAAU,KAEjC,MACF,CAEA,IAAM,EAAO,EAAiB,GACxB,EAAM,EAAQ,IAAK,GAAW,EAAO,EAAE,CAAC,CAAC,OAAO,OAAO,EAEzD,EAAI,SAAW,EAAG,EAAG,gBAAgB,CAAI,EACxC,EAAG,aAAa,EAAM,EAAI,KAAK,GAAG,CAAC,CAC1C"}
1
+ {"version":3,"file":"aria-reflection.cjs","names":[],"sources":["../../src/core/aria-reflection.ts"],"sourcesContent":["/**\n * Cross-shadow-root ARIA relationship helper.\n *\n * Plain IDREF attributes (`aria-controls`, `aria-activedescendant`, `aria-describedby`,\n * `aria-labelledby`, …) cannot resolve across shadow-tree boundaries: the browser only looks\n * up an `id` within the same root as the referencing element, so a target inside one\n * component's shadow root is invisible to an attribute set inside another component's root.\n * This is a platform limitation, not a bug; see the WICG \"reference target\" explainer.\n *\n * Modern browsers instead expose element-reflection IDL properties\n * (`ariaControlsElements`, `ariaActiveDescendantElement`, `ariaDescribedByElements`,\n * `ariaLabelledByElements`, …) that accept\n * live `Element` references directly, sidestepping ID lookup entirely: these work across\n * shadow roots by design. Where unsupported, this falls back to the plain IDREF attribute,\n * which is still correct for same-root pairings and degrades gracefully (no relationship)\n * for cross-root ones instead of throwing.\n */\n\nexport type AriaReflectionProperty =\n | 'ariaActiveDescendantElement'\n | 'ariaControlsElements'\n | 'ariaDescribedByElements'\n | 'ariaLabelledByElements';\n\nconst ATTR_BY_PROPERTY: Record<AriaReflectionProperty, string> = {\n ariaActiveDescendantElement: 'aria-activedescendant',\n ariaControlsElements: 'aria-controls',\n ariaDescribedByElements: 'aria-describedby',\n ariaLabelledByElements: 'aria-labelledby',\n};\n\n/**\n * Associates `el` with `targets` via the given ARIA relationship. Prefers the\n * cross-shadow-root-safe element-reflection property; falls back to a plain IDREF attribute\n * built from `targets`' own `id`s when the browser doesn't support element reflection yet.\n *\n * Pass an empty array to clear the relationship.\n */\nexport function setAriaReflection(el: Element, property: AriaReflectionProperty, targets: readonly Element[]): void {\n if (property in el) {\n if (property === 'ariaActiveDescendantElement') {\n const reflection = el as unknown as { ariaActiveDescendantElement: Element | null };\n const target = targets[0] ?? null;\n reflection.ariaActiveDescendantElement = target;\n if (reflection.ariaActiveDescendantElement === target) return;\n } else {\n const reflection = el as unknown as Record<\n Exclude<AriaReflectionProperty, 'ariaActiveDescendantElement'>,\n readonly Element[] | null\n >;\n const targetList = targets.length > 0 ? targets : null;\n reflection[property] = targetList;\n\n const current = reflection[property];\n if (\n targets.length === 0\n ? !current || current.length === 0\n : current?.length === targets.length && targets.every((target, index) => current[index] === target)\n ) {\n return;\n }\n }\n }\n\n const attr = ATTR_BY_PROPERTY[property];\n const ids = targets.map((target) => target.id).filter(Boolean);\n\n if (ids.length === 0) el.removeAttribute(attr);\n else el.setAttribute(attr, ids.join(' '));\n}\n"],"mappings":"AAwBA,IAAM,EAA2D,CAC/D,4BAA6B,wBAC7B,qBAAsB,gBACtB,wBAAyB,mBACzB,uBAAwB,iBAC1B,EASA,SAAgB,kBAAkB,EAAa,EAAkC,EAAmC,CAClH,GAAI,KAAY,EAAI,CAClB,GAAI,IAAa,8BAA+B,CAC9C,IAAM,EAAa,EACb,EAAS,EAAQ,IAAM,KAE7B,GADA,EAAW,4BAA8B,EACrC,EAAW,8BAAgC,EAAQ,MACzD,KAAO,CACL,IAAM,EAAa,EAKnB,EAAW,GADQ,EAAQ,OAAS,EAAI,EAAU,KAGlD,IAAM,EAAU,EAAW,GAC3B,GACE,EAAQ,SAAW,EACf,CAAC,GAAW,EAAQ,SAAW,EAC/B,GAAS,SAAW,EAAQ,QAAU,EAAQ,OAAO,EAAQ,IAAU,EAAQ,KAAW,CAAM,EAEpG,MAEJ,CACF,CAEA,IAAM,EAAO,EAAiB,GACxB,EAAM,EAAQ,IAAK,GAAW,EAAO,EAAE,CAAC,CAAC,OAAO,OAAO,EAEzD,EAAI,SAAW,EAAG,EAAG,gBAAgB,CAAI,EACxC,EAAG,aAAa,EAAM,EAAI,KAAK,GAAG,CAAC,CAC1C"}
@@ -1,21 +1,21 @@
1
1
  /**
2
2
  * Cross-shadow-root ARIA relationship helper.
3
3
  *
4
- * Plain IDREF attributes (`aria-controls`, `aria-describedby`, `aria-labelledby`, …) cannot
5
- * resolve across shadow-tree boundaries: the browser only looks up an `id` within the same
6
- * root as the referencing element, so `<div id="x">` inside one component's shadow root is
7
- * invisible to `aria-controls="x"` set inside another component's shadow root, even when both
8
- * custom elements are siblings in the light DOM. This is a platform limitation, not a bug :
9
- * see the WICG "reference target" explainer for the full rationale.
4
+ * Plain IDREF attributes (`aria-controls`, `aria-activedescendant`, `aria-describedby`,
5
+ * `aria-labelledby`, …) cannot resolve across shadow-tree boundaries: the browser only looks
6
+ * up an `id` within the same root as the referencing element, so a target inside one
7
+ * component's shadow root is invisible to an attribute set inside another component's root.
8
+ * This is a platform limitation, not a bug; see the WICG "reference target" explainer.
10
9
  *
11
10
  * Modern browsers instead expose element-reflection IDL properties
12
- * (`ariaControlsElements`, `ariaDescribedByElements`, `ariaLabelledByElements`, …) that accept
11
+ * (`ariaControlsElements`, `ariaActiveDescendantElement`, `ariaDescribedByElements`,
12
+ * `ariaLabelledByElements`, …) that accept
13
13
  * live `Element` references directly, sidestepping ID lookup entirely: these work across
14
14
  * shadow roots by design. Where unsupported, this falls back to the plain IDREF attribute,
15
15
  * which is still correct for same-root pairings and degrades gracefully (no relationship)
16
16
  * for cross-root ones instead of throwing.
17
17
  */
18
- export type AriaReflectionProperty = 'ariaControlsElements' | 'ariaDescribedByElements' | 'ariaLabelledByElements';
18
+ export type AriaReflectionProperty = 'ariaActiveDescendantElement' | 'ariaControlsElements' | 'ariaDescribedByElements' | 'ariaLabelledByElements';
19
19
  /**
20
20
  * Associates `el` with `targets` via the given ARIA relationship. Prefers the
21
21
  * cross-shadow-root-safe element-reflection property; falls back to a plain IDREF attribute
@@ -1 +1 @@
1
- {"version":3,"file":"aria-reflection.d.ts","sourceRoot":"","sources":["../../src/core/aria-reflection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,sBAAsB,GAAG,sBAAsB,GAAG,yBAAyB,GAAG,wBAAwB,CAAC;AAQnH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAalH"}
1
+ {"version":3,"file":"aria-reflection.d.ts","sourceRoot":"","sources":["../../src/core/aria-reflection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,sBAAsB,GAC9B,6BAA6B,GAC7B,sBAAsB,GACtB,yBAAyB,GACzB,wBAAwB,CAAC;AAS7B;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CA+BlH"}
@@ -1,2 +1,2 @@
1
- var e={ariaControlsElements:`aria-controls`,ariaDescribedByElements:`aria-describedby`,ariaLabelledByElements:`aria-labelledby`};function setAriaReflection(t,n,r){if(n in t){t[n]=r.length>0?r:null;return}let i=e[n],a=r.map(e=>e.id).filter(Boolean);a.length===0?t.removeAttribute(i):t.setAttribute(i,a.join(` `))}export{setAriaReflection};
1
+ var e={ariaActiveDescendantElement:`aria-activedescendant`,ariaControlsElements:`aria-controls`,ariaDescribedByElements:`aria-describedby`,ariaLabelledByElements:`aria-labelledby`};function setAriaReflection(t,n,r){if(n in t){if(n===`ariaActiveDescendantElement`){let e=t,n=r[0]??null;if(e.ariaActiveDescendantElement=n,e.ariaActiveDescendantElement===n)return}else{let e=t;e[n]=r.length>0?r:null;let i=e[n];if(r.length===0?!i||i.length===0:i?.length===r.length&&r.every((e,t)=>i[t]===e))return}}let i=e[n],a=r.map(e=>e.id).filter(Boolean);a.length===0?t.removeAttribute(i):t.setAttribute(i,a.join(` `))}export{setAriaReflection};
2
2
  //# sourceMappingURL=aria-reflection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aria-reflection.js","names":[],"sources":["../../src/core/aria-reflection.ts"],"sourcesContent":["/**\n * Cross-shadow-root ARIA relationship helper.\n *\n * Plain IDREF attributes (`aria-controls`, `aria-describedby`, `aria-labelledby`, …) cannot\n * resolve across shadow-tree boundaries: the browser only looks up an `id` within the same\n * root as the referencing element, so `<div id=\"x\">` inside one component's shadow root is\n * invisible to `aria-controls=\"x\"` set inside another component's shadow root, even when both\n * custom elements are siblings in the light DOM. This is a platform limitation, not a bug :\n * see the WICG \"reference target\" explainer for the full rationale.\n *\n * Modern browsers instead expose element-reflection IDL properties\n * (`ariaControlsElements`, `ariaDescribedByElements`, `ariaLabelledByElements`, …) that accept\n * live `Element` references directly, sidestepping ID lookup entirely: these work across\n * shadow roots by design. Where unsupported, this falls back to the plain IDREF attribute,\n * which is still correct for same-root pairings and degrades gracefully (no relationship)\n * for cross-root ones instead of throwing.\n */\n\nexport type AriaReflectionProperty = 'ariaControlsElements' | 'ariaDescribedByElements' | 'ariaLabelledByElements';\n\nconst ATTR_BY_PROPERTY: Record<AriaReflectionProperty, string> = {\n ariaControlsElements: 'aria-controls',\n ariaDescribedByElements: 'aria-describedby',\n ariaLabelledByElements: 'aria-labelledby',\n};\n\n/**\n * Associates `el` with `targets` via the given ARIA relationship. Prefers the\n * cross-shadow-root-safe element-reflection property; falls back to a plain IDREF attribute\n * built from `targets`' own `id`s when the browser doesn't support element reflection yet.\n *\n * Pass an empty array to clear the relationship.\n */\nexport function setAriaReflection(el: Element, property: AriaReflectionProperty, targets: readonly Element[]): void {\n if (property in el) {\n (el as unknown as Record<AriaReflectionProperty, readonly Element[] | null>)[property] =\n targets.length > 0 ? targets : null;\n\n return;\n }\n\n const attr = ATTR_BY_PROPERTY[property];\n const ids = targets.map((target) => target.id).filter(Boolean);\n\n if (ids.length === 0) el.removeAttribute(attr);\n else el.setAttribute(attr, ids.join(' '));\n}\n"],"mappings":"AAoBA,IAAM,EAA2D,CAC/D,qBAAsB,gBACtB,wBAAyB,mBACzB,uBAAwB,iBAC1B,EASA,SAAgB,kBAAkB,EAAa,EAAkC,EAAmC,CAClH,GAAI,KAAY,EAAI,CAClB,EAA6E,GAC3E,EAAQ,OAAS,EAAI,EAAU,KAEjC,MACF,CAEA,IAAM,EAAO,EAAiB,GACxB,EAAM,EAAQ,IAAK,GAAW,EAAO,EAAE,CAAC,CAAC,OAAO,OAAO,EAEzD,EAAI,SAAW,EAAG,EAAG,gBAAgB,CAAI,EACxC,EAAG,aAAa,EAAM,EAAI,KAAK,GAAG,CAAC,CAC1C"}
1
+ {"version":3,"file":"aria-reflection.js","names":[],"sources":["../../src/core/aria-reflection.ts"],"sourcesContent":["/**\n * Cross-shadow-root ARIA relationship helper.\n *\n * Plain IDREF attributes (`aria-controls`, `aria-activedescendant`, `aria-describedby`,\n * `aria-labelledby`, …) cannot resolve across shadow-tree boundaries: the browser only looks\n * up an `id` within the same root as the referencing element, so a target inside one\n * component's shadow root is invisible to an attribute set inside another component's root.\n * This is a platform limitation, not a bug; see the WICG \"reference target\" explainer.\n *\n * Modern browsers instead expose element-reflection IDL properties\n * (`ariaControlsElements`, `ariaActiveDescendantElement`, `ariaDescribedByElements`,\n * `ariaLabelledByElements`, …) that accept\n * live `Element` references directly, sidestepping ID lookup entirely: these work across\n * shadow roots by design. Where unsupported, this falls back to the plain IDREF attribute,\n * which is still correct for same-root pairings and degrades gracefully (no relationship)\n * for cross-root ones instead of throwing.\n */\n\nexport type AriaReflectionProperty =\n | 'ariaActiveDescendantElement'\n | 'ariaControlsElements'\n | 'ariaDescribedByElements'\n | 'ariaLabelledByElements';\n\nconst ATTR_BY_PROPERTY: Record<AriaReflectionProperty, string> = {\n ariaActiveDescendantElement: 'aria-activedescendant',\n ariaControlsElements: 'aria-controls',\n ariaDescribedByElements: 'aria-describedby',\n ariaLabelledByElements: 'aria-labelledby',\n};\n\n/**\n * Associates `el` with `targets` via the given ARIA relationship. Prefers the\n * cross-shadow-root-safe element-reflection property; falls back to a plain IDREF attribute\n * built from `targets`' own `id`s when the browser doesn't support element reflection yet.\n *\n * Pass an empty array to clear the relationship.\n */\nexport function setAriaReflection(el: Element, property: AriaReflectionProperty, targets: readonly Element[]): void {\n if (property in el) {\n if (property === 'ariaActiveDescendantElement') {\n const reflection = el as unknown as { ariaActiveDescendantElement: Element | null };\n const target = targets[0] ?? null;\n reflection.ariaActiveDescendantElement = target;\n if (reflection.ariaActiveDescendantElement === target) return;\n } else {\n const reflection = el as unknown as Record<\n Exclude<AriaReflectionProperty, 'ariaActiveDescendantElement'>,\n readonly Element[] | null\n >;\n const targetList = targets.length > 0 ? targets : null;\n reflection[property] = targetList;\n\n const current = reflection[property];\n if (\n targets.length === 0\n ? !current || current.length === 0\n : current?.length === targets.length && targets.every((target, index) => current[index] === target)\n ) {\n return;\n }\n }\n }\n\n const attr = ATTR_BY_PROPERTY[property];\n const ids = targets.map((target) => target.id).filter(Boolean);\n\n if (ids.length === 0) el.removeAttribute(attr);\n else el.setAttribute(attr, ids.join(' '));\n}\n"],"mappings":"AAwBA,IAAM,EAA2D,CAC/D,4BAA6B,wBAC7B,qBAAsB,gBACtB,wBAAyB,mBACzB,uBAAwB,iBAC1B,EASA,SAAgB,kBAAkB,EAAa,EAAkC,EAAmC,CAClH,GAAI,KAAY,EAAI,CAClB,GAAI,IAAa,8BAA+B,CAC9C,IAAM,EAAa,EACb,EAAS,EAAQ,IAAM,KAE7B,GADA,EAAW,4BAA8B,EACrC,EAAW,8BAAgC,EAAQ,MACzD,KAAO,CACL,IAAM,EAAa,EAKnB,EAAW,GADQ,EAAQ,OAAS,EAAI,EAAU,KAGlD,IAAM,EAAU,EAAW,GAC3B,GACE,EAAQ,SAAW,EACf,CAAC,GAAW,EAAQ,SAAW,EAC/B,GAAS,SAAW,EAAQ,QAAU,EAAQ,OAAO,EAAQ,IAAU,EAAQ,KAAW,CAAM,EAEpG,MAEJ,CACF,CAEA,IAAM,EAAO,EAAiB,GACxB,EAAM,EAAQ,IAAK,GAAW,EAAO,EAAE,CAAC,CAAC,OAAO,OAAO,EAEzD,EAAI,SAAW,EAAG,EAAG,gBAAgB,CAAI,EACxC,EAAG,aAAa,EAAM,EAAI,KAAK,GAAG,CAAC,CAC1C"}
@@ -12425,6 +12425,299 @@
12425
12425
  }
12426
12426
  ]
12427
12427
  },
12428
+ {
12429
+ "kind": "javascript-module",
12430
+ "path": "src/inputs/query-bar/query-bar-grammar.ts",
12431
+ "declarations": [
12432
+ {
12433
+ "kind": "function",
12434
+ "name": "commitToken",
12435
+ "return": {
12436
+ "type": {
12437
+ "text": "QueryState"
12438
+ }
12439
+ },
12440
+ "parameters": [
12441
+ {
12442
+ "name": "state",
12443
+ "type": {
12444
+ "text": "QueryState"
12445
+ }
12446
+ },
12447
+ {
12448
+ "name": "key",
12449
+ "type": {
12450
+ "text": "string"
12451
+ }
12452
+ },
12453
+ {
12454
+ "name": "value",
12455
+ "type": {
12456
+ "text": "string"
12457
+ }
12458
+ }
12459
+ ],
12460
+ "description": "One value per key: a second token replaces the first and keeps the pill's slot."
12461
+ },
12462
+ {
12463
+ "kind": "function",
12464
+ "name": "removeToken",
12465
+ "return": {
12466
+ "type": {
12467
+ "text": "QueryState"
12468
+ }
12469
+ },
12470
+ "parameters": [
12471
+ {
12472
+ "name": "state",
12473
+ "type": {
12474
+ "text": "QueryState"
12475
+ }
12476
+ },
12477
+ {
12478
+ "name": "key",
12479
+ "type": {
12480
+ "text": "string"
12481
+ }
12482
+ }
12483
+ ]
12484
+ },
12485
+ {
12486
+ "kind": "function",
12487
+ "name": "tokenValue",
12488
+ "return": {
12489
+ "type": {
12490
+ "text": "string | undefined"
12491
+ }
12492
+ },
12493
+ "parameters": [
12494
+ {
12495
+ "name": "state",
12496
+ "type": {
12497
+ "text": "QueryState"
12498
+ }
12499
+ },
12500
+ {
12501
+ "name": "key",
12502
+ "type": {
12503
+ "text": "string"
12504
+ }
12505
+ }
12506
+ ]
12507
+ },
12508
+ {
12509
+ "kind": "function",
12510
+ "name": "hasQueryFilters",
12511
+ "return": {
12512
+ "type": {
12513
+ "text": "boolean"
12514
+ }
12515
+ },
12516
+ "parameters": [
12517
+ {
12518
+ "name": "state",
12519
+ "type": {
12520
+ "text": "QueryState"
12521
+ }
12522
+ }
12523
+ ]
12524
+ },
12525
+ {
12526
+ "kind": "function",
12527
+ "name": "parseQuery",
12528
+ "return": {
12529
+ "type": {
12530
+ "text": "ParsedQuery"
12531
+ }
12532
+ },
12533
+ "parameters": [
12534
+ {
12535
+ "name": "input",
12536
+ "type": {
12537
+ "text": "string"
12538
+ }
12539
+ },
12540
+ {
12541
+ "name": "vocabulary",
12542
+ "type": {
12543
+ "text": "readonly QueryTokenDef[]"
12544
+ }
12545
+ }
12546
+ ],
12547
+ "description": "Splits a raw field into free text, committed tokens, and the trailing draft.\nThe draft only exists while the input does not end in whitespace and the last\nfragment is an unfinished `key:…` — a finished fragment is either a token or text."
12548
+ },
12549
+ {
12550
+ "kind": "function",
12551
+ "name": "suggestQuery",
12552
+ "return": {
12553
+ "type": {
12554
+ "text": "QuerySuggestion[]"
12555
+ }
12556
+ },
12557
+ "parameters": [
12558
+ {
12559
+ "name": "input",
12560
+ "type": {
12561
+ "text": "string"
12562
+ }
12563
+ },
12564
+ {
12565
+ "name": "vocabulary",
12566
+ "type": {
12567
+ "text": "readonly QueryTokenDef[]"
12568
+ }
12569
+ }
12570
+ ],
12571
+ "description": "The dropdown's offers for the current field:\n- inside a `key:…` draft: that key's options whose value or label matches the prefix;\n- otherwise: the vocabulary's keys whose name matches the word being typed, plus\n any option across all keys that reads like that word (so typing `ali` offers\n `author:Alice` directly — the tap-first path)."
12572
+ }
12573
+ ],
12574
+ "exports": [
12575
+ {
12576
+ "kind": "js",
12577
+ "name": "commitToken",
12578
+ "declaration": {
12579
+ "name": "commitToken",
12580
+ "module": "src/inputs/query-bar/query-bar-grammar.ts"
12581
+ }
12582
+ },
12583
+ {
12584
+ "kind": "js",
12585
+ "name": "removeToken",
12586
+ "declaration": {
12587
+ "name": "removeToken",
12588
+ "module": "src/inputs/query-bar/query-bar-grammar.ts"
12589
+ }
12590
+ },
12591
+ {
12592
+ "kind": "js",
12593
+ "name": "tokenValue",
12594
+ "declaration": {
12595
+ "name": "tokenValue",
12596
+ "module": "src/inputs/query-bar/query-bar-grammar.ts"
12597
+ }
12598
+ },
12599
+ {
12600
+ "kind": "js",
12601
+ "name": "hasQueryFilters",
12602
+ "declaration": {
12603
+ "name": "hasQueryFilters",
12604
+ "module": "src/inputs/query-bar/query-bar-grammar.ts"
12605
+ }
12606
+ },
12607
+ {
12608
+ "kind": "js",
12609
+ "name": "parseQuery",
12610
+ "declaration": {
12611
+ "name": "parseQuery",
12612
+ "module": "src/inputs/query-bar/query-bar-grammar.ts"
12613
+ }
12614
+ },
12615
+ {
12616
+ "kind": "js",
12617
+ "name": "suggestQuery",
12618
+ "declaration": {
12619
+ "name": "suggestQuery",
12620
+ "module": "src/inputs/query-bar/query-bar-grammar.ts"
12621
+ }
12622
+ }
12623
+ ]
12624
+ },
12625
+ {
12626
+ "kind": "javascript-module",
12627
+ "path": "src/inputs/query-bar/query-bar.ts",
12628
+ "declarations": [
12629
+ {
12630
+ "kind": "variable",
12631
+ "name": "QUERY_BAR_TAG",
12632
+ "type": {
12633
+ "text": "'ore-query-bar'"
12634
+ },
12635
+ "default": "'ore-query-bar'",
12636
+ "description": "A search field that accepts free text and `key:value` tokens together, in the\ngrammar GitHub's pull-request search made familiar. Committed tokens render as\nremovable pills inside the field; a suggestion dropdown lists the vocabulary's\nkeys and matching values while typing, so phones never need to type a colon.\n\nThe bar is state-driven: `vocabulary` defines the token keys and their accepted\nvalues, `state` carries `{ text, tokens }`, and every edit emits `input` +\n`change` with the new state readable from the element's `state` property. Omit\n`state` for uncontrolled use. External `state` writes whose `tokens` array is\nidentical to the current one are treated as echoes — only token changes are\nadopted — so text-only round-trips never wipe the field's live draft.\n\nThe dropdown opens while the field holds focus (and reopens on typing after\nEscape) and overlays the page from the top layer. Picking a key suggestion\nstarts composing `key:`; picking a value commits its pill. Typing a complete\n`key:value` commits immediately. Backspace on an empty field removes the last\npill. A draft whose value matches nothing shows a \"searching as text\" row\ninstead of closing; on blur, a bare `key:` fragment reverts and a dead draft\ndegrades into the searched text, so the field never carries silent residue."
12637
+ }
12638
+ ],
12639
+ "exports": [
12640
+ {
12641
+ "kind": "js",
12642
+ "name": "CHIP_TAG",
12643
+ "declaration": {
12644
+ "name": "CHIP_TAG",
12645
+ "module": "../../feedback/chip/chip"
12646
+ }
12647
+ },
12648
+ {
12649
+ "kind": "js",
12650
+ "name": "INPUT_TAG",
12651
+ "declaration": {
12652
+ "name": "INPUT_TAG",
12653
+ "module": "../input/input"
12654
+ }
12655
+ },
12656
+ {
12657
+ "kind": "js",
12658
+ "name": "OreQueryBarEvents",
12659
+ "declaration": {
12660
+ "name": "OreQueryBarEvents",
12661
+ "module": "./query-bar.types"
12662
+ }
12663
+ },
12664
+ {
12665
+ "kind": "js",
12666
+ "name": "OreQueryBarProps",
12667
+ "declaration": {
12668
+ "name": "OreQueryBarProps",
12669
+ "module": "./query-bar.types"
12670
+ }
12671
+ },
12672
+ {
12673
+ "kind": "js",
12674
+ "name": "*",
12675
+ "declaration": {
12676
+ "name": "*",
12677
+ "module": "src/inputs/query-bar/query-bar-grammar"
12678
+ }
12679
+ },
12680
+ {
12681
+ "kind": "js",
12682
+ "name": "QUERY_BAR_TAG",
12683
+ "declaration": {
12684
+ "name": "QUERY_BAR_TAG",
12685
+ "module": "src/inputs/query-bar/query-bar.ts"
12686
+ }
12687
+ }
12688
+ ]
12689
+ },
12690
+ {
12691
+ "kind": "javascript-module",
12692
+ "path": "src/inputs/query-bar/query-bar.types.ts",
12693
+ "declarations": [],
12694
+ "exports": [
12695
+ {
12696
+ "kind": "js",
12697
+ "name": "QueryState",
12698
+ "declaration": {
12699
+ "name": "QueryState",
12700
+ "module": "src/inputs/query-bar/query-bar.types.ts"
12701
+ }
12702
+ },
12703
+ {
12704
+ "kind": "js",
12705
+ "name": "QueryToken",
12706
+ "declaration": {
12707
+ "name": "QueryToken",
12708
+ "module": "src/inputs/query-bar/query-bar.types.ts"
12709
+ }
12710
+ },
12711
+ {
12712
+ "kind": "js",
12713
+ "name": "QueryTokenDef",
12714
+ "declaration": {
12715
+ "name": "QueryTokenDef",
12716
+ "module": "src/inputs/query-bar/query-bar.types.ts"
12717
+ }
12718
+ }
12719
+ ]
12720
+ },
12428
12721
  {
12429
12722
  "kind": "javascript-module",
12430
12723
  "path": "src/inputs/radio/radio.ts",
@@ -1,5 +1,5 @@
1
1
  // Generated from src/types/elements.d.ts. Do not edit directly.
2
2
  import type {} from '../types/elements.js';
3
3
 
4
- export type RefineElementTag = 'ore-accordion' | 'ore-accordion-item' | 'ore-alert' | 'ore-async' | 'ore-avatar' | 'ore-avatar-group' | 'ore-badge' | 'ore-box' | 'ore-breadcrumb' | 'ore-breadcrumb-item' | 'ore-button' | 'ore-button-group' | 'ore-calendar' | 'ore-card' | 'ore-carousel' | 'ore-carousel-slide' | 'ore-chat-message' | 'ore-chat-panel' | 'ore-checkbox' | 'ore-checkbox-group' | 'ore-chip' | 'ore-code-window' | 'ore-column' | 'ore-combobox' | 'ore-combobox-option' | 'ore-command-palette' | 'ore-command-palette-item' | 'ore-cookie-banner' | 'ore-copy-command' | 'ore-counter' | 'ore-datagrid' | 'ore-date-picker' | 'ore-dialog' | 'ore-drawer' | 'ore-file-input' | 'ore-grid' | 'ore-grid-item' | 'ore-icon' | 'ore-input' | 'ore-keyboard-key' | 'ore-keyboard-shortcut' | 'ore-list' | 'ore-list-item' | 'ore-marquee' | 'ore-menu' | 'ore-menu-item' | 'ore-menu-separator' | 'ore-message-composer' | 'ore-navbar' | 'ore-navbar-item' | 'ore-navigation-menu' | 'ore-navigation-menu-item' | 'ore-navigation-menu-panel' | 'ore-number-input' | 'ore-otp-input' | 'ore-pagination' | 'ore-password-strength' | 'ore-popover' | 'ore-progress' | 'ore-qr-code' | 'ore-qr-scanner' | 'ore-radio' | 'ore-radio-group' | 'ore-rank-item' | 'ore-rank-list' | 'ore-rating' | 'ore-select' | 'ore-separator' | 'ore-sidebar' | 'ore-sidebar-group' | 'ore-sidebar-item' | 'ore-skeleton' | 'ore-slider' | 'ore-speech-player' | 'ore-stats' | 'ore-step' | 'ore-stepper' | 'ore-switch' | 'ore-tab-item' | 'ore-tab-panel' | 'ore-table' | 'ore-tabs' | 'ore-td' | 'ore-text' | 'ore-textarea' | 'ore-th' | 'ore-time-picker' | 'ore-toast' | 'ore-tooltip' | 'ore-tr' | 'ore-typing-indicator';
4
+ export type RefineElementTag = 'ore-accordion' | 'ore-accordion-item' | 'ore-alert' | 'ore-async' | 'ore-avatar' | 'ore-avatar-group' | 'ore-badge' | 'ore-box' | 'ore-breadcrumb' | 'ore-breadcrumb-item' | 'ore-button' | 'ore-button-group' | 'ore-calendar' | 'ore-card' | 'ore-carousel' | 'ore-carousel-slide' | 'ore-chat-message' | 'ore-chat-panel' | 'ore-checkbox' | 'ore-checkbox-group' | 'ore-chip' | 'ore-code-window' | 'ore-column' | 'ore-combobox' | 'ore-combobox-option' | 'ore-command-palette' | 'ore-command-palette-item' | 'ore-cookie-banner' | 'ore-copy-command' | 'ore-counter' | 'ore-datagrid' | 'ore-date-picker' | 'ore-dialog' | 'ore-drawer' | 'ore-file-input' | 'ore-grid' | 'ore-grid-item' | 'ore-icon' | 'ore-input' | 'ore-keyboard-key' | 'ore-keyboard-shortcut' | 'ore-list' | 'ore-list-item' | 'ore-marquee' | 'ore-menu' | 'ore-menu-item' | 'ore-menu-separator' | 'ore-message-composer' | 'ore-navbar' | 'ore-navbar-item' | 'ore-navigation-menu' | 'ore-navigation-menu-item' | 'ore-navigation-menu-panel' | 'ore-number-input' | 'ore-otp-input' | 'ore-pagination' | 'ore-password-strength' | 'ore-popover' | 'ore-progress' | 'ore-qr-code' | 'ore-qr-scanner' | 'ore-query-bar' | 'ore-radio' | 'ore-radio-group' | 'ore-rank-item' | 'ore-rank-list' | 'ore-rating' | 'ore-select' | 'ore-separator' | 'ore-sidebar' | 'ore-sidebar-group' | 'ore-sidebar-item' | 'ore-skeleton' | 'ore-slider' | 'ore-speech-player' | 'ore-stats' | 'ore-step' | 'ore-stepper' | 'ore-switch' | 'ore-tab-item' | 'ore-tab-panel' | 'ore-table' | 'ore-tabs' | 'ore-td' | 'ore-text' | 'ore-textarea' | 'ore-th' | 'ore-time-picker' | 'ore-toast' | 'ore-tooltip' | 'ore-tr' | 'ore-typing-indicator';
5
5
  export type RefineElementMap = Pick<HTMLElementTagNameMap, RefineElementTag>;
@@ -29,6 +29,8 @@ export type { OreOtpInputEvents, OreOtpInputProps } from './otp-input/otp-input'
29
29
  export { OTP_INPUT_TAG } from './otp-input/otp-input';
30
30
  export type { OreQrScannerEvents, OreQrScannerProps, OreQrScannerStatus, QrScannerFactory, } from './qr-scanner/qr-scanner';
31
31
  export { QR_SCANNER_TAG } from './qr-scanner/qr-scanner';
32
+ export { QUERY_BAR_TAG, type QueryDraft, type QueryOption, type QueryState, type QuerySuggestion, type QueryToken, type QueryTokenDef, } from './query-bar/query-bar';
33
+ export type { OreQueryBarEvents, OreQueryBarProps } from './query-bar/query-bar.types';
32
34
  export type { OreRadioEvents, OreRadioProps } from './radio/radio';
33
35
  export { RADIO_TAG } from './radio/radio';
34
36
  export type { OreRadioGroupEvents, OreRadioGroupProps } from './radio-group/radio-group';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inputs/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACrF,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACjF,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB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AAe,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC7E,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ var e=/^([a-z][a-z0-9-]*):(.*)$/i,lower=e=>e.toLowerCase();function keyIndex(e){return new Map(e.map(e=>[lower(e.key),e]))}function resolveOption(e,t){let n=lower(t);return e.options.find(e=>lower(e.value)===n||lower(e.label)===n)}function draftOf(t,n){let r=e.exec(t);if(!r)return null;let i=n.get(lower(r[1]));return i?{key:i.key,valuePrefix:r[2]}:null}function trailingDraft(e,t,n){if(/\s$/.test(e))return null;let r=draftOf(t[t.length-1]??``,n);if(!r)return null;let i=n.get(lower(r.key));return i&&resolveOption(i,r.valuePrefix)?null:r}function commitToken(e,t,n){let r=[...e.tokens],i=r.findIndex(e=>e.key===t);return i>=0?r[i]={key:t,value:n}:r.push({key:t,value:n}),{text:e.text,tokens:r}}function removeToken(e,t){return{text:e.text,tokens:e.tokens.filter(e=>e.key!==t)}}function tokenValue(e,t){return e.tokens.find(e=>e.key===t)?.value}var hasQueryFilters=e=>e.text.trim()!==``||e.tokens.length>0;function parseQuery(t,n){let r=t.trim();if(r===``)return{draft:null,text:``,tokens:[]};let i=keyIndex(n),a=r.split(/\s+/),o=trailingDraft(t,a,i),s=o?a.slice(0,-1):a,c=[],l=[];for(let t of s){let n=e.exec(t),r=n?i.get(lower(n[1])):void 0,a=r&&n?resolveOption(r,n[2]):void 0;if(r&&a){let e=l.findIndex(e=>e.key===r.key);e>=0?l[e]={key:r.key,value:a.value}:l.push({key:r.key,value:a.value})}else c.push(t)}return{draft:o,text:c.join(` `),tokens:l}}function suggestQuery(e,t){let n=parseQuery(e,t).draft,matches=(e,t)=>lower(t.value).startsWith(e)||lower(t.label).startsWith(e);if(n){let e=keyIndex(t).get(lower(n.key));if(!e)return[];let r=lower(n.valuePrefix);return e.options.filter(e=>matches(r,e)).map(t=>({key:e.key,kind:`value`,label:t.label,value:t.value}))}let r=lower(/\s$/.test(e)||e.trim()===``?``:e.trim().split(/\s+/).pop()??``),i=t.filter(e=>lower(e.key).startsWith(r)||lower(e.label).startsWith(r)).map(e=>({key:e.key,kind:`key`,label:e.label})),a=r===``?[]:t.flatMap(e=>e.options.filter(e=>matches(r,e)).map(t=>({key:e.key,kind:`value`,label:t.label,value:t.value})));return[...i,...a]}exports.commitToken=commitToken,exports.hasQueryFilters=hasQueryFilters,exports.parseQuery=parseQuery,exports.removeToken=removeToken,exports.suggestQuery=suggestQuery,exports.tokenValue=tokenValue;
2
+ //# sourceMappingURL=query-bar-grammar.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-bar-grammar.cjs","names":[],"sources":["../../../src/inputs/query-bar/query-bar-grammar.ts"],"sourcesContent":["/**\n * The query-bar grammar: one search language for a field that accepts free text and\n * `key:value` tokens together (GitHub's pull-request search is the reference UX).\n * A surface decides which keys exist and which values they accept by passing a\n * vocabulary; the bar turns committed tokens into removable pills and keeps free\n * text in the field.\n *\n * This module is pure: no DOM, no framework, no locale access. Consumers build a\n * vocabulary from their own lists (localized where the labels are localized), pass\n * it in, and consume the resulting state. Token keys are locale-stable (`author:`\n * stays `author:` in German) while the vocabulary's labels stay localized.\n *\n * Semantics:\n * - A complete `key:value` fragment resolves against the vocabulary (value or label,\n * case-insensitive) and commits immediately — the bar moves it out of the field\n * into a removable pill.\n * - Unknown keys and unresolved values degrade to free text, never errors.\n * - One value per key: a second token for the same key replaces the first in place.\n * - The last fragment is a draft while the caret is inside it: `author:al…` stays\n * out of the free text so partial tokens never leak into the live search, and it\n * drives the suggestion list instead.\n */\n\n/** One selectable value of a token key. */\nexport interface QueryOption {\n label: string;\n value: string;\n}\n\n/** A vocabulary entry: the token key, its display name, and its accepted values. */\nexport interface QueryTokenDef {\n key: string;\n label: string;\n options: QueryOption[];\n}\n\n/** A committed `key:value` filter. */\nexport interface QueryToken {\n key: string;\n value: string;\n}\n\n/** The bar's whole state: free text plus committed tokens. */\nexport interface QueryState {\n text: string;\n tokens: QueryToken[];\n}\n\n/** A `key:…` fragment still being composed at the end of the field. */\nexport interface QueryDraft {\n key: string;\n valuePrefix: string;\n}\n\n/** What parsing extracted from the raw field content. */\nexport interface ParsedQuery {\n draft: QueryDraft | null;\n text: string;\n tokens: QueryToken[];\n}\n\n/** A suggestion the dropdown offers: pick a key to compose, or a value to commit. */\nexport type QuerySuggestion =\n | { key: string; kind: 'key'; label: string }\n | { key: string; kind: 'value'; label: string; value: string };\n\nconst TOKEN_SYNTAX = /^([a-z][a-z0-9-]*):(.*)$/i;\n\nconst lower = (value: string): string => value.toLowerCase();\n\nfunction keyIndex(vocabulary: readonly QueryTokenDef[]): Map<string, QueryTokenDef> {\n return new Map(vocabulary.map((def) => [lower(def.key), def]));\n}\n\n/** Resolves a typed value against a key's options: exact, case-insensitive, by value or label. */\nfunction resolveOption(def: QueryTokenDef, raw: string): QueryOption | undefined {\n const needle = lower(raw);\n return def.options.find((option) => lower(option.value) === needle || lower(option.label) === needle);\n}\n\n/** The trailing `key:…` fragment if it opens a known key, `null` for plain words. */\nfunction draftOf(fragment: string, index: Map<string, QueryTokenDef>): QueryDraft | null {\n const match = TOKEN_SYNTAX.exec(fragment);\n if (!match) return null;\n const def = index.get(lower(match[1]));\n return def ? { key: def.key, valuePrefix: match[2] } : null;\n}\n\n/**\n * The trailing fragment as a draft: a known key whose value is still being composed.\n * A fragment that already resolves to a whole option is NOT a draft — typing\n * `author:alice` commits the token immediately instead of waiting for a space.\n */\nfunction trailingDraft(input: string, fragments: string[], index: Map<string, QueryTokenDef>): QueryDraft | null {\n if (/\\s$/.test(input)) return null;\n const candidate = draftOf(fragments[fragments.length - 1] ?? '', index);\n if (!candidate) return null;\n const def = index.get(lower(candidate.key));\n return def && resolveOption(def, candidate.valuePrefix) ? null : candidate;\n}\n\n/** One value per key: a second token replaces the first and keeps the pill's slot. */\nexport function commitToken(state: QueryState, key: string, value: string): QueryState {\n const tokens = [...state.tokens];\n const slot = tokens.findIndex((token) => token.key === key);\n if (slot >= 0) tokens[slot] = { key, value };\n else tokens.push({ key, value });\n return { text: state.text, tokens };\n}\n\nexport function removeToken(state: QueryState, key: string): QueryState {\n return { text: state.text, tokens: state.tokens.filter((token) => token.key !== key) };\n}\n\nexport function tokenValue(state: QueryState, key: string): string | undefined {\n return state.tokens.find((token) => token.key === key)?.value;\n}\n\nexport const hasQueryFilters = (state: QueryState): boolean => state.text.trim() !== '' || state.tokens.length > 0;\n\n/**\n * Splits a raw field into free text, committed tokens, and the trailing draft.\n * The draft only exists while the input does not end in whitespace and the last\n * fragment is an unfinished `key:…` — a finished fragment is either a token or text.\n */\nexport function parseQuery(input: string, vocabulary: readonly QueryTokenDef[]): ParsedQuery {\n const trimmed = input.trim();\n if (trimmed === '') return { draft: null, text: '', tokens: [] };\n\n const index = keyIndex(vocabulary);\n const fragments = trimmed.split(/\\s+/);\n const draft = trailingDraft(input, fragments, index);\n const complete = draft ? fragments.slice(0, -1) : fragments;\n\n const text: string[] = [];\n const tokens: QueryToken[] = [];\n for (const fragment of complete) {\n const match = TOKEN_SYNTAX.exec(fragment);\n const def = match ? index.get(lower(match[1])) : undefined;\n const option = def && match ? resolveOption(def, match[2]) : undefined;\n if (def && option) {\n const slot = tokens.findIndex((token) => token.key === def.key);\n if (slot >= 0) tokens[slot] = { key: def.key, value: option.value };\n else tokens.push({ key: def.key, value: option.value });\n } else {\n text.push(fragment);\n }\n }\n return { draft, text: text.join(' '), tokens };\n}\n\n/**\n * The dropdown's offers for the current field:\n * - inside a `key:…` draft: that key's options whose value or label matches the prefix;\n * - otherwise: the vocabulary's keys whose name matches the word being typed, plus\n * any option across all keys that reads like that word (so typing `ali` offers\n * `author:Alice` directly — the tap-first path).\n */\nexport function suggestQuery(input: string, vocabulary: readonly QueryTokenDef[]): QuerySuggestion[] {\n const draft = parseQuery(input, vocabulary).draft;\n const matches = (needle: string, option: QueryOption): boolean =>\n lower(option.value).startsWith(needle) || lower(option.label).startsWith(needle);\n\n if (draft) {\n const def = keyIndex(vocabulary).get(lower(draft.key));\n if (!def) return [];\n const needle = lower(draft.valuePrefix);\n return def.options\n .filter((option) => matches(needle, option))\n .map((option) => ({ key: def.key, kind: 'value', label: option.label, value: option.value }));\n }\n\n // The word being typed: none once the field ends in whitespace (focus fresh on a\n // finished query), so the dropdown falls back to listing the vocabulary's keys.\n const fragment = /\\s$/.test(input) || input.trim() === '' ? '' : (input.trim().split(/\\s+/).pop() ?? '');\n const needle = lower(fragment);\n const keys: QuerySuggestion[] = vocabulary\n .filter((def) => lower(def.key).startsWith(needle) || lower(def.label).startsWith(needle))\n .map((def) => ({ key: def.key, kind: 'key', label: def.label }));\n const values: QuerySuggestion[] =\n needle === ''\n ? []\n : vocabulary.flatMap((def) =>\n def.options\n .filter((option) => matches(needle, option))\n .map((option) => ({ key: def.key, kind: 'value', label: option.label, value: option.value })),\n );\n return [...keys, ...values];\n}\n"],"mappings":"AAkEA,IAAM,EAAe,4BAEf,MAAS,GAA0B,EAAM,YAAY,EAE3D,SAAS,SAAS,EAAkE,CAClF,OAAO,IAAI,IAAI,EAAW,IAAK,GAAQ,CAAC,MAAM,EAAI,GAAG,EAAG,CAAG,CAAC,CAAC,CAC/D,CAGA,SAAS,cAAc,EAAoB,EAAsC,CAC/E,IAAM,EAAS,MAAM,CAAG,EACxB,OAAO,EAAI,QAAQ,KAAM,GAAW,MAAM,EAAO,KAAK,IAAM,GAAU,MAAM,EAAO,KAAK,IAAM,CAAM,CACtG,CAGA,SAAS,QAAQ,EAAkB,EAAsD,CACvF,IAAM,EAAQ,EAAa,KAAK,CAAQ,EACxC,GAAI,CAAC,EAAO,OAAO,KACnB,IAAM,EAAM,EAAM,IAAI,MAAM,EAAM,EAAE,CAAC,EACrC,OAAO,EAAM,CAAE,IAAK,EAAI,IAAK,YAAa,EAAM,EAAG,EAAI,IACzD,CAOA,SAAS,cAAc,EAAe,EAAqB,EAAsD,CAC/G,GAAI,MAAM,KAAK,CAAK,EAAG,OAAO,KAC9B,IAAM,EAAY,QAAQ,EAAU,EAAU,OAAS,IAAM,GAAI,CAAK,EACtE,GAAI,CAAC,EAAW,OAAO,KACvB,IAAM,EAAM,EAAM,IAAI,MAAM,EAAU,GAAG,CAAC,EAC1C,OAAO,GAAO,cAAc,EAAK,EAAU,WAAW,EAAI,KAAO,CACnE,CAGA,SAAgB,YAAY,EAAmB,EAAa,EAA2B,CACrF,IAAM,EAAS,CAAC,GAAG,EAAM,MAAM,EACzB,EAAO,EAAO,UAAW,GAAU,EAAM,MAAQ,CAAG,EAG1D,OAFI,GAAQ,EAAG,EAAO,GAAQ,CAAE,MAAK,OAAM,EACtC,EAAO,KAAK,CAAE,MAAK,OAAM,CAAC,EACxB,CA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ub's pull-request search is the reference UX).
4
+ * A surface decides which keys exist and which values they accept by passing a
5
+ * vocabulary; the bar turns committed tokens into removable pills and keeps free
6
+ * text in the field.
7
+ *
8
+ * This module is pure: no DOM, no framework, no locale access. Consumers build a
9
+ * vocabulary from their own lists (localized where the labels are localized), pass
10
+ * it in, and consume the resulting state. Token keys are locale-stable (`author:`
11
+ * stays `author:` in German) while the vocabulary's labels stay localized.
12
+ *
13
+ * Semantics:
14
+ * - A complete `key:value` fragment resolves against the vocabulary (value or label,
15
+ * case-insensitive) and commits immediately — the bar moves it out of the field
16
+ * into a removable pill.
17
+ * - Unknown keys and unresolved values degrade to free text, never errors.
18
+ * - One value per key: a second token for the same key replaces the first in place.
19
+ * - The last fragment is a draft while the caret is inside it: `author:al…` stays
20
+ * out of the free text so partial tokens never leak into the live search, and it
21
+ * drives the suggestion list instead.
22
+ */
23
+ /** One selectable value of a token key. */
24
+ export interface QueryOption {
25
+ label: string;
26
+ value: string;
27
+ }
28
+ /** A vocabulary entry: the token key, its display name, and its accepted values. */
29
+ export interface QueryTokenDef {
30
+ key: string;
31
+ label: string;
32
+ options: QueryOption[];
33
+ }
34
+ /** A committed `key:value` filter. */
35
+ export interface QueryToken {
36
+ key: string;
37
+ value: string;
38
+ }
39
+ /** The bar's whole state: free text plus committed tokens. */
40
+ export interface QueryState {
41
+ text: string;
42
+ tokens: QueryToken[];
43
+ }
44
+ /** A `key:…` fragment still being composed at the end of the field. */
45
+ export interface QueryDraft {
46
+ key: string;
47
+ valuePrefix: string;
48
+ }
49
+ /** What parsing extracted from the raw field content. */
50
+ export interface ParsedQuery {
51
+ draft: QueryDraft | null;
52
+ text: string;
53
+ tokens: QueryToken[];
54
+ }
55
+ /** A suggestion the dropdown offers: pick a key to compose, or a value to commit. */
56
+ export type QuerySuggestion = {
57
+ key: string;
58
+ kind: 'key';
59
+ label: string;
60
+ } | {
61
+ key: string;
62
+ kind: 'value';
63
+ label: string;
64
+ value: string;
65
+ };
66
+ /** One value per key: a second token replaces the first and keeps the pill's slot. */
67
+ export declare function commitToken(state: QueryState, key: string, value: string): QueryState;
68
+ export declare function removeToken(state: QueryState, key: string): QueryState;
69
+ export declare function tokenValue(state: QueryState, key: string): string | undefined;
70
+ export declare const hasQueryFilters: (state: QueryState) => boolean;
71
+ /**
72
+ * Splits a raw field into free text, committed tokens, and the trailing draft.
73
+ * The draft only exists while the input does not end in whitespace and the last
74
+ * fragment is an unfinished `key:…` — a finished fragment is either a token or text.
75
+ */
76
+ export declare function parseQuery(input: string, vocabulary: readonly QueryTokenDef[]): ParsedQuery;
77
+ /**
78
+ * The dropdown's offers for the current field:
79
+ * - inside a `key:…` draft: that key's options whose value or label matches the prefix;
80
+ * - otherwise: the vocabulary's keys whose name matches the word being typed, plus
81
+ * any option across all keys that reads like that word (so typing `ali` offers
82
+ * `author:Alice` directly — the tap-first path).
83
+ */
84
+ export declare function suggestQuery(input: string, vocabulary: readonly QueryTokenDef[]): QuerySuggestion[];
85
+ //# sourceMappingURL=query-bar-grammar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-bar-grammar.d.ts","sourceRoot":"","sources":["../../../src/inputs/query-bar/query-bar-grammar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oFAAoF;AACpF,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,sCAAsC;AACtC,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,EAAE,CA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Case();function keyIndex(e){return new Map(e.map(e=>[lower(e.key),e]))}function resolveOption(e,t){let n=lower(t);return e.options.find(e=>lower(e.value)===n||lower(e.label)===n)}function draftOf(t,n){let r=e.exec(t);if(!r)return null;let i=n.get(lower(r[1]));return i?{key:i.key,valuePrefix:r[2]}:null}function trailingDraft(e,t,n){if(/\s$/.test(e))return null;let r=draftOf(t[t.length-1]??``,n);if(!r)return null;let i=n.get(lower(r.key));return i&&resolveOption(i,r.valuePrefix)?null:r}function commitToken(e,t,n){let r=[...e.tokens],i=r.findIndex(e=>e.key===t);return i>=0?r[i]={key:t,value:n}:r.push({key:t,value:n}),{text:e.text,tokens:r}}function removeToken(e,t){return{text:e.text,tokens:e.tokens.filter(e=>e.key!==t)}}function tokenValue(e,t){return e.tokens.find(e=>e.key===t)?.value}var hasQueryFilters=e=>e.text.trim()!==``||e.tokens.length>0;function parseQuery(t,n){let r=t.trim();if(r===``)return{draft:null,text:``,tokens:[]};let i=keyIndex(n),a=r.split(/\s+/),o=trailingDraft(t,a,i),s=o?a.slice(0,-1):a,c=[],l=[];for(let t of s){let n=e.exec(t),r=n?i.get(lower(n[1])):void 0,a=r&&n?resolveOption(r,n[2]):void 0;if(r&&a){let e=l.findIndex(e=>e.key===r.key);e>=0?l[e]={key:r.key,value:a.value}:l.push({key:r.key,value:a.value})}else c.push(t)}return{draft:o,text:c.join(` `),tokens:l}}function suggestQuery(e,t){let n=parseQuery(e,t).draft,matches=(e,t)=>lower(t.value).startsWith(e)||lower(t.label).startsWith(e);if(n){let e=keyIndex(t).get(lower(n.key));if(!e)return[];let r=lower(n.valuePrefix);return e.options.filter(e=>matches(r,e)).map(t=>({key:e.key,kind:`value`,label:t.label,value:t.value}))}let r=lower(/\s$/.test(e)||e.trim()===``?``:e.trim().split(/\s+/).pop()??``),i=t.filter(e=>lower(e.key).startsWith(r)||lower(e.label).startsWith(r)).map(e=>({key:e.key,kind:`key`,label:e.label})),a=r===``?[]:t.flatMap(e=>e.options.filter(e=>matches(r,e)).map(t=>({key:e.key,kind:`value`,label:t.label,value:t.value})));return[...i,...a]}export{commitToken,hasQueryFilters,parseQuery,removeToken,suggestQuery,tokenValue};
2
+ //# sourceMappingURL=query-bar-grammar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-bar-grammar.js","names":[],"sources":["../../../src/inputs/query-bar/query-bar-grammar.ts"],"sourcesContent":["/**\n * The query-bar grammar: one search language for a field that accepts free text and\n * `key:value` tokens together (GitHub's pull-request search is the reference UX).\n * A surface decides which keys exist and which values they accept by passing a\n * vocabulary; the bar turns committed tokens into removable pills and keeps free\n * text in the field.\n *\n * This module is pure: no DOM, no framework, no locale access. Consumers build a\n * vocabulary from their own lists (localized where the labels are localized), pass\n * it in, and consume the resulting state. Token keys are locale-stable (`author:`\n * stays `author:` in German) while the vocabulary's labels stay localized.\n *\n * Semantics:\n * - A complete `key:value` fragment resolves against the vocabulary (value or label,\n * case-insensitive) and commits immediately — the bar moves it out of the field\n * into a removable pill.\n * - Unknown keys and unresolved values degrade to free text, never errors.\n * - One value per key: a second token for the same key replaces the first in place.\n * - The last fragment is a draft while the caret is inside it: `author:al…` stays\n * out of the free text so partial tokens never leak into the live search, and it\n * drives the suggestion list instead.\n */\n\n/** One selectable value of a token key. */\nexport interface QueryOption {\n label: string;\n value: string;\n}\n\n/** A vocabulary entry: the token key, its display name, and its accepted values. */\nexport interface QueryTokenDef {\n key: string;\n label: string;\n options: QueryOption[];\n}\n\n/** A committed `key:value` filter. */\nexport interface QueryToken {\n key: string;\n value: string;\n}\n\n/** The bar's whole state: free text plus committed tokens. */\nexport interface QueryState {\n text: string;\n tokens: QueryToken[];\n}\n\n/** A `key:…` fragment still being composed at the end of the field. */\nexport interface QueryDraft {\n key: string;\n valuePrefix: string;\n}\n\n/** What parsing extracted from the raw field content. */\nexport interface ParsedQuery {\n draft: QueryDraft | null;\n text: string;\n tokens: QueryToken[];\n}\n\n/** A suggestion the dropdown offers: pick a key to compose, or a value to commit. */\nexport type QuerySuggestion =\n | { key: string; kind: 'key'; label: string }\n | { key: string; kind: 'value'; label: string; value: string };\n\nconst TOKEN_SYNTAX = /^([a-z][a-z0-9-]*):(.*)$/i;\n\nconst lower = (value: string): string => value.toLowerCase();\n\nfunction keyIndex(vocabulary: readonly QueryTokenDef[]): Map<string, QueryTokenDef> {\n return new Map(vocabulary.map((def) => [lower(def.key), def]));\n}\n\n/** Resolves a typed value against a key's options: exact, case-insensitive, by value or label. */\nfunction resolveOption(def: QueryTokenDef, raw: string): QueryOption | undefined {\n const needle = lower(raw);\n return def.options.find((option) => lower(option.value) === needle || lower(option.label) === needle);\n}\n\n/** The trailing `key:…` fragment if it opens a known key, `null` for plain words. */\nfunction draftOf(fragment: string, index: Map<string, QueryTokenDef>): QueryDraft | null {\n const match = TOKEN_SYNTAX.exec(fragment);\n if (!match) return null;\n const def = index.get(lower(match[1]));\n return def ? { key: def.key, valuePrefix: match[2] } : null;\n}\n\n/**\n * The trailing fragment as a draft: a known key whose value is still being composed.\n * A fragment that already resolves to a whole option is NOT a draft — typing\n * `author:alice` commits the token immediately instead of waiting for a space.\n */\nfunction trailingDraft(input: string, fragments: string[], index: Map<string, QueryTokenDef>): QueryDraft | null {\n if (/\\s$/.test(input)) return null;\n const candidate = draftOf(fragments[fragments.length - 1] ?? '', index);\n if (!candidate) return null;\n const def = index.get(lower(candidate.key));\n return def && resolveOption(def, candidate.valuePrefix) ? null : candidate;\n}\n\n/** One value per key: a second token replaces the first and keeps the pill's slot. */\nexport function commitToken(state: QueryState, key: string, value: string): QueryState {\n const tokens = [...state.tokens];\n const slot = tokens.findIndex((token) => token.key === key);\n if (slot >= 0) tokens[slot] = { key, value };\n else tokens.push({ key, value });\n return { text: state.text, tokens };\n}\n\nexport function removeToken(state: QueryState, key: string): QueryState {\n return { text: state.text, tokens: state.tokens.filter((token) => token.key !== key) };\n}\n\nexport function tokenValue(state: QueryState, key: string): string | undefined {\n return state.tokens.find((token) => token.key === key)?.value;\n}\n\nexport const hasQueryFilters = (state: QueryState): boolean => state.text.trim() !== '' || state.tokens.length > 0;\n\n/**\n * Splits a raw field into free text, committed tokens, and the trailing draft.\n * The draft only exists while the input does not end in whitespace and the last\n * fragment is an unfinished `key:…` — a finished fragment is either a token or text.\n */\nexport function parseQuery(input: string, vocabulary: readonly QueryTokenDef[]): ParsedQuery {\n const trimmed = input.trim();\n if (trimmed === '') return { draft: null, text: '', tokens: [] };\n\n const index = keyIndex(vocabulary);\n const fragments = trimmed.split(/\\s+/);\n const draft = trailingDraft(input, fragments, index);\n const complete = draft ? fragments.slice(0, -1) : fragments;\n\n const text: string[] = [];\n const tokens: QueryToken[] = [];\n for (const fragment of complete) {\n const match = TOKEN_SYNTAX.exec(fragment);\n const def = match ? index.get(lower(match[1])) : undefined;\n const option = def && match ? resolveOption(def, match[2]) : undefined;\n if (def && option) {\n const slot = tokens.findIndex((token) => token.key === def.key);\n if (slot >= 0) tokens[slot] = { key: def.key, value: option.value };\n else tokens.push({ key: def.key, value: option.value });\n } else {\n text.push(fragment);\n }\n }\n return { draft, text: text.join(' '), tokens };\n}\n\n/**\n * The dropdown's offers for the current field:\n * - inside a `key:…` draft: that key's options whose value or label matches the prefix;\n * - otherwise: the vocabulary's keys whose name matches the word being typed, plus\n * any option across all keys that reads like that word (so typing `ali` offers\n * `author:Alice` directly — the tap-first path).\n */\nexport function suggestQuery(input: string, vocabulary: readonly QueryTokenDef[]): QuerySuggestion[] {\n const draft = parseQuery(input, vocabulary).draft;\n const matches = (needle: string, option: QueryOption): boolean =>\n lower(option.value).startsWith(needle) || lower(option.label).startsWith(needle);\n\n if (draft) {\n const def = keyIndex(vocabulary).get(lower(draft.key));\n if (!def) return [];\n const needle = lower(draft.valuePrefix);\n return def.options\n .filter((option) => matches(needle, option))\n .map((option) => ({ key: def.key, kind: 'value', label: option.label, value: option.value }));\n }\n\n // The word being typed: none once the field ends in whitespace (focus fresh on a\n // finished query), so the dropdown falls back to listing the vocabulary's keys.\n const fragment = /\\s$/.test(input) || input.trim() === '' ? '' : (input.trim().split(/\\s+/).pop() ?? '');\n const needle = lower(fragment);\n const keys: QuerySuggestion[] = vocabulary\n .filter((def) => lower(def.key).startsWith(needle) || lower(def.label).startsWith(needle))\n .map((def) => ({ key: def.key, kind: 'key', label: def.label }));\n const values: QuerySuggestion[] =\n needle === ''\n ? []\n : vocabulary.flatMap((def) =>\n def.options\n .filter((option) => matches(needle, option))\n .map((option) => ({ key: def.key, kind: 'value', label: option.label, value: option.value })),\n );\n return [...keys, ...values];\n}\n"],"mappings":"AAkEA,IAAM,EAAe,4BAEf,MAAS,GAA0B,EAAM,YAAY,EAE3D,SAAS,SAAS,EAAkE,CAClF,OAAO,IAAI,IAAI,EAAW,IAAK,GAAQ,CAAC,MAAM,EAAI,GAAG,EAAG,CAAG,CAAC,CAAC,CAC/D,CAGA,SAAS,cAAc,EAAoB,EAAsC,CAC/E,IAAM,EAAS,MAAM,CAAG,EACxB,OAAO,EAAI,QAAQ,KAAM,GAAW,MAAM,EAAO,KAAK,IAAM,GAAU,MAAM,EAAO,KAAK,IAAM,CAAM,CACtG,CAGA,SAAS,QAAQ,EAAkB,EAAsD,CACvF,IAAM,EAAQ,EAAa,KAAK,CAAQ,EACxC,GAAI,CAAC,EAAO,OAAO,KACnB,IAAM,EAAM,EAAM,IAAI,MAAM,EAAM,EAAE,CAAC,EACrC,OAAO,EAAM,CAAE,IAAK,EAAI,IAAK,YAAa,EAAM,EAAG,EAAI,IACzD,CAOA,SAAS,cAAc,EAAe,EAAqB,EAAsD,CAC/G,GAAI,MAAM,KAAK,CAAK,EAAG,OAAO,KAC9B,IAAM,EAAY,QAAQ,EAAU,EAAU,OAAS,IAAM,GAAI,CAAK,EACtE,GAAI,CAAC,EAAW,OAAO,KACvB,IAAM,EAAM,EAAM,IAAI,MAAM,EAAU,GAAG,CAAC,EAC1C,OAAO,GAAO,cAAc,EAAK,EAAU,WAAW,EAAI,KAAO,CACnE,CAGA,SAAgB,YAAY,EAAmB,EAAa,EAA2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I,IAAK,KAAM,QAAS,MAAO,EAAO,MAAO,MAAO,EAAO,KAAM,EAAE,CAChG,EACN,MAAO,CAAC,GAAG,EAAM,GAAG,CAAM,CAC5B"}
@@ -0,0 +1,2 @@
1
+ var e=`@layer refine.base{:host{--_dropdown-bg:var(--combobox-dropdown-bg,var(--color-canvas));--_dropdown-border-color:var(--combobox-dropdown-border-color,var(--color-contrast-200));--_option-hover-bg:var(--combobox-option-hover-bg,var(--color-contrast-100));--_option-focus-bg:var(--combobox-option-focus-bg,color-mix(in oklch, var(--_theme-base) 12%, var(--color-contrast-100)));min-width:var(--query-bar-min-width,12rem);flex-direction:column;align-items:stretch;display:inline-flex}.trigger::part(input){cursor:text}.trigger::part(field){height:auto;min-height:var(--input-height,var(--size-10))}.trigger::part(input-row){row-gap:var(--size-1);flex-wrap:wrap;align-items:center}.prefix{display:contents}.prefix>ore-icon{color:var(--text-color-tertiary);flex-shrink:0}.prefix>ore-icon:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:var(--size-1)}.prefix>ore-icon:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:var(--size-1)}.pills{display:contents}.prefix ore-chip{flex:none}.prefix ore-chip:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:var(--size-1)}.prefix ore-chip:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:var(--size-1)}.suffix{gap:var(--size-1);flex-shrink:0;align-items:center;display:flex}.clear-btn{color:var(--color-contrast-400);cursor:pointer;background:0 0;border:0;flex-shrink:0;align-items:center;padding:0;display:inline-flex}.clear-btn[hidden]{display:none}.clear-btn:hover{color:var(--color-contrast-600)}.clear-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border);border-radius:var(--rounded-sm)}.dropdown{z-index:calc(var(--z-popover,1000) + 1);box-sizing:border-box;min-width:var(--query-bar-dropdown-min-width,16rem);max-width:var(--query-bar-dropdown-max-width,min(28rem, calc(100vw - var(--size-4))));max-height:min(16rem,50dvh);padding:var(--size-1);overscroll-behavior:contain;pointer-events:none;scrollbar-width:thin;background:var(--_dropdown-bg);border:var(--border) solid var(--_dropdown-border-color);border-radius:var(--_radius);box-shadow:var(--shadow-lg);opacity:0;-webkit-backdrop-filter:blur(var(--blur-md));backdrop-filter:blur(var(--blur-md));transform:translateY(var(--overlay-enter-translate-y));transition:var(--_motion-transition,opacity var(--transition-fast), transform var(--transition-fast), display var(--transition-fast) allow-discrete);margin:0;position:fixed;inset:0 auto auto 0;overflow-y:auto}.dropdown:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:left}.dropdown:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:right}.dropdown[data-open]{pointer-events:auto;opacity:1;transform:translateY(0)}@starting-style{.dropdown[data-open]{opacity:0;transform:translateY(var(--overlay-enter-translate-y))}}.option{box-sizing:border-box;gap:var(--size-2);height:var(--query-bar-option-height,36px);padding:var(--size-1) var(--size-2-5);font-size:var(--text-sm);line-height:var(--leading-normal);cursor:pointer;border-radius:var(--rounded-sm);transition:background var(--transition-fast), color var(--transition-fast);align-items:baseline;display:flex}.option:hover{background:var(--_option-hover-bg)}.option[data-focused]{color:var(--_theme-base);background:var(--_option-focus-bg)}.no-match{box-sizing:border-box;height:var(--query-bar-option-height,36px);padding:var(--size-1) var(--size-2-5);font-size:var(--text-sm);line-height:var(--leading-normal);color:var(--text-color-tertiary);border-radius:var(--rounded-sm);align-items:center;display:flex}.option-label{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;overflow:hidden}.option-meta{text-overflow:ellipsis;min-width:0;font-size:var(--text-xs);color:var(--text-color-tertiary);white-space:nowrap;flex:1;overflow:hidden}.option-meta:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:right}.option-meta:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:left}}`;exports.default=e;
2
+ //# sourceMappingURL=query-bar.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-bar.css.cjs","names":[],"sources":["../../../src/inputs/query-bar/query-bar.css?inline"],"sourcesContent":["@layer refine.base {\n :host {\n --_dropdown-bg: var(--combobox-dropdown-bg, var(--color-canvas));\n --_dropdown-border-color: var(--combobox-dropdown-border-color, var(--color-contrast-200));\n --_option-hover-bg: var(--combobox-option-hover-bg, var(--color-contrast-100));\n --_option-focus-bg: var(\n --combobox-option-focus-bg,\n color-mix(in oklch, var(--_theme-base) 12%, var(--color-contrast-100))\n );\n\n display: inline-flex;\n flex-direction: column;\n align-items: stretch;\n min-width: var(--query-bar-min-width, 12rem);\n }\n\n :host([open]) {\n /* Nothing yet: the open state is reflected for consumer styling. */\n }\n\n /* ore-input cursor override so the field still feels like a text input */\n .trigger::part(input) {\n cursor: text;\n }\n\n /* Allow the field to grow vertically when pills wrap to multiple rows. */\n .trigger::part(field) {\n height: auto;\n min-height: var(--input-height, var(--size-10));\n }\n\n /* Wrap pills + input across rows; the suffix stays on the input's row.\n Only row-gap is set here: spacing between pills is handled via margin on\n ore-chip so the empty prefix adds no extra offset. */\n .trigger::part(input-row) {\n flex-wrap: wrap;\n row-gap: var(--size-1);\n align-items: center;\n }\n\n /* ========================================\n Prefix: search icon + pill tokens\n ======================================== */\n\n /* display:contents removes the prefix wrapper from the flex layout so the\n icon and chips become direct flex items of input-row. */\n .prefix {\n display: contents;\n }\n\n .prefix > ore-icon {\n flex-shrink: 0;\n margin-inline-end: var(--size-1);\n color: var(--text-color-tertiary);\n }\n\n /* .pills is also display:contents so individual ore-chip elements are the\n direct flex items, wrapping inline with the search input. */\n .pills {\n display: contents;\n }\n\n /* Trailing space after each chip covers both inter-chip spacing and\n the gap between the last chip and the search input. Pills never shrink:\n they keep their readable size and wrap instead. */\n .prefix ore-chip {\n flex: none;\n margin-inline-end: var(--size-1);\n }\n\n /* ========================================\n Suffix: clear button\n ======================================== */\n\n .suffix {\n display: flex;\n flex-shrink: 0;\n gap: var(--size-1);\n align-items: center;\n }\n\n .clear-btn {\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n padding: 0;\n color: var(--color-contrast-400);\n cursor: pointer;\n background: none;\n border: 0;\n }\n\n .clear-btn[hidden] {\n display: none;\n }\n\n .clear-btn:hover {\n color: var(--color-contrast-600);\n }\n\n .clear-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n border-radius: var(--rounded-sm);\n }\n\n /* ========================================\n Dropdown / Listbox\n ======================================== */\n\n .dropdown {\n position: fixed;\n inset: 0 auto auto 0;\n z-index: calc(var(--z-popover, 1000) + 1);\n box-sizing: border-box;\n min-width: var(--query-bar-dropdown-min-width, 16rem);\n max-width: var(--query-bar-dropdown-max-width, min(28rem, calc(100vw - var(--size-4))));\n max-height: min(16rem, 50dvh);\n padding: var(--size-1);\n margin: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n text-align: start;\n pointer-events: none;\n scrollbar-width: thin;\n background: var(--_dropdown-bg);\n border: var(--border) solid var(--_dropdown-border-color);\n border-radius: var(--_radius);\n box-shadow: var(--shadow-lg);\n opacity: 0;\n backdrop-filter: blur(var(--blur-md));\n transform: translateY(var(--overlay-enter-translate-y));\n transition: var(\n --_motion-transition,\n opacity var(--transition-fast),\n transform var(--transition-fast),\n display var(--transition-fast) allow-discrete\n );\n }\n\n .dropdown[data-open] {\n pointer-events: auto;\n opacity: 1;\n transform: translateY(0);\n\n @starting-style {\n opacity: 0;\n transform: translateY(var(--overlay-enter-translate-y));\n }\n }\n\n /* ========================================\n Suggestion rows\n ======================================== */\n\n .option {\n box-sizing: border-box;\n display: flex;\n gap: var(--size-2);\n align-items: baseline;\n height: var(--query-bar-option-height, 36px);\n padding: var(--size-1) var(--size-2-5);\n font-size: var(--text-sm);\n line-height: var(--leading-normal);\n cursor: pointer;\n border-radius: var(--rounded-sm);\n transition:\n background var(--transition-fast),\n color var(--transition-fast);\n }\n\n .option:hover {\n background: var(--_option-hover-bg);\n }\n\n .option[data-focused] {\n color: var(--_theme-base);\n background: var(--_option-focus-bg);\n }\n\n /* The muted dead-draft row: explains the degradation instead of closing silently.\n Follows the combobox \"no-results\" presentation pattern. */\n .no-match {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n height: var(--query-bar-option-height, 36px);\n padding: var(--size-1) var(--size-2-5);\n font-size: var(--text-sm);\n line-height: var(--leading-normal);\n color: var(--text-color-tertiary);\n border-radius: var(--rounded-sm);\n }\n\n .option-label {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n /* The muted second column names the dimension a value belongs to, or the\n `key:` syntax a key suggestion inserts. */\n .option-meta {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n color: var(--text-color-tertiary);\n text-align: end;\n white-space: nowrap;\n }\n}\n"],"mappings":""}