@apipass/design-system 7.1.0 → 7.3.1

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 (40) hide show
  1. package/dist/lib/embedded-styles.js +2 -2
  2. package/dist/lib/style.css +1 -1
  3. package/dist/lib/ui/components/DataTable/DataTable.cjs +1 -1
  4. package/dist/lib/ui/components/DataTable/DataTable.cjs.map +1 -1
  5. package/dist/lib/ui/components/DataTable/DataTable.js +70 -69
  6. package/dist/lib/ui/components/DataTable/DataTable.js.map +1 -1
  7. package/dist/lib/ui/components/FormModal/FormModal.cjs +1 -1
  8. package/dist/lib/ui/components/FormModal/FormModal.cjs.map +1 -1
  9. package/dist/lib/ui/components/FormModal/FormModal.js +14 -15
  10. package/dist/lib/ui/components/FormModal/FormModal.js.map +1 -1
  11. package/dist/lib/ui/components/charts/TopList/TopList.cjs +1 -1
  12. package/dist/lib/ui/components/charts/TopList/TopList.cjs.map +1 -1
  13. package/dist/lib/ui/components/charts/TopList/TopList.js +49 -45
  14. package/dist/lib/ui/components/charts/TopList/TopList.js.map +1 -1
  15. package/dist/lib/ui/components/charts/TopList/top-list-option.cjs +1 -1
  16. package/dist/lib/ui/components/charts/TopList/top-list-option.cjs.map +1 -1
  17. package/dist/lib/ui/components/charts/TopList/top-list-option.js +148 -106
  18. package/dist/lib/ui/components/charts/TopList/top-list-option.js.map +1 -1
  19. package/dist/lib/ui/components/charts/chart-theme.cjs +1 -1
  20. package/dist/lib/ui/components/charts/chart-theme.cjs.map +1 -1
  21. package/dist/lib/ui/components/charts/chart-theme.js +6 -4
  22. package/dist/lib/ui/components/charts/chart-theme.js.map +1 -1
  23. package/dist/lib/ui/primitives/Dialog/Dialog.cjs +1 -1
  24. package/dist/lib/ui/primitives/Dialog/Dialog.cjs.map +1 -1
  25. package/dist/lib/ui/primitives/Dialog/Dialog.js +26 -16
  26. package/dist/lib/ui/primitives/Dialog/Dialog.js.map +1 -1
  27. package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.cjs +1 -1
  28. package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.cjs.map +1 -1
  29. package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.js +23 -23
  30. package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.js.map +1 -1
  31. package/dist/lib/ui/primitives/Switch/Switch.cjs +1 -1
  32. package/dist/lib/ui/primitives/Switch/Switch.cjs.map +1 -1
  33. package/dist/lib/ui/primitives/Switch/Switch.js +25 -20
  34. package/dist/lib/ui/primitives/Switch/Switch.js.map +1 -1
  35. package/dist/types/ui/components/FormModal/FormModal.d.ts +2 -1
  36. package/dist/types/ui/components/charts/TopList/top-list-option.d.ts +1 -0
  37. package/dist/types/ui/components/charts/chart-theme.d.ts +2 -0
  38. package/dist/types/ui/primitives/Dialog/Dialog.d.ts +3 -1
  39. package/dist/types/ui/primitives/Switch/Switch.d.ts +5 -2
  40. package/package.json +1 -1
@@ -1,17 +1,27 @@
1
1
  import { jsx as a, jsxs as m } from "react/jsx-runtime";
2
- import { clsx as s } from "../../../vendor/clsx/dist/clsx.js";
3
- import { Dialog as g, DialogTrigger as d, ModalOverlay as u, Modal as p } from "react-aria-components";
2
+ import { clsx as t } from "../../../vendor/clsx/dist/clsx.js";
3
+ import { Dialog as d, DialogTrigger as g, ModalOverlay as u, Modal as p } from "react-aria-components";
4
4
  /* empty css */
5
5
  import { IconX as f } from "../../icons/IconX.js";
6
6
  import { TextHeading as D, Text as N } from "../Text/Text.js";
7
7
  import { IconButton as e } from "../IconButton/IconButton.js";
8
8
  import { Button as b } from "../Button/Button.js";
9
9
  import { useOverlayPortalContainer as T } from "../../hooks/useOverlayPortal.js";
