Skip to content

Commit

Permalink
fix: rename file to use mei ui for pro version
Browse files Browse the repository at this point in the history
  • Loading branch information
toantranmei committed Jun 13, 2024
1 parent bccf8f5 commit 3038ba8
Show file tree
Hide file tree
Showing 44 changed files with 91 additions and 91 deletions.
4 changes: 2 additions & 2 deletions src/runtime/components/data/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ import UIcon from '../elements/Icon.vue'
import UButton from '../elements/Button.vue'
import UProgress from '../elements/Progress.vue'
import UCheckbox from '../forms/Checkbox.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig, get } from '../../utils'
import type { Strategy, Button, ProgressColor, ProgressAnimation } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -207,7 +207,7 @@ export default defineComponent({
},
emits: ['update:modelValue', 'update:sort'],
setup (props, { emit, attrs: $attrs }) {
const { ui, attrs } = useUI('table', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('table', toRef(props, 'ui'), config, toRef(props, 'class'))
const columns = computed(() => props.columns ?? Object.keys(props.rows[0] ?? {}).map((key) => ({ key, label: upperFirst(key), sortable: false, class: undefined, sort: defaultSort })))
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Accordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import type { PropType } from 'vue'
import { Disclosure as HDisclosure, DisclosureButton as HDisclosureButton, DisclosurePanel as HDisclosurePanel, provideUseId } from '@headlessui/vue'
import UIcon from '../elements/Icon.vue'
import UButton from '../elements/Button.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig, omit } from '../../utils'
import type { AccordionItem, Strategy } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -128,7 +128,7 @@ export default defineComponent({
},
emits: ['open'],
setup (props, { emit }) {
const { ui, attrs } = useUI('accordion', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('accordion', toRef(props, 'ui'), config, toRef(props, 'class'))
const uiButton = computed<typeof configButton>(() => configButton)
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import UAvatar from '../elements/Avatar.vue'
import UButton from '../elements/Button.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import type { Avatar, Button, AlertColor, AlertVariant, AlertAction, Strategy } from '../../types'
import { mergeConfig } from '../../utils'
// @ts-expect-error
Expand Down Expand Up @@ -115,7 +115,7 @@ export default defineComponent({
},
emits: ['close'],
setup (props) {
const { ui, attrs } = useUI('alert', toRef(props, 'ui'), config)
const { ui, attrs } = useMeiUI('alert', toRef(props, 'ui'), config)
const alertClass = computed(() => {
const variant = ui.value.color?.[props.color as string]?.[props.variant as string] || ui.value.variant[props.variant]
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { defineComponent, ref, computed, toRef, watch } from 'vue'
import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig } from '../../utils'
import type { AvatarSize, AvatarChipColor, AvatarChipPosition, Strategy } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -99,7 +99,7 @@ export default defineComponent({
}
},
setup (props) {
const { ui, attrs } = useUI('avatar', toRef(props, 'ui'), config)
const { ui, attrs } = useMeiUI('avatar', toRef(props, 'ui'), config)
const url = computed(() => {
if (typeof props.src === 'boolean') {
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/AvatarGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { h, cloneVNode, computed, toRef, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import UAvatar from './Avatar.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig, getSlotsChildren } from '../../utils'
import type { AvatarSize, Strategy } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -37,7 +37,7 @@ export default defineComponent({
}
},
setup (props, { slots }) {
const { ui, attrs } = useUI('avatarGroup', toRef(props, 'ui'), avatarGroupConfig, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('avatarGroup', toRef(props, 'ui'), avatarGroupConfig, toRef(props, 'class'))

const children = computed(() => getSlotsChildren(slots))

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { computed, toRef, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig } from '../../utils'
import { useInjectButtonGroup } from '../../composables/useButtonGroup'
import type { BadgeColor, BadgeSize, BadgeVariant, Strategy } from '../../types'
Expand Down Expand Up @@ -59,7 +59,7 @@ export default defineComponent({
}
},
setup (props) {
const { ui, attrs } = useUI('badge', toRef(props, 'ui'), config)
const { ui, attrs } = useMeiUI('badge', toRef(props, 'ui'), config)
const { size, rounded } = useInjectButtonGroup({ ui, props })
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import ULink from '../elements/Link.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig, nuxtLinkProps, getNuxtLinkProps } from '../../utils'
import { useInjectButtonGroup } from '../../composables/useButtonGroup'
import type { ButtonColor, ButtonSize, ButtonVariant, Strategy } from '../../types'
Expand Down Expand Up @@ -130,7 +130,7 @@ export default defineComponent({
}
},
setup (props, { slots }) {
const { ui, attrs } = useUI('button', toRef(props, 'ui'), config)
const { ui, attrs } = useMeiUI('button', toRef(props, 'ui'), config)
const { size, rounded } = useInjectButtonGroup({ ui, props })
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/ButtonGroup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { h, computed, toRef, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig, getSlotsChildren } from '../../utils'
import { useProvideButtonGroup } from '../../composables/useButtonGroup'
import type { ButtonSize, Strategy } from '../../types'
Expand Down Expand Up @@ -40,7 +40,7 @@ export default defineComponent({
}
},
setup (props, { slots }) {
const { ui, attrs } = useUI('buttonGroup', toRef(props, 'ui'), buttonGroupConfig)
const { ui, attrs } = useMeiUI('buttonGroup', toRef(props, 'ui'), buttonGroupConfig)

const children = computed(() => getSlotsChildren(slots))

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { twMerge } from 'tailwind-merge'
import { mergeConfig } from '../../utils'
import UButton from '../elements/Button.vue'
import type { Strategy, Button } from '../../types'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { useCarouselScroll } from '../../composables/useCarouselScroll'
import { useScroll, useResizeObserver, useElementSize } from '@vueuse/core'
// @ts-expect-error
Expand Down Expand Up @@ -107,7 +107,7 @@ export default defineComponent({
}
},
setup (props, { expose }) {
const { ui, attrs } = useUI('carousel', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('carousel', toRef(props, 'ui'), config, toRef(props, 'class'))
const carouselRef = ref<HTMLElement>()
const itemWidth = ref(0)
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Chip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import { defineComponent, computed, toRef } from 'vue'
import type { PropType } from 'vue'
import { twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig } from '../../utils'
import type { ChipSize, ChipColor, ChipPosition, Strategy } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -69,7 +69,7 @@ export default defineComponent({
}
},
setup (props) {
const { ui, attrs } = useUI('chip', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('chip', toRef(props, 'ui'), config, toRef(props, 'class'))
const chipClass = computed(() => {
return twJoin(
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import UAvatar from '../elements/Avatar.vue'
import UKbd from '../elements/Kbd.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { usePopper } from '../../composables/usePopper'
import { mergeConfig, getNuxtLinkProps } from '../../utils'
import type { DropdownItem, PopperOptions, Strategy } from '../../types'
Expand Down Expand Up @@ -127,7 +127,7 @@ export default defineComponent({
},
emits: ['update:open'],
setup (props, { emit }) {
const { ui, attrs } = useUI('dropdown', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('dropdown', toRef(props, 'ui'), config, toRef(props, 'class'))
const popper = computed<PopperOptions>(() => defu(props.mode === 'hover' ? { offsetDistance: 0 } : {}, props.popper, ui.value.popper as PopperOptions))
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Kbd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { toRef, defineComponent, computed } from 'vue'
import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig } from '../../utils'
import type { KbdSize, Strategy } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -41,7 +41,7 @@ export default defineComponent({
}
},
setup (props) {
const { ui, attrs } = useUI('kbd', toRef(props, 'ui'), config)
const { ui, attrs } = useMeiUI('kbd', toRef(props, 'ui'), config)
const kbdClass = computed(() => {
return twMerge(twJoin(
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Meter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { computed, defineComponent, toRef } from 'vue'
import type { SlotsType, PropType } from 'vue'
import { twJoin } from 'tailwind-merge'
import UIcon from './Icon.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig } from '../../utils'
import type { Strategy, MeterColor, MeterSize } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -99,7 +99,7 @@ export default defineComponent({
}
},
setup (props) {
const { ui, attrs } = useUI('meter', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('meter', toRef(props, 'ui'), config, toRef(props, 'class'))
function clampPercent (value: number, min: number, max: number): number {
if (min == max) {
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/components/elements/MeterGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ComputedRef, VNode, SlotsType, PropType } from 'vue'
import { twJoin } from 'tailwind-merge'
import UIcon from './Icon.vue'
import Meter from './Meter.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig, getSlotsChildren } from '../../utils'
import type { Strategy, MeterSize } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -56,8 +56,8 @@ export default defineComponent({
}
},
setup (props, { slots }) {
const { ui, attrs } = useUI('meterGroup', toRef(props, 'ui'), meterGroupConfig)
const { ui: uiMeter } = useUI('meter', undefined, meterConfig)
const { ui, attrs } = useMeiUI('meterGroup', toRef(props, 'ui'), meterGroupConfig)
const { ui: uiMeter } = useMeiUI('meter', undefined, meterConfig)

// If there is no children, throw an expressive error.
if (!slots.default) {
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Progress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { computed, defineComponent, toRef } from 'vue'
import type { PropType } from 'vue'
import { twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig } from '../../utils'
import type { Strategy, ProgressSize, ProgressAnimation, ProgressColor } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -81,7 +81,7 @@ export default defineComponent({
}
},
setup (props) {
const { ui, attrs } = useUI('progress', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('progress', toRef(props, 'ui'), config, toRef(props, 'class'))
const indicatorContainerClass = computed(() => {
return twJoin(
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/forms/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import { computed, toRef, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { useFormGroup } from '../../composables/useFormGroup'
import { mergeConfig } from '../../utils'
import type { Strategy } from '../../types'
Expand Down Expand Up @@ -104,7 +104,7 @@ export default defineComponent({
},
emits: ['update:modelValue', 'change'],
setup (props, { emit }) {
const { ui, attrs } = useUI('checkbox', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('checkbox', toRef(props, 'ui'), config, toRef(props, 'class'))
const { emitFormChange, color, name, inputId: _inputId } = useFormGroup(props)
const inputId = _inputId.value ?? useId()
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/forms/FormGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<script lang="ts">
import { computed, defineComponent, provide, inject, ref, toRef } from 'vue'
import type { Ref, PropType } from 'vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { mergeConfig } from '../../utils'
import type { FormError, InjectedFormGroupValue, FormGroupSize, Strategy } from '../../types'
// @ts-expect-error
Expand Down Expand Up @@ -104,7 +104,7 @@ export default defineComponent({
}
},
setup (props) {
const { ui, attrs } = useUI('formGroup', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('formGroup', toRef(props, 'ui'), config, toRef(props, 'class'))
const formErrors = inject<Ref<FormError[]> | null>('form-errors', null)
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/forms/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import { defu } from 'defu'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { useFormGroup } from '../../composables/useFormGroup'
import { mergeConfig, looseToNumber } from '../../utils'
import { useInjectButtonGroup } from '../../composables/useButtonGroup'
Expand Down Expand Up @@ -165,7 +165,7 @@ export default defineComponent({
},
emits: ['update:modelValue', 'blur', 'change'],
setup (props, { emit, slots }) {
const { ui, attrs } = useUI('input', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('input', toRef(props, 'ui'), config, toRef(props, 'class'))
const { size: sizeButtonGroup, rounded } = useInjectButtonGroup({ ui, props })
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/components/forms/InputMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import { defu } from 'defu'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import UAvatar from '../elements/Avatar.vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { usePopper } from '../../composables/usePopper'
import { useFormGroup } from '../../composables/useFormGroup'
import { get, mergeConfig } from '../../utils'
Expand Down Expand Up @@ -280,8 +280,8 @@ export default defineComponent({
},
emits: ['update:modelValue', 'update:query', 'open', 'close', 'change'],
setup (props, { emit, slots }) {
const { ui, attrs } = useUI('input', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui: uiMenu } = useUI('inputMenu', toRef(props, 'uiMenu'), configMenu)
const { ui, attrs } = useMeiUI('input', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui: uiMenu } = useMeiUI('inputMenu', toRef(props, 'uiMenu'), configMenu)
const popper = computed<PopperOptions>(() => defu({}, props.popper, uiMenu.value.popper as PopperOptions))
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/forms/Radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import { computed, defineComponent, inject, toRef } from 'vue'
import type { PropType } from 'vue'
import { twMerge, twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { useFormGroup } from '../../composables/useFormGroup'
import { mergeConfig } from '../../utils'
import type { Strategy } from '../../types'
Expand Down Expand Up @@ -99,7 +99,7 @@ export default defineComponent({
},
emits: ['update:modelValue', 'change'],
setup (props, { emit }) {
const { ui, attrs } = useUI('radio', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui, attrs } = useMeiUI('radio', toRef(props, 'ui'), config, toRef(props, 'class'))
const inputId = props.id ?? useId()
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/components/forms/RadioGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import URadio from './Radio.vue'
import { computed, defineComponent, provide, toRef } from 'vue'
import type { PropType } from 'vue'
import { useUI } from '../../composables/useUI'
import { useMeiUI } from '../../composables/useMeiUI'
import { useFormGroup } from '../../composables/useFormGroup'
import { mergeConfig, get } from '../../utils'
import type { Strategy } from '../../types'
Expand Down Expand Up @@ -97,8 +97,8 @@ export default defineComponent({
},
emits: ['update:modelValue', 'change'],
setup (props, { emit }) {
const { ui, attrs } = useUI('radioGroup', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui: uiRadio } = useUI('radio', toRef(props, 'uiRadio'), configRadio)
const { ui, attrs } = useMeiUI('radioGroup', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui: uiRadio } = useMeiUI('radio', toRef(props, 'uiRadio'), configRadio)
const { emitFormChange, color, name } = useFormGroup(props, config)
provide('radio-group', { color, name })
Expand Down
Loading

0 comments on commit 3038ba8

Please sign in to comment.