@parrot-co/parrot-ui 0.1.5 → 0.1.7

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 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,14 +42,13 @@ $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);
48
48
  $parcel$export(module.exports, "IconTray", () => $43de550aebbf1320$export$50e381fea3a45244);
49
49
  $parcel$export(module.exports, "Sticker", () => $fedef2bba4e6812a$export$ea98c603db73aee7);
50
- $parcel$export(module.exports, "Tabs", () => $4337a58f6fe87df9$export$1aaa3deaa90ea306);
50
+ $parcel$export(module.exports, "Tabs", () => $6c55ad3905040a74$export$b2539bed5023c21c);
51
+ $parcel$export(module.exports, "Tab", () => $6c55ad3905040a74$export$6d08773d2e66f8f2);
51
52
  $parcel$export(module.exports, "Table", () => $9fcb37cb330ef9cd$export$54ec01a60f47d33d);
52
53
  $parcel$export(module.exports, "Timeline", () => $9ff025417b0a683c$export$e6a97ba2cae5bb94);
53
54
  $parcel$export(module.exports, "Modal", () => $1278141024f0bc4d$export$2b77a92f1a5ad772);
@@ -2684,107 +2685,6 @@ $e04b6210b7063851$export$b25a304ec7d746bb.displayName = "Progress";
2684
2685
 
2685
2686
 
2686
2687
 
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
2688
 
2789
2689
 
2790
2690
 
@@ -2887,6 +2787,102 @@ $fedef2bba4e6812a$export$ea98c603db73aee7.displayName = "Sticker";
2887
2787
 
2888
2788
 
2889
2789
 
2790
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2791
+
2792
+
2793
+
2794
+
2795
+
2796
+
2797
+ function $6c55ad3905040a74$export$b2539bed5023c21c({ className: className, style: style, ...props }) {
2798
+ const state = (0, $8zHUo$reactstately.useTabListState)(props);
2799
+ const tabRef = $8zHUo$react.useRef(null);
2800
+ const [indicatorStyles, setIndicatorStyles] = $8zHUo$react.useState({
2801
+ width: 0,
2802
+ left: 0
2803
+ });
2804
+ const indicatorRef = $8zHUo$react.useRef(null);
2805
+ const { tabListProps: tabListProps } = (0, $8zHUo$reactaria.useTabList)(props, state, tabRef);
2806
+ $8zHUo$react.useEffect(()=>{
2807
+ const selected = tabRef?.current?.querySelector('.p-tab[aria-selected="true"]');
2808
+ setIndicatorStyles({
2809
+ width: selected?.offsetWidth,
2810
+ left: selected?.offsetLeft
2811
+ });
2812
+ }, [
2813
+ state.selectedKey
2814
+ ]);
2815
+ const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)();
2816
+ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
2817
+ style: style,
2818
+ "data-color": theme?.color ?? "violet",
2819
+ position: "relative",
2820
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-tabs", className),
2821
+ children: [
2822
+ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
2823
+ ...tabListProps,
2824
+ ref: tabRef,
2825
+ className: "p-tab-list",
2826
+ children: [
2827
+ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
2828
+ className: "indicator",
2829
+ style: {
2830
+ left: indicatorStyles?.left,
2831
+ bottom: 0,
2832
+ background: "var(--color-10)",
2833
+ height: 2,
2834
+ marginBottom: -1,
2835
+ width: indicatorStyles?.width,
2836
+ transition: "all 0.2s ease"
2837
+ },
2838
+ ref: indicatorRef,
2839
+ position: "absolute"
2840
+ }),
2841
+ [
2842
+ ...state.collection
2843
+ ].map((item)=>/*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($6c55ad3905040a74$var$Tab, {
2844
+ orientation: props.orientation,
2845
+ item: item,
2846
+ state: state
2847
+ }, item.key))
2848
+ ]
2849
+ }),
2850
+ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($6c55ad3905040a74$var$TabPanel, {
2851
+ state: state
2852
+ }, state?.selectedItem?.key)
2853
+ ]
2854
+ });
2855
+ }
2856
+ function $6c55ad3905040a74$var$Tab({ item: item, state: state }) {
2857
+ const { key: key, rendered: rendered } = item;
2858
+ const ref = $8zHUo$react.useRef(null);
2859
+ const { tabProps: tabProps, isDisabled: isDisabled, isSelected: isSelected } = (0, $8zHUo$reactaria.useTab)({
2860
+ key: key
2861
+ }, state, ref);
2862
+ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
2863
+ id: `tab-${key}`,
2864
+ className: "p-tab",
2865
+ ref: ref,
2866
+ "data-disabled": isDisabled,
2867
+ "data-selected": isSelected,
2868
+ ...tabProps,
2869
+ children: rendered
2870
+ });
2871
+ }
2872
+ function $6c55ad3905040a74$var$TabPanel({ state: state, ...props }) {
2873
+ const ref = $8zHUo$react.useRef(null);
2874
+ const { tabPanelProps: tabPanelProps } = (0, $8zHUo$reactaria.useTabPanel)(props, state, ref);
2875
+ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
2876
+ ...tabPanelProps,
2877
+ ref: ref,
2878
+ children: state.selectedItem?.props.children
2879
+ });
2880
+ }
2881
+ const $6c55ad3905040a74$export$6d08773d2e66f8f2 = (0, $8zHUo$reactstately.Item);
2882
+
2883
+
2884
+
2885
+
2890
2886
 
2891
2887
 
2892
2888
  function $9fcb37cb330ef9cd$export$54ec01a60f47d33d() {