@parrot-co/parrot-ui 0.1.4 → 0.1.6
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 +105 -105
- package/dist/main.js.map +1 -1
- package/dist/module.js +105 -105
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +26 -26
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/main.js
CHANGED
|
@@ -5,9 +5,11 @@ var $8zHUo$reacticonshi = require("react-icons/hi");
|
|
|
5
5
|
var $8zHUo$reactstately = require("react-stately");
|
|
6
6
|
var $8zHUo$internationalizeddate = require("@internationalized/date");
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
function $parcel$export(e, n, v, s) {
|
|
9
10
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
10
11
|
}
|
|
12
|
+
|
|
11
13
|
function $parcel$interopDefault(a) {
|
|
12
14
|
return a && a.__esModule ? a.default : a;
|
|
13
15
|
}
|
|
@@ -40,8 +42,6 @@ $parcel$export(module.exports, "FileUploader", () => $5f87818f4e8f8603$export$1a
|
|
|
40
42
|
$parcel$export(module.exports, "Separator", () => $9e8a15ca4065ce60$export$1ff3c3f08ae963c0);
|
|
41
43
|
$parcel$export(module.exports, "Progress", () => $e04b6210b7063851$export$b25a304ec7d746bb);
|
|
42
44
|
$parcel$export(module.exports, "Loader", () => $a28e128499dd0b02$export$3b0d6d7590275603);
|
|
43
|
-
$parcel$export(module.exports, "Root", () => $6c55ad3905040a74$export$be92b6f5f03c0fe9);
|
|
44
|
-
$parcel$export(module.exports, "Item", () => $6c55ad3905040a74$export$6d08773d2e66f8f2);
|
|
45
45
|
$parcel$export(module.exports, "Tag", () => $cfadb0728cf907ff$export$3288d34c523a1192);
|
|
46
46
|
$parcel$export(module.exports, "Switch", () => $c5c6f63b49c9056a$export$b5d5cf8927ab7262);
|
|
47
47
|
$parcel$export(module.exports, "ColorTray", () => $de38c06a5c24ee45$export$dbada5ace43900dd);
|
|
@@ -2684,107 +2684,6 @@ $e04b6210b7063851$export$b25a304ec7d746bb.displayName = "Progress";
|
|
|
2684
2684
|
|
|
2685
2685
|
|
|
2686
2686
|
|
|
2687
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
const $6c55ad3905040a74$var$Tabs = /*#__PURE__*/ $8zHUo$react.forwardRef(({ ...props }, ref)=>{
|
|
2694
|
-
const state = (0, $8zHUo$reactstately.useTabListState)(props);
|
|
2695
|
-
const tabRef = $8zHUo$react.useRef(null);
|
|
2696
|
-
const [indicatorStyles, setIndicatorStyles] = $8zHUo$react.useState({
|
|
2697
|
-
width: 0,
|
|
2698
|
-
left: 0
|
|
2699
|
-
});
|
|
2700
|
-
const indicatorRef = $8zHUo$react.useRef(null);
|
|
2701
|
-
const { tabListProps: tabListProps } = (0, $8zHUo$reactaria.useTabList)(props, state, tabRef);
|
|
2702
|
-
$8zHUo$react.useEffect(()=>{
|
|
2703
|
-
const selected = tabRef?.current?.querySelector('.p-tab[aria-selected="true"]');
|
|
2704
|
-
setIndicatorStyles({
|
|
2705
|
-
width: selected?.offsetWidth,
|
|
2706
|
-
left: selected?.offsetLeft
|
|
2707
|
-
});
|
|
2708
|
-
}, [
|
|
2709
|
-
state.selectedKey
|
|
2710
|
-
]);
|
|
2711
|
-
const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)();
|
|
2712
|
-
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
2713
|
-
"data-color": theme?.color ?? "violet",
|
|
2714
|
-
position: "relative",
|
|
2715
|
-
ref: ref,
|
|
2716
|
-
className: "p-tabs",
|
|
2717
|
-
children: [
|
|
2718
|
-
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
|
|
2719
|
-
...tabListProps,
|
|
2720
|
-
ref: tabRef,
|
|
2721
|
-
className: "p-tab-list",
|
|
2722
|
-
children: [
|
|
2723
|
-
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
2724
|
-
className: "indicator",
|
|
2725
|
-
style: {
|
|
2726
|
-
left: indicatorStyles?.left,
|
|
2727
|
-
bottom: 0,
|
|
2728
|
-
background: "var(--color-10)",
|
|
2729
|
-
height: 2,
|
|
2730
|
-
marginBottom: -1,
|
|
2731
|
-
width: indicatorStyles?.width,
|
|
2732
|
-
transition: "all 0.2s ease"
|
|
2733
|
-
},
|
|
2734
|
-
ref: indicatorRef,
|
|
2735
|
-
position: "absolute"
|
|
2736
|
-
}),
|
|
2737
|
-
[
|
|
2738
|
-
...state.collection
|
|
2739
|
-
].map((item)=>/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($6c55ad3905040a74$var$Tab, {
|
|
2740
|
-
orientation: props.orientation,
|
|
2741
|
-
item: item,
|
|
2742
|
-
state: state
|
|
2743
|
-
}, item.key))
|
|
2744
|
-
]
|
|
2745
|
-
}),
|
|
2746
|
-
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($6c55ad3905040a74$var$TabPanel, {
|
|
2747
|
-
state: state
|
|
2748
|
-
}, state?.selectedItem?.key)
|
|
2749
|
-
]
|
|
2750
|
-
});
|
|
2751
|
-
});
|
|
2752
|
-
function $6c55ad3905040a74$var$Tab({ item: item, state: state }) {
|
|
2753
|
-
const { key: key, rendered: rendered } = item;
|
|
2754
|
-
const ref = $8zHUo$react.useRef(null);
|
|
2755
|
-
const { tabProps: tabProps, isDisabled: isDisabled, isSelected: isSelected } = (0, $8zHUo$reactaria.useTab)({
|
|
2756
|
-
key: key
|
|
2757
|
-
}, state, ref);
|
|
2758
|
-
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
2759
|
-
id: `tab-${key}`,
|
|
2760
|
-
className: "p-tab",
|
|
2761
|
-
ref: ref,
|
|
2762
|
-
"data-disabled": isDisabled,
|
|
2763
|
-
"data-selected": isSelected,
|
|
2764
|
-
...tabProps,
|
|
2765
|
-
children: rendered
|
|
2766
|
-
});
|
|
2767
|
-
}
|
|
2768
|
-
function $6c55ad3905040a74$var$TabPanel({ state: state, ...props }) {
|
|
2769
|
-
const ref = $8zHUo$react.useRef(null);
|
|
2770
|
-
const { tabPanelProps: tabPanelProps } = (0, $8zHUo$reactaria.useTabPanel)(props, state, ref);
|
|
2771
|
-
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
2772
|
-
...tabPanelProps,
|
|
2773
|
-
ref: ref,
|
|
2774
|
-
children: state.selectedItem?.props.children
|
|
2775
|
-
});
|
|
2776
|
-
}
|
|
2777
|
-
const $6c55ad3905040a74$export$be92b6f5f03c0fe9 = $6c55ad3905040a74$var$Tabs;
|
|
2778
|
-
const $6c55ad3905040a74$export$6d08773d2e66f8f2 = (0, $8zHUo$reactstately.Item);
|
|
2779
|
-
$6c55ad3905040a74$var$Tabs.displayName = "Tabs";
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
const $4337a58f6fe87df9$export$1aaa3deaa90ea306 = {
|
|
2783
|
-
Item: (0, $6c55ad3905040a74$export$6d08773d2e66f8f2),
|
|
2784
|
-
Root: (0, $6c55ad3905040a74$export$be92b6f5f03c0fe9)
|
|
2785
|
-
};
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
2687
|
|
|
2789
2688
|
|
|
2790
2689
|
|
|
@@ -2887,6 +2786,107 @@ $fedef2bba4e6812a$export$ea98c603db73aee7.displayName = "Sticker";
|
|
|
2887
2786
|
|
|
2888
2787
|
|
|
2889
2788
|
|
|
2789
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2790
|
+
|
|
2791
|
+
|
|
2792
|
+
|
|
2793
|
+
|
|
2794
|
+
|
|
2795
|
+
|
|
2796
|
+
function $6c55ad3905040a74$export$b2539bed5023c21c({ className: className, style: style, ...props }) {
|
|
2797
|
+
const state = (0, $8zHUo$reactstately.useTabListState)(props);
|
|
2798
|
+
const tabRef = $8zHUo$react.useRef(null);
|
|
2799
|
+
const [indicatorStyles, setIndicatorStyles] = $8zHUo$react.useState({
|
|
2800
|
+
width: 0,
|
|
2801
|
+
left: 0
|
|
2802
|
+
});
|
|
2803
|
+
const indicatorRef = $8zHUo$react.useRef(null);
|
|
2804
|
+
const { tabListProps: tabListProps } = (0, $8zHUo$reactaria.useTabList)(props, state, tabRef);
|
|
2805
|
+
$8zHUo$react.useEffect(()=>{
|
|
2806
|
+
const selected = tabRef?.current?.querySelector('.p-tab[aria-selected="true"]');
|
|
2807
|
+
setIndicatorStyles({
|
|
2808
|
+
width: selected?.offsetWidth,
|
|
2809
|
+
left: selected?.offsetLeft
|
|
2810
|
+
});
|
|
2811
|
+
}, [
|
|
2812
|
+
state.selectedKey
|
|
2813
|
+
]);
|
|
2814
|
+
const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)();
|
|
2815
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
2816
|
+
style: style,
|
|
2817
|
+
"data-color": theme?.color ?? "violet",
|
|
2818
|
+
position: "relative",
|
|
2819
|
+
className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-tabs", className),
|
|
2820
|
+
children: [
|
|
2821
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
|
|
2822
|
+
...tabListProps,
|
|
2823
|
+
ref: tabRef,
|
|
2824
|
+
className: "p-tab-list",
|
|
2825
|
+
children: [
|
|
2826
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
|
|
2827
|
+
className: "indicator",
|
|
2828
|
+
style: {
|
|
2829
|
+
left: indicatorStyles?.left,
|
|
2830
|
+
bottom: 0,
|
|
2831
|
+
background: "var(--color-10)",
|
|
2832
|
+
height: 2,
|
|
2833
|
+
marginBottom: -1,
|
|
2834
|
+
width: indicatorStyles?.width,
|
|
2835
|
+
transition: "all 0.2s ease"
|
|
2836
|
+
},
|
|
2837
|
+
ref: indicatorRef,
|
|
2838
|
+
position: "absolute"
|
|
2839
|
+
}),
|
|
2840
|
+
[
|
|
2841
|
+
...state.collection
|
|
2842
|
+
].map((item)=>/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($6c55ad3905040a74$var$Tab, {
|
|
2843
|
+
orientation: props.orientation,
|
|
2844
|
+
item: item,
|
|
2845
|
+
state: state
|
|
2846
|
+
}, item.key))
|
|
2847
|
+
]
|
|
2848
|
+
}),
|
|
2849
|
+
/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($6c55ad3905040a74$var$TabPanel, {
|
|
2850
|
+
state: state
|
|
2851
|
+
}, state?.selectedItem?.key)
|
|
2852
|
+
]
|
|
2853
|
+
});
|
|
2854
|
+
}
|
|
2855
|
+
function $6c55ad3905040a74$var$Tab({ item: item, state: state }) {
|
|
2856
|
+
const { key: key, rendered: rendered } = item;
|
|
2857
|
+
const ref = $8zHUo$react.useRef(null);
|
|
2858
|
+
const { tabProps: tabProps, isDisabled: isDisabled, isSelected: isSelected } = (0, $8zHUo$reactaria.useTab)({
|
|
2859
|
+
key: key
|
|
2860
|
+
}, state, ref);
|
|
2861
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
2862
|
+
id: `tab-${key}`,
|
|
2863
|
+
className: "p-tab",
|
|
2864
|
+
ref: ref,
|
|
2865
|
+
"data-disabled": isDisabled,
|
|
2866
|
+
"data-selected": isSelected,
|
|
2867
|
+
...tabProps,
|
|
2868
|
+
children: rendered
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
function $6c55ad3905040a74$var$TabPanel({ state: state, ...props }) {
|
|
2872
|
+
const ref = $8zHUo$react.useRef(null);
|
|
2873
|
+
const { tabPanelProps: tabPanelProps } = (0, $8zHUo$reactaria.useTabPanel)(props, state, ref);
|
|
2874
|
+
return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
2875
|
+
...tabPanelProps,
|
|
2876
|
+
ref: ref,
|
|
2877
|
+
children: state.selectedItem?.props.children
|
|
2878
|
+
});
|
|
2879
|
+
}
|
|
2880
|
+
const $6c55ad3905040a74$export$6d08773d2e66f8f2 = (0, $8zHUo$reactstately.Item);
|
|
2881
|
+
$6c55ad3905040a74$export$b2539bed5023c21c.displayName = "Tabs";
|
|
2882
|
+
|
|
2883
|
+
|
|
2884
|
+
const $4337a58f6fe87df9$export$1aaa3deaa90ea306 = {
|
|
2885
|
+
Item: (0, $6c55ad3905040a74$export$6d08773d2e66f8f2),
|
|
2886
|
+
Root: (0, $6c55ad3905040a74$export$b2539bed5023c21c)
|
|
2887
|
+
};
|
|
2888
|
+
|
|
2889
|
+
|
|
2890
2890
|
|
|
2891
2891
|
|
|
2892
2892
|
function $9fcb37cb330ef9cd$export$54ec01a60f47d33d() {
|
|
@@ -3293,14 +3293,13 @@ function $0f347092d3465402$export$7dacb05d26466c3({ children: children }) {
|
|
|
3293
3293
|
const useClickEvents = ctx.props?.useNativeClickHandler;
|
|
3294
3294
|
const clickProps = (0, $8zHUo$reactaria.usePress)(ctx.triggerProps);
|
|
3295
3295
|
const triggerProps = useClickEvents ? clickProps.pressProps : ctx.triggerProps;
|
|
3296
|
-
console.log(children);
|
|
3297
3296
|
return /*#__PURE__*/ $8zHUo$react.cloneElement(children, {
|
|
3298
3297
|
ref: ctx.triggerRef,
|
|
3299
3298
|
["data-is-pressed"]: clickProps.isPressed,
|
|
3300
3299
|
...triggerProps
|
|
3301
3300
|
});
|
|
3302
3301
|
}
|
|
3303
|
-
function $0f347092d3465402$export$d7e1f420b25549ff({ children: children, offset: offset = 12, placement: placement, style: style, width: width = 160, className: className }) {
|
|
3302
|
+
function $0f347092d3465402$export$d7e1f420b25549ff({ children: children, offset: offset = 12, placement: placement, style: style, width: width = 160, className: className, ...props }) {
|
|
3304
3303
|
const ctx = $8zHUo$react.useContext($0f347092d3465402$var$PopoverContext);
|
|
3305
3304
|
if (!ctx) throw "PopoverContent must be used withing a Popover component";
|
|
3306
3305
|
if (!ctx.overlayState?.isOpen) return null;
|
|
@@ -3309,6 +3308,7 @@ function $0f347092d3465402$export$d7e1f420b25549ff({ children: children, offset:
|
|
|
3309
3308
|
placement: placement,
|
|
3310
3309
|
state: ctx.overlayState,
|
|
3311
3310
|
triggerRef: ctx.triggerRef,
|
|
3311
|
+
...props,
|
|
3312
3312
|
children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
|
|
3313
3313
|
...ctx.overlayProps,
|
|
3314
3314
|
"data-radius": "md",
|