@byyuurin/ui 0.5.1 → 0.5.2

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 (60) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +3 -3
  3. package/dist/runtime/components/Accordion.vue +9 -9
  4. package/dist/runtime/components/Alert.vue +9 -9
  5. package/dist/runtime/components/Avatar.vue +4 -4
  6. package/dist/runtime/components/AvatarGroup.vue +3 -3
  7. package/dist/runtime/components/Badge.vue +5 -5
  8. package/dist/runtime/components/Breadcrumb.vue +9 -9
  9. package/dist/runtime/components/Button.vue +5 -5
  10. package/dist/runtime/components/Calendar.vue +11 -11
  11. package/dist/runtime/components/Card.vue +6 -6
  12. package/dist/runtime/components/Carousel.vue +10 -10
  13. package/dist/runtime/components/Checkbox.vue +9 -9
  14. package/dist/runtime/components/CheckboxGroup.vue +4 -4
  15. package/dist/runtime/components/Chip.vue +2 -2
  16. package/dist/runtime/components/Collapsible.vue +2 -2
  17. package/dist/runtime/components/ContextMenuContent.vue +18 -18
  18. package/dist/runtime/components/Drawer.vue +9 -9
  19. package/dist/runtime/components/DropdownMenu.vue +2 -2
  20. package/dist/runtime/components/DropdownMenuContent.vue +19 -19
  21. package/dist/runtime/components/FieldGroup.vue +1 -1
  22. package/dist/runtime/components/FileUpload.vue +15 -15
  23. package/dist/runtime/components/Form.vue +1 -1
  24. package/dist/runtime/components/FormField.vue +9 -9
  25. package/dist/runtime/components/Input.vue +7 -7
  26. package/dist/runtime/components/InputNumber.vue +4 -4
  27. package/dist/runtime/components/InputTags.vue +12 -12
  28. package/dist/runtime/components/Kbd.vue +1 -1
  29. package/dist/runtime/components/Marquee.vue +2 -2
  30. package/dist/runtime/components/Modal.vue +9 -9
  31. package/dist/runtime/components/NavigationMenu.vue +40 -40
  32. package/dist/runtime/components/Pagination.vue +8 -8
  33. package/dist/runtime/components/PinInput.vue +2 -2
  34. package/dist/runtime/components/Popover.vue +2 -2
  35. package/dist/runtime/components/Progress.vue +6 -6
  36. package/dist/runtime/components/RadioGroup.vue +10 -10
  37. package/dist/runtime/components/ScrollArea.vue +7 -7
  38. package/dist/runtime/components/Select.vue +31 -31
  39. package/dist/runtime/components/Separator.vue +7 -7
  40. package/dist/runtime/components/Skeleton.vue +1 -1
  41. package/dist/runtime/components/Slider.vue +4 -4
  42. package/dist/runtime/components/Stepper.vue +12 -12
  43. package/dist/runtime/components/Switch.vue +10 -10
  44. package/dist/runtime/components/Table.vue +22 -22
  45. package/dist/runtime/components/Tabs.vue +9 -9
  46. package/dist/runtime/components/Textarea.vue +7 -7
  47. package/dist/runtime/components/Timeline.vue +9 -9
  48. package/dist/runtime/components/Toast.vue +10 -9
  49. package/dist/runtime/components/ToastProvider.vue +2 -2
  50. package/dist/runtime/components/Tooltip.vue +4 -4
  51. package/dist/runtime/components/Tree.vue +10 -10
  52. package/dist/runtime/composables/defineShortcuts.js +1 -1
  53. package/dist/runtime/composables/useOverlay.d.ts +3 -1
  54. package/dist/shared/{ui.RIHx5Yhe.mjs → ui.B6u-xvto.mjs} +17 -17
  55. package/dist/shared/{ui.DYMXCXO6.mjs → ui.Dy7aH7sf.mjs} +12 -6
  56. package/dist/unocss.d.mts +20 -2
  57. package/dist/unocss.mjs +25 -2
  58. package/dist/unplugin.mjs +3 -3
  59. package/dist/vite.mjs +2 -2
  60. package/package.json +3 -3
