@parrot-co/parrot-ui 0.1.7 → 0.1.9
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 +985 -309
- package/dist/main.js.map +1 -1
- package/dist/module.js +977 -309
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +102 -41
- package/dist/types.d.ts.map +1 -1
- package/package.json +24 -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,14 +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
|
-
}
|
|
465
|
-
$
|
|
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
|
+
}
|
|
466
497
|
|
|
467
498
|
|
|
468
499
|
|
|
@@ -590,7 +621,7 @@ const $d95a2216d3ccf702$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
590
621
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
591
622
|
const buttonGroupProps = (0, $9230e224c5c26d9c$export$749e21be8b14b968)();
|
|
592
623
|
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 } = {
|
|
624
|
+
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
625
|
...buttonGroupProps,
|
|
595
626
|
...props
|
|
596
627
|
};
|
|
@@ -621,7 +652,10 @@ const $d95a2216d3ccf702$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
621
652
|
}
|
|
622
653
|
const Comp = as;
|
|
623
654
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)(Comp, {
|
|
624
|
-
style:
|
|
655
|
+
style: {
|
|
656
|
+
...style,
|
|
657
|
+
...styles?.base
|
|
658
|
+
},
|
|
625
659
|
"data-is-toggle": isToggle,
|
|
626
660
|
"data-pressed": isPressed,
|
|
627
661
|
"data-radius": radius,
|
|
@@ -633,20 +667,19 @@ const $d95a2216d3ccf702$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
633
667
|
"data-selected": state.isSelected,
|
|
634
668
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)((0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("size", size), className, "p-button", space.classNames),
|
|
635
669
|
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(ref, buttonRef),
|
|
636
|
-
form:
|
|
670
|
+
form: form,
|
|
637
671
|
...buttonProps,
|
|
638
672
|
children: [
|
|
639
673
|
prepend,
|
|
640
|
-
|
|
641
|
-
style: {
|
|
642
|
-
padding: isIconButton ? undefined : "0 6px",
|
|
643
|
-
lineHeight: 0
|
|
644
|
-
},
|
|
645
|
-
children: children
|
|
646
|
-
}),
|
|
674
|
+
children,
|
|
647
675
|
isLoading ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e1148cdb3a130657$export$3b0d6d7590275603), {
|
|
676
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
677
|
+
"p-button-loader",
|
|
678
|
+
classNames?.loader
|
|
679
|
+
]),
|
|
648
680
|
style: {
|
|
649
|
-
marginLeft: 8
|
|
681
|
+
marginLeft: 8,
|
|
682
|
+
...styles?.loader
|
|
650
683
|
},
|
|
651
684
|
color: "inherit",
|
|
652
685
|
size: "xs"
|
|
@@ -680,88 +713,73 @@ $e3f71af5eaf1c216$export$c25acd513dcc8062.displayName = "IconButton";
|
|
|
680
713
|
|
|
681
714
|
|
|
682
715
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
716
|
+
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 }) {
|
|
717
|
+
const ariaProps = {
|
|
718
|
+
...props,
|
|
719
|
+
maxValue: maxValue,
|
|
720
|
+
formatOptions: formatOptions,
|
|
721
|
+
minValue: minValue,
|
|
722
|
+
"aria-label": props["aria-label"] ?? "number input"
|
|
723
|
+
};
|
|
689
724
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
690
725
|
const internalInputRef = $hgUW1$useRef(null);
|
|
691
726
|
const { locale: locale } = (0, $hgUW1$useLocale)();
|
|
692
727
|
const state = (0, $hgUW1$useNumberFieldState)({
|
|
693
|
-
...
|
|
728
|
+
...ariaProps,
|
|
694
729
|
locale: locale
|
|
695
730
|
});
|
|
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
|
-
]
|
|
731
|
+
const { errorMessageProps: errorMessageProps, descriptionProps: descriptionProps, labelProps: labelProps, groupProps: groupProps, inputProps: inputProps, incrementButtonProps: incrementButtonProps, decrementButtonProps: decrementButtonProps } = (0, $hgUW1$useNumberField)(ariaProps, state, internalInputRef);
|
|
732
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
|
|
733
|
+
classNames: classNames,
|
|
734
|
+
color: color,
|
|
735
|
+
size: size,
|
|
736
|
+
labelProps: labelProps,
|
|
737
|
+
descriptionProps: descriptionProps,
|
|
738
|
+
errorMessageProps: errorMessageProps,
|
|
739
|
+
error: error,
|
|
740
|
+
label: label,
|
|
741
|
+
replaceDefaultControlWrapper: true,
|
|
742
|
+
...props,
|
|
743
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
744
|
+
gap: "4xs",
|
|
745
|
+
...groupProps,
|
|
746
|
+
className: "p-input-container",
|
|
747
|
+
children: [
|
|
748
|
+
showSteppers && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e3f71af5eaf1c216$export$c25acd513dcc8062), {
|
|
749
|
+
...decrementButtonProps,
|
|
750
|
+
radius: "md",
|
|
751
|
+
color: color,
|
|
752
|
+
variant: "outline",
|
|
753
|
+
size: size,
|
|
754
|
+
className: classNames?.decrement,
|
|
755
|
+
style: styles?.decrement,
|
|
756
|
+
children: decrementIcon
|
|
757
|
+
}),
|
|
758
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
759
|
+
style: styles?.input,
|
|
760
|
+
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(internalInputRef, inputRef),
|
|
761
|
+
placeholder: placeholder,
|
|
762
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(classNames?.input, "p-input-control", "space-item", space.classNames),
|
|
763
|
+
"data-appearance": appearance,
|
|
764
|
+
"data-has-left-addon": !!prepend,
|
|
765
|
+
"data-has-right-addon": !!append,
|
|
766
|
+
type: "text",
|
|
767
|
+
...inputProps
|
|
768
|
+
}),
|
|
769
|
+
showSteppers && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e3f71af5eaf1c216$export$c25acd513dcc8062), {
|
|
770
|
+
...incrementButtonProps,
|
|
771
|
+
radius: "md",
|
|
772
|
+
color: color,
|
|
773
|
+
variant: "outline",
|
|
774
|
+
size: size,
|
|
775
|
+
className: classNames?.increment,
|
|
776
|
+
style: styles?.increment,
|
|
777
|
+
children: incrementIcon
|
|
778
|
+
})
|
|
779
|
+
]
|
|
780
|
+
})
|
|
762
781
|
});
|
|
763
|
-
}
|
|
764
|
-
$2e89c7375b40283e$export$6bf0cd3a219bbade.displayName = "NumberInput";
|
|
782
|
+
}
|
|
765
783
|
|
|
766
784
|
|
|
767
785
|
|
|
@@ -769,10 +787,10 @@ $2e89c7375b40283e$export$6bf0cd3a219bbade.displayName = "NumberInput";
|
|
|
769
787
|
|
|
770
788
|
|
|
771
789
|
|
|
772
|
-
|
|
790
|
+
function $5e6f334f3e354c44$export$b28585a458fee016({ wrapperRef: wrapperRef, ...props }) {
|
|
773
791
|
const [showPassword, setShowPassword] = (0, $hgUW1$react).useState(false);
|
|
774
792
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ef10b8551376ecd8$export$f5b8910cec6cf069), {
|
|
775
|
-
|
|
793
|
+
wrapperRef: wrapperRef,
|
|
776
794
|
...props,
|
|
777
795
|
type: showPassword ? "text" : "password",
|
|
778
796
|
append: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e3f71af5eaf1c216$export$c25acd513dcc8062), {
|
|
@@ -784,8 +802,7 @@ const $5e6f334f3e354c44$export$b28585a458fee016 = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
784
802
|
})
|
|
785
803
|
})
|
|
786
804
|
});
|
|
787
|
-
}
|
|
788
|
-
$5e6f334f3e354c44$export$b28585a458fee016.displayName = "PasswordInput";
|
|
805
|
+
}
|
|
789
806
|
|
|
790
807
|
|
|
791
808
|
|
|
@@ -911,7 +928,7 @@ $1ab2e355b7aa4310$export$4aa08d5625cb8ead.displayName = "CheckboxGroup";
|
|
|
911
928
|
|
|
912
929
|
|
|
913
930
|
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;
|
|
931
|
+
const { appearance: appearance, size: size, shape: shape = "round", color: color, className: className, classNames: classNames, styles: styles, style: style, ...otherProps } = props;
|
|
915
932
|
// check if checkbox is rendered in a group context
|
|
916
933
|
const groupContext = (0, $hgUW1$react).useContext((0, $1ab2e355b7aa4310$export$f9c6924e160136d1));
|
|
917
934
|
const groupState = groupContext?.state;
|
|
@@ -935,7 +952,11 @@ const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
935
952
|
const resolvedAppearance = appearance || groupProps?.appearance || "outline";
|
|
936
953
|
const resolvedSize = size || groupProps?.size || "md";
|
|
937
954
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("label", {
|
|
938
|
-
|
|
955
|
+
style: {
|
|
956
|
+
...style,
|
|
957
|
+
...styles?.wrapper
|
|
958
|
+
},
|
|
959
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, "p-checkbox", classNames?.wrapper),
|
|
939
960
|
"data-disabled": inputProps?.disabled,
|
|
940
961
|
ref: ref,
|
|
941
962
|
children: [
|
|
@@ -948,9 +969,16 @@ const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
948
969
|
})
|
|
949
970
|
}),
|
|
950
971
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
972
|
+
style: {
|
|
973
|
+
...style,
|
|
974
|
+
...styles?.checkbox
|
|
975
|
+
},
|
|
951
976
|
"data-color": resolvedColor,
|
|
952
977
|
"data-radius": getRadius(),
|
|
953
|
-
className:
|
|
978
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
979
|
+
"p-fake-checkbox",
|
|
980
|
+
classNames?.checkbox
|
|
981
|
+
]),
|
|
954
982
|
"data-focused": isFocusVisible,
|
|
955
983
|
"aria-hidden": "true",
|
|
956
984
|
"data-checked": isSelected && !props.isIndeterminate,
|
|
@@ -959,6 +987,10 @@ const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
959
987
|
"data-appearance": resolvedAppearance,
|
|
960
988
|
children: [
|
|
961
989
|
isSelected && !props.isIndeterminate && /*#__PURE__*/ (0, $hgUW1$jsx)("svg", {
|
|
990
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
991
|
+
"p-checkbox-icon",
|
|
992
|
+
classNames?.icon
|
|
993
|
+
]),
|
|
962
994
|
stroke: "white",
|
|
963
995
|
width: "0.75rem",
|
|
964
996
|
height: "0.75rem",
|
|
@@ -975,6 +1007,10 @@ const $0ca204e719955216$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $hgUW1$react
|
|
|
975
1007
|
})
|
|
976
1008
|
}),
|
|
977
1009
|
props.isIndeterminate && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ee0105641360f1c1$export$e71c4d32a2263218), {
|
|
1010
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
1011
|
+
"p-checkbox-icon",
|
|
1012
|
+
classNames?.icon
|
|
1013
|
+
]),
|
|
978
1014
|
style: {
|
|
979
1015
|
background: "var(--color-12)",
|
|
980
1016
|
width: "70%",
|
|
@@ -1005,25 +1041,39 @@ $0ca204e719955216$export$48513f6b9f8ce62d.displayName = "checkbox";
|
|
|
1005
1041
|
|
|
1006
1042
|
|
|
1007
1043
|
|
|
1008
|
-
function $fc3eb9661261e42e$export$91527519cfe8e396({ state: state, children: children, popoverRef: popoverRef, ...props }) {
|
|
1044
|
+
function $fc3eb9661261e42e$export$91527519cfe8e396({ state: state, children: children, popoverRef: popoverRef, style: style, styles: styles, classNames: classNames, className: className, ...props }) {
|
|
1009
1045
|
const internalPopoverRef = $hgUW1$useRef(null);
|
|
1010
1046
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
1011
1047
|
const { popoverProps: popoverProps, underlayProps: underlayProps } = (0, $hgUW1$usePopover)({
|
|
1012
1048
|
...props,
|
|
1013
1049
|
popoverRef: internalPopoverRef
|
|
1014
1050
|
}, state);
|
|
1051
|
+
const { style: internalStyle, ...otherPopoverProps } = popoverProps;
|
|
1015
1052
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Overlay), {
|
|
1016
1053
|
children: [
|
|
1017
1054
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1018
1055
|
...underlayProps,
|
|
1019
|
-
|
|
1056
|
+
style: styles?.underlay,
|
|
1057
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
1058
|
+
"underlay",
|
|
1059
|
+
classNames?.underlay
|
|
1060
|
+
])
|
|
1020
1061
|
}),
|
|
1021
1062
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1022
1063
|
"data-color": theme?.color,
|
|
1023
1064
|
"data-radius": theme?.radius,
|
|
1024
|
-
...popoverProps,
|
|
1025
1065
|
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(popoverRef, internalPopoverRef),
|
|
1026
|
-
className:
|
|
1066
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
1067
|
+
"p-popover",
|
|
1068
|
+
className,
|
|
1069
|
+
classNames?.wrapper
|
|
1070
|
+
]),
|
|
1071
|
+
style: {
|
|
1072
|
+
...internalStyle,
|
|
1073
|
+
...style,
|
|
1074
|
+
...styles?.wrapper
|
|
1075
|
+
},
|
|
1076
|
+
...otherPopoverProps,
|
|
1027
1077
|
children: children
|
|
1028
1078
|
})
|
|
1029
1079
|
]
|
|
@@ -1277,30 +1327,38 @@ const $3ba60d401cc6cc09$export$e44a253a59704894 = {
|
|
|
1277
1327
|
|
|
1278
1328
|
|
|
1279
1329
|
|
|
1280
|
-
|
|
1330
|
+
const $c35269c9504bc94d$export$5b7f4051a57920d0 = (0, $hgUW1$Item);
|
|
1331
|
+
const $c35269c9504bc94d$export$ef146090a6472d9e = (0, $hgUW1$Section);
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
function $b71fd84ba612e4b0$export$3d7d0414f6db67e7({ children: children, renderOption: renderOption, valueKey: valueKey, sectionKey: sectionKey, renderSectionLabel: renderSectionLabel, labelKey: labelKey, items: items }) {
|
|
1281
1335
|
const hasChildren = $hgUW1$Children.count(children) > 0;
|
|
1282
1336
|
if (hasChildren) return children;
|
|
1283
1337
|
if (items) // eslint-disable-next-line react/display-name
|
|
1284
1338
|
return (item)=>{
|
|
1285
1339
|
const label = item?.[labelKey ?? "label"];
|
|
1286
|
-
const value = item?.[valueKey ?? "id"];
|
|
1340
|
+
const value = item?.[valueKey ?? "id" ?? "key" ?? "value"];
|
|
1287
1341
|
const sectionChildren = item?.[sectionKey ?? "children"] ?? [];
|
|
1288
|
-
if (item?.[sectionKey]) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $
|
|
1342
|
+
if (item?.[sectionKey]) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $c35269c9504bc94d$export$ef146090a6472d9e), {
|
|
1289
1343
|
items: sectionChildren,
|
|
1290
|
-
title:
|
|
1291
|
-
children: (item)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $
|
|
1344
|
+
title: renderSectionLabel?.(item),
|
|
1345
|
+
children: (item)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $c35269c9504bc94d$export$5b7f4051a57920d0), {
|
|
1292
1346
|
textValue: item?.[labelKey ?? "label"],
|
|
1293
|
-
children: item?.[labelKey ?? "label"]
|
|
1294
|
-
}, item?.[valueKey ?? "id"])
|
|
1347
|
+
children: renderOption?.(item) ?? item?.[labelKey ?? "label"]
|
|
1348
|
+
}, item?.[valueKey ?? "id" ?? "key" ?? "value"])
|
|
1295
1349
|
}, value);
|
|
1296
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $
|
|
1350
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $c35269c9504bc94d$export$5b7f4051a57920d0), {
|
|
1297
1351
|
textValue: label,
|
|
1298
1352
|
children: renderOption?.(item) ?? label
|
|
1299
|
-
},
|
|
1353
|
+
}, value);
|
|
1300
1354
|
};
|
|
1301
1355
|
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1356
|
+
function $b71fd84ba612e4b0$export$4c687b6f1150e71b(props) {
|
|
1357
|
+
const children = $hgUW1$useMemo(()=>{
|
|
1358
|
+
return $b71fd84ba612e4b0$export$3d7d0414f6db67e7(props);
|
|
1359
|
+
}, []);
|
|
1360
|
+
return children;
|
|
1361
|
+
}
|
|
1304
1362
|
|
|
1305
1363
|
|
|
1306
1364
|
|
|
@@ -1315,70 +1373,74 @@ function $db709eeca70b0d61$export$1e60abce570c2b01(props) {
|
|
|
1315
1373
|
});
|
|
1316
1374
|
}
|
|
1317
1375
|
function $db709eeca70b0d61$export$961f16f221737ce2() {
|
|
1318
|
-
const
|
|
1319
|
-
if (!
|
|
1320
|
-
return
|
|
1376
|
+
const ctx = $hgUW1$useContext($db709eeca70b0d61$var$ListBoxContext);
|
|
1377
|
+
if (!ctx) throw new Error("ListBox components must be rendered within the ListBoxProvider");
|
|
1378
|
+
return ctx;
|
|
1321
1379
|
}
|
|
1322
1380
|
|
|
1323
1381
|
|
|
1324
1382
|
|
|
1325
1383
|
|
|
1326
|
-
function $6ae005878b435ce8$export$41f133550aa26f48({ state: state, color: color, width: width = 300,
|
|
1384
|
+
function $6ae005878b435ce8$export$41f133550aa26f48({ state: state, color: color, width: width = 300, listBoxRef: listBoxRef, renderEmpty: renderEmpty, classNames: classNames, className: className, style: style, styles: styles, ...props }) {
|
|
1385
|
+
const children = (0, $b71fd84ba612e4b0$export$4c687b6f1150e71b)(props);
|
|
1327
1386
|
const internalState = (0, $hgUW1$useListState)({
|
|
1328
1387
|
...props,
|
|
1329
|
-
children:
|
|
1388
|
+
children: children
|
|
1330
1389
|
});
|
|
1331
1390
|
const listRef = $hgUW1$useRef(null);
|
|
1332
1391
|
const listState = state || internalState;
|
|
1333
|
-
const { listBoxProps: listBoxProps } = (0, $hgUW1$useListBox)(
|
|
1392
|
+
const { listBoxProps: listBoxProps } = (0, $hgUW1$useListBox)({
|
|
1393
|
+
...props,
|
|
1394
|
+
label: props.label ?? "Select an option"
|
|
1395
|
+
}, listState, listRef);
|
|
1334
1396
|
const options = [
|
|
1335
1397
|
...listState.collection
|
|
1336
1398
|
];
|
|
1337
1399
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
1400
|
+
function renderEmptyState() {
|
|
1401
|
+
return renderEmpty?.() ?? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
|
|
1402
|
+
color: "gray",
|
|
1403
|
+
variant: "lighter",
|
|
1404
|
+
children: "No options"
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1338
1407
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $db709eeca70b0d61$export$1e60abce570c2b01), {
|
|
1339
1408
|
...props,
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1409
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1410
|
+
as: "ul",
|
|
1411
|
+
stack: true,
|
|
1412
|
+
gap: "none",
|
|
1413
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-list-box-wrapper", classNames?.wrapper, className),
|
|
1414
|
+
ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(listRef, listBoxRef),
|
|
1415
|
+
"data-radius": "lg",
|
|
1416
|
+
"data-color": color ?? theme?.color,
|
|
1343
1417
|
style: {
|
|
1344
1418
|
width: width,
|
|
1345
|
-
|
|
1419
|
+
...style,
|
|
1420
|
+
...styles?.wrapper
|
|
1346
1421
|
},
|
|
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
|
-
})
|
|
1422
|
+
...listBoxProps,
|
|
1423
|
+
children: [
|
|
1424
|
+
options.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1425
|
+
justify: "center",
|
|
1426
|
+
align: "center",
|
|
1427
|
+
style: {
|
|
1428
|
+
height: 50
|
|
1429
|
+
},
|
|
1430
|
+
children: renderEmptyState()
|
|
1431
|
+
}),
|
|
1432
|
+
options.map((item)=>{
|
|
1433
|
+
return item.type === "section" ? /*#__PURE__*/ (0, $hgUW1$jsx)($6ae005878b435ce8$var$ListSection, {
|
|
1434
|
+
className: classNames?.section,
|
|
1435
|
+
section: item,
|
|
1436
|
+
state: listState
|
|
1437
|
+
}, item.key) : /*#__PURE__*/ (0, $hgUW1$jsx)($6ae005878b435ce8$var$ListOption, {
|
|
1438
|
+
className: classNames?.option,
|
|
1439
|
+
state: listState,
|
|
1440
|
+
item: item
|
|
1441
|
+
}, item.key);
|
|
1442
|
+
})
|
|
1443
|
+
]
|
|
1382
1444
|
})
|
|
1383
1445
|
});
|
|
1384
1446
|
}
|
|
@@ -1387,24 +1449,30 @@ function $6ae005878b435ce8$var$ListOption({ state: state, item: item }) {
|
|
|
1387
1449
|
const { optionProps: optionProps, isDisabled: isDisabled, isFocusVisible: isFocusVisible, isFocused: isFocused, isPressed: isPressed, isSelected: isSelected } = (0, $hgUW1$useOption)({
|
|
1388
1450
|
key: item.key
|
|
1389
1451
|
}, state, optionRef);
|
|
1390
|
-
const
|
|
1452
|
+
const { showSelectionIndicator: showSelectionIndicator = true, renderSelectionIndicator: renderSelectionIndicator } = (0, $db709eeca70b0d61$export$961f16f221737ce2)().props;
|
|
1453
|
+
const { className: className, classNames: classNames, style: style, styles: styles, color: color, textValue: textValue, title: title, ...otherProps } = item.props;
|
|
1391
1454
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
1392
|
-
|
|
1455
|
+
style: {
|
|
1456
|
+
...style,
|
|
1457
|
+
...styles?.wrapper
|
|
1458
|
+
},
|
|
1459
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, "p-list-option", classNames?.wrapper),
|
|
1393
1460
|
"data-disabled": isDisabled,
|
|
1394
1461
|
"data-focus-visible": isFocusVisible,
|
|
1395
1462
|
"data-focused": isFocused,
|
|
1396
1463
|
"data-pressed": isPressed,
|
|
1397
1464
|
"data-selected": isSelected,
|
|
1465
|
+
"data-color": color,
|
|
1398
1466
|
...optionProps,
|
|
1399
|
-
...
|
|
1400
|
-
"textValue"
|
|
1401
|
-
]),
|
|
1467
|
+
...otherProps,
|
|
1402
1468
|
ref: optionRef,
|
|
1469
|
+
"data-text-value": textValue,
|
|
1470
|
+
"data-title": title,
|
|
1403
1471
|
children: [
|
|
1404
1472
|
item.rendered,
|
|
1405
|
-
isSelected &&
|
|
1406
|
-
|
|
1407
|
-
})
|
|
1473
|
+
isSelected && showSelectionIndicator && (renderSelectionIndicator?.(item) ?? /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1474
|
+
children: "/"
|
|
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, 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
|
}
|
|
@@ -2013,20 +2086,6 @@ function $b57bc04886adb8b4$export$b4085f3d3ede4716(array, keys) {
|
|
|
2013
2086
|
}
|
|
2014
2087
|
|
|
2015
2088
|
|
|
2016
|
-
const $11e1beb2a56c81ba$var$monthsByIndex = [
|
|
2017
|
-
"January",
|
|
2018
|
-
"February",
|
|
2019
|
-
"March",
|
|
2020
|
-
"April",
|
|
2021
|
-
"May",
|
|
2022
|
-
"June",
|
|
2023
|
-
"July",
|
|
2024
|
-
"August",
|
|
2025
|
-
"Septemper",
|
|
2026
|
-
"October",
|
|
2027
|
-
"November",
|
|
2028
|
-
"December"
|
|
2029
|
-
];
|
|
2030
2089
|
const $11e1beb2a56c81ba$export$e1aef45b828286de = /*#__PURE__*/ $hgUW1$forwardRef(({ numberOfMonths: numberOfMonths = 1, color: color, ...props }, ref)=>{
|
|
2031
2090
|
const { locale: locale } = (0, $hgUW1$useLocale)();
|
|
2032
2091
|
const state = (0, $hgUW1$useCalendarState)({
|
|
@@ -2292,13 +2351,15 @@ $48aceaf3289ec325$export$7edc06cf1783b30f.displayName = "DateInput";
|
|
|
2292
2351
|
|
|
2293
2352
|
|
|
2294
2353
|
|
|
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 = "
|
|
2354
|
+
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
2355
|
const [imageError, setImageError] = $hgUW1$useState(false);
|
|
2297
2356
|
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
2298
2357
|
function getAvatarRadius() {
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2358
|
+
(0, $0ad0bc75b5eb16a6$export$1c4d39b152e0f791)("shape", "radius", shape);
|
|
2359
|
+
// TODO: remove this when we remove the deprecated shape prop
|
|
2360
|
+
if (shape === "circle" && !radius) radius = "full";
|
|
2361
|
+
if (shape === "square" && !radius) radius = "md";
|
|
2362
|
+
return theme?.avatarRadiusSize || radius;
|
|
2302
2363
|
}
|
|
2303
2364
|
const defaultColor = $hgUW1$useMemo(()=>{
|
|
2304
2365
|
const hash = (0, $0ad0bc75b5eb16a6$export$d41d9ab3de2def3d)(name || "");
|
|
@@ -2308,6 +2369,10 @@ const $55bcc0e5986993c4$export$e2255cf6045e8d47 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
2308
2369
|
]);
|
|
2309
2370
|
const renderContent = ()=>{
|
|
2310
2371
|
if (src && !imageError) return /*#__PURE__*/ (0, $hgUW1$jsx)("img", {
|
|
2372
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
2373
|
+
"avatar-img",
|
|
2374
|
+
classNames?.img
|
|
2375
|
+
]),
|
|
2311
2376
|
onLoad: ()=>setImageError(false),
|
|
2312
2377
|
onError: ()=>setImageError(true),
|
|
2313
2378
|
src: src,
|
|
@@ -2315,14 +2380,24 @@ const $55bcc0e5986993c4$export$e2255cf6045e8d47 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
2315
2380
|
});
|
|
2316
2381
|
if (imageError && !children) return fallback;
|
|
2317
2382
|
if (!src && !children && name) return /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2383
|
+
style: styles?.fallback,
|
|
2384
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
2385
|
+
"avatar-fallback",
|
|
2386
|
+
classNames?.fallback
|
|
2387
|
+
]),
|
|
2318
2388
|
children: name.charAt(0)
|
|
2319
2389
|
});
|
|
2320
2390
|
return children;
|
|
2321
2391
|
};
|
|
2322
2392
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2393
|
+
style: {
|
|
2394
|
+
...style,
|
|
2395
|
+
...styles?.base
|
|
2396
|
+
},
|
|
2323
2397
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
|
|
2324
2398
|
"p-avatar",
|
|
2325
|
-
className
|
|
2399
|
+
className,
|
|
2400
|
+
classNames?.base
|
|
2326
2401
|
]),
|
|
2327
2402
|
"data-radius": getAvatarRadius(),
|
|
2328
2403
|
"data-color": color ?? defaultColor,
|
|
@@ -2689,8 +2764,97 @@ $fac55dfefd316398$export$b5d5cf8927ab7262.displayName = "Switch";
|
|
|
2689
2764
|
|
|
2690
2765
|
|
|
2691
2766
|
|
|
2692
|
-
|
|
2693
|
-
|
|
2767
|
+
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
function $17f80f062b7f107f$export$472062a354075cee({ className: className, classNames: classNames, style: style, styles: styles, name: name, size: size = "sm", orientation: orientation = "horizontal", ...props }) {
|
|
2772
|
+
const trackRef = $hgUW1$useRef(null);
|
|
2773
|
+
const numberFormatter = (0, $hgUW1$useNumberFormatter)();
|
|
2774
|
+
const state = (0, $hgUW1$useSliderState)({
|
|
2775
|
+
...props,
|
|
2776
|
+
numberFormatter: numberFormatter
|
|
2777
|
+
});
|
|
2778
|
+
const { trackProps: trackProps, labelProps: labelProps } = (0, $hgUW1$useSlider)({
|
|
2779
|
+
...props,
|
|
2780
|
+
"aria-label": props["aria-label"] ?? "slider"
|
|
2781
|
+
}, state, trackRef);
|
|
2782
|
+
const percent = state.getThumbPercent(0);
|
|
2783
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2784
|
+
"data-size": size,
|
|
2785
|
+
style: {
|
|
2786
|
+
...style,
|
|
2787
|
+
...styles?.wrapper
|
|
2788
|
+
},
|
|
2789
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-slider", orientation, className, classNames?.wrapper),
|
|
2790
|
+
children: [
|
|
2791
|
+
props.label && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $eea734bbd8b9efff$export$2e2bcd8739ae039), {
|
|
2792
|
+
style: styles?.label,
|
|
2793
|
+
className: classNames?.label,
|
|
2794
|
+
...labelProps,
|
|
2795
|
+
children: props.label
|
|
2796
|
+
}),
|
|
2797
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2798
|
+
ref: trackRef,
|
|
2799
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-slider-track", classNames?.track),
|
|
2800
|
+
...trackProps,
|
|
2801
|
+
children: [
|
|
2802
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2803
|
+
style: {
|
|
2804
|
+
width: `${percent * 100}%`
|
|
2805
|
+
},
|
|
2806
|
+
className: "p-slider-track-fill"
|
|
2807
|
+
}),
|
|
2808
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)($17f80f062b7f107f$var$Thumb, {
|
|
2809
|
+
styles: {
|
|
2810
|
+
wrapper: styles?.thumb,
|
|
2811
|
+
inner: styles?.innerThumb
|
|
2812
|
+
},
|
|
2813
|
+
classNames: {
|
|
2814
|
+
wrapper: classNames?.thumb,
|
|
2815
|
+
inner: classNames?.innerThumb
|
|
2816
|
+
},
|
|
2817
|
+
state: state,
|
|
2818
|
+
trackRef: trackRef,
|
|
2819
|
+
index: 0,
|
|
2820
|
+
name: name
|
|
2821
|
+
})
|
|
2822
|
+
]
|
|
2823
|
+
})
|
|
2824
|
+
]
|
|
2825
|
+
});
|
|
2826
|
+
}
|
|
2827
|
+
function $17f80f062b7f107f$var$Thumb({ state: state, trackRef: trackRef, index: index, name: name, className: className, classNames: classNames, styles: styles, style: style }) {
|
|
2828
|
+
const inputRef = $hgUW1$useRef(null);
|
|
2829
|
+
const { thumbProps: thumbProps, inputProps: inputProps, isDragging: isDragging } = (0, $hgUW1$useSliderThumb)({
|
|
2830
|
+
index: index,
|
|
2831
|
+
trackRef: trackRef,
|
|
2832
|
+
inputRef: inputRef,
|
|
2833
|
+
name: name
|
|
2834
|
+
}, state);
|
|
2835
|
+
const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $hgUW1$useFocusRing)();
|
|
2836
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2837
|
+
"data-dragging": isDragging,
|
|
2838
|
+
"data-focus-visible": isFocusVisible,
|
|
2839
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-slider-thumb", className, classNames?.wrapper),
|
|
2840
|
+
style: {
|
|
2841
|
+
...style,
|
|
2842
|
+
...styles?.wrapper
|
|
2843
|
+
},
|
|
2844
|
+
...thumbProps,
|
|
2845
|
+
children: [
|
|
2846
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2847
|
+
style: styles?.inner,
|
|
2848
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-slider-thumb-inner", classNames?.inner)
|
|
2849
|
+
}),
|
|
2850
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$VisuallyHidden), {
|
|
2851
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
2852
|
+
ref: inputRef,
|
|
2853
|
+
...(0, $hgUW1$mergeProps)(inputProps, focusProps)
|
|
2854
|
+
})
|
|
2855
|
+
})
|
|
2856
|
+
]
|
|
2857
|
+
});
|
|
2694
2858
|
}
|
|
2695
2859
|
|
|
2696
2860
|
|
|
@@ -3238,7 +3402,7 @@ function $61ac9d13c14b7f5b$export$7dacb05d26466c3({ children: children }) {
|
|
|
3238
3402
|
...triggerProps
|
|
3239
3403
|
});
|
|
3240
3404
|
}
|
|
3241
|
-
function $61ac9d13c14b7f5b$export$d7e1f420b25549ff({ children: children, offset: offset = 12, placement: placement, style: style,
|
|
3405
|
+
function $61ac9d13c14b7f5b$export$d7e1f420b25549ff({ children: children, offset: offset = 12, placement: placement, style: style, className: className, ...props }) {
|
|
3242
3406
|
const ctx = $hgUW1$useContext($61ac9d13c14b7f5b$var$PopoverContext);
|
|
3243
3407
|
if (!ctx) throw "PopoverContent must be used withing a Popover component";
|
|
3244
3408
|
if (!ctx.overlayState?.isOpen) return null;
|
|
@@ -3253,7 +3417,6 @@ function $61ac9d13c14b7f5b$export$d7e1f420b25549ff({ children: children, offset:
|
|
|
3253
3417
|
"data-radius": "md",
|
|
3254
3418
|
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, "p-popover-content"),
|
|
3255
3419
|
style: {
|
|
3256
|
-
width: width,
|
|
3257
3420
|
...style
|
|
3258
3421
|
},
|
|
3259
3422
|
children: children
|
|
@@ -3372,5 +3535,510 @@ const $31aad62a65b342bc$export$a79147a60006308c = (0, $hgUW1$Item);
|
|
|
3372
3535
|
|
|
3373
3536
|
|
|
3374
3537
|
|
|
3375
|
-
|
|
3538
|
+
|
|
3539
|
+
|
|
3540
|
+
|
|
3541
|
+
|
|
3542
|
+
|
|
3543
|
+
|
|
3544
|
+
|
|
3545
|
+
|
|
3546
|
+
function $b925f0cf89a3187d$export$9feb1bc2e5f1ccb3({ onChange: onChange, color: colorProp }) {
|
|
3547
|
+
const [colorSpace, setColorSpace] = $hgUW1$useState("hex");
|
|
3548
|
+
const [color, setColor] = (0, $fda09bbc0161c751$export$40bfa8c7b0832715)(colorProp, (0, $hgUW1$parseColor)("#BB66CC").toFormat("hsla"), onChange);
|
|
3549
|
+
function handleChange(color) {
|
|
3550
|
+
setColor(color);
|
|
3551
|
+
onChange?.(color);
|
|
3552
|
+
}
|
|
3553
|
+
function setAlpha(alpha) {
|
|
3554
|
+
if (isNaN(alpha)) return;
|
|
3555
|
+
console.log(alpha);
|
|
3556
|
+
console.log(color);
|
|
3557
|
+
const newColor = color.withChannelValue("alpha", alpha);
|
|
3558
|
+
setColor(newColor);
|
|
3559
|
+
console.log(newColor);
|
|
3560
|
+
}
|
|
3561
|
+
const [h, s, l] = color.getColorChannels();
|
|
3562
|
+
const rgbaColor = color.toFormat("rgba");
|
|
3563
|
+
const [r, g, b] = rgbaColor.getColorChannels();
|
|
3564
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3565
|
+
stack: true,
|
|
3566
|
+
style: {
|
|
3567
|
+
width: 240
|
|
3568
|
+
},
|
|
3569
|
+
children: [
|
|
3570
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $d03055b0909e9e3a$export$b2103f68a961418e), {
|
|
3571
|
+
onChange: handleChange,
|
|
3572
|
+
onChangeEnd: handleChange,
|
|
3573
|
+
xChannel: s,
|
|
3574
|
+
yChannel: l,
|
|
3575
|
+
value: color ?? (0, $hgUW1$parseColor)("hsl(219, 79%, 66%)"),
|
|
3576
|
+
style: {
|
|
3577
|
+
width: "100%",
|
|
3578
|
+
height: 140
|
|
3579
|
+
}
|
|
3580
|
+
}),
|
|
3581
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3582
|
+
stack: true,
|
|
3583
|
+
style: {
|
|
3584
|
+
padding: 8
|
|
3585
|
+
},
|
|
3586
|
+
children: [
|
|
3587
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3588
|
+
stack: true,
|
|
3589
|
+
gap: "2xs",
|
|
3590
|
+
children: [
|
|
3591
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $216a62c521cf5bbd$export$44fd664bcca5b6fb), {
|
|
3592
|
+
value: color,
|
|
3593
|
+
onChange: handleChange,
|
|
3594
|
+
onChangeEnd: handleChange,
|
|
3595
|
+
channel: h
|
|
3596
|
+
}),
|
|
3597
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $216a62c521cf5bbd$export$44fd664bcca5b6fb), {
|
|
3598
|
+
value: color,
|
|
3599
|
+
onChange: handleChange,
|
|
3600
|
+
onChangeEnd: handleChange,
|
|
3601
|
+
channel: "alpha"
|
|
3602
|
+
})
|
|
3603
|
+
]
|
|
3604
|
+
}),
|
|
3605
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3606
|
+
stack: true,
|
|
3607
|
+
children: [
|
|
3608
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3609
|
+
style: {
|
|
3610
|
+
width: "100%"
|
|
3611
|
+
},
|
|
3612
|
+
gap: "3xs",
|
|
3613
|
+
children: [
|
|
3614
|
+
colorSpace === "hex" && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $41cc567ab0625f8f$export$eef1e68107c58ef2), {
|
|
3615
|
+
style: {
|
|
3616
|
+
gap: 3
|
|
3617
|
+
},
|
|
3618
|
+
compact: true,
|
|
3619
|
+
children: [
|
|
3620
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2abac2409e7cef4a$export$b865d4358897bb17), {
|
|
3621
|
+
value: color,
|
|
3622
|
+
onChange: handleChange,
|
|
3623
|
+
size: "sm",
|
|
3624
|
+
style: {
|
|
3625
|
+
width: "60%"
|
|
3626
|
+
},
|
|
3627
|
+
appearance: "filled",
|
|
3628
|
+
placeholder: "Add a color"
|
|
3629
|
+
}),
|
|
3630
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3631
|
+
onChange: (n)=>setAlpha(n),
|
|
3632
|
+
maxValue: 1,
|
|
3633
|
+
formatOptions: {
|
|
3634
|
+
style: "percent",
|
|
3635
|
+
maximumFractionDigits: 0
|
|
3636
|
+
},
|
|
3637
|
+
size: "sm",
|
|
3638
|
+
value: color.getChannelValue("alpha"),
|
|
3639
|
+
style: {
|
|
3640
|
+
width: "40%"
|
|
3641
|
+
},
|
|
3642
|
+
appearance: "filled"
|
|
3643
|
+
})
|
|
3644
|
+
]
|
|
3645
|
+
}),
|
|
3646
|
+
[
|
|
3647
|
+
"rgb",
|
|
3648
|
+
"hsl"
|
|
3649
|
+
].includes(colorSpace) && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $41cc567ab0625f8f$export$eef1e68107c58ef2), {
|
|
3650
|
+
style: {
|
|
3651
|
+
gap: 3
|
|
3652
|
+
},
|
|
3653
|
+
compact: true,
|
|
3654
|
+
children: [
|
|
3655
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3656
|
+
value: colorSpace === "rgb" ? rgbaColor.getChannelValue(r) : color.getChannelValue(h),
|
|
3657
|
+
appearance: "filled",
|
|
3658
|
+
size: "sm"
|
|
3659
|
+
}),
|
|
3660
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3661
|
+
value: colorSpace === "rgb" ? rgbaColor.getChannelValue(g) : color.getChannelValue(s),
|
|
3662
|
+
appearance: "filled",
|
|
3663
|
+
size: "sm"
|
|
3664
|
+
}),
|
|
3665
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3666
|
+
value: colorSpace === "rgb" ? rgbaColor.getChannelValue(b) : color.getChannelValue(l),
|
|
3667
|
+
appearance: "filled",
|
|
3668
|
+
size: "sm"
|
|
3669
|
+
}),
|
|
3670
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $2e89c7375b40283e$export$6bf0cd3a219bbade), {
|
|
3671
|
+
formatOptions: {
|
|
3672
|
+
style: "percent",
|
|
3673
|
+
maximumFractionDigits: 0
|
|
3674
|
+
},
|
|
3675
|
+
value: colorSpace === "rgb" ? rgbaColor.getChannelValue("alpha") : color.getChannelValue("alpha"),
|
|
3676
|
+
appearance: "filled",
|
|
3677
|
+
size: "sm"
|
|
3678
|
+
})
|
|
3679
|
+
]
|
|
3680
|
+
}),
|
|
3681
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $9f79d30a629e2c71$export$ef9b1a59e592288f), {
|
|
3682
|
+
style: {
|
|
3683
|
+
width: "60%"
|
|
3684
|
+
},
|
|
3685
|
+
valueKey: "id",
|
|
3686
|
+
onChange: (v)=>setColorSpace(v.target.value ?? colorSpace),
|
|
3687
|
+
showSelectionIndicator: false,
|
|
3688
|
+
value: colorSpace,
|
|
3689
|
+
size: "sm",
|
|
3690
|
+
appearance: "filled",
|
|
3691
|
+
items: [
|
|
3692
|
+
"hex",
|
|
3693
|
+
"rgb",
|
|
3694
|
+
"hsl"
|
|
3695
|
+
].map((o)=>({
|
|
3696
|
+
label: o.toUpperCase(),
|
|
3697
|
+
id: o
|
|
3698
|
+
}))
|
|
3699
|
+
})
|
|
3700
|
+
]
|
|
3701
|
+
}),
|
|
3702
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $1a0bc09c6bea5bcc$export$1ff3c3f08ae963c0), {
|
|
3703
|
+
color: "gray"
|
|
3704
|
+
}),
|
|
3705
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3706
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a364ffae99b57fd7$export$b46792416e3d8515), {
|
|
3707
|
+
styles: {
|
|
3708
|
+
wrapper: {
|
|
3709
|
+
gap: 6
|
|
3710
|
+
},
|
|
3711
|
+
swatch: {
|
|
3712
|
+
borderRadius: 5
|
|
3713
|
+
}
|
|
3714
|
+
},
|
|
3715
|
+
onChange: handleChange,
|
|
3716
|
+
colors: [
|
|
3717
|
+
"#000000",
|
|
3718
|
+
"#333333",
|
|
3719
|
+
"#555555",
|
|
3720
|
+
"#777777",
|
|
3721
|
+
"#999999",
|
|
3722
|
+
"#bbbbbb",
|
|
3723
|
+
"#dddddd",
|
|
3724
|
+
"#ffffff",
|
|
3725
|
+
"#4455BB",
|
|
3726
|
+
"#1199EE",
|
|
3727
|
+
"#55CCFF",
|
|
3728
|
+
"#22CCDD",
|
|
3729
|
+
"#22AA99",
|
|
3730
|
+
"#66BB66",
|
|
3731
|
+
"#99CC66",
|
|
3732
|
+
"#CCDD33",
|
|
3733
|
+
"#7755CC",
|
|
3734
|
+
"#BB66CC",
|
|
3735
|
+
"#FF88AA",
|
|
3736
|
+
"#EE4444",
|
|
3737
|
+
"#FF7744",
|
|
3738
|
+
"#FFAA22",
|
|
3739
|
+
"#FFCC66",
|
|
3740
|
+
"#FFEE66"
|
|
3741
|
+
].map((color)=>({
|
|
3742
|
+
label: color,
|
|
3743
|
+
color: (0, $hgUW1$parseColor)(color).toString("hsl"),
|
|
3744
|
+
key: color
|
|
3745
|
+
}))
|
|
3746
|
+
})
|
|
3747
|
+
})
|
|
3748
|
+
]
|
|
3749
|
+
})
|
|
3750
|
+
]
|
|
3751
|
+
})
|
|
3752
|
+
]
|
|
3753
|
+
});
|
|
3754
|
+
}
|
|
3755
|
+
|
|
3756
|
+
|
|
3757
|
+
|
|
3758
|
+
|
|
3759
|
+
|
|
3760
|
+
|
|
3761
|
+
|
|
3762
|
+
|
|
3763
|
+
|
|
3764
|
+
function $d03055b0909e9e3a$export$b2103f68a961418e({ className: className, classNames: classNames, style: style, styles: styles, radius: radius, ...props }) {
|
|
3765
|
+
const inputXRef = $hgUW1$useRef(null);
|
|
3766
|
+
const inputYRef = $hgUW1$useRef(null);
|
|
3767
|
+
const containerRef = $hgUW1$useRef(null);
|
|
3768
|
+
const state = (0, $hgUW1$useColorAreaState)(props);
|
|
3769
|
+
const { colorAreaProps: colorAreaProps, xInputProps: xInputProps, yInputProps: yInputProps, thumbProps: thumbProps } = (0, $hgUW1$useColorArea)({
|
|
3770
|
+
...props,
|
|
3771
|
+
inputXRef: inputXRef,
|
|
3772
|
+
inputYRef: inputYRef,
|
|
3773
|
+
containerRef: containerRef
|
|
3774
|
+
}, state);
|
|
3775
|
+
const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $hgUW1$useFocusRing)();
|
|
3776
|
+
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
3777
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3778
|
+
...colorAreaProps,
|
|
3779
|
+
ref: containerRef,
|
|
3780
|
+
style: {
|
|
3781
|
+
...colorAreaProps.style,
|
|
3782
|
+
...styles?.wrapper,
|
|
3783
|
+
...style
|
|
3784
|
+
},
|
|
3785
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-color-area", className, classNames?.wrapper),
|
|
3786
|
+
"data-disabled": props.isDisabled,
|
|
3787
|
+
"data-radius": radius ?? theme?.radius ?? "lg",
|
|
3788
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3789
|
+
...thumbProps,
|
|
3790
|
+
style: {
|
|
3791
|
+
...thumbProps.style,
|
|
3792
|
+
...styles?.thumb
|
|
3793
|
+
},
|
|
3794
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-color-area-thumb", classNames?.thumb),
|
|
3795
|
+
"data-focus-visible": isFocusVisible,
|
|
3796
|
+
"data-color": state.getDisplayColor().toString("css"),
|
|
3797
|
+
children: [
|
|
3798
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
3799
|
+
...xInputProps,
|
|
3800
|
+
ref: inputXRef,
|
|
3801
|
+
...focusProps
|
|
3802
|
+
}),
|
|
3803
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
3804
|
+
...yInputProps,
|
|
3805
|
+
ref: inputYRef,
|
|
3806
|
+
...focusProps
|
|
3807
|
+
})
|
|
3808
|
+
]
|
|
3809
|
+
})
|
|
3810
|
+
});
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
|
|
3814
|
+
|
|
3815
|
+
|
|
3816
|
+
|
|
3817
|
+
|
|
3818
|
+
|
|
3819
|
+
|
|
3820
|
+
function $2abac2409e7cef4a$export$b865d4358897bb17({ label: label, description: description, className: className, classNames: classNames, style: style, styles: styles, ...props }) {
|
|
3821
|
+
const state = (0, $hgUW1$useColorFieldState)(props);
|
|
3822
|
+
const inputRef = $hgUW1$useRef(null);
|
|
3823
|
+
const { inputProps: inputProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $hgUW1$useColorField)({
|
|
3824
|
+
...props,
|
|
3825
|
+
"aria-label": props["aria-label"] ?? "color-field"
|
|
3826
|
+
}, state, inputRef);
|
|
3827
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
|
|
3828
|
+
description: description,
|
|
3829
|
+
label: label,
|
|
3830
|
+
style: style,
|
|
3831
|
+
classNames: classNames,
|
|
3832
|
+
className: className,
|
|
3833
|
+
styles: styles,
|
|
3834
|
+
labelProps: {
|
|
3835
|
+
...labelProps
|
|
3836
|
+
},
|
|
3837
|
+
descriptionProps: {
|
|
3838
|
+
...descriptionProps
|
|
3839
|
+
},
|
|
3840
|
+
errorMessageProps: {
|
|
3841
|
+
...errorMessageProps
|
|
3842
|
+
},
|
|
3843
|
+
...props,
|
|
3844
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
3845
|
+
style: styles?.input,
|
|
3846
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(classNames?.input, "p-text-input-el"),
|
|
3847
|
+
type: "text",
|
|
3848
|
+
ref: inputRef,
|
|
3849
|
+
...inputProps
|
|
3850
|
+
})
|
|
3851
|
+
});
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
|
|
3855
|
+
|
|
3856
|
+
|
|
3857
|
+
|
|
3858
|
+
|
|
3859
|
+
|
|
3860
|
+
|
|
3861
|
+
|
|
3862
|
+
|
|
3863
|
+
|
|
3864
|
+
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 }) {
|
|
3865
|
+
items = colors;
|
|
3866
|
+
children = (item)=>/*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$var$Color, {
|
|
3867
|
+
textValue: item.color,
|
|
3868
|
+
color: (0, $hgUW1$parseColor)(item.color)
|
|
3869
|
+
}, item.color);
|
|
3870
|
+
const listProps = {
|
|
3871
|
+
...props,
|
|
3872
|
+
items: items,
|
|
3873
|
+
children: children,
|
|
3874
|
+
selectionMode: selectionMode,
|
|
3875
|
+
["aria-label"]: "color swatch picker",
|
|
3876
|
+
onSelectionChange: (keys)=>{
|
|
3877
|
+
const keysToArray = [
|
|
3878
|
+
...keys
|
|
3879
|
+
];
|
|
3880
|
+
onChange?.((0, $hgUW1$parseColor)(keysToArray[0]));
|
|
3881
|
+
props.onSelectionChange?.(keys);
|
|
3882
|
+
}
|
|
3883
|
+
};
|
|
3884
|
+
const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
|
|
3885
|
+
const wrapperRef = $hgUW1$useRef(null);
|
|
3886
|
+
const listState = (0, $hgUW1$useListState)(listProps);
|
|
3887
|
+
const { listBoxProps: listBoxProps } = (0, $hgUW1$useListBox)(listProps, listState, wrapperRef);
|
|
3888
|
+
const _colors = [
|
|
3889
|
+
...listState.collection
|
|
3890
|
+
];
|
|
3891
|
+
radius = radius ?? theme?.radius ?? "md";
|
|
3892
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$var$SwatchProvider, {
|
|
3893
|
+
colors: colors,
|
|
3894
|
+
radius: radius,
|
|
3895
|
+
size: size,
|
|
3896
|
+
...props,
|
|
3897
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
3898
|
+
style: {
|
|
3899
|
+
...style,
|
|
3900
|
+
...styles?.wrapper
|
|
3901
|
+
},
|
|
3902
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, classNames?.wrapper),
|
|
3903
|
+
wrap: "wrap",
|
|
3904
|
+
...listBoxProps,
|
|
3905
|
+
ref: wrapperRef,
|
|
3906
|
+
children: _colors.map((color, index)=>/*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$export$47ce3797af1a0c57, {
|
|
3907
|
+
className: classNames?.swatch,
|
|
3908
|
+
style: styles?.swatch,
|
|
3909
|
+
state: listState,
|
|
3910
|
+
item: color
|
|
3911
|
+
}, index))
|
|
3912
|
+
})
|
|
3913
|
+
});
|
|
3914
|
+
}
|
|
3915
|
+
function $a364ffae99b57fd7$export$47ce3797af1a0c57({ item: item, state: state, style: style, className: className }) {
|
|
3916
|
+
const ref = $hgUW1$useRef(null);
|
|
3917
|
+
const { optionProps: optionProps, isDisabled: isDisabled, isFocusVisible: isFocusVisible, isFocused: isFocused, isPressed: isPressed, isSelected: isSelected } = (0, $hgUW1$useOption)({
|
|
3918
|
+
key: item.key
|
|
3919
|
+
}, state, ref);
|
|
3920
|
+
const color = item.props.color;
|
|
3921
|
+
const ctx = $a364ffae99b57fd7$var$useSwatchPickerContext();
|
|
3922
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$var$ColorSwatch, {
|
|
3923
|
+
className: className,
|
|
3924
|
+
style: style,
|
|
3925
|
+
color: color,
|
|
3926
|
+
_ref: ref,
|
|
3927
|
+
"data-disabled": isDisabled,
|
|
3928
|
+
"data-selected": isSelected,
|
|
3929
|
+
"data-focused": isFocused,
|
|
3930
|
+
"data-focus-visible": isFocusVisible,
|
|
3931
|
+
"data-pressed": isPressed,
|
|
3932
|
+
"data-radius": ctx.radius,
|
|
3933
|
+
"data-size": ctx.size,
|
|
3934
|
+
...optionProps
|
|
3935
|
+
});
|
|
3936
|
+
}
|
|
3937
|
+
function $a364ffae99b57fd7$var$ColorSwatch({ className: className, style: style, _ref: _ref, color: colorProp, ...props }) {
|
|
3938
|
+
const { colorSwatchProps: colorSwatchProps, color: color } = (0, $hgUW1$useColorSwatch)({
|
|
3939
|
+
...props,
|
|
3940
|
+
color: colorProp
|
|
3941
|
+
});
|
|
3942
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3943
|
+
...props,
|
|
3944
|
+
ref: _ref,
|
|
3945
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-color-swatch", className),
|
|
3946
|
+
...colorSwatchProps,
|
|
3947
|
+
style: {
|
|
3948
|
+
...colorSwatchProps.style,
|
|
3949
|
+
background: color.toString("css"),
|
|
3950
|
+
...style
|
|
3951
|
+
},
|
|
3952
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3953
|
+
className: "p-swatch-checkers"
|
|
3954
|
+
})
|
|
3955
|
+
});
|
|
3956
|
+
}
|
|
3957
|
+
const $a364ffae99b57fd7$var$SwatchPickerContext = /*#__PURE__*/ $hgUW1$createContext(null);
|
|
3958
|
+
function $a364ffae99b57fd7$var$SwatchProvider(props) {
|
|
3959
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)($a364ffae99b57fd7$var$SwatchPickerContext.Provider, {
|
|
3960
|
+
value: props,
|
|
3961
|
+
children: props.children
|
|
3962
|
+
});
|
|
3963
|
+
}
|
|
3964
|
+
function $a364ffae99b57fd7$var$useSwatchPickerContext() {
|
|
3965
|
+
const ctx = $hgUW1$useContext($a364ffae99b57fd7$var$SwatchPickerContext);
|
|
3966
|
+
if (!ctx) throw new Error("SwatchPicker must be used within a SwatchPickerProvider");
|
|
3967
|
+
return ctx;
|
|
3968
|
+
}
|
|
3969
|
+
const $a364ffae99b57fd7$var$Color = (0, $hgUW1$Item);
|
|
3970
|
+
|
|
3971
|
+
|
|
3972
|
+
|
|
3973
|
+
|
|
3974
|
+
|
|
3975
|
+
|
|
3976
|
+
|
|
3977
|
+
|
|
3978
|
+
function $216a62c521cf5bbd$export$44fd664bcca5b6fb({ label: label, ...props }) {
|
|
3979
|
+
const { locale: locale } = (0, $hgUW1$useLocale)();
|
|
3980
|
+
const state = (0, $hgUW1$useColorSliderState)({
|
|
3981
|
+
...props,
|
|
3982
|
+
locale: locale
|
|
3983
|
+
});
|
|
3984
|
+
const trackRef = $hgUW1$useRef(null);
|
|
3985
|
+
const inputRef = $hgUW1$useRef(null);
|
|
3986
|
+
const { labelProps: labelProps, trackProps: trackProps, thumbProps: thumbProps, inputProps: inputProps } = (0, $hgUW1$useColorSlider)({
|
|
3987
|
+
...props,
|
|
3988
|
+
label: label,
|
|
3989
|
+
"aria-label": props["aria-label"] ?? "color-slider",
|
|
3990
|
+
inputRef: inputRef,
|
|
3991
|
+
trackRef: trackRef
|
|
3992
|
+
}, state);
|
|
3993
|
+
const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $hgUW1$useFocusRing)();
|
|
3994
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
|
|
3995
|
+
label: label,
|
|
3996
|
+
className: "p-color-slider",
|
|
3997
|
+
replaceDefaultControlWrapper: true,
|
|
3998
|
+
labelProps: labelProps,
|
|
3999
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4000
|
+
...trackProps,
|
|
4001
|
+
"data-focus-visible": isFocusVisible,
|
|
4002
|
+
"data-bg": trackProps.style?.background,
|
|
4003
|
+
className: "p-color-slider-track",
|
|
4004
|
+
ref: trackRef,
|
|
4005
|
+
style: {
|
|
4006
|
+
...trackProps.style,
|
|
4007
|
+
background: trackProps.style?.background
|
|
4008
|
+
},
|
|
4009
|
+
children: [
|
|
4010
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4011
|
+
className: "p-color-slider-checkers"
|
|
4012
|
+
}),
|
|
4013
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4014
|
+
className: "p-color-slider-thumb",
|
|
4015
|
+
...thumbProps,
|
|
4016
|
+
style: {
|
|
4017
|
+
...thumbProps.style,
|
|
4018
|
+
background: state.getDisplayColor().toString("css")
|
|
4019
|
+
},
|
|
4020
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
4021
|
+
ref: inputRef,
|
|
4022
|
+
...inputProps,
|
|
4023
|
+
...focusProps
|
|
4024
|
+
})
|
|
4025
|
+
})
|
|
4026
|
+
]
|
|
4027
|
+
})
|
|
4028
|
+
});
|
|
4029
|
+
}
|
|
4030
|
+
|
|
4031
|
+
|
|
4032
|
+
|
|
4033
|
+
function $8f49d2e6ba434739$export$6e865ea70d7724f(color) {
|
|
4034
|
+
// TODO: add support for rgba colors
|
|
4035
|
+
return (0, $hgUW1$parseColor)(color);
|
|
4036
|
+
}
|
|
4037
|
+
|
|
4038
|
+
|
|
4039
|
+
|
|
4040
|
+
|
|
4041
|
+
|
|
4042
|
+
|
|
4043
|
+
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, $8f49d2e6ba434739$export$6e865ea70d7724f as parseColor};
|
|
3376
4044
|
//# sourceMappingURL=module.js.map
|