@byyuurin/ui 0.3.0 → 0.4.0

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 (82) hide show
  1. package/LICENSE +20 -20
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +2 -2
  4. package/dist/runtime/components/Accordion.vue +43 -43
  5. package/dist/runtime/components/Alert.vue +65 -64
  6. package/dist/runtime/components/App.vue +10 -10
  7. package/dist/runtime/components/Avatar.vue +31 -30
  8. package/dist/runtime/components/AvatarGroup.vue +6 -5
  9. package/dist/runtime/components/Badge.vue +36 -35
  10. package/dist/runtime/components/Breadcrumb.vue +51 -51
  11. package/dist/runtime/components/Button.vue +54 -55
  12. package/dist/runtime/components/Calendar.vue +76 -75
  13. package/dist/runtime/components/Card.vue +43 -42
  14. package/dist/runtime/components/Carousel.vue +68 -67
  15. package/dist/runtime/components/Checkbox.vue +50 -48
  16. package/dist/runtime/components/CheckboxGroup.vue +33 -32
  17. package/dist/runtime/components/Chip.vue +20 -16
  18. package/dist/runtime/components/Collapsible.vue +16 -15
  19. package/dist/runtime/components/Drawer.vue +78 -77
  20. package/dist/runtime/components/DropdownMenu.vue +29 -29
  21. package/dist/runtime/components/DropdownMenuContent.vue +152 -152
  22. package/dist/runtime/components/FieldGroup.vue +5 -4
  23. package/dist/runtime/components/FileUpload.vue +267 -0
  24. package/dist/runtime/components/FileUpload.vue.d.ts +178 -0
  25. package/dist/runtime/components/Form.vue +11 -10
  26. package/dist/runtime/components/FormField.vue +39 -38
  27. package/dist/runtime/components/Icon.vue +2 -2
  28. package/dist/runtime/components/Input.vue +52 -52
  29. package/dist/runtime/components/InputNumber.vue +50 -49
  30. package/dist/runtime/components/InputTags.vue +55 -55
  31. package/dist/runtime/components/Kbd.vue +5 -4
  32. package/dist/runtime/components/Link.vue +25 -24
  33. package/dist/runtime/components/LinkBase.vue +3 -3
  34. package/dist/runtime/components/Marquee.vue +7 -6
  35. package/dist/runtime/components/Modal.vue +76 -75
  36. package/dist/runtime/components/NavigationMenu.vue +230 -230
  37. package/dist/runtime/components/OverlayProvider.vue +9 -9
  38. package/dist/runtime/components/Pagination.vue +49 -48
  39. package/dist/runtime/components/PinInput.vue +25 -25
  40. package/dist/runtime/components/Popover.vue +23 -23
  41. package/dist/runtime/components/Progress.vue +27 -26
  42. package/dist/runtime/components/RadioGroup.vue +53 -53
  43. package/dist/runtime/components/ScrollArea.vue +34 -33
  44. package/dist/runtime/components/Select.vue +203 -203
  45. package/dist/runtime/components/Separator.vue +32 -31
  46. package/dist/runtime/components/Skeleton.vue +13 -12
  47. package/dist/runtime/components/Slider.vue +27 -26
  48. package/dist/runtime/components/Stepper.vue +53 -52
  49. package/dist/runtime/components/Stepper.vue.d.ts +2 -2
  50. package/dist/runtime/components/Switch.vue +33 -34
  51. package/dist/runtime/components/Table.vue +139 -138
  52. package/dist/runtime/components/Tabs.vue +76 -76
  53. package/dist/runtime/components/Textarea.vue +50 -50
  54. package/dist/runtime/components/Timeline.vue +49 -48
  55. package/dist/runtime/components/Toast.vue +95 -94
  56. package/dist/runtime/components/ToastProvider.vue +31 -31
  57. package/dist/runtime/components/Tooltip.vue +26 -25
  58. package/dist/runtime/components/Tree.vue +133 -133
  59. package/dist/runtime/composables/useFileUpload.d.ts +19 -0
  60. package/dist/runtime/composables/useFileUpload.js +79 -0
  61. package/dist/runtime/composables/useLocale.d.ts +6 -0
  62. package/dist/runtime/locale/en.d.ts +3 -0
  63. package/dist/runtime/locale/en.js +3 -0
  64. package/dist/runtime/locale/zh_tw.d.ts +3 -0
  65. package/dist/runtime/locale/zh_tw.js +3 -0
  66. package/dist/runtime/types/index.d.ts +1 -0
  67. package/dist/runtime/types/index.js +1 -0
  68. package/dist/runtime/types/locale.d.ts +3 -0
  69. package/dist/runtime/types/unocss.d.ts +4 -4
  70. package/dist/runtime/types/utils.d.ts +1 -1
  71. package/dist/runtime/vue/components/Icon.vue +2 -2
  72. package/dist/setup.d.mts +1 -1
  73. package/dist/shared/{ui.D8Bg1HWt.d.mts → ui.CGCKYv7g.d.mts} +4 -2
  74. package/dist/shared/{ui.9kQouwss.mjs → ui.DYMXCXO6.mjs} +4 -2
  75. package/dist/shared/{ui.DpkP12cX.mjs → ui.DcEKQd0n.mjs} +230 -5
  76. package/dist/unocss.mjs +1 -1
  77. package/dist/unplugin.d.mts +1 -1
  78. package/dist/unplugin.mjs +2 -2
  79. package/dist/vite.d.mts +1 -1
  80. package/dist/vite.mjs +2 -2
  81. package/package.json +10 -10
  82. package/vue-plugin.d.ts +5 -5