@@ -125,21 +125,21 @@ defineExpose({
125
125
  </script>
126
126
 
127
127
  <template>
128
- <Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
129
- <span v-if="isLeading || props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })" data-part="leading">
128
+ <Primitive :as="props.as" data-part="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
129
+ <span v-if="isLeading || props.avatar || !!slots.leading" data-part="leading" :class="ui.leading({ class: props.ui?.leading })">
130
130
  <slot name="leading" :ui="ui">
131
131
  <Icon
132
132
  v-if="isLeading && leadingIconName"
133
133
  :name="leadingIconName"
134
- :class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
135
134
  data-part="leadingIcon"
135
+ :class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
136
136
  />
137
137
  <Avatar
138
138
  v-else-if="props.avatar"
139
139
  :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
140
140
  v-bind="props.avatar"
141
- :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
142
141
  data-part="leadingAvatar"
142
+ :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
143
143
  />
144
144
  </slot>
145
145
  </span>
@@ -151,8 +151,8 @@ defineExpose({
151
151
  :placeholder="props.placeholder"
152
152
  :required="props.required"
153
153
  v-bind="{ id, name, disabled, ...$attrs, ...ariaAttrs }"
154
- :class="ui.base({ class: props.ui?.base })"
155
154
  data-part="base"
155
+ :class="ui.base({ class: props.ui?.base })"
156
156
  @input="onInput"
157
157
  @blur="onBlur"
158
158
  @change="onChange"
@@ -161,13 +161,13 @@ defineExpose({
161
161
 
162
162
  <slot :ui="ui"></slot>
163
163
 
164
- <span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })" data-part="trailing">
164
+ <span v-if="isTrailing || !!slots.trailing" data-part="trailing" :class="ui.trailing({ class: props.ui?.trailing })">
165
165
  <slot name="trailing" :ui="ui">
166
166
  <Icon
167
167
  v-if="trailingIconName"
168
168
  :name="trailingIconName"
169
- :class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
170
169
  data-part="trailingIcon"
170
+ :class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
171
171
  />
172
172
  </slot>
173
173
  </span>
@@ -50,15 +50,15 @@ const ui = computed(() => {
50
50
  </script>
51
51
 
52
52
  <template>
53
- <Primitive :as="props.as" :data-orientation="props.orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
53
+ <Primitive :as="props.as" :data-orientation="props.orientation" data-part="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
54
54
  <div
55
55
  v-for="(item, index) in props.items"
56
56
  :key="item.value ?? index"
57
- :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
58
57
  data-part="item"
58
+ :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
59
59
  :data-state="getItemState(index)"
60
60
  >
61
- <div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })" data-part="container">
61
+ <div data-part="container" :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
62
62
  <Avatar
63
63
  :size="props.size"
64
64
  :icon="item.icon"
@@ -67,8 +67,8 @@ const ui = computed(() => {
67
67
  icon: ui.indicatorIcon({ class: props.ui?.indicatorIcon }),
68
68
  fallback: ui.indicatorFallback({ class: props.ui?.indicatorFallback })
69
69
  }"
70
- :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })"
71
70
  data-part="indicator"
71
+ :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })"
72
72
  >
73
73
  <slot :name="item.slot ? `${item.slot}-indicator` : 'indicator'" :item="item"></slot>
74
74
  </Avatar>
@@ -76,24 +76,24 @@ const ui = computed(() => {
76
76
  <Separator
77
77
  v-if="index < items.length - 1"
78
78
  :orientation="props.orientation"
79
- :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
80
79
  data-part="separator"
80
+ :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
81
81
  />
82
82
  </div>
83
83
 
84
- <div :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })" data-part="wrapper">
84
+ <div data-part="wrapper" :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
85
85
  <slot :name="item.slot ? `${item.slot}-wrapper` : 'wrapper'" :item="item">
86
- <div v-if="item.date || !!slots[item.slot ? `${item.slot}-date` : 'date']" :class="ui.date({ class: [props.ui?.date, item.ui?.date] })" data-part="date">
86
+ <div v-if="item.date || !!slots[item.slot ? `${item.slot}-date` : 'date']" data-part="date" :class="ui.date({ class: [props.ui?.date, item.ui?.date] })">
87
87
  <slot :name="item.slot ? `${item.slot}-date` : 'date'" :item="item">
88
88
  {{ item.date }}
89
89
  </slot>
90
90
  </div>
91
- <div v-if="item.title || !!slots[item.slot ? `${item.slot}-title` : 'title']" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })" data-part="title">
91
+ <div v-if="item.title || !!slots[item.slot ? `${item.slot}-title` : 'title']" data-part="title" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })">
92
92
  <slot :name="item.slot ? `${item.slot}-title` : 'title'" :item="item">
93
93
  {{ item.title }}
94
94
  </slot>
95
95
  </div>
96
- <div v-if="item.description || !!slots[item.slot ? `${item.slot}-description` : 'description']" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })" data-part="description">
96
+ <div v-if="item.description || !!slots[item.slot ? `${item.slot}-description` : 'description']" data-part="description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
97
97
  <slot :name="item.slot ? `${item.slot}-description` : 'description'" :item="item">
98
98
  {{ item.description }}
99
99
  </slot>
