@overmap-ai/blocks 0.0.1-alpha.21 → 0.0.1-alpha.24
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/Input/index.d.ts +1 -1
- package/dist/Popover/Popover.d.ts +3 -0
- package/dist/Popover/index.d.ts +1 -0
- package/dist/Popover/typings.d.ts +17 -0
- package/dist/Select/index.d.ts +1 -1
- package/dist/blocks.js +123 -117
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +2 -2
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +7 -3
package/dist/Input/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Input
|
|
1
|
+
export * from "./Input";
|
|
2
2
|
export * from "./typings.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Popover";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Popover as RadixPopover } from "@radix-ui/themes";
|
|
3
|
+
type RadixPopoverRootProps = React.ComponentProps<typeof RadixPopover.Root>;
|
|
4
|
+
type RadixPopoverContentProps = React.ComponentProps<typeof RadixPopover.Content>;
|
|
5
|
+
export interface PopoverProps extends Omit<RadixPopoverContentProps, "children" | "content"> {
|
|
6
|
+
/** children will represent the content contained within the popover,
|
|
7
|
+
it is using the RenderProps pattern to pass a 'Close' tag which
|
|
8
|
+
can be used to wrap any components in to close the popover on click of those said components*/
|
|
9
|
+
content: (Close: typeof RadixPopover.Close) => ReactNode;
|
|
10
|
+
/** The component that will cause the popover to show or hide on click depending on its current open state */
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** determines if popover should default to open on render */
|
|
13
|
+
defaultOpen?: RadixPopoverRootProps["defaultOpen"];
|
|
14
|
+
/** if true disables interaction with other elements until popover is closed*/
|
|
15
|
+
modal?: RadixPopoverRootProps["modal"];
|
|
16
|
+
}
|
|
17
|
+
export {};
|
package/dist/Select/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Select
|
|
1
|
+
export * from "./Select";
|
|
2
2
|
export * from "./typings.ts";
|
package/dist/blocks.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Button as H, IconButton as B, Flex as h, Dialog as C, AlertDialog as f, Select as
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import k, { forwardRef as D, memo as O, useState as R, useCallback as N, useMemo as P, createContext as q, useContext as G } from "react";
|
|
3
|
+
import { Button as H, IconButton as B, Flex as h, Dialog as C, AlertDialog as f, Select as x, TextField as I, Text as J, Popover as b } from "@radix-ui/themes";
|
|
4
4
|
import { Cross1Icon as K } from "@radix-ui/react-icons";
|
|
5
|
-
const Q = "_fluid_zkx83_5", U = "_hoverSpin90Clockwise_zkx83_19", V = "_hoverSpin180Clockwise_zkx83_30", W = "_hoverSpin360Clockwise_zkx83_41",
|
|
5
|
+
const Q = "_fluid_zkx83_5", U = "_hoverSpin90Clockwise_zkx83_19", V = "_hoverSpin180Clockwise_zkx83_30", W = "_hoverSpin360Clockwise_zkx83_41", w = {
|
|
6
6
|
default: "_default_zkx83_1",
|
|
7
7
|
fluid: Q,
|
|
8
8
|
hoverSpin90Clockwise: U,
|
|
9
9
|
hoverSpin180Clockwise: V,
|
|
10
10
|
hoverSpin360Clockwise: W
|
|
11
11
|
};
|
|
12
|
-
function X(
|
|
13
|
-
return
|
|
12
|
+
function X(i) {
|
|
13
|
+
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
14
14
|
}
|
|
15
|
-
var
|
|
15
|
+
var T = { exports: {} };
|
|
16
16
|
/*!
|
|
17
17
|
Copyright (c) 2018 Jed Watson.
|
|
18
18
|
Licensed under the MIT License (MIT), see
|
|
19
19
|
http://jedwatson.github.io/classnames
|
|
20
20
|
*/
|
|
21
|
-
(function(
|
|
21
|
+
(function(i) {
|
|
22
22
|
(function() {
|
|
23
|
-
var
|
|
23
|
+
var c = {}.hasOwnProperty;
|
|
24
24
|
function o() {
|
|
25
|
-
for (var
|
|
26
|
-
var e = arguments[
|
|
25
|
+
for (var n = [], t = 0; t < arguments.length; t++) {
|
|
26
|
+
var e = arguments[t];
|
|
27
27
|
if (e) {
|
|
28
28
|
var s = typeof e;
|
|
29
29
|
if (s === "string" || s === "number")
|
|
30
|
-
|
|
30
|
+
n.push(e);
|
|
31
31
|
else if (Array.isArray(e)) {
|
|
32
32
|
if (e.length) {
|
|
33
33
|
var l = o.apply(null, e);
|
|
34
|
-
l &&
|
|
34
|
+
l && n.push(l);
|
|
35
35
|
}
|
|
36
36
|
} else if (s === "object") {
|
|
37
37
|
if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]")) {
|
|
38
|
-
|
|
38
|
+
n.push(e.toString());
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
41
|
for (var a in e)
|
|
42
|
-
|
|
42
|
+
c.call(e, a) && e[a] && n.push(a);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
return
|
|
46
|
+
return n.join(" ");
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
i.exports ? (o.default = o, i.exports = o) : window.classNames = o;
|
|
49
49
|
})();
|
|
50
|
-
})(
|
|
51
|
-
var Y =
|
|
52
|
-
const _ = /* @__PURE__ */ X(Y),
|
|
53
|
-
spin90Clockwise:
|
|
54
|
-
spin180Clockwise:
|
|
55
|
-
spin360Clockwise:
|
|
50
|
+
})(T);
|
|
51
|
+
var Y = T.exports;
|
|
52
|
+
const _ = /* @__PURE__ */ X(Y), L = {
|
|
53
|
+
spin90Clockwise: w.hoverSpin90Clockwise,
|
|
54
|
+
spin180Clockwise: w.hoverSpin180Clockwise,
|
|
55
|
+
spin360Clockwise: w.hoverSpin360Clockwise
|
|
56
56
|
};
|
|
57
|
-
function
|
|
58
|
-
if (typeof
|
|
59
|
-
if (!("initial" in
|
|
57
|
+
function $(i, c) {
|
|
58
|
+
if (typeof i == "object") {
|
|
59
|
+
if (!("initial" in i))
|
|
60
60
|
throw new Error("Expected initial property to be set in Responsive object");
|
|
61
|
-
return Object.fromEntries(Object.entries(
|
|
61
|
+
return Object.fromEntries(Object.entries(i).map(([o, n]) => [o, c[n]]));
|
|
62
62
|
} else
|
|
63
|
-
return
|
|
63
|
+
return c[i];
|
|
64
64
|
}
|
|
65
65
|
const j = {
|
|
66
66
|
small: "1",
|
|
@@ -71,55 +71,55 @@ const j = {
|
|
|
71
71
|
success: "green",
|
|
72
72
|
danger: "red",
|
|
73
73
|
info: "gray"
|
|
74
|
-
}, Z =
|
|
75
|
-
const a = (
|
|
76
|
-
return /* @__PURE__ */
|
|
74
|
+
}, Z = D(function({ className: c, severity: o = "primary", size: n = "medium", hoverEffects: t, fluid: e, ...s }, l) {
|
|
75
|
+
const a = (t == null ? void 0 : t.map((u) => L[u])) || [];
|
|
76
|
+
return /* @__PURE__ */ r(
|
|
77
77
|
H,
|
|
78
78
|
{
|
|
79
79
|
ref: l,
|
|
80
|
-
className: _(
|
|
81
|
-
[
|
|
80
|
+
className: _(w.default, c, a, {
|
|
81
|
+
[w.fluid]: e
|
|
82
82
|
}),
|
|
83
83
|
color: g[o],
|
|
84
|
-
size:
|
|
84
|
+
size: $(n, j),
|
|
85
85
|
...s
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
|
-
}), A =
|
|
89
|
-
const a = (e == null ? void 0 : e.map((u) =>
|
|
90
|
-
return /* @__PURE__ */
|
|
88
|
+
}), A = k.memo(Z), ee = D(function({ className: c, children: o, severity: n = "primary", size: t = "medium", hoverEffects: e, ...s }, l) {
|
|
89
|
+
const a = (e == null ? void 0 : e.map((u) => L[u])) || [];
|
|
90
|
+
return /* @__PURE__ */ r(
|
|
91
91
|
B,
|
|
92
92
|
{
|
|
93
|
-
className: _(
|
|
93
|
+
className: _(c, a),
|
|
94
94
|
ref: l,
|
|
95
|
-
color: g[
|
|
96
|
-
size:
|
|
95
|
+
color: g[n],
|
|
96
|
+
size: $(t, j),
|
|
97
97
|
...s,
|
|
98
98
|
children: o
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
|
-
}),
|
|
102
|
-
const { title:
|
|
101
|
+
}), ge = k.memo(ee), oe = O((i) => {
|
|
102
|
+
const { title: c, description: o, content: n, closeDialog: t } = i;
|
|
103
103
|
return /* @__PURE__ */ d(h, { direction: "column", gap: "2", children: [
|
|
104
104
|
/* @__PURE__ */ d(h, { direction: "column", gap: "1", children: [
|
|
105
105
|
/* @__PURE__ */ d(h, { justify: "between", children: [
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ r(C.Title, { mb: "0", children: c }),
|
|
107
|
+
/* @__PURE__ */ r(C.Close, { children: /* @__PURE__ */ r(B, { color: "gray", variant: "ghost", "aria-label": "Close", children: /* @__PURE__ */ r(K, {}) }) })
|
|
108
108
|
] }),
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ r(C.Description, { children: o })
|
|
110
110
|
] }),
|
|
111
|
-
t
|
|
111
|
+
n(t)
|
|
112
112
|
] });
|
|
113
|
-
}),
|
|
114
|
-
const { children:
|
|
113
|
+
}), ve = O((i) => {
|
|
114
|
+
const { children: c, size: o, onOpen: n, onCloseInterrupt: t, ...e } = i, [s, l] = R(!1), a = N(
|
|
115
115
|
(p) => {
|
|
116
|
-
if (p &&
|
|
117
|
-
|
|
118
|
-
else if (!p &&
|
|
119
|
-
return
|
|
116
|
+
if (p && n)
|
|
117
|
+
n();
|
|
118
|
+
else if (!p && t)
|
|
119
|
+
return t(() => l(!1));
|
|
120
120
|
l(p);
|
|
121
121
|
},
|
|
122
|
-
[
|
|
122
|
+
[n, t]
|
|
123
123
|
), u = N(
|
|
124
124
|
(p) => {
|
|
125
125
|
if (p != null && p.force)
|
|
@@ -129,143 +129,149 @@ const j = {
|
|
|
129
129
|
[a]
|
|
130
130
|
);
|
|
131
131
|
return /* @__PURE__ */ d(C.Root, { open: s, onOpenChange: a, children: [
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
132
|
+
/* @__PURE__ */ r(C.Content, { size: o, children: /* @__PURE__ */ r(oe, { closeDialog: u, ...e }) }),
|
|
133
|
+
c(C.Trigger)
|
|
134
134
|
] });
|
|
135
|
-
}),
|
|
136
|
-
const { title:
|
|
135
|
+
}), M = (i) => /* @__PURE__ */ r(f.Title, { mb: "0", ...i }), ne = (i) => {
|
|
136
|
+
const { title: c, description: o, actionText: n = "Confirm", cancelText: t = "Cancel", onAction: e, onCancel: s, severity: l } = i;
|
|
137
137
|
return /* @__PURE__ */ d(h, { direction: "column", gap: "2", children: [
|
|
138
138
|
/* @__PURE__ */ d(h, { direction: "column", gap: "1", children: [
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ r(M, { children: c }),
|
|
140
|
+
/* @__PURE__ */ r(f.Description, { children: o })
|
|
141
141
|
] }),
|
|
142
142
|
/* @__PURE__ */ d(h, { gap: "3", mt: "4", justify: "end", children: [
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ r(f.Cancel, { children: /* @__PURE__ */ r(A, { variant: "soft", severity: "info", onClick: s, children: t }) }),
|
|
144
|
+
/* @__PURE__ */ r(f.Action, { children: /* @__PURE__ */ r(A, { variant: "solid", severity: l, onClick: e, children: n }) })
|
|
145
145
|
] })
|
|
146
146
|
] });
|
|
147
|
-
}, te =
|
|
148
|
-
const { open:
|
|
147
|
+
}, te = O((i) => {
|
|
148
|
+
const { open: c, setOpen: o, children: n, ...t } = i, e = P(() => ({
|
|
149
149
|
close: () => o(!1),
|
|
150
|
-
Title:
|
|
150
|
+
Title: M,
|
|
151
151
|
Description: f.Description
|
|
152
152
|
}), [o]);
|
|
153
|
-
return /* @__PURE__ */ d(f.Root, { open:
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
|
|
153
|
+
return /* @__PURE__ */ d(f.Root, { open: c, onOpenChange: o, children: [
|
|
154
|
+
/* @__PURE__ */ r(f.Content, { children: "content" in t ? t.content(e) : /* @__PURE__ */ r(ne, { ...t }) }),
|
|
155
|
+
n
|
|
156
156
|
] });
|
|
157
|
-
}),
|
|
157
|
+
}), F = q(() => {
|
|
158
158
|
throw new Error("No AlertDialogProvider found");
|
|
159
159
|
}), ie = {
|
|
160
160
|
content: () => null
|
|
161
|
-
}, Se =
|
|
162
|
-
const [
|
|
161
|
+
}, Se = O(({ children: i }) => {
|
|
162
|
+
const [c, o] = R(!1), [n, t] = R(ie), e = N(
|
|
163
163
|
(s) => {
|
|
164
|
-
if (
|
|
164
|
+
if (c)
|
|
165
165
|
throw new Error("AlertDialog is already open");
|
|
166
|
-
|
|
166
|
+
t(s), o(!0);
|
|
167
167
|
},
|
|
168
|
-
[
|
|
168
|
+
[c]
|
|
169
169
|
);
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
-
}), we = () => G(
|
|
170
|
+
return /* @__PURE__ */ r(te, { open: c, setOpen: o, ...n, children: /* @__PURE__ */ r(F.Provider, { value: e, children: i }) });
|
|
171
|
+
}), we = () => G(F), re = "_itemDefault_19sov_5", ce = "_fluid_19sov_9", z = {
|
|
172
172
|
default: "_default_19sov_1",
|
|
173
|
-
itemDefault:
|
|
174
|
-
fluid:
|
|
175
|
-
}, se =
|
|
176
|
-
className:
|
|
173
|
+
itemDefault: re,
|
|
174
|
+
fluid: ce
|
|
175
|
+
}, se = D(function({
|
|
176
|
+
className: c,
|
|
177
177
|
fluid: o,
|
|
178
|
-
size:
|
|
179
|
-
variant:
|
|
178
|
+
size: n = "medium",
|
|
179
|
+
variant: t = "surface",
|
|
180
180
|
severity: e = "primary",
|
|
181
181
|
placeholder: s = "Select",
|
|
182
182
|
side: l,
|
|
183
183
|
items: a = [],
|
|
184
184
|
...u
|
|
185
185
|
}, p) {
|
|
186
|
-
const
|
|
187
|
-
return /* @__PURE__ */ d(
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
|
|
186
|
+
const v = P(() => $(n, j), [n]);
|
|
187
|
+
return /* @__PURE__ */ d(x.Root, { size: v, children: [
|
|
188
|
+
/* @__PURE__ */ r(
|
|
189
|
+
x.Trigger,
|
|
190
190
|
{
|
|
191
|
-
className: _(
|
|
191
|
+
className: _(c, z.default, {
|
|
192
192
|
[z.fluid]: o
|
|
193
193
|
}),
|
|
194
194
|
ref: p,
|
|
195
|
-
variant:
|
|
195
|
+
variant: t,
|
|
196
196
|
placeholder: s,
|
|
197
197
|
color: g[e],
|
|
198
198
|
...u
|
|
199
199
|
}
|
|
200
200
|
),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
201
|
+
/* @__PURE__ */ r(
|
|
202
|
+
x.Content,
|
|
203
203
|
{
|
|
204
204
|
side: l,
|
|
205
205
|
position: "popper",
|
|
206
|
-
variant:
|
|
206
|
+
variant: t !== "surface" ? "soft" : "solid",
|
|
207
207
|
color: g[e],
|
|
208
|
-
children: a.map(({ label:
|
|
208
|
+
children: a.map(({ label: y, value: m, ...E }) => /* @__PURE__ */ r(x.Item, { className: _(z.itemDefault), value: m, ...E, children: y }, m))
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
] });
|
|
212
|
-
}), ke =
|
|
212
|
+
}), ke = k.memo(se), le = "_accommodateCharCount_fni4k_1", ae = "_noLeftIcon_fni4k_9", ue = "_noRightIcon_fni4k_13", pe = "_charCount_fni4k_17", S = {
|
|
213
213
|
accommodateCharCount: le,
|
|
214
214
|
default: "_default_fni4k_5",
|
|
215
215
|
noLeftIcon: ae,
|
|
216
216
|
noRightIcon: ue,
|
|
217
217
|
charCount: pe
|
|
218
|
-
}, de =
|
|
219
|
-
className:
|
|
218
|
+
}, de = D(function({
|
|
219
|
+
className: c,
|
|
220
220
|
leftIcon: o,
|
|
221
|
-
rightIcon:
|
|
222
|
-
size:
|
|
223
|
-
showInputLength: e
|
|
221
|
+
rightIcon: n,
|
|
222
|
+
size: t = "medium",
|
|
223
|
+
showInputLength: e,
|
|
224
224
|
value: s,
|
|
225
225
|
variant: l,
|
|
226
226
|
severity: a = "primary",
|
|
227
227
|
...u
|
|
228
228
|
}, p) {
|
|
229
|
-
const
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
|
|
229
|
+
const v = P(() => $(t, j), [t]), y = e || e === void 0 && u.maxLength !== void 0, m = s !== void 0 ? s.toString() : void 0;
|
|
230
|
+
return /* @__PURE__ */ d(
|
|
231
|
+
I.Root,
|
|
232
232
|
{
|
|
233
233
|
className: _({
|
|
234
|
-
[
|
|
234
|
+
[S.accommodateCharCount]: y
|
|
235
235
|
}),
|
|
236
|
-
size:
|
|
236
|
+
size: v,
|
|
237
237
|
variant: l,
|
|
238
238
|
color: g[a],
|
|
239
239
|
children: [
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
|
|
240
|
+
/* @__PURE__ */ r(I.Slot, { children: o }),
|
|
241
|
+
/* @__PURE__ */ r(
|
|
242
|
+
I.Input,
|
|
243
243
|
{
|
|
244
|
-
className: _(
|
|
245
|
-
[
|
|
246
|
-
[
|
|
244
|
+
className: _(S.default, c, {
|
|
245
|
+
[S.noLeftIcon]: !o,
|
|
246
|
+
[S.noRightIcon]: !n
|
|
247
247
|
}),
|
|
248
248
|
ref: p,
|
|
249
|
-
size:
|
|
249
|
+
size: v,
|
|
250
250
|
variant: l,
|
|
251
251
|
color: g[a],
|
|
252
252
|
...u
|
|
253
253
|
}
|
|
254
254
|
),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
|
|
255
|
+
/* @__PURE__ */ r(I.Slot, { children: n }),
|
|
256
|
+
y && /* @__PURE__ */ r(J, { as: "p", className: S.charCount, size: "1", color: "gray", children: u.maxLength !== void 0 ? `${m == null ? void 0 : m.length}/${u.maxLength}` : `${m == null ? void 0 : m.length}` })
|
|
257
257
|
]
|
|
258
258
|
}
|
|
259
|
-
)
|
|
260
|
-
}),
|
|
259
|
+
);
|
|
260
|
+
}), De = k.memo(de), me = D(function({ defaultOpen: c = !1, modal: o = !1, content: n, children: t, ...e }, s) {
|
|
261
|
+
return /* @__PURE__ */ d(b.Root, { defaultOpen: c, modal: o, children: [
|
|
262
|
+
/* @__PURE__ */ r(b.Trigger, { children: t }),
|
|
263
|
+
/* @__PURE__ */ r(b.Content, { ref: s, ...e, children: n(b.Close) })
|
|
264
|
+
] });
|
|
265
|
+
}), ye = k.memo(me);
|
|
261
266
|
export {
|
|
262
267
|
te as AlertDialog,
|
|
263
|
-
|
|
268
|
+
F as AlertDialogContent,
|
|
264
269
|
Se as AlertDialogProvider,
|
|
265
270
|
A as Button,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
271
|
+
ve as Dialog,
|
|
272
|
+
ge as IconButton,
|
|
273
|
+
De as Input,
|
|
274
|
+
ye as Popover,
|
|
269
275
|
ke as Select,
|
|
270
276
|
we as useAlertDialog
|
|
271
277
|
};
|
package/dist/blocks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sources":["../node_modules/classnames/index.js","../src/Buttons/constants.ts","../src/utils.ts","../src/constants.ts","../src/Buttons/Button.tsx","../src/Buttons/IconButton.tsx","../src/Dialogs/Dialog/DialogContent.tsx","../src/Dialogs/Dialog/Dialog.tsx","../src/Dialogs/AlertDialog/AlertDialogContent.tsx","../src/Dialogs/AlertDialog/AlertDialog.tsx","../src/Dialogs/AlertDialog/context.tsx","../src/Dialogs/AlertDialog/hooks.ts","../src/Select/Select.tsx","../src/Input/Input.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import { ButtonHoverEffect } from \"./typings.ts\"\nimport styles from \"./Button.module.sass\"\n\nexport const hoverEffectClassNameMapping: Record<ButtonHoverEffect, string | undefined> = {\n\tspin90Clockwise: styles.hoverSpin90Clockwise,\n\tspin180Clockwise: styles.hoverSpin180Clockwise,\n\tspin360Clockwise: styles.hoverSpin360Clockwise,\n}\n","import { Responsive } from \"@radix-ui/themes\"\n\n// applyResponsiveMapping is a helper function used to map the keys of a Radix Responsive type that can be understood\n// by a Radix component or primitive. The point of this is to leverage our own custom prop names and values while still\n// using Radix's built in Responsiveness functionality.\n/**\n * Returns an object with mapped key values or a single mapped value\n * @param value an object or string\n * @param mapping a Record mapping the object values of param value\n */\nexport function applyResponsiveMapping<T extends string, K>(value: Responsive<T>, mapping: Record<T, K>) {\n\tif (typeof value === \"object\") {\n\t\tif (!(\"initial\" in value)) {\n\t\t\t// Responsive objects require an 'initial' property to be set that acts as a default\n\t\t\tthrow new Error(\"Expected initial property to be set in Responsive object\")\n\t\t}\n\t\treturn Object.fromEntries(Object.entries(value).map(([key, _value]) => [key, mapping[_value]]))\n\t} else {\n\t\treturn mapping[value]\n\t}\n}\n","import React from \"react\"\nimport { Severity, Size } from \"./typings.ts\"\nimport { Theme } from \"@radix-ui/themes\"\n\ntype ThemeProps = React.ComponentProps<typeof Theme>\n\n// Mappings\nexport const SizeMapping: Record<Size, \"1\" | \"2\" | \"3\"> = {\n\tsmall: \"1\",\n\tmedium: \"2\",\n\tlarge: \"3\",\n}\n\nexport const SeverityColorMapping: Record<Severity, ThemeProps[\"accentColor\"]> = {\n\tprimary: \"indigo\",\n\tsuccess: \"green\",\n\tdanger: \"red\",\n\tinfo: \"gray\",\n}\n","import React, { FC, forwardRef } from \"react\"\nimport { ButtonProps } from \"./typings.ts\"\nimport styles from \"./Button.module.sass\"\nimport classNames from \"classnames\"\nimport { Button as RadixButton } from \"@radix-ui/themes\"\nimport { hoverEffectClassNameMapping } from \"./constants.ts\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\n\nconst _Button = forwardRef(function Button(\n\t{ className, severity = \"primary\", size = \"medium\", hoverEffects, fluid, ...rest }: ButtonProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst hoverEffectClasses =\n\t\thoverEffects?.map((hoverEffect) => {\n\t\t\treturn hoverEffectClassNameMapping[hoverEffect]\n\t\t}) || []\n\n\treturn (\n\t\t<RadixButton\n\t\t\tref={ref}\n\t\t\tclassName={classNames(styles.default, className, hoverEffectClasses, {\n\t\t\t\t[styles.fluid!]: fluid,\n\t\t\t})}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\tsize={applyResponsiveMapping(size, SizeMapping)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n})\n\n// using FC so storybook correctly displays the component props\nconst Button: FC<ButtonProps> = React.memo(_Button)\n\nexport default Button\n","import React, { FC, forwardRef } from \"react\"\nimport { ButtonProps } from \"./typings.ts\"\nimport classNames from \"classnames\"\nimport { IconButton as RadixIconButton } from \"@radix-ui/themes\"\nimport { hoverEffectClassNameMapping } from \"./constants.ts\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\n\ninterface IconButtonProps extends Omit<ButtonProps, \"fluid\"> {\n\t\"aria-label\": string\n}\n\nconst _Button = forwardRef(function Button(\n\t{ className, children, severity = \"primary\", size = \"medium\", hoverEffects, ...rest }: IconButtonProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst hoverEffectClasses =\n\t\thoverEffects?.map((hoverEffect) => {\n\t\t\treturn hoverEffectClassNameMapping[hoverEffect]\n\t\t}) || []\n\n\treturn (\n\t\t<RadixIconButton\n\t\t\tclassName={classNames(className, hoverEffectClasses)}\n\t\t\tref={ref}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\tsize={applyResponsiveMapping(size, SizeMapping)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</RadixIconButton>\n\t)\n})\n\n// using FC so storybook correctly displays the component props\nconst IconButton: FC<IconButtonProps> = React.memo(_Button)\n\nexport default IconButton\n","import { memo } from \"react\"\nimport { Dialog, Flex, IconButton } from \"@radix-ui/themes\"\nimport { Cross1Icon } from \"@radix-ui/react-icons\"\nimport { DialogContentProps } from \"./typings\"\n\nexport const DialogContent = memo((props: DialogContentProps) => {\n\tconst { title, description, content, closeDialog } = props\n\treturn (\n\t\t<Flex direction={\"column\"} gap={\"2\"}>\n\t\t\t<Flex direction={\"column\"} gap={\"1\"}>\n\t\t\t\t<Flex justify={\"between\"}>\n\t\t\t\t\t<Dialog.Title mb={\"0\"}>{title}</Dialog.Title>\n\t\t\t\t\t<Dialog.Close>\n\t\t\t\t\t\t<IconButton color=\"gray\" variant={\"ghost\"} aria-label=\"Close\">\n\t\t\t\t\t\t\t<Cross1Icon />\n\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t</Dialog.Close>\n\t\t\t\t</Flex>\n\t\t\t\t<Dialog.Description>{description}</Dialog.Description>\n\t\t\t</Flex>\n\t\t\t{content(closeDialog)}\n\t\t</Flex>\n\t)\n})\n","import { memo, useState, useCallback } from \"react\"\nimport { Dialog as RadixDialog } from \"@radix-ui/themes\"\nimport { DialogContent } from \"./DialogContent\"\nimport { CloseDialogWithOptions, DialogProps } from \"./typings\"\n\n/**\n * Display or collect information in a modal. Unlike the `AlertDialog`, the `Dialog`'s can be nested\n * and close when clicking outside of the dialog content.\n */\nexport const Dialog = memo((props: DialogProps) => {\n\tconst { children, size, onOpen, onCloseInterrupt, ...contentProps } = props\n\tconst [open, setOpen] = useState(false)\n\n\tconst handleOpenChange = useCallback(\n\t\t(next: boolean) => {\n\t\t\tif (next && onOpen) {\n\t\t\t\tonOpen()\n\t\t\t} else if (!next && onCloseInterrupt) {\n\t\t\t\t// closes the dialog, bypassing the checks in `handleOpenChange`\n\t\t\t\tconst confirmClose = () => setOpen(false)\n\n\t\t\t\t// if onCloseInterrupt is passed, bypass the standard close behavior and require\n\t\t\t\t// the passed `confirmClose` to close the dialog\n\t\t\t\treturn onCloseInterrupt(confirmClose)\n\t\t\t}\n\n\t\t\tsetOpen(next)\n\t\t},\n\t\t[onOpen, onCloseInterrupt],\n\t)\n\n\tconst closeDialog = useCallback<CloseDialogWithOptions>(\n\t\t(options) => {\n\t\t\tif (options?.force) {\n\t\t\t\t// bypass the checks in the `handleOpenChange` function\n\t\t\t\treturn setOpen(false)\n\t\t\t}\n\n\t\t\thandleOpenChange(false)\n\t\t},\n\t\t[handleOpenChange],\n\t)\n\n\treturn (\n\t\t<RadixDialog.Root open={open} onOpenChange={handleOpenChange}>\n\t\t\t<RadixDialog.Content size={size}>\n\t\t\t\t<DialogContent closeDialog={closeDialog} {...contentProps} />\n\t\t\t</RadixDialog.Content>\n\n\t\t\t{children(RadixDialog.Trigger)}\n\t\t</RadixDialog.Root>\n\t)\n})\n","import { AlertDialog, Flex } from \"@radix-ui/themes\"\nimport { AlertDialogStandardContent } from \"./typings\"\nimport { Button } from \"../../Buttons\"\n\n// remove the margin-bottom from the title so that Flex works as expected\nexport const Title: typeof AlertDialog.Title = ((props) => (\n\t<AlertDialog.Title mb=\"0\" {...props} />\n)) as typeof AlertDialog.Title\n\nexport const AlertDialogContent = (props: AlertDialogStandardContent) => {\n\tconst { title, description, actionText = \"Confirm\", cancelText = \"Cancel\", onAction, onCancel, severity } = props\n\treturn (\n\t\t<Flex direction={\"column\"} gap={\"2\"}>\n\t\t\t<Flex direction={\"column\"} gap={\"1\"}>\n\t\t\t\t<Title>{title}</Title>\n\t\t\t\t<AlertDialog.Description>{description}</AlertDialog.Description>\n\t\t\t</Flex>\n\n\t\t\t<Flex gap=\"3\" mt=\"4\" justify=\"end\">\n\t\t\t\t<AlertDialog.Cancel>\n\t\t\t\t\t<Button variant=\"soft\" severity=\"info\" onClick={onCancel}>\n\t\t\t\t\t\t{cancelText}\n\t\t\t\t\t</Button>\n\t\t\t\t</AlertDialog.Cancel>\n\t\t\t\t<AlertDialog.Action>\n\t\t\t\t\t<Button variant=\"solid\" severity={severity} onClick={onAction}>\n\t\t\t\t\t\t{actionText}\n\t\t\t\t\t</Button>\n\t\t\t\t</AlertDialog.Action>\n\t\t\t</Flex>\n\t\t</Flex>\n\t)\n}\n","import { memo, useMemo } from \"react\"\nimport { AlertDialog as RadixAlertDialog } from \"@radix-ui/themes\"\nimport { AlertDialogContentHelpers, AlertDialogProps } from \"./typings\"\nimport { AlertDialogContent, Title } from \"./AlertDialogContent\"\n\n/**\n * The AlertDialog is used to confirm an action or prompt the user for a decision.\n * Unlike the Dialog, the AlertDialog is not dismissible by clicking outside of the dialog, nor can it be nested.\n *\n * To use, place the `AlertDialogProvider` at the root of your app and use the `useAlertDialog` hook to open the dialog.\n *\n * To set the content of the dialog, use the `content` prop or pass values for the `title`, `description`, and `onAction` props.\n */\nexport const AlertDialog = memo((props: AlertDialogProps) => {\n\tconst { open, setOpen, children, ...contentProps } = props\n\n\tconst helpers: AlertDialogContentHelpers = useMemo(() => {\n\t\treturn {\n\t\t\tclose: () => setOpen(false),\n\t\t\tTitle,\n\t\t\tDescription: RadixAlertDialog.Description,\n\t\t}\n\t}, [setOpen])\n\n\treturn (\n\t\t<RadixAlertDialog.Root open={open} onOpenChange={setOpen}>\n\t\t\t<RadixAlertDialog.Content>\n\t\t\t\t{\"content\" in contentProps ? contentProps.content(helpers) : <AlertDialogContent {...contentProps} />}\n\t\t\t</RadixAlertDialog.Content>\n\t\t\t{children}\n\t\t</RadixAlertDialog.Root>\n\t)\n})\n","import { createContext, memo, useState, useCallback } from \"react\"\nimport { AlertDialogContextType, AlertDialogOptions } from \"./typings\"\nimport { AlertDialog } from \"./AlertDialog\"\n\ninterface AlertDialogProviderProps {\n\tchildren: React.ReactNode\n}\n\nexport const AlertDialogContent = createContext<AlertDialogContextType>(() => {\n\tthrow new Error(\"No AlertDialogProvider found\")\n})\n\nconst initialState: AlertDialogOptions = {\n\tcontent: () => null,\n}\n\nexport const AlertDialogProvider = memo(({ children }: AlertDialogProviderProps) => {\n\tconst [open, setOpen] = useState(false)\n\tconst [state, setState] = useState<AlertDialogOptions>(initialState)\n\n\tconst openDialog = useCallback<AlertDialogContextType>(\n\t\t(options) => {\n\t\t\tif (open) throw new Error(\"AlertDialog is already open\")\n\n\t\t\tsetState(options)\n\t\t\tsetOpen(true)\n\t\t},\n\t\t[open],\n\t)\n\n\treturn (\n\t\t<AlertDialog open={open} setOpen={setOpen} {...state}>\n\t\t\t<AlertDialogContent.Provider value={openDialog}>{children}</AlertDialogContent.Provider>\n\t\t</AlertDialog>\n\t)\n})\n","import { useContext } from \"react\"\nimport { AlertDialogContent } from \"./context\"\n\nexport const useAlertDialog = () => {\n\treturn useContext(AlertDialogContent)\n}\n","import React, { FC, forwardRef, useMemo } from \"react\"\nimport { Select as RadixSelect } from \"@radix-ui/themes\"\nimport classNames from \"classnames\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\nimport { SelectItemProps, SelectProps } from \"./typings.ts\"\n\nimport styles from \"./Select.module.sass\"\n\nconst _Select = forwardRef(function Select(\n\t{\n\t\tclassName,\n\t\tfluid,\n\t\tsize = \"medium\",\n\t\tvariant = \"surface\",\n\t\tseverity = \"primary\",\n\t\tplaceholder = \"Select\",\n\t\tside,\n\t\titems = [],\n\t\t...rest\n\t}: SelectProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst mappedSize = useMemo(() => {\n\t\treturn applyResponsiveMapping(size, SizeMapping)\n\t}, [size])\n\n\t// TODO: extend functionality to support grouping of items\n\treturn (\n\t\t<RadixSelect.Root size={mappedSize}>\n\t\t\t<RadixSelect.Trigger\n\t\t\t\tclassName={classNames(className, styles.default, {\n\t\t\t\t\t[styles.fluid!]: fluid,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t\tvariant={variant}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t\t<RadixSelect.Content\n\t\t\t\tside={side}\n\t\t\t\tposition=\"popper\"\n\t\t\t\tvariant={variant !== \"surface\" ? \"soft\" : \"solid\"}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t>\n\t\t\t\t{items.map(({ label, value, ...rest }: SelectItemProps) => (\n\t\t\t\t\t<RadixSelect.Item className={classNames(styles.itemDefault)} key={value} value={value} {...rest}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</RadixSelect.Item>\n\t\t\t\t))}\n\t\t\t</RadixSelect.Content>\n\t\t</RadixSelect.Root>\n\t)\n})\nexport const Select: FC<SelectProps> = React.memo(_Select)\n","import React, { FC, forwardRef, useMemo } from \"react\"\nimport { Text, TextField as RadixTextField } from \"@radix-ui/themes\"\nimport classNames from \"classnames\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SizeMapping, SeverityColorMapping } from \"../constants.ts\"\nimport { InputProps } from \"./typings.ts\"\n\nimport styles from \"./TextField.module.sass\"\n\nconst _Input = forwardRef(function Input(\n\t{\n\t\tclassName,\n\t\tleftIcon,\n\t\trightIcon,\n\t\tsize = \"medium\",\n\t\tshowInputLength = false,\n\t\tvalue,\n\t\tvariant,\n\t\tseverity = \"primary\",\n\t\t...rest\n\t}: InputProps,\n\tref: React.Ref<HTMLInputElement>,\n) {\n\tconst computedSize = useMemo(() => {\n\t\treturn applyResponsiveMapping(size, SizeMapping)\n\t}, [size])\n\n\tconst displayInputLength = showInputLength || (!showInputLength && rest.maxLength !== undefined)\n\tconst valueAsString = value !== undefined ? value.toString() : undefined\n\n\treturn (\n\t\t<>\n\t\t\t<RadixTextField.Root\n\t\t\t\tclassName={classNames({\n\t\t\t\t\t[styles.accommodateCharCount!]: displayInputLength,\n\t\t\t\t})}\n\t\t\t\tsize={computedSize}\n\t\t\t\tvariant={variant}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t>\n\t\t\t\t<RadixTextField.Slot>{leftIcon}</RadixTextField.Slot>\n\t\t\t\t<RadixTextField.Input\n\t\t\t\t\tclassName={classNames(styles.default, className, {\n\t\t\t\t\t\t[styles.noLeftIcon!]: !leftIcon,\n\t\t\t\t\t\t[styles.noRightIcon!]: !rightIcon,\n\t\t\t\t\t})}\n\t\t\t\t\tref={ref}\n\t\t\t\t\tsize={computedSize}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t\t<RadixTextField.Slot>{rightIcon}</RadixTextField.Slot>\n\t\t\t\t{displayInputLength && (\n\t\t\t\t\t<Text as=\"p\" className={styles.charCount} size=\"1\" color=\"gray\">\n\t\t\t\t\t\t{rest.maxLength !== undefined\n\t\t\t\t\t\t\t? `${valueAsString?.length}/${rest.maxLength}`\n\t\t\t\t\t\t\t: `${valueAsString?.length}`}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</RadixTextField.Root>\n\t\t</>\n\t)\n})\nexport const Input: FC<InputProps> = React.memo(_Input)\n"],"names":["hasOwn","classNames","classes","arg","argType","inner","key","module","hoverEffectClassNameMapping","styles","applyResponsiveMapping","value","mapping","_value","SizeMapping","SeverityColorMapping","_Button","forwardRef","className","severity","size","hoverEffects","fluid","rest","ref","hoverEffectClasses","hoverEffect","jsx","RadixButton","Button","React","children","RadixIconButton","IconButton","DialogContent","memo","props","title","description","content","closeDialog","jsxs","Flex","Dialog","Cross1Icon","onOpen","onCloseInterrupt","contentProps","open","setOpen","useState","handleOpenChange","useCallback","next","options","RadixDialog","Title","AlertDialog","AlertDialogContent","actionText","cancelText","onAction","onCancel","helpers","useMemo","RadixAlertDialog","createContext","initialState","AlertDialogProvider","state","setState","openDialog","useAlertDialog","useContext","_Select","variant","placeholder","side","items","mappedSize","RadixSelect","label","Select","_Input","leftIcon","rightIcon","showInputLength","computedSize","displayInputLength","valueAsString","Fragment","RadixTextField","Text","Input"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,GAAC,WAAY;AAGZ,QAAIA,IAAS,CAAE,EAAC;AAGhB,aAASC,IAAa;AAGrB,eAFIC,IAAU,CAAA,GAEL,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AAC1C,YAAIC,IAAM,UAAU,CAAC;AACrB,YAAKA,GAEL;AAAA,cAAIC,IAAU,OAAOD;AAErB,cAAIC,MAAY,YAAYA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,MAAA;AAAA,IAAA;AAAA,EAGH,EAAA,CAAA;AAEF,CAAC,GACYI,KAAwB/D,EAAM,KAAKqD,EAAM;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"blocks.js","sources":["../node_modules/classnames/index.js","../src/Buttons/constants.ts","../src/utils.ts","../src/constants.ts","../src/Buttons/Button.tsx","../src/Buttons/IconButton.tsx","../src/Dialogs/Dialog/DialogContent.tsx","../src/Dialogs/Dialog/Dialog.tsx","../src/Dialogs/AlertDialog/AlertDialogContent.tsx","../src/Dialogs/AlertDialog/AlertDialog.tsx","../src/Dialogs/AlertDialog/context.tsx","../src/Dialogs/AlertDialog/hooks.ts","../src/Select/Select.tsx","../src/Input/Input.tsx","../src/Popover/Popover.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import { ButtonHoverEffect } from \"./typings.ts\"\nimport styles from \"./Button.module.sass\"\n\nexport const hoverEffectClassNameMapping: Record<ButtonHoverEffect, string | undefined> = {\n\tspin90Clockwise: styles.hoverSpin90Clockwise,\n\tspin180Clockwise: styles.hoverSpin180Clockwise,\n\tspin360Clockwise: styles.hoverSpin360Clockwise,\n}\n","import { Responsive } from \"@radix-ui/themes\"\n\n// applyResponsiveMapping is a helper function used to map the keys of a Radix Responsive type that can be understood\n// by a Radix component or primitive. The point of this is to leverage our own custom prop names and values while still\n// using Radix's built in Responsiveness functionality.\n/**\n * Returns an object with mapped key values or a single mapped value\n * @param value an object or string\n * @param mapping a Record mapping the object values of param value\n */\nexport function applyResponsiveMapping<T extends string, K>(value: Responsive<T>, mapping: Record<T, K>) {\n\tif (typeof value === \"object\") {\n\t\tif (!(\"initial\" in value)) {\n\t\t\t// Responsive objects require an 'initial' property to be set that acts as a default\n\t\t\tthrow new Error(\"Expected initial property to be set in Responsive object\")\n\t\t}\n\t\treturn Object.fromEntries(Object.entries(value).map(([key, _value]) => [key, mapping[_value]]))\n\t} else {\n\t\treturn mapping[value]\n\t}\n}\n","import React from \"react\"\nimport { Severity, Size } from \"./typings.ts\"\nimport { Theme } from \"@radix-ui/themes\"\n\ntype ThemeProps = React.ComponentProps<typeof Theme>\n\n// Mappings\nexport const SizeMapping: Record<Size, \"1\" | \"2\" | \"3\"> = {\n\tsmall: \"1\",\n\tmedium: \"2\",\n\tlarge: \"3\",\n}\n\nexport const SeverityColorMapping: Record<Severity, ThemeProps[\"accentColor\"]> = {\n\tprimary: \"indigo\",\n\tsuccess: \"green\",\n\tdanger: \"red\",\n\tinfo: \"gray\",\n}\n","import React, { FC, forwardRef } from \"react\"\nimport { ButtonProps } from \"./typings.ts\"\nimport styles from \"./Button.module.sass\"\nimport classNames from \"classnames\"\nimport { Button as RadixButton } from \"@radix-ui/themes\"\nimport { hoverEffectClassNameMapping } from \"./constants.ts\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\n\nconst _Button = forwardRef(function Button(\n\t{ className, severity = \"primary\", size = \"medium\", hoverEffects, fluid, ...rest }: ButtonProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst hoverEffectClasses =\n\t\thoverEffects?.map((hoverEffect) => {\n\t\t\treturn hoverEffectClassNameMapping[hoverEffect]\n\t\t}) || []\n\n\treturn (\n\t\t<RadixButton\n\t\t\tref={ref}\n\t\t\tclassName={classNames(styles.default, className, hoverEffectClasses, {\n\t\t\t\t[styles.fluid!]: fluid,\n\t\t\t})}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\tsize={applyResponsiveMapping(size, SizeMapping)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n})\n\n// using FC so storybook correctly displays the component props\nconst Button: FC<ButtonProps> = React.memo(_Button)\n\nexport default Button\n","import React, { FC, forwardRef } from \"react\"\nimport { ButtonProps } from \"./typings.ts\"\nimport classNames from \"classnames\"\nimport { IconButton as RadixIconButton } from \"@radix-ui/themes\"\nimport { hoverEffectClassNameMapping } from \"./constants.ts\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\n\ninterface IconButtonProps extends Omit<ButtonProps, \"fluid\"> {\n\t\"aria-label\": string\n}\n\nconst _Button = forwardRef(function Button(\n\t{ className, children, severity = \"primary\", size = \"medium\", hoverEffects, ...rest }: IconButtonProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst hoverEffectClasses =\n\t\thoverEffects?.map((hoverEffect) => {\n\t\t\treturn hoverEffectClassNameMapping[hoverEffect]\n\t\t}) || []\n\n\treturn (\n\t\t<RadixIconButton\n\t\t\tclassName={classNames(className, hoverEffectClasses)}\n\t\t\tref={ref}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\tsize={applyResponsiveMapping(size, SizeMapping)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</RadixIconButton>\n\t)\n})\n\n// using FC so storybook correctly displays the component props\nconst IconButton: FC<IconButtonProps> = React.memo(_Button)\n\nexport default IconButton\n","import { memo } from \"react\"\nimport { Dialog, Flex, IconButton } from \"@radix-ui/themes\"\nimport { Cross1Icon } from \"@radix-ui/react-icons\"\nimport { DialogContentProps } from \"./typings\"\n\nexport const DialogContent = memo((props: DialogContentProps) => {\n\tconst { title, description, content, closeDialog } = props\n\treturn (\n\t\t<Flex direction={\"column\"} gap={\"2\"}>\n\t\t\t<Flex direction={\"column\"} gap={\"1\"}>\n\t\t\t\t<Flex justify={\"between\"}>\n\t\t\t\t\t<Dialog.Title mb={\"0\"}>{title}</Dialog.Title>\n\t\t\t\t\t<Dialog.Close>\n\t\t\t\t\t\t<IconButton color=\"gray\" variant={\"ghost\"} aria-label=\"Close\">\n\t\t\t\t\t\t\t<Cross1Icon />\n\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t</Dialog.Close>\n\t\t\t\t</Flex>\n\t\t\t\t<Dialog.Description>{description}</Dialog.Description>\n\t\t\t</Flex>\n\t\t\t{content(closeDialog)}\n\t\t</Flex>\n\t)\n})\n","import { memo, useState, useCallback } from \"react\"\nimport { Dialog as RadixDialog } from \"@radix-ui/themes\"\nimport { DialogContent } from \"./DialogContent\"\nimport { CloseDialogWithOptions, DialogProps } from \"./typings\"\n\n/**\n * Display or collect information in a modal. Unlike the `AlertDialog`, the `Dialog`'s can be nested\n * and close when clicking outside of the dialog content.\n */\nexport const Dialog = memo((props: DialogProps) => {\n\tconst { children, size, onOpen, onCloseInterrupt, ...contentProps } = props\n\tconst [open, setOpen] = useState(false)\n\n\tconst handleOpenChange = useCallback(\n\t\t(next: boolean) => {\n\t\t\tif (next && onOpen) {\n\t\t\t\tonOpen()\n\t\t\t} else if (!next && onCloseInterrupt) {\n\t\t\t\t// closes the dialog, bypassing the checks in `handleOpenChange`\n\t\t\t\tconst confirmClose = () => setOpen(false)\n\n\t\t\t\t// if onCloseInterrupt is passed, bypass the standard close behavior and require\n\t\t\t\t// the passed `confirmClose` to close the dialog\n\t\t\t\treturn onCloseInterrupt(confirmClose)\n\t\t\t}\n\n\t\t\tsetOpen(next)\n\t\t},\n\t\t[onOpen, onCloseInterrupt],\n\t)\n\n\tconst closeDialog = useCallback<CloseDialogWithOptions>(\n\t\t(options) => {\n\t\t\tif (options?.force) {\n\t\t\t\t// bypass the checks in the `handleOpenChange` function\n\t\t\t\treturn setOpen(false)\n\t\t\t}\n\n\t\t\thandleOpenChange(false)\n\t\t},\n\t\t[handleOpenChange],\n\t)\n\n\treturn (\n\t\t<RadixDialog.Root open={open} onOpenChange={handleOpenChange}>\n\t\t\t<RadixDialog.Content size={size}>\n\t\t\t\t<DialogContent closeDialog={closeDialog} {...contentProps} />\n\t\t\t</RadixDialog.Content>\n\n\t\t\t{children(RadixDialog.Trigger)}\n\t\t</RadixDialog.Root>\n\t)\n})\n","import { AlertDialog, Flex } from \"@radix-ui/themes\"\nimport { AlertDialogStandardContent } from \"./typings\"\nimport { Button } from \"../../Buttons\"\n\n// remove the margin-bottom from the title so that Flex works as expected\nexport const Title: typeof AlertDialog.Title = ((props) => (\n\t<AlertDialog.Title mb=\"0\" {...props} />\n)) as typeof AlertDialog.Title\n\nexport const AlertDialogContent = (props: AlertDialogStandardContent) => {\n\tconst { title, description, actionText = \"Confirm\", cancelText = \"Cancel\", onAction, onCancel, severity } = props\n\treturn (\n\t\t<Flex direction={\"column\"} gap={\"2\"}>\n\t\t\t<Flex direction={\"column\"} gap={\"1\"}>\n\t\t\t\t<Title>{title}</Title>\n\t\t\t\t<AlertDialog.Description>{description}</AlertDialog.Description>\n\t\t\t</Flex>\n\n\t\t\t<Flex gap=\"3\" mt=\"4\" justify=\"end\">\n\t\t\t\t<AlertDialog.Cancel>\n\t\t\t\t\t<Button variant=\"soft\" severity=\"info\" onClick={onCancel}>\n\t\t\t\t\t\t{cancelText}\n\t\t\t\t\t</Button>\n\t\t\t\t</AlertDialog.Cancel>\n\t\t\t\t<AlertDialog.Action>\n\t\t\t\t\t<Button variant=\"solid\" severity={severity} onClick={onAction}>\n\t\t\t\t\t\t{actionText}\n\t\t\t\t\t</Button>\n\t\t\t\t</AlertDialog.Action>\n\t\t\t</Flex>\n\t\t</Flex>\n\t)\n}\n","import { memo, useMemo } from \"react\"\nimport { AlertDialog as RadixAlertDialog } from \"@radix-ui/themes\"\nimport { AlertDialogContentHelpers, AlertDialogProps } from \"./typings\"\nimport { AlertDialogContent, Title } from \"./AlertDialogContent\"\n\n/**\n * The AlertDialog is used to confirm an action or prompt the user for a decision.\n * Unlike the Dialog, the AlertDialog is not dismissible by clicking outside of the dialog, nor can it be nested.\n *\n * To use, place the `AlertDialogProvider` at the root of your app and use the `useAlertDialog` hook to open the dialog.\n *\n * To set the content of the dialog, use the `content` prop or pass values for the `title`, `description`, and `onAction` props.\n */\nexport const AlertDialog = memo((props: AlertDialogProps) => {\n\tconst { open, setOpen, children, ...contentProps } = props\n\n\tconst helpers: AlertDialogContentHelpers = useMemo(() => {\n\t\treturn {\n\t\t\tclose: () => setOpen(false),\n\t\t\tTitle,\n\t\t\tDescription: RadixAlertDialog.Description,\n\t\t}\n\t}, [setOpen])\n\n\treturn (\n\t\t<RadixAlertDialog.Root open={open} onOpenChange={setOpen}>\n\t\t\t<RadixAlertDialog.Content>\n\t\t\t\t{\"content\" in contentProps ? contentProps.content(helpers) : <AlertDialogContent {...contentProps} />}\n\t\t\t</RadixAlertDialog.Content>\n\t\t\t{children}\n\t\t</RadixAlertDialog.Root>\n\t)\n})\n","import { createContext, memo, useState, useCallback } from \"react\"\nimport { AlertDialogContextType, AlertDialogOptions } from \"./typings\"\nimport { AlertDialog } from \"./AlertDialog\"\n\ninterface AlertDialogProviderProps {\n\tchildren: React.ReactNode\n}\n\nexport const AlertDialogContent = createContext<AlertDialogContextType>(() => {\n\tthrow new Error(\"No AlertDialogProvider found\")\n})\n\nconst initialState: AlertDialogOptions = {\n\tcontent: () => null,\n}\n\nexport const AlertDialogProvider = memo(({ children }: AlertDialogProviderProps) => {\n\tconst [open, setOpen] = useState(false)\n\tconst [state, setState] = useState<AlertDialogOptions>(initialState)\n\n\tconst openDialog = useCallback<AlertDialogContextType>(\n\t\t(options) => {\n\t\t\tif (open) throw new Error(\"AlertDialog is already open\")\n\n\t\t\tsetState(options)\n\t\t\tsetOpen(true)\n\t\t},\n\t\t[open],\n\t)\n\n\treturn (\n\t\t<AlertDialog open={open} setOpen={setOpen} {...state}>\n\t\t\t<AlertDialogContent.Provider value={openDialog}>{children}</AlertDialogContent.Provider>\n\t\t</AlertDialog>\n\t)\n})\n","import { useContext } from \"react\"\nimport { AlertDialogContent } from \"./context\"\n\nexport const useAlertDialog = () => {\n\treturn useContext(AlertDialogContent)\n}\n","import React, { FC, forwardRef, useMemo } from \"react\"\nimport { Select as RadixSelect } from \"@radix-ui/themes\"\nimport classNames from \"classnames\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\nimport { SelectItemProps, SelectProps } from \"./typings.ts\"\n\nimport styles from \"./Select.module.sass\"\n\nconst _Select = forwardRef(function Select(\n\t{\n\t\tclassName,\n\t\tfluid,\n\t\tsize = \"medium\",\n\t\tvariant = \"surface\",\n\t\tseverity = \"primary\",\n\t\tplaceholder = \"Select\",\n\t\tside,\n\t\titems = [],\n\t\t...rest\n\t}: SelectProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst mappedSize = useMemo(() => {\n\t\treturn applyResponsiveMapping(size, SizeMapping)\n\t}, [size])\n\n\t// TODO: extend functionality to support grouping of items\n\treturn (\n\t\t<RadixSelect.Root size={mappedSize}>\n\t\t\t<RadixSelect.Trigger\n\t\t\t\tclassName={classNames(className, styles.default, {\n\t\t\t\t\t[styles.fluid!]: fluid,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t\tvariant={variant}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t\t<RadixSelect.Content\n\t\t\t\tside={side}\n\t\t\t\tposition=\"popper\"\n\t\t\t\tvariant={variant !== \"surface\" ? \"soft\" : \"solid\"}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t>\n\t\t\t\t{items.map(({ label, value, ...rest }: SelectItemProps) => (\n\t\t\t\t\t<RadixSelect.Item className={classNames(styles.itemDefault)} key={value} value={value} {...rest}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</RadixSelect.Item>\n\t\t\t\t))}\n\t\t\t</RadixSelect.Content>\n\t\t</RadixSelect.Root>\n\t)\n})\nexport const Select: FC<SelectProps> = React.memo(_Select)\n","import React, { FC, forwardRef, useMemo } from \"react\"\nimport { Text, TextField as RadixTextField } from \"@radix-ui/themes\"\nimport classNames from \"classnames\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SizeMapping, SeverityColorMapping } from \"../constants.ts\"\nimport { InputProps } from \"./typings.ts\"\n\nimport styles from \"./Input.module.sass\"\n\nconst _Input = forwardRef(function Input(\n\t{\n\t\tclassName,\n\t\tleftIcon,\n\t\trightIcon,\n\t\tsize = \"medium\",\n\t\tshowInputLength,\n\t\tvalue,\n\t\tvariant,\n\t\tseverity = \"primary\",\n\t\t...rest\n\t}: InputProps,\n\tref: React.Ref<HTMLInputElement>,\n) {\n\tconst computedSize = useMemo(() => {\n\t\treturn applyResponsiveMapping(size, SizeMapping)\n\t}, [size])\n\n\tconst displayInputLength = showInputLength || (showInputLength === undefined && rest.maxLength !== undefined)\n\tconst valueAsString = value !== undefined ? value.toString() : undefined\n\n\treturn (\n\t\t<RadixTextField.Root\n\t\t\tclassName={classNames({\n\t\t\t\t[styles.accommodateCharCount!]: displayInputLength,\n\t\t\t})}\n\t\t\tsize={computedSize}\n\t\t\tvariant={variant}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t>\n\t\t\t<RadixTextField.Slot>{leftIcon}</RadixTextField.Slot>\n\t\t\t<RadixTextField.Input\n\t\t\t\tclassName={classNames(styles.default, className, {\n\t\t\t\t\t[styles.noLeftIcon!]: !leftIcon,\n\t\t\t\t\t[styles.noRightIcon!]: !rightIcon,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t\tsize={computedSize}\n\t\t\t\tvariant={variant}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t\t<RadixTextField.Slot>{rightIcon}</RadixTextField.Slot>\n\t\t\t{displayInputLength && (\n\t\t\t\t<Text as=\"p\" className={styles.charCount} size=\"1\" color=\"gray\">\n\t\t\t\t\t{rest.maxLength !== undefined\n\t\t\t\t\t\t? `${valueAsString?.length}/${rest.maxLength}`\n\t\t\t\t\t\t: `${valueAsString?.length}`}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</RadixTextField.Root>\n\t)\n})\nexport const Input: FC<InputProps> = React.memo(_Input)\n","import React, { forwardRef, FC } from \"react\"\nimport { Popover as RadixPopover } from \"@radix-ui/themes\"\nimport { PopoverProps } from \"./typings.ts\"\n\nconst _Popover = forwardRef(function Popover(\n\t{ defaultOpen = false, modal = false, content, children, ...rest }: PopoverProps,\n\tref: React.Ref<HTMLDivElement>,\n) {\n\treturn (\n\t\t<RadixPopover.Root defaultOpen={defaultOpen} modal={modal}>\n\t\t\t<RadixPopover.Trigger>{children}</RadixPopover.Trigger>\n\t\t\t<RadixPopover.Content ref={ref} {...rest}>\n\t\t\t\t{content(RadixPopover.Close)}\n\t\t\t</RadixPopover.Content>\n\t\t</RadixPopover.Root>\n\t)\n})\nexport const Popover: FC<PopoverProps> = React.memo(_Popover)\n"],"names":["hasOwn","classNames","classes","i","arg","argType","inner","key","module","hoverEffectClassNameMapping","styles","applyResponsiveMapping","value","mapping","_value","SizeMapping","SeverityColorMapping","_Button","forwardRef","className","severity","size","hoverEffects","fluid","rest","ref","hoverEffectClasses","hoverEffect","jsx","RadixButton","Button","React","children","RadixIconButton","IconButton","DialogContent","memo","props","title","description","content","closeDialog","jsxs","Flex","Dialog","Cross1Icon","onOpen","onCloseInterrupt","contentProps","open","setOpen","useState","handleOpenChange","useCallback","next","options","RadixDialog","Title","AlertDialog","AlertDialogContent","actionText","cancelText","onAction","onCancel","helpers","useMemo","RadixAlertDialog","createContext","initialState","AlertDialogProvider","state","setState","openDialog","useAlertDialog","useContext","_Select","variant","placeholder","side","items","mappedSize","RadixSelect","label","Select","_Input","leftIcon","rightIcon","showInputLength","computedSize","displayInputLength","valueAsString","RadixTextField","Text","Input","_Popover","defaultOpen","modal","RadixPopover","Popover"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,GAAC,WAAY;AAGZ,QAAIA,IAAS,CAAE,EAAC;AAGhB,aAASC,IAAa;AAGrB,eAFIC,IAAU,CAAA,GAELC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAC1C,YAAIC,IAAM,UAAUD,CAAC;AACrB,YAAKC,GAEL;AAAA,cAAIC,IAAU,OAAOD;AAErB,cAAIC,MAAY,YAAYA,MAAY;AACvC,YAAAH,EAAQ,KAAKE,CAAG;AAAA,mBACN,MAAM,QAAQA,CAAG;AAC3B,gBAAIA,EAAI,QAAQ;AACf,kBAAIE,IAAQL,EAAW,MAAM,MAAMG,CAAG;AACtC,cAAIE,KACHJ,EAAQ,KAAKI,CAAK;AAAA,YAEnB;AAAA,qBACSD,MAAY,UAAU;AAChC,gBAAID,EAAI,a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AA;AAAA,IAAC,gBAAApE,EAAAqE,EAAa,SAAb,EAAsB,UAAAjE,EAAS,CAAA;AAAA,IAChC,gBAAAJ,EAACqE,EAAa,SAAb,EAAqB,KAAAxE,GAAW,GAAGD,GAClC,UAAAgB,EAAQyD,EAAa,KAAK,EAC5B,CAAA;AAAA,EACD,EAAA,CAAA;AAEF,CAAC,GACYC,KAA4BnE,EAAM,KAAK+D,EAAQ;","x_google_ignoreList":[0]}
|
package/dist/blocks.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("@radix-ui/themes"),require("@radix-ui/react-icons")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@radix-ui/themes","@radix-ui/react-icons"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d.blocks={},d.jsxRuntime,d.React,d.themes,d.reactIcons))})(this,function(d,o,s,n,O){"use strict";const D={default:"_default_zkx83_1",fluid:"_fluid_zkx83_5",hoverSpin90Clockwise:"_hoverSpin90Clockwise_zkx83_19",hoverSpin180Clockwise:"_hoverSpin180Clockwise_zkx83_30",hoverSpin360Clockwise:"_hoverSpin360Clockwise_zkx83_41"};function T(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var A={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(
|
|
5
|
+
*/(function(l){(function(){var c={}.hasOwnProperty;function t(){for(var r=[],i=0;i<arguments.length;i++){var e=arguments[i];if(e){var a=typeof e;if(a==="string"||a==="number")r.push(e);else if(Array.isArray(e)){if(e.length){var u=t.apply(null,e);u&&r.push(u)}}else if(a==="object"){if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]")){r.push(e.toString());continue}for(var p in e)c.call(e,p)&&e[p]&&r.push(p)}}}return r.join(" ")}l.exports?(t.default=t,l.exports=t):window.classNames=t})()})(A);var z=A.exports;const h=T(z),j={spin90Clockwise:D.hoverSpin90Clockwise,spin180Clockwise:D.hoverSpin180Clockwise,spin360Clockwise:D.hoverSpin360Clockwise};function w(l,c){if(typeof l=="object"){if(!("initial"in l))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(l).map(([t,r])=>[t,c[r]]))}else return c[l]}const k={small:"1",medium:"2",large:"3"},_={primary:"indigo",success:"green",danger:"red",info:"gray"},N=s.forwardRef(function({className:c,severity:t="primary",size:r="medium",hoverEffects:i,fluid:e,...a},u){const p=(i==null?void 0:i.map(f=>j[f]))||[];return o.jsx(n.Button,{ref:u,className:h(D.default,c,p,{[D.fluid]:e}),color:_[t],size:w(r,k),...a})}),x=s.memo(N),B=s.forwardRef(function({className:c,children:t,severity:r="primary",size:i="medium",hoverEffects:e,...a},u){const p=(e==null?void 0:e.map(f=>j[f]))||[];return o.jsx(n.IconButton,{className:h(c,p),ref:u,color:_[r],size:w(i,k),...a,children:t})}),F=s.memo(B),M=s.memo(l=>{const{title:c,description:t,content:r,closeDialog:i}=l;return o.jsxs(n.Flex,{direction:"column",gap:"2",children:[o.jsxs(n.Flex,{direction:"column",gap:"1",children:[o.jsxs(n.Flex,{justify:"between",children:[o.jsx(n.Dialog.Title,{mb:"0",children:c}),o.jsx(n.Dialog.Close,{children:o.jsx(n.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:o.jsx(O.Cross1Icon,{})})})]}),o.jsx(n.Dialog.Description,{children:t})]}),r(i)]})}),$=s.memo(l=>{const{children:c,size:t,onOpen:r,onCloseInterrupt:i,...e}=l,[a,u]=s.useState(!1),p=s.useCallback(C=>{if(C&&r)r();else if(!C&&i)return i(()=>u(!1));u(C)},[r,i]),f=s.useCallback(C=>{if(C!=null&&C.force)return u(!1);p(!1)},[p]);return o.jsxs(n.Dialog.Root,{open:a,onOpenChange:p,children:[o.jsx(n.Dialog.Content,{size:t,children:o.jsx(M,{closeDialog:f,...e})}),c(n.Dialog.Trigger)]})}),P=l=>o.jsx(n.AlertDialog.Title,{mb:"0",...l}),L=l=>{const{title:c,description:t,actionText:r="Confirm",cancelText:i="Cancel",onAction:e,onCancel:a,severity:u}=l;return o.jsxs(n.Flex,{direction:"column",gap:"2",children:[o.jsxs(n.Flex,{direction:"column",gap:"1",children:[o.jsx(P,{children:c}),o.jsx(n.AlertDialog.Description,{children:t})]}),o.jsxs(n.Flex,{gap:"3",mt:"4",justify:"end",children:[o.jsx(n.AlertDialog.Cancel,{children:o.jsx(x,{variant:"soft",severity:"info",onClick:a,children:i})}),o.jsx(n.AlertDialog.Action,{children:o.jsx(x,{variant:"solid",severity:u,onClick:e,children:r})})]})]})},b=s.memo(l=>{const{open:c,setOpen:t,children:r,...i}=l,e=s.useMemo(()=>({close:()=>t(!1),Title:P,Description:n.AlertDialog.Description}),[t]);return o.jsxs(n.AlertDialog.Root,{open:c,onOpenChange:t,children:[o.jsx(n.AlertDialog.Content,{children:"content"in i?i.content(e):o.jsx(L,{...i})}),r]})}),m=s.createContext(()=>{throw new Error("No AlertDialogProvider found")}),q={content:()=>null},E=s.memo(({children:l})=>{const[c,t]=s.useState(!1),[r,i]=s.useState(q),e=s.useCallback(a=>{if(c)throw new Error("AlertDialog is already open");i(a),t(!0)},[c]);return o.jsx(b,{open:c,setOpen:t,...r,children:o.jsx(m.Provider,{value:e,children:l})})}),G=()=>s.useContext(m),I={default:"_default_19sov_1",itemDefault:"_itemDefault_19sov_5",fluid:"_fluid_19sov_9"},H=s.forwardRef(function({className:c,fluid:t,size:r="medium",variant:i="surface",severity:e="primary",placeholder:a="Select",side:u,items:p=[],...f},C){const v=s.useMemo(()=>w(r,k),[r]);return o.jsxs(n.Select.Root,{size:v,children:[o.jsx(n.Select.Trigger,{className:h(c,I.default,{[I.fluid]:t}),ref:C,variant:i,placeholder:a,color:_[e],...f}),o.jsx(n.Select.Content,{side:u,position:"popper",variant:i!=="surface"?"soft":"solid",color:_[e],children:p.map(({label:y,value:g,...W})=>o.jsx(n.Select.Item,{className:h(I.itemDefault),value:g,...W,children:y},g))})]})}),J=s.memo(H),S={accommodateCharCount:"_accommodateCharCount_fni4k_1",default:"_default_fni4k_5",noLeftIcon:"_noLeftIcon_fni4k_9",noRightIcon:"_noRightIcon_fni4k_13",charCount:"_charCount_fni4k_17"},K=s.forwardRef(function({className:c,leftIcon:t,rightIcon:r,size:i="medium",showInputLength:e,value:a,variant:u,severity:p="primary",...f},C){const v=s.useMemo(()=>w(i,k),[i]),y=e||e===void 0&&f.maxLength!==void 0,g=a!==void 0?a.toString():void 0;return o.jsxs(n.TextField.Root,{className:h({[S.accommodateCharCount]:y}),size:v,variant:u,color:_[p],children:[o.jsx(n.TextField.Slot,{children:t}),o.jsx(n.TextField.Input,{className:h(S.default,c,{[S.noLeftIcon]:!t,[S.noRightIcon]:!r}),ref:C,size:v,variant:u,color:_[p],...f}),o.jsx(n.TextField.Slot,{children:r}),y&&o.jsx(n.Text,{as:"p",className:S.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${g==null?void 0:g.length}/${f.maxLength}`:`${g==null?void 0:g.length}`})]})}),Q=s.memo(K),U=s.forwardRef(function({defaultOpen:c=!1,modal:t=!1,content:r,children:i,...e},a){return o.jsxs(n.Popover.Root,{defaultOpen:c,modal:t,children:[o.jsx(n.Popover.Trigger,{children:i}),o.jsx(n.Popover.Content,{ref:a,...e,children:r(n.Popover.Close)})]})}),V=s.memo(U);d.AlertDialog=b,d.AlertDialogContent=m,d.AlertDialogProvider=E,d.Button=x,d.Dialog=$,d.IconButton=F,d.Input=Q,d.Popover=V,d.Select=J,d.useAlertDialog=G,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
6
6
|
//# sourceMappingURL=blocks.umd.cjs.map
|
package/dist/blocks.umd.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.umd.cjs","sources":["../node_modules/classnames/index.js","../src/Buttons/constants.ts","../src/utils.ts","../src/constants.ts","../src/Buttons/Button.tsx","../src/Buttons/IconButton.tsx","../src/Dialogs/Dialog/DialogContent.tsx","../src/Dialogs/Dialog/Dialog.tsx","../src/Dialogs/AlertDialog/AlertDialogContent.tsx","../src/Dialogs/AlertDialog/AlertDialog.tsx","../src/Dialogs/AlertDialog/context.tsx","../src/Dialogs/AlertDialog/hooks.ts","../src/Select/Select.tsx","../src/Input/Input.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import { ButtonHoverEffect } from \"./typings.ts\"\nimport styles from \"./Button.module.sass\"\n\nexport const hoverEffectClassNameMapping: Record<ButtonHoverEffect, string | undefined> = {\n\tspin90Clockwise: styles.hoverSpin90Clockwise,\n\tspin180Clockwise: styles.hoverSpin180Clockwise,\n\tspin360Clockwise: styles.hoverSpin360Clockwise,\n}\n","import { Responsive } from \"@radix-ui/themes\"\n\n// applyResponsiveMapping is a helper function used to map the keys of a Radix Responsive type that can be understood\n// by a Radix component or primitive. The point of this is to leverage our own custom prop names and values while still\n// using Radix's built in Responsiveness functionality.\n/**\n * Returns an object with mapped key values or a single mapped value\n * @param value an object or string\n * @param mapping a Record mapping the object values of param value\n */\nexport function applyResponsiveMapping<T extends string, K>(value: Responsive<T>, mapping: Record<T, K>) {\n\tif (typeof value === \"object\") {\n\t\tif (!(\"initial\" in value)) {\n\t\t\t// Responsive objects require an 'initial' property to be set that acts as a default\n\t\t\tthrow new Error(\"Expected initial property to be set in Responsive object\")\n\t\t}\n\t\treturn Object.fromEntries(Object.entries(value).map(([key, _value]) => [key, mapping[_value]]))\n\t} else {\n\t\treturn mapping[value]\n\t}\n}\n","import React from \"react\"\nimport { Severity, Size } from \"./typings.ts\"\nimport { Theme } from \"@radix-ui/themes\"\n\ntype ThemeProps = React.ComponentProps<typeof Theme>\n\n// Mappings\nexport const SizeMapping: Record<Size, \"1\" | \"2\" | \"3\"> = {\n\tsmall: \"1\",\n\tmedium: \"2\",\n\tlarge: \"3\",\n}\n\nexport const SeverityColorMapping: Record<Severity, ThemeProps[\"accentColor\"]> = {\n\tprimary: \"indigo\",\n\tsuccess: \"green\",\n\tdanger: \"red\",\n\tinfo: \"gray\",\n}\n","import React, { FC, forwardRef } from \"react\"\nimport { ButtonProps } from \"./typings.ts\"\nimport styles from \"./Button.module.sass\"\nimport classNames from \"classnames\"\nimport { Button as RadixButton } from \"@radix-ui/themes\"\nimport { hoverEffectClassNameMapping } from \"./constants.ts\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\n\nconst _Button = forwardRef(function Button(\n\t{ className, severity = \"primary\", size = \"medium\", hoverEffects, fluid, ...rest }: ButtonProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst hoverEffectClasses =\n\t\thoverEffects?.map((hoverEffect) => {\n\t\t\treturn hoverEffectClassNameMapping[hoverEffect]\n\t\t}) || []\n\n\treturn (\n\t\t<RadixButton\n\t\t\tref={ref}\n\t\t\tclassName={classNames(styles.default, className, hoverEffectClasses, {\n\t\t\t\t[styles.fluid!]: fluid,\n\t\t\t})}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\tsize={applyResponsiveMapping(size, SizeMapping)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n})\n\n// using FC so storybook correctly displays the component props\nconst Button: FC<ButtonProps> = React.memo(_Button)\n\nexport default Button\n","import React, { FC, forwardRef } from \"react\"\nimport { ButtonProps } from \"./typings.ts\"\nimport classNames from \"classnames\"\nimport { IconButton as RadixIconButton } from \"@radix-ui/themes\"\nimport { hoverEffectClassNameMapping } from \"./constants.ts\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\n\ninterface IconButtonProps extends Omit<ButtonProps, \"fluid\"> {\n\t\"aria-label\": string\n}\n\nconst _Button = forwardRef(function Button(\n\t{ className, children, severity = \"primary\", size = \"medium\", hoverEffects, ...rest }: IconButtonProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst hoverEffectClasses =\n\t\thoverEffects?.map((hoverEffect) => {\n\t\t\treturn hoverEffectClassNameMapping[hoverEffect]\n\t\t}) || []\n\n\treturn (\n\t\t<RadixIconButton\n\t\t\tclassName={classNames(className, hoverEffectClasses)}\n\t\t\tref={ref}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\tsize={applyResponsiveMapping(size, SizeMapping)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</RadixIconButton>\n\t)\n})\n\n// using FC so storybook correctly displays the component props\nconst IconButton: FC<IconButtonProps> = React.memo(_Button)\n\nexport default IconButton\n","import { memo } from \"react\"\nimport { Dialog, Flex, IconButton } from \"@radix-ui/themes\"\nimport { Cross1Icon } from \"@radix-ui/react-icons\"\nimport { DialogContentProps } from \"./typings\"\n\nexport const DialogContent = memo((props: DialogContentProps) => {\n\tconst { title, description, content, closeDialog } = props\n\treturn (\n\t\t<Flex direction={\"column\"} gap={\"2\"}>\n\t\t\t<Flex direction={\"column\"} gap={\"1\"}>\n\t\t\t\t<Flex justify={\"between\"}>\n\t\t\t\t\t<Dialog.Title mb={\"0\"}>{title}</Dialog.Title>\n\t\t\t\t\t<Dialog.Close>\n\t\t\t\t\t\t<IconButton color=\"gray\" variant={\"ghost\"} aria-label=\"Close\">\n\t\t\t\t\t\t\t<Cross1Icon />\n\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t</Dialog.Close>\n\t\t\t\t</Flex>\n\t\t\t\t<Dialog.Description>{description}</Dialog.Description>\n\t\t\t</Flex>\n\t\t\t{content(closeDialog)}\n\t\t</Flex>\n\t)\n})\n","import { memo, useState, useCallback } from \"react\"\nimport { Dialog as RadixDialog } from \"@radix-ui/themes\"\nimport { DialogContent } from \"./DialogContent\"\nimport { CloseDialogWithOptions, DialogProps } from \"./typings\"\n\n/**\n * Display or collect information in a modal. Unlike the `AlertDialog`, the `Dialog`'s can be nested\n * and close when clicking outside of the dialog content.\n */\nexport const Dialog = memo((props: DialogProps) => {\n\tconst { children, size, onOpen, onCloseInterrupt, ...contentProps } = props\n\tconst [open, setOpen] = useState(false)\n\n\tconst handleOpenChange = useCallback(\n\t\t(next: boolean) => {\n\t\t\tif (next && onOpen) {\n\t\t\t\tonOpen()\n\t\t\t} else if (!next && onCloseInterrupt) {\n\t\t\t\t// closes the dialog, bypassing the checks in `handleOpenChange`\n\t\t\t\tconst confirmClose = () => setOpen(false)\n\n\t\t\t\t// if onCloseInterrupt is passed, bypass the standard close behavior and require\n\t\t\t\t// the passed `confirmClose` to close the dialog\n\t\t\t\treturn onCloseInterrupt(confirmClose)\n\t\t\t}\n\n\t\t\tsetOpen(next)\n\t\t},\n\t\t[onOpen, onCloseInterrupt],\n\t)\n\n\tconst closeDialog = useCallback<CloseDialogWithOptions>(\n\t\t(options) => {\n\t\t\tif (options?.force) {\n\t\t\t\t// bypass the checks in the `handleOpenChange` function\n\t\t\t\treturn setOpen(false)\n\t\t\t}\n\n\t\t\thandleOpenChange(false)\n\t\t},\n\t\t[handleOpenChange],\n\t)\n\n\treturn (\n\t\t<RadixDialog.Root open={open} onOpenChange={handleOpenChange}>\n\t\t\t<RadixDialog.Content size={size}>\n\t\t\t\t<DialogContent closeDialog={closeDialog} {...contentProps} />\n\t\t\t</RadixDialog.Content>\n\n\t\t\t{children(RadixDialog.Trigger)}\n\t\t</RadixDialog.Root>\n\t)\n})\n","import { AlertDialog, Flex } from \"@radix-ui/themes\"\nimport { AlertDialogStandardContent } from \"./typings\"\nimport { Button } from \"../../Buttons\"\n\n// remove the margin-bottom from the title so that Flex works as expected\nexport const Title: typeof AlertDialog.Title = ((props) => (\n\t<AlertDialog.Title mb=\"0\" {...props} />\n)) as typeof AlertDialog.Title\n\nexport const AlertDialogContent = (props: AlertDialogStandardContent) => {\n\tconst { title, description, actionText = \"Confirm\", cancelText = \"Cancel\", onAction, onCancel, severity } = props\n\treturn (\n\t\t<Flex direction={\"column\"} gap={\"2\"}>\n\t\t\t<Flex direction={\"column\"} gap={\"1\"}>\n\t\t\t\t<Title>{title}</Title>\n\t\t\t\t<AlertDialog.Description>{description}</AlertDialog.Description>\n\t\t\t</Flex>\n\n\t\t\t<Flex gap=\"3\" mt=\"4\" justify=\"end\">\n\t\t\t\t<AlertDialog.Cancel>\n\t\t\t\t\t<Button variant=\"soft\" severity=\"info\" onClick={onCancel}>\n\t\t\t\t\t\t{cancelText}\n\t\t\t\t\t</Button>\n\t\t\t\t</AlertDialog.Cancel>\n\t\t\t\t<AlertDialog.Action>\n\t\t\t\t\t<Button variant=\"solid\" severity={severity} onClick={onAction}>\n\t\t\t\t\t\t{actionText}\n\t\t\t\t\t</Button>\n\t\t\t\t</AlertDialog.Action>\n\t\t\t</Flex>\n\t\t</Flex>\n\t)\n}\n","import { memo, useMemo } from \"react\"\nimport { AlertDialog as RadixAlertDialog } from \"@radix-ui/themes\"\nimport { AlertDialogContentHelpers, AlertDialogProps } from \"./typings\"\nimport { AlertDialogContent, Title } from \"./AlertDialogContent\"\n\n/**\n * The AlertDialog is used to confirm an action or prompt the user for a decision.\n * Unlike the Dialog, the AlertDialog is not dismissible by clicking outside of the dialog, nor can it be nested.\n *\n * To use, place the `AlertDialogProvider` at the root of your app and use the `useAlertDialog` hook to open the dialog.\n *\n * To set the content of the dialog, use the `content` prop or pass values for the `title`, `description`, and `onAction` props.\n */\nexport const AlertDialog = memo((props: AlertDialogProps) => {\n\tconst { open, setOpen, children, ...contentProps } = props\n\n\tconst helpers: AlertDialogContentHelpers = useMemo(() => {\n\t\treturn {\n\t\t\tclose: () => setOpen(false),\n\t\t\tTitle,\n\t\t\tDescription: RadixAlertDialog.Description,\n\t\t}\n\t}, [setOpen])\n\n\treturn (\n\t\t<RadixAlertDialog.Root open={open} onOpenChange={setOpen}>\n\t\t\t<RadixAlertDialog.Content>\n\t\t\t\t{\"content\" in contentProps ? contentProps.content(helpers) : <AlertDialogContent {...contentProps} />}\n\t\t\t</RadixAlertDialog.Content>\n\t\t\t{children}\n\t\t</RadixAlertDialog.Root>\n\t)\n})\n","import { createContext, memo, useState, useCallback } from \"react\"\nimport { AlertDialogContextType, AlertDialogOptions } from \"./typings\"\nimport { AlertDialog } from \"./AlertDialog\"\n\ninterface AlertDialogProviderProps {\n\tchildren: React.ReactNode\n}\n\nexport const AlertDialogContent = createContext<AlertDialogContextType>(() => {\n\tthrow new Error(\"No AlertDialogProvider found\")\n})\n\nconst initialState: AlertDialogOptions = {\n\tcontent: () => null,\n}\n\nexport const AlertDialogProvider = memo(({ children }: AlertDialogProviderProps) => {\n\tconst [open, setOpen] = useState(false)\n\tconst [state, setState] = useState<AlertDialogOptions>(initialState)\n\n\tconst openDialog = useCallback<AlertDialogContextType>(\n\t\t(options) => {\n\t\t\tif (open) throw new Error(\"AlertDialog is already open\")\n\n\t\t\tsetState(options)\n\t\t\tsetOpen(true)\n\t\t},\n\t\t[open],\n\t)\n\n\treturn (\n\t\t<AlertDialog open={open} setOpen={setOpen} {...state}>\n\t\t\t<AlertDialogContent.Provider value={openDialog}>{children}</AlertDialogContent.Provider>\n\t\t</AlertDialog>\n\t)\n})\n","import { useContext } from \"react\"\nimport { AlertDialogContent } from \"./context\"\n\nexport const useAlertDialog = () => {\n\treturn useContext(AlertDialogContent)\n}\n","import React, { FC, forwardRef, useMemo } from \"react\"\nimport { Select as RadixSelect } from \"@radix-ui/themes\"\nimport classNames from \"classnames\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\nimport { SelectItemProps, SelectProps } from \"./typings.ts\"\n\nimport styles from \"./Select.module.sass\"\n\nconst _Select = forwardRef(function Select(\n\t{\n\t\tclassName,\n\t\tfluid,\n\t\tsize = \"medium\",\n\t\tvariant = \"surface\",\n\t\tseverity = \"primary\",\n\t\tplaceholder = \"Select\",\n\t\tside,\n\t\titems = [],\n\t\t...rest\n\t}: SelectProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst mappedSize = useMemo(() => {\n\t\treturn applyResponsiveMapping(size, SizeMapping)\n\t}, [size])\n\n\t// TODO: extend functionality to support grouping of items\n\treturn (\n\t\t<RadixSelect.Root size={mappedSize}>\n\t\t\t<RadixSelect.Trigger\n\t\t\t\tclassName={classNames(className, styles.default, {\n\t\t\t\t\t[styles.fluid!]: fluid,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t\tvariant={variant}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t\t<RadixSelect.Content\n\t\t\t\tside={side}\n\t\t\t\tposition=\"popper\"\n\t\t\t\tvariant={variant !== \"surface\" ? \"soft\" : \"solid\"}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t>\n\t\t\t\t{items.map(({ label, value, ...rest }: SelectItemProps) => (\n\t\t\t\t\t<RadixSelect.Item className={classNames(styles.itemDefault)} key={value} value={value} {...rest}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</RadixSelect.Item>\n\t\t\t\t))}\n\t\t\t</RadixSelect.Content>\n\t\t</RadixSelect.Root>\n\t)\n})\nexport const Select: FC<SelectProps> = React.memo(_Select)\n","import React, { FC, forwardRef, useMemo } from \"react\"\nimport { Text, TextField as RadixTextField } from \"@radix-ui/themes\"\nimport classNames from \"classnames\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SizeMapping, SeverityColorMapping } from \"../constants.ts\"\nimport { InputProps } from \"./typings.ts\"\n\nimport styles from \"./TextField.module.sass\"\n\nconst _Input = forwardRef(function Input(\n\t{\n\t\tclassName,\n\t\tleftIcon,\n\t\trightIcon,\n\t\tsize = \"medium\",\n\t\tshowInputLength = false,\n\t\tvalue,\n\t\tvariant,\n\t\tseverity = \"primary\",\n\t\t...rest\n\t}: InputProps,\n\tref: React.Ref<HTMLInputElement>,\n) {\n\tconst computedSize = useMemo(() => {\n\t\treturn applyResponsiveMapping(size, SizeMapping)\n\t}, [size])\n\n\tconst displayInputLength = showInputLength || (!showInputLength && rest.maxLength !== undefined)\n\tconst valueAsString = value !== undefined ? value.toString() : undefined\n\n\treturn (\n\t\t<>\n\t\t\t<RadixTextField.Root\n\t\t\t\tclassName={classNames({\n\t\t\t\t\t[styles.accommodateCharCount!]: displayInputLength,\n\t\t\t\t})}\n\t\t\t\tsize={computedSize}\n\t\t\t\tvariant={variant}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t>\n\t\t\t\t<RadixTextField.Slot>{leftIcon}</RadixTextField.Slot>\n\t\t\t\t<RadixTextField.Input\n\t\t\t\t\tclassName={classNames(styles.default, className, {\n\t\t\t\t\t\t[styles.noLeftIcon!]: !leftIcon,\n\t\t\t\t\t\t[styles.noRightIcon!]: !rightIcon,\n\t\t\t\t\t})}\n\t\t\t\t\tref={ref}\n\t\t\t\t\tsize={computedSize}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t\t<RadixTextField.Slot>{rightIcon}</RadixTextField.Slot>\n\t\t\t\t{displayInputLength && (\n\t\t\t\t\t<Text as=\"p\" className={styles.charCount} size=\"1\" color=\"gray\">\n\t\t\t\t\t\t{rest.maxLength !== undefined\n\t\t\t\t\t\t\t? `${valueAsString?.length}/${rest.maxLength}`\n\t\t\t\t\t\t\t: `${valueAsString?.length}`}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</RadixTextField.Root>\n\t\t</>\n\t)\n})\nexport const Input: FC<InputProps> = React.memo(_Input)\n"],"names":["hasOwn","classNames","classes","i","arg","argType","inner","key","module","hoverEffectClassNameMapping","styles","applyResponsiveMapping","value","mapping","_value","SizeMapping","SeverityColorMapping","_Button","forwardRef","className","severity","size","hoverEffects","fluid","rest","ref","hoverEffectClasses","hoverEffect","jsx","RadixButton","Button","React","children","RadixIconButton","IconButton","DialogContent","memo","props","title","description","content","closeDialog","jsxs","Flex","Dialog","Cross1Icon","onOpen","onCloseInterrupt","contentProps","open","setOpen","useState","handleOpenChange","useCallback","next","options","RadixDialog","Title","AlertDialog","AlertDialogContent","actionText","cancelText","onAction","onCancel","helpers","useMemo","RadixAlertDialog","createContext","initialState","AlertDialogProvider","state","setState","openDialog","useAlertDialog","useContext","_Select","variant","placeholder","side","items","mappedSize","RadixSelect","label","Select","_Input","leftIcon","rightIcon","showInputLength","computedSize","displayInputLength","valueAsString","Fragment","RadixTextField","Text","Input"],"mappings":";;;;gBAOC,UAAY,CAGZ,IAAIA,EAAS,CAAE,EAAC,eAGhB,SAASC,GAAa,CAGrB,QAFIC,EAAU,CAAA,EAELC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CAC1C,IAAIC,EAAM,UAAUD,CAAC,EACrB,GAAKC,EAEL,KAAIC,EAAU,OAAOD,EAErB,GAAIC,IAAY,UAAYA,IAAY,SACvCH,EAAQ,KAAKE,CAAG,UACN,MAAM,QAAQA,CAAG,GAC3B,GAAIA,EAAI,OAAQ,CACf,IAAIE,EAAQL,EAAW,MAAM,KAAMG,CAAG,EAClCE,GACHJ,EAAQ,KAAKI,CAAK,CAEnB,UACSD,IAAY,SAAU,CAChC,GAAID,EAAI,WAAa,OAAO,UAAU,UAAY,CAACA,EAAI,SAAS,SAAQ,EAAG,SAAS,eAAe,EAAG,CACrGF,EAAQ,KAAKE,EAAI,SAAU,CAAA,EAC3B,QACA,CAED,QAASG,KAAOH,EACXJ,EAAO,KAAKI,EAAKG,CAAG,GAAKH,EAAIG,CAAG,GACnCL,EAAQ,KAAKK,CAAG,CAGlB,EACD,CAED,OAAOL,EAAQ,KAAK,GAAG,CACvB,CAEoCM,EAAO,SAC3CP,EAAW,QAAUA,EACrBO,EAAA,QAAiBP,GAOjB,OAAO,WAAaA,CAEtB,uCCxDaQ,EAA6E,CACzF,gBAAiBC,EAAO,qBACxB,iBAAkBA,EAAO,sBACzB,iBAAkBA,EAAO,qBAC1B,ECGgB,SAAAC,EAA4CC,EAAsBC,EAAuB,CACpG,GAAA,OAAOD,GAAU,SAAU,CAC1B,GAAA,EAAE,YAAaA,GAEZ,MAAA,IAAI,MAAM,0DAA0D,EAE3E,OAAO,OAA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E,IAAU,OAAYA,EAAM,WAAa,OAE/D,OAEEgB,MAAA+D,EAAAA,SAAA,CAAA,SAAAjD,EAAA,KAACkD,EAAAA,UAAe,KAAf,CACA,UAAW3F,EAAW,CACrB,CAACS,EAAO,oBAAqB,EAAG+E,CAAA,CAChC,EACD,KAAMD,EACN,QAAAZ,EACA,MAAO5D,EAAqBI,CAAQ,EAEpC,SAAA,CAACQ,EAAAA,IAAAgE,EAAAA,UAAe,KAAf,CAAqB,SAASP,CAAA,CAAA,EAC/BzD,EAAA,IAACgE,EAAAA,UAAe,MAAf,CACA,UAAW3F,EAAWS,EAAO,QAASS,EAAW,CAChD,CAACT,EAAO,UAAW,EAAG,CAAC2E,EACvB,CAAC3E,EAAO,WAAY,EAAG,CAAC4E,CAAA,CACxB,EACD,IAAA7D,EACA,KAAM+D,EACN,QAAAZ,EACA,MAAO5D,EAAqBI,CAAQ,EACnC,GAAGI,CAAA,CACL,EACCI,EAAAA,IAAAgE,EAAAA,UAAe,KAAf,CAAqB,SAAUN,CAAA,CAAA,EAC/BG,GACC7D,EAAAA,IAAAiE,EAAAA,KAAA,CAAK,GAAG,IAAI,UAAWnF,EAAO,UAAW,KAAK,IAAI,MAAM,OACvD,WAAK,YAAc,OACjB,GAAGgF,GAAA,YAAAA,EAAe,MAAM,IAAIlE,EAAK,SAAS,GAC1C,GAAGkE,GAAA,YAAAA,EAAe,MAAM,EAC5B,CAAA,CAAA,CAAA,CAGH,CAAA,CAAA,CAEF,CAAC,EACYI,EAAwB/D,EAAM,KAAKqD,CAAM","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"blocks.umd.cjs","sources":["../node_modules/classnames/index.js","../src/Buttons/constants.ts","../src/utils.ts","../src/constants.ts","../src/Buttons/Button.tsx","../src/Buttons/IconButton.tsx","../src/Dialogs/Dialog/DialogContent.tsx","../src/Dialogs/Dialog/Dialog.tsx","../src/Dialogs/AlertDialog/AlertDialogContent.tsx","../src/Dialogs/AlertDialog/AlertDialog.tsx","../src/Dialogs/AlertDialog/context.tsx","../src/Dialogs/AlertDialog/hooks.ts","../src/Select/Select.tsx","../src/Input/Input.tsx","../src/Popover/Popover.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import { ButtonHoverEffect } from \"./typings.ts\"\nimport styles from \"./Button.module.sass\"\n\nexport const hoverEffectClassNameMapping: Record<ButtonHoverEffect, string | undefined> = {\n\tspin90Clockwise: styles.hoverSpin90Clockwise,\n\tspin180Clockwise: styles.hoverSpin180Clockwise,\n\tspin360Clockwise: styles.hoverSpin360Clockwise,\n}\n","import { Responsive } from \"@radix-ui/themes\"\n\n// applyResponsiveMapping is a helper function used to map the keys of a Radix Responsive type that can be understood\n// by a Radix component or primitive. The point of this is to leverage our own custom prop names and values while still\n// using Radix's built in Responsiveness functionality.\n/**\n * Returns an object with mapped key values or a single mapped value\n * @param value an object or string\n * @param mapping a Record mapping the object values of param value\n */\nexport function applyResponsiveMapping<T extends string, K>(value: Responsive<T>, mapping: Record<T, K>) {\n\tif (typeof value === \"object\") {\n\t\tif (!(\"initial\" in value)) {\n\t\t\t// Responsive objects require an 'initial' property to be set that acts as a default\n\t\t\tthrow new Error(\"Expected initial property to be set in Responsive object\")\n\t\t}\n\t\treturn Object.fromEntries(Object.entries(value).map(([key, _value]) => [key, mapping[_value]]))\n\t} else {\n\t\treturn mapping[value]\n\t}\n}\n","import React from \"react\"\nimport { Severity, Size } from \"./typings.ts\"\nimport { Theme } from \"@radix-ui/themes\"\n\ntype ThemeProps = React.ComponentProps<typeof Theme>\n\n// Mappings\nexport const SizeMapping: Record<Size, \"1\" | \"2\" | \"3\"> = {\n\tsmall: \"1\",\n\tmedium: \"2\",\n\tlarge: \"3\",\n}\n\nexport const SeverityColorMapping: Record<Severity, ThemeProps[\"accentColor\"]> = {\n\tprimary: \"indigo\",\n\tsuccess: \"green\",\n\tdanger: \"red\",\n\tinfo: \"gray\",\n}\n","import React, { FC, forwardRef } from \"react\"\nimport { ButtonProps } from \"./typings.ts\"\nimport styles from \"./Button.module.sass\"\nimport classNames from \"classnames\"\nimport { Button as RadixButton } from \"@radix-ui/themes\"\nimport { hoverEffectClassNameMapping } from \"./constants.ts\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\n\nconst _Button = forwardRef(function Button(\n\t{ className, severity = \"primary\", size = \"medium\", hoverEffects, fluid, ...rest }: ButtonProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst hoverEffectClasses =\n\t\thoverEffects?.map((hoverEffect) => {\n\t\t\treturn hoverEffectClassNameMapping[hoverEffect]\n\t\t}) || []\n\n\treturn (\n\t\t<RadixButton\n\t\t\tref={ref}\n\t\t\tclassName={classNames(styles.default, className, hoverEffectClasses, {\n\t\t\t\t[styles.fluid!]: fluid,\n\t\t\t})}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\tsize={applyResponsiveMapping(size, SizeMapping)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n})\n\n// using FC so storybook correctly displays the component props\nconst Button: FC<ButtonProps> = React.memo(_Button)\n\nexport default Button\n","import React, { FC, forwardRef } from \"react\"\nimport { ButtonProps } from \"./typings.ts\"\nimport classNames from \"classnames\"\nimport { IconButton as RadixIconButton } from \"@radix-ui/themes\"\nimport { hoverEffectClassNameMapping } from \"./constants.ts\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\n\ninterface IconButtonProps extends Omit<ButtonProps, \"fluid\"> {\n\t\"aria-label\": string\n}\n\nconst _Button = forwardRef(function Button(\n\t{ className, children, severity = \"primary\", size = \"medium\", hoverEffects, ...rest }: IconButtonProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst hoverEffectClasses =\n\t\thoverEffects?.map((hoverEffect) => {\n\t\t\treturn hoverEffectClassNameMapping[hoverEffect]\n\t\t}) || []\n\n\treturn (\n\t\t<RadixIconButton\n\t\t\tclassName={classNames(className, hoverEffectClasses)}\n\t\t\tref={ref}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\tsize={applyResponsiveMapping(size, SizeMapping)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</RadixIconButton>\n\t)\n})\n\n// using FC so storybook correctly displays the component props\nconst IconButton: FC<IconButtonProps> = React.memo(_Button)\n\nexport default IconButton\n","import { memo } from \"react\"\nimport { Dialog, Flex, IconButton } from \"@radix-ui/themes\"\nimport { Cross1Icon } from \"@radix-ui/react-icons\"\nimport { DialogContentProps } from \"./typings\"\n\nexport const DialogContent = memo((props: DialogContentProps) => {\n\tconst { title, description, content, closeDialog } = props\n\treturn (\n\t\t<Flex direction={\"column\"} gap={\"2\"}>\n\t\t\t<Flex direction={\"column\"} gap={\"1\"}>\n\t\t\t\t<Flex justify={\"between\"}>\n\t\t\t\t\t<Dialog.Title mb={\"0\"}>{title}</Dialog.Title>\n\t\t\t\t\t<Dialog.Close>\n\t\t\t\t\t\t<IconButton color=\"gray\" variant={\"ghost\"} aria-label=\"Close\">\n\t\t\t\t\t\t\t<Cross1Icon />\n\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t</Dialog.Close>\n\t\t\t\t</Flex>\n\t\t\t\t<Dialog.Description>{description}</Dialog.Description>\n\t\t\t</Flex>\n\t\t\t{content(closeDialog)}\n\t\t</Flex>\n\t)\n})\n","import { memo, useState, useCallback } from \"react\"\nimport { Dialog as RadixDialog } from \"@radix-ui/themes\"\nimport { DialogContent } from \"./DialogContent\"\nimport { CloseDialogWithOptions, DialogProps } from \"./typings\"\n\n/**\n * Display or collect information in a modal. Unlike the `AlertDialog`, the `Dialog`'s can be nested\n * and close when clicking outside of the dialog content.\n */\nexport const Dialog = memo((props: DialogProps) => {\n\tconst { children, size, onOpen, onCloseInterrupt, ...contentProps } = props\n\tconst [open, setOpen] = useState(false)\n\n\tconst handleOpenChange = useCallback(\n\t\t(next: boolean) => {\n\t\t\tif (next && onOpen) {\n\t\t\t\tonOpen()\n\t\t\t} else if (!next && onCloseInterrupt) {\n\t\t\t\t// closes the dialog, bypassing the checks in `handleOpenChange`\n\t\t\t\tconst confirmClose = () => setOpen(false)\n\n\t\t\t\t// if onCloseInterrupt is passed, bypass the standard close behavior and require\n\t\t\t\t// the passed `confirmClose` to close the dialog\n\t\t\t\treturn onCloseInterrupt(confirmClose)\n\t\t\t}\n\n\t\t\tsetOpen(next)\n\t\t},\n\t\t[onOpen, onCloseInterrupt],\n\t)\n\n\tconst closeDialog = useCallback<CloseDialogWithOptions>(\n\t\t(options) => {\n\t\t\tif (options?.force) {\n\t\t\t\t// bypass the checks in the `handleOpenChange` function\n\t\t\t\treturn setOpen(false)\n\t\t\t}\n\n\t\t\thandleOpenChange(false)\n\t\t},\n\t\t[handleOpenChange],\n\t)\n\n\treturn (\n\t\t<RadixDialog.Root open={open} onOpenChange={handleOpenChange}>\n\t\t\t<RadixDialog.Content size={size}>\n\t\t\t\t<DialogContent closeDialog={closeDialog} {...contentProps} />\n\t\t\t</RadixDialog.Content>\n\n\t\t\t{children(RadixDialog.Trigger)}\n\t\t</RadixDialog.Root>\n\t)\n})\n","import { AlertDialog, Flex } from \"@radix-ui/themes\"\nimport { AlertDialogStandardContent } from \"./typings\"\nimport { Button } from \"../../Buttons\"\n\n// remove the margin-bottom from the title so that Flex works as expected\nexport const Title: typeof AlertDialog.Title = ((props) => (\n\t<AlertDialog.Title mb=\"0\" {...props} />\n)) as typeof AlertDialog.Title\n\nexport const AlertDialogContent = (props: AlertDialogStandardContent) => {\n\tconst { title, description, actionText = \"Confirm\", cancelText = \"Cancel\", onAction, onCancel, severity } = props\n\treturn (\n\t\t<Flex direction={\"column\"} gap={\"2\"}>\n\t\t\t<Flex direction={\"column\"} gap={\"1\"}>\n\t\t\t\t<Title>{title}</Title>\n\t\t\t\t<AlertDialog.Description>{description}</AlertDialog.Description>\n\t\t\t</Flex>\n\n\t\t\t<Flex gap=\"3\" mt=\"4\" justify=\"end\">\n\t\t\t\t<AlertDialog.Cancel>\n\t\t\t\t\t<Button variant=\"soft\" severity=\"info\" onClick={onCancel}>\n\t\t\t\t\t\t{cancelText}\n\t\t\t\t\t</Button>\n\t\t\t\t</AlertDialog.Cancel>\n\t\t\t\t<AlertDialog.Action>\n\t\t\t\t\t<Button variant=\"solid\" severity={severity} onClick={onAction}>\n\t\t\t\t\t\t{actionText}\n\t\t\t\t\t</Button>\n\t\t\t\t</AlertDialog.Action>\n\t\t\t</Flex>\n\t\t</Flex>\n\t)\n}\n","import { memo, useMemo } from \"react\"\nimport { AlertDialog as RadixAlertDialog } from \"@radix-ui/themes\"\nimport { AlertDialogContentHelpers, AlertDialogProps } from \"./typings\"\nimport { AlertDialogContent, Title } from \"./AlertDialogContent\"\n\n/**\n * The AlertDialog is used to confirm an action or prompt the user for a decision.\n * Unlike the Dialog, the AlertDialog is not dismissible by clicking outside of the dialog, nor can it be nested.\n *\n * To use, place the `AlertDialogProvider` at the root of your app and use the `useAlertDialog` hook to open the dialog.\n *\n * To set the content of the dialog, use the `content` prop or pass values for the `title`, `description`, and `onAction` props.\n */\nexport const AlertDialog = memo((props: AlertDialogProps) => {\n\tconst { open, setOpen, children, ...contentProps } = props\n\n\tconst helpers: AlertDialogContentHelpers = useMemo(() => {\n\t\treturn {\n\t\t\tclose: () => setOpen(false),\n\t\t\tTitle,\n\t\t\tDescription: RadixAlertDialog.Description,\n\t\t}\n\t}, [setOpen])\n\n\treturn (\n\t\t<RadixAlertDialog.Root open={open} onOpenChange={setOpen}>\n\t\t\t<RadixAlertDialog.Content>\n\t\t\t\t{\"content\" in contentProps ? contentProps.content(helpers) : <AlertDialogContent {...contentProps} />}\n\t\t\t</RadixAlertDialog.Content>\n\t\t\t{children}\n\t\t</RadixAlertDialog.Root>\n\t)\n})\n","import { createContext, memo, useState, useCallback } from \"react\"\nimport { AlertDialogContextType, AlertDialogOptions } from \"./typings\"\nimport { AlertDialog } from \"./AlertDialog\"\n\ninterface AlertDialogProviderProps {\n\tchildren: React.ReactNode\n}\n\nexport const AlertDialogContent = createContext<AlertDialogContextType>(() => {\n\tthrow new Error(\"No AlertDialogProvider found\")\n})\n\nconst initialState: AlertDialogOptions = {\n\tcontent: () => null,\n}\n\nexport const AlertDialogProvider = memo(({ children }: AlertDialogProviderProps) => {\n\tconst [open, setOpen] = useState(false)\n\tconst [state, setState] = useState<AlertDialogOptions>(initialState)\n\n\tconst openDialog = useCallback<AlertDialogContextType>(\n\t\t(options) => {\n\t\t\tif (open) throw new Error(\"AlertDialog is already open\")\n\n\t\t\tsetState(options)\n\t\t\tsetOpen(true)\n\t\t},\n\t\t[open],\n\t)\n\n\treturn (\n\t\t<AlertDialog open={open} setOpen={setOpen} {...state}>\n\t\t\t<AlertDialogContent.Provider value={openDialog}>{children}</AlertDialogContent.Provider>\n\t\t</AlertDialog>\n\t)\n})\n","import { useContext } from \"react\"\nimport { AlertDialogContent } from \"./context\"\n\nexport const useAlertDialog = () => {\n\treturn useContext(AlertDialogContent)\n}\n","import React, { FC, forwardRef, useMemo } from \"react\"\nimport { Select as RadixSelect } from \"@radix-ui/themes\"\nimport classNames from \"classnames\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SeverityColorMapping, SizeMapping } from \"../constants.ts\"\nimport { SelectItemProps, SelectProps } from \"./typings.ts\"\n\nimport styles from \"./Select.module.sass\"\n\nconst _Select = forwardRef(function Select(\n\t{\n\t\tclassName,\n\t\tfluid,\n\t\tsize = \"medium\",\n\t\tvariant = \"surface\",\n\t\tseverity = \"primary\",\n\t\tplaceholder = \"Select\",\n\t\tside,\n\t\titems = [],\n\t\t...rest\n\t}: SelectProps,\n\tref: React.Ref<HTMLButtonElement>,\n) {\n\tconst mappedSize = useMemo(() => {\n\t\treturn applyResponsiveMapping(size, SizeMapping)\n\t}, [size])\n\n\t// TODO: extend functionality to support grouping of items\n\treturn (\n\t\t<RadixSelect.Root size={mappedSize}>\n\t\t\t<RadixSelect.Trigger\n\t\t\t\tclassName={classNames(className, styles.default, {\n\t\t\t\t\t[styles.fluid!]: fluid,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t\tvariant={variant}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t\t<RadixSelect.Content\n\t\t\t\tside={side}\n\t\t\t\tposition=\"popper\"\n\t\t\t\tvariant={variant !== \"surface\" ? \"soft\" : \"solid\"}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t>\n\t\t\t\t{items.map(({ label, value, ...rest }: SelectItemProps) => (\n\t\t\t\t\t<RadixSelect.Item className={classNames(styles.itemDefault)} key={value} value={value} {...rest}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</RadixSelect.Item>\n\t\t\t\t))}\n\t\t\t</RadixSelect.Content>\n\t\t</RadixSelect.Root>\n\t)\n})\nexport const Select: FC<SelectProps> = React.memo(_Select)\n","import React, { FC, forwardRef, useMemo } from \"react\"\nimport { Text, TextField as RadixTextField } from \"@radix-ui/themes\"\nimport classNames from \"classnames\"\nimport { applyResponsiveMapping } from \"../utils.ts\"\nimport { SizeMapping, SeverityColorMapping } from \"../constants.ts\"\nimport { InputProps } from \"./typings.ts\"\n\nimport styles from \"./Input.module.sass\"\n\nconst _Input = forwardRef(function Input(\n\t{\n\t\tclassName,\n\t\tleftIcon,\n\t\trightIcon,\n\t\tsize = \"medium\",\n\t\tshowInputLength,\n\t\tvalue,\n\t\tvariant,\n\t\tseverity = \"primary\",\n\t\t...rest\n\t}: InputProps,\n\tref: React.Ref<HTMLInputElement>,\n) {\n\tconst computedSize = useMemo(() => {\n\t\treturn applyResponsiveMapping(size, SizeMapping)\n\t}, [size])\n\n\tconst displayInputLength = showInputLength || (showInputLength === undefined && rest.maxLength !== undefined)\n\tconst valueAsString = value !== undefined ? value.toString() : undefined\n\n\treturn (\n\t\t<RadixTextField.Root\n\t\t\tclassName={classNames({\n\t\t\t\t[styles.accommodateCharCount!]: displayInputLength,\n\t\t\t})}\n\t\t\tsize={computedSize}\n\t\t\tvariant={variant}\n\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t>\n\t\t\t<RadixTextField.Slot>{leftIcon}</RadixTextField.Slot>\n\t\t\t<RadixTextField.Input\n\t\t\t\tclassName={classNames(styles.default, className, {\n\t\t\t\t\t[styles.noLeftIcon!]: !leftIcon,\n\t\t\t\t\t[styles.noRightIcon!]: !rightIcon,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t\tsize={computedSize}\n\t\t\t\tvariant={variant}\n\t\t\t\tcolor={SeverityColorMapping[severity]}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t\t<RadixTextField.Slot>{rightIcon}</RadixTextField.Slot>\n\t\t\t{displayInputLength && (\n\t\t\t\t<Text as=\"p\" className={styles.charCount} size=\"1\" color=\"gray\">\n\t\t\t\t\t{rest.maxLength !== undefined\n\t\t\t\t\t\t? `${valueAsString?.length}/${rest.maxLength}`\n\t\t\t\t\t\t: `${valueAsString?.length}`}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</RadixTextField.Root>\n\t)\n})\nexport const Input: FC<InputProps> = React.memo(_Input)\n","import React, { forwardRef, FC } from \"react\"\nimport { Popover as RadixPopover } from \"@radix-ui/themes\"\nimport { PopoverProps } from \"./typings.ts\"\n\nconst _Popover = forwardRef(function Popover(\n\t{ defaultOpen = false, modal = false, content, children, ...rest }: PopoverProps,\n\tref: React.Ref<HTMLDivElement>,\n) {\n\treturn (\n\t\t<RadixPopover.Root defaultOpen={defaultOpen} modal={modal}>\n\t\t\t<RadixPopover.Trigger>{children}</RadixPopover.Trigger>\n\t\t\t<RadixPopover.Content ref={ref} {...rest}>\n\t\t\t\t{content(RadixPopover.Close)}\n\t\t\t</RadixPopover.Content>\n\t\t</RadixPopover.Root>\n\t)\n})\nexport const Popover: FC<PopoverProps> = React.memo(_Popover)\n"],"names":["hasOwn","classNames","classes","arg","argType","inner","key","module","hoverEffectClassNameMapping","styles","applyResponsiveMapping","value","mapping","_value","SizeMapping","SeverityColorMapping","_Button","forwardRef","className","severity","size","hoverEffects","fluid","rest","ref","hoverEffectClasses","hoverEffect","jsx","RadixButton","Button","React","children","RadixIconButton","IconButton","DialogContent","memo","props","title","description","content","closeDialog","jsxs","Flex","Dialog","Cross1Icon","onOpen","onCloseInterrupt","contentProps","open","setOpen","useState","handleOpenChange","useCallback","next","options","RadixDialog","Title","AlertDialog","AlertDialogContent","actionText","cancelText","onAction","onCancel","helpers","useMemo","RadixAlertDialog","createContext","initialState","AlertDialogProvider","state","setState","openDialog","useAlertDialog","useContext","_Select","variant","placeholder","side","items","mappedSize","RadixSelect","label","Select","_Input","leftIcon","rightIcon","showInputLength","computedSize","displayInputLength","valueAsString","RadixTextField","Text","Input","_Popover","defaultOpen","modal","RadixPopover","Popover"],"mappings":";;;;gBAOC,UAAY,CAGZ,IAAIA,EAAS,CAAE,EAAC,eAGhB,SAASC,GAAa,CAGrB,QAFIC,EAAU,CAAA,EAEL,EAAI,EAAG,EAAI,UAAU,OAAQ,IAAK,CAC1C,IAAIC,EAAM,UAAU,CAAC,EACrB,GAAKA,EAEL,KAAIC,EAAU,OAAOD,EAErB,GAAIC,IAAY,UAAYA,IAAY,SACvCF,EAAQ,KAAKC,CAAG,UACN,MAAM,QAAQA,CAAG,GAC3B,GAAIA,EAAI,OAAQ,CACf,IAAIE,EAAQJ,EAAW,MAAM,KAAME,CAAG,EAClCE,GACHH,EAAQ,KAAKG,CAAK,CAEnB,UACSD,IAAY,SAAU,CAChC,GAAID,EAAI,WAAa,OAAO,UAAU,UAAY,CAACA,EAAI,SAAS,SAAQ,EAAG,SAAS,eAAe,EAAG,CACrGD,EAAQ,KAAKC,EAAI,SAAU,CAAA,EAC3B,QACA,CAED,QAASG,KAAOH,EACXH,EAAO,KAAKG,EAAKG,CAAG,GAAKH,EAAIG,CAAG,GACnCJ,EAAQ,KAAKI,CAAG,CAGlB,EACD,CAED,OAAOJ,EAAQ,KAAK,GAAG,CACvB,CAEoCK,EAAO,SAC3CN,EAAW,QAAUA,EACrBM,EAAA,QAAiBN,GAOjB,OAAO,WAAaA,CAEtB,uCCxDaO,EAA6E,CACzF,gBAAiBC,EAAO,qBACxB,iBAAkBA,EAAO,sBACzB,iBAAkB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KAAAuD,EAAAA,QAAa,KAAb,CAAkB,YAAAF,EAA0B,MAAAC,EAC5C,SAAA,CAACpE,EAAAA,IAAAqE,EAAA,QAAa,QAAb,CAAsB,SAAAjE,CAAS,CAAA,EAChCJ,EAAAA,IAACqE,EAAa,QAAA,QAAb,CAAqB,IAAAxE,EAAW,GAAGD,EAClC,SAAAgB,EAAQyD,UAAa,KAAK,CAC5B,CAAA,CACD,CAAA,CAAA,CAEF,CAAC,EACYC,EAA4BnE,EAAM,KAAK+D,CAAQ","x_google_ignoreList":[0]}
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overmap-ai/blocks",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.1-alpha.
|
|
4
|
+
"version": "0.0.1-alpha.24",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/blocks.umd.cjs",
|
|
7
7
|
"module": "dist/blocks.js",
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "storybook dev -p 6006",
|
|
11
11
|
"build": "tsc --noEmit && vite build",
|
|
12
|
-
"lint": "eslint src
|
|
12
|
+
"lint": "eslint src .storybook stories --ext ts,tsx,js,jsx --report-unused-disable-directives --max-warnings 0",
|
|
13
13
|
"lint:fix": "yarn lint --fix",
|
|
14
14
|
"preview": "vite preview",
|
|
15
15
|
"prepare": "husky install",
|
|
16
16
|
"build-storybook": "storybook build"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@radix-ui/themes": "^1.1.2",
|
|
20
19
|
"@radix-ui/colors": "^3.0.0-rc.5",
|
|
21
20
|
"@radix-ui/react-icons": "^1.3.0",
|
|
21
|
+
"@radix-ui/themes": "^1.1.2",
|
|
22
22
|
"react": "^18.2.0",
|
|
23
23
|
"react-dom": "^18.2.0"
|
|
24
24
|
},
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@storybook/react": "^7.4.3",
|
|
38
38
|
"@storybook/react-vite": "^7.4.3",
|
|
39
39
|
"@storybook/testing-library": "^0.2.1",
|
|
40
|
+
"@storybook/types": "^7.4.6",
|
|
40
41
|
"@types/node": "^20.6.3",
|
|
41
42
|
"@types/react": "^18.2.15",
|
|
42
43
|
"@types/react-dom": "^18.2.7",
|
|
@@ -66,6 +67,9 @@
|
|
|
66
67
|
"lint-staged": {
|
|
67
68
|
"*.{js,jsx,ts,tsx}": [
|
|
68
69
|
"yarn eslint --fix"
|
|
70
|
+
],
|
|
71
|
+
"*.{css,scss}": [
|
|
72
|
+
"prettier --write"
|
|
69
73
|
]
|
|
70
74
|
},
|
|
71
75
|
"files": [
|