@apipass/design-system 5.5.0 → 5.8.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 (31) hide show
  1. package/dist/lib/embedded-styles.js +2 -2
  2. package/dist/lib/style.css +1 -1
  3. package/dist/lib/ui/layout/Flex/Flex.cjs +1 -1
  4. package/dist/lib/ui/layout/Flex/Flex.cjs.map +1 -1
  5. package/dist/lib/ui/layout/Flex/Flex.js +12 -12
  6. package/dist/lib/ui/layout/Flex/Flex.js.map +1 -1
  7. package/dist/lib/ui/primitives/JsonViewer/JsonEditor.cjs +1 -1
  8. package/dist/lib/ui/primitives/JsonViewer/JsonEditor.cjs.map +1 -1
  9. package/dist/lib/ui/primitives/JsonViewer/JsonEditor.js +43 -42
  10. package/dist/lib/ui/primitives/JsonViewer/JsonEditor.js.map +1 -1
  11. package/dist/lib/ui/primitives/JsonViewer/JsonViewer.cjs +1 -1
  12. package/dist/lib/ui/primitives/JsonViewer/JsonViewer.cjs.map +1 -1
  13. package/dist/lib/ui/primitives/JsonViewer/JsonViewer.js +33 -26
  14. package/dist/lib/ui/primitives/JsonViewer/JsonViewer.js.map +1 -1
  15. package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.cjs +1 -1
  16. package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.cjs.map +1 -1
  17. package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.js +37 -32
  18. package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.js.map +1 -1
  19. package/dist/lib/ui/primitives/NavigationPill/NavigationPill.cjs +1 -1
  20. package/dist/lib/ui/primitives/NavigationPill/NavigationPill.cjs.map +1 -1
  21. package/dist/lib/ui/primitives/NavigationPill/NavigationPill.js +21 -17
  22. package/dist/lib/ui/primitives/NavigationPill/NavigationPill.js.map +1 -1
  23. package/dist/lib/ui/primitives/Search/Search.cjs +1 -1
  24. package/dist/lib/ui/primitives/Search/Search.cjs.map +1 -1
  25. package/dist/lib/ui/primitives/Search/Search.js +22 -49
  26. package/dist/lib/ui/primitives/Search/Search.js.map +1 -1
  27. package/dist/types/ui/primitives/JsonViewer/JsonEditor.d.ts +3 -3
  28. package/dist/types/ui/primitives/JsonViewer/JsonViewer.d.ts +3 -3
  29. package/dist/types/ui/primitives/JsonViewer/json-code-mirror.d.ts +7 -0
  30. package/dist/types/ui/primitives/NavigationPill/NavigationPill.d.ts +5 -2
  31. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- import { EditorView as s } from "@codemirror/view";
2
- import { json as f } from "@codemirror/lang-json";
3
- import { foldGutter as u, syntaxHighlighting as g, HighlightStyle as p } from "@codemirror/language";
1
+ import { EditorView as f } from "@codemirror/view";
2
+ import { json as u } from "@codemirror/lang-json";
3
+ import { foldGutter as g, syntaxHighlighting as p, HighlightStyle as m } from "@codemirror/language";
4
4
  import { tags as n } from "@lezer/highlight";
