@parrot-co/parrot-ui 0.1.7 → 0.1.8
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 +979 -290
- package/dist/main.js.map +1 -1
- package/dist/module.js +972 -290
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +111 -38
- package/dist/types.d.ts.map +1 -1
- package/package.json +23 -21
- package/styles.css +1 -1
package/dist/module.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {jsx as $hgUW1$jsx, jsxs as $hgUW1$jsxs} from "react/jsx-runtime";
|
|
2
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, useEffect as $hgUW1$useEffect, useCallback as $hgUW1$useCallback} from "react";
|
|
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, 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
|
-
import {
|
|
5
|
-
import {
|
|
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
|
+
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
|
+
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";
|
|
6
6
|
import {parseDate as $hgUW1$parseDate, GregorianCalendar as $hgUW1$GregorianCalendar, createCalendar as $hgUW1$createCalendar, endOfMonth as $hgUW1$endOfMonth, getWeeksInMonth as $hgUW1$getWeeksInMonth, isSameMonth as $hgUW1$isSameMonth} from "@internationalized/date";
|
|
7
|
+
import {parseColor as $hgUW1$parseColor, useColorAreaState as $hgUW1$useColorAreaState, useColorFieldState as $hgUW1$useColorFieldState, useColorSliderState as $hgUW1$useColorSliderState} from "@react-stately/color";
|
|
8
|
+
import {useColorArea as $hgUW1$useColorArea, useColorField as $hgUW1$useColorField, useColorSwatch as $hgUW1$useColorSwatch, useColorSlider as $hgUW1$useColorSlider} from "@react-aria/color";
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
|
|
@@ -108,6 +110,7 @@ const $ee0105641360f1c1$export$e71c4d32a2263218 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
108
110
|
|
|
109
111
|
|
|
110
112
|
|
|
113
|
+
|
|
111
114
|
const $074ec3363f6c932f$export$36308cce1deef340 = [
|
|
112
115
|
"tomato",
|
|
113
116
|
"red",
|
|
@@ -149,6 +152,9 @@ function $074ec3363f6c932f$var$ps(styles) {
|
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
|
|
155
|
+
function $0ad0bc75b5eb16a6$export$1c4d39b152e0f791(deprecatedProp, newProp, value) {
|
|
156
|
+
if (!(0, $0f90ef71a188bc45$export$ae45edb09e2fe7c2)(value)) console.warn(`${deprecatedProp} is deprecated and will be removed in a future release. ${newProp ? `Please use ${newProp} instead.` : ""}`);
|
|
157
|
+
}
|
|
152
158
|
function $0ad0bc75b5eb16a6$export$d41d9ab3de2def3d(text) {
|
|
153
159
|
const str = String(text);
|
|
154
160
|
let hash = 0;
|
|
@@ -245,6 +251,9 @@ const $e2f278d76a00796a$export$f51f4c4ede09e011 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
245
251
|
|
|
246
252
|
|
|
247
253
|
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
248
257
|
const $3157c40f7d0e6fa2$export$f5a10939c0132d55 = (props, ref)=>{
|
|
249
258
|
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;
|
|
250
259
|
return /*#__PURE__*/ (0, $hgUW1$jsx)(Comp, {
|
|
@@ -271,6 +280,7 @@ const $3157c40f7d0e6fa2$export$5f1af8db9871e1d6 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
271
280
|
|
|
272
281
|
const $eea734bbd8b9efff$var$InputLabel = /*#__PURE__*/ (0, $hgUW1$react).forwardRef(({ children: children, className: className, color: color, ...props }, ref)=>{
|
|
273
282
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
283
|
+
ref: ref,
|
|
274
284
|
size: "sm",
|
|
275
285
|
color: color || "gray",
|
|
276
286
|
variant: "light",
|
|
@@ -321,7 +331,7 @@ const $41cc567ab0625f8f$var$SpaceContext = /*#__PURE__*/ $hgUW1$createContext({
|
|
|
321
331
|
classNames: {},
|
|
322
332
|
compactItemWrapperAdjust: ""
|
|
323
333
|
});
|
|
324
|
-
function $41cc567ab0625f8f$
|
|
334
|
+
function $41cc567ab0625f8f$export$eef1e68107c58ef2({ children: children, compact: compact, gap: gap, className: className, classNames: classNames, style: style, styles: styles, ...props }) {
|
|
325
335
|
const childrenCount = $hgUW1$Children.count(children);
|
|
326
336
|
const nodes = $hgUW1$useMemo(()=>{
|
|
327
337
|
return $hgUW1$Children.map(children, (child, index)=>{
|
|
@@ -343,20 +353,22 @@ function $41cc567ab0625f8f$var$SpaceComponent({ children: children, compact: com
|
|
|
343
353
|
}, [
|
|
344
354
|
children
|
|
345
355
|
]);
|
|
346
|
-
const realGap = compact ? "none" : gap;
|
|
347
356
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
348
357
|
"data-compact": compact,
|
|
358
|
+
style: {
|
|
359
|
+
...style,
|
|
360
|
+
...styles?.wrapper
|
|
361
|
+
},
|
|
349
362
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
350
363
|
className,
|
|
351
|
-
"p-space"
|
|
364
|
+
"p-space",
|
|
365
|
+
classNames?.wrapper
|
|
352
366
|
]),
|
|
353
|
-
|
|
354
|
-
gap: realGap,
|
|
367
|
+
gap: gap ?? "none",
|
|
355
368
|
...props,
|
|
356
369
|
children: nodes
|
|
357
370
|
});
|
|
358
371
|
}
|
|
359
|
-
const $41cc567ab0625f8f$export$eef1e68107c58ef2 = /*#__PURE__*/ $hgUW1$forwardRef($41cc567ab0625f8f$var$SpaceComponent);
|
|
360
372
|
function $41cc567ab0625f8f$export$450c36e0b0e62ccd() {
|
|
361
373
|
return $hgUW1$useContext($41cc567ab0625f8f$var$SpaceContext);
|
|
362
374
|
}
|
|
@@ -393,37 +405,35 @@ function $5fc28f26e128d5c0$export$93d4e7f90805808f(options) {
|
|
|
393
405
|
|
|
394
406
|
|
|
395
407
|
|
|
396
|
-
|
|
408
|
+
function $095d89378519ff08$export$a455218a85c89869({ label: label, description: description, error: error, color: color = "gray", radius: radius, size: size = "md", className: className, classNames: classNames, style: style, styles: styles, prepend: prepend, append: append, appearance: appearance = "outline", validationStatus: validationStatus, labelProps: labelProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps, children: children, replaceDefaultControlWrapper: replaceDefaultControlWrapper, isDisabled: isDisabled, wrapperRef: wrapperRef, ...props }) {
|
|
397
409
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
398
|
-
const internalInputRef = (0, $hgUW1$react).useRef(null);
|
|
399
|
-
const { labelProps: labelProps, inputProps: inputProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps } = (0, $hgUW1$useTextField)({
|
|
400
|
-
...props,
|
|
401
|
-
inputElementType: "input",
|
|
402
|
-
label: label,
|
|
403
|
-
description: description,
|
|
404
|
-
isDisabled: isDisabled
|
|
405
|
-
}, internalInputRef);
|
|
406
410
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
407
411
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
412
|
+
ref: wrapperRef,
|
|
413
|
+
...props,
|
|
408
414
|
"data-color": color,
|
|
409
415
|
"data-radius": radius ?? theme?.radius ?? "lg",
|
|
410
416
|
"data-size": size,
|
|
411
|
-
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-input-group", space.compactItemWrapperAdjust, className),
|
|
417
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-input-group", space.compactItemWrapperAdjust, className, classNames?.wrapper),
|
|
412
418
|
stack: true,
|
|
413
|
-
ref: ref,
|
|
414
419
|
gap: "3xs",
|
|
415
|
-
|
|
416
|
-
|
|
420
|
+
style: {
|
|
421
|
+
...style,
|
|
422
|
+
...styles?.wrapper
|
|
423
|
+
},
|
|
417
424
|
children: [
|
|
418
425
|
label && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $eea734bbd8b9efff$export$2e2bcd8739ae039), {
|
|
426
|
+
style: styles?.label,
|
|
427
|
+
className: classNames?.label,
|
|
419
428
|
color: color,
|
|
420
429
|
...labelProps,
|
|
421
430
|
children: label
|
|
422
431
|
}),
|
|
423
|
-
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
432
|
+
!replaceDefaultControlWrapper && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
424
433
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(space.classNames, "p-input-control"),
|
|
425
434
|
"data-has-error": !!error,
|
|
426
435
|
"data-appearance": appearance,
|
|
436
|
+
"data-disabled": isDisabled,
|
|
427
437
|
stretchX: true,
|
|
428
438
|
inline: true,
|
|
429
439
|
position: "relative",
|
|
@@ -432,19 +442,14 @@ const $ef10b8551376ecd8$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
432
442
|
className: "add-on add-on-left",
|
|
433
443
|
children: prepend
|
|
434
444
|
}),
|
|
435
|
-
|
|
436
|
-
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(internalInputRef, inputRef),
|
|
437
|
-
"data-has-left-addon": !!prepend,
|
|
438
|
-
"data-has-right-addon": !!append,
|
|
439
|
-
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-text-input-el"),
|
|
440
|
-
...inputProps
|
|
441
|
-
}),
|
|
445
|
+
children,
|
|
442
446
|
append && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
443
447
|
className: "add-on add-on-right",
|
|
444
448
|
children: append
|
|
445
449
|
})
|
|
446
450
|
]
|
|
447
451
|
}),
|
|
452
|
+
replaceDefaultControlWrapper && children,
|
|
448
453
|
error && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $9e021ab4f609c8de$export$2e2bcd8739ae039), {
|
|
449
454
|
validationStatus: validationStatus,
|
|
450
455
|
...errorMessageProps,
|
|
@@ -455,13 +460,40 @@ const $ef10b8551376ecd8$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
455
460
|
variant: "light",
|
|
456
461
|
color: "gray",
|
|
457
462
|
size: "sm",
|
|
458
|
-
lineHeight: "
|
|
463
|
+
lineHeight: "short",
|
|
459
464
|
...descriptionProps,
|
|
460
465
|
children: description
|
|
461
466
|
})
|
|
462
467
|
]
|
|
463
468
|
});
|
|
464
|
-
}
|
|
469
|
+
}
|
|
470
|
+
$095d89378519ff08$export$a455218a85c89869.displayName = "Field";
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
function $ef10b8551376ecd8$export$f5b8910cec6cf069({ className: className, classNames: classNames, style: style, styles: styles, inputRef: inputRef, ...props }) {
|
|
474
|
+
const internalInputRef = (0, $hgUW1$react).useRef(null);
|
|
475
|
+
const { labelProps: labelProps, inputProps: inputProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps } = (0, $hgUW1$useTextField)({
|
|
476
|
+
...props,
|
|
477
|
+
inputElementType: "input"
|
|
478
|
+
}, internalInputRef);
|
|
479
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
|
|
480
|
+
labelProps: labelProps,
|
|
481
|
+
descriptionProps: descriptionProps,
|
|
482
|
+
errorMessageProps: errorMessageProps,
|
|
483
|
+
className: className,
|
|
484
|
+
classNames: classNames,
|
|
485
|
+
styles: styles,
|
|
486
|
+
style: style,
|
|
487
|
+
...props,
|
|
488
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
489
|
+
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(internalInputRef, inputRef),
|
|
490
|
+
"data-has-left-addon": !!props.prepend,
|
|
491
|
+
"data-has-right-addon": !!props.append,
|
|
492
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-text-input-el"),
|
|
493
|
+
...inputProps
|
|
494
|
+
})
|
|
495
|
+
});
|
|
496
|
+
}
|
|
465
497
|
$ef10b8551376ecd8$export$f5b8910cec6cf069.displayName = "Input";
|
|
466
498
|
|
|
467
499
|
|
|
@@ -590,7 +622,7 @@ const $d95a2216d3ccf702$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
590
622
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
591
623
|
const buttonGroupProps = (0, $9230e224c5c26d9c$export$749e21be8b14b968)();
|
|
592
624
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
593
|
-
const { color: color = theme?.color ?? "violet", variant: variant = "solid", append: append, prepend: prepend, size: size = "md", children: children, as: as = "button", className: className, isLoading: isLoading, radius: radius = "full", isToggle: isToggle, activeColor: activeColor = theme?.color, activeVariant: activeVariant = "solid", idleColor: idleColor = "gray", idleVariant: idleVariant = "outline", isIconButton: isIconButton, style: style, ...otherProps } = {
|
|
625
|
+
const { color: color = theme?.color ?? "violet", variant: variant = "solid", append: append, prepend: prepend, size: size = "md", children: children, as: as = "button", className: className, isLoading: isLoading, radius: radius = "full", isToggle: isToggle, activeColor: activeColor = theme?.color, activeVariant: activeVariant = "solid", idleColor: idleColor = "gray", idleVariant: idleVariant = "outline", isIconButton: isIconButton, style: style, classNames: classNames, styles: styles, form: form, ...otherProps } = {
|
|
594
626
|
...buttonGroupProps,
|
|
595
627
|
...props
|
|
596
628
|
};
|
|
@@ -621,7 +653,10 @@ const $d95a2216d3ccf702$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
621
653
|
}
|
|
622
654
|
const Comp = as;
|
|
623
655
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)(Comp, {
|
|
624
|
-
style:
|
|
656
|
+
style: {
|
|
657
|
+
...style,
|
|
658
|
+
...styles?.base
|
|
659
|
+
},
|
|
625
660
|
"data-is-toggle": isToggle,
|
|
626
661
|
"data-pressed": isPressed,
|
|
627
662
|
"data-radius": radius,
|
|
@@ -633,20 +668,19 @@ const $d95a2216d3ccf702$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
633
668
|
"data-selected": state.isSelected,
|
|
634
669
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)((0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("size", size), className, "p-button", space.classNames),
|
|
635
670
|
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(ref, buttonRef),
|
|
636
|
-
form:
|
|
671
|
+
form: form,
|
|
637
672
|
...buttonProps,
|
|
638
673
|
children: [
|
|
639
674
|
prepend,
|
|
640
|
-
|
|
641
|
-
style: {
|
|
642
|
-
padding: isIconButton ? undefined : "0 6px",
|
|
643
|
-
lineHeight: 0
|
|
644
|
-
},
|
|
645
|
-
children: children
|
|
646
|
-
}),
|
|
675
|
+
children,
|
|
647
676
|
isLoading ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e1148cdb3a130657$export$3b0d6d7590275603), {
|
|
677
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
678
|
+
"p-button-loader",
|
|
679
|
+
classNames?.loader
|
|
680
|
+
]),
|
|
648
681
|
style: {
|
|
649
|
-
marginLeft: 8
|
|
682
|
+
marginLeft: 8,
|
|
683
|
+
...styles?.loader
|
|
650
684
|
},
|
|
651
685
|
color: "inherit",
|
|
652
686
|
size: "xs"
|
|
@@ -680,88 +714,73 @@ $e3f71af5eaf1c216$export$c25acd513dcc8062.displayName = "IconButton";
|
|
|
680
714
|
|
|
681
715
|
|
|
682
716
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
717
|
+
function $2e89c7375b40283e$export$6bf0cd3a219bbade({ appearance: appearance = "outline", size: size = "md", color: color = "gray", classNames: classNames, styles: styles, append: append, prepend: prepend, placeholder: placeholder, showSteppers: showSteppers = false, error: error, label: label, minValue: minValue, maxValue: maxValue, formatOptions: formatOptions, inputRef: inputRef, incrementIcon: incrementIcon, decrementIcon: decrementIcon, ...props }) {
|
|
718
|
+
const ariaProps = {
|
|
719
|
+
...props,
|
|
720
|
+
maxValue: maxValue,
|
|
721
|
+
formatOptions: formatOptions,
|
|
722
|
+
minValue: minValue,
|
|
723
|
+
"aria-label": props["aria-label"] ?? "number input"
|
|
724
|
+
};
|
|
689
725
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
690
726
|
const internalInputRef = $hgUW1$useRef(null);
|
|
691
727
|
const { locale: locale } = (0, $hgUW1$useLocale)();
|
|
692
728
|
const state = (0, $hgUW1$useNumberFieldState)({
|
|
693
|
-
...
|
|
729
|
+
...ariaProps,
|
|
694
730
|
locale: locale
|
|
695
731
|
});
|
|
696
|
-
const { errorMessageProps: errorMessageProps, descriptionProps: descriptionProps, labelProps: labelProps, groupProps: groupProps, inputProps: inputProps, incrementButtonProps: incrementButtonProps, decrementButtonProps: decrementButtonProps } = (0, $hgUW1$useNumberField)(
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
}),
|
|
747
|
-
rest.description && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
748
|
-
weight: "regular",
|
|
749
|
-
size: "sm",
|
|
750
|
-
color: "gray",
|
|
751
|
-
variant: "light",
|
|
752
|
-
lineHeight: "base",
|
|
753
|
-
...descriptionProps,
|
|
754
|
-
as: "div",
|
|
755
|
-
children: rest.description
|
|
756
|
-
}),
|
|
757
|
-
rest.error && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $9e021ab4f609c8de$export$2e2bcd8739ae039), {
|
|
758
|
-
...errorMessageProps,
|
|
759
|
-
children: rest.error
|
|
760
|
-
})
|
|
761
|
-
]
|
|
732
|
+
const { errorMessageProps: errorMessageProps, descriptionProps: descriptionProps, labelProps: labelProps, groupProps: groupProps, inputProps: inputProps, incrementButtonProps: incrementButtonProps, decrementButtonProps: decrementButtonProps } = (0, $hgUW1$useNumberField)(ariaProps, state, internalInputRef);
|
|
733
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
|
|
734
|
+
classNames: classNames,
|
|
735
|
+
color: color,
|
|
736
|
+
size: size,
|
|
737
|
+
labelProps: labelProps,
|
|
738
|
+
descriptionProps: descriptionProps,
|
|
739
|
+
errorMessageProps: errorMessageProps,
|
|
740
|
+
error: error,
|
|
741
|
+
label: label,
|
|
742
|
+
replaceDefaultControlWrapper: true,
|
|
743
|
+
...props,
|
|
744
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
745
|
+
gap: "4xs",
|
|
746
|
+
...groupProps,
|
|
747
|
+
className: "p-input-container",
|
|
748
|
+
children: [
|
|
749
|
+
showSteppers && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e3f71af5eaf1c216$export$c25acd513dcc8062), {
|
|
750
|
+
...decrementButtonProps,
|
|
751
|
+
radius: "md",
|
|
752
|
+
color: color,
|
|
753
|
+
variant: "outline",
|
|
754
|
+
size: size,
|
|
755
|
+
className: classNames?.decrement,
|
|
756
|
+
style: styles?.decrement,
|
|
757
|
+
children: decrementIcon
|
|
758
|
+
}),
|
|
759
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
760
|
+
style: styles?.input,
|
|
761
|
+
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(internalInputRef, inputRef),
|
|
762
|
+
placeholder: placeholder,
|
|
763
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(classNames?.input, "p-input-control", "space-item", space.classNames),
|
|
764
|
+
"data-appearance": appearance,
|
|
765
|
+
"data-has-left-addon": !!prepend,
|
|
766
|
+
"data-has-right-addon": !!append,
|
|
767
|
+
type: "text",
|
|
768
|
+
...inputProps
|
|
769
|
+
}),
|
|
770
|
+
showSteppers && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e3f71af5eaf1c216$export$c25acd513dcc8062), {
|
|
771
|
+
...incrementButtonProps,
|
|
772
|
+
radius: "md",
|
|
773
|
+
color: color,
|
|
774
|
+
variant: "outline",
|
|
775
|
+
size: size,
|
|
776
|
+
className: classNames?.increment,
|
|
777
|
+
style: styles?.increment,
|
|
778
|
+
children: incrementIcon
|
|
779
|
+
})
|
|
780
|
+
]
|
|
781
|
+
})
|
|
762
782
|
});
|
|
763
|
-
}
|
|
764
|
-
$2e89c7375b40283e$export$6bf0cd3a219bbade.displayName = "NumberInput";
|
|
783
|
+
}
|
|
765
784
|
|
|
766
785
|
|
|
767
786
|
|
|
@@ -911,7 +930,7 @@ $1ab2e355b7aa4310$export$4aa08d5625cb8ead.displayName = "CheckboxGroup";
|
|
|
911
930
|
|
|
912
931
|
|
|
913
932
|
const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react).forwardRef((props, ref)=>{
|
|
914
|
-
const { appearance: appearance, size: size, shape: shape = "round", color: color, className: className, ...otherProps } = props;
|
|
933
|
+
const { appearance: appearance, size: size, shape: shape = "round", color: color, className: className, classNames: classNames, styles: styles, style: style, ...otherProps } = props;
|
|
915
934
|
// check if checkbox is rendered in a group context
|
|
916
935
|
const groupContext = (0, $hgUW1$react).useContext((0, $1ab2e355b7aa4310$export$f9c6924e160136d1));
|
|
917
936
|
const groupState = groupContext?.state;
|
|
@@ -935,7 +954,11 @@ const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
935
954
|
const resolvedAppearance = appearance || groupProps?.appearance || "outline";
|
|
936
955
|
const resolvedSize = size || groupProps?.size || "md";
|
|
937
956
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("label", {
|
|
938
|
-
|
|
957
|
+
style: {
|
|
958
|
+
...style,
|
|
959
|
+
...styles?.wrapper
|
|
960
|
+
},
|
|
961
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, "p-checkbox", classNames?.wrapper),
|
|
939
962
|
"data-disabled": inputProps?.disabled,
|
|
940
963
|
ref: ref,
|
|
941
964
|
children: [
|
|
@@ -948,9 +971,16 @@ const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
948
971
|
})
|
|
949
972
|
}),
|
|
950
973
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
974
|
+
style: {
|
|
975
|
+
...style,
|
|
976
|
+
...styles?.checkbox
|
|
977
|
+
},
|
|
951
978
|
"data-color": resolvedColor,
|
|
952
979
|
"data-radius": getRadius(),
|
|
953
|
-
className:
|
|
980
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
981
|
+
"p-fake-checkbox",
|
|
982
|
+
classNames?.checkbox
|
|
983
|
+
]),
|
|
954
984
|
"data-focused": isFocusVisible,
|
|
955
985
|
"aria-hidden": "true",
|
|
956
986
|
"data-checked": isSelected && !props.isIndeterminate,
|
|
@@ -959,6 +989,10 @@ const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
959
989
|
"data-appearance": resolvedAppearance,
|
|
960
990
|
children: [
|
|
961
991
|
isSelected && !props.isIndeterminate && /*#__PURE__*/ (0, $hgUW1$jsx)("svg", {
|
|
992
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
993
|
+
"p-checkbox-icon",
|
|
994
|
+
classNames?.icon
|
|
995
|
+
]),
|
|
962
996
|
stroke: "white",
|
|
963
997
|
width: "0.75rem",
|
|
964
998
|
height: "0.75rem",
|
|
@@ -975,6 +1009,10 @@ const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
975
1009
|
})
|
|
976
1010
|
}),
|
|
977
1011
|
props.isIndeterminate && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ee0105641360f1c1$export$e71c4d32a2263218), {
|
|
1012
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
1013
|
+
"p-checkbox-icon",
|
|
1014
|
+
classNames?.icon
|
|
1015
|
+
]),
|
|
978
1016
|
style: {
|
|
979
1017
|
background: "var(--color-12)",
|
|
980
1018
|
width: "70%",
|
|
@@ -1005,25 +1043,39 @@ $0ca204e719955216$export$48513f6b9f8ce62d.displayName = "checkbox";
|
|
|
1005
1043
|
|
|
1006
1044
|
|
|
1007
1045
|
|
|
1008
|
-
function $fc3eb9661261e42e$export$91527519cfe8e396({ state: state, children: children, popoverRef: popoverRef, ...props }) {
|
|
1046
|
+
function $fc3eb9661261e42e$export$91527519cfe8e396({ state: state, children: children, popoverRef: popoverRef, style: style, styles: styles, classNames: classNames, className: className, ...props }) {
|
|
1009
1047
|
const internalPopoverRef = $hgUW1$useRef(null);
|
|
1010
1048
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
1011
1049
|
const { popoverProps: popoverProps, underlayProps: underlayProps } = (0, $hgUW1$usePopover)({
|
|
1012
1050
|
...props,
|
|
1013
1051
|
popoverRef: internalPopoverRef
|
|
1014
1052
|
}, state);
|
|
1053
|
+
const { style: internalStyle, ...otherPopoverProps } = popoverProps;
|
|
1015
1054
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Overlay), {
|
|
1016
1055
|
children: [
|
|
1017
1056
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1018
1057
|
...underlayProps,
|
|
1019
|
-
|
|
1058
|
+
style: styles?.underlay,
|
|
1059
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
1060
|
+
"underlay",
|
|
1061
|
+
classNames?.underlay
|
|
1062
|
+
])
|
|
1020
1063
|
}),
|
|
1021
1064
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1022
1065
|
"data-color": theme?.color,
|
|
1023
1066
|
"data-radius": theme?.radius,
|
|
1024
|
-
...popoverProps,
|
|
1025
1067
|
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(popoverRef, internalPopoverRef),
|
|
1026
|
-
className:
|
|
1068
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
1069
|
+
"p-popover",
|
|
1070
|
+
className,
|
|
1071
|
+
classNames?.wrapper
|
|
1072
|
+
]),
|
|
1073
|
+
style: {
|
|
1074
|
+
...internalStyle,
|
|
1075
|
+
...style,
|
|
1076
|
+
...styles?.wrapper
|
|
1077
|
+
},
|
|
1078
|
+
...otherPopoverProps,
|
|
1027
1079
|
children: children
|
|
1028
1080
|
})
|
|
1029
1081
|
]
|
|
@@ -1277,30 +1329,38 @@ const $3ba60d401cc6cc09$export$e44a253a59704894 = {
|
|
|
1277
1329
|
|
|
1278
1330
|
|
|
1279
1331
|
|
|
1280
|
-
|
|
1332
|
+
const $c35269c9504bc94d$export$5b7f4051a57920d0 = (0, $hgUW1$Item);
|
|
1333
|
+
const $c35269c9504bc94d$export$ef146090a6472d9e = (0, $hgUW1$Section);
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
function $b71fd84ba612e4b0$export$3d7d0414f6db67e7({ children: children, renderOption: renderOption, valueKey: valueKey, sectionKey: sectionKey, renderSectionLabel: renderSectionLabel, labelKey: labelKey, items: items }) {
|
|
1281
1337
|
const hasChildren = $hgUW1$Children.count(children) > 0;
|
|
1282
1338
|
if (hasChildren) return children;
|
|
1283
1339
|
if (items) // eslint-disable-next-line react/display-name
|
|
1284
1340
|
return (item)=>{
|
|
1285
1341
|
const label = item?.[labelKey ?? "label"];
|
|
1286
|
-
const value = item?.[valueKey ?? "id"];
|
|
1342
|
+
const value = item?.[valueKey ?? "id" ?? "key" ?? "value"];
|
|
1287
1343
|
const sectionChildren = item?.[sectionKey ?? "children"] ?? [];
|
|
1288
|
-
if (item?.[sectionKey]) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $
|
|
1344
|
+
if (item?.[sectionKey]) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $c35269c9504bc94d$export$ef146090a6472d9e), {
|
|
1289
1345
|
items: sectionChildren,
|
|
1290
|
-
title:
|
|
1291
|
-
children: (item)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $
|
|
1346
|
+
title: renderSectionLabel?.(item),
|
|
1347
|
+
children: (item)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $c35269c9504bc94d$export$5b7f4051a57920d0), {
|
|
1292
1348
|
textValue: item?.[labelKey ?? "label"],
|
|
1293
|
-
children: item?.[labelKey ?? "label"]
|
|
1294
|
-
}, item?.[valueKey ?? "id"])
|
|
1349
|
+
children: renderOption?.(item) ?? item?.[labelKey ?? "label"]
|
|
1350
|
+
}, item?.[valueKey ?? "id" ?? "key" ?? "value"])
|
|
1295
1351
|
}, value);
|
|
1296
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $
|
|
1352
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $c35269c9504bc94d$export$5b7f4051a57920d0), {
|
|
1297
1353
|
textValue: label,
|
|
1298
1354
|
children: renderOption?.(item) ?? label
|
|
1299
|
-
},
|
|
1355
|
+
}, value);
|
|
1300
1356
|
};
|
|
1301
1357
|
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1358
|
+
function $b71fd84ba612e4b0$export$4c687b6f1150e71b(props) {
|
|
1359
|
+
const children = $hgUW1$useMemo(()=>{
|
|
1360
|
+
return $b71fd84ba612e4b0$export$3d7d0414f6db67e7(props);
|
|
1361
|
+
}, []);
|
|
1362
|
+
return children;
|
|
1363
|
+
}
|
|
1304
1364
|
|
|
1305
1365
|
|
|
1306
1366
|
|
|
@@ -1315,70 +1375,74 @@ function $db709eeca70b0d61$export$1e60abce570c2b01(props) {
|
|
|
1315
1375
|
});
|
|
1316
1376
|
}
|
|
1317
1377
|
function $db709eeca70b0d61$export$961f16f221737ce2() {
|
|
1318
|
-
const
|
|
1319
|
-
if (!
|
|
1320
|
-
return
|
|
1378
|
+
const ctx = $hgUW1$useContext($db709eeca70b0d61$var$ListBoxContext);
|
|
1379
|
+
if (!ctx) throw new Error("ListBox components must be rendered within the ListBoxProvider");
|
|
1380
|
+
return ctx;
|
|
1321
1381
|
}
|
|
1322
1382
|
|
|
1323
1383
|
|
|
1324
1384
|
|
|
1325
1385
|
|
|
1326
|
-
function $6ae005878b435ce8$export$41f133550aa26f48({ state: state, color: color, width: width = 300,
|
|
1386
|
+
function $6ae005878b435ce8$export$41f133550aa26f48({ state: state, color: color, width: width = 300, listBoxRef: listBoxRef, renderEmpty: renderEmpty, classNames: classNames, className: className, style: style, styles: styles, ...props }) {
|
|
1387
|
+
const children = (0, $b71fd84ba612e4b0$export$4c687b6f1150e71b)(props);
|
|
1327
1388
|
const internalState = (0, $hgUW1$useListState)({
|
|
1328
1389
|
...props,
|
|
1329
|
-
children:
|
|
1390
|
+
children: children
|
|
1330
1391
|
});
|
|
1331
1392
|
const listRef = $hgUW1$useRef(null);
|
|
1332
1393
|
const listState = state || internalState;
|
|
1333
|
-
const { listBoxProps: listBoxProps } = (0, $hgUW1$useListBox)(
|
|
1394
|
+
const { listBoxProps: listBoxProps } = (0, $hgUW1$useListBox)({
|
|
1395
|
+
...props,
|
|
1396
|
+
label: props.label ?? "Select an option"
|
|
1397
|
+
}, listState, listRef);
|
|
1334
1398
|
const options = [
|
|
1335
1399
|
...listState.collection
|
|
1336
1400
|
];
|
|
1337
1401
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
1402
|
+
function renderEmptyState() {
|
|
1403
|
+
return renderEmpty?.() ?? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
1404
|
+
color: "gray",
|
|
1405
|
+
variant: "lighter",
|
|
1406
|
+
children: "No options"
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1338
1409
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $db709eeca70b0d61$export$1e60abce570c2b01), {
|
|
1339
1410
|
...props,
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1411
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1412
|
+
as: "ul",
|
|
1413
|
+
stack: true,
|
|
1414
|
+
gap: "none",
|
|
1415
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-list-box-wrapper", classNames?.wrapper, className),
|
|
1416
|
+
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(listRef, listBoxRef),
|
|
1417
|
+
"data-radius": "lg",
|
|
1418
|
+
"data-color": color ?? theme?.color,
|
|
1343
1419
|
style: {
|
|
1344
1420
|
width: width,
|
|
1345
|
-
|
|
1421
|
+
...style,
|
|
1422
|
+
...styles?.wrapper
|
|
1346
1423
|
},
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
})
|
|
1370
|
-
}),
|
|
1371
|
-
options.map((item)=>{
|
|
1372
|
-
return item.type === "section" ? /*#__PURE__*/ (0, $hgUW1$jsx)($6ae005878b435ce8$var$ListSection, {
|
|
1373
|
-
section: item,
|
|
1374
|
-
state: listState
|
|
1375
|
-
}, item.key) : /*#__PURE__*/ (0, $hgUW1$jsx)($6ae005878b435ce8$var$ListOption, {
|
|
1376
|
-
state: listState,
|
|
1377
|
-
item: item
|
|
1378
|
-
}, item.key);
|
|
1379
|
-
})
|
|
1380
|
-
]
|
|
1381
|
-
})
|
|
1424
|
+
...listBoxProps,
|
|
1425
|
+
children: [
|
|
1426
|
+
options.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1427
|
+
justify: "center",
|
|
1428
|
+
align: "center",
|
|
1429
|
+
style: {
|
|
1430
|
+
height: 50
|
|
1431
|
+
},
|
|
1432
|
+
children: renderEmptyState()
|
|
1433
|
+
}),
|
|
1434
|
+
options.map((item)=>{
|
|
1435
|
+
return item.type === "section" ? /*#__PURE__*/ (0, $hgUW1$jsx)($6ae005878b435ce8$var$ListSection, {
|
|
1436
|
+
className: classNames?.section,
|
|
1437
|
+
section: item,
|
|
1438
|
+
state: listState
|
|
1439
|
+
}, item.key) : /*#__PURE__*/ (0, $hgUW1$jsx)($6ae005878b435ce8$var$ListOption, {
|
|
1440
|
+
className: classNames?.option,
|
|
1441
|
+
state: listState,
|
|
1442
|
+
item: item
|
|
1443
|
+
}, item.key);
|
|
1444
|
+
})
|
|
1445
|
+
]
|
|
1382
1446
|
})
|
|
1383
1447
|
});
|
|
1384
1448
|
}
|
|
@@ -1387,24 +1451,28 @@ function $6ae005878b435ce8$var$ListOption({ state: state, item: item }) {
|
|
|
1387
1451
|
const { optionProps: optionProps, isDisabled: isDisabled, isFocusVisible: isFocusVisible, isFocused: isFocused, isPressed: isPressed, isSelected: isSelected } = (0, $hgUW1$useOption)({
|
|
1388
1452
|
key: item.key
|
|
1389
1453
|
}, state, optionRef);
|
|
1390
|
-
const
|
|
1454
|
+
const { showSelectionIndicator: showSelectionIndicator = true, renderSelectionIndicator: renderSelectionIndicator } = (0, $db709eeca70b0d61$export$961f16f221737ce2)().props;
|
|
1455
|
+
const { className: className, classNames: classNames, style: style, styles: styles, color: color, textValue: textValue, title: title, ...otherProps } = item.props;
|
|
1391
1456
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
1392
|
-
|
|
1457
|
+
style: {
|
|
1458
|
+
...style,
|
|
1459
|
+
...styles?.wrapper
|
|
1460
|
+
},
|
|
1461
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, "p-list-option", classNames?.wrapper),
|
|
1393
1462
|
"data-disabled": isDisabled,
|
|
1394
1463
|
"data-focus-visible": isFocusVisible,
|
|
1395
1464
|
"data-focused": isFocused,
|
|
1396
1465
|
"data-pressed": isPressed,
|
|
1397
1466
|
"data-selected": isSelected,
|
|
1467
|
+
"data-color": color,
|
|
1398
1468
|
...optionProps,
|
|
1399
|
-
...
|
|
1400
|
-
"textValue"
|
|
1401
|
-
]),
|
|
1469
|
+
...otherProps,
|
|
1402
1470
|
ref: optionRef,
|
|
1403
1471
|
children: [
|
|
1404
1472
|
item.rendered,
|
|
1405
|
-
isSelected &&
|
|
1406
|
-
|
|
1407
|
-
})
|
|
1473
|
+
isSelected && showSelectionIndicator && (renderSelectionIndicator?.(item) ?? /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1474
|
+
children: "x"
|
|
1475
|
+
}))
|
|
1408
1476
|
]
|
|
1409
1477
|
});
|
|
1410
1478
|
}
|
|
@@ -1414,19 +1482,25 @@ function $6ae005878b435ce8$var$ListSection({ state: state, section: section }) {
|
|
|
1414
1482
|
"aria-label": section["aria-label"]
|
|
1415
1483
|
});
|
|
1416
1484
|
const listBoxContext = (0, $db709eeca70b0d61$export$961f16f221737ce2)();
|
|
1417
|
-
|
|
1485
|
+
const { className: className, classNames: classNames, style: style, styles: styles } = section.props;
|
|
1486
|
+
const children = $hgUW1$useMemo(()=>{
|
|
1418
1487
|
if (state.collection.getChildren) return [
|
|
1419
1488
|
...state.collection.getChildren(section.key)
|
|
1420
1489
|
];
|
|
1421
1490
|
return [];
|
|
1422
|
-
}
|
|
1491
|
+
}, []);
|
|
1423
1492
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1424
1493
|
gap: "sm",
|
|
1425
1494
|
stack: true,
|
|
1426
|
-
className: "p-list-section",
|
|
1495
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, "p-list-section", classNames?.wrapper),
|
|
1496
|
+
style: {
|
|
1497
|
+
...style,
|
|
1498
|
+
...styles?.wrapper
|
|
1499
|
+
},
|
|
1427
1500
|
children: [
|
|
1428
|
-
section.key !== state.collection.getFirstKey() && listBoxContext.props.
|
|
1429
|
-
|
|
1501
|
+
section.key !== state.collection.getFirstKey() && listBoxContext.props.showSectionSeparator && /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
1502
|
+
style: styles?.separator,
|
|
1503
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-list-separator", classNames?.separator)
|
|
1430
1504
|
}),
|
|
1431
1505
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1432
1506
|
gap: "none",
|
|
@@ -1434,20 +1508,18 @@ function $6ae005878b435ce8$var$ListSection({ state: state, section: section }) {
|
|
|
1434
1508
|
as: "li",
|
|
1435
1509
|
...itemProps,
|
|
1436
1510
|
children: [
|
|
1437
|
-
section.rendered && /*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
...headingProps,
|
|
1445
|
-
children: section.rendered
|
|
1446
|
-
})
|
|
1511
|
+
section.rendered && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
1512
|
+
style: styles?.heading,
|
|
1513
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-list-section-header", classNames?.heading),
|
|
1514
|
+
as: "div",
|
|
1515
|
+
variant: "light",
|
|
1516
|
+
...headingProps,
|
|
1517
|
+
children: section.rendered
|
|
1447
1518
|
}),
|
|
1448
1519
|
/*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
1520
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(classNames?.items),
|
|
1449
1521
|
...groupProps,
|
|
1450
|
-
children:
|
|
1522
|
+
children: children.map((node)=>{
|
|
1451
1523
|
return /*#__PURE__*/ (0, $hgUW1$jsx)($6ae005878b435ce8$var$ListOption, {
|
|
1452
1524
|
item: node,
|
|
1453
1525
|
state: state
|
|
@@ -1459,8 +1531,7 @@ function $6ae005878b435ce8$var$ListSection({ state: state, section: section }) {
|
|
|
1459
1531
|
]
|
|
1460
1532
|
});
|
|
1461
1533
|
}
|
|
1462
|
-
|
|
1463
|
-
const $6ae005878b435ce8$export$6e2c8f0811a474ce = (0, $hgUW1$Section);
|
|
1534
|
+
|
|
1464
1535
|
|
|
1465
1536
|
|
|
1466
1537
|
|
|
@@ -1733,7 +1804,6 @@ $e3711da06539818f$export$f8afaea2e9656b91.displayName = "RadioCard";
|
|
|
1733
1804
|
|
|
1734
1805
|
|
|
1735
1806
|
|
|
1736
|
-
|
|
1737
1807
|
const $c700d45659d35204$export$3288d34c523a1192 = /*#__PURE__*/ (0, $hgUW1$react).forwardRef(({ prepend: prepend, append: append, children: children, hashValue: hashValue, color: color, size: size = "sm", shape: shape = "rounded", variant: variant = "light", className: className, ...props }, ref)=>{
|
|
1738
1808
|
const randomColor = (0, $hgUW1$react).useMemo(()=>{
|
|
1739
1809
|
if (hashValue) return (0, $0ad0bc75b5eb16a6$export$e4369cabd7e84cd9)(hashValue);
|
|
@@ -1765,44 +1835,46 @@ $c700d45659d35204$export$3288d34c523a1192.displayName = "Tag";
|
|
|
1765
1835
|
|
|
1766
1836
|
|
|
1767
1837
|
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode: selectionMode = "single", appearance: appearance = "outline", renderValue: renderValue, color: color = "gray", error: error, description: description, size: size = "sm", radius: radius, listBoxColor: listBoxColor, className: className, value: value, defaultValue: defaultValue, onChange: onChange, style: style, ...props }) {
|
|
1838
|
+
function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode: selectionMode = "single", appearance: appearance = "outline", renderValue: renderValue, color: color = "gray", error: error, description: description, size: size = "sm", radius: radius, listBoxColor: listBoxColor, className: className, value: value, defaultValue: defaultValue, onChange: onChange, onSelectionChange: onSelectionChange, style: style, classNames: classNames, styles: styles, showSectionSeparator: showSectionSeparator = true, showSelectionIndicator: showSelectionIndicator = true, ...props }) {
|
|
1771
1839
|
const isMultiple = selectionMode === "multiple";
|
|
1772
|
-
|
|
1840
|
+
const _value = $hgUW1$useMemo(()=>{
|
|
1773
1841
|
if (!value) return null;
|
|
1774
1842
|
if (selectionMode === "single") return [
|
|
1775
1843
|
value
|
|
1776
1844
|
];
|
|
1777
1845
|
if (isMultiple && !(0, $0f90ef71a188bc45$export$43bee75e5e14138e)(value)) throw new Error("Select: value must be an array when selectionMode is multiple");
|
|
1778
1846
|
return value;
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
name: props.name
|
|
1785
|
-
}
|
|
1786
|
-
});
|
|
1787
|
-
}
|
|
1847
|
+
}, [
|
|
1848
|
+
value,
|
|
1849
|
+
selectionMode
|
|
1850
|
+
]);
|
|
1851
|
+
const children = (0, $b71fd84ba612e4b0$export$4c687b6f1150e71b)(props);
|
|
1788
1852
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
1789
1853
|
const triggerState = (0, $hgUW1$useMenuTriggerState)({});
|
|
1790
1854
|
const listState = (0, $hgUW1$useListState)({
|
|
1791
1855
|
...props,
|
|
1792
|
-
selectedKeys:
|
|
1793
|
-
defaultSelectedKeys:
|
|
1856
|
+
selectedKeys: _value,
|
|
1857
|
+
defaultSelectedKeys: _value,
|
|
1794
1858
|
selectionMode: selectionMode,
|
|
1795
|
-
children:
|
|
1859
|
+
children: children,
|
|
1796
1860
|
onSelectionChange (keys) {
|
|
1797
|
-
|
|
1861
|
+
const keysToArray = [
|
|
1798
1862
|
...keys
|
|
1799
|
-
]
|
|
1863
|
+
];
|
|
1864
|
+
onSelectionChange?.(keysToArray);
|
|
1865
|
+
onChange?.({
|
|
1866
|
+
target: {
|
|
1867
|
+
value: isMultiple ? keysToArray : keysToArray[0],
|
|
1868
|
+
name: props.name
|
|
1869
|
+
}
|
|
1870
|
+
});
|
|
1800
1871
|
if (!isMultiple) triggerState.close();
|
|
1801
1872
|
}
|
|
1802
1873
|
});
|
|
1803
1874
|
const triggerRef = $hgUW1$useRef(null);
|
|
1804
1875
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
1805
|
-
|
|
1876
|
+
color = color ?? theme?.color;
|
|
1877
|
+
const { menuTriggerProps: menuTriggerProps, menuProps: menuProps } = (0, $hgUW1$useMenuTrigger)({
|
|
1806
1878
|
type: "listbox",
|
|
1807
1879
|
trigger: "press",
|
|
1808
1880
|
isDisabled: false
|
|
@@ -1811,8 +1883,10 @@ function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1811
1883
|
const selectedItems = [
|
|
1812
1884
|
...listState.selectionManager.selectedKeys
|
|
1813
1885
|
].map((item)=>listState.collection.getItem(item));
|
|
1814
|
-
|
|
1886
|
+
const content = $hgUW1$useMemo(()=>{
|
|
1815
1887
|
if (selectedItems.length === 0) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
1888
|
+
style: styles?.placeholder,
|
|
1889
|
+
className: classNames?.placeholder,
|
|
1816
1890
|
color: color,
|
|
1817
1891
|
variant: "lighter",
|
|
1818
1892
|
children: props.placeholder
|
|
@@ -1820,67 +1894,64 @@ function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1820
1894
|
if (isMultiple) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1821
1895
|
gap: "3xs",
|
|
1822
1896
|
wrap: "wrap",
|
|
1823
|
-
children: selectedItems.map((item)
|
|
1824
|
-
|
|
1825
|
-
|
|
1897
|
+
children: selectedItems.map((item)=>renderValue?.(item?.value) ?? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $c700d45659d35204$export$3288d34c523a1192), {
|
|
1898
|
+
size: "md",
|
|
1899
|
+
variant: "pastel",
|
|
1900
|
+
color: color,
|
|
1826
1901
|
children: item?.textValue
|
|
1827
1902
|
}, item?.key))
|
|
1828
1903
|
});
|
|
1829
1904
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
1905
|
+
as: "div",
|
|
1830
1906
|
variant: "default",
|
|
1831
1907
|
color: color === "gray" ? "black" : color,
|
|
1832
|
-
className: "single-value",
|
|
1908
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("single-value", classNames?.value),
|
|
1909
|
+
style: styles?.value,
|
|
1833
1910
|
children: renderValue?.(selectedItems[0]?.value) ?? selectedItems[0]?.value?.[props.labelKey ?? "label"] ?? selectedItems[0]?.textValue
|
|
1834
1911
|
});
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1912
|
+
}, [
|
|
1913
|
+
selectedItems.length,
|
|
1914
|
+
isMultiple,
|
|
1915
|
+
selectedItems[0]?.value
|
|
1916
|
+
]);
|
|
1917
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
1918
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-select", className, classNames?.wrapper),
|
|
1919
|
+
style: {
|
|
1920
|
+
...style,
|
|
1921
|
+
...styles?.wrapper
|
|
1922
|
+
},
|
|
1841
1923
|
children: [
|
|
1842
|
-
/*#__PURE__*/ (0, $hgUW1$
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
]
|
|
1870
|
-
}),
|
|
1871
|
-
error && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $9e021ab4f609c8de$export$2e2bcd8739ae039), {
|
|
1872
|
-
children: error
|
|
1873
|
-
}),
|
|
1874
|
-
description && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
1875
|
-
as: "div",
|
|
1876
|
-
variant: "light",
|
|
1877
|
-
color: "gray",
|
|
1878
|
-
size: "sm",
|
|
1879
|
-
children: description
|
|
1880
|
-
})
|
|
1881
|
-
]
|
|
1924
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
|
|
1925
|
+
replaceDefaultControlWrapper: true,
|
|
1926
|
+
label: label,
|
|
1927
|
+
error: error,
|
|
1928
|
+
description: description,
|
|
1929
|
+
className: className,
|
|
1930
|
+
classNames: classNames,
|
|
1931
|
+
size: size,
|
|
1932
|
+
radius: radius,
|
|
1933
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
1934
|
+
style: styles?.trigger,
|
|
1935
|
+
"data-selection-mode": selectionMode,
|
|
1936
|
+
tabIndex: 0,
|
|
1937
|
+
role: "button",
|
|
1938
|
+
ref: triggerRef,
|
|
1939
|
+
color: "gray",
|
|
1940
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-input-control", "p-select-trigger", space.classNames, classNames?.trigger),
|
|
1941
|
+
"data-appearance": appearance,
|
|
1942
|
+
...triggerProps,
|
|
1943
|
+
children: [
|
|
1944
|
+
content,
|
|
1945
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$HiSelector), {
|
|
1946
|
+
className: "selector",
|
|
1947
|
+
size: 18
|
|
1948
|
+
})
|
|
1949
|
+
]
|
|
1950
|
+
})
|
|
1882
1951
|
}),
|
|
1883
1952
|
triggerState.isOpen && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $fc3eb9661261e42e$export$91527519cfe8e396), {
|
|
1953
|
+
className: classNames?.popover,
|
|
1954
|
+
style: styles?.popover,
|
|
1884
1955
|
placement: "bottom start",
|
|
1885
1956
|
offset: 4,
|
|
1886
1957
|
shouldUpdatePosition: true,
|
|
@@ -1888,12 +1959,13 @@ function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1888
1959
|
state: triggerState,
|
|
1889
1960
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6ae005878b435ce8$export$41f133550aa26f48), {
|
|
1890
1961
|
label: label,
|
|
1891
|
-
|
|
1892
|
-
|
|
1962
|
+
showSectionSeparator: showSectionSeparator,
|
|
1963
|
+
showSelectionIndicator: showSelectionIndicator,
|
|
1893
1964
|
width: triggerRef.current?.getBoundingClientRect().width,
|
|
1894
1965
|
color: listBoxColor ?? "gray",
|
|
1895
1966
|
shouldFocusOnHover: true,
|
|
1896
1967
|
state: listState,
|
|
1968
|
+
...menuProps,
|
|
1897
1969
|
...props
|
|
1898
1970
|
})
|
|
1899
1971
|
})
|
|
@@ -1916,6 +1988,7 @@ function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1916
1988
|
|
|
1917
1989
|
|
|
1918
1990
|
|
|
1991
|
+
|
|
1919
1992
|
function $693c180b2c3a8d81$var$createCalendar() {
|
|
1920
1993
|
return new (0, $hgUW1$GregorianCalendar)();
|
|
1921
1994
|
}
|
|
@@ -2292,13 +2365,15 @@ $48aceaf3289ec325$export$7edc06cf1783b30f.displayName = "DateInput";
|
|
|
2292
2365
|
|
|
2293
2366
|
|
|
2294
2367
|
|
|
2295
|
-
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 = "
|
|
2368
|
+
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 = "lg", classNames: classNames, styles: styles, style: style, ...props }, ref)=>{
|
|
2296
2369
|
const [imageError, setImageError] = $hgUW1$useState(false);
|
|
2297
2370
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
2298
2371
|
function getAvatarRadius() {
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2372
|
+
(0, $0ad0bc75b5eb16a6$export$1c4d39b152e0f791)("shape", "radius", shape);
|
|
2373
|
+
// TODO: remove this when we remove the deprecated shape prop
|
|
2374
|
+
if (shape === "circle" && !radius) radius = "full";
|
|
2375
|
+
if (shape === "square" && !radius) radius = "md";
|
|
2376
|
+
return theme?.avatarRadiusSize || radius;
|
|
2302
2377
|
}
|
|
2303
2378
|
const defaultColor = $hgUW1$useMemo(()=>{
|
|
2304
2379
|
const hash = (0, $0ad0bc75b5eb16a6$export$d41d9ab3de2def3d)(name || "");
|
|
@@ -2308,6 +2383,10 @@ const $55bcc0e5986993c4$export$e2255cf6045e8d47 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
2308
2383
|
]);
|
|
2309
2384
|
const renderContent = ()=>{
|
|
2310
2385
|
if (src && !imageError) return /*#__PURE__*/ (0, $hgUW1$jsx)("img", {
|
|
2386
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
2387
|
+
"avatar-img",
|
|
2388
|
+
classNames?.img
|
|
2389
|
+
]),
|
|
2311
2390
|
onLoad: ()=>setImageError(false),
|
|
2312
2391
|
onError: ()=>setImageError(true),
|
|
2313
2392
|
src: src,
|
|
@@ -2315,14 +2394,24 @@ const $55bcc0e5986993c4$export$e2255cf6045e8d47 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
2315
2394
|
});
|
|
2316
2395
|
if (imageError && !children) return fallback;
|
|
2317
2396
|
if (!src && !children && name) return /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2397
|
+
style: styles?.fallback,
|
|
2398
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
2399
|
+
"avatar-fallback",
|
|
2400
|
+
classNames?.fallback
|
|
2401
|
+
]),
|
|
2318
2402
|
children: name.charAt(0)
|
|
2319
2403
|
});
|
|
2320
2404
|
return children;
|
|
2321
2405
|
};
|
|
2322
2406
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2407
|
+
style: {
|
|
2408
|
+
...style,
|
|
2409
|
+
...styles?.base
|
|
2410
|
+
},
|
|
2323
2411
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
2324
2412
|
"p-avatar",
|
|
2325
|
-
className
|
|
2413
|
+
className,
|
|
2414
|
+
classNames?.base
|
|
2326
2415
|
]),
|
|
2327
2416
|
"data-radius": getAvatarRadius(),
|
|
2328
2417
|
"data-color": color ?? defaultColor,
|
|
@@ -2689,8 +2778,97 @@ $fac55dfefd316398$export$b5d5cf8927ab7262.displayName = "Switch";
|
|
|
2689
2778
|
|
|
2690
2779
|
|
|
2691
2780
|
|
|
2692
|
-
|
|
2693
|
-
|
|
2781
|
+
|
|
2782
|
+
|
|
2783
|
+
|
|
2784
|
+
|
|
2785
|
+
function $17f80f062b7f107f$export$472062a354075cee({ className: className, classNames: classNames, style: style, styles: styles, name: name, size: size = "sm", orientation: orientation = "horizontal", ...props }) {
|
|
2786
|
+
const trackRef = $hgUW1$useRef(null);
|
|
2787
|
+
const numberFormatter = (0, $hgUW1$useNumberFormatter)();
|
|
2788
|
+
const state = (0, $hgUW1$useSliderState)({
|
|
2789
|
+
...props,
|
|
2790
|
+
numberFormatter: numberFormatter
|
|
2791
|
+
});
|
|
2792
|
+
const { trackProps: trackProps, labelProps: labelProps } = (0, $hgUW1$useSlider)({
|
|
2793
|
+
...props,
|
|
2794
|
+
"aria-label": props["aria-label"] ?? "slider"
|
|
2795
|
+
}, state, trackRef);
|
|
2796
|
+
const percent = state.getThumbPercent(0);
|
|
2797
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2798
|
+
"data-size": size,
|
|
2799
|
+
style: {
|
|
2800
|
+
...style,
|
|
2801
|
+
...styles?.wrapper
|
|
2802
|
+
},
|
|
2803
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-slider", orientation, className, classNames?.wrapper),
|
|
2804
|
+
children: [
|
|
2805
|
+
props.label && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $eea734bbd8b9efff$export$2e2bcd8739ae039), {
|
|
2806
|
+
style: styles?.label,
|
|
2807
|
+
className: classNames?.label,
|
|
2808
|
+
...labelProps,
|
|
2809
|
+
children: props.label
|
|
2810
|
+
}),
|
|
2811
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2812
|
+
ref: trackRef,
|
|
2813
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-slider-track", classNames?.track),
|
|
2814
|
+
...trackProps,
|
|
2815
|
+
children: [
|
|
2816
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2817
|
+
style: {
|
|
2818
|
+
width: `${percent * 100}%`
|
|
2819
|
+
},
|
|
2820
|
+
className: "p-slider-track-fill"
|
|
2821
|
+
}),
|
|
2822
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)($17f80f062b7f107f$var$Thumb, {
|
|
2823
|
+
styles: {
|
|
2824
|
+
wrapper: styles?.thumb,
|
|
2825
|
+
inner: styles?.innerThumb
|
|
2826
|
+
},
|
|
2827
|
+
classNames: {
|
|
2828
|
+
wrapper: classNames?.thumb,
|
|
2829
|
+
inner: classNames?.innerThumb
|
|
2830
|
+
},
|
|
2831
|
+
state: state,
|
|
2832
|
+
trackRef: trackRef,
|
|
2833
|
+
index: 0,
|
|
2834
|
+
name: name
|
|
2835
|
+
})
|
|
2836
|
+
]
|
|
2837
|
+
})
|
|
2838
|
+
]
|
|
2839
|
+
});
|
|
2840
|
+
}
|
|
2841
|
+
function $17f80f062b7f107f$var$Thumb({ state: state, trackRef: trackRef, index: index, name: name, className: className, classNames: classNames, styles: styles, style: style }) {
|
|
2842
|
+
const inputRef = $hgUW1$useRef(null);
|
|
2843
|
+
const { thumbProps: thumbProps, inputProps: inputProps, isDragging: isDragging } = (0, $hgUW1$useSliderThumb)({
|
|
2844
|
+
index: index,
|
|
2845
|
+
trackRef: trackRef,
|
|
2846
|
+
inputRef: inputRef,
|
|
2847
|
+
name: name
|
|
2848
|
+
}, state);
|
|
2849
|
+
const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $hgUW1$useFocusRing)();
|
|
2850
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2851
|
+
"data-dragging": isDragging,
|
|
2852
|
+
"data-focus-visible": isFocusVisible,
|
|
2853
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-slider-thumb", className, classNames?.wrapper),
|
|
2854
|
+
style: {
|
|
2855
|
+
...style,
|
|
2856
|
+
...styles?.wrapper
|
|
2857
|
+
},
|
|
2858
|
+
...thumbProps,
|
|
2859
|
+
children: [
|
|
2860
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2861
|
+
style: styles?.inner,
|
|
2862
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-slider-thumb-inner", classNames?.inner)
|
|
2863
|
+
}),
|
|
2864
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$VisuallyHidden), {
|
|
2865
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
2866
|
+
ref: inputRef,
|
|
2867
|
+
...(0, $hgUW1$mergeProps)(inputProps, focusProps)
|
|
2868
|
+
})
|
|
2869
|
+
})
|
|
2870
|
+
]
|
|
2871
|
+
});
|
|
2694
2872
|
}
|
|
2695
2873
|
|
|
2696
2874
|
|
|
@@ -3238,7 +3416,7 @@ function $61ac9d13c14b7f5b$export$7dacb05d26466c3({ children: children }) {
|
|
|
3238
3416
|
...triggerProps
|
|
3239
3417
|
});
|
|
3240
3418
|
}
|
|
3241
|
-
function $61ac9d13c14b7f5b$export$d7e1f420b25549ff({ children: children, offset: offset = 12, placement: placement, style: style,
|
|
3419
|
+
function $61ac9d13c14b7f5b$export$d7e1f420b25549ff({ children: children, offset: offset = 12, placement: placement, style: style, className: className, ...props }) {
|
|
3242
3420
|
const ctx = $hgUW1$useContext($61ac9d13c14b7f5b$var$PopoverContext);
|
|
3243
3421
|
if (!ctx) throw "PopoverContent must be used withing a Popover component";
|
|
3244
3422
|
if (!ctx.overlayState?.isOpen) return null;
|
|
@@ -3253,7 +3431,6 @@ function $61ac9d13c14b7f5b$export$d7e1f420b25549ff({ children: children, offset:
|
|
|
3253
3431
|
"data-radius": "md",
|
|
3254
3432
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, "p-popover-content"),
|
|
3255
3433
|
style: {
|
|
3256
|
-
width: width,
|
|
3257
3434
|
...style
|
|
3258
3435
|
},
|
|
3259
3436
|
children: children
|
|
@@ -3372,5 +3549,510 @@ const $31aad62a65b342bc$export$a79147a60006308c = (0, $hgUW1$Item);
|
|
|
3372
3549
|
|
|
3373
3550
|
|
|
3374
3551
|
|
|
3375
|
-
|
|
3552
|
+
|
|
3553
|
+
|
|
3554
|
+
|
|
3555
|
+
|
|
3556
|
+
|
|
3557
|
+
|
|
3558
|
+
|
|
3559
|
+
|
|
3560
|
+
function $b925f0cf89a3187d$export$9feb1bc2e5f1ccb3({ onChange: onChange, color: colorProp }) {
|
|
3561
|
+
const [colorSpace, setColorSpace] = $hgUW1$useState("hex");
|
|
3562
|
+
const [color, setColor] = (0, $fda09bbc0161c751$export$40bfa8c7b0832715)(colorProp, (0, $hgUW1$parseColor)("#BB66CC").toFormat("hsla"), onChange);
|
|
3563
|
+
function handleChange(color) {
|
|
3564
|
+
setColor(color);
|
|
3565
|
+
onChange?.(color);
|
|
3566
|
+
}
|
|
3567
|
+
function setAlpha(alpha) {
|
|
3568
|
+
if (isNaN(alpha)) return;
|
|
3569
|
+
console.log(alpha);
|
|
3570
|
+
console.log(color);
|
|
3571
|
+
const newColor = color.withChannelValue("alpha", alpha);
|
|
3572
|
+
setColor(newColor);
|
|
3573
|
+
console.log(newColor);
|
|
3574
|
+
}
|
|
3575
|
+
const [h, s, l] = color.getColorChannels();
|
|
3576
|
+
const rgbaColor = color.toFormat("rgba");
|
|
3577
|
+
const [r, g, b] = rgbaColor.getColorChannels();
|
|
3578
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3579
|
+
stack: true,
|
|
3580
|
+
style: {
|
|
3581
|
+
width: 240
|
|
3582
|
+
},
|
|
3583
|
+
children: [
|
|
3584
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $d03055b0909e9e3a$export$b2103f68a961418e), {
|
|
3585
|
+
onChange: handleChange,
|
|
3586
|
+
onChangeEnd: handleChange,
|
|
3587
|
+
xChannel: s,
|
|
3588
|
+
yChannel: l,
|
|
3589
|
+
value: color ?? (0, $hgUW1$parseColor)("hsl(219, 79%, 66%)"),
|
|
3590
|
+
style: {
|
|
3591
|
+
width: "100%",
|
|
3592
|
+
height: 140
|
|
3593
|
+
}
|
|
3594
|
+
}),
|
|
3595
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3596
|
+
stack: true,
|
|
3597
|
+
style: {
|
|
3598
|
+
padding: 8
|
|
3599
|
+
},
|
|
3600
|
+
children: [
|
|
3601
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3602
|
+
stack: true,
|
|
3603
|
+
gap: "2xs",
|
|
3604
|
+
children: [
|
|
3605
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $216a62c521cf5bbd$export$44fd664bcca5b6fb), {
|
|
3606
|
+
value: color,
|
|
3607
|
+
onChange: handleChange,
|
|
3608
|
+
onChangeEnd: handleChange,
|
|
3609
|
+
channel: h
|
|
3610
|
+
}),
|
|
3611
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $216a62c521cf5bbd$export$44fd664bcca5b6fb), {
|
|
3612
|
+
value: color,
|
|
3613
|
+
onChange: handleChange,
|
|
3614
|
+
onChangeEnd: handleChange,
|
|
3615
|
+
channel: "alpha"
|
|
3616
|
+
})
|
|
3617
|
+
]
|
|
3618
|
+
}),
|
|
3619
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3620
|
+
stack: true,
|
|
3621
|
+
children: [
|
|
3622
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3623
|
+
style: {
|
|
3624
|
+
width: "100%"
|
|
3625
|
+
},
|
|
3626
|
+
gap: "3xs",
|
|
3627
|
+
children: [
|
|
3628
|
+
colorSpace === "hex" && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $41cc567ab0625f8f$export$eef1e68107c58ef2), {
|
|
3629
|
+
style: {
|
|
3630
|
+
gap: 3
|
|
3631
|
+
},
|
|
3632
|
+
compact: true,
|
|
3633
|
+
children: [
|
|
3634
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2abac2409e7cef4a$export$b865d4358897bb17), {
|
|
3635
|
+
value: color,
|
|
3636
|
+
onChange: handleChange,
|
|
3637
|
+
size: "sm",
|
|
3638
|
+
style: {
|
|
3639
|
+
width: "60%"
|
|
3640
|
+
},
|
|
3641
|
+
appearance: "filled",
|
|
3642
|
+
placeholder: "Add a color"
|
|
3643
|
+
}),
|
|
3644
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3645
|
+
onChange: (n)=>setAlpha(n),
|
|
3646
|
+
maxValue: 1,
|
|
3647
|
+
formatOptions: {
|
|
3648
|
+
style: "percent",
|
|
3649
|
+
maximumFractionDigits: 0
|
|
3650
|
+
},
|
|
3651
|
+
size: "sm",
|
|
3652
|
+
value: color.getChannelValue("alpha"),
|
|
3653
|
+
style: {
|
|
3654
|
+
width: "40%"
|
|
3655
|
+
},
|
|
3656
|
+
appearance: "filled"
|
|
3657
|
+
})
|
|
3658
|
+
]
|
|
3659
|
+
}),
|
|
3660
|
+
[
|
|
3661
|
+
"rgb",
|
|
3662
|
+
"hsl"
|
|
3663
|
+
].includes(colorSpace) && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $41cc567ab0625f8f$export$eef1e68107c58ef2), {
|
|
3664
|
+
style: {
|
|
3665
|
+
gap: 3
|
|
3666
|
+
},
|
|
3667
|
+
compact: true,
|
|
3668
|
+
children: [
|
|
3669
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3670
|
+
value: colorSpace === "rgb" ? rgbaColor.getChannelValue(r) : color.getChannelValue(h),
|
|
3671
|
+
appearance: "filled",
|
|
3672
|
+
size: "sm"
|
|
3673
|
+
}),
|
|
3674
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3675
|
+
value: colorSpace === "rgb" ? rgbaColor.getChannelValue(g) : color.getChannelValue(s),
|
|
3676
|
+
appearance: "filled",
|
|
3677
|
+
size: "sm"
|
|
3678
|
+
}),
|
|
3679
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3680
|
+
value: colorSpace === "rgb" ? rgbaColor.getChannelValue(b) : color.getChannelValue(l),
|
|
3681
|
+
appearance: "filled",
|
|
3682
|
+
size: "sm"
|
|
3683
|
+
}),
|
|
3684
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3685
|
+
formatOptions: {
|
|
3686
|
+
style: "percent",
|
|
3687
|
+
maximumFractionDigits: 0
|
|
3688
|
+
},
|
|
3689
|
+
value: colorSpace === "rgb" ? rgbaColor.getChannelValue("alpha") : color.getChannelValue("alpha"),
|
|
3690
|
+
appearance: "filled",
|
|
3691
|
+
size: "sm"
|
|
3692
|
+
})
|
|
3693
|
+
]
|
|
3694
|
+
}),
|
|
3695
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $9f79d30a629e2c71$export$ef9b1a59e592288f), {
|
|
3696
|
+
style: {
|
|
3697
|
+
width: "60%"
|
|
3698
|
+
},
|
|
3699
|
+
valueKey: "id",
|
|
3700
|
+
onChange: (v)=>setColorSpace(v.target.value ?? colorSpace),
|
|
3701
|
+
showSelectionIndicator: false,
|
|
3702
|
+
value: colorSpace,
|
|
3703
|
+
size: "sm",
|
|
3704
|
+
appearance: "filled",
|
|
3705
|
+
items: [
|
|
3706
|
+
"hex",
|
|
3707
|
+
"rgb",
|
|
3708
|
+
"hsl"
|
|
3709
|
+
].map((o)=>({
|
|
3710
|
+
label: o.toUpperCase(),
|
|
3711
|
+
id: o
|
|
3712
|
+
}))
|
|
3713
|
+
})
|
|
3714
|
+
]
|
|
3715
|
+
}),
|
|
3716
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $1a0bc09c6bea5bcc$export$1ff3c3f08ae963c0), {
|
|
3717
|
+
color: "gray"
|
|
3718
|
+
}),
|
|
3719
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3720
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a364ffae99b57fd7$export$b46792416e3d8515), {
|
|
3721
|
+
styles: {
|
|
3722
|
+
wrapper: {
|
|
3723
|
+
gap: 6
|
|
3724
|
+
},
|
|
3725
|
+
swatch: {
|
|
3726
|
+
borderRadius: 5
|
|
3727
|
+
}
|
|
3728
|
+
},
|
|
3729
|
+
onChange: handleChange,
|
|
3730
|
+
colors: [
|
|
3731
|
+
"#000000",
|
|
3732
|
+
"#333333",
|
|
3733
|
+
"#555555",
|
|
3734
|
+
"#777777",
|
|
3735
|
+
"#999999",
|
|
3736
|
+
"#bbbbbb",
|
|
3737
|
+
"#dddddd",
|
|
3738
|
+
"#ffffff",
|
|
3739
|
+
"#4455BB",
|
|
3740
|
+
"#1199EE",
|
|
3741
|
+
"#55CCFF",
|
|
3742
|
+
"#22CCDD",
|
|
3743
|
+
"#22AA99",
|
|
3744
|
+
"#66BB66",
|
|
3745
|
+
"#99CC66",
|
|
3746
|
+
"#CCDD33",
|
|
3747
|
+
"#7755CC",
|
|
3748
|
+
"#BB66CC",
|
|
3749
|
+
"#FF88AA",
|
|
3750
|
+
"#EE4444",
|
|
3751
|
+
"#FF7744",
|
|
3752
|
+
"#FFAA22",
|
|
3753
|
+
"#FFCC66",
|
|
3754
|
+
"#FFEE66"
|
|
3755
|
+
].map((color)=>({
|
|
3756
|
+
label: color,
|
|
3757
|
+
color: (0, $hgUW1$parseColor)(color).toString("hsl"),
|
|
3758
|
+
key: color
|
|
3759
|
+
}))
|
|
3760
|
+
})
|
|
3761
|
+
})
|
|
3762
|
+
]
|
|
3763
|
+
})
|
|
3764
|
+
]
|
|
3765
|
+
})
|
|
3766
|
+
]
|
|
3767
|
+
});
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
|
|
3771
|
+
|
|
3772
|
+
|
|
3773
|
+
|
|
3774
|
+
|
|
3775
|
+
|
|
3776
|
+
|
|
3777
|
+
|
|
3778
|
+
function $d03055b0909e9e3a$export$b2103f68a961418e({ className: className, classNames: classNames, style: style, styles: styles, radius: radius, ...props }) {
|
|
3779
|
+
const inputXRef = $hgUW1$useRef(null);
|
|
3780
|
+
const inputYRef = $hgUW1$useRef(null);
|
|
3781
|
+
const containerRef = $hgUW1$useRef(null);
|
|
3782
|
+
const state = (0, $hgUW1$useColorAreaState)(props);
|
|
3783
|
+
const { colorAreaProps: colorAreaProps, xInputProps: xInputProps, yInputProps: yInputProps, thumbProps: thumbProps } = (0, $hgUW1$useColorArea)({
|
|
3784
|
+
...props,
|
|
3785
|
+
inputXRef: inputXRef,
|
|
3786
|
+
inputYRef: inputYRef,
|
|
3787
|
+
containerRef: containerRef
|
|
3788
|
+
}, state);
|
|
3789
|
+
const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $hgUW1$useFocusRing)();
|
|
3790
|
+
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
3791
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3792
|
+
...colorAreaProps,
|
|
3793
|
+
ref: containerRef,
|
|
3794
|
+
style: {
|
|
3795
|
+
...colorAreaProps.style,
|
|
3796
|
+
...styles?.wrapper,
|
|
3797
|
+
...style
|
|
3798
|
+
},
|
|
3799
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-color-area", className, classNames?.wrapper),
|
|
3800
|
+
"data-disabled": props.isDisabled,
|
|
3801
|
+
"data-radius": radius ?? theme?.radius ?? "lg",
|
|
3802
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3803
|
+
...thumbProps,
|
|
3804
|
+
style: {
|
|
3805
|
+
...thumbProps.style,
|
|
3806
|
+
...styles?.thumb
|
|
3807
|
+
},
|
|
3808
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-color-area-thumb", classNames?.thumb),
|
|
3809
|
+
"data-focus-visible": isFocusVisible,
|
|
3810
|
+
"data-color": state.getDisplayColor().toString("css"),
|
|
3811
|
+
children: [
|
|
3812
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
3813
|
+
...xInputProps,
|
|
3814
|
+
ref: inputXRef,
|
|
3815
|
+
...focusProps
|
|
3816
|
+
}),
|
|
3817
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
3818
|
+
...yInputProps,
|
|
3819
|
+
ref: inputYRef,
|
|
3820
|
+
...focusProps
|
|
3821
|
+
})
|
|
3822
|
+
]
|
|
3823
|
+
})
|
|
3824
|
+
});
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
|
|
3828
|
+
|
|
3829
|
+
|
|
3830
|
+
|
|
3831
|
+
|
|
3832
|
+
|
|
3833
|
+
|
|
3834
|
+
function $2abac2409e7cef4a$export$b865d4358897bb17({ label: label, description: description, className: className, classNames: classNames, style: style, styles: styles, ...props }) {
|
|
3835
|
+
const state = (0, $hgUW1$useColorFieldState)(props);
|
|
3836
|
+
const inputRef = $hgUW1$useRef(null);
|
|
3837
|
+
const { inputProps: inputProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $hgUW1$useColorField)({
|
|
3838
|
+
...props,
|
|
3839
|
+
"aria-label": props["aria-label"] ?? "color-field"
|
|
3840
|
+
}, state, inputRef);
|
|
3841
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
|
|
3842
|
+
description: description,
|
|
3843
|
+
label: label,
|
|
3844
|
+
style: style,
|
|
3845
|
+
classNames: classNames,
|
|
3846
|
+
className: className,
|
|
3847
|
+
styles: styles,
|
|
3848
|
+
labelProps: {
|
|
3849
|
+
...labelProps
|
|
3850
|
+
},
|
|
3851
|
+
descriptionProps: {
|
|
3852
|
+
...descriptionProps
|
|
3853
|
+
},
|
|
3854
|
+
errorMessageProps: {
|
|
3855
|
+
...errorMessageProps
|
|
3856
|
+
},
|
|
3857
|
+
...props,
|
|
3858
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
3859
|
+
style: styles?.input,
|
|
3860
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(classNames?.input, "p-text-input-el"),
|
|
3861
|
+
type: "text",
|
|
3862
|
+
ref: inputRef,
|
|
3863
|
+
...inputProps
|
|
3864
|
+
})
|
|
3865
|
+
});
|
|
3866
|
+
}
|
|
3867
|
+
|
|
3868
|
+
|
|
3869
|
+
|
|
3870
|
+
|
|
3871
|
+
|
|
3872
|
+
|
|
3873
|
+
|
|
3874
|
+
|
|
3875
|
+
|
|
3876
|
+
|
|
3877
|
+
|
|
3878
|
+
function $a364ffae99b57fd7$export$b46792416e3d8515({ colors: colors, items: items, children: children, radius: radius, size: size, onChange: onChange, selectionMode: selectionMode = "single", className: className, classNames: classNames, style: style, styles: styles, ...props }) {
|
|
3879
|
+
items = colors;
|
|
3880
|
+
children = (item)=>/*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$var$Color, {
|
|
3881
|
+
textValue: item.color,
|
|
3882
|
+
color: (0, $hgUW1$parseColor)(item.color)
|
|
3883
|
+
}, item.color);
|
|
3884
|
+
const listProps = {
|
|
3885
|
+
...props,
|
|
3886
|
+
items: items,
|
|
3887
|
+
children: children,
|
|
3888
|
+
selectionMode: selectionMode,
|
|
3889
|
+
["aria-label"]: "color swatch picker",
|
|
3890
|
+
onSelectionChange: (keys)=>{
|
|
3891
|
+
const keysToArray = [
|
|
3892
|
+
...keys
|
|
3893
|
+
];
|
|
3894
|
+
onChange?.((0, $hgUW1$parseColor)(keysToArray[0]));
|
|
3895
|
+
props.onSelectionChange?.(keys);
|
|
3896
|
+
}
|
|
3897
|
+
};
|
|
3898
|
+
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
3899
|
+
const wrapperRef = $hgUW1$useRef(null);
|
|
3900
|
+
const listState = (0, $hgUW1$useListState)(listProps);
|
|
3901
|
+
const { listBoxProps: listBoxProps } = (0, $hgUW1$useListBox)(listProps, listState, wrapperRef);
|
|
3902
|
+
const _colors = [
|
|
3903
|
+
...listState.collection
|
|
3904
|
+
];
|
|
3905
|
+
radius = radius ?? theme?.radius ?? "md";
|
|
3906
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$var$SwatchProvider, {
|
|
3907
|
+
colors: colors,
|
|
3908
|
+
radius: radius,
|
|
3909
|
+
size: size,
|
|
3910
|
+
...props,
|
|
3911
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3912
|
+
style: {
|
|
3913
|
+
...style,
|
|
3914
|
+
...styles?.wrapper
|
|
3915
|
+
},
|
|
3916
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, classNames?.wrapper),
|
|
3917
|
+
wrap: "wrap",
|
|
3918
|
+
...listBoxProps,
|
|
3919
|
+
ref: wrapperRef,
|
|
3920
|
+
children: _colors.map((color, index)=>/*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$export$47ce3797af1a0c57, {
|
|
3921
|
+
className: classNames?.swatch,
|
|
3922
|
+
style: styles?.swatch,
|
|
3923
|
+
state: listState,
|
|
3924
|
+
item: color
|
|
3925
|
+
}, index))
|
|
3926
|
+
})
|
|
3927
|
+
});
|
|
3928
|
+
}
|
|
3929
|
+
function $a364ffae99b57fd7$export$47ce3797af1a0c57({ item: item, state: state, style: style, className: className }) {
|
|
3930
|
+
const ref = $hgUW1$useRef(null);
|
|
3931
|
+
const { optionProps: optionProps, isDisabled: isDisabled, isFocusVisible: isFocusVisible, isFocused: isFocused, isPressed: isPressed, isSelected: isSelected } = (0, $hgUW1$useOption)({
|
|
3932
|
+
key: item.key
|
|
3933
|
+
}, state, ref);
|
|
3934
|
+
const color = item.props.color;
|
|
3935
|
+
const ctx = $a364ffae99b57fd7$var$useSwatchPickerContext();
|
|
3936
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$var$ColorSwatch, {
|
|
3937
|
+
className: className,
|
|
3938
|
+
style: style,
|
|
3939
|
+
color: color,
|
|
3940
|
+
_ref: ref,
|
|
3941
|
+
"data-disabled": isDisabled,
|
|
3942
|
+
"data-selected": isSelected,
|
|
3943
|
+
"data-focused": isFocused,
|
|
3944
|
+
"data-focus-visible": isFocusVisible,
|
|
3945
|
+
"data-pressed": isPressed,
|
|
3946
|
+
"data-radius": ctx.radius,
|
|
3947
|
+
"data-size": ctx.size,
|
|
3948
|
+
...optionProps
|
|
3949
|
+
});
|
|
3950
|
+
}
|
|
3951
|
+
function $a364ffae99b57fd7$var$ColorSwatch({ className: className, style: style, _ref: _ref, color: colorProp, ...props }) {
|
|
3952
|
+
const { colorSwatchProps: colorSwatchProps, color: color } = (0, $hgUW1$useColorSwatch)({
|
|
3953
|
+
...props,
|
|
3954
|
+
color: colorProp
|
|
3955
|
+
});
|
|
3956
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3957
|
+
...props,
|
|
3958
|
+
ref: _ref,
|
|
3959
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-color-swatch", className),
|
|
3960
|
+
...colorSwatchProps,
|
|
3961
|
+
style: {
|
|
3962
|
+
...colorSwatchProps.style,
|
|
3963
|
+
background: color.toString("css"),
|
|
3964
|
+
...style
|
|
3965
|
+
},
|
|
3966
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3967
|
+
className: "p-swatch-checkers"
|
|
3968
|
+
})
|
|
3969
|
+
});
|
|
3970
|
+
}
|
|
3971
|
+
const $a364ffae99b57fd7$var$SwatchPickerContext = /*#__PURE__*/ $hgUW1$createContext(null);
|
|
3972
|
+
function $a364ffae99b57fd7$var$SwatchProvider(props) {
|
|
3973
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$var$SwatchPickerContext.Provider, {
|
|
3974
|
+
value: props,
|
|
3975
|
+
children: props.children
|
|
3976
|
+
});
|
|
3977
|
+
}
|
|
3978
|
+
function $a364ffae99b57fd7$var$useSwatchPickerContext() {
|
|
3979
|
+
const ctx = $hgUW1$useContext($a364ffae99b57fd7$var$SwatchPickerContext);
|
|
3980
|
+
if (!ctx) throw new Error("SwatchPicker must be used within a SwatchPickerProvider");
|
|
3981
|
+
return ctx;
|
|
3982
|
+
}
|
|
3983
|
+
const $a364ffae99b57fd7$var$Color = (0, $hgUW1$Item);
|
|
3984
|
+
|
|
3985
|
+
|
|
3986
|
+
|
|
3987
|
+
|
|
3988
|
+
|
|
3989
|
+
|
|
3990
|
+
|
|
3991
|
+
|
|
3992
|
+
function $216a62c521cf5bbd$export$44fd664bcca5b6fb({ label: label, ...props }) {
|
|
3993
|
+
const { locale: locale } = (0, $hgUW1$useLocale)();
|
|
3994
|
+
const state = (0, $hgUW1$useColorSliderState)({
|
|
3995
|
+
...props,
|
|
3996
|
+
locale: locale
|
|
3997
|
+
});
|
|
3998
|
+
const trackRef = $hgUW1$useRef(null);
|
|
3999
|
+
const inputRef = $hgUW1$useRef(null);
|
|
4000
|
+
const { labelProps: labelProps, trackProps: trackProps, thumbProps: thumbProps, inputProps: inputProps } = (0, $hgUW1$useColorSlider)({
|
|
4001
|
+
...props,
|
|
4002
|
+
label: label,
|
|
4003
|
+
"aria-label": props["aria-label"] ?? "color-slider",
|
|
4004
|
+
inputRef: inputRef,
|
|
4005
|
+
trackRef: trackRef
|
|
4006
|
+
}, state);
|
|
4007
|
+
const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $hgUW1$useFocusRing)();
|
|
4008
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
|
|
4009
|
+
label: label,
|
|
4010
|
+
className: "p-color-slider",
|
|
4011
|
+
replaceDefaultControlWrapper: true,
|
|
4012
|
+
labelProps: labelProps,
|
|
4013
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4014
|
+
...trackProps,
|
|
4015
|
+
"data-focus-visible": isFocusVisible,
|
|
4016
|
+
"data-bg": trackProps.style?.background,
|
|
4017
|
+
className: "p-color-slider-track",
|
|
4018
|
+
ref: trackRef,
|
|
4019
|
+
style: {
|
|
4020
|
+
...trackProps.style,
|
|
4021
|
+
background: trackProps.style?.background
|
|
4022
|
+
},
|
|
4023
|
+
children: [
|
|
4024
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4025
|
+
className: "p-color-slider-checkers"
|
|
4026
|
+
}),
|
|
4027
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4028
|
+
className: "p-color-slider-thumb",
|
|
4029
|
+
...thumbProps,
|
|
4030
|
+
style: {
|
|
4031
|
+
...thumbProps.style,
|
|
4032
|
+
background: state.getDisplayColor().toString("css")
|
|
4033
|
+
},
|
|
4034
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
4035
|
+
ref: inputRef,
|
|
4036
|
+
...inputProps,
|
|
4037
|
+
...focusProps
|
|
4038
|
+
})
|
|
4039
|
+
})
|
|
4040
|
+
]
|
|
4041
|
+
})
|
|
4042
|
+
});
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
|
|
4046
|
+
|
|
4047
|
+
function $8f49d2e6ba434739$export$6e865ea70d7724f(color) {
|
|
4048
|
+
// TODO: add support for rgba colors
|
|
4049
|
+
return (0, $hgUW1$parseColor)(color);
|
|
4050
|
+
}
|
|
4051
|
+
|
|
4052
|
+
|
|
4053
|
+
|
|
4054
|
+
|
|
4055
|
+
|
|
4056
|
+
|
|
4057
|
+
export {$ee0105641360f1c1$export$e71c4d32a2263218 as Box, $11bc53f9891a6532$export$ef2184bd89960b14 as Grid, $11bc53f9891a6532$export$9eb849b9b922d396 as GridItem, $e2f278d76a00796a$export$f51f4c4ede09e011 as Flex, $ef10b8551376ecd8$export$f5b8910cec6cf069 as Input, $2e89c7375b40283e$export$6bf0cd3a219bbade as NumberInput, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6 as Text, $7794de767effca39$export$379139ebc1c2b235 as Textarea, $d95a2216d3ccf702$export$353f5b6fc5456de1 as Button, $e3f71af5eaf1c216$export$c25acd513dcc8062 as IconButton, $9230e224c5c26d9c$export$69b1032f2ecdf404 as ButtonGroup, $0ca204e719955216$export$48513f6b9f8ce62d as Checkbox, $1ab2e355b7aa4310$export$4aa08d5625cb8ead as CheckboxGroup, $3ba60d401cc6cc09$export$e44a253a59704894 as DropdownMenu, $618e53c42107439d$export$72b9695b8216309a as ComboBox, $e00a258f2e8c7774$export$d7b12c4107be0d61 as Radio, $e00a258f2e8c7774$export$a98f0dcb43a68a25 as RadioGroup, $e3711da06539818f$export$f8afaea2e9656b91 as RadioCard, $9f79d30a629e2c71$export$ef9b1a59e592288f as Select, $c35269c9504bc94d$export$5b7f4051a57920d0 as Option, $c35269c9504bc94d$export$5b7f4051a57920d0 as ListBoxItem, $c35269c9504bc94d$export$ef146090a6472d9e as Section, $c35269c9504bc94d$export$ef146090a6472d9e as ListBoxSection, $48aceaf3289ec325$export$7edc06cf1783b30f as DateInput, $11e1beb2a56c81ba$export$e1aef45b828286de as Calendar, $55bcc0e5986993c4$export$e2255cf6045e8d47 as Avatar, $f9f5a5b674d0a63f$export$1a5cb5295a7d2749 as FileUploader, $1a0bc09c6bea5bcc$export$1ff3c3f08ae963c0 as Separator, $2cc726bf01dd2fe8$export$b25a304ec7d746bb as Progress, $e1148cdb3a130657$export$3b0d6d7590275603 as Loader, $c700d45659d35204$export$3288d34c523a1192 as Tag, $fac55dfefd316398$export$b5d5cf8927ab7262 as Switch, $17f80f062b7f107f$export$472062a354075cee as Slider, $62ecff109eaa29fb$export$50e381fea3a45244 as IconTray, $6bbafdf52af7a191$export$ea98c603db73aee7 as Sticker, $28ce03a907630a4d$export$b2539bed5023c21c as Tabs, $28ce03a907630a4d$export$6d08773d2e66f8f2 as Tab, $18afd8c09c9f3065$export$54ec01a60f47d33d as Table, $727b3a4d9b39464f$export$e6a97ba2cae5bb94 as Timeline, $4bad2c10a2b6e638$export$2b77a92f1a5ad772 as Modal, $4bad2c10a2b6e638$export$33ffd74ebf07f060 as useModal, $41cc567ab0625f8f$export$eef1e68107c58ef2 as Space, $aca304249f917497$export$39299b56cfd4e361 as TagInput, $61ac9d13c14b7f5b$export$5b6b19405a83ff9d as Popover, $61ac9d13c14b7f5b$export$d7e1f420b25549ff as PopoverContent, $61ac9d13c14b7f5b$export$7dacb05d26466c3 as PopoverTrigger, $31aad62a65b342bc$export$67ea30858aaf75e3 as TagGroup, $31aad62a65b342bc$export$a79147a60006308c as TagGroupItem, $5fc28f26e128d5c0$export$d8964aec282183a3 as ThemeProvider, $5fc28f26e128d5c0$export$93d4e7f90805808f as useTheme, $d03055b0909e9e3a$export$b2103f68a961418e as ColorArea, $2abac2409e7cef4a$export$b865d4358897bb17 as ColorField, $b925f0cf89a3187d$export$9feb1bc2e5f1ccb3 as ColorPicker, $216a62c521cf5bbd$export$44fd664bcca5b6fb as ColorSlider, $a364ffae99b57fd7$export$b46792416e3d8515 as ColorSwatchPicker};
|
|
3376
4058
|
//# sourceMappingURL=module.js.map
|