@byyuurin/ui 0.1.0 → 0.3.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 (140) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +5 -3
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +2 -2
  5. package/dist/runtime/components/Accordion.vue +41 -41
  6. package/dist/runtime/components/Accordion.vue.d.ts +11 -7
  7. package/dist/runtime/components/Alert.vue +63 -63
  8. package/dist/runtime/components/Alert.vue.d.ts +4 -4
  9. package/dist/runtime/components/App.vue +11 -10
  10. package/dist/runtime/components/App.vue.d.ts +11 -7
  11. package/dist/runtime/components/Avatar.vue +29 -29
  12. package/dist/runtime/components/Avatar.vue.d.ts +4 -3
  13. package/dist/runtime/components/AvatarGroup.vue +4 -4
  14. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  15. package/dist/runtime/components/Badge.vue +32 -32
  16. package/dist/runtime/components/Badge.vue.d.ts +2 -2
  17. package/dist/runtime/components/Breadcrumb.vue +49 -49
  18. package/dist/runtime/components/Breadcrumb.vue.d.ts +10 -6
  19. package/dist/runtime/components/Button.vue +52 -51
  20. package/dist/runtime/components/Button.vue.d.ts +1 -1
  21. package/dist/runtime/components/Calendar.vue +75 -77
  22. package/dist/runtime/components/Calendar.vue.d.ts +16 -12
  23. package/dist/runtime/components/Card.vue +41 -41
  24. package/dist/runtime/components/Card.vue.d.ts +1 -1
  25. package/dist/runtime/components/Carousel.vue +85 -66
  26. package/dist/runtime/components/Carousel.vue.d.ts +14 -10
  27. package/dist/runtime/components/Checkbox.vue +46 -46
  28. package/dist/runtime/components/Checkbox.vue.d.ts +4 -3
  29. package/dist/runtime/components/CheckboxGroup.vue +131 -0
  30. package/dist/runtime/components/CheckboxGroup.vue.d.ts +93 -0
  31. package/dist/runtime/components/Chip.vue +15 -15
  32. package/dist/runtime/components/Chip.vue.d.ts +2 -2
  33. package/dist/runtime/components/Collapsible.vue +14 -14
  34. package/dist/runtime/components/Collapsible.vue.d.ts +2 -2
  35. package/dist/runtime/components/Drawer.vue +76 -76
  36. package/dist/runtime/components/Drawer.vue.d.ts +6 -6
  37. package/dist/runtime/components/DropdownMenu.vue +28 -28
  38. package/dist/runtime/components/DropdownMenu.vue.d.ts +17 -9
  39. package/dist/runtime/components/DropdownMenuContent.vue +152 -153
  40. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +11 -7
  41. package/dist/runtime/components/FieldGroup.vue +3 -3
  42. package/dist/runtime/components/FieldGroup.vue.d.ts +2 -2
  43. package/dist/runtime/components/Form.vue +9 -9
  44. package/dist/runtime/components/Form.vue.d.ts +13 -8
  45. package/dist/runtime/components/FormField.vue +39 -38
  46. package/dist/runtime/components/FormField.vue.d.ts +7 -2
  47. package/dist/runtime/components/Icon.vue +2 -2
  48. package/dist/runtime/components/Icon.vue.d.ts +1 -1
  49. package/dist/runtime/components/Input.vue +48 -48
  50. package/dist/runtime/components/Input.vue.d.ts +16 -12
  51. package/dist/runtime/components/InputNumber.vue +48 -50
  52. package/dist/runtime/components/InputNumber.vue.d.ts +128 -129
  53. package/dist/runtime/components/InputTags.vue +156 -0
  54. package/dist/runtime/components/InputTags.vue.d.ts +90 -0
  55. package/dist/runtime/components/Kbd.vue +3 -3
  56. package/dist/runtime/components/Kbd.vue.d.ts +2 -2
  57. package/dist/runtime/components/Link.vue +26 -25
  58. package/dist/runtime/components/Link.vue.d.ts +16 -6
  59. package/dist/runtime/components/LinkBase.vue +3 -3
  60. package/dist/runtime/components/LinkBase.vue.d.ts +2 -2
  61. package/dist/runtime/components/Marquee.vue +38 -0
  62. package/dist/runtime/components/Marquee.vue.d.ts +54 -0
  63. package/dist/runtime/components/Modal.vue +74 -74
  64. package/dist/runtime/components/Modal.vue.d.ts +6 -6
  65. package/dist/runtime/components/NavigationMenu.vue +243 -234
  66. package/dist/runtime/components/NavigationMenu.vue.d.ts +53 -14
  67. package/dist/runtime/components/OverlayProvider.vue +9 -9
  68. package/dist/runtime/components/Pagination.vue +47 -47
  69. package/dist/runtime/components/Pagination.vue.d.ts +4 -4
  70. package/dist/runtime/components/PinInput.vue +23 -23
  71. package/dist/runtime/components/PinInput.vue.d.ts +14 -10
  72. package/dist/runtime/components/Popover.vue +22 -22
  73. package/dist/runtime/components/Popover.vue.d.ts +11 -7
  74. package/dist/runtime/components/Progress.vue +25 -25
  75. package/dist/runtime/components/Progress.vue.d.ts +2 -2
  76. package/dist/runtime/components/RadioGroup.vue +50 -50
  77. package/dist/runtime/components/RadioGroup.vue.d.ts +13 -9
  78. package/dist/runtime/components/ScrollArea.vue +32 -32
  79. package/dist/runtime/components/ScrollArea.vue.d.ts +2 -2
  80. package/dist/runtime/components/Select.vue +299 -148
  81. package/dist/runtime/components/Select.vue.d.ts +103 -123
  82. package/dist/runtime/components/Separator.vue +30 -30
  83. package/dist/runtime/components/Separator.vue.d.ts +2 -2
  84. package/dist/runtime/components/Skeleton.vue +11 -11
  85. package/dist/runtime/components/Skeleton.vue.d.ts +2 -2
  86. package/dist/runtime/components/Slider.vue +25 -25
  87. package/dist/runtime/components/Slider.vue.d.ts +11 -7
  88. package/dist/runtime/components/Stepper.vue +116 -0
  89. package/dist/runtime/components/Stepper.vue.d.ts +83 -0
  90. package/dist/runtime/components/Switch.vue +30 -30
  91. package/dist/runtime/components/Switch.vue.d.ts +4 -3
  92. package/dist/runtime/components/Table.vue +188 -166
  93. package/dist/runtime/components/Table.vue.d.ts +27 -22
  94. package/dist/runtime/components/Tabs.vue +74 -74
  95. package/dist/runtime/components/Tabs.vue.d.ts +12 -8
  96. package/dist/runtime/components/Textarea.vue +47 -47
  97. package/dist/runtime/components/Textarea.vue.d.ts +16 -11
  98. package/dist/runtime/components/Timeline.vue +102 -0
  99. package/dist/runtime/components/Timeline.vue.d.ts +78 -0
  100. package/dist/runtime/components/Toast.vue +93 -93
  101. package/dist/runtime/components/Toast.vue.d.ts +5 -5
  102. package/dist/runtime/components/ToastProvider.vue +29 -29
  103. package/dist/runtime/components/ToastProvider.vue.d.ts +3 -3
  104. package/dist/runtime/components/Tooltip.vue +24 -25
  105. package/dist/runtime/components/Tooltip.vue.d.ts +2 -2
  106. package/dist/runtime/components/Tree.vue +241 -0
  107. package/dist/runtime/components/Tree.vue.d.ts +121 -0
  108. package/dist/runtime/composables/defineShortcuts.d.ts +1 -0
  109. package/dist/runtime/composables/defineShortcuts.js +44 -8
  110. package/dist/runtime/composables/useLocale.d.ts +12 -0
  111. package/dist/runtime/locale/en.d.ts +6 -0
  112. package/dist/runtime/locale/en.js +6 -0
  113. package/dist/runtime/locale/zh_tw.d.ts +6 -0
  114. package/dist/runtime/locale/zh_tw.js +6 -0
  115. package/dist/runtime/types/html.d.ts +8 -0
  116. package/dist/runtime/types/html.js +0 -0
  117. package/dist/runtime/types/index.d.ts +7 -0
  118. package/dist/runtime/types/index.js +7 -0
  119. package/dist/runtime/types/input.d.ts +5 -5
  120. package/dist/runtime/types/locale.d.ts +6 -0
  121. package/dist/runtime/types/unocss.d.ts +4 -4
  122. package/dist/runtime/types/utils.d.ts +9 -6
  123. package/dist/runtime/utils/index.d.ts +3 -3
  124. package/dist/runtime/utils/link.d.ts +2 -1
  125. package/dist/runtime/utils/link.js +40 -29
  126. package/dist/runtime/vue/components/Icon.vue +2 -2
  127. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  128. package/dist/runtime/vue/components/Link.vue +7 -12
  129. package/dist/runtime/vue/components/Link.vue.d.ts +11 -40
  130. package/dist/setup.d.mts +1 -1
  131. package/dist/shared/{ui.CzIlLITK.mjs → ui.9kQouwss.mjs} +5 -3
  132. package/dist/shared/{ui.DpbffTXs.d.mts → ui.D8Bg1HWt.d.mts} +2 -0
  133. package/dist/shared/{ui.DSyJHSTk.mjs → ui.DpkP12cX.mjs} +784 -84
  134. package/dist/unocss.mjs +1 -1
  135. package/dist/unplugin.d.mts +1 -1
  136. package/dist/unplugin.mjs +2 -2
  137. package/dist/vite.d.mts +1 -1
  138. package/dist/vite.mjs +2 -2
  139. package/package.json +29 -29
  140. package/vue-plugin.d.ts +5 -5