5
- const m = p.define([
5
+ const d = m.define([
6
6
  { tag: n.propertyName, color: "var(--json-viewer-color-key)" },
7
7
  { tag: n.string, color: "var(--json-viewer-color-string)", fontWeight: 600 },
8
8
  { tag: [n.number, n.bool, n.null], color: "var(--json-viewer-color-scalar)" },
9
9
  { tag: [n.separator, n.squareBracket, n.brace], color: "var(--json-viewer-color-punctuation)" }
10
- ]), j = s.theme({
10
+ ]), w = f.theme({
11
11
  "&": { backgroundColor: "transparent", color: "var(--json-viewer-color-punctuation)", fontSize: "13px" },
12
12
  "&.cm-focused": { outline: "none" },
13
- ".cm-content": { fontFamily: "var(--sds-typography-family-mono)", padding: "45px 124px 12px 4px" },
13
+ ".cm-content": { fontFamily: "var(--sds-typography-family-mono)", padding: "8px 124px 12px 4px" },
14
14
  ".cm-gutters": {
15
15
  backgroundColor: "transparent",
16
16
  border: "none",
@@ -18,47 +18,52 @@ const m = p.define([
18
18
  paddingLeft: "5px"
19
19
  },
20
20
  ".cm-scroller": { overflow: "auto" }
21
- }), w = [f(), u(), g(m)];
22
- function S(o) {
21
+ }), S = [u(), g(), p(d)];
22
+ function b(r) {
23
23
  try {
24
- return JSON.stringify(o, null, 2) ?? "null";
24
+ return JSON.stringify(r, null, 2) ?? "null";
25
25
  } catch {
26
- return String(o);
26
+ return String(r);
27
27
  }
28
28
  }
29
- function b(o) {
30
- return typeof o == "number" ? `${o}px` : o;
29
+ function a(r) {
30
+ return typeof r == "number" ? `${r}px` : r;
31
31
  }
32
- function x(o) {
33
- const l = [], c = o.length;
34
- let r = 0;
35
- for (; r < c && o[r] !== "{" && o[r] !== "["; ) r++;
36
- if (r >= c) return l;
37
- let e = 0, a = !1, i = -1;
38
- for (; r < c; r++) {
39
- const t = o[r];
40
- if (a) {
41
- t === "\\" ? r++ : t === '"' && (a = !1);
32
+ function x({ height: r, minHeight: e, maxHeight: i }) {
33
+ const o = {};
34
+ return r !== void 0 && (o["--json-viewer-height"] = a(r)), e !== void 0 && (o["--json-viewer-min-height"] = a(e)), i !== void 0 && (o["--json-viewer-max-height"] = a(i)), o;
35
+ }
36
+ function E(r) {
37
+ const e = [], i = r.length;
38
+ let o = 0;
39
+ for (; o < i && r[o] !== "{" && r[o] !== "["; ) o++;
40
+ if (o >= i) return e;
41
+ let s = 0, c = !1, l = -1;
42
+ for (; o < i; o++) {
43
+ const t = r[o];
44
+ if (c) {
45
+ t === "\\" ? o++ : t === '"' && (c = !1);
42
46
  continue;
43
47
  }
44
48
  if (t === '"') {
45
- a = !0;
49
+ c = !0;
46
50
  continue;
47
51
  }
48
52
  if (t === "{" || t === "[") {
49
- e++, e === 2 && (i = r + 1);
53
+ s++, s === 2 && (l = o + 1);
50
54
  continue;
51
55
  }
52
- (t === "}" || t === "]") && (e === 2 && i !== -1 && (l.push({ from: i, to: r }), i = -1), e--);
56
+ (t === "}" || t === "]") && (s === 2 && l !== -1 && (e.push({ from: l, to: o }), l = -1), s--);
53
57
  }
54
- return l;
58
+ return e;
55
59
  }
56
60
  export {
57
- x as computeFirstLevelFoldRanges,
58
- w as jsonEditorExtensions,
59
- j as jsonEditorTheme,
60
- m as jsonHighlightStyle,
61
- S as serializeJson,
62
- b as toCssSize
61
+ E as computeFirstLevelFoldRanges,
62
+ S as jsonEditorExtensions,
63
+ w as jsonEditorTheme,
64
+ d as jsonHighlightStyle,
65
+ b as serializeJson,
66
+ a as toCssSize,
67
+ x as toEditorSizeStyle
63
68
  };
64
69
  //# sourceMappingURL=json-code-mirror.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"json-code-mirror.js","sources":["../../../../../src/ui/primitives/JsonViewer/json-code-mirror.ts"],"sourcesContent":["import { EditorView } from \"@codemirror/view\";\nimport { json } from \"@codemirror/lang-json\";\nimport { foldGutter, HighlightStyle, syntaxHighlighting } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\n\nexport const jsonHighlightStyle = HighlightStyle.define([\n { tag: t.propertyName, color: \"var(--json-viewer-color-key)\" },\n { tag: t.string, color: \"var(--json-viewer-color-string)\", fontWeight: 600 },\n { tag: [t.number, t.bool, t.null], color: \"var(--json-viewer-color-scalar)\" },\n { tag: [t.separator, t.squareBracket, t.brace], color: \"var(--json-viewer-color-punctuation)\" },\n]);\n\nexport const jsonEditorTheme = EditorView.theme({\n \"&\": { backgroundColor: \"transparent\", color: \"var(--json-viewer-color-punctuation)\", fontSize: \"13px\" },\n \"&.cm-focused\": { outline: \"none\" },\n \".cm-content\": { fontFamily: \"var(--sds-typography-family-mono)\", padding: \"45px 124px 12px 4px\" },\n \".cm-gutters\": {\n backgroundColor: \"transparent\",\n border: \"none\",\n color: \"var(--json-viewer-color-caret)\",\n paddingLeft: \"5px\",\n },\n \".cm-scroller\": { overflow: \"auto\" },\n});\n\nexport const jsonEditorExtensions = [json(), foldGutter(), syntaxHighlighting(jsonHighlightStyle)];\n\nexport function serializeJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2) ?? \"null\";\n } catch {\n return String(value);\n }\n}\n\nexport function toCssSize(size: string | number): string {\n return typeof size === \"number\" ? `${size}px` : size;\n}\n\n/**\n * Finds the fold range of every direct child (depth 1) of the root object/array\n * by scanning the text itself for matching brackets. This mirrors what\n * CodeMirror's `foldable()` would compute, but doesn't depend on the lezer\n * parser having finished tokenizing the document — which for a multi-MB\n * document is not guaranteed synchronously at mount time.\n */\nexport function computeFirstLevelFoldRanges(text: string): { from: number; to: number }[] {\n const ranges: { from: number; to: number }[] = [];\n const n = text.length;\n let i = 0;\n while (i < n && text[i] !== \"{\" && text[i] !== \"[\") i++;\n if (i >= n) return ranges;\n\n let depth = 0;\n let inString = false;\n let pendingStart = -1;\n for (; i < n; i++) {\n const ch = text[i];\n if (inString) {\n if (ch === \"\\\\\") i++;\n else if (ch === '\"') inString = false;\n continue;\n }\n if (ch === '\"') {\n inString = true;\n continue;\n }\n if (ch === \"{\" || ch === \"[\") {\n depth++;\n if (depth === 2) pendingStart = i + 1;\n continue;\n }\n if (ch === \"}\" || ch === \"]\") {\n if (depth === 2 && pendingStart !== -1) {\n ranges.push({ from: pendingStart, to: i });\n pendingStart = -1;\n }\n depth--;\n }\n }\n return ranges;\n}\n"],"names":["jsonHighlightStyle","HighlightStyle","t","jsonEditorTheme","EditorView","jsonEditorExtensions","json","foldGutter","syntaxHighlighting","serializeJson","value","toCssSize","size","computeFirstLevelFoldRanges","text","ranges","n","i","depth","inString","pendingStart","ch"],"mappings":";;;;AAKO,MAAMA,IAAqBC,EAAe,OAAO;AAAA,EACtD,EAAE,KAAKC,EAAE,cAAc,OAAO,+BAAA;AAAA,EAC9B,EAAE,KAAKA,EAAE,QAAQ,OAAO,mCAAmC,YAAY,IAAA;AAAA,EACvE,EAAE,KAAK,CAACA,EAAE,QAAQA,EAAE,MAAMA,EAAE,IAAI,GAAG,OAAO,kCAAA;AAAA,EAC1C,EAAE,KAAK,CAACA,EAAE,WAAWA,EAAE,eAAeA,EAAE,KAAK,GAAG,OAAO,uCAAA;AACzD,CAAC,GAEYC,IAAkBC,EAAW,MAAM;AAAA,EAC9C,KAAK,EAAE,iBAAiB,eAAe,OAAO,wCAAwC,UAAU,OAAA;AAAA,EAChG,gBAAgB,EAAE,SAAS,OAAA;AAAA,EAC3B,eAAe,EAAE,YAAY,qCAAqC,SAAS,sBAAA;AAAA,EAC3E,eAAe;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf,gBAAgB,EAAE,UAAU,OAAA;AAC9B,CAAC,GAEYC,IAAuB,CAACC,EAAA,GAAQC,KAAcC,EAAmBR,CAAkB,CAAC;AAE1F,SAASS,EAAcC,GAAwB;AACpD,MAAI;AACF,WAAO,KAAK,UAAUA,GAAO,MAAM,CAAC,KAAK;AAAA,EAC3C,QAAQ;AACN,WAAO,OAAOA,CAAK;AAAA,EACrB;AACF;AAEO,SAASC,EAAUC,GAA+B;AACvD,SAAO,OAAOA,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAClD;AASO,SAASC,EAA4BC,GAA8C;AACxF,QAAMC,IAAyC,CAAA,GACzCC,IAAIF,EAAK;AACf,MAAIG,IAAI;AACR,SAAOA,IAAID,KAAKF,EAAKG,CAAC,MAAM,OAAOH,EAAKG,CAAC,MAAM,MAAK,CAAAA;AACpD,MAAIA,KAAKD,EAAG,QAAOD;AAEnB,MAAIG,IAAQ,GACRC,IAAW,IACXC,IAAe;AACnB,SAAOH,IAAID,GAAGC,KAAK;AACjB,UAAMI,IAAKP,EAAKG,CAAC;AACjB,QAAIE,GAAU;AACZ,MAAIE,MAAO,OAAMJ,MACRI,MAAO,QAAKF,IAAW;AAChC;AAAA,IACF;AACA,QAAIE,MAAO,KAAK;AACd,MAAAF,IAAW;AACX;AAAA,IACF;AACA,QAAIE,MAAO,OAAOA,MAAO,KAAK;AAC5B,MAAAH,KACIA,MAAU,MAAGE,IAAeH,IAAI;AACpC;AAAA,IACF;AACA,KAAII,MAAO,OAAOA,MAAO,SACnBH,MAAU,KAAKE,MAAiB,OAClCL,EAAO,KAAK,EAAE,MAAMK,GAAc,IAAIH,GAAG,GACzCG,IAAe,KAEjBF;AAAA,EAEJ;AACA,SAAOH;AACT;"}
1
+ {"version":3,"file":"json-code-mirror.js","sources":["../../../../../src/ui/primitives/JsonViewer/json-code-mirror.ts"],"sourcesContent":["import type { CSSProperties } from \"react\";\nimport { EditorView } from \"@codemirror/view\";\nimport { json } from \"@codemirror/lang-json\";\nimport { foldGutter, HighlightStyle, syntaxHighlighting } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\n\nexport const jsonHighlightStyle = HighlightStyle.define([\n { tag: t.propertyName, color: \"var(--json-viewer-color-key)\" },\n { tag: t.string, color: \"var(--json-viewer-color-string)\", fontWeight: 600 },\n { tag: [t.number, t.bool, t.null], color: \"var(--json-viewer-color-scalar)\" },\n { tag: [t.separator, t.squareBracket, t.brace], color: \"var(--json-viewer-color-punctuation)\" },\n]);\n\nexport const jsonEditorTheme = EditorView.theme({\n \"&\": { backgroundColor: \"transparent\", color: \"var(--json-viewer-color-punctuation)\", fontSize: \"13px\" },\n \"&.cm-focused\": { outline: \"none\" },\n \".cm-content\": { fontFamily: \"var(--sds-typography-family-mono)\", padding: \"8px 124px 12px 4px\" },\n \".cm-gutters\": {\n backgroundColor: \"transparent\",\n border: \"none\",\n color: \"var(--json-viewer-color-caret)\",\n paddingLeft: \"5px\",\n },\n \".cm-scroller\": { overflow: \"auto\" },\n});\n\nexport const jsonEditorExtensions = [json(), foldGutter(), syntaxHighlighting(jsonHighlightStyle)];\n\nexport function serializeJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2) ?? \"null\";\n } catch {\n return String(value);\n }\n}\n\nexport function toCssSize(size: string | number): string {\n return typeof size === \"number\" ? `${size}px` : size;\n}\n\nexport interface JsonEditorSize {\n height?: string | number;\n minHeight?: string | number;\n maxHeight?: string | number;\n}\n\nexport function toEditorSizeStyle({ height, minHeight, maxHeight }: JsonEditorSize): CSSProperties {\n const sizeVariables: Record<string, string> = {};\n if (height !== undefined) sizeVariables[\"--json-viewer-height\"] = toCssSize(height);\n if (minHeight !== undefined) sizeVariables[\"--json-viewer-min-height\"] = toCssSize(minHeight);\n if (maxHeight !== undefined) sizeVariables[\"--json-viewer-max-height\"] = toCssSize(maxHeight);\n return sizeVariables as CSSProperties;\n}\n\n/**\n * Finds the fold range of every direct child (depth 1) of the root object/array\n * by scanning the text itself for matching brackets. This mirrors what\n * CodeMirror's `foldable()` would compute, but doesn't depend on the lezer\n * parser having finished tokenizing the document — which for a multi-MB\n * document is not guaranteed synchronously at mount time.\n */\nexport function computeFirstLevelFoldRanges(text: string): { from: number; to: number }[] {\n const ranges: { from: number; to: number }[] = [];\n const n = text.length;\n let i = 0;\n while (i < n && text[i] !== \"{\" && text[i] !== \"[\") i++;\n if (i >= n) return ranges;\n\n let depth = 0;\n let inString = false;\n let pendingStart = -1;\n for (; i < n; i++) {\n const ch = text[i];\n if (inString) {\n if (ch === \"\\\\\") i++;\n else if (ch === '\"') inString = false;\n continue;\n }\n if (ch === '\"') {\n inString = true;\n continue;\n }\n if (ch === \"{\" || ch === \"[\") {\n depth++;\n if (depth === 2) pendingStart = i + 1;\n continue;\n }\n if (ch === \"}\" || ch === \"]\") {\n if (depth === 2 && pendingStart !== -1) {\n ranges.push({ from: pendingStart, to: i });\n pendingStart = -1;\n }\n depth--;\n }\n }\n return ranges;\n}\n"],"names":["jsonHighlightStyle","HighlightStyle","t","jsonEditorTheme","EditorView","jsonEditorExtensions","json","foldGutter","syntaxHighlighting","serializeJson","value","toCssSize","size","toEditorSizeStyle","height","minHeight","maxHeight","sizeVariables","computeFirstLevelFoldRanges","text","ranges","n","i","depth","inString","pendingStart","ch"],"mappings":";;;;AAMO,MAAMA,IAAqBC,EAAe,OAAO;AAAA,EACtD,EAAE,KAAKC,EAAE,cAAc,OAAO,+BAAA;AAAA,EAC9B,EAAE,KAAKA,EAAE,QAAQ,OAAO,mCAAmC,YAAY,IAAA;AAAA,EACvE,EAAE,KAAK,CAACA,EAAE,QAAQA,EAAE,MAAMA,EAAE,IAAI,GAAG,OAAO,kCAAA;AAAA,EAC1C,EAAE,KAAK,CAACA,EAAE,WAAWA,EAAE,eAAeA,EAAE,KAAK,GAAG,OAAO,uCAAA;AACzD,CAAC,GAEYC,IAAkBC,EAAW,MAAM;AAAA,EAC9C,KAAK,EAAE,iBAAiB,eAAe,OAAO,wCAAwC,UAAU,OAAA;AAAA,EAChG,gBAAgB,EAAE,SAAS,OAAA;AAAA,EAC3B,eAAe,EAAE,YAAY,qCAAqC,SAAS,qBAAA;AAAA,EAC3E,eAAe;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf,gBAAgB,EAAE,UAAU,OAAA;AAC9B,CAAC,GAEYC,IAAuB,CAACC,EAAA,GAAQC,KAAcC,EAAmBR,CAAkB,CAAC;AAE1F,SAASS,EAAcC,GAAwB;AACpD,MAAI;AACF,WAAO,KAAK,UAAUA,GAAO,MAAM,CAAC,KAAK;AAAA,EAC3C,QAAQ;AACN,WAAO,OAAOA,CAAK;AAAA,EACrB;AACF;AAEO,SAASC,EAAUC,GAA+B;AACvD,SAAO,OAAOA,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAClD;AAQO,SAASC,EAAkB,EAAE,QAAAC,GAAQ,WAAAC,GAAW,WAAAC,KAA4C;AACjG,QAAMC,IAAwC,CAAA;AAC9C,SAAIH,MAAW,WAAWG,EAAc,sBAAsB,IAAIN,EAAUG,CAAM,IAC9EC,MAAc,WAAWE,EAAc,0BAA0B,IAAIN,EAAUI,CAAS,IACxFC,MAAc,WAAWC,EAAc,0BAA0B,IAAIN,EAAUK,CAAS,IACrFC;AACT;AASO,SAASC,EAA4BC,GAA8C;AACxF,QAAMC,IAAyC,CAAA,GACzCC,IAAIF,EAAK;AACf,MAAIG,IAAI;AACR,SAAOA,IAAID,KAAKF,EAAKG,CAAC,MAAM,OAAOH,EAAKG,CAAC,MAAM,MAAK,CAAAA;AACpD,MAAIA,KAAKD,EAAG,QAAOD;AAEnB,MAAIG,IAAQ,GACRC,IAAW,IACXC,IAAe;AACnB,SAAOH,IAAID,GAAGC,KAAK;AACjB,UAAMI,IAAKP,EAAKG,CAAC;AACjB,QAAIE,GAAU;AACZ,MAAIE,MAAO,OAAMJ,MACRI,MAAO,QAAKF,IAAW;AAChC;AAAA,IACF;AACA,QAAIE,MAAO,KAAK;AACd,MAAAF,IAAW;AACX;AAAA,IACF;AACA,QAAIE,MAAO,OAAOA,MAAO,KAAK;AAC5B,MAAAH,KACIA,MAAU,MAAGE,IAAeH,IAAI;AACpC;AAAA,IACF;AACA,KAAII,MAAO,OAAOA,MAAO,SACnBH,MAAU,KAAKE,MAAiB,OAClCL,EAAO,KAAK,EAAE,MAAMK,GAAc,IAAIH,GAAG,GACzCG,IAAe,KAEjBF;AAAA,EAEJ;AACA,SAAOH;AACT;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("../../../vendor/clsx/dist/clsx.cjs"),t=require("react-aria-components");;/* empty css */function e({className:i,...a}){const s=n.clsx(i,"navigation-pill");return l.jsx(t.Tab,{className:s,...a})}function o({className:i,...a}){const s=n.clsx(i,"navigation-pill-list");return l.jsx(t.TabList,{className:s,...a})}function c({className:i,...a}){const s=n.clsx(i,"navigation-pill-panel");return l.jsx(t.TabPanel,{className:s,...a})}function r({className:i,...a}){const s=n.clsx(i,"navigation-pills");return l.jsx(t.Tabs,{className:s,...a})}exports.NavigationPill=e;exports.NavigationPillList=o;exports.NavigationPillPanel=c;exports.NavigationPills=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("../../../vendor/clsx/dist/clsx.cjs"),t=require("react-aria-components");;/* empty css */function o({className:i,...a}){const s=n.clsx(i,"navigation-pill");return l.jsx(t.Tab,{className:s,...a})}function c({className:i,...a}){const s=n.clsx(i,"navigation-pill-list");return l.jsx(t.TabList,{className:s,...a})}function r({className:i,...a}){const s=n.clsx(i,"navigation-pill-panel");return l.jsx(t.TabPanel,{className:s,...a})}function u({className:i,shape:a="pill",...s}){const e=n.clsx(i,"navigation-pills",`navigation-pills-shape-${a}`);return l.jsx(t.Tabs,{className:e,...s})}exports.NavigationPill=o;exports.NavigationPillList=c;exports.NavigationPillPanel=r;exports.NavigationPills=u;
2
2
  //# sourceMappingURL=NavigationPill.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationPill.cjs","sources":["../../../../../src/ui/primitives/NavigationPill/NavigationPill.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type TabListProps as RACTabListProps,\n type TabPanelProps as RACTabPanelProps,\n type TabProps as RACTabProps,\n type TabsProps as RACTabsProps,\n} from \"react-aria-components\";\nimport \"./navigationPill.css\";\n\nexport type NavigationPillProps = RACTabProps;\nexport function NavigationPill({ className, ...props }: NavigationPillProps) {\n const classNames = clsx(className, \"navigation-pill\");\n return <RACTab className={classNames} {...props} />;\n}\n\nexport type NavigationPillListProps<T> = RACTabListProps<T>;\nexport function NavigationPillList<T extends object>({\n className,\n ...props\n}: NavigationPillListProps<T>) {\n const classNames = clsx(className, \"navigation-pill-list\");\n return <RACTabList className={classNames} {...props} />;\n}\n\nexport type NavigationPillPanelProps = RACTabPanelProps;\nexport function NavigationPillPanel({\n className,\n ...props\n}: NavigationPillPanelProps) {\n const classNames = clsx(className, \"navigation-pill-panel\");\n return <RACTabPanel className={classNames} {...props} />;\n}\n\nexport type NavigationPillsProps = RACTabsProps;\nexport function NavigationPills({ className, ...props }: NavigationPillsProps) {\n const classNames = clsx(className, \"navigation-pills\");\n return <RACTabs className={classNames} {...props} />;\n}\n"],"names":["NavigationPill","className","props","classNames","clsx","jsx","RACTab","NavigationPillList","RACTabList","NavigationPillPanel","RACTabPanel","NavigationPills","RACTabs"],"mappings":"4OAcO,SAASA,EAAe,CAAE,UAAAC,EAAW,GAAGC,GAA8B,CAC3E,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,iBAAiB,EACpD,OAAOI,EAAAA,IAACC,EAAAA,IAAA,CAAO,UAAWH,EAAa,GAAGD,EAAO,CACnD,CAGO,SAASK,EAAqC,CACnD,UAAAN,EACA,GAAGC,CACL,EAA+B,CAC7B,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,sBAAsB,EACzD,OAAOI,EAAAA,IAACG,EAAAA,QAAA,CAAW,UAAWL,EAAa,GAAGD,EAAO,CACvD,CAGO,SAASO,EAAoB,CAClC,UAAAR,EACA,GAAGC,CACL,EAA6B,CAC3B,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,uBAAuB,EAC1D,OAAOI,EAAAA,IAACK,EAAAA,SAAA,CAAY,UAAWP,EAAa,GAAGD,EAAO,CACxD,CAGO,SAASS,EAAgB,CAAE,UAAAV,EAAW,GAAGC,GAA+B,CAC7E,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,kBAAkB,EACrD,OAAOI,EAAAA,IAACO,EAAAA,KAAA,CAAQ,UAAWT,EAAa,GAAGD,EAAO,CACpD"}
1
+ {"version":3,"file":"NavigationPill.cjs","sources":["../../../../../src/ui/primitives/NavigationPill/NavigationPill.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type TabListProps as RACTabListProps,\n type TabPanelProps as RACTabPanelProps,\n type TabProps as RACTabProps,\n type TabsProps as RACTabsProps,\n} from \"react-aria-components\";\nimport \"./navigationPill.css\";\n\nexport type NavigationPillProps = RACTabProps;\nexport function NavigationPill({ className, ...props }: NavigationPillProps) {\n const classNames = clsx(className, \"navigation-pill\");\n return <RACTab className={classNames} {...props} />;\n}\n\nexport type NavigationPillListProps<T> = RACTabListProps<T>;\nexport function NavigationPillList<T extends object>({\n className,\n ...props\n}: NavigationPillListProps<T>) {\n const classNames = clsx(className, \"navigation-pill-list\");\n return <RACTabList className={classNames} {...props} />;\n}\n\nexport type NavigationPillPanelProps = RACTabPanelProps;\nexport function NavigationPillPanel({\n className,\n ...props\n}: NavigationPillPanelProps) {\n const classNames = clsx(className, \"navigation-pill-panel\");\n return <RACTabPanel className={classNames} {...props} />;\n}\n\nexport type NavigationPillShape = \"pill\" | \"rounded\";\n\nexport type NavigationPillsProps = RACTabsProps & {\n shape?: NavigationPillShape;\n};\nexport function NavigationPills({\n className,\n shape = \"pill\",\n ...props\n}: NavigationPillsProps) {\n const classNames = clsx(className, \"navigation-pills\", `navigation-pills-shape-${shape}`);\n return <RACTabs className={classNames} {...props} />;\n}\n"],"names":["NavigationPill","className","props","classNames","clsx","jsx","RACTab","NavigationPillList","RACTabList","NavigationPillPanel","RACTabPanel","NavigationPills","shape","RACTabs"],"mappings":"4OAcO,SAASA,EAAe,CAAE,UAAAC,EAAW,GAAGC,GAA8B,CAC3E,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,iBAAiB,EACpD,OAAOI,EAAAA,IAACC,EAAAA,IAAA,CAAO,UAAWH,EAAa,GAAGD,EAAO,CACnD,CAGO,SAASK,EAAqC,CACnD,UAAAN,EACA,GAAGC,CACL,EAA+B,CAC7B,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,sBAAsB,EACzD,OAAOI,EAAAA,IAACG,EAAAA,QAAA,CAAW,UAAWL,EAAa,GAAGD,EAAO,CACvD,CAGO,SAASO,EAAoB,CAClC,UAAAR,EACA,GAAGC,CACL,EAA6B,CAC3B,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,uBAAuB,EAC1D,OAAOI,EAAAA,IAACK,EAAAA,SAAA,CAAY,UAAWP,EAAa,GAAGD,EAAO,CACxD,CAOO,SAASS,EAAgB,CAC9B,UAAAV,EACA,MAAAW,EAAQ,OACR,GAAGV,CACL,EAAyB,CACvB,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,mBAAoB,0BAA0BW,CAAK,EAAE,EACxF,OAAOP,EAAAA,IAACQ,EAAAA,KAAA,CAAQ,UAAWV,EAAa,GAAGD,EAAO,CACpD"}
@@ -1,33 +1,37 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { clsx as l } from "../../../vendor/clsx/dist/clsx.js";
3
- import { Tab as t, TabList as o, TabPanel as c, Tabs as e } from "react-aria-components";
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { clsx as n } from "../../../vendor/clsx/dist/clsx.js";
3
+ import { Tab as o, TabList as c, TabPanel as e, Tabs as r } from "react-aria-components";
4
4
  /* empty css */
5
- function g({ className: a, ...i }) {
6
- const s = l(a, "navigation-pill");
7
- return /* @__PURE__ */ n(t, { className: s, ...i });
5
+ function v({ className: a, ...i }) {
6
+ const s = n(a, "navigation-pill");
7
+ return /* @__PURE__ */ l(o, { className: s, ...i });
8
8
  }
9
9
  function u({
10
10
  className: a,
11
11
  ...i
12
12
  }) {
13
- const s = l(a, "navigation-pill-list");
14
- return /* @__PURE__ */ n(o, { className: s, ...i });
13
+ const s = n(a, "navigation-pill-list");
14
+ return /* @__PURE__ */ l(c, { className: s, ...i });
15
15
  }
16
- function v({
16
+ function f({
17
17
  className: a,
18
18
  ...i
19
19
  }) {
20
- const s = l(a, "navigation-pill-panel");
21
- return /* @__PURE__ */ n(c, { className: s, ...i });
20
+ const s = n(a, "navigation-pill-panel");
21
+ return /* @__PURE__ */ l(e, { className: s, ...i });
22
22
  }
23
- function f({ className: a, ...i }) {
24
- const s = l(a, "navigation-pills");
25
- return /* @__PURE__ */ n(e, { className: s, ...i });
23
+ function P({
24
+ className: a,
25
+ shape: i = "pill",
26
+ ...s
27
+ }) {
28
+ const t = n(a, "navigation-pills", `navigation-pills-shape-${i}`);
29
+ return /* @__PURE__ */ l(r, { className: t, ...s });
26
30
  }
27
31
  export {
28
- g as NavigationPill,
32
+ v as NavigationPill,
29
33
  u as NavigationPillList,
30
- v as NavigationPillPanel,
31
- f as NavigationPills
34
+ f as NavigationPillPanel,
35
+ P as NavigationPills
32
36
  };
33
37
  //# sourceMappingURL=NavigationPill.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationPill.js","sources":["../../../../../src/ui/primitives/NavigationPill/NavigationPill.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type TabListProps as RACTabListProps,\n type TabPanelProps as RACTabPanelProps,\n type TabProps as RACTabProps,\n type TabsProps as RACTabsProps,\n} from \"react-aria-components\";\nimport \"./navigationPill.css\";\n\nexport type NavigationPillProps = RACTabProps;\nexport function NavigationPill({ className, ...props }: NavigationPillProps) {\n const classNames = clsx(className, \"navigation-pill\");\n return <RACTab className={classNames} {...props} />;\n}\n\nexport type NavigationPillListProps<T> = RACTabListProps<T>;\nexport function NavigationPillList<T extends object>({\n className,\n ...props\n}: NavigationPillListProps<T>) {\n const classNames = clsx(className, \"navigation-pill-list\");\n return <RACTabList className={classNames} {...props} />;\n}\n\nexport type NavigationPillPanelProps = RACTabPanelProps;\nexport function NavigationPillPanel({\n className,\n ...props\n}: NavigationPillPanelProps) {\n const classNames = clsx(className, \"navigation-pill-panel\");\n return <RACTabPanel className={classNames} {...props} />;\n}\n\nexport type NavigationPillsProps = RACTabsProps;\nexport function NavigationPills({ className, ...props }: NavigationPillsProps) {\n const classNames = clsx(className, \"navigation-pills\");\n return <RACTabs className={classNames} {...props} />;\n}\n"],"names":["NavigationPill","className","props","classNames","clsx","jsx","RACTab","NavigationPillList","RACTabList","NavigationPillPanel","RACTabPanel","NavigationPills","RACTabs"],"mappings":";;;;AAcO,SAASA,EAAe,EAAE,WAAAC,GAAW,GAAGC,KAA8B;AAC3E,QAAMC,IAAaC,EAAKH,GAAW,iBAAiB;AACpD,SAAO,gBAAAI,EAACC,GAAA,EAAO,WAAWH,GAAa,GAAGD,GAAO;AACnD;AAGO,SAASK,EAAqC;AAAA,EACnD,WAAAN;AAAA,EACA,GAAGC;AACL,GAA+B;AAC7B,QAAMC,IAAaC,EAAKH,GAAW,sBAAsB;AACzD,SAAO,gBAAAI,EAACG,GAAA,EAAW,WAAWL,GAAa,GAAGD,GAAO;AACvD;AAGO,SAASO,EAAoB;AAAA,EAClC,WAAAR;AAAA,EACA,GAAGC;AACL,GAA6B;AAC3B,QAAMC,IAAaC,EAAKH,GAAW,uBAAuB;AAC1D,SAAO,gBAAAI,EAACK,GAAA,EAAY,WAAWP,GAAa,GAAGD,GAAO;AACxD;AAGO,SAASS,EAAgB,EAAE,WAAAV,GAAW,GAAGC,KAA+B;AAC7E,QAAMC,IAAaC,EAAKH,GAAW,kBAAkB;AACrD,SAAO,gBAAAI,EAACO,GAAA,EAAQ,WAAWT,GAAa,GAAGD,GAAO;AACpD;"}
1
+ {"version":3,"file":"NavigationPill.js","sources":["../../../../../src/ui/primitives/NavigationPill/NavigationPill.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type TabListProps as RACTabListProps,\n type TabPanelProps as RACTabPanelProps,\n type TabProps as RACTabProps,\n type TabsProps as RACTabsProps,\n} from \"react-aria-components\";\nimport \"./navigationPill.css\";\n\nexport type NavigationPillProps = RACTabProps;\nexport function NavigationPill({ className, ...props }: NavigationPillProps) {\n const classNames = clsx(className, \"navigation-pill\");\n return <RACTab className={classNames} {...props} />;\n}\n\nexport type NavigationPillListProps<T> = RACTabListProps<T>;\nexport function NavigationPillList<T extends object>({\n className,\n ...props\n}: NavigationPillListProps<T>) {\n const classNames = clsx(className, \"navigation-pill-list\");\n return <RACTabList className={classNames} {...props} />;\n}\n\nexport type NavigationPillPanelProps = RACTabPanelProps;\nexport function NavigationPillPanel({\n className,\n ...props\n}: NavigationPillPanelProps) {\n const classNames = clsx(className, \"navigation-pill-panel\");\n return <RACTabPanel className={classNames} {...props} />;\n}\n\nexport type NavigationPillShape = \"pill\" | \"rounded\";\n\nexport type NavigationPillsProps = RACTabsProps & {\n shape?: NavigationPillShape;\n};\nexport function NavigationPills({\n className,\n shape = \"pill\",\n ...props\n}: NavigationPillsProps) {\n const classNames = clsx(className, \"navigation-pills\", `navigation-pills-shape-${shape}`);\n return <RACTabs className={classNames} {...props} />;\n}\n"],"names":["NavigationPill","className","props","classNames","clsx","jsx","RACTab","NavigationPillList","RACTabList","NavigationPillPanel","RACTabPanel","NavigationPills","shape","RACTabs"],"mappings":";;;;AAcO,SAASA,EAAe,EAAE,WAAAC,GAAW,GAAGC,KAA8B;AAC3E,QAAMC,IAAaC,EAAKH,GAAW,iBAAiB;AACpD,SAAO,gBAAAI,EAACC,GAAA,EAAO,WAAWH,GAAa,GAAGD,GAAO;AACnD;AAGO,SAASK,EAAqC;AAAA,EACnD,WAAAN;AAAA,EACA,GAAGC;AACL,GAA+B;AAC7B,QAAMC,IAAaC,EAAKH,GAAW,sBAAsB;AACzD,SAAO,gBAAAI,EAACG,GAAA,EAAW,WAAWL,GAAa,GAAGD,GAAO;AACvD;AAGO,SAASO,EAAoB;AAAA,EAClC,WAAAR;AAAA,EACA,GAAGC;AACL,GAA6B;AAC3B,QAAMC,IAAaC,EAAKH,GAAW,uBAAuB;AAC1D,SAAO,gBAAAI,EAACK,GAAA,EAAY,WAAWP,GAAa,GAAGD,GAAO;AACxD;AAOO,SAASS,EAAgB;AAAA,EAC9B,WAAAV;AAAA,EACA,OAAAW,IAAQ;AAAA,EACR,GAAGV;AACL,GAAyB;AACvB,QAAMC,IAAaC,EAAKH,GAAW,oBAAoB,0BAA0BW,CAAK,EAAE;AACxF,SAAO,gBAAAP,EAACQ,GAAA,EAAQ,WAAWV,GAAa,GAAGD,GAAO;AACpD;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("../../../vendor/clsx/dist/clsx.cjs"),a=require("react"),u=require("react-aria-components");;/* empty css */const q=require("../../icons/IconX.cjs"),S=require("../../icons/IconSearch.cjs"),b=require("../../hooks/useOverlayPortal.cjs"),f=require("../Fieldset/Fieldset.cjs"),v=require("../Input/Input.cjs"),h=require("../IconButton/IconButton.cjs"),x=require("../ListBox/ListBox.cjs"),B=a.forwardRef(function({className:m,results:c,onSearch:o,...i},n){const[l,j]=a.useState(""),t=a.useRef(null),s=e=>{j(e),o&&o(e)},p=d.clsx(m,"search-input-container"),I=b.useOverlayPortalContainer();return r.jsxs(u.ComboBox,{className:p,children:[r.jsx(f.Label,{hidden:!0,children:i["aria-label"]||"Search"}),r.jsx(v.Input,{type:"search",className:"search-input",value:l,onInput:e=>s(e.currentTarget.value),ref:e=>{t.current=e,typeof n=="function"?n(e):n&&(n.current=e)},...i}),r.jsx("span",{className:"search-icon",children:l?r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>s(""),size:"small",variant:"subtle",children:r.jsx(q.IconX,{})}):r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>{var e;return(e=t==null?void 0:t.current)==null?void 0:e.focus()},size:"small",variant:"subtle",children:r.jsx(S.IconSearch,{})})}),r.jsx(u.Popover,{UNSTABLE_portalContainer:I,children:r.jsx(x.ListBox,{children:c==null?void 0:c.map(e=>r.jsx(x.ListBoxItem,{onAction:()=>s(e),children:e},e))})})]})});exports.Search=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("../../../vendor/clsx/dist/clsx.cjs"),a=require("react"),s=require("react-aria-components");;/* empty css */const q=require("../../hooks/useOverlayPortal.cjs"),j=require("../Fieldset/Fieldset.cjs"),S=require("../Input/Input.cjs"),i=require("../ListBox/ListBox.cjs"),v=a.forwardRef(function({className:u,results:t,onSearch:n,...o},l){const[h,x]=a.useState(""),c=e=>{x(e),n&&n(e)},p=m.clsx(u,"search-input-container"),d=q.useOverlayPortalContainer();return r.jsxs(s.ComboBox,{className:p,children:[r.jsx(j.Label,{hidden:!0,children:o["aria-label"]||"Search"}),r.jsx(S.Input,{type:"search",className:"search-input",value:h,onInput:e=>c(e.currentTarget.value),ref:l,...o}),r.jsx(s.Popover,{UNSTABLE_portalContainer:d,children:r.jsx(i.ListBox,{children:t==null?void 0:t.map(e=>r.jsx(i.ListBoxItem,{onAction:()=>c(e),children:e},e))})})]})});exports.Search=v;
2
2
  //# sourceMappingURL=Search.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.cjs","sources":["../../../../../src/ui/primitives/Search/Search.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconSearch, IconX } from \"icons\";\nimport { IconButton, Input, Label, ListBox, ListBoxItem } from \"primitives\";\nimport React, { useRef, useState } from \"react\";\nimport {\n ComboBox as RACComboBox,\n Popover as RACPopover,\n type InputProps as RACInputProps,\n} from \"react-aria-components\";\nimport \"./search.css\";\n\nexport type SearchProps = Omit<RACInputProps, \"results\"> & {\n results?: string[];\n onSearch?: (search: string) => void;\n};\nexport const Search = React.forwardRef(function Search(\n { className, results, onSearch, ...props }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n const onInputInput = (search: string) => {\n setSearchTerm(search);\n if (onSearch) {\n onSearch(search);\n }\n };\n\n const classNames = clsx(className, \"search-input-container\");\n // Sem container explícito o dropdown faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n\n return (\n <RACComboBox className={classNames}>\n <Label hidden>{props[\"aria-label\"] || \"Search\"}</Label>\n <Input\n type=\"search\"\n className=\"search-input\"\n value={searchTerm}\n onInput={(e) => onInputInput(e.currentTarget.value)}\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n {...props}\n />\n <span className=\"search-icon\">\n {searchTerm ? (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => onInputInput(\"\")}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconX />\n </IconButton>\n ) : (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => inputRef?.current?.focus()}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconSearch />\n </IconButton>\n )}\n </span>\n <RACPopover UNSTABLE_portalContainer={portalContainer}>\n <ListBox>\n {results?.map((a) => (\n <ListBoxItem key={a} onAction={() => onInputInput(a)}>\n {a}\n </ListBoxItem>\n ))}\n </ListBox>\n </RACPopover>\n </RACComboBox>\n );\n});\n"],"names":["Search","React","className","results","onSearch","props","ref","searchTerm","setSearchTerm","useState","inputRef","useRef","onInputInput","search","classNames","clsx","portalContainer","useOverlayPortalContainer","jsxs","RACComboBox","jsx","Label","Input","node","IconButton","IconX","_a","IconSearch","RACPopover","ListBox","a","ListBoxItem"],"mappings":"0gBAgBaA,EAASC,EAAM,WAAW,SACrC,CAAE,UAAAC,EAAW,QAAAC,EAAS,SAAAC,EAAU,GAAGC,CAAA,EACnCC,EACA,CACA,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,EAAE,EACzCC,EAAWC,EAAAA,OAAgC,IAAI,EAC/CC,EAAgBC,GAAmB,CACvCL,EAAcK,CAAM,EAChBT,GACFA,EAASS,CAAM,CAEnB,EAEMC,EAAaC,EAAAA,KAAKb,EAAW,wBAAwB,EAGrDc,EAAkBC,EAAAA,0BAAA,EAExB,OACEC,EAAAA,KAACC,EAAAA,SAAA,CAAY,UAAWL,EACtB,SAAA,CAAAM,MAACC,EAAAA,OAAM,OAAM,GAAE,SAAAhB,EAAM,YAAY,GAAK,SAAS,EAC/Ce,EAAAA,IAACE,EAAAA,MAAA,CACC,KAAK,SACL,UAAU,eACV,MAAOf,EACP,QAAU,GAAMK,EAAa,EAAE,cAAc,KAAK,EAClD,IAAMW,GAAS,CACbb,EAAS,QAAUa,EACf,OAAOjB,GAAQ,WACjBA,EAAIiB,CAAI,EACCjB,IACTA,EAAI,QAAUiB,EAElB,EACC,GAAGlB,CAAA,CAAA,EAENe,EAAAA,IAAC,OAAA,CAAK,UAAU,cACb,SAAAb,EACCa,EAAAA,IAACI,EAAAA,WAAA,CACC,aAAW,eACX,QAAS,IAAMZ,EAAa,EAAE,EAC9B,KAAK,QACL,QAAQ,SAER,eAACa,EAAAA,MAAA,CAAA,CAAM,CAAA,CAAA,EAGTL,EAAAA,IAACI,EAAAA,WAAA,CACC,aAAW,eACX,QAAS,IAAA,OAAM,OAAAE,EAAAhB,GAAA,YAAAA,EAAU,UAAV,YAAAgB,EAAmB,SAClC,KAAK,QACL,QAAQ,SAER,eAACC,EAAAA,WAAA,CAAA,CAAW,CAAA,CAAA,EAGlB,EACAP,EAAAA,IAACQ,EAAAA,SAAW,yBAA0BZ,EACpC,eAACa,EAAAA,QAAA,CACE,SAAA1B,GAAA,YAAAA,EAAS,IAAK2B,SACZC,cAAA,CAAoB,SAAU,IAAMnB,EAAakB,CAAC,EAChD,SAAAA,CAAA,EADeA,CAElB,EACD,CACH,CAAA,CACF,CAAA,EACF,CAEJ,CAAC"}
1
+ {"version":3,"file":"Search.cjs","sources":["../../../../../src/ui/primitives/Search/Search.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { Input, Label, ListBox, ListBoxItem } from \"primitives\";\nimport React, { useState } from \"react\";\nimport {\n ComboBox as RACComboBox,\n Popover as RACPopover,\n type InputProps as RACInputProps,\n} from \"react-aria-components\";\nimport \"./search.css\";\n\nexport type SearchProps = Omit<RACInputProps, \"results\"> & {\n results?: string[];\n onSearch?: (search: string) => void;\n};\n\nexport const Search = React.forwardRef(function Search(\n { className, results, onSearch, ...props }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n\n const onInputInput = (search: string) => {\n setSearchTerm(search);\n if (onSearch) {\n onSearch(search);\n }\n };\n\n const classNames = clsx(className, \"search-input-container\");\n // Sem container explícito o dropdown faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n\n return (\n <RACComboBox className={classNames}>\n <Label hidden>{props[\"aria-label\"] || \"Search\"}</Label>\n <Input\n type=\"search\"\n className=\"search-input\"\n value={searchTerm}\n onInput={(e) => onInputInput(e.currentTarget.value)}\n ref={ref}\n {...props}\n />\n <RACPopover UNSTABLE_portalContainer={portalContainer}>\n <ListBox>\n {results?.map((a) => (\n <ListBoxItem key={a} onAction={() => onInputInput(a)}>\n {a}\n </ListBoxItem>\n ))}\n </ListBox>\n </RACPopover>\n </RACComboBox>\n );\n});\n"],"names":["Search","React","className","results","onSearch","props","ref","searchTerm","setSearchTerm","useState","onInputInput","search","classNames","clsx","portalContainer","useOverlayPortalContainer","jsxs","RACComboBox","jsx","Label","Input","RACPopover","ListBox","a","ListBoxItem"],"mappings":"qZAgBaA,EAASC,EAAM,WAAW,SACrC,CAAE,UAAAC,EAAW,QAAAC,EAAS,SAAAC,EAAU,GAAGC,CAAA,EACnCC,EACA,CACA,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,EAAE,EAEzCC,EAAgBC,GAAmB,CACvCH,EAAcG,CAAM,EAChBP,GACFA,EAASO,CAAM,CAEnB,EAEMC,EAAaC,EAAAA,KAAKX,EAAW,wBAAwB,EAGrDY,EAAkBC,EAAAA,0BAAA,EAExB,OACEC,EAAAA,KAACC,EAAAA,SAAA,CAAY,UAAWL,EACtB,SAAA,CAAAM,MAACC,EAAAA,OAAM,OAAM,GAAE,SAAAd,EAAM,YAAY,GAAK,SAAS,EAC/Ca,EAAAA,IAACE,EAAAA,MAAA,CACC,KAAK,SACL,UAAU,eACV,MAAOb,EACP,QAAU,GAAMG,EAAa,EAAE,cAAc,KAAK,EAClD,IAAAJ,EACC,GAAGD,CAAA,CAAA,EAENa,EAAAA,IAACG,EAAAA,SAAW,yBAA0BP,EACpC,eAACQ,EAAAA,QAAA,CACE,SAAAnB,GAAA,YAAAA,EAAS,IAAKoB,SACZC,cAAA,CAAoB,SAAU,IAAMd,EAAaa,CAAC,EAChD,SAAAA,CAAA,EADeA,CAElB,EACD,CACH,CAAA,CACF,CAAA,EACF,CAEJ,CAAC"}
@@ -1,60 +1,33 @@
1
- import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
- import { clsx as d } from "../../../vendor/clsx/dist/clsx.js";
3
- import I, { useState as b, useRef as x } from "react";
4
- import { ComboBox as v, Popover as C } from "react-aria-components";
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
+ import { clsx as h } from "../../../vendor/clsx/dist/clsx.js";
3
+ import u, { useState as d } from "react";
4
+ import { ComboBox as x, Popover as I } from "react-aria-components";
5
5
  /* empty css */
6
- import { IconX as S } from "../../icons/IconX.js";
7
- import { IconSearch as B } from "../../icons/IconSearch.js";
8
- import { useOverlayPortalContainer as N } from "../../hooks/useOverlayPortal.js";
9
- import { Label as L } from "../Fieldset/Fieldset.js";
10
- import { Input as P } from "../Input/Input.js";
11
- import { IconButton as m } from "../IconButton/IconButton.js";
12
- import { ListBox as T, ListBoxItem as y } from "../ListBox/ListBox.js";
13
- const D = I.forwardRef(function({ className: l, results: a, onSearch: c, ...i }, o) {
14
- const [s, p] = b(""), t = x(null), n = (r) => {
15
- p(r), c && c(r);
16
- }, h = d(l, "search-input-container"), u = N();
17
- return /* @__PURE__ */ f(v, { className: h, children: [
18
- /* @__PURE__ */ e(L, { hidden: !0, children: i["aria-label"] || "Search" }),
19
- /* @__PURE__ */ e(
20
- P,
6
+ import { useOverlayPortalContainer as S } from "../../hooks/useOverlayPortal.js";
7
+ import { Label as v } from "../Fieldset/Fieldset.js";
8
+ import { Input as B } from "../Input/Input.js";
9
+ import { ListBox as C, ListBoxItem as L } from "../ListBox/ListBox.js";
10
+ const E = u.forwardRef(function({ className: i, results: t, onSearch: e, ...n }, c) {
11
+ const [m, p] = d(""), a = (r) => {
12
+ p(r), e && e(r);
13
+ }, s = h(i, "search-input-container"), l = S();
14
+ return /* @__PURE__ */ f(x, { className: s, children: [
15
+ /* @__PURE__ */ o(v, { hidden: !0, children: n["aria-label"] || "Search" }),
16
+ /* @__PURE__ */ o(
17
+ B,
21
18
  {
22
19
  type: "search",
23
20
  className: "search-input",
24
- value: s,
25
- onInput: (r) => n(r.currentTarget.value),
26
- ref: (r) => {
27
- t.current = r, typeof o == "function" ? o(r) : o && (o.current = r);
28
- },
29
- ...i
21
+ value: m,
22
+ onInput: (r) => a(r.currentTarget.value),
23
+ ref: c,
24
+ ...n
30
25
  }
31
26
  ),
32
- /* @__PURE__ */ e("span", { className: "search-icon", children: s ? /* @__PURE__ */ e(
33
- m,
34
- {
35
- "aria-label": "Clear search",
36
- onPress: () => n(""),
37
- size: "small",
38
- variant: "subtle",
39
- children: /* @__PURE__ */ e(S, {})
40
- }
41
- ) : /* @__PURE__ */ e(
42
- m,
43
- {
44
- "aria-label": "Clear search",
45
- onPress: () => {
46
- var r;
47
- return (r = t == null ? void 0 : t.current) == null ? void 0 : r.focus();
48
- },
49
- size: "small",
50
- variant: "subtle",
51
- children: /* @__PURE__ */ e(B, {})
52
- }
53
- ) }),
54
- /* @__PURE__ */ e(C, { UNSTABLE_portalContainer: u, children: /* @__PURE__ */ e(T, { children: a == null ? void 0 : a.map((r) => /* @__PURE__ */ e(y, { onAction: () => n(r), children: r }, r)) }) })
27
+ /* @__PURE__ */ o(I, { UNSTABLE_portalContainer: l, children: /* @__PURE__ */ o(C, { children: t == null ? void 0 : t.map((r) => /* @__PURE__ */ o(L, { onAction: () => a(r), children: r }, r)) }) })
55
28
  ] });
56
29
  });
57
30
  export {
58
- D as Search
31
+ E as Search
59
32
  };
60
33
  //# sourceMappingURL=Search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.js","sources":["../../../../../src/ui/primitives/Search/Search.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconSearch, IconX } from \"icons\";\nimport { IconButton, Input, Label, ListBox, ListBoxItem } from \"primitives\";\nimport React, { useRef, useState } from \"react\";\nimport {\n ComboBox as RACComboBox,\n Popover as RACPopover,\n type InputProps as RACInputProps,\n} from \"react-aria-components\";\nimport \"./search.css\";\n\nexport type SearchProps = Omit<RACInputProps, \"results\"> & {\n results?: string[];\n onSearch?: (search: string) => void;\n};\nexport const Search = React.forwardRef(function Search(\n { className, results, onSearch, ...props }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n const onInputInput = (search: string) => {\n setSearchTerm(search);\n if (onSearch) {\n onSearch(search);\n }\n };\n\n const classNames = clsx(className, \"search-input-container\");\n // Sem container explícito o dropdown faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n\n return (\n <RACComboBox className={classNames}>\n <Label hidden>{props[\"aria-label\"] || \"Search\"}</Label>\n <Input\n type=\"search\"\n className=\"search-input\"\n value={searchTerm}\n onInput={(e) => onInputInput(e.currentTarget.value)}\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n {...props}\n />\n <span className=\"search-icon\">\n {searchTerm ? (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => onInputInput(\"\")}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconX />\n </IconButton>\n ) : (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => inputRef?.current?.focus()}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconSearch />\n </IconButton>\n )}\n </span>\n <RACPopover UNSTABLE_portalContainer={portalContainer}>\n <ListBox>\n {results?.map((a) => (\n <ListBoxItem key={a} onAction={() => onInputInput(a)}>\n {a}\n </ListBoxItem>\n ))}\n </ListBox>\n </RACPopover>\n </RACComboBox>\n );\n});\n"],"names":["Search","React","className","results","onSearch","props","ref","searchTerm","setSearchTerm","useState","inputRef","useRef","onInputInput","search","classNames","clsx","portalContainer","useOverlayPortalContainer","jsxs","RACComboBox","jsx","Label","Input","e","node","IconButton","IconX","_a","IconSearch","RACPopover","ListBox","a","ListBoxItem"],"mappings":";;;;;;;;;;;;AAgBO,MAAMA,IAASC,EAAM,WAAW,SACrC,EAAE,WAAAC,GAAW,SAAAC,GAAS,UAAAC,GAAU,GAAGC,EAAA,GACnCC,GACA;AACA,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAE,GACzCC,IAAWC,EAAgC,IAAI,GAC/CC,IAAe,CAACC,MAAmB;AACvC,IAAAL,EAAcK,CAAM,GAChBT,KACFA,EAASS,CAAM;AAAA,EAEnB,GAEMC,IAAaC,EAAKb,GAAW,wBAAwB,GAGrDc,IAAkBC,EAAA;AAExB,SACE,gBAAAC,EAACC,GAAA,EAAY,WAAWL,GACtB,UAAA;AAAA,IAAA,gBAAAM,EAACC,KAAM,QAAM,IAAE,UAAAhB,EAAM,YAAY,KAAK,UAAS;AAAA,IAC/C,gBAAAe;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAU;AAAA,QACV,OAAOf;AAAA,QACP,SAAS,CAACgB,MAAMX,EAAaW,EAAE,cAAc,KAAK;AAAA,QAClD,KAAK,CAACC,MAAS;AACb,UAAAd,EAAS,UAAUc,GACf,OAAOlB,KAAQ,aACjBA,EAAIkB,CAAI,IACClB,MACTA,EAAI,UAAUkB;AAAA,QAElB;AAAA,QACC,GAAGnB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEN,gBAAAe,EAAC,QAAA,EAAK,WAAU,eACb,UAAAb,IACC,gBAAAa;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAW;AAAA,QACX,SAAS,MAAMb,EAAa,EAAE;AAAA,QAC9B,MAAK;AAAA,QACL,SAAQ;AAAA,QAER,4BAACc,GAAA,CAAA,CAAM;AAAA,MAAA;AAAA,IAAA,IAGT,gBAAAN;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAW;AAAA,QACX,SAAS,MAAA;;AAAM,kBAAAE,IAAAjB,KAAA,gBAAAA,EAAU,YAAV,gBAAAiB,EAAmB;AAAA;AAAA,QAClC,MAAK;AAAA,QACL,SAAQ;AAAA,QAER,4BAACC,GAAA,CAAA,CAAW;AAAA,MAAA;AAAA,IAAA,GAGlB;AAAA,IACA,gBAAAR,EAACS,KAAW,0BAA0Bb,GACpC,4BAACc,GAAA,EACE,UAAA3B,KAAA,gBAAAA,EAAS,IAAI,CAAC4B,wBACZC,GAAA,EAAoB,UAAU,MAAMpB,EAAamB,CAAC,GAChD,UAAAA,EAAA,GADeA,CAElB,GACD,CACH,EAAA,CACF;AAAA,EAAA,GACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Search.js","sources":["../../../../../src/ui/primitives/Search/Search.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { Input, Label, ListBox, ListBoxItem } from \"primitives\";\nimport React, { useState } from \"react\";\nimport {\n ComboBox as RACComboBox,\n Popover as RACPopover,\n type InputProps as RACInputProps,\n} from \"react-aria-components\";\nimport \"./search.css\";\n\nexport type SearchProps = Omit<RACInputProps, \"results\"> & {\n results?: string[];\n onSearch?: (search: string) => void;\n};\n\nexport const Search = React.forwardRef(function Search(\n { className, results, onSearch, ...props }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n\n const onInputInput = (search: string) => {\n setSearchTerm(search);\n if (onSearch) {\n onSearch(search);\n }\n };\n\n const classNames = clsx(className, \"search-input-container\");\n // Sem container explícito o dropdown faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n\n return (\n <RACComboBox className={classNames}>\n <Label hidden>{props[\"aria-label\"] || \"Search\"}</Label>\n <Input\n type=\"search\"\n className=\"search-input\"\n value={searchTerm}\n onInput={(e) => onInputInput(e.currentTarget.value)}\n ref={ref}\n {...props}\n />\n <RACPopover UNSTABLE_portalContainer={portalContainer}>\n <ListBox>\n {results?.map((a) => (\n <ListBoxItem key={a} onAction={() => onInputInput(a)}>\n {a}\n </ListBoxItem>\n ))}\n </ListBox>\n </RACPopover>\n </RACComboBox>\n );\n});\n"],"names":["Search","React","className","results","onSearch","props","ref","searchTerm","setSearchTerm","useState","onInputInput","search","classNames","clsx","portalContainer","useOverlayPortalContainer","jsxs","RACComboBox","jsx","Label","Input","e","RACPopover","ListBox","a","ListBoxItem"],"mappings":";;;;;;;;;AAgBO,MAAMA,IAASC,EAAM,WAAW,SACrC,EAAE,WAAAC,GAAW,SAAAC,GAAS,UAAAC,GAAU,GAAGC,EAAA,GACnCC,GACA;AACA,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAE,GAEzCC,IAAe,CAACC,MAAmB;AACvC,IAAAH,EAAcG,CAAM,GAChBP,KACFA,EAASO,CAAM;AAAA,EAEnB,GAEMC,IAAaC,EAAKX,GAAW,wBAAwB,GAGrDY,IAAkBC,EAAA;AAExB,SACE,gBAAAC,EAACC,GAAA,EAAY,WAAWL,GACtB,UAAA;AAAA,IAAA,gBAAAM,EAACC,KAAM,QAAM,IAAE,UAAAd,EAAM,YAAY,KAAK,UAAS;AAAA,IAC/C,gBAAAa;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAU;AAAA,QACV,OAAOb;AAAA,QACP,SAAS,CAACc,MAAMX,EAAaW,EAAE,cAAc,KAAK;AAAA,QAClD,KAAAf;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,IAEN,gBAAAa,EAACI,KAAW,0BAA0BR,GACpC,4BAACS,GAAA,EACE,UAAApB,KAAA,gBAAAA,EAAS,IAAI,CAACqB,wBACZC,GAAA,EAAoB,UAAU,MAAMf,EAAac,CAAC,GAChD,UAAAA,EAAA,GADeA,CAElB,GACD,CACH,EAAA,CACF;AAAA,EAAA,GACF;AAEJ,CAAC;"}
@@ -1,10 +1,10 @@
1
+ import type { JsonEditorSize } from "./json-code-mirror";
1
2
  import "./jsonviewer.css";
2
- export interface JsonEditorProps {
3
+ export interface JsonEditorProps extends JsonEditorSize {
3
4
  value: string;
4
5
  onChange?: (value: string) => void;
5
6
  expandAllLabel: string;
6
7
  className?: string;
7
- height?: string | number;
8
8
  isDisabled?: boolean;
9
9
  isReadOnly?: boolean;
10
10
  "aria-label"?: string;
@@ -15,4 +15,4 @@ export interface JsonEditorProps {
15
15
  * `JsonViewer` stays read-only-only on purpose so its bundle keeps assuming
16
16
  * a static document; this component owns the editable/controlled behavior.
17
17
  */
18
- export declare function JsonEditor({ value, onChange, expandAllLabel, className, height, isDisabled, isReadOnly, "aria-label": ariaLabel, }: JsonEditorProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function JsonEditor({ value, onChange, expandAllLabel, className, height, minHeight, maxHeight, isDisabled, isReadOnly, "aria-label": ariaLabel, }: JsonEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import type { JsonEditorSize } from "./json-code-mirror";
2
3
  import "./jsonviewer.css";
3
4
  export interface JsonViewerAction {
4
5
  key: string;
@@ -6,11 +7,10 @@ export interface JsonViewerAction {
6
7
  icon: ReactNode;
7
8
  onPress: () => void;
8
9
  }
9
- export interface JsonViewerProps {
10
+ export interface JsonViewerProps extends JsonEditorSize {
10
11
  value: unknown;
11
12
  expandAllLabel: string;
12
13
  actions?: JsonViewerAction[];
13
14
  className?: string;
14
- height?: string | number;
15
15
  }
16
- export declare function JsonViewer({ value, expandAllLabel, actions, className, height }: JsonViewerProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function JsonViewer({ value, expandAllLabel, actions, className, height, minHeight, maxHeight, }: JsonViewerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,16 @@
1
+ import type { CSSProperties } from "react";
1
2
  import { HighlightStyle } from "@codemirror/language";
2
3
  export declare const jsonHighlightStyle: HighlightStyle;
3
4
  export declare const jsonEditorTheme: import("@codemirror/state").Extension;
4
5
  export declare const jsonEditorExtensions: import("@codemirror/state").Extension[];
5
6
  export declare function serializeJson(value: unknown): string;
6
7
  export declare function toCssSize(size: string | number): string;
8
+ export interface JsonEditorSize {
9
+ height?: string | number;
10
+ minHeight?: string | number;
11
+ maxHeight?: string | number;
12
+ }
13
+ export declare function toEditorSizeStyle({ height, minHeight, maxHeight }: JsonEditorSize): CSSProperties;
7
14
  /**
8
15
  * Finds the fold range of every direct child (depth 1) of the root object/array
9
16
  * by scanning the text itself for matching brackets. This mirrors what
@@ -6,5 +6,8 @@ export type NavigationPillListProps<T> = RACTabListProps<T>;
6
6
  export declare function NavigationPillList<T extends object>({ className, ...props }: NavigationPillListProps<T>): import("react/jsx-runtime").JSX.Element;
7
7
  export type NavigationPillPanelProps = RACTabPanelProps;
8
8
  export declare function NavigationPillPanel({ className, ...props }: NavigationPillPanelProps): import("react/jsx-runtime").JSX.Element;
9
- export type NavigationPillsProps = RACTabsProps;
10
- export declare function NavigationPills({ className, ...props }: NavigationPillsProps): import("react/jsx-runtime").JSX.Element;
9
+ export type NavigationPillShape = "pill" | "rounded";
10
+ export type NavigationPillsProps = RACTabsProps & {
11
+ shape?: NavigationPillShape;
12
+ };
13
+ export declare function NavigationPills({ className, shape, ...props }: NavigationPillsProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/design-system",
3
- "version": "5.5.0",
3
+ "version": "5.8.0",
4
4
  "type": "module",
5
5
  "description": "APIPass React Design System",
6
6
  "sideEffects": [