@parrot-co/parrot-ui 0.0.94 → 0.0.96
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 +105 -116
- package/dist/main.js.map +1 -1
- package/dist/module.js +106 -117
- 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}`, wrap && `flex-${wrap}`, justify && `flex-justify-${justify}`, align && `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,
|
|
@@ -243,19 +295,17 @@ const $c3a954a7c0cb5109$export$f51f4c4ede09e011 = /*#__PURE__*/ $8zHUo$react.for
|
|
|
243
295
|
|
|
244
296
|
|
|
245
297
|
|
|
298
|
+
|
|
246
299
|
const $88fa102d91bf323a$export$f5a10939c0132d55 = (props, ref)=>{
|
|
247
300
|
const { textCase: textCase, size: size = "sm", weight: weight, color: color = "gray", variant: variant = "default", highlight: highlight, align: align, lineHeight: lineHeight, underline: underline, italic: italic, as: Comp = "span", className: className, ...rest } = props;
|
|
248
301
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)(Comp, {
|
|
249
|
-
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)({
|
|
302
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-text", className, {
|
|
250
303
|
[`text-highlight`]: !!highlight,
|
|
251
|
-
"p-text": true,
|
|
252
|
-
[`text-size-${size}`]: !!size,
|
|
253
304
|
[`text-weight-${weight}`]: !!weight,
|
|
254
305
|
[`text-align-${align}`]: !!align,
|
|
255
306
|
[`text-line-height-${lineHeight}`]: !!lineHeight,
|
|
256
|
-
[`text-transform-${textCase}`]: !!textCase
|
|
257
|
-
|
|
258
|
-
}),
|
|
307
|
+
[`text-transform-${textCase}`]: !!textCase
|
|
308
|
+
}, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("text-size", size)),
|
|
259
309
|
"data-underline": underline,
|
|
260
310
|
"data-italic": italic,
|
|
261
311
|
"data-color": color,
|
|
@@ -369,13 +419,14 @@ function $eae337549f49a5a2$export$450c36e0b0e62ccd() {
|
|
|
369
419
|
|
|
370
420
|
const $f2fd0cbe11b7f0dd$var$ThemeContext = /*#__PURE__*/ $8zHUo$react.createContext(null);
|
|
371
421
|
function $f2fd0cbe11b7f0dd$export$d8964aec282183a3(props) {
|
|
372
|
-
const { children: children, className: className, ...themeProps } = props;
|
|
422
|
+
const { children: children, className: className, scaling: scaling = "100%", ...themeProps } = props;
|
|
373
423
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($f2fd0cbe11b7f0dd$var$ThemeContext.Provider, {
|
|
374
424
|
value: themeProps,
|
|
375
425
|
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
376
426
|
id: "parrot-theme-provider",
|
|
377
427
|
"data-radius": themeProps.radius,
|
|
378
428
|
"data-color": themeProps.color,
|
|
429
|
+
"data-scaling": scaling,
|
|
379
430
|
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
|
|
380
431
|
"parrot-theme",
|
|
381
432
|
className
|
|
@@ -585,6 +636,7 @@ function $7f70742e736041ff$export$749e21be8b14b968() {
|
|
|
585
636
|
|
|
586
637
|
|
|
587
638
|
|
|
639
|
+
|
|
588
640
|
const $5a6f28f3fd58ff6e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef((props, ref)=>{
|
|
589
641
|
const space = (0, $eae337549f49a5a2$export$450c36e0b0e62ccd)();
|
|
590
642
|
const buttonGroupProps = (0, $7f70742e736041ff$export$749e21be8b14b968)();
|
|
@@ -625,8 +677,7 @@ const $5a6f28f3fd58ff6e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
625
677
|
"aria-busy": isLoading,
|
|
626
678
|
"data-color": getColor().color,
|
|
627
679
|
"data-variant": getColor().variant,
|
|
628
|
-
"
|
|
629
|
-
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, "p-button", space.classNames),
|
|
680
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)((0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("size", size), className, "p-button", space.classNames),
|
|
630
681
|
ref: (0, $62f1c614c0962470$export$c9058316764c140e)(ref, buttonRef),
|
|
631
682
|
form: otherProps.form,
|
|
632
683
|
...buttonProps,
|
|
@@ -1724,68 +1775,6 @@ $71fcf48f7e2e9427$export$f8afaea2e9656b91.displayName = "RadioCard";
|
|
|
1724
1775
|
|
|
1725
1776
|
|
|
1726
1777
|
|
|
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
1778
|
|
|
1790
1779
|
|
|
1791
1780
|
|