@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/main.js
CHANGED
|
@@ -272,7 +272,7 @@ const $c3a954a7c0cb5109$export$21ee1313e2afe36c = (props, ref)=>{
|
|
|
272
272
|
const { justify: justify, align: align, direction: direction, gap: gap = "sm", columnGap: columnGap, rowGap: rowGap, inline: inline, wrap: wrap, stack: stack, className: className, ...otherProps } = props;
|
|
273
273
|
const flexDirection = stack ? "column" : direction ?? "row";
|
|
274
274
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
275
|
-
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, inline ? "display-inline-flex" : "display-flex", `flex-direction-${flexDirection}`, `flex-${wrap}`, `flex-justify-${justify}`, `flex-align-${align}`, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("gap", gap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("column-gap", columnGap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("row-gap", rowGap)),
|
|
275
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, inline ? "display-inline-flex" : "display-flex", `flex-direction-${flexDirection}`, wrap && `flex-${wrap}`, justify && `flex-justify-${justify}`, align && `flex-align-${align}`, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("gap", gap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("column-gap", columnGap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("row-gap", rowGap)),
|
|
276
276
|
// TODO - Fix types here - seems to work just fine though
|
|
277
277
|
ref: ref,
|
|
278
278
|
...otherProps,
|
|
@@ -295,19 +295,17 @@ const $c3a954a7c0cb5109$export$f51f4c4ede09e011 = /*#__PURE__*/ $8zHUo$react.for
|
|
|
295
295
|
|
|
296
296
|
|
|
297
297
|
|
|
298
|
+
|
|
298
299
|
const $88fa102d91bf323a$export$f5a10939c0132d55 = (props, ref)=>{
|
|
299
300
|
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;
|
|
300
301
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)(Comp, {
|
|
301
|
-
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)({
|
|
302
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-text", className, {
|
|
302
303
|
[`text-highlight`]: !!highlight,
|
|
303
|
-
"p-text": true,
|
|
304
|
-
[`text-size-${size}`]: !!size,
|
|
305
304
|
[`text-weight-${weight}`]: !!weight,
|
|
306
305
|
[`text-align-${align}`]: !!align,
|
|
307
306
|
[`text-line-height-${lineHeight}`]: !!lineHeight,
|
|
308
|
-
[`text-transform-${textCase}`]: !!textCase
|
|
309
|
-
|
|
310
|
-
}),
|
|
307
|
+
[`text-transform-${textCase}`]: !!textCase
|
|
308
|
+
}, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("text-size", size)),
|
|
311
309
|
"data-underline": underline,
|
|
312
310
|
"data-italic": italic,
|
|
313
311
|
"data-color": color,
|
|
@@ -1728,11 +1726,13 @@ const $71fcf48f7e2e9427$export$f8afaea2e9656b91 = /*#__PURE__*/ $8zHUo$react.for
|
|
|
1728
1726
|
})
|
|
1729
1727
|
}),
|
|
1730
1728
|
showIndicator && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
1731
|
-
className: "p-fake-radio",
|
|
1729
|
+
className: "p-radio-card-indicator p-fake-radio",
|
|
1732
1730
|
"data-size": "sm",
|
|
1733
1731
|
"data-checked": inputProps.checked
|
|
1734
1732
|
}),
|
|
1735
1733
|
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
|
|
1734
|
+
stretchX: true,
|
|
1735
|
+
className: "p-radio-card-content",
|
|
1736
1736
|
stack: true,
|
|
1737
1737
|
gap: "xs",
|
|
1738
1738
|
children: [
|
|
@@ -1813,7 +1813,7 @@ $cfadb0728cf907ff$export$3288d34c523a1192.displayName = "Tag";
|
|
|
1813
1813
|
|
|
1814
1814
|
|
|
1815
1815
|
|
|
1816
|
-
function $e37831ebf64d8e7d$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 }) {
|
|
1816
|
+
function $e37831ebf64d8e7d$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 }) {
|
|
1817
1817
|
const isMultiple = selectionMode === "multiple";
|
|
1818
1818
|
function getValue(value) {
|
|
1819
1819
|
if (!value) return null;
|
|
@@ -1832,7 +1832,6 @@ function $e37831ebf64d8e7d$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1832
1832
|
});
|
|
1833
1833
|
}
|
|
1834
1834
|
const space = (0, $eae337549f49a5a2$export$450c36e0b0e62ccd)();
|
|
1835
|
-
const [isFocused, setIsFocused] = $8zHUo$react.useState(false);
|
|
1836
1835
|
const triggerState = (0, $8zHUo$reactstately.useMenuTriggerState)({});
|
|
1837
1836
|
const listState = (0, $8zHUo$reactstately.useListState)({
|
|
1838
1837
|
...props,
|
|
@@ -1881,29 +1880,11 @@ function $e37831ebf64d8e7d$export$ef9b1a59e592288f({ label: label, selectionMode
|
|
|
1881
1880
|
});
|
|
1882
1881
|
}
|
|
1883
1882
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
1883
|
+
style: style,
|
|
1884
1884
|
as: "span",
|
|
1885
1885
|
position: "relative",
|
|
1886
1886
|
stretchX: true,
|
|
1887
1887
|
children: [
|
|
1888
|
-
selectionMode === "single" && // Implement a hidden select element to allow for native form submission
|
|
1889
|
-
// should work for both single and multiple selection modes
|
|
1890
|
-
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reactaria.HiddenSelect), {
|
|
1891
|
-
triggerRef: triggerRef,
|
|
1892
|
-
label: label,
|
|
1893
|
-
name: props.name,
|
|
1894
|
-
state: {
|
|
1895
|
-
selectedItem: selectedItems[0],
|
|
1896
|
-
selectedKey: selectedItems[0]?.key,
|
|
1897
|
-
setSelectedKey: (key)=>listState.selectionManager.setSelectedKeys([
|
|
1898
|
-
key
|
|
1899
|
-
]),
|
|
1900
|
-
isFocused: isFocused,
|
|
1901
|
-
setFocused: setIsFocused,
|
|
1902
|
-
...listState,
|
|
1903
|
-
...triggerState
|
|
1904
|
-
},
|
|
1905
|
-
isDisabled: props.isDisabled
|
|
1906
|
-
}),
|
|
1907
1888
|
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
|
|
1908
1889
|
"data-radius": radius ?? theme?.radius ?? "lg",
|
|
1909
1890
|
gap: "3xs",
|
|
@@ -2078,6 +2059,20 @@ function $9bce4a3d5b18599c$export$b4085f3d3ede4716(array, keys) {
|
|
|
2078
2059
|
}
|
|
2079
2060
|
|
|
2080
2061
|
|
|
2062
|
+
const $284d30e280d297d3$var$monthsByIndex = [
|
|
2063
|
+
"January",
|
|
2064
|
+
"February",
|
|
2065
|
+
"March",
|
|
2066
|
+
"April",
|
|
2067
|
+
"May",
|
|
2068
|
+
"June",
|
|
2069
|
+
"July",
|
|
2070
|
+
"August",
|
|
2071
|
+
"Septemper",
|
|
2072
|
+
"October",
|
|
2073
|
+
"November",
|
|
2074
|
+
"December"
|
|
2075
|
+
];
|
|
2081
2076
|
const $284d30e280d297d3$export$e1aef45b828286de = /*#__PURE__*/ $8zHUo$react.forwardRef(({ numberOfMonths: numberOfMonths = 1, color: color, ...props }, ref)=>{
|
|
2082
2077
|
const { locale: locale } = (0, $8zHUo$reactaria.useLocale)();
|
|
2083
2078
|
const state = (0, $8zHUo$reactstately.useCalendarState)({
|
|
@@ -2089,6 +2084,25 @@ const $284d30e280d297d3$export$e1aef45b828286de = /*#__PURE__*/ $8zHUo$react.for
|
|
|
2089
2084
|
}
|
|
2090
2085
|
});
|
|
2091
2086
|
const { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, title: title } = (0, $8zHUo$reactaria.useCalendar)(props, state);
|
|
2087
|
+
console.log(state);
|
|
2088
|
+
// function onMonthChange(month: string) {
|
|
2089
|
+
// state.setValue(
|
|
2090
|
+
// parseDate(
|
|
2091
|
+
// `${state.value.year}-${month.padStart(2, "0")}-${state.value.day
|
|
2092
|
+
// .toString()
|
|
2093
|
+
// .padStart(2, "0")}`
|
|
2094
|
+
// )
|
|
2095
|
+
// );
|
|
2096
|
+
// }
|
|
2097
|
+
// function onYearChange(year: string) {
|
|
2098
|
+
// state.setValue(
|
|
2099
|
+
// parseDate(
|
|
2100
|
+
// `${year}-${state.value.month
|
|
2101
|
+
// .toString()
|
|
2102
|
+
// .padStart(2, "0")}-${state.value.day.toString().padStart(2, "0")}`
|
|
2103
|
+
// )
|
|
2104
|
+
// );
|
|
2105
|
+
// }
|
|
2092
2106
|
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
|
|
2093
2107
|
"data-color": color,
|
|
2094
2108
|
inline: true,
|
|
@@ -2232,12 +2246,14 @@ const $e0a58c83d4c36e4e$export$7edc06cf1783b30f = /*#__PURE__*/ $8zHUo$react.for
|
|
|
2232
2246
|
}), value: value, defaultValue: defaultValue, onChange: onChange, ...props }, ref)=>{
|
|
2233
2247
|
const space = (0, $eae337549f49a5a2$export$450c36e0b0e62ccd)();
|
|
2234
2248
|
function proxyOnChange(date) {
|
|
2235
|
-
|
|
2249
|
+
console.log(date);
|
|
2250
|
+
if (!date) onChange?.(null, null);
|
|
2251
|
+
onChange?.(date?.toString(), date);
|
|
2236
2252
|
}
|
|
2237
2253
|
const newProps = {
|
|
2238
2254
|
...props,
|
|
2239
|
-
value: value ? (0, $8zHUo$internationalizeddate.parseDate)(value) :
|
|
2240
|
-
defaultValue: defaultValue ? (0, $8zHUo$internationalizeddate.parseDate)(defaultValue) :
|
|
2255
|
+
value: value ? (0, $8zHUo$internationalizeddate.parseDate)(value) : null,
|
|
2256
|
+
defaultValue: defaultValue ? (0, $8zHUo$internationalizeddate.parseDate)(defaultValue) : null,
|
|
2241
2257
|
onChange: proxyOnChange
|
|
2242
2258
|
};
|
|
2243
2259
|
const state = (0, $8zHUo$reactstately.useDatePickerState)(newProps);
|