@apipass/design-system 7.1.0 → 7.2.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.
@@ -1,10 +1,9 @@
1
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
- import { clsx as h } from "../../../vendor/clsx/dist/clsx.js";
1
+ import { jsx as r, jsxs as a } from "react/jsx-runtime";
3
2
  /* empty css */
4
- import { DialogModal as u, Dialog as D, DialogTitle as x, DialogClose as y, DialogBody as P } from "../../primitives/Dialog/Dialog.js";
5
- import { Flex as a } from "../../layout/Flex/Flex.js";
3
+ import { DialogModal as h, Dialog as u, DialogTitle as D, DialogClose as y, DialogBody as P } from "../../primitives/Dialog/Dialog.js";
4
+ import { Flex as o } from "../../layout/Flex/Flex.js";
6
5
  import { Button as n } from "../../primitives/Button/Button.js";
7
- function M({
6
+ function B({
8
7
  isOpen: l,
9
8
  title: m,
10
9
  submitLabel: t = "Save",
@@ -13,24 +12,24 @@ function M({
13
12
  isSubmitDisabled: d = !1,
14
13
  size: s = "medium",
15
14
  onSubmit: f,
16
- onClose: o,
15
+ onClose: i,
17
16
  children: p
18
17
  }) {
19
- return l ? /* @__PURE__ */ r(u, { isOpen: l, onOpenChange: (g) => !g && o(), children: /* @__PURE__ */ i(D, { className: h("form-modal", `form-modal--${s}`), children: [
20
- /* @__PURE__ */ i(a, { direction: "row", alignPrimary: "space-between", alignSecondary: "center", children: [
21
- /* @__PURE__ */ r(x, { children: m }),
22
- /* @__PURE__ */ r(y, { onPress: o })
18
+ return l ? /* @__PURE__ */ r(h, { isOpen: l, onOpenChange: (g) => !g && i(), children: /* @__PURE__ */ a(u, { className: "form-modal", size: s, children: [
19
+ /* @__PURE__ */ a(o, { direction: "row", alignPrimary: "space-between", alignSecondary: "center", children: [
20
+ /* @__PURE__ */ r(D, { children: m }),
21
+ /* @__PURE__ */ r(y, { onPress: i })
23
22
  ] }),
24
- /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(a, { direction: "column", gap: "300", children: p }) }),
25
- /* @__PURE__ */ i(
26
- a,
23
+ /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(o, { direction: "column", gap: "300", children: p }) }),
24
+ /* @__PURE__ */ a(
25
+ o,
27
26
  {
28
27
  direction: "row",
29
28
  gap: "200",
30
29
  alignPrimary: "end",
31
30
  className: "form-modal-footer",
32
31
  children: [
33
- /* @__PURE__ */ r(n, { variant: "neutral", onPress: o, isDisabled: e, children: c }),
32
+ /* @__PURE__ */ r(n, { variant: "neutral", onPress: i, isDisabled: e, children: c }),
34
33
  /* @__PURE__ */ r(
35
34
  n,
36
35
  {
@@ -46,6 +45,6 @@ function M({
46
45
  ] }) }) : null;
47
46
  }
48
47
  export {
49
- M as FormModal
48
+ B as FormModal
50
49
  };
51
50
  //# sourceMappingURL=FormModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormModal.js","sources":["../../../../../src/ui/components/FormModal/FormModal.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport {\n Button,\n Dialog,\n DialogBody,\n DialogClose,\n DialogModal,\n DialogTitle,\n} from \"primitives\";\nimport { Flex } from \"layout\";\nimport type { ReactNode } from \"react\";\nimport \"./formmodal.css\";\n\nexport type FormModalSize = \"medium\" | \"large\" | \"xlarge\";\n\nexport interface FormModalProps {\n isOpen: boolean;\n title: string;\n submitLabel?: string;\n cancelLabel?: string;\n isLoading?: boolean;\n isSubmitDisabled?: boolean;\n /**\n * Maximum width of the dialog. Defaults to `\"medium\"`, which preserves the\n * previous fixed width. Use `\"large\"`/`\"xlarge\"` for forms that embed wide\n * content such as tables.\n */\n size?: FormModalSize;\n onSubmit: () => void;\n onClose: () => void;\n children: ReactNode;\n}\n\nexport function FormModal({\n isOpen,\n title,\n submitLabel = \"Save\",\n cancelLabel = \"Cancel\",\n isLoading = false,\n isSubmitDisabled = false,\n size = \"medium\",\n onSubmit,\n onClose,\n children,\n}: FormModalProps) {\n if (!isOpen) return null;\n\n return (\n <DialogModal isOpen={isOpen} onOpenChange={(open) => !open && onClose()}>\n <Dialog className={clsx(\"form-modal\", `form-modal--${size}`)}>\n <Flex direction=\"row\" alignPrimary=\"space-between\" alignSecondary=\"center\">\n <DialogTitle>{title}</DialogTitle>\n <DialogClose onPress={onClose} />\n </Flex>\n <DialogBody>\n <Flex direction=\"column\" gap=\"300\">\n {children}\n </Flex>\n </DialogBody>\n <Flex\n direction=\"row\"\n gap=\"200\"\n alignPrimary=\"end\"\n className=\"form-modal-footer\"\n >\n <Button variant=\"neutral\" onPress={onClose} isDisabled={isLoading}>\n {cancelLabel}\n </Button>\n <Button\n variant=\"primary\"\n onPress={onSubmit}\n isDisabled={isSubmitDisabled || isLoading}\n >\n {isLoading ? \"...\" : submitLabel}\n </Button>\n </Flex>\n </Dialog>\n </DialogModal>\n );\n}\n"],"names":["FormModal","isOpen","title","submitLabel","cancelLabel","isLoading","isSubmitDisabled","size","onSubmit","onClose","children","DialogModal","open","jsxs","Dialog","clsx","Flex","jsx","DialogTitle","DialogClose","DialogBody","Button"],"mappings":";;;;;;AAiCO,SAASA,EAAU;AAAA,EACxB,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC,IAAc;AAAA,EACd,WAAAC,IAAY;AAAA,EACZ,kBAAAC,IAAmB;AAAA,EACnB,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAAmB;AACjB,SAAKT,sBAGFU,GAAA,EAAY,QAAAV,GAAgB,cAAc,CAACW,MAAS,CAACA,KAAQH,KAC5D,UAAA,gBAAAI,EAACC,KAAO,WAAWC,EAAK,cAAc,eAAeR,CAAI,EAAE,GACzD,UAAA;AAAA,IAAA,gBAAAM,EAACG,KAAK,WAAU,OAAM,cAAa,iBAAgB,gBAAe,UAChE,UAAA;AAAA,MAAA,gBAAAC,EAACC,KAAa,UAAAhB,EAAA,CAAM;AAAA,MACpB,gBAAAe,EAACE,GAAA,EAAY,SAASV,EAAA,CAAS;AAAA,IAAA,GACjC;AAAA,IACA,gBAAAQ,EAACG,KACC,UAAA,gBAAAH,EAACD,GAAA,EAAK,WAAU,UAAS,KAAI,OAC1B,UAAAN,EAAA,CACH,EAAA,CACF;AAAA,IACA,gBAAAG;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,KAAI;AAAA,QACJ,cAAa;AAAA,QACb,WAAU;AAAA,QAEV,UAAA;AAAA,UAAA,gBAAAC,EAACI,KAAO,SAAQ,WAAU,SAASZ,GAAS,YAAYJ,GACrD,UAAAD,EAAA,CACH;AAAA,UACA,gBAAAa;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,SAASb;AAAA,cACT,YAAYF,KAAoBD;AAAA,cAE/B,cAAY,QAAQF;AAAA,YAAA;AAAA,UAAA;AAAA,QACvB;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,EAAA,CACF,EAAA,CACF,IAhCkB;AAkCtB;"}
1
+ {"version":3,"file":"FormModal.js","sources":["../../../../../src/ui/components/FormModal/FormModal.tsx"],"sourcesContent":["import {\n Button,\n Dialog,\n DialogBody,\n DialogClose,\n DialogModal,\n DialogTitle,\n type DialogSize,\n} from \"primitives\";\nimport { Flex } from \"layout\";\nimport type { ReactNode } from \"react\";\nimport \"./formmodal.css\";\n\nexport type FormModalSize = DialogSize;\n\nexport interface FormModalProps {\n isOpen: boolean;\n title: string;\n submitLabel?: string;\n cancelLabel?: string;\n isLoading?: boolean;\n isSubmitDisabled?: boolean;\n /**\n * Maximum width of the dialog. Defaults to `\"medium\"`, which preserves the\n * previous fixed width. Use `\"large\"`/`\"xlarge\"` for forms that embed wide\n * content such as tables.\n */\n size?: FormModalSize;\n onSubmit: () => void;\n onClose: () => void;\n children: ReactNode;\n}\n\nexport function FormModal({\n isOpen,\n title,\n submitLabel = \"Save\",\n cancelLabel = \"Cancel\",\n isLoading = false,\n isSubmitDisabled = false,\n size = \"medium\",\n onSubmit,\n onClose,\n children,\n}: FormModalProps) {\n if (!isOpen) return null;\n\n return (\n <DialogModal isOpen={isOpen} onOpenChange={(open) => !open && onClose()}>\n <Dialog className=\"form-modal\" size={size}>\n <Flex direction=\"row\" alignPrimary=\"space-between\" alignSecondary=\"center\">\n <DialogTitle>{title}</DialogTitle>\n <DialogClose onPress={onClose} />\n </Flex>\n <DialogBody>\n <Flex direction=\"column\" gap=\"300\">\n {children}\n </Flex>\n </DialogBody>\n <Flex\n direction=\"row\"\n gap=\"200\"\n alignPrimary=\"end\"\n className=\"form-modal-footer\"\n >\n <Button variant=\"neutral\" onPress={onClose} isDisabled={isLoading}>\n {cancelLabel}\n </Button>\n <Button\n variant=\"primary\"\n onPress={onSubmit}\n isDisabled={isSubmitDisabled || isLoading}\n >\n {isLoading ? \"...\" : submitLabel}\n </Button>\n </Flex>\n </Dialog>\n </DialogModal>\n );\n}\n"],"names":["FormModal","isOpen","title","submitLabel","cancelLabel","isLoading","isSubmitDisabled","size","onSubmit","onClose","children","jsx","DialogModal","open","jsxs","Dialog","Flex","DialogTitle","DialogClose","DialogBody","Button"],"mappings":";;;;;AAiCO,SAASA,EAAU;AAAA,EACxB,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC,IAAc;AAAA,EACd,WAAAC,IAAY;AAAA,EACZ,kBAAAC,IAAmB;AAAA,EACnB,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAAmB;AACjB,SAAKT,IAGH,gBAAAU,EAACC,GAAA,EAAY,QAAAX,GAAgB,cAAc,CAACY,MAAS,CAACA,KAAQJ,EAAA,GAC5D,UAAA,gBAAAK,EAACC,GAAA,EAAO,WAAU,cAAa,MAAAR,GAC7B,UAAA;AAAA,IAAA,gBAAAO,EAACE,KAAK,WAAU,OAAM,cAAa,iBAAgB,gBAAe,UAChE,UAAA;AAAA,MAAA,gBAAAL,EAACM,KAAa,UAAAf,EAAA,CAAM;AAAA,MACpB,gBAAAS,EAACO,GAAA,EAAY,SAAST,EAAA,CAAS;AAAA,IAAA,GACjC;AAAA,IACA,gBAAAE,EAACQ,KACC,UAAA,gBAAAR,EAACK,GAAA,EAAK,WAAU,UAAS,KAAI,OAC1B,UAAAN,EAAA,CACH,EAAA,CACF;AAAA,IACA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,KAAI;AAAA,QACJ,cAAa;AAAA,QACb,WAAU;AAAA,QAEV,UAAA;AAAA,UAAA,gBAAAL,EAACS,KAAO,SAAQ,WAAU,SAASX,GAAS,YAAYJ,GACrD,UAAAD,EAAA,CACH;AAAA,UACA,gBAAAO;AAAA,YAACS;AAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,SAASZ;AAAA,cACT,YAAYF,KAAoBD;AAAA,cAE/B,cAAY,QAAQF;AAAA,YAAA;AAAA,UAAA;AAAA,QACvB;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,EAAA,CACF,EAAA,CACF,IAhCkB;AAkCtB;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("../../../vendor/clsx/dist/clsx.cjs"),t=require("react-aria-components");;/* empty css */const m=require("../../icons/IconX.cjs"),r=require("../Text/Text.cjs"),c=require("../IconButton/IconButton.cjs"),j=require("../Button/Button.cjs"),N=require("../../hooks/useOverlayPortal.cjs");function u({className:o,type:e="card",...a}){const i=l.clsx(o,"dialog",`dialog-type-${e}`);return s.jsx(t.Dialog,{className:i,...a})}const y=({onPress:o})=>s.jsx(c.IconButton,{className:"dialog-close","aria-label":"Dismiss dialog",onPress:o,variant:"subtle",size:"small",children:s.jsx(m.IconX,{})});function g({...o}){return s.jsx(t.DialogTrigger,{...o})}function B({label:o,icon:e,variant:a,children:i,...n}){return s.jsxs(g,{children:[e?s.jsx(c.IconButton,{variant:a,"aria-label":o,children:e}):s.jsx(j.Button,{variant:a,children:o}),s.jsx(d,{isDismissable:!0,children:s.jsx(u,{...n,children:i})})]})}function T({className:o,...e}){const a=l.clsx(o,"dialog-title");return s.jsx(r.TextHeading,{...e,slot:"title",className:a})}function b({className:o,...e}){const a=l.clsx(o,"dialog-description");return s.jsx(r.Text,{...e,className:a})}function p({bleed:o,className:e,...a}){const i=l.clsx(e,"dialog-body",o&&"dialog-body-bleed");return s.jsx("div",{...a,className:i})}function d({children:o,className:e,isDismissable:a,UNSTABLE_portalContainer:i,...n}){const x=l.clsx(e,"dialog-backdrop"),D=N.useOverlayPortalContainer();return s.jsx(t.ModalOverlay,{className:x,isDismissable:a,...n,UNSTABLE_portalContainer:i??D,children:s.jsx(t.Modal,{className:"dialog-container",children:o})})}exports.Dialog=u;exports.DialogBody=p;exports.DialogButton=B;exports.DialogClose=y;exports.DialogDescription=b;exports.DialogModal=d;exports.DialogTitle=T;exports.DialogTrigger=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../../vendor/clsx/dist/clsx.cjs"),n=require("react-aria-components");;/* empty css */const m=require("../../icons/IconX.cjs"),r=require("../Text/Text.cjs"),c=require("../IconButton/IconButton.cjs"),j=require("../Button/Button.cjs"),N=require("../../hooks/useOverlayPortal.cjs");function u({className:o,type:s="card",size:i="medium",...a}){const l=t.clsx(o,"dialog",`dialog-type-${s}`,`dialog-size-${i}`);return e.jsx(n.Dialog,{className:l,...a})}const y=({onPress:o})=>e.jsx(c.IconButton,{className:"dialog-close","aria-label":"Dismiss dialog",onPress:o,variant:"subtle",size:"small",children:e.jsx(m.IconX,{})});function g({...o}){return e.jsx(n.DialogTrigger,{...o})}function B({label:o,icon:s,variant:i,children:a,...l}){return e.jsxs(g,{children:[s?e.jsx(c.IconButton,{variant:i,"aria-label":o,children:s}):e.jsx(j.Button,{variant:i,children:o}),e.jsx(d,{isDismissable:!0,children:e.jsx(u,{...l,children:a})})]})}function T({className:o,...s}){const i=t.clsx(o,"dialog-title");return e.jsx(r.TextHeading,{...s,slot:"title",className:i})}function b({className:o,...s}){const i=t.clsx(o,"dialog-description");return e.jsx(r.Text,{...s,className:i})}function p({bleed:o,className:s,...i}){const a=t.clsx(s,"dialog-body",o&&"dialog-body-bleed");return e.jsx("div",{...i,className:a})}function d({children:o,className:s,isDismissable:i,UNSTABLE_portalContainer:a,...l}){const x=t.clsx(s,"dialog-backdrop"),D=N.useOverlayPortalContainer();return e.jsx(n.ModalOverlay,{className:x,isDismissable:i,...l,UNSTABLE_portalContainer:a??D,children:e.jsx(n.Modal,{className:"dialog-container",children:o})})}exports.Dialog=u;exports.DialogBody=p;exports.DialogButton=B;exports.DialogClose=y;exports.DialogDescription=b;exports.DialogModal=d;exports.DialogTitle=T;exports.DialogTrigger=g;
2
2
  //# sourceMappingURL=Dialog.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.cjs","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":"qaA2BO,SAASA,EAAO,CAAE,UAAAC,EAAW,KAAAC,EAAO,OAAQ,GAAGC,GAAsB,CAC1E,MAAMC,EAAaC,EAAAA,KAAKJ,EAAW,SAAU,eAAeC,CAAI,EAAE,EAClE,OAAOI,EAAAA,IAACC,EAAAA,OAAA,CAAU,UAAWH,EAAa,GAAGD,EAAO,CACtD,CAGO,MAAMK,EAAc,CAAC,CAAE,QAAAC,CAAA,IAC5BH,EAAAA,IAACI,EAAAA,WAAA,CACC,UAAU,eACV,aAAW,iBACX,QAAAD,EACA,QAAQ,SACR,KAAK,QAEL,eAACE,EAAAA,MAAA,CAAA,CAAM,CAAA,CACT,EAIK,SAASC,EAAc,CAAE,GAAGT,GAA6B,CAC9D,OAAOG,MAACO,EAAAA,cAAA,CAAkB,GAAGV,CAAA,CAAO,CACtC,CASO,SAASW,EAAa,CAC3B,MAAAC,EACA,KAAAC,EACA,QAAAC,EACA,SAAAC,EACA,GAAGf,CACL,EAAsB,CACpB,cACGS,EAAA,CACE,SAAA,CAAAI,EACCV,EAAAA,IAACI,EAAAA,WAAA,CAAW,QAAAO,EAAkB,aAAYF,EACvC,WACH,EAEAT,EAAAA,IAACa,EAAAA,OAAA,CAAO,QAAAF,EAAmB,SAAAF,EAAM,EAEnCT,EAAAA,IAACc,GAAY,cAAa,GACxB,eAACpB,EAAA,CAAQ,GAAGG,EAAQ,SAAAe,CAAA,CAAS,CAAA,CAC/B,CAAA,EACF,CAEJ,CAGO,SAASG,EAAY,CAAE,UAAApB,EAAW,GAAGE,GAA2B,CACrE,MAAMC,EAAaC,EAAAA,KAAKJ,EAAW,cAAc,EACjD,aAAQqB,EAAAA,YAAA,CAAa,GAAGnB,EAAO,KAAK,QAAQ,UAAWC,EAAY,CACrE,CAGO,SAASmB,EAAkB,CAChC,UAAAtB,EACA,GAAGE,CACL,EAA2B,CACzB,MAAMC,EAAaC,EAAAA,KAAKJ,EAAW,oBAAoB,EACvD,OAAOK,EAAAA,IAACkB,EAAAA,KAAA,CAAM,GAAGrB,EAAO,UAAWC,EAAY,CACjD,CAKO,SAASqB,EAAW,CAAE,MAAAC,EAAO,UAAAzB,EAAW,GAAGE,GAA0B,CAC1E,MAAMC,EAAaC,EAAAA,KACjBJ,EACA,cACAyB,GAAS,mBAAA,EAEX,OAAOpB,EAAAA,IAAC,MAAA,CAAK,GAAGH,EAAO,UAAWC,EAAY,CAChD,CAGO,SAASgB,EAAY,CAC1B,SAAAF,EACA,UAAAjB,EACA,cAAA0B,EACA,yBAAAC,EACA,GAAGzB,CACL,EAAqB,CACnB,MAAMC,EAAaC,EAAAA,KAAKJ,EAAW,iBAAiB,EAI9C4B,EAAkBC,EAAAA,0BAAA,EACxB,OACExB,EAAAA,IAACyB,EAAAA,aAAA,CACC,UAAW3B,EACX,cAAAuB,EACC,GAAGxB,EACJ,yBAA0ByB,GAA4BC,EAEtD,SAAAvB,EAAAA,IAAC0B,EAAAA,MAAA,CAAS,UAAW,mBAAqB,SAAAd,CAAA,CAAS,CAAA,CAAA,CAGzD"}
1
+ {"version":3,"file":"Dialog.cjs","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":"qaA8BO,SAASA,EAAO,CACrB,UAAAC,EACA,KAAAC,EAAO,OACP,KAAAC,EAAO,SACP,GAAGC,CACL,EAAgB,CACd,MAAMC,EAAaC,EAAAA,KACjBL,EACA,SACA,eAAeC,CAAI,GACnB,eAAeC,CAAI,EAAA,EAErB,OAAOI,EAAAA,IAACC,EAAAA,OAAA,CAAU,UAAWH,EAAa,GAAGD,EAAO,CACtD,CAGO,MAAMK,EAAc,CAAC,CAAE,QAAAC,CAAA,IAC5BH,EAAAA,IAACI,EAAAA,WAAA,CACC,UAAU,eACV,aAAW,iBACX,QAAAD,EACA,QAAQ,SACR,KAAK,QAEL,eAACE,EAAAA,MAAA,CAAA,CAAM,CAAA,CACT,EAIK,SAASC,EAAc,CAAE,GAAGT,GAA6B,CAC9D,OAAOG,MAACO,EAAAA,cAAA,CAAkB,GAAGV,CAAA,CAAO,CACtC,CASO,SAASW,EAAa,CAC3B,MAAAC,EACA,KAAAC,EACA,QAAAC,EACA,SAAAC,EACA,GAAGf,CACL,EAAsB,CACpB,cACGS,EAAA,CACE,SAAA,CAAAI,EACCV,EAAAA,IAACI,EAAAA,WAAA,CAAW,QAAAO,EAAkB,aAAYF,EACvC,WACH,EAEAT,EAAAA,IAACa,EAAAA,OAAA,CAAO,QAAAF,EAAmB,SAAAF,EAAM,EAEnCT,EAAAA,IAACc,GAAY,cAAa,GACxB,eAACrB,EAAA,CAAQ,GAAGI,EAAQ,SAAAe,CAAA,CAAS,CAAA,CAC/B,CAAA,EACF,CAEJ,CAGO,SAASG,EAAY,CAAE,UAAArB,EAAW,GAAGG,GAA2B,CACrE,MAAMC,EAAaC,EAAAA,KAAKL,EAAW,cAAc,EACjD,aAAQsB,EAAAA,YAAA,CAAa,GAAGnB,EAAO,KAAK,QAAQ,UAAWC,EAAY,CACrE,CAGO,SAASmB,EAAkB,CAChC,UAAAvB,EACA,GAAGG,CACL,EAA2B,CACzB,MAAMC,EAAaC,EAAAA,KAAKL,EAAW,oBAAoB,EACvD,OAAOM,EAAAA,IAACkB,EAAAA,KAAA,CAAM,GAAGrB,EAAO,UAAWC,EAAY,CACjD,CAKO,SAASqB,EAAW,CAAE,MAAAC,EAAO,UAAA1B,EAAW,GAAGG,GAA0B,CAC1E,MAAMC,EAAaC,EAAAA,KACjBL,EACA,cACA0B,GAAS,mBAAA,EAEX,OAAOpB,EAAAA,IAAC,MAAA,CAAK,GAAGH,EAAO,UAAWC,EAAY,CAChD,CAGO,SAASgB,EAAY,CAC1B,SAAAF,EACA,UAAAlB,EACA,cAAA2B,EACA,yBAAAC,EACA,GAAGzB,CACL,EAAqB,CACnB,MAAMC,EAAaC,EAAAA,KAAKL,EAAW,iBAAiB,EAI9C6B,EAAkBC,EAAAA,0BAAA,EACxB,OACExB,EAAAA,IAACyB,EAAAA,aAAA,CACC,UAAW3B,EACX,cAAAuB,EACC,GAAGxB,EACJ,yBAA0ByB,GAA4BC,EAEtD,SAAAvB,EAAAA,IAAC0B,EAAAA,MAAA,CAAS,UAAW,mBAAqB,SAAAd,CAAA,CAAS,CAAA,CAAA,CAGzD"}
@@ -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 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;
@@ -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.2.0",
4
4
  "type": "module",
5
5
  "description": "APIPass React Design System",
6
6
  "sideEffects": [