10
- function h({ className: o, type: i = "card", ...l }) {
11
- const r = s(o, "dialog", `dialog-type-${i}`);
12
- return /* @__PURE__ */ a(g, { className: r, ...l });
10
+ function h({
11
+ className: o,
12
+ type: i = "card",
13
+ size: l = "medium",
14
+ ...r
15
+ }) {
16
+ const s = t(
17
+ o,
18
+ "dialog",
19
+ `dialog-type-${i}`,
20
+ `dialog-size-${l}`
21
+ );
22
+ return /* @__PURE__ */ a(d, { className: s, ...r });
13
23
  }
14
- const z = ({ onPress: o }) => /* @__PURE__ */ a(
24
+ const k = ({ onPress: o }) => /* @__PURE__ */ a(
15
25
  e,
16
26
  {
17
27
  className: "dialog-close",
@@ -23,33 +33,33 @@ const z = ({ onPress: o }) => /* @__PURE__ */ a(
23
33
  }
24
34
  );
25
35
  function x({ ...o }) {
26
- return /* @__PURE__ */ a(d, { ...o });
36
+ return /* @__PURE__ */ a(g, { ...o });
27
37
  }
28
38
  function A({
29
39
  label: o,
30
40
  icon: i,
31
41
  variant: l,
32
42
  children: r,
33
- ...t
43
+ ...s
34
44
  }) {
35
45
  return /* @__PURE__ */ m(x, { children: [
36
46
  i ? /* @__PURE__ */ a(e, { variant: l, "aria-label": o, children: i }) : /* @__PURE__ */ a(b, { variant: l, children: o }),
37
- /* @__PURE__ */ a(y, { isDismissable: !0, children: /* @__PURE__ */ a(h, { ...t, children: r }) })
47
+ /* @__PURE__ */ a(y, { isDismissable: !0, children: /* @__PURE__ */ a(h, { ...s, children: r }) })
38
48
  ] });
39
49
  }
40
50
  function E({ className: o, ...i }) {
41
- const l = s(o, "dialog-title");
51
+ const l = t(o, "dialog-title");
42
52
  return /* @__PURE__ */ a(D, { ...i, slot: "title", className: l });
43
53
  }
44
54
  function H({
45
55
  className: o,
46
56
  ...i
47
57
  }) {
48
- const l = s(o, "dialog-description");
58
+ const l = t(o, "dialog-description");
49
59
  return /* @__PURE__ */ a(N, { ...i, className: l });
50
60
  }
51
61
  function L({ bleed: o, className: i, ...l }) {
52
- const r = s(
62
+ const r = t(
53
63
  i,
54
64
  "dialog-body",
55
65
  o && "dialog-body-bleed"
@@ -61,15 +71,15 @@ function y({
61
71
  className: i,
62
72
  isDismissable: l,
63
73
  UNSTABLE_portalContainer: r,
64
- ...t
74
+ ...s
65
75
  }) {
66
- const n = s(i, "dialog-backdrop"), c = T();
76
+ const n = t(i, "dialog-backdrop"), c = T();
67
77
  return /* @__PURE__ */ a(
68
78
  u,
69
79
  {
70
80
  className: n,
71
81
  isDismissable: l,
72
- ...t,
82
+ ...s,
73
83
  UNSTABLE_portalContainer: r ?? c,
74
84
  children: /* @__PURE__ */ a(p, { className: "dialog-container", children: o })
75
85
  }
@@ -79,7 +89,7 @@ export {
79
89
  h as Dialog,
80
90
  L as DialogBody,
81
91
  A as DialogButton,
82
- z as DialogClose,
92
+ k as DialogClose,
83
93
  H as DialogDescription,
84
94
  y as DialogModal,
85
95
  E as DialogTitle,
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sources":["../../../../../src/ui/primitives/Dialog/Dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconX } from \"icons\";\nimport {\n Button,\n ButtonProps,\n IconButton,\n IconButtonProps,\n Text,\n TextHeading,\n type TextHeadingProps,\n type TextProps,\n} from \"primitives\";\nimport {\n Dialog as RACDialog,\n DialogTrigger as RACDialogTrigger,\n Modal as RACModal,\n ModalOverlay as RACModalOverlay,\n type DialogProps as RACDialogProps,\n type DialogTriggerProps as RACDialogTriggerProps,\n type ModalOverlayProps as RACModalOverlayProps,\n} from \"react-aria-components\";\nimport \"./dialog.css\";\n\nexport type DialogProps = RACDialogProps & {\n type?: \"sheet\" | \"card\";\n};\nexport function Dialog({ className, type = \"card\", ...props }: DialogProps) {\n const classNames = clsx(className, \"dialog\", `dialog-type-${type}`);\n return <RACDialog className={classNames} {...props} />;\n}\n\nexport type DialogCloseProps = Pick<IconButtonProps, \"onPress\">;\nexport const DialogClose = ({ onPress }: DialogCloseProps) => (\n <IconButton\n className=\"dialog-close\"\n aria-label=\"Dismiss dialog\"\n onPress={onPress}\n variant=\"subtle\"\n size=\"small\"\n >\n <IconX />\n </IconButton>\n);\n\nexport type DialogTriggerProps = RACDialogTriggerProps;\nexport function DialogTrigger({ ...props }: DialogTriggerProps) {\n return <RACDialogTrigger {...props} />;\n}\n\nexport interface DialogButtonProps\n extends DialogProps,\n Omit<DialogTriggerProps, \"children\"> {\n label: string;\n variant?: ButtonProps[\"variant\"];\n icon?: React.ReactNode;\n}\nexport function DialogButton({\n label,\n icon,\n variant,\n children,\n ...props\n}: DialogButtonProps) {\n return (\n <DialogTrigger>\n {icon ? (\n <IconButton variant={variant} aria-label={label}>\n {icon}\n </IconButton>\n ) : (\n <Button variant={variant}>{label}</Button>\n )}\n <DialogModal isDismissable>\n <Dialog {...props}>{children}</Dialog>\n </DialogModal>\n </DialogTrigger>\n );\n}\n\nexport type DialogTitleProps = TextHeadingProps;\nexport function DialogTitle({ className, ...props }: DialogTitleProps) {\n const classNames = clsx(className, \"dialog-title\");\n return <TextHeading {...props} slot=\"title\" className={classNames} />;\n}\n\nexport type DialogDescriptionProps = TextProps;\nexport function DialogDescription({\n className,\n ...props\n}: DialogDescriptionProps) {\n const classNames = clsx(className, \"dialog-description\");\n return <Text {...props} className={classNames} />;\n}\n\nexport type DialogBodyProps = {\n bleed?: boolean;\n} & React.ComponentPropsWithoutRef<\"div\">;\nexport function DialogBody({ bleed, className, ...props }: DialogBodyProps) {\n const classNames = clsx(\n className,\n \"dialog-body\",\n bleed && \"dialog-body-bleed\",\n );\n return <div {...props} className={classNames} />;\n}\n\nexport type DialogModalProps = RACModalOverlayProps;\nexport function DialogModal({\n children,\n className,\n isDismissable,\n UNSTABLE_portalContainer,\n ...props\n}: DialogModalProps) {\n const classNames = clsx(className, \"dialog-backdrop\");\n // Sem um container explícito, o RAC faz portal no document.body — fora da\n // shadow root do MFE, onde o CSS do DS não alcança, e o dialog abre sem\n // estilo. Ver OverlayPortalProvider em ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n return (\n <RACModalOverlay\n className={classNames}\n isDismissable={isDismissable}\n {...props}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer ?? portalContainer}\n >\n <RACModal className={\"dialog-container\"}>{children}</RACModal>\n </RACModalOverlay>\n );\n}\n"],"names":["Dialog","className","type","props","classNames","clsx","jsx","RACDialog","DialogClose","onPress","IconButton","IconX","DialogTrigger","RACDialogTrigger","DialogButton","label","icon","variant","children","Button","DialogModal","DialogTitle","TextHeading","DialogDescription","Text","DialogBody","bleed","isDismissable","UNSTABLE_portalContainer","portalContainer","useOverlayPortalContainer","RACModalOverlay","RACModal"],"mappings":";;;;;;;;;AA2BO,SAASA,EAAO,EAAE,WAAAC,GAAW,MAAAC,IAAO,QAAQ,GAAGC,KAAsB;AAC1E,QAAMC,IAAaC,EAAKJ,GAAW,UAAU,eAAeC,CAAI,EAAE;AAClE,SAAO,gBAAAI,EAACC,GAAA,EAAU,WAAWH,GAAa,GAAGD,GAAO;AACtD;AAGO,MAAMK,IAAc,CAAC,EAAE,SAAAC,EAAA,MAC5B,gBAAAH;AAAA,EAACI;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,cAAW;AAAA,IACX,SAAAD;AAAA,IACA,SAAQ;AAAA,IACR,MAAK;AAAA,IAEL,4BAACE,GAAA,CAAA,CAAM;AAAA,EAAA;AACT;AAIK,SAASC,EAAc,EAAE,GAAGT,KAA6B;AAC9D,SAAO,gBAAAG,EAACO,GAAA,EAAkB,GAAGV,EAAA,CAAO;AACtC;AASO,SAASW,EAAa;AAAA,EAC3B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGf;AACL,GAAsB;AACpB,2BACGS,GAAA,EACE,UAAA;AAAA,IAAAI,IACC,gBAAAV,EAACI,GAAA,EAAW,SAAAO,GAAkB,cAAYF,GACvC,aACH,IAEA,gBAAAT,EAACa,GAAA,EAAO,SAAAF,GAAmB,UAAAF,GAAM;AAAA,IAEnC,gBAAAT,EAACc,KAAY,eAAa,IACxB,4BAACpB,GAAA,EAAQ,GAAGG,GAAQ,UAAAe,EAAA,CAAS,EAAA,CAC/B;AAAA,EAAA,GACF;AAEJ;AAGO,SAASG,EAAY,EAAE,WAAApB,GAAW,GAAGE,KAA2B;AACrE,QAAMC,IAAaC,EAAKJ,GAAW,cAAc;AACjD,2BAAQqB,GAAA,EAAa,GAAGnB,GAAO,MAAK,SAAQ,WAAWC,GAAY;AACrE;AAGO,SAASmB,EAAkB;AAAA,EAChC,WAAAtB;AAAA,EACA,GAAGE;AACL,GAA2B;AACzB,QAAMC,IAAaC,EAAKJ,GAAW,oBAAoB;AACvD,SAAO,gBAAAK,EAACkB,GAAA,EAAM,GAAGrB,GAAO,WAAWC,GAAY;AACjD;AAKO,SAASqB,EAAW,EAAE,OAAAC,GAAO,WAAAzB,GAAW,GAAGE,KAA0B;AAC1E,QAAMC,IAAaC;AAAA,IACjBJ;AAAA,IACA;AAAA,IACAyB,KAAS;AAAA,EAAA;AAEX,SAAO,gBAAApB,EAAC,OAAA,EAAK,GAAGH,GAAO,WAAWC,GAAY;AAChD;AAGO,SAASgB,EAAY;AAAA,EAC1B,UAAAF;AAAA,EACA,WAAAjB;AAAA,EACA,eAAA0B;AAAA,EACA,0BAAAC;AAAA,EACA,GAAGzB;AACL,GAAqB;AACnB,QAAMC,IAAaC,EAAKJ,GAAW,iBAAiB,GAI9C4B,IAAkBC,EAAA;AACxB,SACE,gBAAAxB;AAAA,IAACyB;AAAAA,IAAA;AAAA,MACC,WAAW3B;AAAA,MACX,eAAAuB;AAAA,MACC,GAAGxB;AAAA,MACJ,0BAA0ByB,KAA4BC;AAAA,MAEtD,UAAA,gBAAAvB,EAAC0B,GAAA,EAAS,WAAW,oBAAqB,UAAAd,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGzD;"}
1
+ {"version":3,"file":"Dialog.js","sources":["../../../../../src/ui/primitives/Dialog/Dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconX } from \"icons\";\nimport {\n Button,\n ButtonProps,\n IconButton,\n IconButtonProps,\n Text,\n TextHeading,\n type TextHeadingProps,\n type TextProps,\n} from \"primitives\";\nimport {\n Dialog as RACDialog,\n DialogTrigger as RACDialogTrigger,\n Modal as RACModal,\n ModalOverlay as RACModalOverlay,\n type DialogProps as RACDialogProps,\n type DialogTriggerProps as RACDialogTriggerProps,\n type ModalOverlayProps as RACModalOverlayProps,\n} from \"react-aria-components\";\nimport \"./dialog.css\";\n\nexport type DialogSize = \"medium\" | \"large\" | \"xlarge\";\n\nexport type DialogProps = RACDialogProps & {\n type?: \"sheet\" | \"card\";\n size?: DialogSize;\n};\nexport function Dialog({\n className,\n type = \"card\",\n size = \"medium\",\n ...props\n}: DialogProps) {\n const classNames = clsx(\n className,\n \"dialog\",\n `dialog-type-${type}`,\n `dialog-size-${size}`,\n );\n return <RACDialog className={classNames} {...props} />;\n}\n\nexport type DialogCloseProps = Pick<IconButtonProps, \"onPress\">;\nexport const DialogClose = ({ onPress }: DialogCloseProps) => (\n <IconButton\n className=\"dialog-close\"\n aria-label=\"Dismiss dialog\"\n onPress={onPress}\n variant=\"subtle\"\n size=\"small\"\n >\n <IconX />\n </IconButton>\n);\n\nexport type DialogTriggerProps = RACDialogTriggerProps;\nexport function DialogTrigger({ ...props }: DialogTriggerProps) {\n return <RACDialogTrigger {...props} />;\n}\n\nexport interface DialogButtonProps\n extends DialogProps,\n Omit<DialogTriggerProps, \"children\"> {\n label: string;\n variant?: ButtonProps[\"variant\"];\n icon?: React.ReactNode;\n}\nexport function DialogButton({\n label,\n icon,\n variant,\n children,\n ...props\n}: DialogButtonProps) {\n return (\n <DialogTrigger>\n {icon ? (\n <IconButton variant={variant} aria-label={label}>\n {icon}\n </IconButton>\n ) : (\n <Button variant={variant}>{label}</Button>\n )}\n <DialogModal isDismissable>\n <Dialog {...props}>{children}</Dialog>\n </DialogModal>\n </DialogTrigger>\n );\n}\n\nexport type DialogTitleProps = TextHeadingProps;\nexport function DialogTitle({ className, ...props }: DialogTitleProps) {\n const classNames = clsx(className, \"dialog-title\");\n return <TextHeading {...props} slot=\"title\" className={classNames} />;\n}\n\nexport type DialogDescriptionProps = TextProps;\nexport function DialogDescription({\n className,\n ...props\n}: DialogDescriptionProps) {\n const classNames = clsx(className, \"dialog-description\");\n return <Text {...props} className={classNames} />;\n}\n\nexport type DialogBodyProps = {\n bleed?: boolean;\n} & React.ComponentPropsWithoutRef<\"div\">;\nexport function DialogBody({ bleed, className, ...props }: DialogBodyProps) {\n const classNames = clsx(\n className,\n \"dialog-body\",\n bleed && \"dialog-body-bleed\",\n );\n return <div {...props} className={classNames} />;\n}\n\nexport type DialogModalProps = RACModalOverlayProps;\nexport function DialogModal({\n children,\n className,\n isDismissable,\n UNSTABLE_portalContainer,\n ...props\n}: DialogModalProps) {\n const classNames = clsx(className, \"dialog-backdrop\");\n // Sem um container explícito, o RAC faz portal no document.body — fora da\n // shadow root do MFE, onde o CSS do DS não alcança, e o dialog abre sem\n // estilo. Ver OverlayPortalProvider em ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n return (\n <RACModalOverlay\n className={classNames}\n isDismissable={isDismissable}\n {...props}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer ?? portalContainer}\n >\n <RACModal className={\"dialog-container\"}>{children}</RACModal>\n </RACModalOverlay>\n );\n}\n"],"names":["Dialog","className","type","size","props","classNames","clsx","jsx","RACDialog","DialogClose","onPress","IconButton","IconX","DialogTrigger","RACDialogTrigger","DialogButton","label","icon","variant","children","Button","DialogModal","DialogTitle","TextHeading","DialogDescription","Text","DialogBody","bleed","isDismissable","UNSTABLE_portalContainer","portalContainer","useOverlayPortalContainer","RACModalOverlay","RACModal"],"mappings":";;;;;;;;;AA8BO,SAASA,EAAO;AAAA,EACrB,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GAAgB;AACd,QAAMC,IAAaC;AAAA,IACjBL;AAAA,IACA;AAAA,IACA,eAAeC,CAAI;AAAA,IACnB,eAAeC,CAAI;AAAA,EAAA;AAErB,SAAO,gBAAAI,EAACC,GAAA,EAAU,WAAWH,GAAa,GAAGD,GAAO;AACtD;AAGO,MAAMK,IAAc,CAAC,EAAE,SAAAC,EAAA,MAC5B,gBAAAH;AAAA,EAACI;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,cAAW;AAAA,IACX,SAAAD;AAAA,IACA,SAAQ;AAAA,IACR,MAAK;AAAA,IAEL,4BAACE,GAAA,CAAA,CAAM;AAAA,EAAA;AACT;AAIK,SAASC,EAAc,EAAE,GAAGT,KAA6B;AAC9D,SAAO,gBAAAG,EAACO,GAAA,EAAkB,GAAGV,EAAA,CAAO;AACtC;AASO,SAASW,EAAa;AAAA,EAC3B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGf;AACL,GAAsB;AACpB,2BACGS,GAAA,EACE,UAAA;AAAA,IAAAI,IACC,gBAAAV,EAACI,GAAA,EAAW,SAAAO,GAAkB,cAAYF,GACvC,aACH,IAEA,gBAAAT,EAACa,GAAA,EAAO,SAAAF,GAAmB,UAAAF,GAAM;AAAA,IAEnC,gBAAAT,EAACc,KAAY,eAAa,IACxB,4BAACrB,GAAA,EAAQ,GAAGI,GAAQ,UAAAe,EAAA,CAAS,EAAA,CAC/B;AAAA,EAAA,GACF;AAEJ;AAGO,SAASG,EAAY,EAAE,WAAArB,GAAW,GAAGG,KAA2B;AACrE,QAAMC,IAAaC,EAAKL,GAAW,cAAc;AACjD,2BAAQsB,GAAA,EAAa,GAAGnB,GAAO,MAAK,SAAQ,WAAWC,GAAY;AACrE;AAGO,SAASmB,EAAkB;AAAA,EAChC,WAAAvB;AAAA,EACA,GAAGG;AACL,GAA2B;AACzB,QAAMC,IAAaC,EAAKL,GAAW,oBAAoB;AACvD,SAAO,gBAAAM,EAACkB,GAAA,EAAM,GAAGrB,GAAO,WAAWC,GAAY;AACjD;AAKO,SAASqB,EAAW,EAAE,OAAAC,GAAO,WAAA1B,GAAW,GAAGG,KAA0B;AAC1E,QAAMC,IAAaC;AAAA,IACjBL;AAAA,IACA;AAAA,IACA0B,KAAS;AAAA,EAAA;AAEX,SAAO,gBAAApB,EAAC,OAAA,EAAK,GAAGH,GAAO,WAAWC,GAAY;AAChD;AAGO,SAASgB,EAAY;AAAA,EAC1B,UAAAF;AAAA,EACA,WAAAlB;AAAA,EACA,eAAA2B;AAAA,EACA,0BAAAC;AAAA,EACA,GAAGzB;AACL,GAAqB;AACnB,QAAMC,IAAaC,EAAKL,GAAW,iBAAiB,GAI9C6B,IAAkBC,EAAA;AACxB,SACE,gBAAAxB;AAAA,IAACyB;AAAAA,IAAA;AAAA,MACC,WAAW3B;AAAA,MACX,eAAAuB;AAAA,MACC,GAAGxB;AAAA,MACJ,0BAA0ByB,KAA4BC;AAAA,MAEtD,UAAA,gBAAAvB,EAAC0B,GAAA,EAAS,WAAW,oBAAqB,UAAAd,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGzD;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@codemirror/view"),d=require("@codemirror/lang-json"),g=require("@codemirror/language"),t=require("@lezer/highlight"),u=g.HighlightStyle.define([{tag:t.tags.propertyName,color:"var(--json-viewer-color-key)"},{tag:t.tags.string,color:"var(--json-viewer-color-string)",fontWeight:600},{tag:[t.tags.number,t.tags.bool,t.tags.null],color:"var(--json-viewer-color-scalar)"},{tag:[t.tags.separator,t.tags.squareBracket,t.tags.brace],color:"var(--json-viewer-color-punctuation)"}]),p=f.EditorView.theme({"&":{backgroundColor:"transparent",color:"var(--json-viewer-color-punctuation)",fontSize:"13px"},"&.cm-focused":{outline:"none"},".cm-content":{fontFamily:"var(--sds-typography-family-mono)",padding:"8px 124px 12px 4px"},".cm-gutters":{backgroundColor:"transparent",border:"none",color:"var(--json-viewer-color-caret)",paddingLeft:"5px"},".cm-scroller":{overflow:"auto"}}),h=[d.json(),g.foldGutter(),g.syntaxHighlighting(u)];function v(e){try{return JSON.stringify(e,null,2)??"null"}catch{return String(e)}}function a(e){return typeof e=="number"?`${e}px`:e}function j({height:e,minHeight:r,maxHeight:i}){const o={};return e!==void 0&&(o["--json-viewer-height"]=a(e)),r!==void 0&&(o["--json-viewer-min-height"]=a(r)),i!==void 0&&(o["--json-viewer-max-height"]=a(i)),o}function m(e){const r=[],i=e.length;let o=0;for(;o<i&&e[o]!=="{"&&e[o]!=="[";)o++;if(o>=i)return r;let s=0,c=!1,l=-1;for(;o<i;o++){const n=e[o];if(c){n==="\\"?o++:n==='"'&&(c=!1);continue}if(n==='"'){c=!0;continue}if(n==="{"||n==="["){s++,s===2&&(l=o+1);continue}(n==="}"||n==="]")&&(s===2&&l!==-1&&(r.push({from:l,to:o}),l=-1),s--)}return r}exports.computeFirstLevelFoldRanges=m;exports.jsonEditorExtensions=h;exports.jsonEditorTheme=p;exports.jsonHighlightStyle=u;exports.serializeJson=v;exports.toCssSize=a;exports.toEditorSizeStyle=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@codemirror/view"),d=require("@codemirror/lang-json"),g=require("@codemirror/language"),t=require("@lezer/highlight"),u=g.HighlightStyle.define([{tag:t.tags.propertyName,color:"var(--json-viewer-color-key)"},{tag:t.tags.string,color:"var(--json-viewer-color-string)",fontWeight:600},{tag:[t.tags.number,t.tags.bool,t.tags.null],color:"var(--json-viewer-color-scalar)"},{tag:[t.tags.separator,t.tags.squareBracket,t.tags.brace],color:"var(--json-viewer-color-punctuation)"}]),p=f.EditorView.theme({"&":{backgroundColor:"transparent",color:"var(--json-viewer-color-punctuation)",fontSize:"13px"},"&.cm-focused":{outline:"none"},".cm-content":{fontFamily:"var(--sds-typography-family-mono)",padding:"8px 124px 12px 4px"},".cm-gutters":{backgroundColor:"transparent",border:"none",color:"var(--json-viewer-color-caret)",paddingLeft:"5px"},".cm-scroller":{overflow:"auto"}}),h=[d.json(),g.foldGutter(),g.syntaxHighlighting(u)];function v(e){try{return JSON.stringify(e,null,2)??"null"}catch{return String(e)}}function a(e){return typeof e=="number"?`${e}px`:e}function m({height:e,minHeight:r,maxHeight:i}){const o={};return e!==void 0&&(o["--json-viewer-height"]=a(e)),r!==void 0&&(o["--json-viewer-min-height"]=a(r)),i!==void 0&&(o["--json-viewer-max-height"]=a(i)),o}function y(e){const r=[],i=e.length;let o=0;for(;o<i&&e[o]!=="{"&&e[o]!=="[";)o++;if(o>=i)return r;let l=0,c=!1,s=-1;for(;o<i;o++){const n=e[o];if(c){n==="\\"?o++:n==='"'&&(c=!1);continue}if(n==='"'){c=!0;continue}if(n==="{"||n==="["){l++,l===2&&(s=o+1);continue}(n==="}"||n==="]")&&(l===2&&s!==-1&&(o===s||r.push({from:s,to:o}),s=-1),l--)}return r}exports.computeFirstLevelFoldRanges=y;exports.jsonEditorExtensions=h;exports.jsonEditorTheme=p;exports.jsonHighlightStyle=u;exports.serializeJson=v;exports.toCssSize=a;exports.toEditorSizeStyle=m;
2
2
  //# sourceMappingURL=json-code-mirror.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"json-code-mirror.cjs","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":"uNAMaA,EAAqBC,EAAAA,eAAe,OAAO,CACtD,CAAE,IAAKC,EAAAA,KAAE,aAAc,MAAO,8BAAA,EAC9B,CAAE,IAAKA,EAAAA,KAAE,OAAQ,MAAO,kCAAmC,WAAY,GAAA,EACvE,CAAE,IAAK,CAACA,OAAE,OAAQA,EAAAA,KAAE,KAAMA,EAAAA,KAAE,IAAI,EAAG,MAAO,iCAAA,EAC1C,CAAE,IAAK,CAACA,EAAAA,KAAE,UAAWA,EAAAA,KAAE,cAAeA,OAAE,KAAK,EAAG,MAAO,sCAAA,CACzD,CAAC,EAEYC,EAAkBC,EAAAA,WAAW,MAAM,CAC9C,IAAK,CAAE,gBAAiB,cAAe,MAAO,uCAAwC,SAAU,MAAA,EAChG,eAAgB,CAAE,QAAS,MAAA,EAC3B,cAAe,CAAE,WAAY,oCAAqC,QAAS,oBAAA,EAC3E,cAAe,CACb,gBAAiB,cACjB,OAAQ,OACR,MAAO,iCACP,YAAa,KAAA,EAEf,eAAgB,CAAE,SAAU,MAAA,CAC9B,CAAC,EAEYC,EAAuB,CAACC,EAAAA,KAAA,EAAQC,EAAAA,aAAcC,EAAAA,mBAAmBR,CAAkB,CAAC,EAE1F,SAASS,EAAcC,EAAwB,CACpD,GAAI,CACF,OAAO,KAAK,UAAUA,EAAO,KAAM,CAAC,GAAK,MAC3C,MAAQ,CACN,OAAO,OAAOA,CAAK,CACrB,CACF,CAEO,SAASC,EAAUC,EAA+B,CACvD,OAAO,OAAOA,GAAS,SAAW,GAAGA,CAAI,KAAOA,CAClD,CAQO,SAASC,EAAkB,CAAE,OAAAC,EAAQ,UAAAC,EAAW,UAAAC,GAA4C,CACjG,MAAMC,EAAwC,CAAA,EAC9C,OAAIH,IAAW,SAAWG,EAAc,sBAAsB,EAAIN,EAAUG,CAAM,GAC9EC,IAAc,SAAWE,EAAc,0BAA0B,EAAIN,EAAUI,CAAS,GACxFC,IAAc,SAAWC,EAAc,0BAA0B,EAAIN,EAAUK,CAAS,GACrFC,CACT,CASO,SAASC,EAA4BC,EAA8C,CACxF,MAAMC,EAAyC,CAAA,EACzCC,EAAIF,EAAK,OACf,IAAIG,EAAI,EACR,KAAOA,EAAID,GAAKF,EAAKG,CAAC,IAAM,KAAOH,EAAKG,CAAC,IAAM,KAAKA,IACpD,GAAIA,GAAKD,EAAG,OAAOD,EAEnB,IAAIG,EAAQ,EACRC,EAAW,GACXC,EAAe,GACnB,KAAOH,EAAID,EAAGC,IAAK,CACjB,MAAMI,EAAKP,EAAKG,CAAC,EACjB,GAAIE,EAAU,CACRE,IAAO,KAAMJ,IACRI,IAAO,MAAKF,EAAW,IAChC,QACF,CACA,GAAIE,IAAO,IAAK,CACdF,EAAW,GACX,QACF,CACA,GAAIE,IAAO,KAAOA,IAAO,IAAK,CAC5BH,IACIA,IAAU,IAAGE,EAAeH,EAAI,GACpC,QACF,EACII,IAAO,KAAOA,IAAO,OACnBH,IAAU,GAAKE,IAAiB,KAClCL,EAAO,KAAK,CAAE,KAAMK,EAAc,GAAIH,EAAG,EACzCG,EAAe,IAEjBF,IAEJ,CACA,OAAOH,CACT"}
1
+ {"version":3,"file":"json-code-mirror.cjs","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 const isEmptyBlock = i === pendingStart;\n if (!isEmptyBlock) 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":"uNAMaA,EAAqBC,EAAAA,eAAe,OAAO,CACtD,CAAE,IAAKC,EAAAA,KAAE,aAAc,MAAO,8BAAA,EAC9B,CAAE,IAAKA,EAAAA,KAAE,OAAQ,MAAO,kCAAmC,WAAY,GAAA,EACvE,CAAE,IAAK,CAACA,OAAE,OAAQA,EAAAA,KAAE,KAAMA,EAAAA,KAAE,IAAI,EAAG,MAAO,iCAAA,EAC1C,CAAE,IAAK,CAACA,EAAAA,KAAE,UAAWA,EAAAA,KAAE,cAAeA,OAAE,KAAK,EAAG,MAAO,sCAAA,CACzD,CAAC,EAEYC,EAAkBC,EAAAA,WAAW,MAAM,CAC9C,IAAK,CAAE,gBAAiB,cAAe,MAAO,uCAAwC,SAAU,MAAA,EAChG,eAAgB,CAAE,QAAS,MAAA,EAC3B,cAAe,CAAE,WAAY,oCAAqC,QAAS,oBAAA,EAC3E,cAAe,CACb,gBAAiB,cACjB,OAAQ,OACR,MAAO,iCACP,YAAa,KAAA,EAEf,eAAgB,CAAE,SAAU,MAAA,CAC9B,CAAC,EAEYC,EAAuB,CAACC,EAAAA,KAAA,EAAQC,EAAAA,aAAcC,EAAAA,mBAAmBR,CAAkB,CAAC,EAE1F,SAASS,EAAcC,EAAwB,CACpD,GAAI,CACF,OAAO,KAAK,UAAUA,EAAO,KAAM,CAAC,GAAK,MAC3C,MAAQ,CACN,OAAO,OAAOA,CAAK,CACrB,CACF,CAEO,SAASC,EAAUC,EAA+B,CACvD,OAAO,OAAOA,GAAS,SAAW,GAAGA,CAAI,KAAOA,CAClD,CAQO,SAASC,EAAkB,CAAE,OAAAC,EAAQ,UAAAC,EAAW,UAAAC,GAA4C,CACjG,MAAMC,EAAwC,CAAA,EAC9C,OAAIH,IAAW,SAAWG,EAAc,sBAAsB,EAAIN,EAAUG,CAAM,GAC9EC,IAAc,SAAWE,EAAc,0BAA0B,EAAIN,EAAUI,CAAS,GACxFC,IAAc,SAAWC,EAAc,0BAA0B,EAAIN,EAAUK,CAAS,GACrFC,CACT,CASO,SAASC,EAA4BC,EAA8C,CACxF,MAAMC,EAAyC,CAAA,EACzCC,EAAIF,EAAK,OACf,IAAIG,EAAI,EACR,KAAOA,EAAID,GAAKF,EAAKG,CAAC,IAAM,KAAOH,EAAKG,CAAC,IAAM,KAAKA,IACpD,GAAIA,GAAKD,EAAG,OAAOD,EAEnB,IAAIG,EAAQ,EACRC,EAAW,GACXC,EAAe,GACnB,KAAOH,EAAID,EAAGC,IAAK,CACjB,MAAMI,EAAKP,EAAKG,CAAC,EACjB,GAAIE,EAAU,CACRE,IAAO,KAAMJ,IACRI,IAAO,MAAKF,EAAW,IAChC,QACF,CACA,GAAIE,IAAO,IAAK,CACdF,EAAW,GACX,QACF,CACA,GAAIE,IAAO,KAAOA,IAAO,IAAK,CAC5BH,IACIA,IAAU,IAAGE,EAAeH,EAAI,GACpC,QACF,EACII,IAAO,KAAOA,IAAO,OACnBH,IAAU,GAAKE,IAAiB,KACbH,IAAMG,GACRL,EAAO,KAAK,CAAE,KAAMK,EAAc,GAAIH,EAAG,EAC5DG,EAAe,IAEjBF,IAEJ,CACA,OAAOH,CACT"}
@@ -1,13 +1,13 @@
1
1
  import { EditorView as f } from "@codemirror/view";
2
2
  import { json as u } from "@codemirror/lang-json";
3
- import { foldGutter as g, syntaxHighlighting as p, HighlightStyle as m } from "@codemirror/language";
4
- import { tags as n } from "@lezer/highlight";
3
+ import { foldGutter as p, syntaxHighlighting as g, HighlightStyle as m } from "@codemirror/language";
4
+ import { tags as t } from "@lezer/highlight";
5
5
  const d = m.define([
6
- { tag: n.propertyName, color: "var(--json-viewer-color-key)" },
7
- { tag: n.string, color: "var(--json-viewer-color-string)", fontWeight: 600 },
8
- { tag: [n.number, n.bool, n.null], color: "var(--json-viewer-color-scalar)" },
9
- { tag: [n.separator, n.squareBracket, n.brace], color: "var(--json-viewer-color-punctuation)" }
10
- ]), w = f.theme({
6
+ { tag: t.propertyName, color: "var(--json-viewer-color-key)" },
7
+ { tag: t.string, color: "var(--json-viewer-color-string)", fontWeight: 600 },
8
+ { tag: [t.number, t.bool, t.null], color: "var(--json-viewer-color-scalar)" },
9
+ { tag: [t.separator, t.squareBracket, t.brace], color: "var(--json-viewer-color-punctuation)" }
10
+ ]), S = f.theme({
11
11
  "&": { backgroundColor: "transparent", color: "var(--json-viewer-color-punctuation)", fontSize: "13px" },
12
12
  "&.cm-focused": { outline: "none" },
13
13
  ".cm-content": { fontFamily: "var(--sds-typography-family-mono)", padding: "8px 124px 12px 4px" },
@@ -18,8 +18,8 @@ const d = m.define([
18
18
  paddingLeft: "5px"
19
19
  },
20
20
  ".cm-scroller": { overflow: "auto" }
21
- }), S = [u(), g(), p(d)];
22
- function b(r) {
21
+ }), b = [u(), p(), g(d)];
22
+ function x(r) {
23
23
  try {
24
24
  return JSON.stringify(r, null, 2) ?? "null";
25
25
  } catch {
@@ -29,41 +29,41 @@ function b(r) {
29
29
  function a(r) {
30
30
  return typeof r == "number" ? `${r}px` : r;
31
31
  }
32
- function x({ height: r, minHeight: e, maxHeight: i }) {
32
+ function E({ height: r, minHeight: e, maxHeight: i }) {
33
33
  const o = {};
34
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
35
  }
36
- function E(r) {
36
+ function k(r) {
37
37
  const e = [], i = r.length;
38
38
  let o = 0;
39
39
  for (; o < i && r[o] !== "{" && r[o] !== "["; ) o++;
40
40
  if (o >= i) return e;
41
- let s = 0, c = !1, l = -1;
41
+ let l = 0, c = !1, s = -1;
42
42
  for (; o < i; o++) {
43
- const t = r[o];
43
+ const n = r[o];
44
44
  if (c) {
45
- t === "\\" ? o++ : t === '"' && (c = !1);
45
+ n === "\\" ? o++ : n === '"' && (c = !1);
46
46
  continue;
47
47
  }
48
- if (t === '"') {
48
+ if (n === '"') {
49
49
  c = !0;
50
50
  continue;
51
51
  }
52
- if (t === "{" || t === "[") {
53
- s++, s === 2 && (l = o + 1);
52
+ if (n === "{" || n === "[") {
53
+ l++, l === 2 && (s = o + 1);
54
54
  continue;
55
55
  }
56
- (t === "}" || t === "]") && (s === 2 && l !== -1 && (e.push({ from: l, to: o }), l = -1), s--);
56
+ (n === "}" || n === "]") && (l === 2 && s !== -1 && (o === s || e.push({ from: s, to: o }), s = -1), l--);
57
57
  }
58
58
  return e;
59
59
  }
60
60
  export {
61
- E as computeFirstLevelFoldRanges,
62
- S as jsonEditorExtensions,
63
- w as jsonEditorTheme,
61
+ k as computeFirstLevelFoldRanges,
62
+ b as jsonEditorExtensions,
63
+ S as jsonEditorTheme,
64
64
  d as jsonHighlightStyle,
65
- b as serializeJson,
65
+ x as serializeJson,
66
66
  a as toCssSize,
67
- x as toEditorSizeStyle
67
+ E as toEditorSizeStyle
68
68
  };
69
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 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
+ {"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 const isEmptyBlock = i === pendingStart;\n if (!isEmptyBlock) 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,OACbH,MAAMG,KACRL,EAAO,KAAK,EAAE,MAAMK,GAAc,IAAIH,GAAG,GAC5DG,IAAe,KAEjBF;AAAA,EAEJ;AACA,SAAOH;AACT;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("../../../vendor/clsx/dist/clsx.cjs"),h=require("react-aria-components");;/* empty css */const i=require("../Fieldset/Fieldset.cjs");function x({className:e,...c}){const t=r.clsx(e,"switch-group");return s.jsx("div",{...c,className:t})}function j({children:e,className:c,label:t,description:n,errorMessage:o,...u}){const d=r.clsx(c,"switch-field"),l=t||(typeof e=="string"?e:void 0);return s.jsx(h.Switch,{className:d,...u,children:s.jsxs(s.Fragment,{children:[s.jsx(i.Label,{children:l}),s.jsx(a,{}),n&&s.jsx(i.Description,{children:n}),s.jsx(i.FieldError,{children:o}),l!==e&&e]})})}function a({className:e,...c}){const t=r.clsx(e,"sds-switch");return s.jsx("div",{className:t,...c,children:s.jsx("span",{"aria-hidden":"true",className:"switch-icon"})})}exports.Switch=a;exports.SwitchField=j;exports.SwitchGroup=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("../../../vendor/clsx/dist/clsx.cjs"),x=require("react-aria-components");;/* empty css */const i=require("../Fieldset/Fieldset.cjs");function w({className:e,...t}){const c=r.clsx(e,"switch-group");return s.jsx("div",{...t,className:c})}function j({children:e,className:t,label:c,description:n,errorMessage:o,labelPosition:u="start",...d}){const h=r.clsx(t,"switch-field",`switch-field-label-${u}`),l=c||(typeof e=="string"?e:void 0);return s.jsx(x.Switch,{className:h,...d,children:s.jsxs(s.Fragment,{children:[s.jsx(i.Label,{children:l}),s.jsx(a,{}),n&&s.jsx(i.Description,{children:n}),s.jsx(i.FieldError,{children:o}),l!==e&&e]})})}function a({className:e,...t}){const c=r.clsx(e,"sds-switch");return s.jsx("div",{className:c,...t,children:s.jsx("span",{"aria-hidden":"true",className:"switch-icon"})})}exports.Switch=a;exports.SwitchField=j;exports.SwitchGroup=w;
2
2
  //# sourceMappingURL=Switch.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.cjs","sources":["../../../../../src/ui/primitives/Switch/Switch.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport type React from \"react\";\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from \"react-aria-components\";\nimport \"./switch.css\";\n\nexport type SwitchGroupProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function SwitchGroup({ className, ...props }: SwitchGroupProps) {\n const classNames = clsx(className, \"switch-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type SwitchFieldProps = RACSwitchProps & SharedFieldProps;\nexport function SwitchField({\n children,\n className,\n label,\n description,\n errorMessage,\n ...props\n}: SwitchFieldProps) {\n const classNames = clsx(className, \"switch-field\");\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACSwitch className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Switch />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && children}\n </>\n </RACSwitch>\n );\n}\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Switch({ className, ...props }: SwitchProps) {\n const classNames = clsx(className, \"sds-switch\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"switch-icon\" />\n </div>\n );\n}\n"],"names":["SwitchGroup","className","props","classNames","clsx","jsx","SwitchField","children","label","description","errorMessage","labelText","RACSwitch","jsxs","Fragment","Label","Switch","Description","FieldError"],"mappings":"gRAUO,SAASA,EAAY,CAAE,UAAAC,EAAW,GAAGC,GAA2B,CACrE,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,cAAc,EACjD,OAAOI,EAAAA,IAAC,MAAA,CAAK,GAAGH,EAAO,UAAWC,EAAY,CAChD,CAGO,SAASG,EAAY,CAC1B,SAAAC,EACA,UAAAN,EACA,MAAAO,EACA,YAAAC,EACA,aAAAC,EACA,GAAGR,CACL,EAAqB,CACnB,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,cAAc,EAC3CU,EACJH,IAAU,OAAOD,GAAa,SAAWA,EAAW,QACtD,aACGK,EAAAA,OAAA,CAAU,UAAWT,EAAa,GAAGD,EACpC,SAAAW,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAT,EAAAA,IAACU,EAAAA,OAAO,SAAAJ,CAAA,CAAU,QACjBK,EAAA,EAAO,EACPP,GAAeJ,EAAAA,IAACY,EAAAA,YAAA,CAAa,SAAAR,CAAA,CAAY,EAC1CJ,EAAAA,IAACa,EAAAA,YAAY,SAAAR,CAAA,CAAa,EACzBC,IAAcJ,GAAYA,CAAA,CAAA,CAC7B,CAAA,CACF,CAEJ,CAGO,SAASS,EAAO,CAAE,UAAAf,EAAW,GAAGC,GAAsB,CAC3D,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,YAAY,EAC/C,OACEI,EAAAA,IAAC,MAAA,CAAI,UAAWF,EAAa,GAAGD,EAC9B,SAAAG,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAO,UAAU,aAAA,CAAc,EACnD,CAEJ"}
1
+ {"version":3,"file":"Switch.cjs","sources":["../../../../../src/ui/primitives/Switch/Switch.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport type React from \"react\";\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from \"react-aria-components\";\nimport \"./switch.css\";\n\nexport type SwitchGroupProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function SwitchGroup({ className, ...props }: SwitchGroupProps) {\n const classNames = clsx(className, \"switch-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type SwitchFieldLabelPosition = \"start\" | \"end\";\n\nexport type SwitchFieldProps = RACSwitchProps &\n SharedFieldProps & {\n labelPosition?: SwitchFieldLabelPosition;\n };\nexport function SwitchField({\n children,\n className,\n label,\n description,\n errorMessage,\n labelPosition = \"start\",\n ...props\n}: SwitchFieldProps) {\n const classNames = clsx(\n className,\n \"switch-field\",\n `switch-field-label-${labelPosition}`,\n );\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACSwitch className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Switch />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && children}\n </>\n </RACSwitch>\n );\n}\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Switch({ className, ...props }: SwitchProps) {\n const classNames = clsx(className, \"sds-switch\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"switch-icon\" />\n </div>\n );\n}\n"],"names":["SwitchGroup","className","props","classNames","clsx","jsx","SwitchField","children","label","description","errorMessage","labelPosition","labelText","RACSwitch","jsxs","Fragment","Label","Switch","Description","FieldError"],"mappings":"gRAUO,SAASA,EAAY,CAAE,UAAAC,EAAW,GAAGC,GAA2B,CACrE,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,cAAc,EACjD,OAAOI,EAAAA,IAAC,MAAA,CAAK,GAAGH,EAAO,UAAWC,EAAY,CAChD,CAQO,SAASG,EAAY,CAC1B,SAAAC,EACA,UAAAN,EACA,MAAAO,EACA,YAAAC,EACA,aAAAC,EACA,cAAAC,EAAgB,QAChB,GAAGT,CACL,EAAqB,CACnB,MAAMC,EAAaC,EAAAA,KACjBH,EACA,eACA,sBAAsBU,CAAa,EAAA,EAE/BC,EACJJ,IAAU,OAAOD,GAAa,SAAWA,EAAW,QACtD,aACGM,EAAAA,OAAA,CAAU,UAAWV,EAAa,GAAGD,EACpC,SAAAY,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAV,EAAAA,IAACW,EAAAA,OAAO,SAAAJ,CAAA,CAAU,QACjBK,EAAA,EAAO,EACPR,GAAeJ,EAAAA,IAACa,EAAAA,YAAA,CAAa,SAAAT,CAAA,CAAY,EAC1CJ,EAAAA,IAACc,EAAAA,YAAY,SAAAT,CAAA,CAAa,EACzBE,IAAcL,GAAYA,CAAA,CAAA,CAC7B,CAAA,CACF,CAEJ,CAGO,SAASU,EAAO,CAAE,UAAAhB,EAAW,GAAGC,GAAsB,CAC3D,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,YAAY,EAC/C,OACEI,EAAAA,IAAC,MAAA,CAAI,UAAWF,EAAa,GAAGD,EAC9B,SAAAG,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAO,UAAU,aAAA,CAAc,EACnD,CAEJ"}
@@ -1,36 +1,41 @@
1
- import { jsx as i, jsxs as m, Fragment as h } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as h, Fragment as d } from "react/jsx-runtime";
2
2
  import { clsx as r } from "../../../vendor/clsx/dist/clsx.js";
3
- import { Switch as d } from "react-aria-components";
3
+ import { Switch as f } from "react-aria-components";
4
4
  /* empty css */
5
- import { Label as p, Description as f, FieldError as u } from "../Fieldset/Fieldset.js";
6
- function F({ className: s, ...t }) {
5
+ import { Label as p, Description as w, FieldError as u } from "../Fieldset/Fieldset.js";
6
+ function F({ className: s, ...i }) {
7
7
  const c = r(s, "switch-group");
8
- return /* @__PURE__ */ i("div", { ...t, className: c });
8
+ return /* @__PURE__ */ t("div", { ...i, className: c });
9
9
  }
10
- function b({
10
+ function j({
11
11
  children: s,
12
- className: t,
12
+ className: i,
13
13
  label: c,
14
14
  description: e,
15
- errorMessage: a,
16
- ...n
15
+ errorMessage: o,
16
+ labelPosition: n = "start",
17
+ ...l
17
18
  }) {
18
- const l = r(t, "switch-field"), o = c || (typeof s == "string" ? s : void 0);
19
- return /* @__PURE__ */ i(d, { className: l, ...n, children: /* @__PURE__ */ m(h, { children: [
20
- /* @__PURE__ */ i(p, { children: o }),
21
- /* @__PURE__ */ i(w, {}),
22
- e && /* @__PURE__ */ i(f, { children: e }),
23
- /* @__PURE__ */ i(u, { children: a }),
24
- o !== s && s
19
+ const m = r(
20
+ i,
21
+ "switch-field",
22
+ `switch-field-label-${n}`
23
+ ), a = c || (typeof s == "string" ? s : void 0);
24
+ return /* @__PURE__ */ t(f, { className: m, ...l, children: /* @__PURE__ */ h(d, { children: [
25
+ /* @__PURE__ */ t(p, { children: a }),
26
+ /* @__PURE__ */ t(N, {}),
27
+ e && /* @__PURE__ */ t(w, { children: e }),
28
+ /* @__PURE__ */ t(u, { children: o }),
29
+ a !== s && s
25
30
  ] }) });
26
31
  }
27
- function w({ className: s, ...t }) {
32
+ function N({ className: s, ...i }) {
28
33
  const c = r(s, "sds-switch");
29
- return /* @__PURE__ */ i("div", { className: c, ...t, children: /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "switch-icon" }) });
34
+ return /* @__PURE__ */ t("div", { className: c, ...i, children: /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "switch-icon" }) });
30
35
  }
31
36
  export {
32
- w as Switch,
33
- b as SwitchField,
37
+ N as Switch,
38
+ j as SwitchField,
34
39
  F as SwitchGroup
35
40
  };
36
41
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../../../src/ui/primitives/Switch/Switch.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport type React from \"react\";\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from \"react-aria-components\";\nimport \"./switch.css\";\n\nexport type SwitchGroupProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function SwitchGroup({ className, ...props }: SwitchGroupProps) {\n const classNames = clsx(className, \"switch-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type SwitchFieldProps = RACSwitchProps & SharedFieldProps;\nexport function SwitchField({\n children,\n className,\n label,\n description,\n errorMessage,\n ...props\n}: SwitchFieldProps) {\n const classNames = clsx(className, \"switch-field\");\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACSwitch className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Switch />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && children}\n </>\n </RACSwitch>\n );\n}\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Switch({ className, ...props }: SwitchProps) {\n const classNames = clsx(className, \"sds-switch\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"switch-icon\" />\n </div>\n );\n}\n"],"names":["SwitchGroup","className","props","classNames","clsx","jsx","SwitchField","children","label","description","errorMessage","labelText","RACSwitch","jsxs","Fragment","Label","Switch","Description","FieldError"],"mappings":";;;;;AAUO,SAASA,EAAY,EAAE,WAAAC,GAAW,GAAGC,KAA2B;AACrE,QAAMC,IAAaC,EAAKH,GAAW,cAAc;AACjD,SAAO,gBAAAI,EAAC,OAAA,EAAK,GAAGH,GAAO,WAAWC,GAAY;AAChD;AAGO,SAASG,EAAY;AAAA,EAC1B,UAAAC;AAAA,EACA,WAAAN;AAAA,EACA,OAAAO;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGR;AACL,GAAqB;AACnB,QAAMC,IAAaC,EAAKH,GAAW,cAAc,GAC3CU,IACJH,MAAU,OAAOD,KAAa,WAAWA,IAAW;AACtD,2BACGK,GAAA,EAAU,WAAWT,GAAa,GAAGD,GACpC,UAAA,gBAAAW,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAT,EAACU,KAAO,UAAAJ,EAAA,CAAU;AAAA,sBACjBK,GAAA,EAAO;AAAA,IACPP,KAAe,gBAAAJ,EAACY,GAAA,EAAa,UAAAR,EAAA,CAAY;AAAA,IAC1C,gBAAAJ,EAACa,KAAY,UAAAR,EAAA,CAAa;AAAA,IACzBC,MAAcJ,KAAYA;AAAA,EAAA,EAAA,CAC7B,EAAA,CACF;AAEJ;AAGO,SAASS,EAAO,EAAE,WAAAf,GAAW,GAAGC,KAAsB;AAC3D,QAAMC,IAAaC,EAAKH,GAAW,YAAY;AAC/C,SACE,gBAAAI,EAAC,OAAA,EAAI,WAAWF,GAAa,GAAGD,GAC9B,UAAA,gBAAAG,EAAC,QAAA,EAAK,eAAY,QAAO,WAAU,cAAA,CAAc,GACnD;AAEJ;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../../../src/ui/primitives/Switch/Switch.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport type React from \"react\";\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from \"react-aria-components\";\nimport \"./switch.css\";\n\nexport type SwitchGroupProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function SwitchGroup({ className, ...props }: SwitchGroupProps) {\n const classNames = clsx(className, \"switch-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type SwitchFieldLabelPosition = \"start\" | \"end\";\n\nexport type SwitchFieldProps = RACSwitchProps &\n SharedFieldProps & {\n labelPosition?: SwitchFieldLabelPosition;\n };\nexport function SwitchField({\n children,\n className,\n label,\n description,\n errorMessage,\n labelPosition = \"start\",\n ...props\n}: SwitchFieldProps) {\n const classNames = clsx(\n className,\n \"switch-field\",\n `switch-field-label-${labelPosition}`,\n );\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACSwitch className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Switch />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && children}\n </>\n </RACSwitch>\n );\n}\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Switch({ className, ...props }: SwitchProps) {\n const classNames = clsx(className, \"sds-switch\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"switch-icon\" />\n </div>\n );\n}\n"],"names":["SwitchGroup","className","props","classNames","clsx","jsx","SwitchField","children","label","description","errorMessage","labelPosition","labelText","RACSwitch","jsxs","Fragment","Label","Switch","Description","FieldError"],"mappings":";;;;;AAUO,SAASA,EAAY,EAAE,WAAAC,GAAW,GAAGC,KAA2B;AACrE,QAAMC,IAAaC,EAAKH,GAAW,cAAc;AACjD,SAAO,gBAAAI,EAAC,OAAA,EAAK,GAAGH,GAAO,WAAWC,GAAY;AAChD;AAQO,SAASG,EAAY;AAAA,EAC1B,UAAAC;AAAA,EACA,WAAAN;AAAA,EACA,OAAAO;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,GAAGT;AACL,GAAqB;AACnB,QAAMC,IAAaC;AAAA,IACjBH;AAAA,IACA;AAAA,IACA,sBAAsBU,CAAa;AAAA,EAAA,GAE/BC,IACJJ,MAAU,OAAOD,KAAa,WAAWA,IAAW;AACtD,2BACGM,GAAA,EAAU,WAAWV,GAAa,GAAGD,GACpC,UAAA,gBAAAY,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAV,EAACW,KAAO,UAAAJ,EAAA,CAAU;AAAA,sBACjBK,GAAA,EAAO;AAAA,IACPR,KAAe,gBAAAJ,EAACa,GAAA,EAAa,UAAAT,EAAA,CAAY;AAAA,IAC1C,gBAAAJ,EAACc,KAAY,UAAAT,EAAA,CAAa;AAAA,IACzBE,MAAcL,KAAYA;AAAA,EAAA,EAAA,CAC7B,EAAA,CACF;AAEJ;AAGO,SAASU,EAAO,EAAE,WAAAhB,GAAW,GAAGC,KAAsB;AAC3D,QAAMC,IAAaC,EAAKH,GAAW,YAAY;AAC/C,SACE,gBAAAI,EAAC,OAAA,EAAI,WAAWF,GAAa,GAAGD,GAC9B,UAAA,gBAAAG,EAAC,QAAA,EAAK,eAAY,QAAO,WAAU,cAAA,CAAc,GACnD;AAEJ;"}
@@ -1,6 +1,7 @@
1
+ import { type DialogSize } from "primitives";
1
2
  import type { ReactNode } from "react";
2
3
  import "./formmodal.css";
3
- export type FormModalSize = "medium" | "large" | "xlarge";
4
+ export type FormModalSize = DialogSize;
4
5
  export interface FormModalProps {
5
6
  isOpen: boolean;
6
7
  title: string;
@@ -16,6 +16,7 @@ export interface TopListOptionInput {
16
16
  colorsByItemId: Record<string, string>;
17
17
  animate: boolean;
18
18
  labeledRowStep: number;
19
+ canvasWidthPx: number;
19
20
  valueFormatter?: (value: number) => string;
20
21
  }
21
22
  export declare function rankById(items: TopListItem[], sort: TopListSort): Map<string, number>;
@@ -4,6 +4,8 @@ export interface ChartTheme {
4
4
  axisLineColor: string;
5
5
  splitLineColor: string;
6
6
  labelColor: string;
7
+ emphasizedLabelColor: string;
8
+ trackColor: string;
7
9
  tooltipBackgroundColor: string;
8
10
  tooltipBorderColor: string;
9
11
  fontFamily: string;
@@ -1,10 +1,12 @@
1
1
  import { ButtonProps, IconButtonProps, type TextHeadingProps, type TextProps } from "primitives";
2
2
  import { type DialogProps as RACDialogProps, type DialogTriggerProps as RACDialogTriggerProps, type ModalOverlayProps as RACModalOverlayProps } from "react-aria-components";
3
3
  import "./dialog.css";
4
+ export type DialogSize = "medium" | "large" | "xlarge";
4
5
  export type DialogProps = RACDialogProps & {
5
6
  type?: "sheet" | "card";
7
+ size?: DialogSize;
6
8
  };
7
- export declare function Dialog({ className, type, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function Dialog({ className, type, size, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
8
10
  export type DialogCloseProps = Pick<IconButtonProps, "onPress">;
9
11
  export declare const DialogClose: ({ onPress }: DialogCloseProps) => import("react/jsx-runtime").JSX.Element;
10
12
  export type DialogTriggerProps = RACDialogTriggerProps;
@@ -4,7 +4,10 @@ import { type SwitchProps as RACSwitchProps } from "react-aria-components";
4
4
  import "./switch.css";
5
5
  export type SwitchGroupProps = React.ComponentPropsWithoutRef<"div">;
6
6
  export declare function SwitchGroup({ className, ...props }: SwitchGroupProps): import("react/jsx-runtime").JSX.Element;
7
- export type SwitchFieldProps = RACSwitchProps & SharedFieldProps;
8
- export declare function SwitchField({ children, className, label, description, errorMessage, ...props }: SwitchFieldProps): import("react/jsx-runtime").JSX.Element;
7
+ export type SwitchFieldLabelPosition = "start" | "end";
8
+ export type SwitchFieldProps = RACSwitchProps & SharedFieldProps & {
9
+ labelPosition?: SwitchFieldLabelPosition;
10
+ };
11
+ export declare function SwitchField({ children, className, label, description, errorMessage, labelPosition, ...props }: SwitchFieldProps): import("react/jsx-runtime").JSX.Element;
9
12
  export type SwitchProps = React.ComponentPropsWithoutRef<"div">;
10
13
  export declare function Switch({ className, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/design-system",
3
- "version": "7.1.0",
3
+ "version": "7.3.1",
4
4
  "type": "module",
5
5
  "description": "APIPass React Design System",
6
6
  "sideEffects": [