@parrot-co/parrot-ui 0.0.95 → 0.0.97
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 +48 -32
- package/dist/main.js.map +1 -1
- package/dist/module.js +49 -33
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +7 -7
- 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";
|
|
@@ -221,7 +221,7 @@ const $e2f278d76a00796a$export$21ee1313e2afe36c = (props, ref)=>{
|
|
|
221
221
|
const { justify: justify, align: align, direction: direction, gap: gap = "sm", columnGap: columnGap, rowGap: rowGap, inline: inline, wrap: wrap, stack: stack, className: className, ...otherProps } = props;
|
|
222
222
|
const flexDirection = stack ? "column" : direction ?? "row";
|
|
223
223
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ee0105641360f1c1$export$e71c4d32a2263218), {
|
|
224
|
-
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, inline ? "display-inline-flex" : "display-flex", `flex-direction-${flexDirection}`, `flex-${wrap}`, `flex-justify-${justify}`, `flex-align-${align}`, (0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("gap", gap), (0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("column-gap", columnGap), (0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("row-gap", rowGap)),
|
|
224
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)(className, inline ? "display-inline-flex" : "display-flex", `flex-direction-${flexDirection}`, wrap && `flex-${wrap}`, justify && `flex-justify-${justify}`, align && `flex-align-${align}`, (0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("gap", gap), (0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("column-gap", columnGap), (0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("row-gap", rowGap)),
|
|
225
225
|
// TODO - Fix types here - seems to work just fine though
|
|
226
226
|
ref: ref,
|
|
227
227
|
...otherProps,
|
|
@@ -244,19 +244,17 @@ const $e2f278d76a00796a$export$f51f4c4ede09e011 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
244
244
|
|
|
245
245
|
|
|
246
246
|
|
|
247
|
+
|
|
247
248
|
const $3157c40f7d0e6fa2$export$f5a10939c0132d55 = (props, ref)=>{
|
|
248
249
|
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;
|
|
249
250
|
return /*#__PURE__*/ (0, $hgUW1$jsx)(Comp, {
|
|
250
|
-
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)({
|
|
251
|
+
className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-text", className, {
|
|
251
252
|
[`text-highlight`]: !!highlight,
|
|
252
|
-
"p-text": true,
|
|
253
|
-
[`text-size-${size}`]: !!size,
|
|
254
253
|
[`text-weight-${weight}`]: !!weight,
|
|
255
254
|
[`text-align-${align}`]: !!align,
|
|
256
255
|
[`text-line-height-${lineHeight}`]: !!lineHeight,
|
|
257
|
-
[`text-transform-${textCase}`]: !!textCase
|
|
258
|
-
|
|
259
|
-
}),
|
|
256
|
+
[`text-transform-${textCase}`]: !!textCase
|
|
257
|
+
}, (0, $0ad0bc75b5eb16a6$export$2db1d02db18b2d82)("text-size", size)),
|
|
260
258
|
"data-underline": underline,
|
|
261
259
|
"data-italic": italic,
|
|
262
260
|
"data-color": color,
|
|
@@ -1677,11 +1675,13 @@ const $e3711da06539818f$export$f8afaea2e9656b91 = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
1677
1675
|
})
|
|
1678
1676
|
}),
|
|
1679
1677
|
showIndicator && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1680
|
-
className: "p-fake-radio",
|
|
1678
|
+
className: "p-radio-card-indicator p-fake-radio",
|
|
1681
1679
|
"data-size": "sm",
|
|
1682
1680
|
"data-checked": inputProps.checked
|
|
1683
1681
|
}),
|
|
1684
1682
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1683
|
+
stretchX: true,
|
|
1684
|
+
className: "p-radio-card-content",
|
|
1685
1685
|
stack: true,
|
|
1686
1686
|
gap: "xs",
|
|
1687
1687
|
children: [
|
|
@@ -1762,7 +1762,7 @@ $c700d45659d35204$export$3288d34c523a1192.displayName = "Tag";
|
|
|
1762
1762
|
|
|
1763
1763
|
|
|
1764
1764
|
|
|
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, ...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 }) {
|
|
1766
1766
|
const isMultiple = selectionMode === "multiple";
|
|
1767
1767
|
function getValue(value) {
|
|
1768
1768
|
if (!value) return null;
|
|
@@ -1781,7 +1781,6 @@ function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1781
1781
|
});
|
|
1782
1782
|
}
|
|
1783
1783
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
1784
|
-
const [isFocused, setIsFocused] = $hgUW1$useState(false);
|
|
1785
1784
|
const triggerState = (0, $hgUW1$useMenuTriggerState)({});
|
|
1786
1785
|
const listState = (0, $hgUW1$useListState)({
|
|
1787
1786
|
...props,
|
|
@@ -1830,29 +1829,11 @@ function $9f79d30a629e2c71$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1830
1829
|
});
|
|
1831
1830
|
}
|
|
1832
1831
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $ee0105641360f1c1$export$e71c4d32a2263218), {
|
|
1832
|
+
style: style,
|
|
1833
1833
|
as: "span",
|
|
1834
1834
|
position: "relative",
|
|
1835
1835
|
stretchX: true,
|
|
1836
1836
|
children: [
|
|
1837
|
-
selectionMode === "single" && // Implement a hidden select element to allow for native form submission
|
|
1838
|
-
// should work for both single and multiple selection modes
|
|
1839
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$HiddenSelect), {
|
|
1840
|
-
triggerRef: triggerRef,
|
|
1841
|
-
label: label,
|
|
1842
|
-
name: props.name,
|
|
1843
|
-
state: {
|
|
1844
|
-
selectedItem: selectedItems[0],
|
|
1845
|
-
selectedKey: selectedItems[0]?.key,
|
|
1846
|
-
setSelectedKey: (key)=>listState.selectionManager.setSelectedKeys([
|
|
1847
|
-
key
|
|
1848
|
-
]),
|
|
1849
|
-
isFocused: isFocused,
|
|
1850
|
-
setFocused: setIsFocused,
|
|
1851
|
-
...listState,
|
|
1852
|
-
...triggerState
|
|
1853
|
-
},
|
|
1854
|
-
isDisabled: props.isDisabled
|
|
1855
|
-
}),
|
|
1856
1837
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
1857
1838
|
"data-radius": radius ?? theme?.radius ?? "lg",
|
|
1858
1839
|
gap: "3xs",
|
|
@@ -2027,6 +2008,20 @@ function $b57bc04886adb8b4$export$b4085f3d3ede4716(array, keys) {
|
|
|
2027
2008
|
}
|
|
2028
2009
|
|
|
2029
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
|
+
];
|
|
2030
2025
|
const $11e1beb2a56c81ba$export$e1aef45b828286de = /*#__PURE__*/ $hgUW1$forwardRef(({ numberOfMonths: numberOfMonths = 1, color: color, ...props }, ref)=>{
|
|
2031
2026
|
const { locale: locale } = (0, $hgUW1$useLocale)();
|
|
2032
2027
|
const state = (0, $hgUW1$useCalendarState)({
|
|
@@ -2038,6 +2033,25 @@ const $11e1beb2a56c81ba$export$e1aef45b828286de = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
2038
2033
|
}
|
|
2039
2034
|
});
|
|
2040
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
|
+
// }
|
|
2041
2055
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
|
|
2042
2056
|
"data-color": color,
|
|
2043
2057
|
inline: true,
|
|
@@ -2181,12 +2195,14 @@ const $48aceaf3289ec325$export$7edc06cf1783b30f = /*#__PURE__*/ $hgUW1$forwardRe
|
|
|
2181
2195
|
}), value: value, defaultValue: defaultValue, onChange: onChange, ...props }, ref)=>{
|
|
2182
2196
|
const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
|
|
2183
2197
|
function proxyOnChange(date) {
|
|
2184
|
-
|
|
2198
|
+
console.log(date);
|
|
2199
|
+
if (!date) onChange?.(null, null);
|
|
2200
|
+
onChange?.(date?.toString(), date);
|
|
2185
2201
|
}
|
|
2186
2202
|
const newProps = {
|
|
2187
2203
|
...props,
|
|
2188
|
-
value: value ? (0, $hgUW1$parseDate)(value) :
|
|
2189
|
-
defaultValue: defaultValue ? (0, $hgUW1$parseDate)(defaultValue) :
|
|
2204
|
+
value: value ? (0, $hgUW1$parseDate)(value) : null,
|
|
2205
|
+
defaultValue: defaultValue ? (0, $hgUW1$parseDate)(defaultValue) : null,
|
|
2190
2206
|
onChange: proxyOnChange
|
|
2191
2207
|
};
|
|
2192
2208
|
const state = (0, $hgUW1$useDatePickerState)(newProps);
|