@parrot-co/parrot-ui 0.1.1 → 0.1.2
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 +107 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js +107 -2
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +33 -21
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -54,6 +54,8 @@ $parcel$export(module.exports, "Modal", () => $1278141024f0bc4d$export$2b77a92f1
|
|
|
54
54
|
$parcel$export(module.exports, "useModal", () => $1278141024f0bc4d$export$33ffd74ebf07f060);
|
|
55
55
|
$parcel$export(module.exports, "Space", () => $eae337549f49a5a2$export$eef1e68107c58ef2);
|
|
56
56
|
$parcel$export(module.exports, "TagInput", () => $0cdc620c9e9fb79f$export$39299b56cfd4e361);
|
|
57
|
+
$parcel$export(module.exports, "TagGroup", () => $d26053f02b9f370b$export$67ea30858aaf75e3);
|
|
58
|
+
$parcel$export(module.exports, "TagGroupItem", () => $d26053f02b9f370b$export$a79147a60006308c);
|
|
57
59
|
$parcel$export(module.exports, "ThemeProvider", () => $f2fd0cbe11b7f0dd$export$d8964aec282183a3);
|
|
58
60
|
$parcel$export(module.exports, "useTheme", () => $f2fd0cbe11b7f0dd$export$93d4e7f90805808f);
|
|
59
61
|
|
|
@@ -3254,4 +3256,109 @@ function $0cdc620c9e9fb79f$export$39299b56cfd4e361({ appearance: appearance = "o
|
|
|
3254
3256
|
|
|
3255
3257
|
|
|
3256
3258
|
|
|
3259
|
+
|
|
3260
|
+
|
|
3261
|
+
|
|
3262
|
+
|
|
3263
|
+
|
|
3264
|
+
|
|
3265
|
+
|
|
3266
|
+
|
|
3267
|
+
function $d26053f02b9f370b$var$Tag(props) {
|
|
3268
|
+
const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)();
|
|
3269
|
+
const { activeColor: activeColor = theme?.color ?? "gray", activeVariant: activeVariant = "solid", idleColor: idleColor = "gray", idleVariant: idleVariant = "outline", item: item, state: state, autoColor: autoColor } = props;
|
|
3270
|
+
const tagRef = $8zHUo$react.useRef(null);
|
|
3271
|
+
const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $8zHUo$reactaria.useFocusRing)({
|
|
3272
|
+
within: true
|
|
3273
|
+
});
|
|
3274
|
+
const { rowProps: rowProps, gridCellProps: gridCellProps, isSelected: isSelected } = (0, $8zHUo$reactaria.useTag)(props, state, tagRef);
|
|
3275
|
+
const colors = $8zHUo$react.useMemo(()=>{
|
|
3276
|
+
if (autoColor) {
|
|
3277
|
+
const color = (0, $4af7da5c7dd0b9c2$export$e4369cabd7e84cd9)(item.textValue);
|
|
3278
|
+
return {
|
|
3279
|
+
active: color,
|
|
3280
|
+
idle: color
|
|
3281
|
+
};
|
|
3282
|
+
}
|
|
3283
|
+
return {
|
|
3284
|
+
active: activeColor,
|
|
3285
|
+
idle: idleColor
|
|
3286
|
+
};
|
|
3287
|
+
}, [
|
|
3288
|
+
activeColor,
|
|
3289
|
+
idleColor,
|
|
3290
|
+
autoColor
|
|
3291
|
+
]);
|
|
3292
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
3293
|
+
ref: tagRef,
|
|
3294
|
+
...rowProps,
|
|
3295
|
+
...focusProps,
|
|
3296
|
+
"data-focus-visible": isFocusVisible,
|
|
3297
|
+
"data-is-toggle": true,
|
|
3298
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-button", "size-sm"),
|
|
3299
|
+
"data-variant": isSelected ? activeVariant : idleVariant,
|
|
3300
|
+
"data-radius": "full",
|
|
3301
|
+
"data-color": isSelected ? colors.active : colors.idle,
|
|
3302
|
+
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
3303
|
+
...gridCellProps,
|
|
3304
|
+
children: item.rendered
|
|
3305
|
+
})
|
|
3306
|
+
});
|
|
3307
|
+
}
|
|
3308
|
+
function $d26053f02b9f370b$export$67ea30858aaf75e3({ wrap: wrap = "wrap", gap: gap, columnGap: columnGap, rowGap: rowGap, align: align, justify: justify, activeColor: activeColor, activeVariant: activeVariant, idleColor: idleColor, idleVariant: idleVariant, autoColor: autoColor, ...props }) {
|
|
3309
|
+
const { label: label, description: description, errorMessage: errorMessage } = props;
|
|
3310
|
+
const tagGroupRef = $8zHUo$react.useRef(null);
|
|
3311
|
+
const state = (0, $8zHUo$reactstately.useListState)(props);
|
|
3312
|
+
const { gridProps: gridProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $8zHUo$reactaria.useTagGroup)(props, state, tagGroupRef);
|
|
3313
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
|
|
3314
|
+
stack: true,
|
|
3315
|
+
className: "tag-group",
|
|
3316
|
+
children: [
|
|
3317
|
+
label && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $5a5b41d120374960$export$2e2bcd8739ae039), {
|
|
3318
|
+
...labelProps,
|
|
3319
|
+
children: label
|
|
3320
|
+
}),
|
|
3321
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
|
|
3322
|
+
wrap: wrap,
|
|
3323
|
+
gap: gap,
|
|
3324
|
+
columnGap: columnGap,
|
|
3325
|
+
rowGap: rowGap,
|
|
3326
|
+
align: align,
|
|
3327
|
+
justify: justify,
|
|
3328
|
+
ref: tagGroupRef,
|
|
3329
|
+
...gridProps,
|
|
3330
|
+
children: [
|
|
3331
|
+
...state.collection
|
|
3332
|
+
].map((item)=>{
|
|
3333
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($d26053f02b9f370b$var$Tag, {
|
|
3334
|
+
autoColor: autoColor,
|
|
3335
|
+
activeColor: activeColor,
|
|
3336
|
+
activeVariant: activeVariant,
|
|
3337
|
+
idleColor: idleColor,
|
|
3338
|
+
idleVariant: idleVariant,
|
|
3339
|
+
state: state,
|
|
3340
|
+
item: item
|
|
3341
|
+
}, item.key);
|
|
3342
|
+
})
|
|
3343
|
+
}),
|
|
3344
|
+
errorMessage && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $4b54f76a59afa8a5$export$2e2bcd8739ae039), {
|
|
3345
|
+
...errorMessageProps,
|
|
3346
|
+
children: errorMessage
|
|
3347
|
+
}),
|
|
3348
|
+
description && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), {
|
|
3349
|
+
as: "div",
|
|
3350
|
+
...descriptionProps,
|
|
3351
|
+
children: description
|
|
3352
|
+
})
|
|
3353
|
+
]
|
|
3354
|
+
});
|
|
3355
|
+
}
|
|
3356
|
+
const $d26053f02b9f370b$export$a79147a60006308c = (0, $8zHUo$reactstately.Item);
|
|
3357
|
+
|
|
3358
|
+
|
|
3359
|
+
|
|
3360
|
+
|
|
3361
|
+
|
|
3362
|
+
|
|
3363
|
+
|
|
3257
3364
|
//# sourceMappingURL=main.js.map
|