@smurfox/proxy-ui 0.2.2 → 0.3.1
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/README.md +66 -11
- package/dist/module.json +1 -1
- package/dist/runtime/assets/empty-state.json +1 -0
- package/dist/runtime/components/Chip.vue +3 -3
- package/dist/runtime/components/Dropdown.d.vue.ts +17 -9
- package/dist/runtime/components/Dropdown.vue +7 -1
- package/dist/runtime/components/Dropdown.vue.d.ts +17 -9
- package/dist/runtime/components/Lottie.d.vue.ts +13 -0
- package/dist/runtime/components/Lottie.vue +50 -0
- package/dist/runtime/components/Lottie.vue.d.ts +13 -0
- package/dist/runtime/components/Table.d.vue.ts +16 -4
- package/dist/runtime/components/Table.vue +55 -8
- package/dist/runtime/components/Table.vue.d.ts +16 -4
- package/dist/runtime/types/index.d.ts +33 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -589,6 +589,12 @@ A floating panel anchored to an activator element. Opens on click and closes on
|
|
|
589
589
|
</PUDropdown>
|
|
590
590
|
```
|
|
591
591
|
|
|
592
|
+
**Props**
|
|
593
|
+
|
|
594
|
+
| Prop | Type | Default | Description |
|
|
595
|
+
| -------------- | -------- | ----------- | ------------------------------------------------------------------ |
|
|
596
|
+
| `menuMinWidth` | `string` | `'min-w-52'` | Tailwind min-width class applied to the floating panel. |
|
|
597
|
+
|
|
592
598
|
**Slots**
|
|
593
599
|
|
|
594
600
|
| Slot | Description |
|
|
@@ -616,6 +622,43 @@ const closeDropdown = inject("closeDropdown");
|
|
|
616
622
|
|
|
617
623
|
---
|
|
618
624
|
|
|
625
|
+
### PULottie
|
|
626
|
+
|
|
627
|
+
A Lottie animation player powered by `vue3-lottie`. Renders inside `ClientOnly` so it is SSR-safe, and shrinks 80px in width and height on screens narrower than 768px.
|
|
628
|
+
|
|
629
|
+
```vue
|
|
630
|
+
<script setup>
|
|
631
|
+
import animationData from "./my-animation.json";
|
|
632
|
+
</script>
|
|
633
|
+
|
|
634
|
+
<template>
|
|
635
|
+
<PULottie :animation-data="animationData" />
|
|
636
|
+
</template>
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
**Props**
|
|
640
|
+
|
|
641
|
+
| Prop | Type | Default | Description |
|
|
642
|
+
| --------------- | --------- | ------- | ------------------------------------------------------------ |
|
|
643
|
+
| `animationData` | `object` | — | Parsed Lottie JSON object. Required. |
|
|
644
|
+
| `loop` | `boolean` | `true` | Whether the animation loops. |
|
|
645
|
+
| `height` | `number` | `420` | Height in pixels. Reduced by 80px on viewports below 768px. |
|
|
646
|
+
| `width` | `number` | `420` | Width in pixels. Reduced by 80px on viewports below 768px. |
|
|
647
|
+
|
|
648
|
+
**Examples**
|
|
649
|
+
|
|
650
|
+
```vue
|
|
651
|
+
<!-- Play once -->
|
|
652
|
+
<PULottie :animation-data="data" :loop="false" />
|
|
653
|
+
|
|
654
|
+
<!-- Custom size -->
|
|
655
|
+
<PULottie :animation-data="data" :width="240" :height="240" />
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
> `PUTable` ships with a bundled empty-state Lottie that uses this component internally. You can disable or override it via the table's `showEmptyAnimation` and `emptyAnimationData` props.
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
|
|
619
662
|
### PUTable
|
|
620
663
|
|
|
621
664
|
A responsive data table that renders as a normal `<table>` on `md+` viewports and switches to a stack of cards on mobile. Cells are rendered through per-column scoped slots so you can fully customize their content.
|
|
@@ -626,16 +669,22 @@ A responsive data table that renders as a normal `<table>` on `md+` viewports an
|
|
|
626
669
|
|
|
627
670
|
**Props**
|
|
628
671
|
|
|
629
|
-
| Prop
|
|
630
|
-
|
|
|
631
|
-
| `items`
|
|
632
|
-
| `columns`
|
|
633
|
-
| `rounded`
|
|
634
|
-
| `isBordered`
|
|
635
|
-
| `isSelectable`
|
|
636
|
-
| `itemsSize`
|
|
637
|
-
| `headerColor`
|
|
638
|
-
| `bodyColor`
|
|
672
|
+
| Prop | Type | Default | Description |
|
|
673
|
+
| ---------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
674
|
+
| `items` | `Array<{ id: string \| number, [key: string]: unknown }>` | `[]` | Row data. Each item must have an `id` used as the Vue key. |
|
|
675
|
+
| `columns` | `{ name: string, id: string, width?: string }[]` | `[]` | Column definitions. `id` is the row key to read, `width` is CSS width. |
|
|
676
|
+
| `rounded` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| '3xl' \| 'full'` | `'lg'` | Border radius of the outer container. |
|
|
677
|
+
| `isBordered` | `boolean` | `false` | Adds an outer border around the table. |
|
|
678
|
+
| `isSelectable` | `boolean` | `false` | Enables row click + hover effects (cursor, bg highlight, motion-v lift). Emits `row-click`. |
|
|
679
|
+
| `itemsSize` | `'sm' \| 'md' \| 'lg'` | `'md'` | Vertical padding of body rows. `sm` → `py-2`, `md` → `py-4`, `lg` → `py-6`. |
|
|
680
|
+
| `headerColor` | `string` | `bg-[#F4F4F5] text-[#71717A] dark:bg-[#27272A] dark:text-[#A1A1AA]` | Tailwind classes applied to `<thead>`. |
|
|
681
|
+
| `bodyColor` | `string` | `''` | Tailwind classes applied to `<tbody>`. |
|
|
682
|
+
| `hasShadow` | `boolean` | `true` | Adds an iOS-style outer shadow to the table container. |
|
|
683
|
+
| `emptyStateTitle` | `string` | `'No results found'` | Heading shown when `items` is empty. |
|
|
684
|
+
| `emptyStateDescription`| `string` | `'Try adjusting your search or filter to find what you\'re looking for.'` | Sub-text shown under the empty-state title. |
|
|
685
|
+
| `showEmptyAnimation` | `boolean` | `true` | Renders a bundled Lottie above the empty-state text. Set to `false` to hide it. |
|
|
686
|
+
| `emptyAnimationData` | `object \| undefined` | bundled `empty-state.json` | Override the empty-state Lottie with your own animation JSON object. |
|
|
687
|
+
| `emptyAnimationSize` | `number` | `220` | Width and height of the empty-state animation, in pixels. |
|
|
639
688
|
|
|
640
689
|
**Events**
|
|
641
690
|
|
|
@@ -727,10 +776,16 @@ import type {
|
|
|
727
776
|
TabItem,
|
|
728
777
|
TabsProps,
|
|
729
778
|
TabsRounded,
|
|
779
|
+
LottieProps,
|
|
780
|
+
TableProps,
|
|
781
|
+
TableColumn,
|
|
782
|
+
TableItem,
|
|
783
|
+
TableRounded,
|
|
784
|
+
TableItemsSize,
|
|
730
785
|
} from "proxy-ui";
|
|
731
786
|
```
|
|
732
787
|
|
|
733
|
-
> `PUTextArea`, `PUSelect`,
|
|
788
|
+
> `PUTextArea`, `PUSelect`, and `PUDropdown` define their props inline and do not export dedicated `Props` types. They reuse `InputVariant` and `InputRounded` from the same package.
|
|
734
789
|
|
|
735
790
|
---
|
|
736
791
|
|
package/dist/module.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.20","a":"","k":"","d":"","tc":""},"fr":30,"ip":0,"op":90,"w":1200,"h":1200,"nm":"box","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"eye","parent":5,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":17,"s":[100]},{"t":18.000000733155,"s":[0]}],"ix":11},"r":{"a":0,"k":-3.26,"ix":10},"p":{"a":0,"k":[615.862,463.104,0],"ix":2},"a":{"a":0,"k":[127.58,82.222,0],"ix":1},"s":{"a":0,"k":[100,71.332,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.039,0],[0.6,1.171],[-0.826,1.073],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[-1.309,0],[-0.618,-1.204],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[-0.038,0.002]],"v":[[-32.856,35.435],[-35.969,33.533],[-35.631,29.803],[14.481,-35.435],[20.033,-31.17],[-25.569,28.195],[36.358,26.167],[36.587,33.164],[-32.741,35.433]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[218.323,35.685],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[-0.233,-1.324],[1.093,-0.784]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[1.294,0.366],[0.232,1.324],[0,0]],"v":[[-32.586,36.912],[-36.667,31.225],[25.042,-13.055],[-35.578,-30.176],[-33.676,-36.912],[33.938,-17.816],[36.435,-15.052],[35.026,-11.604]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[36.917,127.282],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":119.000004846969,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"right eye","parent":5,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":18,"s":[0]},{"t":19.0000007738859,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[704.616,429.018,0],"ix":2},"a":{"a":0,"k":[11.582,20.934,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.5,0.5,0.5],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":38,"s":[100,100,100]},{"i":{"x":[0.5,0.5,0.5],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":43,"s":[100,0,100]},{"t":48.0000019550801,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-6.258,0],[0,11.422],[6.259,0],[0,-11.423]],"o":[[6.259,0],[0,-11.423],[-6.258,0],[0,11.422]],"v":[[0,20.683],[11.332,0],[0,-20.683],[-11.332,0]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[11.582,20.934],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":119.000004846969,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"left eye","parent":5,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":18,"s":[0]},{"t":19.0000007738859,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[522.057,503.396,0],"ix":2},"a":{"a":0,"k":[11.582,20.933,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.5,0.5,0.5],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":38,"s":[100,100,100]},{"i":{"x":[0.5,0.5,0.5],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":43,"s":[100,0,100]},{"t":48.0000019550801,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-6.259,0],[0,11.423],[6.258,0],[0,-11.422]],"o":[[6.258,0],[0,-11.422],[-6.259,0],[0,11.423]],"v":[[0.001,20.683],[11.332,-0.001],[0.001,-20.683],[-11.332,-0.001]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[11.582,20.933],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":119.000004846969,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"mouth","parent":5,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[635.424,595.739,0],"ix":2},"a":{"a":0,"k":[55.31,37.779,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[14.989,-38.593],[0,0],[-24.018,3.631],[-7.024,-8.854],[0,0],[20.125,-3.041]],"o":[[0,0],[16.303,-41.974],[22.978,-3.473],[0,0],[-4.857,-6.125],[-20.726,3.131]],"v":[[-47.702,37.528],[-55.061,34.673],[5.705,-34.055],[55.061,-12.846],[48.876,-7.941],[6.888,-26.251]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[55.31,37.779],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":119.000004846969,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"box","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":13,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":20,"s":[-3.323]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":30,"s":[-3.323]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":32,"s":[1.526]},{"t":34.0000013848484,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.97,"y":1},"o":{"x":0.5,"y":0},"t":13,"s":[599.823,1019.934,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.51,"y":1},"o":{"x":0.5,"y":0},"t":20,"s":[599.823,883.934,0],"to":[0,0,0],"ti":[0,0,0]},{"t":30.0000012219251,"s":[599.823,1027.934,0]}],"ix":2},"a":{"a":0,"k":[396.637,841.845,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.5,0.5,0.5],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":2,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,0.833,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":11,"s":[100,55.00000000000001,100]},{"t":17.0000006924242,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-254.471,-127.467],[140.402,44.408],[143.989,169.658],[254.47,124.071],[251.131,-1.97],[-155.426,-169.658]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.9607843137254902,0.19607843137254902,0.19607843137254902,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[404.144,234.244],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[-0.002,170.176],[396.387,4.152],[3.11,-170.176],[-396.387,0.001]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.6078431372549019,0.6078431372549019,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[396.637,170.427],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.5,"y":1},"o":{"x":0.5,"y":0},"t":2,"s":[{"i":[[0,0],[0.326,-170],[0,0],[0,0],[-1.219,152],[0,0]],"o":[[0,0],[-0.326,170],[0,0],[0,0],[1.219,-152],[0,0]],"v":[[-197.227,-171.62],[-198.227,84.256],[-197.227,339.161],[198.227,174.49],[198.227,-59.743],[198.227,-338.785]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.5,"y":0},"t":11,"s":[{"i":[[0,0],[0.326,-170],[0,0],[0,0],[-1.219,152],[0,0]],"o":[[0,0],[-0.326,170],[0,0],[0,0],[1.219,-152],[0,0]],"v":[[-197.227,-171.62],[-221.227,84.256],[-197.227,339.161],[198.227,174.49],[218.227,-68.315],[198.227,-338.785]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":17,"s":[{"i":[[0,0],[0.326,-170],[0,0],[0,0],[-1.219,152],[0,0]],"o":[[0,0],[-0.326,170],[0,0],[0,0],[1.219,-152],[0,0]],"v":[[-197.227,-171.62],[-198.227,84.256],[-197.227,339.161],[198.227,174.49],[198.227,-59.743],[198.227,-338.785]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":30,"s":[{"i":[[0,0],[0.326,-170],[0,0],[0,0],[-1.219,152],[0,0]],"o":[[0,0],[-0.326,170],[0,0],[0,0],[1.219,-152],[0,0]],"v":[[-197.227,-171.62],[-198.227,84.256],[-197.227,339.161],[198.227,174.49],[198.227,-59.743],[198.227,-338.785]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":32,"s":[{"i":[[0,0],[0.326,-170],[0,0],[0,0],[-1.219,152],[0,0]],"o":[[0,0],[-0.326,170],[0,0],[0,0],[1.219,-152],[0,0]],"v":[[-197.227,-171.62],[-211.196,85.602],[-197.227,339.161],[198.227,174.49],[205.172,-61.929],[198.227,-338.785]],"c":true}]},{"t":34.0000013848484,"s":[{"i":[[0,0],[0.326,-170],[0,0],[0,0],[-1.219,152],[0,0]],"o":[[0,0],[-0.326,170],[0,0],[0,0],[1.219,-152],[0,0]],"v":[[-197.227,-171.62],[-198.227,84.256],[-197.227,339.161],[198.227,174.49],[198.227,-59.743],[198.227,-338.785]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.32941176470588235,0.32941176470588235,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[593.868,512.154],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 3","np":2,"cix":2,"bm":0,"ix":3,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.5,"y":1},"o":{"x":0.5,"y":0},"t":2,"s":[{"i":[[0,0],[0,0],[0,0],[0.754,213.01],[0,0]],"o":[[0,0],[0,0],[0,0],[-0.754,-213.01],[0,0]],"v":[[198.192,-170.583],[198.192,339.948],[-198.193,168.738],[-196.375,-76.442],[-196.301,-339.948]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.5,"y":0},"t":11,"s":[{"i":[[0,0],[0,0],[0,0],[0.754,213.01],[0,0]],"o":[[0,0],[0,0],[0,0],[-0.754,-213.01],[0,0]],"v":[[198.193,-170.583],[198.193,339.948],[-198.193,168.738],[-220.375,-70.727],[-196.301,-339.948]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":17,"s":[{"i":[[0,0],[0,0],[0,0],[0.754,213.01],[0,0]],"o":[[0,0],[0,0],[0,0],[-0.754,-213.01],[0,0]],"v":[[198.192,-170.583],[198.192,339.948],[-198.193,168.738],[-196.375,-76.442],[-196.301,-339.948]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":30,"s":[{"i":[[0,0],[0,0],[0,0],[0.754,213.01],[0,0]],"o":[[0,0],[0,0],[0,0],[-0.754,-213.01],[0,0]],"v":[[198.192,-170.583],[198.192,339.948],[-198.193,168.738],[-196.375,-76.442],[-196.301,-339.948]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":32,"s":[{"i":[[0,0],[0,0],[0,0],[0.754,213.01],[0,0]],"o":[[0,0],[0,0],[0,0],[-0.754,-213.01],[0,0]],"v":[[198.193,-170.583],[198.193,339.948],[-198.193,168.738],[-208.37,-76.122],[-196.301,-339.948]],"c":true}]},{"t":34.0000013848484,"s":[{"i":[[0,0],[0,0],[0,0],[0.754,213.01],[0,0]],"o":[[0,0],[0,0],[0,0],[-0.754,-213.01],[0,0]],"v":[[198.192,-170.583],[198.192,339.948],[-198.193,168.738],[-196.375,-76.442],[-196.301,-339.948]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.9607843137254902,0.19607843137254902,0.19607843137254902,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[198.443,511.187],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 4","np":2,"cix":2,"bm":0,"ix":4,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":119.000004846969,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"bg","sr":1,"ks":{"o":{"a":0,"k":30,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[599.425,597.205,0],"ix":2},"a":{"a":0,"k":[-0.5,8,0],"ix":1},"s":{"a":0,"k":[115.063,115.063,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[940,940],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.909803921569,0.827450980392,0.909803921569,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-0.5,8],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":179.000007290819,"st":0,"bm":0}],"markers":[]}
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
<script setup>
|
|
32
32
|
const sizes = {
|
|
33
|
-
sm: "text-xs min-w-8 py-
|
|
34
|
-
md: "text-xs min-w-12 py-1
|
|
35
|
-
lg: "text-sm min-w-14 py-
|
|
33
|
+
sm: "text-xs min-w-8 py-0.5 px-2",
|
|
34
|
+
md: "text-xs min-w-12 py-1 px-2.5",
|
|
35
|
+
lg: "text-sm min-w-14 py-1.5 px-4"
|
|
36
36
|
};
|
|
37
37
|
const variantClasses = {
|
|
38
38
|
default: "",
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
menuMinWidth?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {}, __VLS_17: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
activator?: (props: typeof __VLS_1) => any;
|
|
7
|
+
} & {
|
|
8
|
+
content?: (props: typeof __VLS_17) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
menuMinWidth: string;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
1
14
|
declare const _default: typeof __VLS_export;
|
|
2
15
|
export default _default;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
-
type __VLS_Slots = {
|
|
9
|
-
activator?: ((props: {}) => any) | undefined;
|
|
10
|
-
} & {
|
|
11
|
-
content?: ((props: {}) => any) | undefined;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
12
20
|
};
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
:initial="{ scale: 0.9, opacity: 0, y: -10 }"
|
|
14
14
|
:exit="{ opacity: 0 }"
|
|
15
15
|
:animate="{ scale: 1, opacity: 1, y: 0 }"
|
|
16
|
-
class="
|
|
16
|
+
:class="[
|
|
17
|
+
'absolute right-0 z-50 mt-2 origin-top-right bg-white border border-gray-100 rounded-xl shadow-xl dark:bg-[#18181B] dark:border-black/40',
|
|
18
|
+
props.menuMinWidth
|
|
19
|
+
]"
|
|
17
20
|
@click="handleContentClick"
|
|
18
21
|
>
|
|
19
22
|
<slot name="content" />
|
|
@@ -25,6 +28,9 @@
|
|
|
25
28
|
<script setup>
|
|
26
29
|
import { AnimatePresence, motion } from "motion-v";
|
|
27
30
|
import { ref, onMounted, onUnmounted, provide } from "vue";
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
menuMinWidth: { type: String, required: false, default: "min-w-52" }
|
|
33
|
+
});
|
|
28
34
|
const isOpen = ref(false);
|
|
29
35
|
const dropdownRef = ref(null);
|
|
30
36
|
const toggle = () => {
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
menuMinWidth?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {}, __VLS_17: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
activator?: (props: typeof __VLS_1) => any;
|
|
7
|
+
} & {
|
|
8
|
+
content?: (props: typeof __VLS_17) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
menuMinWidth: string;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
1
14
|
declare const _default: typeof __VLS_export;
|
|
2
15
|
export default _default;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
-
type __VLS_Slots = {
|
|
9
|
-
activator?: ((props: {}) => any) | undefined;
|
|
10
|
-
} & {
|
|
11
|
-
content?: ((props: {}) => any) | undefined;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
12
20
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
animationData: object;
|
|
3
|
+
loop?: boolean;
|
|
4
|
+
height?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
8
|
+
height: number;
|
|
9
|
+
width: number;
|
|
10
|
+
loop: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ClientOnly>
|
|
3
|
+
<Vue3Lottie
|
|
4
|
+
:loop="loop"
|
|
5
|
+
:height="effectiveHeight"
|
|
6
|
+
:width="effectiveWidth"
|
|
7
|
+
:animation-data="animationData"
|
|
8
|
+
/>
|
|
9
|
+
<template #fallback>
|
|
10
|
+
<div
|
|
11
|
+
class="flex items-center justify-center bg-gray-100 dark:bg-gray-800 rounded-lg"
|
|
12
|
+
:style="{ width: `${effectiveWidth}px`, height: `${effectiveHeight}px` }"
|
|
13
|
+
>
|
|
14
|
+
<div class="text-gray-500 dark:text-gray-400">
|
|
15
|
+
Loading animation...
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
</ClientOnly>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup>
|
|
23
|
+
import { computed, onMounted, onUnmounted, ref } from "vue";
|
|
24
|
+
import { Vue3Lottie } from "vue3-lottie";
|
|
25
|
+
const props = defineProps({
|
|
26
|
+
animationData: { type: Object, required: true },
|
|
27
|
+
loop: { type: Boolean, required: false, default: true },
|
|
28
|
+
height: { type: Number, required: false, default: 420 },
|
|
29
|
+
width: { type: Number, required: false, default: 420 }
|
|
30
|
+
});
|
|
31
|
+
const isMobile = ref(false);
|
|
32
|
+
let mq = null;
|
|
33
|
+
function handleChange(e) {
|
|
34
|
+
isMobile.value = e.matches;
|
|
35
|
+
}
|
|
36
|
+
onMounted(() => {
|
|
37
|
+
mq = window.matchMedia("(max-width: 767px)");
|
|
38
|
+
isMobile.value = mq.matches;
|
|
39
|
+
mq.addEventListener("change", handleChange);
|
|
40
|
+
});
|
|
41
|
+
onUnmounted(() => {
|
|
42
|
+
if (mq) mq.removeEventListener("change", handleChange);
|
|
43
|
+
});
|
|
44
|
+
const effectiveHeight = computed(
|
|
45
|
+
() => isMobile.value ? Math.max(props.height - 80, 0) : props.height
|
|
46
|
+
);
|
|
47
|
+
const effectiveWidth = computed(
|
|
48
|
+
() => isMobile.value ? Math.max(props.width - 80, 0) : props.width
|
|
49
|
+
);
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
animationData: object;
|
|
3
|
+
loop?: boolean;
|
|
4
|
+
height?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
8
|
+
height: number;
|
|
9
|
+
width: number;
|
|
10
|
+
loop: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -30,6 +30,12 @@ type __VLS_Props = {
|
|
|
30
30
|
headerColor?: string;
|
|
31
31
|
bodyColor?: string;
|
|
32
32
|
itemsSize?: keyof typeof sizes;
|
|
33
|
+
hasShadow?: boolean;
|
|
34
|
+
emptyStateTitle?: string;
|
|
35
|
+
emptyStateDescription?: string;
|
|
36
|
+
showEmptyAnimation?: boolean;
|
|
37
|
+
emptyAnimationData?: object;
|
|
38
|
+
emptyAnimationSize?: number;
|
|
33
39
|
};
|
|
34
40
|
declare var __VLS_10: `cell-${string}`, __VLS_11: {
|
|
35
41
|
item: {
|
|
@@ -37,7 +43,7 @@ declare var __VLS_10: `cell-${string}`, __VLS_11: {
|
|
|
37
43
|
id: string | number;
|
|
38
44
|
};
|
|
39
45
|
value: unknown;
|
|
40
|
-
},
|
|
46
|
+
}, __VLS_26: {
|
|
41
47
|
item: {
|
|
42
48
|
[key: string]: unknown;
|
|
43
49
|
id: string | number;
|
|
@@ -47,7 +53,7 @@ declare var __VLS_10: `cell-${string}`, __VLS_11: {
|
|
|
47
53
|
id: string;
|
|
48
54
|
width?: string;
|
|
49
55
|
}[];
|
|
50
|
-
},
|
|
56
|
+
}, __VLS_29: `cell-${string}`, __VLS_30: {
|
|
51
57
|
item: {
|
|
52
58
|
[key: string]: unknown;
|
|
53
59
|
id: string | number;
|
|
@@ -57,9 +63,9 @@ declare var __VLS_10: `cell-${string}`, __VLS_11: {
|
|
|
57
63
|
type __VLS_Slots = {} & {
|
|
58
64
|
[K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
|
|
59
65
|
} & {
|
|
60
|
-
[K in NonNullable<typeof
|
|
66
|
+
[K in NonNullable<typeof __VLS_29>]?: (props: typeof __VLS_30) => any;
|
|
61
67
|
} & {
|
|
62
|
-
'mobile-card'?: (props: typeof
|
|
68
|
+
'mobile-card'?: (props: typeof __VLS_26) => any;
|
|
63
69
|
};
|
|
64
70
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
65
71
|
"row-click": (item: {
|
|
@@ -79,6 +85,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
79
85
|
width?: string;
|
|
80
86
|
}[];
|
|
81
87
|
isBordered: boolean;
|
|
88
|
+
hasShadow: boolean;
|
|
82
89
|
items: Array<{
|
|
83
90
|
id: string | number;
|
|
84
91
|
[key: string]: unknown;
|
|
@@ -87,6 +94,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
87
94
|
headerColor: string;
|
|
88
95
|
bodyColor: string;
|
|
89
96
|
itemsSize: keyof typeof sizes;
|
|
97
|
+
emptyStateTitle: string;
|
|
98
|
+
emptyStateDescription: string;
|
|
99
|
+
showEmptyAnimation: boolean;
|
|
100
|
+
emptyAnimationData: object;
|
|
101
|
+
emptyAnimationSize: number;
|
|
90
102
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
91
103
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
92
104
|
declare const _default: typeof __VLS_export;
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
class="hidden md:block overflow-clip"
|
|
6
6
|
:class="[
|
|
7
7
|
roundedClasses[props.rounded],
|
|
8
|
-
isBordered ? 'border border-gray-200 dark:border-white/10 ' : ''
|
|
8
|
+
isBordered ? 'border border-gray-200 dark:border-white/10 ' : '',
|
|
9
|
+
hasShadow ? 'pu-shadow-ios' : ''
|
|
9
10
|
]"
|
|
10
11
|
>
|
|
11
12
|
<table class="w-full text-sm text-left rtl:text-right table-fixed">
|
|
@@ -34,7 +35,9 @@
|
|
|
34
35
|
:key="item.id"
|
|
35
36
|
:while-hover="props.isSelectable ? { scale: 1.01 } : {}"
|
|
36
37
|
:transition="{ type: 'spring', stiffness: 400, damping: 30 }"
|
|
37
|
-
:class="
|
|
38
|
+
:class="
|
|
39
|
+
props.isSelectable ? 'cursor-pointer hover:bg-gray-100 dark:hover:bg-white/5' : ''
|
|
40
|
+
"
|
|
38
41
|
@click="props.isSelectable && emit('row-click', item)"
|
|
39
42
|
>
|
|
40
43
|
<td
|
|
@@ -58,9 +61,25 @@
|
|
|
58
61
|
<tr v-else>
|
|
59
62
|
<td
|
|
60
63
|
:colspan="columns.length"
|
|
61
|
-
class="text-
|
|
64
|
+
class="text-center py-10"
|
|
62
65
|
>
|
|
63
|
-
|
|
66
|
+
<div class="flex flex-col items-center gap-1">
|
|
67
|
+
<Lottie
|
|
68
|
+
v-if="props.showEmptyAnimation"
|
|
69
|
+
:animation-data="props.emptyAnimationData ?? defaultEmptyAnimation"
|
|
70
|
+
:width="props.emptyAnimationSize"
|
|
71
|
+
:height="props.emptyAnimationSize"
|
|
72
|
+
/>
|
|
73
|
+
<p class="text-lg font-medium text-black/70 dark:text-white/70">
|
|
74
|
+
{{ props.emptyStateTitle }}
|
|
75
|
+
</p>
|
|
76
|
+
<p
|
|
77
|
+
v-if="props.emptyStateDescription"
|
|
78
|
+
class="text-sm text-black/50 dark:text-white/50"
|
|
79
|
+
>
|
|
80
|
+
{{ props.emptyStateDescription }}
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
64
83
|
</td>
|
|
65
84
|
</tr>
|
|
66
85
|
</tbody>
|
|
@@ -75,7 +94,9 @@
|
|
|
75
94
|
:while-hover="props.isSelectable ? { y: -3 } : {}"
|
|
76
95
|
:transition="{ type: 'spring', stiffness: 400, damping: 25 }"
|
|
77
96
|
class="bg-white dark:bg-[#18181B] border border-gray-200 dark:border-white/10 rounded-lg p-4 shadow-sm"
|
|
78
|
-
:class="
|
|
97
|
+
:class="
|
|
98
|
+
props.isSelectable ? 'cursor-pointer hover:bg-gray-50 dark:hover:bg-white/5 hover:shadow-md' : ''
|
|
99
|
+
"
|
|
79
100
|
@click="props.isSelectable && emit('row-click', item)"
|
|
80
101
|
>
|
|
81
102
|
<slot
|
|
@@ -112,9 +133,23 @@
|
|
|
112
133
|
<!-- Mensaje cuando no hay items -->
|
|
113
134
|
<div
|
|
114
135
|
v-if="items.length === 0"
|
|
115
|
-
class="text-
|
|
136
|
+
class="text-center py-10 flex flex-col items-center gap-1"
|
|
116
137
|
>
|
|
117
|
-
|
|
138
|
+
<Lottie
|
|
139
|
+
v-if="props.showEmptyAnimation"
|
|
140
|
+
:animation-data="props.emptyAnimationData ?? defaultEmptyAnimation"
|
|
141
|
+
:width="props.emptyAnimationSize"
|
|
142
|
+
:height="props.emptyAnimationSize"
|
|
143
|
+
/>
|
|
144
|
+
<p class="text-lg font-medium text-black/70 dark:text-white/70">
|
|
145
|
+
{{ props.emptyStateTitle }}
|
|
146
|
+
</p>
|
|
147
|
+
<p
|
|
148
|
+
v-if="props.emptyStateDescription"
|
|
149
|
+
class="text-sm text-black/50 dark:text-white/50"
|
|
150
|
+
>
|
|
151
|
+
{{ props.emptyStateDescription }}
|
|
152
|
+
</p>
|
|
118
153
|
</div>
|
|
119
154
|
</div>
|
|
120
155
|
</div>
|
|
@@ -122,6 +157,8 @@
|
|
|
122
157
|
|
|
123
158
|
<script setup>
|
|
124
159
|
import { motion } from "motion-v";
|
|
160
|
+
import Lottie from "./Lottie.vue";
|
|
161
|
+
import defaultEmptyAnimation from "../assets/empty-state.json";
|
|
125
162
|
const roundedClasses = {
|
|
126
163
|
"none": "rounded-none",
|
|
127
164
|
"xs": "rounded-xs",
|
|
@@ -190,7 +227,17 @@ const props = defineProps({
|
|
|
190
227
|
isSelectable: { type: Boolean, required: false, default: false },
|
|
191
228
|
headerColor: { type: String, required: false, default: "bg-[#F4F4F5] text-[#71717A] dark:bg-[#27272A] dark:text-[#A1A1AA]" },
|
|
192
229
|
bodyColor: { type: String, required: false, default: "" },
|
|
193
|
-
itemsSize: { type: null, required: false, default: "md" }
|
|
230
|
+
itemsSize: { type: null, required: false, default: "md" },
|
|
231
|
+
hasShadow: { type: Boolean, required: false, default: true },
|
|
232
|
+
emptyStateTitle: { type: String, required: false, default: "No results found" },
|
|
233
|
+
emptyStateDescription: { type: String, required: false, default: "Try adjusting your search or filter to find what you're looking for." },
|
|
234
|
+
showEmptyAnimation: { type: Boolean, required: false, default: true },
|
|
235
|
+
emptyAnimationData: { type: Object, required: false, default: void 0 },
|
|
236
|
+
emptyAnimationSize: { type: Number, required: false, default: 220 }
|
|
194
237
|
});
|
|
195
238
|
const emit = defineEmits(["row-click"]);
|
|
196
239
|
</script>
|
|
240
|
+
|
|
241
|
+
<style scoped>
|
|
242
|
+
.pu-shadow-ios{box-shadow:0 10px 30px rgba(0,0,0,.05)}
|
|
243
|
+
</style>
|
|
@@ -30,6 +30,12 @@ type __VLS_Props = {
|
|
|
30
30
|
headerColor?: string;
|
|
31
31
|
bodyColor?: string;
|
|
32
32
|
itemsSize?: keyof typeof sizes;
|
|
33
|
+
hasShadow?: boolean;
|
|
34
|
+
emptyStateTitle?: string;
|
|
35
|
+
emptyStateDescription?: string;
|
|
36
|
+
showEmptyAnimation?: boolean;
|
|
37
|
+
emptyAnimationData?: object;
|
|
38
|
+
emptyAnimationSize?: number;
|
|
33
39
|
};
|
|
34
40
|
declare var __VLS_10: `cell-${string}`, __VLS_11: {
|
|
35
41
|
item: {
|
|
@@ -37,7 +43,7 @@ declare var __VLS_10: `cell-${string}`, __VLS_11: {
|
|
|
37
43
|
id: string | number;
|
|
38
44
|
};
|
|
39
45
|
value: unknown;
|
|
40
|
-
},
|
|
46
|
+
}, __VLS_26: {
|
|
41
47
|
item: {
|
|
42
48
|
[key: string]: unknown;
|
|
43
49
|
id: string | number;
|
|
@@ -47,7 +53,7 @@ declare var __VLS_10: `cell-${string}`, __VLS_11: {
|
|
|
47
53
|
id: string;
|
|
48
54
|
width?: string;
|
|
49
55
|
}[];
|
|
50
|
-
},
|
|
56
|
+
}, __VLS_29: `cell-${string}`, __VLS_30: {
|
|
51
57
|
item: {
|
|
52
58
|
[key: string]: unknown;
|
|
53
59
|
id: string | number;
|
|
@@ -57,9 +63,9 @@ declare var __VLS_10: `cell-${string}`, __VLS_11: {
|
|
|
57
63
|
type __VLS_Slots = {} & {
|
|
58
64
|
[K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
|
|
59
65
|
} & {
|
|
60
|
-
[K in NonNullable<typeof
|
|
66
|
+
[K in NonNullable<typeof __VLS_29>]?: (props: typeof __VLS_30) => any;
|
|
61
67
|
} & {
|
|
62
|
-
'mobile-card'?: (props: typeof
|
|
68
|
+
'mobile-card'?: (props: typeof __VLS_26) => any;
|
|
63
69
|
};
|
|
64
70
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
65
71
|
"row-click": (item: {
|
|
@@ -79,6 +85,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
79
85
|
width?: string;
|
|
80
86
|
}[];
|
|
81
87
|
isBordered: boolean;
|
|
88
|
+
hasShadow: boolean;
|
|
82
89
|
items: Array<{
|
|
83
90
|
id: string | number;
|
|
84
91
|
[key: string]: unknown;
|
|
@@ -87,6 +94,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
87
94
|
headerColor: string;
|
|
88
95
|
bodyColor: string;
|
|
89
96
|
itemsSize: keyof typeof sizes;
|
|
97
|
+
emptyStateTitle: string;
|
|
98
|
+
emptyStateDescription: string;
|
|
99
|
+
showEmptyAnimation: boolean;
|
|
100
|
+
emptyAnimationData: object;
|
|
101
|
+
emptyAnimationSize: number;
|
|
90
102
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
91
103
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
92
104
|
declare const _default: typeof __VLS_export;
|
|
@@ -72,3 +72,36 @@ export interface TabsProps {
|
|
|
72
72
|
disabledTabs?: string[];
|
|
73
73
|
isVertical?: boolean;
|
|
74
74
|
}
|
|
75
|
+
export interface LottieProps {
|
|
76
|
+
animationData: object;
|
|
77
|
+
loop?: boolean;
|
|
78
|
+
height?: number;
|
|
79
|
+
width?: number;
|
|
80
|
+
}
|
|
81
|
+
export type TableRounded = GlobalRounded;
|
|
82
|
+
export type TableItemsSize = 'sm' | 'md' | 'lg';
|
|
83
|
+
export interface TableColumn {
|
|
84
|
+
name: string;
|
|
85
|
+
id: string;
|
|
86
|
+
width?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface TableItem {
|
|
89
|
+
id: string | number;
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
}
|
|
92
|
+
export interface TableProps {
|
|
93
|
+
items?: TableItem[];
|
|
94
|
+
columns?: TableColumn[];
|
|
95
|
+
rounded?: TableRounded;
|
|
96
|
+
isBordered?: boolean;
|
|
97
|
+
isSelectable?: boolean;
|
|
98
|
+
headerColor?: string;
|
|
99
|
+
bodyColor?: string;
|
|
100
|
+
itemsSize?: TableItemsSize;
|
|
101
|
+
hasShadow?: boolean;
|
|
102
|
+
emptyStateTitle?: string;
|
|
103
|
+
emptyStateDescription?: string;
|
|
104
|
+
showEmptyAnimation?: boolean;
|
|
105
|
+
emptyAnimationData?: object;
|
|
106
|
+
emptyAnimationSize?: number;
|
|
107
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smurfox/proxy-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A UI component library built for Nuxt 4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"@nuxt/fonts": "^0.14.0",
|
|
57
57
|
"@nuxt/icon": "^2.2.1",
|
|
58
58
|
"@nuxt/kit": "^4.4.2",
|
|
59
|
-
"motion-v": "^1.0.0"
|
|
59
|
+
"motion-v": "^1.0.0",
|
|
60
|
+
"vue3-lottie": "^3.3.1"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
62
63
|
"nuxt": "^4.0.0",
|