@televet/kibble-ui 4.0.0-beta.113 → 4.0.0-beta.114

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.
@@ -0,0 +1,2 @@
1
+ "use strict";const i=require("./jsx-runtime-BjDatQAs.js"),l=require("react"),k=require("./create-slot-recipe-context-IwVIgtBt.js"),w=require("./factory-D6tdBUPG.js"),o=require("./use-locale-context-D0LByRu9.js"),p=require("./render-strategy-C_zp9LNQ.js"),c=require("./index-CHIISuTq.js"),f=require("./index-BR7peqZO.js"),[v,a]=o.createContext({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),u=l.forwardRef((s,r)=>{const e=a(),t=p.useRenderStrategyPropsContext(),n=o.usePresence({...t,present:e.open}),d=c.mergeProps(e.getBackdropProps(),n.getPresenceProps(),s);return n.unmounted?null:i.jsxRuntimeExports.jsx(o.ark.div,{...d,ref:o.composeRefs(n.ref,r)})});u.displayName="DialogBackdrop";const P=l.forwardRef((s,r)=>{const e=a(),t=c.mergeProps(e.getCloseTriggerProps(),s);return i.jsxRuntimeExports.jsx(o.ark.button,{...t,ref:r})});P.displayName="DialogCloseTrigger";const D=l.forwardRef((s,r)=>{const e=a(),t=o.usePresenceContext(),n=c.mergeProps(e.getContentProps(),t.getPresenceProps(),s);return t.unmounted?null:i.jsxRuntimeExports.jsx(o.ark.div,{...n,ref:o.composeRefs(t.ref,r)})});D.displayName="DialogContent";const j=s=>s.children(a()),x=l.forwardRef((s,r)=>{const e=a(),t=c.mergeProps(e.getDescriptionProps(),s);return i.jsxRuntimeExports.jsx(o.ark.div,{...t,ref:r})});x.displayName="DialogDescription";const m=l.forwardRef((s,r)=>{const e=a(),t=c.mergeProps(e.getPositionerProps(),s);return o.usePresenceContext().unmounted?null:i.jsxRuntimeExports.jsx(o.ark.div,{...t,ref:r})});m.displayName="DialogPositioner";const E=s=>{const r=l.useId(),{getRootNode:e}=o.useEnvironmentContext(),{dir:t}=o.useLocaleContext(),n={id:r,getRootNode:e,dir:t,...s},d=o.useMachine(f.machine,n);return f.connect(d,o.normalizeProps)},h=s=>{const[r,{children:e,...t}]=o.splitPresenceProps(s),[n]=p.splitRenderStrategyProps(r),d=E(t),$=o.usePresence(c.mergeProps({present:d.open},r));return i.jsxRuntimeExports.jsx(v,{value:d,children:i.jsxRuntimeExports.jsx(p.RenderStrategyPropsProvider,{value:n,children:i.jsxRuntimeExports.jsx(o.PresenceProvider,{value:$,children:e})})})},y=s=>{const[r,{value:e,children:t}]=o.splitPresenceProps(s),[n]=p.splitRenderStrategyProps(r),d=o.usePresence(c.mergeProps({present:e.open},r));return i.jsxRuntimeExports.jsx(v,{value:e,children:i.jsxRuntimeExports.jsx(p.RenderStrategyPropsProvider,{value:n,children:i.jsxRuntimeExports.jsx(o.PresenceProvider,{value:d,children:t})})})},R=l.forwardRef((s,r)=>{const e=a(),t=c.mergeProps(e.getTitleProps(),s);return i.jsxRuntimeExports.jsx(o.ark.h2,{...t,ref:r})});R.displayName="DialogTitle";const C=l.forwardRef((s,r)=>{const e=a(),t=o.usePresenceContext(),n=c.mergeProps({...e.getTriggerProps(),"aria-controls":t.unmounted?void 0:e.getTriggerProps()["aria-controls"]},s);return i.jsxRuntimeExports.jsx(o.ark.button,{...n,ref:r})});C.displayName="DialogTrigger";const{withRootProvider:T,withContext:g,PropsProvider:S}=k.createSlotRecipeContext({key:"dialog"}),A=T(y,{defaultProps:{unmountOnExit:!0,lazyMount:!0}}),N=T(h,{defaultProps:{unmountOnExit:!0,lazyMount:!0}}),q=S,B=g(C,"trigger",{forwardAsChild:!0}),b=g(m,"positioner",{forwardAsChild:!0}),z=g(D,"content",{forwardAsChild:!0}),M=g(x,"description",{forwardAsChild:!0}),O=g(R,"title",{forwardAsChild:!0}),F=g(P,"closeTrigger",{forwardAsChild:!0}),H=l.forwardRef(function(r,e){const t=a();return i.jsxRuntimeExports.jsx(w.chakra.button,{...r,ref:e,onClick:()=>t.setOpen(!1)})}),L=g(u,"backdrop",{forwardAsChild:!0}),I=g("div","body"),G=g("div","footer"),J=g("div","header"),K=j;exports.DialogActionTrigger=H;exports.DialogBackdrop=L;exports.DialogBackdrop$1=u;exports.DialogBody=I;exports.DialogCloseTrigger=F;exports.DialogCloseTrigger$1=P;exports.DialogContent=z;exports.DialogContent$1=D;exports.DialogContext=K;exports.DialogContext$1=j;exports.DialogDescription=M;exports.DialogDescription$1=x;exports.DialogFooter=G;exports.DialogHeader=J;exports.DialogPositioner=b;exports.DialogPositioner$1=m;exports.DialogPropsProvider=q;exports.DialogRoot=N;exports.DialogRoot$1=h;exports.DialogRootProvider=A;exports.DialogRootProvider$1=y;exports.DialogTitle=O;exports.DialogTitle$1=R;exports.DialogTrigger=B;exports.DialogTrigger$1=C;exports.useDialogContext=a;
2
+ //# sourceMappingURL=dialog-BeivYfW7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-BeivYfW7.js","sources":["../../node_modules/@ark-ui/react/dist/components/dialog/use-dialog-context.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-context.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-positioner.js","../../node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-root.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-root-provider.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-title.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-trigger.js","../../node_modules/@chakra-ui/react/dist/esm/components/dialog/dialog.js"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [DialogProvider, useDialogContext] = createContext({\n name: \"DialogContext\",\n hookName: \"useDialogContext\",\n providerName: \"<DialogProvider />\"\n});\n\nexport { DialogProvider, useDialogContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { useRenderStrategyPropsContext } from '../../utils/render-strategy.js';\nimport { ark } from '../factory.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogBackdrop = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const renderStrategyProps = useRenderStrategyPropsContext();\n const presence = usePresence({ ...renderStrategyProps, present: dialog.open });\n const mergedProps = mergeProps(dialog.getBackdropProps(), presence.getPresenceProps(), props);\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });\n});\nDialogBackdrop.displayName = \"DialogBackdrop\";\n\nexport { DialogBackdrop };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogCloseTrigger = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const mergedProps = mergeProps(dialog.getCloseTriggerProps(), props);\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nDialogCloseTrigger.displayName = \"DialogCloseTrigger\";\n\nexport { DialogCloseTrigger };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogContent = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const presence = usePresenceContext();\n const mergedProps = mergeProps(dialog.getContentProps(), presence.getPresenceProps(), props);\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });\n});\nDialogContent.displayName = \"DialogContent\";\n\nexport { DialogContent };\n","'use client';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogContext = (props) => props.children(useDialogContext());\n\nexport { DialogContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogDescription = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const mergedProps = mergeProps(dialog.getDescriptionProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nDialogDescription.displayName = \"DialogDescription\";\n\nexport { DialogDescription };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogPositioner = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const mergedProps = mergeProps(dialog.getPositionerProps(), props);\n const presence = usePresenceContext();\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nDialogPositioner.displayName = \"DialogPositioner\";\n\nexport { DialogPositioner };\n","'use client';\nimport * as dialog from '@zag-js/dialog';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\n\nconst useDialog = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const machineProps = {\n id,\n getRootNode,\n dir,\n ...props\n };\n const service = useMachine(dialog.machine, machineProps);\n return dialog.connect(service, normalizeProps);\n};\n\nexport { useDialog };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { splitRenderStrategyProps, RenderStrategyPropsProvider } from '../../utils/render-strategy.js';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { useDialog } from './use-dialog.js';\nimport { DialogProvider } from './use-dialog-context.js';\n\nconst DialogRoot = (props) => {\n const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);\n const [renderStrategyProps] = splitRenderStrategyProps(presenceProps);\n const dialog = useDialog(localProps);\n const presence = usePresence(mergeProps({ present: dialog.open }, presenceProps));\n return /* @__PURE__ */ jsx(DialogProvider, { value: dialog, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) }) });\n};\n\nexport { DialogRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { splitRenderStrategyProps, RenderStrategyPropsProvider } from '../../utils/render-strategy.js';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { DialogProvider } from './use-dialog-context.js';\n\nconst DialogRootProvider = (props) => {\n const [presenceProps, { value: dialog, children }] = splitPresenceProps(props);\n const [renderStrategyProps] = splitRenderStrategyProps(presenceProps);\n const presence = usePresence(mergeProps({ present: dialog.open }, presenceProps));\n return /* @__PURE__ */ jsx(DialogProvider, { value: dialog, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) }) });\n};\n\nexport { DialogRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogTitle = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const mergedProps = mergeProps(dialog.getTitleProps(), props);\n return /* @__PURE__ */ jsx(ark.h2, { ...mergedProps, ref });\n});\nDialogTitle.displayName = \"DialogTitle\";\n\nexport { DialogTitle };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogTrigger = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const presence = usePresenceContext();\n const mergedProps = mergeProps(\n {\n ...dialog.getTriggerProps(),\n \"aria-controls\": presence.unmounted ? void 0 : dialog.getTriggerProps()[\"aria-controls\"]\n },\n props\n );\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nDialogTrigger.displayName = \"DialogTrigger\";\n\nexport { DialogTrigger };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Dialog, useDialogContext } from '@ark-ui/react/dialog';\nimport { forwardRef } from 'react';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withRootProvider,\n withContext,\n useStyles: useDialogStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"dialog\" });\nconst DialogRootProvider = withRootProvider(\n Dialog.RootProvider,\n {\n defaultProps: { unmountOnExit: true, lazyMount: true }\n }\n);\nconst DialogRoot = withRootProvider(Dialog.Root, {\n defaultProps: { unmountOnExit: true, lazyMount: true }\n});\nconst DialogPropsProvider = PropsProvider;\nconst DialogTrigger = withContext(\n Dialog.Trigger,\n \"trigger\",\n { forwardAsChild: true }\n);\nconst DialogPositioner = withContext(Dialog.Positioner, \"positioner\", { forwardAsChild: true });\nconst DialogContent = withContext(\n Dialog.Content,\n \"content\",\n { forwardAsChild: true }\n);\nconst DialogDescription = withContext(Dialog.Description, \"description\", { forwardAsChild: true });\nconst DialogTitle = withContext(\n Dialog.Title,\n \"title\",\n { forwardAsChild: true }\n);\nconst DialogCloseTrigger = withContext(Dialog.CloseTrigger, \"closeTrigger\", { forwardAsChild: true });\nconst DialogActionTrigger = forwardRef(function DialogActionTrigger2(props, ref) {\n const dialog = useDialogContext();\n return /* @__PURE__ */ jsx(chakra.button, { ...props, ref, onClick: () => dialog.setOpen(false) });\n});\nconst DialogBackdrop = withContext(\n Dialog.Backdrop,\n \"backdrop\",\n { forwardAsChild: true }\n);\nconst DialogBody = withContext(\n \"div\",\n \"body\"\n);\nconst DialogFooter = withContext(\n \"div\",\n \"footer\"\n);\nconst DialogHeader = withContext(\n \"div\",\n \"header\"\n);\nconst DialogContext = Dialog.Context;\n\nexport { DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogFooter, DialogHeader, DialogPositioner, DialogPropsProvider, DialogRoot, DialogRootProvider, DialogTitle, DialogTrigger, useDialogStyles };\n"],"names":["DialogProvider","useDialogContext","createContext","DialogBackdrop","forwardRef","props","ref","dialog","renderStrategyProps","useRenderStrategyPropsContext","presence","usePresence","mergedProps","mergeProps","jsx","ark","composeRefs","DialogCloseTrigger","DialogContent","usePresenceContext","DialogContext","DialogDescription","DialogPositioner","useDialog","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","dialog.machine","dialog.connect","normalizeProps","DialogRoot","presenceProps","children","localProps","splitPresenceProps","splitRenderStrategyProps","RenderStrategyPropsProvider","PresenceProvider","DialogRootProvider","DialogTitle","DialogTrigger","withRootProvider","withContext","PropsProvider","createSlotRecipeContext","Dialog.RootProvider","Dialog.Root","DialogPropsProvider","Dialog.Trigger","Dialog.Positioner","Dialog.Content","Dialog.Description","Dialog.Title","Dialog.CloseTrigger","DialogActionTrigger","chakra","Dialog.Backdrop","DialogBody","DialogFooter","DialogHeader","Dialog.Context"],"m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YAAAC,EAEA,cAAAC,CACF,EAAIC,0BAAwB,CAAE,IAAK,SAAU,EACvCN,EAAqBG,EACzBI,EACA,CACE,aAAc,CAAE,cAAe,GAAM,UAAW,EAAI,CACxD,CACA,EACMf,EAAaW,EAAiBK,EAAa,CAC/C,aAAc,CAAE,cAAe,GAAM,UAAW,EAAI,CACtD,CAAC,EACKC,EAAsBJ,EACtBH,EAAgBE,EACpBM,EACA,UACA,CAAE,eAAgB,EAAI,CACxB,EACMhC,EAAmB0B,EAAYO,EAAmB,aAAc,CAAE,eAAgB,EAAM,CAAA,EACxFrC,EAAgB8B,EACpBQ,EACA,UACA,CAAE,eAAgB,EAAI,CACxB,EACMnC,EAAoB2B,EAAYS,EAAoB,cAAe,CAAE,eAAgB,EAAM,CAAA,EAC3FZ,EAAcG,EAClBU,EACA,QACA,CAAE,eAAgB,EAAI,CACxB,EACMzC,EAAqB+B,EAAYW,EAAqB,eAAgB,CAAE,eAAgB,EAAM,CAAA,EAC9FC,EAAsBxD,EAAAA,WAAW,SAA8BC,EAAOC,EAAK,CAC/E,MAAMC,EAASN,EAAkB,EACjC,OAAuBa,wBAAI+C,EAAAA,OAAO,OAAQ,CAAE,GAAGxD,EAAO,IAAAC,EAAK,QAAS,IAAMC,EAAO,QAAQ,EAAK,CAAC,CAAE,CACnG,CAAC,EACKJ,EAAiB6C,EACrBc,EACA,WACA,CAAE,eAAgB,EAAI,CACxB,EACMC,EAAaf,EACjB,MACA,MACF,EACMgB,EAAehB,EACnB,MACA,QACF,EACMiB,EAAejB,EACnB,MACA,QACF,EACM5B,EAAgB8C","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12]}
@@ -0,0 +1,136 @@
1
+ import { j as n } from "./jsx-runtime-C5mzlN2N.js";
2
+ import { forwardRef as g, useId as $ } from "react";
3
+ import { c as A } from "./create-slot-recipe-context-BJmsuxih.js";
4
+ import { c as S } from "./factory-Ctbv0Ozn.js";
5
+ import { c as b, l as p, f as d, h as P, u, i as B, j as E, k as z, n as M, s as m, m as D } from "./use-locale-context-BNU4MHrO.js";
6
+ import { u as O, s as f, R as x } from "./render-strategy-D5Z6LZ1V.js";
7
+ import { a1 as i } from "./index-Ztgrae6O.js";
8
+ import { m as q, c as F } from "./index-B3d3tRic.js";
9
+ const [v, c] = b({
10
+ name: "DialogContext",
11
+ hookName: "useDialogContext",
12
+ providerName: "<DialogProvider />"
13
+ }), C = g((s, e) => {
14
+ const o = c(), r = O(), t = p({ ...r, present: o.open }), l = i(o.getBackdropProps(), t.getPresenceProps(), s);
15
+ return t.unmounted ? null : /* @__PURE__ */ n.jsx(d.div, { ...l, ref: P(t.ref, e) });
16
+ });
17
+ C.displayName = "DialogBackdrop";
18
+ const h = g((s, e) => {
19
+ const o = c(), r = i(o.getCloseTriggerProps(), s);
20
+ return /* @__PURE__ */ n.jsx(d.button, { ...r, ref: e });
21
+ });
22
+ h.displayName = "DialogCloseTrigger";
23
+ const y = g((s, e) => {
24
+ const o = c(), r = u(), t = i(o.getContentProps(), r.getPresenceProps(), s);
25
+ return r.unmounted ? null : /* @__PURE__ */ n.jsx(d.div, { ...t, ref: P(r.ref, e) });
26
+ });
27
+ y.displayName = "DialogContent";
28
+ const H = (s) => s.children(c()), j = g((s, e) => {
29
+ const o = c(), r = i(o.getDescriptionProps(), s);
30
+ return /* @__PURE__ */ n.jsx(d.div, { ...r, ref: e });
31
+ });
32
+ j.displayName = "DialogDescription";
33
+ const T = g((s, e) => {
34
+ const o = c(), r = i(o.getPositionerProps(), s);
35
+ return u().unmounted ? null : /* @__PURE__ */ n.jsx(d.div, { ...r, ref: e });
36
+ });
37
+ T.displayName = "DialogPositioner";
38
+ const I = (s) => {
39
+ const e = $(), { getRootNode: o } = B(), { dir: r } = E(), t = {
40
+ id: e,
41
+ getRootNode: o,
42
+ dir: r,
43
+ ...s
44
+ }, l = z(q, t);
45
+ return F(l, M);
46
+ }, L = (s) => {
47
+ const [e, { children: o, ...r }] = m(s), [t] = f(e), l = I(r), N = p(i({ present: l.open }, e));
48
+ return /* @__PURE__ */ n.jsx(v, { value: l, children: /* @__PURE__ */ n.jsx(x, { value: t, children: /* @__PURE__ */ n.jsx(D, { value: N, children: o }) }) });
49
+ }, G = (s) => {
50
+ const [e, { value: o, children: r }] = m(s), [t] = f(e), l = p(i({ present: o.open }, e));
51
+ return /* @__PURE__ */ n.jsx(v, { value: o, children: /* @__PURE__ */ n.jsx(x, { value: t, children: /* @__PURE__ */ n.jsx(D, { value: l, children: r }) }) });
52
+ }, R = g((s, e) => {
53
+ const o = c(), r = i(o.getTitleProps(), s);
54
+ return /* @__PURE__ */ n.jsx(d.h2, { ...r, ref: e });
55
+ });
56
+ R.displayName = "DialogTitle";
57
+ const k = g((s, e) => {
58
+ const o = c(), r = u(), t = i(
59
+ {
60
+ ...o.getTriggerProps(),
61
+ "aria-controls": r.unmounted ? void 0 : o.getTriggerProps()["aria-controls"]
62
+ },
63
+ s
64
+ );
65
+ return /* @__PURE__ */ n.jsx(d.button, { ...t, ref: e });
66
+ });
67
+ k.displayName = "DialogTrigger";
68
+ const {
69
+ withRootProvider: w,
70
+ withContext: a,
71
+ PropsProvider: J
72
+ } = A({ key: "dialog" }), _ = w(
73
+ G,
74
+ {
75
+ defaultProps: { unmountOnExit: !0, lazyMount: !0 }
76
+ }
77
+ ), oo = w(L, {
78
+ defaultProps: { unmountOnExit: !0, lazyMount: !0 }
79
+ }), eo = J, ro = a(
80
+ k,
81
+ "trigger",
82
+ { forwardAsChild: !0 }
83
+ ), so = a(T, "positioner", { forwardAsChild: !0 }), to = a(
84
+ y,
85
+ "content",
86
+ { forwardAsChild: !0 }
87
+ ), no = a(j, "description", { forwardAsChild: !0 }), ao = a(
88
+ R,
89
+ "title",
90
+ { forwardAsChild: !0 }
91
+ ), io = a(h, "closeTrigger", { forwardAsChild: !0 }), co = g(function(e, o) {
92
+ const r = c();
93
+ return /* @__PURE__ */ n.jsx(S.button, { ...e, ref: o, onClick: () => r.setOpen(!1) });
94
+ }), lo = a(
95
+ C,
96
+ "backdrop",
97
+ { forwardAsChild: !0 }
98
+ ), go = a(
99
+ "div",
100
+ "body"
101
+ ), po = a(
102
+ "div",
103
+ "footer"
104
+ ), uo = a(
105
+ "div",
106
+ "header"
107
+ ), Po = H;
108
+ export {
109
+ po as D,
110
+ co as a,
111
+ oo as b,
112
+ ro as c,
113
+ lo as d,
114
+ so as e,
115
+ to as f,
116
+ io as g,
117
+ uo as h,
118
+ ao as i,
119
+ go as j,
120
+ Po as k,
121
+ no as l,
122
+ eo as m,
123
+ _ as n,
124
+ H as o,
125
+ C as p,
126
+ h as q,
127
+ y as r,
128
+ j as s,
129
+ T as t,
130
+ c as u,
131
+ L as v,
132
+ G as w,
133
+ R as x,
134
+ k as y
135
+ };
136
+ //# sourceMappingURL=dialog-CcVRidaV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-CcVRidaV.js","sources":["../../node_modules/@ark-ui/react/dist/components/dialog/use-dialog-context.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-context.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-positioner.js","../../node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-root.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-root-provider.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-title.js","../../node_modules/@ark-ui/react/dist/components/dialog/dialog-trigger.js","../../node_modules/@chakra-ui/react/dist/esm/components/dialog/dialog.js"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [DialogProvider, useDialogContext] = createContext({\n name: \"DialogContext\",\n hookName: \"useDialogContext\",\n providerName: \"<DialogProvider />\"\n});\n\nexport { DialogProvider, useDialogContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { useRenderStrategyPropsContext } from '../../utils/render-strategy.js';\nimport { ark } from '../factory.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogBackdrop = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const renderStrategyProps = useRenderStrategyPropsContext();\n const presence = usePresence({ ...renderStrategyProps, present: dialog.open });\n const mergedProps = mergeProps(dialog.getBackdropProps(), presence.getPresenceProps(), props);\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });\n});\nDialogBackdrop.displayName = \"DialogBackdrop\";\n\nexport { DialogBackdrop };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogCloseTrigger = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const mergedProps = mergeProps(dialog.getCloseTriggerProps(), props);\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nDialogCloseTrigger.displayName = \"DialogCloseTrigger\";\n\nexport { DialogCloseTrigger };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogContent = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const presence = usePresenceContext();\n const mergedProps = mergeProps(dialog.getContentProps(), presence.getPresenceProps(), props);\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });\n});\nDialogContent.displayName = \"DialogContent\";\n\nexport { DialogContent };\n","'use client';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogContext = (props) => props.children(useDialogContext());\n\nexport { DialogContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogDescription = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const mergedProps = mergeProps(dialog.getDescriptionProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nDialogDescription.displayName = \"DialogDescription\";\n\nexport { DialogDescription };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogPositioner = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const mergedProps = mergeProps(dialog.getPositionerProps(), props);\n const presence = usePresenceContext();\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nDialogPositioner.displayName = \"DialogPositioner\";\n\nexport { DialogPositioner };\n","'use client';\nimport * as dialog from '@zag-js/dialog';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\n\nconst useDialog = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const machineProps = {\n id,\n getRootNode,\n dir,\n ...props\n };\n const service = useMachine(dialog.machine, machineProps);\n return dialog.connect(service, normalizeProps);\n};\n\nexport { useDialog };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { splitRenderStrategyProps, RenderStrategyPropsProvider } from '../../utils/render-strategy.js';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { useDialog } from './use-dialog.js';\nimport { DialogProvider } from './use-dialog-context.js';\n\nconst DialogRoot = (props) => {\n const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);\n const [renderStrategyProps] = splitRenderStrategyProps(presenceProps);\n const dialog = useDialog(localProps);\n const presence = usePresence(mergeProps({ present: dialog.open }, presenceProps));\n return /* @__PURE__ */ jsx(DialogProvider, { value: dialog, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) }) });\n};\n\nexport { DialogRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { splitRenderStrategyProps, RenderStrategyPropsProvider } from '../../utils/render-strategy.js';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { DialogProvider } from './use-dialog-context.js';\n\nconst DialogRootProvider = (props) => {\n const [presenceProps, { value: dialog, children }] = splitPresenceProps(props);\n const [renderStrategyProps] = splitRenderStrategyProps(presenceProps);\n const presence = usePresence(mergeProps({ present: dialog.open }, presenceProps));\n return /* @__PURE__ */ jsx(DialogProvider, { value: dialog, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) }) });\n};\n\nexport { DialogRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogTitle = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const mergedProps = mergeProps(dialog.getTitleProps(), props);\n return /* @__PURE__ */ jsx(ark.h2, { ...mergedProps, ref });\n});\nDialogTitle.displayName = \"DialogTitle\";\n\nexport { DialogTitle };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useDialogContext } from './use-dialog-context.js';\n\nconst DialogTrigger = forwardRef((props, ref) => {\n const dialog = useDialogContext();\n const presence = usePresenceContext();\n const mergedProps = mergeProps(\n {\n ...dialog.getTriggerProps(),\n \"aria-controls\": presence.unmounted ? void 0 : dialog.getTriggerProps()[\"aria-controls\"]\n },\n props\n );\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nDialogTrigger.displayName = \"DialogTrigger\";\n\nexport { DialogTrigger };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Dialog, useDialogContext } from '@ark-ui/react/dialog';\nimport { forwardRef } from 'react';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withRootProvider,\n withContext,\n useStyles: useDialogStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"dialog\" });\nconst DialogRootProvider = withRootProvider(\n Dialog.RootProvider,\n {\n defaultProps: { unmountOnExit: true, lazyMount: true }\n }\n);\nconst DialogRoot = withRootProvider(Dialog.Root, {\n defaultProps: { unmountOnExit: true, lazyMount: true }\n});\nconst DialogPropsProvider = PropsProvider;\nconst DialogTrigger = withContext(\n Dialog.Trigger,\n \"trigger\",\n { forwardAsChild: true }\n);\nconst DialogPositioner = withContext(Dialog.Positioner, \"positioner\", { forwardAsChild: true });\nconst DialogContent = withContext(\n Dialog.Content,\n \"content\",\n { forwardAsChild: true }\n);\nconst DialogDescription = withContext(Dialog.Description, \"description\", { forwardAsChild: true });\nconst DialogTitle = withContext(\n Dialog.Title,\n \"title\",\n { forwardAsChild: true }\n);\nconst DialogCloseTrigger = withContext(Dialog.CloseTrigger, \"closeTrigger\", { forwardAsChild: true });\nconst DialogActionTrigger = forwardRef(function DialogActionTrigger2(props, ref) {\n const dialog = useDialogContext();\n return /* @__PURE__ */ jsx(chakra.button, { ...props, ref, onClick: () => dialog.setOpen(false) });\n});\nconst DialogBackdrop = withContext(\n Dialog.Backdrop,\n \"backdrop\",\n { forwardAsChild: true }\n);\nconst DialogBody = withContext(\n \"div\",\n \"body\"\n);\nconst DialogFooter = withContext(\n \"div\",\n \"footer\"\n);\nconst DialogHeader = withContext(\n \"div\",\n \"header\"\n);\nconst DialogContext = Dialog.Context;\n\nexport { DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogFooter, DialogHeader, DialogPositioner, DialogPropsProvider, DialogRoot, DialogRootProvider, DialogTitle, DialogTrigger, useDialogStyles };\n"],"names":["DialogProvider","useDialogContext","createContext","DialogBackdrop","forwardRef","props","ref","dialog","renderStrategyProps","useRenderStrategyPropsContext","presence","usePresence","mergedProps","mergeProps","jsx","ark","composeRefs","DialogCloseTrigger","DialogContent","usePresenceContext","DialogContext","DialogDescription","DialogPositioner","useDialog","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","dialog.machine","dialog.connect","normalizeProps","DialogRoot","presenceProps","children","localProps","splitPresenceProps","splitRenderStrategyProps","RenderStrategyPropsProvider","PresenceProvider","DialogRootProvider","DialogTitle","DialogTrigger","withRootProvider","withContext","PropsProvider","createSlotRecipeContext","Dialog.RootProvider","Dialog.Root","DialogPropsProvider","Dialog.Trigger","Dialog.Positioner","Dialog.Content","Dialog.Description","Dialog.Title","Dialog.CloseTrigger","DialogActionTrigger","chakra","Dialog.Backdrop","DialogBody","DialogFooter","DialogHeader","Dialog.Context"],"mappings":";;;;;;;;AAGK,MA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;AACA,GACMf,KAAaW,EAAiBK,GAAa;AAAA,EAC/C,cAAc,EAAE,eAAe,IAAM,WAAW,GAAI;AACtD,CAAC,GACKC,KAAsBJ,GACtBH,KAAgBE;AAAA,EACpBM;AAAAA,EACA;AAAA,EACA,EAAE,gBAAgB,GAAI;AACxB,GACMhC,KAAmB0B,EAAYO,GAAmB,cAAc,EAAE,gBAAgB,GAAM,CAAA,GACxFrC,KAAgB8B;AAAA,EACpBQ;AAAAA,EACA;AAAA,EACA,EAAE,gBAAgB,GAAI;AACxB,GACMnC,KAAoB2B,EAAYS,GAAoB,eAAe,EAAE,gBAAgB,GAAM,CAAA,GAC3FZ,KAAcG;AAAA,EAClBU;AAAAA,EACA;AAAA,EACA,EAAE,gBAAgB,GAAI;AACxB,GACMzC,KAAqB+B,EAAYW,GAAqB,gBAAgB,EAAE,gBAAgB,GAAM,CAAA,GAC9FC,KAAsBxD,EAAW,SAA8BC,GAAOC,GAAK;AAC/E,QAAMC,IAASN,EAAkB;AACjC,SAAuBa,gBAAAA,MAAI+C,EAAO,QAAQ,EAAE,GAAGxD,GAAO,KAAAC,GAAK,SAAS,MAAMC,EAAO,QAAQ,EAAK,EAAC,CAAE;AACnG,CAAC,GACKJ,KAAiB6C;AAAA,EACrBc;AAAAA,EACA;AAAA,EACA,EAAE,gBAAgB,GAAI;AACxB,GACMC,KAAaf;AAAA,EACjB;AAAA,EACA;AACF,GACMgB,KAAehB;AAAA,EACnB;AAAA,EACA;AACF,GACMiB,KAAejB;AAAA,EACnB;AAAA,EACA;AACF,GACM5B,KAAgB8C;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12]}
@@ -0,0 +1,2 @@
1
+ "use strict";const t=require("./jsx-runtime-BjDatQAs.js"),R=require("react"),i=require("./button.component-CsJxgblU.js"),C=require("./flex-D14H6HbP.js"),e=require("./dialog-BeivYfW7.js"),k=require("./heading.component-BMvc5kM8.js"),B=require("./usePortalContentRef-CTrvBQ7I.js"),M=require("./use-breakpoint-uBg4-8yY.js"),N=require("./use-locale-context-D0LByRu9.js"),D=({children:o,destructive:a,disabled:l,hideCancel:s=!1,loading:n,loadingText:r,onCancel:d,onSubmit:c,submitText:u="Submit",...x})=>t.jsxRuntimeExports.jsx(e.DialogFooter,{className:"Modal__Footer","data-testid":"kibble-modal-footer",...x,children:o||t.jsxRuntimeExports.jsxs(C.Flex,{alignItems:"center",justifyContent:"space-between",w:"100%",children:[!s&&t.jsxRuntimeExports.jsx(e.DialogActionTrigger,{asChild:!0,className:"Modal__CancelButton","data-testid":"kibble-modal-cancel-button",children:t.jsxRuntimeExports.jsx(i.Button,{variant:"tertiary",onClick:d,children:"Cancel"})}),t.jsxRuntimeExports.jsx(i.Button,{className:"Modal__SubmitButton","data-testid":"kibble-modal-submit-button",onClick:c,loading:n,loadingText:r,disabled:l,variant:a?"primaryDestructive":"primary",children:u})]})}),v=({children:o,footerProps:a,fullScreenMobile:l=!0,header:s,headerProps:n,hideCloseButton:r=!1,hideFooter:d=!1,motionPreset:c="slide-in-bottom",placement:u="center",showExpandButton:x=!1,size:m="md",trigger:j,...g})=>{const p=R.useRef(null),h={contentRef:p},[b,E]=R.useState(!1),_=M.useBreakpointValue({base:l?"full":m,md:m});return t.jsxRuntimeExports.jsxs(e.DialogRoot,{motionPreset:c,placement:u,size:_,...g,expanded:b,children:[j&&t.jsxRuntimeExports.jsx(e.DialogTrigger,{asChild:!0,children:j}),t.jsxRuntimeExports.jsxs(N.Portal,{children:[t.jsxRuntimeExports.jsx(e.DialogBackdrop,{}),t.jsxRuntimeExports.jsx(e.DialogPositioner,{children:t.jsxRuntimeExports.jsx(B.PortalContext.Provider,{value:h,children:t.jsxRuntimeExports.jsxs(e.DialogContent,{className:"Modal","data-testid":"kibble-modal",ref:p,children:[!r&&t.jsxRuntimeExports.jsx(e.DialogCloseTrigger,{asChild:!0,className:"Modal__CloseButton","data-testid":"kibble-modal-close-button",children:t.jsxRuntimeExports.jsx(i.Button,{iconName:"close",variant:"ghostNeutral"})}),x&&t.jsxRuntimeExports.jsx(i.Button,{className:"Modal__ExpandButton","data-testid":"kibble-modal-expand-button",variant:"ghostNeutral",iconName:b?"arrowsIn":"arrowsOut",position:"absolute",top:2,right:12,onClick:()=>E(f=>!f)}),t.jsxRuntimeExports.jsx(e.DialogHeader,{className:"Modal__Header","data-testid":"kibble-modal-header",children:s&&t.jsxRuntimeExports.jsx(e.DialogTitle,{className:"Modal__Title","data-testid":"kibble-modal-title",asChild:!0,children:typeof s=="string"?t.jsxRuntimeExports.jsx(k.WrappedHeading,{size:"xl",...n,children:s}):s})}),t.jsxRuntimeExports.jsx(e.DialogBody,{className:"Modal__Body","data-testid":"kibble-modal-body",children:o}),!d&&t.jsxRuntimeExports.jsx(D,{...a})]})})})]})]})},q=["xs","sm","md","lg","cover","full"],P=["center","top","bottom"],y=["inside","outside"],S=["scale","slide-in-bottom","slide-in-top","slide-in-left","slide-in-right","none"];exports.Modal=v;exports.modalMotionPresets=S;exports.modalPlacements=P;exports.modalScrollBehaviors=y;exports.modalSizes=q;
2
+ //# sourceMappingURL=modal.types-BiEPKa2t.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.types-BiEPKa2t.js","sources":["../../src/components/Modal/components/ModalFooter/modalFooter.component.tsx","../../src/components/Modal/modal.component.tsx","../../src/components/Modal/modal.types.ts"],"sourcesContent":["import React from 'react';\nimport { Dialog } from '@chakra-ui/react/dialog';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Button } from 'components/Button/button.component';\n\nexport interface ModalFooterProps extends Dialog.FooterProps {\n children?: React.ReactNode;\n destructive?: boolean;\n disabled?: boolean;\n hideCancel?: boolean;\n loading?: boolean;\n loadingText?: string;\n onCancel?: () => void;\n onSubmit?: () => void | Promise<void>;\n submitText?: string;\n}\n\nexport const ModalFooter = ({\n children,\n destructive,\n disabled,\n hideCancel = false,\n loading,\n loadingText,\n onCancel,\n onSubmit,\n submitText = 'Submit',\n ...rest\n}: ModalFooterProps): React.JSX.Element => {\n return (\n <Dialog.Footer className=\"Modal__Footer\" data-testid=\"kibble-modal-footer\" {...rest}>\n {children ? (\n children\n ) : (\n <Flex alignItems=\"center\" justifyContent=\"space-between\" w=\"100%\">\n {!hideCancel && (\n <Dialog.ActionTrigger asChild className=\"Modal__CancelButton\" data-testid=\"kibble-modal-cancel-button\">\n <Button variant=\"tertiary\" onClick={onCancel}>\n Cancel\n </Button>\n </Dialog.ActionTrigger>\n )}\n <Button\n className=\"Modal__SubmitButton\"\n data-testid=\"kibble-modal-submit-button\"\n onClick={onSubmit}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n variant={destructive ? 'primaryDestructive' : 'primary'}\n >\n {submitText}\n </Button>\n </Flex>\n )}\n </Dialog.Footer>\n );\n};\n","import React, { useRef, useState } from 'react';\nimport { Dialog } from '@chakra-ui/react/dialog';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { ConditionalValue } from '@chakra-ui/react/styled-system';\nimport { ModalFooter, ModalFooterProps } from './components/ModalFooter/modalFooter.component';\nimport { Heading, HeadingProps } from 'components/Heading/heading.component';\nimport { ModalMotionPreset, ModalPlacement, ModalSize } from './modal.types';\nimport { Button } from 'components/Button/button.component';\nimport { useBreakpointValue } from '@chakra-ui/react';\nimport { PortalContext } from 'hooks/usePortalContentRef';\n\nexport interface ModalProps extends Dialog.RootProps {\n footerProps?: ModalFooterProps;\n fullScreenMobile?: boolean;\n header?: React.ReactNode;\n headerProps?: HeadingProps;\n hideCloseButton?: boolean;\n hideFooter?: boolean;\n motionPreset?: ModalMotionPreset;\n placement?: ModalPlacement;\n showExpandButton?: boolean;\n size?: ConditionalValue<ModalSize>;\n trigger?: React.ReactNode;\n}\n\nexport const Modal = ({\n children,\n footerProps,\n fullScreenMobile = true,\n header,\n headerProps,\n hideCloseButton = false,\n hideFooter = false,\n motionPreset = 'slide-in-bottom',\n placement = 'center',\n showExpandButton = false,\n size = 'md',\n trigger,\n ...rest\n}: ModalProps): React.JSX.Element => {\n const contentRef = useRef<HTMLDivElement>(null!);\n const contextValue = { contentRef };\n const [isExpanded, setIsExpanded] = useState(false);\n const computedSize = useBreakpointValue({\n base: fullScreenMobile ? 'full' : size,\n md: size,\n });\n\n return (\n <Dialog.Root motionPreset={motionPreset} placement={placement} size={computedSize} {...rest} expanded={isExpanded}>\n {trigger && <Dialog.Trigger asChild>{trigger}</Dialog.Trigger>}\n <Portal>\n <Dialog.Backdrop />\n <Dialog.Positioner>\n <PortalContext.Provider value={contextValue}>\n <Dialog.Content className=\"Modal\" data-testid=\"kibble-modal\" ref={contentRef}>\n {!hideCloseButton && (\n <Dialog.CloseTrigger asChild className=\"Modal__CloseButton\" data-testid=\"kibble-modal-close-button\">\n <Button iconName=\"close\" variant=\"ghostNeutral\" />\n </Dialog.CloseTrigger>\n )}\n {showExpandButton && (\n <Button\n className=\"Modal__ExpandButton\"\n data-testid=\"kibble-modal-expand-button\"\n variant=\"ghostNeutral\"\n iconName={isExpanded ? 'arrowsIn' : 'arrowsOut'}\n position=\"absolute\"\n top={2}\n right={12}\n onClick={() => setIsExpanded((prev) => !prev)}\n />\n )}\n <Dialog.Header className=\"Modal__Header\" data-testid=\"kibble-modal-header\">\n {header && (\n <Dialog.Title className=\"Modal__Title\" data-testid=\"kibble-modal-title\" asChild>\n {typeof header === 'string' ? (\n <Heading size=\"xl\" {...headerProps}>\n {header}\n </Heading>\n ) : (\n header\n )}\n </Dialog.Title>\n )}\n </Dialog.Header>\n <Dialog.Body className=\"Modal__Body\" data-testid=\"kibble-modal-body\">\n {children}\n </Dialog.Body>\n {!hideFooter && <ModalFooter {...footerProps} />}\n </Dialog.Content>\n </PortalContext.Provider>\n </Dialog.Positioner>\n </Portal>\n </Dialog.Root>\n );\n};\n","export const modalSizes = ['xs', 'sm', 'md', 'lg', 'cover', 'full'] as const;\nexport type ModalSize = (typeof modalSizes)[number];\n\nexport const modalPlacements = ['center', 'top', 'bottom'] as const;\nexport type ModalPlacement = (typeof modalPlacements)[number];\n\nexport const modalScrollBehaviors = ['inside', 'outside'] as const;\nexport type ModalScrollBehavior = (typeof modalScrollBehaviors)[number];\n\nexport const modalMotionPresets = [\n 'scale',\n 'slide-in-bottom',\n 'slide-in-top',\n 'slide-in-left',\n 'slide-in-right',\n 'none',\n] as const;\nexport type ModalMotionPreset = (typeof modalMotionPresets)[number];\n"],"names":["ModalFooter","children","destructive","disabled","hideCancel","loading","loadingText","onCancel","onSubmit","submitText","rest","Dialog.Footer","Flex","jsx","Dialog.ActionTrigger","Button","Modal","footerProps","fullScreenMobile","header","headerProps","hideCloseButton","hideFooter","motionPreset","placement","showExpandButton","size","trigger","contentRef","useRef","contextValue","isExpanded","setIsExpanded","useState","computedSize","useBreakpointValue","jsxs","Dialog.Root","Dialog.Trigger","Portal","Dialog.Backdrop","Dialog.Positioner","PortalContext","Dialog.Content","Dialog.CloseTrigger","prev","Dialog.Header","Dialog.Title","Heading","Dialog.Body","modalSizes","modalPlacements","modalScrollBehaviors","modalMotionPresets"],"mappings":"+WAiBaA,EAAc,CAAC,CAC1B,SAAAC,EACA,YAAAC,EACA,SAAAC,EACA,WAAAC,EAAa,GACb,QAAAC,EACA,YAAAC,EACA,SAAAC,EACA,SAAAC,EACA,WAAAC,EAAa,SACb,GAAGC,CACL,4BAEKC,eAAA,CAAc,UAAU,gBAAgB,cAAY,sBAAuB,GAAGD,EAC5E,SACCT,4BAECW,OAAK,CAAA,WAAW,SAAS,eAAe,gBAAgB,EAAE,OACxD,SAAA,CAAA,CAACR,GACCS,wBAAAC,EAAAA,oBAAA,CAAqB,QAAO,GAAC,UAAU,sBAAsB,cAAY,6BACxE,iCAACC,EAAAA,OAAO,CAAA,QAAQ,WAAW,QAASR,EAAU,iBAE9C,CAAA,EACF,EAEFM,EAAA,kBAAA,IAACE,EAAA,OAAA,CACC,UAAU,sBACV,cAAY,6BACZ,QAASP,EACT,QAAAH,EACA,YAAAC,EACA,SAAAH,EACA,QAASD,EAAc,qBAAuB,UAE7C,SAAAO,CAAA,CAAA,CACH,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,EACL,MAAO,GACP,QAAS,IAAMC,EAAea,GAAS,CAACA,CAAI,CAAA,CAC9C,EAEDhC,EAAA,kBAAA,IAAAiC,EAAA,aAAA,CAAc,UAAU,gBAAgB,cAAY,sBAClD,SACC3B,GAAAN,EAAAA,kBAAAA,IAACkC,EAAAA,YAAA,CAAa,UAAU,eAAe,cAAY,qBAAqB,QAAO,GAC5E,SAAO,OAAA5B,GAAW,SAChBN,EAAA,kBAAA,IAAAmC,EAAA,eAAA,CAAQ,KAAK,KAAM,GAAG5B,EACpB,SACHD,CAAA,CAAA,EAEAA,CAEJ,CAAA,EAEJ,EACAN,EAAA,kBAAA,IAACoC,EAAA,WAAA,CAAY,UAAU,cAAc,cAAY,oBAC9C,SAAAhD,EACH,EACC,CAACqB,GAAeT,EAAA,kBAAA,IAAAb,EAAA,CAAa,GAAGiB,CAAa,CAAA,CAAA,CAChD,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,EACF,CAEJ,EChGaiC,EAAa,CAAC,KAAM,KAAM,KAAM,KAAM,QAAS,MAAM,EAGrDC,EAAkB,CAAC,SAAU,MAAO,QAAQ,EAG5CC,EAAuB,CAAC,SAAU,SAAS,EAG3CC,EAAqB,CAChC,QACA,kBACA,eACA,gBACA,iBACA,MACF"}
@@ -0,0 +1,95 @@
1
+ import { j as a } from "./jsx-runtime-C5mzlN2N.js";
2
+ import { useRef as k, useState as C } from "react";
3
+ import { B as s } from "./button.component-Br9jCpBx.js";
4
+ import { F as D } from "./flex-smlF8uQG.js";
5
+ import { D as M, a as N, b as B, c as v, d as y, e as P, f as S, g as F, h as T, i as w, j as E } from "./dialog-CcVRidaV.js";
6
+ import { W as R } from "./heading.component-CSbfsm3W.js";
7
+ import { P as z } from "./usePortalContentRef-DO_jc4W9.js";
8
+ import { u as H } from "./use-breakpoint-MQ7agQJe.js";
9
+ import { P as I } from "./use-locale-context-BNU4MHrO.js";
10
+ const V = ({
11
+ children: e,
12
+ destructive: o,
13
+ disabled: l,
14
+ hideCancel: t = !1,
15
+ loading: i,
16
+ loadingText: d,
17
+ onCancel: r,
18
+ onSubmit: n,
19
+ submitText: c = "Submit",
20
+ ...m
21
+ }) => /* @__PURE__ */ a.jsx(M, { className: "Modal__Footer", "data-testid": "kibble-modal-footer", ...m, children: e || /* @__PURE__ */ a.jsxs(D, { alignItems: "center", justifyContent: "space-between", w: "100%", children: [
22
+ !t && /* @__PURE__ */ a.jsx(N, { asChild: !0, className: "Modal__CancelButton", "data-testid": "kibble-modal-cancel-button", children: /* @__PURE__ */ a.jsx(s, { variant: "tertiary", onClick: r, children: "Cancel" }) }),
23
+ /* @__PURE__ */ a.jsx(
24
+ s,
25
+ {
26
+ className: "Modal__SubmitButton",
27
+ "data-testid": "kibble-modal-submit-button",
28
+ onClick: n,
29
+ loading: i,
30
+ loadingText: d,
31
+ disabled: l,
32
+ variant: o ? "primaryDestructive" : "primary",
33
+ children: c
34
+ }
35
+ )
36
+ ] }) }), U = ({
37
+ children: e,
38
+ footerProps: o,
39
+ fullScreenMobile: l = !0,
40
+ header: t,
41
+ headerProps: i,
42
+ hideCloseButton: d = !1,
43
+ hideFooter: r = !1,
44
+ motionPreset: n = "slide-in-bottom",
45
+ placement: c = "center",
46
+ showExpandButton: m = !1,
47
+ size: u = "md",
48
+ trigger: b,
49
+ ...f
50
+ }) => {
51
+ const x = k(null), g = { contentRef: x }, [p, j] = C(!1), h = H({
52
+ base: l ? "full" : u,
53
+ md: u
54
+ });
55
+ return /* @__PURE__ */ a.jsxs(B, { motionPreset: n, placement: c, size: h, ...f, expanded: p, children: [
56
+ b && /* @__PURE__ */ a.jsx(v, { asChild: !0, children: b }),
57
+ /* @__PURE__ */ a.jsxs(I, { children: [
58
+ /* @__PURE__ */ a.jsx(y, {}),
59
+ /* @__PURE__ */ a.jsx(P, { children: /* @__PURE__ */ a.jsx(z.Provider, { value: g, children: /* @__PURE__ */ a.jsxs(S, { className: "Modal", "data-testid": "kibble-modal", ref: x, children: [
60
+ !d && /* @__PURE__ */ a.jsx(F, { asChild: !0, className: "Modal__CloseButton", "data-testid": "kibble-modal-close-button", children: /* @__PURE__ */ a.jsx(s, { iconName: "close", variant: "ghostNeutral" }) }),
61
+ m && /* @__PURE__ */ a.jsx(
62
+ s,
63
+ {
64
+ className: "Modal__ExpandButton",
65
+ "data-testid": "kibble-modal-expand-button",
66
+ variant: "ghostNeutral",
67
+ iconName: p ? "arrowsIn" : "arrowsOut",
68
+ position: "absolute",
69
+ top: 2,
70
+ right: 12,
71
+ onClick: () => j((_) => !_)
72
+ }
73
+ ),
74
+ /* @__PURE__ */ a.jsx(T, { className: "Modal__Header", "data-testid": "kibble-modal-header", children: t && /* @__PURE__ */ a.jsx(w, { className: "Modal__Title", "data-testid": "kibble-modal-title", asChild: !0, children: typeof t == "string" ? /* @__PURE__ */ a.jsx(R, { size: "xl", ...i, children: t }) : t }) }),
75
+ /* @__PURE__ */ a.jsx(E, { className: "Modal__Body", "data-testid": "kibble-modal-body", children: e }),
76
+ !r && /* @__PURE__ */ a.jsx(V, { ...o })
77
+ ] }) }) })
78
+ ] })
79
+ ] });
80
+ }, X = ["xs", "sm", "md", "lg", "cover", "full"], Y = ["center", "top", "bottom"], Z = ["inside", "outside"], $ = [
81
+ "scale",
82
+ "slide-in-bottom",
83
+ "slide-in-top",
84
+ "slide-in-left",
85
+ "slide-in-right",
86
+ "none"
87
+ ];
88
+ export {
89
+ U as M,
90
+ Y as a,
91
+ Z as b,
92
+ $ as c,
93
+ X as m
94
+ };
95
+ //# sourceMappingURL=modal.types-DqAH_jR5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.types-DqAH_jR5.js","sources":["../../src/components/Modal/components/ModalFooter/modalFooter.component.tsx","../../src/components/Modal/modal.component.tsx","../../src/components/Modal/modal.types.ts"],"sourcesContent":["import React from 'react';\nimport { Dialog } from '@chakra-ui/react/dialog';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Button } from 'components/Button/button.component';\n\nexport interface ModalFooterProps extends Dialog.FooterProps {\n children?: React.ReactNode;\n destructive?: boolean;\n disabled?: boolean;\n hideCancel?: boolean;\n loading?: boolean;\n loadingText?: string;\n onCancel?: () => void;\n onSubmit?: () => void | Promise<void>;\n submitText?: string;\n}\n\nexport const ModalFooter = ({\n children,\n destructive,\n disabled,\n hideCancel = false,\n loading,\n loadingText,\n onCancel,\n onSubmit,\n submitText = 'Submit',\n ...rest\n}: ModalFooterProps): React.JSX.Element => {\n return (\n <Dialog.Footer className=\"Modal__Footer\" data-testid=\"kibble-modal-footer\" {...rest}>\n {children ? (\n children\n ) : (\n <Flex alignItems=\"center\" justifyContent=\"space-between\" w=\"100%\">\n {!hideCancel && (\n <Dialog.ActionTrigger asChild className=\"Modal__CancelButton\" data-testid=\"kibble-modal-cancel-button\">\n <Button variant=\"tertiary\" onClick={onCancel}>\n Cancel\n </Button>\n </Dialog.ActionTrigger>\n )}\n <Button\n className=\"Modal__SubmitButton\"\n data-testid=\"kibble-modal-submit-button\"\n onClick={onSubmit}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n variant={destructive ? 'primaryDestructive' : 'primary'}\n >\n {submitText}\n </Button>\n </Flex>\n )}\n </Dialog.Footer>\n );\n};\n","import React, { useRef, useState } from 'react';\nimport { Dialog } from '@chakra-ui/react/dialog';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { ConditionalValue } from '@chakra-ui/react/styled-system';\nimport { ModalFooter, ModalFooterProps } from './components/ModalFooter/modalFooter.component';\nimport { Heading, HeadingProps } from 'components/Heading/heading.component';\nimport { ModalMotionPreset, ModalPlacement, ModalSize } from './modal.types';\nimport { Button } from 'components/Button/button.component';\nimport { useBreakpointValue } from '@chakra-ui/react';\nimport { PortalContext } from 'hooks/usePortalContentRef';\n\nexport interface ModalProps extends Dialog.RootProps {\n footerProps?: ModalFooterProps;\n fullScreenMobile?: boolean;\n header?: React.ReactNode;\n headerProps?: HeadingProps;\n hideCloseButton?: boolean;\n hideFooter?: boolean;\n motionPreset?: ModalMotionPreset;\n placement?: ModalPlacement;\n showExpandButton?: boolean;\n size?: ConditionalValue<ModalSize>;\n trigger?: React.ReactNode;\n}\n\nexport const Modal = ({\n children,\n footerProps,\n fullScreenMobile = true,\n header,\n headerProps,\n hideCloseButton = false,\n hideFooter = false,\n motionPreset = 'slide-in-bottom',\n placement = 'center',\n showExpandButton = false,\n size = 'md',\n trigger,\n ...rest\n}: ModalProps): React.JSX.Element => {\n const contentRef = useRef<HTMLDivElement>(null!);\n const contextValue = { contentRef };\n const [isExpanded, setIsExpanded] = useState(false);\n const computedSize = useBreakpointValue({\n base: fullScreenMobile ? 'full' : size,\n md: size,\n });\n\n return (\n <Dialog.Root motionPreset={motionPreset} placement={placement} size={computedSize} {...rest} expanded={isExpanded}>\n {trigger && <Dialog.Trigger asChild>{trigger}</Dialog.Trigger>}\n <Portal>\n <Dialog.Backdrop />\n <Dialog.Positioner>\n <PortalContext.Provider value={contextValue}>\n <Dialog.Content className=\"Modal\" data-testid=\"kibble-modal\" ref={contentRef}>\n {!hideCloseButton && (\n <Dialog.CloseTrigger asChild className=\"Modal__CloseButton\" data-testid=\"kibble-modal-close-button\">\n <Button iconName=\"close\" variant=\"ghostNeutral\" />\n </Dialog.CloseTrigger>\n )}\n {showExpandButton && (\n <Button\n className=\"Modal__ExpandButton\"\n data-testid=\"kibble-modal-expand-button\"\n variant=\"ghostNeutral\"\n iconName={isExpanded ? 'arrowsIn' : 'arrowsOut'}\n position=\"absolute\"\n top={2}\n right={12}\n onClick={() => setIsExpanded((prev) => !prev)}\n />\n )}\n <Dialog.Header className=\"Modal__Header\" data-testid=\"kibble-modal-header\">\n {header && (\n <Dialog.Title className=\"Modal__Title\" data-testid=\"kibble-modal-title\" asChild>\n {typeof header === 'string' ? (\n <Heading size=\"xl\" {...headerProps}>\n {header}\n </Heading>\n ) : (\n header\n )}\n </Dialog.Title>\n )}\n </Dialog.Header>\n <Dialog.Body className=\"Modal__Body\" data-testid=\"kibble-modal-body\">\n {children}\n </Dialog.Body>\n {!hideFooter && <ModalFooter {...footerProps} />}\n </Dialog.Content>\n </PortalContext.Provider>\n </Dialog.Positioner>\n </Portal>\n </Dialog.Root>\n );\n};\n","export const modalSizes = ['xs', 'sm', 'md', 'lg', 'cover', 'full'] as const;\nexport type ModalSize = (typeof modalSizes)[number];\n\nexport const modalPlacements = ['center', 'top', 'bottom'] as const;\nexport type ModalPlacement = (typeof modalPlacements)[number];\n\nexport const modalScrollBehaviors = ['inside', 'outside'] as const;\nexport type ModalScrollBehavior = (typeof modalScrollBehaviors)[number];\n\nexport const modalMotionPresets = [\n 'scale',\n 'slide-in-bottom',\n 'slide-in-top',\n 'slide-in-left',\n 'slide-in-right',\n 'none',\n] as const;\nexport type ModalMotionPreset = (typeof modalMotionPresets)[number];\n"],"names":["ModalFooter","children","destructive","disabled","hideCancel","loading","loadingText","onCancel","onSubmit","submitText","rest","Dialog.Footer","Flex","jsx","Dialog.ActionTrigger","Button","Modal","footerProps","fullScreenMobile","header","headerProps","hideCloseButton","hideFooter","motionPreset","placement","showExpandButton","size","trigger","contentRef","useRef","contextValue","isExpanded","setIsExpanded","useState","computedSize","useBreakpointValue","jsxs","Dialog.Root","Dialog.Trigger","Portal","Dialog.Backdrop","Dialog.Positioner","PortalContext","Dialog.Content","Dialog.CloseTrigger","prev","Dialog.Header","Dialog.Title","Heading","Dialog.Body","modalSizes","modalPlacements","modalScrollBehaviors","modalMotionPresets"],"mappings":";;;;;;;;;AAiBO,MAAMA,IAAc,CAAC;AAAA,EAC1B,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,GAAGC;AACL,4BAEKC,GAAA,EAAc,WAAU,iBAAgB,eAAY,uBAAuB,GAAGD,GAC5E,UACCT,4BAECW,GAAK,EAAA,YAAW,UAA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