@revojs/ui 0.2.7 → 0.2.9

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.
Files changed (34) hide show
  1. package/dist/components/button.d.ts +4 -3
  2. package/dist/components/icon.d.ts +2 -1
  3. package/dist/components/input.d.ts +3 -2
  4. package/dist/components/navigate.d.ts +3 -2
  5. package/dist/module/icons.d.ts +2 -0
  6. package/dist/module/icons.js +12 -0
  7. package/dist/module/index.d.ts +1 -1
  8. package/dist/module/index.js +37 -47
  9. package/dist/types/index.d.ts +0 -7
  10. package/dist/vue/components/breadcrumb.vue +2 -4
  11. package/dist/vue/components/button.vue +26 -26
  12. package/dist/vue/components/card.vue +7 -10
  13. package/dist/vue/components/checkbox.vue +17 -12
  14. package/dist/vue/components/collection.vue +2 -10
  15. package/dist/vue/components/container.vue +2 -4
  16. package/dist/vue/components/counter.vue +7 -11
  17. package/dist/vue/components/dialog.vue +4 -18
  18. package/dist/vue/components/field.vue +3 -13
  19. package/dist/vue/components/heading.vue +7 -8
  20. package/dist/vue/components/icon.vue +3 -41
  21. package/dist/vue/components/input.vue +9 -19
  22. package/dist/vue/components/link.vue +8 -9
  23. package/dist/vue/components/navigate.vue +3 -14
  24. package/dist/vue/components/popover.vue +3 -11
  25. package/dist/vue/components/progress.vue +3 -10
  26. package/dist/vue/components/radio.vue +12 -20
  27. package/dist/vue/components/range.vue +99 -29
  28. package/dist/vue/components/rating.vue +6 -17
  29. package/dist/vue/components/select.vue +84 -61
  30. package/dist/vue/components/separator.vue +2 -10
  31. package/dist/vue/components/sheet.vue +17 -21
  32. package/dist/vue/components/switch.vue +6 -21
  33. package/dist/vue/components/upload.vue +2 -18
  34. package/package.json +5 -4
@@ -1,17 +1,17 @@
1
1
  <template>
2
2
  <dialog
3
3
  ref="sheet"
4
- class="m-0 h-full max-h-none max-w-none border-0 bg-transparent p-0 backdrop:bg-black/50"
4
+ class="m-0 max-w-none border-0 bg-transparent p-0 backdrop:bg-black/50"
5
5
  :class="positions[side]"
6
6
  @close="$emit('update:modelValue', false)"
7
7
  @click="$event.target === $event.currentTarget && ($event.currentTarget as HTMLDialogElement).close()"
8
8
  >
9
- <Card :title="title" :description="description" class="h-full w-full shadow-2xl">
9
+ <Card :title="title" :description="description" :class="cardClasses[side]">
10
10
  <template #actions>
11
11
  <Button
12
12
  size="icon"
13
13
  variant="ghost"
14
- icon-prefix="multiplication-sign"
14
+ :icon-prefix="CloseIcon"
15
15
  :aria-label="closeLabel"
16
16
  @click="sheet?.close()"
17
17
  />
@@ -29,24 +29,13 @@
29
29
  </template>
30
30
 
31
31
  <script setup lang="ts">
32
+ import CloseIcon from "~icons/hugeicons/multiplication-sign";
32
33
  import { useTemplateRef, watchEffect } from "vue";
33
- import type { SheetSide } from "../../components/sheet.ts";
34
+ import type { SheetProps, SheetSide } from "../../components/sheet";
34
35
  import Button from "./button.vue";
35
36
  import Card from "./card.vue";
36
37
 
37
- const {
38
- modelValue = false,
39
- side = "right",
40
- title = undefined,
41
- description = undefined,
42
- closeLabel = "Close",
43
- } = defineProps<{
44
- modelValue?: boolean;
45
- side?: SheetSide;
46
- title?: string;
47
- description?: string;
48
- closeLabel?: string;
49
- }>();
38
+ const { modelValue = false, side = "right", title, description, closeLabel = "Close" } = defineProps<SheetProps>();
50
39
 