@@ -64,9 +64,9 @@ defineExpose({
64
64
  ref="el"
65
65
  v-slot="{ remaining, duration, open }"
66
66
  v-bind="rootProps"
67
- :class="ui.root({ class: [props.ui?.root, props.class] })"
68
67
  :data-orientation="props.orientation"
69
68
  data-part="root"
69
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
70
70
  :style="{ '--height': height }"
71
71
  >
72
72
  <slot name="leading" :ui="ui">
@@ -74,19 +74,19 @@ defineExpose({
74
74
  v-if="props.avatar"
75
75
  :size="props.ui?.avatarSize || ui.avatarSize()"
76
76
  v-bind="props.avatar"
77
- :class="ui.avatar({ class: props.ui?.avatar })"
78
77
  data-part="avatar"
78
+ :class="ui.avatar({ class: props.ui?.avatar })"
79
79
  />
80
80
  <Icon
81
81
  v-else-if="props.icon"
82
82
  :name="props.icon"
83
- :class="ui.icon({ class: props.ui?.icon })"
84
83
  data-part="icon"
84
+ :class="ui.icon({ class: props.ui?.icon })"
85
85
  />
86
86
  </slot>
87
87
 
88
- <div :class="ui.wrapper({ class: props.ui?.wrapper })" data-part="wrapper">
89
- <ToastTitle v-if="props.title || !!slots.title" :class="ui.title({ class: props.ui?.title })" data-part="title">
88
+ <div data-part="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
89
+ <ToastTitle v-if="props.title || !!slots.title" data-part="title" :class="ui.title({ class: props.ui?.title })">
90
90
  <slot name="title">
91
91
  <component :is="props.title()" v-if="typeof props.title === 'function'" />
92
92
  <component :is="props.title" v-else-if="typeof props.title === 'object'" />
@@ -95,7 +95,7 @@ defineExpose({
95
95
  </template>
96
96
  </slot>
97
97
  </ToastTitle>
98
- <ToastDescription v-if="props.description || !!slots.description" :class="ui.description({ class: props.ui?.description })" data-part="description">
98
+ <ToastDescription v-if="props.description || !!slots.description" data-part="description" :class="ui.description({ class: props.ui?.description })">
99
99
  <slot name="description">
100
100
  <component :is="props.description()" v-if="typeof props.description === 'function'" />
101
101
  <component :is="props.description" v-else-if="typeof props.description === 'object'" />
@@ -105,7 +105,7 @@ defineExpose({
105
105
  </slot>
106
106
  </ToastDescription>
107
107
 
108
- <div v-if="props.orientation === 'vertical' && (props.actions?.length || slots.actions)" :class="ui.actions({ class: props.ui?.actions })" data-part="actions">
108
+ <div v-if="props.orientation === 'vertical' && (props.actions?.length || slots.actions)" data-part="actions" :class="ui.actions({ class: props.ui?.actions })">
109
109
  <slot name="actions">
110
110
  <ToastAction v-for="(action, index) in props.actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
111
111
  <Button size="xs" :color="props.color" v-bind="action" />
@@ -116,8 +116,8 @@ defineExpose({
116
116
 
117
117
  <div
118
118
  v-if="props.orientation === 'horizontal' && (props.actions?.length || !!slots.actions) || props.close"
119
- :class="ui.actions({ class: props.ui?.actions })"
120
119
  data-part="actions"
120
+ :class="ui.actions({ class: props.ui?.actions })"
121
121
  >
122
122
  <template v-if="props.orientation === 'horizontal'">
123
123
  <slot name="actions">
@@ -136,8 +136,8 @@ defineExpose({
136
136
  variant="link"
137
137
  :aria-label="t('toast.close')"
138
138
  v-bind="typeof props.close === 'object' ? props.close : {}"
139
- :class="ui.close({ class: props.ui?.close })"
140
139
  data-part="close"
140
+ :class="ui.close({ class: props.ui?.close })"
141
141
  @click.stop
142
142
  />
143
143
  </slot>
@@ -150,6 +150,7 @@ defineExpose({
150
150
  :color="props.color"
151
151
  v-bind="typeof props.progress === 'object' ? props.progress : {}"
152
152
  size="sm"
153
+ data-part="progress"
153
154
  :class="ui.progress({ class: props.ui?.progress })"
154
155
  />
155
156
  </ToastRoot>
@@ -88,8 +88,8 @@ function getOffset(index) {
88
88
  '--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
89
89
  '--transform': 'translateY(var(--translate)) scale(var(--scale))'
90
90
  }"
91
- :class="ui.base({ class: props.ui?.base })"
92
91
  data-part="base"
92
+ :class="ui.base({ class: props.ui?.base })"
93
93
  @update:open="onUpdateOpen($event, toast.id)"
94
94
  @click="toast.onClick && toast.onClick(toast)"
95
95
  />
@@ -97,8 +97,8 @@ function getOffset(index) {
97
97
  <ToastPortal v-bind="portalProps">
98
98
  <ToastViewport
99
99
  :data-expanded="expanded"
100
- :class="ui.viewport({ class: [props.ui?.viewport, props.class] })"
101
100
  data-part="viewport"
101
+ :class="ui.viewport({ class: [props.ui?.viewport, props.class] })"
102
102
  :style="{
103
103
  '--scale-factor': '0.05',
104
104
  '--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
@@ -48,11 +48,11 @@ const ui = computed(() => {
48
48
  </TooltipTrigger>
49
49
 
50
50
  <TooltipPortal v-bind="portalProps">
51
- <TooltipContent v-bind="contentProps" :class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })" data-part="content">
51
+ <TooltipContent v-bind="contentProps" data-part="content" :class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })">
52
52
  <slot name="content" :ui="ui">
53
- <span v-if="props.text" :class="ui.text({ class: props.ui?.text })" data-part="text">{{ props.text }}</span>
53
+ <span v-if="props.text" data-part="text" :class="ui.text({ class: props.ui?.text })">{{ props.text }}</span>
54
54
 
55
- <span v-if="props.kbds?.length" :class="ui.kbds({ class: props.ui?.kbds })" data-part="kbds">
55
+ <span v-if="props.kbds?.length" data-part="kbds" :class="ui.kbds({ class: props.ui?.kbds })">
56
56
  <Kbd
57
57
  v-for="(kbd, index) in props.kbds"
58
58
  :key="index"
@@ -62,7 +62,7 @@ const ui = computed(() => {
62
62
  </span>
63
63
  </slot>
64
64
 
65
- <TooltipArrow v-if="props.arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" data-part="arrow" />
65
+ <TooltipArrow v-if="props.arrow" v-bind="arrowProps" data-part="arrow" :class="ui.arrow({ class: props.ui?.arrow })" />
66
66
  </TooltipContent>
67
67
  </TooltipPortal>
68
68
  </TooltipRoot>
@@ -110,8 +110,8 @@ function onUpdate(value) {
110
110
  <DefineItemTemplate v-slot="{ item, index, level }">
111
111
  <li
112
112
  role="presentation"
113
- :class="props.nested && level > 1 ? ui.itemWithChildren({ class: [props.ui?.itemWithChildren, item.ui?.itemWithChildren] }) : ui.item({ class: [props.ui?.item, item.ui?.item] })"
114
113
  :data-part="props.nested && level > 1 ? 'itemWithChildren' : 'item'"
114
+ :class="props.nested && level > 1 ? ui.itemWithChildren({ class: [props.ui?.itemWithChildren, item.ui?.itemWithChildren] }) : ui.item({ class: [props.ui?.item, item.ui?.item] })"
115
115
  >
116
116
  <TreeItem
117
117
  v-slot="{ isExpanded, isSelected, isIndeterminate, handleSelect, handleToggle }"
@@ -130,8 +130,8 @@ function onUpdate(value) {
130
130
  :is="as.link"
131
131
  :type="as.link === 'button' ? 'button' : void 0"
132
132
  :disabled="item.disabled || props.disabled"
133
- :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || props.disabled })"
134
133
  data-part="link"
134
+ :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || props.disabled })"
135
135
  :style="!props.nested && level > 1 ? { paddingLeft: flattenedPaddingFormula(level) } : void 0"
136
136
  >
137
137
  <slot
@@ -147,18 +147,18 @@ function onUpdate(value) {
147
147
  <Icon
148
148
  v-if="item.icon"
149
149
  :name="item.icon"
150
- :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
151
150
  data-part="linkLeadingIcon"
151
+ :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
152
152
  />
153
153
  <Icon
154
154
  v-else-if="item.children?.length"
155
155
  :name="isExpanded ? props.expandedIcon ?? appConfig.ui.icons.folderOpen : props.collapsedIcon ?? appConfig.ui.icons.folder"
156
- :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
157
156
  data-part="linkLeadingIcon"
157
+ :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
158
158
  />
159
159
  </slot>
160
160
 
161
- <span v-if="getItemLabel(item) || slots[`${item.slot || 'item'}-label`]" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })" data-part="linkLabel">
161
+ <span v-if="getItemLabel(item) || slots[`${item.slot || 'item'}-label`]" data-part="linkLabel" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
162
162
  <slot
163
163
  :name="`${item.slot || 'item'}-label`"
164
164
  v-bind="{ index, level, expanded: isExpanded, selected: isSelected, indeterminate: isIndeterminate, handleSelect, handleToggle, ui }"
@@ -170,8 +170,8 @@ function onUpdate(value) {
170
170
 
171
171
  <span
172
172
  v-if="item.trailingIcon || item.children?.length || slots[`${item.slot || 'item'}-trailing`]"
173
- :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })"
174
173
  data-part="linkTrailing"
174
+ :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })"
175
175
  >
176
176
  <slot
177
177
  :name="`${item.slot || 'item'}-trailing`"
@@ -181,14 +181,14 @@ function onUpdate(value) {
181
181
  <Icon
182
182
  v-if="item.trailingIcon"
183
183
  :name="item.trailingIcon"
184
- :class="ui.linkTrailingIcon({ class: [props.trailingIcon, item.ui?.linkTrailingIcon] })"
185
184
  data-part="linkTrailingIcon"
185
+ :class="ui.linkTrailingIcon({ class: [props.trailingIcon, item.ui?.linkTrailingIcon] })"
186
186
  />
187
187
  <Icon
188
188
  v-else-if="item.children?.length"
189
189
  :name="props.trailingIcon ?? appConfig.ui.icons.chevronDown"
190
- :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })"
191
190
  data-part="linkTrailingIcon"
191
+ :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })"
192
192
  />
193
193
  </slot>
194
194
  </span>
@@ -199,8 +199,8 @@ function onUpdate(value) {
199
199
  <ul
200
200
  v-if="props.nested && item.children?.length && isExpanded"
201
201
  role="group"
202
- :class="ui.listWithChildren({ class: [props.ui?.listWithChildren, item.ui?.listWithChildren] })"
203
202
  data-part="listWithChildren"
203
+ :class="ui.listWithChildren({ class: [props.ui?.listWithChildren, item.ui?.listWithChildren] })"
204
204
  >
205
205
  <ReuseTreeTemplate :items="item.children" :level="level + 1" />
206
206
  </ul>
@@ -223,8 +223,8 @@ function onUpdate(value) {
223
223
  :default-expanded="defaultExpanded"
224
224
  :selection-behavior="props.selectionBehavior"
225
225
  :multiple="props.multiple"
226
- :class="ui.root({ class: [props.ui?.root, props.class] })"
227
226
  data-part="root"
227
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
228
228
  @update:model-value="onUpdate"
229
229
  >
230
230
  <template v-if="!props.nested">
@@ -150,7 +150,7 @@ export function defineShortcuts(config, options = {}) {
150
150
  continue;
151
151
  if (e.ctrlKey !== shortcut.ctrlKey)
152
152
  continue;
153
- if ((alphabetKey || shiftableKey) && e.shiftKey !== shortcut.shiftKey)
153
+ if ((alphabetKey || shiftableKey || shortcut.shiftKey || e.shiftKey) && e.shiftKey !== shortcut.shiftKey)
154
154
  continue;
155
155
  if (shortcut.enabled) {
156
156
  e.preventDefault();
@@ -1,5 +1,6 @@
1
1
  import type { Component } from 'vue';
2
2
  import type { ComponentEmit, ComponentProps } from 'vue-component-type-helpers';
3
+ type CloseEventArgTypeSimple<T> = T extends (event: 'close', arg_0: infer Arg, ...args: any[]) => void ? Arg : never;
3
4
  /**
4
5
  * This is a workaround for a design limitation in TypeScript.
5
6
  *
@@ -9,7 +10,7 @@ import type { ComponentEmit, ComponentProps } from 'vue-component-type-helpers';
9
10
  *
10
11
  * @see https://github.com/microsoft/TypeScript/issues/32164
11
12
  */
12
- type CloseEventArgType<T> = T extends {
13
+ type CloseEventArgTypeComplex<T> = T extends {
13
14
  (event: 'close', arg_0: infer Arg, ...args: any[]): void;
14
15
  (...args: any[]): void;
15
16
  (...args: any[]): void;
@@ -28,6 +29,7 @@ type CloseEventArgType<T> = T extends {
28
29
  (...args: any[]): void;
29
30
  (...args: any[]): void;
30
31
  } ? Arg : never;
32
+ type CloseEventArgType<T> = CloseEventArgTypeSimple<T> | CloseEventArgTypeComplex<T>;
31
33
  export interface OverlayOptions<ComponentProps = Record<string, any>> {
32
34
  defaultOpen?: boolean;
33
35
  props?: ComponentProps;
@@ -5,12 +5,12 @@ import { loadConfig } from '@unocss/config';
5
5
  import { genExport } from 'knitwork';
6
6
  import { normalize } from 'pathe';
7
7
  import { kebabCase } from 'scule';
8
- import { n as neutralColors } from './ui.DYMXCXO6.mjs';
8
+ import { n as neutralColors, a as applyDefaultVariants } from './ui.Dy7aH7sf.mjs';
9
9
  import { ct } from '@byyuurin/ui-kit';
10
10
  import { defu } from 'defu';
11
11
 
12
12
  const name = "@byyuurin/ui";
13
- const version = "0.5.1";
13
+ const version = "0.5.2";
14
14
 
15
15
  const accordion = ct({
16
16
  parts: {
@@ -1208,7 +1208,7 @@ const contextMenu = (options) => ct({
1208
1208
  group: "p-1 isolate",
1209
1209
  label: "w-full flex items-center font-semibold text-highlighted",
1210
1210
  separator: "-mx-1 my-1 h-px bg-border",
1211
- item: "group relative w-full flex items-start select-none outline-none before:content-empty before:absolute before:z-[-1] before:inset-px before:rounded-md data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75",
1211
+ item: "group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75",
1212
1212
  itemLeadingIcon: "shrink-0",
1213
1213
  itemLeadingAvatar: "shrink-0",
1214
1214
  itemLeadingAvatarSize: "",
@@ -1463,7 +1463,7 @@ const dropdownMenu = (options) => ct({
1463
1463
  group: "p-1 isolate",
1464
1464
  label: "w-full flex items-center font-semibold text-highlighted",
1465
1465
  separator: "-mx-1 my-1 h-px bg-border",
1466
- item: "group relative w-full flex items-start select-none outline-none before:content-empty before:absolute before:z-[-1] before:inset-px before:rounded-md data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75",
1466
+ item: "group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75",
1467
1467
  itemLeadingIcon: "shrink-0",
1468
1468
  itemLeadingAvatar: "shrink-0",
1469
1469
  itemLeadingAvatarSize: "",
@@ -2347,7 +2347,7 @@ const marquee = ct({
2347
2347
  },
2348
2348
  overlay: {
2349
2349
  true: {
2350
- root: "before:absolute before:pointer-events-none before:content-empty before:z-2 before:from-[--ui-bg] before:to-transparent after:absolute after:pointer-events-none after:content-empty after:z-2 after:from-[--ui-bg] after:to-transparent"
2350
+ root: "before:absolute before:pointer-events-none before:z-2 before:from-default before:to-transparent after:absolute after:pointer-events-none after:z-2 after:from-default after:to-transparent"
2351
2351
  }
2352
2352
  }
2353
2353
  },
@@ -2418,7 +2418,7 @@ const navigationMenu = (options) => ct({
2418
2418
  list: "isolate min-w-0",
2419
2419
  label: "w-full flex items-center gap-1.5 font-semibold text-xs/5 text-highlighted px-2.5 py-1.5",
2420
2420
  item: "min-w-0",
2421
- link: "group relative w-full flex items-center gap-1.5 font-medium text-sm before:content-empty before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
2421
+ link: "group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
2422
2422
  linkLeadingIcon: "shrink-0 size-5",
2423
2423
  linkLeadingAvatar: "shrink-0",
2424
2424
  linkLeadingAvatarSize: "2xs",
@@ -2431,7 +2431,7 @@ const navigationMenu = (options) => ct({
2431
2431
  childList: "isolate",
2432
2432
  childLabel: "text-xs text-highlighted",
2433
2433
  childItem: "",
2434
- childLink: "group relative size-full flex items-start text-start text-sm before:content-empty before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
2434
+ childLink: "group relative size-full flex items-start text-start text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
2435
2435
  childLinkWrapper: "min-w-0",
2436
2436
  childLinkIcon: "size-5 shrink-0",
2437
2437
  childLinkLabel: "truncate",
@@ -2563,7 +2563,7 @@ const navigationMenu = (options) => ct({
2563
2563
  highlight: true,
2564
2564
  class: {
2565
2565
  link: [
2566
- "after:content-empty after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full",
2566
+ "after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full",
2567
2567
  options.theme.transitions && "after:transition-colors"
2568
2568
  ]
2569
2569
  }
@@ -2574,7 +2574,7 @@ const navigationMenu = (options) => ct({
2574
2574
  level: true,
2575
2575
  class: {
2576
2576
  link: [
2577
- "after:content-empty after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full",
2577
+ "after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full",
2578
2578
  options.theme.transitions && "after:transition-colors"
2579
2579
  ]
2580
2580
  }
@@ -3253,7 +3253,7 @@ const scrollArea = ct({
3253
3253
  thumb: [
3254
3254
  "relative flex-1 bg-[--ui-border-accented] opacity-80 rounded cursor-pointer transition-colors",
3255
3255
  "hover:bg-[--ui-text-dimmed]",
3256
- "before:content-empty before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-10 before:min-h-10 "
3256
+ "before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-10 before:min-h-10 "
3257
3257
  ],
3258
3258
  corner: ""
3259
3259
  }
@@ -3286,7 +3286,7 @@ const select = (options) => {
3286
3286
  label: "font-semibold text-highlighted",
3287
3287
  separator: "-mx-1 my-1 h-px bg-border",
3288
3288
  item: [
3289
- "group relative w-full flex items-start select-none outline-none before:content-empty before:absolute before:z-[-1] before:inset-px before:rounded-md cursor-pointer data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75 text-default data-[highlighted]:not-[[data-disabled]]:text-highlighted data-[highlighted]:not-[[data-disabled]]:before:bg-elevated/50",
3289
+ "group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md cursor-pointer data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75 text-default data-[highlighted]:not-[[data-disabled]]:text-highlighted data-[highlighted]:not-[[data-disabled]]:before:bg-elevated/50",
3290
3290
  options.theme.transitions && "transition-colors before:transition-colors"
3291
3291
  ],
3292
3292
  itemLeadingIcon: [
@@ -3909,7 +3909,7 @@ const table = (options) => ct({
3909
3909
  },
3910
3910
  loading: {
3911
3911
  true: {
3912
- thead: "after:content-empty after:absolute after:z-1 after:h-px"
3912
+ thead: "after:absolute after:z-1 after:h-px"
3913
3913
  }
3914
3914
  },
3915
3915
  loadingAnimation: {
@@ -4692,7 +4692,8 @@ function getTemplates(options, uiConfig, nuxt) {
4692
4692
  write: true,
4693
4693
  getContents: () => {
4694
4694
  const template = theme2[component];
4695
- const result = typeof template === "function" ? template(options) : template;
4695
+ let result = typeof template === "function" ? template(options) : template;
4696
+ result = applyDefaultVariants(result, options.theme?.defaultVariants);
4696
4697
  const json = JSON.stringify(result, null, 2);
4697
4698
  return [
4698
4699
  `// @unocss-include
@@ -4771,16 +4772,15 @@ export const { merge: unoMerge } = await createUnoMerge(mergeConfigs([
4771
4772
  templates.push({
4772
4773
  filename: "types/ui.d.ts",
4773
4774
  getContents() {
4774
- const appIcon = Object.keys(uiConfig.icons ?? {}).map((s) => `'${s}'`).join(" | ");
4775
- const appNeutralColor = neutralColors.map((s) => `'${s}'`).join(" | ");
4775
+ const union = (values) => values.map((s) => `'${s}'`).join(" | ");
4776
4776
  return `import * as ui from '#build/ui'
4777
4777
  import type { UIConfig } from '@byyuurin/ui'
4778
4778
  import type { colors } from '@unocss/preset-wind4/colors'
4779
4779
 
4780
- type NeutralColor = ${appNeutralColor}
4780
+ type NeutralColor = ${union(neutralColors)}
4781
4781
  type Color = keyof Omit<typeof colors, NeutralColor | 'black' | 'white'> | (string & {})
4782
4782
 
4783
- type AppConfigIcons = Record<${appIcon} | (string & {}), string>
4783
+ type AppConfigIcons = Record<${union(Object.keys(uiConfig.icons ?? {}))} | (string & {}), string>
4784
4784
 
4785
4785
  export type AppConfigUI = {
4786
4786
  colors?: {
@@ -20,7 +20,7 @@ const icons = {
20
20
  upload: "i-lucide-upload"
21
21
  };
22
22
 
23
- function getDefaultUIConfig(colors) {
23
+ function getDefaultConfig(theme) {
24
24
  return {
25
25
  colors: pick({
26
26
  primary: "orange",
@@ -30,7 +30,7 @@ function getDefaultUIConfig(colors) {
30
30
  warning: "yellow",
31
31
  error: "red",
32
32
  neutral: "stone"
33
- }, [...colors || [], "neutral"]),
33
+ }, [...theme?.colors || [], "neutral"]),
34
34
  icons
35
35
  };
36
36
  }
@@ -47,9 +47,15 @@ const defaultColors = ["primary", "secondary", "success", "info", "warning", "er
47
47
  function resolveColors(colors) {
48
48
  return colors?.length ? [.../* @__PURE__ */ new Set(["primary", ...colors])] : [...defaultColors];
49
49
  }
50
- function pickColorNames(colors) {
51
- return colors;
50
+ const neutralColors = ["slate", "gray", "zinc", "neutral", "stone", "light", "dark"];
51
+ function applyDefaultVariants(result, defaultVariants) {
52
+ if (!result || !defaultVariants)
53
+ return result;
54
+ if (defaultVariants.color && result.defaultVariants?.color && result.defaultVariants.color === "primary")
55
+ result.defaultVariants.color = defaultVariants.color;
56
+ if (defaultVariants.size && result.defaultVariants?.size && result.defaultVariants.size === "md")
57
+ result.defaultVariants.size = defaultVariants.size;
58
+ return result;
52
59
  }
53
- const neutralColors = pickColorNames(["slate", "gray", "zinc", "neutral", "stone", "light", "dark"]);
54
60
 
55
- export { defaultOptions as d, getDefaultUIConfig as g, neutralColors as n, resolveColors as r };
61
+ export { applyDefaultVariants as a, defaultOptions as d, getDefaultConfig as g, neutralColors as n, resolveColors as r };
package/dist/unocss.d.mts CHANGED
@@ -1,12 +1,30 @@
1
- import { Preset } from '@unocss/core';
1
+ import { Postprocessor, Preset } from '@unocss/core';
2
2
  import { Theme } from '@unocss/preset-wind4/theme';
3
3
  import { M as ModuleOptions } from './shared/ui.IulR-OYx.mjs';
4
4
  import '@nuxt/schema';
5
5
  import '@unocss/preset-wind4/colors';
6
6
  import '../dist/runtime/types/index.js';
7
7
 
8
+ /**
9
+ * Normalize pseudo-element (`::before` / `::after`) content behavior to align with TailwindCSS.
10
+ *
11
+ * In TailwindCSS, all `before:*` and `after:*` variants implicitly define `content`,
12
+ * so pseudo-elements are always rendered without requiring explicit
13
+ * `before:content-empty` or `after:content-empty`.
14
+ *
15
+ * UnoCSS requires `content` to be explicitly defined, which can cause styles
16
+ * to silently break when migrating from TailwindCSS.
17
+ *
18
+ * This postprocessor normalizes the behavior by:
19
+ * - Replacing `content: ""` with a CSS variable reference
20
+ * - Injecting a default `content` definition for all pseudo-element variants
21
+ *
22
+ * This ensures consistent rendering of pseudo-elements and prevents migration
23
+ * issues caused by missing `content` declarations.
24
+ */
25
+ declare const normalizePseudoElementContent: Postprocessor;
8
26
  type PresetOptions = Pick<(ModuleOptions['theme'] & {}), 'colors'>;
9
27
  declare function createUnoPreset(options?: PresetOptions): () => Preset<Theme>;
10
28
 
11
- export { createUnoPreset };
29
+ export { createUnoPreset, normalizePseudoElementContent };
12
30
  export type { PresetOptions };
package/dist/unocss.mjs CHANGED
@@ -1,8 +1,24 @@
1
1
  import { colors } from '@unocss/preset-wind4/colors';
2
2
  import { parseColor } from '@unocss/preset-wind4/utils';
3
- import { r as resolveColors } from './shared/ui.DYMXCXO6.mjs';
3
+ import { r as resolveColors } from './shared/ui.Dy7aH7sf.mjs';
4
4
  import '../dist/runtime/utils/index.js';
5
5
 
6
+ const normalizePseudoElementContent = (util) => {
7
+ if (util.layer === "properties")
8
+ return;
9
+ util.entries.forEach((i) => {
10
+ const CONTENT_EMPTY = '""';
11
+ if (i[0] === "content" && i[1] === CONTENT_EMPTY) {
12
+ i[1] = "var(--un-content)";
13
+ util.entries.unshift(["--un-content", CONTENT_EMPTY]);
14
+ }
15
+ });
16
+ if (!/(?:before|after)(?:\\:|-).+/.test(util.selector))
17
+ return;
18
+ if (util.entries.some((i) => i[0] === "content" || i[0] === "--un-content"))
19
+ return;
20
+ util.entries.unshift(["content", "var(--un-content)"]);
21
+ };
6
22
  function createUnoPreset(options = {}) {
7
23
  const themeShades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
8
24
  const colors$1 = Object.fromEntries(resolveColors(options?.colors).map((color) => {
@@ -85,6 +101,10 @@ function createUnoPreset(options = {}) {
85
101
  const result = `${t}-[--ui-${t}-${parsed.name}]/${parsed.opacity ?? 100}`.replace("-default", "").replace("/100", "").replace(/\[--ui-(?:border-[rltbsexy]|border|divide|outline|ring-offset|ring|stroke|fill)(-.+)?\]/, "[--ui-border$1]").replace(/(?:bg-(border)|border-(bg))/, "$1$2");
86
102
  return result;
87
103
  }
104
+ ],
105
+ [
106
+ /^(?:from|via|to|stops)-(default(?:\/(\d+|\[--.+\]))?)$/,
107
+ ([matched]) => matched.replace("default", "[--ui-bg]")
88
108
  ]
89
109
  ],
90
110
  safelist: Object.keys(keyframes).map((s) => `keyframes-${s}`),
@@ -147,9 +167,12 @@ function createUnoPreset(options = {}) {
147
167
  }`;
148
168
  }
149
169
  }
170
+ ],
171
+ postprocess: [
172
+ normalizePseudoElementContent
150
173
  ]
151
174
  };
152
175
  return () => preset;
153
176
  }
154
177
 
155
- export { createUnoPreset };
178
+ export { createUnoPreset, normalizePseudoElementContent };
package/dist/unplugin.mjs CHANGED
@@ -2,8 +2,8 @@ import { fileURLToPath } from 'node:url';
2
2
  import { defu } from 'defu';
3
3
  import { join, normalize } from 'pathe';
4
4
  import { createUnplugin } from 'unplugin';
5
- import { g as getTemplates, n as name } from './shared/ui.RIHx5Yhe.mjs';
6
- import { d as defaultOptions, r as resolveColors, g as getDefaultUIConfig } from './shared/ui.DYMXCXO6.mjs';
5
+ import { g as getTemplates, n as name } from './shared/ui.B6u-xvto.mjs';
6
+ import { d as defaultOptions, r as resolveColors, g as getDefaultConfig } from './shared/ui.Dy7aH7sf.mjs';
7
7
  import AutoImport from 'unplugin-auto-import';
8
8
  import { globSync } from 'tinyglobby';
9
9
  import AutoImportComponents from 'unplugin-vue-components';
@@ -280,7 +280,7 @@ const unplugin = createUnplugin((userOptions = {}, meta) => {
280
280
  ui: options.ui,
281
281
  colorMode: options.colorMode
282
282
  },
283
- { ui: getDefaultUIConfig(options.theme.colors) }
283
+ { ui: getDefaultConfig(options.theme) }
284
284
  );
285
285
  return [
286
286
  NuxtEnvironmentPlugin(options),