@parrot-co/parrot-ui 0.1.12 → 0.1.14
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 +50 -22
- package/dist/main.js.map +1 -1
- package/dist/module.js +51 -23
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -10
- package/styles.css +1 -1
package/dist/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {jsx as $hgUW1$jsx, jsxs as $hgUW1$jsxs} from "react/jsx-runtime";
|
|
2
|
-
import $hgUW1$react, {forwardRef as $hgUW1$forwardRef, createContext as $hgUW1$createContext, Children as $hgUW1$Children, useMemo as $hgUW1$useMemo, isValidElement as $hgUW1$isValidElement, useContext as $hgUW1$useContext, useRef as $hgUW1$useRef, cloneElement as $hgUW1$cloneElement, createElement as $hgUW1$createElement, useState as $hgUW1$useState,
|
|
2
|
+
import $hgUW1$react, {forwardRef as $hgUW1$forwardRef, createContext as $hgUW1$createContext, Children as $hgUW1$Children, useMemo as $hgUW1$useMemo, isValidElement as $hgUW1$isValidElement, useContext as $hgUW1$useContext, useEffect as $hgUW1$useEffect, useRef as $hgUW1$useRef, cloneElement as $hgUW1$cloneElement, createElement as $hgUW1$createElement, useState as $hgUW1$useState, useCallback as $hgUW1$useCallback} from "react";
|
|
3
3
|
import {useTextField as $hgUW1$useTextField, useLocale as $hgUW1$useLocale, useNumberField as $hgUW1$useNumberField, useToggleButton as $hgUW1$useToggleButton, useButton as $hgUW1$useButton, useCheckbox as $hgUW1$useCheckbox, useCheckboxGroupItem as $hgUW1$useCheckboxGroupItem, useFocusRing as $hgUW1$useFocusRing, VisuallyHidden as $hgUW1$VisuallyHidden, useCheckboxGroup as $hgUW1$useCheckboxGroup, useMenuTrigger as $hgUW1$useMenuTrigger, usePress as $hgUW1$usePress, mergeProps as $hgUW1$mergeProps, useMenu as $hgUW1$useMenu, useMenuItem as $hgUW1$useMenuItem, useMenuSection as $hgUW1$useMenuSection, useSeparator as $hgUW1$useSeparator, usePopover as $hgUW1$usePopover, Overlay as $hgUW1$Overlay, useFilter as $hgUW1$useFilter, useComboBox as $hgUW1$useComboBox, useListBox as $hgUW1$useListBox, useOption as $hgUW1$useOption, useListBoxSection as $hgUW1$useListBoxSection, useRadio as $hgUW1$useRadio, useRadioGroup as $hgUW1$useRadioGroup, useDatePicker as $hgUW1$useDatePicker, useDateField as $hgUW1$useDateField, useDateSegment as $hgUW1$useDateSegment, useCalendar as $hgUW1$useCalendar, useCalendarGrid as $hgUW1$useCalendarGrid, useCalendarCell as $hgUW1$useCalendarCell, useDrop as $hgUW1$useDrop, useProgressBar as $hgUW1$useProgressBar, useHover as $hgUW1$useHover, useSwitch as $hgUW1$useSwitch, useNumberFormatter as $hgUW1$useNumberFormatter, useSlider as $hgUW1$useSlider, useSliderThumb as $hgUW1$useSliderThumb, useTabList as $hgUW1$useTabList, useTab as $hgUW1$useTab, useTabPanel as $hgUW1$useTabPanel, useModalOverlay as $hgUW1$useModalOverlay, useDialog as $hgUW1$useDialog, useOverlayTrigger as $hgUW1$useOverlayTrigger, useTag as $hgUW1$useTag, useTagGroup as $hgUW1$useTagGroup} from "react-aria";
|
|
4
4
|
import {useNumberFieldState as $hgUW1$useNumberFieldState, useToggleState as $hgUW1$useToggleState, useCheckboxGroupState as $hgUW1$useCheckboxGroupState, useMenuTriggerState as $hgUW1$useMenuTriggerState, useTreeState as $hgUW1$useTreeState, Item as $hgUW1$Item, Section as $hgUW1$Section, useComboBoxState as $hgUW1$useComboBoxState, useListState as $hgUW1$useListState, useRadioGroupState as $hgUW1$useRadioGroupState, useDatePickerState as $hgUW1$useDatePickerState, useDateFieldState as $hgUW1$useDateFieldState, useCalendarState as $hgUW1$useCalendarState, useSliderState as $hgUW1$useSliderState, useTabListState as $hgUW1$useTabListState, useOverlayTriggerState as $hgUW1$useOverlayTriggerState} from "react-stately";
|
|
5
5
|
import {HiEye as $hgUW1$HiEye, HiCheck as $hgUW1$HiCheck, HiSelector as $hgUW1$HiSelector, HiOutlineCalendar as $hgUW1$HiOutlineCalendar, HiChevronLeft as $hgUW1$HiChevronLeft, HiChevronRight as $hgUW1$HiChevronRight, HiOutlineDocumentAdd as $hgUW1$HiOutlineDocumentAdd, HiOutlineCheckCircle as $hgUW1$HiOutlineCheckCircle, HiOutlineTrash as $hgUW1$HiOutlineTrash, HiOutlineExclamationCircle as $hgUW1$HiOutlineExclamationCircle, HiOutlineRefresh as $hgUW1$HiOutlineRefresh, HiOutlinePaperClip as $hgUW1$HiOutlinePaperClip, HiX as $hgUW1$HiX} from "react-icons/hi";
|
|
@@ -351,10 +351,6 @@ const $074ec3363f6c932f$export$b4e0e71242920c6a = {
|
|
|
351
351
|
pill: "full",
|
|
352
352
|
rounded: undefined
|
|
353
353
|
};
|
|
354
|
-
function $074ec3363f6c932f$var$ps(styles) {
|
|
355
|
-
// 1. iterate over the keys of the styles object
|
|
356
|
-
// 2. for each key, check is is valid css property
|
|
357
|
-
}
|
|
358
354
|
|
|
359
355
|
|
|
360
356
|
function $0ad0bc75b5eb16a6$export$1c4d39b152e0f791(deprecatedProp, newProp, value) {
|
|
@@ -586,6 +582,9 @@ function $41cc567ab0625f8f$export$450c36e0b0e62ccd() {
|
|
|
586
582
|
const $5fc28f26e128d5c0$var$ThemeContext = /*#__PURE__*/ $hgUW1$createContext(null);
|
|
587
583
|
function $5fc28f26e128d5c0$export$d8964aec282183a3(props) {
|
|
588
584
|
const { children: children, className: className, scaling: scaling = "100%", ...themeProps } = props;
|
|
585
|
+
$hgUW1$useEffect(()=>{
|
|
586
|
+
document.body.classList.add("dark");
|
|
587
|
+
});
|
|
589
588
|
return /*#__PURE__*/ (0, $hgUW1$jsx)($5fc28f26e128d5c0$var$ThemeContext.Provider, {
|
|
590
589
|
value: themeProps,
|
|
591
590
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -2014,15 +2013,15 @@ $e3711da06539818f$export$f8afaea2e9656b91.displayName = "RadioCard";
|
|
|
2014
2013
|
|
|
2015
2014
|
|
|
2016
2015
|
|
|
2017
|
-
|
|
2018
|
-
|
|
2016
|
+
const $c700d45659d35204$export$3288d34c523a1192 = /*#__PURE__*/ (0, $hgUW1$react).forwardRef(({ prepend: prepend, append: append, children: children, hashValue: hashValue, color: color, size: size = "sm", shape: /**@deprecated use radius instead */ shape = "rounded", variant: variant = "light", className: className, radius: radius = "full", ...props }, ref)=>{
|
|
2017
|
+
(0, $0ad0bc75b5eb16a6$export$1c4d39b152e0f791)("shape", "radius", shape);
|
|
2019
2018
|
const randomColor = (0, $hgUW1$react).useMemo(()=>{
|
|
2020
2019
|
if (hashValue) return (0, $0ad0bc75b5eb16a6$export$e4369cabd7e84cd9)(hashValue);
|
|
2021
2020
|
return "gray";
|
|
2022
2021
|
}, []);
|
|
2023
2022
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2024
2023
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, "p-tag"),
|
|
2025
|
-
"data-radius":
|
|
2024
|
+
"data-radius": radius,
|
|
2026
2025
|
"data-size": size,
|
|
2027
2026
|
"data-color": color ?? randomColor,
|
|
2028
2027
|
"data-variant": variant,
|
|
@@ -2562,7 +2561,7 @@ $48aceaf3289ec325$export$7edc06cf1783b30f.displayName = "DateInput";
|
|
|
2562
2561
|
|
|
2563
2562
|
|
|
2564
2563
|
|
|
2565
|
-
const $55bcc0e5986993c4$export$e2255cf6045e8d47 = /*#__PURE__*/ $hgUW1$forwardRef(({ src: src, alt: alt, name: name, color: color, variant: variant = "light", fallback: fallback, children: children, size: size = "md", shape: shape, className: className, radius: radius = "
|
|
2564
|
+
const $55bcc0e5986993c4$export$e2255cf6045e8d47 = /*#__PURE__*/ $hgUW1$forwardRef(({ src: src, alt: alt, name: name, color: color, variant: variant = "light", fallback: fallback, children: children, size: size = "md", shape: shape, className: className, radius: radius = "full", classNames: classNames, styles: styles, style: style, ...props }, ref)=>{
|
|
2566
2565
|
const [imageError, setImageError] = $hgUW1$useState(false);
|
|
2567
2566
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
2568
2567
|
function getAvatarRadius() {
|
|
@@ -3269,17 +3268,29 @@ function $727b3a4d9b39464f$export$e6a97ba2cae5bb94({ items: items, render: rende
|
|
|
3269
3268
|
|
|
3270
3269
|
|
|
3271
3270
|
|
|
3272
|
-
function $4bad2c10a2b6e638$export$c6fdb837b070b4ff({ children: children, state: state, ...props }) {
|
|
3271
|
+
function $4bad2c10a2b6e638$export$c6fdb837b070b4ff({ children: children, state: state, classNames: classNames, styles: styles, variant: variant = "modal", isDismissable: isDismissable = true, ...props }) {
|
|
3273
3272
|
const modalRef = $hgUW1$useRef(null);
|
|
3274
|
-
const { modalProps: modalProps, underlayProps: underlayProps } = (0, $hgUW1$useModalOverlay)(
|
|
3273
|
+
const { modalProps: modalProps, underlayProps: underlayProps } = (0, $hgUW1$useModalOverlay)({
|
|
3274
|
+
...props,
|
|
3275
|
+
isDismissable: isDismissable
|
|
3276
|
+
}, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3275
3277
|
state, modalRef);
|
|
3276
3278
|
if (!state?.isOpen) return null;
|
|
3277
3279
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Overlay), {
|
|
3278
3280
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3279
|
-
|
|
3281
|
+
style: styles?.underlay,
|
|
3282
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
3283
|
+
"p-modal-underlay",
|
|
3284
|
+
classNames?.underlay
|
|
3285
|
+
]),
|
|
3280
3286
|
...underlayProps,
|
|
3281
3287
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3282
|
-
|
|
3288
|
+
"data-variant": variant,
|
|
3289
|
+
style: styles?.wrapper,
|
|
3290
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
3291
|
+
"p-modal-container",
|
|
3292
|
+
classNames?.wrapper
|
|
3293
|
+
]),
|
|
3283
3294
|
...modalProps,
|
|
3284
3295
|
ref: modalRef,
|
|
3285
3296
|
children: children
|
|
@@ -3287,23 +3298,23 @@ function $4bad2c10a2b6e638$export$c6fdb837b070b4ff({ children: children, state:
|
|
|
3287
3298
|
})
|
|
3288
3299
|
});
|
|
3289
3300
|
}
|
|
3290
|
-
function $4bad2c10a2b6e638$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,
|
|
3301
|
+
function $4bad2c10a2b6e638$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, showCloseButton: showCloseButton = true, onClose: onClose, className: className, style: style, hideTitle: hideTitle, classNames: classNames, styles: styles, state: state, ...props }) {
|
|
3291
3302
|
const dialogRef = $hgUW1$useRef(null);
|
|
3292
3303
|
const { dialogProps: dialogProps, titleProps: titleProps } = (0, $hgUW1$useDialog)({
|
|
3293
3304
|
role: "dialog",
|
|
3294
3305
|
...props
|
|
3295
3306
|
}, dialogRef);
|
|
3296
3307
|
function handleClose() {
|
|
3297
|
-
|
|
3308
|
+
state?.close();
|
|
3298
3309
|
onClose?.();
|
|
3299
3310
|
}
|
|
3300
3311
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3301
3312
|
"data-radius": "md",
|
|
3302
|
-
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-modal-content", className),
|
|
3303
|
-
"data-variant": variant,
|
|
3313
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-modal-content", className, classNames?.content),
|
|
3304
3314
|
style: {
|
|
3305
|
-
|
|
3306
|
-
...style
|
|
3315
|
+
width: width,
|
|
3316
|
+
...style,
|
|
3317
|
+
...styles?.content
|
|
3307
3318
|
},
|
|
3308
3319
|
ref: dialogRef,
|
|
3309
3320
|
...dialogProps,
|
|
@@ -3313,18 +3324,27 @@ function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCanc
|
|
|
3313
3324
|
as: "header",
|
|
3314
3325
|
justify: "space-between",
|
|
3315
3326
|
gap: "2xl",
|
|
3316
|
-
|
|
3327
|
+
style: styles?.header,
|
|
3328
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
3329
|
+
"p-modal-head",
|
|
3330
|
+
classNames?.header
|
|
3331
|
+
]),
|
|
3317
3332
|
children: [
|
|
3318
3333
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3319
3334
|
stack: true,
|
|
3320
3335
|
gap: "3xs",
|
|
3321
3336
|
children: [
|
|
3322
3337
|
title && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
3338
|
+
style: styles?.title,
|
|
3339
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
3340
|
+
"p-modal-title",
|
|
3341
|
+
classNames?.title
|
|
3342
|
+
]),
|
|
3323
3343
|
weight: "medium",
|
|
3324
3344
|
size: "md",
|
|
3325
3345
|
color: "black",
|
|
3326
|
-
...titleProps,
|
|
3327
3346
|
as: "div",
|
|
3347
|
+
...titleProps,
|
|
3328
3348
|
children: title
|
|
3329
3349
|
}),
|
|
3330
3350
|
description && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
@@ -3352,12 +3372,20 @@ function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCanc
|
|
|
3352
3372
|
}),
|
|
3353
3373
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3354
3374
|
stack: true,
|
|
3355
|
-
className:
|
|
3375
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
3376
|
+
"p-modal-body",
|
|
3377
|
+
classNames?.body
|
|
3378
|
+
]),
|
|
3379
|
+
style: styles?.body,
|
|
3356
3380
|
children: children
|
|
3357
3381
|
}),
|
|
3358
3382
|
(onConfirm || onCancel) && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3359
3383
|
as: "footer",
|
|
3360
|
-
|
|
3384
|
+
style: styles?.footer,
|
|
3385
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
3386
|
+
"p-modal-footer",
|
|
3387
|
+
classNames?.footer
|
|
3388
|
+
]),
|
|
3361
3389
|
gap: "xs",
|
|
3362
3390
|
justify: "end",
|
|
3363
3391
|
stretchX: true,
|