@@ -0,0 +1,156 @@
1
+ <script>
2
+ import theme from "#build/ui/input-tags";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { reactivePick } from "@vueuse/core";
7
+ import { TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText, TagsInputRoot, useForwardPropsEmits } from "reka-ui";
8
+ import { computed, onMounted, shallowRef, toRaw, toRef } from "vue";
9
+ import { useAppConfig } from "#imports";
10
+ import { useComponentIcons } from "../composables/useComponentIcons";
11
+ import { useFieldGroup } from "../composables/useFieldGroup";
12
+ import { useFormField } from "../composables/useFormField";
13
+ import { cv, merge } from "../utils/style";
14
+ import Avatar from "./Avatar.vue";
15
+ import Icon from "./Icon.vue";
16
+ defineOptions({ inheritAttrs: false });
17
+ const props = defineProps({
18
+ as: { type: null, required: false },
19
+ placeholder: { type: String, required: false },
20
+ maxLength: { type: Number, required: false },
21
+ color: { type: null, required: false },
22
+ variant: { type: null, required: false },
23
+ size: { type: null, required: false },
24
+ autofocus: { type: Boolean, required: false },
25
+ autofocusDelay: { type: Number, required: false, default: 0 },
26
+ deleteIcon: { type: [String, Object], required: false },
27
+ highlight: { type: Boolean, required: false },
28
+ ui: { type: null, required: false },
29
+ class: { type: [Object, String, Number, Boolean, null, Array], required: false, skipCheck: true },
30
+ modelValue: { type: [Array, null], required: false },
31
+ defaultValue: { type: Array, required: false },
32
+ addOnPaste: { type: Boolean, required: false },
33
+ addOnTab: { type: Boolean, required: false },
34
+ addOnBlur: { type: Boolean, required: false },
35
+ duplicate: { type: Boolean, required: false },
36
+ disabled: { type: Boolean, required: false },
37
+ delimiter: { type: null, required: false },
38
+ max: { type: Number, required: false },
39
+ id: { type: String, required: false },
40
+ convertValue: { type: Function, required: false },
41
+ displayValue: { type: Function, required: false },
42
+ name: { type: String, required: false },
43
+ required: { type: Boolean, required: false },
44
+ icon: { type: [String, Object], required: false },
45
+ avatar: { type: Object, required: false },
46
+ leading: { type: Boolean, required: false },
47
+ leadingIcon: { type: [String, Object], required: false },
48
+ trailing: { type: Boolean, required: false },
49
+ trailingIcon: { type: [String, Object], required: false },
50
+ loading: { type: Boolean, required: false },
51
+ loadingIcon: { type: [String, Object], required: false }
52
+ });
53
+ const emit = defineEmits(["change", "blur", "focus", "update:modelValue", "invalid", "addTag", "removeTag"]);
54
+ const slots = defineSlots();
55
+ const rootProps = useForwardPropsEmits(reactivePick(props, "as", "addOnPaste", "addOnTab", "addOnBlur", "duplicate", "delimiter", "max", "convertValue", "displayValue", "required"), emit);
56
+ const { id, name, size: formFieldSize, color, highlight, disabled, ariaAttrs, emitFormBlur, emitFormInput, emitFormChange, emitFormFocus } = useFormField(props);
57
+ const { orientation, size: fieldGroupSize } = useFieldGroup(props);
58
+ const { isLeading, leadingIconName, isTrailing, trailingIconName } = useComponentIcons(props);
59
+ const appConfig = useAppConfig();
60
+ const ui = computed(() => {
61
+ const styler = cv(merge(theme, appConfig.ui.inputTags));
62
+ return styler({
63
+ ...props,
64
+ type: void 0,
65
+ color: color.value,
66
+ size: fieldGroupSize.value || formFieldSize.value,
67
+ highlight: highlight.value,
68
+ leading: isLeading.value || !!props.avatar || !!slots.leading,
69
+ trailing: isTrailing.value || !!slots.trailing,
70
+ fieldGroup: orientation.value
71
+ });
72
+ });
73
+ const inputRef = shallowRef(null);
74
+ function onUpdate(value) {
75
+ if (toRaw(props.modelValue) === value)
76
+ return;
77
+ const event = new Event("change", { target: { value } });
78
+ emit("change", event);
79
+ emitFormChange();
80
+ emitFormInput();
81
+ }
82
+ function onBlur(event) {
83
+ emit("blur", event);
84
+ emitFormBlur();
85
+ }
86
+ function onFocus(event) {
87
+ emit("focus", event);
88
+ emitFormFocus();
89
+ }
90
+ function autoFocus() {
91
+ if (props.autofocus)
92
+ inputRef.value?.$el?.focus();
93
+ }
94
+ onMounted(() => {
95
+ setTimeout(() => autoFocus(), props.autofocusDelay);
96
+ });
97
+ defineExpose({
98
+ inputRef: toRef(() => inputRef.value?.$el)
99
+ });
100
+ </script>
101
+
102
+ <template>
103
+ <TagsInputRoot
104
+ v-slot="{ modelValue: tags }"
105
+ :model-value="props.modelValue"
106
+ :default-value="props.defaultValue"
107
+ :class="ui.root({ class: [ui.base({ class: props.ui?.base }), props.ui?.root, props.class] })"
108
+ v-bind="{ ...rootProps, id, name, disabled }"
109
+ data-part="root"
110
+ @update:model-value="onUpdate"
111
+ >
112
+ <TagsInputItem
113
+ v-for="(item, index) in tags"
114
+ :key="index"
115
+ :value="item"
116
+ :class="ui.item({ class: props.ui?.item })"
117
+ data-part="item"
118
+ >
119
+ <TagsInputItemText :class="ui.itemText({ class: props.ui?.itemText })" data-part="itemText">
120
+ <slot name="item-text" :item="item" :index="index" :ui="ui"></slot>
121
+ </TagsInputItemText>
122
+
123
+ <TagsInputItemDelete :disabled="disabled" :class="ui.itemDelete({ class: props.ui?.itemDelete })" data-part="itemDelete">
124
+ <slot name="item-delete" :item="item" :index="index" :ui="ui">
125
+ <Icon :name="props.deleteIcon || appConfig.ui.icons.close" :class="ui.itemDeleteIcon({ class: props.ui?.itemDeleteIcon })" data-part="itemDeleteIcon" />
126
+ </slot>
127
+ </TagsInputItemDelete>
128
+ </TagsInputItem>
129
+
130
+ <TagsInputInput
131
+ ref="inputRef"
132
+ v-bind="{ ...$attrs, ...ariaAttrs }"
133
+ :placeholder="props.placeholder"
134
+ :max-length="props.maxLength"
135
+ :class="ui.input({ class: props.ui?.input })"
136
+ data-part="input"
137
+ @blur="onBlur"
138
+ @focus="onFocus"
139
+ />
140
+
141
+ <span v-if="isLeading || props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })" data-part="leading">
142
+ <slot name="leading" :ui="ui">
143
+ <Icon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" data-part="leadingIcon" />
144
+ <Avatar v-else-if="props.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="props.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" data-part="leadingAvatar" />
145
+ </slot>
146
+ </span>
147
+
148
+ <slot :ui="ui"></slot>
149
+
150
+ <span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })" data-part="trailing">
151
+ <slot name="trailing" :ui="ui">
152
+ <Icon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" data-part="trailingIcon" />
153
+ </slot>
154
+ </span>
155
+ </TagsInputRoot>
156
+ </template>
@@ -0,0 +1,90 @@
1
+ import type { VariantProps } from '@byyuurin/ui-kit';
2
+ import type { AcceptableInputValue, TagsInputRootEmits, TagsInputRootProps } from 'reka-ui';
3
+ import theme from '#build/ui/input-tags';
4
+ import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
+ import type { ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps } from '../types';
6
+ import type { InputHTMLAttributes } from '../types/html';
7
+ import type { StaticSlot } from '../types/utils';
8
+ type ThemeVariants = VariantProps<typeof theme>;
9
+ export type InputTagsItem = AcceptableInputValue;
10
+ export interface InputTagsProps<T extends InputTagsItem = InputTagsItem> extends ComponentBaseProps, Pick<TagsInputRootProps<T>, 'modelValue' | 'defaultValue' | 'addOnPaste' | 'addOnTab' | 'addOnBlur' | 'duplicate' | 'disabled' | 'delimiter' | 'max' | 'id' | 'convertValue' | 'displayValue' | 'name' | 'required'>, UseComponentIconsProps, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'max' | 'required' | 'name' | 'placeholder'> {
11
+ /**
12
+ * The element or component this component should render as.
13
+ * @default "div"
14
+ */
15
+ as?: TagsInputRootProps<T>['as'];
16
+ /** The placeholder text when the input is empty. */
17
+ placeholder?: string;
18
+ /** The maximum number of character allowed. */
19
+ maxLength?: number;
20
+ /** @default "primary" */
21
+ color?: ThemeVariants['color'];
22
+ /** @default "outline" */
23
+ variant?: ThemeVariants['variant'];
24
+ /** @default "md" */
25
+ size?: ThemeVariants['size'];
26
+ autofocus?: boolean;
27
+ autofocusDelay?: number;
28
+ /**
29
+ * The icon displayed to delete a tag.
30
+ * @default app.icons.close
31
+ */
32
+ deleteIcon?: IconProps['name'];
33
+ /** Highlight the ring color like a focus state. */
34
+ highlight?: boolean;
35
+ ui?: ComponentUIProps<typeof theme>;
36
+ }
37
+ export interface InputTagsEmits<T extends InputTagsItem> extends TagsInputRootEmits<T> {
38
+ change: [event: Event];
39
+ blur: [event: FocusEvent];
40
+ focus: [event: FocusEvent];
41
+ }
42
+ export interface InputTagsSlots<T extends InputTagsItem = InputTagsItem> {
43
+ 'leading': StaticSlot<{
44
+ ui: ComponentStyler<typeof theme>;
45
+ }>;
46
+ 'default': StaticSlot<{
47
+ ui: ComponentStyler<typeof theme>;
48
+ }>;
49
+ 'trailing': StaticSlot<{
50
+ ui: ComponentStyler<typeof theme>;
51
+ }>;
52
+ 'item-text': StaticSlot<{
53
+ item: T;
54
+ index: number;
55
+ ui: ComponentStyler<typeof theme>;
56
+ }>;
57
+ 'item-delete': StaticSlot<{
58
+ item: T;
59
+ index: number;
60
+ ui: ComponentStyler<typeof theme>;
61
+ }>;
62
+ }
63
+ declare const _default: typeof __VLS_export;
64
+ export default _default;
65
+ declare const __VLS_export: <T extends InputTagsItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
66
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<InputTagsProps<AcceptableInputValue> & {
67
+ onBlur?: ((event: FocusEvent) => any) | undefined;
68
+ onChange?: ((event: Event) => any) | undefined;
69
+ onFocus?: ((event: FocusEvent) => any) | undefined;
70
+ onInvalid?: ((payload: T) => any) | undefined;
71
+ "onUpdate:modelValue"?: ((payload: T[]) => any) | undefined;
72
+ onAddTag?: ((payload: T) => any) | undefined;
73
+ onRemoveTag?: ((payload: T) => any) | undefined;
74
+ }> & (typeof globalThis extends {
75
+ __VLS_PROPS_FALLBACK: infer P;
76
+ } ? P : {});
77
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
78
+ inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
79
+ }>) => void;
80
+ attrs: any;
81
+ slots: InputTagsSlots<T>;
82
+ emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "invalid", payload: T) => void) & ((evt: "update:modelValue", payload: T[]) => void) & ((evt: "addTag", payload: T) => void) & ((evt: "removeTag", payload: T) => void);
83
+ }>) => import("vue").VNode & {
84
+ __ctx?: Awaited<typeof __VLS_setup>;
85
+ };
86
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
87
+ [K in keyof T]: T[K];
88
+ } : {
89
+ [K in keyof T as K]: T[K];
90
+ }) & {};
@@ -26,7 +26,7 @@ const ui = computed(() => {
26
26
  </script>
27
27
 
28
28
  <template>
29
- <Primitive :as="props.as" :class="ui.base({ class: props.class })" data-part="base">
30
- <slot>{{ getKbdKey(props.value) }}</slot>
31
- </Primitive>
29
+ <Primitive :as="props.as" :class="ui.base({ class: props.class })" data-part="base">
30
+ <slot>{{ getKbdKey(props.value) }}</slot>
31
+ </Primitive>
32
32
  </template>
@@ -22,11 +22,11 @@ export interface KbdProps extends ComponentBaseProps {
22
22
  export interface KbdSlots {
23
23
  default: StaticSlot;
24
24
  }
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
25
27
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<KbdProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KbdProps> & Readonly<{}>, {
26
28
  as: import("reka-ui").AsTag | import("vue").Component;
27
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, KbdSlots>;
28
- declare const _default: typeof __VLS_export;
29
- export default _default;
30
30
  type __VLS_WithSlots<T, S> = T & {
31
31
  new (): {
32
32
  $slots: S;
@@ -29,13 +29,14 @@ const props = defineProps({
29
29
  to: { type: null, required: false },
30
30
  href: { type: null, required: false },
31
31
  external: { type: Boolean, required: false },
32
- target: { type: [String, Object], required: false },
33
- rel: { type: [String, Object], required: false },
32
+ target: { type: [String, Object, null], required: false },
33
+ rel: { type: [String, Object, null], required: false },
34
34
  noRel: { type: Boolean, required: false },
35
35
  prefetchedClass: { type: String, required: false },
36
36
  prefetch: { type: Boolean, required: false },
37
37
  prefetchOn: { type: [String, Object], required: false },
38
38
  noPrefetch: { type: Boolean, required: false },
39
+ trailingSlash: { type: String, required: false },
39
40
  activeClass: { type: String, required: false },
40
41
  exactActiveClass: { type: String, required: false },
41
42
  ariaCurrentValue: { type: String, required: false, default: "page" },
@@ -87,14 +88,14 @@ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
87
88
  </script>
88
89
 
89
90
  <template>
90
- <NuxtLink
91
- v-slot="{ href, navigate, route: linkRoute, rel, target, isExternal, isActive, isExactActive }"
92
- v-bind="nuxtLinkProps"
93
- :to="to"
94
- custom
95
- >
96
- <template v-if="custom">
97
- <slot
91
+ <NuxtLink
92
+ v-slot="{ href, navigate, route: linkRoute, rel, target, isExternal, isActive, isExactActive }"
93
+ v-bind="nuxtLinkProps"
94
+ :to="to"
95
+ custom
96
+ >
97
+ <template v-if="custom">
98
+ <slot
98
99
  v-bind="{
99
100
  ...$attrs,
100
101
  ...props.exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {},
@@ -105,13 +106,13 @@ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
105
106
  target,
106
107
  isExternal,
107
108
  active: isLinkActive({ route: linkRoute, isActive, isExactActive })
108
- }"
109
- >
110
- {{ props.label }}
111
- </slot>
112
- </template>
113
- <LinkBase
114
- v-else
109
+ }"
110
+ >
111
+ {{ props.label }}
112
+ </slot>
113
+ </template>
114
+ <LinkBase
115
+ v-else
115
116
  v-bind="{
116
117
  ...$attrs,
117
118
  ...props.exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {},
@@ -121,12 +122,12 @@ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
121
122
  rel,
122
123
  target,
123
124
  isExternal
124
- }"
125
- :class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
126
- >
127
- <slot :active="isLinkActive({ route: linkRoute, isActive, isExactActive })">
128
- {{ props.label }}
129
- </slot>
130
- </LinkBase>
131
- </NuxtLink>
125
+ }"
126
+ :class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
127
+ >
128
+ <slot :active="isLinkActive({ route: linkRoute, isActive, isExactActive })">
129
+ {{ props.label }}
130
+ </slot>
131
+ </LinkBase>
132
+ </NuxtLink>
132
133
  </template>
@@ -1,7 +1,7 @@
1
1
  import type { PrimitiveProps } from 'reka-ui';
2
- import type { ButtonHTMLAttributes } from 'vue';
3
2
  import type { RouteLocationRaw, RouterLinkProps } from 'vue-router';
4
3
  import type { ComponentBaseProps } from '../types';
4
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from '../types/html';
5
5
  import type { StaticSlot } from '../types/utils';
6
6
  interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
7
7
  /**
@@ -19,11 +19,11 @@ interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
19
19
  /**
20
20
  * Where to display the linked URL, as the name for a browsing context.
21
21
  */
22
- target?: '_blank' | '_parent' | '_self' | '_top' | (string & {});
22
+ target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
23
23
  /**
24
24
  * A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
25
25
  */
26
- rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {});
26
+ rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
27
27
  /**
28
28
  * If set to true, no rel attribute will be added to the link
29
29
  */
@@ -47,8 +47,13 @@ interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
47
47
  * Escape hatch to disable `prefetch` attribute.
48
48
  */
49
49
  noPrefetch?: boolean;
50
+ /**
51
+ * An option to either add or remove trailing slashes in the `href` for this specific link.
52
+ * Overrides the global `trailingSlash` option if provided.
53
+ */
54
+ trailingSlash?: 'append' | 'remove';
50
55
  }
51
- export interface LinkProps extends ComponentBaseProps, NuxtLinkProps {
56
+ export interface LinkProps extends ComponentBaseProps, Omit<NuxtLinkProps, 'custom'>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled'>, /** @vue-ignore */ Omit<AnchorHTMLAttributes, 'href' | 'target' | 'rel' | 'type'> {
52
57
  /**
53
58
  * The element or component this component should render as when not a link.
54
59
  * @default "button"
@@ -75,19 +80,24 @@ export interface LinkProps extends ComponentBaseProps, NuxtLinkProps {
75
80
  /** When `true`, only styles from `class`, `activeClass`, and `inactiveClass` will be applied. */
76
81
  raw?: boolean;
77
82
  }
83
+ /**
84
+ * Link-related props that can be omitted from ButtonProps when link functionality is not needed.
85
+ * Use this with `Omit<ButtonProps, LinkPropsKeys>` in components where buttons should not act as links.
86
+ */
87
+ export type LinkPropsKeys = 'to' | 'href' | 'target' | 'rel' | 'noRel' | 'external' | 'prefetch' | 'prefetchOn' | 'prefetchedClass' | 'noPrefetch' | 'trailingSlash' | 'replace' | 'ariaCurrentValue' | 'active' | 'activeClass' | 'exact' | 'exactQuery' | 'exactHash' | 'inactiveClass' | 'download' | 'ping' | 'referrerpolicy' | 'hreflang' | 'media';
78
88
  export interface LinkSlots {
79
89
  default: StaticSlot<{
80
90
  active: boolean;
81
91
  }>;
82
92
  }
93
+ declare const _default: typeof __VLS_export;
94
+ export default _default;
83
95
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
84
96
  active: boolean;
85
97
  type: "reset" | "submit" | "button";
86
98
  ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
87
99
  as: import("reka-ui").AsTag | import("vue").Component;
88
100
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
89
- declare const _default: typeof __VLS_export;
90
- export default _default;
91
101
  type __VLS_WithSlots<T, S> = T & {
92
102
  new (): {
93
103
  $slots: S;
@@ -42,7 +42,7 @@ function onClickWrapper(e) {
42
42
  </script>
43
43
 
44
44
  <template>
45
- <Primitive v-bind="linkProps" @click="onClickWrapper">
46
- <slot></slot>
47
- </Primitive>
45
+ <Primitive v-bind="linkProps" @click="onClickWrapper">
46
+ <slot></slot>
47
+ </Primitive>
48
48
  </template>
@@ -18,14 +18,14 @@ export interface LinkBaseProps {
18
18
  active?: boolean;
19
19
  isExternal?: boolean;
20
20
  }
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
21
23
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkBaseProps> & Readonly<{}>, {
22
24
  type: string;
23
25
  as: import("reka-ui").AsTag | import("vue").Component;
24
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
25
27
  default?: (props: {}) => any;
26
28
  }>;
27
- declare const _default: typeof __VLS_export;
28
- export default _default;
29
29
  type __VLS_WithSlots<T, S> = T & {
30
30
  new (): {
31
31
  $slots: S;
@@ -0,0 +1,38 @@
1
+ <script>
2
+ import theme from "#build/ui/marquee";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { Primitive } from "reka-ui";
7
+ import { computed } from "vue";
8
+ import { useAppConfig } from "#imports";
9
+ import { cv, merge } from "../utils/style";
10
+ const props = defineProps({
11
+ as: { type: null, required: false },
12
+ pauseOnHover: { type: Boolean, required: false },
13
+ reverse: { type: Boolean, required: false },
14
+ orientation: { type: null, required: false, default: "horizontal" },
15
+ repeat: { type: Number, required: false, default: 4 },
16
+ overlay: { type: Boolean, required: false, default: true },
17
+ ui: { type: null, required: false },
18
+ class: { type: [Object, String, Number, Boolean, null, Array], required: false, skipCheck: true }
19
+ });
20
+ defineSlots();
21
+ const appConfig = useAppConfig();
22
+ const ui = computed(() => {
23
+ const styler = cv(merge(theme, appConfig.ui.marquee));
24
+ return styler(props);
25
+ });
26
+ </script>
27
+
28
+ <template>
29
+ <Primitive :as="props.as" :data-orientation="props.orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
30
+ <div v-for="i in props.repeat" :key="i" :class="ui.content({ class: props.ui?.content })" data-part="content">
31
+ <slot></slot>
32
+ </div>
33
+ </Primitive>
34
+ </template>
35
+
36
+ <style>
37
+ @keyframes marquee{0%{transform:translateZ(0)}to{transform:translate3d(calc(-100% - var(--gap)),0,0)}}@keyframes marquee-rtl{0%{transform:translateZ(0)}to{transform:translate3d(calc(100% + var(--gap)),0,0)}}@keyframes marquee-vertical{0%{transform:translateZ(0)}to{transform:translate3d(0,calc(-100% - var(--gap)),0)}}@keyframes marquee-vertical-rtl{0%{transform:translate3d(0,calc(-100% - var(--gap)),0)}to{transform:translate3d(0,calc(-100%*var(--gap)),0)}}
38
+ </style>
@@ -0,0 +1,54 @@
1
+ import type { VariantProps } from '@byyuurin/ui-kit';
2
+ import type { PrimitiveProps } from 'reka-ui';
3
+ import theme from '#build/ui/marquee';
4
+ import type { ComponentBaseProps, ComponentStyler } from '../types';
5
+ import type { StaticSlot } from '../types/utils';
6
+ type ThemeVariants = VariantProps<typeof theme>;
7
+ export interface MarqueeProps extends ComponentBaseProps {
8
+ /**
9
+ * The element or component this component should render as.
10
+ * @default "div"
11
+ */
12
+ as?: PrimitiveProps['as'];
13
+ /**
14
+ * Pause the marquee on hover.
15
+ * @default false
16
+ */
17
+ pauseOnHover?: boolean;
18
+ /**
19
+ * Reverse the direction of the marquee.
20
+ * @default false
21
+ */
22
+ reverse?: boolean;
23
+ /**
24
+ * The orientation of the marquee.
25
+ * @default "horizontal"
26
+ */
27
+ orientation?: ThemeVariants['orientation'];
28
+ /**
29
+ * The number of times the marquee should repeat.
30
+ * @default 4
31
+ */
32
+ repeat?: number;
33
+ /**
34
+ * Display an overlay on the marquee.
35
+ * @default true
36
+ */
37
+ overlay?: boolean;
38
+ ui?: ComponentStyler<typeof theme>;
39
+ }
40
+ export interface MarqueeSlots {
41
+ default: StaticSlot;
42
+ }
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
45
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MarqueeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MarqueeProps> & Readonly<{}>, {
46
+ repeat: number;
47
+ orientation: "horizontal" | "vertical";
48
+ overlay: boolean;
49
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, MarqueeSlots>;
50
+ type __VLS_WithSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };