@televet/kibble-ui 4.0.0-beta.45 → 4.0.0-beta.46
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.
- package/dist/chunks/modal.types-CdZepugS.js +205 -0
- package/dist/chunks/modal.types-CdZepugS.js.map +1 -0
- package/dist/chunks/modal.types-DJwWi7cT.js +2 -0
- package/dist/chunks/modal.types-DJwWi7cT.js.map +1 -0
- package/dist/chunks/select.component-D3FwGf7W.js +2 -0
- package/dist/chunks/{select.component-9-2Fo505.js.map → select.component-D3FwGf7W.js.map} +1 -1
- package/dist/chunks/{select.component-C4Kx68wP.js → select.component-DC_tM1JD.js} +75 -75
- package/dist/chunks/{select.component-C4Kx68wP.js.map → select.component-DC_tM1JD.js.map} +1 -1
- package/dist/cjs/components/Modal/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/modal.types-DYbLPZKq.js +0 -197
- package/dist/chunks/modal.types-DYbLPZKq.js.map +0 -1
- package/dist/chunks/modal.types-Dt-zDnrS.js +0 -2
- package/dist/chunks/modal.types-Dt-zDnrS.js.map +0 -1
- package/dist/chunks/select.component-9-2Fo505.js +0 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../chunks/alert.component-CjjsneE_.js"),y=require("../chunks/alert.types-R_9yno9e.js"),T=require("../chunks/avatar.component-C0lDpuBh.js"),a=require("../chunks/avatar.types-Bmt5Uhfb.js"),b=require("../chunks/avatarGroup.component-Cr2dLGn7.js"),h=require("../chunks/button.component-ytAmAAJg.js"),e=require("../chunks/button.types-DsLMGraz.js"),C=require("../chunks/buttonGroup.component-BllwiY24.js"),P=require("../chunks/card.component-nehAyK91.js"),z=require("../chunks/card.types-MvkQTTZF.js"),x=require("../chunks/characterCounter.component-L802Ir9b.js"),k=require("../chunks/checkbox.component-jKQDjGYQ.js"),V=require("../chunks/checkboxGroup.component-v0mNVsPd.js"),D=require("../chunks/conversationCard.component-CTRfZQCI.js"),s=require("../chunks/datePicker.component-DN3Vb2hm.js"),r=require("../chunks/divider.types-luokl8-p.js"),M=require("../chunks/heading.component-CgsSnBVo.js"),f=require("../chunks/icon.component-4aaCABoX.js"),B=require("../chunks/icon.types-2obj_NKG.js"),w=require("../chunks/link.component-CRVhyVdO.js"),n=require("../chunks/logo.types-Ddn7cI2i.js"),A=require("../chunks/menu.component-DfMZGgCy.js"),t=require("../chunks/modal.types-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../chunks/alert.component-CjjsneE_.js"),y=require("../chunks/alert.types-R_9yno9e.js"),T=require("../chunks/avatar.component-C0lDpuBh.js"),a=require("../chunks/avatar.types-Bmt5Uhfb.js"),b=require("../chunks/avatarGroup.component-Cr2dLGn7.js"),h=require("../chunks/button.component-ytAmAAJg.js"),e=require("../chunks/button.types-DsLMGraz.js"),C=require("../chunks/buttonGroup.component-BllwiY24.js"),P=require("../chunks/card.component-nehAyK91.js"),z=require("../chunks/card.types-MvkQTTZF.js"),x=require("../chunks/characterCounter.component-L802Ir9b.js"),k=require("../chunks/checkbox.component-jKQDjGYQ.js"),V=require("../chunks/checkboxGroup.component-v0mNVsPd.js"),D=require("../chunks/conversationCard.component-CTRfZQCI.js"),s=require("../chunks/datePicker.component-DN3Vb2hm.js"),r=require("../chunks/divider.types-luokl8-p.js"),M=require("../chunks/heading.component-CgsSnBVo.js"),f=require("../chunks/icon.component-4aaCABoX.js"),B=require("../chunks/icon.types-2obj_NKG.js"),w=require("../chunks/link.component-CRVhyVdO.js"),n=require("../chunks/logo.types-Ddn7cI2i.js"),A=require("../chunks/menu.component-DfMZGgCy.js"),t=require("../chunks/modal.types-DJwWi7cT.js"),G=require("../chunks/notificationCounter.component-Bm528kQ-.js"),c=require("../chunks/notificationCounter.types-B_-siNfi.js"),I=require("../chunks/picture.component-C9l8Zjob.js"),p=require("../chunks/pinInput.types-CU3UyhyT.js"),W=require("../chunks/popover.component-DU-JJabq.js"),i=require("../chunks/popover.types-BF2KRf_I.js"),L=require("../chunks/radioGroup.component-D9lKUJfv.js"),R=require("../chunks/ratingDots.component-CdawEWbl.js"),O=require("../chunks/select.component-D3FwGf7W.js"),F=require("../chunks/sortableList.component-Engs9U32.js"),H=require("../chunks/spinner.component-BuNeiOw3.js"),K=require("../chunks/spinner.types-BCLN5-H2.js"),u=require("../chunks/styledAvatar.types-BT8cujaA.js"),d=require("../chunks/swatch.types-CeCazVD3.js"),N=require("../chunks/switch.component-QSVPRhDJ.js"),j=require("../chunks/tabs.component-Cy7BLGXM.js"),$=require("../chunks/tag.component-C5MszzTM.js"),m=require("../chunks/tag.types-BnDFgTvb.js"),l=require("../chunks/tagBlock.component-CNWy7Cz4.js"),E=require("../chunks/text.component-Dcx3RoTp.js"),J=require("../chunks/textInput.component-BjQgcjCW.js"),Q=require("../chunks/textarea.component-BXtiF_l4.js"),q=require("../chunks/timePicker.component-Bk5xtY7m.js"),U=require("../chunks/timeRange.component-CWbreNV8.js"),X=require("../chunks/timestamp.component-6Yax0uEP.js"),Y=require("./components/Toast/index.cjs"),Z=require("../chunks/tooltip.component-C7RpuMiK.js"),_=require("../chunks/index-lIficens.js"),v=require("../chunks/index-CkYZf9Pm.js"),o=require("./shared/types/index.cjs"),S=require("../chunks/theme.provider-B8KfvKCf.js");exports.Alert=g.Alert;exports.alertButtonPositions=y.alertButtonPositions;exports.Avatar=T.Avatar;exports.avatarSizes=a.avatarSizes;exports.avatarVariants=a.avatarVariants;exports.AvatarGroup=b.AvatarGroup;exports.Button=h.Button;exports.buttonConfigVariants=e.buttonConfigVariants;exports.buttonIconPositions=e.buttonIconPositions;exports.buttonSizes=e.buttonSizes;exports.buttonSpinnerPlacements=e.buttonSpinnerPlacements;exports.buttonVariants=e.buttonVariants;exports.ButtonGroup=C.ButtonGroup;exports.Card=P.Card;exports.cardSizes=z.cardSizes;exports.CharacterCounter=x.CharacterCounter;exports.Checkbox=k.WrappedCheckbox;exports.CheckboxGroup=V.WrappedCheckboxGroup;exports.ConversationCard=D.ConversationCard;exports.DateFormats=s.DateFormats;exports.DatePicker=s.DatePicker;exports.Divider=r.Divider;exports.dividerOrientations=r.dividerOrientations;exports.dividerSizes=r.dividerSizes;exports.dividerVariants=r.dividerVariants;exports.Heading=M.WrappedHeading;exports.Icon=f.Icon;exports.iconSizes=B.iconSizes;exports.Link=w.Link;exports.Logo=n.Logo;exports.logoTypes=n.logoTypes;exports.logoVariants=n.logoVariants;exports.Menu=A.Menu;exports.Modal=t.Modal;exports.modalMotionPresets=t.modalMotionPresets;exports.modalPlacements=t.modalPlacements;exports.modalScrollBehaviors=t.modalScrollBehaviors;exports.modalSizes=t.modalSizes;exports.NotificationCounter=G.NotificationCounter;exports.notificationCounterSizes=c.notificationCounterSizes;exports.notificationCounterVariants=c.notificationCounterVariants;exports.Picture=I.Picture;exports.PinInput=p.WrappedPinInput;exports.pinInputTypes=p.pinInputTypes;exports.Popover=W.Popover;exports.popoverSizes=i.popoverSizes;exports.popoverTriggerTypes=i.popoverTriggerTypes;exports.popoverVariants=i.popoverVariants;exports.RadioGroup=L.WrappedRadioGroup;exports.RatingDots=R.RatingDots;exports.Select=O.WrappedSelect;exports.SortableList=F.SortableList;exports.Spinner=H.Spinner;exports.spinnerSizes=K.spinnerSizes;exports.StyledAvatar=u.StyledAvatar;exports.styledAvatarTypes=u.styledAvatarTypes;exports.Swatch=d.Swatch;exports.swatchSizes=d.swatchSizes;exports.Switch=N.WrappedSwitch;exports.Tabs=j.Tabs;exports.Tag=$.Tag;exports.closeButtonDisplays=m.closeButtonDisplays;exports.tagSizes=m.tagSizes;exports.TagBlock=l.TagBlock;exports.TagDisabledState=l.TagDisabledState;exports.Text=E.WrappedText;exports.TextInput=J.WrappedTextInput;exports.Textarea=Q.WrappedTextArea;exports.Meridiem=q.Meridiem;exports.TimePicker=q.TimePicker;exports.TimeRange=U.TimeRange;exports.Timestamp=X.Timestamp;exports.useToast=Y.useToast;exports.Tooltip=Z.Tooltip;exports.withDarkMode=_.withDarkMode;exports.withLightMode=_.withLightMode;exports.useColorMode=v.useColorMode;exports.useColorModeValue=v.useColorModeValue;exports.alignments=o.alignments;exports.flexDirections=o.flexDirections;exports.placements=o.placements;exports.statuses=o.statuses;exports.typographyVariants=o.typographyVariants;exports.KibbleThemeProvider=S.KibbleThemeProvider;exports.system=S.system;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -20,7 +20,7 @@ import { i as Q } from "../../chunks/icon.types-DLbVfMjG.js";
|
|
|
20
20
|
import { L as X } from "../../chunks/link.component-DYNc5XEj.js";
|
|
21
21
|
import { L as Z, l as _, a as $ } from "../../chunks/logo.types-B_zly1v-.js";
|
|
22
22
|
import { M as ro } from "../../chunks/menu.component-CTze16Re.js";
|
|
23
|
-
import { M as to, c as so, a as eo, b as po, m as io } from "../../chunks/modal.types-
|
|
23
|
+
import { M as to, c as so, a as eo, b as po, m as io } from "../../chunks/modal.types-CdZepugS.js";
|
|
24
24
|
import { N as no } from "../../chunks/notificationCounter.component-CG5067PO.js";
|
|
25
25
|
import { n as fo, a as co } from "../../chunks/notificationCounter.types-S7ENT1Oj.js";
|
|
26
26
|
import { P as To } from "../../chunks/picture.component-a4DWuwBK.js";
|
|
@@ -29,7 +29,7 @@ import { P as Co } from "../../chunks/popover.component-LH8cQ5xp.js";
|
|
|
29
29
|
import { p as Po, b as zo, a as Wo } from "../../chunks/popover.types-C-V7Diw4.js";
|
|
30
30
|
import { W as Bo } from "../../chunks/radioGroup.component-BijXqMDe.js";
|
|
31
31
|
import { R as ho } from "../../chunks/ratingDots.component-CgBG_tvz.js";
|
|
32
|
-
import { W as Mo } from "../../chunks/select.component-
|
|
32
|
+
import { W as Mo } from "../../chunks/select.component-DC_tM1JD.js";
|
|
33
33
|
import { S as ko } from "../../chunks/sortableList.component-BRToMbfY.js";
|
|
34
34
|
import { S as Lo } from "../../chunks/spinner.component-DCSsW51J.js";
|
|
35
35
|
import { s as Ro } from "../../chunks/spinner.types-g7cTFJkb.js";
|
package/dist/esm/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import { i as Q } from "../chunks/icon.types-DLbVfMjG.js";
|
|
|
20
20
|
import { L as X } from "../chunks/link.component-DYNc5XEj.js";
|
|
21
21
|
import { L as Z, l as _, a as $ } from "../chunks/logo.types-B_zly1v-.js";
|
|
22
22
|
import { M as ro } from "../chunks/menu.component-CTze16Re.js";
|
|
23
|
-
import { M as to, c as eo, a as so, b as po, m as io } from "../chunks/modal.types-
|
|
23
|
+
import { M as to, c as eo, a as so, b as po, m as io } from "../chunks/modal.types-CdZepugS.js";
|
|
24
24
|
import { N as no } from "../chunks/notificationCounter.component-CG5067PO.js";
|
|
25
25
|
import { n as fo, a as lo } from "../chunks/notificationCounter.types-S7ENT1Oj.js";
|
|
26
26
|
import { P as uo } from "../chunks/picture.component-a4DWuwBK.js";
|
|
@@ -29,7 +29,7 @@ import { P as go } from "../chunks/popover.component-LH8cQ5xp.js";
|
|
|
29
29
|
import { p as Po, b as ho, a as zo } from "../chunks/popover.types-C-V7Diw4.js";
|
|
30
30
|
import { W as yo } from "../chunks/radioGroup.component-BijXqMDe.js";
|
|
31
31
|
import { R as Wo } from "../chunks/ratingDots.component-CgBG_tvz.js";
|
|
32
|
-
import { W as Ao } from "../chunks/select.component-
|
|
32
|
+
import { W as Ao } from "../chunks/select.component-DC_tM1JD.js";
|
|
33
33
|
import { S as ko } from "../chunks/sortableList.component-BRToMbfY.js";
|
|
34
34
|
import { S as Io } from "../chunks/spinner.component-DCSsW51J.js";
|
|
35
35
|
import { s as Go } from "../chunks/spinner.types-g7cTFJkb.js";
|
package/package.json
CHANGED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { forwardRef as k, useRef as M, useState as _ } from "react";
|
|
3
|
-
import { B as l } from "./button.component-BWlRjD5a.js";
|
|
4
|
-
import { F as v } from "./flex-C2d2LH-K.js";
|
|
5
|
-
import { c as w } from "./create-slot-recipe-context-DJkLYvCT.js";
|
|
6
|
-
import { c as N } from "./factory-gZxMesut.js";
|
|
7
|
-
import { D as y, a as B, b as P, c as R, d as T, e as A, f as S, u as $, g as E, h as z, i as F } from "./dialog-trigger-sGBMGLMB.js";
|
|
8
|
-
import { W as O } from "./heading.component-DIST7ncC.js";
|
|
9
|
-
import { M as H } from "./tooltip.component-DYBYGsfe.js";
|
|
10
|
-
import { P as I } from "./use-locale-context-zakBNK5b.js";
|
|
11
|
-
const {
|
|
12
|
-
withRootProvider: x,
|
|
13
|
-
withContext: o
|
|
14
|
-
} = w({ key: "dialog" });
|
|
15
|
-
x(
|
|
16
|
-
E,
|
|
17
|
-
{
|
|
18
|
-
defaultProps: { unmountOnExit: !0, lazyMount: !0 }
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
const V = x(y, {
|
|
22
|
-
defaultProps: { unmountOnExit: !0, lazyMount: !0 }
|
|
23
|
-
}), W = o(
|
|
24
|
-
B,
|
|
25
|
-
"trigger",
|
|
26
|
-
{ forwardAsChild: !0 }
|
|
27
|
-
), q = o(R, "positioner", { forwardAsChild: !0 }), G = o(
|
|
28
|
-
T,
|
|
29
|
-
"content",
|
|
30
|
-
{ forwardAsChild: !0 }
|
|
31
|
-
);
|
|
32
|
-
o(z, "description", { forwardAsChild: !0 });
|
|
33
|
-
const J = o(
|
|
34
|
-
S,
|
|
35
|
-
"title",
|
|
36
|
-
{ forwardAsChild: !0 }
|
|
37
|
-
), K = o(A, "closeTrigger", { forwardAsChild: !0 }), L = k(function(s, i) {
|
|
38
|
-
const e = $();
|
|
39
|
-
return /* @__PURE__ */ t.jsx(N.button, { ...s, ref: i, onClick: () => e.setOpen(!1) });
|
|
40
|
-
}), Q = o(
|
|
41
|
-
P,
|
|
42
|
-
"backdrop",
|
|
43
|
-
{ forwardAsChild: !0 }
|
|
44
|
-
), U = o(
|
|
45
|
-
"div",
|
|
46
|
-
"body"
|
|
47
|
-
), X = o(
|
|
48
|
-
"div",
|
|
49
|
-
"footer"
|
|
50
|
-
), Y = o(
|
|
51
|
-
"div",
|
|
52
|
-
"header"
|
|
53
|
-
), Z = ({
|
|
54
|
-
children: a,
|
|
55
|
-
destructive: s,
|
|
56
|
-
disabled: i,
|
|
57
|
-
hideCancel: e = !1,
|
|
58
|
-
loading: r,
|
|
59
|
-
loadingText: n,
|
|
60
|
-
onCancel: d,
|
|
61
|
-
onSubmit: c,
|
|
62
|
-
submitText: m = "Submit",
|
|
63
|
-
...u
|
|
64
|
-
}) => /* @__PURE__ */ t.jsx(
|
|
65
|
-
X,
|
|
66
|
-
{
|
|
67
|
-
className: "Modal__Footer",
|
|
68
|
-
"data-testid": "kibble-modal-footer",
|
|
69
|
-
...u,
|
|
70
|
-
children: a || /* @__PURE__ */ t.jsxs(v, { alignItems: "center", justifyContent: "space-between", w: "100%", children: [
|
|
71
|
-
!e && /* @__PURE__ */ t.jsx(
|
|
72
|
-
L,
|
|
73
|
-
{
|
|
74
|
-
asChild: !0,
|
|
75
|
-
className: "Modal__CancelButton",
|
|
76
|
-
"data-testid": "kibble-modal-cancel-button",
|
|
77
|
-
children: /* @__PURE__ */ t.jsx(l, { variant: "tertiary", onClick: d, children: "Cancel" })
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ t.jsx(
|
|
81
|
-
l,
|
|
82
|
-
{
|
|
83
|
-
className: "Modal__SubmitButton",
|
|
84
|
-
"data-testid": "kibble-modal-submit-button",
|
|
85
|
-
onClick: c,
|
|
86
|
-
loading: r,
|
|
87
|
-
loadingText: n,
|
|
88
|
-
disabled: i,
|
|
89
|
-
variant: s ? "primaryDestructive" : "primary",
|
|
90
|
-
children: m
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
] })
|
|
94
|
-
}
|
|
95
|
-
), mt = ({
|
|
96
|
-
children: a,
|
|
97
|
-
footerProps: s,
|
|
98
|
-
fullScreenMobile: i = !0,
|
|
99
|
-
header: e,
|
|
100
|
-
headerProps: r,
|
|
101
|
-
hideCloseButton: n = !1,
|
|
102
|
-
hideFooter: d = !1,
|
|
103
|
-
motionPreset: c = "slide-in-bottom",
|
|
104
|
-
placement: m = "center",
|
|
105
|
-
showExpandButton: u = !1,
|
|
106
|
-
size: g = "md",
|
|
107
|
-
trigger: f,
|
|
108
|
-
...b
|
|
109
|
-
}) => {
|
|
110
|
-
const h = { contentRef: M(null) }, [p, C] = _(!1), D = F({
|
|
111
|
-
base: i ? "full" : g,
|
|
112
|
-
md: g
|
|
113
|
-
});
|
|
114
|
-
return /* @__PURE__ */ t.jsxs(
|
|
115
|
-
V,
|
|
116
|
-
{
|
|
117
|
-
motionPreset: c,
|
|
118
|
-
placement: m,
|
|
119
|
-
size: D,
|
|
120
|
-
...b,
|
|
121
|
-
expanded: p,
|
|
122
|
-
children: [
|
|
123
|
-
f && /* @__PURE__ */ t.jsx(W, { asChild: !0, children: f }),
|
|
124
|
-
/* @__PURE__ */ t.jsxs(I, { children: [
|
|
125
|
-
/* @__PURE__ */ t.jsx(Q, {}),
|
|
126
|
-
/* @__PURE__ */ t.jsx(q, { children: /* @__PURE__ */ t.jsxs(H.Provider, { value: h, children: [
|
|
127
|
-
" ",
|
|
128
|
-
/* @__PURE__ */ t.jsxs(G, { className: "Modal", "data-testid": "kibble-modal", children: [
|
|
129
|
-
!n && /* @__PURE__ */ t.jsx(
|
|
130
|
-
K,
|
|
131
|
-
{
|
|
132
|
-
asChild: !0,
|
|
133
|
-
className: "Modal__CloseButton",
|
|
134
|
-
"data-testid": "kibble-modal-close-button",
|
|
135
|
-
children: /* @__PURE__ */ t.jsx(l, { iconName: "close", variant: "ghostNeutral" })
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
u && /* @__PURE__ */ t.jsx(
|
|
139
|
-
l,
|
|
140
|
-
{
|
|
141
|
-
className: "Modal__ExpandButton",
|
|
142
|
-
"data-testid": "kibble-modal-expand-button",
|
|
143
|
-
variant: "ghostNeutral",
|
|
144
|
-
iconName: p ? "arrowsIn" : "arrowsOut",
|
|
145
|
-
position: "absolute",
|
|
146
|
-
top: 2,
|
|
147
|
-
right: 12,
|
|
148
|
-
onClick: () => C((j) => !j)
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
/* @__PURE__ */ t.jsx(
|
|
152
|
-
Y,
|
|
153
|
-
{
|
|
154
|
-
className: "Modal__Header",
|
|
155
|
-
"data-testid": "kibble-modal-header",
|
|
156
|
-
children: e && /* @__PURE__ */ t.jsx(
|
|
157
|
-
J,
|
|
158
|
-
{
|
|
159
|
-
className: "Modal__Title",
|
|
160
|
-
"data-testid": "kibble-modal-title",
|
|
161
|
-
asChild: !0,
|
|
162
|
-
children: typeof e == "string" ? /* @__PURE__ */ t.jsx(O, { size: "xl", ...r, children: e }) : e
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
}
|
|
166
|
-
),
|
|
167
|
-
/* @__PURE__ */ t.jsx(
|
|
168
|
-
U,
|
|
169
|
-
{
|
|
170
|
-
className: "Modal__Body",
|
|
171
|
-
"data-testid": "kibble-modal-body",
|
|
172
|
-
children: a
|
|
173
|
-
}
|
|
174
|
-
),
|
|
175
|
-
!d && /* @__PURE__ */ t.jsx(Z, { ...s })
|
|
176
|
-
] })
|
|
177
|
-
] }) })
|
|
178
|
-
] })
|
|
179
|
-
]
|
|
180
|
-
}
|
|
181
|
-
);
|
|
182
|
-
}, ut = ["xs", "sm", "md", "lg", "cover", "full"], gt = ["center", "top", "bottom"], ft = ["inside", "outside"], pt = [
|
|
183
|
-
"scale",
|
|
184
|
-
"slide-in-bottom",
|
|
185
|
-
"slide-in-top",
|
|
186
|
-
"slide-in-left",
|
|
187
|
-
"slide-in-right",
|
|
188
|
-
"none"
|
|
189
|
-
];
|
|
190
|
-
export {
|
|
191
|
-
mt as M,
|
|
192
|
-
gt as a,
|
|
193
|
-
ft as b,
|
|
194
|
-
pt as c,
|
|
195
|
-
ut as m
|
|
196
|
-
};
|
|
197
|
-
//# sourceMappingURL=modal.types-DYbLPZKq.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.types-DYbLPZKq.js","sources":["../../node_modules/@chakra-ui/react/dist/esm/components/dialog/dialog.js","../../src/components/Modal/components/ModalFooter/modalFooter.component.tsx","../../src/components/Modal/modal.component.tsx","../../src/components/Modal/modal.types.ts"],"sourcesContent":["\"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","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\n className=\"Modal__Footer\"\n data-testid=\"kibble-modal-footer\"\n {...rest}\n >\n {children ? (\n children\n ) : (\n <Flex alignItems=\"center\" justifyContent=\"space-between\" w=\"100%\">\n {!hideCancel && (\n <Dialog.ActionTrigger\n asChild\n className=\"Modal__CancelButton\"\n data-testid=\"kibble-modal-cancel-button\"\n >\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 {\n ModalFooter,\n ModalFooterProps,\n} 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 { ModalContext } from \"./context/modal.context\";\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?: 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\n motionPreset={motionPreset}\n placement={placement}\n size={computedSize}\n {...rest}\n expanded={isExpanded}\n >\n {trigger && <Dialog.Trigger asChild>{trigger}</Dialog.Trigger>}\n <Portal>\n <Dialog.Backdrop />\n <Dialog.Positioner>\n <ModalContext.Provider value={contextValue}>\n {\" \"}\n <Dialog.Content className=\"Modal\" data-testid=\"kibble-modal\">\n {!hideCloseButton && (\n <Dialog.CloseTrigger\n asChild\n className=\"Modal__CloseButton\"\n data-testid=\"kibble-modal-close-button\"\n >\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\n className=\"Modal__Header\"\n data-testid=\"kibble-modal-header\"\n >\n {header && (\n <Dialog.Title\n className=\"Modal__Title\"\n data-testid=\"kibble-modal-title\"\n asChild\n >\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\n className=\"Modal__Body\"\n data-testid=\"kibble-modal-body\"\n >\n {children}\n </Dialog.Body>\n {!hideFooter && <ModalFooter {...footerProps} />}\n </Dialog.Content>\n </ModalContext.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":["withRootProvider","withContext","createSlotRecipeContext","Dialog.RootProvider","DialogRoot","Dialog.Root","DialogTrigger","Dialog.Trigger","DialogPositioner","Dialog.Positioner","DialogContent","Dialog.Content","Dialog.Description","DialogTitle","Dialog.Title","DialogCloseTrigger","Dialog.CloseTrigger","DialogActionTrigger","forwardRef","props","ref","dialog","useDialogContext","jsx","chakra","DialogBackdrop","Dialog.Backdrop","DialogBody","DialogFooter","DialogHeader","ModalFooter","children","destructive","disabled","hideCancel","loading","loadingText","onCancel","onSubmit","submitText","rest","Dialog.Footer","jsxs","Flex","Dialog.ActionTrigger","Button","Modal","footerProps","fullScreenMobile","header","headerProps","hideCloseButton","hideFooter","motionPreset","placement","showExpandButton","size","trigger","contextValue","useRef","isExpanded","setIsExpanded","useState","computedSize","useBreakpointValue","Portal","ModalContext","prev","Dialog.Header","Heading","Dialog.Body","modalSizes","modalPlacements","modalScrollBehaviors","modalMotionPresets"],"mappings":";;;;;;;;;;AAQA,MAAM;AAAA,EACJ,kBAAAA;AAAA,EACA,aAAAC;AAGF,IAAIC,EAAwB,EAAE,KAAK,SAAQ,CAAE;AAClBF;AAAA,EACzBG;AAAAA,EACA;AAAA,IACE,cAAc,EAAE,eAAe,IAAM,WAAW,GAAI;AAAA,EACxD;AACA;AACA,MAAMC,IAAaJ,EAAiBK,GAAa;AAAA,EAC/C,cAAc,EAAE,eAAe,IAAM,WAAW,GAAI;AACtD,CAAC,GAEKC,IAAgBL;AAAA,EACpBM;AAAAA,EACA;AAAA,EACA,EAAE,gBAAgB,GAAI;AACxB,GACMC,IAAmBP,EAAYQ,GAAmB,cAAc,EAAE,gBAAgB,IAAM,GACxFC,IAAgBT;AAAA,EACpBU;AAAAA,EACA;AAAA,EACA,EAAE,gBAAgB,GAAI;AACxB;AAC0BV,EAAYW,GAAoB,eAAe,EAAE,gBAAgB,GAAM,CAAA;AACjG,MAAMC,IAAcZ;AAAA,EAClBa;AAAAA,EACA;AAAA,EACA,EAAE,gBAAgB,GAAI;AACxB,GACMC,IAAqBd,EAAYe,GAAqB,g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UAAU,OAAO,QAAQ,GAG5CC,KAAuB,CAAC,UAAU,SAAS,GAG3CC,KAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./jsx-runtime-BjDatQAs.js"),p=require("react"),a=require("./button.component-ytAmAAJg.js"),k=require("./flex-DKWxn8hO.js"),_=require("./create-slot-recipe-context-D-pJ8fgs.js"),M=require("./factory-CkTX_WOU.js"),e=require("./dialog-trigger-C86J6PDS.js"),v=require("./heading.component-CgsSnBVo.js"),B=require("./tooltip.component-C7RpuMiK.js"),w=require("./use-locale-context-BdqHZ8L8.js"),{withRootProvider:h,withContext:o}=_.createSlotRecipeContext({key:"dialog"});h(e.DialogRootProvider,{defaultProps:{unmountOnExit:!0,lazyMount:!0}});const y=h(e.DialogRoot,{defaultProps:{unmountOnExit:!0,lazyMount:!0}}),N=o(e.DialogTrigger,"trigger",{forwardAsChild:!0}),P=o(e.DialogPositioner,"positioner",{forwardAsChild:!0}),T=o(e.DialogContent,"content",{forwardAsChild:!0});o(e.DialogDescription,"description",{forwardAsChild:!0});const q=o(e.DialogTitle,"title",{forwardAsChild:!0}),S=o(e.DialogCloseTrigger,"closeTrigger",{forwardAsChild:!0}),A=p.forwardRef(function(n,r){const s=e.useDialogContext();return t.jsxRuntimeExports.jsx(M.chakra.button,{...n,ref:r,onClick:()=>s.setOpen(!1)})}),z=o(e.DialogBackdrop,"backdrop",{forwardAsChild:!0}),F=o("div","body"),O=o("div","footer"),H=o("div","header"),I=({children:i,destructive:n,disabled:r,hideCancel:s=!1,loading:l,loadingText:d,onCancel:c,onSubmit:u,submitText:x="Submit",...m})=>t.jsxRuntimeExports.jsx(O,{className:"Modal__Footer","data-testid":"kibble-modal-footer",...m,children:i||t.jsxRuntimeExports.jsxs(k.Flex,{alignItems:"center",justifyContent:"space-between",w:"100%",children:[!s&&t.jsxRuntimeExports.jsx(A,{asChild:!0,className:"Modal__CancelButton","data-testid":"kibble-modal-cancel-button",children:t.jsxRuntimeExports.jsx(a.Button,{variant:"tertiary",onClick:c,children:"Cancel"})}),t.jsxRuntimeExports.jsx(a.Button,{className:"Modal__SubmitButton","data-testid":"kibble-modal-submit-button",onClick:u,loading:l,loadingText:d,disabled:r,variant:n?"primaryDestructive":"primary",children:x})]})}),V=({children:i,footerProps:n,fullScreenMobile:r=!0,header:s,headerProps:l,hideCloseButton:d=!1,hideFooter:c=!1,motionPreset:u="slide-in-bottom",placement:x="center",showExpandButton:m=!1,size:g="md",trigger:j,...R})=>{const f={contentRef:p.useRef(null)},[b,C]=p.useState(!1),E=e.useBreakpointValue({base:r?"full":g,md:g});return t.jsxRuntimeExports.jsxs(y,{motionPreset:u,placement:x,size:E,...R,expanded:b,children:[j&&t.jsxRuntimeExports.jsx(N,{asChild:!0,children:j}),t.jsxRuntimeExports.jsxs(w.Portal,{children:[t.jsxRuntimeExports.jsx(z,{}),t.jsxRuntimeExports.jsx(P,{children:t.jsxRuntimeExports.jsxs(B.ModalContext.Provider,{value:f,children:[" ",t.jsxRuntimeExports.jsxs(T,{className:"Modal","data-testid":"kibble-modal",children:[!d&&t.jsxRuntimeExports.jsx(S,{asChild:!0,className:"Modal__CloseButton","data-testid":"kibble-modal-close-button",children:t.jsxRuntimeExports.jsx(a.Button,{iconName:"close",variant:"ghostNeutral"})}),m&&t.jsxRuntimeExports.jsx(a.Button,{className:"Modal__ExpandButton","data-testid":"kibble-modal-expand-button",variant:"ghostNeutral",iconName:b?"arrowsIn":"arrowsOut",position:"absolute",top:2,right:12,onClick:()=>C(D=>!D)}),t.jsxRuntimeExports.jsx(H,{className:"Modal__Header","data-testid":"kibble-modal-header",children:s&&t.jsxRuntimeExports.jsx(q,{className:"Modal__Title","data-testid":"kibble-modal-title",asChild:!0,children:typeof s=="string"?t.jsxRuntimeExports.jsx(v.WrappedHeading,{size:"xl",...l,children:s}):s})}),t.jsxRuntimeExports.jsx(F,{className:"Modal__Body","data-testid":"kibble-modal-body",children:i}),!c&&t.jsxRuntimeExports.jsx(I,{...n})]})]})})]})]})},L=["xs","sm","md","lg","cover","full"],W=["center","top","bottom"],G=["inside","outside"],J=["scale","slide-in-bottom","slide-in-top","slide-in-left","slide-in-right","none"];exports.Modal=V;exports.modalMotionPresets=J;exports.modalPlacements=W;exports.modalScrollBehaviors=G;exports.modalSizes=L;
|
|
2
|
-
//# sourceMappingURL=modal.types-Dt-zDnrS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.types-Dt-zDnrS.js","sources":["../../node_modules/@chakra-ui/react/dist/esm/components/dialog/dialog.js","../../src/components/Modal/components/ModalFooter/modalFooter.component.tsx","../../src/components/Modal/modal.component.tsx","../../src/components/Modal/modal.types.ts"],"sourcesContent":["\"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","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\n className=\"Modal__Footer\"\n data-testid=\"kibble-modal-footer\"\n {...rest}\n >\n {children ? (\n children\n ) : (\n <Flex alignItems=\"center\" justifyContent=\"space-between\" w=\"100%\">\n {!hideCancel && (\n <Dialog.ActionTrigger\n asChild\n className=\"Modal__CancelButton\"\n data-testid=\"kibble-modal-cancel-button\"\n >\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 {\n ModalFooter,\n ModalFooterProps,\n} 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 { ModalContext } from \"./context/modal.context\";\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?: 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\n motionPreset={motionPreset}\n placement={placement}\n size={computedSize}\n {...rest}\n expanded={isExpanded}\n >\n {trigger && <Dialog.Trigger asChild>{trigger}</Dialog.Trigger>}\n <Portal>\n <Dialog.Backdrop />\n <Dialog.Positioner>\n <ModalContext.Provider value={contextValue}>\n {\" \"}\n <Dialog.Content className=\"Modal\" data-testid=\"kibble-modal\">\n {!hideCloseButton && (\n <Dialog.CloseTrigger\n asChild\n className=\"Modal__CloseButton\"\n data-testid=\"kibble-modal-close-button\"\n >\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\n className=\"Modal__Header\"\n data-testid=\"kibble-modal-header\"\n >\n {header && (\n <Dialog.Title\n className=\"Modal__Title\"\n data-testid=\"kibble-modal-title\"\n asChild\n >\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\n className=\"Modal__Body\"\n data-testid=\"kibble-modal-body\"\n >\n {children}\n </Dialog.Body>\n {!hideFooter && <ModalFooter {...footerProps} />}\n </Dialog.Content>\n </ModalContext.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":["withRootProvider","withContext","createSlotRecipeContext","Dialog.RootProvider","DialogRoot","Dialog.Root","DialogTrigger","Dialog.Trigger","DialogPositioner","Dialog.Positioner","DialogContent","Dialog.Content","Dialog.Description","DialogTitle","Dialog.Title","DialogCloseTrigger","Dialog.CloseTrigger","DialogActionTrigger","forwardRef","props","ref","dialog","useDialogContext","jsx","chakra","DialogBackdrop","Dialog.Backdrop","DialogBody","DialogFooter","DialogHeader","ModalFooter","children","destructive","disabled","hideCancel","loading","loadingText","onCancel","onSubmit","submitText","rest","Dialog.Footer","jsxs","Flex","Dialog.ActionTrigger","Button","Modal","footerProps","fullScreenMobile","header","headerProps","hideCloseButton","hideFooter","motionPreset","placement","showExpandButton","size","trigger","contextValue","useRef","isExpanded","setIsExpanded","useState","computedSize","useBreakpointValue","Portal","ModalContext","prev","Dialog.Header","Heading","Dialog.Body","modalSizes","modalPlacements","modalScrollBehaviors","modalMotionPresets"],"mappings":"oaAQM,CACJ,iBAAAA,EACA,YAAAC,CAGF,EAAIC,EAAuB,wBAAC,CAAE,IAAK,QAAQ,CAAE,EAClBF,EACzBG,EAAmB,mBACnB,CACE,aAAc,CAAE,cAAe,GAAM,UAAW,EAAI,CACxD,CACA,EACA,MAAMC,EAAaJ,EAAiBK,aAAa,CAC/C,aAAc,CAAE,cAAe,GAAM,UAAW,EAAI,CACtD,CAAC,EAEKC,EAAgBL,EACpBM,EAAc,cACd,UACA,CAAE,eAAgB,EAAI,CACxB,EACMC,EAAmBP,EAAYQ,EAAiB,iBAAE,aAAc,CAAE,eAAgB,GAAM,EACxFC,EAAgBT,EACpBU,EAAc,cACd,UACA,CAAE,eAAgB,EAAI,CACxB,EAC0BV,EAAYW,oBAAoB,cAAe,CAAE,eAAgB,EAAM,CAAA,EACjG,MAAMC,EAAcZ,EAClBa,EAAY,YACZ,QACA,CAAE,eAAgB,EAAI,CACxB,EACMC,EAAqBd,EAAYe,EAAmB,mBAAE,eAAgB,C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BAAAA,IAAA8C,EAAAA,eAAA,CAAQ,KAAK,KAAM,GAAGnB,EACpB,SAAAD,CACH,CAAA,EAEAA,CAAA,CAAA,CAEJ,CAEJ,EACA1B,EAAA,kBAAA,IAAC+C,EAAA,CACC,UAAU,cACV,cAAY,oBAEX,SAAAvC,CAAA,CACH,EACC,CAACqB,GAAe7B,EAAA,kBAAA,IAAAO,EAAA,CAAa,GAAGiB,CAAa,CAAA,CAAA,CAChD,CAAA,CAAA,CAAA,CACF,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CACF,CAEJ,ECvHawB,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","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BjDatQAs.js"),l=require("react"),B=require("./withFormControl-YVXep-WE.js"),J=require("./icon.component-4aaCABoX.js"),K=require("./button.component-ytAmAAJg.js"),h=require("./text.component-Dcx3RoTp.js"),Q=require("./spinner.component-BuNeiOw3.js"),n=require("./use-locale-context-BdqHZ8L8.js"),U=require("./create-slot-recipe-context-D-pJ8fgs.js"),R=require("./icons-BVYVhH49.js"),C=require("./use-field-context--wBJQY1R.js"),p=require("./index-CZ42b9rT.js"),S=require("./index-BDnnTdaJ.js"),X=require("./tooltip.component-C7RpuMiK.js"),f=require("./flex-DKWxn8hO.js"),Y=t=>t&&t.__esModule?t:{default:t},Z=Y(l),z=t=>new S.ListCollection(t),[v,d]=n.createContext({name:"SelectContext",hookName:"useSelectContext",providerName:"<SelectProvider />"}),E=l.forwardRef((t,o)=>{const s=d(),r=p.mergeProps(s.getClearTriggerProps(),t);return e.jsxRuntimeExports.jsx(n.ark.button,{...r,ref:o})});E.displayName="SelectClearTrigger";const I=l.forwardRef((t,o)=>{const s=d(),r=n.usePresenceContext(),c=p.mergeProps(s.getContentProps(),r.getPresenceProps(),t);return r.unmounted?null:e.jsxRuntimeExports.jsx(n.ark.div,{...c,ref:n.composeRefs(r.ref,o)})});I.displayName="SelectContent";const w=l.forwardRef((t,o)=>{const s=d(),r=p.mergeProps(s.getControlProps(),t);return e.jsxRuntimeExports.jsx(n.ark.div,{...r,ref:o})});w.displayName="SelectControl";const b=l.forwardRef((t,o)=>{const s=d(),r=p.mergeProps(s.getHiddenSelectProps(),t),c=s.value.length===0,a=C.useFieldContext();return e.jsxRuntimeExports.jsxs(n.ark.select,{"aria-describedby":a?.ariaDescribedby,...r,ref:o,children:[c&&e.jsxRuntimeExports.jsx("option",{value:""}),s.collection.items.map((i,x)=>e.jsxRuntimeExports.jsx("option",{value:s.collection.getItemValue(i)??"",disabled:s.collection.getItemDisabled(i),children:s.collection.stringifyItem(i)},x))]})});b.displayName="SelectHiddenSelect";const y=l.forwardRef((t,o)=>{const s=d(),r=p.mergeProps(s.getIndicatorProps(),t);return e.jsxRuntimeExports.jsx(n.ark.div,{...r,ref:o})});y.displayName="SelectIndicator";const[ee,he]=n.createContext({name:"SelectItemContext",hookName:"useSelectItemContext",providerName:"<SelectItemProvider />"}),[te,N]=n.createContext({name:"SelectItemPropsContext",hookName:"useSelectItemPropsContext",providerName:"<SelectItemPropsProvider />"}),T=l.forwardRef((t,o)=>{const[s,r]=n.createSplitProps()(t,["item","persistFocus"]),c=d(),a=p.mergeProps(c.getItemProps(s),r),i=c.getItemState(s);return e.jsxRuntimeExports.jsx(te,{value:s,children:e.jsxRuntimeExports.jsx(ee,{value:i,children:e.jsxRuntimeExports.jsx(n.ark.div,{...a,ref:o})})})});T.displayName="SelectItem";const[re,se]=n.createContext({name:"SelectItemGroupPropsContext",hookName:"useSelectItemGroupPropsContext",providerName:"<SelectItemGroupPropsProvider />"}),k=l.forwardRef((t,o)=>{const s=l.useId(),[r,c]=n.createSplitProps()(t,["id"]),a={id:s,...r},i=d(),x=p.mergeProps(i.getItemGroupProps(a),c);return e.jsxRuntimeExports.jsx(re,{value:a,children:e.jsxRuntimeExports.jsx(n.ark.div,{...x,ref:o})})});k.displayName="SelectItemGroup";const q=l.forwardRef((t,o)=>{const s=d(),r=se(),c=p.mergeProps(s.getItemGroupLabelProps({htmlFor:r.id}),t);return e.jsxRuntimeExports.jsx(n.ark.div,{...c,ref:o})});q.displayName="SelectItemGroupLabel";const G=l.forwardRef((t,o)=>{const s=d(),r=N(),c=p.mergeProps(s.getItemIndicatorProps(r),t);return e.jsxRuntimeExports.jsx(n.ark.div,{...c,ref:o})});G.displayName="SelectItemIndicator";const A=l.forwardRef((t,o)=>{const s=d(),r=N(),c=p.mergeProps(s.getItemTextProps(r),t);return e.jsxRuntimeExports.jsx(n.ark.span,{...c,ref:o})});A.displayName="SelectItemText";const F=l.forwardRef((t,o)=>{const s=d(),r=p.mergeProps(s.getLabelProps(),t);return e.jsxRuntimeExports.jsx(n.ark.label,{...r,ref:o})});F.displayName="SelectLabel";const V=l.forwardRef((t,o)=>{const s=d(),r=p.mergeProps(s.getPositionerProps(),t);return n.usePresenceContext().unmounted?null:e.jsxRuntimeExports.jsx(n.ark.div,{...r,ref:o})});V.displayName="SelectPositioner";const oe=t=>{const o=l.useId(),{dir:s}=n.useLocaleContext(),{getRootNode:r}=n.useEnvironmentContext(),c=C.useFieldContext(),a={id:o,ids:{label:c?.ids.label,hiddenSelect:c?.ids.control},disabled:c?.disabled,readOnly:c?.readOnly,invalid:c?.invalid,required:c?.required,dir:s,getRootNode:r,...t},i=n.useMachine(S.machine,a);return S.connect(i,n.normalizeProps)},ne=(t,o)=>{const[s,r]=n.splitPresenceProps(t),[c,a]=n.createSplitProps()(r,["closeOnSelect","collection","composite","defaultHighlightedValue","defaultOpen","defaultValue","deselectable","disabled","form","highlightedValue","id","ids","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onValueChange","open","positioning","readOnly","required","scrollToIndexFn","value"]),i=oe(c),x=n.usePresence(p.mergeProps({present:i.open},s)),j=p.mergeProps(i.getRootProps(),a);return e.jsxRuntimeExports.jsx(v,{value:i,children:e.jsxRuntimeExports.jsx(n.PresenceProvider,{value:x,children:e.jsxRuntimeExports.jsx(n.ark.div,{...j,ref:o})})})},ce=l.forwardRef(ne),le=(t,o)=>{const[s,r]=n.splitPresenceProps(t),[{value:c},a]=n.createSplitProps()(r,["value"]),i=n.usePresence(p.mergeProps({present:c.open},s)),x=p.mergeProps(c.getRootProps(),a);return e.jsxRuntimeExports.jsx(v,{value:c,children:e.jsxRuntimeExports.jsx(n.PresenceProvider,{value:i,children:e.jsxRuntimeExports.jsx(n.ark.div,{...x,ref:o})})})},ie=l.forwardRef(le),_=l.forwardRef((t,o)=>{const s=d(),r=p.mergeProps(s.getTriggerProps(),t);return e.jsxRuntimeExports.jsx(n.ark.button,{...r,ref:o})});_.displayName="SelectTrigger";const $=l.forwardRef((t,o)=>{const{children:s,placeholder:r,...c}=t,a=d(),i=p.mergeProps(a.getValueTextProps(),c);return e.jsxRuntimeExports.jsx(n.ark.span,{...i,ref:o,children:s||a.valueAsString||r})});$.displayName="SelectValueText";const{withProvider:L,withContext:u}=U.createSlotRecipeContext({key:"select"});L(ie,"root",{forwardAsChild:!0});const ae=L(ce,"root",{forwardAsChild:!0,defaultProps:{positioning:{sameWidth:!0}}}),pe=u(_,"trigger",{forwardAsChild:!0}),de=u(V,"positioner",{forwardAsChild:!0}),ue=u(I,"content",{forwardAsChild:!0}),xe=u($,"valueText",{forwardAsChild:!0}),me=u(E,"clearTrigger",{forwardAsChild:!0,defaultProps:{children:e.jsxRuntimeExports.jsx(R.CloseIcon,{boxSize:"1em"})}});u(k,"itemGroup",{forwardAsChild:!0});u(q,"itemGroupLabel",{forwardAsChild:!0});const Pe=u(T,"item",{forwardAsChild:!0});u(A,"itemText",{forwardAsChild:!0});u(G,"itemIndicator",{forwardAsChild:!0,defaultProps:{children:e.jsxRuntimeExports.jsx(R.CheckIcon,{})}});const je=u("div","indicatorGroup");u(y,"indicator",{forwardAsChild:!0,defaultProps:{children:e.jsxRuntimeExports.jsx(R.ChevronDownIcon,{})}});const ge=u(w,"control",{forwardAsChild:!0});u(F,"label",{forwardAsChild:!0});const Se=b,O=({item:t,onContrast:o,shouldTruncateText:s,size:r})=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[t.leftElement,typeof t.label=="string"?e.jsxRuntimeExports.jsx(h.WrappedText,{size:r,truncated:s,variant:t.variant||(o?"onContrast":"default"),children:t.label}):t.label]}),Re=({placeholder:t="",placeholderElement:o,...s})=>{const r=d(),c=l.useMemo(()=>r.selectedItems[0],[r]);return e.jsxRuntimeExports.jsxs(pe,{children:[!c&&o,e.jsxRuntimeExports.jsx(xe,{placeholder:t,children:c&&e.jsxRuntimeExports.jsx(O,{item:c,...s})})]})},fe=B.withFormControl(({clearable:t,emptyPlaceholder:o="No options available",loading:s,onContrast:r,options:c,placeholder:a="",placeholderElement:i,selectRef:x,shouldTruncateText:j,size:P="md",...H})=>{const{contentRef:M}=X.useModalContentRef(),W=r?"onContrast":"default",g=l.useMemo(()=>z({items:c??[],itemToString:m=>typeof m.label=="string"?m.label:m.valueText||"",itemToValue:m=>m.value}),[c]);return e.jsxRuntimeExports.jsxs(ae,{className:"Select","data-testid":"kibble-select",collection:g,size:P,variant:W,...H,children:[e.jsxRuntimeExports.jsx(Se,{ref:x}),e.jsxRuntimeExports.jsxs(ge,{children:[e.jsxRuntimeExports.jsx(Re,{placeholder:a,placeholderElement:i,onContrast:!!r,shouldTruncateText:!!j,size:P}),e.jsxRuntimeExports.jsxs(je,{children:[t&&e.jsxRuntimeExports.jsx(me,{asChild:!0,children:e.jsxRuntimeExports.jsx(K.Button,{iconName:"close",onContrast:r,size:P==="lg"?"sm":"xs",variant:"ghostNeutral"})}),e.jsxRuntimeExports.jsx(J.Icon,{name:"chevronDown",size:P,variant:r?"onContrast":"default"})]})]}),e.jsxRuntimeExports.jsx(n.Portal,{container:M||void 0,children:e.jsxRuntimeExports.jsx(de,{children:e.jsxRuntimeExports.jsx(ue,{children:s?e.jsxRuntimeExports.jsx(f.Flex,{w:"100%",justifyContent:"center",py:3,children:e.jsxRuntimeExports.jsx(Q.Spinner,{variant:r?"brandOnContrast":"brand",size:P})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:g.items.length?g.items.map(m=>e.jsxRuntimeExports.jsx(Pe,{item:m,children:e.jsxRuntimeExports.jsx(O,{item:m,onContrast:!!r,shouldTruncateText:!!j,size:P})},m.value)):e.jsxRuntimeExports.jsx(f.Flex,{w:"100%",justifyContent:"center",py:3,children:e.jsxRuntimeExports.jsx(h.WrappedText,{size:"sm",variant:r?"subtleOnContrast":"subtle",children:o})})})})})})]})}),D=Z.default.forwardRef((t,o)=>e.jsxRuntimeExports.jsx(fe,{selectRef:o,...t}));D.displayName="Select";exports.WrappedSelect=D;
|
|
2
|
-
//# sourceMappingURL=select.component-9-2Fo505.js.map
|