@parrot-co/parrot-ui 0.0.93 → 0.0.95
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/main.js +108 -115
- package/dist/main.js.map +1 -1
- package/dist/module.js +109 -116
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +21 -19
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/styles.css +1 -1
package/dist/main.js
CHANGED
|
@@ -159,39 +159,107 @@ const $eb8f27c3596a0e6b$export$e71c4d32a2263218 = /*#__PURE__*/ $8zHUo$react.for
|
|
|
159
159
|
|
|
160
160
|
|
|
161
161
|
|
|
162
|
-
const $
|
|
163
|
-
|
|
162
|
+
const $8ddcc69383feb36a$export$36308cce1deef340 = [
|
|
163
|
+
"tomato",
|
|
164
|
+
"red",
|
|
165
|
+
"crimson",
|
|
166
|
+
"pink",
|
|
167
|
+
"plum",
|
|
168
|
+
"purple",
|
|
169
|
+
"violet",
|
|
170
|
+
"indigo",
|
|
171
|
+
"blue",
|
|
172
|
+
"cyan",
|
|
173
|
+
"teal",
|
|
174
|
+
"green",
|
|
175
|
+
"grass",
|
|
176
|
+
"orange",
|
|
177
|
+
"brown",
|
|
178
|
+
"sky",
|
|
179
|
+
"mint",
|
|
180
|
+
"lime",
|
|
181
|
+
"yellow",
|
|
182
|
+
"amber",
|
|
183
|
+
"gold",
|
|
184
|
+
"bronze",
|
|
185
|
+
"gray",
|
|
186
|
+
"mauve",
|
|
187
|
+
"slate",
|
|
188
|
+
"sage",
|
|
189
|
+
"olive",
|
|
190
|
+
"sand"
|
|
191
|
+
];
|
|
192
|
+
const $8ddcc69383feb36a$export$b4e0e71242920c6a = {
|
|
193
|
+
sharp: "none",
|
|
194
|
+
pill: "full",
|
|
195
|
+
rounded: undefined
|
|
196
|
+
};
|
|
197
|
+
function $8ddcc69383feb36a$var$ps(styles) {
|
|
198
|
+
// 1. iterate over the keys of the styles object
|
|
199
|
+
// 2. for each key, check is is valid css property
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
function $4af7da5c7dd0b9c2$export$d41d9ab3de2def3d(text) {
|
|
204
|
+
const str = String(text);
|
|
205
|
+
let hash = 0;
|
|
206
|
+
let char;
|
|
207
|
+
if (str.trim().length === 0) return hash;
|
|
208
|
+
for(let i = 0; i < str.length; i++){
|
|
209
|
+
char = str.charCodeAt(i);
|
|
210
|
+
hash = (hash << 5) - hash + char;
|
|
211
|
+
// Convert to 32bit integer
|
|
212
|
+
hash &= hash;
|
|
213
|
+
}
|
|
214
|
+
return Math.abs(hash);
|
|
215
|
+
}
|
|
216
|
+
function $4af7da5c7dd0b9c2$export$d560c7e4a29451c2() {
|
|
217
|
+
return Math.random().toString(36);
|
|
218
|
+
}
|
|
219
|
+
function $4af7da5c7dd0b9c2$export$e4369cabd7e84cd9(string) {
|
|
220
|
+
const hash = $4af7da5c7dd0b9c2$export$d41d9ab3de2def3d(string);
|
|
221
|
+
return (0, $8ddcc69383feb36a$export$36308cce1deef340)[hash % (0, $8ddcc69383feb36a$export$36308cce1deef340).length];
|
|
222
|
+
}
|
|
223
|
+
function $4af7da5c7dd0b9c2$export$2db1d02db18b2d82(prefix, value) {
|
|
224
|
+
if (!value) return "";
|
|
225
|
+
if (typeof value === "string" || typeof value === "number") return `${prefix}-${value}`;
|
|
226
|
+
let classNames = "";
|
|
227
|
+
for (const key of Object.keys(value)){
|
|
228
|
+
const breakpoint = key;
|
|
229
|
+
const breakpointValue = value[breakpoint];
|
|
230
|
+
if (breakpointValue) {
|
|
231
|
+
classNames && (classNames += " ");
|
|
232
|
+
classNames += breakpoint === "base" ? `${prefix}-${breakpointValue}` : `${breakpoint}:${prefix}-${breakpointValue}`;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return classNames;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
const $df66c26cdcece32b$export$de87bc49c164ff72 = (props, ref)=>{
|
|
240
|
+
const { columns: columns = 12, gap: gap = "sm", gapX: gapX, gapY: gapY, align: align, justify: justify, as: as, className: className, ...otherProps } = props;
|
|
241
|
+
return(// TODO figure out why ts is screaming over here
|
|
242
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
243
|
+
//@ts-ignore
|
|
244
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
164
245
|
as: as,
|
|
165
246
|
ref: ref,
|
|
166
|
-
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
[`flex-align-${align}`]: !!align,
|
|
174
|
-
[`flex-justify-${justify}`]: !!justify,
|
|
175
|
-
[`${className}`]: !!className
|
|
176
|
-
}),
|
|
177
|
-
...props
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
$df66c26cdcece32b$export$ef2184bd89960b14.displayName = "Grid";
|
|
181
|
-
const $df66c26cdcece32b$export$9eb849b9b922d396 = /*#__PURE__*/ $8zHUo$react.forwardRef(({ colSpan: colSpan = 1, as: as, className: className, ...props }, ref)=>{
|
|
247
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-grid", "display-grid", (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("columns", columns), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("gap", gap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("column-gap", gapX), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("row-gap", gapY), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("flex-align", align), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("flex-justify", justify), className),
|
|
248
|
+
...otherProps
|
|
249
|
+
}));
|
|
250
|
+
};
|
|
251
|
+
$df66c26cdcece32b$export$de87bc49c164ff72.displayName = "Grid";
|
|
252
|
+
const $df66c26cdcece32b$export$ef2184bd89960b14 = /*#__PURE__*/ $8zHUo$react.forwardRef($df66c26cdcece32b$export$de87bc49c164ff72);
|
|
253
|
+
const $df66c26cdcece32b$export$faaf771f35016530 = (props, ref)=>{
|
|
182
254
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
183
|
-
as: as,
|
|
184
|
-
stretchX: true,
|
|
185
|
-
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)({
|
|
186
|
-
"p-grid-item": true,
|
|
187
|
-
[`col-span-${colSpan}`]: !!colSpan,
|
|
188
|
-
[`${className}`]: !!className
|
|
189
|
-
}),
|
|
190
255
|
ref: ref,
|
|
256
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-grid-item", (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("col-span", props.colSpan), props.className),
|
|
191
257
|
...props
|
|
192
258
|
});
|
|
193
|
-
}
|
|
194
|
-
$df66c26cdcece32b$export$9eb849b9b922d396
|
|
259
|
+
};
|
|
260
|
+
const $df66c26cdcece32b$export$9eb849b9b922d396 = /*#__PURE__*/ $8zHUo$react.forwardRef($df66c26cdcece32b$export$faaf771f35016530);
|
|
261
|
+
$df66c26cdcece32b$export$faaf771f35016530.displayName = "GridItem";
|
|
262
|
+
|
|
195
263
|
|
|
196
264
|
|
|
197
265
|
|
|
@@ -202,25 +270,9 @@ $df66c26cdcece32b$export$9eb849b9b922d396.displayName = "GridItem";
|
|
|
202
270
|
|
|
203
271
|
const $c3a954a7c0cb5109$export$21ee1313e2afe36c = (props, ref)=>{
|
|
204
272
|
const { justify: justify, align: align, direction: direction, gap: gap = "sm", columnGap: columnGap, rowGap: rowGap, inline: inline, wrap: wrap, stack: stack, className: className, ...otherProps } = props;
|
|
205
|
-
const
|
|
206
|
-
if (stack) return "column";
|
|
207
|
-
return direction || "row";
|
|
208
|
-
}, [
|
|
209
|
-
stack,
|
|
210
|
-
direction
|
|
211
|
-
]);
|
|
273
|
+
const flexDirection = stack ? "column" : direction ?? "row";
|
|
212
274
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
213
|
-
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)({
|
|
214
|
-
[`${className}`]: !!className,
|
|
215
|
-
[inline ? "display-inline-flex" : "display-flex"]: true,
|
|
216
|
-
[`flex-justify-${justify}`]: !!justify,
|
|
217
|
-
[`flex-align-${align}`]: !!align,
|
|
218
|
-
[`flex-direction-${getDirection()}`]: !!getDirection(),
|
|
219
|
-
[`gap-${gap}`]: !!gap,
|
|
220
|
-
[`column-gap-${columnGap}`]: !!columnGap,
|
|
221
|
-
[`row-gap-${rowGap}`]: !!rowGap,
|
|
222
|
-
[`flex-${wrap}`]: !!wrap
|
|
223
|
-
}),
|
|
275
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, inline ? "display-inline-flex" : "display-flex", `flex-direction-${flexDirection}`, `flex-${wrap}`, `flex-justify-${justify}`, `flex-align-${align}`, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("gap", gap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("column-gap", columnGap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("row-gap", rowGap)),
|
|
224
276
|
// TODO - Fix types here - seems to work just fine though
|
|
225
277
|
ref: ref,
|
|
226
278
|
...otherProps,
|
|
@@ -369,13 +421,14 @@ function $eae337549f49a5a2$export$450c36e0b0e62ccd() {
|
|
|
369
421
|
|
|
370
422
|
const $f2fd0cbe11b7f0dd$var$ThemeContext = /*#__PURE__*/ $8zHUo$react.createContext(null);
|
|
371
423
|
function $f2fd0cbe11b7f0dd$export$d8964aec282183a3(props) {
|
|
372
|
-
const { children: children, className: className, ...themeProps } = props;
|
|
424
|
+
const { children: children, className: className, scaling: scaling = "100%", ...themeProps } = props;
|
|
373
425
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($f2fd0cbe11b7f0dd$var$ThemeContext.Provider, {
|
|
374
426
|
value: themeProps,
|
|
375
427
|
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
376
428
|
id: "parrot-theme-provider",
|
|
377
429
|
"data-radius": themeProps.radius,
|
|
378
430
|
"data-color": themeProps.color,
|
|
431
|
+
"data-scaling": scaling,
|
|
379
432
|
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
|
|
380
433
|
"parrot-theme",
|
|
381
434
|
className
|
|
@@ -585,6 +638,7 @@ function $7f70742e736041ff$export$749e21be8b14b968() {
|
|
|
585
638
|
|
|
586
639
|
|
|
587
640
|
|
|
641
|
+
|
|
588
642
|
const $5a6f28f3fd58ff6e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef((props, ref)=>{
|
|
589
643
|
const space = (0, $eae337549f49a5a2$export$450c36e0b0e62ccd)();
|
|
590
644
|
const buttonGroupProps = (0, $7f70742e736041ff$export$749e21be8b14b968)();
|
|
@@ -625,8 +679,7 @@ const $5a6f28f3fd58ff6e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
625
679
|
"aria-busy": isLoading,
|
|
626
680
|
"data-color": getColor().color,
|
|
627
681
|
"data-variant": getColor().variant,
|
|
628
|
-
"
|
|
629
|
-
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, "p-button", space.classNames),
|
|
682
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)((0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("size", size), className, "p-button", space.classNames),
|
|
630
683
|
ref: (0, $62f1c614c0962470$export$c9058316764c140e)(ref, buttonRef),
|
|
631
684
|
form: otherProps.form,
|
|
632
685
|
...buttonProps,
|
|
@@ -1209,7 +1262,7 @@ function $724eace27ebf345b$var$MenuSectionInner({ state: state, section: section
|
|
|
1209
1262
|
style: style,
|
|
1210
1263
|
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, "p-list-section"),
|
|
1211
1264
|
children: [
|
|
1212
|
-
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("li", {
|
|
1265
|
+
section.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("li", {
|
|
1213
1266
|
className: "p-list-separator",
|
|
1214
1267
|
...separatorProps
|
|
1215
1268
|
}),
|
|
@@ -1724,68 +1777,6 @@ $71fcf48f7e2e9427$export$f8afaea2e9656b91.displayName = "RadioCard";
|
|
|
1724
1777
|
|
|
1725
1778
|
|
|
1726
1779
|
|
|
1727
|
-
const $8ddcc69383feb36a$export$36308cce1deef340 = [
|
|
1728
|
-
"tomato",
|
|
1729
|
-
"red",
|
|
1730
|
-
"crimson",
|
|
1731
|
-
"pink",
|
|
1732
|
-
"plum",
|
|
1733
|
-
"purple",
|
|
1734
|
-
"violet",
|
|
1735
|
-
"indigo",
|
|
1736
|
-
"blue",
|
|
1737
|
-
"cyan",
|
|
1738
|
-
"teal",
|
|
1739
|
-
"green",
|
|
1740
|
-
"grass",
|
|
1741
|
-
"orange",
|
|
1742
|
-
"brown",
|
|
1743
|
-
"sky",
|
|
1744
|
-
"mint",
|
|
1745
|
-
"lime",
|
|
1746
|
-
"yellow",
|
|
1747
|
-
"amber",
|
|
1748
|
-
"gold",
|
|
1749
|
-
"bronze",
|
|
1750
|
-
"gray",
|
|
1751
|
-
"mauve",
|
|
1752
|
-
"slate",
|
|
1753
|
-
"sage",
|
|
1754
|
-
"olive",
|
|
1755
|
-
"sand"
|
|
1756
|
-
];
|
|
1757
|
-
const $8ddcc69383feb36a$export$b4e0e71242920c6a = {
|
|
1758
|
-
sharp: "none",
|
|
1759
|
-
pill: "full",
|
|
1760
|
-
rounded: undefined
|
|
1761
|
-
};
|
|
1762
|
-
function $8ddcc69383feb36a$var$ps(styles) {
|
|
1763
|
-
// 1. iterate over the keys of the styles object
|
|
1764
|
-
// 2. for each key, check is is valid css property
|
|
1765
|
-
}
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
function $4af7da5c7dd0b9c2$export$d41d9ab3de2def3d(text) {
|
|
1769
|
-
const str = String(text);
|
|
1770
|
-
let hash = 0;
|
|
1771
|
-
let char;
|
|
1772
|
-
if (str.trim().length === 0) return hash;
|
|
1773
|
-
for(let i = 0; i < str.length; i++){
|
|
1774
|
-
char = str.charCodeAt(i);
|
|
1775
|
-
hash = (hash << 5) - hash + char;
|
|
1776
|
-
// Convert to 32bit integer
|
|
1777
|
-
hash &= hash;
|
|
1778
|
-
}
|
|
1779
|
-
return Math.abs(hash);
|
|
1780
|
-
}
|
|
1781
|
-
function $4af7da5c7dd0b9c2$export$d560c7e4a29451c2() {
|
|
1782
|
-
return Math.random().toString(36);
|
|
1783
|
-
}
|
|
1784
|
-
function $4af7da5c7dd0b9c2$export$e4369cabd7e84cd9(string) {
|
|
1785
|
-
const hash = $4af7da5c7dd0b9c2$export$d41d9ab3de2def3d(string);
|
|
1786
|
-
return (0, $8ddcc69383feb36a$export$36308cce1deef340)[hash % (0, $8ddcc69383feb36a$export$36308cce1deef340).length];
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
1780
|
|
|
1790
1781
|
|
|
1791
1782
|
|
|
@@ -2931,6 +2922,7 @@ function $9ff025417b0a683c$export$e6a97ba2cae5bb94({ items: items, render: rende
|
|
|
2931
2922
|
|
|
2932
2923
|
|
|
2933
2924
|
|
|
2925
|
+
|
|
2934
2926
|
function $1278141024f0bc4d$export$c6fdb837b070b4ff({ children: children, state: state, ...props }) {
|
|
2935
2927
|
const modalRef = $8zHUo$react.useRef(null);
|
|
2936
2928
|
const { modalProps: modalProps, underlayProps: underlayProps } = (0, $8zHUo$reactaria.useModalOverlay)(props, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -2949,7 +2941,7 @@ function $1278141024f0bc4d$export$c6fdb837b070b4ff({ children: children, state:
|
|
|
2949
2941
|
})
|
|
2950
2942
|
});
|
|
2951
2943
|
}
|
|
2952
|
-
function $1278141024f0bc4d$var$Dialog({ width: width = 400, title: title, onCancel: onCancel, onConfirm: onConfirm, confirmLabel: confirmLabel = "Confirm", cancelLabel: cancelLabel = "Cancel", description: description, children: children, confirmButtonProps: confirmButtonProps, cancelButtonProps: cancelButtonProps, variant: variant = "modal", showCloseButton: showCloseButton = true, onClose: onClose, onOpenChange: onOpenChange, ...props }) {
|
|
2944
|
+
function $1278141024f0bc4d$var$Dialog({ width: width = 400, title: title, onCancel: onCancel, onConfirm: onConfirm, confirmLabel: confirmLabel = "Confirm", cancelLabel: cancelLabel = "Cancel", description: description, children: children, confirmButtonProps: confirmButtonProps, cancelButtonProps: cancelButtonProps, variant: variant = "modal", showCloseButton: showCloseButton = true, onClose: onClose, onOpenChange: onOpenChange, className: className, style: style, hideTitle: hideTitle, ...props }) {
|
|
2953
2945
|
const dialogRef = $8zHUo$react.useRef(null);
|
|
2954
2946
|
const { dialogProps: dialogProps, titleProps: titleProps } = (0, $8zHUo$reactaria.useDialog)({
|
|
2955
2947
|
role: "dialog",
|
|
@@ -2961,15 +2953,16 @@ function $1278141024f0bc4d$var$Dialog({ width: width = 400, title: title, onCanc
|
|
|
2961
2953
|
}
|
|
2962
2954
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
|
|
2963
2955
|
"data-radius": "md",
|
|
2964
|
-
className: "p-modal-content",
|
|
2956
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-modal-content", className),
|
|
2965
2957
|
"data-variant": variant,
|
|
2966
2958
|
style: {
|
|
2967
|
-
minWidth: width
|
|
2959
|
+
minWidth: width,
|
|
2960
|
+
...style
|
|
2968
2961
|
},
|
|
2969
2962
|
ref: dialogRef,
|
|
2970
2963
|
...dialogProps,
|
|
2971
2964
|
children: [
|
|
2972
|
-
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
|
|
2965
|
+
!hideTitle && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
|
|
2973
2966
|
align: "center",
|
|
2974
2967
|
as: "header",
|
|
2975
2968
|
justify: "space-between",
|