51
40
  defineEmits<{
52
41
  "update:modelValue": [value: boolean];
@@ -55,10 +44,17 @@ defineEmits<{
55
44
  const sheet = useTemplateRef("sheet");
56
45
 
57
46
  const positions: Record<SheetSide, string> = {
58
- top: "inset-x-0 top-0 h-auto w-full max-h-[85vh]",
59
- right: "inset-y-0 right-0 w-[min(28rem,90vw)]",
60
- bottom: "inset-x-0 bottom-0 h-auto w-full max-h-[85vh]",
61
- left: "inset-y-0 left-0 w-[min(28rem,90vw)]",
47
+ top: "bottom-auto left-0 right-0 top-0 h-auto w-full",
48
+ right: "bottom-0 left-auto right-0 top-0 h-full max-h-full w-[min(28rem,90vw)]",
49
+ bottom: "bottom-0 left-0 right-0 top-auto h-auto w-full",
50
+ left: "bottom-0 left-0 right-auto top-0 h-full max-h-full w-[min(28rem,90vw)]",
51
+ };
52
+
53
+ const cardClasses: Record<SheetSide, string> = {
54
+ top: "max-h-[85vh] w-full shadow-2xl",
55
+ right: "h-full w-full shadow-2xl",
56
+ bottom: "max-h-[85vh] w-full shadow-2xl",
57
+ left: "h-full w-full shadow-2xl",
62
58
  };
63
59
 
64
60
  watchEffect(() => {
@@ -3,7 +3,7 @@
3
3
  <input v-if="name" type="hidden" :name="name" :value="modelValue ? 'on' : 'off'" />
4
4
 
5
5
  <button
6
- class="relative mt-0.5 h-6 w-11 shrink-0 rounded-full outline-ring transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed"
6
+ class="relative mt-0.5 flex h-6 w-11 shrink-0 items-center rounded-full outline-ring transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed"
7
7
  :class="variants[state]"
8
8
  type="button"
9
9
  role="switch"
@@ -11,10 +11,7 @@
11
11
  :disabled="disabled"
12
12
  @click="$emit('update:modelValue', !modelValue)"
13
13
  >
14
- <span
15
- class="block size-5 translate-x-0.5 rounded-full bg-white shadow transition-transform"
16
- :class="thumbVariants[state]"
17
- />
14
+ <span class="block size-5 rounded-full shadow transition-transform" :class="thumbVariants[state]" />
18
15
  </button>
19
16
 
20
17
  <span v-if="label || description || $slots.default" class="flex flex-col gap-0.5">
@@ -30,21 +27,9 @@
30
27
  <script setup lang="ts">
31
28
  import { computed } from "vue";
32
29
  import type { ControlInteraction } from "../../components/control.ts";
33
- import type { SwitchState } from "../../components/switch.ts";
30
+ import type { SwitchProps, SwitchState } from "../../components/switch";
34
31
 
35
- const {
36
- modelValue = false,
37
- label = undefined,
38
- description = undefined,
39
- name = undefined,
40
- disabled = false,
41
- } = defineProps<{
42
- modelValue?: boolean;
43
- label?: string;
44
- description?: string;
45
- name?: string;
46
- disabled?: boolean;
47
- }>();
32
+ const { modelValue = false, label, description, name, disabled = false } = defineProps<SwitchProps>();
48
33
 
49
34
  defineEmits<{
50
35
  "update:modelValue": [value: boolean];
@@ -60,8 +45,8 @@ const interactionVariants: Record<ControlInteraction, string> = {
60
45
  };
61
46
 
62
47
  const thumbVariants: Record<SwitchState, string> = {
63
- checked: "translate-x-5",
64
- unchecked: "",
48
+ checked: "translate-x-5 bg-primary-foreground",
49
+ unchecked: "translate-x-0.5 bg-white",
65
50
  };
66
51
 
67
52
  const variants: Record<SwitchState, string> = {
@@ -44,26 +44,10 @@
44
44
  <script setup lang="ts">
45
45
  import { computed, ref, useTemplateRef } from "vue";
46
46
  import type { ControlInteraction } from "../../components/control.ts";
47
- import type { UploadState } from "../../components/upload.ts";
47
+ import type { UploadProps, UploadState } from "../../components/upload";
48
48
  import Button from "./button.vue";
49
49
 
50
- const {
51
- modelValue = undefined,
52
- label = undefined,
53
- description = undefined,
54
- accept = undefined,
55
- name = undefined,
56
- required = false,
57
- disabled = false,
58
- } = defineProps<{
59
- modelValue?: Blob | File;
60
- label?: string;
61
- description?: string;
62
- accept?: string;
63
- name?: string;
64
- required?: boolean;
65
- disabled?: boolean;
66
- }>();
50
+ const { modelValue, label, description, accept, name, required = false, disabled = false } = defineProps<UploadProps>();
67
51
 
68
52
  const emit = defineEmits<{
69
53
  "update:modelValue": [value?: Blob | File];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revojs/ui",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,15 +30,16 @@
30
30
  },
31
31
  "scripts": {
32
32
  "build": "vite build",
33
+ "typecheck": "tsc --noEmit -p tsconfig.json",
33
34
  "watch": "vite build --watch"
34
35
  },
35
36
  "dependencies": {
36
- "@iconify/types": "^2.0.0",
37
- "@iconify/utils": "^3.1.7",
37
+ "@iconify-json/hugeicons": "^1.2.35",
38
38
  "@revojs/client": "*",
39
39
  "@tailwindcss/vite": "^4.3.3",
40
40
  "revojs": "*",
41
- "tailwindcss": "^4.3.3"
41
+ "tailwindcss": "^4.3.3",
42
+ "unplugin-icons": "^24.0.0"
42
43
  },
43
44
  "devDependencies": {
44
45
  "@revojs/tsconfig": "*",