@parrot-co/parrot-ui 0.0.96 → 0.0.98
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 +41 -25
- package/dist/main.js.map +1 -1
- package/dist/module.js +42 -26
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +6 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/styles.css +1 -1
package/dist/module.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, 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,
|
|
3
|
+
import {useTextField as $hgUW1$useTextField, useLocale as $hgUW1$useLocale, useNumberField as $hgUW1$useNumberField, useToggleButton as $hgUW1$useToggleButton, 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, useTabList as $hgUW1$useTabList, useTab as $hgUW1$useTab, useTabPanel as $hgUW1$useTabPanel, useHover as $hgUW1$useHover, useSwitch as $hgUW1$useSwitch, useModalOverlay as $hgUW1$useModalOverlay, useDialog as $hgUW1$useDialog} from "react-aria";
|
|
4
4
|
import {HiMinus as $hgUW1$HiMinus, HiPlus as $hgUW1$HiPlus, HiEye as $hgUW1$HiEye, HiCheck as $hgUW1$HiCheck, HiSelector as $hgUW1$HiSelector, HiX as $hgUW1$HiX, 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} from "react-icons/hi";
|
|
5
5
|
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, useTabListState as $hgUW1$useTabListState, useOverlayTriggerState as $hgUW1$useOverlayTriggerState} from "react-stately";
|
|
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";
|
|
@@ -1675,11 +1675,13 @@ const $e3711da06539818f$export$f8afaea2e9656b91 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
1675
1675
|
})
|
|
1676
1676
|
}),
|
|
1677
1677
|
showIndicator && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1678
|
-
className: "p-fake-radio",
|
|
1678
|
+
className: "p-radio-card-indicator p-fake-radio",
|
|
1679
1679
|
"data-size": "sm",
|
|
1680
1680
|
"data-checked": inputProps.checked
|
|
1681
1681
|
}),
|
|
1682
1682
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1683
|
+
stretchX: true,
|
|
1684
|
+
className: "p-radio-card-content",
|
|
1683
1685
|
stack: true,
|
|
1684
1686
|
gap: "xs",
|
|
1685
1687
|
children: [
|
|
@@ -1760,7 +1762,7 @@ $c700d45659d35204$export$3288d34c523a1192.displayName = "Tag";
|
|
|
1760
1762
|
|
|
1761
1763
|
|
|
1762
1764
|
|
|
1763
|
-
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, ...props }) {
|
|
1765
|
+
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 }) {
|
|
1764
1766
|
const isMultiple = selectionMode === "multiple";
|
|
1765
1767
|
function getValue(value) {
|
|
1766
1768
|
if (!value) return null;
|
|
@@ -1779,7 +1781,6 @@ function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1779
1781
|
});
|
|
1780
1782
|
}
|
|
1781
1783
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
1782
|
-
const [isFocused, setIsFocused] = $hgUW1$useState(false);
|
|
1783
1784
|
const triggerState = (0, $hgUW1$useMenuTriggerState)({});
|
|
1784
1785
|
const listState = (0, $hgUW1$useListState)({
|
|
1785
1786
|
...props,
|
|
@@ -1828,29 +1829,11 @@ function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1828
1829
|
});
|
|
1829
1830
|
}
|
|
1830
1831
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $ee0105641360f1c1$export$e71c4d32a2263218), {
|
|
1832
|
+
style: style,
|
|
1831
1833
|
as: "span",
|
|
1832
1834
|
position: "relative",
|
|
1833
1835
|
stretchX: true,
|
|
1834
1836
|
children: [
|
|
1835
|
-
selectionMode === "single" && // Implement a hidden select element to allow for native form submission
|
|
1836
|
-
// should work for both single and multiple selection modes
|
|
1837
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$HiddenSelect), {
|
|
1838
|
-
triggerRef: triggerRef,
|
|
1839
|
-
label: label,
|
|
1840
|
-
name: props.name,
|
|
1841
|
-
state: {
|
|
1842
|
-
selectedItem: selectedItems[0],
|
|
1843
|
-
selectedKey: selectedItems[0]?.key,
|
|
1844
|
-
setSelectedKey: (key)=>listState.selectionManager.setSelectedKeys([
|
|
1845
|
-
key
|
|
1846
|
-
]),
|
|
1847
|
-
isFocused: isFocused,
|
|
1848
|
-
setFocused: setIsFocused,
|
|
1849
|
-
...listState,
|
|
1850
|
-
...triggerState
|
|
1851
|
-
},
|
|
1852
|
-
isDisabled: props.isDisabled
|
|
1853
|
-
}),
|
|
1854
1837
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1855
1838
|
"data-radius": radius ?? theme?.radius ?? "lg",
|
|
1856
1839
|
gap: "3xs",
|
|
@@ -2025,6 +2008,20 @@ function $b57bc04886adb8b4$export$b4085f3d3ede4716(array, keys) {
|
|
|
2025
2008
|
}
|
|
2026
2009
|
|
|
2027
2010
|
|
|
2011
|
+
const $11e1beb2a56c81ba$var$monthsByIndex = [
|
|
2012
|
+
"January",
|
|
2013
|
+
"February",
|
|
2014
|
+
"March",
|
|
2015
|
+
"April",
|
|
2016
|
+
"May",
|
|
2017
|
+
"June",
|
|
2018
|
+
"July",
|
|
2019
|
+
"August",
|
|
2020
|
+
"Septemper",
|
|
2021
|
+
"October",
|
|
2022
|
+
"November",
|
|
2023
|
+
"December"
|
|
2024
|
+
];
|
|
2028
2025
|
const $11e1beb2a56c81ba$export$e1aef45b828286de = /*#__PURE__*/ $hgUW1$forwardRef(({ numberOfMonths: numberOfMonths = 1, color: color, ...props }, ref)=>{
|
|
2029
2026
|
const { locale: locale } = (0, $hgUW1$useLocale)();
|
|
2030
2027
|
const state = (0, $hgUW1$useCalendarState)({
|
|
@@ -2036,6 +2033,25 @@ const $11e1beb2a56c81ba$export$e1aef45b828286de = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
2036
2033
|
}
|
|
2037
2034
|
});
|
|
2038
2035
|
const { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, title: title } = (0, $hgUW1$useCalendar)(props, state);
|
|
2036
|
+
console.log(state);
|
|
2037
|
+
// function onMonthChange(month: string) {
|
|
2038
|
+
// state.setValue(
|
|
2039
|
+
// parseDate(
|
|
2040
|
+
// `${state.value.year}-${month.padStart(2, "0")}-${state.value.day
|
|
2041
|
+
// .toString()
|
|
2042
|
+
// .padStart(2, "0")}`
|
|
2043
|
+
// )
|
|
2044
|
+
// );
|
|
2045
|
+
// }
|
|
2046
|
+
// function onYearChange(year: string) {
|
|
2047
|
+
// state.setValue(
|
|
2048
|
+
// parseDate(
|
|
2049
|
+
// `${year}-${state.value.month
|
|
2050
|
+
// .toString()
|
|
2051
|
+
// .padStart(2, "0")}-${state.value.day.toString().padStart(2, "0")}`
|
|
2052
|
+
// )
|
|
2053
|
+
// );
|
|
2054
|
+
// }
|
|
2039
2055
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
2040
2056
|
"data-color": color,
|
|
2041
2057
|
inline: true,
|
|
@@ -2179,12 +2195,12 @@ const $48aceaf3289ec325$export$7edc06cf1783b30f = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
2179
2195
|
}), value: value, defaultValue: defaultValue, onChange: onChange, ...props }, ref)=>{
|
|
2180
2196
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
2181
2197
|
function proxyOnChange(date) {
|
|
2182
|
-
onChange?.(date
|
|
2198
|
+
onChange?.(date?.toString(), date);
|
|
2183
2199
|
}
|
|
2184
2200
|
const newProps = {
|
|
2185
2201
|
...props,
|
|
2186
|
-
value: value ? (0, $hgUW1$parseDate)(value) :
|
|
2187
|
-
defaultValue: defaultValue ? (0, $hgUW1$parseDate)(defaultValue) :
|
|
2202
|
+
value: value ? (0, $hgUW1$parseDate)(value) : null,
|
|
2203
|
+
defaultValue: defaultValue ? (0, $hgUW1$parseDate)(defaultValue) : null,
|
|
2188
2204
|
onChange: proxyOnChange
|
|
2189
2205
|
};
|
|
2190
2206
|
const state = (0, $hgUW1$useDatePickerState)(newProps);
|