@@ -9,6 +9,7 @@ import { computed, toRef } from "vue";
9
9
  import { useAppConfig } from "#imports";
10
10
  import { useLocale } from "../composables/useLocale";
11
11
  import { usePortal } from "../composables/usePortal";
12
+ import { pick } from "../utils";
12
13
  import { cv, merge } from "../utils/style";
13
14
  import Button from "./Button.vue";
14
15
  const props = defineProps({
@@ -52,83 +53,83 @@ const { t } = useLocale();
52
53
  const appConfig = useAppConfig();
53
54
  const ui = computed(() => {
54
55
  const styler = cv(merge(theme, appConfig.ui.modal));
55
- return styler(props);
56
+ return styler(pick(props, ["transition", "fullscreen", "overlay"]));
56
57
  });
57
58
  </script>
58
59
 
59
60
  <template>
60
- <DialogRoot v-slot="{ open, close }" v-bind="rootProps">
61
- <DialogTrigger v-if="!!slots.default" as-child :class="props.class">
62
- <slot :open="open"></slot>
63
- </DialogTrigger>
64
-
65
- <DialogPortal v-bind="portalProps">
66
- <DialogOverlay v-if="props.overlay" :class="ui.overlay({ class: props.ui?.overlay })" data-part="overlay" />
67
-
68
- <DialogContent
69
- :class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
70
- v-bind="contentProps"
71
- data-part="content"
72
- @after-enter="emit('after-enter')"
73
- @after-leave="emit('after-leave')"
74
- v-on="contentEvents"
75
- >
76
- <VisuallyHidden v-if="!!slots.content || !!slots.header || !props.title && !slots.title">
77
- <DialogTitle />
78
- </VisuallyHidden>
79
-
80
- <slot name="content" :close="close">
81
- <div
82
- v-if="slots.header || props.title || slots.title || props.description || slots.description || props.close || slots.close"
83
- :class="ui.header({ class: props.ui?.header })"
84
- data-part="header"
85
- >
86
- <slot name="header" :close="close">
87
- <DialogTitle
88
- v-if="props.title || slots.title"
89
- :class="ui.title({ class: props.ui?.title })"
90
- data-part="title"
91
- >
92
- <slot name="title">
93
- {{ props.title }}
94
- </slot>
95
- </DialogTitle>
96
-
97
- <DialogClose v-if="props.close || slots.close" as-child>
98
- <slot name="close" :close="close" :ui="ui">
99
- <Button
100
- variant="ghost"
101
- color="neutral"
102
- :icon="props.closeIcon || appConfig.ui.icons.close"
103
- v-bind="typeof props.close === 'object' ? props.close : {}"
104
- :aria-label="t('modal.close')"
105
- :class="ui.close({ class: props.ui?.close })"
106
- data-part="close"
107
- />
108
- </slot>
109
- </DialogClose>
110
-
111
- <DialogDescription
112
- v-if="props.description || slots.description"
113
- :class="ui.description({ class: props.ui?.description })"
114
- data-part="description"
115
- >
116
- <slot name="description">
117
- {{ props.description }}
118
- </slot>
119
- </DialogDescription>
120
- </slot>
121
- </div>
122
-
123
- <div v-if="slots.body" :class="ui.body({ class: props.ui?.body })" data-part="body">
124
- <slot name="body" :close="close"></slot>
125
- </div>
126
-
127
- <div v-if="slots.footer" :class="ui.footer({ class: props.ui?.footer })" data-part="footer">
128
- <slot name="footer" :close="close"></slot>
129
- </div>
130
- </slot>
131
- </DialogContent>
132
- </DialogPortal>
133
- </DialogRoot>
61
+ <DialogRoot v-slot="{ open, close }" v-bind="rootProps">
62
+ <DialogTrigger v-if="!!slots.default" as-child :class="props.class">
63
+ <slot :open="open"></slot>
64
+ </DialogTrigger>
65
+
66
+ <DialogPortal v-bind="portalProps">
67
+ <DialogOverlay v-if="props.overlay" :class="ui.overlay({ class: props.ui?.overlay })" data-part="overlay" />
68
+
69
+ <DialogContent
70
+ :class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
71
+ v-bind="contentProps"
72
+ data-part="content"
73
+ @after-enter="emit('after-enter')"
74
+ @after-leave="emit('after-leave')"
75
+ v-on="contentEvents"
76
+ >
77
+ <VisuallyHidden v-if="!!slots.content || !!slots.header || !props.title && !slots.title">
78
+ <DialogTitle />
79
+ </VisuallyHidden>
80
+
81
+ <slot name="content" :close="close">
82
+ <div
83
+ v-if="slots.header || props.title || slots.title || props.description || slots.description || props.close || slots.close"
84
+ :class="ui.header({ class: props.ui?.header })"
85
+ data-part="header"
86
+ >
87
+ <slot name="header" :close="close">
88
+ <DialogTitle
89
+ v-if="props.title || slots.title"
90
+ :class="ui.title({ class: props.ui?.title })"
91
+ data-part="title"
92
+ >
93
+ <slot name="title">
94
+ {{ props.title }}
95
+ </slot>
96
+ </DialogTitle>
97
+
98
+ <DialogClose v-if="props.close || slots.close" as-child>
99
+ <slot name="close" :close="close" :ui="ui">
100
+ <Button
101
+ variant="ghost"
102
+ color="neutral"
103
+ :icon="props.closeIcon || appConfig.ui.icons.close"
104
+ v-bind="typeof props.close === 'object' ? props.close : {}"
105
+ :aria-label="t('modal.close')"
106
+ :class="ui.close({ class: props.ui?.close })"
107
+ data-part="close"
108
+ />
109
+ </slot>
110
+ </DialogClose>
111
+
112
+ <DialogDescription
113
+ v-if="props.description || slots.description"
114
+ :class="ui.description({ class: props.ui?.description })"
115
+ data-part="description"
116
+ >
117
+ <slot name="description">
118
+ {{ props.description }}
119
+ </slot>
120
+ </DialogDescription>
121
+ </slot>
122
+ </div>
123
+
124
+ <div v-if="slots.body" :class="ui.body({ class: props.ui?.body })" data-part="body">
125
+ <slot name="body" :close="close"></slot>
126
+ </div>
127
+
128
+ <div v-if="slots.footer" :class="ui.footer({ class: props.ui?.footer })" data-part="footer">
129
+ <slot name="footer" :close="close"></slot>
130
+ </div>
131
+ </slot>
132
+ </DialogContent>
133
+ </DialogPortal>
134
+ </DialogRoot>
134
135
  </template>